From 4a11840fd2a54caae4f6d9df2660818506e1732d Mon Sep 17 00:00:00 2001 From: Malik Date: Wed, 13 Nov 2024 13:16:04 -0700 Subject: [PATCH] Revert "Merge branch 'sampleDS' into main" will be merged lated This reverts commit 4a390f073f2cfbc324fa53df5e3319de4f7de912, reversing changes made to c327befb1eedcb74d0fcf4ca86e6282d3436cf94. --- .../.vim/.netrwhist | 3 - .../0.orig/CO2.gas | 47 -- .../0.orig/CO2.liquid | 42 - .../0.orig/H2.gas | 47 -- .../0.orig/H2.liquid | 42 - .../0.orig/N2.gas | 47 -- .../0.orig/T.gas | 44 -- .../0.orig/T.liquid | 43 - .../0.orig/U.gas | 47 -- .../0.orig/U.liquid | 46 -- .../0.orig/Ydefault.gas | 42 - .../0.orig/Ydefault.liquid | 42 - .../0.orig/alpha.gas | 43 - .../0.orig/alpha.liquid | 40 - .../0.orig/alphat.gas | 46 -- .../0.orig/alphat.liquid | 44 -- .../0.orig/epsilon.gas | 48 -- .../0.orig/epsilon.liquid | 43 - .../0.orig/f.gas | 41 - .../0.orig/k.gas | 43 - .../0.orig/k.liquid | 44 -- .../0.orig/nut.gas | 48 -- .../0.orig/nut.liquid | 43 - .../0.orig/p | 39 - .../0.orig/p_rgh | 43 - .../Allclean | 18 - .../computeQOI.sh | 13 - .../constant/dynamicMix_util.H | 37 - .../constant/fvModels | 128 --- .../constant/g | 21 - .../constant/globalVars | 83 -- .../constant/globalVars_temp | 83 -- .../constant/momentumTransport.gas | 26 - .../constant/momentumTransport.liquid | 27 - .../constant/phaseProperties | 295 ------- .../constant/phaseProperties_constantd | 261 ------ .../constant/phaseProperties_pbe | 295 ------- .../constant/thermophysicalProperties.gas | 142 ---- .../constant/thermophysicalProperties.liquid | 108 --- .../get_qoi.py | 183 ----- .../presteps.sh | 71 -- .../read_history.py | 239 ------ .../run.sh | 5 - .../script | 14 - .../script_post | 10 - .../system/blockMeshDict | 746 ------------------ .../system/controlDict | 67 -- .../system/decomposeParDict | 30 - .../system/fvConstraints | 56 -- .../system/fvSchemes | 70 -- .../system/fvSolution | 120 --- .../system/inlets_outlets.json | 28 - .../system/mesh.json | 26 - .../system/mixers.json | 29 - .../system/setFieldsDict | 37 - .../writeGlobalVars.py | 47 -- .../.vim/.netrwhist | 3 - .../0.orig/CO2.gas | 47 -- .../0.orig/CO2.liquid | 42 - .../0.orig/H2.gas | 47 -- .../0.orig/H2.liquid | 42 - .../0.orig/N2.gas | 47 -- .../0.orig/T.gas | 44 -- .../0.orig/T.liquid | 43 - .../0.orig/U.gas | 47 -- .../0.orig/U.liquid | 46 -- .../0.orig/Ydefault.gas | 42 - .../0.orig/Ydefault.liquid | 42 - .../0.orig/alpha.gas | 43 - .../0.orig/alpha.liquid | 40 - .../0.orig/alphat.gas | 46 -- .../0.orig/alphat.liquid | 44 -- .../0.orig/epsilon.gas | 48 -- .../0.orig/epsilon.liquid | 43 - .../0.orig/f.gas | 41 - .../0.orig/k.gas | 43 - .../0.orig/k.liquid | 44 -- .../0.orig/nut.gas | 48 -- .../0.orig/nut.liquid | 43 - .../0.orig/p | 39 - .../0.orig/p_rgh | 43 - .../Allclean | 18 - .../computeQOI.sh | 13 - .../constant/dynamicMix_util.H | 37 - .../constant/fvModels | 128 --- .../constant/g | 21 - .../constant/globalVars | 83 -- .../constant/globalVars_temp | 83 -- .../constant/momentumTransport.gas | 26 - .../constant/momentumTransport.liquid | 27 - .../constant/phaseProperties | 295 ------- .../constant/phaseProperties_constantd | 261 ------ .../constant/phaseProperties_pbe | 295 ------- .../constant/thermophysicalProperties.gas | 142 ---- .../constant/thermophysicalProperties.liquid | 108 --- .../get_qoi.py | 183 ----- .../presteps.sh | 71 -- .../read_history.py | 239 ------ .../run.sh | 5 - .../script | 14 - .../script_post | 10 - .../system/blockMeshDict | 746 ------------------ .../system/controlDict | 67 -- .../system/decomposeParDict | 30 - .../system/fvConstraints | 56 -- .../system/fvSchemes | 70 -- .../system/fvSolution | 120 --- .../system/inlets_outlets.json | 28 - .../system/mesh.json | 26 - .../system/mixers.json | 29 - .../system/setFieldsDict | 37 - .../writeGlobalVars.py | 47 -- applications/GA_opt/ga2sim.py | 124 --- applications/GA_opt/read_qoi.py | 51 -- applications/GA_opt/runGA.sh | 14 - applications/Random_opt/randsim.py | 100 --- applications/Random_opt/read_qoi.py | 51 -- applications/Random_opt/runGA.sh | 14 - applications/convert_dim.py | 43 - applications/read_history.py | 243 ------ applications/write_dynMix_fvModels.py | 4 +- .../write_dynMix_fvModels_force_sign.py | 40 - bird/__init__.py | 2 - bird/meshing/block_rect_mesh.py | 4 +- .../loop_reactor_3_6L/.vim/.netrwhist | 3 - .../loop_reactor_3_6L/0.orig/CO2.gas | 47 -- .../loop_reactor_3_6L/0.orig/CO2.liquid | 42 - .../loop_reactor_3_6L/0.orig/H2.gas | 47 -- .../loop_reactor_3_6L/0.orig/H2.liquid | 42 - .../loop_reactor_3_6L/0.orig/N2.gas | 47 -- .../loop_reactor_3_6L/0.orig/T.gas | 44 -- .../loop_reactor_3_6L/0.orig/T.liquid | 43 - .../loop_reactor_3_6L/0.orig/U.gas | 47 -- .../loop_reactor_3_6L/0.orig/U.liquid | 46 -- .../loop_reactor_3_6L/0.orig/Ydefault.gas | 42 - .../loop_reactor_3_6L/0.orig/Ydefault.liquid | 42 - .../loop_reactor_3_6L/0.orig/alpha.gas | 43 - .../loop_reactor_3_6L/0.orig/alpha.liquid | 40 - .../loop_reactor_3_6L/0.orig/alphat.gas | 46 -- .../loop_reactor_3_6L/0.orig/alphat.liquid | 44 -- .../loop_reactor_3_6L/0.orig/epsilon.gas | 48 -- .../loop_reactor_3_6L/0.orig/epsilon.liquid | 43 - .../loop_reactor_3_6L/0.orig/f.gas | 41 - .../loop_reactor_3_6L/0.orig/k.gas | 43 - .../loop_reactor_3_6L/0.orig/k.liquid | 44 -- .../loop_reactor_3_6L/0.orig/nut.gas | 48 -- .../loop_reactor_3_6L/0.orig/nut.liquid | 43 - .../loop_reactor_3_6L/0.orig/p | 39 - .../loop_reactor_3_6L/0.orig/p_rgh | 43 - .../loop_reactor_3_6L/Allclean | 18 - .../loop_reactor_3_6L/computeQOI.sh | 13 - .../constant/dynamicMix_util.H | 37 - .../loop_reactor_3_6L/constant/fvModels | 128 --- .../loop_reactor_3_6L/constant/g | 21 - .../loop_reactor_3_6L/constant/globalVars | 83 -- .../constant/globalVars_temp | 83 -- .../constant/momentumTransport.gas | 26 - .../constant/momentumTransport.liquid | 27 - .../constant/phaseProperties | 295 ------- .../constant/phaseProperties_constantd | 261 ------ .../constant/phaseProperties_pbe | 295 ------- .../constant/thermophysicalProperties.gas | 142 ---- .../constant/thermophysicalProperties.liquid | 108 --- .../loop_reactor_3_6L/get_qoi.py | 183 ----- .../loop_reactor_3_6L/presteps.sh | 71 -- .../loop_reactor_3_6L/read_history.py | 239 ------ .../data_preprocess/loop_reactor_3_6L/run.sh | 5 - .../data_preprocess/loop_reactor_3_6L/script | 14 - .../loop_reactor_3_6L/script_post | 10 - .../loop_reactor_3_6L/system/blockMeshDict | 746 ------------------ .../loop_reactor_3_6L/system/controlDict | 67 -- .../loop_reactor_3_6L/system/decomposeParDict | 30 - .../loop_reactor_3_6L/system/fvConstraints | 56 -- .../loop_reactor_3_6L/system/fvSchemes | 70 -- .../loop_reactor_3_6L/system/fvSolution | 120 --- .../system/inlets_outlets.json | 28 - .../loop_reactor_3_6L/system/mesh.json | 26 - .../loop_reactor_3_6L/system/mixers.json | 29 - .../loop_reactor_3_6L/system/setFieldsDict | 37 - .../loop_reactor_3_6L/writeGlobalVars.py | 47 -- bird/preprocess/dynamic_mixer/io_fvModels.py | 159 +--- bird/preprocess/dynamic_mixer/mixer.py | 12 +- .../dynamic_mixer/mixing_fvModels.py | 12 +- bird/preprocess/json_gen/design_io.py | 85 -- bird/preprocess/json_gen/generate_designs.py | 344 -------- bird/preprocess/stl_patch/stl_bc.py | 4 +- bird/preprocess/stl_patch/stl_shapes.py | 6 +- bird/utilities/ofio.py | 5 +- bird/version.py | 2 +- setup.py | 1 - tests/postprocess/test_cond_mean.py | 8 +- tests/preprocess/test_generate_case.py | 22 - 192 files changed, 28 insertions(+), 14438 deletions(-) delete mode 100644 OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch/.vim/.netrwhist delete mode 100644 OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch/0.orig/CO2.gas delete mode 100644 OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch/0.orig/CO2.liquid delete mode 100644 OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch/0.orig/H2.gas delete mode 100644 OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch/0.orig/H2.liquid delete mode 100644 OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch/0.orig/N2.gas delete mode 100644 OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch/0.orig/T.gas delete mode 100644 OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch/0.orig/T.liquid delete mode 100644 OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch/0.orig/U.gas delete mode 100644 OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch/0.orig/U.liquid delete mode 100644 OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch/0.orig/Ydefault.gas delete mode 100644 OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch/0.orig/Ydefault.liquid delete mode 100644 OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch/0.orig/alpha.gas delete mode 100644 OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch/0.orig/alpha.liquid delete mode 100644 OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch/0.orig/alphat.gas delete mode 100644 OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch/0.orig/alphat.liquid delete mode 100644 OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch/0.orig/epsilon.gas delete mode 100644 OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch/0.orig/epsilon.liquid delete mode 100644 OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch/0.orig/f.gas delete mode 100644 OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch/0.orig/k.gas delete mode 100644 OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch/0.orig/k.liquid delete mode 100644 OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch/0.orig/nut.gas delete mode 100644 OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch/0.orig/nut.liquid delete mode 100644 OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch/0.orig/p delete mode 100644 OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch/0.orig/p_rgh delete mode 100755 OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch/Allclean delete mode 100644 OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch/computeQOI.sh delete mode 100644 OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch/constant/dynamicMix_util.H delete mode 100644 OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch/constant/fvModels delete mode 100644 OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch/constant/g delete mode 100644 OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch/constant/globalVars delete mode 100644 OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch/constant/globalVars_temp delete mode 100644 OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch/constant/momentumTransport.gas delete mode 100644 OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch/constant/momentumTransport.liquid delete mode 100644 OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch/constant/phaseProperties delete mode 100644 OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch/constant/phaseProperties_constantd delete mode 100644 OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch/constant/phaseProperties_pbe delete mode 100644 OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch/constant/thermophysicalProperties.gas delete mode 100644 OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch/constant/thermophysicalProperties.liquid delete mode 100644 OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch/get_qoi.py delete mode 100644 OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch/presteps.sh delete mode 100644 OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch/read_history.py delete mode 100644 OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch/run.sh delete mode 100755 OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch/script delete mode 100755 OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch/script_post delete mode 100644 OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch/system/blockMeshDict delete mode 100644 OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch/system/controlDict delete mode 100755 OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch/system/decomposeParDict delete mode 100644 OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch/system/fvConstraints delete mode 100644 OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch/system/fvSchemes delete mode 100644 OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch/system/fvSolution delete mode 100644 OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch/system/inlets_outlets.json delete mode 100644 OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch/system/mesh.json delete mode 100644 OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch/system/mixers.json delete mode 100644 OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch/system/setFieldsDict delete mode 100644 OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch/writeGlobalVars.py delete mode 100644 OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch_scaleup/.vim/.netrwhist delete mode 100644 OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch_scaleup/0.orig/CO2.gas delete mode 100644 OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch_scaleup/0.orig/CO2.liquid delete mode 100644 OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch_scaleup/0.orig/H2.gas delete mode 100644 OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch_scaleup/0.orig/H2.liquid delete mode 100644 OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch_scaleup/0.orig/N2.gas delete mode 100644 OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch_scaleup/0.orig/T.gas delete mode 100644 OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch_scaleup/0.orig/T.liquid delete mode 100644 OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch_scaleup/0.orig/U.gas delete mode 100644 OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch_scaleup/0.orig/U.liquid delete mode 100644 OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch_scaleup/0.orig/Ydefault.gas delete mode 100644 OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch_scaleup/0.orig/Ydefault.liquid delete mode 100644 OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch_scaleup/0.orig/alpha.gas delete mode 100644 OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch_scaleup/0.orig/alpha.liquid delete mode 100644 OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch_scaleup/0.orig/alphat.gas delete mode 100644 OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch_scaleup/0.orig/alphat.liquid delete mode 100644 OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch_scaleup/0.orig/epsilon.gas delete mode 100644 OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch_scaleup/0.orig/epsilon.liquid delete mode 100644 OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch_scaleup/0.orig/f.gas delete mode 100644 OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch_scaleup/0.orig/k.gas delete mode 100644 OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch_scaleup/0.orig/k.liquid delete mode 100644 OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch_scaleup/0.orig/nut.gas delete mode 100644 OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch_scaleup/0.orig/nut.liquid delete mode 100644 OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch_scaleup/0.orig/p delete mode 100644 OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch_scaleup/0.orig/p_rgh delete mode 100755 OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch_scaleup/Allclean delete mode 100644 OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch_scaleup/computeQOI.sh delete mode 100644 OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch_scaleup/constant/dynamicMix_util.H delete mode 100644 OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch_scaleup/constant/fvModels delete mode 100644 OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch_scaleup/constant/g delete mode 100644 OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch_scaleup/constant/globalVars delete mode 100644 OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch_scaleup/constant/globalVars_temp delete mode 100644 OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch_scaleup/constant/momentumTransport.gas delete mode 100644 OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch_scaleup/constant/momentumTransport.liquid delete mode 100644 OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch_scaleup/constant/phaseProperties delete mode 100644 OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch_scaleup/constant/phaseProperties_constantd delete mode 100644 OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch_scaleup/constant/phaseProperties_pbe delete mode 100644 OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch_scaleup/constant/thermophysicalProperties.gas delete mode 100644 OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch_scaleup/constant/thermophysicalProperties.liquid delete mode 100644 OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch_scaleup/get_qoi.py delete mode 100644 OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch_scaleup/presteps.sh delete mode 100644 OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch_scaleup/read_history.py delete mode 100644 OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch_scaleup/run.sh delete mode 100755 OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch_scaleup/script delete mode 100755 OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch_scaleup/script_post delete mode 100644 OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch_scaleup/system/blockMeshDict delete mode 100644 OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch_scaleup/system/controlDict delete mode 100755 OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch_scaleup/system/decomposeParDict delete mode 100644 OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch_scaleup/system/fvConstraints delete mode 100644 OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch_scaleup/system/fvSchemes delete mode 100644 OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch_scaleup/system/fvSolution delete mode 100644 OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch_scaleup/system/inlets_outlets.json delete mode 100644 OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch_scaleup/system/mesh.json delete mode 100644 OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch_scaleup/system/mixers.json delete mode 100644 OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch_scaleup/system/setFieldsDict delete mode 100644 OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch_scaleup/writeGlobalVars.py delete mode 100644 applications/GA_opt/ga2sim.py delete mode 100644 applications/GA_opt/read_qoi.py delete mode 100644 applications/GA_opt/runGA.sh delete mode 100644 applications/Random_opt/randsim.py delete mode 100644 applications/Random_opt/read_qoi.py delete mode 100644 applications/Random_opt/runGA.sh delete mode 100644 applications/convert_dim.py delete mode 100644 applications/read_history.py delete mode 100644 applications/write_dynMix_fvModels_force_sign.py delete mode 100644 bird/preprocess/data_preprocess/loop_reactor_3_6L/.vim/.netrwhist delete mode 100644 bird/preprocess/data_preprocess/loop_reactor_3_6L/0.orig/CO2.gas delete mode 100644 bird/preprocess/data_preprocess/loop_reactor_3_6L/0.orig/CO2.liquid delete mode 100644 bird/preprocess/data_preprocess/loop_reactor_3_6L/0.orig/H2.gas delete mode 100644 bird/preprocess/data_preprocess/loop_reactor_3_6L/0.orig/H2.liquid delete mode 100644 bird/preprocess/data_preprocess/loop_reactor_3_6L/0.orig/N2.gas delete mode 100644 bird/preprocess/data_preprocess/loop_reactor_3_6L/0.orig/T.gas delete mode 100644 bird/preprocess/data_preprocess/loop_reactor_3_6L/0.orig/T.liquid delete mode 100644 bird/preprocess/data_preprocess/loop_reactor_3_6L/0.orig/U.gas delete mode 100644 bird/preprocess/data_preprocess/loop_reactor_3_6L/0.orig/U.liquid delete mode 100644 bird/preprocess/data_preprocess/loop_reactor_3_6L/0.orig/Ydefault.gas delete mode 100644 bird/preprocess/data_preprocess/loop_reactor_3_6L/0.orig/Ydefault.liquid delete mode 100644 bird/preprocess/data_preprocess/loop_reactor_3_6L/0.orig/alpha.gas delete mode 100644 bird/preprocess/data_preprocess/loop_reactor_3_6L/0.orig/alpha.liquid delete mode 100644 bird/preprocess/data_preprocess/loop_reactor_3_6L/0.orig/alphat.gas delete mode 100644 bird/preprocess/data_preprocess/loop_reactor_3_6L/0.orig/alphat.liquid delete mode 100644 bird/preprocess/data_preprocess/loop_reactor_3_6L/0.orig/epsilon.gas delete mode 100644 bird/preprocess/data_preprocess/loop_reactor_3_6L/0.orig/epsilon.liquid delete mode 100644 bird/preprocess/data_preprocess/loop_reactor_3_6L/0.orig/f.gas delete mode 100644 bird/preprocess/data_preprocess/loop_reactor_3_6L/0.orig/k.gas delete mode 100644 bird/preprocess/data_preprocess/loop_reactor_3_6L/0.orig/k.liquid delete mode 100644 bird/preprocess/data_preprocess/loop_reactor_3_6L/0.orig/nut.gas delete mode 100644 bird/preprocess/data_preprocess/loop_reactor_3_6L/0.orig/nut.liquid delete mode 100644 bird/preprocess/data_preprocess/loop_reactor_3_6L/0.orig/p delete mode 100644 bird/preprocess/data_preprocess/loop_reactor_3_6L/0.orig/p_rgh delete mode 100755 bird/preprocess/data_preprocess/loop_reactor_3_6L/Allclean delete mode 100644 bird/preprocess/data_preprocess/loop_reactor_3_6L/computeQOI.sh delete mode 100644 bird/preprocess/data_preprocess/loop_reactor_3_6L/constant/dynamicMix_util.H delete mode 100644 bird/preprocess/data_preprocess/loop_reactor_3_6L/constant/fvModels delete mode 100644 bird/preprocess/data_preprocess/loop_reactor_3_6L/constant/g delete mode 100644 bird/preprocess/data_preprocess/loop_reactor_3_6L/constant/globalVars delete mode 100644 bird/preprocess/data_preprocess/loop_reactor_3_6L/constant/globalVars_temp delete mode 100644 bird/preprocess/data_preprocess/loop_reactor_3_6L/constant/momentumTransport.gas delete mode 100644 bird/preprocess/data_preprocess/loop_reactor_3_6L/constant/momentumTransport.liquid delete mode 100644 bird/preprocess/data_preprocess/loop_reactor_3_6L/constant/phaseProperties delete mode 100644 bird/preprocess/data_preprocess/loop_reactor_3_6L/constant/phaseProperties_constantd delete mode 100644 bird/preprocess/data_preprocess/loop_reactor_3_6L/constant/phaseProperties_pbe delete mode 100644 bird/preprocess/data_preprocess/loop_reactor_3_6L/constant/thermophysicalProperties.gas delete mode 100644 bird/preprocess/data_preprocess/loop_reactor_3_6L/constant/thermophysicalProperties.liquid delete mode 100644 bird/preprocess/data_preprocess/loop_reactor_3_6L/get_qoi.py delete mode 100644 bird/preprocess/data_preprocess/loop_reactor_3_6L/presteps.sh delete mode 100644 bird/preprocess/data_preprocess/loop_reactor_3_6L/read_history.py delete mode 100644 bird/preprocess/data_preprocess/loop_reactor_3_6L/run.sh delete mode 100755 bird/preprocess/data_preprocess/loop_reactor_3_6L/script delete mode 100755 bird/preprocess/data_preprocess/loop_reactor_3_6L/script_post delete mode 100644 bird/preprocess/data_preprocess/loop_reactor_3_6L/system/blockMeshDict delete mode 100644 bird/preprocess/data_preprocess/loop_reactor_3_6L/system/controlDict delete mode 100755 bird/preprocess/data_preprocess/loop_reactor_3_6L/system/decomposeParDict delete mode 100644 bird/preprocess/data_preprocess/loop_reactor_3_6L/system/fvConstraints delete mode 100644 bird/preprocess/data_preprocess/loop_reactor_3_6L/system/fvSchemes delete mode 100644 bird/preprocess/data_preprocess/loop_reactor_3_6L/system/fvSolution delete mode 100644 bird/preprocess/data_preprocess/loop_reactor_3_6L/system/inlets_outlets.json delete mode 100644 bird/preprocess/data_preprocess/loop_reactor_3_6L/system/mesh.json delete mode 100644 bird/preprocess/data_preprocess/loop_reactor_3_6L/system/mixers.json delete mode 100644 bird/preprocess/data_preprocess/loop_reactor_3_6L/system/setFieldsDict delete mode 100644 bird/preprocess/data_preprocess/loop_reactor_3_6L/writeGlobalVars.py delete mode 100644 bird/preprocess/json_gen/design_io.py delete mode 100644 bird/preprocess/json_gen/generate_designs.py delete mode 100644 tests/preprocess/test_generate_case.py diff --git a/OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch/.vim/.netrwhist b/OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch/.vim/.netrwhist deleted file mode 100644 index b9691c3b..00000000 --- a/OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch/.vim/.netrwhist +++ /dev/null @@ -1,3 +0,0 @@ -let g:netrw_dirhistmax =10 -let g:netrw_dirhistcnt =1 -let g:netrw_dirhist_1='/home/openfoam/postProcessing/patchIntegrate(patch=inlet,field=alpha.gas)/0' diff --git a/OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch/0.orig/CO2.gas b/OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch/0.orig/CO2.gas deleted file mode 100644 index e4165b1a..00000000 --- a/OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch/0.orig/CO2.gas +++ /dev/null @@ -1,47 +0,0 @@ -/*--------------------------------*- C++ -*----------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | Website: https://openfoam.org - \\ / A nd | Version: 9 - \\/ M anipulation | -\*---------------------------------------------------------------------------*/ -FoamFile -{ - format ascii; - class volScalarField; - object CO2.gas; -} -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -dimensions [0 0 0 0 0 0 0]; - -#include "${FOAM_CASE}/constant/globalVars" - -internalField uniform 0; - - -boundaryField -{ - #includeEtc "caseDicts/setConstraintTypes" - - inlet - { - type fixedValue; - value uniform $f_CO2; - } - - outlet - { - //type inletOutlet; - //phi phi.gas; - //inletValue $f_CO2; - //value $f_CO2; - type zeroGradient; - } - - defaultFaces - { - type zeroGradient; - } -} - -// ************************************************************************* // diff --git a/OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch/0.orig/CO2.liquid b/OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch/0.orig/CO2.liquid deleted file mode 100644 index 4b8ea6a0..00000000 --- a/OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch/0.orig/CO2.liquid +++ /dev/null @@ -1,42 +0,0 @@ -/*--------------------------------*- C++ -*----------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | Website: https://openfoam.org - \\ / A nd | Version: 9 - \\/ M anipulation | -\*---------------------------------------------------------------------------*/ -FoamFile -{ - format ascii; - class volScalarField; - object CO2.liquid; -} -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -dimensions [0 0 0 0 0 0 0]; - -internalField uniform 0.0; - -boundaryField -{ - #includeEtc "caseDicts/setConstraintTypes" - - inlet - { - type zeroGradient; - //type fixedValue; - //value uniform 0.0; - } - - outlet - { - type zeroGradient; - } - - defaultFaces - { - type zeroGradient; - } -} - -// ************************************************************************* // diff --git a/OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch/0.orig/H2.gas b/OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch/0.orig/H2.gas deleted file mode 100644 index 9f66b2d2..00000000 --- a/OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch/0.orig/H2.gas +++ /dev/null @@ -1,47 +0,0 @@ -/*--------------------------------*- C++ -*----------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | Website: https://openfoam.org - \\ / A nd | Version: 9 - \\/ M anipulation | -\*---------------------------------------------------------------------------*/ -FoamFile -{ - format ascii; - class volScalarField; - object H2.gas; -} -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -dimensions [0 0 0 0 0 0 0]; - -#include "${FOAM_CASE}/constant/globalVars" - -internalField uniform 0; - - -boundaryField -{ - #includeEtc "caseDicts/setConstraintTypes" - - inlet - { - type fixedValue; - value uniform $f_H2; - } - - outlet - { - //type inletOutlet; - //phi phi.gas; - //inletValue $f_H2; - //value $f_H2; - type zeroGradient; - } - - defaultFaces - { - type zeroGradient; - } -} - -// ************************************************************************* // diff --git a/OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch/0.orig/H2.liquid b/OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch/0.orig/H2.liquid deleted file mode 100644 index 65ae8d34..00000000 --- a/OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch/0.orig/H2.liquid +++ /dev/null @@ -1,42 +0,0 @@ -/*--------------------------------*- C++ -*----------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | Website: https://openfoam.org - \\ / A nd | Version: 9 - \\/ M anipulation | -\*---------------------------------------------------------------------------*/ -FoamFile -{ - format ascii; - class volScalarField; - object H2.liquid; -} -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -dimensions [0 0 0 0 0 0 0]; - -internalField uniform 0.0; - -boundaryField -{ - #includeEtc "caseDicts/setConstraintTypes" - - inlet - { - type zeroGradient; - //type fixedValue; - //value uniform 0.0; - } - - outlet - { - type zeroGradient; - } - - defaultFaces - { - type zeroGradient; - } -} - -// ************************************************************************* // diff --git a/OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch/0.orig/N2.gas b/OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch/0.orig/N2.gas deleted file mode 100644 index c1d7225f..00000000 --- a/OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch/0.orig/N2.gas +++ /dev/null @@ -1,47 +0,0 @@ -/*--------------------------------*- C++ -*----------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | Website: https://openfoam.org - \\ / A nd | Version: 9 - \\/ M anipulation | -\*---------------------------------------------------------------------------*/ -FoamFile -{ - format ascii; - class volScalarField; - object N2.gas; -} -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -dimensions [0 0 0 0 0 0 0]; - -#include "${FOAM_CASE}/constant/globalVars" - -internalField uniform 1; - - -boundaryField -{ - #includeEtc "caseDicts/setConstraintTypes" - - inlet - { - type fixedValue; - value uniform $f_N2; - } - - outlet - { - //type inletOutlet; - //phi phi.gas; - //inletValue $f_N2; - //value $f_N2; - type zeroGradient; - } - - defaultFaces - { - type zeroGradient; - } -} - -// ************************************************************************* // diff --git a/OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch/0.orig/T.gas b/OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch/0.orig/T.gas deleted file mode 100644 index bf0199a0..00000000 --- a/OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch/0.orig/T.gas +++ /dev/null @@ -1,44 +0,0 @@ -/*--------------------------------*- C++ -*----------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | Website: https://openfoam.org - \\ / A nd | Version: 9 - \\/ M anipulation | -\*---------------------------------------------------------------------------*/ -FoamFile -{ - format ascii; - class volScalarField; - object T.gas; -} -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -dimensions [0 0 0 1 0 0 0]; - -internalField uniform 300; - -boundaryField -{ - #includeEtc "caseDicts/setConstraintTypes" - - inlet - { - type fixedValue; - value $internalField; - } - - outlet - { - type inletOutlet; - phi phi.gas; - inletValue $internalField; - value $internalField; - } - - defaultFaces - { - type zeroGradient; - } -} - -// ************************************************************************* // diff --git a/OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch/0.orig/T.liquid b/OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch/0.orig/T.liquid deleted file mode 100644 index 7101ea31..00000000 --- a/OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch/0.orig/T.liquid +++ /dev/null @@ -1,43 +0,0 @@ -/*--------------------------------*- C++ -*----------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | Website: https://openfoam.org - \\ / A nd | Version: 9 - \\/ M anipulation | -\*---------------------------------------------------------------------------*/ -FoamFile -{ - format ascii; - class volScalarField; - object T.liquid; -} -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -dimensions [0 0 0 1 0 0 0]; - -internalField uniform 300; - -boundaryField -{ - #includeEtc "caseDicts/setConstraintTypes" - - outlet - { - type inletOutlet; - phi phi.liquid; - inletValue $internalField; - value $internalField; - } - inlet - { - type fixedValue; - value $internalField; - } - defaultFaces - { - type zeroGradient; - } - -} - -// ************************************************************************* // diff --git a/OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch/0.orig/U.gas b/OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch/0.orig/U.gas deleted file mode 100644 index e696566f..00000000 --- a/OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch/0.orig/U.gas +++ /dev/null @@ -1,47 +0,0 @@ -/*--------------------------------*- C++ -*----------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | Website: https://openfoam.org - \\ / A nd | Version: dev - \\/ M anipulation | -\*---------------------------------------------------------------------------*/ -FoamFile -{ - format ascii; - class volVectorField; - object U.gas; -} -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -dimensions [0 1 -1 0 0 0 0]; - -internalField uniform (0 0.0 0); - -#include "${FOAM_CASE}/constant/globalVars" - -boundaryField -{ - #includeEtc "caseDicts/setConstraintTypes" - - inlet - { - //type flowRateInletVelocity; - //massFlowRate $mflowRateGas; - //rho thermo:rho.gas; - //value $internalField; - type fixedValue; - value uniform (0 $uGasPhase 0); - } - outlet - { - type pressureInletOutletVelocity; - phi phi.gas; - value $internalField; - } - defaultFaces - { - type slip; - } -} - -// ************************************************************************* // diff --git a/OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch/0.orig/U.liquid b/OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch/0.orig/U.liquid deleted file mode 100644 index 1879e020..00000000 --- a/OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch/0.orig/U.liquid +++ /dev/null @@ -1,46 +0,0 @@ -/*--------------------------------*- C++ -*----------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | Website: https://openfoam.org - \\ / A nd | Version: dev - \\/ M anipulation | -\*---------------------------------------------------------------------------*/ -FoamFile -{ - format ascii; - class volVectorField; - object U.liquid; -} -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -dimensions [0 1 -1 0 0 0 0]; - -#include "${FOAM_CASE}/constant/globalVars" - -internalField uniform (0 0 0); - -boundaryField -{ - #includeEtc "caseDicts/setConstraintTypes" - - inlet - { - //type flowRateInletVelocity; - //massFlowRate $mflowRateLiq; - //rho thermo:rho.liquid; - //value $internalField; - type fixedValue; - value uniform (0 0 0); - } - outlet - { - type noSlip; - } - defaultFaces - { - type noSlip; - } - -} - -// ************************************************************************* // diff --git a/OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch/0.orig/Ydefault.gas b/OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch/0.orig/Ydefault.gas deleted file mode 100644 index fba2945d..00000000 --- a/OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch/0.orig/Ydefault.gas +++ /dev/null @@ -1,42 +0,0 @@ -/*--------------------------------*- C++ -*----------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | Website: https://openfoam.org - \\ / A nd | Version: 9 - \\/ M anipulation | -\*---------------------------------------------------------------------------*/ -FoamFile -{ - format ascii; - class volScalarField; - object Ydefault.gas; -} -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -dimensions [0 0 0 0 0 0 0]; - -internalField uniform 0.0; - -boundaryField -{ - #includeEtc "caseDicts/setConstraintTypes" - - inlet - { - type fixedValue; - value uniform 0.0; - } - - outlet - { - type zeroGradient; - } - - defaultFaces - { - type zeroGradient; - } -} - - -// ************************************************************************* // diff --git a/OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch/0.orig/Ydefault.liquid b/OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch/0.orig/Ydefault.liquid deleted file mode 100644 index a5108564..00000000 --- a/OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch/0.orig/Ydefault.liquid +++ /dev/null @@ -1,42 +0,0 @@ -/*--------------------------------*- C++ -*----------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | Website: https://openfoam.org - \\ / A nd | Version: 9 - \\/ M anipulation | -\*---------------------------------------------------------------------------*/ -FoamFile -{ - format ascii; - class volScalarField; - object Ydefault.liquid; -} -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -dimensions [0 0 0 0 0 0 0]; - -internalField uniform 1.0; - -boundaryField -{ - #includeEtc "caseDicts/setConstraintTypes" - - inlet - { - type fixedValue; - value uniform 1.0; - } - - outlet - { - type zeroGradient; - } - - defaultFaces - { - type zeroGradient; - } -} - - -// ************************************************************************* // diff --git a/OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch/0.orig/alpha.gas b/OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch/0.orig/alpha.gas deleted file mode 100644 index 1e303fbe..00000000 --- a/OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch/0.orig/alpha.gas +++ /dev/null @@ -1,43 +0,0 @@ -/*--------------------------------*- C++ -*----------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | Website: https://openfoam.org - \\ / A nd | Version: dev - \\/ M anipulation | -\*---------------------------------------------------------------------------*/ -FoamFile -{ - format ascii; - class volScalarField; - location "0"; - object alpha.gas; -} -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -dimensions [0 0 0 0 0 0 0]; - -#include "${FOAM_CASE}/constant/globalVars" - -internalField uniform $alphaGas; - -boundaryField -{ - inlet - { - type fixedValue; - value uniform $alphaGas; - } - outlet - { - type inletOutlet; - phi phi.gas; - inletValue uniform 1; - value uniform 1; - } - defaultFaces - { - type zeroGradient; - } -} - -// ************************************************************************* // diff --git a/OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch/0.orig/alpha.liquid b/OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch/0.orig/alpha.liquid deleted file mode 100644 index 5c92070b..00000000 --- a/OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch/0.orig/alpha.liquid +++ /dev/null @@ -1,40 +0,0 @@ -/*--------------------------------*- C++ -*----------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | Website: https://openfoam.org - \\ / A nd | Version: dev - \\/ M anipulation | -\*---------------------------------------------------------------------------*/ -FoamFile -{ - format ascii; - class volScalarField; - object alpha.liquid; -} -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -dimensions [0 0 0 0 0 0 0]; - -#include "${FOAM_CASE}/constant/globalVars" - -internalField uniform 1; - -boundaryField -{ - inlet - { - type fixedValue; - value uniform $alphaLiq; - } - outlet - { - type fixedValue; - value uniform 0; - } - defaultFaces - { - type zeroGradient; - } -} - -// ************************************************************************* // diff --git a/OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch/0.orig/alphat.gas b/OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch/0.orig/alphat.gas deleted file mode 100644 index b867958f..00000000 --- a/OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch/0.orig/alphat.gas +++ /dev/null @@ -1,46 +0,0 @@ -/*--------------------------------*- C++ -*----------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | Website: https://openfoam.org - \\ / A nd | Version: 9 - \\/ M anipulation | -\*---------------------------------------------------------------------------*/ -FoamFile -{ - format ascii; - class volScalarField; - object alphat.gas; -} -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -dimensions [1 -1 -1 0 0 0 0]; - -internalField uniform 0; - -boundaryField -{ - #includeEtc "caseDicts/setConstraintTypes" - - inlet - { - type calculated; - value $internalField; - } - - outlet - { - type calculated; - value $internalField; - } - - defaultFaces - { - type calculated; - value $internalField; - //type compressible::alphatWallFunction; - //Prt 0.85; - //value $internalField; - } -} - -// ************************************************************************* // diff --git a/OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch/0.orig/alphat.liquid b/OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch/0.orig/alphat.liquid deleted file mode 100644 index 2569c3ee..00000000 --- a/OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch/0.orig/alphat.liquid +++ /dev/null @@ -1,44 +0,0 @@ -/*--------------------------------*- C++ -*----------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | Website: https://openfoam.org - \\ / A nd | Version: 9 - \\/ M anipulation | -\*---------------------------------------------------------------------------*/ -FoamFile -{ - format ascii; - class volScalarField; - object alphat.liquid; -} -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -dimensions [1 -1 -1 0 0 0 0]; - -internalField uniform 0; - -boundaryField -{ - #includeEtc "caseDicts/setConstraintTypes" - - inlet - { - type calculated; - value $internalField; - } - - outlet - { - type calculated; - value $internalField; - } - - defaultFaces - { - type compressible::alphatWallFunction; - Prt 0.85; - value $internalField; - } -} - -// ************************************************************************* // diff --git a/OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch/0.orig/epsilon.gas b/OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch/0.orig/epsilon.gas deleted file mode 100644 index 707a1cda..00000000 --- a/OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch/0.orig/epsilon.gas +++ /dev/null @@ -1,48 +0,0 @@ -/*--------------------------------*- C++ -*----------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | Website: https://openfoam.org - \\ / A nd | Version: 9 - \\/ M anipulation | -\*---------------------------------------------------------------------------*/ -FoamFile -{ - format ascii; - class volScalarField; - object epsilon.gas; -} -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -dimensions [0 2 -3 0 0 0 0]; - -#include "${FOAM_CASE}/constant/globalVars" - -internalField uniform $eps_inlet_gas; - -boundaryField -{ - inlet - { - type fixedValue; - value uniform $eps_inlet_gas; - } - - outlet - { - type zeroGradient; - } - - defaultFaces - { - type zeroGradient; - //type epsilonWallFunction; - //value $internalField; - } - - // defaultFaces - // { - // type empty; - // } -} - -// ************************************************************************* // diff --git a/OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch/0.orig/epsilon.liquid b/OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch/0.orig/epsilon.liquid deleted file mode 100644 index 0a4236fd..00000000 --- a/OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch/0.orig/epsilon.liquid +++ /dev/null @@ -1,43 +0,0 @@ -/*--------------------------------*- C++ -*----------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | Website: https://openfoam.org - \\ / A nd | Version: 9 - \\/ M anipulation | -\*---------------------------------------------------------------------------*/ -FoamFile -{ - format ascii; - class volScalarField; - object epsilon.liquid; -} -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -dimensions [0 2 -3 0 0 0 0]; - -#include "${FOAM_CASE}/constant/globalVars" - -internalField uniform $eps_inlet_liq; - -boundaryField -{ - inlet - { - type fixedValue; - value uniform $eps_inlet_liq; - } - - outlet - { - type zeroGradient; - } - - defaultFaces - { - type epsilonWallFunction; - value $internalField; - } - -} - -// ************************************************************************* // diff --git a/OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch/0.orig/f.gas b/OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch/0.orig/f.gas deleted file mode 100644 index 76ee77a9..00000000 --- a/OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch/0.orig/f.gas +++ /dev/null @@ -1,41 +0,0 @@ -/*--------------------------------*- C++ -*----------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | Website: https://openfoam.org - \\ / A nd | Version: 9 - \\/ M anipulation | -\*---------------------------------------------------------------------------*/ -FoamFile -{ - format ascii; - class volScalarField; - object f.gas; -} -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -dimensions [0 0 0 0 0 0 0]; - -internalField uniform 1.0; - -boundaryField -{ - #includeEtc "caseDicts/setConstraintTypes" - - inlet - { - type fixedValue; - value uniform 1.0; //$internalField; // - } - - outlet - { - type zeroGradient; - } - - defaultFaces - { - type zeroGradient; - } -} - -// ************************************************************************* // diff --git a/OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch/0.orig/k.gas b/OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch/0.orig/k.gas deleted file mode 100644 index 4a3d44ca..00000000 --- a/OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch/0.orig/k.gas +++ /dev/null @@ -1,43 +0,0 @@ -/*--------------------------------*- C++ -*----------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | Website: https://openfoam.org - \\ / A nd | Version: 9 - \\/ M anipulation | -\*---------------------------------------------------------------------------*/ -FoamFile -{ - format ascii; - class volScalarField; - object k.gas; -} -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -dimensions [0 2 -2 0 0 0 0]; - -#include "${FOAM_CASE}/constant/globalVars" - -internalField uniform $k_inlet_gas; - -boundaryField -{ - #includeEtc "caseDicts/setConstraintTypes" - - inlet - { - type fixedValue; - value uniform $k_inlet_gas; - } - - outlet - { - type zeroGradient; - } - - defaultFaces - { - type zeroGradient; - } -} - -// ************************************************************************* // diff --git a/OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch/0.orig/k.liquid b/OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch/0.orig/k.liquid deleted file mode 100644 index cde8f6c1..00000000 --- a/OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch/0.orig/k.liquid +++ /dev/null @@ -1,44 +0,0 @@ -/*--------------------------------*- C++ -*----------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | Website: https://openfoam.org - \\ / A nd | Version: 9 - \\/ M anipulation | -\*---------------------------------------------------------------------------*/ -FoamFile -{ - format ascii; - class volScalarField; - object k.liquid; -} -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -dimensions [0 2 -2 0 0 0 0]; - -#include "${FOAM_CASE}/constant/globalVars" - -internalField uniform $k_inlet_liq; - -boundaryField -{ - #includeEtc "caseDicts/setConstraintTypes" - - inlet - { - type fixedValue; - value uniform $k_inlet_liq; - } - - outlet - { - type zeroGradient; - } - - defaultFaces - { - type kqRWallFunction; - value $internalField; - } -} - -// ************************************************************************* // diff --git a/OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch/0.orig/nut.gas b/OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch/0.orig/nut.gas deleted file mode 100644 index ba16dd4c..00000000 --- a/OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch/0.orig/nut.gas +++ /dev/null @@ -1,48 +0,0 @@ -/*--------------------------------*- C++ -*----------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | Website: https://openfoam.org - \\ / A nd | Version: 9 - \\/ M anipulation | -\*---------------------------------------------------------------------------*/ -FoamFile -{ - format ascii; - class volScalarField; - object nut.gas; -} -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -dimensions [0 2 -1 0 0 0 0]; - -internalField uniform 1e-8; - -boundaryField -{ - inlet - { - type calculated; - value $internalField; - } - - outlet - { - type calculated; - value $internalField; - } - - defaultFaces - { - //type nutkWallFunction; - //value $internalField; - type calculated; - value $internalField; - } - - // defaultFaces - // { - // type empty; - // } -} - -// ************************************************************************* // diff --git a/OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch/0.orig/nut.liquid b/OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch/0.orig/nut.liquid deleted file mode 100644 index 1442e07f..00000000 --- a/OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch/0.orig/nut.liquid +++ /dev/null @@ -1,43 +0,0 @@ -/*--------------------------------*- C++ -*----------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | Website: https://openfoam.org - \\ / A nd | Version: 9 - \\/ M anipulation | -\*---------------------------------------------------------------------------*/ -FoamFile -{ - format ascii; - class volScalarField; - object nut.liquid; -} -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -dimensions [0 2 -1 0 0 0 0]; - -internalField uniform 1e-4; - -boundaryField -{ - #includeEtc "caseDicts/setConstraintTypes" - - inlet - { - type calculated; - value $internalField; - } - - outlet - { - type calculated; - value $internalField; - } - - defaultFaces - { - type nutkWallFunction; - value $internalField; - } -} - -// ************************************************************************* // diff --git a/OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch/0.orig/p b/OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch/0.orig/p deleted file mode 100644 index b3a295fb..00000000 --- a/OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch/0.orig/p +++ /dev/null @@ -1,39 +0,0 @@ -/*--------------------------------*- C++ -*----------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | Website: https://openfoam.org - \\ / A nd | Version: dev - \\/ M anipulation | -\*---------------------------------------------------------------------------*/ -FoamFile -{ - format ascii; - class volScalarField; - object p; -} -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -dimensions [1 -1 -2 0 0 0 0]; - -internalField uniform 101325; - -boundaryField -{ - inlet - { - type calculated; - value $internalField; - } - outlet - { - type calculated; - value $internalField; - } - defaultFaces - { - type calculated; - value $internalField; - } -} - -// ************************************************************************* // diff --git a/OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch/0.orig/p_rgh b/OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch/0.orig/p_rgh deleted file mode 100644 index 88ee7d80..00000000 --- a/OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch/0.orig/p_rgh +++ /dev/null @@ -1,43 +0,0 @@ -/*--------------------------------*- C++ -*----------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | Website: https://openfoam.org - \\ / A nd | Version: dev - \\/ M anipulation | -\*---------------------------------------------------------------------------*/ -FoamFile -{ - format ascii; - class volScalarField; - object p_rgh; -} -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -dimensions [1 -1 -2 0 0 0 0]; - -internalField uniform 101325; - -boundaryField -{ - inlet - { - type fixedFluxPressure; - value $internalField; - } - outlet - { - type prghTotalPressure; - p0 $internalField; - U U.gas; - phi phi.gas; - rho thermo:rho.gas; - value $internalField; - } - defaultFaces - { - type fixedFluxPressure; - value $internalField; - } -} - -// ************************************************************************* // diff --git a/OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch/Allclean b/OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch/Allclean deleted file mode 100755 index f55e0ec9..00000000 --- a/OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch/Allclean +++ /dev/null @@ -1,18 +0,0 @@ -#!/bin/sh -cd ${0%/*} || exit 1 # Run from this directory - -# Source tutorial clean functions -. $WM_PROJECT_DIR/bin/tools/CleanFunctions - -# Remove surface, features and solution -#rm -rf constant/extendedFeatureEdgeMesh > /dev/null 2>&1 -#rm -f constant/triSurface/*.eMesh > /dev/null 2>&1 -#rm -rf constant/polyMesh > /dev/null 2>&1 -#rm -rf processor* > /dev/null 2>&1 -rm -rf 0 -cleanCase - -#rm *.obj -#rm *.stl - -#------------------------------------------------------------------------------ diff --git a/OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch/computeQOI.sh b/OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch/computeQOI.sh deleted file mode 100644 index 3756ed7f..00000000 --- a/OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch/computeQOI.sh +++ /dev/null @@ -1,13 +0,0 @@ -if [ ! -f qoi.txt ]; then - # Reconstruct if needed - source /projects/gas2fuels/ofoam_cray_mpich/OpenFOAM-dev/etc/bashrc - reconstructPar -newTimes - module load anaconda3/2023 - conda activate /projects/gas2fuels/conda_env/bird - python read_history.py -cr .. -cn local -df data - python get_qoi.py - conda deactivate -else - echo "WARNING: QOI already computed" -fi - diff --git a/OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch/constant/dynamicMix_util.H b/OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch/constant/dynamicMix_util.H deleted file mode 100644 index 8fa7daf7..00000000 --- a/OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch/constant/dynamicMix_util.H +++ /dev/null @@ -1,37 +0,0 @@ -#include - -double gradfunMix(double V1, double V2){ - return 3.0*V2*V2 + 2.0*V1*V2 - V1*V1; -} - -double funMix(double V1, double V2, double P, double rhoL, double A){ - return V2*V2*V2 + V1*V2*V2 - V2*V1*V1 - V1*V1*V1 - 4.0*P/(rhoL * A); -} - -double findV2(double P, double rhoL, double A, double V1) { - int newton_iter = 100; - double V2 = 2*V1; - double V2_old; - double V2_new; - if (std::abs(V1) < 1e-12) { - V2=std::pow((4.0*P/rhoL/A),0.333333); - V2_new = V2; - V2_old = V2; - } else { - for (int i=0; i("thermo:rho.liquid"); - const volScalarField& alphaL = - mesh().lookupObject("alpha.liquid"); - const volVectorField& UL = - mesh().lookupObject("U.liquid"); - double pi=3.141592654; - double source_pt_x=0.25; - double source_pt_y=0.025; - double source_pt_z=0.225; - double disk_rad=0.017499999999999998; - double disk_area=pi*disk_rad*disk_rad; - double power=2.5; - double smear_factor=3.0; - const scalar startTime = 1; - if (time.value() > startTime) - { - // Get V1 - double source_sign_factor = 1.0; - double V1 = 0; - double V2 = 0; - double rhoV; - double dist_tol = disk_rad*5; - - double dist_n; - double upV = 0; - double uprhoV = 0; - double upVvol = 0; - double downV = 0; - double downrhoV = 0; - double downVvol = 0; - double dist2; - forAll(C,i) - { - dist2 = (C[i].x()-source_pt_x)*(C[i].x()-source_pt_x); - dist2 += (C[i].y()-source_pt_y)*(C[i].y()-source_pt_y); - dist2 += (C[i].z()-source_pt_z)*(C[i].z()-source_pt_z); - - dist_n = (C[i].x()-source_pt_x); - - if (dist2 < dist_tol*dist_tol && dist_n < -dist_tol/2) { - upVvol += V[i] * alphaL[i]; - upV += V[i] * alphaL[i] * UL[i][0]; - uprhoV += V[i] * alphaL[i] * rhoL[i]; - } - if (dist2 < dist_tol*dist_tol && dist_n > dist_tol/2) { - downVvol += V[i] * alphaL[i]; - downV += V[i] * alphaL[i] * UL[i][0]; - downrhoV += V[i] * alphaL[i] * rhoL[i]; - } - } - - reduce(uprhoV, sumOp()); - reduce(downrhoV, sumOp()); - reduce(upV, sumOp()); - reduce(downV, sumOp()); - reduce(downVvol, sumOp()); - reduce(upVvol, sumOp()); - - downV /= downVvol; - upV /= upVvol; - downrhoV /= downVvol; - uprhoV /= upVvol; - - if (upV <= 0 && downV <= 0) { - source_sign_factor = -1.0; - V1 = std::abs(upV); - rhoV = uprhoV; - } else if (upV >= 0 && downV >= 0) { - source_sign_factor = 1.0; - V1 = std::abs(downV); - rhoV = downrhoV; - } else { - V1 = 0.0; - source_sign_factor = -1.0; - rhoV = uprhoV; - Foam::Info << "[BIRD:DYNMIX WARN] " << "upV = " << upV << " downV = " << downV << " for source at " << source_pt_x << ", " << source_pt_y << ", " << source_pt_z << endl; - } - Foam::Info << "[BIRD:DYNMIX INFO] V1 = " << V1 << endl; - - // Get V2 - V2 = findV2(power, rhoV, disk_area, V1); - - forAll(C,i) - { - double Thrust=0.5*rhoL[i]*(V2*V2 - V1*V1)*disk_area; - double dist2=(C[i].x()-source_pt_x)*(C[i].x()-source_pt_x); - dist2 += (C[i].y()-source_pt_y)*(C[i].y()-source_pt_y); - dist2 += (C[i].z()-source_pt_z)*(C[i].z()-source_pt_z); - double epsilon=pow(V[i],0.33333)*smear_factor; - double sourceterm=alphaL[i]*(Thrust/pow(pi,1.5)/pow(epsilon,3.0))* - exp(-dist2/(epsilon*epsilon)); - Usource[i][0] -= source_sign_factor*sourceterm*V[i]; - } - } - #}; -}; diff --git a/OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch/constant/g b/OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch/constant/g deleted file mode 100644 index 770a5619..00000000 --- a/OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch/constant/g +++ /dev/null @@ -1,21 +0,0 @@ -/*--------------------------------*- C++ -*----------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | Website: https://openfoam.org - \\ / A nd | Version: dev - \\/ M anipulation | -\*---------------------------------------------------------------------------*/ -FoamFile -{ - format ascii; - class uniformDimensionedVectorField; - location "constant"; - object g; -} -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -dimensions [0 1 -2 0 0 0 0]; -value (0 -9.81 0); - - -// ************************************************************************* // diff --git a/OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch/constant/globalVars b/OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch/constant/globalVars deleted file mode 100644 index 21436f69..00000000 --- a/OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch/constant/globalVars +++ /dev/null @@ -1,83 +0,0 @@ -T0 300; //initial T(K) which stays constant -VVM 1.6; -//****water Liquid properties************** -CpMixLiq 4181; -muMixLiq #calc "2.414e-5 * pow(10,247.8/($T0 - 140.0))"; //viscosity (Pa.s) of water as a function of T(K) -kThermLiq 0.62; // W/m-K -rho0MixLiq 1000; // kg/m^3 -sigmaLiq 0.07; //surface tension N/m -//Wilke-Chang params for diffusion coefficient of a given solute in water (solvent) -WC_psi 2.6; -WC_M 18; // kg/kmol -WC_V_O2 25.6e-3; // m3/kmol molar volume at normal boiling temperature (Treybal 1968) -WC_V_H2 14.3e-3; -WC_V_CO2 34e-3; -WC_V_CO 30.7e-3; -WC_V_N2 31.2e-3; -WC_V_CH4 35e-3; // V_b[cm3/mol]=0.285*V_critical^1.048 (Tyn and Calus; ESTIMATING LIQUID MOLAL VOLUME; Processing, Volume 21, Issue 4, Pages 16 - 17) -//****** diffusion coeff *********** -D_H2 #calc "1.173e-16 * pow($WC_psi * $WC_M,0.5) * $T0 / $muMixLiq / pow($WC_V_H2,0.6)"; -D_CO2 #calc "1.173e-16 * pow($WC_psi * $WC_M,0.5) * $T0 / $muMixLiq / pow($WC_V_CO2,0.6)"; -D_CO #calc "1.173e-16 * pow($WC_psi * $WC_M,0.5) * $T0 / $muMixLiq / pow($WC_V_CO,0.6)"; -D_CH4 #calc "1.173e-16 * pow($WC_psi * $WC_M,0.5) * $T0 / $muMixLiq / pow($WC_V_CH4,0.6)"; -D_N2 #calc "1.173e-16 * pow($WC_psi * $WC_M,0.5) * $T0 / $muMixLiq / pow($WC_V_N2,0.6)"; -//****** Henry coeff *************** -H_O2_298 0.032; -DH_O2 1700; -H_CO2_298 0.83; -DH_CO2 2400; -H_CO_298 0.023; -DH_CO 1300; -H_H2_298 0.019; -DH_H2 500; -H_CH4_298 0.032; -DH_CH4 1900; -H_N2_298 0.015; -DH_N2 1300; -He_H2 #calc "$H_H2_298 * exp($DH_H2 *(1. / $T0 - 1./298.15))"; -He_CO #calc "$H_CO_298 * exp($DH_CO *(1. / $T0 - 1./298.15))"; -He_CO2 #calc "$H_CO2_298 * exp($DH_CO2 *(1. / $T0 - 1./298.15))"; -He_CH4 #calc "$H_CH4_298 * exp($DH_CH4 *(1. / $T0 - 1./298.15))"; -He_N2 #calc "$H_N2_298 * exp($DH_N2 *(1. / $T0 - 1./298.15))"; -//*******inlet gas frac************* -f_H2 0.1; -f_CO2 0.9; -f_N2 0.0; -//*******inlet gas frac************* -inletA 0.0039; -liqVol 0.003625; -alphaGas 1; -alphaLiq 0; -uGasPhase #calc "$liqVol * $VVM / (60 * $inletA * $alphaGas)"; -//********************************* -LeLiqH2 #calc "$kThermLiq / $rho0MixLiq / $D_H2 / $CpMixLiq"; -LeLiqCO #calc "$kThermLiq / $rho0MixLiq / $D_CO / $CpMixLiq"; -LeLiqCO2 #calc "$kThermLiq / $rho0MixLiq / $D_CO2 / $CpMixLiq"; // = 74 -LeLiqCH4 #calc "$kThermLiq / $rho0MixLiq / $D_CH4 / $CpMixLiq"; -LeLiqN2 #calc "$kThermLiq / $rho0MixLiq / $D_N2 / $CpMixLiq"; -LeLiqMix #calc "$f_CO2*$LeLiqCO2+$f_H2*$LeLiqH2"; -PrMixLiq #calc "$CpMixLiq * $muMixLiq / $kThermLiq"; -//********************************* -kH2 #calc "$D_H2*$rho0MixLiq*$CpMixLiq*$LeLiqMix"; -PrH2 #calc "$muMixLiq*$CpMixLiq / $kH2"; - -kCO #calc "$D_CO*$rho0MixLiq*$CpMixLiq*$LeLiqMix"; -PrCO #calc "$muMixLiq*$CpMixLiq / $kCO"; - -kCO2 #calc "$D_CO2*$rho0MixLiq*$CpMixLiq*$LeLiqMix"; -PrCO2 #calc "$muMixLiq*$CpMixLiq / $kCO2"; - -kCH4 #calc "$D_CH4*$rho0MixLiq*$CpMixLiq*$LeLiqMix"; -PrCH4 #calc "$muMixLiq*$CpMixLiq / $kCH4"; - -kN2 #calc "$D_N2*$rho0MixLiq*$CpMixLiq*$LeLiqMix"; -PrN2 #calc "$muMixLiq*$CpMixLiq / $kN2"; -//********************************* -l_scale 0.5; -intensity 0.05; -k_inlet_gas #calc "1.5 * Foam::pow(($uGasPhase), 2) * Foam::pow($intensity, 2)"; -k_inlet_liq #calc "1.5 * Foam::pow(($uGasPhase), 2) * Foam::pow($intensity, 2)"; -eps_inlet_gas #calc "pow(0.09,0.75) * Foam::pow($k_inlet_gas, 1.5) / ($l_scale * 0.07)"; -eps_inlet_liq #calc "pow(0.09,0.75) * Foam::pow($k_inlet_liq, 1.5) / ($l_scale * 0.07)"; -omega_inlet_gas #calc "pow(0.09,-0.25) * pow($k_inlet_gas,0.5) / ($l_scale * 0.07)"; -omega_inlet_liq #calc "pow(0.09,-0.25) * pow($k_inlet_liq,0.5) / ($l_scale * 0.07)"; diff --git a/OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch/constant/globalVars_temp b/OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch/constant/globalVars_temp deleted file mode 100644 index fcb076a7..00000000 --- a/OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch/constant/globalVars_temp +++ /dev/null @@ -1,83 +0,0 @@ -T0 300; //initial T(K) which stays constant -VVM 0.2; -//****water Liquid properties************** -CpMixLiq 4181; -muMixLiq #calc "2.414e-5 * pow(10,247.8/($T0 - 140.0))"; //viscosity (Pa.s) of water as a function of T(K) -kThermLiq 0.62; // W/m-K -rho0MixLiq 1000; // kg/m^3 -sigmaLiq 0.07; //surface tension N/m -//Wilke-Chang params for diffusion coefficient of a given solute in water (solvent) -WC_psi 2.6; -WC_M 18; // kg/kmol -WC_V_O2 25.6e-3; // m3/kmol molar volume at normal boiling temperature (Treybal 1968) -WC_V_H2 14.3e-3; -WC_V_CO2 34e-3; -WC_V_CO 30.7e-3; -WC_V_N2 31.2e-3; -WC_V_CH4 35e-3; // V_b[cm3/mol]=0.285*V_critical^1.048 (Tyn and Calus; ESTIMATING LIQUID MOLAL VOLUME; Processing, Volume 21, Issue 4, Pages 16 - 17) -//****** diffusion coeff *********** -D_H2 #calc "1.173e-16 * pow($WC_psi * $WC_M,0.5) * $T0 / $muMixLiq / pow($WC_V_H2,0.6)"; -D_CO2 #calc "1.173e-16 * pow($WC_psi * $WC_M,0.5) * $T0 / $muMixLiq / pow($WC_V_CO2,0.6)"; -D_CO #calc "1.173e-16 * pow($WC_psi * $WC_M,0.5) * $T0 / $muMixLiq / pow($WC_V_CO,0.6)"; -D_CH4 #calc "1.173e-16 * pow($WC_psi * $WC_M,0.5) * $T0 / $muMixLiq / pow($WC_V_CH4,0.6)"; -D_N2 #calc "1.173e-16 * pow($WC_psi * $WC_M,0.5) * $T0 / $muMixLiq / pow($WC_V_N2,0.6)"; -//****** Henry coeff *************** -H_O2_298 0.032; -DH_O2 1700; -H_CO2_298 0.83; -DH_CO2 2400; -H_CO_298 0.023; -DH_CO 1300; -H_H2_298 0.019; -DH_H2 500; -H_CH4_298 0.032; -DH_CH4 1900; -H_N2_298 0.015; -DH_N2 1300; -He_H2 #calc "$H_H2_298 * exp($DH_H2 *(1. / $T0 - 1./298.15))"; -He_CO #calc "$H_CO_298 * exp($DH_CO *(1. / $T0 - 1./298.15))"; -He_CO2 #calc "$H_CO2_298 * exp($DH_CO2 *(1. / $T0 - 1./298.15))"; -He_CH4 #calc "$H_CH4_298 * exp($DH_CH4 *(1. / $T0 - 1./298.15))"; -He_N2 #calc "$H_N2_298 * exp($DH_N2 *(1. / $T0 - 1./298.15))"; -//*******inlet gas frac************* -f_H2 0.1; -f_CO2 0.9; -f_N2 0.0; -//*******inlet gas frac************* -inletA ; -liqVol ; -alphaGas 1; -alphaLiq 0; -uGasPhase #calc "$liqVol * $VVM / (60 * $inletA * $alphaGas)"; -//********************************* -LeLiqH2 #calc "$kThermLiq / $rho0MixLiq / $D_H2 / $CpMixLiq"; -LeLiqCO #calc "$kThermLiq / $rho0MixLiq / $D_CO / $CpMixLiq"; -LeLiqCO2 #calc "$kThermLiq / $rho0MixLiq / $D_CO2 / $CpMixLiq"; // = 74 -LeLiqCH4 #calc "$kThermLiq / $rho0MixLiq / $D_CH4 / $CpMixLiq"; -LeLiqN2 #calc "$kThermLiq / $rho0MixLiq / $D_N2 / $CpMixLiq"; -LeLiqMix #calc "$f_CO2*$LeLiqCO2+$f_H2*$LeLiqH2"; -PrMixLiq #calc "$CpMixLiq * $muMixLiq / $kThermLiq"; -//********************************* -kH2 #calc "$D_H2*$rho0MixLiq*$CpMixLiq*$LeLiqMix"; -PrH2 #calc "$muMixLiq*$CpMixLiq / $kH2"; - -kCO #calc "$D_CO*$rho0MixLiq*$CpMixLiq*$LeLiqMix"; -PrCO #calc "$muMixLiq*$CpMixLiq / $kCO"; - -kCO2 #calc "$D_CO2*$rho0MixLiq*$CpMixLiq*$LeLiqMix"; -PrCO2 #calc "$muMixLiq*$CpMixLiq / $kCO2"; - -kCH4 #calc "$D_CH4*$rho0MixLiq*$CpMixLiq*$LeLiqMix"; -PrCH4 #calc "$muMixLiq*$CpMixLiq / $kCH4"; - -kN2 #calc "$D_N2*$rho0MixLiq*$CpMixLiq*$LeLiqMix"; -PrN2 #calc "$muMixLiq*$CpMixLiq / $kN2"; -//********************************* -l_scale 0.5; -intensity 0.05; -k_inlet_gas #calc "1.5 * Foam::pow(($uGasPhase), 2) * Foam::pow($intensity, 2)"; -k_inlet_liq #calc "1.5 * Foam::pow(($uGasPhase), 2) * Foam::pow($intensity, 2)"; -eps_inlet_gas #calc "pow(0.09,0.75) * Foam::pow($k_inlet_gas, 1.5) / ($l_scale * 0.07)"; -eps_inlet_liq #calc "pow(0.09,0.75) * Foam::pow($k_inlet_liq, 1.5) / ($l_scale * 0.07)"; -omega_inlet_gas #calc "pow(0.09,-0.25) * pow($k_inlet_gas,0.5) / ($l_scale * 0.07)"; -omega_inlet_liq #calc "pow(0.09,-0.25) * pow($k_inlet_liq,0.5) / ($l_scale * 0.07)"; diff --git a/OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch/constant/momentumTransport.gas b/OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch/constant/momentumTransport.gas deleted file mode 100644 index ca916714..00000000 --- a/OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch/constant/momentumTransport.gas +++ /dev/null @@ -1,26 +0,0 @@ -/*--------------------------------*- C++ -*----------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | Website: https://openfoam.org - \\ / A nd | Version: dev - \\/ M anipulation | -\*---------------------------------------------------------------------------*/ -FoamFile -{ - format ascii; - class dictionary; - location "constant"; - object momentumTransport.gas; -} -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -//simulationType laminar; -simulationType RAS; -RAS -{ - model mixtureKEpsilon; - turbulence on; - printCoeff on; -} - -// ************************************************************************* // diff --git a/OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch/constant/momentumTransport.liquid b/OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch/constant/momentumTransport.liquid deleted file mode 100644 index 2063de0d..00000000 --- a/OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch/constant/momentumTransport.liquid +++ /dev/null @@ -1,27 +0,0 @@ -/*--------------------------------*- C++ -*----------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | Website: https://openfoam.org - \\ / A nd | Version: dev - \\/ M anipulation | -\*---------------------------------------------------------------------------*/ -FoamFile -{ - format ascii; - class dictionary; - location "constant"; - object momentumTransport.liquid; -} -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -//simulationType laminar; -simulationType RAS; - -RAS -{ - model mixtureKEpsilon; - turbulence on; - printCoeffs on; -} - -// ************************************************************************* // diff --git a/OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch/constant/phaseProperties b/OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch/constant/phaseProperties deleted file mode 100644 index a3c90f5a..00000000 --- a/OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch/constant/phaseProperties +++ /dev/null @@ -1,295 +0,0 @@ -/*--------------------------------*- C++ -*----------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | Website: https://openfoam.org - \\ / A nd | Version: 9 - \\/ M anipulation | -\*---------------------------------------------------------------------------*/ -FoamFile -{ - format ascii; - class dictionary; - object phaseProperties; -} -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#include "$FOAM_CASE/constant/globalVars" - -type interfaceCompositionPhaseChangePopulationBalanceMultiphaseSystem; - -phases (gas liquid); - -populationBalances (bubbles); - -gas -{ - type multiComponentPhaseModel;//pureIsothermalPhaseModel; - - diameterModel velocityGroup; - - velocityGroupCoeffs - { - populationBalance bubbles; - - shapeModel spherical; - - sizeGroups - ( - f1 {dSph 1.4e-3; value 0.0;} - f2 {dSph 1.8e-3; value 0.0;} - f3 {dSph 2.2e-3; value 0.0;} - f4 {dSph 2.6e-3; value 0.0;} - f5 {dSph 3e-3; value 1.0;} - f6 {dSph 3.4e-3; value 0.0;} - f7 {dSph 3.8e-3; value 0.0;} - f8 {dSph 4.2e-3; value 0.0;} - f9 {dSph 4.6e-3; value 0.0;} - f10 {dSph 5.0e-3; value 0.0;} - ); - } - - residualAlpha 1e-6; - - Sc 0.7; -} - -liquid -{ - type multiComponentPhaseModel;//pureIsothermalPhaseModel; - - diameterModel constant; - - constantCoeffs - { - d 1e-4; - } - Sc #codeStream - { - code - #{ - os << ($LeLiqMix * $CpMixLiq * $muMixLiq / $kThermLiq); - #}; - }; - - residualAlpha 1e-6; -} - -populationBalanceCoeffs -{ - bubbles - { - continuousPhase liquid; - - coalescenceModels - ( - LehrMilliesMewes{ - efficiency 4.695; - uCrit 0.08; - alphaMax 0.6; - } - ); - - binaryBreakupModels - (); - - breakupModels - ( - Laakkonen { - efficiency 13.83; - daughterSizeDistributionModel Laakkonen; - } - - ); - - driftModels - ( - densityChange{} - ); - - nucleationModels - (); - } -} - -blending -{ - default - { - type linear; - minFullyContinuousAlpha.gas 0.7; - minPartlyContinuousAlpha.gas 0.3; - minFullyContinuousAlpha.liquid 0.7; - minPartlyContinuousAlpha.liquid 0.3; - } - heatTransfer - { - type linear; - minFullyContinuousAlpha.gas 1; - minPartlyContinuousAlpha.gas 0; - minFullyContinuousAlpha.liquid 1; - minPartlyContinuousAlpha.liquid 0; - } - massTransfer - { - $heatTransfer; - } -} - -surfaceTension -( - (gas and liquid) - { - type constant; - sigma $sigmaLiq; - } -); - -interfaceCompression -(); - -aspectRatio -( - (gas in liquid) - { - type Wellek; - } -); - - -drag -( - (gas in liquid) - { - type Grace; // Need to install the model available at https://github.com/NREL/BioReactorDesign - //type IshiiZuber; - residualRe 1e-3; - swarmCorrection - { - type none; - } - } -); - -virtualMass -( - (gas in liquid) - { - type constantCoefficient; - Cvm 0.5; - } -); - -// heatTransfer -// (); - -heatTransfer.gas -( - (gas in liquid) - { - type spherical; - residualAlpha 1e-4; - } - - (liquid in gas) - { - type RanzMarshall; - residualAlpha 1e-4; - } -); - -heatTransfer.liquid -( - (gas in liquid) - { - type RanzMarshall; - residualAlpha 1e-4; - } - - (liquid in gas) - { - type spherical; - residualAlpha 1e-4; - } -); - -interfaceComposition.gas -(); - -interfaceComposition.liquid -( - (liquid and gas) - { - type Henry; - species ( CO2 H2 ); - k ( $He_CO2 $He_H2 ); - Le $LeLiqMix; - } -); - -diffusiveMassTransfer.gas -(); - -diffusiveMassTransfer.liquid -( - (gas in liquid) - { - type Higbie; // Need to install the model available at https://github.com/NREL/BioReactorDesign - //type Frossling; - Le $LeLiqMix; - } - - (liquid in gas) - { - type spherical; - Le 1.0; //not used for spherical - } -); - -phaseTransfer -(); - -lift -( - (gas in liquid) - { - type wallDamped; - - wallDamping - { - type cosine; - Cd 3.0; - } - - lift - { - type Tomiyama; - - swarmCorrection - { - type none; - } - } - } - -); - -wallLubrication -( - (gas in liquid) - { - type Antal; - Cw1 -0.01; - Cw2 0.05; - } -); - -turbulentDispersion -( - (gas in liquid) - { - type Burns; - sigma 0.9; - } -); - -// ************************************************************************* // diff --git a/OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch/constant/phaseProperties_constantd b/OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch/constant/phaseProperties_constantd deleted file mode 100644 index e029df99..00000000 --- a/OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch/constant/phaseProperties_constantd +++ /dev/null @@ -1,261 +0,0 @@ -/*--------------------------------*- C++ -*----------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | Website: https://openfoam.org - \\ / A nd | Version: 9 - \\/ M anipulation | -\*---------------------------------------------------------------------------*/ -FoamFile -{ - format ascii; - class dictionary; - object phaseProperties; -} -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#include "$FOAM_CASE/constant/globalVars" - -type interfaceCompositionPhaseChangeMultiphaseSystem; - -phases (gas liquid); - -gas -{ - type multiComponentPhaseModel;//pureIsothermalPhaseModel; - - diameterModel constant; - - constantCoeffs - { - d 3e-3; - } - residualAlpha 1e-6; - Sc 0.7; -} - -liquid -{ - type multiComponentPhaseModel;//pureIsothermalPhaseModel; - - diameterModel constant; - - constantCoeffs - { - d 1e-4; - } - Sc #codeStream - { - code - #{ - os << ($LeLiqMix * $CpMixLiq * $muMixLiq / $kThermLiq); - #}; - }; - - residualAlpha 1e-6; -} - -populationBalanceCoeffs -{ - bubbles - { - continuousPhase liquid; - - coalescenceModels - (); - - binaryBreakupModels - (); - - breakupModels - (); - - driftModels - (); - - nucleationModels - (); - } -} - -blending -{ - default - { - type linear; - minFullyContinuousAlpha.gas 0.7; - minPartlyContinuousAlpha.gas 0.3; - minFullyContinuousAlpha.liquid 0.7; - minPartlyContinuousAlpha.liquid 0.3; - } - heatTransfer - { - type linear; - minFullyContinuousAlpha.gas 1; - minPartlyContinuousAlpha.gas 0; - minFullyContinuousAlpha.liquid 1; - minPartlyContinuousAlpha.liquid 0; - } - massTransfer - { - $heatTransfer; - } -} - -surfaceTension -( - (gas and liquid) - { - type constant; - sigma $sigmaLiq; - } -); - -interfaceCompression -(); - -aspectRatio -( - (gas in liquid) - { - type Wellek; - } -); - - -drag -( - (gas in liquid) - { - type Grace; // Need to install the model available at https://github.com/NREL/BioReactorDesign - //type IshiiZuber; - residualRe 1e-3; - swarmCorrection - { - type none; - } - } -); - -virtualMass -( - (gas in liquid) - { - type constantCoefficient; - Cvm 0.5; - } -); - -// heatTransfer -// (); - -heatTransfer.gas -( - (gas in liquid) - { - type spherical; - residualAlpha 1e-4; - } - - (liquid in gas) - { - type RanzMarshall; - residualAlpha 1e-4; - } -); - -heatTransfer.liquid -( - (gas in liquid) - { - type RanzMarshall; - residualAlpha 1e-4; - } - - (liquid in gas) - { - type spherical; - residualAlpha 1e-4; - } -); - -interfaceComposition.gas -(); - -interfaceComposition.liquid -( - (liquid and gas) - { - type Henry; - species ( CO2 H2 ); - k ( $He_CO2 $He_H2 ); - Le $LeLiqMix; - } -); - -diffusiveMassTransfer.gas -(); - -diffusiveMassTransfer.liquid -( - (gas in liquid) - { - type Higbie; // Need to install the model available at https://github.com/NREL/BioReactorDesign - //type Frossling; - Le $LeLiqMix; - } - - (liquid in gas) - { - type spherical; - Le 1.0; //not used for spherical - } -); - -phaseTransfer -(); - -lift -( - (gas in liquid) - { - type wallDamped; - - wallDamping - { - type cosine; - Cd 3.0; - } - - lift - { - type Tomiyama; - - swarmCorrection - { - type none; - } - } - } - -); - -wallLubrication -( - (gas in liquid) - { - type Antal; - Cw1 -0.01; - Cw2 0.05; - } -); - -turbulentDispersion -( - (gas in liquid) - { - type Burns; - sigma 0.9; - } -); - -// ************************************************************************* // diff --git a/OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch/constant/phaseProperties_pbe b/OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch/constant/phaseProperties_pbe deleted file mode 100644 index a3c90f5a..00000000 --- a/OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch/constant/phaseProperties_pbe +++ /dev/null @@ -1,295 +0,0 @@ -/*--------------------------------*- C++ -*----------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | Website: https://openfoam.org - \\ / A nd | Version: 9 - \\/ M anipulation | -\*---------------------------------------------------------------------------*/ -FoamFile -{ - format ascii; - class dictionary; - object phaseProperties; -} -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#include "$FOAM_CASE/constant/globalVars" - -type interfaceCompositionPhaseChangePopulationBalanceMultiphaseSystem; - -phases (gas liquid); - -populationBalances (bubbles); - -gas -{ - type multiComponentPhaseModel;//pureIsothermalPhaseModel; - - diameterModel velocityGroup; - - velocityGroupCoeffs - { - populationBalance bubbles; - - shapeModel spherical; - - sizeGroups - ( - f1 {dSph 1.4e-3; value 0.0;} - f2 {dSph 1.8e-3; value 0.0;} - f3 {dSph 2.2e-3; value 0.0;} - f4 {dSph 2.6e-3; value 0.0;} - f5 {dSph 3e-3; value 1.0;} - f6 {dSph 3.4e-3; value 0.0;} - f7 {dSph 3.8e-3; value 0.0;} - f8 {dSph 4.2e-3; value 0.0;} - f9 {dSph 4.6e-3; value 0.0;} - f10 {dSph 5.0e-3; value 0.0;} - ); - } - - residualAlpha 1e-6; - - Sc 0.7; -} - -liquid -{ - type multiComponentPhaseModel;//pureIsothermalPhaseModel; - - diameterModel constant; - - constantCoeffs - { - d 1e-4; - } - Sc #codeStream - { - code - #{ - os << ($LeLiqMix * $CpMixLiq * $muMixLiq / $kThermLiq); - #}; - }; - - residualAlpha 1e-6; -} - -populationBalanceCoeffs -{ - bubbles - { - continuousPhase liquid; - - coalescenceModels - ( - LehrMilliesMewes{ - efficiency 4.695; - uCrit 0.08; - alphaMax 0.6; - } - ); - - binaryBreakupModels - (); - - breakupModels - ( - Laakkonen { - efficiency 13.83; - daughterSizeDistributionModel Laakkonen; - } - - ); - - driftModels - ( - densityChange{} - ); - - nucleationModels - (); - } -} - -blending -{ - default - { - type linear; - minFullyContinuousAlpha.gas 0.7; - minPartlyContinuousAlpha.gas 0.3; - minFullyContinuousAlpha.liquid 0.7; - minPartlyContinuousAlpha.liquid 0.3; - } - heatTransfer - { - type linear; - minFullyContinuousAlpha.gas 1; - minPartlyContinuousAlpha.gas 0; - minFullyContinuousAlpha.liquid 1; - minPartlyContinuousAlpha.liquid 0; - } - massTransfer - { - $heatTransfer; - } -} - -surfaceTension -( - (gas and liquid) - { - type constant; - sigma $sigmaLiq; - } -); - -interfaceCompression -(); - -aspectRatio -( - (gas in liquid) - { - type Wellek; - } -); - - -drag -( - (gas in liquid) - { - type Grace; // Need to install the model available at https://github.com/NREL/BioReactorDesign - //type IshiiZuber; - residualRe 1e-3; - swarmCorrection - { - type none; - } - } -); - -virtualMass -( - (gas in liquid) - { - type constantCoefficient; - Cvm 0.5; - } -); - -// heatTransfer -// (); - -heatTransfer.gas -( - (gas in liquid) - { - type spherical; - residualAlpha 1e-4; - } - - (liquid in gas) - { - type RanzMarshall; - residualAlpha 1e-4; - } -); - -heatTransfer.liquid -( - (gas in liquid) - { - type RanzMarshall; - residualAlpha 1e-4; - } - - (liquid in gas) - { - type spherical; - residualAlpha 1e-4; - } -); - -interfaceComposition.gas -(); - -interfaceComposition.liquid -( - (liquid and gas) - { - type Henry; - species ( CO2 H2 ); - k ( $He_CO2 $He_H2 ); - Le $LeLiqMix; - } -); - -diffusiveMassTransfer.gas -(); - -diffusiveMassTransfer.liquid -( - (gas in liquid) - { - type Higbie; // Need to install the model available at https://github.com/NREL/BioReactorDesign - //type Frossling; - Le $LeLiqMix; - } - - (liquid in gas) - { - type spherical; - Le 1.0; //not used for spherical - } -); - -phaseTransfer -(); - -lift -( - (gas in liquid) - { - type wallDamped; - - wallDamping - { - type cosine; - Cd 3.0; - } - - lift - { - type Tomiyama; - - swarmCorrection - { - type none; - } - } - } - -); - -wallLubrication -( - (gas in liquid) - { - type Antal; - Cw1 -0.01; - Cw2 0.05; - } -); - -turbulentDispersion -( - (gas in liquid) - { - type Burns; - sigma 0.9; - } -); - -// ************************************************************************* // diff --git a/OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch/constant/thermophysicalProperties.gas b/OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch/constant/thermophysicalProperties.gas deleted file mode 100644 index 11b1c4b9..00000000 --- a/OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch/constant/thermophysicalProperties.gas +++ /dev/null @@ -1,142 +0,0 @@ -/*--------------------------------*- C++ -*----------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | Website: https://openfoam.org - \\ / A nd | Version: dev - \\/ M anipulation | -\*---------------------------------------------------------------------------*/ -FoamFile -{ - format ascii; - class dictionary; - location "constant"; - object thermophysicalProperties.gas; -} -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -thermoType -{ - type heRhoThermo; - mixture multiComponentMixture; - transport sutherland; - thermo janaf; - equationOfState perfectGas; - specie specie; - energy sensibleInternalEnergy; - //energy sensibleEnthalpy; -} - - -species -( - H2 - CO2 - N2 -); - -defaultSpecie N2; - -CO2 -{ - specie - { - molWeight 44.00995; - } - thermodynamics - { - Tlow 200; - Thigh 3500; - Tcommon 1000; - highCpCoeffs ( 3.85746029 0.00441437026 -2.21481404e-06 5.23490188e-10 -4.72084164e-14 -48759.166 2.27163806 ); - lowCpCoeffs ( 2.35677352 0.00898459677 -7.12356269e-06 2.45919022e-09 -1.43699548e-13 -48371.9697 9.90105222 ); - } - transport - { - As 1.572e-06; - Ts 240; - } - elements - { - C 1; - O 2; - } -} - -water -{ - specie - { - molWeight 18.01534; - } - thermodynamics - { - Tlow 200; - Thigh 3500; - Tcommon 1000; - highCpCoeffs ( 3.03399249 0.00217691804 -1.64072518e-07 -9.7041987e-11 1.68200992e-14 -30004.2971 4.9667701 ); - lowCpCoeffs ( 4.19864056 -0.0020364341 6.52040211e-06 -5.48797062e-09 1.77197817e-12 -30293.7267 -0.849032208 ); - } - transport - { - As 1.512e-06; - Ts 120; - } - elements - { - H 2; - O 1; - } -} - -N2 -{ - specie - { - molWeight 28.0134; - } - thermodynamics - { - Tlow 250; - Thigh 5000; - Tcommon 1000; - highCpCoeffs ( 2.92664 0.0014879768 -5.68476e-07 1.0097038e-10 -6.753351e-15 -922.7977 5.980528 ); - lowCpCoeffs ( 3.298677 0.0014082404 -3.963222e-06 5.641515e-09 -2.444854e-12 -1020.8999 3.950372 ); - } - transport - { - As 1.512e-06; - Ts 120; - } - elements - { - N 2; - } -} - -H2 -{ - specie - { - molWeight 2.01594; - } - thermodynamics - { - Tlow 200; - Thigh 3500; - Tcommon 1000; - highCpCoeffs ( 3.3372792 -4.94024731e-05 4.99456778e-07 -1.79566394e-10 2.00255376e-14 -950.158922 -3.20502331 ); - lowCpCoeffs ( 2.34433112 0.00798052075 -1.9478151e-05 2.01572094e-08 -7.37611761e-12 -917.935173 0.683010238 ); - } - transport - { - As 6.362e-07; - Ts 72; - } - elements - { - H 2; - } -} - - -// ************************************************************************* // diff --git a/OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch/constant/thermophysicalProperties.liquid b/OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch/constant/thermophysicalProperties.liquid deleted file mode 100644 index d324ec51..00000000 --- a/OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch/constant/thermophysicalProperties.liquid +++ /dev/null @@ -1,108 +0,0 @@ -/*--------------------------------*- C++ -*----------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | Website: https://openfoam.org - \\ / A nd | Version: dev - \\/ M anipulation | -\*---------------------------------------------------------------------------*/ -FoamFile -{ - format ascii; - class dictionary; - location "constant"; - object thermophysicalProperties.liquid; -} -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#include "$FOAM_CASE/constant/globalVars" - -thermoType -{ - type heRhoThermo; - mixture multiComponentMixture; - transport const; - thermo hConst; - equationOfState rhoConst;//rPolynomial; - specie specie; - energy sensibleInternalEnergy; - //energy sensibleEnthalpy; -} - -species -( - CO2 - water - H2 -); - -inertSpecie water; - -water -{ - specie - { - molWeight 18.0153; - } - equationOfState - { - rho $rho0MixLiq; - } - thermodynamics - { - Cp $CpMixLiq; - Hf -1.5879e+07; - } - transport - { - mu $muMixLiq; - Pr $PrMixLiq; - } -} - -CO2 -{ - specie - { - molWeight 44.00995; - } - equationOfState - { - rho $rho0MixLiq; - } - thermodynamics - { - Cp $CpMixLiq; - Hf -1.5879e+07; - } - transport - { - mu $muMixLiq; - Pr $PrCO2; - } -} - -H2 -{ - specie - { - molWeight 2.01594; - } - equationOfState - { - rho $rho0MixLiq; - } - thermodynamics - { - Cp $CpMixLiq; - Hf -1.5879e+07;//-9402451; - } - transport - { - mu $muMixLiq; - Pr $PrH2; - } -} - - - -// ************************************************************************* // diff --git a/OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch/get_qoi.py b/OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch/get_qoi.py deleted file mode 100644 index 9562cc65..00000000 --- a/OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch/get_qoi.py +++ /dev/null @@ -1,183 +0,0 @@ -import json -import os -import pickle as pkl - -import matplotlib as mpl -import numpy as np -from prettyPlot.plotting import * -from scipy.optimize import curve_fit - - -def get_sim_folds(path): - folds = os.listdir(path) - sim_folds = [] - for fold in folds: - if fold.startswith("loop"): - sim_folds.append(fold) - return sim_folds - - -def func(t, cstar, kla): - t = t - t0 = 0 - c0 = 0 - return (cstar - c0) * (1 - np.exp(-kla * (t - t0))) + c0 - - -def get_vl(verb=False): - filename = os.path.join("constant", "globalVars") - with open(filename, "r+") as f: - lines = f.readlines() - for line in lines: - if line.startswith("liqVol"): - vol = float(line.split()[-1][:-1]) - break - if verb: - print(f"Read liqVol = {vol}m3") - return vol - - -def get_vvm(verb=False): - filename = os.path.join("constant", "globalVars") - with open(filename, "r+") as f: - lines = f.readlines() - for line in lines: - if line.startswith("VVM"): - vvm = float(line.split()[-1][:-1]) - break - if verb: - print(f"Read VVM = {vvm} [-]") - return vvm - - -def get_As(verb=False): - filename = os.path.join("constant", "globalVars") - with open(filename, "r+") as f: - lines = f.readlines() - for line in lines: - if line.startswith("inletA"): - As = float(line.split()[-1][:-1]) - break - if verb: - print(f"Read As = {As}m2") - return As - - -def get_pmix(verb=False): - with open("system/mixers.json", "r+") as f: - data = json.load(f) - mixer_list = data["mixers"] - pmix = 0 - for mix in mixer_list: - pmix += mix["power"] / 1000 - if verb: - print(f"Read Mixing power = {pmix}kW") - return pmix - - -def get_lh(verb=False): - filename = os.path.join("system", "setFieldsDict") - with open(filename, "r+") as f: - lines = f.readlines() - for line in lines: - if "box (-1.0 -1.0 -1.0)" in line: - height = float(line.split("(")[2].split()[1]) - break - if verb: - print(f"Read Height = {height}m") - return height - - -def get_pinj(vvm, Vl, As, lh): - rhog = 1.25 # kg /m3 - Vg = Vl * vvm / (60 * As * 1) # m/s - Ptank = 101325 # Pa - # Ptank = 0 # Pa - rhoL = 1000 # kg / m3 - Pl = 101325 + rhoL * 9.8 * lh # Pa - # W - P1 = rhog * As * Vg**3 - # W - P2 = (Pl - Ptank) * As * Vg - # kg /s - MF = rhog * Vg * As - # kwh / kg - e_m = (P1 + P2) / (3600 * 1000 * MF) - - # returns kW - return (P1 + P2) * 1e-3 - - -def get_qoi(kla_co2, cs_co2, kla_h2, cs_h2, verb=False): - vvm = get_vvm(verb) - As = get_As(verb) - V_l = get_vl(verb) - liqh = get_lh(verb) - P_inj = get_pinj(vvm, V_l, As, liqh) - P_mix = get_pmix(verb) - - qoi_co2 = kla_co2 * cs_co2 * V_l * 0.04401 / (P_mix / 3600 + P_inj / 3600) - qoi_h2 = kla_h2 * cs_h2 * V_l * 0.002016 / (P_mix / 3600 + P_inj / 3600) - return qoi_co2 * qoi_h2 - - -def get_qoi_uq(kla_co2, cs_co2, kla_h2, cs_h2): - qoi = [] - for i in range(len(kla_co2)): - if i == 0: - verb = True - else: - verb = False - qoi.append(get_qoi(kla_co2[i], cs_co2[i], kla_h2[i], cs_h2[i], verb)) - qoi = np.array(qoi) - return np.mean(qoi), np.std(qoi) - - -os.makedirs("Figures", exist_ok=True) - -dataFolder = "data" -fold = "local" - -nuq = 100 -mean_cstar_co2 = np.random.uniform(12.6, 13.3, nuq) -mean_cstar_h2 = np.random.uniform(0.902, 0.96, nuq) - - -tmp_cs_h2 = [] -tmp_cs_co2 = [] -tmp_kla_h2 = [] -tmp_kla_co2 = [] -cs_co2 = mean_cstar_co2 -cs_h2 = mean_cstar_h2 - -a = np.load(os.path.join(dataFolder, fold, "conv.npz")) -endindex = -1 -if ( - "c_h2" in a - and "c_co2" in a - and len(a["time"][:endindex] > 0) - and (a["time"][:endindex][-1] > 95) -): - for i in range(nuq): - fitparamsH2, _ = curve_fit( - func, - np.array(a["time"][:endindex]), - np.array(a["c_h2"][:endindex]), - bounds=[(cs_h2[i] - 1e-6, 0), (cs_h2[i] + 1e-6, 1)], - ) - fitparamsCO2, _ = curve_fit( - func, - np.array(a["time"][:endindex]), - np.array(a["c_co2"][:endindex]), - bounds=[(cs_co2[i] - 1e-6, 0), (cs_co2[i] + 1e-6, 1)], - ) - tmp_kla_co2.append(fitparamsCO2[1]) - tmp_kla_h2.append(fitparamsH2[1]) - tmp_cs_h2.append(cs_h2[i]) - tmp_cs_co2.append(cs_co2[i]) - -qoi_m, qoi_s = get_qoi_uq(tmp_kla_co2, tmp_cs_co2, tmp_kla_h2, tmp_cs_h2) - - -with open("qoi.txt", "w+") as f: - f.write(f"{qoi_m},{qoi_s}\n") diff --git a/OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch/presteps.sh b/OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch/presteps.sh deleted file mode 100644 index 899655b8..00000000 --- a/OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch/presteps.sh +++ /dev/null @@ -1,71 +0,0 @@ -# Clean case -module load anaconda3/2023 -conda activate /projects/gas2fuels/conda_env/bird -source /projects/gas2fuels/ofoam_cray_mpich/OpenFOAM-dev/etc/bashrc -./Allclean - -echo PRESTEP 1 -# Generate blockmeshDict -python /projects/gas2fuels/BioReactorDesign/applications/write_block_rect_mesh.py -i system/mesh.json -o system -#python ../../../applications/write_block_rect_mesh.py -i system/mesh.json -o system - -# Generate boundary stl -python /projects/gas2fuels/BioReactorDesign/applications/write_stl_patch.py -i system/inlets_outlets.json -#python ../../../applications/write_stl_patch.py -i system/inlets_outlets.json - -# Generate mixers -python /projects/gas2fuels/BioReactorDesign/applications/write_dynMix_fvModels_force_sign.py -i system/mixers.json -o constant -#python ../../../applications/write_dynMix_fvModels.py -i system/mixers.json -o constant - -echo PRESTEP 2 -# Mesh gen -blockMesh -dict system/blockMeshDict - -# Inlet BC -surfaceToPatch -tol 1e-3 inlets.stl -export newmeshdir=$(foamListTimes -latestTime) -rm -rf constant/polyMesh/ -cp -r $newmeshdir/polyMesh ./constant -rm -rf $newmeshdir -cp constant/polyMesh/boundary /tmp -sed -i -e 's/inlets\.stl/inlet/g' /tmp/boundary -cat /tmp/boundary > constant/polyMesh/boundary - -# Outlet BC -surfaceToPatch -tol 1e-3 outlets.stl -export newmeshdir=$(foamListTimes -latestTime) -rm -rf constant/polyMesh/ -cp -r $newmeshdir/polyMesh ./constant -rm -rf $newmeshdir -cp constant/polyMesh/boundary /tmp -sed -i -e 's/outlets\.stl/outlet/g' /tmp/boundary -cat /tmp/boundary > constant/polyMesh/boundary - - -# Scale -transformPoints "scale=(0.05 0.05 0.05)" - - -# setup IC -cp -r 0.orig 0 -setFields - -# Setup mass flow rate -# Get inlet area -postProcess -func 'patchIntegrate(patch="inlet", field="alpha.gas")' -postProcess -func writeCellVolumes -writeMeshObj - -echo PRESTEP 3 -python writeGlobalVars.py -cp constant/phaseProperties_constantd constant/phaseProperties - - -if [ -f qoi.txt ]; then - rm qoi.txt -fi -if [ -f data/local/conv.npz ]; then - rm data/local/conv.npz -fi - -conda deactivate diff --git a/OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch/read_history.py b/OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch/read_history.py deleted file mode 100644 index 264711f8..00000000 --- a/OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch/read_history.py +++ /dev/null @@ -1,239 +0,0 @@ -import argparse -import os -import sys - -import numpy as np -from prettyPlot.plotting import plt, pretty_labels - -from bird.utilities.ofio import * - - -def compute_gas_holdup(caseFolder, timeFolder, nCells, field_dict={}): - if not ("alpha_liq" in field_dict) or field_dict["alpha_liq"] is None: - alpha_liq_file = os.path.join(caseFolder, timeFolder, "alpha.liquid") - alpha_liq = readOFScal(alpha_liq_file, nCells) - # print("reading alpha_liq") - field_dict["alpha_liq"] = alpha_liq - if not ("volume" in field_dict) or field_dict["volume"] is None: - volume_file = os.path.join(caseFolder, "0", "V") - volume = readOFScal(volume_file, nCells) - # print("reading Volume") - field_dict["volume"] = volume - alpha_liq = field_dict["alpha_liq"] - volume = field_dict["volume"] - holdup = np.sum((1 - alpha_liq) * volume) / np.sum(volume) - return holdup, field_dict - - -def co2liq(caseFolder, timeFolder, nCells, field_dict={}): - if not ("alpha_liq" in field_dict) or field_dict["alpha_liq"] is None: - alpha_liq_file = os.path.join(caseFolder, timeFolder, "alpha.liquid") - alpha_liq = readOFScal(alpha_liq_file, nCells) - # print("reading alpha_liq") - field_dict["alpha_liq"] = alpha_liq - if not ("co2_liq" in field_dict) or field_dict["co2_liq"] is None: - co2_liq_file = os.path.join(caseFolder, timeFolder, "CO2.liquid") - co2_liq = readOFScal(co2_liq_file, nCells) - # print("computing co2 liq") - field_dict["co2_liq"] = co2_liq - if not ("volume" in field_dict) or field_dict["volume"] is None: - volume_file = os.path.join(caseFolder, "0", "V") - volume = readOFScal(volume_file, nCells) - # print("reading Volume") - field_dict["volume"] = volume - if not ("indliq" in field_dict) or field_dict["indliq"] is None: - alpha_liq = field_dict["alpha_liq"] - indliq = np.argwhere(alpha_liq > 0.5) - # print("computing indliq") - field_dict["indliq"] = indliq - volume = field_dict["volume"] - indliq = field_dict["indliq"] - alpha_liq = field_dict["alpha_liq"] - co2_liq = field_dict["co2_liq"] - met = np.sum( - alpha_liq[indliq] * co2_liq[indliq] * volume[indliq] - ) / np.sum(volume[indliq]) - return met, field_dict - - -def cliq(caseFolder, timeFolder, nCells, field_dict={}): - if not ("alpha_liq" in field_dict) or field_dict["alpha_liq"] is None: - alpha_liq_file = os.path.join(caseFolder, timeFolder, "alpha.liquid") - alpha_liq = readOFScal(alpha_liq_file, nCells) - # print("reading alpha_liq") - field_dict["alpha_liq"] = alpha_liq - if not ("rho_liq" in field_dict) or field_dict["rho_liq"] is None: - rho_liq_file = os.path.join(caseFolder, timeFolder, "rhom") - rho_liq = readOFScal(rho_liq_file, nCells) - field_dict["rho_liq"] = rho_liq - if not ("co2_liq" in field_dict) or field_dict["co2_liq"] is None: - co2_liq_file = os.path.join(caseFolder, timeFolder, "CO2.liquid") - co2_liq = readOFScal(co2_liq_file, nCells) - # print("computing co2 liq") - field_dict["co2_liq"] = co2_liq - if not ("h2_liq" in field_dict) or field_dict["h2_liq"] is None: - h2_liq_file = os.path.join(caseFolder, timeFolder, "H2.liquid") - h2_liq = readOFScal(h2_liq_file, nCells) - # print("computing h2 liq") - field_dict["h2_liq"] = h2_liq - if not ("volume" in field_dict) or field_dict["volume"] is None: - volume_file = os.path.join(caseFolder, "0", "V") - volume = readOFScal(volume_file, nCells) - # print("reading Volume") - field_dict["volume"] = volume - if not ("indliq" in field_dict) or field_dict["indliq"] is None: - alpha_liq = field_dict["alpha_liq"] - indliq = np.argwhere(alpha_liq > 0.5) - # print("computing indliq") - field_dict["indliq"] = indliq - - volume = field_dict["volume"] - indliq = field_dict["indliq"] - alpha_liq = field_dict["alpha_liq"] - co2_liq = field_dict["co2_liq"] - h2_liq = field_dict["h2_liq"] - rho_liq = field_dict["rho_liq"] - - # c_h2 = rho_liq[indliq] * alpha_liq[indliq] * h2_liq[indliq] / 0.002016 - # c_co2 = rho_liq[indliq] * alpha_liq[indliq] * co2_liq[indliq] / 0.04401 - - c_h2 = 1000 * alpha_liq[indliq] * h2_liq[indliq] / 0.002016 - c_co2 = 1000 * alpha_liq[indliq] * co2_liq[indliq] / 0.04401 - - c_h2 = np.sum(c_h2 * volume[indliq]) / np.sum(volume[indliq]) - c_co2 = np.sum(c_co2 * volume[indliq]) / np.sum(volume[indliq]) - - return c_co2, c_h2, field_dict - - -def h2liq(caseFolder, timeFolder, nCells, field_dict={}): - if not ("alpha_liq" in field_dict) or field_dict["alpha_liq"] is None: - alpha_liq_file = os.path.join(caseFolder, timeFolder, "alpha.liquid") - alpha_liq = readOFScal(alpha_liq_file, nCells) - # print("reading alpha_liq") - field_dict["alpha_liq"] = alpha_liq - if not ("h2_liq" in field_dict) or field_dict["h2_liq"] is None: - h2_liq_file = os.path.join(caseFolder, timeFolder, "H2.liquid") - h2_liq = readOFScal(h2_liq_file, nCells) - # print("computing h2 liq") - field_dict["h2_liq"] = h2_liq - if not ("volume" in field_dict) or field_dict["volume"] is None: - volume_file = os.path.join(caseFolder, "0", "V") - volume = readOFScal(volume_file, nCells) - # print("reading Volume") - field_dict["volume"] = volume - if not ("indliq" in field_dict) or field_dict["indliq"] is None: - alpha_liq = field_dict["alpha_liq"] - indliq = np.argwhere(alpha_liq > 0.5) - # print("computing indliq") - field_dict["indliq"] = indliq - volume = field_dict["volume"] - indliq = field_dict["indliq"] - alpha_liq = field_dict["alpha_liq"] - h2_liq = field_dict["h2_liq"] - met = np.sum(alpha_liq[indliq] * h2_liq[indliq] * volume[indliq]) / np.sum( - volume[indliq] - ) - return met, field_dict - - -def vol_liq(caseFolder, timeFolder, nCells, field_dict={}): - if not ("alpha_liq" in field_dict) or field_dict["alpha_liq"] is None: - alpha_liq_file = os.path.join(caseFolder, timeFolder, "alpha.liquid") - alpha_liq = readOFScal(alpha_liq_file, nCells) - # print("reading alpha_liq") - field_dict["alpha_liq"] = alpha_liq - if not ("volume" in field_dict) or field_dict["volume"] is None: - volume_file = os.path.join(caseFolder, "0", "V") - volume = readOFScal(volume_file, nCells) - # print("reading Volume") - field_dict["volume"] = volume - volume = field_dict["volume"] - alpha_liq = field_dict["alpha_liq"] - indliq = np.argwhere(alpha_liq > 0.0) - liqvol = np.sum(alpha_liq[indliq] * volume[indliq]) / np.sum( - volume[indliq] - ) - return liqvol, field_dict - - -parser = argparse.ArgumentParser(description="Convergence of GH") -parser.add_argument( - "-cn", - "--case_name", - type=str, - metavar="", - required=True, - help="Case name", -) -parser.add_argument( - "-df", - "--data_folder", - type=str, - metavar="", - required=False, - help="data folder name", - default="data", -) - -args, unknown = parser.parse_known_args() - - -case_root = "." # "../" -case_name = args.case_name # "12_hole_sparger_snappyRefine_700rpm_opt_coeff" -case_path = "." -dataFolder = args.data_folder - -if os.path.isfile(os.path.join(dataFolder, case_name, "conv.npz")): - sys.exit("WARNING: History already created, Skipping") - -time_float_sorted, time_str_sorted = getCaseTimes(case_path, remove_zero=True) -cellCentres = readMesh(os.path.join(case_path, f"meshCellCentres_0.obj")) -nCells = len(cellCentres) - - -co2_history = np.zeros(len(time_str_sorted)) -c_co2_history = np.zeros(len(time_str_sorted)) -h2_history = np.zeros(len(time_str_sorted)) -c_h2_history = np.zeros(len(time_str_sorted)) -gh_history = np.zeros(len(time_str_sorted)) -liqvol_history = np.zeros(len(time_str_sorted)) -print(f"case_path = {case_path}") -field_dict = {} -for itime, time in enumerate(time_float_sorted): - time_folder = time_str_sorted[itime] - print(f"\tTime : {time_folder}") - if not field_dict == {}: - new_field_dict = {} - if "volume" in field_dict: - new_field_dict["volume"] = field_dict["volume"] - field_dict = new_field_dict - gh_history[itime], field_dict = compute_gas_holdup( - case_path, time_str_sorted[itime], nCells, field_dict - ) - co2_history[itime], field_dict = co2liq( - case_path, time_str_sorted[itime], nCells, field_dict - ) - h2_history[itime], field_dict = h2liq( - case_path, time_str_sorted[itime], nCells, field_dict - ) - liqvol_history[itime], field_dict = vol_liq( - case_path, time_str_sorted[itime], nCells, field_dict - ) - c_co2_history[itime], c_h2_history[itime], field_dict = cliq( - case_path, time_str_sorted[itime], nCells, field_dict - ) - - -os.makedirs(dataFolder, exist_ok=True) -os.makedirs(os.path.join(dataFolder, case_name), exist_ok=True) -np.savez( - os.path.join(dataFolder, case_name, "conv.npz"), - time=np.array(time_float_sorted), - gh=gh_history, - co2=co2_history, - h2=h2_history, - vol_liq=liqvol_history, - c_h2=c_h2_history, - c_co2=c_co2_history, -) diff --git a/OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch/run.sh b/OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch/run.sh deleted file mode 100644 index 6b7eb516..00000000 --- a/OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch/run.sh +++ /dev/null @@ -1,5 +0,0 @@ -multiphaseEulerFoam - - - - diff --git a/OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch/script b/OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch/script deleted file mode 100755 index 090e5c05..00000000 --- a/OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch/script +++ /dev/null @@ -1,14 +0,0 @@ -#!/bin/bash -#SBATCH --qos=high -#SBATCH --job-name=val2 -##SBATCH --partition=debug -#SBATCH --nodes=1 -#SBATCH --ntasks-per-node=16 -#SBATCH --time=07:59:00 -#SBATCH --account=co2snow - -bash presteps.sh -source /projects/gas2fuels/ofoam_cray_mpich/OpenFOAM-dev/etc/bashrc -decomposePar -fileHandler collated -srun -n 16 multiphaseEulerFoam -parallel -fileHandler collated -reconstructPar -newTimes diff --git a/OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch/script_post b/OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch/script_post deleted file mode 100755 index aabbc33e..00000000 --- a/OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch/script_post +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/bash -#SBATCH --qos=high -#SBATCH --job-name=val2 -##SBATCH --partition=debug -#SBATCH --nodes=1 -#SBATCH --ntasks-per-node=16 -#SBATCH --time=00:59:00 -#SBATCH --account=co2snow - -bash computeQOI.sh diff --git a/OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch/system/blockMeshDict b/OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch/system/blockMeshDict deleted file mode 100644 index 1183d262..00000000 --- a/OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch/system/blockMeshDict +++ /dev/null @@ -1,746 +0,0 @@ -FoamFile -{ - version 2.0; - format ascii; - class dictionary; - object blockMeshDict; -} - -convertToMeters 1.0; - - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -vertices -( -( 0.0 0.0 0.0) -( 1.0 0.0 0.0) -( 2.0 0.0 0.0) -( 3.0 0.0 0.0) -( 4.0 0.0 0.0) -( 5.0 0.0 0.0) -( 6.0 0.0 0.0) -( 7.0 0.0 0.0) -( 8.0 0.0 0.0) -( 9.0 0.0 0.0) -( 10.0 0.0 0.0) -( 0.0 1.0 0.0) -( 1.0 1.0 0.0) -( 2.0 1.0 0.0) -( 3.0 1.0 0.0) -( 4.0 1.0 0.0) -( 5.0 1.0 0.0) -( 6.0 1.0 0.0) -( 7.0 1.0 0.0) -( 8.0 1.0 0.0) -( 9.0 1.0 0.0) -( 10.0 1.0 0.0) -( 0.0 2.0 0.0) -( 1.0 2.0 0.0) -( 2.0 2.0 0.0) -( 3.0 2.0 0.0) -( 4.0 2.0 0.0) -( 5.0 2.0 0.0) -( 6.0 2.0 0.0) -( 7.0 2.0 0.0) -( 8.0 2.0 0.0) -( 9.0 2.0 0.0) -( 10.0 2.0 0.0) -( 0.0 3.0 0.0) -( 1.0 3.0 0.0) -( 2.0 3.0 0.0) -( 3.0 3.0 0.0) -( 4.0 3.0 0.0) -( 5.0 3.0 0.0) -( 6.0 3.0 0.0) -( 7.0 3.0 0.0) -( 8.0 3.0 0.0) -( 9.0 3.0 0.0) -( 10.0 3.0 0.0) -( 0.0 4.0 0.0) -( 1.0 4.0 0.0) -( 2.0 4.0 0.0) -( 3.0 4.0 0.0) -( 4.0 4.0 0.0) -( 5.0 4.0 0.0) -( 6.0 4.0 0.0) -( 7.0 4.0 0.0) -( 8.0 4.0 0.0) -( 9.0 4.0 0.0) -( 10.0 4.0 0.0) -( 0.0 5.0 0.0) -( 1.0 5.0 0.0) -( 2.0 5.0 0.0) -( 3.0 5.0 0.0) -( 4.0 5.0 0.0) -( 5.0 5.0 0.0) -( 6.0 5.0 0.0) -( 7.0 5.0 0.0) -( 8.0 5.0 0.0) -( 9.0 5.0 0.0) -( 10.0 5.0 0.0) -( 0.0 6.0 0.0) -( 1.0 6.0 0.0) -( 2.0 6.0 0.0) -( 3.0 6.0 0.0) -( 4.0 6.0 0.0) -( 5.0 6.0 0.0) -( 6.0 6.0 0.0) -( 7.0 6.0 0.0) -( 8.0 6.0 0.0) -( 9.0 6.0 0.0) -( 10.0 6.0 0.0) -( 0.0 7.0 0.0) -( 1.0 7.0 0.0) -( 2.0 7.0 0.0) -( 3.0 7.0 0.0) -( 4.0 7.0 0.0) -( 5.0 7.0 0.0) -( 6.0 7.0 0.0) -( 7.0 7.0 0.0) -( 8.0 7.0 0.0) -( 9.0 7.0 0.0) -( 10.0 7.0 0.0) -( 0.0 0.0 1.0) -( 1.0 0.0 1.0) -( 2.0 0.0 1.0) -( 3.0 0.0 1.0) -( 4.0 0.0 1.0) -( 5.0 0.0 1.0) -( 6.0 0.0 1.0) -( 7.0 0.0 1.0) -( 8.0 0.0 1.0) -( 9.0 0.0 1.0) -( 10.0 0.0 1.0) -( 0.0 1.0 1.0) -( 1.0 1.0 1.0) -( 2.0 1.0 1.0) -( 3.0 1.0 1.0) -( 4.0 1.0 1.0) -( 5.0 1.0 1.0) -( 6.0 1.0 1.0) -( 7.0 1.0 1.0) -( 8.0 1.0 1.0) -( 9.0 1.0 1.0) -( 10.0 1.0 1.0) -( 0.0 2.0 1.0) -( 1.0 2.0 1.0) -( 2.0 2.0 1.0) -( 3.0 2.0 1.0) -( 4.0 2.0 1.0) -( 5.0 2.0 1.0) -( 6.0 2.0 1.0) -( 7.0 2.0 1.0) -( 8.0 2.0 1.0) -( 9.0 2.0 1.0) -( 10.0 2.0 1.0) -( 0.0 3.0 1.0) -( 1.0 3.0 1.0) -( 2.0 3.0 1.0) -( 3.0 3.0 1.0) -( 4.0 3.0 1.0) -( 5.0 3.0 1.0) -( 6.0 3.0 1.0) -( 7.0 3.0 1.0) -( 8.0 3.0 1.0) -( 9.0 3.0 1.0) -( 10.0 3.0 1.0) -( 0.0 4.0 1.0) -( 1.0 4.0 1.0) -( 2.0 4.0 1.0) -( 3.0 4.0 1.0) -( 4.0 4.0 1.0) -( 5.0 4.0 1.0) -( 6.0 4.0 1.0) -( 7.0 4.0 1.0) -( 8.0 4.0 1.0) -( 9.0 4.0 1.0) -( 10.0 4.0 1.0) -( 0.0 5.0 1.0) -( 1.0 5.0 1.0) -( 2.0 5.0 1.0) -( 3.0 5.0 1.0) -( 4.0 5.0 1.0) -( 5.0 5.0 1.0) -( 6.0 5.0 1.0) -( 7.0 5.0 1.0) -( 8.0 5.0 1.0) -( 9.0 5.0 1.0) -( 10.0 5.0 1.0) -( 0.0 6.0 1.0) -( 1.0 6.0 1.0) -( 2.0 6.0 1.0) -( 3.0 6.0 1.0) -( 4.0 6.0 1.0) -( 5.0 6.0 1.0) -( 6.0 6.0 1.0) -( 7.0 6.0 1.0) -( 8.0 6.0 1.0) -( 9.0 6.0 1.0) -( 10.0 6.0 1.0) -( 0.0 7.0 1.0) -( 1.0 7.0 1.0) -( 2.0 7.0 1.0) -( 3.0 7.0 1.0) -( 4.0 7.0 1.0) -( 5.0 7.0 1.0) -( 6.0 7.0 1.0) -( 7.0 7.0 1.0) -( 8.0 7.0 1.0) -( 9.0 7.0 1.0) -( 10.0 7.0 1.0) -( 0.0 0.0 2.0) -( 1.0 0.0 2.0) -( 2.0 0.0 2.0) -( 3.0 0.0 2.0) -( 4.0 0.0 2.0) -( 5.0 0.0 2.0) -( 6.0 0.0 2.0) -( 7.0 0.0 2.0) -( 8.0 0.0 2.0) -( 9.0 0.0 2.0) -( 10.0 0.0 2.0) -( 0.0 1.0 2.0) -( 1.0 1.0 2.0) -( 2.0 1.0 2.0) -( 3.0 1.0 2.0) -( 4.0 1.0 2.0) -( 5.0 1.0 2.0) -( 6.0 1.0 2.0) -( 7.0 1.0 2.0) -( 8.0 1.0 2.0) -( 9.0 1.0 2.0) -( 10.0 1.0 2.0) -( 0.0 2.0 2.0) -( 1.0 2.0 2.0) -( 2.0 2.0 2.0) -( 3.0 2.0 2.0) -( 4.0 2.0 2.0) -( 5.0 2.0 2.0) -( 6.0 2.0 2.0) -( 7.0 2.0 2.0) -( 8.0 2.0 2.0) -( 9.0 2.0 2.0) -( 10.0 2.0 2.0) -( 0.0 3.0 2.0) -( 1.0 3.0 2.0) -( 2.0 3.0 2.0) -( 3.0 3.0 2.0) -( 4.0 3.0 2.0) -( 5.0 3.0 2.0) -( 6.0 3.0 2.0) -( 7.0 3.0 2.0) -( 8.0 3.0 2.0) -( 9.0 3.0 2.0) -( 10.0 3.0 2.0) -( 0.0 4.0 2.0) -( 1.0 4.0 2.0) -( 2.0 4.0 2.0) -( 3.0 4.0 2.0) -( 4.0 4.0 2.0) -( 5.0 4.0 2.0) -( 6.0 4.0 2.0) -( 7.0 4.0 2.0) -( 8.0 4.0 2.0) -( 9.0 4.0 2.0) -( 10.0 4.0 2.0) -( 0.0 5.0 2.0) -( 1.0 5.0 2.0) -( 2.0 5.0 2.0) -( 3.0 5.0 2.0) -( 4.0 5.0 2.0) -( 5.0 5.0 2.0) -( 6.0 5.0 2.0) -( 7.0 5.0 2.0) -( 8.0 5.0 2.0) -( 9.0 5.0 2.0) -( 10.0 5.0 2.0) -( 0.0 6.0 2.0) -( 1.0 6.0 2.0) -( 2.0 6.0 2.0) -( 3.0 6.0 2.0) -( 4.0 6.0 2.0) -( 5.0 6.0 2.0) -( 6.0 6.0 2.0) -( 7.0 6.0 2.0) -( 8.0 6.0 2.0) -( 9.0 6.0 2.0) -( 10.0 6.0 2.0) -( 0.0 7.0 2.0) -( 1.0 7.0 2.0) -( 2.0 7.0 2.0) -( 3.0 7.0 2.0) -( 4.0 7.0 2.0) -( 5.0 7.0 2.0) -( 6.0 7.0 2.0) -( 7.0 7.0 2.0) -( 8.0 7.0 2.0) -( 9.0 7.0 2.0) -( 10.0 7.0 2.0) -( 0.0 0.0 3.0) -( 1.0 0.0 3.0) -( 2.0 0.0 3.0) -( 3.0 0.0 3.0) -( 4.0 0.0 3.0) -( 5.0 0.0 3.0) -( 6.0 0.0 3.0) -( 7.0 0.0 3.0) -( 8.0 0.0 3.0) -( 9.0 0.0 3.0) -( 10.0 0.0 3.0) -( 0.0 1.0 3.0) -( 1.0 1.0 3.0) -( 2.0 1.0 3.0) -( 3.0 1.0 3.0) -( 4.0 1.0 3.0) -( 5.0 1.0 3.0) -( 6.0 1.0 3.0) -( 7.0 1.0 3.0) -( 8.0 1.0 3.0) -( 9.0 1.0 3.0) -( 10.0 1.0 3.0) -( 0.0 2.0 3.0) -( 1.0 2.0 3.0) -( 2.0 2.0 3.0) -( 3.0 2.0 3.0) -( 4.0 2.0 3.0) -( 5.0 2.0 3.0) -( 6.0 2.0 3.0) -( 7.0 2.0 3.0) -( 8.0 2.0 3.0) -( 9.0 2.0 3.0) -( 10.0 2.0 3.0) -( 0.0 3.0 3.0) -( 1.0 3.0 3.0) -( 2.0 3.0 3.0) -( 3.0 3.0 3.0) -( 4.0 3.0 3.0) -( 5.0 3.0 3.0) -( 6.0 3.0 3.0) -( 7.0 3.0 3.0) -( 8.0 3.0 3.0) -( 9.0 3.0 3.0) -( 10.0 3.0 3.0) -( 0.0 4.0 3.0) -( 1.0 4.0 3.0) -( 2.0 4.0 3.0) -( 3.0 4.0 3.0) -( 4.0 4.0 3.0) -( 5.0 4.0 3.0) -( 6.0 4.0 3.0) -( 7.0 4.0 3.0) -( 8.0 4.0 3.0) -( 9.0 4.0 3.0) -( 10.0 4.0 3.0) -( 0.0 5.0 3.0) -( 1.0 5.0 3.0) -( 2.0 5.0 3.0) -( 3.0 5.0 3.0) -( 4.0 5.0 3.0) -( 5.0 5.0 3.0) -( 6.0 5.0 3.0) -( 7.0 5.0 3.0) -( 8.0 5.0 3.0) -( 9.0 5.0 3.0) -( 10.0 5.0 3.0) -( 0.0 6.0 3.0) -( 1.0 6.0 3.0) -( 2.0 6.0 3.0) -( 3.0 6.0 3.0) -( 4.0 6.0 3.0) -( 5.0 6.0 3.0) -( 6.0 6.0 3.0) -( 7.0 6.0 3.0) -( 8.0 6.0 3.0) -( 9.0 6.0 3.0) -( 10.0 6.0 3.0) -( 0.0 7.0 3.0) -( 1.0 7.0 3.0) -( 2.0 7.0 3.0) -( 3.0 7.0 3.0) -( 4.0 7.0 3.0) -( 5.0 7.0 3.0) -( 6.0 7.0 3.0) -( 7.0 7.0 3.0) -( 8.0 7.0 3.0) -( 9.0 7.0 3.0) -( 10.0 7.0 3.0) -( 0.0 0.0 4.0) -( 1.0 0.0 4.0) -( 2.0 0.0 4.0) -( 3.0 0.0 4.0) -( 4.0 0.0 4.0) -( 5.0 0.0 4.0) -( 6.0 0.0 4.0) -( 7.0 0.0 4.0) -( 8.0 0.0 4.0) -( 9.0 0.0 4.0) -( 10.0 0.0 4.0) -( 0.0 1.0 4.0) -( 1.0 1.0 4.0) -( 2.0 1.0 4.0) -( 3.0 1.0 4.0) -( 4.0 1.0 4.0) -( 5.0 1.0 4.0) -( 6.0 1.0 4.0) -( 7.0 1.0 4.0) -( 8.0 1.0 4.0) -( 9.0 1.0 4.0) -( 10.0 1.0 4.0) -( 0.0 2.0 4.0) -( 1.0 2.0 4.0) -( 2.0 2.0 4.0) -( 3.0 2.0 4.0) -( 4.0 2.0 4.0) -( 5.0 2.0 4.0) -( 6.0 2.0 4.0) -( 7.0 2.0 4.0) -( 8.0 2.0 4.0) -( 9.0 2.0 4.0) -( 10.0 2.0 4.0) -( 0.0 3.0 4.0) -( 1.0 3.0 4.0) -( 2.0 3.0 4.0) -( 3.0 3.0 4.0) -( 4.0 3.0 4.0) -( 5.0 3.0 4.0) -( 6.0 3.0 4.0) -( 7.0 3.0 4.0) -( 8.0 3.0 4.0) -( 9.0 3.0 4.0) -( 10.0 3.0 4.0) -( 0.0 4.0 4.0) -( 1.0 4.0 4.0) -( 2.0 4.0 4.0) -( 3.0 4.0 4.0) -( 4.0 4.0 4.0) -( 5.0 4.0 4.0) -( 6.0 4.0 4.0) -( 7.0 4.0 4.0) -( 8.0 4.0 4.0) -( 9.0 4.0 4.0) -( 10.0 4.0 4.0) -( 0.0 5.0 4.0) -( 1.0 5.0 4.0) -( 2.0 5.0 4.0) -( 3.0 5.0 4.0) -( 4.0 5.0 4.0) -( 5.0 5.0 4.0) -( 6.0 5.0 4.0) -( 7.0 5.0 4.0) -( 8.0 5.0 4.0) -( 9.0 5.0 4.0) -( 10.0 5.0 4.0) -( 0.0 6.0 4.0) -( 1.0 6.0 4.0) -( 2.0 6.0 4.0) -( 3.0 6.0 4.0) -( 4.0 6.0 4.0) -( 5.0 6.0 4.0) -( 6.0 6.0 4.0) -( 7.0 6.0 4.0) -( 8.0 6.0 4.0) -( 9.0 6.0 4.0) -( 10.0 6.0 4.0) -( 0.0 7.0 4.0) -( 1.0 7.0 4.0) -( 2.0 7.0 4.0) -( 3.0 7.0 4.0) -( 4.0 7.0 4.0) -( 5.0 7.0 4.0) -( 6.0 7.0 4.0) -( 7.0 7.0 4.0) -( 8.0 7.0 4.0) -( 9.0 7.0 4.0) -( 10.0 7.0 4.0) -( 0.0 0.0 5.0) -( 1.0 0.0 5.0) -( 2.0 0.0 5.0) -( 3.0 0.0 5.0) -( 4.0 0.0 5.0) -( 5.0 0.0 5.0) -( 6.0 0.0 5.0) -( 7.0 0.0 5.0) -( 8.0 0.0 5.0) -( 9.0 0.0 5.0) -( 10.0 0.0 5.0) -( 0.0 1.0 5.0) -( 1.0 1.0 5.0) -( 2.0 1.0 5.0) -( 3.0 1.0 5.0) -( 4.0 1.0 5.0) -( 5.0 1.0 5.0) -( 6.0 1.0 5.0) -( 7.0 1.0 5.0) -( 8.0 1.0 5.0) -( 9.0 1.0 5.0) -( 10.0 1.0 5.0) -( 0.0 2.0 5.0) -( 1.0 2.0 5.0) -( 2.0 2.0 5.0) -( 3.0 2.0 5.0) -( 4.0 2.0 5.0) -( 5.0 2.0 5.0) -( 6.0 2.0 5.0) -( 7.0 2.0 5.0) -( 8.0 2.0 5.0) -( 9.0 2.0 5.0) -( 10.0 2.0 5.0) -( 0.0 3.0 5.0) -( 1.0 3.0 5.0) -( 2.0 3.0 5.0) -( 3.0 3.0 5.0) -( 4.0 3.0 5.0) -( 5.0 3.0 5.0) -( 6.0 3.0 5.0) -( 7.0 3.0 5.0) -( 8.0 3.0 5.0) -( 9.0 3.0 5.0) -( 10.0 3.0 5.0) -( 0.0 4.0 5.0) -( 1.0 4.0 5.0) -( 2.0 4.0 5.0) -( 3.0 4.0 5.0) -( 4.0 4.0 5.0) -( 5.0 4.0 5.0) -( 6.0 4.0 5.0) -( 7.0 4.0 5.0) -( 8.0 4.0 5.0) -( 9.0 4.0 5.0) -( 10.0 4.0 5.0) -( 0.0 5.0 5.0) -( 1.0 5.0 5.0) -( 2.0 5.0 5.0) -( 3.0 5.0 5.0) -( 4.0 5.0 5.0) -( 5.0 5.0 5.0) -( 6.0 5.0 5.0) -( 7.0 5.0 5.0) -( 8.0 5.0 5.0) -( 9.0 5.0 5.0) -( 10.0 5.0 5.0) -( 0.0 6.0 5.0) -( 1.0 6.0 5.0) -( 2.0 6.0 5.0) -( 3.0 6.0 5.0) -( 4.0 6.0 5.0) -( 5.0 6.0 5.0) -( 6.0 6.0 5.0) -( 7.0 6.0 5.0) -( 8.0 6.0 5.0) -( 9.0 6.0 5.0) -( 10.0 6.0 5.0) -( 0.0 7.0 5.0) -( 1.0 7.0 5.0) -( 2.0 7.0 5.0) -( 3.0 7.0 5.0) -( 4.0 7.0 5.0) -( 5.0 7.0 5.0) -( 6.0 7.0 5.0) -( 7.0 7.0 5.0) -( 8.0 7.0 5.0) -( 9.0 7.0 5.0) -( 10.0 7.0 5.0) -); - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -blocks -( - - //block 0 -hex (0 1 12 11 88 89 100 99 ) -( 10 10 10 ) -SimpleGrading (1 1 1) - - //block 1 -hex (1 2 13 12 89 90 101 100 ) -( 10 10 10 ) -SimpleGrading (1 1 1) - - //block 2 -hex (2 3 14 13 90 91 102 101 ) -( 10 10 10 ) -SimpleGrading (1 1 1) - - //block 3 -hex (3 4 15 14 91 92 103 102 ) -( 10 10 10 ) -SimpleGrading (1 1 1) - - //block 4 -hex (4 5 16 15 92 93 104 103 ) -( 10 10 10 ) -SimpleGrading (1 1 1) - - //block 5 -hex (5 6 17 16 93 94 105 104 ) -( 10 10 10 ) -SimpleGrading (1 1 1) - - //block 6 -hex (6 7 18 17 94 95 106 105 ) -( 10 10 10 ) -SimpleGrading (1 1 1) - - //block 7 -hex (7 8 19 18 95 96 107 106 ) -( 10 10 10 ) -SimpleGrading (1 1 1) - - //block 8 -hex (8 9 20 19 96 97 108 107 ) -( 10 10 10 ) -SimpleGrading (1 1 1) - - //block 9 -hex (9 10 21 20 97 98 109 108 ) -( 10 10 10 ) -SimpleGrading (1 1 1) - - //block 10 -hex (97 98 109 108 185 186 197 196 ) -( 10 10 10 ) -SimpleGrading (1 1 1) - - //block 11 -hex (185 186 197 196 273 274 285 284 ) -( 10 10 10 ) -SimpleGrading (1 1 1) - - //block 12 -hex (273 274 285 284 361 362 373 372 ) -( 10 10 10 ) -SimpleGrading (1 1 1) - - //block 13 -hex (361 362 373 372 449 450 461 460 ) -( 10 10 10 ) -SimpleGrading (1 1 1) - - //block 14 -hex (360 361 372 371 448 449 460 459 ) -( 10 10 10 ) -SimpleGrading (1 1 1) - - //block 15 -hex (359 360 371 370 447 448 459 458 ) -( 10 10 10 ) -SimpleGrading (1 1 1) - - //block 16 -hex (358 359 370 369 446 447 458 457 ) -( 10 10 10 ) -SimpleGrading (1 1 1) - - //block 17 -hex (357 358 369 368 445 446 457 456 ) -( 10 10 10 ) -SimpleGrading (1 1 1) - - //block 18 -hex (356 357 368 367 444 445 456 455 ) -( 10 10 10 ) -SimpleGrading (1 1 1) - - //block 19 -hex (355 356 367 366 443 444 455 454 ) -( 10 10 10 ) -SimpleGrading (1 1 1) - - //block 20 -hex (354 355 366 365 442 443 454 453 ) -( 10 10 10 ) -SimpleGrading (1 1 1) - - //block 21 -hex (353 354 365 364 441 442 453 452 ) -( 10 10 10 ) -SimpleGrading (1 1 1) - - //block 22 -hex (352 353 364 363 440 441 452 451 ) -( 10 10 10 ) -SimpleGrading (1 1 1) - - //block 23 -hex (363 364 375 374 451 452 463 462 ) -( 10 10 10 ) -SimpleGrading (1 1 1) - - //block 24 -hex (374 375 386 385 462 463 474 473 ) -( 10 10 10 ) -SimpleGrading (1 1 1) - - //block 25 -hex (385 386 397 396 473 474 485 484 ) -( 10 10 10 ) -SimpleGrading (1 1 1) - - //block 26 -hex (396 397 408 407 484 485 496 495 ) -( 10 10 10 ) -SimpleGrading (1 1 1) - - //block 27 -hex (407 408 419 418 495 496 507 506 ) -( 10 10 10 ) -SimpleGrading (1 1 1) - - //block 28 -hex (418 419 430 429 506 507 518 517 ) -( 10 10 10 ) -SimpleGrading (1 1 1) - - //block 29 -hex (308 309 320 319 396 397 408 407 ) -( 10 10 10 ) -SimpleGrading (1 1 1) - - //block 30 -hex (220 221 232 231 308 309 320 319 ) -( 10 10 10 ) -SimpleGrading (1 1 1) - - //block 31 -hex (132 133 144 143 220 221 232 231 ) -( 10 10 10 ) -SimpleGrading (1 1 1) - - //block 32 -hex (44 45 56 55 132 133 144 143 ) -( 10 10 10 ) -SimpleGrading (1 1 1) - - //block 33 -hex (55 56 67 66 143 144 155 154 ) -( 10 10 10 ) -SimpleGrading (1 1 1) - - //block 34 -hex (66 67 78 77 154 155 166 165 ) -( 10 10 10 ) -SimpleGrading (1 1 1) - - //block 35 -hex (33 34 45 44 121 122 133 132 ) -( 10 10 10 ) -SimpleGrading (1 1 1) - - //block 36 -hex (22 23 34 33 110 111 122 121 ) -( 10 10 10 ) -SimpleGrading (1 1 1) - - //block 37 -hex (11 12 23 22 99 100 111 110 ) -( 10 10 10 ) -SimpleGrading (1 1 1) -); - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -defaultPatch -{ type wall;} - -patches -( -); diff --git a/OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch/system/controlDict b/OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch/system/controlDict deleted file mode 100644 index 7374023a..00000000 --- a/OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch/system/controlDict +++ /dev/null @@ -1,67 +0,0 @@ -/*--------------------------------*- C++ -*----------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | Website: https://openfoam.org - \\ / A nd | Version: dev - \\/ M anipulation | -\*---------------------------------------------------------------------------*/ -FoamFile -{ - format ascii; - class dictionary; - location "system"; - object controlDict; -} -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -application multiphaseEulerFoam; - -startFrom latestTime;//startTime; - -startTime 0; - -stopAt endTime; - -endTime 100; - -deltaT 0.0001; - -writeControl adjustableRunTime; - -writeInterval 2; - -purgeWrite 0; - -writeFormat ascii; - -writePrecision 6; - -writeCompression off; - -timeFormat general; - -timePrecision 6; - -runTimeModifiable yes; - -adjustTimeStep yes; - -maxCo 0.5; - -maxDeltaT 0.0005; - - -functions -{ - - #includeFunc writeObjects(d.gas) - #includeFunc writeObjects(thermo:rho.gas) - #includeFunc writeObjects(thermo:rho.liquid) -} -//functions -//{ -// #includeFunc fieldAverage(U.air, U.water, alpha.air, p) -//} - - -// ************************************************************************* // diff --git a/OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch/system/decomposeParDict b/OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch/system/decomposeParDict deleted file mode 100755 index f8397e73..00000000 --- a/OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch/system/decomposeParDict +++ /dev/null @@ -1,30 +0,0 @@ -/*--------------------------------*- C++ -*----------------------------------*\ -| ========= | | -| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | -| \\ / O peration | Version: 3.0.x | -| \\ / A nd | Web: www.OpenFOAM.org | -| \\/ M anipulation | | -\*---------------------------------------------------------------------------*/ -FoamFile -{ - version 2.0; - format ascii; - class dictionary; - object decomposeParDict; -} - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -numberOfSubdomains 16; - -method scotch; - -hierarchicalCoeffs -{ - n (4 4 1); - delta 0.001; - order xyz; -} - - -// ************************************************************************* // diff --git a/OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch/system/fvConstraints b/OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch/system/fvConstraints deleted file mode 100644 index 334f1c8f..00000000 --- a/OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch/system/fvConstraints +++ /dev/null @@ -1,56 +0,0 @@ -/*--------------------------------*- C++ -*----------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | Website: https://openfoam.org - \\ / A nd | Version: dev - \\/ M anipulation | -\*---------------------------------------------------------------------------*/ -FoamFile -{ - format ascii; - class dictionary; - object fvConstraints; -} -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -limitp -{ - type limitPressure; - - min 1e4; -} -limitUliq -{ - type limitVelocity; - active yes; - U U.liquid; - selectionMode all; - max 1e1; -} -limitUgas -{ - type limitVelocity; - active yes; - U U.gas; - selectionMode all; - max 2e1; -} -limitTgas -{ - type limitTemperature; - selectionMode all; - min 290; - max 310; - phase gas; -} -limitTliq -{ - type limitTemperature; - selectionMode all; - min 290; - max 310; - phase liquid; -} - - -// ************************************************************************* // diff --git a/OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch/system/fvSchemes b/OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch/system/fvSchemes deleted file mode 100644 index 52e6e13a..00000000 --- a/OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch/system/fvSchemes +++ /dev/null @@ -1,70 +0,0 @@ -/*--------------------------------*- C++ -*----------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | Website: https://openfoam.org - \\ / A nd | Version: dev - \\/ M anipulation | -\*---------------------------------------------------------------------------*/ -FoamFile -{ - format ascii; - class dictionary; - location "system"; - object fvSchemes; -} -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -ddtSchemes -{ - default Euler; -} - -gradSchemes -{ - default Gauss linear; - limited cellLimited Gauss linear 1; -} - -divSchemes -{ - default none; - - "div\(phi,alpha.*\)" Gauss vanLeer; - - "div\(phir,alpha.*,alpha.*\)" Gauss vanLeer; - - "div\(alphaRhoPhi.*,U.*\)" Gauss limitedLinearV 1; - "div\(phi.*,U.*\)" Gauss limitedLinearV 1; - "div\(alphaRhoPhi.*,Yi\)" Gauss limitedLinear 1; - "div\(alphaRhoPhi.*,(h|e).*\)" Gauss limitedLinear 1; - "div\(alphaRhoPhi.*,(K|k|epsilon|omega).*\)" Gauss limitedLinear 1; - "div\(alphaPhi.*,f.*\)" Gauss limitedLinear 1; - "div\(alphaRhoPhi.*,\(p\|thermo:rho.*\)\)" Gauss limitedLinear 1; - - "div\(phim,(k|epsilon)m\)" Gauss upwind; - "div\(\(\(\(alpha.*\*thermo:rho.*\)*nuEff.*\)*dev2\(T\(grad\(U.*\)\)\)\)\)" Gauss linear; -} - -laplacianSchemes -{ - default Gauss linear corrected; -} - -interpolationSchemes -{ - default linear; -} - -snGradSchemes -{ - default uncorrected; -} - -wallDist -{ - method Poisson; - nRequired true; -} - - -// ************************************************************************* // diff --git a/OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch/system/fvSolution b/OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch/system/fvSolution deleted file mode 100644 index 2e69fdfa..00000000 --- a/OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch/system/fvSolution +++ /dev/null @@ -1,120 +0,0 @@ -/*--------------------------------*- C++ -*----------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | Website: https://openfoam.org - \\ / A nd | Version: dev - \\/ M anipulation | -\*---------------------------------------------------------------------------*/ -FoamFile -{ - format ascii; - class dictionary; - location "system"; - object fvSolution; -} -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -solvers -{ - "alpha.*" - { - nAlphaCorr 2; - nAlphaSubCycles 5; - } - - bubbles - { - nCorr 1; - tolerance 1e-4; - scale true; - solveOnFinalIterOnly true; - sourceUpdateInterval 1; - } - - p_rgh - { - solver GAMG; - smoother DIC; - tolerance 1e-7; - relTol 0; - } - - p_rghFinal - { - $p_rgh; - relTol 0; - } - - "(k|omega).*" - { - solver smoothSolver; - smoother symGaussSeidel; - tolerance 1e-7; - relTol 0; - minIter 1; - } - - "(e|h).*" - { - solver smoothSolver; - smoother symGaussSeidel; - tolerance 1e-8; - relTol 0; - minIter 0; - maxIter 3; - } - - "f.*" - { - solver PBiCGStab; - preconditioner DILU; - tolerance 1e-6; - relTol 0; - } - - "Yi.*" - { - solver PBiCGStab; - preconditioner DILU; - tolerance 1e-12; - relTol 0; - residualAlpha 1e-8; - } - - "U.*" - { - solver smoothSolver; - smoother symGaussSeidel; - tolerance 1e-5; - relTol 0; - minIter 1; - } - - yPsi - { - solver PCG; - preconditioner DIC; - tolerance 1e-10; - relTol 0; - } - -} - -PIMPLE -{ - nOuterCorrectors 3; - nCorrectors 1; - nNonOrthogonalCorrectors 0; - -} - -relaxationFactors -{ - equations - { - ".*" 1; - } -} - - -// ************************************************************************* // diff --git a/OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch/system/inlets_outlets.json b/OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch/system/inlets_outlets.json deleted file mode 100644 index 2b53da73..00000000 --- a/OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch/system/inlets_outlets.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "Geometry": { - "OverallDomain": { - "x" : {"nblocks": 10, "size_per_block": 1.0}, - "y" : {"nblocks": 11, "size_per_block": 1.0}, - "z" : {"nblocks": 5, "size_per_block": 1.0} - }, - "Fluids": [ - [ [0,0,0], [9,0,0] ], - [ [9,0,0], [9,0,4] ], - [ [9,0,4], [0,0,4] ], - [ [0,1,4], [0,4,4] ], - [ [0,4,4], [0,10,4] ], - [ [0,4,4], [0,4,0] ], - [ [0,4,0], [0,10,0] ], - [ [0,4,0], [0,1,0] ] - ] - }, - "inlets": [ - {"branch_id": 0, "type": "circle", "frac_space": 0.2222222222222222, "normal_dir": 1, "radius": 0.4, "nelements": 50, "block_pos": "bottom"}, - {"branch_id": 0, "type": "circle", "frac_space": 0.5, "radius": 0.4, "normal_dir": 1,"nelements": 50, "block_pos": "bottom"}, - {"branch_id": 0, "type": "circle", "frac_space": 0.7777777777777778, "radius": 0.4, "normal_dir": 1,"nelements": 50, "block_pos": "bottom"} - ], - "outlets": [ - {"branch_id": 6, "type": "circle", "frac_space": 1, "normal_dir": 1, "radius": 0.4, "nelements": 50, "block_pos": "top"}, - {"branch_id": 4, "type": "circle", "frac_space": 1, "normal_dir": 1, "radius": 0.4, "nelements": 50, "block_pos": "top"} - ] -} diff --git a/OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch/system/mesh.json b/OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch/system/mesh.json deleted file mode 100644 index 29841d7e..00000000 --- a/OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch/system/mesh.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "Meshing": { - "Blockwise": { - "x" : 10, - "y" : 10, - "z" : 10 - } - }, - "Geometry": { - "OverallDomain": { - "x" : {"nblocks": 10, "size_per_block": 1.0}, - "y" : {"nblocks": 11, "size_per_block": 1.0}, - "z" : {"nblocks": 5, "size_per_block": 1.0} - }, - "Fluids": [ - [ [0,0,0], [9,0,0] ], - [ [9,0,0], [9,0,4] ], - [ [9,0,4], [0,0,4] ], - [ [0,1,4], [0,4,4] ], - [ [0,4,4], [0,10,4] ], - [ [0,4,4], [0,4,0] ], - [ [0,4,0], [0,10,0] ], - [ [0,4,0], [0,1,0] ] - ] - } -} diff --git a/OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch/system/mixers.json b/OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch/system/mixers.json deleted file mode 100644 index 0106f58d..00000000 --- a/OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch/system/mixers.json +++ /dev/null @@ -1,29 +0,0 @@ -{ - "Meshing": { - "Blockwise": { - "x" : 10, - "y" : 10, - "z" : 10 - } - }, - "Geometry": { - "OverallDomain": { - "x" : {"nblocks": 10, "size_per_block": 1.0, "rescale": 0.05}, - "y" : {"nblocks": 11, "size_per_block": 1.0, "rescale": 0.05}, - "z" : {"nblocks": 5, "size_per_block": 1.0, "rescale": 0.05} - }, - "Fluids": [ - [ [0,0,0], [9,0,0] ], - [ [9,0,0], [9,0,4] ], - [ [9,0,4], [0,0,4] ], - [ [0,1,4], [0,4,4] ], - [ [0,4,4], [0,10,4] ], - [ [0,4,4], [0,4,0] ], - [ [0,4,0], [0,10,0] ], - [ [0,4,0], [0,1,0] ] - ] - }, - "mixers": [ - {"branch_id": 2, "frac_space": 0.5, "start_time": 1, "power": 2.5, "sign": "+"} - ] -} diff --git a/OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch/system/setFieldsDict b/OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch/system/setFieldsDict deleted file mode 100644 index 7faaeb15..00000000 --- a/OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch/system/setFieldsDict +++ /dev/null @@ -1,37 +0,0 @@ -/*--------------------------------*- C++ -*----------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | Website: https://openfoam.org - \\ / A nd | Version: dev - \\/ M anipulation | -\*---------------------------------------------------------------------------*/ -FoamFile -{ - format ascii; - class dictionary; - location "system"; - object setFieldsDict; -} -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -defaultFieldValues -( - volScalarFieldValue alpha.gas 0.99 - volScalarFieldValue alpha.liquid 0.01 -); - -regions -( - boxToCell - { - box (-1.0 -1.0 -1.0) (10 0.2 10.0); - fieldValues - ( - volScalarFieldValue alpha.gas 0.01 - volScalarFieldValue alpha.liquid 0.99 - ); - } -); - - -// ************************************************************************* // diff --git a/OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch/writeGlobalVars.py b/OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch/writeGlobalVars.py deleted file mode 100644 index 0594eccc..00000000 --- a/OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch/writeGlobalVars.py +++ /dev/null @@ -1,47 +0,0 @@ -import os - -import numpy as np - -from bird.utilities.ofio import * - - -def writeGvars(inletA, liqVol): - filename_tmp = os.path.join("constant", "globalVars_temp") - with open(filename_tmp, "r+") as f: - lines = f.readlines() - filename = os.path.join("constant", "globalVars") - with open(filename, "w+") as f: - for line in lines: - if line.startswith("inletA"): - f.write(f"inletA\t{inletA:g};\n") - elif line.startswith("liqVol"): - f.write(f"liqVol\t{liqVol:g};\n") - else: - f.write(line) - - -def readInletArea(): - filename = os.path.join( - "postProcessing", - "patchIntegrate(patch=inlet,field=alpha.gas)", - "0", - "surfaceFieldValue.dat", - ) - with open(filename, "r+") as f: - lines = f.readlines() - return float(lines[4].split()[-1]) - - -def getLiqVol(): - cellCentres = readMesh(os.path.join(".", f"meshCellCentres_0.obj")) - volume_field = readOFScal(os.path.join("0", "V"), len(cellCentres)) - alpha_field = readOFScal( - os.path.join("0", "alpha.liquid"), len(cellCentres) - ) - return np.sum(volume_field * alpha_field) - - -if __name__ == "__main__": - A = readInletArea() - V = getLiqVol() - writeGvars(A, V) diff --git a/OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch_scaleup/.vim/.netrwhist b/OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch_scaleup/.vim/.netrwhist deleted file mode 100644 index b9691c3b..00000000 --- a/OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch_scaleup/.vim/.netrwhist +++ /dev/null @@ -1,3 +0,0 @@ -let g:netrw_dirhistmax =10 -let g:netrw_dirhistcnt =1 -let g:netrw_dirhist_1='/home/openfoam/postProcessing/patchIntegrate(patch=inlet,field=alpha.gas)/0' diff --git a/OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch_scaleup/0.orig/CO2.gas b/OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch_scaleup/0.orig/CO2.gas deleted file mode 100644 index e4165b1a..00000000 --- a/OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch_scaleup/0.orig/CO2.gas +++ /dev/null @@ -1,47 +0,0 @@ -/*--------------------------------*- C++ -*----------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | Website: https://openfoam.org - \\ / A nd | Version: 9 - \\/ M anipulation | -\*---------------------------------------------------------------------------*/ -FoamFile -{ - format ascii; - class volScalarField; - object CO2.gas; -} -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -dimensions [0 0 0 0 0 0 0]; - -#include "${FOAM_CASE}/constant/globalVars" - -internalField uniform 0; - - -boundaryField -{ - #includeEtc "caseDicts/setConstraintTypes" - - inlet - { - type fixedValue; - value uniform $f_CO2; - } - - outlet - { - //type inletOutlet; - //phi phi.gas; - //inletValue $f_CO2; - //value $f_CO2; - type zeroGradient; - } - - defaultFaces - { - type zeroGradient; - } -} - -// ************************************************************************* // diff --git a/OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch_scaleup/0.orig/CO2.liquid b/OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch_scaleup/0.orig/CO2.liquid deleted file mode 100644 index 4b8ea6a0..00000000 --- a/OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch_scaleup/0.orig/CO2.liquid +++ /dev/null @@ -1,42 +0,0 @@ -/*--------------------------------*- C++ -*----------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | Website: https://openfoam.org - \\ / A nd | Version: 9 - \\/ M anipulation | -\*---------------------------------------------------------------------------*/ -FoamFile -{ - format ascii; - class volScalarField; - object CO2.liquid; -} -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -dimensions [0 0 0 0 0 0 0]; - -internalField uniform 0.0; - -boundaryField -{ - #includeEtc "caseDicts/setConstraintTypes" - - inlet - { - type zeroGradient; - //type fixedValue; - //value uniform 0.0; - } - - outlet - { - type zeroGradient; - } - - defaultFaces - { - type zeroGradient; - } -} - -// ************************************************************************* // diff --git a/OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch_scaleup/0.orig/H2.gas b/OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch_scaleup/0.orig/H2.gas deleted file mode 100644 index 9f66b2d2..00000000 --- a/OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch_scaleup/0.orig/H2.gas +++ /dev/null @@ -1,47 +0,0 @@ -/*--------------------------------*- C++ -*----------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | Website: https://openfoam.org - \\ / A nd | Version: 9 - \\/ M anipulation | -\*---------------------------------------------------------------------------*/ -FoamFile -{ - format ascii; - class volScalarField; - object H2.gas; -} -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -dimensions [0 0 0 0 0 0 0]; - -#include "${FOAM_CASE}/constant/globalVars" - -internalField uniform 0; - - -boundaryField -{ - #includeEtc "caseDicts/setConstraintTypes" - - inlet - { - type fixedValue; - value uniform $f_H2; - } - - outlet - { - //type inletOutlet; - //phi phi.gas; - //inletValue $f_H2; - //value $f_H2; - type zeroGradient; - } - - defaultFaces - { - type zeroGradient; - } -} - -// ************************************************************************* // diff --git a/OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch_scaleup/0.orig/H2.liquid b/OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch_scaleup/0.orig/H2.liquid deleted file mode 100644 index 65ae8d34..00000000 --- a/OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch_scaleup/0.orig/H2.liquid +++ /dev/null @@ -1,42 +0,0 @@ -/*--------------------------------*- C++ -*----------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | Website: https://openfoam.org - \\ / A nd | Version: 9 - \\/ M anipulation | -\*---------------------------------------------------------------------------*/ -FoamFile -{ - format ascii; - class volScalarField; - object H2.liquid; -} -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -dimensions [0 0 0 0 0 0 0]; - -internalField uniform 0.0; - -boundaryField -{ - #includeEtc "caseDicts/setConstraintTypes" - - inlet - { - type zeroGradient; - //type fixedValue; - //value uniform 0.0; - } - - outlet - { - type zeroGradient; - } - - defaultFaces - { - type zeroGradient; - } -} - -// ************************************************************************* // diff --git a/OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch_scaleup/0.orig/N2.gas b/OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch_scaleup/0.orig/N2.gas deleted file mode 100644 index c1d7225f..00000000 --- a/OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch_scaleup/0.orig/N2.gas +++ /dev/null @@ -1,47 +0,0 @@ -/*--------------------------------*- C++ -*----------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | Website: https://openfoam.org - \\ / A nd | Version: 9 - \\/ M anipulation | -\*---------------------------------------------------------------------------*/ -FoamFile -{ - format ascii; - class volScalarField; - object N2.gas; -} -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -dimensions [0 0 0 0 0 0 0]; - -#include "${FOAM_CASE}/constant/globalVars" - -internalField uniform 1; - - -boundaryField -{ - #includeEtc "caseDicts/setConstraintTypes" - - inlet - { - type fixedValue; - value uniform $f_N2; - } - - outlet - { - //type inletOutlet; - //phi phi.gas; - //inletValue $f_N2; - //value $f_N2; - type zeroGradient; - } - - defaultFaces - { - type zeroGradient; - } -} - -// ************************************************************************* // diff --git a/OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch_scaleup/0.orig/T.gas b/OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch_scaleup/0.orig/T.gas deleted file mode 100644 index bf0199a0..00000000 --- a/OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch_scaleup/0.orig/T.gas +++ /dev/null @@ -1,44 +0,0 @@ -/*--------------------------------*- C++ -*----------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | Website: https://openfoam.org - \\ / A nd | Version: 9 - \\/ M anipulation | -\*---------------------------------------------------------------------------*/ -FoamFile -{ - format ascii; - class volScalarField; - object T.gas; -} -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -dimensions [0 0 0 1 0 0 0]; - -internalField uniform 300; - -boundaryField -{ - #includeEtc "caseDicts/setConstraintTypes" - - inlet - { - type fixedValue; - value $internalField; - } - - outlet - { - type inletOutlet; - phi phi.gas; - inletValue $internalField; - value $internalField; - } - - defaultFaces - { - type zeroGradient; - } -} - -// ************************************************************************* // diff --git a/OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch_scaleup/0.orig/T.liquid b/OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch_scaleup/0.orig/T.liquid deleted file mode 100644 index 7101ea31..00000000 --- a/OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch_scaleup/0.orig/T.liquid +++ /dev/null @@ -1,43 +0,0 @@ -/*--------------------------------*- C++ -*----------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | Website: https://openfoam.org - \\ / A nd | Version: 9 - \\/ M anipulation | -\*---------------------------------------------------------------------------*/ -FoamFile -{ - format ascii; - class volScalarField; - object T.liquid; -} -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -dimensions [0 0 0 1 0 0 0]; - -internalField uniform 300; - -boundaryField -{ - #includeEtc "caseDicts/setConstraintTypes" - - outlet - { - type inletOutlet; - phi phi.liquid; - inletValue $internalField; - value $internalField; - } - inlet - { - type fixedValue; - value $internalField; - } - defaultFaces - { - type zeroGradient; - } - -} - -// ************************************************************************* // diff --git a/OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch_scaleup/0.orig/U.gas b/OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch_scaleup/0.orig/U.gas deleted file mode 100644 index e696566f..00000000 --- a/OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch_scaleup/0.orig/U.gas +++ /dev/null @@ -1,47 +0,0 @@ -/*--------------------------------*- C++ -*----------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | Website: https://openfoam.org - \\ / A nd | Version: dev - \\/ M anipulation | -\*---------------------------------------------------------------------------*/ -FoamFile -{ - format ascii; - class volVectorField; - object U.gas; -} -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -dimensions [0 1 -1 0 0 0 0]; - -internalField uniform (0 0.0 0); - -#include "${FOAM_CASE}/constant/globalVars" - -boundaryField -{ - #includeEtc "caseDicts/setConstraintTypes" - - inlet - { - //type flowRateInletVelocity; - //massFlowRate $mflowRateGas; - //rho thermo:rho.gas; - //value $internalField; - type fixedValue; - value uniform (0 $uGasPhase 0); - } - outlet - { - type pressureInletOutletVelocity; - phi phi.gas; - value $internalField; - } - defaultFaces - { - type slip; - } -} - -// ************************************************************************* // diff --git a/OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch_scaleup/0.orig/U.liquid b/OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch_scaleup/0.orig/U.liquid deleted file mode 100644 index 1879e020..00000000 --- a/OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch_scaleup/0.orig/U.liquid +++ /dev/null @@ -1,46 +0,0 @@ -/*--------------------------------*- C++ -*----------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | Website: https://openfoam.org - \\ / A nd | Version: dev - \\/ M anipulation | -\*---------------------------------------------------------------------------*/ -FoamFile -{ - format ascii; - class volVectorField; - object U.liquid; -} -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -dimensions [0 1 -1 0 0 0 0]; - -#include "${FOAM_CASE}/constant/globalVars" - -internalField uniform (0 0 0); - -boundaryField -{ - #includeEtc "caseDicts/setConstraintTypes" - - inlet - { - //type flowRateInletVelocity; - //massFlowRate $mflowRateLiq; - //rho thermo:rho.liquid; - //value $internalField; - type fixedValue; - value uniform (0 0 0); - } - outlet - { - type noSlip; - } - defaultFaces - { - type noSlip; - } - -} - -// ************************************************************************* // diff --git a/OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch_scaleup/0.orig/Ydefault.gas b/OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch_scaleup/0.orig/Ydefault.gas deleted file mode 100644 index fba2945d..00000000 --- a/OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch_scaleup/0.orig/Ydefault.gas +++ /dev/null @@ -1,42 +0,0 @@ -/*--------------------------------*- C++ -*----------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | Website: https://openfoam.org - \\ / A nd | Version: 9 - \\/ M anipulation | -\*---------------------------------------------------------------------------*/ -FoamFile -{ - format ascii; - class volScalarField; - object Ydefault.gas; -} -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -dimensions [0 0 0 0 0 0 0]; - -internalField uniform 0.0; - -boundaryField -{ - #includeEtc "caseDicts/setConstraintTypes" - - inlet - { - type fixedValue; - value uniform 0.0; - } - - outlet - { - type zeroGradient; - } - - defaultFaces - { - type zeroGradient; - } -} - - -// ************************************************************************* // diff --git a/OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch_scaleup/0.orig/Ydefault.liquid b/OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch_scaleup/0.orig/Ydefault.liquid deleted file mode 100644 index a5108564..00000000 --- a/OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch_scaleup/0.orig/Ydefault.liquid +++ /dev/null @@ -1,42 +0,0 @@ -/*--------------------------------*- C++ -*----------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | Website: https://openfoam.org - \\ / A nd | Version: 9 - \\/ M anipulation | -\*---------------------------------------------------------------------------*/ -FoamFile -{ - format ascii; - class volScalarField; - object Ydefault.liquid; -} -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -dimensions [0 0 0 0 0 0 0]; - -internalField uniform 1.0; - -boundaryField -{ - #includeEtc "caseDicts/setConstraintTypes" - - inlet - { - type fixedValue; - value uniform 1.0; - } - - outlet - { - type zeroGradient; - } - - defaultFaces - { - type zeroGradient; - } -} - - -// ************************************************************************* // diff --git a/OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch_scaleup/0.orig/alpha.gas b/OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch_scaleup/0.orig/alpha.gas deleted file mode 100644 index 1e303fbe..00000000 --- a/OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch_scaleup/0.orig/alpha.gas +++ /dev/null @@ -1,43 +0,0 @@ -/*--------------------------------*- C++ -*----------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | Website: https://openfoam.org - \\ / A nd | Version: dev - \\/ M anipulation | -\*---------------------------------------------------------------------------*/ -FoamFile -{ - format ascii; - class volScalarField; - location "0"; - object alpha.gas; -} -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -dimensions [0 0 0 0 0 0 0]; - -#include "${FOAM_CASE}/constant/globalVars" - -internalField uniform $alphaGas; - -boundaryField -{ - inlet - { - type fixedValue; - value uniform $alphaGas; - } - outlet - { - type inletOutlet; - phi phi.gas; - inletValue uniform 1; - value uniform 1; - } - defaultFaces - { - type zeroGradient; - } -} - -// ************************************************************************* // diff --git a/OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch_scaleup/0.orig/alpha.liquid b/OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch_scaleup/0.orig/alpha.liquid deleted file mode 100644 index 5c92070b..00000000 --- a/OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch_scaleup/0.orig/alpha.liquid +++ /dev/null @@ -1,40 +0,0 @@ -/*--------------------------------*- C++ -*----------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | Website: https://openfoam.org - \\ / A nd | Version: dev - \\/ M anipulation | -\*---------------------------------------------------------------------------*/ -FoamFile -{ - format ascii; - class volScalarField; - object alpha.liquid; -} -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -dimensions [0 0 0 0 0 0 0]; - -#include "${FOAM_CASE}/constant/globalVars" - -internalField uniform 1; - -boundaryField -{ - inlet - { - type fixedValue; - value uniform $alphaLiq; - } - outlet - { - type fixedValue; - value uniform 0; - } - defaultFaces - { - type zeroGradient; - } -} - -// ************************************************************************* // diff --git a/OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch_scaleup/0.orig/alphat.gas b/OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch_scaleup/0.orig/alphat.gas deleted file mode 100644 index b867958f..00000000 --- a/OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch_scaleup/0.orig/alphat.gas +++ /dev/null @@ -1,46 +0,0 @@ -/*--------------------------------*- C++ -*----------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | Website: https://openfoam.org - \\ / A nd | Version: 9 - \\/ M anipulation | -\*---------------------------------------------------------------------------*/ -FoamFile -{ - format ascii; - class volScalarField; - object alphat.gas; -} -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -dimensions [1 -1 -1 0 0 0 0]; - -internalField uniform 0; - -boundaryField -{ - #includeEtc "caseDicts/setConstraintTypes" - - inlet - { - type calculated; - value $internalField; - } - - outlet - { - type calculated; - value $internalField; - } - - defaultFaces - { - type calculated; - value $internalField; - //type compressible::alphatWallFunction; - //Prt 0.85; - //value $internalField; - } -} - -// ************************************************************************* // diff --git a/OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch_scaleup/0.orig/alphat.liquid b/OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch_scaleup/0.orig/alphat.liquid deleted file mode 100644 index 2569c3ee..00000000 --- a/OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch_scaleup/0.orig/alphat.liquid +++ /dev/null @@ -1,44 +0,0 @@ -/*--------------------------------*- C++ -*----------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | Website: https://openfoam.org - \\ / A nd | Version: 9 - \\/ M anipulation | -\*---------------------------------------------------------------------------*/ -FoamFile -{ - format ascii; - class volScalarField; - object alphat.liquid; -} -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -dimensions [1 -1 -1 0 0 0 0]; - -internalField uniform 0; - -boundaryField -{ - #includeEtc "caseDicts/setConstraintTypes" - - inlet - { - type calculated; - value $internalField; - } - - outlet - { - type calculated; - value $internalField; - } - - defaultFaces - { - type compressible::alphatWallFunction; - Prt 0.85; - value $internalField; - } -} - -// ************************************************************************* // diff --git a/OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch_scaleup/0.orig/epsilon.gas b/OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch_scaleup/0.orig/epsilon.gas deleted file mode 100644 index 707a1cda..00000000 --- a/OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch_scaleup/0.orig/epsilon.gas +++ /dev/null @@ -1,48 +0,0 @@ -/*--------------------------------*- C++ -*----------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | Website: https://openfoam.org - \\ / A nd | Version: 9 - \\/ M anipulation | -\*---------------------------------------------------------------------------*/ -FoamFile -{ - format ascii; - class volScalarField; - object epsilon.gas; -} -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -dimensions [0 2 -3 0 0 0 0]; - -#include "${FOAM_CASE}/constant/globalVars" - -internalField uniform $eps_inlet_gas; - -boundaryField -{ - inlet - { - type fixedValue; - value uniform $eps_inlet_gas; - } - - outlet - { - type zeroGradient; - } - - defaultFaces - { - type zeroGradient; - //type epsilonWallFunction; - //value $internalField; - } - - // defaultFaces - // { - // type empty; - // } -} - -// ************************************************************************* // diff --git a/OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch_scaleup/0.orig/epsilon.liquid b/OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch_scaleup/0.orig/epsilon.liquid deleted file mode 100644 index 0a4236fd..00000000 --- a/OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch_scaleup/0.orig/epsilon.liquid +++ /dev/null @@ -1,43 +0,0 @@ -/*--------------------------------*- C++ -*----------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | Website: https://openfoam.org - \\ / A nd | Version: 9 - \\/ M anipulation | -\*---------------------------------------------------------------------------*/ -FoamFile -{ - format ascii; - class volScalarField; - object epsilon.liquid; -} -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -dimensions [0 2 -3 0 0 0 0]; - -#include "${FOAM_CASE}/constant/globalVars" - -internalField uniform $eps_inlet_liq; - -boundaryField -{ - inlet - { - type fixedValue; - value uniform $eps_inlet_liq; - } - - outlet - { - type zeroGradient; - } - - defaultFaces - { - type epsilonWallFunction; - value $internalField; - } - -} - -// ************************************************************************* // diff --git a/OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch_scaleup/0.orig/f.gas b/OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch_scaleup/0.orig/f.gas deleted file mode 100644 index 76ee77a9..00000000 --- a/OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch_scaleup/0.orig/f.gas +++ /dev/null @@ -1,41 +0,0 @@ -/*--------------------------------*- C++ -*----------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | Website: https://openfoam.org - \\ / A nd | Version: 9 - \\/ M anipulation | -\*---------------------------------------------------------------------------*/ -FoamFile -{ - format ascii; - class volScalarField; - object f.gas; -} -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -dimensions [0 0 0 0 0 0 0]; - -internalField uniform 1.0; - -boundaryField -{ - #includeEtc "caseDicts/setConstraintTypes" - - inlet - { - type fixedValue; - value uniform 1.0; //$internalField; // - } - - outlet - { - type zeroGradient; - } - - defaultFaces - { - type zeroGradient; - } -} - -// ************************************************************************* // diff --git a/OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch_scaleup/0.orig/k.gas b/OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch_scaleup/0.orig/k.gas deleted file mode 100644 index 4a3d44ca..00000000 --- a/OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch_scaleup/0.orig/k.gas +++ /dev/null @@ -1,43 +0,0 @@ -/*--------------------------------*- C++ -*----------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | Website: https://openfoam.org - \\ / A nd | Version: 9 - \\/ M anipulation | -\*---------------------------------------------------------------------------*/ -FoamFile -{ - format ascii; - class volScalarField; - object k.gas; -} -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -dimensions [0 2 -2 0 0 0 0]; - -#include "${FOAM_CASE}/constant/globalVars" - -internalField uniform $k_inlet_gas; - -boundaryField -{ - #includeEtc "caseDicts/setConstraintTypes" - - inlet - { - type fixedValue; - value uniform $k_inlet_gas; - } - - outlet - { - type zeroGradient; - } - - defaultFaces - { - type zeroGradient; - } -} - -// ************************************************************************* // diff --git a/OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch_scaleup/0.orig/k.liquid b/OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch_scaleup/0.orig/k.liquid deleted file mode 100644 index cde8f6c1..00000000 --- a/OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch_scaleup/0.orig/k.liquid +++ /dev/null @@ -1,44 +0,0 @@ -/*--------------------------------*- C++ -*----------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | Website: https://openfoam.org - \\ / A nd | Version: 9 - \\/ M anipulation | -\*---------------------------------------------------------------------------*/ -FoamFile -{ - format ascii; - class volScalarField; - object k.liquid; -} -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -dimensions [0 2 -2 0 0 0 0]; - -#include "${FOAM_CASE}/constant/globalVars" - -internalField uniform $k_inlet_liq; - -boundaryField -{ - #includeEtc "caseDicts/setConstraintTypes" - - inlet - { - type fixedValue; - value uniform $k_inlet_liq; - } - - outlet - { - type zeroGradient; - } - - defaultFaces - { - type kqRWallFunction; - value $internalField; - } -} - -// ************************************************************************* // diff --git a/OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch_scaleup/0.orig/nut.gas b/OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch_scaleup/0.orig/nut.gas deleted file mode 100644 index ba16dd4c..00000000 --- a/OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch_scaleup/0.orig/nut.gas +++ /dev/null @@ -1,48 +0,0 @@ -/*--------------------------------*- C++ -*----------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | Website: https://openfoam.org - \\ / A nd | Version: 9 - \\/ M anipulation | -\*---------------------------------------------------------------------------*/ -FoamFile -{ - format ascii; - class volScalarField; - object nut.gas; -} -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -dimensions [0 2 -1 0 0 0 0]; - -internalField uniform 1e-8; - -boundaryField -{ - inlet - { - type calculated; - value $internalField; - } - - outlet - { - type calculated; - value $internalField; - } - - defaultFaces - { - //type nutkWallFunction; - //value $internalField; - type calculated; - value $internalField; - } - - // defaultFaces - // { - // type empty; - // } -} - -// ************************************************************************* // diff --git a/OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch_scaleup/0.orig/nut.liquid b/OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch_scaleup/0.orig/nut.liquid deleted file mode 100644 index 1442e07f..00000000 --- a/OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch_scaleup/0.orig/nut.liquid +++ /dev/null @@ -1,43 +0,0 @@ -/*--------------------------------*- C++ -*----------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | Website: https://openfoam.org - \\ / A nd | Version: 9 - \\/ M anipulation | -\*---------------------------------------------------------------------------*/ -FoamFile -{ - format ascii; - class volScalarField; - object nut.liquid; -} -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -dimensions [0 2 -1 0 0 0 0]; - -internalField uniform 1e-4; - -boundaryField -{ - #includeEtc "caseDicts/setConstraintTypes" - - inlet - { - type calculated; - value $internalField; - } - - outlet - { - type calculated; - value $internalField; - } - - defaultFaces - { - type nutkWallFunction; - value $internalField; - } -} - -// ************************************************************************* // diff --git a/OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch_scaleup/0.orig/p b/OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch_scaleup/0.orig/p deleted file mode 100644 index b3a295fb..00000000 --- a/OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch_scaleup/0.orig/p +++ /dev/null @@ -1,39 +0,0 @@ -/*--------------------------------*- C++ -*----------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | Website: https://openfoam.org - \\ / A nd | Version: dev - \\/ M anipulation | -\*---------------------------------------------------------------------------*/ -FoamFile -{ - format ascii; - class volScalarField; - object p; -} -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -dimensions [1 -1 -2 0 0 0 0]; - -internalField uniform 101325; - -boundaryField -{ - inlet - { - type calculated; - value $internalField; - } - outlet - { - type calculated; - value $internalField; - } - defaultFaces - { - type calculated; - value $internalField; - } -} - -// ************************************************************************* // diff --git a/OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch_scaleup/0.orig/p_rgh b/OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch_scaleup/0.orig/p_rgh deleted file mode 100644 index 88ee7d80..00000000 --- a/OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch_scaleup/0.orig/p_rgh +++ /dev/null @@ -1,43 +0,0 @@ -/*--------------------------------*- C++ -*----------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | Website: https://openfoam.org - \\ / A nd | Version: dev - \\/ M anipulation | -\*---------------------------------------------------------------------------*/ -FoamFile -{ - format ascii; - class volScalarField; - object p_rgh; -} -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -dimensions [1 -1 -2 0 0 0 0]; - -internalField uniform 101325; - -boundaryField -{ - inlet - { - type fixedFluxPressure; - value $internalField; - } - outlet - { - type prghTotalPressure; - p0 $internalField; - U U.gas; - phi phi.gas; - rho thermo:rho.gas; - value $internalField; - } - defaultFaces - { - type fixedFluxPressure; - value $internalField; - } -} - -// ************************************************************************* // diff --git a/OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch_scaleup/Allclean b/OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch_scaleup/Allclean deleted file mode 100755 index f55e0ec9..00000000 --- a/OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch_scaleup/Allclean +++ /dev/null @@ -1,18 +0,0 @@ -#!/bin/sh -cd ${0%/*} || exit 1 # Run from this directory - -# Source tutorial clean functions -. $WM_PROJECT_DIR/bin/tools/CleanFunctions - -# Remove surface, features and solution -#rm -rf constant/extendedFeatureEdgeMesh > /dev/null 2>&1 -#rm -f constant/triSurface/*.eMesh > /dev/null 2>&1 -#rm -rf constant/polyMesh > /dev/null 2>&1 -#rm -rf processor* > /dev/null 2>&1 -rm -rf 0 -cleanCase - -#rm *.obj -#rm *.stl - -#------------------------------------------------------------------------------ diff --git a/OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch_scaleup/computeQOI.sh b/OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch_scaleup/computeQOI.sh deleted file mode 100644 index 3756ed7f..00000000 --- a/OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch_scaleup/computeQOI.sh +++ /dev/null @@ -1,13 +0,0 @@ -if [ ! -f qoi.txt ]; then - # Reconstruct if needed - source /projects/gas2fuels/ofoam_cray_mpich/OpenFOAM-dev/etc/bashrc - reconstructPar -newTimes - module load anaconda3/2023 - conda activate /projects/gas2fuels/conda_env/bird - python read_history.py -cr .. -cn local -df data - python get_qoi.py - conda deactivate -else - echo "WARNING: QOI already computed" -fi - diff --git a/OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch_scaleup/constant/dynamicMix_util.H b/OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch_scaleup/constant/dynamicMix_util.H deleted file mode 100644 index 8fa7daf7..00000000 --- a/OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch_scaleup/constant/dynamicMix_util.H +++ /dev/null @@ -1,37 +0,0 @@ -#include - -double gradfunMix(double V1, double V2){ - return 3.0*V2*V2 + 2.0*V1*V2 - V1*V1; -} - -double funMix(double V1, double V2, double P, double rhoL, double A){ - return V2*V2*V2 + V1*V2*V2 - V2*V1*V1 - V1*V1*V1 - 4.0*P/(rhoL * A); -} - -double findV2(double P, double rhoL, double A, double V1) { - int newton_iter = 100; - double V2 = 2*V1; - double V2_old; - double V2_new; - if (std::abs(V1) < 1e-12) { - V2=std::pow((4.0*P/rhoL/A),0.333333); - V2_new = V2; - V2_old = V2; - } else { - for (int i=0; i("thermo:rho.liquid"); - const volScalarField& alphaL = - mesh().lookupObject("alpha.liquid"); - const volVectorField& UL = - mesh().lookupObject("U.liquid"); - double pi=3.141592654; - double source_pt_x=13.807637692813548; - double source_pt_y=1.3807637692813548; - double source_pt_z=12.426873923532193; - double disk_rad=0.9665346384969483; - double disk_area=pi*disk_rad*disk_rad; - double power=7626.034346240216; - double smear_factor=3.0; - const scalar startTime = 1; - if (time.value() > startTime) - { - // Get V1 - double source_sign_factor = 1.0; - double V1 = 0; - double V2 = 0; - double rhoV; - double dist_tol = disk_rad*5; - - double dist_n; - double upV = 0; - double uprhoV = 0; - double upVvol = 0; - double downV = 0; - double downrhoV = 0; - double downVvol = 0; - double dist2; - forAll(C,i) - { - dist2 = (C[i].x()-source_pt_x)*(C[i].x()-source_pt_x); - dist2 += (C[i].y()-source_pt_y)*(C[i].y()-source_pt_y); - dist2 += (C[i].z()-source_pt_z)*(C[i].z()-source_pt_z); - - dist_n = (C[i].x()-source_pt_x); - - if (dist2 < dist_tol*dist_tol && dist_n < -dist_tol/2) { - upVvol += V[i] * alphaL[i]; - upV += V[i] * alphaL[i] * UL[i][0]; - uprhoV += V[i] * alphaL[i] * rhoL[i]; - } - if (dist2 < dist_tol*dist_tol && dist_n > dist_tol/2) { - downVvol += V[i] * alphaL[i]; - downV += V[i] * alphaL[i] * UL[i][0]; - downrhoV += V[i] * alphaL[i] * rhoL[i]; - } - } - - reduce(uprhoV, sumOp()); - reduce(downrhoV, sumOp()); - reduce(upV, sumOp()); - reduce(downV, sumOp()); - reduce(downVvol, sumOp()); - reduce(upVvol, sumOp()); - - downV /= downVvol; - upV /= upVvol; - downrhoV /= downVvol; - uprhoV /= upVvol; - - if (upV <= 0 && downV <= 0) { - source_sign_factor = -1.0; - V1 = std::abs(upV); - rhoV = uprhoV; - } else if (upV >= 0 && downV >= 0) { - source_sign_factor = 1.0; - V1 = std::abs(downV); - rhoV = downrhoV; - } else { - V1 = 0.0; - source_sign_factor = -1.0; - rhoV = uprhoV; - Foam::Info << "[BIRD:DYNMIX WARN] " << "upV = " << upV << " downV = " << downV << " for source at " << source_pt_x << ", " << source_pt_y << ", " << source_pt_z << endl; - } - Foam::Info << "[BIRD:DYNMIX INFO] V1 = " << V1 << endl; - - // Get V2 - V2 = findV2(power, rhoV, disk_area, V1); - - forAll(C,i) - { - double Thrust=0.5*rhoL[i]*(V2*V2 - V1*V1)*disk_area; - double dist2=(C[i].x()-source_pt_x)*(C[i].x()-source_pt_x); - dist2 += (C[i].y()-source_pt_y)*(C[i].y()-source_pt_y); - dist2 += (C[i].z()-source_pt_z)*(C[i].z()-source_pt_z); - double epsilon=pow(V[i],0.33333)*smear_factor; - double sourceterm=alphaL[i]*(Thrust/pow(pi,1.5)/pow(epsilon,3.0))* - exp(-dist2/(epsilon*epsilon)); - Usource[i][0] -= source_sign_factor*sourceterm*V[i]; - } - } - #}; -}; diff --git a/OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch_scaleup/constant/g b/OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch_scaleup/constant/g deleted file mode 100644 index 770a5619..00000000 --- a/OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch_scaleup/constant/g +++ /dev/null @@ -1,21 +0,0 @@ -/*--------------------------------*- C++ -*----------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | Website: https://openfoam.org - \\ / A nd | Version: dev - \\/ M anipulation | -\*---------------------------------------------------------------------------*/ -FoamFile -{ - format ascii; - class uniformDimensionedVectorField; - location "constant"; - object g; -} -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -dimensions [0 1 -2 0 0 0 0]; -value (0 -9.81 0); - - -// ************************************************************************* // diff --git a/OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch_scaleup/constant/globalVars b/OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch_scaleup/constant/globalVars deleted file mode 100644 index 1a0ce724..00000000 --- a/OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch_scaleup/constant/globalVars +++ /dev/null @@ -1,83 +0,0 @@ -T0 300; //initial T(K) which stays constant -VVM 1.6; -//****water Liquid properties************** -CpMixLiq 4181; -muMixLiq #calc "2.414e-5 * pow(10,247.8/($T0 - 140.0))"; //viscosity (Pa.s) of water as a function of T(K) -kThermLiq 0.62; // W/m-K -rho0MixLiq 1000; // kg/m^3 -sigmaLiq 0.07; //surface tension N/m -//Wilke-Chang params for diffusion coefficient of a given solute in water (solvent) -WC_psi 2.6; -WC_M 18; // kg/kmol -WC_V_O2 25.6e-3; // m3/kmol molar volume at normal boiling temperature (Treybal 1968) -WC_V_H2 14.3e-3; -WC_V_CO2 34e-3; -WC_V_CO 30.7e-3; -WC_V_N2 31.2e-3; -WC_V_CH4 35e-3; // V_b[cm3/mol]=0.285*V_critical^1.048 (Tyn and Calus; ESTIMATING LIQUID MOLAL VOLUME; Processing, Volume 21, Issue 4, Pages 16 - 17) -//****** diffusion coeff *********** -D_H2 #calc "1.173e-16 * pow($WC_psi * $WC_M,0.5) * $T0 / $muMixLiq / pow($WC_V_H2,0.6)"; -D_CO2 #calc "1.173e-16 * pow($WC_psi * $WC_M,0.5) * $T0 / $muMixLiq / pow($WC_V_CO2,0.6)"; -D_CO #calc "1.173e-16 * pow($WC_psi * $WC_M,0.5) * $T0 / $muMixLiq / pow($WC_V_CO,0.6)"; -D_CH4 #calc "1.173e-16 * pow($WC_psi * $WC_M,0.5) * $T0 / $muMixLiq / pow($WC_V_CH4,0.6)"; -D_N2 #calc "1.173e-16 * pow($WC_psi * $WC_M,0.5) * $T0 / $muMixLiq / pow($WC_V_N2,0.6)"; -//****** Henry coeff *************** -H_O2_298 0.032; -DH_O2 1700; -H_CO2_298 0.83; -DH_CO2 2400; -H_CO_298 0.023; -DH_CO 1300; -H_H2_298 0.019; -DH_H2 500; -H_CH4_298 0.032; -DH_CH4 1900; -H_N2_298 0.015; -DH_N2 1300; -He_H2 #calc "$H_H2_298 * exp($DH_H2 *(1. / $T0 - 1./298.15))"; -He_CO #calc "$H_CO_298 * exp($DH_CO *(1. / $T0 - 1./298.15))"; -He_CO2 #calc "$H_CO2_298 * exp($DH_CO2 *(1. / $T0 - 1./298.15))"; -He_CH4 #calc "$H_CH4_298 * exp($DH_CH4 *(1. / $T0 - 1./298.15))"; -He_N2 #calc "$H_N2_298 * exp($DH_N2 *(1. / $T0 - 1./298.15))"; -//*******inlet gas frac************* -f_H2 0.1; -f_CO2 0.9; -f_N2 0.0; -//*******inlet gas frac************* -inletA 11.8966; -liqVol 606.514; -alphaGas 1; -alphaLiq 0; -uGasPhase #calc "$liqVol * $VVM / (60 * $inletA * $alphaGas)"; -//********************************* -LeLiqH2 #calc "$kThermLiq / $rho0MixLiq / $D_H2 / $CpMixLiq"; -LeLiqCO #calc "$kThermLiq / $rho0MixLiq / $D_CO / $CpMixLiq"; -LeLiqCO2 #calc "$kThermLiq / $rho0MixLiq / $D_CO2 / $CpMixLiq"; // = 74 -LeLiqCH4 #calc "$kThermLiq / $rho0MixLiq / $D_CH4 / $CpMixLiq"; -LeLiqN2 #calc "$kThermLiq / $rho0MixLiq / $D_N2 / $CpMixLiq"; -LeLiqMix #calc "$f_CO2*$LeLiqCO2+$f_H2*$LeLiqH2"; -PrMixLiq #calc "$CpMixLiq * $muMixLiq / $kThermLiq"; -//********************************* -kH2 #calc "$D_H2*$rho0MixLiq*$CpMixLiq*$LeLiqMix"; -PrH2 #calc "$muMixLiq*$CpMixLiq / $kH2"; - -kCO #calc "$D_CO*$rho0MixLiq*$CpMixLiq*$LeLiqMix"; -PrCO #calc "$muMixLiq*$CpMixLiq / $kCO"; - -kCO2 #calc "$D_CO2*$rho0MixLiq*$CpMixLiq*$LeLiqMix"; -PrCO2 #calc "$muMixLiq*$CpMixLiq / $kCO2"; - -kCH4 #calc "$D_CH4*$rho0MixLiq*$CpMixLiq*$LeLiqMix"; -PrCH4 #calc "$muMixLiq*$CpMixLiq / $kCH4"; - -kN2 #calc "$D_N2*$rho0MixLiq*$CpMixLiq*$LeLiqMix"; -PrN2 #calc "$muMixLiq*$CpMixLiq / $kN2"; -//********************************* -l_scale 0.5; -intensity 0.05; -k_inlet_gas #calc "1.5 * Foam::pow(($uGasPhase), 2) * Foam::pow($intensity, 2)"; -k_inlet_liq #calc "1.5 * Foam::pow(($uGasPhase), 2) * Foam::pow($intensity, 2)"; -eps_inlet_gas #calc "pow(0.09,0.75) * Foam::pow($k_inlet_gas, 1.5) / ($l_scale * 0.07)"; -eps_inlet_liq #calc "pow(0.09,0.75) * Foam::pow($k_inlet_liq, 1.5) / ($l_scale * 0.07)"; -omega_inlet_gas #calc "pow(0.09,-0.25) * pow($k_inlet_gas,0.5) / ($l_scale * 0.07)"; -omega_inlet_liq #calc "pow(0.09,-0.25) * pow($k_inlet_liq,0.5) / ($l_scale * 0.07)"; diff --git a/OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch_scaleup/constant/globalVars_temp b/OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch_scaleup/constant/globalVars_temp deleted file mode 100644 index fcb076a7..00000000 --- a/OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch_scaleup/constant/globalVars_temp +++ /dev/null @@ -1,83 +0,0 @@ -T0 300; //initial T(K) which stays constant -VVM 0.2; -//****water Liquid properties************** -CpMixLiq 4181; -muMixLiq #calc "2.414e-5 * pow(10,247.8/($T0 - 140.0))"; //viscosity (Pa.s) of water as a function of T(K) -kThermLiq 0.62; // W/m-K -rho0MixLiq 1000; // kg/m^3 -sigmaLiq 0.07; //surface tension N/m -//Wilke-Chang params for diffusion coefficient of a given solute in water (solvent) -WC_psi 2.6; -WC_M 18; // kg/kmol -WC_V_O2 25.6e-3; // m3/kmol molar volume at normal boiling temperature (Treybal 1968) -WC_V_H2 14.3e-3; -WC_V_CO2 34e-3; -WC_V_CO 30.7e-3; -WC_V_N2 31.2e-3; -WC_V_CH4 35e-3; // V_b[cm3/mol]=0.285*V_critical^1.048 (Tyn and Calus; ESTIMATING LIQUID MOLAL VOLUME; Processing, Volume 21, Issue 4, Pages 16 - 17) -//****** diffusion coeff *********** -D_H2 #calc "1.173e-16 * pow($WC_psi * $WC_M,0.5) * $T0 / $muMixLiq / pow($WC_V_H2,0.6)"; -D_CO2 #calc "1.173e-16 * pow($WC_psi * $WC_M,0.5) * $T0 / $muMixLiq / pow($WC_V_CO2,0.6)"; -D_CO #calc "1.173e-16 * pow($WC_psi * $WC_M,0.5) * $T0 / $muMixLiq / pow($WC_V_CO,0.6)"; -D_CH4 #calc "1.173e-16 * pow($WC_psi * $WC_M,0.5) * $T0 / $muMixLiq / pow($WC_V_CH4,0.6)"; -D_N2 #calc "1.173e-16 * pow($WC_psi * $WC_M,0.5) * $T0 / $muMixLiq / pow($WC_V_N2,0.6)"; -//****** Henry coeff *************** -H_O2_298 0.032; -DH_O2 1700; -H_CO2_298 0.83; -DH_CO2 2400; -H_CO_298 0.023; -DH_CO 1300; -H_H2_298 0.019; -DH_H2 500; -H_CH4_298 0.032; -DH_CH4 1900; -H_N2_298 0.015; -DH_N2 1300; -He_H2 #calc "$H_H2_298 * exp($DH_H2 *(1. / $T0 - 1./298.15))"; -He_CO #calc "$H_CO_298 * exp($DH_CO *(1. / $T0 - 1./298.15))"; -He_CO2 #calc "$H_CO2_298 * exp($DH_CO2 *(1. / $T0 - 1./298.15))"; -He_CH4 #calc "$H_CH4_298 * exp($DH_CH4 *(1. / $T0 - 1./298.15))"; -He_N2 #calc "$H_N2_298 * exp($DH_N2 *(1. / $T0 - 1./298.15))"; -//*******inlet gas frac************* -f_H2 0.1; -f_CO2 0.9; -f_N2 0.0; -//*******inlet gas frac************* -inletA ; -liqVol ; -alphaGas 1; -alphaLiq 0; -uGasPhase #calc "$liqVol * $VVM / (60 * $inletA * $alphaGas)"; -//********************************* -LeLiqH2 #calc "$kThermLiq / $rho0MixLiq / $D_H2 / $CpMixLiq"; -LeLiqCO #calc "$kThermLiq / $rho0MixLiq / $D_CO / $CpMixLiq"; -LeLiqCO2 #calc "$kThermLiq / $rho0MixLiq / $D_CO2 / $CpMixLiq"; // = 74 -LeLiqCH4 #calc "$kThermLiq / $rho0MixLiq / $D_CH4 / $CpMixLiq"; -LeLiqN2 #calc "$kThermLiq / $rho0MixLiq / $D_N2 / $CpMixLiq"; -LeLiqMix #calc "$f_CO2*$LeLiqCO2+$f_H2*$LeLiqH2"; -PrMixLiq #calc "$CpMixLiq * $muMixLiq / $kThermLiq"; -//********************************* -kH2 #calc "$D_H2*$rho0MixLiq*$CpMixLiq*$LeLiqMix"; -PrH2 #calc "$muMixLiq*$CpMixLiq / $kH2"; - -kCO #calc "$D_CO*$rho0MixLiq*$CpMixLiq*$LeLiqMix"; -PrCO #calc "$muMixLiq*$CpMixLiq / $kCO"; - -kCO2 #calc "$D_CO2*$rho0MixLiq*$CpMixLiq*$LeLiqMix"; -PrCO2 #calc "$muMixLiq*$CpMixLiq / $kCO2"; - -kCH4 #calc "$D_CH4*$rho0MixLiq*$CpMixLiq*$LeLiqMix"; -PrCH4 #calc "$muMixLiq*$CpMixLiq / $kCH4"; - -kN2 #calc "$D_N2*$rho0MixLiq*$CpMixLiq*$LeLiqMix"; -PrN2 #calc "$muMixLiq*$CpMixLiq / $kN2"; -//********************************* -l_scale 0.5; -intensity 0.05; -k_inlet_gas #calc "1.5 * Foam::pow(($uGasPhase), 2) * Foam::pow($intensity, 2)"; -k_inlet_liq #calc "1.5 * Foam::pow(($uGasPhase), 2) * Foam::pow($intensity, 2)"; -eps_inlet_gas #calc "pow(0.09,0.75) * Foam::pow($k_inlet_gas, 1.5) / ($l_scale * 0.07)"; -eps_inlet_liq #calc "pow(0.09,0.75) * Foam::pow($k_inlet_liq, 1.5) / ($l_scale * 0.07)"; -omega_inlet_gas #calc "pow(0.09,-0.25) * pow($k_inlet_gas,0.5) / ($l_scale * 0.07)"; -omega_inlet_liq #calc "pow(0.09,-0.25) * pow($k_inlet_liq,0.5) / ($l_scale * 0.07)"; diff --git a/OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch_scaleup/constant/momentumTransport.gas b/OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch_scaleup/constant/momentumTransport.gas deleted file mode 100644 index ca916714..00000000 --- a/OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch_scaleup/constant/momentumTransport.gas +++ /dev/null @@ -1,26 +0,0 @@ -/*--------------------------------*- C++ -*----------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | Website: https://openfoam.org - \\ / A nd | Version: dev - \\/ M anipulation | -\*---------------------------------------------------------------------------*/ -FoamFile -{ - format ascii; - class dictionary; - location "constant"; - object momentumTransport.gas; -} -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -//simulationType laminar; -simulationType RAS; -RAS -{ - model mixtureKEpsilon; - turbulence on; - printCoeff on; -} - -// ************************************************************************* // diff --git a/OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch_scaleup/constant/momentumTransport.liquid b/OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch_scaleup/constant/momentumTransport.liquid deleted file mode 100644 index 2063de0d..00000000 --- a/OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch_scaleup/constant/momentumTransport.liquid +++ /dev/null @@ -1,27 +0,0 @@ -/*--------------------------------*- C++ -*----------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | Website: https://openfoam.org - \\ / A nd | Version: dev - \\/ M anipulation | -\*---------------------------------------------------------------------------*/ -FoamFile -{ - format ascii; - class dictionary; - location "constant"; - object momentumTransport.liquid; -} -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -//simulationType laminar; -simulationType RAS; - -RAS -{ - model mixtureKEpsilon; - turbulence on; - printCoeffs on; -} - -// ************************************************************************* // diff --git a/OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch_scaleup/constant/phaseProperties b/OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch_scaleup/constant/phaseProperties deleted file mode 100644 index a3c90f5a..00000000 --- a/OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch_scaleup/constant/phaseProperties +++ /dev/null @@ -1,295 +0,0 @@ -/*--------------------------------*- C++ -*----------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | Website: https://openfoam.org - \\ / A nd | Version: 9 - \\/ M anipulation | -\*---------------------------------------------------------------------------*/ -FoamFile -{ - format ascii; - class dictionary; - object phaseProperties; -} -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#include "$FOAM_CASE/constant/globalVars" - -type interfaceCompositionPhaseChangePopulationBalanceMultiphaseSystem; - -phases (gas liquid); - -populationBalances (bubbles); - -gas -{ - type multiComponentPhaseModel;//pureIsothermalPhaseModel; - - diameterModel velocityGroup; - - velocityGroupCoeffs - { - populationBalance bubbles; - - shapeModel spherical; - - sizeGroups - ( - f1 {dSph 1.4e-3; value 0.0;} - f2 {dSph 1.8e-3; value 0.0;} - f3 {dSph 2.2e-3; value 0.0;} - f4 {dSph 2.6e-3; value 0.0;} - f5 {dSph 3e-3; value 1.0;} - f6 {dSph 3.4e-3; value 0.0;} - f7 {dSph 3.8e-3; value 0.0;} - f8 {dSph 4.2e-3; value 0.0;} - f9 {dSph 4.6e-3; value 0.0;} - f10 {dSph 5.0e-3; value 0.0;} - ); - } - - residualAlpha 1e-6; - - Sc 0.7; -} - -liquid -{ - type multiComponentPhaseModel;//pureIsothermalPhaseModel; - - diameterModel constant; - - constantCoeffs - { - d 1e-4; - } - Sc #codeStream - { - code - #{ - os << ($LeLiqMix * $CpMixLiq * $muMixLiq / $kThermLiq); - #}; - }; - - residualAlpha 1e-6; -} - -populationBalanceCoeffs -{ - bubbles - { - continuousPhase liquid; - - coalescenceModels - ( - LehrMilliesMewes{ - efficiency 4.695; - uCrit 0.08; - alphaMax 0.6; - } - ); - - binaryBreakupModels - (); - - breakupModels - ( - Laakkonen { - efficiency 13.83; - daughterSizeDistributionModel Laakkonen; - } - - ); - - driftModels - ( - densityChange{} - ); - - nucleationModels - (); - } -} - -blending -{ - default - { - type linear; - minFullyContinuousAlpha.gas 0.7; - minPartlyContinuousAlpha.gas 0.3; - minFullyContinuousAlpha.liquid 0.7; - minPartlyContinuousAlpha.liquid 0.3; - } - heatTransfer - { - type linear; - minFullyContinuousAlpha.gas 1; - minPartlyContinuousAlpha.gas 0; - minFullyContinuousAlpha.liquid 1; - minPartlyContinuousAlpha.liquid 0; - } - massTransfer - { - $heatTransfer; - } -} - -surfaceTension -( - (gas and liquid) - { - type constant; - sigma $sigmaLiq; - } -); - -interfaceCompression -(); - -aspectRatio -( - (gas in liquid) - { - type Wellek; - } -); - - -drag -( - (gas in liquid) - { - type Grace; // Need to install the model available at https://github.com/NREL/BioReactorDesign - //type IshiiZuber; - residualRe 1e-3; - swarmCorrection - { - type none; - } - } -); - -virtualMass -( - (gas in liquid) - { - type constantCoefficient; - Cvm 0.5; - } -); - -// heatTransfer -// (); - -heatTransfer.gas -( - (gas in liquid) - { - type spherical; - residualAlpha 1e-4; - } - - (liquid in gas) - { - type RanzMarshall; - residualAlpha 1e-4; - } -); - -heatTransfer.liquid -( - (gas in liquid) - { - type RanzMarshall; - residualAlpha 1e-4; - } - - (liquid in gas) - { - type spherical; - residualAlpha 1e-4; - } -); - -interfaceComposition.gas -(); - -interfaceComposition.liquid -( - (liquid and gas) - { - type Henry; - species ( CO2 H2 ); - k ( $He_CO2 $He_H2 ); - Le $LeLiqMix; - } -); - -diffusiveMassTransfer.gas -(); - -diffusiveMassTransfer.liquid -( - (gas in liquid) - { - type Higbie; // Need to install the model available at https://github.com/NREL/BioReactorDesign - //type Frossling; - Le $LeLiqMix; - } - - (liquid in gas) - { - type spherical; - Le 1.0; //not used for spherical - } -); - -phaseTransfer -(); - -lift -( - (gas in liquid) - { - type wallDamped; - - wallDamping - { - type cosine; - Cd 3.0; - } - - lift - { - type Tomiyama; - - swarmCorrection - { - type none; - } - } - } - -); - -wallLubrication -( - (gas in liquid) - { - type Antal; - Cw1 -0.01; - Cw2 0.05; - } -); - -turbulentDispersion -( - (gas in liquid) - { - type Burns; - sigma 0.9; - } -); - -// ************************************************************************* // diff --git a/OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch_scaleup/constant/phaseProperties_constantd b/OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch_scaleup/constant/phaseProperties_constantd deleted file mode 100644 index e029df99..00000000 --- a/OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch_scaleup/constant/phaseProperties_constantd +++ /dev/null @@ -1,261 +0,0 @@ -/*--------------------------------*- C++ -*----------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | Website: https://openfoam.org - \\ / A nd | Version: 9 - \\/ M anipulation | -\*---------------------------------------------------------------------------*/ -FoamFile -{ - format ascii; - class dictionary; - object phaseProperties; -} -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#include "$FOAM_CASE/constant/globalVars" - -type interfaceCompositionPhaseChangeMultiphaseSystem; - -phases (gas liquid); - -gas -{ - type multiComponentPhaseModel;//pureIsothermalPhaseModel; - - diameterModel constant; - - constantCoeffs - { - d 3e-3; - } - residualAlpha 1e-6; - Sc 0.7; -} - -liquid -{ - type multiComponentPhaseModel;//pureIsothermalPhaseModel; - - diameterModel constant; - - constantCoeffs - { - d 1e-4; - } - Sc #codeStream - { - code - #{ - os << ($LeLiqMix * $CpMixLiq * $muMixLiq / $kThermLiq); - #}; - }; - - residualAlpha 1e-6; -} - -populationBalanceCoeffs -{ - bubbles - { - continuousPhase liquid; - - coalescenceModels - (); - - binaryBreakupModels - (); - - breakupModels - (); - - driftModels - (); - - nucleationModels - (); - } -} - -blending -{ - default - { - type linear; - minFullyContinuousAlpha.gas 0.7; - minPartlyContinuousAlpha.gas 0.3; - minFullyContinuousAlpha.liquid 0.7; - minPartlyContinuousAlpha.liquid 0.3; - } - heatTransfer - { - type linear; - minFullyContinuousAlpha.gas 1; - minPartlyContinuousAlpha.gas 0; - minFullyContinuousAlpha.liquid 1; - minPartlyContinuousAlpha.liquid 0; - } - massTransfer - { - $heatTransfer; - } -} - -surfaceTension -( - (gas and liquid) - { - type constant; - sigma $sigmaLiq; - } -); - -interfaceCompression -(); - -aspectRatio -( - (gas in liquid) - { - type Wellek; - } -); - - -drag -( - (gas in liquid) - { - type Grace; // Need to install the model available at https://github.com/NREL/BioReactorDesign - //type IshiiZuber; - residualRe 1e-3; - swarmCorrection - { - type none; - } - } -); - -virtualMass -( - (gas in liquid) - { - type constantCoefficient; - Cvm 0.5; - } -); - -// heatTransfer -// (); - -heatTransfer.gas -( - (gas in liquid) - { - type spherical; - residualAlpha 1e-4; - } - - (liquid in gas) - { - type RanzMarshall; - residualAlpha 1e-4; - } -); - -heatTransfer.liquid -( - (gas in liquid) - { - type RanzMarshall; - residualAlpha 1e-4; - } - - (liquid in gas) - { - type spherical; - residualAlpha 1e-4; - } -); - -interfaceComposition.gas -(); - -interfaceComposition.liquid -( - (liquid and gas) - { - type Henry; - species ( CO2 H2 ); - k ( $He_CO2 $He_H2 ); - Le $LeLiqMix; - } -); - -diffusiveMassTransfer.gas -(); - -diffusiveMassTransfer.liquid -( - (gas in liquid) - { - type Higbie; // Need to install the model available at https://github.com/NREL/BioReactorDesign - //type Frossling; - Le $LeLiqMix; - } - - (liquid in gas) - { - type spherical; - Le 1.0; //not used for spherical - } -); - -phaseTransfer -(); - -lift -( - (gas in liquid) - { - type wallDamped; - - wallDamping - { - type cosine; - Cd 3.0; - } - - lift - { - type Tomiyama; - - swarmCorrection - { - type none; - } - } - } - -); - -wallLubrication -( - (gas in liquid) - { - type Antal; - Cw1 -0.01; - Cw2 0.05; - } -); - -turbulentDispersion -( - (gas in liquid) - { - type Burns; - sigma 0.9; - } -); - -// ************************************************************************* // diff --git a/OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch_scaleup/constant/phaseProperties_pbe b/OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch_scaleup/constant/phaseProperties_pbe deleted file mode 100644 index a3c90f5a..00000000 --- a/OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch_scaleup/constant/phaseProperties_pbe +++ /dev/null @@ -1,295 +0,0 @@ -/*--------------------------------*- C++ -*----------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | Website: https://openfoam.org - \\ / A nd | Version: 9 - \\/ M anipulation | -\*---------------------------------------------------------------------------*/ -FoamFile -{ - format ascii; - class dictionary; - object phaseProperties; -} -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#include "$FOAM_CASE/constant/globalVars" - -type interfaceCompositionPhaseChangePopulationBalanceMultiphaseSystem; - -phases (gas liquid); - -populationBalances (bubbles); - -gas -{ - type multiComponentPhaseModel;//pureIsothermalPhaseModel; - - diameterModel velocityGroup; - - velocityGroupCoeffs - { - populationBalance bubbles; - - shapeModel spherical; - - sizeGroups - ( - f1 {dSph 1.4e-3; value 0.0;} - f2 {dSph 1.8e-3; value 0.0;} - f3 {dSph 2.2e-3; value 0.0;} - f4 {dSph 2.6e-3; value 0.0;} - f5 {dSph 3e-3; value 1.0;} - f6 {dSph 3.4e-3; value 0.0;} - f7 {dSph 3.8e-3; value 0.0;} - f8 {dSph 4.2e-3; value 0.0;} - f9 {dSph 4.6e-3; value 0.0;} - f10 {dSph 5.0e-3; value 0.0;} - ); - } - - residualAlpha 1e-6; - - Sc 0.7; -} - -liquid -{ - type multiComponentPhaseModel;//pureIsothermalPhaseModel; - - diameterModel constant; - - constantCoeffs - { - d 1e-4; - } - Sc #codeStream - { - code - #{ - os << ($LeLiqMix * $CpMixLiq * $muMixLiq / $kThermLiq); - #}; - }; - - residualAlpha 1e-6; -} - -populationBalanceCoeffs -{ - bubbles - { - continuousPhase liquid; - - coalescenceModels - ( - LehrMilliesMewes{ - efficiency 4.695; - uCrit 0.08; - alphaMax 0.6; - } - ); - - binaryBreakupModels - (); - - breakupModels - ( - Laakkonen { - efficiency 13.83; - daughterSizeDistributionModel Laakkonen; - } - - ); - - driftModels - ( - densityChange{} - ); - - nucleationModels - (); - } -} - -blending -{ - default - { - type linear; - minFullyContinuousAlpha.gas 0.7; - minPartlyContinuousAlpha.gas 0.3; - minFullyContinuousAlpha.liquid 0.7; - minPartlyContinuousAlpha.liquid 0.3; - } - heatTransfer - { - type linear; - minFullyContinuousAlpha.gas 1; - minPartlyContinuousAlpha.gas 0; - minFullyContinuousAlpha.liquid 1; - minPartlyContinuousAlpha.liquid 0; - } - massTransfer - { - $heatTransfer; - } -} - -surfaceTension -( - (gas and liquid) - { - type constant; - sigma $sigmaLiq; - } -); - -interfaceCompression -(); - -aspectRatio -( - (gas in liquid) - { - type Wellek; - } -); - - -drag -( - (gas in liquid) - { - type Grace; // Need to install the model available at https://github.com/NREL/BioReactorDesign - //type IshiiZuber; - residualRe 1e-3; - swarmCorrection - { - type none; - } - } -); - -virtualMass -( - (gas in liquid) - { - type constantCoefficient; - Cvm 0.5; - } -); - -// heatTransfer -// (); - -heatTransfer.gas -( - (gas in liquid) - { - type spherical; - residualAlpha 1e-4; - } - - (liquid in gas) - { - type RanzMarshall; - residualAlpha 1e-4; - } -); - -heatTransfer.liquid -( - (gas in liquid) - { - type RanzMarshall; - residualAlpha 1e-4; - } - - (liquid in gas) - { - type spherical; - residualAlpha 1e-4; - } -); - -interfaceComposition.gas -(); - -interfaceComposition.liquid -( - (liquid and gas) - { - type Henry; - species ( CO2 H2 ); - k ( $He_CO2 $He_H2 ); - Le $LeLiqMix; - } -); - -diffusiveMassTransfer.gas -(); - -diffusiveMassTransfer.liquid -( - (gas in liquid) - { - type Higbie; // Need to install the model available at https://github.com/NREL/BioReactorDesign - //type Frossling; - Le $LeLiqMix; - } - - (liquid in gas) - { - type spherical; - Le 1.0; //not used for spherical - } -); - -phaseTransfer -(); - -lift -( - (gas in liquid) - { - type wallDamped; - - wallDamping - { - type cosine; - Cd 3.0; - } - - lift - { - type Tomiyama; - - swarmCorrection - { - type none; - } - } - } - -); - -wallLubrication -( - (gas in liquid) - { - type Antal; - Cw1 -0.01; - Cw2 0.05; - } -); - -turbulentDispersion -( - (gas in liquid) - { - type Burns; - sigma 0.9; - } -); - -// ************************************************************************* // diff --git a/OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch_scaleup/constant/thermophysicalProperties.gas b/OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch_scaleup/constant/thermophysicalProperties.gas deleted file mode 100644 index 11b1c4b9..00000000 --- a/OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch_scaleup/constant/thermophysicalProperties.gas +++ /dev/null @@ -1,142 +0,0 @@ -/*--------------------------------*- C++ -*----------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | Website: https://openfoam.org - \\ / A nd | Version: dev - \\/ M anipulation | -\*---------------------------------------------------------------------------*/ -FoamFile -{ - format ascii; - class dictionary; - location "constant"; - object thermophysicalProperties.gas; -} -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -thermoType -{ - type heRhoThermo; - mixture multiComponentMixture; - transport sutherland; - thermo janaf; - equationOfState perfectGas; - specie specie; - energy sensibleInternalEnergy; - //energy sensibleEnthalpy; -} - - -species -( - H2 - CO2 - N2 -); - -defaultSpecie N2; - -CO2 -{ - specie - { - molWeight 44.00995; - } - thermodynamics - { - Tlow 200; - Thigh 3500; - Tcommon 1000; - highCpCoeffs ( 3.85746029 0.00441437026 -2.21481404e-06 5.23490188e-10 -4.72084164e-14 -48759.166 2.27163806 ); - lowCpCoeffs ( 2.35677352 0.00898459677 -7.12356269e-06 2.45919022e-09 -1.43699548e-13 -48371.9697 9.90105222 ); - } - transport - { - As 1.572e-06; - Ts 240; - } - elements - { - C 1; - O 2; - } -} - -water -{ - specie - { - molWeight 18.01534; - } - thermodynamics - { - Tlow 200; - Thigh 3500; - Tcommon 1000; - highCpCoeffs ( 3.03399249 0.00217691804 -1.64072518e-07 -9.7041987e-11 1.68200992e-14 -30004.2971 4.9667701 ); - lowCpCoeffs ( 4.19864056 -0.0020364341 6.52040211e-06 -5.48797062e-09 1.77197817e-12 -30293.7267 -0.849032208 ); - } - transport - { - As 1.512e-06; - Ts 120; - } - elements - { - H 2; - O 1; - } -} - -N2 -{ - specie - { - molWeight 28.0134; - } - thermodynamics - { - Tlow 250; - Thigh 5000; - Tcommon 1000; - highCpCoeffs ( 2.92664 0.0014879768 -5.68476e-07 1.0097038e-10 -6.753351e-15 -922.7977 5.980528 ); - lowCpCoeffs ( 3.298677 0.0014082404 -3.963222e-06 5.641515e-09 -2.444854e-12 -1020.8999 3.950372 ); - } - transport - { - As 1.512e-06; - Ts 120; - } - elements - { - N 2; - } -} - -H2 -{ - specie - { - molWeight 2.01594; - } - thermodynamics - { - Tlow 200; - Thigh 3500; - Tcommon 1000; - highCpCoeffs ( 3.3372792 -4.94024731e-05 4.99456778e-07 -1.79566394e-10 2.00255376e-14 -950.158922 -3.20502331 ); - lowCpCoeffs ( 2.34433112 0.00798052075 -1.9478151e-05 2.01572094e-08 -7.37611761e-12 -917.935173 0.683010238 ); - } - transport - { - As 6.362e-07; - Ts 72; - } - elements - { - H 2; - } -} - - -// ************************************************************************* // diff --git a/OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch_scaleup/constant/thermophysicalProperties.liquid b/OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch_scaleup/constant/thermophysicalProperties.liquid deleted file mode 100644 index d324ec51..00000000 --- a/OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch_scaleup/constant/thermophysicalProperties.liquid +++ /dev/null @@ -1,108 +0,0 @@ -/*--------------------------------*- C++ -*----------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | Website: https://openfoam.org - \\ / A nd | Version: dev - \\/ M anipulation | -\*---------------------------------------------------------------------------*/ -FoamFile -{ - format ascii; - class dictionary; - location "constant"; - object thermophysicalProperties.liquid; -} -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#include "$FOAM_CASE/constant/globalVars" - -thermoType -{ - type heRhoThermo; - mixture multiComponentMixture; - transport const; - thermo hConst; - equationOfState rhoConst;//rPolynomial; - specie specie; - energy sensibleInternalEnergy; - //energy sensibleEnthalpy; -} - -species -( - CO2 - water - H2 -); - -inertSpecie water; - -water -{ - specie - { - molWeight 18.0153; - } - equationOfState - { - rho $rho0MixLiq; - } - thermodynamics - { - Cp $CpMixLiq; - Hf -1.5879e+07; - } - transport - { - mu $muMixLiq; - Pr $PrMixLiq; - } -} - -CO2 -{ - specie - { - molWeight 44.00995; - } - equationOfState - { - rho $rho0MixLiq; - } - thermodynamics - { - Cp $CpMixLiq; - Hf -1.5879e+07; - } - transport - { - mu $muMixLiq; - Pr $PrCO2; - } -} - -H2 -{ - specie - { - molWeight 2.01594; - } - equationOfState - { - rho $rho0MixLiq; - } - thermodynamics - { - Cp $CpMixLiq; - Hf -1.5879e+07;//-9402451; - } - transport - { - mu $muMixLiq; - Pr $PrH2; - } -} - - - -// ************************************************************************* // diff --git a/OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch_scaleup/get_qoi.py b/OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch_scaleup/get_qoi.py deleted file mode 100644 index 9562cc65..00000000 --- a/OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch_scaleup/get_qoi.py +++ /dev/null @@ -1,183 +0,0 @@ -import json -import os -import pickle as pkl - -import matplotlib as mpl -import numpy as np -from prettyPlot.plotting import * -from scipy.optimize import curve_fit - - -def get_sim_folds(path): - folds = os.listdir(path) - sim_folds = [] - for fold in folds: - if fold.startswith("loop"): - sim_folds.append(fold) - return sim_folds - - -def func(t, cstar, kla): - t = t - t0 = 0 - c0 = 0 - return (cstar - c0) * (1 - np.exp(-kla * (t - t0))) + c0 - - -def get_vl(verb=False): - filename = os.path.join("constant", "globalVars") - with open(filename, "r+") as f: - lines = f.readlines() - for line in lines: - if line.startswith("liqVol"): - vol = float(line.split()[-1][:-1]) - break - if verb: - print(f"Read liqVol = {vol}m3") - return vol - - -def get_vvm(verb=False): - filename = os.path.join("constant", "globalVars") - with open(filename, "r+") as f: - lines = f.readlines() - for line in lines: - if line.startswith("VVM"): - vvm = float(line.split()[-1][:-1]) - break - if verb: - print(f"Read VVM = {vvm} [-]") - return vvm - - -def get_As(verb=False): - filename = os.path.join("constant", "globalVars") - with open(filename, "r+") as f: - lines = f.readlines() - for line in lines: - if line.startswith("inletA"): - As = float(line.split()[-1][:-1]) - break - if verb: - print(f"Read As = {As}m2") - return As - - -def get_pmix(verb=False): - with open("system/mixers.json", "r+") as f: - data = json.load(f) - mixer_list = data["mixers"] - pmix = 0 - for mix in mixer_list: - pmix += mix["power"] / 1000 - if verb: - print(f"Read Mixing power = {pmix}kW") - return pmix - - -def get_lh(verb=False): - filename = os.path.join("system", "setFieldsDict") - with open(filename, "r+") as f: - lines = f.readlines() - for line in lines: - if "box (-1.0 -1.0 -1.0)" in line: - height = float(line.split("(")[2].split()[1]) - break - if verb: - print(f"Read Height = {height}m") - return height - - -def get_pinj(vvm, Vl, As, lh): - rhog = 1.25 # kg /m3 - Vg = Vl * vvm / (60 * As * 1) # m/s - Ptank = 101325 # Pa - # Ptank = 0 # Pa - rhoL = 1000 # kg / m3 - Pl = 101325 + rhoL * 9.8 * lh # Pa - # W - P1 = rhog * As * Vg**3 - # W - P2 = (Pl - Ptank) * As * Vg - # kg /s - MF = rhog * Vg * As - # kwh / kg - e_m = (P1 + P2) / (3600 * 1000 * MF) - - # returns kW - return (P1 + P2) * 1e-3 - - -def get_qoi(kla_co2, cs_co2, kla_h2, cs_h2, verb=False): - vvm = get_vvm(verb) - As = get_As(verb) - V_l = get_vl(verb) - liqh = get_lh(verb) - P_inj = get_pinj(vvm, V_l, As, liqh) - P_mix = get_pmix(verb) - - qoi_co2 = kla_co2 * cs_co2 * V_l * 0.04401 / (P_mix / 3600 + P_inj / 3600) - qoi_h2 = kla_h2 * cs_h2 * V_l * 0.002016 / (P_mix / 3600 + P_inj / 3600) - return qoi_co2 * qoi_h2 - - -def get_qoi_uq(kla_co2, cs_co2, kla_h2, cs_h2): - qoi = [] - for i in range(len(kla_co2)): - if i == 0: - verb = True - else: - verb = False - qoi.append(get_qoi(kla_co2[i], cs_co2[i], kla_h2[i], cs_h2[i], verb)) - qoi = np.array(qoi) - return np.mean(qoi), np.std(qoi) - - -os.makedirs("Figures", exist_ok=True) - -dataFolder = "data" -fold = "local" - -nuq = 100 -mean_cstar_co2 = np.random.uniform(12.6, 13.3, nuq) -mean_cstar_h2 = np.random.uniform(0.902, 0.96, nuq) - - -tmp_cs_h2 = [] -tmp_cs_co2 = [] -tmp_kla_h2 = [] -tmp_kla_co2 = [] -cs_co2 = mean_cstar_co2 -cs_h2 = mean_cstar_h2 - -a = np.load(os.path.join(dataFolder, fold, "conv.npz")) -endindex = -1 -if ( - "c_h2" in a - and "c_co2" in a - and len(a["time"][:endindex] > 0) - and (a["time"][:endindex][-1] > 95) -): - for i in range(nuq): - fitparamsH2, _ = curve_fit( - func, - np.array(a["time"][:endindex]), - np.array(a["c_h2"][:endindex]), - bounds=[(cs_h2[i] - 1e-6, 0), (cs_h2[i] + 1e-6, 1)], - ) - fitparamsCO2, _ = curve_fit( - func, - np.array(a["time"][:endindex]), - np.array(a["c_co2"][:endindex]), - bounds=[(cs_co2[i] - 1e-6, 0), (cs_co2[i] + 1e-6, 1)], - ) - tmp_kla_co2.append(fitparamsCO2[1]) - tmp_kla_h2.append(fitparamsH2[1]) - tmp_cs_h2.append(cs_h2[i]) - tmp_cs_co2.append(cs_co2[i]) - -qoi_m, qoi_s = get_qoi_uq(tmp_kla_co2, tmp_cs_co2, tmp_kla_h2, tmp_cs_h2) - - -with open("qoi.txt", "w+") as f: - f.write(f"{qoi_m},{qoi_s}\n") diff --git a/OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch_scaleup/presteps.sh b/OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch_scaleup/presteps.sh deleted file mode 100644 index 6d419bf9..00000000 --- a/OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch_scaleup/presteps.sh +++ /dev/null @@ -1,71 +0,0 @@ -# Clean case -module load anaconda3/2023 -conda activate /projects/gas2fuels/conda_env/bird -source /projects/gas2fuels/ofoam_cray_mpich/OpenFOAM-dev/etc/bashrc -./Allclean - -echo PRESTEP 1 -# Generate blockmeshDict -python /projects/gas2fuels/BioReactorDesign/applications/write_block_rect_mesh.py -i system/mesh.json -o system -#python ../../../applications/write_block_rect_mesh.py -i system/mesh.json -o system - -# Generate boundary stl -python /projects/gas2fuels/BioReactorDesign/applications/write_stl_patch.py -i system/inlets_outlets.json -#python ../../../applications/write_stl_patch.py -i system/inlets_outlets.json - -# Generate mixers -python /projects/gas2fuels/BioReactorDesign/applications/write_dynMix_fvModels_force_sign.py -i system/mixers.json -o constant -#python ../../../applications/write_dynMix_fvModels_force_sign.py -i system/mixers.json -o constant - -echo PRESTEP 2 -# Mesh gen -blockMesh -dict system/blockMeshDict - -# Inlet BC -surfaceToPatch -tol 1e-3 inlets.stl -export newmeshdir=$(foamListTimes -latestTime) -rm -rf constant/polyMesh/ -cp -r $newmeshdir/polyMesh ./constant -rm -rf $newmeshdir -cp constant/polyMesh/boundary /tmp -sed -i -e 's/inlets\.stl/inlet/g' /tmp/boundary -cat /tmp/boundary > constant/polyMesh/boundary - -# Outlet BC -surfaceToPatch -tol 1e-3 outlets.stl -export newmeshdir=$(foamListTimes -latestTime) -rm -rf constant/polyMesh/ -cp -r $newmeshdir/polyMesh ./constant -rm -rf $newmeshdir -cp constant/polyMesh/boundary /tmp -sed -i -e 's/outlets\.stl/outlet/g' /tmp/boundary -cat /tmp/boundary > constant/polyMesh/boundary - - -# Scale -transformPoints "scale=(2.7615275385627096 2.7615275385627096 2.7615275385627096)" - - -# setup IC -cp -r 0.orig 0 -setFields - -# Setup mass flow rate -# Get inlet area -postProcess -func 'patchIntegrate(patch="inlet", field="alpha.gas")' -postProcess -func writeCellVolumes -writeMeshObj - -echo PRESTEP 3 -python writeGlobalVars.py -cp constant/phaseProperties_constantd constant/phaseProperties - -conda deactivate - -if [ -f qoi.txt ]; then - rm qoi.txt -fi -if [ -f data/local/conv.npz ]; then - rm data/local/conv.npz -fi - diff --git a/OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch_scaleup/read_history.py b/OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch_scaleup/read_history.py deleted file mode 100644 index 264711f8..00000000 --- a/OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch_scaleup/read_history.py +++ /dev/null @@ -1,239 +0,0 @@ -import argparse -import os -import sys - -import numpy as np -from prettyPlot.plotting import plt, pretty_labels - -from bird.utilities.ofio import * - - -def compute_gas_holdup(caseFolder, timeFolder, nCells, field_dict={}): - if not ("alpha_liq" in field_dict) or field_dict["alpha_liq"] is None: - alpha_liq_file = os.path.join(caseFolder, timeFolder, "alpha.liquid") - alpha_liq = readOFScal(alpha_liq_file, nCells) - # print("reading alpha_liq") - field_dict["alpha_liq"] = alpha_liq - if not ("volume" in field_dict) or field_dict["volume"] is None: - volume_file = os.path.join(caseFolder, "0", "V") - volume = readOFScal(volume_file, nCells) - # print("reading Volume") - field_dict["volume"] = volume - alpha_liq = field_dict["alpha_liq"] - volume = field_dict["volume"] - holdup = np.sum((1 - alpha_liq) * volume) / np.sum(volume) - return holdup, field_dict - - -def co2liq(caseFolder, timeFolder, nCells, field_dict={}): - if not ("alpha_liq" in field_dict) or field_dict["alpha_liq"] is None: - alpha_liq_file = os.path.join(caseFolder, timeFolder, "alpha.liquid") - alpha_liq = readOFScal(alpha_liq_file, nCells) - # print("reading alpha_liq") - field_dict["alpha_liq"] = alpha_liq - if not ("co2_liq" in field_dict) or field_dict["co2_liq"] is None: - co2_liq_file = os.path.join(caseFolder, timeFolder, "CO2.liquid") - co2_liq = readOFScal(co2_liq_file, nCells) - # print("computing co2 liq") - field_dict["co2_liq"] = co2_liq - if not ("volume" in field_dict) or field_dict["volume"] is None: - volume_file = os.path.join(caseFolder, "0", "V") - volume = readOFScal(volume_file, nCells) - # print("reading Volume") - field_dict["volume"] = volume - if not ("indliq" in field_dict) or field_dict["indliq"] is None: - alpha_liq = field_dict["alpha_liq"] - indliq = np.argwhere(alpha_liq > 0.5) - # print("computing indliq") - field_dict["indliq"] = indliq - volume = field_dict["volume"] - indliq = field_dict["indliq"] - alpha_liq = field_dict["alpha_liq"] - co2_liq = field_dict["co2_liq"] - met = np.sum( - alpha_liq[indliq] * co2_liq[indliq] * volume[indliq] - ) / np.sum(volume[indliq]) - return met, field_dict - - -def cliq(caseFolder, timeFolder, nCells, field_dict={}): - if not ("alpha_liq" in field_dict) or field_dict["alpha_liq"] is None: - alpha_liq_file = os.path.join(caseFolder, timeFolder, "alpha.liquid") - alpha_liq = readOFScal(alpha_liq_file, nCells) - # print("reading alpha_liq") - field_dict["alpha_liq"] = alpha_liq - if not ("rho_liq" in field_dict) or field_dict["rho_liq"] is None: - rho_liq_file = os.path.join(caseFolder, timeFolder, "rhom") - rho_liq = readOFScal(rho_liq_file, nCells) - field_dict["rho_liq"] = rho_liq - if not ("co2_liq" in field_dict) or field_dict["co2_liq"] is None: - co2_liq_file = os.path.join(caseFolder, timeFolder, "CO2.liquid") - co2_liq = readOFScal(co2_liq_file, nCells) - # print("computing co2 liq") - field_dict["co2_liq"] = co2_liq - if not ("h2_liq" in field_dict) or field_dict["h2_liq"] is None: - h2_liq_file = os.path.join(caseFolder, timeFolder, "H2.liquid") - h2_liq = readOFScal(h2_liq_file, nCells) - # print("computing h2 liq") - field_dict["h2_liq"] = h2_liq - if not ("volume" in field_dict) or field_dict["volume"] is None: - volume_file = os.path.join(caseFolder, "0", "V") - volume = readOFScal(volume_file, nCells) - # print("reading Volume") - field_dict["volume"] = volume - if not ("indliq" in field_dict) or field_dict["indliq"] is None: - alpha_liq = field_dict["alpha_liq"] - indliq = np.argwhere(alpha_liq > 0.5) - # print("computing indliq") - field_dict["indliq"] = indliq - - volume = field_dict["volume"] - indliq = field_dict["indliq"] - alpha_liq = field_dict["alpha_liq"] - co2_liq = field_dict["co2_liq"] - h2_liq = field_dict["h2_liq"] - rho_liq = field_dict["rho_liq"] - - # c_h2 = rho_liq[indliq] * alpha_liq[indliq] * h2_liq[indliq] / 0.002016 - # c_co2 = rho_liq[indliq] * alpha_liq[indliq] * co2_liq[indliq] / 0.04401 - - c_h2 = 1000 * alpha_liq[indliq] * h2_liq[indliq] / 0.002016 - c_co2 = 1000 * alpha_liq[indliq] * co2_liq[indliq] / 0.04401 - - c_h2 = np.sum(c_h2 * volume[indliq]) / np.sum(volume[indliq]) - c_co2 = np.sum(c_co2 * volume[indliq]) / np.sum(volume[indliq]) - - return c_co2, c_h2, field_dict - - -def h2liq(caseFolder, timeFolder, nCells, field_dict={}): - if not ("alpha_liq" in field_dict) or field_dict["alpha_liq"] is None: - alpha_liq_file = os.path.join(caseFolder, timeFolder, "alpha.liquid") - alpha_liq = readOFScal(alpha_liq_file, nCells) - # print("reading alpha_liq") - field_dict["alpha_liq"] = alpha_liq - if not ("h2_liq" in field_dict) or field_dict["h2_liq"] is None: - h2_liq_file = os.path.join(caseFolder, timeFolder, "H2.liquid") - h2_liq = readOFScal(h2_liq_file, nCells) - # print("computing h2 liq") - field_dict["h2_liq"] = h2_liq - if not ("volume" in field_dict) or field_dict["volume"] is None: - volume_file = os.path.join(caseFolder, "0", "V") - volume = readOFScal(volume_file, nCells) - # print("reading Volume") - field_dict["volume"] = volume - if not ("indliq" in field_dict) or field_dict["indliq"] is None: - alpha_liq = field_dict["alpha_liq"] - indliq = np.argwhere(alpha_liq > 0.5) - # print("computing indliq") - field_dict["indliq"] = indliq - volume = field_dict["volume"] - indliq = field_dict["indliq"] - alpha_liq = field_dict["alpha_liq"] - h2_liq = field_dict["h2_liq"] - met = np.sum(alpha_liq[indliq] * h2_liq[indliq] * volume[indliq]) / np.sum( - volume[indliq] - ) - return met, field_dict - - -def vol_liq(caseFolder, timeFolder, nCells, field_dict={}): - if not ("alpha_liq" in field_dict) or field_dict["alpha_liq"] is None: - alpha_liq_file = os.path.join(caseFolder, timeFolder, "alpha.liquid") - alpha_liq = readOFScal(alpha_liq_file, nCells) - # print("reading alpha_liq") - field_dict["alpha_liq"] = alpha_liq - if not ("volume" in field_dict) or field_dict["volume"] is None: - volume_file = os.path.join(caseFolder, "0", "V") - volume = readOFScal(volume_file, nCells) - # print("reading Volume") - field_dict["volume"] = volume - volume = field_dict["volume"] - alpha_liq = field_dict["alpha_liq"] - indliq = np.argwhere(alpha_liq > 0.0) - liqvol = np.sum(alpha_liq[indliq] * volume[indliq]) / np.sum( - volume[indliq] - ) - return liqvol, field_dict - - -parser = argparse.ArgumentParser(description="Convergence of GH") -parser.add_argument( - "-cn", - "--case_name", - type=str, - metavar="", - required=True, - help="Case name", -) -parser.add_argument( - "-df", - "--data_folder", - type=str, - metavar="", - required=False, - help="data folder name", - default="data", -) - -args, unknown = parser.parse_known_args() - - -case_root = "." # "../" -case_name = args.case_name # "12_hole_sparger_snappyRefine_700rpm_opt_coeff" -case_path = "." -dataFolder = args.data_folder - -if os.path.isfile(os.path.join(dataFolder, case_name, "conv.npz")): - sys.exit("WARNING: History already created, Skipping") - -time_float_sorted, time_str_sorted = getCaseTimes(case_path, remove_zero=True) -cellCentres = readMesh(os.path.join(case_path, f"meshCellCentres_0.obj")) -nCells = len(cellCentres) - - -co2_history = np.zeros(len(time_str_sorted)) -c_co2_history = np.zeros(len(time_str_sorted)) -h2_history = np.zeros(len(time_str_sorted)) -c_h2_history = np.zeros(len(time_str_sorted)) -gh_history = np.zeros(len(time_str_sorted)) -liqvol_history = np.zeros(len(time_str_sorted)) -print(f"case_path = {case_path}") -field_dict = {} -for itime, time in enumerate(time_float_sorted): - time_folder = time_str_sorted[itime] - print(f"\tTime : {time_folder}") - if not field_dict == {}: - new_field_dict = {} - if "volume" in field_dict: - new_field_dict["volume"] = field_dict["volume"] - field_dict = new_field_dict - gh_history[itime], field_dict = compute_gas_holdup( - case_path, time_str_sorted[itime], nCells, field_dict - ) - co2_history[itime], field_dict = co2liq( - case_path, time_str_sorted[itime], nCells, field_dict - ) - h2_history[itime], field_dict = h2liq( - case_path, time_str_sorted[itime], nCells, field_dict - ) - liqvol_history[itime], field_dict = vol_liq( - case_path, time_str_sorted[itime], nCells, field_dict - ) - c_co2_history[itime], c_h2_history[itime], field_dict = cliq( - case_path, time_str_sorted[itime], nCells, field_dict - ) - - -os.makedirs(dataFolder, exist_ok=True) -os.makedirs(os.path.join(dataFolder, case_name), exist_ok=True) -np.savez( - os.path.join(dataFolder, case_name, "conv.npz"), - time=np.array(time_float_sorted), - gh=gh_history, - co2=co2_history, - h2=h2_history, - vol_liq=liqvol_history, - c_h2=c_h2_history, - c_co2=c_co2_history, -) diff --git a/OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch_scaleup/run.sh b/OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch_scaleup/run.sh deleted file mode 100644 index 6b7eb516..00000000 --- a/OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch_scaleup/run.sh +++ /dev/null @@ -1,5 +0,0 @@ -multiphaseEulerFoam - - - - diff --git a/OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch_scaleup/script b/OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch_scaleup/script deleted file mode 100755 index 090e5c05..00000000 --- a/OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch_scaleup/script +++ /dev/null @@ -1,14 +0,0 @@ -#!/bin/bash -#SBATCH --qos=high -#SBATCH --job-name=val2 -##SBATCH --partition=debug -#SBATCH --nodes=1 -#SBATCH --ntasks-per-node=16 -#SBATCH --time=07:59:00 -#SBATCH --account=co2snow - -bash presteps.sh -source /projects/gas2fuels/ofoam_cray_mpich/OpenFOAM-dev/etc/bashrc -decomposePar -fileHandler collated -srun -n 16 multiphaseEulerFoam -parallel -fileHandler collated -reconstructPar -newTimes diff --git a/OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch_scaleup/script_post b/OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch_scaleup/script_post deleted file mode 100755 index aabbc33e..00000000 --- a/OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch_scaleup/script_post +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/bash -#SBATCH --qos=high -#SBATCH --job-name=val2 -##SBATCH --partition=debug -#SBATCH --nodes=1 -#SBATCH --ntasks-per-node=16 -#SBATCH --time=00:59:00 -#SBATCH --account=co2snow - -bash computeQOI.sh diff --git a/OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch_scaleup/system/blockMeshDict b/OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch_scaleup/system/blockMeshDict deleted file mode 100644 index 1183d262..00000000 --- a/OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch_scaleup/system/blockMeshDict +++ /dev/null @@ -1,746 +0,0 @@ -FoamFile -{ - version 2.0; - format ascii; - class dictionary; - object blockMeshDict; -} - -convertToMeters 1.0; - - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -vertices -( -( 0.0 0.0 0.0) -( 1.0 0.0 0.0) -( 2.0 0.0 0.0) -( 3.0 0.0 0.0) -( 4.0 0.0 0.0) -( 5.0 0.0 0.0) -( 6.0 0.0 0.0) -( 7.0 0.0 0.0) -( 8.0 0.0 0.0) -( 9.0 0.0 0.0) -( 10.0 0.0 0.0) -( 0.0 1.0 0.0) -( 1.0 1.0 0.0) -( 2.0 1.0 0.0) -( 3.0 1.0 0.0) -( 4.0 1.0 0.0) -( 5.0 1.0 0.0) -( 6.0 1.0 0.0) -( 7.0 1.0 0.0) -( 8.0 1.0 0.0) -( 9.0 1.0 0.0) -( 10.0 1.0 0.0) -( 0.0 2.0 0.0) -( 1.0 2.0 0.0) -( 2.0 2.0 0.0) -( 3.0 2.0 0.0) -( 4.0 2.0 0.0) -( 5.0 2.0 0.0) -( 6.0 2.0 0.0) -( 7.0 2.0 0.0) -( 8.0 2.0 0.0) -( 9.0 2.0 0.0) -( 10.0 2.0 0.0) -( 0.0 3.0 0.0) -( 1.0 3.0 0.0) -( 2.0 3.0 0.0) -( 3.0 3.0 0.0) -( 4.0 3.0 0.0) -( 5.0 3.0 0.0) -( 6.0 3.0 0.0) -( 7.0 3.0 0.0) -( 8.0 3.0 0.0) -( 9.0 3.0 0.0) -( 10.0 3.0 0.0) -( 0.0 4.0 0.0) -( 1.0 4.0 0.0) -( 2.0 4.0 0.0) -( 3.0 4.0 0.0) -( 4.0 4.0 0.0) -( 5.0 4.0 0.0) -( 6.0 4.0 0.0) -( 7.0 4.0 0.0) -( 8.0 4.0 0.0) -( 9.0 4.0 0.0) -( 10.0 4.0 0.0) -( 0.0 5.0 0.0) -( 1.0 5.0 0.0) -( 2.0 5.0 0.0) -( 3.0 5.0 0.0) -( 4.0 5.0 0.0) -( 5.0 5.0 0.0) -( 6.0 5.0 0.0) -( 7.0 5.0 0.0) -( 8.0 5.0 0.0) -( 9.0 5.0 0.0) -( 10.0 5.0 0.0) -( 0.0 6.0 0.0) -( 1.0 6.0 0.0) -( 2.0 6.0 0.0) -( 3.0 6.0 0.0) -( 4.0 6.0 0.0) -( 5.0 6.0 0.0) -( 6.0 6.0 0.0) -( 7.0 6.0 0.0) -( 8.0 6.0 0.0) -( 9.0 6.0 0.0) -( 10.0 6.0 0.0) -( 0.0 7.0 0.0) -( 1.0 7.0 0.0) -( 2.0 7.0 0.0) -( 3.0 7.0 0.0) -( 4.0 7.0 0.0) -( 5.0 7.0 0.0) -( 6.0 7.0 0.0) -( 7.0 7.0 0.0) -( 8.0 7.0 0.0) -( 9.0 7.0 0.0) -( 10.0 7.0 0.0) -( 0.0 0.0 1.0) -( 1.0 0.0 1.0) -( 2.0 0.0 1.0) -( 3.0 0.0 1.0) -( 4.0 0.0 1.0) -( 5.0 0.0 1.0) -( 6.0 0.0 1.0) -( 7.0 0.0 1.0) -( 8.0 0.0 1.0) -( 9.0 0.0 1.0) -( 10.0 0.0 1.0) -( 0.0 1.0 1.0) -( 1.0 1.0 1.0) -( 2.0 1.0 1.0) -( 3.0 1.0 1.0) -( 4.0 1.0 1.0) -( 5.0 1.0 1.0) -( 6.0 1.0 1.0) -( 7.0 1.0 1.0) -( 8.0 1.0 1.0) -( 9.0 1.0 1.0) -( 10.0 1.0 1.0) -( 0.0 2.0 1.0) -( 1.0 2.0 1.0) -( 2.0 2.0 1.0) -( 3.0 2.0 1.0) -( 4.0 2.0 1.0) -( 5.0 2.0 1.0) -( 6.0 2.0 1.0) -( 7.0 2.0 1.0) -( 8.0 2.0 1.0) -( 9.0 2.0 1.0) -( 10.0 2.0 1.0) -( 0.0 3.0 1.0) -( 1.0 3.0 1.0) -( 2.0 3.0 1.0) -( 3.0 3.0 1.0) -( 4.0 3.0 1.0) -( 5.0 3.0 1.0) -( 6.0 3.0 1.0) -( 7.0 3.0 1.0) -( 8.0 3.0 1.0) -( 9.0 3.0 1.0) -( 10.0 3.0 1.0) -( 0.0 4.0 1.0) -( 1.0 4.0 1.0) -( 2.0 4.0 1.0) -( 3.0 4.0 1.0) -( 4.0 4.0 1.0) -( 5.0 4.0 1.0) -( 6.0 4.0 1.0) -( 7.0 4.0 1.0) -( 8.0 4.0 1.0) -( 9.0 4.0 1.0) -( 10.0 4.0 1.0) -( 0.0 5.0 1.0) -( 1.0 5.0 1.0) -( 2.0 5.0 1.0) -( 3.0 5.0 1.0) -( 4.0 5.0 1.0) -( 5.0 5.0 1.0) -( 6.0 5.0 1.0) -( 7.0 5.0 1.0) -( 8.0 5.0 1.0) -( 9.0 5.0 1.0) -( 10.0 5.0 1.0) -( 0.0 6.0 1.0) -( 1.0 6.0 1.0) -( 2.0 6.0 1.0) -( 3.0 6.0 1.0) -( 4.0 6.0 1.0) -( 5.0 6.0 1.0) -( 6.0 6.0 1.0) -( 7.0 6.0 1.0) -( 8.0 6.0 1.0) -( 9.0 6.0 1.0) -( 10.0 6.0 1.0) -( 0.0 7.0 1.0) -( 1.0 7.0 1.0) -( 2.0 7.0 1.0) -( 3.0 7.0 1.0) -( 4.0 7.0 1.0) -( 5.0 7.0 1.0) -( 6.0 7.0 1.0) -( 7.0 7.0 1.0) -( 8.0 7.0 1.0) -( 9.0 7.0 1.0) -( 10.0 7.0 1.0) -( 0.0 0.0 2.0) -( 1.0 0.0 2.0) -( 2.0 0.0 2.0) -( 3.0 0.0 2.0) -( 4.0 0.0 2.0) -( 5.0 0.0 2.0) -( 6.0 0.0 2.0) -( 7.0 0.0 2.0) -( 8.0 0.0 2.0) -( 9.0 0.0 2.0) -( 10.0 0.0 2.0) -( 0.0 1.0 2.0) -( 1.0 1.0 2.0) -( 2.0 1.0 2.0) -( 3.0 1.0 2.0) -( 4.0 1.0 2.0) -( 5.0 1.0 2.0) -( 6.0 1.0 2.0) -( 7.0 1.0 2.0) -( 8.0 1.0 2.0) -( 9.0 1.0 2.0) -( 10.0 1.0 2.0) -( 0.0 2.0 2.0) -( 1.0 2.0 2.0) -( 2.0 2.0 2.0) -( 3.0 2.0 2.0) -( 4.0 2.0 2.0) -( 5.0 2.0 2.0) -( 6.0 2.0 2.0) -( 7.0 2.0 2.0) -( 8.0 2.0 2.0) -( 9.0 2.0 2.0) -( 10.0 2.0 2.0) -( 0.0 3.0 2.0) -( 1.0 3.0 2.0) -( 2.0 3.0 2.0) -( 3.0 3.0 2.0) -( 4.0 3.0 2.0) -( 5.0 3.0 2.0) -( 6.0 3.0 2.0) -( 7.0 3.0 2.0) -( 8.0 3.0 2.0) -( 9.0 3.0 2.0) -( 10.0 3.0 2.0) -( 0.0 4.0 2.0) -( 1.0 4.0 2.0) -( 2.0 4.0 2.0) -( 3.0 4.0 2.0) -( 4.0 4.0 2.0) -( 5.0 4.0 2.0) -( 6.0 4.0 2.0) -( 7.0 4.0 2.0) -( 8.0 4.0 2.0) -( 9.0 4.0 2.0) -( 10.0 4.0 2.0) -( 0.0 5.0 2.0) -( 1.0 5.0 2.0) -( 2.0 5.0 2.0) -( 3.0 5.0 2.0) -( 4.0 5.0 2.0) -( 5.0 5.0 2.0) -( 6.0 5.0 2.0) -( 7.0 5.0 2.0) -( 8.0 5.0 2.0) -( 9.0 5.0 2.0) -( 10.0 5.0 2.0) -( 0.0 6.0 2.0) -( 1.0 6.0 2.0) -( 2.0 6.0 2.0) -( 3.0 6.0 2.0) -( 4.0 6.0 2.0) -( 5.0 6.0 2.0) -( 6.0 6.0 2.0) -( 7.0 6.0 2.0) -( 8.0 6.0 2.0) -( 9.0 6.0 2.0) -( 10.0 6.0 2.0) -( 0.0 7.0 2.0) -( 1.0 7.0 2.0) -( 2.0 7.0 2.0) -( 3.0 7.0 2.0) -( 4.0 7.0 2.0) -( 5.0 7.0 2.0) -( 6.0 7.0 2.0) -( 7.0 7.0 2.0) -( 8.0 7.0 2.0) -( 9.0 7.0 2.0) -( 10.0 7.0 2.0) -( 0.0 0.0 3.0) -( 1.0 0.0 3.0) -( 2.0 0.0 3.0) -( 3.0 0.0 3.0) -( 4.0 0.0 3.0) -( 5.0 0.0 3.0) -( 6.0 0.0 3.0) -( 7.0 0.0 3.0) -( 8.0 0.0 3.0) -( 9.0 0.0 3.0) -( 10.0 0.0 3.0) -( 0.0 1.0 3.0) -( 1.0 1.0 3.0) -( 2.0 1.0 3.0) -( 3.0 1.0 3.0) -( 4.0 1.0 3.0) -( 5.0 1.0 3.0) -( 6.0 1.0 3.0) -( 7.0 1.0 3.0) -( 8.0 1.0 3.0) -( 9.0 1.0 3.0) -( 10.0 1.0 3.0) -( 0.0 2.0 3.0) -( 1.0 2.0 3.0) -( 2.0 2.0 3.0) -( 3.0 2.0 3.0) -( 4.0 2.0 3.0) -( 5.0 2.0 3.0) -( 6.0 2.0 3.0) -( 7.0 2.0 3.0) -( 8.0 2.0 3.0) -( 9.0 2.0 3.0) -( 10.0 2.0 3.0) -( 0.0 3.0 3.0) -( 1.0 3.0 3.0) -( 2.0 3.0 3.0) -( 3.0 3.0 3.0) -( 4.0 3.0 3.0) -( 5.0 3.0 3.0) -( 6.0 3.0 3.0) -( 7.0 3.0 3.0) -( 8.0 3.0 3.0) -( 9.0 3.0 3.0) -( 10.0 3.0 3.0) -( 0.0 4.0 3.0) -( 1.0 4.0 3.0) -( 2.0 4.0 3.0) -( 3.0 4.0 3.0) -( 4.0 4.0 3.0) -( 5.0 4.0 3.0) -( 6.0 4.0 3.0) -( 7.0 4.0 3.0) -( 8.0 4.0 3.0) -( 9.0 4.0 3.0) -( 10.0 4.0 3.0) -( 0.0 5.0 3.0) -( 1.0 5.0 3.0) -( 2.0 5.0 3.0) -( 3.0 5.0 3.0) -( 4.0 5.0 3.0) -( 5.0 5.0 3.0) -( 6.0 5.0 3.0) -( 7.0 5.0 3.0) -( 8.0 5.0 3.0) -( 9.0 5.0 3.0) -( 10.0 5.0 3.0) -( 0.0 6.0 3.0) -( 1.0 6.0 3.0) -( 2.0 6.0 3.0) -( 3.0 6.0 3.0) -( 4.0 6.0 3.0) -( 5.0 6.0 3.0) -( 6.0 6.0 3.0) -( 7.0 6.0 3.0) -( 8.0 6.0 3.0) -( 9.0 6.0 3.0) -( 10.0 6.0 3.0) -( 0.0 7.0 3.0) -( 1.0 7.0 3.0) -( 2.0 7.0 3.0) -( 3.0 7.0 3.0) -( 4.0 7.0 3.0) -( 5.0 7.0 3.0) -( 6.0 7.0 3.0) -( 7.0 7.0 3.0) -( 8.0 7.0 3.0) -( 9.0 7.0 3.0) -( 10.0 7.0 3.0) -( 0.0 0.0 4.0) -( 1.0 0.0 4.0) -( 2.0 0.0 4.0) -( 3.0 0.0 4.0) -( 4.0 0.0 4.0) -( 5.0 0.0 4.0) -( 6.0 0.0 4.0) -( 7.0 0.0 4.0) -( 8.0 0.0 4.0) -( 9.0 0.0 4.0) -( 10.0 0.0 4.0) -( 0.0 1.0 4.0) -( 1.0 1.0 4.0) -( 2.0 1.0 4.0) -( 3.0 1.0 4.0) -( 4.0 1.0 4.0) -( 5.0 1.0 4.0) -( 6.0 1.0 4.0) -( 7.0 1.0 4.0) -( 8.0 1.0 4.0) -( 9.0 1.0 4.0) -( 10.0 1.0 4.0) -( 0.0 2.0 4.0) -( 1.0 2.0 4.0) -( 2.0 2.0 4.0) -( 3.0 2.0 4.0) -( 4.0 2.0 4.0) -( 5.0 2.0 4.0) -( 6.0 2.0 4.0) -( 7.0 2.0 4.0) -( 8.0 2.0 4.0) -( 9.0 2.0 4.0) -( 10.0 2.0 4.0) -( 0.0 3.0 4.0) -( 1.0 3.0 4.0) -( 2.0 3.0 4.0) -( 3.0 3.0 4.0) -( 4.0 3.0 4.0) -( 5.0 3.0 4.0) -( 6.0 3.0 4.0) -( 7.0 3.0 4.0) -( 8.0 3.0 4.0) -( 9.0 3.0 4.0) -( 10.0 3.0 4.0) -( 0.0 4.0 4.0) -( 1.0 4.0 4.0) -( 2.0 4.0 4.0) -( 3.0 4.0 4.0) -( 4.0 4.0 4.0) -( 5.0 4.0 4.0) -( 6.0 4.0 4.0) -( 7.0 4.0 4.0) -( 8.0 4.0 4.0) -( 9.0 4.0 4.0) -( 10.0 4.0 4.0) -( 0.0 5.0 4.0) -( 1.0 5.0 4.0) -( 2.0 5.0 4.0) -( 3.0 5.0 4.0) -( 4.0 5.0 4.0) -( 5.0 5.0 4.0) -( 6.0 5.0 4.0) -( 7.0 5.0 4.0) -( 8.0 5.0 4.0) -( 9.0 5.0 4.0) -( 10.0 5.0 4.0) -( 0.0 6.0 4.0) -( 1.0 6.0 4.0) -( 2.0 6.0 4.0) -( 3.0 6.0 4.0) -( 4.0 6.0 4.0) -( 5.0 6.0 4.0) -( 6.0 6.0 4.0) -( 7.0 6.0 4.0) -( 8.0 6.0 4.0) -( 9.0 6.0 4.0) -( 10.0 6.0 4.0) -( 0.0 7.0 4.0) -( 1.0 7.0 4.0) -( 2.0 7.0 4.0) -( 3.0 7.0 4.0) -( 4.0 7.0 4.0) -( 5.0 7.0 4.0) -( 6.0 7.0 4.0) -( 7.0 7.0 4.0) -( 8.0 7.0 4.0) -( 9.0 7.0 4.0) -( 10.0 7.0 4.0) -( 0.0 0.0 5.0) -( 1.0 0.0 5.0) -( 2.0 0.0 5.0) -( 3.0 0.0 5.0) -( 4.0 0.0 5.0) -( 5.0 0.0 5.0) -( 6.0 0.0 5.0) -( 7.0 0.0 5.0) -( 8.0 0.0 5.0) -( 9.0 0.0 5.0) -( 10.0 0.0 5.0) -( 0.0 1.0 5.0) -( 1.0 1.0 5.0) -( 2.0 1.0 5.0) -( 3.0 1.0 5.0) -( 4.0 1.0 5.0) -( 5.0 1.0 5.0) -( 6.0 1.0 5.0) -( 7.0 1.0 5.0) -( 8.0 1.0 5.0) -( 9.0 1.0 5.0) -( 10.0 1.0 5.0) -( 0.0 2.0 5.0) -( 1.0 2.0 5.0) -( 2.0 2.0 5.0) -( 3.0 2.0 5.0) -( 4.0 2.0 5.0) -( 5.0 2.0 5.0) -( 6.0 2.0 5.0) -( 7.0 2.0 5.0) -( 8.0 2.0 5.0) -( 9.0 2.0 5.0) -( 10.0 2.0 5.0) -( 0.0 3.0 5.0) -( 1.0 3.0 5.0) -( 2.0 3.0 5.0) -( 3.0 3.0 5.0) -( 4.0 3.0 5.0) -( 5.0 3.0 5.0) -( 6.0 3.0 5.0) -( 7.0 3.0 5.0) -( 8.0 3.0 5.0) -( 9.0 3.0 5.0) -( 10.0 3.0 5.0) -( 0.0 4.0 5.0) -( 1.0 4.0 5.0) -( 2.0 4.0 5.0) -( 3.0 4.0 5.0) -( 4.0 4.0 5.0) -( 5.0 4.0 5.0) -( 6.0 4.0 5.0) -( 7.0 4.0 5.0) -( 8.0 4.0 5.0) -( 9.0 4.0 5.0) -( 10.0 4.0 5.0) -( 0.0 5.0 5.0) -( 1.0 5.0 5.0) -( 2.0 5.0 5.0) -( 3.0 5.0 5.0) -( 4.0 5.0 5.0) -( 5.0 5.0 5.0) -( 6.0 5.0 5.0) -( 7.0 5.0 5.0) -( 8.0 5.0 5.0) -( 9.0 5.0 5.0) -( 10.0 5.0 5.0) -( 0.0 6.0 5.0) -( 1.0 6.0 5.0) -( 2.0 6.0 5.0) -( 3.0 6.0 5.0) -( 4.0 6.0 5.0) -( 5.0 6.0 5.0) -( 6.0 6.0 5.0) -( 7.0 6.0 5.0) -( 8.0 6.0 5.0) -( 9.0 6.0 5.0) -( 10.0 6.0 5.0) -( 0.0 7.0 5.0) -( 1.0 7.0 5.0) -( 2.0 7.0 5.0) -( 3.0 7.0 5.0) -( 4.0 7.0 5.0) -( 5.0 7.0 5.0) -( 6.0 7.0 5.0) -( 7.0 7.0 5.0) -( 8.0 7.0 5.0) -( 9.0 7.0 5.0) -( 10.0 7.0 5.0) -); - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -blocks -( - - //block 0 -hex (0 1 12 11 88 89 100 99 ) -( 10 10 10 ) -SimpleGrading (1 1 1) - - //block 1 -hex (1 2 13 12 89 90 101 100 ) -( 10 10 10 ) -SimpleGrading (1 1 1) - - //block 2 -hex (2 3 14 13 90 91 102 101 ) -( 10 10 10 ) -SimpleGrading (1 1 1) - - //block 3 -hex (3 4 15 14 91 92 103 102 ) -( 10 10 10 ) -SimpleGrading (1 1 1) - - //block 4 -hex (4 5 16 15 92 93 104 103 ) -( 10 10 10 ) -SimpleGrading (1 1 1) - - //block 5 -hex (5 6 17 16 93 94 105 104 ) -( 10 10 10 ) -SimpleGrading (1 1 1) - - //block 6 -hex (6 7 18 17 94 95 106 105 ) -( 10 10 10 ) -SimpleGrading (1 1 1) - - //block 7 -hex (7 8 19 18 95 96 107 106 ) -( 10 10 10 ) -SimpleGrading (1 1 1) - - //block 8 -hex (8 9 20 19 96 97 108 107 ) -( 10 10 10 ) -SimpleGrading (1 1 1) - - //block 9 -hex (9 10 21 20 97 98 109 108 ) -( 10 10 10 ) -SimpleGrading (1 1 1) - - //block 10 -hex (97 98 109 108 185 186 197 196 ) -( 10 10 10 ) -SimpleGrading (1 1 1) - - //block 11 -hex (185 186 197 196 273 274 285 284 ) -( 10 10 10 ) -SimpleGrading (1 1 1) - - //block 12 -hex (273 274 285 284 361 362 373 372 ) -( 10 10 10 ) -SimpleGrading (1 1 1) - - //block 13 -hex (361 362 373 372 449 450 461 460 ) -( 10 10 10 ) -SimpleGrading (1 1 1) - - //block 14 -hex (360 361 372 371 448 449 460 459 ) -( 10 10 10 ) -SimpleGrading (1 1 1) - - //block 15 -hex (359 360 371 370 447 448 459 458 ) -( 10 10 10 ) -SimpleGrading (1 1 1) - - //block 16 -hex (358 359 370 369 446 447 458 457 ) -( 10 10 10 ) -SimpleGrading (1 1 1) - - //block 17 -hex (357 358 369 368 445 446 457 456 ) -( 10 10 10 ) -SimpleGrading (1 1 1) - - //block 18 -hex (356 357 368 367 444 445 456 455 ) -( 10 10 10 ) -SimpleGrading (1 1 1) - - //block 19 -hex (355 356 367 366 443 444 455 454 ) -( 10 10 10 ) -SimpleGrading (1 1 1) - - //block 20 -hex (354 355 366 365 442 443 454 453 ) -( 10 10 10 ) -SimpleGrading (1 1 1) - - //block 21 -hex (353 354 365 364 441 442 453 452 ) -( 10 10 10 ) -SimpleGrading (1 1 1) - - //block 22 -hex (352 353 364 363 440 441 452 451 ) -( 10 10 10 ) -SimpleGrading (1 1 1) - - //block 23 -hex (363 364 375 374 451 452 463 462 ) -( 10 10 10 ) -SimpleGrading (1 1 1) - - //block 24 -hex (374 375 386 385 462 463 474 473 ) -( 10 10 10 ) -SimpleGrading (1 1 1) - - //block 25 -hex (385 386 397 396 473 474 485 484 ) -( 10 10 10 ) -SimpleGrading (1 1 1) - - //block 26 -hex (396 397 408 407 484 485 496 495 ) -( 10 10 10 ) -SimpleGrading (1 1 1) - - //block 27 -hex (407 408 419 418 495 496 507 506 ) -( 10 10 10 ) -SimpleGrading (1 1 1) - - //block 28 -hex (418 419 430 429 506 507 518 517 ) -( 10 10 10 ) -SimpleGrading (1 1 1) - - //block 29 -hex (308 309 320 319 396 397 408 407 ) -( 10 10 10 ) -SimpleGrading (1 1 1) - - //block 30 -hex (220 221 232 231 308 309 320 319 ) -( 10 10 10 ) -SimpleGrading (1 1 1) - - //block 31 -hex (132 133 144 143 220 221 232 231 ) -( 10 10 10 ) -SimpleGrading (1 1 1) - - //block 32 -hex (44 45 56 55 132 133 144 143 ) -( 10 10 10 ) -SimpleGrading (1 1 1) - - //block 33 -hex (55 56 67 66 143 144 155 154 ) -( 10 10 10 ) -SimpleGrading (1 1 1) - - //block 34 -hex (66 67 78 77 154 155 166 165 ) -( 10 10 10 ) -SimpleGrading (1 1 1) - - //block 35 -hex (33 34 45 44 121 122 133 132 ) -( 10 10 10 ) -SimpleGrading (1 1 1) - - //block 36 -hex (22 23 34 33 110 111 122 121 ) -( 10 10 10 ) -SimpleGrading (1 1 1) - - //block 37 -hex (11 12 23 22 99 100 111 110 ) -( 10 10 10 ) -SimpleGrading (1 1 1) -); - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -defaultPatch -{ type wall;} - -patches -( -); diff --git a/OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch_scaleup/system/controlDict b/OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch_scaleup/system/controlDict deleted file mode 100644 index 7f457c4b..00000000 --- a/OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch_scaleup/system/controlDict +++ /dev/null @@ -1,67 +0,0 @@ -/*--------------------------------*- C++ -*----------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | Website: https://openfoam.org - \\ / A nd | Version: dev - \\/ M anipulation | -\*---------------------------------------------------------------------------*/ -FoamFile -{ - format ascii; - class dictionary; - location "system"; - object controlDict; -} -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -application multiphaseEulerFoam; - -startFrom latestTime;//startTime; - -startTime 0; - -stopAt endTime; - -endTime 200; - -deltaT 0.0001; - -writeControl adjustableRunTime; - -writeInterval 2; - -purgeWrite 0; - -writeFormat ascii; - -writePrecision 6; - -writeCompression off; - -timeFormat general; - -timePrecision 6; - -runTimeModifiable yes; - -adjustTimeStep yes; - -maxCo 0.5; - -maxDeltaT 0.01; - - -functions -{ - - #includeFunc writeObjects(d.gas) - #includeFunc writeObjects(thermo:rho.gas) - #includeFunc writeObjects(thermo:rho.liquid) -} -//functions -//{ -// #includeFunc fieldAverage(U.air, U.water, alpha.air, p) -//} - - -// ************************************************************************* // diff --git a/OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch_scaleup/system/decomposeParDict b/OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch_scaleup/system/decomposeParDict deleted file mode 100755 index f8397e73..00000000 --- a/OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch_scaleup/system/decomposeParDict +++ /dev/null @@ -1,30 +0,0 @@ -/*--------------------------------*- C++ -*----------------------------------*\ -| ========= | | -| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | -| \\ / O peration | Version: 3.0.x | -| \\ / A nd | Web: www.OpenFOAM.org | -| \\/ M anipulation | | -\*---------------------------------------------------------------------------*/ -FoamFile -{ - version 2.0; - format ascii; - class dictionary; - object decomposeParDict; -} - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -numberOfSubdomains 16; - -method scotch; - -hierarchicalCoeffs -{ - n (4 4 1); - delta 0.001; - order xyz; -} - - -// ************************************************************************* // diff --git a/OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch_scaleup/system/fvConstraints b/OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch_scaleup/system/fvConstraints deleted file mode 100644 index 334f1c8f..00000000 --- a/OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch_scaleup/system/fvConstraints +++ /dev/null @@ -1,56 +0,0 @@ -/*--------------------------------*- C++ -*----------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | Website: https://openfoam.org - \\ / A nd | Version: dev - \\/ M anipulation | -\*---------------------------------------------------------------------------*/ -FoamFile -{ - format ascii; - class dictionary; - object fvConstraints; -} -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -limitp -{ - type limitPressure; - - min 1e4; -} -limitUliq -{ - type limitVelocity; - active yes; - U U.liquid; - selectionMode all; - max 1e1; -} -limitUgas -{ - type limitVelocity; - active yes; - U U.gas; - selectionMode all; - max 2e1; -} -limitTgas -{ - type limitTemperature; - selectionMode all; - min 290; - max 310; - phase gas; -} -limitTliq -{ - type limitTemperature; - selectionMode all; - min 290; - max 310; - phase liquid; -} - - -// ************************************************************************* // diff --git a/OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch_scaleup/system/fvSchemes b/OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch_scaleup/system/fvSchemes deleted file mode 100644 index 52e6e13a..00000000 --- a/OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch_scaleup/system/fvSchemes +++ /dev/null @@ -1,70 +0,0 @@ -/*--------------------------------*- C++ -*----------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | Website: https://openfoam.org - \\ / A nd | Version: dev - \\/ M anipulation | -\*---------------------------------------------------------------------------*/ -FoamFile -{ - format ascii; - class dictionary; - location "system"; - object fvSchemes; -} -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -ddtSchemes -{ - default Euler; -} - -gradSchemes -{ - default Gauss linear; - limited cellLimited Gauss linear 1; -} - -divSchemes -{ - default none; - - "div\(phi,alpha.*\)" Gauss vanLeer; - - "div\(phir,alpha.*,alpha.*\)" Gauss vanLeer; - - "div\(alphaRhoPhi.*,U.*\)" Gauss limitedLinearV 1; - "div\(phi.*,U.*\)" Gauss limitedLinearV 1; - "div\(alphaRhoPhi.*,Yi\)" Gauss limitedLinear 1; - "div\(alphaRhoPhi.*,(h|e).*\)" Gauss limitedLinear 1; - "div\(alphaRhoPhi.*,(K|k|epsilon|omega).*\)" Gauss limitedLinear 1; - "div\(alphaPhi.*,f.*\)" Gauss limitedLinear 1; - "div\(alphaRhoPhi.*,\(p\|thermo:rho.*\)\)" Gauss limitedLinear 1; - - "div\(phim,(k|epsilon)m\)" Gauss upwind; - "div\(\(\(\(alpha.*\*thermo:rho.*\)*nuEff.*\)*dev2\(T\(grad\(U.*\)\)\)\)\)" Gauss linear; -} - -laplacianSchemes -{ - default Gauss linear corrected; -} - -interpolationSchemes -{ - default linear; -} - -snGradSchemes -{ - default uncorrected; -} - -wallDist -{ - method Poisson; - nRequired true; -} - - -// ************************************************************************* // diff --git a/OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch_scaleup/system/fvSolution b/OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch_scaleup/system/fvSolution deleted file mode 100644 index 2e69fdfa..00000000 --- a/OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch_scaleup/system/fvSolution +++ /dev/null @@ -1,120 +0,0 @@ -/*--------------------------------*- C++ -*----------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | Website: https://openfoam.org - \\ / A nd | Version: dev - \\/ M anipulation | -\*---------------------------------------------------------------------------*/ -FoamFile -{ - format ascii; - class dictionary; - location "system"; - object fvSolution; -} -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -solvers -{ - "alpha.*" - { - nAlphaCorr 2; - nAlphaSubCycles 5; - } - - bubbles - { - nCorr 1; - tolerance 1e-4; - scale true; - solveOnFinalIterOnly true; - sourceUpdateInterval 1; - } - - p_rgh - { - solver GAMG; - smoother DIC; - tolerance 1e-7; - relTol 0; - } - - p_rghFinal - { - $p_rgh; - relTol 0; - } - - "(k|omega).*" - { - solver smoothSolver; - smoother symGaussSeidel; - tolerance 1e-7; - relTol 0; - minIter 1; - } - - "(e|h).*" - { - solver smoothSolver; - smoother symGaussSeidel; - tolerance 1e-8; - relTol 0; - minIter 0; - maxIter 3; - } - - "f.*" - { - solver PBiCGStab; - preconditioner DILU; - tolerance 1e-6; - relTol 0; - } - - "Yi.*" - { - solver PBiCGStab; - preconditioner DILU; - tolerance 1e-12; - relTol 0; - residualAlpha 1e-8; - } - - "U.*" - { - solver smoothSolver; - smoother symGaussSeidel; - tolerance 1e-5; - relTol 0; - minIter 1; - } - - yPsi - { - solver PCG; - preconditioner DIC; - tolerance 1e-10; - relTol 0; - } - -} - -PIMPLE -{ - nOuterCorrectors 3; - nCorrectors 1; - nNonOrthogonalCorrectors 0; - -} - -relaxationFactors -{ - equations - { - ".*" 1; - } -} - - -// ************************************************************************* // diff --git a/OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch_scaleup/system/inlets_outlets.json b/OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch_scaleup/system/inlets_outlets.json deleted file mode 100644 index 2b53da73..00000000 --- a/OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch_scaleup/system/inlets_outlets.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "Geometry": { - "OverallDomain": { - "x" : {"nblocks": 10, "size_per_block": 1.0}, - "y" : {"nblocks": 11, "size_per_block": 1.0}, - "z" : {"nblocks": 5, "size_per_block": 1.0} - }, - "Fluids": [ - [ [0,0,0], [9,0,0] ], - [ [9,0,0], [9,0,4] ], - [ [9,0,4], [0,0,4] ], - [ [0,1,4], [0,4,4] ], - [ [0,4,4], [0,10,4] ], - [ [0,4,4], [0,4,0] ], - [ [0,4,0], [0,10,0] ], - [ [0,4,0], [0,1,0] ] - ] - }, - "inlets": [ - {"branch_id": 0, "type": "circle", "frac_space": 0.2222222222222222, "normal_dir": 1, "radius": 0.4, "nelements": 50, "block_pos": "bottom"}, - {"branch_id": 0, "type": "circle", "frac_space": 0.5, "radius": 0.4, "normal_dir": 1,"nelements": 50, "block_pos": "bottom"}, - {"branch_id": 0, "type": "circle", "frac_space": 0.7777777777777778, "radius": 0.4, "normal_dir": 1,"nelements": 50, "block_pos": "bottom"} - ], - "outlets": [ - {"branch_id": 6, "type": "circle", "frac_space": 1, "normal_dir": 1, "radius": 0.4, "nelements": 50, "block_pos": "top"}, - {"branch_id": 4, "type": "circle", "frac_space": 1, "normal_dir": 1, "radius": 0.4, "nelements": 50, "block_pos": "top"} - ] -} diff --git a/OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch_scaleup/system/mesh.json b/OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch_scaleup/system/mesh.json deleted file mode 100644 index 29841d7e..00000000 --- a/OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch_scaleup/system/mesh.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "Meshing": { - "Blockwise": { - "x" : 10, - "y" : 10, - "z" : 10 - } - }, - "Geometry": { - "OverallDomain": { - "x" : {"nblocks": 10, "size_per_block": 1.0}, - "y" : {"nblocks": 11, "size_per_block": 1.0}, - "z" : {"nblocks": 5, "size_per_block": 1.0} - }, - "Fluids": [ - [ [0,0,0], [9,0,0] ], - [ [9,0,0], [9,0,4] ], - [ [9,0,4], [0,0,4] ], - [ [0,1,4], [0,4,4] ], - [ [0,4,4], [0,10,4] ], - [ [0,4,4], [0,4,0] ], - [ [0,4,0], [0,10,0] ], - [ [0,4,0], [0,1,0] ] - ] - } -} diff --git a/OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch_scaleup/system/mixers.json b/OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch_scaleup/system/mixers.json deleted file mode 100644 index b6224fb7..00000000 --- a/OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch_scaleup/system/mixers.json +++ /dev/null @@ -1,29 +0,0 @@ -{ - "Meshing": { - "Blockwise": { - "x" : 10, - "y" : 10, - "z" : 10 - } - }, - "Geometry": { - "OverallDomain": { - "x" : {"nblocks": 10, "size_per_block": 1.0, "rescale": 2.7615275385627096}, - "y" : {"nblocks": 11, "size_per_block": 1.0, "rescale": 2.7615275385627096}, - "z" : {"nblocks": 5, "size_per_block": 1.0, "rescale": 2.7615275385627096} - }, - "Fluids": [ - [ [0,0,0], [9,0,0] ], - [ [9,0,0], [9,0,4] ], - [ [9,0,4], [0,0,4] ], - [ [0,1,4], [0,4,4] ], - [ [0,4,4], [0,10,4] ], - [ [0,4,4], [0,4,0] ], - [ [0,4,0], [0,10,0] ], - [ [0,4,0], [0,1,0] ] - ] - }, - "mixers": [ - {"branch_id": 2, "frac_space": 0.5, "start_time": 4, "power": 1500, "sign": "+"} - ] -} diff --git a/OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch_scaleup/system/setFieldsDict b/OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch_scaleup/system/setFieldsDict deleted file mode 100644 index 89a797b9..00000000 --- a/OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch_scaleup/system/setFieldsDict +++ /dev/null @@ -1,37 +0,0 @@ -/*--------------------------------*- C++ -*----------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | Website: https://openfoam.org - \\ / A nd | Version: dev - \\/ M anipulation | -\*---------------------------------------------------------------------------*/ -FoamFile -{ - format ascii; - class dictionary; - location "system"; - object setFieldsDict; -} -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -defaultFieldValues -( - volScalarFieldValue alpha.gas 0.99 - volScalarFieldValue alpha.liquid 0.01 -); - -regions -( - boxToCell - { - box (-1.0 -1.0 -1.0) (552.3 11.046 552.3); - fieldValues - ( - volScalarFieldValue alpha.gas 0.01 - volScalarFieldValue alpha.liquid 0.99 - ); - } -); - - -// ************************************************************************* // diff --git a/OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch_scaleup/writeGlobalVars.py b/OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch_scaleup/writeGlobalVars.py deleted file mode 100644 index 0594eccc..00000000 --- a/OFsolvers/tutorial_cases/loop_reactor_pbe_dynmix_nonstat_headbranch_scaleup/writeGlobalVars.py +++ /dev/null @@ -1,47 +0,0 @@ -import os - -import numpy as np - -from bird.utilities.ofio import * - - -def writeGvars(inletA, liqVol): - filename_tmp = os.path.join("constant", "globalVars_temp") - with open(filename_tmp, "r+") as f: - lines = f.readlines() - filename = os.path.join("constant", "globalVars") - with open(filename, "w+") as f: - for line in lines: - if line.startswith("inletA"): - f.write(f"inletA\t{inletA:g};\n") - elif line.startswith("liqVol"): - f.write(f"liqVol\t{liqVol:g};\n") - else: - f.write(line) - - -def readInletArea(): - filename = os.path.join( - "postProcessing", - "patchIntegrate(patch=inlet,field=alpha.gas)", - "0", - "surfaceFieldValue.dat", - ) - with open(filename, "r+") as f: - lines = f.readlines() - return float(lines[4].split()[-1]) - - -def getLiqVol(): - cellCentres = readMesh(os.path.join(".", f"meshCellCentres_0.obj")) - volume_field = readOFScal(os.path.join("0", "V"), len(cellCentres)) - alpha_field = readOFScal( - os.path.join("0", "alpha.liquid"), len(cellCentres) - ) - return np.sum(volume_field * alpha_field) - - -if __name__ == "__main__": - A = readInletArea() - V = getLiqVol() - writeGvars(A, V) diff --git a/applications/GA_opt/ga2sim.py b/applications/GA_opt/ga2sim.py deleted file mode 100644 index a5526bff..00000000 --- a/applications/GA_opt/ga2sim.py +++ /dev/null @@ -1,124 +0,0 @@ -import os -import pickle -import shutil - -import numpy as np - -from bird import BIRD_CASE_DIR -from bird.preprocess.json_gen.design_io import * -from bird.preprocess.json_gen.generate_designs import * - - -def optimization_setup(): - # spots on the branches where we can place sparger or mixers - branchcom_spots = {} - branchcom_spots[0] = np.linspace(0.2, 0.8, 4) - branchcom_spots[1] = np.linspace(0.2, 0.8, 3) - branchcom_spots[2] = np.linspace(0.2, 0.8, 4) - # branches where the sparger and mixers are placed - branches_com = [0, 1, 2] - return branchcom_spots, branches_com - - -def check_ga_samples(ga_samples): - # we expect ga_samples of dimension (N, 11), where N is the number of samples in the batch - assert len(ga_samples.shape) == 2 - assert ga_samples.shape[1] == 11 - assert np.amax(ga_samples) <= 2 - assert np.amin(ga_samples) >= 0 - - -def ga2sim(ga_samples): - branchcom_spots, branches_com = optimization_setup() - check_ga_samples(ga_samples) - config_dict = {} - # Split ga_samples across the 3 branches - split_ga_samples = np.split(ga_samples, [4, 7], axis=1) - n_batch = ga_samples.shape[0] - for i_batch in range(n_batch): - config = {} - for branch in branches_com: - config[branch] = split_ga_samples[branch][i_batch, :] - config_dict[i_batch] = config - - return config_dict - - -def setup_sim_batch( - ga_samples, vvm_v=0.4, pow_v=6000, study_folder="GA_batch" -): - # GA_batch - check_ga_samples(ga_samples) - n_batch = ga_samples.shape[0] - branchcom_spots, branches_com = optimization_setup() - - # Generate cases - config_dict = ga2sim(ga_samples) - generate_scaledup_reactor_cases( - config_dict, - branchcom_spots=branchcom_spots, - vvm=vvm_v, - power=pow_v, - constantD=True, - study_folder=study_folder, - ) - write_script_start(f"{study_folder}/many_scripts_start", n_batch) - write_script_post(f"{study_folder}/many_scripts_post", n_batch) - write_prep(f"{study_folder}/prep.sh", n_batch) - save_config_dict(f"{study_folder}/configs.pkl", config_dict) - save_config_dict(f"{study_folder}/branchcom_spots.pkl", branchcom_spots) - - -if __name__ == "__main__": - import argparse - - parser = argparse.ArgumentParser(description="GA setup") - parser.add_argument( - "-bf", - "--batch_folder", - type=str, - metavar="", - required=False, - help="Folder that contains the batch of sims", - default="GAbatch_0.4vvm_6kW", - ) - parser.add_argument( - "-vvm", - "--vvm", - type=float, - metavar="", - required=False, - help="Volume flow rate", - default=0.4, - ) - parser.add_argument( - "-pow", - "--power", - type=float, - metavar="", - required=False, - help="mixer power", - default=6000, - ) - parser.add_argument( - "-gas", - "--ga_sample_file", - type=str, - metavar="", - required=False, - help="file containing the ga samples to execute", - default=None, - ) - args, unknown = parser.parse_known_args() - - if args.ga_sample_file is None: - n_batch = 3 - ga_samples = np.random.choice([0, 1, 2], size=(n_batch, 11)) - else: - ga_samples = np.load(args.ga_sample_file) - vvm_v = args.vvm - pow_v = args.power - study_folder = args.batch_folder - setup_sim_batch( - ga_samples, vvm_v=vvm_v, pow_v=pow_v, study_folder=study_folder - ) diff --git a/applications/GA_opt/read_qoi.py b/applications/GA_opt/read_qoi.py deleted file mode 100644 index e1924121..00000000 --- a/applications/GA_opt/read_qoi.py +++ /dev/null @@ -1,51 +0,0 @@ -import argparse -import os - -import numpy as np - - -def count_sim(dirlist): - count = 0 - for entry in dirlist: - if entry.startswith("Sim"): - count += 1 - return count - - -def read_qoi(case_folder): - filen = os.path.join(case_folder, "qoi.txt") - if os.path.isfile(filen): - with open(filen, "r+") as f: - try: - line = f.readline() - qois = line.split(",") - except: - qois = [np.nan, np.nan] - return float(qois[0]), float(qois[1]) - else: - return np.nan, np.nan - - -parser = argparse.ArgumentParser(description="QOI reader") -parser.add_argument( - "-bf", - "--batch_folder", - type=str, - metavar="", - required=True, - help="Folder that contains the batch of sims", -) -args, unknown = parser.parse_known_args() - - -dir_list = os.listdir(args.batch_folder) -n_sim = count_sim(dir_list) -qoi = np.zeros(n_sim) -qoi_err = np.zeros(n_sim) -for isim in range(n_sim): - case_folder = os.path.join(args.batch_folder, f"Sim_{isim}") - qoi[isim], qoi_err[isim] = read_qoi(case_folder) - -np.savez( - os.path.join(args.batch_folder, "results.npz"), qoi=qoi, qoi_err=qoi_err -) diff --git a/applications/GA_opt/runGA.sh b/applications/GA_opt/runGA.sh deleted file mode 100644 index 210010fc..00000000 --- a/applications/GA_opt/runGA.sh +++ /dev/null @@ -1,14 +0,0 @@ -for ga_iter in NiterGA: - 1) decide next batch of GA samples - 2) save samples as 'samples_batch${ga_iter}.npy' - 3) setup the next batch of CFD runs - python ga2sim.py -bf GAbatch${ga_iter}_0.4vvm_6kW -vvm 0.4 -pow 6000 --ga_sample_file samples_batch${ga_iter}.npy - 4) run the CFD sim - cd GAbatch${ga_iter}_0.4vvm_6kW - bash many_scripts_start - 5) waituntil done - 6) compute QOI - cd GAbatch${ga_iter}_0.4vvm_6kW - bash many_scripts_post - 7) Store qoi of batch in numpy array - python read_qoi.py -bf GAbatch${ga_iter}_0.4vvm_6kW diff --git a/applications/Random_opt/randsim.py b/applications/Random_opt/randsim.py deleted file mode 100644 index a3b49d53..00000000 --- a/applications/Random_opt/randsim.py +++ /dev/null @@ -1,100 +0,0 @@ -import os -import pickle -import shutil - -import numpy as np - -from bird import BIRD_CASE_DIR -from bird.preprocess.json_gen.design_io import * -from bird.preprocess.json_gen.generate_designs import * - - -def optimization_setup(): - # spots on the branches where we can place sparger or mixers - branchcom_spots = {} - branchcom_spots[0] = np.linspace(0.2, 0.8, 4) - branchcom_spots[1] = np.linspace(0.2, 0.8, 3) - branchcom_spots[2] = np.linspace(0.2, 0.8, 4) - # branches where the sparger and mixers are placed - branches_com = [0, 1, 2] - return branchcom_spots, branches_com - - -def random_sample(branches_com, branchcom_spots, config_dict={}): - config = {} - # choices = ["mix", "sparger", "none"] - choices_com = [0, 1, 2] - for branch in branches_com: - config[branch] = np.random.choice( - choices_com, size=len(branchcom_spots[branch]) - ) - - existing = False - new_config_key = 0 - for old_key_conf in config_dict: - if compare_config(config_dict[old_key_conf], config): - existing = True - print("FOUND SAME CONFIG") - return config_dict - new_config_key = old_key_conf + 1 - - if check_config(config): - config_dict[new_config_key] = config - - return config_dict - - -if __name__ == "__main__": - branchcom_spots, branches_com = optimization_setup() - n_sim = 4 - config_dict = {} - for i in range(n_sim): - config_dict = random_sample( - branches_com, branchcom_spots, config_dict=config_dict - ) - - vvm_l = [0.4] - pow_l = [2] - - for vvm_v in vvm_l: - vvm_str = str(vvm_v).replace(".", "_") - for pow_v in pow_l: - study_folder = f"study_{vvm_str}vvm_{pow_v}W" - generate_small_reactor_cases( - config_dict, - branchcom_spots, - vvm=vvm_v, - power=pow_v, - constantD=True, - study_folder=study_folder, - ) - write_script_start(f"{study_folder}/many_scripts_start", n_sim) - write_script_post(f"{study_folder}/many_scripts_post", n_sim) - write_prep(f"{study_folder}/prep.sh", n_sim) - save_config_dict(f"{study_folder}/configs.pkl", config_dict) - save_config_dict( - f"{study_folder}/branchcom_spots.pkl", branchcom_spots - ) - - vvm_l = [0.1, 0.4] - pow_l = [6000] - - for vvm_v in vvm_l: - vvm_str = str(vvm_v).replace(".", "_") - for pow_v in pow_l: - study_folder = f"study_scaleup_{vvm_str}vvm_{pow_v}W" - generate_scaledup_reactor_cases( - config_dict, - branchcom_spots, - vvm=vvm_v, - power=pow_v, - constantD=True, - study_folder=study_folder, - ) - write_script_start(f"{study_folder}/many_scripts_start", n_sim) - write_script_post(f"{study_folder}/many_scripts_post", n_sim) - write_prep(f"{study_folder}/prep.sh", n_sim) - save_config_dict(f"{study_folder}/configs.pkl", config_dict) - save_config_dict( - f"{study_folder}/branchcom_spots.pkl", branchcom_spots - ) diff --git a/applications/Random_opt/read_qoi.py b/applications/Random_opt/read_qoi.py deleted file mode 100644 index e1924121..00000000 --- a/applications/Random_opt/read_qoi.py +++ /dev/null @@ -1,51 +0,0 @@ -import argparse -import os - -import numpy as np - - -def count_sim(dirlist): - count = 0 - for entry in dirlist: - if entry.startswith("Sim"): - count += 1 - return count - - -def read_qoi(case_folder): - filen = os.path.join(case_folder, "qoi.txt") - if os.path.isfile(filen): - with open(filen, "r+") as f: - try: - line = f.readline() - qois = line.split(",") - except: - qois = [np.nan, np.nan] - return float(qois[0]), float(qois[1]) - else: - return np.nan, np.nan - - -parser = argparse.ArgumentParser(description="QOI reader") -parser.add_argument( - "-bf", - "--batch_folder", - type=str, - metavar="", - required=True, - help="Folder that contains the batch of sims", -) -args, unknown = parser.parse_known_args() - - -dir_list = os.listdir(args.batch_folder) -n_sim = count_sim(dir_list) -qoi = np.zeros(n_sim) -qoi_err = np.zeros(n_sim) -for isim in range(n_sim): - case_folder = os.path.join(args.batch_folder, f"Sim_{isim}") - qoi[isim], qoi_err[isim] = read_qoi(case_folder) - -np.savez( - os.path.join(args.batch_folder, "results.npz"), qoi=qoi, qoi_err=qoi_err -) diff --git a/applications/Random_opt/runGA.sh b/applications/Random_opt/runGA.sh deleted file mode 100644 index 210010fc..00000000 --- a/applications/Random_opt/runGA.sh +++ /dev/null @@ -1,14 +0,0 @@ -for ga_iter in NiterGA: - 1) decide next batch of GA samples - 2) save samples as 'samples_batch${ga_iter}.npy' - 3) setup the next batch of CFD runs - python ga2sim.py -bf GAbatch${ga_iter}_0.4vvm_6kW -vvm 0.4 -pow 6000 --ga_sample_file samples_batch${ga_iter}.npy - 4) run the CFD sim - cd GAbatch${ga_iter}_0.4vvm_6kW - bash many_scripts_start - 5) waituntil done - 6) compute QOI - cd GAbatch${ga_iter}_0.4vvm_6kW - bash many_scripts_post - 7) Store qoi of batch in numpy array - python read_qoi.py -bf GAbatch${ga_iter}_0.4vvm_6kW diff --git a/applications/convert_dim.py b/applications/convert_dim.py deleted file mode 100644 index c739e1dc..00000000 --- a/applications/convert_dim.py +++ /dev/null @@ -1,43 +0,0 @@ -import argparse -import os -import shutil -import sys - -from bird.preprocess.json_gen.generate_designs import ( - convert_case_dim, - replace_str_in_file, -) - -if __name__ == "__main__": - parser = argparse.ArgumentParser(description="Modify case dim") - parser.add_argument( - "-i", - "--input_folder", - type=str, - metavar="", - required=False, - help="case folder input", - default=None, - ) - parser.add_argument( - "-o", - "--output_folder", - type=str, - metavar="", - required=False, - help="case folder output", - default=None, - ) - parser.add_argument( - "-f", - "--dim_factor", - type=float, - metavar="", - required=False, - help="scaling factor", - default=None, - ) - - args, unknown = parser.parse_known_args() - - convert_case_dim(args.input_folder, args.output_folder, args.dim_factor) diff --git a/applications/read_history.py b/applications/read_history.py deleted file mode 100644 index d287f020..00000000 --- a/applications/read_history.py +++ /dev/null @@ -1,243 +0,0 @@ -import argparse -import os -import sys - -import numpy as np -from prettyPlot.plotting import plt, pretty_labels - -from bird.utilities.ofio import * - - -def compute_gas_holdup(caseFolder, timeFolder, nCells, field_dict={}): - if not ("alpha_liq" in field_dict) or field_dict["alpha_liq"] is None: - alpha_liq_file = os.path.join(caseFolder, timeFolder, "alpha.liquid") - alpha_liq = readOFScal(alpha_liq_file, nCells) - # print("reading alpha_liq") - field_dict["alpha_liq"] = alpha_liq - if not ("volume" in field_dict) or field_dict["volume"] is None: - volume_file = os.path.join(caseFolder, "0", "V") - volume = readOFScal(volume_file, nCells) - # print("reading Volume") - field_dict["volume"] = volume - alpha_liq = field_dict["alpha_liq"] - volume = field_dict["volume"] - holdup = np.sum((1 - alpha_liq) * volume) / np.sum(volume) - return holdup, field_dict - - -def co2liq(caseFolder, timeFolder, nCells, field_dict={}): - if not ("alpha_liq" in field_dict) or field_dict["alpha_liq"] is None: - alpha_liq_file = os.path.join(caseFolder, timeFolder, "alpha.liquid") - alpha_liq = readOFScal(alpha_liq_file, nCells) - # print("reading alpha_liq") - field_dict["alpha_liq"] = alpha_liq - if not ("co2_liq" in field_dict) or field_dict["co2_liq"] is None: - co2_liq_file = os.path.join(caseFolder, timeFolder, "CO2.liquid") - co2_liq = readOFScal(co2_liq_file, nCells) - # print("computing co2 liq") - field_dict["co2_liq"] = co2_liq - if not ("volume" in field_dict) or field_dict["volume"] is None: - volume_file = os.path.join(caseFolder, "0", "V") - volume = readOFScal(volume_file, nCells) - # print("reading Volume") - field_dict["volume"] = volume - if not ("indliq" in field_dict) or field_dict["indliq"] is None: - alpha_liq = field_dict["alpha_liq"] - indliq = np.argwhere(alpha_liq > 0.5) - # print("computing indliq") - field_dict["indliq"] = indliq - volume = field_dict["volume"] - indliq = field_dict["indliq"] - alpha_liq = field_dict["alpha_liq"] - co2_liq = field_dict["co2_liq"] - met = np.sum( - alpha_liq[indliq] * co2_liq[indliq] * volume[indliq] - ) / np.sum(volume[indliq]) - return met, field_dict - - -def cliq(caseFolder, timeFolder, nCells, field_dict={}): - if not ("alpha_liq" in field_dict) or field_dict["alpha_liq"] is None: - alpha_liq_file = os.path.join(caseFolder, timeFolder, "alpha.liquid") - alpha_liq = readOFScal(alpha_liq_file, nCells) - # print("reading alpha_liq") - field_dict["alpha_liq"] = alpha_liq - if not ("rho_liq" in field_dict) or field_dict["rho_liq"] is None: - rho_liq_file = os.path.join(caseFolder, timeFolder, "rhom") - rho_liq = readOFScal(rho_liq_file, nCells) - field_dict["rho_liq"] = rho_liq - if not ("co2_liq" in field_dict) or field_dict["co2_liq"] is None: - co2_liq_file = os.path.join(caseFolder, timeFolder, "CO2.liquid") - co2_liq = readOFScal(co2_liq_file, nCells) - # print("computing co2 liq") - field_dict["co2_liq"] = co2_liq - if not ("h2_liq" in field_dict) or field_dict["h2_liq"] is None: - h2_liq_file = os.path.join(caseFolder, timeFolder, "H2.liquid") - h2_liq = readOFScal(h2_liq_file, nCells) - # print("computing h2 liq") - field_dict["h2_liq"] = h2_liq - if not ("volume" in field_dict) or field_dict["volume"] is None: - volume_file = os.path.join(caseFolder, "0", "V") - volume = readOFScal(volume_file, nCells) - # print("reading Volume") - field_dict["volume"] = volume - if not ("indliq" in field_dict) or field_dict["indliq"] is None: - alpha_liq = field_dict["alpha_liq"] - indliq = np.argwhere(alpha_liq > 0.5) - # print("computing indliq") - field_dict["indliq"] = indliq - - volume = field_dict["volume"] - indliq = field_dict["indliq"] - alpha_liq = field_dict["alpha_liq"] - co2_liq = field_dict["co2_liq"] - h2_liq = field_dict["h2_liq"] - rho_liq = field_dict["rho_liq"] - - # c_h2 = rho_liq[indliq] * alpha_liq[indliq] * h2_liq[indliq] / 0.002016 - # c_co2 = rho_liq[indliq] * alpha_liq[indliq] * co2_liq[indliq] / 0.04401 - - c_h2 = 1000 * alpha_liq[indliq] * h2_liq[indliq] / 0.002016 - c_co2 = 1000 * alpha_liq[indliq] * co2_liq[indliq] / 0.04401 - - c_h2 = np.sum(c_h2 * volume[indliq]) / np.sum(volume[indliq]) - c_co2 = np.sum(c_co2 * volume[indliq]) / np.sum(volume[indliq]) - - return c_co2, c_h2, field_dict - - -def h2liq(caseFolder, timeFolder, nCells, field_dict={}): - if not ("alpha_liq" in field_dict) or field_dict["alpha_liq"] is None: - alpha_liq_file = os.path.join(caseFolder, timeFolder, "alpha.liquid") - alpha_liq = readOFScal(alpha_liq_file, nCells) - # print("reading alpha_liq") - field_dict["alpha_liq"] = alpha_liq - if not ("h2_liq" in field_dict) or field_dict["h2_liq"] is None: - h2_liq_file = os.path.join(caseFolder, timeFolder, "H2.liquid") - h2_liq = readOFScal(h2_liq_file, nCells) - # print("computing h2 liq") - field_dict["h2_liq"] = h2_liq - if not ("volume" in field_dict) or field_dict["volume"] is None: - volume_file = os.path.join(caseFolder, "0", "V") - volume = readOFScal(volume_file, nCells) - # print("reading Volume") - field_dict["volume"] = volume - if not ("indliq" in field_dict) or field_dict["indliq"] is None: - alpha_liq = field_dict["alpha_liq"] - indliq = np.argwhere(alpha_liq > 0.5) - # print("computing indliq") - field_dict["indliq"] = indliq - volume = field_dict["volume"] - indliq = field_dict["indliq"] - alpha_liq = field_dict["alpha_liq"] - h2_liq = field_dict["h2_liq"] - met = np.sum(alpha_liq[indliq] * h2_liq[indliq] * volume[indliq]) / np.sum( - volume[indliq] - ) - return met, field_dict - - -def vol_liq(caseFolder, timeFolder, nCells, field_dict={}): - if not ("alpha_liq" in field_dict) or field_dict["alpha_liq"] is None: - alpha_liq_file = os.path.join(caseFolder, timeFolder, "alpha.liquid") - alpha_liq = readOFScal(alpha_liq_file, nCells) - # print("reading alpha_liq") - field_dict["alpha_liq"] = alpha_liq - if not ("volume" in field_dict) or field_dict["volume"] is None: - volume_file = os.path.join(caseFolder, "0", "V") - volume = readOFScal(volume_file, nCells) - # print("reading Volume") - field_dict["volume"] = volume - volume = field_dict["volume"] - alpha_liq = field_dict["alpha_liq"] - indliq = np.argwhere(alpha_liq > 0.0) - liqvol = np.sum(alpha_liq[indliq] * volume[indliq]) / np.sum( - volume[indliq] - ) - return liqvol, field_dict - - -parser = argparse.ArgumentParser(description="Convergence of GH") -parser.add_argument( - "-cr", - "--case_root", - type=str, - metavar="", - required=True, - help="Case root", -) -parser.add_argument( - "-cn", - "--case_name", - type=str, - metavar="", - required=True, - help="Case name", -) -parser.add_argument( - "-df", - "--data_folder", - type=str, - metavar="", - required=False, - help="data folder name", - default="data", -) - -args, unknown = parser.parse_known_args() - - -case_root = args.case_root # "../" -case_name = args.case_name # "12_hole_sparger_snappyRefine_700rpm_opt_coeff" -case_path = os.path.join(case_root, case_name) -time_float_sorted, time_str_sorted = getCaseTimes(case_path, remove_zero=True) -cellCentres = readMesh(os.path.join(case_path, f"meshCellCentres_0.obj")) -nCells = len(cellCentres) - - -co2_history = np.zeros(len(time_str_sorted)) -c_co2_history = np.zeros(len(time_str_sorted)) -h2_history = np.zeros(len(time_str_sorted)) -c_h2_history = np.zeros(len(time_str_sorted)) -gh_history = np.zeros(len(time_str_sorted)) -liqvol_history = np.zeros(len(time_str_sorted)) -print(f"case_path = {case_path}") -field_dict = {} -for itime, time in enumerate(time_float_sorted): - time_folder = time_str_sorted[itime] - print(f"\tTime : {time_folder}") - if not field_dict == {}: - new_field_dict = {} - if "volume" in field_dict: - new_field_dict["volume"] = field_dict["volume"] - field_dict = new_field_dict - gh_history[itime], field_dict = compute_gas_holdup( - case_path, time_str_sorted[itime], nCells, field_dict - ) - co2_history[itime], field_dict = co2liq( - case_path, time_str_sorted[itime], nCells, field_dict - ) - h2_history[itime], field_dict = h2liq( - case_path, time_str_sorted[itime], nCells, field_dict - ) - liqvol_history[itime], field_dict = vol_liq( - case_path, time_str_sorted[itime], nCells, field_dict - ) - c_co2_history[itime], c_h2_history[itime], field_dict = cliq( - case_path, time_str_sorted[itime], nCells, field_dict - ) - - -dataFolder = args.data_folder -os.makedirs(dataFolder, exist_ok=True) -os.makedirs(os.path.join(dataFolder, case_name), exist_ok=True) -np.savez( - os.path.join(dataFolder, case_name, "conv.npz"), - time=np.array(time_float_sorted), - gh=gh_history, - co2=co2_history, - h2=h2_history, - vol_liq=liqvol_history, - c_h2=c_h2_history, - c_co2=c_co2_history, -) diff --git a/applications/write_dynMix_fvModels.py b/applications/write_dynMix_fvModels.py index bf1665ca..e2a5278b 100644 --- a/applications/write_dynMix_fvModels.py +++ b/applications/write_dynMix_fvModels.py @@ -35,6 +35,4 @@ ) args = parser.parse_args() dynMix_dict = parseJsonFile(args.input) - write_fvModel( - dynMix_dict, output_folder=args.output_folder, force_sign=True - ) + write_fvModel(dynMix_dict, output_folder=args.output_folder) diff --git a/applications/write_dynMix_fvModels_force_sign.py b/applications/write_dynMix_fvModels_force_sign.py deleted file mode 100644 index bf1665ca..00000000 --- a/applications/write_dynMix_fvModels_force_sign.py +++ /dev/null @@ -1,40 +0,0 @@ -import os - -import numpy as np -import stl - -from bird import BIRD_PRE_DYNMIX_TEMP_DIR -from bird.meshing._mesh_tools import parseJsonFile -from bird.preprocess.dynamic_mixer.mixing_fvModels import * - -if __name__ == "__main__": - import argparse - - parser = argparse.ArgumentParser( - description="Generate dynamic mixer fvModels" - ) - parser.add_argument( - "-i", - "--input", - type=str, - metavar="", - required=False, - help="Mixers Json input", - default=os.path.join( - BIRD_PRE_DYNMIX_TEMP_DIR, "expl_list", "mixers.json" - ), - ) - parser.add_argument( - "-o", - "--output_folder", - type=str, - metavar="", - required=False, - help="fvModels folder output", - default=".", - ) - args = parser.parse_args() - dynMix_dict = parseJsonFile(args.input) - write_fvModel( - dynMix_dict, output_folder=args.output_folder, force_sign=True - ) diff --git a/bird/__init__.py b/bird/__init__.py index b8aa816c..3365eb11 100644 --- a/bird/__init__.py +++ b/bird/__init__.py @@ -5,7 +5,6 @@ from bird.version import __version__ BIRD_DIR = os.path.dirname(os.path.realpath(__file__)) -BIRD_CASE_DIR = os.path.join(BIRD_DIR, "../OFsolvers/tutorial_cases") BIRD_MESH_DIR = os.path.join(BIRD_DIR, "meshing") BIRD_POST_DIR = os.path.join(BIRD_DIR, "postprocess") BIRD_PRE_DIR = os.path.join(BIRD_DIR, "preprocess") @@ -33,6 +32,5 @@ BIRD_PRE_DYNMIX_TEMP_DIR = os.path.join( BIRD_PRE_DIR, "dynamic_mixer", "mixing_template" ) -BIRD_PRE_DATA_DIR = os.path.join(BIRD_PRE_DIR, "data_preprocess") BIRD_EARLY_PRED_DATA_DIR = os.path.join(BIRD_POST_DIR, "data_early") BIRD_INV_DIR = os.path.join(BIRD_DIR, "inverse_modeling") diff --git a/bird/meshing/block_rect_mesh.py b/bird/meshing/block_rect_mesh.py index 2b9d335e..22a31f16 100644 --- a/bird/meshing/block_rect_mesh.py +++ b/bird/meshing/block_rect_mesh.py @@ -240,9 +240,9 @@ def from_block_rect_to_seg(input_geom_dict, rescale=True): segments[iseg]["normal_dir"] = int(np.nonzero(vec_conn)[0][0]) if segments[iseg]["normal_dir"] == 0: segments[iseg]["max_rad"] = (blocksize_y + blocksize_z) / 4 - elif segments[iseg]["normal_dir"] == 1: + if segments[iseg]["normal_dir"] == 1: segments[iseg]["max_rad"] = (blocksize_x + blocksize_z) / 4 - elif segments[iseg]["normal_dir"] == 2: + if segments[iseg]["normal_dir"] == 2: segments[iseg]["max_rad"] = (blocksize_x + blocksize_y) / 4 return { diff --git a/bird/preprocess/data_preprocess/loop_reactor_3_6L/.vim/.netrwhist b/bird/preprocess/data_preprocess/loop_reactor_3_6L/.vim/.netrwhist deleted file mode 100644 index b9691c3b..00000000 --- a/bird/preprocess/data_preprocess/loop_reactor_3_6L/.vim/.netrwhist +++ /dev/null @@ -1,3 +0,0 @@ -let g:netrw_dirhistmax =10 -let g:netrw_dirhistcnt =1 -let g:netrw_dirhist_1='/home/openfoam/postProcessing/patchIntegrate(patch=inlet,field=alpha.gas)/0' diff --git a/bird/preprocess/data_preprocess/loop_reactor_3_6L/0.orig/CO2.gas b/bird/preprocess/data_preprocess/loop_reactor_3_6L/0.orig/CO2.gas deleted file mode 100644 index e4165b1a..00000000 --- a/bird/preprocess/data_preprocess/loop_reactor_3_6L/0.orig/CO2.gas +++ /dev/null @@ -1,47 +0,0 @@ -/*--------------------------------*- C++ -*----------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | Website: https://openfoam.org - \\ / A nd | Version: 9 - \\/ M anipulation | -\*---------------------------------------------------------------------------*/ -FoamFile -{ - format ascii; - class volScalarField; - object CO2.gas; -} -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -dimensions [0 0 0 0 0 0 0]; - -#include "${FOAM_CASE}/constant/globalVars" - -internalField uniform 0; - - -boundaryField -{ - #includeEtc "caseDicts/setConstraintTypes" - - inlet - { - type fixedValue; - value uniform $f_CO2; - } - - outlet - { - //type inletOutlet; - //phi phi.gas; - //inletValue $f_CO2; - //value $f_CO2; - type zeroGradient; - } - - defaultFaces - { - type zeroGradient; - } -} - -// ************************************************************************* // diff --git a/bird/preprocess/data_preprocess/loop_reactor_3_6L/0.orig/CO2.liquid b/bird/preprocess/data_preprocess/loop_reactor_3_6L/0.orig/CO2.liquid deleted file mode 100644 index 4b8ea6a0..00000000 --- a/bird/preprocess/data_preprocess/loop_reactor_3_6L/0.orig/CO2.liquid +++ /dev/null @@ -1,42 +0,0 @@ -/*--------------------------------*- C++ -*----------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | Website: https://openfoam.org - \\ / A nd | Version: 9 - \\/ M anipulation | -\*---------------------------------------------------------------------------*/ -FoamFile -{ - format ascii; - class volScalarField; - object CO2.liquid; -} -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -dimensions [0 0 0 0 0 0 0]; - -internalField uniform 0.0; - -boundaryField -{ - #includeEtc "caseDicts/setConstraintTypes" - - inlet - { - type zeroGradient; - //type fixedValue; - //value uniform 0.0; - } - - outlet - { - type zeroGradient; - } - - defaultFaces - { - type zeroGradient; - } -} - -// ************************************************************************* // diff --git a/bird/preprocess/data_preprocess/loop_reactor_3_6L/0.orig/H2.gas b/bird/preprocess/data_preprocess/loop_reactor_3_6L/0.orig/H2.gas deleted file mode 100644 index 9f66b2d2..00000000 --- a/bird/preprocess/data_preprocess/loop_reactor_3_6L/0.orig/H2.gas +++ /dev/null @@ -1,47 +0,0 @@ -/*--------------------------------*- C++ -*----------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | Website: https://openfoam.org - \\ / A nd | Version: 9 - \\/ M anipulation | -\*---------------------------------------------------------------------------*/ -FoamFile -{ - format ascii; - class volScalarField; - object H2.gas; -} -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -dimensions [0 0 0 0 0 0 0]; - -#include "${FOAM_CASE}/constant/globalVars" - -internalField uniform 0; - - -boundaryField -{ - #includeEtc "caseDicts/setConstraintTypes" - - inlet - { - type fixedValue; - value uniform $f_H2; - } - - outlet - { - //type inletOutlet; - //phi phi.gas; - //inletValue $f_H2; - //value $f_H2; - type zeroGradient; - } - - defaultFaces - { - type zeroGradient; - } -} - -// ************************************************************************* // diff --git a/bird/preprocess/data_preprocess/loop_reactor_3_6L/0.orig/H2.liquid b/bird/preprocess/data_preprocess/loop_reactor_3_6L/0.orig/H2.liquid deleted file mode 100644 index 65ae8d34..00000000 --- a/bird/preprocess/data_preprocess/loop_reactor_3_6L/0.orig/H2.liquid +++ /dev/null @@ -1,42 +0,0 @@ -/*--------------------------------*- C++ -*----------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | Website: https://openfoam.org - \\ / A nd | Version: 9 - \\/ M anipulation | -\*---------------------------------------------------------------------------*/ -FoamFile -{ - format ascii; - class volScalarField; - object H2.liquid; -} -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -dimensions [0 0 0 0 0 0 0]; - -internalField uniform 0.0; - -boundaryField -{ - #includeEtc "caseDicts/setConstraintTypes" - - inlet - { - type zeroGradient; - //type fixedValue; - //value uniform 0.0; - } - - outlet - { - type zeroGradient; - } - - defaultFaces - { - type zeroGradient; - } -} - -// ************************************************************************* // diff --git a/bird/preprocess/data_preprocess/loop_reactor_3_6L/0.orig/N2.gas b/bird/preprocess/data_preprocess/loop_reactor_3_6L/0.orig/N2.gas deleted file mode 100644 index c1d7225f..00000000 --- a/bird/preprocess/data_preprocess/loop_reactor_3_6L/0.orig/N2.gas +++ /dev/null @@ -1,47 +0,0 @@ -/*--------------------------------*- C++ -*----------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | Website: https://openfoam.org - \\ / A nd | Version: 9 - \\/ M anipulation | -\*---------------------------------------------------------------------------*/ -FoamFile -{ - format ascii; - class volScalarField; - object N2.gas; -} -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -dimensions [0 0 0 0 0 0 0]; - -#include "${FOAM_CASE}/constant/globalVars" - -internalField uniform 1; - - -boundaryField -{ - #includeEtc "caseDicts/setConstraintTypes" - - inlet - { - type fixedValue; - value uniform $f_N2; - } - - outlet - { - //type inletOutlet; - //phi phi.gas; - //inletValue $f_N2; - //value $f_N2; - type zeroGradient; - } - - defaultFaces - { - type zeroGradient; - } -} - -// ************************************************************************* // diff --git a/bird/preprocess/data_preprocess/loop_reactor_3_6L/0.orig/T.gas b/bird/preprocess/data_preprocess/loop_reactor_3_6L/0.orig/T.gas deleted file mode 100644 index bf0199a0..00000000 --- a/bird/preprocess/data_preprocess/loop_reactor_3_6L/0.orig/T.gas +++ /dev/null @@ -1,44 +0,0 @@ -/*--------------------------------*- C++ -*----------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | Website: https://openfoam.org - \\ / A nd | Version: 9 - \\/ M anipulation | -\*---------------------------------------------------------------------------*/ -FoamFile -{ - format ascii; - class volScalarField; - object T.gas; -} -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -dimensions [0 0 0 1 0 0 0]; - -internalField uniform 300; - -boundaryField -{ - #includeEtc "caseDicts/setConstraintTypes" - - inlet - { - type fixedValue; - value $internalField; - } - - outlet - { - type inletOutlet; - phi phi.gas; - inletValue $internalField; - value $internalField; - } - - defaultFaces - { - type zeroGradient; - } -} - -// ************************************************************************* // diff --git a/bird/preprocess/data_preprocess/loop_reactor_3_6L/0.orig/T.liquid b/bird/preprocess/data_preprocess/loop_reactor_3_6L/0.orig/T.liquid deleted file mode 100644 index 7101ea31..00000000 --- a/bird/preprocess/data_preprocess/loop_reactor_3_6L/0.orig/T.liquid +++ /dev/null @@ -1,43 +0,0 @@ -/*--------------------------------*- C++ -*----------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | Website: https://openfoam.org - \\ / A nd | Version: 9 - \\/ M anipulation | -\*---------------------------------------------------------------------------*/ -FoamFile -{ - format ascii; - class volScalarField; - object T.liquid; -} -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -dimensions [0 0 0 1 0 0 0]; - -internalField uniform 300; - -boundaryField -{ - #includeEtc "caseDicts/setConstraintTypes" - - outlet - { - type inletOutlet; - phi phi.liquid; - inletValue $internalField; - value $internalField; - } - inlet - { - type fixedValue; - value $internalField; - } - defaultFaces - { - type zeroGradient; - } - -} - -// ************************************************************************* // diff --git a/bird/preprocess/data_preprocess/loop_reactor_3_6L/0.orig/U.gas b/bird/preprocess/data_preprocess/loop_reactor_3_6L/0.orig/U.gas deleted file mode 100644 index e696566f..00000000 --- a/bird/preprocess/data_preprocess/loop_reactor_3_6L/0.orig/U.gas +++ /dev/null @@ -1,47 +0,0 @@ -/*--------------------------------*- C++ -*----------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | Website: https://openfoam.org - \\ / A nd | Version: dev - \\/ M anipulation | -\*---------------------------------------------------------------------------*/ -FoamFile -{ - format ascii; - class volVectorField; - object U.gas; -} -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -dimensions [0 1 -1 0 0 0 0]; - -internalField uniform (0 0.0 0); - -#include "${FOAM_CASE}/constant/globalVars" - -boundaryField -{ - #includeEtc "caseDicts/setConstraintTypes" - - inlet - { - //type flowRateInletVelocity; - //massFlowRate $mflowRateGas; - //rho thermo:rho.gas; - //value $internalField; - type fixedValue; - value uniform (0 $uGasPhase 0); - } - outlet - { - type pressureInletOutletVelocity; - phi phi.gas; - value $internalField; - } - defaultFaces - { - type slip; - } -} - -// ************************************************************************* // diff --git a/bird/preprocess/data_preprocess/loop_reactor_3_6L/0.orig/U.liquid b/bird/preprocess/data_preprocess/loop_reactor_3_6L/0.orig/U.liquid deleted file mode 100644 index 1879e020..00000000 --- a/bird/preprocess/data_preprocess/loop_reactor_3_6L/0.orig/U.liquid +++ /dev/null @@ -1,46 +0,0 @@ -/*--------------------------------*- C++ -*----------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | Website: https://openfoam.org - \\ / A nd | Version: dev - \\/ M anipulation | -\*---------------------------------------------------------------------------*/ -FoamFile -{ - format ascii; - class volVectorField; - object U.liquid; -} -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -dimensions [0 1 -1 0 0 0 0]; - -#include "${FOAM_CASE}/constant/globalVars" - -internalField uniform (0 0 0); - -boundaryField -{ - #includeEtc "caseDicts/setConstraintTypes" - - inlet - { - //type flowRateInletVelocity; - //massFlowRate $mflowRateLiq; - //rho thermo:rho.liquid; - //value $internalField; - type fixedValue; - value uniform (0 0 0); - } - outlet - { - type noSlip; - } - defaultFaces - { - type noSlip; - } - -} - -// ************************************************************************* // diff --git a/bird/preprocess/data_preprocess/loop_reactor_3_6L/0.orig/Ydefault.gas b/bird/preprocess/data_preprocess/loop_reactor_3_6L/0.orig/Ydefault.gas deleted file mode 100644 index fba2945d..00000000 --- a/bird/preprocess/data_preprocess/loop_reactor_3_6L/0.orig/Ydefault.gas +++ /dev/null @@ -1,42 +0,0 @@ -/*--------------------------------*- C++ -*----------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | Website: https://openfoam.org - \\ / A nd | Version: 9 - \\/ M anipulation | -\*---------------------------------------------------------------------------*/ -FoamFile -{ - format ascii; - class volScalarField; - object Ydefault.gas; -} -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -dimensions [0 0 0 0 0 0 0]; - -internalField uniform 0.0; - -boundaryField -{ - #includeEtc "caseDicts/setConstraintTypes" - - inlet - { - type fixedValue; - value uniform 0.0; - } - - outlet - { - type zeroGradient; - } - - defaultFaces - { - type zeroGradient; - } -} - - -// ************************************************************************* // diff --git a/bird/preprocess/data_preprocess/loop_reactor_3_6L/0.orig/Ydefault.liquid b/bird/preprocess/data_preprocess/loop_reactor_3_6L/0.orig/Ydefault.liquid deleted file mode 100644 index a5108564..00000000 --- a/bird/preprocess/data_preprocess/loop_reactor_3_6L/0.orig/Ydefault.liquid +++ /dev/null @@ -1,42 +0,0 @@ -/*--------------------------------*- C++ -*----------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | Website: https://openfoam.org - \\ / A nd | Version: 9 - \\/ M anipulation | -\*---------------------------------------------------------------------------*/ -FoamFile -{ - format ascii; - class volScalarField; - object Ydefault.liquid; -} -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -dimensions [0 0 0 0 0 0 0]; - -internalField uniform 1.0; - -boundaryField -{ - #includeEtc "caseDicts/setConstraintTypes" - - inlet - { - type fixedValue; - value uniform 1.0; - } - - outlet - { - type zeroGradient; - } - - defaultFaces - { - type zeroGradient; - } -} - - -// ************************************************************************* // diff --git a/bird/preprocess/data_preprocess/loop_reactor_3_6L/0.orig/alpha.gas b/bird/preprocess/data_preprocess/loop_reactor_3_6L/0.orig/alpha.gas deleted file mode 100644 index 1e303fbe..00000000 --- a/bird/preprocess/data_preprocess/loop_reactor_3_6L/0.orig/alpha.gas +++ /dev/null @@ -1,43 +0,0 @@ -/*--------------------------------*- C++ -*----------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | Website: https://openfoam.org - \\ / A nd | Version: dev - \\/ M anipulation | -\*---------------------------------------------------------------------------*/ -FoamFile -{ - format ascii; - class volScalarField; - location "0"; - object alpha.gas; -} -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -dimensions [0 0 0 0 0 0 0]; - -#include "${FOAM_CASE}/constant/globalVars" - -internalField uniform $alphaGas; - -boundaryField -{ - inlet - { - type fixedValue; - value uniform $alphaGas; - } - outlet - { - type inletOutlet; - phi phi.gas; - inletValue uniform 1; - value uniform 1; - } - defaultFaces - { - type zeroGradient; - } -} - -// ************************************************************************* // diff --git a/bird/preprocess/data_preprocess/loop_reactor_3_6L/0.orig/alpha.liquid b/bird/preprocess/data_preprocess/loop_reactor_3_6L/0.orig/alpha.liquid deleted file mode 100644 index 5c92070b..00000000 --- a/bird/preprocess/data_preprocess/loop_reactor_3_6L/0.orig/alpha.liquid +++ /dev/null @@ -1,40 +0,0 @@ -/*--------------------------------*- C++ -*----------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | Website: https://openfoam.org - \\ / A nd | Version: dev - \\/ M anipulation | -\*---------------------------------------------------------------------------*/ -FoamFile -{ - format ascii; - class volScalarField; - object alpha.liquid; -} -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -dimensions [0 0 0 0 0 0 0]; - -#include "${FOAM_CASE}/constant/globalVars" - -internalField uniform 1; - -boundaryField -{ - inlet - { - type fixedValue; - value uniform $alphaLiq; - } - outlet - { - type fixedValue; - value uniform 0; - } - defaultFaces - { - type zeroGradient; - } -} - -// ************************************************************************* // diff --git a/bird/preprocess/data_preprocess/loop_reactor_3_6L/0.orig/alphat.gas b/bird/preprocess/data_preprocess/loop_reactor_3_6L/0.orig/alphat.gas deleted file mode 100644 index b867958f..00000000 --- a/bird/preprocess/data_preprocess/loop_reactor_3_6L/0.orig/alphat.gas +++ /dev/null @@ -1,46 +0,0 @@ -/*--------------------------------*- C++ -*----------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | Website: https://openfoam.org - \\ / A nd | Version: 9 - \\/ M anipulation | -\*---------------------------------------------------------------------------*/ -FoamFile -{ - format ascii; - class volScalarField; - object alphat.gas; -} -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -dimensions [1 -1 -1 0 0 0 0]; - -internalField uniform 0; - -boundaryField -{ - #includeEtc "caseDicts/setConstraintTypes" - - inlet - { - type calculated; - value $internalField; - } - - outlet - { - type calculated; - value $internalField; - } - - defaultFaces - { - type calculated; - value $internalField; - //type compressible::alphatWallFunction; - //Prt 0.85; - //value $internalField; - } -} - -// ************************************************************************* // diff --git a/bird/preprocess/data_preprocess/loop_reactor_3_6L/0.orig/alphat.liquid b/bird/preprocess/data_preprocess/loop_reactor_3_6L/0.orig/alphat.liquid deleted file mode 100644 index 2569c3ee..00000000 --- a/bird/preprocess/data_preprocess/loop_reactor_3_6L/0.orig/alphat.liquid +++ /dev/null @@ -1,44 +0,0 @@ -/*--------------------------------*- C++ -*----------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | Website: https://openfoam.org - \\ / A nd | Version: 9 - \\/ M anipulation | -\*---------------------------------------------------------------------------*/ -FoamFile -{ - format ascii; - class volScalarField; - object alphat.liquid; -} -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -dimensions [1 -1 -1 0 0 0 0]; - -internalField uniform 0; - -boundaryField -{ - #includeEtc "caseDicts/setConstraintTypes" - - inlet - { - type calculated; - value $internalField; - } - - outlet - { - type calculated; - value $internalField; - } - - defaultFaces - { - type compressible::alphatWallFunction; - Prt 0.85; - value $internalField; - } -} - -// ************************************************************************* // diff --git a/bird/preprocess/data_preprocess/loop_reactor_3_6L/0.orig/epsilon.gas b/bird/preprocess/data_preprocess/loop_reactor_3_6L/0.orig/epsilon.gas deleted file mode 100644 index 707a1cda..00000000 --- a/bird/preprocess/data_preprocess/loop_reactor_3_6L/0.orig/epsilon.gas +++ /dev/null @@ -1,48 +0,0 @@ -/*--------------------------------*- C++ -*----------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | Website: https://openfoam.org - \\ / A nd | Version: 9 - \\/ M anipulation | -\*---------------------------------------------------------------------------*/ -FoamFile -{ - format ascii; - class volScalarField; - object epsilon.gas; -} -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -dimensions [0 2 -3 0 0 0 0]; - -#include "${FOAM_CASE}/constant/globalVars" - -internalField uniform $eps_inlet_gas; - -boundaryField -{ - inlet - { - type fixedValue; - value uniform $eps_inlet_gas; - } - - outlet - { - type zeroGradient; - } - - defaultFaces - { - type zeroGradient; - //type epsilonWallFunction; - //value $internalField; - } - - // defaultFaces - // { - // type empty; - // } -} - -// ************************************************************************* // diff --git a/bird/preprocess/data_preprocess/loop_reactor_3_6L/0.orig/epsilon.liquid b/bird/preprocess/data_preprocess/loop_reactor_3_6L/0.orig/epsilon.liquid deleted file mode 100644 index 0a4236fd..00000000 --- a/bird/preprocess/data_preprocess/loop_reactor_3_6L/0.orig/epsilon.liquid +++ /dev/null @@ -1,43 +0,0 @@ -/*--------------------------------*- C++ -*----------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | Website: https://openfoam.org - \\ / A nd | Version: 9 - \\/ M anipulation | -\*---------------------------------------------------------------------------*/ -FoamFile -{ - format ascii; - class volScalarField; - object epsilon.liquid; -} -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -dimensions [0 2 -3 0 0 0 0]; - -#include "${FOAM_CASE}/constant/globalVars" - -internalField uniform $eps_inlet_liq; - -boundaryField -{ - inlet - { - type fixedValue; - value uniform $eps_inlet_liq; - } - - outlet - { - type zeroGradient; - } - - defaultFaces - { - type epsilonWallFunction; - value $internalField; - } - -} - -// ************************************************************************* // diff --git a/bird/preprocess/data_preprocess/loop_reactor_3_6L/0.orig/f.gas b/bird/preprocess/data_preprocess/loop_reactor_3_6L/0.orig/f.gas deleted file mode 100644 index 76ee77a9..00000000 --- a/bird/preprocess/data_preprocess/loop_reactor_3_6L/0.orig/f.gas +++ /dev/null @@ -1,41 +0,0 @@ -/*--------------------------------*- C++ -*----------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | Website: https://openfoam.org - \\ / A nd | Version: 9 - \\/ M anipulation | -\*---------------------------------------------------------------------------*/ -FoamFile -{ - format ascii; - class volScalarField; - object f.gas; -} -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -dimensions [0 0 0 0 0 0 0]; - -internalField uniform 1.0; - -boundaryField -{ - #includeEtc "caseDicts/setConstraintTypes" - - inlet - { - type fixedValue; - value uniform 1.0; //$internalField; // - } - - outlet - { - type zeroGradient; - } - - defaultFaces - { - type zeroGradient; - } -} - -// ************************************************************************* // diff --git a/bird/preprocess/data_preprocess/loop_reactor_3_6L/0.orig/k.gas b/bird/preprocess/data_preprocess/loop_reactor_3_6L/0.orig/k.gas deleted file mode 100644 index 4a3d44ca..00000000 --- a/bird/preprocess/data_preprocess/loop_reactor_3_6L/0.orig/k.gas +++ /dev/null @@ -1,43 +0,0 @@ -/*--------------------------------*- C++ -*----------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | Website: https://openfoam.org - \\ / A nd | Version: 9 - \\/ M anipulation | -\*---------------------------------------------------------------------------*/ -FoamFile -{ - format ascii; - class volScalarField; - object k.gas; -} -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -dimensions [0 2 -2 0 0 0 0]; - -#include "${FOAM_CASE}/constant/globalVars" - -internalField uniform $k_inlet_gas; - -boundaryField -{ - #includeEtc "caseDicts/setConstraintTypes" - - inlet - { - type fixedValue; - value uniform $k_inlet_gas; - } - - outlet - { - type zeroGradient; - } - - defaultFaces - { - type zeroGradient; - } -} - -// ************************************************************************* // diff --git a/bird/preprocess/data_preprocess/loop_reactor_3_6L/0.orig/k.liquid b/bird/preprocess/data_preprocess/loop_reactor_3_6L/0.orig/k.liquid deleted file mode 100644 index cde8f6c1..00000000 --- a/bird/preprocess/data_preprocess/loop_reactor_3_6L/0.orig/k.liquid +++ /dev/null @@ -1,44 +0,0 @@ -/*--------------------------------*- C++ -*----------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | Website: https://openfoam.org - \\ / A nd | Version: 9 - \\/ M anipulation | -\*---------------------------------------------------------------------------*/ -FoamFile -{ - format ascii; - class volScalarField; - object k.liquid; -} -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -dimensions [0 2 -2 0 0 0 0]; - -#include "${FOAM_CASE}/constant/globalVars" - -internalField uniform $k_inlet_liq; - -boundaryField -{ - #includeEtc "caseDicts/setConstraintTypes" - - inlet - { - type fixedValue; - value uniform $k_inlet_liq; - } - - outlet - { - type zeroGradient; - } - - defaultFaces - { - type kqRWallFunction; - value $internalField; - } -} - -// ************************************************************************* // diff --git a/bird/preprocess/data_preprocess/loop_reactor_3_6L/0.orig/nut.gas b/bird/preprocess/data_preprocess/loop_reactor_3_6L/0.orig/nut.gas deleted file mode 100644 index ba16dd4c..00000000 --- a/bird/preprocess/data_preprocess/loop_reactor_3_6L/0.orig/nut.gas +++ /dev/null @@ -1,48 +0,0 @@ -/*--------------------------------*- C++ -*----------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | Website: https://openfoam.org - \\ / A nd | Version: 9 - \\/ M anipulation | -\*---------------------------------------------------------------------------*/ -FoamFile -{ - format ascii; - class volScalarField; - object nut.gas; -} -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -dimensions [0 2 -1 0 0 0 0]; - -internalField uniform 1e-8; - -boundaryField -{ - inlet - { - type calculated; - value $internalField; - } - - outlet - { - type calculated; - value $internalField; - } - - defaultFaces - { - //type nutkWallFunction; - //value $internalField; - type calculated; - value $internalField; - } - - // defaultFaces - // { - // type empty; - // } -} - -// ************************************************************************* // diff --git a/bird/preprocess/data_preprocess/loop_reactor_3_6L/0.orig/nut.liquid b/bird/preprocess/data_preprocess/loop_reactor_3_6L/0.orig/nut.liquid deleted file mode 100644 index 1442e07f..00000000 --- a/bird/preprocess/data_preprocess/loop_reactor_3_6L/0.orig/nut.liquid +++ /dev/null @@ -1,43 +0,0 @@ -/*--------------------------------*- C++ -*----------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | Website: https://openfoam.org - \\ / A nd | Version: 9 - \\/ M anipulation | -\*---------------------------------------------------------------------------*/ -FoamFile -{ - format ascii; - class volScalarField; - object nut.liquid; -} -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -dimensions [0 2 -1 0 0 0 0]; - -internalField uniform 1e-4; - -boundaryField -{ - #includeEtc "caseDicts/setConstraintTypes" - - inlet - { - type calculated; - value $internalField; - } - - outlet - { - type calculated; - value $internalField; - } - - defaultFaces - { - type nutkWallFunction; - value $internalField; - } -} - -// ************************************************************************* // diff --git a/bird/preprocess/data_preprocess/loop_reactor_3_6L/0.orig/p b/bird/preprocess/data_preprocess/loop_reactor_3_6L/0.orig/p deleted file mode 100644 index b3a295fb..00000000 --- a/bird/preprocess/data_preprocess/loop_reactor_3_6L/0.orig/p +++ /dev/null @@ -1,39 +0,0 @@ -/*--------------------------------*- C++ -*----------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | Website: https://openfoam.org - \\ / A nd | Version: dev - \\/ M anipulation | -\*---------------------------------------------------------------------------*/ -FoamFile -{ - format ascii; - class volScalarField; - object p; -} -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -dimensions [1 -1 -2 0 0 0 0]; - -internalField uniform 101325; - -boundaryField -{ - inlet - { - type calculated; - value $internalField; - } - outlet - { - type calculated; - value $internalField; - } - defaultFaces - { - type calculated; - value $internalField; - } -} - -// ************************************************************************* // diff --git a/bird/preprocess/data_preprocess/loop_reactor_3_6L/0.orig/p_rgh b/bird/preprocess/data_preprocess/loop_reactor_3_6L/0.orig/p_rgh deleted file mode 100644 index 88ee7d80..00000000 --- a/bird/preprocess/data_preprocess/loop_reactor_3_6L/0.orig/p_rgh +++ /dev/null @@ -1,43 +0,0 @@ -/*--------------------------------*- C++ -*----------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | Website: https://openfoam.org - \\ / A nd | Version: dev - \\/ M anipulation | -\*---------------------------------------------------------------------------*/ -FoamFile -{ - format ascii; - class volScalarField; - object p_rgh; -} -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -dimensions [1 -1 -2 0 0 0 0]; - -internalField uniform 101325; - -boundaryField -{ - inlet - { - type fixedFluxPressure; - value $internalField; - } - outlet - { - type prghTotalPressure; - p0 $internalField; - U U.gas; - phi phi.gas; - rho thermo:rho.gas; - value $internalField; - } - defaultFaces - { - type fixedFluxPressure; - value $internalField; - } -} - -// ************************************************************************* // diff --git a/bird/preprocess/data_preprocess/loop_reactor_3_6L/Allclean b/bird/preprocess/data_preprocess/loop_reactor_3_6L/Allclean deleted file mode 100755 index f55e0ec9..00000000 --- a/bird/preprocess/data_preprocess/loop_reactor_3_6L/Allclean +++ /dev/null @@ -1,18 +0,0 @@ -#!/bin/sh -cd ${0%/*} || exit 1 # Run from this directory - -# Source tutorial clean functions -. $WM_PROJECT_DIR/bin/tools/CleanFunctions - -# Remove surface, features and solution -#rm -rf constant/extendedFeatureEdgeMesh > /dev/null 2>&1 -#rm -f constant/triSurface/*.eMesh > /dev/null 2>&1 -#rm -rf constant/polyMesh > /dev/null 2>&1 -#rm -rf processor* > /dev/null 2>&1 -rm -rf 0 -cleanCase - -#rm *.obj -#rm *.stl - -#------------------------------------------------------------------------------ diff --git a/bird/preprocess/data_preprocess/loop_reactor_3_6L/computeQOI.sh b/bird/preprocess/data_preprocess/loop_reactor_3_6L/computeQOI.sh deleted file mode 100644 index 3756ed7f..00000000 --- a/bird/preprocess/data_preprocess/loop_reactor_3_6L/computeQOI.sh +++ /dev/null @@ -1,13 +0,0 @@ -if [ ! -f qoi.txt ]; then - # Reconstruct if needed - source /projects/gas2fuels/ofoam_cray_mpich/OpenFOAM-dev/etc/bashrc - reconstructPar -newTimes - module load anaconda3/2023 - conda activate /projects/gas2fuels/conda_env/bird - python read_history.py -cr .. -cn local -df data - python get_qoi.py - conda deactivate -else - echo "WARNING: QOI already computed" -fi - diff --git a/bird/preprocess/data_preprocess/loop_reactor_3_6L/constant/dynamicMix_util.H b/bird/preprocess/data_preprocess/loop_reactor_3_6L/constant/dynamicMix_util.H deleted file mode 100644 index 8fa7daf7..00000000 --- a/bird/preprocess/data_preprocess/loop_reactor_3_6L/constant/dynamicMix_util.H +++ /dev/null @@ -1,37 +0,0 @@ -#include - -double gradfunMix(double V1, double V2){ - return 3.0*V2*V2 + 2.0*V1*V2 - V1*V1; -} - -double funMix(double V1, double V2, double P, double rhoL, double A){ - return V2*V2*V2 + V1*V2*V2 - V2*V1*V1 - V1*V1*V1 - 4.0*P/(rhoL * A); -} - -double findV2(double P, double rhoL, double A, double V1) { - int newton_iter = 100; - double V2 = 2*V1; - double V2_old; - double V2_new; - if (std::abs(V1) < 1e-12) { - V2=std::pow((4.0*P/rhoL/A),0.333333); - V2_new = V2; - V2_old = V2; - } else { - for (int i=0; i("thermo:rho.liquid"); - const volScalarField& alphaL = - mesh().lookupObject("alpha.liquid"); - const volVectorField& UL = - mesh().lookupObject("U.liquid"); - double pi=3.141592654; - double source_pt_x=0.25; - double source_pt_y=0.025; - double source_pt_z=0.225; - double disk_rad=0.017499999999999998; - double disk_area=pi*disk_rad*disk_rad; - double power=2.5; - double smear_factor=3.0; - const scalar startTime = 1; - if (time.value() > startTime) - { - // Get V1 - double source_sign_factor = 1.0; - double V1 = 0; - double V2 = 0; - double rhoV; - double dist_tol = disk_rad*5; - - double dist_n; - double upV = 0; - double uprhoV = 0; - double upVvol = 0; - double downV = 0; - double downrhoV = 0; - double downVvol = 0; - double dist2; - forAll(C,i) - { - dist2 = (C[i].x()-source_pt_x)*(C[i].x()-source_pt_x); - dist2 += (C[i].y()-source_pt_y)*(C[i].y()-source_pt_y); - dist2 += (C[i].z()-source_pt_z)*(C[i].z()-source_pt_z); - - dist_n = (C[i].x()-source_pt_x); - - if (dist2 < dist_tol*dist_tol && dist_n < -dist_tol/2) { - upVvol += V[i] * alphaL[i]; - upV += V[i] * alphaL[i] * UL[i][0]; - uprhoV += V[i] * alphaL[i] * rhoL[i]; - } - if (dist2 < dist_tol*dist_tol && dist_n > dist_tol/2) { - downVvol += V[i] * alphaL[i]; - downV += V[i] * alphaL[i] * UL[i][0]; - downrhoV += V[i] * alphaL[i] * rhoL[i]; - } - } - - reduce(uprhoV, sumOp()); - reduce(downrhoV, sumOp()); - reduce(upV, sumOp()); - reduce(downV, sumOp()); - reduce(downVvol, sumOp()); - reduce(upVvol, sumOp()); - - downV /= downVvol; - upV /= upVvol; - downrhoV /= downVvol; - uprhoV /= upVvol; - - if (upV <= 0 && downV <= 0) { - source_sign_factor = -1.0; - V1 = std::abs(upV); - rhoV = uprhoV; - } else if (upV >= 0 && downV >= 0) { - source_sign_factor = 1.0; - V1 = std::abs(downV); - rhoV = downrhoV; - } else { - V1 = 0.0; - source_sign_factor = -1.0; - rhoV = uprhoV; - Foam::Info << "[BIRD:DYNMIX WARN] " << "upV = " << upV << " downV = " << downV << " for source at " << source_pt_x << ", " << source_pt_y << ", " << source_pt_z << endl; - } - Foam::Info << "[BIRD:DYNMIX INFO] V1 = " << V1 << endl; - - // Get V2 - V2 = findV2(power, rhoV, disk_area, V1); - - forAll(C,i) - { - double Thrust=0.5*rhoL[i]*(V2*V2 - V1*V1)*disk_area; - double dist2=(C[i].x()-source_pt_x)*(C[i].x()-source_pt_x); - dist2 += (C[i].y()-source_pt_y)*(C[i].y()-source_pt_y); - dist2 += (C[i].z()-source_pt_z)*(C[i].z()-source_pt_z); - double epsilon=pow(V[i],0.33333)*smear_factor; - double sourceterm=alphaL[i]*(Thrust/pow(pi,1.5)/pow(epsilon,3.0))* - exp(-dist2/(epsilon*epsilon)); - Usource[i][0] -= source_sign_factor*sourceterm*V[i]; - } - } - #}; -}; diff --git a/bird/preprocess/data_preprocess/loop_reactor_3_6L/constant/g b/bird/preprocess/data_preprocess/loop_reactor_3_6L/constant/g deleted file mode 100644 index 770a5619..00000000 --- a/bird/preprocess/data_preprocess/loop_reactor_3_6L/constant/g +++ /dev/null @@ -1,21 +0,0 @@ -/*--------------------------------*- C++ -*----------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | Website: https://openfoam.org - \\ / A nd | Version: dev - \\/ M anipulation | -\*---------------------------------------------------------------------------*/ -FoamFile -{ - format ascii; - class uniformDimensionedVectorField; - location "constant"; - object g; -} -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -dimensions [0 1 -2 0 0 0 0]; -value (0 -9.81 0); - - -// ************************************************************************* // diff --git a/bird/preprocess/data_preprocess/loop_reactor_3_6L/constant/globalVars b/bird/preprocess/data_preprocess/loop_reactor_3_6L/constant/globalVars deleted file mode 100644 index 21436f69..00000000 --- a/bird/preprocess/data_preprocess/loop_reactor_3_6L/constant/globalVars +++ /dev/null @@ -1,83 +0,0 @@ -T0 300; //initial T(K) which stays constant -VVM 1.6; -//****water Liquid properties************** -CpMixLiq 4181; -muMixLiq #calc "2.414e-5 * pow(10,247.8/($T0 - 140.0))"; //viscosity (Pa.s) of water as a function of T(K) -kThermLiq 0.62; // W/m-K -rho0MixLiq 1000; // kg/m^3 -sigmaLiq 0.07; //surface tension N/m -//Wilke-Chang params for diffusion coefficient of a given solute in water (solvent) -WC_psi 2.6; -WC_M 18; // kg/kmol -WC_V_O2 25.6e-3; // m3/kmol molar volume at normal boiling temperature (Treybal 1968) -WC_V_H2 14.3e-3; -WC_V_CO2 34e-3; -WC_V_CO 30.7e-3; -WC_V_N2 31.2e-3; -WC_V_CH4 35e-3; // V_b[cm3/mol]=0.285*V_critical^1.048 (Tyn and Calus; ESTIMATING LIQUID MOLAL VOLUME; Processing, Volume 21, Issue 4, Pages 16 - 17) -//****** diffusion coeff *********** -D_H2 #calc "1.173e-16 * pow($WC_psi * $WC_M,0.5) * $T0 / $muMixLiq / pow($WC_V_H2,0.6)"; -D_CO2 #calc "1.173e-16 * pow($WC_psi * $WC_M,0.5) * $T0 / $muMixLiq / pow($WC_V_CO2,0.6)"; -D_CO #calc "1.173e-16 * pow($WC_psi * $WC_M,0.5) * $T0 / $muMixLiq / pow($WC_V_CO,0.6)"; -D_CH4 #calc "1.173e-16 * pow($WC_psi * $WC_M,0.5) * $T0 / $muMixLiq / pow($WC_V_CH4,0.6)"; -D_N2 #calc "1.173e-16 * pow($WC_psi * $WC_M,0.5) * $T0 / $muMixLiq / pow($WC_V_N2,0.6)"; -//****** Henry coeff *************** -H_O2_298 0.032; -DH_O2 1700; -H_CO2_298 0.83; -DH_CO2 2400; -H_CO_298 0.023; -DH_CO 1300; -H_H2_298 0.019; -DH_H2 500; -H_CH4_298 0.032; -DH_CH4 1900; -H_N2_298 0.015; -DH_N2 1300; -He_H2 #calc "$H_H2_298 * exp($DH_H2 *(1. / $T0 - 1./298.15))"; -He_CO #calc "$H_CO_298 * exp($DH_CO *(1. / $T0 - 1./298.15))"; -He_CO2 #calc "$H_CO2_298 * exp($DH_CO2 *(1. / $T0 - 1./298.15))"; -He_CH4 #calc "$H_CH4_298 * exp($DH_CH4 *(1. / $T0 - 1./298.15))"; -He_N2 #calc "$H_N2_298 * exp($DH_N2 *(1. / $T0 - 1./298.15))"; -//*******inlet gas frac************* -f_H2 0.1; -f_CO2 0.9; -f_N2 0.0; -//*******inlet gas frac************* -inletA 0.0039; -liqVol 0.003625; -alphaGas 1; -alphaLiq 0; -uGasPhase #calc "$liqVol * $VVM / (60 * $inletA * $alphaGas)"; -//********************************* -LeLiqH2 #calc "$kThermLiq / $rho0MixLiq / $D_H2 / $CpMixLiq"; -LeLiqCO #calc "$kThermLiq / $rho0MixLiq / $D_CO / $CpMixLiq"; -LeLiqCO2 #calc "$kThermLiq / $rho0MixLiq / $D_CO2 / $CpMixLiq"; // = 74 -LeLiqCH4 #calc "$kThermLiq / $rho0MixLiq / $D_CH4 / $CpMixLiq"; -LeLiqN2 #calc "$kThermLiq / $rho0MixLiq / $D_N2 / $CpMixLiq"; -LeLiqMix #calc "$f_CO2*$LeLiqCO2+$f_H2*$LeLiqH2"; -PrMixLiq #calc "$CpMixLiq * $muMixLiq / $kThermLiq"; -//********************************* -kH2 #calc "$D_H2*$rho0MixLiq*$CpMixLiq*$LeLiqMix"; -PrH2 #calc "$muMixLiq*$CpMixLiq / $kH2"; - -kCO #calc "$D_CO*$rho0MixLiq*$CpMixLiq*$LeLiqMix"; -PrCO #calc "$muMixLiq*$CpMixLiq / $kCO"; - -kCO2 #calc "$D_CO2*$rho0MixLiq*$CpMixLiq*$LeLiqMix"; -PrCO2 #calc "$muMixLiq*$CpMixLiq / $kCO2"; - -kCH4 #calc "$D_CH4*$rho0MixLiq*$CpMixLiq*$LeLiqMix"; -PrCH4 #calc "$muMixLiq*$CpMixLiq / $kCH4"; - -kN2 #calc "$D_N2*$rho0MixLiq*$CpMixLiq*$LeLiqMix"; -PrN2 #calc "$muMixLiq*$CpMixLiq / $kN2"; -//********************************* -l_scale 0.5; -intensity 0.05; -k_inlet_gas #calc "1.5 * Foam::pow(($uGasPhase), 2) * Foam::pow($intensity, 2)"; -k_inlet_liq #calc "1.5 * Foam::pow(($uGasPhase), 2) * Foam::pow($intensity, 2)"; -eps_inlet_gas #calc "pow(0.09,0.75) * Foam::pow($k_inlet_gas, 1.5) / ($l_scale * 0.07)"; -eps_inlet_liq #calc "pow(0.09,0.75) * Foam::pow($k_inlet_liq, 1.5) / ($l_scale * 0.07)"; -omega_inlet_gas #calc "pow(0.09,-0.25) * pow($k_inlet_gas,0.5) / ($l_scale * 0.07)"; -omega_inlet_liq #calc "pow(0.09,-0.25) * pow($k_inlet_liq,0.5) / ($l_scale * 0.07)"; diff --git a/bird/preprocess/data_preprocess/loop_reactor_3_6L/constant/globalVars_temp b/bird/preprocess/data_preprocess/loop_reactor_3_6L/constant/globalVars_temp deleted file mode 100644 index fcb076a7..00000000 --- a/bird/preprocess/data_preprocess/loop_reactor_3_6L/constant/globalVars_temp +++ /dev/null @@ -1,83 +0,0 @@ -T0 300; //initial T(K) which stays constant -VVM 0.2; -//****water Liquid properties************** -CpMixLiq 4181; -muMixLiq #calc "2.414e-5 * pow(10,247.8/($T0 - 140.0))"; //viscosity (Pa.s) of water as a function of T(K) -kThermLiq 0.62; // W/m-K -rho0MixLiq 1000; // kg/m^3 -sigmaLiq 0.07; //surface tension N/m -//Wilke-Chang params for diffusion coefficient of a given solute in water (solvent) -WC_psi 2.6; -WC_M 18; // kg/kmol -WC_V_O2 25.6e-3; // m3/kmol molar volume at normal boiling temperature (Treybal 1968) -WC_V_H2 14.3e-3; -WC_V_CO2 34e-3; -WC_V_CO 30.7e-3; -WC_V_N2 31.2e-3; -WC_V_CH4 35e-3; // V_b[cm3/mol]=0.285*V_critical^1.048 (Tyn and Calus; ESTIMATING LIQUID MOLAL VOLUME; Processing, Volume 21, Issue 4, Pages 16 - 17) -//****** diffusion coeff *********** -D_H2 #calc "1.173e-16 * pow($WC_psi * $WC_M,0.5) * $T0 / $muMixLiq / pow($WC_V_H2,0.6)"; -D_CO2 #calc "1.173e-16 * pow($WC_psi * $WC_M,0.5) * $T0 / $muMixLiq / pow($WC_V_CO2,0.6)"; -D_CO #calc "1.173e-16 * pow($WC_psi * $WC_M,0.5) * $T0 / $muMixLiq / pow($WC_V_CO,0.6)"; -D_CH4 #calc "1.173e-16 * pow($WC_psi * $WC_M,0.5) * $T0 / $muMixLiq / pow($WC_V_CH4,0.6)"; -D_N2 #calc "1.173e-16 * pow($WC_psi * $WC_M,0.5) * $T0 / $muMixLiq / pow($WC_V_N2,0.6)"; -//****** Henry coeff *************** -H_O2_298 0.032; -DH_O2 1700; -H_CO2_298 0.83; -DH_CO2 2400; -H_CO_298 0.023; -DH_CO 1300; -H_H2_298 0.019; -DH_H2 500; -H_CH4_298 0.032; -DH_CH4 1900; -H_N2_298 0.015; -DH_N2 1300; -He_H2 #calc "$H_H2_298 * exp($DH_H2 *(1. / $T0 - 1./298.15))"; -He_CO #calc "$H_CO_298 * exp($DH_CO *(1. / $T0 - 1./298.15))"; -He_CO2 #calc "$H_CO2_298 * exp($DH_CO2 *(1. / $T0 - 1./298.15))"; -He_CH4 #calc "$H_CH4_298 * exp($DH_CH4 *(1. / $T0 - 1./298.15))"; -He_N2 #calc "$H_N2_298 * exp($DH_N2 *(1. / $T0 - 1./298.15))"; -//*******inlet gas frac************* -f_H2 0.1; -f_CO2 0.9; -f_N2 0.0; -//*******inlet gas frac************* -inletA ; -liqVol ; -alphaGas 1; -alphaLiq 0; -uGasPhase #calc "$liqVol * $VVM / (60 * $inletA * $alphaGas)"; -//********************************* -LeLiqH2 #calc "$kThermLiq / $rho0MixLiq / $D_H2 / $CpMixLiq"; -LeLiqCO #calc "$kThermLiq / $rho0MixLiq / $D_CO / $CpMixLiq"; -LeLiqCO2 #calc "$kThermLiq / $rho0MixLiq / $D_CO2 / $CpMixLiq"; // = 74 -LeLiqCH4 #calc "$kThermLiq / $rho0MixLiq / $D_CH4 / $CpMixLiq"; -LeLiqN2 #calc "$kThermLiq / $rho0MixLiq / $D_N2 / $CpMixLiq"; -LeLiqMix #calc "$f_CO2*$LeLiqCO2+$f_H2*$LeLiqH2"; -PrMixLiq #calc "$CpMixLiq * $muMixLiq / $kThermLiq"; -//********************************* -kH2 #calc "$D_H2*$rho0MixLiq*$CpMixLiq*$LeLiqMix"; -PrH2 #calc "$muMixLiq*$CpMixLiq / $kH2"; - -kCO #calc "$D_CO*$rho0MixLiq*$CpMixLiq*$LeLiqMix"; -PrCO #calc "$muMixLiq*$CpMixLiq / $kCO"; - -kCO2 #calc "$D_CO2*$rho0MixLiq*$CpMixLiq*$LeLiqMix"; -PrCO2 #calc "$muMixLiq*$CpMixLiq / $kCO2"; - -kCH4 #calc "$D_CH4*$rho0MixLiq*$CpMixLiq*$LeLiqMix"; -PrCH4 #calc "$muMixLiq*$CpMixLiq / $kCH4"; - -kN2 #calc "$D_N2*$rho0MixLiq*$CpMixLiq*$LeLiqMix"; -PrN2 #calc "$muMixLiq*$CpMixLiq / $kN2"; -//********************************* -l_scale 0.5; -intensity 0.05; -k_inlet_gas #calc "1.5 * Foam::pow(($uGasPhase), 2) * Foam::pow($intensity, 2)"; -k_inlet_liq #calc "1.5 * Foam::pow(($uGasPhase), 2) * Foam::pow($intensity, 2)"; -eps_inlet_gas #calc "pow(0.09,0.75) * Foam::pow($k_inlet_gas, 1.5) / ($l_scale * 0.07)"; -eps_inlet_liq #calc "pow(0.09,0.75) * Foam::pow($k_inlet_liq, 1.5) / ($l_scale * 0.07)"; -omega_inlet_gas #calc "pow(0.09,-0.25) * pow($k_inlet_gas,0.5) / ($l_scale * 0.07)"; -omega_inlet_liq #calc "pow(0.09,-0.25) * pow($k_inlet_liq,0.5) / ($l_scale * 0.07)"; diff --git a/bird/preprocess/data_preprocess/loop_reactor_3_6L/constant/momentumTransport.gas b/bird/preprocess/data_preprocess/loop_reactor_3_6L/constant/momentumTransport.gas deleted file mode 100644 index ca916714..00000000 --- a/bird/preprocess/data_preprocess/loop_reactor_3_6L/constant/momentumTransport.gas +++ /dev/null @@ -1,26 +0,0 @@ -/*--------------------------------*- C++ -*----------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | Website: https://openfoam.org - \\ / A nd | Version: dev - \\/ M anipulation | -\*---------------------------------------------------------------------------*/ -FoamFile -{ - format ascii; - class dictionary; - location "constant"; - object momentumTransport.gas; -} -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -//simulationType laminar; -simulationType RAS; -RAS -{ - model mixtureKEpsilon; - turbulence on; - printCoeff on; -} - -// ************************************************************************* // diff --git a/bird/preprocess/data_preprocess/loop_reactor_3_6L/constant/momentumTransport.liquid b/bird/preprocess/data_preprocess/loop_reactor_3_6L/constant/momentumTransport.liquid deleted file mode 100644 index 2063de0d..00000000 --- a/bird/preprocess/data_preprocess/loop_reactor_3_6L/constant/momentumTransport.liquid +++ /dev/null @@ -1,27 +0,0 @@ -/*--------------------------------*- C++ -*----------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | Website: https://openfoam.org - \\ / A nd | Version: dev - \\/ M anipulation | -\*---------------------------------------------------------------------------*/ -FoamFile -{ - format ascii; - class dictionary; - location "constant"; - object momentumTransport.liquid; -} -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -//simulationType laminar; -simulationType RAS; - -RAS -{ - model mixtureKEpsilon; - turbulence on; - printCoeffs on; -} - -// ************************************************************************* // diff --git a/bird/preprocess/data_preprocess/loop_reactor_3_6L/constant/phaseProperties b/bird/preprocess/data_preprocess/loop_reactor_3_6L/constant/phaseProperties deleted file mode 100644 index a3c90f5a..00000000 --- a/bird/preprocess/data_preprocess/loop_reactor_3_6L/constant/phaseProperties +++ /dev/null @@ -1,295 +0,0 @@ -/*--------------------------------*- C++ -*----------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | Website: https://openfoam.org - \\ / A nd | Version: 9 - \\/ M anipulation | -\*---------------------------------------------------------------------------*/ -FoamFile -{ - format ascii; - class dictionary; - object phaseProperties; -} -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#include "$FOAM_CASE/constant/globalVars" - -type interfaceCompositionPhaseChangePopulationBalanceMultiphaseSystem; - -phases (gas liquid); - -populationBalances (bubbles); - -gas -{ - type multiComponentPhaseModel;//pureIsothermalPhaseModel; - - diameterModel velocityGroup; - - velocityGroupCoeffs - { - populationBalance bubbles; - - shapeModel spherical; - - sizeGroups - ( - f1 {dSph 1.4e-3; value 0.0;} - f2 {dSph 1.8e-3; value 0.0;} - f3 {dSph 2.2e-3; value 0.0;} - f4 {dSph 2.6e-3; value 0.0;} - f5 {dSph 3e-3; value 1.0;} - f6 {dSph 3.4e-3; value 0.0;} - f7 {dSph 3.8e-3; value 0.0;} - f8 {dSph 4.2e-3; value 0.0;} - f9 {dSph 4.6e-3; value 0.0;} - f10 {dSph 5.0e-3; value 0.0;} - ); - } - - residualAlpha 1e-6; - - Sc 0.7; -} - -liquid -{ - type multiComponentPhaseModel;//pureIsothermalPhaseModel; - - diameterModel constant; - - constantCoeffs - { - d 1e-4; - } - Sc #codeStream - { - code - #{ - os << ($LeLiqMix * $CpMixLiq * $muMixLiq / $kThermLiq); - #}; - }; - - residualAlpha 1e-6; -} - -populationBalanceCoeffs -{ - bubbles - { - continuousPhase liquid; - - coalescenceModels - ( - LehrMilliesMewes{ - efficiency 4.695; - uCrit 0.08; - alphaMax 0.6; - } - ); - - binaryBreakupModels - (); - - breakupModels - ( - Laakkonen { - efficiency 13.83; - daughterSizeDistributionModel Laakkonen; - } - - ); - - driftModels - ( - densityChange{} - ); - - nucleationModels - (); - } -} - -blending -{ - default - { - type linear; - minFullyContinuousAlpha.gas 0.7; - minPartlyContinuousAlpha.gas 0.3; - minFullyContinuousAlpha.liquid 0.7; - minPartlyContinuousAlpha.liquid 0.3; - } - heatTransfer - { - type linear; - minFullyContinuousAlpha.gas 1; - minPartlyContinuousAlpha.gas 0; - minFullyContinuousAlpha.liquid 1; - minPartlyContinuousAlpha.liquid 0; - } - massTransfer - { - $heatTransfer; - } -} - -surfaceTension -( - (gas and liquid) - { - type constant; - sigma $sigmaLiq; - } -); - -interfaceCompression -(); - -aspectRatio -( - (gas in liquid) - { - type Wellek; - } -); - - -drag -( - (gas in liquid) - { - type Grace; // Need to install the model available at https://github.com/NREL/BioReactorDesign - //type IshiiZuber; - residualRe 1e-3; - swarmCorrection - { - type none; - } - } -); - -virtualMass -( - (gas in liquid) - { - type constantCoefficient; - Cvm 0.5; - } -); - -// heatTransfer -// (); - -heatTransfer.gas -( - (gas in liquid) - { - type spherical; - residualAlpha 1e-4; - } - - (liquid in gas) - { - type RanzMarshall; - residualAlpha 1e-4; - } -); - -heatTransfer.liquid -( - (gas in liquid) - { - type RanzMarshall; - residualAlpha 1e-4; - } - - (liquid in gas) - { - type spherical; - residualAlpha 1e-4; - } -); - -interfaceComposition.gas -(); - -interfaceComposition.liquid -( - (liquid and gas) - { - type Henry; - species ( CO2 H2 ); - k ( $He_CO2 $He_H2 ); - Le $LeLiqMix; - } -); - -diffusiveMassTransfer.gas -(); - -diffusiveMassTransfer.liquid -( - (gas in liquid) - { - type Higbie; // Need to install the model available at https://github.com/NREL/BioReactorDesign - //type Frossling; - Le $LeLiqMix; - } - - (liquid in gas) - { - type spherical; - Le 1.0; //not used for spherical - } -); - -phaseTransfer -(); - -lift -( - (gas in liquid) - { - type wallDamped; - - wallDamping - { - type cosine; - Cd 3.0; - } - - lift - { - type Tomiyama; - - swarmCorrection - { - type none; - } - } - } - -); - -wallLubrication -( - (gas in liquid) - { - type Antal; - Cw1 -0.01; - Cw2 0.05; - } -); - -turbulentDispersion -( - (gas in liquid) - { - type Burns; - sigma 0.9; - } -); - -// ************************************************************************* // diff --git a/bird/preprocess/data_preprocess/loop_reactor_3_6L/constant/phaseProperties_constantd b/bird/preprocess/data_preprocess/loop_reactor_3_6L/constant/phaseProperties_constantd deleted file mode 100644 index e029df99..00000000 --- a/bird/preprocess/data_preprocess/loop_reactor_3_6L/constant/phaseProperties_constantd +++ /dev/null @@ -1,261 +0,0 @@ -/*--------------------------------*- C++ -*----------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | Website: https://openfoam.org - \\ / A nd | Version: 9 - \\/ M anipulation | -\*---------------------------------------------------------------------------*/ -FoamFile -{ - format ascii; - class dictionary; - object phaseProperties; -} -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#include "$FOAM_CASE/constant/globalVars" - -type interfaceCompositionPhaseChangeMultiphaseSystem; - -phases (gas liquid); - -gas -{ - type multiComponentPhaseModel;//pureIsothermalPhaseModel; - - diameterModel constant; - - constantCoeffs - { - d 3e-3; - } - residualAlpha 1e-6; - Sc 0.7; -} - -liquid -{ - type multiComponentPhaseModel;//pureIsothermalPhaseModel; - - diameterModel constant; - - constantCoeffs - { - d 1e-4; - } - Sc #codeStream - { - code - #{ - os << ($LeLiqMix * $CpMixLiq * $muMixLiq / $kThermLiq); - #}; - }; - - residualAlpha 1e-6; -} - -populationBalanceCoeffs -{ - bubbles - { - continuousPhase liquid; - - coalescenceModels - (); - - binaryBreakupModels - (); - - breakupModels - (); - - driftModels - (); - - nucleationModels - (); - } -} - -blending -{ - default - { - type linear; - minFullyContinuousAlpha.gas 0.7; - minPartlyContinuousAlpha.gas 0.3; - minFullyContinuousAlpha.liquid 0.7; - minPartlyContinuousAlpha.liquid 0.3; - } - heatTransfer - { - type linear; - minFullyContinuousAlpha.gas 1; - minPartlyContinuousAlpha.gas 0; - minFullyContinuousAlpha.liquid 1; - minPartlyContinuousAlpha.liquid 0; - } - massTransfer - { - $heatTransfer; - } -} - -surfaceTension -( - (gas and liquid) - { - type constant; - sigma $sigmaLiq; - } -); - -interfaceCompression -(); - -aspectRatio -( - (gas in liquid) - { - type Wellek; - } -); - - -drag -( - (gas in liquid) - { - type Grace; // Need to install the model available at https://github.com/NREL/BioReactorDesign - //type IshiiZuber; - residualRe 1e-3; - swarmCorrection - { - type none; - } - } -); - -virtualMass -( - (gas in liquid) - { - type constantCoefficient; - Cvm 0.5; - } -); - -// heatTransfer -// (); - -heatTransfer.gas -( - (gas in liquid) - { - type spherical; - residualAlpha 1e-4; - } - - (liquid in gas) - { - type RanzMarshall; - residualAlpha 1e-4; - } -); - -heatTransfer.liquid -( - (gas in liquid) - { - type RanzMarshall; - residualAlpha 1e-4; - } - - (liquid in gas) - { - type spherical; - residualAlpha 1e-4; - } -); - -interfaceComposition.gas -(); - -interfaceComposition.liquid -( - (liquid and gas) - { - type Henry; - species ( CO2 H2 ); - k ( $He_CO2 $He_H2 ); - Le $LeLiqMix; - } -); - -diffusiveMassTransfer.gas -(); - -diffusiveMassTransfer.liquid -( - (gas in liquid) - { - type Higbie; // Need to install the model available at https://github.com/NREL/BioReactorDesign - //type Frossling; - Le $LeLiqMix; - } - - (liquid in gas) - { - type spherical; - Le 1.0; //not used for spherical - } -); - -phaseTransfer -(); - -lift -( - (gas in liquid) - { - type wallDamped; - - wallDamping - { - type cosine; - Cd 3.0; - } - - lift - { - type Tomiyama; - - swarmCorrection - { - type none; - } - } - } - -); - -wallLubrication -( - (gas in liquid) - { - type Antal; - Cw1 -0.01; - Cw2 0.05; - } -); - -turbulentDispersion -( - (gas in liquid) - { - type Burns; - sigma 0.9; - } -); - -// ************************************************************************* // diff --git a/bird/preprocess/data_preprocess/loop_reactor_3_6L/constant/phaseProperties_pbe b/bird/preprocess/data_preprocess/loop_reactor_3_6L/constant/phaseProperties_pbe deleted file mode 100644 index a3c90f5a..00000000 --- a/bird/preprocess/data_preprocess/loop_reactor_3_6L/constant/phaseProperties_pbe +++ /dev/null @@ -1,295 +0,0 @@ -/*--------------------------------*- C++ -*----------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | Website: https://openfoam.org - \\ / A nd | Version: 9 - \\/ M anipulation | -\*---------------------------------------------------------------------------*/ -FoamFile -{ - format ascii; - class dictionary; - object phaseProperties; -} -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#include "$FOAM_CASE/constant/globalVars" - -type interfaceCompositionPhaseChangePopulationBalanceMultiphaseSystem; - -phases (gas liquid); - -populationBalances (bubbles); - -gas -{ - type multiComponentPhaseModel;//pureIsothermalPhaseModel; - - diameterModel velocityGroup; - - velocityGroupCoeffs - { - populationBalance bubbles; - - shapeModel spherical; - - sizeGroups - ( - f1 {dSph 1.4e-3; value 0.0;} - f2 {dSph 1.8e-3; value 0.0;} - f3 {dSph 2.2e-3; value 0.0;} - f4 {dSph 2.6e-3; value 0.0;} - f5 {dSph 3e-3; value 1.0;} - f6 {dSph 3.4e-3; value 0.0;} - f7 {dSph 3.8e-3; value 0.0;} - f8 {dSph 4.2e-3; value 0.0;} - f9 {dSph 4.6e-3; value 0.0;} - f10 {dSph 5.0e-3; value 0.0;} - ); - } - - residualAlpha 1e-6; - - Sc 0.7; -} - -liquid -{ - type multiComponentPhaseModel;//pureIsothermalPhaseModel; - - diameterModel constant; - - constantCoeffs - { - d 1e-4; - } - Sc #codeStream - { - code - #{ - os << ($LeLiqMix * $CpMixLiq * $muMixLiq / $kThermLiq); - #}; - }; - - residualAlpha 1e-6; -} - -populationBalanceCoeffs -{ - bubbles - { - continuousPhase liquid; - - coalescenceModels - ( - LehrMilliesMewes{ - efficiency 4.695; - uCrit 0.08; - alphaMax 0.6; - } - ); - - binaryBreakupModels - (); - - breakupModels - ( - Laakkonen { - efficiency 13.83; - daughterSizeDistributionModel Laakkonen; - } - - ); - - driftModels - ( - densityChange{} - ); - - nucleationModels - (); - } -} - -blending -{ - default - { - type linear; - minFullyContinuousAlpha.gas 0.7; - minPartlyContinuousAlpha.gas 0.3; - minFullyContinuousAlpha.liquid 0.7; - minPartlyContinuousAlpha.liquid 0.3; - } - heatTransfer - { - type linear; - minFullyContinuousAlpha.gas 1; - minPartlyContinuousAlpha.gas 0; - minFullyContinuousAlpha.liquid 1; - minPartlyContinuousAlpha.liquid 0; - } - massTransfer - { - $heatTransfer; - } -} - -surfaceTension -( - (gas and liquid) - { - type constant; - sigma $sigmaLiq; - } -); - -interfaceCompression -(); - -aspectRatio -( - (gas in liquid) - { - type Wellek; - } -); - - -drag -( - (gas in liquid) - { - type Grace; // Need to install the model available at https://github.com/NREL/BioReactorDesign - //type IshiiZuber; - residualRe 1e-3; - swarmCorrection - { - type none; - } - } -); - -virtualMass -( - (gas in liquid) - { - type constantCoefficient; - Cvm 0.5; - } -); - -// heatTransfer -// (); - -heatTransfer.gas -( - (gas in liquid) - { - type spherical; - residualAlpha 1e-4; - } - - (liquid in gas) - { - type RanzMarshall; - residualAlpha 1e-4; - } -); - -heatTransfer.liquid -( - (gas in liquid) - { - type RanzMarshall; - residualAlpha 1e-4; - } - - (liquid in gas) - { - type spherical; - residualAlpha 1e-4; - } -); - -interfaceComposition.gas -(); - -interfaceComposition.liquid -( - (liquid and gas) - { - type Henry; - species ( CO2 H2 ); - k ( $He_CO2 $He_H2 ); - Le $LeLiqMix; - } -); - -diffusiveMassTransfer.gas -(); - -diffusiveMassTransfer.liquid -( - (gas in liquid) - { - type Higbie; // Need to install the model available at https://github.com/NREL/BioReactorDesign - //type Frossling; - Le $LeLiqMix; - } - - (liquid in gas) - { - type spherical; - Le 1.0; //not used for spherical - } -); - -phaseTransfer -(); - -lift -( - (gas in liquid) - { - type wallDamped; - - wallDamping - { - type cosine; - Cd 3.0; - } - - lift - { - type Tomiyama; - - swarmCorrection - { - type none; - } - } - } - -); - -wallLubrication -( - (gas in liquid) - { - type Antal; - Cw1 -0.01; - Cw2 0.05; - } -); - -turbulentDispersion -( - (gas in liquid) - { - type Burns; - sigma 0.9; - } -); - -// ************************************************************************* // diff --git a/bird/preprocess/data_preprocess/loop_reactor_3_6L/constant/thermophysicalProperties.gas b/bird/preprocess/data_preprocess/loop_reactor_3_6L/constant/thermophysicalProperties.gas deleted file mode 100644 index 11b1c4b9..00000000 --- a/bird/preprocess/data_preprocess/loop_reactor_3_6L/constant/thermophysicalProperties.gas +++ /dev/null @@ -1,142 +0,0 @@ -/*--------------------------------*- C++ -*----------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | Website: https://openfoam.org - \\ / A nd | Version: dev - \\/ M anipulation | -\*---------------------------------------------------------------------------*/ -FoamFile -{ - format ascii; - class dictionary; - location "constant"; - object thermophysicalProperties.gas; -} -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -thermoType -{ - type heRhoThermo; - mixture multiComponentMixture; - transport sutherland; - thermo janaf; - equationOfState perfectGas; - specie specie; - energy sensibleInternalEnergy; - //energy sensibleEnthalpy; -} - - -species -( - H2 - CO2 - N2 -); - -defaultSpecie N2; - -CO2 -{ - specie - { - molWeight 44.00995; - } - thermodynamics - { - Tlow 200; - Thigh 3500; - Tcommon 1000; - highCpCoeffs ( 3.85746029 0.00441437026 -2.21481404e-06 5.23490188e-10 -4.72084164e-14 -48759.166 2.27163806 ); - lowCpCoeffs ( 2.35677352 0.00898459677 -7.12356269e-06 2.45919022e-09 -1.43699548e-13 -48371.9697 9.90105222 ); - } - transport - { - As 1.572e-06; - Ts 240; - } - elements - { - C 1; - O 2; - } -} - -water -{ - specie - { - molWeight 18.01534; - } - thermodynamics - { - Tlow 200; - Thigh 3500; - Tcommon 1000; - highCpCoeffs ( 3.03399249 0.00217691804 -1.64072518e-07 -9.7041987e-11 1.68200992e-14 -30004.2971 4.9667701 ); - lowCpCoeffs ( 4.19864056 -0.0020364341 6.52040211e-06 -5.48797062e-09 1.77197817e-12 -30293.7267 -0.849032208 ); - } - transport - { - As 1.512e-06; - Ts 120; - } - elements - { - H 2; - O 1; - } -} - -N2 -{ - specie - { - molWeight 28.0134; - } - thermodynamics - { - Tlow 250; - Thigh 5000; - Tcommon 1000; - highCpCoeffs ( 2.92664 0.0014879768 -5.68476e-07 1.0097038e-10 -6.753351e-15 -922.7977 5.980528 ); - lowCpCoeffs ( 3.298677 0.0014082404 -3.963222e-06 5.641515e-09 -2.444854e-12 -1020.8999 3.950372 ); - } - transport - { - As 1.512e-06; - Ts 120; - } - elements - { - N 2; - } -} - -H2 -{ - specie - { - molWeight 2.01594; - } - thermodynamics - { - Tlow 200; - Thigh 3500; - Tcommon 1000; - highCpCoeffs ( 3.3372792 -4.94024731e-05 4.99456778e-07 -1.79566394e-10 2.00255376e-14 -950.158922 -3.20502331 ); - lowCpCoeffs ( 2.34433112 0.00798052075 -1.9478151e-05 2.01572094e-08 -7.37611761e-12 -917.935173 0.683010238 ); - } - transport - { - As 6.362e-07; - Ts 72; - } - elements - { - H 2; - } -} - - -// ************************************************************************* // diff --git a/bird/preprocess/data_preprocess/loop_reactor_3_6L/constant/thermophysicalProperties.liquid b/bird/preprocess/data_preprocess/loop_reactor_3_6L/constant/thermophysicalProperties.liquid deleted file mode 100644 index d324ec51..00000000 --- a/bird/preprocess/data_preprocess/loop_reactor_3_6L/constant/thermophysicalProperties.liquid +++ /dev/null @@ -1,108 +0,0 @@ -/*--------------------------------*- C++ -*----------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | Website: https://openfoam.org - \\ / A nd | Version: dev - \\/ M anipulation | -\*---------------------------------------------------------------------------*/ -FoamFile -{ - format ascii; - class dictionary; - location "constant"; - object thermophysicalProperties.liquid; -} -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#include "$FOAM_CASE/constant/globalVars" - -thermoType -{ - type heRhoThermo; - mixture multiComponentMixture; - transport const; - thermo hConst; - equationOfState rhoConst;//rPolynomial; - specie specie; - energy sensibleInternalEnergy; - //energy sensibleEnthalpy; -} - -species -( - CO2 - water - H2 -); - -inertSpecie water; - -water -{ - specie - { - molWeight 18.0153; - } - equationOfState - { - rho $rho0MixLiq; - } - thermodynamics - { - Cp $CpMixLiq; - Hf -1.5879e+07; - } - transport - { - mu $muMixLiq; - Pr $PrMixLiq; - } -} - -CO2 -{ - specie - { - molWeight 44.00995; - } - equationOfState - { - rho $rho0MixLiq; - } - thermodynamics - { - Cp $CpMixLiq; - Hf -1.5879e+07; - } - transport - { - mu $muMixLiq; - Pr $PrCO2; - } -} - -H2 -{ - specie - { - molWeight 2.01594; - } - equationOfState - { - rho $rho0MixLiq; - } - thermodynamics - { - Cp $CpMixLiq; - Hf -1.5879e+07;//-9402451; - } - transport - { - mu $muMixLiq; - Pr $PrH2; - } -} - - - -// ************************************************************************* // diff --git a/bird/preprocess/data_preprocess/loop_reactor_3_6L/get_qoi.py b/bird/preprocess/data_preprocess/loop_reactor_3_6L/get_qoi.py deleted file mode 100644 index 9562cc65..00000000 --- a/bird/preprocess/data_preprocess/loop_reactor_3_6L/get_qoi.py +++ /dev/null @@ -1,183 +0,0 @@ -import json -import os -import pickle as pkl - -import matplotlib as mpl -import numpy as np -from prettyPlot.plotting import * -from scipy.optimize import curve_fit - - -def get_sim_folds(path): - folds = os.listdir(path) - sim_folds = [] - for fold in folds: - if fold.startswith("loop"): - sim_folds.append(fold) - return sim_folds - - -def func(t, cstar, kla): - t = t - t0 = 0 - c0 = 0 - return (cstar - c0) * (1 - np.exp(-kla * (t - t0))) + c0 - - -def get_vl(verb=False): - filename = os.path.join("constant", "globalVars") - with open(filename, "r+") as f: - lines = f.readlines() - for line in lines: - if line.startswith("liqVol"): - vol = float(line.split()[-1][:-1]) - break - if verb: - print(f"Read liqVol = {vol}m3") - return vol - - -def get_vvm(verb=False): - filename = os.path.join("constant", "globalVars") - with open(filename, "r+") as f: - lines = f.readlines() - for line in lines: - if line.startswith("VVM"): - vvm = float(line.split()[-1][:-1]) - break - if verb: - print(f"Read VVM = {vvm} [-]") - return vvm - - -def get_As(verb=False): - filename = os.path.join("constant", "globalVars") - with open(filename, "r+") as f: - lines = f.readlines() - for line in lines: - if line.startswith("inletA"): - As = float(line.split()[-1][:-1]) - break - if verb: - print(f"Read As = {As}m2") - return As - - -def get_pmix(verb=False): - with open("system/mixers.json", "r+") as f: - data = json.load(f) - mixer_list = data["mixers"] - pmix = 0 - for mix in mixer_list: - pmix += mix["power"] / 1000 - if verb: - print(f"Read Mixing power = {pmix}kW") - return pmix - - -def get_lh(verb=False): - filename = os.path.join("system", "setFieldsDict") - with open(filename, "r+") as f: - lines = f.readlines() - for line in lines: - if "box (-1.0 -1.0 -1.0)" in line: - height = float(line.split("(")[2].split()[1]) - break - if verb: - print(f"Read Height = {height}m") - return height - - -def get_pinj(vvm, Vl, As, lh): - rhog = 1.25 # kg /m3 - Vg = Vl * vvm / (60 * As * 1) # m/s - Ptank = 101325 # Pa - # Ptank = 0 # Pa - rhoL = 1000 # kg / m3 - Pl = 101325 + rhoL * 9.8 * lh # Pa - # W - P1 = rhog * As * Vg**3 - # W - P2 = (Pl - Ptank) * As * Vg - # kg /s - MF = rhog * Vg * As - # kwh / kg - e_m = (P1 + P2) / (3600 * 1000 * MF) - - # returns kW - return (P1 + P2) * 1e-3 - - -def get_qoi(kla_co2, cs_co2, kla_h2, cs_h2, verb=False): - vvm = get_vvm(verb) - As = get_As(verb) - V_l = get_vl(verb) - liqh = get_lh(verb) - P_inj = get_pinj(vvm, V_l, As, liqh) - P_mix = get_pmix(verb) - - qoi_co2 = kla_co2 * cs_co2 * V_l * 0.04401 / (P_mix / 3600 + P_inj / 3600) - qoi_h2 = kla_h2 * cs_h2 * V_l * 0.002016 / (P_mix / 3600 + P_inj / 3600) - return qoi_co2 * qoi_h2 - - -def get_qoi_uq(kla_co2, cs_co2, kla_h2, cs_h2): - qoi = [] - for i in range(len(kla_co2)): - if i == 0: - verb = True - else: - verb = False - qoi.append(get_qoi(kla_co2[i], cs_co2[i], kla_h2[i], cs_h2[i], verb)) - qoi = np.array(qoi) - return np.mean(qoi), np.std(qoi) - - -os.makedirs("Figures", exist_ok=True) - -dataFolder = "data" -fold = "local" - -nuq = 100 -mean_cstar_co2 = np.random.uniform(12.6, 13.3, nuq) -mean_cstar_h2 = np.random.uniform(0.902, 0.96, nuq) - - -tmp_cs_h2 = [] -tmp_cs_co2 = [] -tmp_kla_h2 = [] -tmp_kla_co2 = [] -cs_co2 = mean_cstar_co2 -cs_h2 = mean_cstar_h2 - -a = np.load(os.path.join(dataFolder, fold, "conv.npz")) -endindex = -1 -if ( - "c_h2" in a - and "c_co2" in a - and len(a["time"][:endindex] > 0) - and (a["time"][:endindex][-1] > 95) -): - for i in range(nuq): - fitparamsH2, _ = curve_fit( - func, - np.array(a["time"][:endindex]), - np.array(a["c_h2"][:endindex]), - bounds=[(cs_h2[i] - 1e-6, 0), (cs_h2[i] + 1e-6, 1)], - ) - fitparamsCO2, _ = curve_fit( - func, - np.array(a["time"][:endindex]), - np.array(a["c_co2"][:endindex]), - bounds=[(cs_co2[i] - 1e-6, 0), (cs_co2[i] + 1e-6, 1)], - ) - tmp_kla_co2.append(fitparamsCO2[1]) - tmp_kla_h2.append(fitparamsH2[1]) - tmp_cs_h2.append(cs_h2[i]) - tmp_cs_co2.append(cs_co2[i]) - -qoi_m, qoi_s = get_qoi_uq(tmp_kla_co2, tmp_cs_co2, tmp_kla_h2, tmp_cs_h2) - - -with open("qoi.txt", "w+") as f: - f.write(f"{qoi_m},{qoi_s}\n") diff --git a/bird/preprocess/data_preprocess/loop_reactor_3_6L/presteps.sh b/bird/preprocess/data_preprocess/loop_reactor_3_6L/presteps.sh deleted file mode 100644 index 899655b8..00000000 --- a/bird/preprocess/data_preprocess/loop_reactor_3_6L/presteps.sh +++ /dev/null @@ -1,71 +0,0 @@ -# Clean case -module load anaconda3/2023 -conda activate /projects/gas2fuels/conda_env/bird -source /projects/gas2fuels/ofoam_cray_mpich/OpenFOAM-dev/etc/bashrc -./Allclean - -echo PRESTEP 1 -# Generate blockmeshDict -python /projects/gas2fuels/BioReactorDesign/applications/write_block_rect_mesh.py -i system/mesh.json -o system -#python ../../../applications/write_block_rect_mesh.py -i system/mesh.json -o system - -# Generate boundary stl -python /projects/gas2fuels/BioReactorDesign/applications/write_stl_patch.py -i system/inlets_outlets.json -#python ../../../applications/write_stl_patch.py -i system/inlets_outlets.json - -# Generate mixers -python /projects/gas2fuels/BioReactorDesign/applications/write_dynMix_fvModels_force_sign.py -i system/mixers.json -o constant -#python ../../../applications/write_dynMix_fvModels.py -i system/mixers.json -o constant - -echo PRESTEP 2 -# Mesh gen -blockMesh -dict system/blockMeshDict - -# Inlet BC -surfaceToPatch -tol 1e-3 inlets.stl -export newmeshdir=$(foamListTimes -latestTime) -rm -rf constant/polyMesh/ -cp -r $newmeshdir/polyMesh ./constant -rm -rf $newmeshdir -cp constant/polyMesh/boundary /tmp -sed -i -e 's/inlets\.stl/inlet/g' /tmp/boundary -cat /tmp/boundary > constant/polyMesh/boundary - -# Outlet BC -surfaceToPatch -tol 1e-3 outlets.stl -export newmeshdir=$(foamListTimes -latestTime) -rm -rf constant/polyMesh/ -cp -r $newmeshdir/polyMesh ./constant -rm -rf $newmeshdir -cp constant/polyMesh/boundary /tmp -sed -i -e 's/outlets\.stl/outlet/g' /tmp/boundary -cat /tmp/boundary > constant/polyMesh/boundary - - -# Scale -transformPoints "scale=(0.05 0.05 0.05)" - - -# setup IC -cp -r 0.orig 0 -setFields - -# Setup mass flow rate -# Get inlet area -postProcess -func 'patchIntegrate(patch="inlet", field="alpha.gas")' -postProcess -func writeCellVolumes -writeMeshObj - -echo PRESTEP 3 -python writeGlobalVars.py -cp constant/phaseProperties_constantd constant/phaseProperties - - -if [ -f qoi.txt ]; then - rm qoi.txt -fi -if [ -f data/local/conv.npz ]; then - rm data/local/conv.npz -fi - -conda deactivate diff --git a/bird/preprocess/data_preprocess/loop_reactor_3_6L/read_history.py b/bird/preprocess/data_preprocess/loop_reactor_3_6L/read_history.py deleted file mode 100644 index 264711f8..00000000 --- a/bird/preprocess/data_preprocess/loop_reactor_3_6L/read_history.py +++ /dev/null @@ -1,239 +0,0 @@ -import argparse -import os -import sys - -import numpy as np -from prettyPlot.plotting import plt, pretty_labels - -from bird.utilities.ofio import * - - -def compute_gas_holdup(caseFolder, timeFolder, nCells, field_dict={}): - if not ("alpha_liq" in field_dict) or field_dict["alpha_liq"] is None: - alpha_liq_file = os.path.join(caseFolder, timeFolder, "alpha.liquid") - alpha_liq = readOFScal(alpha_liq_file, nCells) - # print("reading alpha_liq") - field_dict["alpha_liq"] = alpha_liq - if not ("volume" in field_dict) or field_dict["volume"] is None: - volume_file = os.path.join(caseFolder, "0", "V") - volume = readOFScal(volume_file, nCells) - # print("reading Volume") - field_dict["volume"] = volume - alpha_liq = field_dict["alpha_liq"] - volume = field_dict["volume"] - holdup = np.sum((1 - alpha_liq) * volume) / np.sum(volume) - return holdup, field_dict - - -def co2liq(caseFolder, timeFolder, nCells, field_dict={}): - if not ("alpha_liq" in field_dict) or field_dict["alpha_liq"] is None: - alpha_liq_file = os.path.join(caseFolder, timeFolder, "alpha.liquid") - alpha_liq = readOFScal(alpha_liq_file, nCells) - # print("reading alpha_liq") - field_dict["alpha_liq"] = alpha_liq - if not ("co2_liq" in field_dict) or field_dict["co2_liq"] is None: - co2_liq_file = os.path.join(caseFolder, timeFolder, "CO2.liquid") - co2_liq = readOFScal(co2_liq_file, nCells) - # print("computing co2 liq") - field_dict["co2_liq"] = co2_liq - if not ("volume" in field_dict) or field_dict["volume"] is None: - volume_file = os.path.join(caseFolder, "0", "V") - volume = readOFScal(volume_file, nCells) - # print("reading Volume") - field_dict["volume"] = volume - if not ("indliq" in field_dict) or field_dict["indliq"] is None: - alpha_liq = field_dict["alpha_liq"] - indliq = np.argwhere(alpha_liq > 0.5) - # print("computing indliq") - field_dict["indliq"] = indliq - volume = field_dict["volume"] - indliq = field_dict["indliq"] - alpha_liq = field_dict["alpha_liq"] - co2_liq = field_dict["co2_liq"] - met = np.sum( - alpha_liq[indliq] * co2_liq[indliq] * volume[indliq] - ) / np.sum(volume[indliq]) - return met, field_dict - - -def cliq(caseFolder, timeFolder, nCells, field_dict={}): - if not ("alpha_liq" in field_dict) or field_dict["alpha_liq"] is None: - alpha_liq_file = os.path.join(caseFolder, timeFolder, "alpha.liquid") - alpha_liq = readOFScal(alpha_liq_file, nCells) - # print("reading alpha_liq") - field_dict["alpha_liq"] = alpha_liq - if not ("rho_liq" in field_dict) or field_dict["rho_liq"] is None: - rho_liq_file = os.path.join(caseFolder, timeFolder, "rhom") - rho_liq = readOFScal(rho_liq_file, nCells) - field_dict["rho_liq"] = rho_liq - if not ("co2_liq" in field_dict) or field_dict["co2_liq"] is None: - co2_liq_file = os.path.join(caseFolder, timeFolder, "CO2.liquid") - co2_liq = readOFScal(co2_liq_file, nCells) - # print("computing co2 liq") - field_dict["co2_liq"] = co2_liq - if not ("h2_liq" in field_dict) or field_dict["h2_liq"] is None: - h2_liq_file = os.path.join(caseFolder, timeFolder, "H2.liquid") - h2_liq = readOFScal(h2_liq_file, nCells) - # print("computing h2 liq") - field_dict["h2_liq"] = h2_liq - if not ("volume" in field_dict) or field_dict["volume"] is None: - volume_file = os.path.join(caseFolder, "0", "V") - volume = readOFScal(volume_file, nCells) - # print("reading Volume") - field_dict["volume"] = volume - if not ("indliq" in field_dict) or field_dict["indliq"] is None: - alpha_liq = field_dict["alpha_liq"] - indliq = np.argwhere(alpha_liq > 0.5) - # print("computing indliq") - field_dict["indliq"] = indliq - - volume = field_dict["volume"] - indliq = field_dict["indliq"] - alpha_liq = field_dict["alpha_liq"] - co2_liq = field_dict["co2_liq"] - h2_liq = field_dict["h2_liq"] - rho_liq = field_dict["rho_liq"] - - # c_h2 = rho_liq[indliq] * alpha_liq[indliq] * h2_liq[indliq] / 0.002016 - # c_co2 = rho_liq[indliq] * alpha_liq[indliq] * co2_liq[indliq] / 0.04401 - - c_h2 = 1000 * alpha_liq[indliq] * h2_liq[indliq] / 0.002016 - c_co2 = 1000 * alpha_liq[indliq] * co2_liq[indliq] / 0.04401 - - c_h2 = np.sum(c_h2 * volume[indliq]) / np.sum(volume[indliq]) - c_co2 = np.sum(c_co2 * volume[indliq]) / np.sum(volume[indliq]) - - return c_co2, c_h2, field_dict - - -def h2liq(caseFolder, timeFolder, nCells, field_dict={}): - if not ("alpha_liq" in field_dict) or field_dict["alpha_liq"] is None: - alpha_liq_file = os.path.join(caseFolder, timeFolder, "alpha.liquid") - alpha_liq = readOFScal(alpha_liq_file, nCells) - # print("reading alpha_liq") - field_dict["alpha_liq"] = alpha_liq - if not ("h2_liq" in field_dict) or field_dict["h2_liq"] is None: - h2_liq_file = os.path.join(caseFolder, timeFolder, "H2.liquid") - h2_liq = readOFScal(h2_liq_file, nCells) - # print("computing h2 liq") - field_dict["h2_liq"] = h2_liq - if not ("volume" in field_dict) or field_dict["volume"] is None: - volume_file = os.path.join(caseFolder, "0", "V") - volume = readOFScal(volume_file, nCells) - # print("reading Volume") - field_dict["volume"] = volume - if not ("indliq" in field_dict) or field_dict["indliq"] is None: - alpha_liq = field_dict["alpha_liq"] - indliq = np.argwhere(alpha_liq > 0.5) - # print("computing indliq") - field_dict["indliq"] = indliq - volume = field_dict["volume"] - indliq = field_dict["indliq"] - alpha_liq = field_dict["alpha_liq"] - h2_liq = field_dict["h2_liq"] - met = np.sum(alpha_liq[indliq] * h2_liq[indliq] * volume[indliq]) / np.sum( - volume[indliq] - ) - return met, field_dict - - -def vol_liq(caseFolder, timeFolder, nCells, field_dict={}): - if not ("alpha_liq" in field_dict) or field_dict["alpha_liq"] is None: - alpha_liq_file = os.path.join(caseFolder, timeFolder, "alpha.liquid") - alpha_liq = readOFScal(alpha_liq_file, nCells) - # print("reading alpha_liq") - field_dict["alpha_liq"] = alpha_liq - if not ("volume" in field_dict) or field_dict["volume"] is None: - volume_file = os.path.join(caseFolder, "0", "V") - volume = readOFScal(volume_file, nCells) - # print("reading Volume") - field_dict["volume"] = volume - volume = field_dict["volume"] - alpha_liq = field_dict["alpha_liq"] - indliq = np.argwhere(alpha_liq > 0.0) - liqvol = np.sum(alpha_liq[indliq] * volume[indliq]) / np.sum( - volume[indliq] - ) - return liqvol, field_dict - - -parser = argparse.ArgumentParser(description="Convergence of GH") -parser.add_argument( - "-cn", - "--case_name", - type=str, - metavar="", - required=True, - help="Case name", -) -parser.add_argument( - "-df", - "--data_folder", - type=str, - metavar="", - required=False, - help="data folder name", - default="data", -) - -args, unknown = parser.parse_known_args() - - -case_root = "." # "../" -case_name = args.case_name # "12_hole_sparger_snappyRefine_700rpm_opt_coeff" -case_path = "." -dataFolder = args.data_folder - -if os.path.isfile(os.path.join(dataFolder, case_name, "conv.npz")): - sys.exit("WARNING: History already created, Skipping") - -time_float_sorted, time_str_sorted = getCaseTimes(case_path, remove_zero=True) -cellCentres = readMesh(os.path.join(case_path, f"meshCellCentres_0.obj")) -nCells = len(cellCentres) - - -co2_history = np.zeros(len(time_str_sorted)) -c_co2_history = np.zeros(len(time_str_sorted)) -h2_history = np.zeros(len(time_str_sorted)) -c_h2_history = np.zeros(len(time_str_sorted)) -gh_history = np.zeros(len(time_str_sorted)) -liqvol_history = np.zeros(len(time_str_sorted)) -print(f"case_path = {case_path}") -field_dict = {} -for itime, time in enumerate(time_float_sorted): - time_folder = time_str_sorted[itime] - print(f"\tTime : {time_folder}") - if not field_dict == {}: - new_field_dict = {} - if "volume" in field_dict: - new_field_dict["volume"] = field_dict["volume"] - field_dict = new_field_dict - gh_history[itime], field_dict = compute_gas_holdup( - case_path, time_str_sorted[itime], nCells, field_dict - ) - co2_history[itime], field_dict = co2liq( - case_path, time_str_sorted[itime], nCells, field_dict - ) - h2_history[itime], field_dict = h2liq( - case_path, time_str_sorted[itime], nCells, field_dict - ) - liqvol_history[itime], field_dict = vol_liq( - case_path, time_str_sorted[itime], nCells, field_dict - ) - c_co2_history[itime], c_h2_history[itime], field_dict = cliq( - case_path, time_str_sorted[itime], nCells, field_dict - ) - - -os.makedirs(dataFolder, exist_ok=True) -os.makedirs(os.path.join(dataFolder, case_name), exist_ok=True) -np.savez( - os.path.join(dataFolder, case_name, "conv.npz"), - time=np.array(time_float_sorted), - gh=gh_history, - co2=co2_history, - h2=h2_history, - vol_liq=liqvol_history, - c_h2=c_h2_history, - c_co2=c_co2_history, -) diff --git a/bird/preprocess/data_preprocess/loop_reactor_3_6L/run.sh b/bird/preprocess/data_preprocess/loop_reactor_3_6L/run.sh deleted file mode 100644 index 6b7eb516..00000000 --- a/bird/preprocess/data_preprocess/loop_reactor_3_6L/run.sh +++ /dev/null @@ -1,5 +0,0 @@ -multiphaseEulerFoam - - - - diff --git a/bird/preprocess/data_preprocess/loop_reactor_3_6L/script b/bird/preprocess/data_preprocess/loop_reactor_3_6L/script deleted file mode 100755 index 090e5c05..00000000 --- a/bird/preprocess/data_preprocess/loop_reactor_3_6L/script +++ /dev/null @@ -1,14 +0,0 @@ -#!/bin/bash -#SBATCH --qos=high -#SBATCH --job-name=val2 -##SBATCH --partition=debug -#SBATCH --nodes=1 -#SBATCH --ntasks-per-node=16 -#SBATCH --time=07:59:00 -#SBATCH --account=co2snow - -bash presteps.sh -source /projects/gas2fuels/ofoam_cray_mpich/OpenFOAM-dev/etc/bashrc -decomposePar -fileHandler collated -srun -n 16 multiphaseEulerFoam -parallel -fileHandler collated -reconstructPar -newTimes diff --git a/bird/preprocess/data_preprocess/loop_reactor_3_6L/script_post b/bird/preprocess/data_preprocess/loop_reactor_3_6L/script_post deleted file mode 100755 index aabbc33e..00000000 --- a/bird/preprocess/data_preprocess/loop_reactor_3_6L/script_post +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/bash -#SBATCH --qos=high -#SBATCH --job-name=val2 -##SBATCH --partition=debug -#SBATCH --nodes=1 -#SBATCH --ntasks-per-node=16 -#SBATCH --time=00:59:00 -#SBATCH --account=co2snow - -bash computeQOI.sh diff --git a/bird/preprocess/data_preprocess/loop_reactor_3_6L/system/blockMeshDict b/bird/preprocess/data_preprocess/loop_reactor_3_6L/system/blockMeshDict deleted file mode 100644 index 1183d262..00000000 --- a/bird/preprocess/data_preprocess/loop_reactor_3_6L/system/blockMeshDict +++ /dev/null @@ -1,746 +0,0 @@ -FoamFile -{ - version 2.0; - format ascii; - class dictionary; - object blockMeshDict; -} - -convertToMeters 1.0; - - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -vertices -( -( 0.0 0.0 0.0) -( 1.0 0.0 0.0) -( 2.0 0.0 0.0) -( 3.0 0.0 0.0) -( 4.0 0.0 0.0) -( 5.0 0.0 0.0) -( 6.0 0.0 0.0) -( 7.0 0.0 0.0) -( 8.0 0.0 0.0) -( 9.0 0.0 0.0) -( 10.0 0.0 0.0) -( 0.0 1.0 0.0) -( 1.0 1.0 0.0) -( 2.0 1.0 0.0) -( 3.0 1.0 0.0) -( 4.0 1.0 0.0) -( 5.0 1.0 0.0) -( 6.0 1.0 0.0) -( 7.0 1.0 0.0) -( 8.0 1.0 0.0) -( 9.0 1.0 0.0) -( 10.0 1.0 0.0) -( 0.0 2.0 0.0) -( 1.0 2.0 0.0) -( 2.0 2.0 0.0) -( 3.0 2.0 0.0) -( 4.0 2.0 0.0) -( 5.0 2.0 0.0) -( 6.0 2.0 0.0) -( 7.0 2.0 0.0) -( 8.0 2.0 0.0) -( 9.0 2.0 0.0) -( 10.0 2.0 0.0) -( 0.0 3.0 0.0) -( 1.0 3.0 0.0) -( 2.0 3.0 0.0) -( 3.0 3.0 0.0) -( 4.0 3.0 0.0) -( 5.0 3.0 0.0) -( 6.0 3.0 0.0) -( 7.0 3.0 0.0) -( 8.0 3.0 0.0) -( 9.0 3.0 0.0) -( 10.0 3.0 0.0) -( 0.0 4.0 0.0) -( 1.0 4.0 0.0) -( 2.0 4.0 0.0) -( 3.0 4.0 0.0) -( 4.0 4.0 0.0) -( 5.0 4.0 0.0) -( 6.0 4.0 0.0) -( 7.0 4.0 0.0) -( 8.0 4.0 0.0) -( 9.0 4.0 0.0) -( 10.0 4.0 0.0) -( 0.0 5.0 0.0) -( 1.0 5.0 0.0) -( 2.0 5.0 0.0) -( 3.0 5.0 0.0) -( 4.0 5.0 0.0) -( 5.0 5.0 0.0) -( 6.0 5.0 0.0) -( 7.0 5.0 0.0) -( 8.0 5.0 0.0) -( 9.0 5.0 0.0) -( 10.0 5.0 0.0) -( 0.0 6.0 0.0) -( 1.0 6.0 0.0) -( 2.0 6.0 0.0) -( 3.0 6.0 0.0) -( 4.0 6.0 0.0) -( 5.0 6.0 0.0) -( 6.0 6.0 0.0) -( 7.0 6.0 0.0) -( 8.0 6.0 0.0) -( 9.0 6.0 0.0) -( 10.0 6.0 0.0) -( 0.0 7.0 0.0) -( 1.0 7.0 0.0) -( 2.0 7.0 0.0) -( 3.0 7.0 0.0) -( 4.0 7.0 0.0) -( 5.0 7.0 0.0) -( 6.0 7.0 0.0) -( 7.0 7.0 0.0) -( 8.0 7.0 0.0) -( 9.0 7.0 0.0) -( 10.0 7.0 0.0) -( 0.0 0.0 1.0) -( 1.0 0.0 1.0) -( 2.0 0.0 1.0) -( 3.0 0.0 1.0) -( 4.0 0.0 1.0) -( 5.0 0.0 1.0) -( 6.0 0.0 1.0) -( 7.0 0.0 1.0) -( 8.0 0.0 1.0) -( 9.0 0.0 1.0) -( 10.0 0.0 1.0) -( 0.0 1.0 1.0) -( 1.0 1.0 1.0) -( 2.0 1.0 1.0) -( 3.0 1.0 1.0) -( 4.0 1.0 1.0) -( 5.0 1.0 1.0) -( 6.0 1.0 1.0) -( 7.0 1.0 1.0) -( 8.0 1.0 1.0) -( 9.0 1.0 1.0) -( 10.0 1.0 1.0) -( 0.0 2.0 1.0) -( 1.0 2.0 1.0) -( 2.0 2.0 1.0) -( 3.0 2.0 1.0) -( 4.0 2.0 1.0) -( 5.0 2.0 1.0) -( 6.0 2.0 1.0) -( 7.0 2.0 1.0) -( 8.0 2.0 1.0) -( 9.0 2.0 1.0) -( 10.0 2.0 1.0) -( 0.0 3.0 1.0) -( 1.0 3.0 1.0) -( 2.0 3.0 1.0) -( 3.0 3.0 1.0) -( 4.0 3.0 1.0) -( 5.0 3.0 1.0) -( 6.0 3.0 1.0) -( 7.0 3.0 1.0) -( 8.0 3.0 1.0) -( 9.0 3.0 1.0) -( 10.0 3.0 1.0) -( 0.0 4.0 1.0) -( 1.0 4.0 1.0) -( 2.0 4.0 1.0) -( 3.0 4.0 1.0) -( 4.0 4.0 1.0) -( 5.0 4.0 1.0) -( 6.0 4.0 1.0) -( 7.0 4.0 1.0) -( 8.0 4.0 1.0) -( 9.0 4.0 1.0) -( 10.0 4.0 1.0) -( 0.0 5.0 1.0) -( 1.0 5.0 1.0) -( 2.0 5.0 1.0) -( 3.0 5.0 1.0) -( 4.0 5.0 1.0) -( 5.0 5.0 1.0) -( 6.0 5.0 1.0) -( 7.0 5.0 1.0) -( 8.0 5.0 1.0) -( 9.0 5.0 1.0) -( 10.0 5.0 1.0) -( 0.0 6.0 1.0) -( 1.0 6.0 1.0) -( 2.0 6.0 1.0) -( 3.0 6.0 1.0) -( 4.0 6.0 1.0) -( 5.0 6.0 1.0) -( 6.0 6.0 1.0) -( 7.0 6.0 1.0) -( 8.0 6.0 1.0) -( 9.0 6.0 1.0) -( 10.0 6.0 1.0) -( 0.0 7.0 1.0) -( 1.0 7.0 1.0) -( 2.0 7.0 1.0) -( 3.0 7.0 1.0) -( 4.0 7.0 1.0) -( 5.0 7.0 1.0) -( 6.0 7.0 1.0) -( 7.0 7.0 1.0) -( 8.0 7.0 1.0) -( 9.0 7.0 1.0) -( 10.0 7.0 1.0) -( 0.0 0.0 2.0) -( 1.0 0.0 2.0) -( 2.0 0.0 2.0) -( 3.0 0.0 2.0) -( 4.0 0.0 2.0) -( 5.0 0.0 2.0) -( 6.0 0.0 2.0) -( 7.0 0.0 2.0) -( 8.0 0.0 2.0) -( 9.0 0.0 2.0) -( 10.0 0.0 2.0) -( 0.0 1.0 2.0) -( 1.0 1.0 2.0) -( 2.0 1.0 2.0) -( 3.0 1.0 2.0) -( 4.0 1.0 2.0) -( 5.0 1.0 2.0) -( 6.0 1.0 2.0) -( 7.0 1.0 2.0) -( 8.0 1.0 2.0) -( 9.0 1.0 2.0) -( 10.0 1.0 2.0) -( 0.0 2.0 2.0) -( 1.0 2.0 2.0) -( 2.0 2.0 2.0) -( 3.0 2.0 2.0) -( 4.0 2.0 2.0) -( 5.0 2.0 2.0) -( 6.0 2.0 2.0) -( 7.0 2.0 2.0) -( 8.0 2.0 2.0) -( 9.0 2.0 2.0) -( 10.0 2.0 2.0) -( 0.0 3.0 2.0) -( 1.0 3.0 2.0) -( 2.0 3.0 2.0) -( 3.0 3.0 2.0) -( 4.0 3.0 2.0) -( 5.0 3.0 2.0) -( 6.0 3.0 2.0) -( 7.0 3.0 2.0) -( 8.0 3.0 2.0) -( 9.0 3.0 2.0) -( 10.0 3.0 2.0) -( 0.0 4.0 2.0) -( 1.0 4.0 2.0) -( 2.0 4.0 2.0) -( 3.0 4.0 2.0) -( 4.0 4.0 2.0) -( 5.0 4.0 2.0) -( 6.0 4.0 2.0) -( 7.0 4.0 2.0) -( 8.0 4.0 2.0) -( 9.0 4.0 2.0) -( 10.0 4.0 2.0) -( 0.0 5.0 2.0) -( 1.0 5.0 2.0) -( 2.0 5.0 2.0) -( 3.0 5.0 2.0) -( 4.0 5.0 2.0) -( 5.0 5.0 2.0) -( 6.0 5.0 2.0) -( 7.0 5.0 2.0) -( 8.0 5.0 2.0) -( 9.0 5.0 2.0) -( 10.0 5.0 2.0) -( 0.0 6.0 2.0) -( 1.0 6.0 2.0) -( 2.0 6.0 2.0) -( 3.0 6.0 2.0) -( 4.0 6.0 2.0) -( 5.0 6.0 2.0) -( 6.0 6.0 2.0) -( 7.0 6.0 2.0) -( 8.0 6.0 2.0) -( 9.0 6.0 2.0) -( 10.0 6.0 2.0) -( 0.0 7.0 2.0) -( 1.0 7.0 2.0) -( 2.0 7.0 2.0) -( 3.0 7.0 2.0) -( 4.0 7.0 2.0) -( 5.0 7.0 2.0) -( 6.0 7.0 2.0) -( 7.0 7.0 2.0) -( 8.0 7.0 2.0) -( 9.0 7.0 2.0) -( 10.0 7.0 2.0) -( 0.0 0.0 3.0) -( 1.0 0.0 3.0) -( 2.0 0.0 3.0) -( 3.0 0.0 3.0) -( 4.0 0.0 3.0) -( 5.0 0.0 3.0) -( 6.0 0.0 3.0) -( 7.0 0.0 3.0) -( 8.0 0.0 3.0) -( 9.0 0.0 3.0) -( 10.0 0.0 3.0) -( 0.0 1.0 3.0) -( 1.0 1.0 3.0) -( 2.0 1.0 3.0) -( 3.0 1.0 3.0) -( 4.0 1.0 3.0) -( 5.0 1.0 3.0) -( 6.0 1.0 3.0) -( 7.0 1.0 3.0) -( 8.0 1.0 3.0) -( 9.0 1.0 3.0) -( 10.0 1.0 3.0) -( 0.0 2.0 3.0) -( 1.0 2.0 3.0) -( 2.0 2.0 3.0) -( 3.0 2.0 3.0) -( 4.0 2.0 3.0) -( 5.0 2.0 3.0) -( 6.0 2.0 3.0) -( 7.0 2.0 3.0) -( 8.0 2.0 3.0) -( 9.0 2.0 3.0) -( 10.0 2.0 3.0) -( 0.0 3.0 3.0) -( 1.0 3.0 3.0) -( 2.0 3.0 3.0) -( 3.0 3.0 3.0) -( 4.0 3.0 3.0) -( 5.0 3.0 3.0) -( 6.0 3.0 3.0) -( 7.0 3.0 3.0) -( 8.0 3.0 3.0) -( 9.0 3.0 3.0) -( 10.0 3.0 3.0) -( 0.0 4.0 3.0) -( 1.0 4.0 3.0) -( 2.0 4.0 3.0) -( 3.0 4.0 3.0) -( 4.0 4.0 3.0) -( 5.0 4.0 3.0) -( 6.0 4.0 3.0) -( 7.0 4.0 3.0) -( 8.0 4.0 3.0) -( 9.0 4.0 3.0) -( 10.0 4.0 3.0) -( 0.0 5.0 3.0) -( 1.0 5.0 3.0) -( 2.0 5.0 3.0) -( 3.0 5.0 3.0) -( 4.0 5.0 3.0) -( 5.0 5.0 3.0) -( 6.0 5.0 3.0) -( 7.0 5.0 3.0) -( 8.0 5.0 3.0) -( 9.0 5.0 3.0) -( 10.0 5.0 3.0) -( 0.0 6.0 3.0) -( 1.0 6.0 3.0) -( 2.0 6.0 3.0) -( 3.0 6.0 3.0) -( 4.0 6.0 3.0) -( 5.0 6.0 3.0) -( 6.0 6.0 3.0) -( 7.0 6.0 3.0) -( 8.0 6.0 3.0) -( 9.0 6.0 3.0) -( 10.0 6.0 3.0) -( 0.0 7.0 3.0) -( 1.0 7.0 3.0) -( 2.0 7.0 3.0) -( 3.0 7.0 3.0) -( 4.0 7.0 3.0) -( 5.0 7.0 3.0) -( 6.0 7.0 3.0) -( 7.0 7.0 3.0) -( 8.0 7.0 3.0) -( 9.0 7.0 3.0) -( 10.0 7.0 3.0) -( 0.0 0.0 4.0) -( 1.0 0.0 4.0) -( 2.0 0.0 4.0) -( 3.0 0.0 4.0) -( 4.0 0.0 4.0) -( 5.0 0.0 4.0) -( 6.0 0.0 4.0) -( 7.0 0.0 4.0) -( 8.0 0.0 4.0) -( 9.0 0.0 4.0) -( 10.0 0.0 4.0) -( 0.0 1.0 4.0) -( 1.0 1.0 4.0) -( 2.0 1.0 4.0) -( 3.0 1.0 4.0) -( 4.0 1.0 4.0) -( 5.0 1.0 4.0) -( 6.0 1.0 4.0) -( 7.0 1.0 4.0) -( 8.0 1.0 4.0) -( 9.0 1.0 4.0) -( 10.0 1.0 4.0) -( 0.0 2.0 4.0) -( 1.0 2.0 4.0) -( 2.0 2.0 4.0) -( 3.0 2.0 4.0) -( 4.0 2.0 4.0) -( 5.0 2.0 4.0) -( 6.0 2.0 4.0) -( 7.0 2.0 4.0) -( 8.0 2.0 4.0) -( 9.0 2.0 4.0) -( 10.0 2.0 4.0) -( 0.0 3.0 4.0) -( 1.0 3.0 4.0) -( 2.0 3.0 4.0) -( 3.0 3.0 4.0) -( 4.0 3.0 4.0) -( 5.0 3.0 4.0) -( 6.0 3.0 4.0) -( 7.0 3.0 4.0) -( 8.0 3.0 4.0) -( 9.0 3.0 4.0) -( 10.0 3.0 4.0) -( 0.0 4.0 4.0) -( 1.0 4.0 4.0) -( 2.0 4.0 4.0) -( 3.0 4.0 4.0) -( 4.0 4.0 4.0) -( 5.0 4.0 4.0) -( 6.0 4.0 4.0) -( 7.0 4.0 4.0) -( 8.0 4.0 4.0) -( 9.0 4.0 4.0) -( 10.0 4.0 4.0) -( 0.0 5.0 4.0) -( 1.0 5.0 4.0) -( 2.0 5.0 4.0) -( 3.0 5.0 4.0) -( 4.0 5.0 4.0) -( 5.0 5.0 4.0) -( 6.0 5.0 4.0) -( 7.0 5.0 4.0) -( 8.0 5.0 4.0) -( 9.0 5.0 4.0) -( 10.0 5.0 4.0) -( 0.0 6.0 4.0) -( 1.0 6.0 4.0) -( 2.0 6.0 4.0) -( 3.0 6.0 4.0) -( 4.0 6.0 4.0) -( 5.0 6.0 4.0) -( 6.0 6.0 4.0) -( 7.0 6.0 4.0) -( 8.0 6.0 4.0) -( 9.0 6.0 4.0) -( 10.0 6.0 4.0) -( 0.0 7.0 4.0) -( 1.0 7.0 4.0) -( 2.0 7.0 4.0) -( 3.0 7.0 4.0) -( 4.0 7.0 4.0) -( 5.0 7.0 4.0) -( 6.0 7.0 4.0) -( 7.0 7.0 4.0) -( 8.0 7.0 4.0) -( 9.0 7.0 4.0) -( 10.0 7.0 4.0) -( 0.0 0.0 5.0) -( 1.0 0.0 5.0) -( 2.0 0.0 5.0) -( 3.0 0.0 5.0) -( 4.0 0.0 5.0) -( 5.0 0.0 5.0) -( 6.0 0.0 5.0) -( 7.0 0.0 5.0) -( 8.0 0.0 5.0) -( 9.0 0.0 5.0) -( 10.0 0.0 5.0) -( 0.0 1.0 5.0) -( 1.0 1.0 5.0) -( 2.0 1.0 5.0) -( 3.0 1.0 5.0) -( 4.0 1.0 5.0) -( 5.0 1.0 5.0) -( 6.0 1.0 5.0) -( 7.0 1.0 5.0) -( 8.0 1.0 5.0) -( 9.0 1.0 5.0) -( 10.0 1.0 5.0) -( 0.0 2.0 5.0) -( 1.0 2.0 5.0) -( 2.0 2.0 5.0) -( 3.0 2.0 5.0) -( 4.0 2.0 5.0) -( 5.0 2.0 5.0) -( 6.0 2.0 5.0) -( 7.0 2.0 5.0) -( 8.0 2.0 5.0) -( 9.0 2.0 5.0) -( 10.0 2.0 5.0) -( 0.0 3.0 5.0) -( 1.0 3.0 5.0) -( 2.0 3.0 5.0) -( 3.0 3.0 5.0) -( 4.0 3.0 5.0) -( 5.0 3.0 5.0) -( 6.0 3.0 5.0) -( 7.0 3.0 5.0) -( 8.0 3.0 5.0) -( 9.0 3.0 5.0) -( 10.0 3.0 5.0) -( 0.0 4.0 5.0) -( 1.0 4.0 5.0) -( 2.0 4.0 5.0) -( 3.0 4.0 5.0) -( 4.0 4.0 5.0) -( 5.0 4.0 5.0) -( 6.0 4.0 5.0) -( 7.0 4.0 5.0) -( 8.0 4.0 5.0) -( 9.0 4.0 5.0) -( 10.0 4.0 5.0) -( 0.0 5.0 5.0) -( 1.0 5.0 5.0) -( 2.0 5.0 5.0) -( 3.0 5.0 5.0) -( 4.0 5.0 5.0) -( 5.0 5.0 5.0) -( 6.0 5.0 5.0) -( 7.0 5.0 5.0) -( 8.0 5.0 5.0) -( 9.0 5.0 5.0) -( 10.0 5.0 5.0) -( 0.0 6.0 5.0) -( 1.0 6.0 5.0) -( 2.0 6.0 5.0) -( 3.0 6.0 5.0) -( 4.0 6.0 5.0) -( 5.0 6.0 5.0) -( 6.0 6.0 5.0) -( 7.0 6.0 5.0) -( 8.0 6.0 5.0) -( 9.0 6.0 5.0) -( 10.0 6.0 5.0) -( 0.0 7.0 5.0) -( 1.0 7.0 5.0) -( 2.0 7.0 5.0) -( 3.0 7.0 5.0) -( 4.0 7.0 5.0) -( 5.0 7.0 5.0) -( 6.0 7.0 5.0) -( 7.0 7.0 5.0) -( 8.0 7.0 5.0) -( 9.0 7.0 5.0) -( 10.0 7.0 5.0) -); - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -blocks -( - - //block 0 -hex (0 1 12 11 88 89 100 99 ) -( 10 10 10 ) -SimpleGrading (1 1 1) - - //block 1 -hex (1 2 13 12 89 90 101 100 ) -( 10 10 10 ) -SimpleGrading (1 1 1) - - //block 2 -hex (2 3 14 13 90 91 102 101 ) -( 10 10 10 ) -SimpleGrading (1 1 1) - - //block 3 -hex (3 4 15 14 91 92 103 102 ) -( 10 10 10 ) -SimpleGrading (1 1 1) - - //block 4 -hex (4 5 16 15 92 93 104 103 ) -( 10 10 10 ) -SimpleGrading (1 1 1) - - //block 5 -hex (5 6 17 16 93 94 105 104 ) -( 10 10 10 ) -SimpleGrading (1 1 1) - - //block 6 -hex (6 7 18 17 94 95 106 105 ) -( 10 10 10 ) -SimpleGrading (1 1 1) - - //block 7 -hex (7 8 19 18 95 96 107 106 ) -( 10 10 10 ) -SimpleGrading (1 1 1) - - //block 8 -hex (8 9 20 19 96 97 108 107 ) -( 10 10 10 ) -SimpleGrading (1 1 1) - - //block 9 -hex (9 10 21 20 97 98 109 108 ) -( 10 10 10 ) -SimpleGrading (1 1 1) - - //block 10 -hex (97 98 109 108 185 186 197 196 ) -( 10 10 10 ) -SimpleGrading (1 1 1) - - //block 11 -hex (185 186 197 196 273 274 285 284 ) -( 10 10 10 ) -SimpleGrading (1 1 1) - - //block 12 -hex (273 274 285 284 361 362 373 372 ) -( 10 10 10 ) -SimpleGrading (1 1 1) - - //block 13 -hex (361 362 373 372 449 450 461 460 ) -( 10 10 10 ) -SimpleGrading (1 1 1) - - //block 14 -hex (360 361 372 371 448 449 460 459 ) -( 10 10 10 ) -SimpleGrading (1 1 1) - - //block 15 -hex (359 360 371 370 447 448 459 458 ) -( 10 10 10 ) -SimpleGrading (1 1 1) - - //block 16 -hex (358 359 370 369 446 447 458 457 ) -( 10 10 10 ) -SimpleGrading (1 1 1) - - //block 17 -hex (357 358 369 368 445 446 457 456 ) -( 10 10 10 ) -SimpleGrading (1 1 1) - - //block 18 -hex (356 357 368 367 444 445 456 455 ) -( 10 10 10 ) -SimpleGrading (1 1 1) - - //block 19 -hex (355 356 367 366 443 444 455 454 ) -( 10 10 10 ) -SimpleGrading (1 1 1) - - //block 20 -hex (354 355 366 365 442 443 454 453 ) -( 10 10 10 ) -SimpleGrading (1 1 1) - - //block 21 -hex (353 354 365 364 441 442 453 452 ) -( 10 10 10 ) -SimpleGrading (1 1 1) - - //block 22 -hex (352 353 364 363 440 441 452 451 ) -( 10 10 10 ) -SimpleGrading (1 1 1) - - //block 23 -hex (363 364 375 374 451 452 463 462 ) -( 10 10 10 ) -SimpleGrading (1 1 1) - - //block 24 -hex (374 375 386 385 462 463 474 473 ) -( 10 10 10 ) -SimpleGrading (1 1 1) - - //block 25 -hex (385 386 397 396 473 474 485 484 ) -( 10 10 10 ) -SimpleGrading (1 1 1) - - //block 26 -hex (396 397 408 407 484 485 496 495 ) -( 10 10 10 ) -SimpleGrading (1 1 1) - - //block 27 -hex (407 408 419 418 495 496 507 506 ) -( 10 10 10 ) -SimpleGrading (1 1 1) - - //block 28 -hex (418 419 430 429 506 507 518 517 ) -( 10 10 10 ) -SimpleGrading (1 1 1) - - //block 29 -hex (308 309 320 319 396 397 408 407 ) -( 10 10 10 ) -SimpleGrading (1 1 1) - - //block 30 -hex (220 221 232 231 308 309 320 319 ) -( 10 10 10 ) -SimpleGrading (1 1 1) - - //block 31 -hex (132 133 144 143 220 221 232 231 ) -( 10 10 10 ) -SimpleGrading (1 1 1) - - //block 32 -hex (44 45 56 55 132 133 144 143 ) -( 10 10 10 ) -SimpleGrading (1 1 1) - - //block 33 -hex (55 56 67 66 143 144 155 154 ) -( 10 10 10 ) -SimpleGrading (1 1 1) - - //block 34 -hex (66 67 78 77 154 155 166 165 ) -( 10 10 10 ) -SimpleGrading (1 1 1) - - //block 35 -hex (33 34 45 44 121 122 133 132 ) -( 10 10 10 ) -SimpleGrading (1 1 1) - - //block 36 -hex (22 23 34 33 110 111 122 121 ) -( 10 10 10 ) -SimpleGrading (1 1 1) - - //block 37 -hex (11 12 23 22 99 100 111 110 ) -( 10 10 10 ) -SimpleGrading (1 1 1) -); - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -defaultPatch -{ type wall;} - -patches -( -); diff --git a/bird/preprocess/data_preprocess/loop_reactor_3_6L/system/controlDict b/bird/preprocess/data_preprocess/loop_reactor_3_6L/system/controlDict deleted file mode 100644 index 7374023a..00000000 --- a/bird/preprocess/data_preprocess/loop_reactor_3_6L/system/controlDict +++ /dev/null @@ -1,67 +0,0 @@ -/*--------------------------------*- C++ -*----------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | Website: https://openfoam.org - \\ / A nd | Version: dev - \\/ M anipulation | -\*---------------------------------------------------------------------------*/ -FoamFile -{ - format ascii; - class dictionary; - location "system"; - object controlDict; -} -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -application multiphaseEulerFoam; - -startFrom latestTime;//startTime; - -startTime 0; - -stopAt endTime; - -endTime 100; - -deltaT 0.0001; - -writeControl adjustableRunTime; - -writeInterval 2; - -purgeWrite 0; - -writeFormat ascii; - -writePrecision 6; - -writeCompression off; - -timeFormat general; - -timePrecision 6; - -runTimeModifiable yes; - -adjustTimeStep yes; - -maxCo 0.5; - -maxDeltaT 0.0005; - - -functions -{ - - #includeFunc writeObjects(d.gas) - #includeFunc writeObjects(thermo:rho.gas) - #includeFunc writeObjects(thermo:rho.liquid) -} -//functions -//{ -// #includeFunc fieldAverage(U.air, U.water, alpha.air, p) -//} - - -// ************************************************************************* // diff --git a/bird/preprocess/data_preprocess/loop_reactor_3_6L/system/decomposeParDict b/bird/preprocess/data_preprocess/loop_reactor_3_6L/system/decomposeParDict deleted file mode 100755 index f8397e73..00000000 --- a/bird/preprocess/data_preprocess/loop_reactor_3_6L/system/decomposeParDict +++ /dev/null @@ -1,30 +0,0 @@ -/*--------------------------------*- C++ -*----------------------------------*\ -| ========= | | -| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | -| \\ / O peration | Version: 3.0.x | -| \\ / A nd | Web: www.OpenFOAM.org | -| \\/ M anipulation | | -\*---------------------------------------------------------------------------*/ -FoamFile -{ - version 2.0; - format ascii; - class dictionary; - object decomposeParDict; -} - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -numberOfSubdomains 16; - -method scotch; - -hierarchicalCoeffs -{ - n (4 4 1); - delta 0.001; - order xyz; -} - - -// ************************************************************************* // diff --git a/bird/preprocess/data_preprocess/loop_reactor_3_6L/system/fvConstraints b/bird/preprocess/data_preprocess/loop_reactor_3_6L/system/fvConstraints deleted file mode 100644 index 334f1c8f..00000000 --- a/bird/preprocess/data_preprocess/loop_reactor_3_6L/system/fvConstraints +++ /dev/null @@ -1,56 +0,0 @@ -/*--------------------------------*- C++ -*----------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | Website: https://openfoam.org - \\ / A nd | Version: dev - \\/ M anipulation | -\*---------------------------------------------------------------------------*/ -FoamFile -{ - format ascii; - class dictionary; - object fvConstraints; -} -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -limitp -{ - type limitPressure; - - min 1e4; -} -limitUliq -{ - type limitVelocity; - active yes; - U U.liquid; - selectionMode all; - max 1e1; -} -limitUgas -{ - type limitVelocity; - active yes; - U U.gas; - selectionMode all; - max 2e1; -} -limitTgas -{ - type limitTemperature; - selectionMode all; - min 290; - max 310; - phase gas; -} -limitTliq -{ - type limitTemperature; - selectionMode all; - min 290; - max 310; - phase liquid; -} - - -// ************************************************************************* // diff --git a/bird/preprocess/data_preprocess/loop_reactor_3_6L/system/fvSchemes b/bird/preprocess/data_preprocess/loop_reactor_3_6L/system/fvSchemes deleted file mode 100644 index 52e6e13a..00000000 --- a/bird/preprocess/data_preprocess/loop_reactor_3_6L/system/fvSchemes +++ /dev/null @@ -1,70 +0,0 @@ -/*--------------------------------*- C++ -*----------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | Website: https://openfoam.org - \\ / A nd | Version: dev - \\/ M anipulation | -\*---------------------------------------------------------------------------*/ -FoamFile -{ - format ascii; - class dictionary; - location "system"; - object fvSchemes; -} -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -ddtSchemes -{ - default Euler; -} - -gradSchemes -{ - default Gauss linear; - limited cellLimited Gauss linear 1; -} - -divSchemes -{ - default none; - - "div\(phi,alpha.*\)" Gauss vanLeer; - - "div\(phir,alpha.*,alpha.*\)" Gauss vanLeer; - - "div\(alphaRhoPhi.*,U.*\)" Gauss limitedLinearV 1; - "div\(phi.*,U.*\)" Gauss limitedLinearV 1; - "div\(alphaRhoPhi.*,Yi\)" Gauss limitedLinear 1; - "div\(alphaRhoPhi.*,(h|e).*\)" Gauss limitedLinear 1; - "div\(alphaRhoPhi.*,(K|k|epsilon|omega).*\)" Gauss limitedLinear 1; - "div\(alphaPhi.*,f.*\)" Gauss limitedLinear 1; - "div\(alphaRhoPhi.*,\(p\|thermo:rho.*\)\)" Gauss limitedLinear 1; - - "div\(phim,(k|epsilon)m\)" Gauss upwind; - "div\(\(\(\(alpha.*\*thermo:rho.*\)*nuEff.*\)*dev2\(T\(grad\(U.*\)\)\)\)\)" Gauss linear; -} - -laplacianSchemes -{ - default Gauss linear corrected; -} - -interpolationSchemes -{ - default linear; -} - -snGradSchemes -{ - default uncorrected; -} - -wallDist -{ - method Poisson; - nRequired true; -} - - -// ************************************************************************* // diff --git a/bird/preprocess/data_preprocess/loop_reactor_3_6L/system/fvSolution b/bird/preprocess/data_preprocess/loop_reactor_3_6L/system/fvSolution deleted file mode 100644 index 2e69fdfa..00000000 --- a/bird/preprocess/data_preprocess/loop_reactor_3_6L/system/fvSolution +++ /dev/null @@ -1,120 +0,0 @@ -/*--------------------------------*- C++ -*----------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | Website: https://openfoam.org - \\ / A nd | Version: dev - \\/ M anipulation | -\*---------------------------------------------------------------------------*/ -FoamFile -{ - format ascii; - class dictionary; - location "system"; - object fvSolution; -} -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -solvers -{ - "alpha.*" - { - nAlphaCorr 2; - nAlphaSubCycles 5; - } - - bubbles - { - nCorr 1; - tolerance 1e-4; - scale true; - solveOnFinalIterOnly true; - sourceUpdateInterval 1; - } - - p_rgh - { - solver GAMG; - smoother DIC; - tolerance 1e-7; - relTol 0; - } - - p_rghFinal - { - $p_rgh; - relTol 0; - } - - "(k|omega).*" - { - solver smoothSolver; - smoother symGaussSeidel; - tolerance 1e-7; - relTol 0; - minIter 1; - } - - "(e|h).*" - { - solver smoothSolver; - smoother symGaussSeidel; - tolerance 1e-8; - relTol 0; - minIter 0; - maxIter 3; - } - - "f.*" - { - solver PBiCGStab; - preconditioner DILU; - tolerance 1e-6; - relTol 0; - } - - "Yi.*" - { - solver PBiCGStab; - preconditioner DILU; - tolerance 1e-12; - relTol 0; - residualAlpha 1e-8; - } - - "U.*" - { - solver smoothSolver; - smoother symGaussSeidel; - tolerance 1e-5; - relTol 0; - minIter 1; - } - - yPsi - { - solver PCG; - preconditioner DIC; - tolerance 1e-10; - relTol 0; - } - -} - -PIMPLE -{ - nOuterCorrectors 3; - nCorrectors 1; - nNonOrthogonalCorrectors 0; - -} - -relaxationFactors -{ - equations - { - ".*" 1; - } -} - - -// ************************************************************************* // diff --git a/bird/preprocess/data_preprocess/loop_reactor_3_6L/system/inlets_outlets.json b/bird/preprocess/data_preprocess/loop_reactor_3_6L/system/inlets_outlets.json deleted file mode 100644 index 2b53da73..00000000 --- a/bird/preprocess/data_preprocess/loop_reactor_3_6L/system/inlets_outlets.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "Geometry": { - "OverallDomain": { - "x" : {"nblocks": 10, "size_per_block": 1.0}, - "y" : {"nblocks": 11, "size_per_block": 1.0}, - "z" : {"nblocks": 5, "size_per_block": 1.0} - }, - "Fluids": [ - [ [0,0,0], [9,0,0] ], - [ [9,0,0], [9,0,4] ], - [ [9,0,4], [0,0,4] ], - [ [0,1,4], [0,4,4] ], - [ [0,4,4], [0,10,4] ], - [ [0,4,4], [0,4,0] ], - [ [0,4,0], [0,10,0] ], - [ [0,4,0], [0,1,0] ] - ] - }, - "inlets": [ - {"branch_id": 0, "type": "circle", "frac_space": 0.2222222222222222, "normal_dir": 1, "radius": 0.4, "nelements": 50, "block_pos": "bottom"}, - {"branch_id": 0, "type": "circle", "frac_space": 0.5, "radius": 0.4, "normal_dir": 1,"nelements": 50, "block_pos": "bottom"}, - {"branch_id": 0, "type": "circle", "frac_space": 0.7777777777777778, "radius": 0.4, "normal_dir": 1,"nelements": 50, "block_pos": "bottom"} - ], - "outlets": [ - {"branch_id": 6, "type": "circle", "frac_space": 1, "normal_dir": 1, "radius": 0.4, "nelements": 50, "block_pos": "top"}, - {"branch_id": 4, "type": "circle", "frac_space": 1, "normal_dir": 1, "radius": 0.4, "nelements": 50, "block_pos": "top"} - ] -} diff --git a/bird/preprocess/data_preprocess/loop_reactor_3_6L/system/mesh.json b/bird/preprocess/data_preprocess/loop_reactor_3_6L/system/mesh.json deleted file mode 100644 index 29841d7e..00000000 --- a/bird/preprocess/data_preprocess/loop_reactor_3_6L/system/mesh.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "Meshing": { - "Blockwise": { - "x" : 10, - "y" : 10, - "z" : 10 - } - }, - "Geometry": { - "OverallDomain": { - "x" : {"nblocks": 10, "size_per_block": 1.0}, - "y" : {"nblocks": 11, "size_per_block": 1.0}, - "z" : {"nblocks": 5, "size_per_block": 1.0} - }, - "Fluids": [ - [ [0,0,0], [9,0,0] ], - [ [9,0,0], [9,0,4] ], - [ [9,0,4], [0,0,4] ], - [ [0,1,4], [0,4,4] ], - [ [0,4,4], [0,10,4] ], - [ [0,4,4], [0,4,0] ], - [ [0,4,0], [0,10,0] ], - [ [0,4,0], [0,1,0] ] - ] - } -} diff --git a/bird/preprocess/data_preprocess/loop_reactor_3_6L/system/mixers.json b/bird/preprocess/data_preprocess/loop_reactor_3_6L/system/mixers.json deleted file mode 100644 index 10fdbd99..00000000 --- a/bird/preprocess/data_preprocess/loop_reactor_3_6L/system/mixers.json +++ /dev/null @@ -1,29 +0,0 @@ -{ - "Meshing": { - "Blockwise": { - "x" : 10, - "y" : 10, - "z" : 10 - } - }, - "Geometry": { - "OverallDomain": { - "x" : {"nblocks": 10, "size_per_block": 1.0, "rescale": 0.05}, - "y" : {"nblocks": 11, "size_per_block": 1.0, "rescale": 0.05}, - "z" : {"nblocks": 5, "size_per_block": 1.0, "rescale": 0.05} - }, - "Fluids": [ - [ [0,0,0], [9,0,0] ], - [ [9,0,0], [9,0,4] ], - [ [9,0,4], [0,0,4] ], - [ [0,1,4], [0,4,4] ], - [ [0,4,4], [0,10,4] ], - [ [0,4,4], [0,4,0] ], - [ [0,4,0], [0,10,0] ], - [ [0,4,0], [0,1,0] ] - ] - }, - "mixers": [ - {"branch_id": 2, "frac_space": 0.5, "start_time": 1, "power": 1, "sign": "+"} - ] -} diff --git a/bird/preprocess/data_preprocess/loop_reactor_3_6L/system/setFieldsDict b/bird/preprocess/data_preprocess/loop_reactor_3_6L/system/setFieldsDict deleted file mode 100644 index 7faaeb15..00000000 --- a/bird/preprocess/data_preprocess/loop_reactor_3_6L/system/setFieldsDict +++ /dev/null @@ -1,37 +0,0 @@ -/*--------------------------------*- C++ -*----------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | Website: https://openfoam.org - \\ / A nd | Version: dev - \\/ M anipulation | -\*---------------------------------------------------------------------------*/ -FoamFile -{ - format ascii; - class dictionary; - location "system"; - object setFieldsDict; -} -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -defaultFieldValues -( - volScalarFieldValue alpha.gas 0.99 - volScalarFieldValue alpha.liquid 0.01 -); - -regions -( - boxToCell - { - box (-1.0 -1.0 -1.0) (10 0.2 10.0); - fieldValues - ( - volScalarFieldValue alpha.gas 0.01 - volScalarFieldValue alpha.liquid 0.99 - ); - } -); - - -// ************************************************************************* // diff --git a/bird/preprocess/data_preprocess/loop_reactor_3_6L/writeGlobalVars.py b/bird/preprocess/data_preprocess/loop_reactor_3_6L/writeGlobalVars.py deleted file mode 100644 index 0594eccc..00000000 --- a/bird/preprocess/data_preprocess/loop_reactor_3_6L/writeGlobalVars.py +++ /dev/null @@ -1,47 +0,0 @@ -import os - -import numpy as np - -from bird.utilities.ofio import * - - -def writeGvars(inletA, liqVol): - filename_tmp = os.path.join("constant", "globalVars_temp") - with open(filename_tmp, "r+") as f: - lines = f.readlines() - filename = os.path.join("constant", "globalVars") - with open(filename, "w+") as f: - for line in lines: - if line.startswith("inletA"): - f.write(f"inletA\t{inletA:g};\n") - elif line.startswith("liqVol"): - f.write(f"liqVol\t{liqVol:g};\n") - else: - f.write(line) - - -def readInletArea(): - filename = os.path.join( - "postProcessing", - "patchIntegrate(patch=inlet,field=alpha.gas)", - "0", - "surfaceFieldValue.dat", - ) - with open(filename, "r+") as f: - lines = f.readlines() - return float(lines[4].split()[-1]) - - -def getLiqVol(): - cellCentres = readMesh(os.path.join(".", f"meshCellCentres_0.obj")) - volume_field = readOFScal(os.path.join("0", "V"), len(cellCentres)) - alpha_field = readOFScal( - os.path.join("0", "alpha.liquid"), len(cellCentres) - ) - return np.sum(volume_field * alpha_field) - - -if __name__ == "__main__": - A = readInletArea() - V = getLiqVol() - writeGvars(A, V) diff --git a/bird/preprocess/dynamic_mixer/io_fvModels.py b/bird/preprocess/dynamic_mixer/io_fvModels.py index 6d405984..46092969 100644 --- a/bird/preprocess/dynamic_mixer/io_fvModels.py +++ b/bird/preprocess/dynamic_mixer/io_fvModels.py @@ -42,26 +42,18 @@ def write_preamble(output_folder): f.write("\t\tconst volVectorField& UL =\n") f.write('\t\t\tmesh().lookupObject("U.liquid");\n') f.write("\t\tdouble pi=3.141592654;\n") - f.write(f"\t\tdouble source_pt_x;\n") - f.write(f"\t\tdouble source_pt_y;\n") - f.write(f"\t\tdouble source_pt_z;\n") - f.write(f"\t\tdouble disk_rad;\n") - f.write("\t\tdouble disk_area;\n") - f.write(f"\t\tdouble power;\n") - f.write(f"\t\tdouble smear_factor;\n") - f.write(f"\t\tdouble startTime;\n") def write_mixer(mixer, output_folder): with open(os.path.join(output_folder, "fvModels"), "a+") as f: - f.write(f"\t\tsource_pt_x={mixer.x};\n") - f.write(f"\t\tsource_pt_y={mixer.y};\n") - f.write(f"\t\tsource_pt_z={mixer.z};\n") - f.write(f"\t\tdisk_rad={mixer.rad};\n") - f.write("\t\tdisk_area=pi*disk_rad*disk_rad;\n") - f.write(f"\t\tpower={mixer.power};\n") - f.write(f"\t\tsmear_factor={float(mixer.smear)};\n") - f.write(f"\t\tstartTime = {mixer.start_time};\n") + f.write(f"\t\tdouble source_pt_x={mixer.x};\n") + f.write(f"\t\tdouble source_pt_y={mixer.y};\n") + f.write(f"\t\tdouble source_pt_z={mixer.z};\n") + f.write(f"\t\tdouble disk_rad={mixer.rad};\n") + f.write("\t\tdouble disk_area=pi*disk_rad*disk_rad;\n") + f.write(f"\t\tdouble power={mixer.power};\n") + f.write(f"\t\tdouble smear_factor={float(mixer.smear)};\n") + f.write(f"\t\tconst scalar startTime = {mixer.start_time};\n") f.write("\t\tif (time.value() > startTime)\n") f.write("\t\t{\n") f.write("\t\t\t// Get V1\n") @@ -69,7 +61,7 @@ def write_mixer(mixer, output_folder): f.write("\t\t\tdouble V1 = 0;\n") f.write("\t\t\tdouble V2 = 0;\n") f.write("\t\t\tdouble rhoV;\n") - f.write("\t\t\tdouble dist_tol = disk_rad*3;\n") + f.write("\t\t\tdouble dist_tol = disk_rad*5;\n") f.write("\n") f.write("\t\t\tdouble dist_n;\n") f.write("\t\t\tdouble upV = 0;\n") @@ -192,139 +184,6 @@ def write_mixer(mixer, output_folder): f.write("\t\t}\n") -def write_mixer_force_sign(mixer, output_folder): - with open(os.path.join(output_folder, "fvModels"), "a+") as f: - f.write(f"\t\tsource_pt_x={mixer.x};\n") - f.write(f"\t\tsource_pt_y={mixer.y};\n") - f.write(f"\t\tsource_pt_z={mixer.z};\n") - f.write(f"\t\tdisk_rad={mixer.rad};\n") - f.write("\t\tdisk_area=pi*disk_rad*disk_rad;\n") - f.write(f"\t\tpower={mixer.power};\n") - f.write(f"\t\tsmear_factor={float(mixer.smear)};\n") - f.write(f"\t\tstartTime = {mixer.start_time};\n") - f.write("\t\tif (time.value() > startTime)\n") - f.write("\t\t{\n") - f.write("\t\t\t// Get V1\n") - f.write("\t\t\tdouble source_sign_factor = 1.0;\n") - f.write("\t\t\tdouble V1 = 0;\n") - f.write("\t\t\tdouble V2 = 0;\n") - f.write("\t\t\tdouble rhoV;\n") - f.write("\t\t\tdouble dist_tol = disk_rad*3;\n") - f.write("\n") - f.write("\t\t\tdouble dist_n;\n") - f.write("\t\t\tdouble upV = 0;\n") - f.write("\t\t\tdouble uprhoV = 0;\n") - f.write("\t\t\tdouble upVvol = 0;\n") - f.write("\t\t\tdouble downV = 0;\n") - f.write("\t\t\tdouble downrhoV = 0;\n") - f.write("\t\t\tdouble downVvol = 0;\n") - f.write("\t\t\tdouble dist2;\n") - - f.write("\t\t\tforAll(C,i)\n") - f.write("\t\t\t{\n") - f.write( - "\t\t\t\tdist2 = (C[i].x()-source_pt_x)*(C[i].x()-source_pt_x);\n" - ) - f.write( - "\t\t\t\tdist2 += (C[i].y()-source_pt_y)*(C[i].y()-source_pt_y);\n" - ) - f.write( - "\t\t\t\tdist2 += (C[i].z()-source_pt_z)*(C[i].z()-source_pt_z);\n" - ) - f.write("\n") - if mixer.normal_dir == 0: - f.write("\t\t\t\tdist_n = (C[i].x()-source_pt_x);\n") - elif mixer.normal_dir == 1: - f.write("\t\t\t\tdist_n = (C[i].y()-source_pt_y);\n") - elif mixer.normal_dir == 2: - f.write("\t\t\t\tdist_n = (C[i].z()-source_pt_z);\n") - f.write("\n") - - f.write( - "\t\t\t\tif (dist2 < dist_tol*dist_tol && dist_n < -dist_tol/2) {\n" - ) - f.write("\t\t\t\t\tupVvol += V[i] * alphaL[i];\n") - f.write( - f"\t\t\t\t\tupV += V[i] * alphaL[i] * UL[i][{int(mixer.normal_dir)}];\n" - ) - f.write("\t\t\t\t\tuprhoV += V[i] * alphaL[i] * rhoL[i];\n") - f.write("\t\t\t\t}\n") - f.write( - "\t\t\t\tif (dist2 < dist_tol*dist_tol && dist_n > dist_tol/2) {\n" - ) - f.write("\t\t\t\t\tdownVvol += V[i] * alphaL[i];\n") - f.write( - f"\t\t\t\t\tdownV += V[i] * alphaL[i] * UL[i][{int(mixer.normal_dir)}];\n" - ) - f.write("\t\t\t\t\tdownrhoV += V[i] * alphaL[i] * rhoL[i];\n") - f.write("\t\t\t\t}\n") - f.write("\t\t\t}\n") - f.write("\n") - f.write("\t\t\treduce(uprhoV, sumOp());\n") - f.write("\t\t\treduce(downrhoV, sumOp());\n") - f.write("\t\t\treduce(upV, sumOp());\n") - f.write("\t\t\treduce(downV, sumOp());\n") - f.write("\t\t\treduce(downVvol, sumOp());\n") - f.write("\t\t\treduce(upVvol, sumOp());\n") - f.write("\n") - f.write("\t\t\tdownV /= downVvol;\n") - f.write("\t\t\tupV /= upVvol;\n") - f.write("\t\t\tdownrhoV /= downVvol;\n") - f.write("\t\t\tuprhoV /= upVvol;\n") - f.write("\n") - if mixer.sign == "+": - f.write("\t\t\tsource_sign_factor = -1.0;\n") - f.write("\t\t\tif (upV >= 0){\n") - f.write("\t\t\t\tV1 = 0.0;\n") - f.write("\t\t\t} else {\n") - f.write("\t\t\t\tV1 = std::abs(upV);\n") - f.write("\t\t\t}\n") - f.write("\t\t\trhoV = uprhoV;\n") - elif mixer.sign == "-": - f.write("\t\t\tsource_sign_factor = 1.0;\n") - f.write("\t\t\tif (downV <= 0){\n") - f.write("\t\t\t\tV1 = 0.0;\n") - f.write("\t\t\t} else {\n") - f.write("\t\t\t\tV1 = std::abs(downV);\n") - f.write("\t\t\t}\n") - f.write("\t\t\trhoV = downrhoV;\n") - # f.write("\t\t\t}\n") - f.write( - '\t\t\tFoam::Info << "[BIRD:DYNMIX INFO] V1 = " << V1 << endl;\n' - ) - f.write("\t\t\t\n") - f.write("\t\t\t// Get V2\n") - f.write("\t\t\tV2 = findV2(power, rhoV, disk_area, V1);\n") - f.write("\n") - f.write("\t\t\tforAll(C,i)\n") - f.write("\t\t\t{\n") - f.write( - "\t\t\t\tdouble Thrust=0.5*rhoL[i]*(V2*V2 - V1*V1)*disk_area;\n" - ) - f.write( - "\t\t\t\tdouble dist2=(C[i].x()-source_pt_x)*(C[i].x()-source_pt_x);\n" - ) - f.write( - "\t\t\t\tdist2 += (C[i].y()-source_pt_y)*(C[i].y()-source_pt_y);\n" - ) - f.write( - "\t\t\t\tdist2 += (C[i].z()-source_pt_z)*(C[i].z()-source_pt_z);\n" - ) - - f.write("\t\t\t\tdouble epsilon=pow(V[i],0.33333)*smear_factor;\n") - f.write( - "\t\t\t\tdouble sourceterm=alphaL[i]*(Thrust/pow(pi,1.5)/pow(epsilon,3.0))*\n" - ) - f.write("\t\t\t\t\texp(-dist2/(epsilon*epsilon));\n") - - f.write( - f"\t\t\t\tUsource[i][{int(mixer.normal_dir)}] -= source_sign_factor*sourceterm*V[i];\n" - ) - - f.write("\t\t\t}\n") - f.write("\t\t}\n") - - def write_end(output_folder): with open(os.path.join(output_folder, "fvModels"), "a+") as f: f.write("\t#};\n") diff --git a/bird/preprocess/dynamic_mixer/mixer.py b/bird/preprocess/dynamic_mixer/mixer.py index d3068427..1cc9b8b5 100644 --- a/bird/preprocess/dynamic_mixer/mixer.py +++ b/bird/preprocess/dynamic_mixer/mixer.py @@ -15,7 +15,6 @@ def __init__(self): self.ready = False def update_from_expl_dict(self, mixer_dict): - print("\nMaking dynamic mixer with explicit input") if "x" in mixer_dict: self.x = mixer_dict["x"] if "y" in mixer_dict: @@ -37,7 +36,6 @@ def update_from_expl_dict(self, mixer_dict): self.check_status() def update_from_loop_dict(self, mixer_dict, geom_dict, mesh_dict=None): - print("\nMaking dynamic mixer from loop specific input") segment = geom_dict["segments"][mixer_dict["branch_id"]] pos = segment["start"] + mixer_dict["frac_space"] * segment["conn"] self.x = pos[0] @@ -83,13 +81,13 @@ def check_status(self, blocks=None): self.ready = False else: print( - f"\tpos({self.x:.2g}, {self.y:.2g}, {self.z:.2g})m" + f"\n\tpos({self.x:.2g}, {self.y:.2g}, {self.z:.2g})" + f"\n\tnormal_dir {self.normal_dir}" - + f"\n\trad {self.rad:.2g}m" - + f"\n\tpower {self.power:.2g}W" + + f"\n\trad {self.rad:.2g}" + + f"\n\tpower {self.power:.2g}" + f"\n\tsign {self.sign}" - + f"\n\tsmear {self.smear} grid points" - + f"\n\tstart_time {self.start_time:.2g}s" + + f"\n\tsmear {self.smear}" + + f"\n\tstart_time {self.start_time:.2g}" ) if blocks is not None: print(f"\tbranch = {blocks}") diff --git a/bird/preprocess/dynamic_mixer/mixing_fvModels.py b/bird/preprocess/dynamic_mixer/mixing_fvModels.py index 146fc510..95eb04f6 100644 --- a/bird/preprocess/dynamic_mixer/mixing_fvModels.py +++ b/bird/preprocess/dynamic_mixer/mixing_fvModels.py @@ -28,7 +28,7 @@ def check_input(input_dict): return mix_type -def write_fvModel(input_dict, output_folder=".", force_sign=False): +def write_fvModel(input_dict, output_folder="."): mix_type = check_input(input_dict) write_preamble(output_folder) if "loop" in mix_type: @@ -39,19 +39,13 @@ def write_fvModel(input_dict, output_folder=".", force_sign=False): if mtype == "expl": mixer.update_from_expl_dict(input_dict["mixers"][imix]) if mixer.ready: - if force_sign: - write_mixer_force_sign(mixer, output_folder) - else: - write_mixer(mixer, output_folder) + write_mixer(mixer, output_folder) elif mtype == "loop": mixer.update_from_loop_dict( input_dict["mixers"][imix], geom_dict, mesh_dict ) if mixer.ready: - if force_sign: - write_mixer_force_sign(mixer, output_folder) - else: - write_mixer(mixer, output_folder) + write_mixer(mixer, output_folder) write_end(output_folder) diff --git a/bird/preprocess/json_gen/design_io.py b/bird/preprocess/json_gen/design_io.py deleted file mode 100644 index d6ed2c72..00000000 --- a/bird/preprocess/json_gen/design_io.py +++ /dev/null @@ -1,85 +0,0 @@ -import json - - -def generate_stl_patch(filename, bc_dict, geom_dict): - final_dict = {} - final_dict["Geometry"] = geom_dict["Geometry"] - for patch in bc_dict: - final_dict[patch] = bc_dict[patch] - with open(filename, "w+") as f: - json.dump(final_dict, f, indent=2) - - -def generate_dynamic_mixer(filename, mixers_list, geom_dict): - final_dict = {} - final_dict["Meshing"] = geom_dict["Meshing"] - final_dict["Geometry"] = geom_dict["Geometry"] - final_dict["mixers"] = mixers_list - with open(filename, "w+") as f: - json.dump(final_dict, f, indent=2) - - -def make_default_geom_dict_from_file(filename, rescale=2.7615275385627096): - with open(filename, "r+") as f: - geom_dict = json.load(f) - if "rescale" not in geom_dict["Geometry"]["OverallDomain"]["x"]: - geom_dict["Geometry"]["OverallDomain"]["x"]["rescale"] = rescale - geom_dict["Geometry"]["OverallDomain"]["y"]["rescale"] = rescale - geom_dict["Geometry"]["OverallDomain"]["z"]["rescale"] = rescale - assert "Meshing" in geom_dict - assert "Geometry" in geom_dict - return geom_dict - - -if __name__ == "__main__": - bc_dict = {} - bc_dict["inlets"] = [] - bc_dict["outlets"] = [] - tmp_dict = {} - tmp_dict["type"] = "circle" - tmp_dict["centx"] = 5.0 - tmp_dict["centy"] = 0.0 - tmp_dict["centz"] = 0.5 - tmp_dict["radius"] = 0.4 - tmp_dict["normal_dir"] = 1 - tmp_dict["nelements"] = 50 - bc_dict["inlets"].append(tmp_dict) - tmp_dict = {} - tmp_dict["type"] = "circle" - tmp_dict["centx"] = 2.5 - tmp_dict["centy"] = 0.0 - tmp_dict["centz"] = 0.5 - tmp_dict["radius"] = 0.4 - tmp_dict["normal_dir"] = 1 - tmp_dict["nelements"] = 50 - bc_dict["inlets"].append(tmp_dict) - tmp_dict = {} - tmp_dict["type"] = "circle" - tmp_dict["centx"] = 7.5 - tmp_dict["centy"] = 0.0 - tmp_dict["centz"] = 0.5 - tmp_dict["radius"] = 0.4 - tmp_dict["normal_dir"] = 1 - tmp_dict["nelements"] = 50 - bc_dict["inlets"].append(tmp_dict) - - tmp_dict = {} - tmp_dict["type"] = "circle" - tmp_dict["centx"] = 0.5 - tmp_dict["centy"] = 5.0 - tmp_dict["centz"] = 0.5 - tmp_dict["radius"] = 0.4 - tmp_dict["normal_dir"] = 1 - tmp_dict["nelements"] = 50 - bc_dict["outlets"].append(tmp_dict) - tmp_dict = {} - tmp_dict["type"] = "circle" - tmp_dict["centx"] = 0.5 - tmp_dict["centy"] = 5.0 - tmp_dict["centz"] = 0.5 - tmp_dict["radius"] = 0.4 - tmp_dict["normal_dir"] = 1 - tmp_dict["nelements"] = 50 - bc_dict["outlets"].append(tmp_dict) - - generate_stl_patch("test.json", bc_dict) diff --git a/bird/preprocess/json_gen/generate_designs.py b/bird/preprocess/json_gen/generate_designs.py deleted file mode 100644 index f6c9c265..00000000 --- a/bird/preprocess/json_gen/generate_designs.py +++ /dev/null @@ -1,344 +0,0 @@ -import os -import pickle -import shutil - -import numpy as np - -from bird import BIRD_CASE_DIR -from bird.preprocess.json_gen.design_io import * - - -def compare_config(config1, config2): - same = True - for key in config1: - if np.linalg.norm(config1[key] - config2[key]) > 1e-6: - same = False - return same - return same - - -def check_config(config): - success = False - inlet_exist = False - for key in config: - if len(np.argwhere(config[key] == 1)) > 0: - inlet_exist = True - break - if inlet_exist: - success = True - else: - success = False - return success - - -def save_config_dict(filename, config_dict): - with open(filename, "wb") as f: - pickle.dump(config_dict, f) - - -def load_config_dict(filename): - with open(filename, "rb") as f: - config_dict = pickle.load(f) - return config_dict - - -def write_script_start(filename, n): - with open(filename, "w+") as f: - for i in range(n): - f.write(f"cd Sim_{i}\n") - f.write(f"sbatch script\n") - f.write(f"cd ..\n") - - -def write_script_post(filename, n): - with open(filename, "w+") as f: - for i in range(n): - f.write(f"cd Sim_{i}\n") - f.write(f"sbatch script_post\n") - f.write(f"cd ..\n") - - -def write_prep(filename, n): - with open(filename, "w+") as f: - f.write("prep () {\n") - f.write(f"\tcd $1\n") - f.write(f"\treconstructPar -newTimes\n") - f.write(f"\tcd ..\n") - f.write("}\n") - f.write(f"\n") - f.write( - f"source /projects/gas2fuels/ofoam_cray_mpich/OpenFOAM-dev/etc/bashrc\n" - ) - for i in range(n): - f.write(f"prep Sim_{i}\n") - - -def overwrite_vvm(case_folder, vvm): - list_dir = os.listdir(case_folder) - if not "constant" in list_dir: - sys.exit( - f"ERROR: {case_folder} is likely not a case folder, could not find constant/" - ) - else: - filename = os.path.join(case_folder, "constant", "globalVars_temp") - filename_write = os.path.join( - case_folder, "constant", "globalVars_temp2" - ) - with open(filename, "r+") as f: - lines = f.readlines() - with open(filename_write, "w+") as f: - for line in lines: - if line.startswith("VVM"): - f.write(f"VVM\t{vvm};\n") - else: - f.write(line) - shutil.copy( - os.path.join(case_folder, "constant", "globalVars_temp2"), - os.path.join(case_folder, "constant", "globalVars_temp"), - ) - os.remove(os.path.join(case_folder, "constant", "globalVars_temp2")) - - -def overwrite_bubble_size_model(case_folder, constantD=False): - list_dir = os.listdir(case_folder) - if not "constant" in list_dir: - sys.exit( - f"ERROR: {case_folder} is likely not a case folder, could not find constant/" - ) - else: - filename = os.path.join(case_folder, "presteps.sh") - filename_write = os.path.join(case_folder, "presteps2.sh") - with open(filename, "r+") as f: - lines = f.readlines() - with open(filename_write, "w+") as f: - for line in lines: - if line.startswith("cp constant/phaseProperties"): - if constantD: - f.write( - "cp constant/phaseProperties_constantd constant/phaseProperties\n" - ) - else: - f.write( - "cp constant/phaseProperties_pbe constant/phaseProperties\n" - ) - else: - f.write(line) - shutil.copy( - os.path.join(case_folder, "presteps2.sh"), - os.path.join(case_folder, "presteps.sh"), - ) - os.remove(os.path.join(case_folder, "presteps2.sh")) - - -def generate_small_reactor_cases( - config_dict, branchcom_spots, vvm, power, constantD, study_folder -): - templateFolder = "loop_reactor_pbe_dynmix_nonstat_headbranch" - - geom_dict = make_default_geom_dict_from_file( - f"{BIRD_CASE_DIR}/{templateFolder}/system/mesh.json", - rescale=0.05, - ) - try: - shutil.rmtree(study_folder) - except: - pass - os.makedirs(study_folder) - for simid in config_dict: - shutil.copytree( - f"{BIRD_CASE_DIR}/{templateFolder}", - f"{study_folder}/Sim_{simid}", - ) - bc_dict = {} - bc_dict["inlets"] = [] - bc_dict["outlets"] = [] - bc_dict["outlets"].append( - { - "branch_id": 6, - "type": "circle", - "frac_space": 1, - "normal_dir": 1, - "radius": 0.4, - "nelements": 50, - "block_pos": "top", - } - ) - bc_dict["outlets"].append( - { - "branch_id": 4, - "type": "circle", - "frac_space": 1, - "normal_dir": 1, - "radius": 0.4, - "nelements": 50, - "block_pos": "top", - } - ) - for branch in config_dict: - if branch in [0, 1, 2]: - ind = np.argwhere(config_dict[simid][branch] == 1) - if len(ind) > 0: - ind = list(ind[:, 0]) - for iind in ind: - bc_dict["inlets"].append( - { - "branch_id": branch, - "type": "circle", - "frac_space": branchcom_spots[branch][iind], - "normal_dir": 1, - "radius": 0.4, - "nelements": 50, - "block_pos": "bottom", - } - ) - generate_stl_patch( - os.path.join( - study_folder, f"Sim_{simid}", "system", "inlets_outlets.json" - ), - bc_dict, - geom_dict, - ) - - mix_list = [] - for branch in config_dict: - if branch in [0, 1, 2]: - ind = np.argwhere(config_dict[simid][branch] == 0) - if len(ind) > 0: - ind = list(ind[:, 0]) - for iind in ind: - if branch == 0: - sign = "+" - else: - sign = "-" - mix_list.append( - { - "branch_id": branch, - "frac_space": branchcom_spots[branch][iind], - "start_time": 1, - "power": power, - "sign": sign, - } - ) - generate_dynamic_mixer( - os.path.join( - study_folder, f"Sim_{simid}", "system", "mixers.json" - ), - mix_list, - geom_dict, - ) - overwrite_vvm( - case_folder=os.path.join(study_folder, f"Sim_{simid}"), vvm=vvm - ) - overwrite_bubble_size_model( - case_folder=os.path.join(study_folder, f"Sim_{simid}"), - constantD=constantD, - ) - - geom_dict = make_default_geom_dict_from_file( - f"{BIRD_CASE_DIR}/{templateFolder}/system/mesh.json", - rescale=0.05, - ) - - -def generate_scaledup_reactor_cases( - config_dict, branchcom_spots, vvm, power, constantD, study_folder -): - - templateFolder = "loop_reactor_pbe_dynmix_nonstat_headbranch_scaleup" - geom_dict = make_default_geom_dict_from_file( - f"{BIRD_CASE_DIR}/{templateFolder}/system/mesh.json" - ) - try: - shutil.rmtree(study_folder) - except: - pass - os.makedirs(study_folder) - for simid in config_dict: - shutil.copytree( - f"{BIRD_CASE_DIR}/{templateFolder}", - f"{study_folder}/Sim_{simid}", - ) - bc_dict = {} - bc_dict["inlets"] = [] - bc_dict["outlets"] = [] - bc_dict["outlets"].append( - { - "branch_id": 6, - "type": "circle", - "frac_space": 1, - "normal_dir": 1, - "radius": 0.4, - "nelements": 50, - "block_pos": "top", - } - ) - bc_dict["outlets"].append( - { - "branch_id": 4, - "type": "circle", - "frac_space": 1, - "normal_dir": 1, - "radius": 0.4, - "nelements": 50, - "block_pos": "top", - } - ) - for branch in config_dict: - if branch in [0, 1, 2]: - ind = np.argwhere(config_dict[simid][branch] == 1) - if len(ind) > 0: - ind = list(ind[:, 0]) - for iind in ind: - bc_dict["inlets"].append( - { - "branch_id": branch, - "type": "circle", - "frac_space": branchcom_spots[branch][iind], - "normal_dir": 1, - "radius": 0.4, - "nelements": 50, - "block_pos": "bottom", - } - ) - generate_stl_patch( - os.path.join( - study_folder, f"Sim_{simid}", "system", "inlets_outlets.json" - ), - bc_dict, - geom_dict, - ) - - mix_list = [] - for branch in config_dict: - if branch in [0, 1, 2]: - ind = np.argwhere(config_dict[simid][branch] == 0) - if len(ind) > 0: - ind = list(ind[:, 0]) - for iind in ind: - if branch == 0: - sign = "+" - else: - sign = "-" - mix_list.append( - { - "branch_id": branch, - "frac_space": branchcom_spots[branch][iind], - "start_time": 3, - "power": power, - "sign": sign, - } - ) - generate_dynamic_mixer( - os.path.join( - study_folder, f"Sim_{simid}", "system", "mixers.json" - ), - mix_list, - geom_dict, - ) - overwrite_vvm( - case_folder=os.path.join(study_folder, f"Sim_{simid}"), vvm=vvm - ) - overwrite_bubble_size_model( - case_folder=os.path.join(study_folder, f"Sim_{simid}"), - constantD=constantD, - ) diff --git a/bird/preprocess/stl_patch/stl_bc.py b/bird/preprocess/stl_patch/stl_bc.py index 032f5316..29a96c4c 100644 --- a/bird/preprocess/stl_patch/stl_bc.py +++ b/bird/preprocess/stl_patch/stl_bc.py @@ -12,7 +12,7 @@ def check_input(input_dict): assert isinstance(input_dict, dict) need_geom = False for bound in input_dict: - if not bound == "Geometry" and not bound == "Meshing": + if not bound == "Geometry": assert isinstance(input_dict[bound], list) for patch in input_dict[bound]: assert isinstance(patch, dict) @@ -41,7 +41,7 @@ def write_boundaries(input_dict): check_input(input_dict) for boundary_name in input_dict.keys(): if not boundary_name == "Geometry": - print(f"\nMaking {boundary_name}") + print(f"Making {boundary_name}") boundary_mesh = get_all_vert_faces(input_dict, boundary_name) print(f"\tArea {boundary_mesh.area} m2") boundary_mesh.save(f"{boundary_name}.stl") diff --git a/bird/preprocess/stl_patch/stl_shapes.py b/bird/preprocess/stl_patch/stl_shapes.py index bb5a9ab6..e9cc1fec 100644 --- a/bird/preprocess/stl_patch/stl_shapes.py +++ b/bird/preprocess/stl_patch/stl_shapes.py @@ -9,7 +9,7 @@ def make_polygon(rad, nvert, center, normal_dir): print( - f"\tMaking polygon at ({center[0]:.4g}, {center[1]:.4g}, {center[2]:.4g})m" + f"\tMaking polygon at ({center[0]:.4g}, {center[1]:.4g}, {center[2]:.4g})" ) theta = 2 * np.pi / nvert vertices = np.zeros((nvert, 3)) @@ -27,7 +27,7 @@ def make_polygon(rad, nvert, center, normal_dir): def make_rectangle(w, h, center, normal_dir): print( - f"\tMaking rectangle at ({center[0]:.4g}, {center[1]:.4g}, {center[2]:.4g})m" + f"\tMaking rectangle at ({center[0]:.4g}, {center[1]:.4g}, {center[2]:.4g})" ) # Define vertices t1dir = (normal_dir + 1) % 3 @@ -50,7 +50,7 @@ def make_rectangle(w, h, center, normal_dir): def make_circle(radius, center, normal_dir, npts=3): print( - f"\tMaking circle at ({center[0]:.4g}, {center[1]:.4g}, {center[2]:.4g})m" + f"\tMaking circle at ({center[0]:.4g}, {center[1]:.4g}, {center[2]:.4g})" ) vertices = np.zeros((npts + 1, 3)) t1dir = (normal_dir + 1) % 3 diff --git a/bird/utilities/ofio.py b/bird/utilities/ofio.py index 8f9d8f41..6a0877b4 100644 --- a/bird/utilities/ofio.py +++ b/bird/utilities/ofio.py @@ -127,16 +127,13 @@ def readSizeGroups(file): return sizeGroup, binGroup -def getCaseTimes(casePath, remove_zero=False): +def getCaseTimes(casePath): # Read Time times_tmp = os.listdir(casePath) # remove non floats for i, entry in reversed(list(enumerate(times_tmp))): try: a = float(entry) - if remove_zero: - if abs(a) < 1e-12: - _ = times_tmp.pop(i) except ValueError: a = times_tmp.pop(i) # print('removed ', a) diff --git a/bird/version.py b/bird/version.py index 4b814da6..2ed1d089 100644 --- a/bird/version.py +++ b/bird/version.py @@ -1,3 +1,3 @@ """Bio reactor design version""" -__version__ = "0.0.15" +__version__ = "0.0.14" diff --git a/setup.py b/setup.py index 877ee8a1..28cdc688 100644 --- a/setup.py +++ b/setup.py @@ -39,7 +39,6 @@ "*.yaml", "*.csv", "data_conditional_mean", - "data_preprocess", ] }, include_package_data=True, diff --git a/tests/postprocess/test_cond_mean.py b/tests/postprocess/test_cond_mean.py index 2367367d..c453b99a 100644 --- a/tests/postprocess/test_cond_mean.py +++ b/tests/postprocess/test_cond_mean.py @@ -2,7 +2,6 @@ from prettyPlot.plotting import plt, pretty_labels -from bird import BIRD_POST_DIR from bird.postprocess.conditional_mean import ( compute_cond_mean, save_cond, @@ -11,12 +10,7 @@ def test_compute_cond(): - if os.path.exists(os.path.join(BIRD_POST_DIR, "data_conditional_mean")): - caseFolder = os.path.join(BIRD_POST_DIR, "data_conditional_mean") - else: - caseFolder = os.path.join( - "bird", "postprocess", "data_conditional_mean" - ) + caseFolder = os.path.join("bird", "postprocess", "data_conditional_mean") fields_list = [ "CO.gas", "CO.liquid", diff --git a/tests/preprocess/test_generate_case.py b/tests/preprocess/test_generate_case.py deleted file mode 100644 index d0e2536e..00000000 --- a/tests/preprocess/test_generate_case.py +++ /dev/null @@ -1,22 +0,0 @@ -import os - -import pytest - -from bird import BIRD_PRE_DATA_DIR -from bird.preprocess.json_gen.generate_designs import ( - convert_case_dim, - replace_str_in_file, -) - - -@pytest.mark.parametrize( - "dim_factor", - [2, 4, 8], -) -def test_scale_dim(dim_factor): - input_folder = os.path.join(BIRD_PRE_DATA_DIR, "loop_reactor_3_6L") - convert_case_dim(input_folder, "dummy_loop", dim_factor) - - -if __name__ == "__main__": - test_scale_dim(2)