From 5d8c07cab998a1d0ae1d5941330f487002607d4f Mon Sep 17 00:00:00 2001 From: Spencer Bryngelson Date: Fri, 27 Dec 2024 08:05:22 -0500 Subject: [PATCH] Remove junk comments and code + check in CI (#777) --- .github/workflows/formatting.yml | 2 +- .github/workflows/lint-source.yml | 7 + examples/0D_bubblecollapse_adap/case.py | 256 +++++------ examples/1D_acoustic_dipole/case.py | 144 +++--- examples/1D_acoustic_gauss_sigmadist/case.py | 142 +++--- examples/1D_acoustic_gauss_sigmatime/case.py | 142 +++--- examples/1D_acoustic_sine_frequency/case.py | 142 +++--- examples/1D_acoustic_sine_wavelength/case.py | 142 +++--- examples/1D_bubblescreen/case.py | 364 ++++++++------- examples/1D_exp_bubscreen/case.py | 417 +++++++++--------- examples/1D_exp_tube_phasechange/case.py | 203 +++++---- examples/1D_hypo_2materials/case.py | 160 ++++--- examples/1D_impact/case.py | 146 +++--- examples/1D_inert_shocktube/case.py | 174 ++++---- examples/1D_inert_shocktube/viz.py | 43 +- examples/1D_kapilashocktube/case.py | 144 +++--- examples/1D_laxshocktube/case.py | 136 +++--- examples/1D_poly_bubscreen/case.py | 322 ++++++-------- examples/1D_qbmm/case.py | 358 +++++++-------- examples/1D_reactive_shocktube/case.py | 178 ++++---- examples/1D_reactive_shocktube/viz.py | 41 +- examples/1D_shuosher_old/case.py | 142 +++--- examples/1D_shuosher_teno5/case.py | 146 +++--- examples/1D_shuosher_teno7/case.py | 146 +++--- examples/1D_shuosher_wenojs5/case.py | 144 +++--- examples/1D_shuosher_wenom5/case.py | 144 +++--- examples/1D_shuosher_wenoz5/case.py | 144 +++--- examples/1D_sodHypo/case.py | 158 +++---- examples/1D_sodshocktube/case.py | 140 +++--- examples/1D_titarevtorro/case.py | 136 +++--- examples/1D_vacuum/case.py | 150 +++---- examples/1D_vacuum_restart/case.py | 150 +++---- examples/1D_vacuum_restart/restart_case.py | 128 +++--- examples/2D_5wave_quasi1D/case.py | 178 ++++---- examples/2D_GreshoVortex/case.py | 152 +++---- examples/2D_TaylorGreenVortex/case.py | 149 +++---- examples/2D_acoustic_broadband/case.py | 171 ++++--- examples/2D_acoustic_pulse/case.py | 185 ++++---- examples/2D_acoustic_support10_axisym/case.py | 166 ++++--- examples/2D_acoustic_support2/case.py | 158 +++---- examples/2D_acoustic_support5/case.py | 158 +++---- examples/2D_acoustic_support6_axisym/case.py | 160 ++++--- examples/2D_acoustic_support9/case.py | 164 ++++--- examples/2D_advection/case.py | 173 ++++---- examples/2D_axisym_shockbubble/case.py | 222 +++++----- examples/2D_axisym_shockwatercavity/case.py | 295 ++++++------- examples/2D_bubbly_steady_shock/case.py | 379 ++++++++-------- examples/2D_hardcodied_ic/case.py | 153 +++---- examples/2D_ibm/case.py | 189 ++++---- examples/2D_ibm_airfoil/case.py | 207 +++++---- examples/2D_ibm_cfl_dt/case.py | 195 ++++---- examples/2D_ibm_multiphase/case.py | 189 ++++---- examples/2D_ibm_steady_shock/case.py | 291 ++++++------ examples/2D_ibm_stl_MFCCharacter/case.py | 154 +++---- examples/2D_ibm_stl_test/case.py | 156 +++---- examples/2D_ibm_stl_wedge/case.py | 158 ++++--- examples/2D_isentropicvortex/case.py | 201 ++++----- examples/2D_laplace_pressure_jump/case.py | 172 ++++---- examples/2D_lid_driven_cavity/case.py | 150 +++---- examples/2D_lungwave/case.py | 292 ++++++------ examples/2D_lungwave_horizontal/case.py | 288 ++++++------ examples/2D_mixing_artificial_Ma/case.py | 204 ++++----- examples/2D_phasechange_bubble/case.py | 305 +++++++------ examples/2D_phasechange_bubble/casefile.py | 333 +++++++------- examples/2D_rayleigh_taylor/case.py | 163 +++---- examples/2D_riemann_test/case.py | 197 ++++----- examples/2D_shearlayer/case.py | 178 ++++---- examples/2D_shockbubble/case.py | 220 +++++---- examples/2D_shockdroplet/case.py | 230 +++++----- examples/2D_shocktube_phasechange/case.py | 300 +++++++------ examples/2D_triple_point/case.py | 207 ++++----- examples/2D_viscous/case.py | 192 ++++---- examples/2D_whale_bubble_annulus/case.py | 300 ++++++------- examples/2D_zero_circ_vortex/case.py | 195 ++++---- examples/3D_TaylorGreenVortex/case.py | 174 ++++---- examples/3D_acoustic_support11/case.py | 214 +++++---- examples/3D_acoustic_support3/case.py | 174 ++++---- examples/3D_acoustic_support7/case.py | 174 ++++---- examples/3D_ibm_bowshock/case.py | 208 +++++---- examples/3D_ibm_stl_ellipsoid/case.py | 189 ++++---- examples/3D_ibm_stl_pyramid/case.py | 189 ++++---- examples/3D_ibm_stl_test/case.py | 187 ++++---- examples/3D_lagrange_bubblescreen/case.py | 331 +++++++------- examples/3D_lagrange_shbubcollapse/case.py | 341 +++++++------- examples/3D_lungwave/arc_case.py | 349 +++++++-------- examples/3D_lungwave/case.py | 347 +++++++-------- examples/3D_performance_test/case.py | 218 +++++---- examples/3D_phasechange_bubble/case.py | 333 +++++++------- examples/3D_rayleigh_taylor/case.py | 177 ++++---- examples/3D_recovering_sphere/case.py | 190 ++++---- examples/3D_shockdroplet/case.py | 304 ++++++------- examples/3D_sphbubcollapse/case.py | 270 ++++++------ examples/3D_turb_mixing/case.py | 205 ++++----- examples/nD_perfect_reactor/analyze.py | 49 +- examples/nD_perfect_reactor/case.py | 190 ++++---- examples/nD_perfect_reactor/export.py | 23 +- examples/scaling/case.py | 319 +++++++------- examples/scaling/export.py | 85 ++-- misc/m_silo_proxy.f90 | 78 ++-- src/common/m_checker_common.fpp | 8 +- src/common/m_delay_file_access.f90 | 2 +- src/common/m_eigen_solver.f90 | 211 +++++---- src/common/m_helper.fpp | 10 +- src/common/m_mpi_common.fpp | 2 +- src/common/m_variables_conversion.fpp | 2 +- src/post_process/m_checker.fpp | 2 +- src/post_process/m_data_input.f90 | 30 +- src/post_process/m_data_output.fpp | 10 +- src/post_process/m_mpi_proxy.fpp | 4 +- src/post_process/m_start_up.f90 | 8 +- src/pre_process/m_check_patches.fpp | 2 +- src/pre_process/m_data_output.fpp | 2 +- src/pre_process/m_initial_condition.fpp | 2 +- src/pre_process/m_mpi_proxy.fpp | 4 +- src/pre_process/m_patches.fpp | 6 +- src/pre_process/m_start_up.fpp | 38 +- src/simulation/m_bubbles_EL.fpp | 4 +- src/simulation/m_data_output.fpp | 61 ++- src/simulation/m_ibm.fpp | 25 -- src/simulation/m_mpi_proxy.fpp | 4 +- src/simulation/m_start_up.fpp | 52 +-- toolchain/bootstrap/format.sh | 9 +- toolchain/bootstrap/format_python.sh | 8 + toolchain/bootstrap/lint.sh | 6 + toolchain/pyproject.toml | 1 + 125 files changed, 9330 insertions(+), 10421 deletions(-) create mode 100644 toolchain/bootstrap/format_python.sh diff --git a/.github/workflows/formatting.yml b/.github/workflows/formatting.yml index 2a94daee0c..16043daa95 100644 --- a/.github/workflows/formatting.yml +++ b/.github/workflows/formatting.yml @@ -4,7 +4,7 @@ on: [push, pull_request, workflow_dispatch] jobs: docs: - name: Code formatting + name: Formatting runs-on: ubuntu-latest steps: diff --git a/.github/workflows/lint-source.yml b/.github/workflows/lint-source.yml index 23da477571..aefd5495ab 100644 --- a/.github/workflows/lint-source.yml +++ b/.github/workflows/lint-source.yml @@ -38,3 +38,10 @@ jobs: run: | ! grep -iR 'double_precision\|dsqrt\|dexp\|dlog\|dble\|dabs\|double\ precision\|real(8)\|real(4)\|dprod\|dmin\|dmax\|dfloat\|dreal\|dcos\|dsin\|dtan\|dsign\|dtanh\|dsinh\|dcosh\|d0' --exclude-dir=syscheck --exclude="*nvtx*" --exclude="*precision_select*" ./src/* + - name: Looking for junk code + run: | + ! grep -iR -e '\.\.\.' -e '\-\-\-' -e '===' ./src/* + + - name: Looking for junk comments in examples + run: | + ! grep -R '# ===' ./examples/**/*.py diff --git a/examples/0D_bubblecollapse_adap/case.py b/examples/0D_bubblecollapse_adap/case.py index 58384908c1..0b76e79ede 100644 --- a/examples/0D_bubblecollapse_adap/case.py +++ b/examples/0D_bubblecollapse_adap/case.py @@ -1,163 +1,141 @@ #!/usr/bin/env python2 - import math import json # FLUID PROPERTIES ============================================================ # Water -n_tait = 7.1 -B_tait = 306.E+06 -rho0 = 1.E+03 -mul0 = 1.002E-03 -ss = 0.07275 -pv = 2.3388E+03 +n_tait = 7.1 +B_tait = 306.0e06 +rho0 = 1.0e03 +mul0 = 1.002e-03 +ss = 0.07275 +pv = 2.3388e03 # Vapor gamma_v = 1.33 -M_v = 18.02 -mu_v = 0.8816E-05 -k_v = 0.019426 +M_v = 18.02 +mu_v = 0.8816e-05 +k_v = 0.019426 # Air gamma_n = 1.4 -M_n = 28.97 -mu_n = 1.8E-05 -k_n = 0.02556 +M_n = 28.97 +mu_n = 1.8e-05 +k_n = 0.02556 # REFERENCE VALUES ============================================================ -R0ref = 50.E-06 -x0 = R0ref -p0 = 8236. # for Ca = 1 in mixing layer scale -u0 = math.sqrt( p0/rho0 ) -patm = 1. -cact = math.sqrt(n_tait*(p0+B_tait)/rho0) +R0ref = 50.0e-06 +x0 = R0ref +p0 = 8236.0 # for Ca = 1 in mixing layer scale +u0 = math.sqrt(p0 / rho0) +patm = 1.0 +cact = math.sqrt(n_tait * (p0 + B_tait) / rho0) # NONDIMENSIONAL NUMBERS ====================================================== -Ca = (p0 - pv)/(rho0*(u0**2.)) # Cavitation number -We = rho0*(u0**2.)*R0ref/ss # Weber number -Re_inv = mul0/(rho0*u0*R0ref) # Inv. bubble Reynolds number +Ca = (p0 - pv) / (rho0 * (u0**2.0)) # Cavitation number +We = rho0 * (u0**2.0) * R0ref / ss # Weber number +Re_inv = mul0 / (rho0 * u0 * R0ref) # Inv. bubble Reynolds number # BUBBLES ===================================================================== -vf0 = 1e-5 -nb = 1 +vf0 = 1e-5 +nb = 1 # DOMAIN ====================================================================== -Nx = 30 -Ldomain = 20.E-03 -L = Ldomain/x0 -dx = L/float(Nx+1) +Nx = 30 +Ldomain = 20.0e-03 +L = Ldomain / x0 +dx = L / float(Nx + 1) # TIME STEPS ================================================================== -Tfinal = 0.05 -Nt = int(5e2+1) -t_save = 1 -dt = Tfinal/(Nt-1) +Tfinal = 0.05 +Nt = int(5e2 + 1) +t_save = 1 +dt = Tfinal / (Nt - 1) # Configuring case dictionary -print(json.dumps({ - # Logistics ================================================ - 'run_time_info' : 'T', - # ========================================================== - - # Computational Domain Parameters ========================== - 'x_domain%beg' : -0.5*L, - 'x_domain%end' : 0.5*L, - 'stretch_x' : 'F', - 'cyl_coord' : 'F', - 'm' : Nx, - 'n' : 0, - 'p' : 0, - 'dt' : dt, - 't_step_start' : 0, - 't_step_stop' : Nt, - 't_step_save' : t_save, - # ========================================================== - - # Simulation Algorithm Parameters ========================== - 'num_patches' : 1, - 'model_eqns' : 2, - 'alt_soundspeed' : 'F', - 'num_fluids' : 1, - 'mpp_lim' : 'F', - 'mixture_err' : 'F', - 'time_stepper' : 3, - 'weno_order' : 5, - 'weno_eps' : 1.E-16, - 'mapped_weno' : 'T', - 'null_weights' : 'F', - 'mp_weno' : 'T', - 'riemann_solver' : 2, - 'wave_speeds' : 1, - 'avg_state' : 2, - 'bc_x%beg' : -1, - 'bc_x%end' : -1, - # ========================================================== - - # Formatted Database Files Structure Parameters ============ - 'format' : 1, - 'precision' : 2, - 'prim_vars_wrt' :'T', - 'parallel_io' :'T', - 'fd_order' : 1, - # ========================================================== - - # Patch 1 _ Background ===================================== - 'patch_icpp(1)%geometry' : 1, - 'patch_icpp(1)%x_centroid' : 0., - 'patch_icpp(1)%length_x' : L, - 'patch_icpp(1)%vel(1)' : 0., - 'patch_icpp(1)%pres' : 1000., - 'patch_icpp(1)%alpha_rho(1)' : (1.-vf0), - 'patch_icpp(1)%alpha(1)' : vf0, - 'patch_icpp(1)%r0' : 1., - 'patch_icpp(1)%v0' : 0., - # ========================================================== - - # Non-polytropic gas compression model AND/OR Tait EOS ===== - 'pref' : p0, - 'rhoref' : rho0, - # ========================================================== - - # Bubbles ================================================== - 'bubbles_euler' : 'T', - 'bubble_model' : 2, - - # Nondimensional numbers - 'Ca' : Ca, - 'Web' : We, - 'Re_inv' : Re_inv, - - # adv_n - 'adv_n' : 'T', - - # adap_dt - 'adap_dt' : 'T', - - # Gas compression model - 'polytropic' : 'T', - 'thermal' : 1, - - # Polydispersity - 'polydisperse' : 'F', - 'nb' : nb, - - # QBMM - 'qbmm' : 'F', - # ========================================================== - - # Fluids Physical Parameters =============================== - # Surrounding liquid - 'fluid_pp(1)%gamma' : 1.E+00/(n_tait-1.E+00), - 'fluid_pp(1)%pi_inf' : n_tait*(B_tait/p0)/(n_tait-1.), - 'fluid_pp(1)%ss' : ss, - 'fluid_pp(1)%pv' : pv, - - # Last fluid_pp is always reserved for bubble gas state === - # if applicable ========================================== - 'fluid_pp(2)%gamma' : 1./(gamma_n-1.), - 'fluid_pp(2)%pi_inf' : 0.0E+00, - # ========================================================== - -})) - -# ============================================================================== +print( + json.dumps( + { + # Logistics ================================================ + "run_time_info": "T", + # Computational Domain Parameters ========================== + "x_domain%beg": -0.5 * L, + "x_domain%end": 0.5 * L, + "stretch_x": "F", + "cyl_coord": "F", + "m": Nx, + "n": 0, + "p": 0, + "dt": dt, + "t_step_start": 0, + "t_step_stop": Nt, + "t_step_save": t_save, + # Simulation Algorithm Parameters ========================== + "num_patches": 1, + "model_eqns": 2, + "alt_soundspeed": "F", + "num_fluids": 1, + "mpp_lim": "F", + "mixture_err": "F", + "time_stepper": 3, + "weno_order": 5, + "weno_eps": 1.0e-16, + "mapped_weno": "T", + "null_weights": "F", + "mp_weno": "T", + "riemann_solver": 2, + "wave_speeds": 1, + "avg_state": 2, + "bc_x%beg": -1, + "bc_x%end": -1, + # Formatted Database Files Structure Parameters ============ + "format": 1, + "precision": 2, + "prim_vars_wrt": "T", + "parallel_io": "T", + "fd_order": 1, + # Patch 1 _ Background ===================================== + "patch_icpp(1)%geometry": 1, + "patch_icpp(1)%x_centroid": 0.0, + "patch_icpp(1)%length_x": L, + "patch_icpp(1)%vel(1)": 0.0, + "patch_icpp(1)%pres": 1000.0, + "patch_icpp(1)%alpha_rho(1)": (1.0 - vf0), + "patch_icpp(1)%alpha(1)": vf0, + "patch_icpp(1)%r0": 1.0, + "patch_icpp(1)%v0": 0.0, + # Non-polytropic gas compression model AND/OR Tait EOS ===== + "pref": p0, + "rhoref": rho0, + # Bubbles ================================================== + "bubbles_euler": "T", + "bubble_model": 2, + # Nondimensional numbers + "Ca": Ca, + "Web": We, + "Re_inv": Re_inv, + # adv_n + "adv_n": "T", + # adap_dt + "adap_dt": "T", + # Gas compression model + "polytropic": "T", + "thermal": 1, + # Polydispersity + "polydisperse": "F", + "nb": nb, + # QBMM + "qbmm": "F", + # Fluids Physical Parameters =============================== + # Surrounding liquid + "fluid_pp(1)%gamma": 1.0e00 / (n_tait - 1.0e00), + "fluid_pp(1)%pi_inf": n_tait * (B_tait / p0) / (n_tait - 1.0), + "fluid_pp(1)%ss": ss, + "fluid_pp(1)%pv": pv, + # Last fluid_pp is always reserved for bubble gas state === + # if applicable ========================================== + "fluid_pp(2)%gamma": 1.0 / (gamma_n - 1.0), + "fluid_pp(2)%pi_inf": 0.0e00, + } + ) +) diff --git a/examples/1D_acoustic_dipole/case.py b/examples/1D_acoustic_dipole/case.py index 34da50d547..9da5823de5 100644 --- a/examples/1D_acoustic_dipole/case.py +++ b/examples/1D_acoustic_dipole/case.py @@ -1,82 +1,70 @@ #!/usr/bin/env python3 - import json # Configuring case dictionary -print(json.dumps({ - # Logistics ================================================================ - 'run_time_info' : 'T', - # ========================================================================== - - # Computational Domain Parameters ========================================== - 'x_domain%beg' : 0, - 'x_domain%end' : 0.001, - 'm' : 199, - 'n' : 0, - 'p' : 0, - 'dt' : 2e-9, - 't_step_start' : 0, - 't_step_stop' : 250, - 't_step_save' : 1, - # ========================================================================== - - # Simulation Algorithm Parameters ========================================== - 'num_patches' : 1, - 'model_eqns' : 2, - 'alt_soundspeed' : 'F', - 'num_fluids' : 1, - 'mpp_lim' : 'F', - 'mixture_err' : 'F', - 'time_stepper' : 3, - 'weno_order' : 5, - 'weno_eps' : 1.E-16, - 'teno' : 'T', - 'teno_CT' : 1E-8, - 'null_weights' : 'F', - 'mp_weno' : 'F', - 'riemann_solver' : 2, - 'wave_speeds' : 1, - 'avg_state' : 2, - 'bc_x%beg' : -6, - 'bc_x%end' : -6, - # ========================================================================== - - # Formatted Database Files Structure Parameters ============================ - 'format' : 1, - 'precision' : 2, - 'prim_vars_wrt' :'T', - 'rho_wrt' :'T', - 'parallel_io' :'T', - # ========================================================================== - - # Patch 1 Liquid =========================================================== - 'patch_icpp(1)%geometry' : 1, - 'patch_icpp(1)%x_centroid' : 0.0005, - 'patch_icpp(1)%length_x' : 0.001, - 'patch_icpp(1)%vel(1)' : 0.0, - 'patch_icpp(1)%pres' : 1E+05, - 'patch_icpp(1)%alpha_rho(1)' : 1100, - 'patch_icpp(1)%alpha(1)' : 1.0, - # ========================================================================== - - # Acoustic source ========================================================== - 'acoustic_source' : 'T', - 'num_source' : 1, - 'acoustic(1)%support' : 1, - 'acoustic(1)%dipole' : 'T', - 'acoustic(1)%loc(1)' : 0.0005, - 'acoustic(1)%pulse' : 2, - 'acoustic(1)%npulse' : 1, - 'acoustic(1)%dir' : 1., - 'acoustic(1)%mag' : 1., - 'acoustic(1)%gauss_sigma_time' : 2E-8, - 'acoustic(1)%delay' : 1E-7, - # ========================================================================== - - # Fluids Physical Parameters =============================================== - 'fluid_pp(1)%gamma' : 1.E+00/(4.4E+00-1.E+00), - 'fluid_pp(1)%pi_inf' : 4.4E+00*5.57E+08/(4.4E+00 - 1.E+00), - # ========================================================================== -})) - -# ============================================================================== +print( + json.dumps( + { + # Logistics ================================================================ + "run_time_info": "T", + # Computational Domain Parameters ========================================== + "x_domain%beg": 0, + "x_domain%end": 0.001, + "m": 199, + "n": 0, + "p": 0, + "dt": 2e-9, + "t_step_start": 0, + "t_step_stop": 250, + "t_step_save": 1, + # Simulation Algorithm Parameters ========================================== + "num_patches": 1, + "model_eqns": 2, + "alt_soundspeed": "F", + "num_fluids": 1, + "mpp_lim": "F", + "mixture_err": "F", + "time_stepper": 3, + "weno_order": 5, + "weno_eps": 1.0e-16, + "teno": "T", + "teno_CT": 1e-8, + "null_weights": "F", + "mp_weno": "F", + "riemann_solver": 2, + "wave_speeds": 1, + "avg_state": 2, + "bc_x%beg": -6, + "bc_x%end": -6, + # Formatted Database Files Structure Parameters ============================ + "format": 1, + "precision": 2, + "prim_vars_wrt": "T", + "rho_wrt": "T", + "parallel_io": "T", + # Patch 1 Liquid =========================================================== + "patch_icpp(1)%geometry": 1, + "patch_icpp(1)%x_centroid": 0.0005, + "patch_icpp(1)%length_x": 0.001, + "patch_icpp(1)%vel(1)": 0.0, + "patch_icpp(1)%pres": 1e05, + "patch_icpp(1)%alpha_rho(1)": 1100, + "patch_icpp(1)%alpha(1)": 1.0, + # Acoustic source ========================================================== + "acoustic_source": "T", + "num_source": 1, + "acoustic(1)%support": 1, + "acoustic(1)%dipole": "T", + "acoustic(1)%loc(1)": 0.0005, + "acoustic(1)%pulse": 2, + "acoustic(1)%npulse": 1, + "acoustic(1)%dir": 1.0, + "acoustic(1)%mag": 1.0, + "acoustic(1)%gauss_sigma_time": 2e-8, + "acoustic(1)%delay": 1e-7, + # Fluids Physical Parameters =============================================== + "fluid_pp(1)%gamma": 1.0e00 / (4.4e00 - 1.0e00), + "fluid_pp(1)%pi_inf": 4.4e00 * 5.57e08 / (4.4e00 - 1.0e00), + } + ) +) diff --git a/examples/1D_acoustic_gauss_sigmadist/case.py b/examples/1D_acoustic_gauss_sigmadist/case.py index c3635d0133..71000be942 100644 --- a/examples/1D_acoustic_gauss_sigmadist/case.py +++ b/examples/1D_acoustic_gauss_sigmadist/case.py @@ -1,81 +1,69 @@ #!/usr/bin/env python3 - import json # Configuring case dictionary -print(json.dumps({ - # Logistics ================================================================ - 'run_time_info' : 'T', - # ========================================================================== - - # Computational Domain Parameters ========================================== - 'x_domain%beg' : 0, - 'x_domain%end' : 0.001, - 'm' : 199, - 'n' : 0, - 'p' : 0, - 'dt' : 2e-9, - 't_step_start' : 0, - 't_step_stop' : 250, - 't_step_save' : 1, - # ========================================================================== - - # Simulation Algorithm Parameters ========================================== - 'num_patches' : 1, - 'model_eqns' : 2, - 'alt_soundspeed' : 'F', - 'num_fluids' : 1, - 'mpp_lim' : 'F', - 'mixture_err' : 'F', - 'time_stepper' : 3, - 'weno_order' : 5, - 'weno_eps' : 1.E-16, - 'teno' : 'T', - 'teno_CT' : 1E-8, - 'null_weights' : 'F', - 'mp_weno' : 'F', - 'riemann_solver' : 2, - 'wave_speeds' : 1, - 'avg_state' : 2, - 'bc_x%beg' : -6, - 'bc_x%end' : -6, - # ========================================================================== - - # Formatted Database Files Structure Parameters ============================ - 'format' : 1, - 'precision' : 2, - 'prim_vars_wrt' :'T', - 'rho_wrt' :'T', - 'parallel_io' :'T', - # ========================================================================== - - # Patch 1 Liquid =========================================================== - 'patch_icpp(1)%geometry' : 1, - 'patch_icpp(1)%x_centroid' : 0.0005, - 'patch_icpp(1)%length_x' : 0.001, - 'patch_icpp(1)%vel(1)' : 0.0, - 'patch_icpp(1)%pres' : 1E+05, - 'patch_icpp(1)%alpha_rho(1)' : 1100, - 'patch_icpp(1)%alpha(1)' : 1.0, - # ========================================================================== - - # Acoustic source ========================================================== - 'acoustic_source' : 'T', - 'num_source' : 1, - 'acoustic(1)%support' : 1, - 'acoustic(1)%loc(1)' : 0.0001, - 'acoustic(1)%pulse' : 2, - 'acoustic(1)%npulse' : 1, - 'acoustic(1)%dir' : 1., - 'acoustic(1)%mag' : 1., - 'acoustic(1)%gauss_sigma_dist' : 2E-8*1493, - 'acoustic(1)%delay' : 1E-7, - # ========================================================================== - - # Fluids Physical Parameters =============================================== - 'fluid_pp(1)%gamma' : 1.E+00/(4.4E+00-1.E+00), - 'fluid_pp(1)%pi_inf' : 4.4E+00*5.57E+08/(4.4E+00 - 1.E+00), - # ========================================================================== -})) - -# ============================================================================== +print( + json.dumps( + { + # Logistics ================================================================ + "run_time_info": "T", + # Computational Domain Parameters ========================================== + "x_domain%beg": 0, + "x_domain%end": 0.001, + "m": 199, + "n": 0, + "p": 0, + "dt": 2e-9, + "t_step_start": 0, + "t_step_stop": 250, + "t_step_save": 1, + # Simulation Algorithm Parameters ========================================== + "num_patches": 1, + "model_eqns": 2, + "alt_soundspeed": "F", + "num_fluids": 1, + "mpp_lim": "F", + "mixture_err": "F", + "time_stepper": 3, + "weno_order": 5, + "weno_eps": 1.0e-16, + "teno": "T", + "teno_CT": 1e-8, + "null_weights": "F", + "mp_weno": "F", + "riemann_solver": 2, + "wave_speeds": 1, + "avg_state": 2, + "bc_x%beg": -6, + "bc_x%end": -6, + # Formatted Database Files Structure Parameters ============================ + "format": 1, + "precision": 2, + "prim_vars_wrt": "T", + "rho_wrt": "T", + "parallel_io": "T", + # Patch 1 Liquid =========================================================== + "patch_icpp(1)%geometry": 1, + "patch_icpp(1)%x_centroid": 0.0005, + "patch_icpp(1)%length_x": 0.001, + "patch_icpp(1)%vel(1)": 0.0, + "patch_icpp(1)%pres": 1e05, + "patch_icpp(1)%alpha_rho(1)": 1100, + "patch_icpp(1)%alpha(1)": 1.0, + # Acoustic source ========================================================== + "acoustic_source": "T", + "num_source": 1, + "acoustic(1)%support": 1, + "acoustic(1)%loc(1)": 0.0001, + "acoustic(1)%pulse": 2, + "acoustic(1)%npulse": 1, + "acoustic(1)%dir": 1.0, + "acoustic(1)%mag": 1.0, + "acoustic(1)%gauss_sigma_dist": 2e-8 * 1493, + "acoustic(1)%delay": 1e-7, + # Fluids Physical Parameters =============================================== + "fluid_pp(1)%gamma": 1.0e00 / (4.4e00 - 1.0e00), + "fluid_pp(1)%pi_inf": 4.4e00 * 5.57e08 / (4.4e00 - 1.0e00), + } + ) +) diff --git a/examples/1D_acoustic_gauss_sigmatime/case.py b/examples/1D_acoustic_gauss_sigmatime/case.py index 99ed65675a..2b43b08699 100644 --- a/examples/1D_acoustic_gauss_sigmatime/case.py +++ b/examples/1D_acoustic_gauss_sigmatime/case.py @@ -1,81 +1,69 @@ #!/usr/bin/env python3 - import json # Configuring case dictionary -print(json.dumps({ - # Logistics ================================================================ - 'run_time_info' : 'T', - # ========================================================================== - - # Computational Domain Parameters ========================================== - 'x_domain%beg' : 0, - 'x_domain%end' : 0.001, - 'm' : 199, - 'n' : 0, - 'p' : 0, - 'dt' : 2e-9, - 't_step_start' : 0, - 't_step_stop' : 250, - 't_step_save' : 1, - # ========================================================================== - - # Simulation Algorithm Parameters ========================================== - 'num_patches' : 1, - 'model_eqns' : 2, - 'alt_soundspeed' : 'F', - 'num_fluids' : 1, - 'mpp_lim' : 'F', - 'mixture_err' : 'F', - 'time_stepper' : 3, - 'weno_order' : 5, - 'weno_eps' : 1.E-16, - 'teno' : 'T', - 'teno_CT' : 1E-8, - 'null_weights' : 'F', - 'mp_weno' : 'F', - 'riemann_solver' : 2, - 'wave_speeds' : 1, - 'avg_state' : 2, - 'bc_x%beg' : -6, - 'bc_x%end' : -6, - # ========================================================================== - - # Formatted Database Files Structure Parameters ============================ - 'format' : 1, - 'precision' : 2, - 'prim_vars_wrt' :'T', - 'rho_wrt' :'T', - 'parallel_io' :'T', - # ========================================================================== - - # Patch 1 Liquid =========================================================== - 'patch_icpp(1)%geometry' : 1, - 'patch_icpp(1)%x_centroid' : 0.0005, - 'patch_icpp(1)%length_x' : 0.001, - 'patch_icpp(1)%vel(1)' : 0.0, - 'patch_icpp(1)%pres' : 1E+05, - 'patch_icpp(1)%alpha_rho(1)' : 1100, - 'patch_icpp(1)%alpha(1)' : 1.0, - # ========================================================================== - - # Acoustic source ========================================================== - 'acoustic_source' : 'T', - 'num_source' : 1, - 'acoustic(1)%support' : 1, - 'acoustic(1)%loc(1)' : 0.0001, - 'acoustic(1)%pulse' : 2, - 'acoustic(1)%npulse' : 1, - 'acoustic(1)%dir' : 1., - 'acoustic(1)%mag' : 1., - 'acoustic(1)%gauss_sigma_time' : 2E-8, - 'acoustic(1)%delay' : 1E-7, - # ========================================================================== - - # Fluids Physical Parameters =============================================== - 'fluid_pp(1)%gamma' : 1.E+00/(4.4E+00-1.E+00), - 'fluid_pp(1)%pi_inf' : 4.4E+00*5.57E+08/(4.4E+00 - 1.E+00), - # ========================================================================== -})) - -# ============================================================================== +print( + json.dumps( + { + # Logistics ================================================================ + "run_time_info": "T", + # Computational Domain Parameters ========================================== + "x_domain%beg": 0, + "x_domain%end": 0.001, + "m": 199, + "n": 0, + "p": 0, + "dt": 2e-9, + "t_step_start": 0, + "t_step_stop": 250, + "t_step_save": 1, + # Simulation Algorithm Parameters ========================================== + "num_patches": 1, + "model_eqns": 2, + "alt_soundspeed": "F", + "num_fluids": 1, + "mpp_lim": "F", + "mixture_err": "F", + "time_stepper": 3, + "weno_order": 5, + "weno_eps": 1.0e-16, + "teno": "T", + "teno_CT": 1e-8, + "null_weights": "F", + "mp_weno": "F", + "riemann_solver": 2, + "wave_speeds": 1, + "avg_state": 2, + "bc_x%beg": -6, + "bc_x%end": -6, + # Formatted Database Files Structure Parameters ============================ + "format": 1, + "precision": 2, + "prim_vars_wrt": "T", + "rho_wrt": "T", + "parallel_io": "T", + # Patch 1 Liquid =========================================================== + "patch_icpp(1)%geometry": 1, + "patch_icpp(1)%x_centroid": 0.0005, + "patch_icpp(1)%length_x": 0.001, + "patch_icpp(1)%vel(1)": 0.0, + "patch_icpp(1)%pres": 1e05, + "patch_icpp(1)%alpha_rho(1)": 1100, + "patch_icpp(1)%alpha(1)": 1.0, + # Acoustic source ========================================================== + "acoustic_source": "T", + "num_source": 1, + "acoustic(1)%support": 1, + "acoustic(1)%loc(1)": 0.0001, + "acoustic(1)%pulse": 2, + "acoustic(1)%npulse": 1, + "acoustic(1)%dir": 1.0, + "acoustic(1)%mag": 1.0, + "acoustic(1)%gauss_sigma_time": 2e-8, + "acoustic(1)%delay": 1e-7, + # Fluids Physical Parameters =============================================== + "fluid_pp(1)%gamma": 1.0e00 / (4.4e00 - 1.0e00), + "fluid_pp(1)%pi_inf": 4.4e00 * 5.57e08 / (4.4e00 - 1.0e00), + } + ) +) diff --git a/examples/1D_acoustic_sine_frequency/case.py b/examples/1D_acoustic_sine_frequency/case.py index 2a687b6dee..b31d65c652 100644 --- a/examples/1D_acoustic_sine_frequency/case.py +++ b/examples/1D_acoustic_sine_frequency/case.py @@ -1,81 +1,69 @@ #!/usr/bin/env python3 - import json # Configuring case dictionary -print(json.dumps({ - # Logistics ================================================================ - 'run_time_info' : 'T', - # ========================================================================== - - # Computational Domain Parameters ========================================== - 'x_domain%beg' : 0, - 'x_domain%end' : 0.001, - 'm' : 199, - 'n' : 0, - 'p' : 0, - 'dt' : 2e-9, - 't_step_start' : 0, - 't_step_stop' : 250, - 't_step_save' : 1, - # ========================================================================== - - # Simulation Algorithm Parameters ========================================== - 'num_patches' : 1, - 'model_eqns' : 2, - 'alt_soundspeed' : 'F', - 'num_fluids' : 1, - 'mpp_lim' : 'F', - 'mixture_err' : 'F', - 'time_stepper' : 3, - 'weno_order' : 5, - 'weno_eps' : 1.E-16, - 'teno' : 'T', - 'teno_CT' : 1E-8, - 'null_weights' : 'F', - 'mp_weno' : 'F', - 'riemann_solver' : 2, - 'wave_speeds' : 1, - 'avg_state' : 2, - 'bc_x%beg' : -6, - 'bc_x%end' : -6, - # ========================================================================== - - # Formatted Database Files Structure Parameters ============================ - 'format' : 1, - 'precision' : 2, - 'prim_vars_wrt' :'T', - 'rho_wrt' :'T', - 'parallel_io' :'T', - # ========================================================================== - - # Patch 1 Liquid =========================================================== - 'patch_icpp(1)%geometry' : 1, - 'patch_icpp(1)%x_centroid' : 0.0005, - 'patch_icpp(1)%length_x' : 0.001, - 'patch_icpp(1)%vel(1)' : 0.0, - 'patch_icpp(1)%pres' : 1E+05, - 'patch_icpp(1)%alpha_rho(1)' : 1100, - 'patch_icpp(1)%alpha(1)' : 1.0, - # ========================================================================== - - # Acoustic source ========================================================== - 'acoustic_source' : 'T', - 'num_source' : 1, - 'acoustic(1)%support' : 1, - 'acoustic(1)%loc(1)' : 0.0001, - 'acoustic(1)%pulse' : 1, - 'acoustic(1)%npulse' : 3, - 'acoustic(1)%dir' : 1., - 'acoustic(1)%mag' : 1., - 'acoustic(1)%frequency' : 1/5E-8, - 'acoustic(1)%delay' : 0, - # ========================================================================== - - # Fluids Physical Parameters =============================================== - 'fluid_pp(1)%gamma' : 1.E+00/(4.4E+00-1.E+00), - 'fluid_pp(1)%pi_inf' : 4.4E+00*5.57E+08/(4.4E+00 - 1.E+00), - # ========================================================================== -})) - -# ============================================================================== +print( + json.dumps( + { + # Logistics ================================================================ + "run_time_info": "T", + # Computational Domain Parameters ========================================== + "x_domain%beg": 0, + "x_domain%end": 0.001, + "m": 199, + "n": 0, + "p": 0, + "dt": 2e-9, + "t_step_start": 0, + "t_step_stop": 250, + "t_step_save": 1, + # Simulation Algorithm Parameters ========================================== + "num_patches": 1, + "model_eqns": 2, + "alt_soundspeed": "F", + "num_fluids": 1, + "mpp_lim": "F", + "mixture_err": "F", + "time_stepper": 3, + "weno_order": 5, + "weno_eps": 1.0e-16, + "teno": "T", + "teno_CT": 1e-8, + "null_weights": "F", + "mp_weno": "F", + "riemann_solver": 2, + "wave_speeds": 1, + "avg_state": 2, + "bc_x%beg": -6, + "bc_x%end": -6, + # Formatted Database Files Structure Parameters ============================ + "format": 1, + "precision": 2, + "prim_vars_wrt": "T", + "rho_wrt": "T", + "parallel_io": "T", + # Patch 1 Liquid =========================================================== + "patch_icpp(1)%geometry": 1, + "patch_icpp(1)%x_centroid": 0.0005, + "patch_icpp(1)%length_x": 0.001, + "patch_icpp(1)%vel(1)": 0.0, + "patch_icpp(1)%pres": 1e05, + "patch_icpp(1)%alpha_rho(1)": 1100, + "patch_icpp(1)%alpha(1)": 1.0, + # Acoustic source ========================================================== + "acoustic_source": "T", + "num_source": 1, + "acoustic(1)%support": 1, + "acoustic(1)%loc(1)": 0.0001, + "acoustic(1)%pulse": 1, + "acoustic(1)%npulse": 3, + "acoustic(1)%dir": 1.0, + "acoustic(1)%mag": 1.0, + "acoustic(1)%frequency": 1 / 5e-8, + "acoustic(1)%delay": 0, + # Fluids Physical Parameters =============================================== + "fluid_pp(1)%gamma": 1.0e00 / (4.4e00 - 1.0e00), + "fluid_pp(1)%pi_inf": 4.4e00 * 5.57e08 / (4.4e00 - 1.0e00), + } + ) +) diff --git a/examples/1D_acoustic_sine_wavelength/case.py b/examples/1D_acoustic_sine_wavelength/case.py index d59c7e427e..dd124d767e 100644 --- a/examples/1D_acoustic_sine_wavelength/case.py +++ b/examples/1D_acoustic_sine_wavelength/case.py @@ -1,81 +1,69 @@ #!/usr/bin/env python3 - import json # Configuring case dictionary -print(json.dumps({ - # Logistics ================================================================ - 'run_time_info' : 'T', - # ========================================================================== - - # Computational Domain Parameters ========================================== - 'x_domain%beg' : 0, - 'x_domain%end' : 0.001, - 'm' : 199, - 'n' : 0, - 'p' : 0, - 'dt' : 2e-9, - 't_step_start' : 0, - 't_step_stop' : 250, - 't_step_save' : 5, - # ========================================================================== - - # Simulation Algorithm Parameters ========================================== - 'num_patches' : 1, - 'model_eqns' : 2, - 'alt_soundspeed' : 'F', - 'num_fluids' : 1, - 'mpp_lim' : 'F', - 'mixture_err' : 'F', - 'time_stepper' : 3, - 'weno_order' : 5, - 'weno_eps' : 1.E-16, - 'teno' : 'T', - 'teno_CT' : 1E-8, - 'null_weights' : 'F', - 'mp_weno' : 'F', - 'riemann_solver' : 2, - 'wave_speeds' : 1, - 'avg_state' : 2, - 'bc_x%beg' : -6, - 'bc_x%end' : -6, - # ========================================================================== - - # Formatted Database Files Structure Parameters ============================ - 'format' : 1, - 'precision' : 2, - 'prim_vars_wrt' :'T', - 'rho_wrt' :'T', - 'parallel_io' :'T', - # ========================================================================== - - # Patch 1 Liquid =========================================================== - 'patch_icpp(1)%geometry' : 1, - 'patch_icpp(1)%x_centroid' : 0.0005, - 'patch_icpp(1)%length_x' : 0.001, - 'patch_icpp(1)%vel(1)' : 0.0, - 'patch_icpp(1)%pres' : 1E+05, - 'patch_icpp(1)%alpha_rho(1)' : 1100, - 'patch_icpp(1)%alpha(1)' : 1.0, - # ========================================================================== - - # Acoustic source ========================================================== - 'acoustic_source' : 'T', - 'num_source' : 1, - 'acoustic(1)%support' : 1, - 'acoustic(1)%loc(1)' : 0.0001, - 'acoustic(1)%pulse' : 1, - 'acoustic(1)%npulse' : 3, - 'acoustic(1)%dir' : 1., - 'acoustic(1)%mag' : 1., - 'acoustic(1)%wavelength' : 5E-8*1493, - 'acoustic(1)%delay' : 0, - # ========================================================================== - - # Fluids Physical Parameters =============================================== - 'fluid_pp(1)%gamma' : 1.E+00/(4.4E+00-1.E+00), - 'fluid_pp(1)%pi_inf' : 4.4E+00*5.57E+08/(4.4E+00 - 1.E+00), - # ========================================================================== -})) - -# ============================================================================== +print( + json.dumps( + { + # Logistics ================================================================ + "run_time_info": "T", + # Computational Domain Parameters ========================================== + "x_domain%beg": 0, + "x_domain%end": 0.001, + "m": 199, + "n": 0, + "p": 0, + "dt": 2e-9, + "t_step_start": 0, + "t_step_stop": 250, + "t_step_save": 5, + # Simulation Algorithm Parameters ========================================== + "num_patches": 1, + "model_eqns": 2, + "alt_soundspeed": "F", + "num_fluids": 1, + "mpp_lim": "F", + "mixture_err": "F", + "time_stepper": 3, + "weno_order": 5, + "weno_eps": 1.0e-16, + "teno": "T", + "teno_CT": 1e-8, + "null_weights": "F", + "mp_weno": "F", + "riemann_solver": 2, + "wave_speeds": 1, + "avg_state": 2, + "bc_x%beg": -6, + "bc_x%end": -6, + # Formatted Database Files Structure Parameters ============================ + "format": 1, + "precision": 2, + "prim_vars_wrt": "T", + "rho_wrt": "T", + "parallel_io": "T", + # Patch 1 Liquid =========================================================== + "patch_icpp(1)%geometry": 1, + "patch_icpp(1)%x_centroid": 0.0005, + "patch_icpp(1)%length_x": 0.001, + "patch_icpp(1)%vel(1)": 0.0, + "patch_icpp(1)%pres": 1e05, + "patch_icpp(1)%alpha_rho(1)": 1100, + "patch_icpp(1)%alpha(1)": 1.0, + # Acoustic source ========================================================== + "acoustic_source": "T", + "num_source": 1, + "acoustic(1)%support": 1, + "acoustic(1)%loc(1)": 0.0001, + "acoustic(1)%pulse": 1, + "acoustic(1)%npulse": 3, + "acoustic(1)%dir": 1.0, + "acoustic(1)%mag": 1.0, + "acoustic(1)%wavelength": 5e-8 * 1493, + "acoustic(1)%delay": 0, + # Fluids Physical Parameters =============================================== + "fluid_pp(1)%gamma": 1.0e00 / (4.4e00 - 1.0e00), + "fluid_pp(1)%pi_inf": 4.4e00 * 5.57e08 / (4.4e00 - 1.0e00), + } + ) +) diff --git a/examples/1D_bubblescreen/case.py b/examples/1D_bubblescreen/case.py index 15c1878675..055bdc933d 100755 --- a/examples/1D_bubblescreen/case.py +++ b/examples/1D_bubblescreen/case.py @@ -1,205 +1,185 @@ #!/usr/bin/env python3 - import math, json -x0 = 10.E-06 -p0 = 101325. -rho0 = 1.E+03 -c0 = math.sqrt( p0/rho0 ) -patm = 1. +x0 = 10.0e-06 +p0 = 101325.0 +rho0 = 1.0e03 +c0 = math.sqrt(p0 / rho0) +patm = 1.0 -#water props -n_tait = 7.1 -B_tait = 306.E+06 / p0 -mul0 = 1.002E-03 #viscosity -ss = 0.07275 #surface tension -pv = 2.3388E+03 #vapor pressure +# water props +n_tait = 7.1 +B_tait = 306.0e06 / p0 +mul0 = 1.002e-03 # viscosity +ss = 0.07275 # surface tension +pv = 2.3388e03 # vapor pressure gamma_v = 1.33 -M_v = 18.02 -mu_v = 0.8816E-05 -k_v = 0.019426 +M_v = 18.02 +mu_v = 0.8816e-05 +k_v = 0.019426 -#air props +# air props gamma_n = 1.4 -M_n = 28.97 -mu_n = 1.8E-05 -k_n = 0.02556 +M_n = 28.97 +mu_n = 1.8e-05 +k_n = 0.02556 -#air props +# air props gamma_gas = gamma_n -#reference bubble size -R0ref = 10.E-06 - -pa = 0.1 * 1.E+06 / 101325. - -#Characteristic velocity -uu = math.sqrt( p0/rho0 ) -#Cavitation number -Ca = (p0 - pv)/(rho0*(uu**2.)) -#Weber number -We = rho0*(uu**2.)*R0ref/ss -#Inv. bubble Reynolds number -Re_inv = mul0/(rho0*uu*R0ref) - -#IC setup -vf0 = 0.00004 -n0 = vf0/(math.pi*4.E+00/3.E+00) - -cact = 1475. -t0 = x0/c0 - -nbubbles = 1 -myr0 = R0ref - -cfl = 0.1 -Nx = 100 -Ldomain = 20.E-03 -L = Ldomain/x0 -dx = L/float(Nx) -dt = cfl*dx*c0/cact -Lpulse = 0.3*Ldomain -Tpulse = Lpulse/cact -Tfinal = 0.25*10.*Tpulse*c0/x0 -Nt = int(Tfinal/dt) - -Nfiles = 20. -Nout = int(math.ceil(Nt/Nfiles)) -Nt = int(Nout*Nfiles) - -# ============================================================================== +# reference bubble size +R0ref = 10.0e-06 + +pa = 0.1 * 1.0e06 / 101325.0 + +# Characteristic velocity +uu = math.sqrt(p0 / rho0) +# Cavitation number +Ca = (p0 - pv) / (rho0 * (uu**2.0)) +# Weber number +We = rho0 * (uu**2.0) * R0ref / ss +# Inv. bubble Reynolds number +Re_inv = mul0 / (rho0 * uu * R0ref) + +# IC setup +vf0 = 0.00004 +n0 = vf0 / (math.pi * 4.0e00 / 3.0e00) + +cact = 1475.0 +t0 = x0 / c0 + +nbubbles = 1 +myr0 = R0ref + +cfl = 0.1 +Nx = 100 +Ldomain = 20.0e-03 +L = Ldomain / x0 +dx = L / float(Nx) +dt = cfl * dx * c0 / cact +Lpulse = 0.3 * Ldomain +Tpulse = Lpulse / cact +Tfinal = 0.25 * 10.0 * Tpulse * c0 / x0 +Nt = int(Tfinal / dt) + +Nfiles = 20.0 +Nout = int(math.ceil(Nt / Nfiles)) +Nt = int(Nout * Nfiles) # Configuring case dictionary ================================================== -print(json.dumps({ - # Logistics ================================================ - 'run_time_info' : 'T', - # ========================================================== - - # Computational Domain Parameters ========================== - 'x_domain%beg' : -10.E-03/x0, - 'x_domain%end' : 10.E-03/x0, - 'stretch_x' : 'F', - 'cyl_coord' : 'F', - 'm' : Nx, - 'n' : 0, - 'p' : 0, - 'dt' : dt, - 't_step_start' : 0, - 't_step_stop' : Nt, - 't_step_save' : Nout, - # ========================================================== - - # Simulation Algorithm Parameters ========================== - 'num_patches' : 2, - 'model_eqns' : 2, - 'alt_soundspeed' : 'F', - 'num_fluids' : 1, - 'mpp_lim' : 'F', - 'mixture_err' : 'F', - 'time_stepper' : 3, - 'weno_order' : 5, - 'weno_eps' : 1.E-16, - 'weno_Re_flux' : 'F', - 'weno_avg' : 'F', - 'mapped_weno' : 'T', - 'null_weights' : 'F', - 'mp_weno' : 'T', - 'riemann_solver' : 2, - 'wave_speeds' : 1, - 'avg_state' : 2, - 'bc_x%beg' : -3, - 'bc_x%end' : -3, - # ========================================================== - - # Formatted Database Files Structure Parameters ============ - 'format' : 1, - 'precision' : 2, - 'prim_vars_wrt' :'T', - 'parallel_io' :'F', - 'fd_order' : 1, - # 'schlieren_wrt' :'T', - 'probe_wrt' :'T', - 'num_probes' : 1, - 'probe(1)%x' : 0., - # ========================================================== - - # Patch 1 _ Background ===================================== - 'patch_icpp(1)%geometry' : 1, - 'patch_icpp(1)%x_centroid' : 0., - 'patch_icpp(1)%length_x' : 20.E-03/x0, - 'patch_icpp(1)%vel(1)' : 0.0, - 'patch_icpp(1)%pres' : patm, - 'patch_icpp(1)%alpha_rho(1)' : (1.-1.E-12)*1.E+03/rho0, - 'patch_icpp(1)%alpha(1)' : 1.E-12, - 'patch_icpp(1)%r0' : 1., - 'patch_icpp(1)%v0' : 0.0E+00, - # ========================================================== - - # Patch 2 Screen =========================================== - 'patch_icpp(2)%geometry' : 1, - 'patch_icpp(2)%x_centroid' : 0., - 'patch_icpp(2)%length_x' : 5.E-03/x0, - 'patch_icpp(2)%alter_patch(1)' : 'T', - 'patch_icpp(2)%vel(1)' : 0.0, - 'patch_icpp(2)%pres' : patm, - 'patch_icpp(2)%alpha_rho(1)' : (1.-vf0)*1.E+03/rho0, - 'patch_icpp(2)%alpha(1)' : vf0, - 'patch_icpp(2)%r0' : 1., - 'patch_icpp(2)%v0' : 0.0E+00, - # ========================================================== - - # Fluids Physical Parameters =============================== - # Surrounding liquid - 'fluid_pp(1)%gamma' : 1.E+00/(n_tait-1.E+00), - 'fluid_pp(1)%pi_inf' : n_tait*B_tait/(n_tait-1.), - 'fluid_pp(1)%mul0' : mul0, - 'fluid_pp(1)%ss' : ss, - 'fluid_pp(1)%pv' : pv, - 'fluid_pp(1)%gamma_v' : gamma_v, - 'fluid_pp(1)%M_v' : M_v, - 'fluid_pp(1)%mu_v' : mu_v, - 'fluid_pp(1)%k_v' : k_v, - # Last fluid_pp is always reserved for bubble gas state === - # if applicable ========================================== - 'fluid_pp(2)%gamma' : 1./(gamma_gas-1.), - 'fluid_pp(2)%pi_inf' : 0.0E+00, - 'fluid_pp(2)%gamma_v' : gamma_n, - 'fluid_pp(2)%M_v' : M_n, - 'fluid_pp(2)%mu_v' : mu_n, - 'fluid_pp(2)%k_v' : k_n, - # ========================================================== - - # Non-polytropic gas compression model AND/OR Tait EOS ===== - 'pref' : p0, - 'rhoref' : rho0, - # ========================================================== - - # Bubbles ================================================== - 'bubbles_euler' : 'T', - 'bubble_model' : 3, - 'polytropic' : 'T', - 'polydisperse' : 'F', - # 'poly_sigma' : 0.3, - 'thermal' : 3, - 'R0ref' : myr0, - 'nb' : 1, - 'Ca' : Ca, - 'Web' : We, - 'Re_inv' : Re_inv, - # ========================================================== - - # Acoustic source ========================================== - 'acoustic_source' : 'T', - 'num_source' : 1, - 'acoustic(1)%support' : 1, - 'acoustic(1)%loc(1)' : -5.E-03/x0, - 'acoustic(1)%npulse' : 1, - 'acoustic(1)%dir' : 1., - 'acoustic(1)%pulse' : 1, - 'acoustic(1)%mag' : pa, - 'acoustic(1)%wavelength' : (1./(300000.))*cact/x0 - # ========================================================== -})) - -# ============================================================================== +print( + json.dumps( + { + # Logistics ================================================ + "run_time_info": "T", + # Computational Domain Parameters ========================== + "x_domain%beg": -10.0e-03 / x0, + "x_domain%end": 10.0e-03 / x0, + "stretch_x": "F", + "cyl_coord": "F", + "m": Nx, + "n": 0, + "p": 0, + "dt": dt, + "t_step_start": 0, + "t_step_stop": Nt, + "t_step_save": Nout, + # Simulation Algorithm Parameters ========================== + "num_patches": 2, + "model_eqns": 2, + "alt_soundspeed": "F", + "num_fluids": 1, + "mpp_lim": "F", + "mixture_err": "F", + "time_stepper": 3, + "weno_order": 5, + "weno_eps": 1.0e-16, + "weno_Re_flux": "F", + "weno_avg": "F", + "mapped_weno": "T", + "null_weights": "F", + "mp_weno": "T", + "riemann_solver": 2, + "wave_speeds": 1, + "avg_state": 2, + "bc_x%beg": -3, + "bc_x%end": -3, + # Formatted Database Files Structure Parameters ============ + "format": 1, + "precision": 2, + "prim_vars_wrt": "T", + "parallel_io": "F", + "fd_order": 1, + # 'schlieren_wrt' :'T', + "probe_wrt": "T", + "num_probes": 1, + "probe(1)%x": 0.0, + # Patch 1 _ Background ===================================== + "patch_icpp(1)%geometry": 1, + "patch_icpp(1)%x_centroid": 0.0, + "patch_icpp(1)%length_x": 20.0e-03 / x0, + "patch_icpp(1)%vel(1)": 0.0, + "patch_icpp(1)%pres": patm, + "patch_icpp(1)%alpha_rho(1)": (1.0 - 1.0e-12) * 1.0e03 / rho0, + "patch_icpp(1)%alpha(1)": 1.0e-12, + "patch_icpp(1)%r0": 1.0, + "patch_icpp(1)%v0": 0.0e00, + # Patch 2 Screen =========================================== + "patch_icpp(2)%geometry": 1, + "patch_icpp(2)%x_centroid": 0.0, + "patch_icpp(2)%length_x": 5.0e-03 / x0, + "patch_icpp(2)%alter_patch(1)": "T", + "patch_icpp(2)%vel(1)": 0.0, + "patch_icpp(2)%pres": patm, + "patch_icpp(2)%alpha_rho(1)": (1.0 - vf0) * 1.0e03 / rho0, + "patch_icpp(2)%alpha(1)": vf0, + "patch_icpp(2)%r0": 1.0, + "patch_icpp(2)%v0": 0.0e00, + # Fluids Physical Parameters =============================== + # Surrounding liquid + "fluid_pp(1)%gamma": 1.0e00 / (n_tait - 1.0e00), + "fluid_pp(1)%pi_inf": n_tait * B_tait / (n_tait - 1.0), + "fluid_pp(1)%mul0": mul0, + "fluid_pp(1)%ss": ss, + "fluid_pp(1)%pv": pv, + "fluid_pp(1)%gamma_v": gamma_v, + "fluid_pp(1)%M_v": M_v, + "fluid_pp(1)%mu_v": mu_v, + "fluid_pp(1)%k_v": k_v, + # Last fluid_pp is always reserved for bubble gas state === + # if applicable ========================================== + "fluid_pp(2)%gamma": 1.0 / (gamma_gas - 1.0), + "fluid_pp(2)%pi_inf": 0.0e00, + "fluid_pp(2)%gamma_v": gamma_n, + "fluid_pp(2)%M_v": M_n, + "fluid_pp(2)%mu_v": mu_n, + "fluid_pp(2)%k_v": k_n, + # Non-polytropic gas compression model AND/OR Tait EOS ===== + "pref": p0, + "rhoref": rho0, + # Bubbles ================================================== + "bubbles_euler": "T", + "bubble_model": 3, + "polytropic": "T", + "polydisperse": "F", + # 'poly_sigma' : 0.3, + "thermal": 3, + "R0ref": myr0, + "nb": 1, + "Ca": Ca, + "Web": We, + "Re_inv": Re_inv, + # Acoustic source ========================================== + "acoustic_source": "T", + "num_source": 1, + "acoustic(1)%support": 1, + "acoustic(1)%loc(1)": -5.0e-03 / x0, + "acoustic(1)%npulse": 1, + "acoustic(1)%dir": 1.0, + "acoustic(1)%pulse": 1, + "acoustic(1)%mag": pa, + "acoustic(1)%wavelength": (1.0 / (300000.0)) * cact / x0, + } + ) +) diff --git a/examples/1D_exp_bubscreen/case.py b/examples/1D_exp_bubscreen/case.py index 938636a3c9..875bf9605b 100755 --- a/examples/1D_exp_bubscreen/case.py +++ b/examples/1D_exp_bubscreen/case.py @@ -1,253 +1,234 @@ #!/usr/bin/env python3 - import math import json -x0 = 17.E-05 -p0 = 101325. -rho0 = 1.E+03 -c0 = math.sqrt( p0/rho0 ) -patm = 1. +x0 = 17.0e-05 +p0 = 101325.0 +rho0 = 1.0e03 +c0 = math.sqrt(p0 / rho0) +patm = 1.0 -#water props +# water props ## AKA little \gamma (see coralic 2014 eq'n (13)) -n_tait = 7.1 +n_tait = 7.1 ## AKA little \pi(see coralic 2014 eq'n (13)) -B_tait = 306.E+06 / p0 +B_tait = 306.0e06 / p0 -mul0 = 1.002E-03 #viscosity +mul0 = 1.002e-03 # viscosity # mul0 = 1.E-12 -ss = 0.07275 #surface tension +ss = 0.07275 # surface tension # ss = 1.E-12 ## this would turn-off surface tension -pv = 2.3388E+03 #vapor pressure +pv = 2.3388e03 # vapor pressure -# water +# water # These _v and _n parameters ONLY correspond to the bubble model of Preston (2010 maybe 2008) # (this model would replace the usual Rayleigh-plesset or Keller-miksis model (it's more complicated)) -#gamma_v = 1.33 -#M_v = 18.02 -#mu_v = 0.8816E-05 -#k_v = 0.019426 +# gamma_v = 1.33 +# M_v = 18.02 +# mu_v = 0.8816E-05 +# k_v = 0.019426 ##air props -#gamma_n = 1.4 -#M_n = 28.97 -#mu_n = 1.8E-05 -#k_n = 0.02556 +# gamma_n = 1.4 +# M_n = 28.97 +# mu_n = 1.8E-05 +# k_n = 0.02556 -#air props +# air props gamma_gas = 1.4 -#reference bubble size -R0ref = 17.E-05 +# reference bubble size +R0ref = 17.0e-05 -pa = 0.1 * 1.E+06 / 101325. +pa = 0.1 * 1.0e06 / 101325.0 -#Characteristic velocity -uu = math.sqrt( p0/rho0 ) -#Cavitation number +# Characteristic velocity +uu = math.sqrt(p0 / rho0) +# Cavitation number # Ca = (p0 - pv)/(rho0*(uu**2.)) Ca = 1 -#Weber number -We = rho0*(uu**2.)*R0ref/ss -#Inv. bubble Reynolds number -Re_inv = mul0/(rho0*uu*R0ref) +# Weber number +We = rho0 * (uu**2.0) * R0ref / ss +# Inv. bubble Reynolds number +Re_inv = mul0 / (rho0 * uu * R0ref) -#IC setup -vf0 = 0.0023 +# IC setup +vf0 = 0.0023 # vf0 = 1.E-6 -n0 = vf0/(math.pi*4.E+00/3.E+00) +n0 = vf0 / (math.pi * 4.0e00 / 3.0e00) -cphysical = 1475. -t0 = x0/c0 +cphysical = 1475.0 +t0 = x0 / c0 -nbubbles = 1 -myr0 = R0ref +nbubbles = 1 +myr0 = R0ref # CFL number should be < 1 for numerical stability # CFL = speed of sound * dt/dx -cfl = 0.2 -Nx = 500 +cfl = 0.2 +Nx = 500 Ldomain = 0.3 -L = Ldomain/x0 -dx = L/float(Nx) -dt = cfl*dx/(cphysical/c0) +L = Ldomain / x0 +dx = L / float(Nx) +dt = cfl * dx / (cphysical / c0) -Lpulse = 0.3*Ldomain -Tpulse = Lpulse/cphysical -Tfinal = 0.3*0.25*10.*Tpulse*c0/x0 -Nt = int(Tfinal/dt) +Lpulse = 0.3 * Ldomain +Tpulse = Lpulse / cphysical +Tfinal = 0.3 * 0.25 * 10.0 * Tpulse * c0 / x0 +Nt = int(Tfinal / dt) -Nfiles = 100. -Nout = int(math.ceil(Nt/Nfiles)) -Nt = int(Nout*Nfiles) +Nfiles = 100.0 +Nout = int(math.ceil(Nt / Nfiles)) +Nt = int(Nout * Nfiles) # Configuring case dictionary -print(json.dumps({ - # Logistics ================================================ - 'run_time_info' : 'T', - # ========================================================== - - # Computational Domain Parameters ========================== - 'x_domain%beg' : -0.15/x0, - 'x_domain%end' : 0.15/x0, - 'stretch_x' : 'F', - 'cyl_coord' : 'F', - 'm' : Nx, - 'n' : 0, - 'p' : 0, - 'dt' : dt, - 't_step_start' : 0, - 't_step_stop' : Nt, - 't_step_save' : Nout, - # ========================================================== - - # Simulation Algorithm Parameters ========================== - 'num_patches' : 2, - 'model_eqns' : 2, - 'alt_soundspeed' : 'F', - 'num_fluids' : 1, - 'mpp_lim' : 'F', - 'mixture_err' : 'F', - 'time_stepper' : 3, - 'weno_order' : 5, - 'weno_eps' : 1.E-16, - 'weno_Re_flux' : 'F', - 'weno_avg' : 'F', - 'mapped_weno' : 'T', - 'null_weights' : 'F', - 'mp_weno' : 'T', - 'riemann_solver' : 2, - 'wave_speeds' : 1, - 'avg_state' : 2, - 'bc_x%beg' : -8, - 'bc_x%end' : -8, - # ========================================================== - - # Formatted Database Files Structure Parameters ============ - 'format' : 1, - 'precision' : 2, - 'prim_vars_wrt' :'T', - 'parallel_io' :'F', - 'fd_order' : 1, - #'schlieren_wrt' :'T', - 'probe_wrt' :'T', - 'num_probes' : 1, - 'probe(1)%x' : 0., - # ========================================================== - - # Patch 1 _ Background ===================================== - # this problem is 1D... so based on the dimension of the problem - # you have different 'geometries' available to you - # e.g. in 3D you might have spherical geometries - # and rectangular ones - # in 1D (like here)... there is only one option {#1}... which is a - # line - 'patch_icpp(1)%geometry' : 1, - 'patch_icpp(1)%x_centroid' : 0., - 'patch_icpp(1)%length_x' : 0.3/x0, - 'patch_icpp(1)%vel(1)' : 0.0, - 'patch_icpp(1)%pres' : patm, - # \alpha stands for volume fraction of this phase - # so if there are no bubbles, then it is all water (liquid) - # and \alpha_1 = \alpha_liquid \approx 1 - 'patch_icpp(1)%alpha_rho(1)' : (1.-1.E-12)*(1.E+03/rho0), - # \alpha_1 here is always (for num_fluids = 1 and bubbles=True) - # \alpha is always the void fraction of bubbles (usually << 1) - 'patch_icpp(1)%alpha(1)' : 1.E-12, - # dimensionless initial bubble radius - 'patch_icpp(1)%r0' : 1., - # dimensionless initial velocity - 'patch_icpp(1)%v0' : 0.0E+00, - # ========================================================== - - # Patch 2 Screen =========================================== - 'patch_icpp(2)%geometry' : 1, - #overwrite the part in the middle that was the - #background (no bubble) area - 'patch_icpp(2)%alter_patch(1)' : 'T', - 'patch_icpp(2)%x_centroid' : 0., - 'patch_icpp(2)%length_x' : 0.08/x0, - 'patch_icpp(2)%vel(1)' : 0.0, - 'patch_icpp(2)%pres' : patm, - # \alpha stands for volume fraction of this phase - # so if there are no bubbles, then it is all water (liquid) - # and \alpha_1 = \alpha_liquid \approx 1 - # in the screen case, you have \alpha_1 = 1 - \alpha_bubbles = 1 - vf0 - 'patch_icpp(2)%alpha_rho(1)' : (1.-vf0)*1.E+03/rho0, - # void fraction of bubbles - 'patch_icpp(2)%alpha(1)' : vf0, - 'patch_icpp(2)%r0' : 1., - 'patch_icpp(2)%v0' : 0.0E+00, - # ========================================================== - - # Fluids Physical Parameters =============================== - # Surrounding liquid - 'fluid_pp(1)%gamma' : 1.E+00/(n_tait-1.E+00), - 'fluid_pp(1)%pi_inf' : n_tait*B_tait/(n_tait-1.), - # 'fluid_pp(1)%mul0' : mul0, - # 'fluid_pp(1)%ss' : ss, - # 'fluid_pp(1)%pv' : pv, - # 'fluid_pp(1)%gamma_v' : gamma_v, - # 'fluid_pp(1)%M_v' : M_v, - # 'fluid_pp(1)%mu_v' : mu_v, - # 'fluid_pp(1)%k_v' : k_v, - - # Last fluid_pp is always reserved for bubble gas state === - # if applicable ========================================== - 'fluid_pp(2)%gamma' : 1./(gamma_gas-1.), - 'fluid_pp(2)%pi_inf' : 0.0E+00, - # 'fluid_pp(2)%gamma_v' : gamma_n, - # 'fluid_pp(2)%M_v' : M_n, - # 'fluid_pp(2)%mu_v' : mu_n, - # 'fluid_pp(2)%k_v' : k_n, - # ========================================================== - - # Non-polytropic gas compression model AND/OR Tait EOS ===== - 'pref' : p0, - 'rhoref' : rho0, - # ========================================================== - - # Bubbles ================================================== - 'bubbles_euler' : 'T', - # in user guide... 1 = gilbert 2 = keller-miksis - # but gilbert won't work for the equations that you are using... (i think) - 'bubble_model' : 2, - # polytropic: this is where the different between Rayleigh--Plesset and - # Preston's model shows up. polytropic = False means complicated Preston model - # = True means simpler Rayleigh--Plesset model - # if polytropic == False then you will end up calling s_initialize_nonpoly in - # m_global_parameters.f90 in both the pre_process and simulation - 'polytropic' : 'T', - 'polydisperse' : 'F', - #'poly_sigma' : 0.3, - # only matters if polytropic = False (complicated model) - 'thermal' : 3, - # only matters if polytropic = False (complicated model) - 'R0ref' : myr0, - 'nb' : 1, - # cavitation number (has something to do with the ratio of gas to vapour in the bubble) - # this is usually near 1 - # can set = 1 for testing purposes - 'Ca' : Ca, - # weber number (corresponds to surface tension) - 'Web' : We, - # inverse reynolds number (corresponds to viscosity) - 'Re_inv' : Re_inv, - # ========================================================== - - # Acoustic source ========================================== - 'acoustic_source' : 'T', - 'num_source' : 1, - 'acoustic(1)%support' : 1, - 'acoustic(1)%loc(1)' : -0.05/x0, - 'acoustic(1)%npulse' : 1, - 'acoustic(1)%dir' : 1., - 'acoustic(1)%pulse' : 1, - 'acoustic(1)%mag' : 0.001, - 'acoustic(1)%wavelength' : (1./(30000.))*cphysical/x0 - # ========================================================== -})) - -# ============================================================================== +print( + json.dumps( + { + # Logistics ================================================ + "run_time_info": "T", + # Computational Domain Parameters ========================== + "x_domain%beg": -0.15 / x0, + "x_domain%end": 0.15 / x0, + "stretch_x": "F", + "cyl_coord": "F", + "m": Nx, + "n": 0, + "p": 0, + "dt": dt, + "t_step_start": 0, + "t_step_stop": Nt, + "t_step_save": Nout, + # Simulation Algorithm Parameters ========================== + "num_patches": 2, + "model_eqns": 2, + "alt_soundspeed": "F", + "num_fluids": 1, + "mpp_lim": "F", + "mixture_err": "F", + "time_stepper": 3, + "weno_order": 5, + "weno_eps": 1.0e-16, + "weno_Re_flux": "F", + "weno_avg": "F", + "mapped_weno": "T", + "null_weights": "F", + "mp_weno": "T", + "riemann_solver": 2, + "wave_speeds": 1, + "avg_state": 2, + "bc_x%beg": -8, + "bc_x%end": -8, + # Formatted Database Files Structure Parameters ============ + "format": 1, + "precision": 2, + "prim_vars_wrt": "T", + "parallel_io": "F", + "fd_order": 1, + #'schlieren_wrt' :'T', + "probe_wrt": "T", + "num_probes": 1, + "probe(1)%x": 0.0, + # Patch 1 _ Background ===================================== + # this problem is 1D... so based on the dimension of the problem + # you have different 'geometries' available to you + # e.g. in 3D you might have spherical geometries + # and rectangular ones + # in 1D (like here)... there is only one option {#1}... which is a + # line + "patch_icpp(1)%geometry": 1, + "patch_icpp(1)%x_centroid": 0.0, + "patch_icpp(1)%length_x": 0.3 / x0, + "patch_icpp(1)%vel(1)": 0.0, + "patch_icpp(1)%pres": patm, + # \alpha stands for volume fraction of this phase + # so if there are no bubbles, then it is all water (liquid) + # and \alpha_1 = \alpha_liquid \approx 1 + "patch_icpp(1)%alpha_rho(1)": (1.0 - 1.0e-12) * (1.0e03 / rho0), + # \alpha_1 here is always (for num_fluids = 1 and bubbles=True) + # \alpha is always the void fraction of bubbles (usually << 1) + "patch_icpp(1)%alpha(1)": 1.0e-12, + # dimensionless initial bubble radius + "patch_icpp(1)%r0": 1.0, + # dimensionless initial velocity + "patch_icpp(1)%v0": 0.0e00, + # Patch 2 Screen =========================================== + "patch_icpp(2)%geometry": 1, + # overwrite the part in the middle that was the + # background (no bubble) area + "patch_icpp(2)%alter_patch(1)": "T", + "patch_icpp(2)%x_centroid": 0.0, + "patch_icpp(2)%length_x": 0.08 / x0, + "patch_icpp(2)%vel(1)": 0.0, + "patch_icpp(2)%pres": patm, + # \alpha stands for volume fraction of this phase + # so if there are no bubbles, then it is all water (liquid) + # and \alpha_1 = \alpha_liquid \approx 1 + # in the screen case, you have \alpha_1 = 1 - \alpha_bubbles = 1 - vf0 + "patch_icpp(2)%alpha_rho(1)": (1.0 - vf0) * 1.0e03 / rho0, + # void fraction of bubbles + "patch_icpp(2)%alpha(1)": vf0, + "patch_icpp(2)%r0": 1.0, + "patch_icpp(2)%v0": 0.0e00, + # Fluids Physical Parameters =============================== + # Surrounding liquid + "fluid_pp(1)%gamma": 1.0e00 / (n_tait - 1.0e00), + "fluid_pp(1)%pi_inf": n_tait * B_tait / (n_tait - 1.0), + # 'fluid_pp(1)%mul0' : mul0, + # 'fluid_pp(1)%ss' : ss, + # 'fluid_pp(1)%pv' : pv, + # 'fluid_pp(1)%gamma_v' : gamma_v, + # 'fluid_pp(1)%M_v' : M_v, + # 'fluid_pp(1)%mu_v' : mu_v, + # 'fluid_pp(1)%k_v' : k_v, + # Last fluid_pp is always reserved for bubble gas state === + # if applicable ========================================== + "fluid_pp(2)%gamma": 1.0 / (gamma_gas - 1.0), + "fluid_pp(2)%pi_inf": 0.0e00, + # 'fluid_pp(2)%gamma_v' : gamma_n, + # 'fluid_pp(2)%M_v' : M_n, + # 'fluid_pp(2)%mu_v' : mu_n, + # 'fluid_pp(2)%k_v' : k_n, + # Non-polytropic gas compression model AND/OR Tait EOS ===== + "pref": p0, + "rhoref": rho0, + # Bubbles ================================================== + "bubbles_euler": "T", + # in user guide... 1 = gilbert 2 = keller-miksis + # but gilbert won't work for the equations that you are using... (i think) + "bubble_model": 2, + # polytropic: this is where the different between Rayleigh--Plesset and + # Preston's model shows up. polytropic = False means complicated Preston model + # = True means simpler Rayleigh--Plesset model + # if polytropic == False then you will end up calling s_initialize_nonpoly in + # m_global_parameters.f90 in both the pre_process and simulation + "polytropic": "T", + "polydisperse": "F", + #'poly_sigma' : 0.3, + # only matters if polytropic = False (complicated model) + "thermal": 3, + # only matters if polytropic = False (complicated model) + "R0ref": myr0, + "nb": 1, + # cavitation number (has something to do with the ratio of gas to vapour in the bubble) + # this is usually near 1 + # can set = 1 for testing purposes + "Ca": Ca, + # weber number (corresponds to surface tension) + "Web": We, + # inverse reynolds number (corresponds to viscosity) + "Re_inv": Re_inv, + # Acoustic source ========================================== + "acoustic_source": "T", + "num_source": 1, + "acoustic(1)%support": 1, + "acoustic(1)%loc(1)": -0.05 / x0, + "acoustic(1)%npulse": 1, + "acoustic(1)%dir": 1.0, + "acoustic(1)%pulse": 1, + "acoustic(1)%mag": 0.001, + "acoustic(1)%wavelength": (1.0 / (30000.0)) * cphysical / x0, + } + ) +) diff --git a/examples/1D_exp_tube_phasechange/case.py b/examples/1D_exp_tube_phasechange/case.py index cc2d89709a..919de88bad 100644 --- a/examples/1D_exp_tube_phasechange/case.py +++ b/examples/1D_exp_tube_phasechange/case.py @@ -2,18 +2,18 @@ import math, json # Pressure -p01 = 1.175435854855077e+05 +p01 = 1.175435854855077e05 # AIR -#density +# density rho0a1 = 1.077440586592175 # pi infinity pia = 0 # qv -qva = 0E0 +qva = 0e0 # qv' -qvpa = 0E0 +qvpa = 0e0 # cv cva = 717.5 # cp @@ -21,18 +21,18 @@ # gamma gama = cpa / cva # Speed of sound -c_a = math.sqrt( gama * ( p01 + pia ) / rho0a1 ) +c_a = math.sqrt(gama * (p01 + pia) / rho0a1) # liquid water # density -rho0wl1 = 1.079065851351639e+03 +rho0wl1 = 1.079065851351639e03 # pi infty -piwl = 1.0E+09 +piwl = 1.0e09 # qv qvwl = -1167000 # qv' -qvpwl = 0.0E0 +qvpwl = 0.0e0 # cv cvwl = 1816 # cp @@ -40,7 +40,7 @@ # gamma gamwl = cpwl / cvwl # speed of sound -c_wl = math.sqrt( gamwl * ( p01 + piwl ) / rho0wl1 ) +c_wl = math.sqrt(gamwl * (p01 + piwl) / rho0wl1) # Vapor water # density @@ -59,14 +59,14 @@ # gamma gamwv = cpwv / cvwv # speed of sound -c_wv = math.sqrt( gamwv * ( p01 + piwv ) / rho0wv1 ) +c_wv = math.sqrt(gamwv * (p01 + piwv) / rho0wv1) # Mach number of the shocked region - this should agree with Min, if everything is correct Ms = 2.0 ss = Ms * c_a -vel = 2.0E+0 +vel = 2.0e0 # domain boundaries xb = 0.0 @@ -76,22 +76,22 @@ cfl = 0.40 # Number of elements into the x direction -Nx = 200 +Nx = 200 -dx = ( xe - xb ) / Nx +dx = (xe - xb) / Nx dt = cfl * dx / ss # save frequency = SF + 1 (because the initial state, 0.dat, is also saved) SF = 200 # making Nt divisible by SF -tendA = ( xe - xb ) / ss * 0.25 +tendA = (xe - xb) / ss * 0.25 # 1 - ensure NtA is sufficient to go a little beyond tendA -NtA = int( tendA//dt + 1 ) +NtA = int(tendA // dt + 1) # Array of saves. it is the same as Nt/Sf = t_step_save -AS = int( NtA // SF + 1 ) +AS = int(NtA // SF + 1) # Nt = total number of steps. Ensure Nt > NtA (so the total tendA is covered) Nt = AS * SF @@ -106,90 +106,87 @@ aa1 = 1 - awl1 - awv1 # Configuring case dictionary ================================================== -print(json.dumps({ - # Logistics ================================================ - 'run_time_info': 'T', - # ========================================================== - # Computational Domain Parameters ========================== - 'x_domain%beg' : xb, - 'x_domain%end' : xe, - 'm' : Nx, - 'n' : 0, - 'p' : 0, - 'dt' : dt, - 't_step_start' : 0, - 't_step_stop' : Nt, - 't_step_save' : AS, - # ========================================================== - # Simulation Algorithm Parameters ========================== - 'num_patches' : 2, - 'model_eqns' : 3, - 'num_fluids' : 3, - 'mpp_lim' : 'T', - 'mixture_err' : 'T', - 'relax' : 'T', - 'relax_model' : 6, - 'palpha_eps' : 1.0E-2, - 'ptgalpha_eps' : 1.0E-2, - 'time_stepper' : 3, - 'weno_order' : 3, - 'weno_eps' : 1.0E-16, - 'mapped_weno' : 'T', - 'null_weights' : 'F', - 'mp_weno' : 'F', - 'riemann_solver' : 2, - 'wave_speeds' : 1, - 'avg_state' : 2, - 'bc_x%beg' : -3, - 'bc_x%end' : -3, - # ========================================================== - # Formatted Database Files Structure Parameters ============ - 'format' : 1, - 'precision' : 2, - 'prim_vars_wrt':'T', - 'parallel_io' :'T', - # ========================================================== - # Patch 1 - Shocked Stated ==================================== - 'patch_icpp(1)%geometry' : 1, - 'patch_icpp(1)%x_centroid' : ( xe + xb ) * 1 / 4, - 'patch_icpp(1)%length_x' : ( xe - xb ) * 1 / 2, - 'patch_icpp(1)%vel(1)' : -vel, - 'patch_icpp(1)%pres' : p01, - 'patch_icpp(1)%alpha_rho(1)' : awl1 * rho0wl1, - 'patch_icpp(1)%alpha_rho(2)' : awv1 * rho0wv1, - 'patch_icpp(1)%alpha_rho(3)' : aa1 * rho0a1, - 'patch_icpp(1)%alpha(1)' : awl1, - 'patch_icpp(1)%alpha(2)' : awv1, - 'patch_icpp(1)%alpha(3)' : aa1, - # ========================================================== - # Patch 2 R ================================================ - 'patch_icpp(2)%geometry' : 1, - 'patch_icpp(2)%x_centroid' : ( xe + xb ) * 3 / 4, - 'patch_icpp(2)%length_x' : ( xe - xb ) * 1 / 2, - 'patch_icpp(2)%vel(1)' : vel, - 'patch_icpp(2)%pres' : p01, - 'patch_icpp(2)%alpha_rho(1)' : awl1 * rho0wl1, - 'patch_icpp(2)%alpha_rho(2)' : awv1 * rho0wv1, - 'patch_icpp(2)%alpha_rho(3)' : aa1 * rho0a1, - 'patch_icpp(2)%alpha(1)' : awl1, - 'patch_icpp(2)%alpha(2)' : awv1, - 'patch_icpp(2)%alpha(3)' : aa1, - # ========================================================== - # Fluids Physical Parameters =============================== - 'fluid_pp(1)%gamma' : 1.0E+00 / ( gamwl - 1 ), - 'fluid_pp(1)%pi_inf' : gamwl * piwl / ( gamwl - 1 ), - 'fluid_pp(1)%cv' : cvwl, - 'fluid_pp(1)%qv' : qvwl, - 'fluid_pp(1)%qvp' : qvpwl, - 'fluid_pp(2)%gamma' : 1.0E+00 / ( gamwv - 1 ), - 'fluid_pp(2)%pi_inf' : gamwv * piwv / ( gamwv - 1 ), - 'fluid_pp(2)%cv' : cvwv, - 'fluid_pp(2)%qv' : qvwv, - 'fluid_pp(2)%qvp' : qvpwv, - 'fluid_pp(3)%gamma' : 1.0E+00 / ( gama - 1 ), - 'fluid_pp(3)%pi_inf' : gama * pia / ( gama - 1 ), - 'fluid_pp(3)%cv' : cva, - 'fluid_pp(3)%qv' : qva, - 'fluid_pp(3)%qvp' : qvpa, - # ========================================================== -})) +print( + json.dumps( + { + # Logistics ================================================ + "run_time_info": "T", + # Computational Domain Parameters ========================== + "x_domain%beg": xb, + "x_domain%end": xe, + "m": Nx, + "n": 0, + "p": 0, + "dt": dt, + "t_step_start": 0, + "t_step_stop": Nt, + "t_step_save": AS, + # Simulation Algorithm Parameters ========================== + "num_patches": 2, + "model_eqns": 3, + "num_fluids": 3, + "mpp_lim": "T", + "mixture_err": "T", + "relax": "T", + "relax_model": 6, + "palpha_eps": 1.0e-2, + "ptgalpha_eps": 1.0e-2, + "time_stepper": 3, + "weno_order": 3, + "weno_eps": 1.0e-16, + "mapped_weno": "T", + "null_weights": "F", + "mp_weno": "F", + "riemann_solver": 2, + "wave_speeds": 1, + "avg_state": 2, + "bc_x%beg": -3, + "bc_x%end": -3, + # Formatted Database Files Structure Parameters ============ + "format": 1, + "precision": 2, + "prim_vars_wrt": "T", + "parallel_io": "T", + # Patch 1 - Shocked Stated ==================================== + "patch_icpp(1)%geometry": 1, + "patch_icpp(1)%x_centroid": (xe + xb) * 1 / 4, + "patch_icpp(1)%length_x": (xe - xb) * 1 / 2, + "patch_icpp(1)%vel(1)": -vel, + "patch_icpp(1)%pres": p01, + "patch_icpp(1)%alpha_rho(1)": awl1 * rho0wl1, + "patch_icpp(1)%alpha_rho(2)": awv1 * rho0wv1, + "patch_icpp(1)%alpha_rho(3)": aa1 * rho0a1, + "patch_icpp(1)%alpha(1)": awl1, + "patch_icpp(1)%alpha(2)": awv1, + "patch_icpp(1)%alpha(3)": aa1, + # Patch 2 R ================================================ + "patch_icpp(2)%geometry": 1, + "patch_icpp(2)%x_centroid": (xe + xb) * 3 / 4, + "patch_icpp(2)%length_x": (xe - xb) * 1 / 2, + "patch_icpp(2)%vel(1)": vel, + "patch_icpp(2)%pres": p01, + "patch_icpp(2)%alpha_rho(1)": awl1 * rho0wl1, + "patch_icpp(2)%alpha_rho(2)": awv1 * rho0wv1, + "patch_icpp(2)%alpha_rho(3)": aa1 * rho0a1, + "patch_icpp(2)%alpha(1)": awl1, + "patch_icpp(2)%alpha(2)": awv1, + "patch_icpp(2)%alpha(3)": aa1, + # Fluids Physical Parameters =============================== + "fluid_pp(1)%gamma": 1.0e00 / (gamwl - 1), + "fluid_pp(1)%pi_inf": gamwl * piwl / (gamwl - 1), + "fluid_pp(1)%cv": cvwl, + "fluid_pp(1)%qv": qvwl, + "fluid_pp(1)%qvp": qvpwl, + "fluid_pp(2)%gamma": 1.0e00 / (gamwv - 1), + "fluid_pp(2)%pi_inf": gamwv * piwv / (gamwv - 1), + "fluid_pp(2)%cv": cvwv, + "fluid_pp(2)%qv": qvwv, + "fluid_pp(2)%qvp": qvpwv, + "fluid_pp(3)%gamma": 1.0e00 / (gama - 1), + "fluid_pp(3)%pi_inf": gama * pia / (gama - 1), + "fluid_pp(3)%cv": cva, + "fluid_pp(3)%qv": qva, + "fluid_pp(3)%qvp": qvpa, + } + ) +) diff --git a/examples/1D_hypo_2materials/case.py b/examples/1D_hypo_2materials/case.py index 94ce8d7258..fdbcf266e1 100755 --- a/examples/1D_hypo_2materials/case.py +++ b/examples/1D_hypo_2materials/case.py @@ -2,99 +2,87 @@ import math import json -#Numerical setup -Nx = 399 -dx = 1./(1.*(Nx+1)) +# Numerical setup +Nx = 399 +dx = 1.0 / (1.0 * (Nx + 1)) -Tend = 240E-06 -Nt = 1000 -mydt = Tend/(1.*Nt) +Tend = 240e-06 +Nt = 1000 +mydt = Tend / (1.0 * Nt) # Configuring case dictionary -print(json.dumps({ +print( + json.dumps( + { # Logistics ================================================ - 'run_time_info' : 'T', - # ========================================================== - + "run_time_info": "T", # Computational Domain Parameters ========================== - 'x_domain%beg' : 0.E+00, - 'x_domain%end' : 1.E+00, - 'm' : 25, - 'n' : 0, - 'p' : 0, - 'dt' : mydt, - 't_step_start' : 0, - 't_step_stop' : 50, - 't_step_save' : 50, - # ========================================================== - + "x_domain%beg": 0.0e00, + "x_domain%end": 1.0e00, + "m": 25, + "n": 0, + "p": 0, + "dt": mydt, + "t_step_start": 0, + "t_step_stop": 50, + "t_step_save": 50, # Simulation Algorithm Parameters ========================== - 'num_patches' : 2, - 'model_eqns' : 2, - 'alt_soundspeed' : 'F', - 'num_fluids' : 2, - 'mpp_lim' : 'F', - 'mixture_err' : 'F', - 'time_stepper' : 3, - 'weno_order' : 3, - 'weno_eps' : 1.E-16, - 'weno_Re_flux' : 'F', - 'weno_avg' : 'F', - 'mapped_weno' : 'F', - 'null_weights' : 'F', - 'mp_weno' : 'F', - 'riemann_solver' : 1, - 'wave_speeds' : 1, - 'avg_state' : 2, - 'bc_x%beg' : -3, - 'bc_x%end' : -3, - # ========================================================== - + "num_patches": 2, + "model_eqns": 2, + "alt_soundspeed": "F", + "num_fluids": 2, + "mpp_lim": "F", + "mixture_err": "F", + "time_stepper": 3, + "weno_order": 3, + "weno_eps": 1.0e-16, + "weno_Re_flux": "F", + "weno_avg": "F", + "mapped_weno": "F", + "null_weights": "F", + "mp_weno": "F", + "riemann_solver": 1, + "wave_speeds": 1, + "avg_state": 2, + "bc_x%beg": -3, + "bc_x%end": -3, # Turning on Hypoelasticity ================================ - 'hypoelasticity' : 'T', - 'fd_order' : 4, - # ========================================================== - + "hypoelasticity": "T", + "fd_order": 4, # Formatted Database Files Structure Parameters ============ - 'format' : 1, - 'precision' : 2, - 'prim_vars_wrt' :'T', - 'parallel_io' :'F', - # ========================================================== - - # Patch 1 L ================================================ - 'patch_icpp(1)%geometry' : 1, - 'patch_icpp(1)%x_centroid' : 0.35, - 'patch_icpp(1)%length_x' : 0.7, - 'patch_icpp(1)%vel(1)' : 0.0, - 'patch_icpp(1)%pres' : 1E+09, - 'patch_icpp(1)%alpha_rho(1)' : 1000, - 'patch_icpp(1)%alpha_rho(2)' : 0., - 'patch_icpp(1)%alpha(1)' : 1, - 'patch_icpp(1)%alpha(2)' : 0., - 'patch_icpp(1)%tau_e(1)' : 0.0, - # ========================================================== - + "format": 1, + "precision": 2, + "prim_vars_wrt": "T", + "parallel_io": "F", + # Patch 1 L ================================================ + "patch_icpp(1)%geometry": 1, + "patch_icpp(1)%x_centroid": 0.35, + "patch_icpp(1)%length_x": 0.7, + "patch_icpp(1)%vel(1)": 0.0, + "patch_icpp(1)%pres": 1e09, + "patch_icpp(1)%alpha_rho(1)": 1000, + "patch_icpp(1)%alpha_rho(2)": 0.0, + "patch_icpp(1)%alpha(1)": 1, + "patch_icpp(1)%alpha(2)": 0.0, + "patch_icpp(1)%tau_e(1)": 0.0, # Patch 2 R ================================================ - 'patch_icpp(2)%geometry' : 1, - 'patch_icpp(2)%x_centroid' : 0.85, - 'patch_icpp(2)%length_x' : 0.3, - 'patch_icpp(2)%vel(1)' : 0, - 'patch_icpp(2)%pres' : 1E+05, - 'patch_icpp(2)%alpha_rho(1)' : 0., - 'patch_icpp(2)%alpha_rho(2)' : 50., - 'patch_icpp(2)%alpha(1)' : 0, - 'patch_icpp(2)%alpha(2)' : 1, - 'patch_icpp(2)%tau_e(1)' : 0.0, - # ========================================================== - + "patch_icpp(2)%geometry": 1, + "patch_icpp(2)%x_centroid": 0.85, + "patch_icpp(2)%length_x": 0.3, + "patch_icpp(2)%vel(1)": 0, + "patch_icpp(2)%pres": 1e05, + "patch_icpp(2)%alpha_rho(1)": 0.0, + "patch_icpp(2)%alpha_rho(2)": 50.0, + "patch_icpp(2)%alpha(1)": 0, + "patch_icpp(2)%alpha(2)": 1, + "patch_icpp(2)%tau_e(1)": 0.0, # Fluids Physical Parameters =============================== - 'fluid_pp(1)%gamma' : 1.E+00/(4.4E+00-1.E+00), - 'fluid_pp(1)%pi_inf' : 4.4E+00*6.E+08/(4.4E+00 - 1.E+00), - 'fluid_pp(1)%G' : 1.E+09, - 'fluid_pp(2)%gamma' : 1.E+00/(1.4E+00-1.E+00), - 'fluid_pp(2)%pi_inf' : 0., - 'fluid_pp(2)%G' : 0., - # ========================================================== -})) -# ============================================================================== + "fluid_pp(1)%gamma": 1.0e00 / (4.4e00 - 1.0e00), + "fluid_pp(1)%pi_inf": 4.4e00 * 6.0e08 / (4.4e00 - 1.0e00), + "fluid_pp(1)%G": 1.0e09, + "fluid_pp(2)%gamma": 1.0e00 / (1.4e00 - 1.0e00), + "fluid_pp(2)%pi_inf": 0.0, + "fluid_pp(2)%G": 0.0, + } + ) +) diff --git a/examples/1D_impact/case.py b/examples/1D_impact/case.py index c825b1df6b..e0f04d345b 100755 --- a/examples/1D_impact/case.py +++ b/examples/1D_impact/case.py @@ -2,92 +2,80 @@ import math import json -#Numerical setup -Nx = 399 -dx = 1./(1.*(Nx+1)) +# Numerical setup +Nx = 399 +dx = 1.0 / (1.0 * (Nx + 1)) -Tend = 6.4E-05 -Nt = 200 -mydt = Tend/(1.*Nt) +Tend = 6.4e-05 +Nt = 200 +mydt = Tend / (1.0 * Nt) # Configuring case dictionary -print(json.dumps({ +print( + json.dumps( + { # Logistics ================================================ - 'run_time_info' : 'T', - # ========================================================== - + "run_time_info": "T", # Computational Domain Parameters ========================== - 'x_domain%beg' : 0.E+00, - 'x_domain%end' : 1.E+00, - 'm' : Nx, - 'n' : 0, - 'p' : 0, - 'dt' : mydt, - 't_step_start' : 0, - 't_step_stop' : int(Nt), - 't_step_save' : int(math.ceil(Nt/1.)), - # ========================================================== - + "x_domain%beg": 0.0e00, + "x_domain%end": 1.0e00, + "m": Nx, + "n": 0, + "p": 0, + "dt": mydt, + "t_step_start": 0, + "t_step_stop": int(Nt), + "t_step_save": int(math.ceil(Nt / 1.0)), # Simulation Algorithm Parameters ========================== - 'num_patches' : 2, - 'model_eqns' : 2, - 'alt_soundspeed' : 'F', - 'num_fluids' : 1, - 'mpp_lim' : 'F', - 'mixture_err' : 'F', - 'time_stepper' : 3, - 'weno_order' : 3, - 'weno_eps' : 1.E-16, - 'weno_Re_flux' : 'F', - 'weno_avg' : 'F', - 'mapped_weno' : 'F', - 'null_weights' : 'F', - 'mp_weno' : 'F', - 'riemann_solver' : 1, - 'wave_speeds' : 1, - 'avg_state' : 2, - 'bc_x%beg' : -3, - 'bc_x%end' : -3, - # ========================================================== - + "num_patches": 2, + "model_eqns": 2, + "alt_soundspeed": "F", + "num_fluids": 1, + "mpp_lim": "F", + "mixture_err": "F", + "time_stepper": 3, + "weno_order": 3, + "weno_eps": 1.0e-16, + "weno_Re_flux": "F", + "weno_avg": "F", + "mapped_weno": "F", + "null_weights": "F", + "mp_weno": "F", + "riemann_solver": 1, + "wave_speeds": 1, + "avg_state": 2, + "bc_x%beg": -3, + "bc_x%end": -3, # Turning on Hypoelasticity ================================ - 'hypoelasticity' : 'T', - 'fd_order' : 4, - # ========================================================== - + "hypoelasticity": "T", + "fd_order": 4, # Formatted Database Files Structure Parameters ============ - 'format' : 1, - 'precision' : 2, - 'prim_vars_wrt' :'T', - 'parallel_io' :'F', - # ========================================================== - - # Patch 1 L ================================================ - 'patch_icpp(1)%geometry' : 1, - 'patch_icpp(1)%x_centroid' : 0.25, - 'patch_icpp(1)%length_x' : 0.5, - 'patch_icpp(1)%vel(1)' : 10.0, - 'patch_icpp(1)%pres' : 1E+05, - 'patch_icpp(1)%alpha_rho(1)' : 1000, - 'patch_icpp(1)%alpha(1)' : 1., - 'patch_icpp(1)%tau_e(1)' : 0.0, - # ========================================================== - + "format": 1, + "precision": 2, + "prim_vars_wrt": "T", + "parallel_io": "F", + # Patch 1 L ================================================ + "patch_icpp(1)%geometry": 1, + "patch_icpp(1)%x_centroid": 0.25, + "patch_icpp(1)%length_x": 0.5, + "patch_icpp(1)%vel(1)": 10.0, + "patch_icpp(1)%pres": 1e05, + "patch_icpp(1)%alpha_rho(1)": 1000, + "patch_icpp(1)%alpha(1)": 1.0, + "patch_icpp(1)%tau_e(1)": 0.0, # Patch 2 R ================================================ - 'patch_icpp(2)%geometry' : 1, - 'patch_icpp(2)%x_centroid' : 0.75, - 'patch_icpp(2)%length_x' : 0.5, - 'patch_icpp(2)%vel(1)' : -10.0, - 'patch_icpp(2)%pres' : 1E+05, - 'patch_icpp(2)%alpha_rho(1)' : 1000, - 'patch_icpp(2)%alpha(1)' : 1., - 'patch_icpp(2)%tau_e(1)' : 0.0, - # ========================================================== - + "patch_icpp(2)%geometry": 1, + "patch_icpp(2)%x_centroid": 0.75, + "patch_icpp(2)%length_x": 0.5, + "patch_icpp(2)%vel(1)": -10.0, + "patch_icpp(2)%pres": 1e05, + "patch_icpp(2)%alpha_rho(1)": 1000, + "patch_icpp(2)%alpha(1)": 1.0, + "patch_icpp(2)%tau_e(1)": 0.0, # Fluids Physical Parameters =============================== - 'fluid_pp(1)%gamma' : 1.E+00/(4.4E+00-1.E+00), - 'fluid_pp(1)%pi_inf' : 4.4E+00*6.E+08/(4.4E+00 - 1.E+00), - 'fluid_pp(1)%G' : 0.5E+09, - # ========================================================== -})) -# ============================================================================== + "fluid_pp(1)%gamma": 1.0e00 / (4.4e00 - 1.0e00), + "fluid_pp(1)%pi_inf": 4.4e00 * 6.0e08 / (4.4e00 - 1.0e00), + "fluid_pp(1)%G": 0.5e09, + } + ) +) diff --git a/examples/1D_inert_shocktube/case.py b/examples/1D_inert_shocktube/case.py index b2381c21ac..a902e85426 100644 --- a/examples/1D_inert_shocktube/case.py +++ b/examples/1D_inert_shocktube/case.py @@ -1,5 +1,4 @@ #!/usr/bin/env python3 - # References: # + https://doi.org/10.1016/j.compfluid.2013.10.014: 4.3. Multi-component inert shock tube @@ -8,117 +7,106 @@ import cantera as ct -parser = argparse.ArgumentParser( - prog="nD_inert_shocktube", - formatter_class=argparse.ArgumentDefaultsHelpFormatter) - -parser.add_argument("--mfc", type=json.loads, default='{}', metavar="DICT", - help="MFC's toolchain's internal state.") -parser.add_argument("--no-chem", dest='chemistry', default=True, action="store_false", - help="Disable chemistry.") +parser = argparse.ArgumentParser(prog="nD_inert_shocktube", formatter_class=argparse.ArgumentDefaultsHelpFormatter) + +parser.add_argument( + "--mfc", + type=json.loads, + default="{}", + metavar="DICT", + help="MFC's toolchain's internal state.", +) +parser.add_argument( + "--no-chem", + dest="chemistry", + default=True, + action="store_false", + help="Disable chemistry.", +) args = parser.parse_args() -ctfile = 'h2o2.yaml' -sol_L = ct.Solution(ctfile) -sol_L.TPX = 400, 8000, 'H2:2,O2:1,AR:7' -sol_R = ct.Solution(ctfile) -sol_R.TPX = 1200, 80000, 'H2:2,O2:1,AR:7' +ctfile = "h2o2.yaml" +sol_L = ct.Solution(ctfile) +sol_L.TPX = 400, 8000, "H2:2,O2:1,AR:7" +sol_R = ct.Solution(ctfile) +sol_R.TPX = 1200, 80000, "H2:2,O2:1,AR:7" -L = 0.10 -Nx = 400 -dx = L / Nx -dt = 20e-8 +L = 0.10 +Nx = 400 +dx = L / Nx +dt = 20e-8 Tend = 40e-6 -NT = int(Tend / dt) +NT = int(Tend / dt) SAVE_COUNT = 200 -NS = NT // SAVE_COUNT +NS = NT // SAVE_COUNT case = { # Logistics ================================================================ - 'run_time_info' : 'T', - # ========================================================================== - + "run_time_info": "T", # Computational Domain Parameters ========================================== - 'x_domain%beg' : -L/2, - 'x_domain%end' : +L/2, - 'm' : Nx, - 'n' : 0, - 'p' : 0, - 'dt' : float(dt), - 't_step_start' : 0, - 't_step_stop' : NT, - 't_step_save' : NS, - 't_step_print' : NS, - 'parallel_io' : 'F', - # ========================================================================== - + "x_domain%beg": -L / 2, + "x_domain%end": +L / 2, + "m": Nx, + "n": 0, + "p": 0, + "dt": float(dt), + "t_step_start": 0, + "t_step_stop": NT, + "t_step_save": NS, + "t_step_print": NS, + "parallel_io": "F", # Simulation Algorithm Parameters ========================================== - 'model_eqns' : 2, - 'num_fluids' : 1, - 'num_patches' : 2, - 'mpp_lim' : 'F', - 'mixture_err' : 'F', - 'time_stepper' : 3, - 'weno_order' : 5, - 'weno_eps' : 1E-16, - 'weno_avg' : 'F', - 'mapped_weno' : 'T', - 'mp_weno' : 'T', - 'riemann_solver' : 2, - 'wave_speeds' : 2, - 'avg_state' : 1, - 'bc_x%beg' :-2, - 'bc_x%end' :-3, - # ========================================================================== - + "model_eqns": 2, + "num_fluids": 1, + "num_patches": 2, + "mpp_lim": "F", + "mixture_err": "F", + "time_stepper": 3, + "weno_order": 5, + "weno_eps": 1e-16, + "weno_avg": "F", + "mapped_weno": "T", + "mp_weno": "T", + "riemann_solver": 2, + "wave_speeds": 2, + "avg_state": 1, + "bc_x%beg": -2, + "bc_x%end": -3, # Chemistry ================================================================ - 'chemistry' : 'F' if not args.chemistry else 'T', - 'chem_params%diffusion' : 'F', - 'chem_params%reactions' : 'T', - # ========================================================================== - + "chemistry": "F" if not args.chemistry else "T", + "chem_params%diffusion": "F", + "chem_params%reactions": "T", # Formatted Database Files Structure Parameters ============================ - 'format' : 1, - 'precision' : 2, - 'prim_vars_wrt' : 'T', - # ========================================================================== - - # ========================================================================== - 'patch_icpp(1)%geometry' : 1, - 'patch_icpp(1)%x_centroid' : -L/4, - 'patch_icpp(1)%length_x' : L/2, - 'patch_icpp(1)%vel(1)' : 0, - 'patch_icpp(1)%pres' : sol_L.P, - 'patch_icpp(1)%alpha(1)' : 1, - 'patch_icpp(1)%alpha_rho(1)' : sol_L.density, - # ========================================================================== - - # ========================================================================== - 'patch_icpp(2)%geometry' : 1, - 'patch_icpp(2)%x_centroid' : L/4, - 'patch_icpp(2)%length_x' : L/2, - 'patch_icpp(2)%vel(1)' : 0, - 'patch_icpp(2)%pres' : sol_R.P, - 'patch_icpp(2)%alpha(1)' : 1, - 'patch_icpp(2)%alpha_rho(1)' : sol_R.density, - # ========================================================================== - + "format": 1, + "precision": 2, + "prim_vars_wrt": "T", + "patch_icpp(1)%geometry": 1, + "patch_icpp(1)%x_centroid": -L / 4, + "patch_icpp(1)%length_x": L / 2, + "patch_icpp(1)%vel(1)": 0, + "patch_icpp(1)%pres": sol_L.P, + "patch_icpp(1)%alpha(1)": 1, + "patch_icpp(1)%alpha_rho(1)": sol_L.density, + "patch_icpp(2)%geometry": 1, + "patch_icpp(2)%x_centroid": L / 4, + "patch_icpp(2)%length_x": L / 2, + "patch_icpp(2)%vel(1)": 0, + "patch_icpp(2)%pres": sol_R.P, + "patch_icpp(2)%alpha(1)": 1, + "patch_icpp(2)%alpha_rho(1)": sol_R.density, # Fluids Physical Parameters =============================================== - 'fluid_pp(1)%gamma' : 1.0E+00/(1.55E+00-1.0E+00), - 'fluid_pp(1)%pi_inf' : 0, - # ========================================================================== - + "fluid_pp(1)%gamma": 1.0e00 / (1.55e00 - 1.0e00), + "fluid_pp(1)%pi_inf": 0, # Chemistry ================================================================ - 'cantera_file' : ctfile, - # ========================================================================== + "cantera_file": ctfile, } if args.chemistry: for i in range(len(sol_L.Y)): - case[f'patch_icpp(1)%Y({i+1})'] = sol_L.Y[i] - case[f'patch_icpp(2)%Y({i+1})'] = sol_R.Y[i] + case[f"patch_icpp(1)%Y({i+1})"] = sol_L.Y[i] + case[f"patch_icpp(2)%Y({i+1})"] = sol_R.Y[i] -if __name__ == '__main__': +if __name__ == "__main__": print(json.dumps(case)) diff --git a/examples/1D_inert_shocktube/viz.py b/examples/1D_inert_shocktube/viz.py index 0f5b4f754f..6d96f4a8bb 100644 --- a/examples/1D_inert_shocktube/viz.py +++ b/examples/1D_inert_shocktube/viz.py @@ -1,5 +1,4 @@ import mfc.viz - import os import subprocess @@ -13,17 +12,17 @@ os.makedirs("viz", exist_ok=True) -#sns.set_theme(style=mfc.viz.generate_cpg_style()) +# sns.set_theme(style=mfc.viz.generate_cpg_style()) Y_VARS = ["H2", "O2", "H2O", "N2"] variables = [ ("rho", "prim.1"), ("u_x", "prim.2"), - ("p", "prim.3"), - ("E", "cons.3"), + ("p", "prim.3"), + ("E", "cons.3"), *[(f"Y_{name}", f"prim.{5 + sol.species_index(name)}") for name in Y_VARS], - ("T", "prim.15"), + ("T", "prim.15"), ] for variable in tqdm(variables, desc="Loading Variables"): @@ -33,7 +32,10 @@ fig, axes = plt.subplots(2, 3, figsize=(16, 9)) def pad_ylim(ylim, pad=0.1): - return (ylim[0] - pad*(ylim[1] - ylim[0]), ylim[1] + pad*(ylim[1] - ylim[0])) + return ( + ylim[0] - pad * (ylim[1] - ylim[0]), + ylim[1] + pad * (ylim[1] - ylim[0]), + ) case.plot_step(step, "rho", ax=axes[0, 0]) axes[0, 0].set_ylim(*pad_ylim(case.get_minmax_time("rho"))) @@ -41,17 +43,17 @@ def pad_ylim(ylim, pad=0.1): case.plot_step(step, "u_x", ax=axes[0, 1]) axes[0, 1].set_ylim(*pad_ylim(case.get_minmax_time("u_x"))) axes[0, 1].set_ylabel("$u_x$") - case.plot_step(step, "p", ax=axes[1, 0]) + case.plot_step(step, "p", ax=axes[1, 0]) axes[1, 0].set_ylim(*pad_ylim(case.get_minmax_time("p"))) axes[1, 0].set_ylabel("$p$") for y in Y_VARS: case.plot_step(step, f"Y_{y}", ax=axes[1, 1], label=y) - axes[1, 1].set_ylim(0, 1.1*max(case.get_minmax_time(f"Y_{y}")[1] for y in Y_VARS)) + axes[1, 1].set_ylim(0, 1.1 * max(case.get_minmax_time(f"Y_{y}")[1] for y in Y_VARS)) axes[1, 1].set_ylabel("$Y_k$") - case.plot_step(step, "T", ax=axes[1, 2]) + case.plot_step(step, "T", ax=axes[1, 2]) axes[1, 2].set_ylim(*pad_ylim(case.get_minmax_time("T"))) axes[1, 2].set_ylabel("$T$") - case.plot_step(step, "E", ax=axes[0, 2]) + case.plot_step(step, "E", ax=axes[0, 2]) axes[0, 2].set_ylim(*pad_ylim(case.get_minmax_time("E"))) axes[0, 2].set_ylabel("$E$") @@ -59,7 +61,20 @@ def pad_ylim(ylim, pad=0.1): plt.savefig(f"viz/{step:06d}.png") plt.close() -subprocess.run([ - "ffmpeg", "-y", "-framerate", "60", "-pattern_type", "glob", "-i", - "viz/*.png", "-c:v", "libx264", "-pix_fmt", "yuv420p", "viz.mp4" -]) \ No newline at end of file +subprocess.run( + [ + "ffmpeg", + "-y", + "-framerate", + "60", + "-pattern_type", + "glob", + "-i", + "viz/*.png", + "-c:v", + "libx264", + "-pix_fmt", + "yuv420p", + "viz.mp4", + ] +) diff --git a/examples/1D_kapilashocktube/case.py b/examples/1D_kapilashocktube/case.py index d71c5f656c..d662ddf72f 100755 --- a/examples/1D_kapilashocktube/case.py +++ b/examples/1D_kapilashocktube/case.py @@ -1,79 +1,73 @@ #!/usr/bin/env python3 - import json # Configuring case dictionary ================================================== -print(json.dumps({ - # Logistics ================================================================ - 'run_time_info' : 'T', - # ========================================================================== - # Computational Domain Parameters ========================================== - 'x_domain%beg' : 0.E+00, - 'x_domain%end' : 1.E+00, - 'm' : 999, - 'n' : 0, - 'p' : 0, - 'dt' : 4.E-08, - 't_step_start' : 0, - 't_step_stop' : 6025, - 't_step_save' : 100, - # ========================================================================== - # Simulation Algorithm Parameters ========================================== - 'num_patches' : 2, - 'model_eqns' : 2, - 'alt_soundspeed' : 'T', - 'num_fluids' : 2, - 'mpp_lim' : 'F', - 'mixture_err' : 'F', - 'time_stepper' : 3, - 'weno_order' : 5, - 'weno_eps' : 1.E-16, - 'weno_Re_flux' : 'F', - 'weno_avg' : 'F', - 'mapped_weno' : 'T', - 'null_weights' : 'F', - 'mp_weno' : 'F', - 'riemann_solver' : 2, - 'wave_speeds' : 1, - 'avg_state' : 2, - 'bc_x%beg' : -3, - 'bc_x%end' : -3, - # ========================================================================== - # Formatted Database Files Structure Parameters ============================ - 'format' : 1, - 'precision' : 2, - 'prim_vars_wrt' :'T', - 'parallel_io' :'T', - # ========================================================================== - # Patch 1: High pressured water ============================================ - 'patch_icpp(1)%geometry' : 1, - 'patch_icpp(1)%x_centroid' : 0.5E+00, - 'patch_icpp(1)%length_x' : 1.E+00, - 'patch_icpp(1)%vel(1)' : 0.E+00, - 'patch_icpp(1)%pres' : 1.E+09, - 'patch_icpp(1)%alpha_rho(1)' : 1000.E+00, - 'patch_icpp(1)%alpha_rho(2)' : 0., - 'patch_icpp(1)%alpha(1)' : 1.E+00, - 'patch_icpp(1)%alpha(2)' : 0.E+00, - # ========================================================================== - # Patch 2: Air bubble ====================================================== - 'patch_icpp(2)%geometry' : 1, - 'patch_icpp(2)%x_centroid' : 0.85E+00, - 'patch_icpp(2)%length_x' : 0.3E+00, - 'patch_icpp(2)%alter_patch(1)' : 'T', - 'patch_icpp(2)%vel(1)' : 0.E+00, - 'patch_icpp(2)%pres' : 1.E+05, - 'patch_icpp(2)%alpha_rho(1)' : 0., - 'patch_icpp(2)%alpha_rho(2)' : 50.E+0, - 'patch_icpp(2)%alpha(1)' : 0, - 'patch_icpp(2)%alpha(2)' : 1., - # ========================================================================== - # Fluids Physical Parameters =============================================== - 'fluid_pp(1)%gamma' : 1.E+00/(4.4E+00-1.E+00), - 'fluid_pp(1)%pi_inf' : 4.4E+00*6.E+08/(4.4E+00-1.E+00), - 'fluid_pp(2)%gamma' : 1.E+00/(1.4E+00-1.E+00), - 'fluid_pp(2)%pi_inf' : 0.E+00, - # ========================================================================== -})) - -# ============================================================================== +print( + json.dumps( + { + # Logistics ================================================================ + "run_time_info": "T", + # Computational Domain Parameters ========================================== + "x_domain%beg": 0.0e00, + "x_domain%end": 1.0e00, + "m": 999, + "n": 0, + "p": 0, + "dt": 4.0e-08, + "t_step_start": 0, + "t_step_stop": 6025, + "t_step_save": 100, + # Simulation Algorithm Parameters ========================================== + "num_patches": 2, + "model_eqns": 2, + "alt_soundspeed": "T", + "num_fluids": 2, + "mpp_lim": "F", + "mixture_err": "F", + "time_stepper": 3, + "weno_order": 5, + "weno_eps": 1.0e-16, + "weno_Re_flux": "F", + "weno_avg": "F", + "mapped_weno": "T", + "null_weights": "F", + "mp_weno": "F", + "riemann_solver": 2, + "wave_speeds": 1, + "avg_state": 2, + "bc_x%beg": -3, + "bc_x%end": -3, + # Formatted Database Files Structure Parameters ============================ + "format": 1, + "precision": 2, + "prim_vars_wrt": "T", + "parallel_io": "T", + # Patch 1: High pressured water ============================================ + "patch_icpp(1)%geometry": 1, + "patch_icpp(1)%x_centroid": 0.5e00, + "patch_icpp(1)%length_x": 1.0e00, + "patch_icpp(1)%vel(1)": 0.0e00, + "patch_icpp(1)%pres": 1.0e09, + "patch_icpp(1)%alpha_rho(1)": 1000.0e00, + "patch_icpp(1)%alpha_rho(2)": 0.0, + "patch_icpp(1)%alpha(1)": 1.0e00, + "patch_icpp(1)%alpha(2)": 0.0e00, + # Patch 2: Air bubble ====================================================== + "patch_icpp(2)%geometry": 1, + "patch_icpp(2)%x_centroid": 0.85e00, + "patch_icpp(2)%length_x": 0.3e00, + "patch_icpp(2)%alter_patch(1)": "T", + "patch_icpp(2)%vel(1)": 0.0e00, + "patch_icpp(2)%pres": 1.0e05, + "patch_icpp(2)%alpha_rho(1)": 0.0, + "patch_icpp(2)%alpha_rho(2)": 50.0e0, + "patch_icpp(2)%alpha(1)": 0, + "patch_icpp(2)%alpha(2)": 1.0, + # Fluids Physical Parameters =============================================== + "fluid_pp(1)%gamma": 1.0e00 / (4.4e00 - 1.0e00), + "fluid_pp(1)%pi_inf": 4.4e00 * 6.0e08 / (4.4e00 - 1.0e00), + "fluid_pp(2)%gamma": 1.0e00 / (1.4e00 - 1.0e00), + "fluid_pp(2)%pi_inf": 0.0e00, + } + ) +) diff --git a/examples/1D_laxshocktube/case.py b/examples/1D_laxshocktube/case.py index ea286fcdb9..a5a9b1e89a 100644 --- a/examples/1D_laxshocktube/case.py +++ b/examples/1D_laxshocktube/case.py @@ -1,84 +1,72 @@ #!/usr/bin/env python3 - import math import json # Numerical setup Nx = 200 -dx = 1./(1.*(Nx+1)) +dx = 1.0 / (1.0 * (Nx + 1)) Tend, Nt = 0.14, 1000 -mydt = Tend/(1.*Nt) +mydt = Tend / (1.0 * Nt) # Configuring case dictionary -print(json.dumps({ - # Logistics ================================================================ - 'run_time_info' : 'T', - # ========================================================================== - - # Computational Domain Parameters ========================================== - 'x_domain%beg' : 0.E+00, - 'x_domain%end' : 1.E+00, - 'm' : Nx, - 'n' : 0, - 'p' : 0, - 'dt' : mydt, - 't_step_start' : 0, - 't_step_stop' : int(Nt), - 't_step_save' : int(math.ceil(Nt/10.)), - # ========================================================================== - - # Simulation Algorithm Parameters ========================================== - 'num_patches' : 2, - 'model_eqns' : 2, - 'alt_soundspeed' : 'F', - 'num_fluids' : 1, - 'mpp_lim' : 'F', - 'mixture_err' : 'F', - 'time_stepper' : 3, - 'weno_order' : 5, - 'weno_eps' : 1.E-16, - 'mapped_weno' : 'T', - 'null_weights' : 'F', - 'mp_weno' : 'F', - 'riemann_solver' : 2, - 'wave_speeds' : 1, - 'avg_state' : 2, - 'bc_x%beg' : -3, - 'bc_x%end' : -3, - # ========================================================================== - - # Formatted Database Files Structure Parameters ============================ - 'format' : 1, - 'precision' : 2, - 'prim_vars_wrt' :'T', - 'parallel_io' :'F', - # ========================================================================== - - # Patch 1 L ================================================================ - 'patch_icpp(1)%geometry' : 1, - 'patch_icpp(1)%x_centroid' : 0.25, - 'patch_icpp(1)%length_x' : 0.5, - 'patch_icpp(1)%vel(1)' : 0.698, - 'patch_icpp(1)%pres' : 3.528, - 'patch_icpp(1)%alpha_rho(1)' : 0.445E+00, - 'patch_icpp(1)%alpha(1)' : 1., - # ========================================================================== - - # Patch 2 R ================================================================ - 'patch_icpp(2)%geometry' : 1, - 'patch_icpp(2)%x_centroid' : 0.75, - 'patch_icpp(2)%length_x' : 0.5, - 'patch_icpp(2)%vel(1)' : 0.0, - 'patch_icpp(2)%pres' : 0.571, - 'patch_icpp(2)%alpha_rho(1)' : 0.5E+00, - 'patch_icpp(2)%alpha(1)' : 1., - # ========================================================================== - - # Fluids Physical Parameters =============================================== - 'fluid_pp(1)%gamma' : 1.E+00/(1.4-1.E+00), - 'fluid_pp(1)%pi_inf' : 0.0, - # ========================================================================== -})) - -# ============================================================================== +print( + json.dumps( + { + # Logistics ================================================================ + "run_time_info": "T", + # Computational Domain Parameters ========================================== + "x_domain%beg": 0.0e00, + "x_domain%end": 1.0e00, + "m": Nx, + "n": 0, + "p": 0, + "dt": mydt, + "t_step_start": 0, + "t_step_stop": int(Nt), + "t_step_save": int(math.ceil(Nt / 10.0)), + # Simulation Algorithm Parameters ========================================== + "num_patches": 2, + "model_eqns": 2, + "alt_soundspeed": "F", + "num_fluids": 1, + "mpp_lim": "F", + "mixture_err": "F", + "time_stepper": 3, + "weno_order": 5, + "weno_eps": 1.0e-16, + "mapped_weno": "T", + "null_weights": "F", + "mp_weno": "F", + "riemann_solver": 2, + "wave_speeds": 1, + "avg_state": 2, + "bc_x%beg": -3, + "bc_x%end": -3, + # Formatted Database Files Structure Parameters ============================ + "format": 1, + "precision": 2, + "prim_vars_wrt": "T", + "parallel_io": "F", + # Patch 1 L ================================================================ + "patch_icpp(1)%geometry": 1, + "patch_icpp(1)%x_centroid": 0.25, + "patch_icpp(1)%length_x": 0.5, + "patch_icpp(1)%vel(1)": 0.698, + "patch_icpp(1)%pres": 3.528, + "patch_icpp(1)%alpha_rho(1)": 0.445e00, + "patch_icpp(1)%alpha(1)": 1.0, + # Patch 2 R ================================================================ + "patch_icpp(2)%geometry": 1, + "patch_icpp(2)%x_centroid": 0.75, + "patch_icpp(2)%length_x": 0.5, + "patch_icpp(2)%vel(1)": 0.0, + "patch_icpp(2)%pres": 0.571, + "patch_icpp(2)%alpha_rho(1)": 0.5e00, + "patch_icpp(2)%alpha(1)": 1.0, + # Fluids Physical Parameters =============================================== + "fluid_pp(1)%gamma": 1.0e00 / (1.4 - 1.0e00), + "fluid_pp(1)%pi_inf": 0.0, + } + ) +) diff --git a/examples/1D_poly_bubscreen/case.py b/examples/1D_poly_bubscreen/case.py index c7a6b2a47b..37ec997bb6 100644 --- a/examples/1D_poly_bubscreen/case.py +++ b/examples/1D_poly_bubscreen/case.py @@ -1,219 +1,169 @@ #!/usr/bin/env python3 - import math import json -x0 = 10.E-06 -p0 = 112.9E+03 -rho0 = 1.E+03 -c0 = math.sqrt( p0/rho0 ) -patm = 1. +x0 = 10.0e-06 +p0 = 112.9e03 +rho0 = 1.0e03 +c0 = math.sqrt(p0 / rho0) +patm = 1.0 -#water props +# water props n_tait = 7.15 -B_tait = 306.E+06 / p0 -mul0 = 1.002E-03 # viscosity +B_tait = 306.0e06 / p0 +mul0 = 1.002e-03 # viscosity # ss = 1.E-12 # surface tension -ss = 0.07275 # surface tension -pv = 2.3388E+03 # vapor pressure +ss = 0.07275 # surface tension +pv = 2.3388e03 # vapor pressure # Preston parameters gamma_v = 1.33 -M_v = 18.02 -mu_v = 0.8816E-05 -k_v = 0.019426 +M_v = 18.02 +mu_v = 0.8816e-05 +k_v = 0.019426 # air props gamma_n = 1.4 -M_n = 28.97 -mu_n = 1.8E-05 -k_n = 0.02556 +M_n = 28.97 +mu_n = 1.8e-05 +k_n = 0.02556 # air props # gamma_gas = gamma_n gamma_gas = 1.4 # reference bubble size -R0ref = 10.E-06 -pa = 0.1 * 1.E+06 / 101325. +R0ref = 10.0e-06 +pa = 0.1 * 1.0e06 / 101325.0 # Characteristic velocity -uu = math.sqrt( p0/rho0 ) +uu = math.sqrt(p0 / rho0) # Cavitation number -Ca = (p0 - pv)/(rho0*(uu**2.)) -#Ca = 1. +Ca = (p0 - pv) / (rho0 * (uu**2.0)) +# Ca = 1. # Weber number # We = rho0*(uu**2.)*R0ref/ss -We = p0*R0ref/ss +We = p0 * R0ref / ss # Inv. bubble Reynolds number -Re_inv = mul0/(rho0*uu*R0ref) - -#IC setup -vf0 = 1.E-4 -n0 = vf0/(math.pi*4.E+00/3.E+00) +Re_inv = mul0 / (rho0 * uu * R0ref) -cact = 1475. -t0 = x0/c0 +# IC setup +vf0 = 1.0e-4 +n0 = vf0 / (math.pi * 4.0e00 / 3.0e00) -myr0 = R0ref +cact = 1475.0 +t0 = x0 / c0 -cfl = 0.4 -Nx = 20 -Ldomain = 20.E-03 -L = Ldomain/x0 -dx = L/float(Nx) -dt = cfl*dx*c0/cact -Lpulse = 0.3*Ldomain -Tpulse = Lpulse/cact -Tfinal = 1.*10.*Tpulse*c0/x0 -Nt = int(Tfinal/dt) +myr0 = R0ref -Nt = 1000 +cfl = 0.4 +Nx = 20 +Ldomain = 20.0e-03 +L = Ldomain / x0 +dx = L / float(Nx) +dt = cfl * dx * c0 / cact +Lpulse = 0.3 * Ldomain +Tpulse = Lpulse / cact +Tfinal = 1.0 * 10.0 * Tpulse * c0 / x0 +Nt = int(Tfinal / dt) -Nfiles = 20. -Nout = int(math.ceil(Nt/Nfiles)) -Nt = int(Nout*Nfiles) +Nt = 1000 -# ============================================================================== +Nfiles = 20.0 +Nout = int(math.ceil(Nt / Nfiles)) +Nt = int(Nout * Nfiles) # Configuring case dictionary -print(json.dumps({ - # Logistics ================================================================ - 'run_time_info' : 'F', - # ========================================================================== - # Computational Domain Parameters ========================================== - 'x_domain%beg' : -10.E-03/x0, - 'x_domain%end' : 10.E-03/x0, - 'stretch_x' : 'F', - 'cyl_coord' : 'F', - 'm' : Nx, - 'n' : 0, - 'p' : 0, - 'dt' : dt, - 't_step_start' : 0, - 't_step_stop' : 1, - 't_step_save' : 1, - # ========================================================================== - # Simulation Algorithm Parameters ========================================== - 'num_patches' : 1, - 'model_eqns' : 2, - 'alt_soundspeed' : 'F', - 'num_fluids' : 1, - 'mpp_lim' : 'F', - 'mixture_err' : 'F', - 'time_stepper' : 1, - 'weno_order' : 1, - 'weno_eps' : 1.E-16, - 'weno_Re_flux' : 'F', - 'weno_avg' : 'F', - 'mapped_weno' : 'F', - 'null_weights' : 'F', - 'mp_weno' : 'F', - 'riemann_solver' : 2, - 'wave_speeds' : 1, - 'avg_state' : 2, - 'bc_x%beg' : -1, - 'bc_x%end' : -1, - # ========================================================================== - # Formatted Database Files Structure Parameters ============================ - 'format' : 1, - 'precision' : 2, - 'prim_vars_wrt' :'T', - 'parallel_io' :'F', - 'fd_order' : 1, - #'schlieren_wrt' :'T', - 'probe_wrt' :'T', - 'num_probes' : 1, - 'probe(1)%x' : 0., - # ========================================================================== - # Patch 1 _ Background ===================================================== - 'patch_icpp(1)%geometry' : 1, - 'patch_icpp(1)%x_centroid' : 0., - 'patch_icpp(1)%length_x' : 20.E-03/x0, - 'patch_icpp(1)%vel(1)' : 0, - 'patch_icpp(1)%pres' : 1, - 'patch_icpp(1)%alpha_rho(1)' : (1.-vf0)*1.E+03/rho0, - 'patch_icpp(1)%alpha(1)' : vf0, - 'patch_icpp(1)%r0' : 1., - 'patch_icpp(1)%v0' : 0.0E+00, - # 'patch_icpp(1)%geometry' : 1, - # 'patch_icpp(1)%x_centroid' : 0., - # 'patch_icpp(1)%length_x' : 20.E-03/x0, - # 'patch_icpp(1)%vel(1)' : 0, - # 'patch_icpp(1)%pres' : 1, - # 'patch_icpp(1)%alpha_rho(1)' : (1.-1.E-12)*1.E+03/rho0, - # 'patch_icpp(1)%alpha(1)' : 1.E-12, - # 'patch_icpp(1)%r0' : 1., - # 'patch_icpp(1)%v0' : 0.0E+00, - # ========================================================== - # Patch 2 Screen =========================================== - # 'patch_icpp(2)%geometry' : 1, - # 'patch_icpp(2)%x_centroid' : 0., - # 'patch_icpp(2)%length_x' : 5.E-03/x0, - # 'patch_icpp(2)%alter_patch(1)' : 'T', - # 'patch_icpp(2)%vel(1)' : 0, - # 'patch_icpp(2)%pres' : 1, - # 'patch_icpp(2)%alpha_rho(1)' : (1.-vf0)*1.E+03/rho0, - # 'patch_icpp(2)%alpha(1)' : vf0, - # 'patch_icpp(2)%r0' : 1., - # 'patch_icpp(2)%v0' : 0., - # ========================================================================== - # Fluids Physical Parameters =============================================== - # Surrounding liquid - 'fluid_pp(1)%gamma' : 1.E+00/(n_tait-1.E+00), - 'fluid_pp(1)%pi_inf' : n_tait*B_tait/(n_tait-1.), - 'fluid_pp(1)%mul0' : mul0, - 'fluid_pp(1)%ss' : ss, - 'fluid_pp(1)%pv' : pv, - 'fluid_pp(1)%gamma_v' : gamma_v, - 'fluid_pp(1)%M_v' : M_v, - 'fluid_pp(1)%mu_v' : mu_v, - 'fluid_pp(1)%k_v' : k_v, - - # Last fluid_pp is always reserved for bubble gas state =================== - # if applicable ========================================================== - 'fluid_pp(2)%gamma' : 1./(gamma_gas-1.), - 'fluid_pp(2)%pi_inf' : 0.0E+00, - 'fluid_pp(2)%gamma_v' : gamma_n, - 'fluid_pp(2)%M_v' : M_n, - 'fluid_pp(2)%mu_v' : mu_n, - 'fluid_pp(2)%k_v' : k_n, - # ========================================================================== - # Non-polytropic gas compression model AND/OR Tait EOS ===================== - 'pref' : p0, - 'rhoref' : rho0, - # ========================================================================== - # Bubbles ================================================================== - 'bubbles_euler' : 'T', - 'bubble_model' : 2, - 'polytropic' : 'T', - # 'polydisperse' : 'T', - 'R0_type' : 1, - # 'polydisperse' : 'F', - # 'poly_sigma' : 0.1, - 'thermal' : 3, - 'R0ref' : myr0, - # 'nb' : 3, - 'nb' : 1, - 'Ca' : Ca, - 'Web' : We, - 'Re_inv' : Re_inv, - # 'qbmm' : 'T', - # 'dist_type' : 2, - # 'sigR' : 0.1, - # 'sigV' : 0.1, - # 'rhoRV' : 0.0, - # ========================================================================== - # Acoustic source ========================================================== - # 'acoustic_source' : 'F', - # 'num_source' : 1, - # 'acoustic(1)%loc(1)' : -8.E-03/x0, - # 'acoustic(1)%npulse' : 1, - # 'acoustic(1)%dir' : 1., - # 'acoustic(1)%pulse' : 1, - # 'acoustic(1)%mag' : 1*pa, - # 'acoustic(1)%length' : (1./(300000.))*cact/x0, - # ========================================================================== -})) - -# ============================================================================== +print( + json.dumps( + { + # Logistics ================================================================ + "run_time_info": "F", + # Computational Domain Parameters ========================================== + "x_domain%beg": -10.0e-03 / x0, + "x_domain%end": 10.0e-03 / x0, + "stretch_x": "F", + "cyl_coord": "F", + "m": Nx, + "n": 0, + "p": 0, + "dt": dt, + "t_step_start": 0, + "t_step_stop": 1, + "t_step_save": 1, + # Simulation Algorithm Parameters ========================================== + "num_patches": 1, + "model_eqns": 2, + "alt_soundspeed": "F", + "num_fluids": 1, + "mpp_lim": "F", + "mixture_err": "F", + "time_stepper": 1, + "weno_order": 1, + "weno_eps": 1.0e-16, + "weno_Re_flux": "F", + "weno_avg": "F", + "mapped_weno": "F", + "null_weights": "F", + "mp_weno": "F", + "riemann_solver": 2, + "wave_speeds": 1, + "avg_state": 2, + "bc_x%beg": -1, + "bc_x%end": -1, + # Formatted Database Files Structure Parameters ============================ + "format": 1, + "precision": 2, + "prim_vars_wrt": "T", + "parallel_io": "F", + "fd_order": 1, + #'schlieren_wrt' :'T', + "probe_wrt": "T", + "num_probes": 1, + "probe(1)%x": 0.0, + # Patch 1 _ Background ===================================================== + "patch_icpp(1)%geometry": 1, + "patch_icpp(1)%x_centroid": 0.0, + "patch_icpp(1)%length_x": 20.0e-03 / x0, + "patch_icpp(1)%vel(1)": 0, + "patch_icpp(1)%pres": 1, + "patch_icpp(1)%alpha_rho(1)": (1.0 - vf0) * 1.0e03 / rho0, + "patch_icpp(1)%alpha(1)": vf0, + "patch_icpp(1)%r0": 1.0, + "patch_icpp(1)%v0": 0.0e00, + # Fluids Physical Parameters =============================================== + # Surrounding liquid + "fluid_pp(1)%gamma": 1.0e00 / (n_tait - 1.0e00), + "fluid_pp(1)%pi_inf": n_tait * B_tait / (n_tait - 1.0), + "fluid_pp(1)%mul0": mul0, + "fluid_pp(1)%ss": ss, + "fluid_pp(1)%pv": pv, + "fluid_pp(1)%gamma_v": gamma_v, + "fluid_pp(1)%M_v": M_v, + "fluid_pp(1)%mu_v": mu_v, + "fluid_pp(1)%k_v": k_v, + # Last fluid_pp is always reserved for bubble gas state =================== + # if applicable ========================================================== + "fluid_pp(2)%gamma": 1.0 / (gamma_gas - 1.0), + "fluid_pp(2)%pi_inf": 0.0e00, + "fluid_pp(2)%gamma_v": gamma_n, + "fluid_pp(2)%M_v": M_n, + "fluid_pp(2)%mu_v": mu_n, + "fluid_pp(2)%k_v": k_n, + # Non-polytropic gas compression model AND/OR Tait EOS ===================== + "pref": p0, + "rhoref": rho0, + # Bubbles ================================================================== + "bubbles_euler": "T", + "bubble_model": 2, + "polytropic": "T", + "R0_type": 1, + "thermal": 3, + "R0ref": myr0, + "nb": 1, + "Ca": Ca, + "Web": We, + "Re_inv": Re_inv, + } + ) +) diff --git a/examples/1D_qbmm/case.py b/examples/1D_qbmm/case.py index 8642d2e9ca..1efd795251 100644 --- a/examples/1D_qbmm/case.py +++ b/examples/1D_qbmm/case.py @@ -1,207 +1,189 @@ #!/usr/bin/env python2 - import math import json -x0 = 10.E-06 -p0 = 101325. -rho0 = 1.E+03 -c0 = math.sqrt( p0/rho0 ) -patm = 1. +x0 = 10.0e-06 +p0 = 101325.0 +rho0 = 1.0e03 +c0 = math.sqrt(p0 / rho0) +patm = 1.0 -#water props -n_tait = 7.1 -B_tait = 306.E+06 / p0 -mul0 = 1.002E-03 #viscosity -ss = 0.07275 #surface tension -pv = 2.3388E+03 #vapor pressure +# water props +n_tait = 7.1 +B_tait = 306.0e06 / p0 +mul0 = 1.002e-03 # viscosity +ss = 0.07275 # surface tension +pv = 2.3388e03 # vapor pressure gamma_v = 1.33 -M_v = 18.02 -mu_v = 0.8816E-05 -k_v = 0.019426 +M_v = 18.02 +mu_v = 0.8816e-05 +k_v = 0.019426 -#air props +# air props gamma_n = 1.4 -M_n = 28.97 -mu_n = 1.8E-05 -k_n = 0.02556 +M_n = 28.97 +mu_n = 1.8e-05 +k_n = 0.02556 -#air props +# air props # gamma_gas = gamma_n gamma_gas = 1.4 -#reference bubble size -R0ref = 10.E-06 - -pa = 0.1 * 1.E+06 / 101325. - -#Characteristic velocity -uu = math.sqrt( p0/rho0 ) -#Cavitation number -Ca = (p0 - pv)/(rho0*(uu**2.)) -#Weber number -We = rho0*(uu**2.)*R0ref/ss -#Inv. bubble Reynolds number -Re_inv = mul0/(rho0*uu*R0ref) - -#IC setup -vf0 = 0.04 -n0 = vf0/(math.pi*4.E+00/3.E+00) - -cact = 1475. -t0 = x0/c0 - -nbubbles = 1 -myr0 = R0ref - -cfl = 0.1 -Nx = 400 -Ldomain = 20.E-03 -L = Ldomain/x0 -dx = L/float(Nx) -dt = cfl*dx*c0/cact -Lpulse = 0.3*Ldomain -Tpulse = Lpulse/cact -Tfinal = 0.25*10.*Tpulse*c0/x0 -Nt = int(Tfinal/dt) +# reference bubble size +R0ref = 10.0e-06 + +pa = 0.1 * 1.0e06 / 101325.0 + +# Characteristic velocity +uu = math.sqrt(p0 / rho0) +# Cavitation number +Ca = (p0 - pv) / (rho0 * (uu**2.0)) +# Weber number +We = rho0 * (uu**2.0) * R0ref / ss +# Inv. bubble Reynolds number +Re_inv = mul0 / (rho0 * uu * R0ref) + +# IC setup +vf0 = 0.04 +n0 = vf0 / (math.pi * 4.0e00 / 3.0e00) + +cact = 1475.0 +t0 = x0 / c0 + +nbubbles = 1 +myr0 = R0ref + +cfl = 0.1 +Nx = 400 +Ldomain = 20.0e-03 +L = Ldomain / x0 +dx = L / float(Nx) +dt = cfl * dx * c0 / cact +Lpulse = 0.3 * Ldomain +Tpulse = Lpulse / cact +Tfinal = 0.25 * 10.0 * Tpulse * c0 / x0 +Nt = int(Tfinal / dt) dt = dt * 0.1 # print('dt: ',dt) -Nfiles = 20. -Nout = int(math.ceil(Nt/Nfiles)) -Nt = int(Nout*Nfiles) +Nfiles = 20.0 +Nout = int(math.ceil(Nt / Nfiles)) +Nt = int(Nout * Nfiles) # Configuring case dictionary -print(json.dumps({ - # Logistics ================================================ - 'run_time_info' : 'F', - # ========================================================== - - # Computational Domain Parameters ========================== - 'x_domain%beg' : -10.E-03/x0, - 'x_domain%end' : 10.E-03/x0, - 'stretch_x' : 'F', - 'cyl_coord' : 'F', - 'm' : Nx, - 'n' : 0, - 'p' : 0, - 'dt' : dt, - 't_step_start' : 0, - 't_step_stop' : 800, - # 't_step_stop' : 4, - 't_step_save' : 80, - # 't_step_save' : 1, - # ========================================================== - - # Simulation Algorithm Parameters ========================== - 'num_patches' : 2, - 'model_eqns' : 2, - 'alt_soundspeed' : 'F', - 'num_fluids' : 1, - 'mpp_lim' : 'F', - 'mixture_err' : 'F', - 'time_stepper' : 3, - 'weno_order' : 5, - 'weno_eps' : 1.E-16, - 'weno_Re_flux' : 'F', - 'weno_avg' : 'F', - 'mapped_weno' : 'T', - 'null_weights' : 'F', - 'mp_weno' : 'T', - 'riemann_solver' : 2, - 'wave_speeds' : 1, - 'avg_state' : 2, - 'bc_x%beg' : -8, - 'bc_x%end' : -8, - # ========================================================== - - # Formatted Database Files Structure Parameters ============ - 'format' : 1, - 'precision' : 2, - 'prim_vars_wrt' :'T', - 'parallel_io' :'T', - 'fd_order' : 1, - #'schlieren_wrt' :'T', - 'probe_wrt' :'T', - 'num_probes' : 1, - 'probe(1)%x' : 0., - # ========================================================== - - # Patch 1 _ Background ===================================== - 'patch_icpp(1)%geometry' : 1, - 'patch_icpp(1)%x_centroid' : 0., - 'patch_icpp(1)%length_x' : 20.E-03/x0, - 'patch_icpp(1)%vel(1)' : 0.0, - 'patch_icpp(1)%pres' : 1, - 'patch_icpp(1)%alpha_rho(1)' : (1.-1.E-12)*1.E+03/rho0, - 'patch_icpp(1)%alpha(1)' : 1.E-12, - 'patch_icpp(1)%r0' : 1., - 'patch_icpp(1)%v0' : 0.0E+00, - # ========================================================== - - # Patch 2 Screen =========================================== - 'patch_icpp(2)%geometry' : 1, - 'patch_icpp(2)%x_centroid' : 0., - 'patch_icpp(2)%length_x' : 5.E-03/x0, - # 'patch_icpp(1)%length_x' : 20.E-03/x0, - 'patch_icpp(2)%alter_patch(1)' : 'T', - 'patch_icpp(2)%vel(1)' : 0.0, - 'patch_icpp(2)%pres' : 1, - 'patch_icpp(2)%alpha_rho(1)' : (1.-vf0)*1.E+03/rho0, - 'patch_icpp(2)%alpha(1)' : vf0, - 'patch_icpp(2)%r0' : 1., - 'patch_icpp(2)%v0' : 0., - # ========================================================== - - # Fluids Physical Parameters =============================== - # Surrounding liquid - 'fluid_pp(1)%gamma' : 1.E+00/(n_tait-1.E+00), - 'fluid_pp(1)%pi_inf' : n_tait*B_tait/(n_tait-1.), - 'fluid_pp(1)%mul0' : mul0, - 'fluid_pp(1)%ss' : ss, - 'fluid_pp(1)%pv' : pv, - 'fluid_pp(1)%gamma_v' : gamma_v, - 'fluid_pp(1)%M_v' : M_v, - 'fluid_pp(1)%mu_v' : mu_v, - 'fluid_pp(1)%k_v' : k_v, - - # Last fluid_pp is always reserved for bubble gas state === - # if applicable ========================================== - 'fluid_pp(2)%gamma' : 1./(gamma_gas-1.), - 'fluid_pp(2)%pi_inf' : 0.0E+00, - 'fluid_pp(2)%gamma_v' : gamma_n, - 'fluid_pp(2)%M_v' : M_n, - 'fluid_pp(2)%mu_v' : mu_n, - 'fluid_pp(2)%k_v' : k_n, - # ========================================================== - - # Non-polytropic gas compression model AND/OR Tait EOS ===== - 'pref' : p0, - 'rhoref' : rho0, - # ========================================================== - - # Bubbles ================================================== - 'bubbles_euler' : 'T', - 'bubble_model' : 2, - 'polytropic' : 'F', - 'polydisperse' : 'T', - 'R0_type' : 1, - 'poly_sigma' : 0.3, - 'thermal' : 3, - 'R0ref' : myr0, - 'nb' : 3, - 'Ca' : Ca, - 'Web' : We, - 'Re_inv' : Re_inv, - 'qbmm' : 'T', - 'dist_type' : 2, - 'sigR' : 0.1, - 'sigV' : 0.1, - 'rhoRV' : 0.0, - # ========================================================== - -})) - -# ============================================================================== +print( + json.dumps( + { + # Logistics ================================================ + "run_time_info": "F", + # Computational Domain Parameters ========================== + "x_domain%beg": -10.0e-03 / x0, + "x_domain%end": 10.0e-03 / x0, + "stretch_x": "F", + "cyl_coord": "F", + "m": Nx, + "n": 0, + "p": 0, + "dt": dt, + "t_step_start": 0, + "t_step_stop": 800, + # 't_step_stop' : 4, + "t_step_save": 80, + # 't_step_save' : 1, + # Simulation Algorithm Parameters ========================== + "num_patches": 2, + "model_eqns": 2, + "alt_soundspeed": "F", + "num_fluids": 1, + "mpp_lim": "F", + "mixture_err": "F", + "time_stepper": 3, + "weno_order": 5, + "weno_eps": 1.0e-16, + "weno_Re_flux": "F", + "weno_avg": "F", + "mapped_weno": "T", + "null_weights": "F", + "mp_weno": "T", + "riemann_solver": 2, + "wave_speeds": 1, + "avg_state": 2, + "bc_x%beg": -8, + "bc_x%end": -8, + # Formatted Database Files Structure Parameters ============ + "format": 1, + "precision": 2, + "prim_vars_wrt": "T", + "parallel_io": "T", + "fd_order": 1, + #'schlieren_wrt' :'T', + "probe_wrt": "T", + "num_probes": 1, + "probe(1)%x": 0.0, + # Patch 1 _ Background ===================================== + "patch_icpp(1)%geometry": 1, + "patch_icpp(1)%x_centroid": 0.0, + "patch_icpp(1)%length_x": 20.0e-03 / x0, + "patch_icpp(1)%vel(1)": 0.0, + "patch_icpp(1)%pres": 1, + "patch_icpp(1)%alpha_rho(1)": (1.0 - 1.0e-12) * 1.0e03 / rho0, + "patch_icpp(1)%alpha(1)": 1.0e-12, + "patch_icpp(1)%r0": 1.0, + "patch_icpp(1)%v0": 0.0e00, + # Patch 2 Screen =========================================== + "patch_icpp(2)%geometry": 1, + "patch_icpp(2)%x_centroid": 0.0, + "patch_icpp(2)%length_x": 5.0e-03 / x0, + # 'patch_icpp(1)%length_x' : 20.E-03/x0, + "patch_icpp(2)%alter_patch(1)": "T", + "patch_icpp(2)%vel(1)": 0.0, + "patch_icpp(2)%pres": 1, + "patch_icpp(2)%alpha_rho(1)": (1.0 - vf0) * 1.0e03 / rho0, + "patch_icpp(2)%alpha(1)": vf0, + "patch_icpp(2)%r0": 1.0, + "patch_icpp(2)%v0": 0.0, + # Fluids Physical Parameters =============================== + # Surrounding liquid + "fluid_pp(1)%gamma": 1.0e00 / (n_tait - 1.0e00), + "fluid_pp(1)%pi_inf": n_tait * B_tait / (n_tait - 1.0), + "fluid_pp(1)%mul0": mul0, + "fluid_pp(1)%ss": ss, + "fluid_pp(1)%pv": pv, + "fluid_pp(1)%gamma_v": gamma_v, + "fluid_pp(1)%M_v": M_v, + "fluid_pp(1)%mu_v": mu_v, + "fluid_pp(1)%k_v": k_v, + # Last fluid_pp is always reserved for bubble gas state === + # if applicable ========================================== + "fluid_pp(2)%gamma": 1.0 / (gamma_gas - 1.0), + "fluid_pp(2)%pi_inf": 0.0e00, + "fluid_pp(2)%gamma_v": gamma_n, + "fluid_pp(2)%M_v": M_n, + "fluid_pp(2)%mu_v": mu_n, + "fluid_pp(2)%k_v": k_n, + # Non-polytropic gas compression model AND/OR Tait EOS ===== + "pref": p0, + "rhoref": rho0, + # Bubbles ================================================== + "bubbles_euler": "T", + "bubble_model": 2, + "polytropic": "F", + "polydisperse": "T", + "R0_type": 1, + "poly_sigma": 0.3, + "thermal": 3, + "R0ref": myr0, + "nb": 3, + "Ca": Ca, + "Web": We, + "Re_inv": Re_inv, + "qbmm": "T", + "dist_type": 2, + "sigR": 0.1, + "sigV": 0.1, + "rhoRV": 0.0, + } + ) +) diff --git a/examples/1D_reactive_shocktube/case.py b/examples/1D_reactive_shocktube/case.py index 832f2dbde6..43dd1a6f73 100644 --- a/examples/1D_reactive_shocktube/case.py +++ b/examples/1D_reactive_shocktube/case.py @@ -1,5 +1,4 @@ #!/usr/bin/env python3 - # References: # + https://doi.org/10.1016/j.ijhydene.2023.03.190: Verification of numerical method # + https://doi.org/10.1016/j.compfluid.2013.10.014: 4.7. Multi-species reactive shock tube @@ -7,119 +6,112 @@ import json, argparse import cantera as ct -parser = argparse.ArgumentParser( - prog="1D_reactive_shocktube", - formatter_class=argparse.ArgumentDefaultsHelpFormatter) - -parser.add_argument("--mfc", type=json.loads, default='{}', metavar="DICT", - help="MFC's toolchain's internal state.") -parser.add_argument("--no-chem", dest='chemistry', default=True, action="store_false", - help="Disable chemistry.") -parser.add_argument("--scale", type=float, default=1, help="Scale.") +parser = argparse.ArgumentParser(prog="1D_reactive_shocktube", formatter_class=argparse.ArgumentDefaultsHelpFormatter) + +parser.add_argument( + "--mfc", + type=json.loads, + default="{}", + metavar="DICT", + help="MFC's toolchain's internal state.", +) +parser.add_argument( + "--no-chem", + dest="chemistry", + default=True, + action="store_false", + help="Disable chemistry.", +) +parser.add_argument("--scale", type=float, default=1, help="Scale.") args = parser.parse_args() -ctfile = 'h2o2.yaml' -sol_L = ct.Solution(ctfile) -sol_L.DPX = 0.072, 7173, 'H2:2,O2:1,AR:7' +ctfile = "h2o2.yaml" +sol_L = ct.Solution(ctfile) +sol_L.DPX = 0.072, 7173, "H2:2,O2:1,AR:7" -sol_R = ct.Solution(ctfile) -sol_R.DPX = 0.18075, 35594, 'H2:2,O2:1,AR:7' +sol_R = ct.Solution(ctfile) +sol_R.DPX = 0.18075, 35594, "H2:2,O2:1,AR:7" u_l = 0 u_r = -487.34 -L = 0.12 +L = 0.12 Nx = 400 * args.scale -dx = L/Nx -dt = dx/abs(u_r)*0.02 -Tend=230e-6 +dx = L / Nx +dt = dx / abs(u_r) * 0.02 +Tend = 230e-6 -NT=int(Tend/dt) -SAVE_COUNT=100 -NS=NT//SAVE_COUNT +NT = int(Tend / dt) +SAVE_COUNT = 100 +NS = NT // SAVE_COUNT case = { # Logistics ================================================================ - 'run_time_info' : 'T', - # ========================================================================== - + "run_time_info": "T", # Computational Domain Parameters ========================================== - 'x_domain%beg' : 0, - 'x_domain%end' : L, - 'm' : Nx, - 'n' : 0, - 'p' : 0, - 'dt' : float(dt), - 't_step_start' : 0, - 't_step_stop' : NT, - 't_step_save' : NS, - 't_step_print' : NS, - 'parallel_io' : 'F' if args.mfc.get("mpi", True) else 'F', - + "x_domain%beg": 0, + "x_domain%end": L, + "m": Nx, + "n": 0, + "p": 0, + "dt": float(dt), + "t_step_start": 0, + "t_step_stop": NT, + "t_step_save": NS, + "t_step_print": NS, + "parallel_io": "F" if args.mfc.get("mpi", True) else "F", # Simulation Algorithm Parameters ========================================== - 'model_eqns' : 2, - 'num_fluids' : 1, - 'num_patches' : 2, - 'mpp_lim' : 'F', - 'mixture_err' : 'F', - 'time_stepper' : 3, - 'weno_order' : 5, - 'weno_eps' : 1E-16, - 'weno_avg' : 'F', - 'mapped_weno' : 'T', - 'mp_weno' : 'T', - 'riemann_solver' : 2, - 'wave_speeds' : 1, - 'avg_state' : 2, - 'bc_x%beg' :-2, - 'bc_x%end' :-3, - + "model_eqns": 2, + "num_fluids": 1, + "num_patches": 2, + "mpp_lim": "F", + "mixture_err": "F", + "time_stepper": 3, + "weno_order": 5, + "weno_eps": 1e-16, + "weno_avg": "F", + "mapped_weno": "T", + "mp_weno": "T", + "riemann_solver": 2, + "wave_speeds": 1, + "avg_state": 2, + "bc_x%beg": -2, + "bc_x%end": -3, # Chemistry ================================================================ - 'chemistry' : 'F' if not args.chemistry else 'T', - 'chem_params%diffusion' : 'F', - 'chem_params%reactions' : 'T', - 'cantera_file' : ctfile, - # ========================================================================== - + "chemistry": "F" if not args.chemistry else "T", + "chem_params%diffusion": "F", + "chem_params%reactions": "T", + "cantera_file": ctfile, # Formatted Database Files Structure Parameters ============================ - 'format' : 1, - 'precision' : 2, - 'prim_vars_wrt' : 'T', - 'chem_wrt_T' : 'T', - # ========================================================================== - - # ========================================================================== - 'patch_icpp(1)%geometry' : 1, - 'patch_icpp(1)%x_centroid' : L/4, - 'patch_icpp(1)%length_x' : L/2, - 'patch_icpp(1)%vel(1)' : u_l, - 'patch_icpp(1)%pres' : sol_L.P, - 'patch_icpp(1)%alpha(1)' : 1, - 'patch_icpp(1)%alpha_rho(1)' : sol_L.density, - # ========================================================================== - - # ========================================================================== - 'patch_icpp(2)%geometry' : 1, - 'patch_icpp(2)%x_centroid' : 3*L/4, - 'patch_icpp(2)%length_x' : L/2, - 'patch_icpp(2)%vel(1)' : u_r, - 'patch_icpp(2)%pres' : sol_R.P, - 'patch_icpp(2)%alpha(1)' : 1, - 'patch_icpp(2)%alpha_rho(1)' : sol_R.density, - # ========================================================================== - + "format": 1, + "precision": 2, + "prim_vars_wrt": "T", + "chem_wrt_T": "T", + "patch_icpp(1)%geometry": 1, + "patch_icpp(1)%x_centroid": L / 4, + "patch_icpp(1)%length_x": L / 2, + "patch_icpp(1)%vel(1)": u_l, + "patch_icpp(1)%pres": sol_L.P, + "patch_icpp(1)%alpha(1)": 1, + "patch_icpp(1)%alpha_rho(1)": sol_L.density, + "patch_icpp(2)%geometry": 1, + "patch_icpp(2)%x_centroid": 3 * L / 4, + "patch_icpp(2)%length_x": L / 2, + "patch_icpp(2)%vel(1)": u_r, + "patch_icpp(2)%pres": sol_R.P, + "patch_icpp(2)%alpha(1)": 1, + "patch_icpp(2)%alpha_rho(1)": sol_R.density, # Fluids Physical Parameters =============================================== - 'fluid_pp(1)%gamma' : 1.0E+00/(4.4E+00-1.0E+00), - 'fluid_pp(1)%pi_inf' : 0, - # ========================================================================== + "fluid_pp(1)%gamma": 1.0e00 / (4.4e00 - 1.0e00), + "fluid_pp(1)%pi_inf": 0, } if args.chemistry: for i in range(len(sol_L.Y)): - case[f'chem_wrt_Y({i + 1})'] = 'T' - case[f'patch_icpp(1)%Y({i+1})'] = sol_L.Y[i] - case[f'patch_icpp(2)%Y({i+1})'] = sol_R.Y[i] + case[f"chem_wrt_Y({i + 1})"] = "T" + case[f"patch_icpp(1)%Y({i+1})"] = sol_L.Y[i] + case[f"patch_icpp(2)%Y({i+1})"] = sol_R.Y[i] -if __name__ == '__main__': +if __name__ == "__main__": print(json.dumps(case)) diff --git a/examples/1D_reactive_shocktube/viz.py b/examples/1D_reactive_shocktube/viz.py index f2c13d8326..63c769fca9 100644 --- a/examples/1D_reactive_shocktube/viz.py +++ b/examples/1D_reactive_shocktube/viz.py @@ -1,5 +1,4 @@ import mfc.viz - import os import subprocess @@ -20,10 +19,10 @@ variables = [ ("rho", "prim.1"), ("u_x", "prim.2"), - ("p", "prim.3"), - ("E", "cons.3"), + ("p", "prim.3"), + ("E", "cons.3"), *[(f"Y_{name}", f"prim.{5 + sol.species_index(name)}") for name in Y_VARS], - ("T", "prim.15"), + ("T", "prim.15"), ] for variable in tqdm(variables, desc="Loading Variables"): @@ -33,7 +32,10 @@ fig, axes = plt.subplots(2, 3, figsize=(16, 9)) def pad_ylim(ylim, pad=0.1): - return (ylim[0] - pad*(ylim[1] - ylim[0]), ylim[1] + pad*(ylim[1] - ylim[0])) + return ( + ylim[0] - pad * (ylim[1] - ylim[0]), + ylim[1] + pad * (ylim[1] - ylim[0]), + ) case.plot_step(step, "rho", ax=axes[0, 0]) axes[0, 0].set_ylim(*pad_ylim(case.get_minmax_time("rho"))) @@ -41,17 +43,17 @@ def pad_ylim(ylim, pad=0.1): case.plot_step(step, "u_x", ax=axes[0, 1]) axes[0, 1].set_ylim(*pad_ylim(case.get_minmax_time("u_x"))) axes[0, 1].set_ylabel("$u_x$") - case.plot_step(step, "p", ax=axes[1, 0]) + case.plot_step(step, "p", ax=axes[1, 0]) axes[1, 0].set_ylim(*pad_ylim(case.get_minmax_time("p"))) axes[1, 0].set_ylabel("$p$") for y in Y_VARS: case.plot_step(step, f"Y_{y}", ax=axes[1, 1], label=y) - axes[1, 1].set_ylim(0, 1.1*max(case.get_minmax_time(f"Y_{y}")[1] for y in Y_VARS)) + axes[1, 1].set_ylim(0, 1.1 * max(case.get_minmax_time(f"Y_{y}")[1] for y in Y_VARS)) axes[1, 1].set_ylabel("$Y_k$") - case.plot_step(step, "T", ax=axes[1, 2]) + case.plot_step(step, "T", ax=axes[1, 2]) axes[1, 2].set_ylim(*pad_ylim(case.get_minmax_time("T"))) axes[1, 2].set_ylabel("$T$") - case.plot_step(step, "E", ax=axes[0, 2]) + case.plot_step(step, "E", ax=axes[0, 2]) axes[0, 2].set_ylim(*pad_ylim(case.get_minmax_time("E"))) axes[0, 2].set_ylabel("$E$") @@ -59,7 +61,20 @@ def pad_ylim(ylim, pad=0.1): plt.savefig(f"viz/{step:06d}.png") plt.close() -subprocess.run([ - "ffmpeg", "-y", "-framerate", "60", "-pattern_type", "glob", "-i", - "viz/*.png", "-c:v", "libx264", "-pix_fmt", "yuv420p", "viz.mp4" -]) \ No newline at end of file +subprocess.run( + [ + "ffmpeg", + "-y", + "-framerate", + "60", + "-pattern_type", + "glob", + "-i", + "viz/*.png", + "-c:v", + "libx264", + "-pix_fmt", + "yuv420p", + "viz.mp4", + ] +) diff --git a/examples/1D_shuosher_old/case.py b/examples/1D_shuosher_old/case.py index b905e76c0f..34ef517ecf 100644 --- a/examples/1D_shuosher_old/case.py +++ b/examples/1D_shuosher_old/case.py @@ -1,88 +1,74 @@ #!/usr/bin/env python3 - import math import json # Numerical setup Nx = 1000 -dx = 1./(1.*(Nx+1)) +dx = 1.0 / (1.0 * (Nx + 1)) Tend, Nt = 1.8, 20000 -mydt = Tend/(1.*Nt) +mydt = Tend / (1.0 * Nt) # Configuring case dictionary -print(json.dumps({ - # Logistics ================================================================ - 'run_time_info' : 'T', - # ========================================================================== - - # Computational Domain Parameters ========================================== - 'x_domain%beg' : -5., - 'x_domain%end' : 5. , - 'm' : Nx, - 'n' : 0, - 'p' : 0, - 'dt' : mydt, - 't_step_start' : 0, - 't_step_stop' : int(Nt), - 't_step_save' : int(math.ceil(Nt/10.0)), - # ========================================================================== - - # Simulation Algorithm Parameters ========================================== - 'num_patches' : 2, - 'model_eqns' : 2, - 'alt_soundspeed' : 'F', - 'num_fluids' : 1, - 'mpp_lim' : 'F', - 'mixture_err' : 'F', - 'time_stepper' : 3, - 'weno_order' : 5, - 'weno_eps' : 1.E-16, - 'mapped_weno' : 'T', - 'null_weights' : 'F', - 'mp_weno' : 'F', - 'riemann_solver' : 2, - 'wave_speeds' : 1, - 'avg_state' : 2, - 'bc_x%beg' : -3, - 'bc_x%end' : -3, - # ========================================================================== - - # Formatted Database Files Structure Parameters ============================ - 'format' : 1, - 'precision' : 2, - 'prim_vars_wrt' :'T', - 'parallel_io' :'F', - # ========================================================================== - - - # Background to cover whole domain with basic line patch - # Patch 1 Left (-5 < x < -4) =============================================== - 'patch_icpp(1)%geometry' : 1, - 'patch_icpp(1)%x_centroid' : -4.5, - 'patch_icpp(1)%length_x' : 1., - 'patch_icpp(1)%vel(1)' : 2.629369, - 'patch_icpp(1)%pres' : 10.3333, - 'patch_icpp(1)%alpha_rho(1)' : 3.957143, - 'patch_icpp(1)%alpha(1)' : 1., - # ========================================================================== - - - # One anlytic patch to take care of -4 < x < 5 - # Patch 2 Analytic ========================================================= - 'patch_icpp(2)%geometry' : 1, - 'patch_icpp(2)%x_centroid' : 0.5, - 'patch_icpp(2)%length_x' : 9., - 'patch_icpp(2)%vel(1)' : 0., - 'patch_icpp(2)%pres' : 1., - 'patch_icpp(2)%alpha_rho(1)' : '1 + 0.2*sin(5*x)', - 'patch_icpp(2)%alpha(1)' : 1., - # ========================================================================== - - # Fluids Physical Parameters =============================================== - 'fluid_pp(1)%gamma' : 1.E+00/(1.4-1.E+00), - 'fluid_pp(1)%pi_inf' : 0.0, - # ========================================================================== -})) - -# ============================================================================== +print( + json.dumps( + { + # Logistics ================================================================ + "run_time_info": "T", + # Computational Domain Parameters ========================================== + "x_domain%beg": -5.0, + "x_domain%end": 5.0, + "m": Nx, + "n": 0, + "p": 0, + "dt": mydt, + "t_step_start": 0, + "t_step_stop": int(Nt), + "t_step_save": int(math.ceil(Nt / 10.0)), + # Simulation Algorithm Parameters ========================================== + "num_patches": 2, + "model_eqns": 2, + "alt_soundspeed": "F", + "num_fluids": 1, + "mpp_lim": "F", + "mixture_err": "F", + "time_stepper": 3, + "weno_order": 5, + "weno_eps": 1.0e-16, + "mapped_weno": "T", + "null_weights": "F", + "mp_weno": "F", + "riemann_solver": 2, + "wave_speeds": 1, + "avg_state": 2, + "bc_x%beg": -3, + "bc_x%end": -3, + # Formatted Database Files Structure Parameters ============================ + "format": 1, + "precision": 2, + "prim_vars_wrt": "T", + "parallel_io": "F", + # Background to cover whole domain with basic line patch + # Patch 1 Left (-5 < x < -4) =============================================== + "patch_icpp(1)%geometry": 1, + "patch_icpp(1)%x_centroid": -4.5, + "patch_icpp(1)%length_x": 1.0, + "patch_icpp(1)%vel(1)": 2.629369, + "patch_icpp(1)%pres": 10.3333, + "patch_icpp(1)%alpha_rho(1)": 3.957143, + "patch_icpp(1)%alpha(1)": 1.0, + # One anlytic patch to take care of -4 < x < 5 + # Patch 2 Analytic ========================================================= + "patch_icpp(2)%geometry": 1, + "patch_icpp(2)%x_centroid": 0.5, + "patch_icpp(2)%length_x": 9.0, + "patch_icpp(2)%vel(1)": 0.0, + "patch_icpp(2)%pres": 1.0, + "patch_icpp(2)%alpha_rho(1)": "1 + 0.2*sin(5*x)", + "patch_icpp(2)%alpha(1)": 1.0, + # Fluids Physical Parameters =============================================== + "fluid_pp(1)%gamma": 1.0e00 / (1.4 - 1.0e00), + "fluid_pp(1)%pi_inf": 0.0, + } + ) +) diff --git a/examples/1D_shuosher_teno5/case.py b/examples/1D_shuosher_teno5/case.py index c3b4e5163e..a97cf54de3 100644 --- a/examples/1D_shuosher_teno5/case.py +++ b/examples/1D_shuosher_teno5/case.py @@ -1,90 +1,76 @@ #!/usr/bin/env python3 - import math import json # Numerical setup Nx = 1000 -dx = 1./(1.*(Nx+1)) +dx = 1.0 / (1.0 * (Nx + 1)) Tend, Nt = 1.8, 2000 -mydt = Tend/(1.*Nt) +mydt = Tend / (1.0 * Nt) # Configuring case dictionary -print(json.dumps({ - # Logistics ================================================================ - 'run_time_info' : 'T', - # ========================================================================== - - # Computational Domain Parameters ========================================== - 'x_domain%beg' : 0., - 'x_domain%end' : 10., - 'm' : Nx, - 'n' : 0, - 'p' : 0, - 'dt' : mydt, - 't_step_start' : 0, - 't_step_stop' : int(Nt), - 't_step_save' : int(math.ceil(Nt/10.0)), - # ========================================================================== - - # Simulation Algorithm Parameters ========================================== - 'num_patches' : 2, - 'model_eqns' : 2, - 'alt_soundspeed' : 'F', - 'num_fluids' : 1, - 'mpp_lim' : 'F', - 'mixture_err' : 'F', - 'time_stepper' : 3, - 'weno_order' : 5, - 'weno_eps' : 1.E-40, - 'teno' : 'T', - 'teno_CT' : 1.E-6, - 'null_weights' : 'F', - 'mp_weno' : 'F', - 'riemann_solver' : 2, - 'wave_speeds' : 1, - 'avg_state' : 2, - 'bc_x%beg' : -3, - 'bc_x%end' : -3, - # ========================================================================== - - # Formatted Database Files Structure Parameters ============================ - 'format' : 1, - 'precision' : 2, - 'prim_vars_wrt' :'T', - 'rho_wrt' :'T', - 'parallel_io' :'T', - # ========================================================================== - - - # Background to cover whole domain with basic line patch - # Patch 1 Left (0 < x < 1) =============================================== - 'patch_icpp(1)%geometry' : 1, - 'patch_icpp(1)%x_centroid' : 0.5, - 'patch_icpp(1)%length_x' : 1., - 'patch_icpp(1)%vel(1)' : 2.629, - 'patch_icpp(1)%pres' : 10.333, - 'patch_icpp(1)%alpha_rho(1)' : 3.857, - 'patch_icpp(1)%alpha(1)' : 1., - # ========================================================================== - - - # One anlytic patch to take care of 1 < x < 10 - # Patch 2 Analytic ========================================================= - 'patch_icpp(2)%geometry' : 1, - 'patch_icpp(2)%x_centroid' : 5.5, - 'patch_icpp(2)%length_x' : 9., - 'patch_icpp(2)%vel(1)' : 0., - 'patch_icpp(2)%pres' : 1., - 'patch_icpp(2)%alpha_rho(1)' : '1 + 0.2*sin(5*x)', - 'patch_icpp(2)%alpha(1)' : 1., - # ========================================================================== - - # Fluids Physical Parameters =============================================== - 'fluid_pp(1)%gamma' : 1.E+00/(1.4-1.E+00), - 'fluid_pp(1)%pi_inf' : 0.0, - # ========================================================================== -})) - -# ============================================================================== +print( + json.dumps( + { + # Logistics ================================================================ + "run_time_info": "T", + # Computational Domain Parameters ========================================== + "x_domain%beg": 0.0, + "x_domain%end": 10.0, + "m": Nx, + "n": 0, + "p": 0, + "dt": mydt, + "t_step_start": 0, + "t_step_stop": int(Nt), + "t_step_save": int(math.ceil(Nt / 10.0)), + # Simulation Algorithm Parameters ========================================== + "num_patches": 2, + "model_eqns": 2, + "alt_soundspeed": "F", + "num_fluids": 1, + "mpp_lim": "F", + "mixture_err": "F", + "time_stepper": 3, + "weno_order": 5, + "weno_eps": 1.0e-40, + "teno": "T", + "teno_CT": 1.0e-6, + "null_weights": "F", + "mp_weno": "F", + "riemann_solver": 2, + "wave_speeds": 1, + "avg_state": 2, + "bc_x%beg": -3, + "bc_x%end": -3, + # Formatted Database Files Structure Parameters ============================ + "format": 1, + "precision": 2, + "prim_vars_wrt": "T", + "rho_wrt": "T", + "parallel_io": "T", + # Background to cover whole domain with basic line patch + # Patch 1 Left (0 < x < 1) =============================================== + "patch_icpp(1)%geometry": 1, + "patch_icpp(1)%x_centroid": 0.5, + "patch_icpp(1)%length_x": 1.0, + "patch_icpp(1)%vel(1)": 2.629, + "patch_icpp(1)%pres": 10.333, + "patch_icpp(1)%alpha_rho(1)": 3.857, + "patch_icpp(1)%alpha(1)": 1.0, + # One anlytic patch to take care of 1 < x < 10 + # Patch 2 Analytic ========================================================= + "patch_icpp(2)%geometry": 1, + "patch_icpp(2)%x_centroid": 5.5, + "patch_icpp(2)%length_x": 9.0, + "patch_icpp(2)%vel(1)": 0.0, + "patch_icpp(2)%pres": 1.0, + "patch_icpp(2)%alpha_rho(1)": "1 + 0.2*sin(5*x)", + "patch_icpp(2)%alpha(1)": 1.0, + # Fluids Physical Parameters =============================================== + "fluid_pp(1)%gamma": 1.0e00 / (1.4 - 1.0e00), + "fluid_pp(1)%pi_inf": 0.0, + } + ) +) diff --git a/examples/1D_shuosher_teno7/case.py b/examples/1D_shuosher_teno7/case.py index b84cce28db..f9d0e9deea 100644 --- a/examples/1D_shuosher_teno7/case.py +++ b/examples/1D_shuosher_teno7/case.py @@ -1,90 +1,76 @@ #!/usr/bin/env python3 - import math import json # Numerical setup Nx = 1000 -dx = 1./(1.*(Nx+1)) +dx = 1.0 / (1.0 * (Nx + 1)) Tend, Nt = 1.8, 2000 -mydt = Tend/(1.*Nt) +mydt = Tend / (1.0 * Nt) # Configuring case dictionary -print(json.dumps({ - # Logistics ================================================================ - 'run_time_info' : 'T', - # ========================================================================== - - # Computational Domain Parameters ========================================== - 'x_domain%beg' : 0., - 'x_domain%end' : 10., - 'm' : Nx, - 'n' : 0, - 'p' : 0, - 'dt' : mydt, - 't_step_start' : 0, - 't_step_stop' : int(Nt), - 't_step_save' : int(math.ceil(Nt/10.0)), - # ========================================================================== - - # Simulation Algorithm Parameters ========================================== - 'num_patches' : 2, - 'model_eqns' : 2, - 'alt_soundspeed' : 'F', - 'num_fluids' : 1, - 'mpp_lim' : 'F', - 'mixture_err' : 'F', - 'time_stepper' : 3, - 'weno_order' : 7, - 'weno_eps' : 1.E-40, - 'teno' : 'T', - 'teno_CT' : 1.E-9, - 'null_weights' : 'F', - 'mp_weno' : 'F', - 'riemann_solver' : 2, - 'wave_speeds' : 1, - 'avg_state' : 2, - 'bc_x%beg' : -3, - 'bc_x%end' : -3, - # ========================================================================== - - # Formatted Database Files Structure Parameters ============================ - 'format' : 1, - 'precision' : 2, - 'prim_vars_wrt' :'T', - 'rho_wrt' :'T', - 'parallel_io' :'T', - # ========================================================================== - - - # Background to cover whole domain with basic line patch - # Patch 1 Left (0 < x < 1) =============================================== - 'patch_icpp(1)%geometry' : 1, - 'patch_icpp(1)%x_centroid' : 0.5, - 'patch_icpp(1)%length_x' : 1., - 'patch_icpp(1)%vel(1)' : 2.629, - 'patch_icpp(1)%pres' : 10.333, - 'patch_icpp(1)%alpha_rho(1)' : 3.857, - 'patch_icpp(1)%alpha(1)' : 1., - # ========================================================================== - - - # One anlytic patch to take care of 1 < x < 10 - # Patch 2 Analytic ========================================================= - 'patch_icpp(2)%geometry' : 1, - 'patch_icpp(2)%x_centroid' : 5.5, - 'patch_icpp(2)%length_x' : 9., - 'patch_icpp(2)%vel(1)' : 0., - 'patch_icpp(2)%pres' : 1., - 'patch_icpp(2)%alpha_rho(1)' : '1 + 0.2*sin(5*x)', - 'patch_icpp(2)%alpha(1)' : 1., - # ========================================================================== - - # Fluids Physical Parameters =============================================== - 'fluid_pp(1)%gamma' : 1.E+00/(1.4-1.E+00), - 'fluid_pp(1)%pi_inf' : 0.0, - # ========================================================================== -})) - -# ============================================================================== +print( + json.dumps( + { + # Logistics ================================================================ + "run_time_info": "T", + # Computational Domain Parameters ========================================== + "x_domain%beg": 0.0, + "x_domain%end": 10.0, + "m": Nx, + "n": 0, + "p": 0, + "dt": mydt, + "t_step_start": 0, + "t_step_stop": int(Nt), + "t_step_save": int(math.ceil(Nt / 10.0)), + # Simulation Algorithm Parameters ========================================== + "num_patches": 2, + "model_eqns": 2, + "alt_soundspeed": "F", + "num_fluids": 1, + "mpp_lim": "F", + "mixture_err": "F", + "time_stepper": 3, + "weno_order": 7, + "weno_eps": 1.0e-40, + "teno": "T", + "teno_CT": 1.0e-9, + "null_weights": "F", + "mp_weno": "F", + "riemann_solver": 2, + "wave_speeds": 1, + "avg_state": 2, + "bc_x%beg": -3, + "bc_x%end": -3, + # Formatted Database Files Structure Parameters ============================ + "format": 1, + "precision": 2, + "prim_vars_wrt": "T", + "rho_wrt": "T", + "parallel_io": "T", + # Background to cover whole domain with basic line patch + # Patch 1 Left (0 < x < 1) =============================================== + "patch_icpp(1)%geometry": 1, + "patch_icpp(1)%x_centroid": 0.5, + "patch_icpp(1)%length_x": 1.0, + "patch_icpp(1)%vel(1)": 2.629, + "patch_icpp(1)%pres": 10.333, + "patch_icpp(1)%alpha_rho(1)": 3.857, + "patch_icpp(1)%alpha(1)": 1.0, + # One anlytic patch to take care of 1 < x < 10 + # Patch 2 Analytic ========================================================= + "patch_icpp(2)%geometry": 1, + "patch_icpp(2)%x_centroid": 5.5, + "patch_icpp(2)%length_x": 9.0, + "patch_icpp(2)%vel(1)": 0.0, + "patch_icpp(2)%pres": 1.0, + "patch_icpp(2)%alpha_rho(1)": "1 + 0.2*sin(5*x)", + "patch_icpp(2)%alpha(1)": 1.0, + # Fluids Physical Parameters =============================================== + "fluid_pp(1)%gamma": 1.0e00 / (1.4 - 1.0e00), + "fluid_pp(1)%pi_inf": 0.0, + } + ) +) diff --git a/examples/1D_shuosher_wenojs5/case.py b/examples/1D_shuosher_wenojs5/case.py index efc2acf91a..b83f5f05ec 100644 --- a/examples/1D_shuosher_wenojs5/case.py +++ b/examples/1D_shuosher_wenojs5/case.py @@ -1,89 +1,75 @@ #!/usr/bin/env python3 - import math import json # Numerical setup Nx = 1000 -dx = 1./(1.*(Nx+1)) +dx = 1.0 / (1.0 * (Nx + 1)) Tend, Nt = 1.8, 2000 -mydt = Tend/(1.*Nt) +mydt = Tend / (1.0 * Nt) # Configuring case dictionary -print(json.dumps({ - # Logistics ================================================================ - 'run_time_info' : 'T', - # ========================================================================== - - # Computational Domain Parameters ========================================== - 'x_domain%beg' : 0., - 'x_domain%end' : 10., - 'm' : Nx, - 'n' : 0, - 'p' : 0, - 'dt' : mydt, - 't_step_start' : 0, - 't_step_stop' : int(Nt), - 't_step_save' : int(math.ceil(Nt/10.0)), - # ========================================================================== - - # Simulation Algorithm Parameters ========================================== - 'num_patches' : 2, - 'model_eqns' : 2, - 'alt_soundspeed' : 'F', - 'num_fluids' : 1, - 'mpp_lim' : 'F', - 'mixture_err' : 'F', - 'time_stepper' : 3, - 'weno_order' : 5, - 'weno_eps' : 1.E-6, - 'mapped_weno' : 'F', - 'null_weights' : 'F', - 'mp_weno' : 'F', - 'riemann_solver' : 2, - 'wave_speeds' : 1, - 'avg_state' : 2, - 'bc_x%beg' : -3, - 'bc_x%end' : -3, - # ========================================================================== - - # Formatted Database Files Structure Parameters ============================ - 'format' : 1, - 'precision' : 2, - 'prim_vars_wrt' :'T', - 'rho_wrt' :'T', - 'parallel_io' :'T', - # ========================================================================== - - - # Background to cover whole domain with basic line patch - # Patch 1 Left (0 < x < 1) =============================================== - 'patch_icpp(1)%geometry' : 1, - 'patch_icpp(1)%x_centroid' : 0.5, - 'patch_icpp(1)%length_x' : 1., - 'patch_icpp(1)%vel(1)' : 2.629, - 'patch_icpp(1)%pres' : 10.333, - 'patch_icpp(1)%alpha_rho(1)' : 3.857, - 'patch_icpp(1)%alpha(1)' : 1., - # ========================================================================== - - - # One anlytic patch to take care of 1 < x < 10 - # Patch 2 Analytic ========================================================= - 'patch_icpp(2)%geometry' : 1, - 'patch_icpp(2)%x_centroid' : 5.5, - 'patch_icpp(2)%length_x' : 9., - 'patch_icpp(2)%vel(1)' : 0., - 'patch_icpp(2)%pres' : 1., - 'patch_icpp(2)%alpha_rho(1)' : '1 + 0.2*sin(5*x)', - 'patch_icpp(2)%alpha(1)' : 1., - # ========================================================================== - - # Fluids Physical Parameters =============================================== - 'fluid_pp(1)%gamma' : 1.E+00/(1.4-1.E+00), - 'fluid_pp(1)%pi_inf' : 0.0, - # ========================================================================== -})) - -# ============================================================================== +print( + json.dumps( + { + # Logistics ================================================================ + "run_time_info": "T", + # Computational Domain Parameters ========================================== + "x_domain%beg": 0.0, + "x_domain%end": 10.0, + "m": Nx, + "n": 0, + "p": 0, + "dt": mydt, + "t_step_start": 0, + "t_step_stop": int(Nt), + "t_step_save": int(math.ceil(Nt / 10.0)), + # Simulation Algorithm Parameters ========================================== + "num_patches": 2, + "model_eqns": 2, + "alt_soundspeed": "F", + "num_fluids": 1, + "mpp_lim": "F", + "mixture_err": "F", + "time_stepper": 3, + "weno_order": 5, + "weno_eps": 1.0e-6, + "mapped_weno": "F", + "null_weights": "F", + "mp_weno": "F", + "riemann_solver": 2, + "wave_speeds": 1, + "avg_state": 2, + "bc_x%beg": -3, + "bc_x%end": -3, + # Formatted Database Files Structure Parameters ============================ + "format": 1, + "precision": 2, + "prim_vars_wrt": "T", + "rho_wrt": "T", + "parallel_io": "T", + # Background to cover whole domain with basic line patch + # Patch 1 Left (0 < x < 1) =============================================== + "patch_icpp(1)%geometry": 1, + "patch_icpp(1)%x_centroid": 0.5, + "patch_icpp(1)%length_x": 1.0, + "patch_icpp(1)%vel(1)": 2.629, + "patch_icpp(1)%pres": 10.333, + "patch_icpp(1)%alpha_rho(1)": 3.857, + "patch_icpp(1)%alpha(1)": 1.0, + # One anlytic patch to take care of 1 < x < 10 + # Patch 2 Analytic ========================================================= + "patch_icpp(2)%geometry": 1, + "patch_icpp(2)%x_centroid": 5.5, + "patch_icpp(2)%length_x": 9.0, + "patch_icpp(2)%vel(1)": 0.0, + "patch_icpp(2)%pres": 1.0, + "patch_icpp(2)%alpha_rho(1)": "1 + 0.2*sin(5*x)", + "patch_icpp(2)%alpha(1)": 1.0, + # Fluids Physical Parameters =============================================== + "fluid_pp(1)%gamma": 1.0e00 / (1.4 - 1.0e00), + "fluid_pp(1)%pi_inf": 0.0, + } + ) +) diff --git a/examples/1D_shuosher_wenom5/case.py b/examples/1D_shuosher_wenom5/case.py index ea8602cb7c..b4580f87fb 100644 --- a/examples/1D_shuosher_wenom5/case.py +++ b/examples/1D_shuosher_wenom5/case.py @@ -1,89 +1,75 @@ #!/usr/bin/env python3 - import math import json # Numerical setup Nx = 1000 -dx = 1./(1.*(Nx+1)) +dx = 1.0 / (1.0 * (Nx + 1)) Tend, Nt = 1.8, 2000 -mydt = Tend/(1.*Nt) +mydt = Tend / (1.0 * Nt) # Configuring case dictionary -print(json.dumps({ - # Logistics ================================================================ - 'run_time_info' : 'T', - # ========================================================================== - - # Computational Domain Parameters ========================================== - 'x_domain%beg' : 0., - 'x_domain%end' : 10., - 'm' : Nx, - 'n' : 0, - 'p' : 0, - 'dt' : mydt, - 't_step_start' : 0, - 't_step_stop' : int(Nt), - 't_step_save' : int(math.ceil(Nt/10.0)), - # ========================================================================== - - # Simulation Algorithm Parameters ========================================== - 'num_patches' : 2, - 'model_eqns' : 2, - 'alt_soundspeed' : 'F', - 'num_fluids' : 1, - 'mpp_lim' : 'F', - 'mixture_err' : 'F', - 'time_stepper' : 3, - 'weno_order' : 5, - 'weno_eps' : 1.E-40, - 'mapped_weno' : 'T', - 'null_weights' : 'F', - 'mp_weno' : 'F', - 'riemann_solver' : 2, - 'wave_speeds' : 1, - 'avg_state' : 2, - 'bc_x%beg' : -3, - 'bc_x%end' : -3, - # ========================================================================== - - # Formatted Database Files Structure Parameters ============================ - 'format' : 1, - 'precision' : 2, - 'prim_vars_wrt' :'T', - 'rho_wrt' :'T', - 'parallel_io' :'T', - # ========================================================================== - - - # Background to cover whole domain with basic line patch - # Patch 1 Left (0 < x < 1) =============================================== - 'patch_icpp(1)%geometry' : 1, - 'patch_icpp(1)%x_centroid' : 0.5, - 'patch_icpp(1)%length_x' : 1., - 'patch_icpp(1)%vel(1)' : 2.629, - 'patch_icpp(1)%pres' : 10.333, - 'patch_icpp(1)%alpha_rho(1)' : 3.857, - 'patch_icpp(1)%alpha(1)' : 1., - # ========================================================================== - - - # One anlytic patch to take care of 1 < x < 10 - # Patch 2 Analytic ========================================================= - 'patch_icpp(2)%geometry' : 1, - 'patch_icpp(2)%x_centroid' : 5.5, - 'patch_icpp(2)%length_x' : 9., - 'patch_icpp(2)%vel(1)' : 0., - 'patch_icpp(2)%pres' : 1., - 'patch_icpp(2)%alpha_rho(1)' : '1 + 0.2*sin(5*x)', - 'patch_icpp(2)%alpha(1)' : 1., - # ========================================================================== - - # Fluids Physical Parameters =============================================== - 'fluid_pp(1)%gamma' : 1.E+00/(1.4-1.E+00), - 'fluid_pp(1)%pi_inf' : 0.0, - # ========================================================================== -})) - -# ============================================================================== +print( + json.dumps( + { + # Logistics ================================================================ + "run_time_info": "T", + # Computational Domain Parameters ========================================== + "x_domain%beg": 0.0, + "x_domain%end": 10.0, + "m": Nx, + "n": 0, + "p": 0, + "dt": mydt, + "t_step_start": 0, + "t_step_stop": int(Nt), + "t_step_save": int(math.ceil(Nt / 10.0)), + # Simulation Algorithm Parameters ========================================== + "num_patches": 2, + "model_eqns": 2, + "alt_soundspeed": "F", + "num_fluids": 1, + "mpp_lim": "F", + "mixture_err": "F", + "time_stepper": 3, + "weno_order": 5, + "weno_eps": 1.0e-40, + "mapped_weno": "T", + "null_weights": "F", + "mp_weno": "F", + "riemann_solver": 2, + "wave_speeds": 1, + "avg_state": 2, + "bc_x%beg": -3, + "bc_x%end": -3, + # Formatted Database Files Structure Parameters ============================ + "format": 1, + "precision": 2, + "prim_vars_wrt": "T", + "rho_wrt": "T", + "parallel_io": "T", + # Background to cover whole domain with basic line patch + # Patch 1 Left (0 < x < 1) =============================================== + "patch_icpp(1)%geometry": 1, + "patch_icpp(1)%x_centroid": 0.5, + "patch_icpp(1)%length_x": 1.0, + "patch_icpp(1)%vel(1)": 2.629, + "patch_icpp(1)%pres": 10.333, + "patch_icpp(1)%alpha_rho(1)": 3.857, + "patch_icpp(1)%alpha(1)": 1.0, + # One anlytic patch to take care of 1 < x < 10 + # Patch 2 Analytic ========================================================= + "patch_icpp(2)%geometry": 1, + "patch_icpp(2)%x_centroid": 5.5, + "patch_icpp(2)%length_x": 9.0, + "patch_icpp(2)%vel(1)": 0.0, + "patch_icpp(2)%pres": 1.0, + "patch_icpp(2)%alpha_rho(1)": "1 + 0.2*sin(5*x)", + "patch_icpp(2)%alpha(1)": 1.0, + # Fluids Physical Parameters =============================================== + "fluid_pp(1)%gamma": 1.0e00 / (1.4 - 1.0e00), + "fluid_pp(1)%pi_inf": 0.0, + } + ) +) diff --git a/examples/1D_shuosher_wenoz5/case.py b/examples/1D_shuosher_wenoz5/case.py index 521be138a2..1e0fed3e4e 100644 --- a/examples/1D_shuosher_wenoz5/case.py +++ b/examples/1D_shuosher_wenoz5/case.py @@ -1,89 +1,75 @@ #!/usr/bin/env python3 - import math import json # Numerical setup Nx = 1000 -dx = 1./(1.*(Nx+1)) +dx = 1.0 / (1.0 * (Nx + 1)) Tend, Nt = 1.8, 2000 -mydt = Tend/(1.*Nt) +mydt = Tend / (1.0 * Nt) # Configuring case dictionary -print(json.dumps({ - # Logistics ================================================================ - 'run_time_info' : 'T', - # ========================================================================== - - # Computational Domain Parameters ========================================== - 'x_domain%beg' : 0., - 'x_domain%end' : 10., - 'm' : Nx, - 'n' : 0, - 'p' : 0, - 'dt' : mydt, - 't_step_start' : 0, - 't_step_stop' : int(Nt), - 't_step_save' : int(math.ceil(Nt/10.0)), - # ========================================================================== - - # Simulation Algorithm Parameters ========================================== - 'num_patches' : 2, - 'model_eqns' : 2, - 'alt_soundspeed' : 'F', - 'num_fluids' : 1, - 'mpp_lim' : 'F', - 'mixture_err' : 'F', - 'time_stepper' : 3, - 'weno_order' : 5, - 'weno_eps' : 1.E-40, - 'wenoz' : 'T', - 'null_weights' : 'F', - 'mp_weno' : 'F', - 'riemann_solver' : 2, - 'wave_speeds' : 1, - 'avg_state' : 2, - 'bc_x%beg' : -3, - 'bc_x%end' : -3, - # ========================================================================== - - # Formatted Database Files Structure Parameters ============================ - 'format' : 1, - 'precision' : 2, - 'prim_vars_wrt' :'T', - 'rho_wrt' :'T', - 'parallel_io' :'T', - # ========================================================================== - - - # Background to cover whole domain with basic line patch - # Patch 1 Left (0 < x < 1) =============================================== - 'patch_icpp(1)%geometry' : 1, - 'patch_icpp(1)%x_centroid' : 0.5, - 'patch_icpp(1)%length_x' : 1., - 'patch_icpp(1)%vel(1)' : 2.629, - 'patch_icpp(1)%pres' : 10.333, - 'patch_icpp(1)%alpha_rho(1)' : 3.857, - 'patch_icpp(1)%alpha(1)' : 1., - # ========================================================================== - - - # One anlytic patch to take care of 1 < x < 10 - # Patch 2 Analytic ========================================================= - 'patch_icpp(2)%geometry' : 1, - 'patch_icpp(2)%x_centroid' : 5.5, - 'patch_icpp(2)%length_x' : 9., - 'patch_icpp(2)%vel(1)' : 0., - 'patch_icpp(2)%pres' : 1., - 'patch_icpp(2)%alpha_rho(1)' : '1 + 0.2*sin(5*x)', - 'patch_icpp(2)%alpha(1)' : 1., - # ========================================================================== - - # Fluids Physical Parameters =============================================== - 'fluid_pp(1)%gamma' : 1.E+00/(1.4-1.E+00), - 'fluid_pp(1)%pi_inf' : 0.0, - # ========================================================================== -})) - -# ============================================================================== +print( + json.dumps( + { + # Logistics ================================================================ + "run_time_info": "T", + # Computational Domain Parameters ========================================== + "x_domain%beg": 0.0, + "x_domain%end": 10.0, + "m": Nx, + "n": 0, + "p": 0, + "dt": mydt, + "t_step_start": 0, + "t_step_stop": int(Nt), + "t_step_save": int(math.ceil(Nt / 10.0)), + # Simulation Algorithm Parameters ========================================== + "num_patches": 2, + "model_eqns": 2, + "alt_soundspeed": "F", + "num_fluids": 1, + "mpp_lim": "F", + "mixture_err": "F", + "time_stepper": 3, + "weno_order": 5, + "weno_eps": 1.0e-40, + "wenoz": "T", + "null_weights": "F", + "mp_weno": "F", + "riemann_solver": 2, + "wave_speeds": 1, + "avg_state": 2, + "bc_x%beg": -3, + "bc_x%end": -3, + # Formatted Database Files Structure Parameters ============================ + "format": 1, + "precision": 2, + "prim_vars_wrt": "T", + "rho_wrt": "T", + "parallel_io": "T", + # Background to cover whole domain with basic line patch + # Patch 1 Left (0 < x < 1) =============================================== + "patch_icpp(1)%geometry": 1, + "patch_icpp(1)%x_centroid": 0.5, + "patch_icpp(1)%length_x": 1.0, + "patch_icpp(1)%vel(1)": 2.629, + "patch_icpp(1)%pres": 10.333, + "patch_icpp(1)%alpha_rho(1)": 3.857, + "patch_icpp(1)%alpha(1)": 1.0, + # One anlytic patch to take care of 1 < x < 10 + # Patch 2 Analytic ========================================================= + "patch_icpp(2)%geometry": 1, + "patch_icpp(2)%x_centroid": 5.5, + "patch_icpp(2)%length_x": 9.0, + "patch_icpp(2)%vel(1)": 0.0, + "patch_icpp(2)%pres": 1.0, + "patch_icpp(2)%alpha_rho(1)": "1 + 0.2*sin(5*x)", + "patch_icpp(2)%alpha(1)": 1.0, + # Fluids Physical Parameters =============================================== + "fluid_pp(1)%gamma": 1.0e00 / (1.4 - 1.0e00), + "fluid_pp(1)%pi_inf": 0.0, + } + ) +) diff --git a/examples/1D_sodHypo/case.py b/examples/1D_sodHypo/case.py index 3d5b551006..0650a5a6e2 100755 --- a/examples/1D_sodHypo/case.py +++ b/examples/1D_sodHypo/case.py @@ -2,91 +2,79 @@ import math import json -#Numerical setup -Nx = 201 -dx = 1./(1.*(Nx+1)) +# Numerical setup +Nx = 201 +dx = 1.0 / (1.0 * (Nx + 1)) -Tend = 64E-06 -Nt = 200 -mydt = Tend/(1.*Nt) +Tend = 64e-06 +Nt = 200 +mydt = Tend / (1.0 * Nt) # Configuring case dictionary -print(json.dumps({ - # Logistics ================================================ - 'run_time_info' : 'F', - # ========================================================== - - # Computational Domain Parameters ========================== - 'x_domain%beg' : 0.E+00, - 'x_domain%end' : 1.E+00, - 'm' : Nx, - 'n' : 0, - 'p' : 0, - 'dt' : mydt, - 't_step_start' : 0, - 't_step_stop' : int(Nt), - 't_step_save' : int(Nt), - # ========================================================== - - # Simulation Algorithm Parameters ========================== - 'num_patches' : 2, - 'model_eqns' : 2, - 'alt_soundspeed' : 'F', - 'num_fluids' : 1, - 'mpp_lim' : 'F', - 'mixture_err' : 'F', - 'time_stepper' : 3, - 'weno_order' : 5, - 'weno_eps' : 1.E-16, - 'weno_Re_flux' : 'F', - 'weno_avg' : 'F', - 'mapped_weno' : 'F', - 'null_weights' : 'F', - 'mp_weno' : 'F', - 'riemann_solver' : 1, - 'wave_speeds' : 1, - 'avg_state' : 2, - 'bc_x%beg' : -3, - 'bc_x%end' : -3, - # ========================================================== - - # Turning on Hypoelasticity ================================ - 'hypoelasticity' : 'T', - # ========================================================== - - # Formatted Database Files Structure Parameters ============ - 'format' : 1, - 'precision' : 2, - 'prim_vars_wrt' :'T', - 'parallel_io' :'F', - # ========================================================== - - # Patch 1 L ================================================ - 'patch_icpp(1)%geometry' : 1, - 'patch_icpp(1)%x_centroid' : 0.25, - 'patch_icpp(1)%length_x' : 0.5, - 'patch_icpp(1)%vel(1)' : 0.0, - 'patch_icpp(1)%pres' : 1.E+8, - 'patch_icpp(1)%alpha_rho(1)' : 1000, - 'patch_icpp(1)%alpha(1)' : 1., - 'patch_icpp(1)%tau_e(1)' : 0.0, - # ========================================================== - - # Patch 2 R ================================================ - 'patch_icpp(2)%geometry' : 1, - 'patch_icpp(2)%x_centroid' : 0.75, - 'patch_icpp(2)%length_x' : 0.5, - 'patch_icpp(2)%vel(1)' : 0, - 'patch_icpp(2)%pres' : 1.E+05, - 'patch_icpp(2)%alpha_rho(1)' : 1000, - 'patch_icpp(2)%alpha(1)' : 1., - 'patch_icpp(2)%tau_e(1)' : 0.0, - # ========================================================== - - # Fluids Physical Parameters =============================== - 'fluid_pp(1)%gamma' : 1.E+00/(4.4E+00-1.E+00), - 'fluid_pp(1)%pi_inf' : 4.4E+00*6.E+08/(4.4E+00 - 1.E+00), - 'fluid_pp(1)%G' : 10E+09, - # ========================================================== -})) -# ============================================================================== +print( + json.dumps( + { + # Logistics ================================================ + "run_time_info": "F", + # Computational Domain Parameters ========================== + "x_domain%beg": 0.0e00, + "x_domain%end": 1.0e00, + "m": Nx, + "n": 0, + "p": 0, + "dt": mydt, + "t_step_start": 0, + "t_step_stop": int(Nt), + "t_step_save": int(Nt), + # Simulation Algorithm Parameters ========================== + "num_patches": 2, + "model_eqns": 2, + "alt_soundspeed": "F", + "num_fluids": 1, + "mpp_lim": "F", + "mixture_err": "F", + "time_stepper": 3, + "weno_order": 5, + "weno_eps": 1.0e-16, + "weno_Re_flux": "F", + "weno_avg": "F", + "mapped_weno": "F", + "null_weights": "F", + "mp_weno": "F", + "riemann_solver": 1, + "wave_speeds": 1, + "avg_state": 2, + "bc_x%beg": -3, + "bc_x%end": -3, + # Turning on Hypoelasticity ================================ + "hypoelasticity": "T", + # Formatted Database Files Structure Parameters ============ + "format": 1, + "precision": 2, + "prim_vars_wrt": "T", + "parallel_io": "F", + # Patch 1 L ================================================ + "patch_icpp(1)%geometry": 1, + "patch_icpp(1)%x_centroid": 0.25, + "patch_icpp(1)%length_x": 0.5, + "patch_icpp(1)%vel(1)": 0.0, + "patch_icpp(1)%pres": 1.0e8, + "patch_icpp(1)%alpha_rho(1)": 1000, + "patch_icpp(1)%alpha(1)": 1.0, + "patch_icpp(1)%tau_e(1)": 0.0, + # Patch 2 R ================================================ + "patch_icpp(2)%geometry": 1, + "patch_icpp(2)%x_centroid": 0.75, + "patch_icpp(2)%length_x": 0.5, + "patch_icpp(2)%vel(1)": 0, + "patch_icpp(2)%pres": 1.0e05, + "patch_icpp(2)%alpha_rho(1)": 1000, + "patch_icpp(2)%alpha(1)": 1.0, + "patch_icpp(2)%tau_e(1)": 0.0, + # Fluids Physical Parameters =============================== + "fluid_pp(1)%gamma": 1.0e00 / (4.4e00 - 1.0e00), + "fluid_pp(1)%pi_inf": 4.4e00 * 6.0e08 / (4.4e00 - 1.0e00), + "fluid_pp(1)%G": 10e09, + } + ) +) diff --git a/examples/1D_sodshocktube/case.py b/examples/1D_sodshocktube/case.py index a6c1787632..2607d705c8 100755 --- a/examples/1D_sodshocktube/case.py +++ b/examples/1D_sodshocktube/case.py @@ -1,86 +1,74 @@ #!/usr/bin/env python3 - import math import json # Numerical setup Nx = 399 -dx = 1./(1.*(Nx+1)) +dx = 1.0 / (1.0 * (Nx + 1)) Tend, Nt = 0.1, 1000 -mydt = Tend/(1.*Nt) +mydt = Tend / (1.0 * Nt) # Configuring case dictionary -print(json.dumps({ - # Logistics ================================================================ - 'run_time_info' : 'T', - # ========================================================================== - - # Computational Domain Parameters ========================================== - 'x_domain%beg' : 0.E+00, - 'x_domain%end' : 1.E+00, - 'm' : Nx, - 'n' : 0, - 'p' : 0, - 'dt' : mydt, - 't_step_start' : 0, - 't_step_stop' : int(Nt), - 't_step_save' : int(math.ceil(Nt/10.)), - # ========================================================================== - - # Simulation Algorithm Parameters ========================================== - 'num_patches' : 2, - 'model_eqns' : 2, - 'alt_soundspeed' : 'F', - 'num_fluids' : 1, - 'mpp_lim' : 'F', - 'mixture_err' : 'F', - 'time_stepper' : 3, - 'weno_order' : 5, - 'weno_eps' : 1.E-16, - 'weno_Re_flux' : 'F', - 'weno_avg' : 'F', - 'mapped_weno' : 'T', - 'null_weights' : 'F', - 'mp_weno' : 'F', - 'riemann_solver' : 2, - 'wave_speeds' : 1, - 'avg_state' : 2, - 'bc_x%beg' : -3, - 'bc_x%end' : -3, - # ========================================================================== - - # Formatted Database Files Structure Parameters ============================ - 'format' : 1, - 'precision' : 2, - 'prim_vars_wrt' :'T', - 'parallel_io' :'T', - # ========================================================================== - - # Patch 1 L ================================================================ - 'patch_icpp(1)%geometry' : 1, - 'patch_icpp(1)%x_centroid' : 0.25, - 'patch_icpp(1)%length_x' : 0.5, - 'patch_icpp(1)%vel(1)' : 0.0, - 'patch_icpp(1)%pres' : 1.0, - 'patch_icpp(1)%alpha_rho(1)' : 1.E+00, - 'patch_icpp(1)%alpha(1)' : 1., - # ========================================================================== - - # Patch 2 R ================================================================ - 'patch_icpp(2)%geometry' : 1, - 'patch_icpp(2)%x_centroid' : 0.75, - 'patch_icpp(2)%length_x' : 0.5, - 'patch_icpp(2)%vel(1)' : 0.0, - 'patch_icpp(2)%pres' : 0.1, - 'patch_icpp(2)%alpha_rho(1)' : 0.125E+00, - 'patch_icpp(2)%alpha(1)' : 1., - # ========================================================================== - - # Fluids Physical Parameters =============================================== - 'fluid_pp(1)%gamma' : 1.E+00/(1.4-1.E+00), - 'fluid_pp(1)%pi_inf' : 0.0, - # ========================================================================== -})) - -# ============================================================================== +print( + json.dumps( + { + # Logistics ================================================================ + "run_time_info": "T", + # Computational Domain Parameters ========================================== + "x_domain%beg": 0.0e00, + "x_domain%end": 1.0e00, + "m": Nx, + "n": 0, + "p": 0, + "dt": mydt, + "t_step_start": 0, + "t_step_stop": int(Nt), + "t_step_save": int(math.ceil(Nt / 10.0)), + # Simulation Algorithm Parameters ========================================== + "num_patches": 2, + "model_eqns": 2, + "alt_soundspeed": "F", + "num_fluids": 1, + "mpp_lim": "F", + "mixture_err": "F", + "time_stepper": 3, + "weno_order": 5, + "weno_eps": 1.0e-16, + "weno_Re_flux": "F", + "weno_avg": "F", + "mapped_weno": "T", + "null_weights": "F", + "mp_weno": "F", + "riemann_solver": 2, + "wave_speeds": 1, + "avg_state": 2, + "bc_x%beg": -3, + "bc_x%end": -3, + # Formatted Database Files Structure Parameters ============================ + "format": 1, + "precision": 2, + "prim_vars_wrt": "T", + "parallel_io": "T", + # Patch 1 L ================================================================ + "patch_icpp(1)%geometry": 1, + "patch_icpp(1)%x_centroid": 0.25, + "patch_icpp(1)%length_x": 0.5, + "patch_icpp(1)%vel(1)": 0.0, + "patch_icpp(1)%pres": 1.0, + "patch_icpp(1)%alpha_rho(1)": 1.0e00, + "patch_icpp(1)%alpha(1)": 1.0, + # Patch 2 R ================================================================ + "patch_icpp(2)%geometry": 1, + "patch_icpp(2)%x_centroid": 0.75, + "patch_icpp(2)%length_x": 0.5, + "patch_icpp(2)%vel(1)": 0.0, + "patch_icpp(2)%pres": 0.1, + "patch_icpp(2)%alpha_rho(1)": 0.125e00, + "patch_icpp(2)%alpha(1)": 1.0, + # Fluids Physical Parameters =============================================== + "fluid_pp(1)%gamma": 1.0e00 / (1.4 - 1.0e00), + "fluid_pp(1)%pi_inf": 0.0, + } + ) +) diff --git a/examples/1D_titarevtorro/case.py b/examples/1D_titarevtorro/case.py index 35847c9cac..074d4b7164 100644 --- a/examples/1D_titarevtorro/case.py +++ b/examples/1D_titarevtorro/case.py @@ -1,84 +1,72 @@ #!/usr/bin/env python3 - import math import json # Numerical setup Nx = 999 -dx = 1./(1.*(Nx+1)) +dx = 1.0 / (1.0 * (Nx + 1)) Tend, Nt = 5, 20000 -mydt = Tend/(1.*Nt) +mydt = Tend / (1.0 * Nt) # Configuring case dictionary -print(json.dumps({ - # Logistics ================================================================ - 'run_time_info' : 'T', - # ========================================================================== - - # Computational Domain Parameters ========================================== - 'x_domain%beg' : -5., - 'x_domain%end' : 5. , - 'm' : Nx, - 'n' : 0, - 'p' : 0, - 'dt' : mydt, - 't_step_start' : 0, - 't_step_stop' : int(Nt), - 't_step_save' : int(math.ceil(Nt/10.)), - # ========================================================================== - - # Simulation Algorithm Parameters ========================================== - 'num_patches' : 2, - 'model_eqns' : 2, - 'alt_soundspeed' : 'F', - 'num_fluids' : 1, - 'mpp_lim' : 'F', - 'mixture_err' : 'F', - 'time_stepper' : 3, - 'weno_order' : 5, - 'weno_eps' : 1.E-16, - 'mapped_weno' : 'T', - 'null_weights' : 'F', - 'mp_weno' : 'F', - 'riemann_solver' : 2, - 'wave_speeds' : 1, - 'avg_state' : 2, - 'bc_x%beg' : -3, - 'bc_x%end' : -3, - # ========================================================================== - - # Formatted Database Files Structure Parameters ============================ - 'format' : 1, - 'precision' : 2, - 'prim_vars_wrt' :'T', - 'parallel_io' :'F', - # ========================================================================== - - # Patch 1 L (-5 < x < -4.5) ================================================ - 'patch_icpp(1)%geometry' : 1, - 'patch_icpp(1)%x_centroid' : -4.75, - 'patch_icpp(1)%length_x' : 0.5, - 'patch_icpp(1)%vel(1)' : 0.523326, - 'patch_icpp(1)%pres' : 1.805, - 'patch_icpp(1)%alpha_rho(1)' : 1.515695, - 'patch_icpp(1)%alpha(1)' : 1., - # ========================================================================== - - # Patch 2 R (-4.5 < x < 5) ================================================= - 'patch_icpp(2)%geometry' : 1, - 'patch_icpp(2)%x_centroid' : 0.25, - 'patch_icpp(2)%length_x' : 9.5, - 'patch_icpp(2)%vel(1)' : 0., - 'patch_icpp(2)%pres' : 1., - 'patch_icpp(2)%alpha_rho(1)' : '1 + 0.1*sin(20*x*pi)', - 'patch_icpp(2)%alpha(1)' : 1., - # ========================================================================== - - # Fluids Physical Parameters =============================================== - 'fluid_pp(1)%gamma' : 1.E+00/(1.4-1.E+00), - 'fluid_pp(1)%pi_inf' : 0.0, - # ========================================================================== -})) - -# ============================================================================== +print( + json.dumps( + { + # Logistics ================================================================ + "run_time_info": "T", + # Computational Domain Parameters ========================================== + "x_domain%beg": -5.0, + "x_domain%end": 5.0, + "m": Nx, + "n": 0, + "p": 0, + "dt": mydt, + "t_step_start": 0, + "t_step_stop": int(Nt), + "t_step_save": int(math.ceil(Nt / 10.0)), + # Simulation Algorithm Parameters ========================================== + "num_patches": 2, + "model_eqns": 2, + "alt_soundspeed": "F", + "num_fluids": 1, + "mpp_lim": "F", + "mixture_err": "F", + "time_stepper": 3, + "weno_order": 5, + "weno_eps": 1.0e-16, + "mapped_weno": "T", + "null_weights": "F", + "mp_weno": "F", + "riemann_solver": 2, + "wave_speeds": 1, + "avg_state": 2, + "bc_x%beg": -3, + "bc_x%end": -3, + # Formatted Database Files Structure Parameters ============================ + "format": 1, + "precision": 2, + "prim_vars_wrt": "T", + "parallel_io": "F", + # Patch 1 L (-5 < x < -4.5) ================================================ + "patch_icpp(1)%geometry": 1, + "patch_icpp(1)%x_centroid": -4.75, + "patch_icpp(1)%length_x": 0.5, + "patch_icpp(1)%vel(1)": 0.523326, + "patch_icpp(1)%pres": 1.805, + "patch_icpp(1)%alpha_rho(1)": 1.515695, + "patch_icpp(1)%alpha(1)": 1.0, + # Patch 2 R (-4.5 < x < 5) ================================================= + "patch_icpp(2)%geometry": 1, + "patch_icpp(2)%x_centroid": 0.25, + "patch_icpp(2)%length_x": 9.5, + "patch_icpp(2)%vel(1)": 0.0, + "patch_icpp(2)%pres": 1.0, + "patch_icpp(2)%alpha_rho(1)": "1 + 0.1*sin(20*x*pi)", + "patch_icpp(2)%alpha(1)": 1.0, + # Fluids Physical Parameters =============================================== + "fluid_pp(1)%gamma": 1.0e00 / (1.4 - 1.0e00), + "fluid_pp(1)%pi_inf": 0.0, + } + ) +) diff --git a/examples/1D_vacuum/case.py b/examples/1D_vacuum/case.py index b0e4367198..d5ad25bdee 100644 --- a/examples/1D_vacuum/case.py +++ b/examples/1D_vacuum/case.py @@ -1,85 +1,73 @@ #!/usr/bin/env python3 - import json # Configuring case dictionary -print(json.dumps({ - # Logistics ================================================================ - 'run_time_info' : 'T', - # ========================================================================== - - # Computational Domain Parameters ========================================== - 'x_domain%beg' : 0.E+00, - 'x_domain%end' : 1.E+00, - 'm' : 199, - 'n' : 0, - 'p' : 0, - 'dt' : 5.E-08, - 't_step_start' : 0, - 't_step_stop' : 15000, - 't_step_save' : 1000, - # ========================================================================== - - # Simulation Algorithm Parameters ========================================== - 'num_patches' : 2, - 'model_eqns' : 3, - 'alt_soundspeed' : 'F', - 'num_fluids' : 2, - 'mpp_lim' : 'T', - 'mixture_err' : 'T', - 'time_stepper' : 3, - 'weno_order' : 3, - 'weno_eps' : 1.E-16, - 'weno_Re_flux' : 'F', - 'weno_avg' : 'F', - 'mapped_weno' : 'T', - 'null_weights' : 'F', - 'mp_weno' : 'F', - 'riemann_solver' : 2, - 'wave_speeds' : 1, - 'avg_state' : 2, - 'bc_x%beg' : -3, - 'bc_x%end' : -3, - # ========================================================================== - - # Formatted Database Files Structure Parameters ============================ - 'format' : 1, - 'precision' : 2, - 'prim_vars_wrt' :'T', - 'parallel_io' :'T', - # ========================================================================== - - # Patch 1: Left state ====================================================== - 'patch_icpp(1)%geometry' : 1, - 'patch_icpp(1)%x_centroid' : 0.25E+00, - 'patch_icpp(1)%length_x' : 0.5E+00, - 'patch_icpp(1)%vel(1)' : -100.E+00, - 'patch_icpp(1)%pres' : 1.E+05, - 'patch_icpp(1)%alpha_rho(1)' : 1000.E+00*0.99E+00, - 'patch_icpp(1)%alpha_rho(2)' : 10.E+00*0.01E+00, - 'patch_icpp(1)%alpha(1)' : 0.99E+00, - 'patch_icpp(1)%alpha(2)' : 0.01E+00, - # ========================================================================== - - # Patch 2: Right state ===================================================== - 'patch_icpp(2)%geometry' : 1, - 'patch_icpp(2)%x_centroid' : 0.75E+00, - 'patch_icpp(2)%length_x' : 0.5E+00, - 'patch_icpp(2)%alter_patch(1)' : 'T', - 'patch_icpp(2)%vel(1)' : 100.E+00, - 'patch_icpp(2)%pres' : 1.E+05, - 'patch_icpp(2)%alpha_rho(1)' : 1000.E+00*0.99E+00, - 'patch_icpp(2)%alpha_rho(2)' : 10.E+00*0.01E+00, - 'patch_icpp(2)%alpha(1)' : 0.99E+00, - 'patch_icpp(2)%alpha(2)' : 0.01E+00, - # ========================================================================== - - # Fluids Physical Parameters =============================================== - 'fluid_pp(1)%gamma' : 1.E+00/(4.4E+00-1.E+00), - 'fluid_pp(1)%pi_inf' : 4.4E+00*6.E+08/(4.4E+00-1.E+00), - 'fluid_pp(2)%gamma' : 1.E+00/(1.4E+00-1.E+00), - 'fluid_pp(2)%pi_inf' : 0.E+00, - # ========================================================================== -})) - -# ============================================================================== +print( + json.dumps( + { + # Logistics ================================================================ + "run_time_info": "T", + # Computational Domain Parameters ========================================== + "x_domain%beg": 0.0e00, + "x_domain%end": 1.0e00, + "m": 199, + "n": 0, + "p": 0, + "dt": 5.0e-08, + "t_step_start": 0, + "t_step_stop": 15000, + "t_step_save": 1000, + # Simulation Algorithm Parameters ========================================== + "num_patches": 2, + "model_eqns": 3, + "alt_soundspeed": "F", + "num_fluids": 2, + "mpp_lim": "T", + "mixture_err": "T", + "time_stepper": 3, + "weno_order": 3, + "weno_eps": 1.0e-16, + "weno_Re_flux": "F", + "weno_avg": "F", + "mapped_weno": "T", + "null_weights": "F", + "mp_weno": "F", + "riemann_solver": 2, + "wave_speeds": 1, + "avg_state": 2, + "bc_x%beg": -3, + "bc_x%end": -3, + # Formatted Database Files Structure Parameters ============================ + "format": 1, + "precision": 2, + "prim_vars_wrt": "T", + "parallel_io": "T", + # Patch 1: Left state ====================================================== + "patch_icpp(1)%geometry": 1, + "patch_icpp(1)%x_centroid": 0.25e00, + "patch_icpp(1)%length_x": 0.5e00, + "patch_icpp(1)%vel(1)": -100.0e00, + "patch_icpp(1)%pres": 1.0e05, + "patch_icpp(1)%alpha_rho(1)": 1000.0e00 * 0.99e00, + "patch_icpp(1)%alpha_rho(2)": 10.0e00 * 0.01e00, + "patch_icpp(1)%alpha(1)": 0.99e00, + "patch_icpp(1)%alpha(2)": 0.01e00, + # Patch 2: Right state ===================================================== + "patch_icpp(2)%geometry": 1, + "patch_icpp(2)%x_centroid": 0.75e00, + "patch_icpp(2)%length_x": 0.5e00, + "patch_icpp(2)%alter_patch(1)": "T", + "patch_icpp(2)%vel(1)": 100.0e00, + "patch_icpp(2)%pres": 1.0e05, + "patch_icpp(2)%alpha_rho(1)": 1000.0e00 * 0.99e00, + "patch_icpp(2)%alpha_rho(2)": 10.0e00 * 0.01e00, + "patch_icpp(2)%alpha(1)": 0.99e00, + "patch_icpp(2)%alpha(2)": 0.01e00, + # Fluids Physical Parameters =============================================== + "fluid_pp(1)%gamma": 1.0e00 / (4.4e00 - 1.0e00), + "fluid_pp(1)%pi_inf": 4.4e00 * 6.0e08 / (4.4e00 - 1.0e00), + "fluid_pp(2)%gamma": 1.0e00 / (1.4e00 - 1.0e00), + "fluid_pp(2)%pi_inf": 0.0e00, + } + ) +) diff --git a/examples/1D_vacuum_restart/case.py b/examples/1D_vacuum_restart/case.py index 2b9e942971..dbc7ad8cfe 100644 --- a/examples/1D_vacuum_restart/case.py +++ b/examples/1D_vacuum_restart/case.py @@ -1,85 +1,73 @@ #!/usr/bin/env python3 - import json # Configuring case dictionary -print(json.dumps({ - # Logistics ================================================================ - 'run_time_info' : 'T', - # ========================================================================== - - # Computational Domain Parameters ========================================== - 'x_domain%beg' : 0.E+00, - 'x_domain%end' : 1.E+00, - 'm' : 199, - 'n' : 0, - 'p' : 0, - 'dt' : 5.E-08, - 't_step_start' : 0, - 't_step_stop' : 7000, - 't_step_save' : 1000, - # ========================================================================== - - # Simulation Algorithm Parameters ========================================== - 'num_patches' : 2, - 'model_eqns' : 3, - 'alt_soundspeed' : 'F', - 'num_fluids' : 2, - 'mpp_lim' : 'T', - 'mixture_err' : 'T', - 'time_stepper' : 3, - 'weno_order' : 3, - 'weno_eps' : 1.E-16, - 'weno_Re_flux' : 'F', - 'weno_avg' : 'F', - 'mapped_weno' : 'T', - 'null_weights' : 'F', - 'mp_weno' : 'F', - 'riemann_solver' : 2, - 'wave_speeds' : 1, - 'avg_state' : 2, - 'bc_x%beg' : -3, - 'bc_x%end' : -3, - # ========================================================================== - - # Formatted Database Files Structure Parameters ============================ - 'format' : 1, - 'precision' : 2, - 'prim_vars_wrt' :'T', - 'parallel_io' :'T', - # ========================================================================== - - # Patch 1: Left state ====================================================== - 'patch_icpp(1)%geometry' : 1, - 'patch_icpp(1)%x_centroid' : 0.25E+00, - 'patch_icpp(1)%length_x' : 0.5E+00, - 'patch_icpp(1)%vel(1)' : -100.E+00, - 'patch_icpp(1)%pres' : 1.E+05, - 'patch_icpp(1)%alpha_rho(1)' : 1000.E+00*0.99E+00, - 'patch_icpp(1)%alpha_rho(2)' : 10.E+00*0.01E+00, - 'patch_icpp(1)%alpha(1)' : 0.99E+00, - 'patch_icpp(1)%alpha(2)' : 0.01E+00, - # ========================================================================== - - # Patch 2: Right state ===================================================== - 'patch_icpp(2)%geometry' : 1, - 'patch_icpp(2)%x_centroid' : 0.75E+00, - 'patch_icpp(2)%length_x' : 0.5E+00, - 'patch_icpp(2)%alter_patch(1)' : 'T', - 'patch_icpp(2)%vel(1)' : 100.E+00, - 'patch_icpp(2)%pres' : 1.E+05, - 'patch_icpp(2)%alpha_rho(1)' : 1000.E+00*0.99E+00, - 'patch_icpp(2)%alpha_rho(2)' : 10.E+00*0.01E+00, - 'patch_icpp(2)%alpha(1)' : 0.99E+00, - 'patch_icpp(2)%alpha(2)' : 0.01E+00, - # ========================================================================== - - # Fluids Physical Parameters =============================================== - 'fluid_pp(1)%gamma' : 1.E+00/(4.4E+00-1.E+00), - 'fluid_pp(1)%pi_inf' : 4.4E+00*6.E+08/(4.4E+00-1.E+00), - 'fluid_pp(2)%gamma' : 1.E+00/(1.4E+00-1.E+00), - 'fluid_pp(2)%pi_inf' : 0.E+00, - # ========================================================================== -})) - -# ============================================================================== +print( + json.dumps( + { + # Logistics ================================================================ + "run_time_info": "T", + # Computational Domain Parameters ========================================== + "x_domain%beg": 0.0e00, + "x_domain%end": 1.0e00, + "m": 199, + "n": 0, + "p": 0, + "dt": 5.0e-08, + "t_step_start": 0, + "t_step_stop": 7000, + "t_step_save": 1000, + # Simulation Algorithm Parameters ========================================== + "num_patches": 2, + "model_eqns": 3, + "alt_soundspeed": "F", + "num_fluids": 2, + "mpp_lim": "T", + "mixture_err": "T", + "time_stepper": 3, + "weno_order": 3, + "weno_eps": 1.0e-16, + "weno_Re_flux": "F", + "weno_avg": "F", + "mapped_weno": "T", + "null_weights": "F", + "mp_weno": "F", + "riemann_solver": 2, + "wave_speeds": 1, + "avg_state": 2, + "bc_x%beg": -3, + "bc_x%end": -3, + # Formatted Database Files Structure Parameters ============================ + "format": 1, + "precision": 2, + "prim_vars_wrt": "T", + "parallel_io": "T", + # Patch 1: Left state ====================================================== + "patch_icpp(1)%geometry": 1, + "patch_icpp(1)%x_centroid": 0.25e00, + "patch_icpp(1)%length_x": 0.5e00, + "patch_icpp(1)%vel(1)": -100.0e00, + "patch_icpp(1)%pres": 1.0e05, + "patch_icpp(1)%alpha_rho(1)": 1000.0e00 * 0.99e00, + "patch_icpp(1)%alpha_rho(2)": 10.0e00 * 0.01e00, + "patch_icpp(1)%alpha(1)": 0.99e00, + "patch_icpp(1)%alpha(2)": 0.01e00, + # Patch 2: Right state ===================================================== + "patch_icpp(2)%geometry": 1, + "patch_icpp(2)%x_centroid": 0.75e00, + "patch_icpp(2)%length_x": 0.5e00, + "patch_icpp(2)%alter_patch(1)": "T", + "patch_icpp(2)%vel(1)": 100.0e00, + "patch_icpp(2)%pres": 1.0e05, + "patch_icpp(2)%alpha_rho(1)": 1000.0e00 * 0.99e00, + "patch_icpp(2)%alpha_rho(2)": 10.0e00 * 0.01e00, + "patch_icpp(2)%alpha(1)": 0.99e00, + "patch_icpp(2)%alpha(2)": 0.01e00, + # Fluids Physical Parameters =============================================== + "fluid_pp(1)%gamma": 1.0e00 / (4.4e00 - 1.0e00), + "fluid_pp(1)%pi_inf": 4.4e00 * 6.0e08 / (4.4e00 - 1.0e00), + "fluid_pp(2)%gamma": 1.0e00 / (1.4e00 - 1.0e00), + "fluid_pp(2)%pi_inf": 0.0e00, + } + ) +) diff --git a/examples/1D_vacuum_restart/restart_case.py b/examples/1D_vacuum_restart/restart_case.py index 40ead1b774..8299183b31 100644 --- a/examples/1D_vacuum_restart/restart_case.py +++ b/examples/1D_vacuum_restart/restart_case.py @@ -1,73 +1,63 @@ #!/usr/bin/env python3 - import json # Configuring case dictionary -print(json.dumps({ - # Logistics ================================================================ - 'run_time_info' : 'T', - # ========================================================================== - - # Computational Domain Parameters ========================================== - 'm' : 199, - 'n' : 0, - 'p' : 0, - 'dt' : 5.E-08, - 't_step_old' : 0, - 't_step_start' : 7000, - 't_step_stop' : 15000, - 't_step_save' : 1000, - # ========================================================================== - - # Simulation Algorithm Parameters ========================================== - 'old_ic' : 'T', - 'old_grid' : 'T', - 'num_patches' : 1, - 'model_eqns' : 3, - 'alt_soundspeed' : 'F', - 'num_fluids' : 2, - 'mpp_lim' : 'T', - 'mixture_err' : 'T', - 'time_stepper' : 3, - 'weno_order' : 3, - 'weno_eps' : 1.E-16, - 'weno_Re_flux' : 'F', - 'weno_avg' : 'F', - 'mapped_weno' : 'T', - 'null_weights' : 'F', - 'mp_weno' : 'F', - 'riemann_solver' : 2, - 'wave_speeds' : 1, - 'avg_state' : 2, - 'bc_x%beg' : -3, - 'bc_x%end' : -3, - # ========================================================================== - - # Formatted Database Files Structure Parameters ============================ - 'format' : 1, - 'precision' : 2, - 'prim_vars_wrt' :'T', - 'parallel_io' :'T', - # ========================================================================== - - # Patch 3: Added Patch ===================================================== - 'patch_icpp(1)%geometry' : 1, - 'patch_icpp(1)%x_centroid' : 0.5E+00, - 'patch_icpp(1)%length_x' : 0.5E+00, - 'patch_icpp(1)%vel(1)' : 0.E+00, - 'patch_icpp(1)%pres' : 1.E+05, - 'patch_icpp(1)%alpha_rho(1)' : 1000.E+00*0.99E+00, - 'patch_icpp(1)%alpha_rho(2)' : 10.E+00*0.01E+00, - 'patch_icpp(1)%alpha(1)' : 0.99E+00, - 'patch_icpp(1)%alpha(2)' : 0.01E+00, - # ========================================================================== - - # Fluids Physical Parameters =============================================== - 'fluid_pp(1)%gamma' : 1.E+00/(4.4E+00-1.E+00), - 'fluid_pp(1)%pi_inf' : 4.4E+00*6.E+08/(4.4E+00-1.E+00), - 'fluid_pp(2)%gamma' : 1.E+00/(1.4E+00-1.E+00), - 'fluid_pp(2)%pi_inf' : 0.E+00, - # ========================================================================== -})) - -# ============================================================================== +print( + json.dumps( + { + # Logistics ================================================================ + "run_time_info": "T", + # Computational Domain Parameters ========================================== + "m": 199, + "n": 0, + "p": 0, + "dt": 5.0e-08, + "t_step_old": 0, + "t_step_start": 7000, + "t_step_stop": 15000, + "t_step_save": 1000, + # Simulation Algorithm Parameters ========================================== + "old_ic": "T", + "old_grid": "T", + "num_patches": 1, + "model_eqns": 3, + "alt_soundspeed": "F", + "num_fluids": 2, + "mpp_lim": "T", + "mixture_err": "T", + "time_stepper": 3, + "weno_order": 3, + "weno_eps": 1.0e-16, + "weno_Re_flux": "F", + "weno_avg": "F", + "mapped_weno": "T", + "null_weights": "F", + "mp_weno": "F", + "riemann_solver": 2, + "wave_speeds": 1, + "avg_state": 2, + "bc_x%beg": -3, + "bc_x%end": -3, + # Formatted Database Files Structure Parameters ============================ + "format": 1, + "precision": 2, + "prim_vars_wrt": "T", + "parallel_io": "T", + # Patch 3: Added Patch ===================================================== + "patch_icpp(1)%geometry": 1, + "patch_icpp(1)%x_centroid": 0.5e00, + "patch_icpp(1)%length_x": 0.5e00, + "patch_icpp(1)%vel(1)": 0.0e00, + "patch_icpp(1)%pres": 1.0e05, + "patch_icpp(1)%alpha_rho(1)": 1000.0e00 * 0.99e00, + "patch_icpp(1)%alpha_rho(2)": 10.0e00 * 0.01e00, + "patch_icpp(1)%alpha(1)": 0.99e00, + "patch_icpp(1)%alpha(2)": 0.01e00, + # Fluids Physical Parameters =============================================== + "fluid_pp(1)%gamma": 1.0e00 / (4.4e00 - 1.0e00), + "fluid_pp(1)%pi_inf": 4.4e00 * 6.0e08 / (4.4e00 - 1.0e00), + "fluid_pp(2)%gamma": 1.0e00 / (1.4e00 - 1.0e00), + "fluid_pp(2)%pi_inf": 0.0e00, + } + ) +) diff --git a/examples/2D_5wave_quasi1D/case.py b/examples/2D_5wave_quasi1D/case.py index 4590ca8381..96caf95b2a 100755 --- a/examples/2D_5wave_quasi1D/case.py +++ b/examples/2D_5wave_quasi1D/case.py @@ -2,105 +2,93 @@ import math import json -#Numerical setup -Nx = 399 -dx = 1./(1.*(Nx+1)) +# Numerical setup +Nx = 399 +dx = 1.0 / (1.0 * (Nx + 1)) Ny = 19 -dy = 1./(1.*(Ny+1)) +dy = 1.0 / (1.0 * (Ny + 1)) -Tend = 6.4E-05 -Nt = 200 -mydt = Tend/(1.*Nt) +Tend = 6.4e-05 +Nt = 200 +mydt = Tend / (1.0 * Nt) # Configuring case dictionary -print(json.dumps({ +print( + json.dumps( + { # Logistics ================================================ - 'run_time_info' : 'T', - # ========================================================== - + "run_time_info": "T", # Computational Domain Parameters ========================== - 'x_domain%beg' : 0.E+00, - 'x_domain%end' : 1.E+00, - 'y_domain%beg' : -1.E-01, - 'y_domain%end' : 1.E-01, - 'm' : Nx, - 'n' : Ny, - 'p' : 0, - 'dt' : mydt, - 't_step_start' : 0, - 't_step_stop' : int(Nt), - 't_step_save' : int(math.ceil(Nt/1)), - # ========================================================== - - # Simulation Algorithm Parameters ========================== - 'num_patches' : 2, - 'model_eqns' : 2, - 'alt_soundspeed' : 'F', - 'num_fluids' : 1, - 'mpp_lim' : 'F', - 'mixture_err' : 'F', - 'time_stepper' : 3, - 'weno_order' : 3, - 'weno_eps' : 1.E-16, - 'weno_Re_flux' : 'F', - 'weno_avg' : 'F', - 'mapped_weno' : 'F', - 'null_weights' : 'F', - 'mp_weno' : 'F', - 'riemann_solver' : 1, - 'wave_speeds' : 1, - 'avg_state' : 2, - 'bc_x%beg' : -3, - 'bc_x%end' : -3, - 'bc_y%beg' : -3, - 'bc_y%end' : -3, - # ========================================================== - - # Turning on Hypoelasticity ================================ - 'hypoelasticity' : 'T', - 'fd_order' : 4, - # ========================================================== - - # Formatted Database Files Structure Parameters ============ - 'format' : 1, - 'precision' : 2, - 'prim_vars_wrt' :'T', - 'parallel_io' :'F', - # ========================================================== - - # Patch 1 L ================================================ - 'patch_icpp(1)%geometry' : 3, - 'patch_icpp(1)%x_centroid' : 0.25, - 'patch_icpp(1)%y_centroid' : 0.0, - 'patch_icpp(1)%length_x' : 0.5, - 'patch_icpp(1)%length_y' : 0.2, - 'patch_icpp(1)%vel(1)' : 0.0, - 'patch_icpp(1)%vel(2)' : 100, - 'patch_icpp(1)%pres' : 1E+08, - 'patch_icpp(1)%alpha_rho(1)' : 1000, - 'patch_icpp(1)%alpha(1)' : 1., - 'patch_icpp(1)%tau_e(1)' : 0.0, - # ========================================================== - - # Patch 2 R ================================================ - 'patch_icpp(2)%geometry' : 3, - 'patch_icpp(2)%x_centroid' : 0.75, - 'patch_icpp(2)%y_centroid' : 0.0, - 'patch_icpp(2)%length_x' : 0.5, - 'patch_icpp(2)%length_y' : 0.2, - 'patch_icpp(2)%vel(1)' : 0.0, - 'patch_icpp(2)%vel(2)' : -100, - 'patch_icpp(2)%pres' : 1E+05, - 'patch_icpp(2)%alpha_rho(1)' : 1000, - 'patch_icpp(2)%alpha(1)' : 1., - 'patch_icpp(2)%tau_e(1)' : 0.0, - # ========================================================== - - # Fluids Physical Parameters =============================== - 'fluid_pp(1)%gamma' : 1.E+00/(4.4E+00-1.E+00), - 'fluid_pp(1)%pi_inf' : 4.4E+00*6.E+08/(4.4E+00 - 1.E+00), - 'fluid_pp(1)%G' : 10.E+9, - # ========================================================== -})) -# ============================================================================== + "x_domain%beg": 0.0e00, + "x_domain%end": 1.0e00, + "y_domain%beg": -1.0e-01, + "y_domain%end": 1.0e-01, + "m": Nx, + "n": Ny, + "p": 0, + "dt": mydt, + "t_step_start": 0, + "t_step_stop": int(Nt), + "t_step_save": int(math.ceil(Nt / 1)), + # Simulation Algorithm Parameters ========================== + "num_patches": 2, + "model_eqns": 2, + "alt_soundspeed": "F", + "num_fluids": 1, + "mpp_lim": "F", + "mixture_err": "F", + "time_stepper": 3, + "weno_order": 3, + "weno_eps": 1.0e-16, + "weno_Re_flux": "F", + "weno_avg": "F", + "mapped_weno": "F", + "null_weights": "F", + "mp_weno": "F", + "riemann_solver": 1, + "wave_speeds": 1, + "avg_state": 2, + "bc_x%beg": -3, + "bc_x%end": -3, + "bc_y%beg": -3, + "bc_y%end": -3, + # Turning on Hypoelasticity ================================ + "hypoelasticity": "T", + "fd_order": 4, + # Formatted Database Files Structure Parameters ============ + "format": 1, + "precision": 2, + "prim_vars_wrt": "T", + "parallel_io": "F", + # Patch 1 L ================================================ + "patch_icpp(1)%geometry": 3, + "patch_icpp(1)%x_centroid": 0.25, + "patch_icpp(1)%y_centroid": 0.0, + "patch_icpp(1)%length_x": 0.5, + "patch_icpp(1)%length_y": 0.2, + "patch_icpp(1)%vel(1)": 0.0, + "patch_icpp(1)%vel(2)": 100, + "patch_icpp(1)%pres": 1e08, + "patch_icpp(1)%alpha_rho(1)": 1000, + "patch_icpp(1)%alpha(1)": 1.0, + "patch_icpp(1)%tau_e(1)": 0.0, + # Patch 2 R ================================================ + "patch_icpp(2)%geometry": 3, + "patch_icpp(2)%x_centroid": 0.75, + "patch_icpp(2)%y_centroid": 0.0, + "patch_icpp(2)%length_x": 0.5, + "patch_icpp(2)%length_y": 0.2, + "patch_icpp(2)%vel(1)": 0.0, + "patch_icpp(2)%vel(2)": -100, + "patch_icpp(2)%pres": 1e05, + "patch_icpp(2)%alpha_rho(1)": 1000, + "patch_icpp(2)%alpha(1)": 1.0, + "patch_icpp(2)%tau_e(1)": 0.0, + # Fluids Physical Parameters =============================== + "fluid_pp(1)%gamma": 1.0e00 / (4.4e00 - 1.0e00), + "fluid_pp(1)%pi_inf": 4.4e00 * 6.0e08 / (4.4e00 - 1.0e00), + "fluid_pp(1)%G": 10.0e9, + } + ) +) diff --git a/examples/2D_GreshoVortex/case.py b/examples/2D_GreshoVortex/case.py index 4070360e8f..4c0e789c42 100644 --- a/examples/2D_GreshoVortex/case.py +++ b/examples/2D_GreshoVortex/case.py @@ -1,96 +1,86 @@ #!/usr/bin/env python3 - import math import json gam = 1.4 -Ma0 = 1E-3 +Ma0 = 1e-3 c0 = math.sqrt(gam) -u0 = Ma0*c0 +u0 = Ma0 * c0 Nx = 256 Ny = 256 Nz = 0 -dx = 1./Nx +dx = 1.0 / Nx cfl = 0.5 -T = 1./Ma0 -dt = cfl*dx/(u0+c0) -Ntfinal = int(T/dt) +T = 1.0 / Ma0 +dt = cfl * dx / (u0 + c0) +Ntfinal = int(T / dt) Ntstart = 0 -Nfiles = 10 -t_save = int(math.ceil((Ntfinal-0)/float(Nfiles))) -Nt = t_save*Nfiles -t_step_start = Ntstart -t_step_stop = int(Nt) +Nfiles = 10 +t_save = int(math.ceil((Ntfinal - 0) / float(Nfiles))) +Nt = t_save * Nfiles +t_step_start = Ntstart +t_step_stop = int(Nt) # Configuring case dictionary -print(json.dumps({ - # Logistics ================================================================ - 'run_time_info' : 'T', - # ========================================================================== - - # Computational Domain Parameters ========================================== - 'x_domain%beg' : 0., - 'x_domain%end' : 1, - 'y_domain%beg' : 0., - 'y_domain%end' : 1., - 'm' : Nx, - 'n' : Ny, - 'p' : Nz, - 'dt' : dt, - 't_step_start' : t_step_start, - 't_step_stop' : t_step_stop, - 't_step_save' : t_save, - # ========================================================================== - - # Simulation Algorithm Parameters ========================================== - 'num_patches' : 1, - 'model_eqns' : 2, - 'num_fluids' : 1, - 'time_stepper' : 3, - 'weno_order' : 5, - 'weno_eps' : 1.E-16, - # 'mapped_weno' : 'T', - 'wenoz' : 'T', - 'riemann_solver' : 2, - 'low_Mach' : 1, - 'wave_speeds' : 1, - 'avg_state' : 2, - 'bc_x%beg' : -1, - 'bc_x%end' : -1, - 'bc_y%beg' : -1, - 'bc_y%end' : -1, - # ========================================================================== - - # Formatted Database Files Structure Parameters ============================ - 'format' : 1, - 'precision' : 2, - 'cons_vars_wrt' :'T', - 'prim_vars_wrt' :'T', - 'parallel_io' :'T', - 'fd_order' : 1, - 'omega_wrt(3)' :'T', - # ========================================================================== - - # Patch 1 ================================================================== - 'patch_icpp(1)%geometry' : 7, - 'patch_icpp(1)%hcid' : 203, - 'patch_icpp(1)%x_centroid' : 0.5, - 'patch_icpp(1)%y_centroid' : 0.5, - 'patch_icpp(1)%length_x' : 1, - 'patch_icpp(1)%length_y' : 1, - 'patch_icpp(1)%alpha_rho(1)' : 1., - 'patch_icpp(1)%alpha(1)' : 1., - 'patch_icpp(1)%vel(1)' : u0, - 'patch_icpp(1)%vel(2)' : Ma0, - 'patch_icpp(1)%pres' : 1., - # ========================================================================== - - # Fluids Physical Parameters =============================================== - 'fluid_pp(1)%gamma' : 1.E+00/(gam-1.E+00), - 'fluid_pp(1)%pi_inf' : 0., - # ========================================================================= -})) - -# ============================================================================== +print( + json.dumps( + { + # Logistics ================================================================ + "run_time_info": "T", + # Computational Domain Parameters ========================================== + "x_domain%beg": 0.0, + "x_domain%end": 1, + "y_domain%beg": 0.0, + "y_domain%end": 1.0, + "m": Nx, + "n": Ny, + "p": Nz, + "dt": dt, + "t_step_start": t_step_start, + "t_step_stop": t_step_stop, + "t_step_save": t_save, + # Simulation Algorithm Parameters ========================================== + "num_patches": 1, + "model_eqns": 2, + "num_fluids": 1, + "time_stepper": 3, + "weno_order": 5, + "weno_eps": 1.0e-16, + # 'mapped_weno' : 'T', + "wenoz": "T", + "riemann_solver": 2, + "low_Mach": 1, + "wave_speeds": 1, + "avg_state": 2, + "bc_x%beg": -1, + "bc_x%end": -1, + "bc_y%beg": -1, + "bc_y%end": -1, + # Formatted Database Files Structure Parameters ============================ + "format": 1, + "precision": 2, + "cons_vars_wrt": "T", + "prim_vars_wrt": "T", + "parallel_io": "T", + "fd_order": 1, + "omega_wrt(3)": "T", + # Patch 1 ================================================================== + "patch_icpp(1)%geometry": 7, + "patch_icpp(1)%hcid": 203, + "patch_icpp(1)%x_centroid": 0.5, + "patch_icpp(1)%y_centroid": 0.5, + "patch_icpp(1)%length_x": 1, + "patch_icpp(1)%length_y": 1, + "patch_icpp(1)%alpha_rho(1)": 1.0, + "patch_icpp(1)%alpha(1)": 1.0, + "patch_icpp(1)%vel(1)": u0, + "patch_icpp(1)%vel(2)": Ma0, + "patch_icpp(1)%pres": 1.0, + # Fluids Physical Parameters =============================================== + "fluid_pp(1)%gamma": 1.0e00 / (gam - 1.0e00), + "fluid_pp(1)%pi_inf": 0.0, + } + ) +) diff --git a/examples/2D_TaylorGreenVortex/case.py b/examples/2D_TaylorGreenVortex/case.py index a0b6bbebe2..d73ee524ce 100644 --- a/examples/2D_TaylorGreenVortex/case.py +++ b/examples/2D_TaylorGreenVortex/case.py @@ -1,89 +1,78 @@ #!/usr/bin/env python3 - import math import json gam_a = 1.4 -Mu = 10000 # Define the fluid's dynamic viscosity +Mu = 10000 # Define the fluid's dynamic viscosity # Dimension of the Vortex l = 1.0 -L = math.pi*l -import json +L = math.pi * l # Configuring case dictionary -print(json.dumps({ - # Logistics ================================================ - 'run_time_info' : 'T', - # ========================================================== - - # Computational Domain Parameters ========================== - # Periodic Domain from -pi*l to pi*l - 'x_domain%beg' : -L, - 'x_domain%end' : L, - 'y_domain%beg' : -L, - 'y_domain%end' : L, - 'm' : 199, - 'n' : 199, - 'p' : 0, - 'dt' : 1.0E-08, - 't_step_start' : 0, - 't_step_stop' : 10000, - 't_step_save' : 100, - # ========================================================== - - # Simulation Algorithm Parameters ========================== - 'num_patches' : 1, - 'model_eqns' : 2, - 'alt_soundspeed' : 'F', - 'num_fluids' : 1, - 'mpp_lim' : 'F', - 'mixture_err' : 'T', - 'time_stepper' : 3, - 'weno_order' : 5, - 'weno_eps' : 1.E-16, - 'mapped_weno' : 'T', - 'null_weights' : 'F', - 'mp_weno' : 'F', - 'weno_Re_flux' : 'T', - 'weno_avg' : 'T', - 'riemann_solver' : 2, - 'wave_speeds' : 1, - 'avg_state' : 2, - 'bc_x%beg' : -1, - 'bc_x%end' : -1, - 'bc_y%beg' : -1, - 'bc_y%end' : -1, - 'viscous' : 'T', - # ========================================================== - - # Formatted Database Files Structure Parameters ============ - 'format' : 1, - 'precision' : 2, - 'prim_vars_wrt' :'T', - 'parallel_io' :'T', - # ========================================================== - - # Patch 1: Base ============================================ - # Uncomment the configuration of the Taylor Green Vortex in - # 2D analytical patch under m_patch.f90 - 'patch_icpp(1)%geometry' : 20, - 'patch_icpp(1)%x_centroid' : 0.0, - 'patch_icpp(1)%y_centroid' : 0.0, - 'patch_icpp(1)%length_x' : 2.0*L, - 'patch_icpp(1)%length_y' : 2.0*L, - 'patch_icpp(1)%vel(1)' : 1.E-01, # Define the characteristic velocity of the vortex - 'patch_icpp(1)%vel(2)' : l, # Define the characteristic length of the vortex - 'patch_icpp(1)%pres' : 1.E+05, - 'patch_icpp(1)%alpha_rho(1)' : 1.22, - 'patch_icpp(1)%alpha(1)' : 1., - # ========================================================== - - - # Fluids Physical Parameters =============================== - 'fluid_pp(1)%gamma' : 1.E+00/(gam_a-1.E+00), - 'fluid_pp(1)%pi_inf' : 0.0, - # Shear viscosity of STD air - 'fluid_pp(1)%Re(1)' : 1/Mu, - # ========================================================== -})) -# ============================================================================== +print( + json.dumps( + { + # Logistics ================================================ + "run_time_info": "T", + # Computational Domain Parameters ========================== + # Periodic Domain from -pi*l to pi*l + "x_domain%beg": -L, + "x_domain%end": L, + "y_domain%beg": -L, + "y_domain%end": L, + "m": 199, + "n": 199, + "p": 0, + "dt": 1.0e-08, + "t_step_start": 0, + "t_step_stop": 10000, + "t_step_save": 100, + # Simulation Algorithm Parameters ========================== + "num_patches": 1, + "model_eqns": 2, + "alt_soundspeed": "F", + "num_fluids": 1, + "mpp_lim": "F", + "mixture_err": "T", + "time_stepper": 3, + "weno_order": 5, + "weno_eps": 1.0e-16, + "mapped_weno": "T", + "null_weights": "F", + "mp_weno": "F", + "weno_Re_flux": "T", + "weno_avg": "T", + "riemann_solver": 2, + "wave_speeds": 1, + "avg_state": 2, + "bc_x%beg": -1, + "bc_x%end": -1, + "bc_y%beg": -1, + "bc_y%end": -1, + "viscous": "T", + # Formatted Database Files Structure Parameters ============ + "format": 1, + "precision": 2, + "prim_vars_wrt": "T", + "parallel_io": "T", + # Patch 1: Base ============================================ + # Uncomment the configuration of the Taylor Green Vortex in + # 2D analytical patch under m_patch.f90 + "patch_icpp(1)%geometry": 20, + "patch_icpp(1)%x_centroid": 0.0, + "patch_icpp(1)%y_centroid": 0.0, + "patch_icpp(1)%length_x": 2.0 * L, + "patch_icpp(1)%length_y": 2.0 * L, + "patch_icpp(1)%vel(1)": 1.0e-01, # Define the characteristic velocity of the vortex + "patch_icpp(1)%vel(2)": l, # Define the characteristic length of the vortex + "patch_icpp(1)%pres": 1.0e05, + "patch_icpp(1)%alpha_rho(1)": 1.22, + "patch_icpp(1)%alpha(1)": 1.0, + # Fluids Physical Parameters =============================== + "fluid_pp(1)%gamma": 1.0e00 / (gam_a - 1.0e00), + "fluid_pp(1)%pi_inf": 0.0, + # Shear viscosity of STD air + "fluid_pp(1)%Re(1)": 1 / Mu, + } + ) +) diff --git a/examples/2D_acoustic_broadband/case.py b/examples/2D_acoustic_broadband/case.py index 1db0381567..0ec194f227 100644 --- a/examples/2D_acoustic_broadband/case.py +++ b/examples/2D_acoustic_broadband/case.py @@ -1,95 +1,82 @@ #!/usr/bin/env python3 - import json, math -print(json.dumps({ -# Logistics ================================================================ -'run_time_info' : 'T', -# ========================================================================== - -# Computational Domain Parameters ========================================== -'x_domain%beg' : 0, -'x_domain%end' : 0.3, -'y_domain%beg' : 0, -'y_domain%end' : 0.1, -'m' : 299, -'n' : 99, -'p' : 0, -'dt' : 5e-7, -'t_step_start' : 0, -'t_step_stop' : 1000, -'t_step_save' : 10, -# ========================================================================== - -# Simulation Algorithm Parameters ========================================== -'num_patches' : 1, -'model_eqns' : 2, -'alt_soundspeed' : 'F', -'num_fluids' : 1, -'mpp_lim' : 'F', -'mixture_err' : 'F', -'time_stepper' : 3, -'weno_order' : 5, -'weno_eps' : 1.E-16, -'teno' : 'T', -'teno_CT' : 1E-8, -'null_weights' : 'F', -'mp_weno' : 'F', -'riemann_solver' : 2, -'wave_speeds' : 1, -'avg_state' : 2, -'bc_x%beg' : -6, -'bc_x%end' : -6, -'bc_y%beg' : -6, -'bc_y%end' : -6, -# ========================================================================== - -# Formatted Database Files Structure Parameters ============================ -'format' : 1, -'precision' : 2, -'prim_vars_wrt' :'T', -'parallel_io' :'T', -'probe_wrt' :'T', -'fd_order' : 2, -'num_probes' : 1, -'probe(1)%x' : 0.13, -'probe(1)%y' : 0.05, - -# ========================================================================== - -# Patch 1 Liquid =========================================================== -'patch_icpp(1)%geometry' : 3, -'patch_icpp(1)%x_centroid' : 0.15, -'patch_icpp(1)%y_centroid' : 0.05, -'patch_icpp(1)%length_x' : 0.3, -'patch_icpp(1)%length_y' : 0.1, -'patch_icpp(1)%vel(1)' : 0.0, -'patch_icpp(1)%vel(2)' : 0.0, -'patch_icpp(1)%pres' : 1E+05, -'patch_icpp(1)%alpha_rho(1)' : 1.19, -'patch_icpp(1)%alpha(1)' : 1.0, -# ========================================================================== - -# Acoustic source ========================================================== -'acoustic_source' : 'T', -'num_source' : 1, -'acoustic(1)%support' : 2, -'acoustic(1)%loc(1)' : 0.1, -'acoustic(1)%loc(2)' : 0.05, -'acoustic(1)%dir' : math.pi * 0, -'acoustic(1)%length' : 0.1, -'acoustic(1)%pulse' : 4, -'acoustic(1)%npulse' : 1000000, -'acoustic(1)%mag' : 1000., -'acoustic(1)%bb_num_freq' : 100, -'acoustic(1)%bb_lowest_freq' : 500., -'acoustic(1)%bb_bandwidth' : 500., -# ========================================================================== - -# Fluids Physical Parameters =============================================== -'fluid_pp(1)%gamma' : 1.E+00/(1.4E+00-1.E+00), -'fluid_pp(1)%pi_inf' : 0, -# ========================================================================== -})) - -# ============================================================================== +print( + json.dumps( + { + # Logistics ================================================================ + "run_time_info": "T", + # Computational Domain Parameters ========================================== + "x_domain%beg": 0, + "x_domain%end": 0.3, + "y_domain%beg": 0, + "y_domain%end": 0.1, + "m": 299, + "n": 99, + "p": 0, + "dt": 5e-7, + "t_step_start": 0, + "t_step_stop": 1000, + "t_step_save": 10, + # Simulation Algorithm Parameters ========================================== + "num_patches": 1, + "model_eqns": 2, + "alt_soundspeed": "F", + "num_fluids": 1, + "mpp_lim": "F", + "mixture_err": "F", + "time_stepper": 3, + "weno_order": 5, + "weno_eps": 1.0e-16, + "teno": "T", + "teno_CT": 1e-8, + "null_weights": "F", + "mp_weno": "F", + "riemann_solver": 2, + "wave_speeds": 1, + "avg_state": 2, + "bc_x%beg": -6, + "bc_x%end": -6, + "bc_y%beg": -6, + "bc_y%end": -6, + # Formatted Database Files Structure Parameters ============================ + "format": 1, + "precision": 2, + "prim_vars_wrt": "T", + "parallel_io": "T", + "probe_wrt": "T", + "fd_order": 2, + "num_probes": 1, + "probe(1)%x": 0.13, + "probe(1)%y": 0.05, + # Patch 1 Liquid =========================================================== + "patch_icpp(1)%geometry": 3, + "patch_icpp(1)%x_centroid": 0.15, + "patch_icpp(1)%y_centroid": 0.05, + "patch_icpp(1)%length_x": 0.3, + "patch_icpp(1)%length_y": 0.1, + "patch_icpp(1)%vel(1)": 0.0, + "patch_icpp(1)%vel(2)": 0.0, + "patch_icpp(1)%pres": 1e05, + "patch_icpp(1)%alpha_rho(1)": 1.19, + "patch_icpp(1)%alpha(1)": 1.0, + # Acoustic source ========================================================== + "acoustic_source": "T", + "num_source": 1, + "acoustic(1)%support": 2, + "acoustic(1)%loc(1)": 0.1, + "acoustic(1)%loc(2)": 0.05, + "acoustic(1)%dir": math.pi * 0, + "acoustic(1)%length": 0.1, + "acoustic(1)%pulse": 4, + "acoustic(1)%npulse": 1000000, + "acoustic(1)%mag": 1000.0, + "acoustic(1)%bb_num_freq": 100, + "acoustic(1)%bb_lowest_freq": 500.0, + "acoustic(1)%bb_bandwidth": 500.0, + # Fluids Physical Parameters =============================================== + "fluid_pp(1)%gamma": 1.0e00 / (1.4e00 - 1.0e00), + "fluid_pp(1)%pi_inf": 0, + } + ) +) diff --git a/examples/2D_acoustic_pulse/case.py b/examples/2D_acoustic_pulse/case.py index 979e8b751e..6c0b23da13 100644 --- a/examples/2D_acoustic_pulse/case.py +++ b/examples/2D_acoustic_pulse/case.py @@ -4,7 +4,7 @@ # Numerical setup Nx = 99 Ny = 99 -dx = 8./(1.*(Nx+1)) +dx = 8.0 / (1.0 * (Nx + 1)) alf_st = 0.4 @@ -12,104 +12,91 @@ rho_inf = 1 gam = 1.4 -c = math.sqrt(gam*(p_inf) / rho_inf) +c = math.sqrt(gam * (p_inf) / rho_inf) cfl = 0.3 -mydt = cfl * dx / c -Tfinal = 80*1 / c -Nt = int(Tfinal/mydt) +mydt = cfl * dx / c +Tfinal = 80 * 1 / c +Nt = int(Tfinal / mydt) # Configuring case dictionary -print(json.dumps({ - # Logistics ================================================================ - 'run_time_info' : 'T', - # ========================================================================== - - # Computational Domain Parameters ========================================== - 'x_domain%beg' : -4, - 'x_domain%end' : 4, - 'y_domain%beg' : -4, - 'y_domain%end' : 4, - 'm' : Nx, - 'n' : Ny, - 'p' : 0, - 'dt' : mydt, - 't_step_start' : 0, - 't_step_stop' : Nt, - 't_step_save' : int(Nt/100), - # ========================================================================== - - # Simulation Algorithm Parameters ========================================== - 'num_patches' : 2, - 'model_eqns' : 2, - 'alt_soundspeed' : 'F', - 'num_fluids' : 1, - 'mpp_lim' : 'F', - 'mixture_err' : 'F', - 'time_stepper' : 3, - 'weno_order' : 5, - 'weno_eps' : 1.E-16, - 'mapped_weno' : 'T', - 'null_weights' : 'F', - 'mp_weno' : 'F', - 'riemann_solver' : 2, - 'wave_speeds' : 1, - 'avg_state' : 2, - 'bc_x%beg' : -8, - 'bc_x%end' : -8, - 'bc_y%beg' : -8, - 'bc_y%end' : -8, - # ========================================================================== - - # Formatted Database Files Structure Parameters ============================ - 'format' : 1, - 'precision' : 2, - 'prim_vars_wrt' :'T', - 'parallel_io' :'T', - 'omega_wrt(3)' :'T', - 'fd_order' : 2, - # ========================================================================== - - # Patch 1 ================================================================== - 'patch_icpp(1)%geometry' : 3, - 'patch_icpp(1)%x_centroid' : 0, - 'patch_icpp(1)%y_centroid' : 0, - 'patch_icpp(1)%length_x' : 8., - 'patch_icpp(1)%length_y' : 8., - 'patch_icpp(1)%vel(1)' : 0, - 'patch_icpp(1)%vel(2)' : 0, - 'patch_icpp(1)%pres' : p_inf, - 'patch_icpp(1)%alpha_rho(1)' : rho_inf, - 'patch_icpp(1)%alpha(1)' : 1., - # ========================================================================== - - # Patch 2 ================================================================== - 'patch_icpp(2)%geometry' : 2, - 'patch_icpp(2)%x_centroid' : 0, - 'patch_icpp(2)%y_centroid' : 0, - 'patch_icpp(2)%radius' : 1., - 'patch_icpp(2)%vel(1)' : 0, - 'patch_icpp(2)%vel(2)' : 0, - 'patch_icpp(2)%pres' : f"{p_inf}*(1 - 0.5*({gam} - 1)*({alf_st})**2*exp(0.5*(1 - sqrt(x**2 + y**2))))**({gam} / ({gam} - 1))", - 'patch_icpp(2)%alpha_rho(1)' : f"{rho_inf}*(1 - 0.5*({gam} - 1)*({alf_st})**2*exp(0.5*(1 - sqrt(x**2 + y**2))))**(1 / ({gam} - 1))", - 'patch_icpp(2)%alpha(1)' : 1., - 'patch_icpp(2)%alter_patch(1)' : 'T', - # ========================================================================== - - # CBC Inflow / Outflow ======================================== - 'bc_x%grcbc_in' : 'F', - 'bc_x%grcbc_out' : 'T', - 'bc_x%grcbc_vel_out' : 'F', - 'bc_x%pres_out' : p_inf, - 'bc_y%grcbc_in' : 'F', - 'bc_y%grcbc_out' : 'T', - 'bc_y%grcbc_vel_out' : 'F', - 'bc_y%pres_out' : p_inf, - # # ======================================================================== - - # Fluids Physical Parameters =============================================== - 'fluid_pp(1)%gamma' : 1.E+00/(gam-1.E+00), - 'fluid_pp(1)%pi_inf' : 0.0, - # ========================================================================== -})) - -# ============================================================================== +print( + json.dumps( + { + # Logistics ================================================================ + "run_time_info": "T", + # Computational Domain Parameters ========================================== + "x_domain%beg": -4, + "x_domain%end": 4, + "y_domain%beg": -4, + "y_domain%end": 4, + "m": Nx, + "n": Ny, + "p": 0, + "dt": mydt, + "t_step_start": 0, + "t_step_stop": Nt, + "t_step_save": int(Nt / 100), + # Simulation Algorithm Parameters ========================================== + "num_patches": 2, + "model_eqns": 2, + "alt_soundspeed": "F", + "num_fluids": 1, + "mpp_lim": "F", + "mixture_err": "F", + "time_stepper": 3, + "weno_order": 5, + "weno_eps": 1.0e-16, + "mapped_weno": "T", + "null_weights": "F", + "mp_weno": "F", + "riemann_solver": 2, + "wave_speeds": 1, + "avg_state": 2, + "bc_x%beg": -8, + "bc_x%end": -8, + "bc_y%beg": -8, + "bc_y%end": -8, + # Formatted Database Files Structure Parameters ============================ + "format": 1, + "precision": 2, + "prim_vars_wrt": "T", + "parallel_io": "T", + "omega_wrt(3)": "T", + "fd_order": 2, + # Patch 1 ================================================================== + "patch_icpp(1)%geometry": 3, + "patch_icpp(1)%x_centroid": 0, + "patch_icpp(1)%y_centroid": 0, + "patch_icpp(1)%length_x": 8.0, + "patch_icpp(1)%length_y": 8.0, + "patch_icpp(1)%vel(1)": 0, + "patch_icpp(1)%vel(2)": 0, + "patch_icpp(1)%pres": p_inf, + "patch_icpp(1)%alpha_rho(1)": rho_inf, + "patch_icpp(1)%alpha(1)": 1.0, + # Patch 2 ================================================================== + "patch_icpp(2)%geometry": 2, + "patch_icpp(2)%x_centroid": 0, + "patch_icpp(2)%y_centroid": 0, + "patch_icpp(2)%radius": 1.0, + "patch_icpp(2)%vel(1)": 0, + "patch_icpp(2)%vel(2)": 0, + "patch_icpp(2)%pres": f"{p_inf}*(1 - 0.5*({gam} - 1)*({alf_st})**2*exp(0.5*(1 - sqrt(x**2 + y**2))))**({gam} / ({gam} - 1))", + "patch_icpp(2)%alpha_rho(1)": f"{rho_inf}*(1 - 0.5*({gam} - 1)*({alf_st})**2*exp(0.5*(1 - sqrt(x**2 + y**2))))**(1 / ({gam} - 1))", + "patch_icpp(2)%alpha(1)": 1.0, + "patch_icpp(2)%alter_patch(1)": "T", + # CBC Inflow / Outflow ======================================== + "bc_x%grcbc_in": "F", + "bc_x%grcbc_out": "T", + "bc_x%grcbc_vel_out": "F", + "bc_x%pres_out": p_inf, + "bc_y%grcbc_in": "F", + "bc_y%grcbc_out": "T", + "bc_y%grcbc_vel_out": "F", + "bc_y%pres_out": p_inf, + # Fluids Physical Parameters =============================================== + "fluid_pp(1)%gamma": 1.0e00 / (gam - 1.0e00), + "fluid_pp(1)%pi_inf": 0.0, + } + ) +) diff --git a/examples/2D_acoustic_support10_axisym/case.py b/examples/2D_acoustic_support10_axisym/case.py index d22d665e22..da2f338654 100644 --- a/examples/2D_acoustic_support10_axisym/case.py +++ b/examples/2D_acoustic_support10_axisym/case.py @@ -1,93 +1,81 @@ #!/usr/bin/env python3 - import json, math # Configuring case dictionary -print(json.dumps({ - # Logistics ================================================================ - 'run_time_info' : 'T', - # ========================================================================== - - # Computational Domain Parameters ========================================== - 'x_domain%beg' : 0, - 'x_domain%end' : 0.001, - 'y_domain%beg' : 0, - 'y_domain%end' : 0.0005, - 'cyl_coord' : 'T', - 'm' : 199, - 'n' : 99, - 'p' : 0, - 'dt' : 1e-9, - 't_step_start' : 0, - 't_step_stop' : 800, - 't_step_save' : 20, - # ========================================================================== - - # Simulation Algorithm Parameters ========================================== - 'num_patches' : 1, - 'model_eqns' : 2, - 'alt_soundspeed' : 'F', - 'num_fluids' : 1, - 'mpp_lim' : 'F', - 'mixture_err' : 'F', - 'time_stepper' : 3, - 'weno_order' : 5, - 'weno_eps' : 1.E-16, - 'teno' : 'T', - 'teno_CT' : 1E-8, - 'null_weights' : 'F', - 'mp_weno' : 'F', - 'riemann_solver' : 2, - 'wave_speeds' : 1, - 'avg_state' : 2, - 'bc_x%beg' : -6, - 'bc_x%end' : -6, - 'bc_y%beg' : -2, - 'bc_y%end' : -6, - # ========================================================================== - - # Formatted Database Files Structure Parameters ============================ - 'format' : 1, - 'precision' : 2, - 'prim_vars_wrt' :'T', - 'parallel_io' :'T', - # ========================================================================== - - # Patch 1 Liquid =========================================================== - 'patch_icpp(1)%geometry' : 3, - 'patch_icpp(1)%x_centroid' : 0.0005, - 'patch_icpp(1)%y_centroid' : 0.00025, - 'patch_icpp(1)%length_x' : 0.001, - 'patch_icpp(1)%length_y' : 0.0005, - 'patch_icpp(1)%vel(1)' : 0.0, - 'patch_icpp(1)%vel(2)' : 0.0, - 'patch_icpp(1)%pres' : 1E+05, - 'patch_icpp(1)%alpha_rho(1)' : 1100, - 'patch_icpp(1)%alpha(1)' : 1.0, - # ========================================================================== - - # Acoustic source ========================================================== - 'acoustic_source' : 'T', - 'num_source' : 1, - 'acoustic(1)%support' : 10, - 'acoustic(1)%loc(1)' : 0.00006, - 'acoustic(1)%loc(2)' : 0., - 'acoustic(1)%pulse' : 2, - 'acoustic(1)%npulse' : 1, - 'acoustic(1)%mag' : 1., - 'acoustic(1)%gauss_sigma_time' : 2E-8, - 'acoustic(1)%foc_length' : 0.00054, - 'acoustic(1)%aperture' : 0.0008, - 'acoustic(1)%num_elements' : 4, - 'acoustic(1)%element_on' : 0, - 'acoustic(1)%element_spacing_angle': math.pi/180*5, - 'acoustic(1)%delay' : 1E-7, - # ========================================================================== - - # Fluids Physical Parameters =============================================== - 'fluid_pp(1)%gamma' : 1.E+00/(4.4E+00-1.E+00), - 'fluid_pp(1)%pi_inf' : 4.4E+00*5.57E+08/(4.4E+00 - 1.E+00), - # ========================================================================== -})) - -# ============================================================================== +print( + json.dumps( + { + # Logistics ================================================================ + "run_time_info": "T", + # Computational Domain Parameters ========================================== + "x_domain%beg": 0, + "x_domain%end": 0.001, + "y_domain%beg": 0, + "y_domain%end": 0.0005, + "cyl_coord": "T", + "m": 199, + "n": 99, + "p": 0, + "dt": 1e-9, + "t_step_start": 0, + "t_step_stop": 800, + "t_step_save": 20, + # Simulation Algorithm Parameters ========================================== + "num_patches": 1, + "model_eqns": 2, + "alt_soundspeed": "F", + "num_fluids": 1, + "mpp_lim": "F", + "mixture_err": "F", + "time_stepper": 3, + "weno_order": 5, + "weno_eps": 1.0e-16, + "teno": "T", + "teno_CT": 1e-8, + "null_weights": "F", + "mp_weno": "F", + "riemann_solver": 2, + "wave_speeds": 1, + "avg_state": 2, + "bc_x%beg": -6, + "bc_x%end": -6, + "bc_y%beg": -2, + "bc_y%end": -6, + # Formatted Database Files Structure Parameters ============================ + "format": 1, + "precision": 2, + "prim_vars_wrt": "T", + "parallel_io": "T", + # Patch 1 Liquid =========================================================== + "patch_icpp(1)%geometry": 3, + "patch_icpp(1)%x_centroid": 0.0005, + "patch_icpp(1)%y_centroid": 0.00025, + "patch_icpp(1)%length_x": 0.001, + "patch_icpp(1)%length_y": 0.0005, + "patch_icpp(1)%vel(1)": 0.0, + "patch_icpp(1)%vel(2)": 0.0, + "patch_icpp(1)%pres": 1e05, + "patch_icpp(1)%alpha_rho(1)": 1100, + "patch_icpp(1)%alpha(1)": 1.0, + # Acoustic source ========================================================== + "acoustic_source": "T", + "num_source": 1, + "acoustic(1)%support": 10, + "acoustic(1)%loc(1)": 0.00006, + "acoustic(1)%loc(2)": 0.0, + "acoustic(1)%pulse": 2, + "acoustic(1)%npulse": 1, + "acoustic(1)%mag": 1.0, + "acoustic(1)%gauss_sigma_time": 2e-8, + "acoustic(1)%foc_length": 0.00054, + "acoustic(1)%aperture": 0.0008, + "acoustic(1)%num_elements": 4, + "acoustic(1)%element_on": 0, + "acoustic(1)%element_spacing_angle": math.pi / 180 * 5, + "acoustic(1)%delay": 1e-7, + # Fluids Physical Parameters =============================================== + "fluid_pp(1)%gamma": 1.0e00 / (4.4e00 - 1.0e00), + "fluid_pp(1)%pi_inf": 4.4e00 * 5.57e08 / (4.4e00 - 1.0e00), + } + ) +) diff --git a/examples/2D_acoustic_support2/case.py b/examples/2D_acoustic_support2/case.py index c2a179b56d..f0805984de 100644 --- a/examples/2D_acoustic_support2/case.py +++ b/examples/2D_acoustic_support2/case.py @@ -1,89 +1,77 @@ #!/usr/bin/env python3 - import json, math # Configuring case dictionary -print(json.dumps({ - # Logistics ================================================================ - 'run_time_info' : 'T', - # ========================================================================== - - # Computational Domain Parameters ========================================== - 'x_domain%beg' : 0, - 'x_domain%end' : 0.001, - 'y_domain%beg' : 0, - 'y_domain%end' : 0.001, - 'm' : 99, - 'n' : 99, - 'p' : 0, - 'dt' : 4e-9, - 't_step_start' : 0, - 't_step_stop' : 200, - 't_step_save' : 10, - # ========================================================================== - - # Simulation Algorithm Parameters ========================================== - 'num_patches' : 1, - 'model_eqns' : 2, - 'alt_soundspeed' : 'F', - 'num_fluids' : 1, - 'mpp_lim' : 'F', - 'mixture_err' : 'F', - 'time_stepper' : 3, - 'weno_order' : 5, - 'weno_eps' : 1.E-16, - 'teno' : 'T', - 'teno_CT' : 1E-8, - 'null_weights' : 'F', - 'mp_weno' : 'F', - 'riemann_solver' : 2, - 'wave_speeds' : 1, - 'avg_state' : 2, - 'bc_x%beg' : -6, - 'bc_x%end' : -6, - 'bc_y%beg' : -6, - 'bc_y%end' : -6, - # ========================================================================== - - # Formatted Database Files Structure Parameters ============================ - 'format' : 1, - 'precision' : 2, - 'prim_vars_wrt' :'T', - 'parallel_io' :'T', - # ========================================================================== - - # Patch 1 Liquid =========================================================== - 'patch_icpp(1)%geometry' : 3, - 'patch_icpp(1)%x_centroid' : 0.0005, - 'patch_icpp(1)%y_centroid' : 0.0005, - 'patch_icpp(1)%length_x' : 0.001, - 'patch_icpp(1)%length_y' : 0.001, - 'patch_icpp(1)%vel(1)' : 0.0, - 'patch_icpp(1)%vel(2)' : 0.0, - 'patch_icpp(1)%pres' : 1E+05, - 'patch_icpp(1)%alpha_rho(1)' : 1100, - 'patch_icpp(1)%alpha(1)' : 1.0, - # ========================================================================== - - # Acoustic source ========================================================== - 'acoustic_source' : 'T', - 'num_source' : 1, - 'acoustic(1)%support' : 2, - 'acoustic(1)%loc(1)' : 0.0005, - 'acoustic(1)%loc(2)' : 0.0005, - 'acoustic(1)%dir' : math.pi/4, - 'acoustic(1)%length' : 0.0005, - 'acoustic(1)%pulse' : 2, - 'acoustic(1)%npulse' : 1, - 'acoustic(1)%mag' : 1., - 'acoustic(1)%gauss_sigma_time' : 2E-8, - 'acoustic(1)%delay' : 1E-7, - # ========================================================================== - - # Fluids Physical Parameters =============================================== - 'fluid_pp(1)%gamma' : 1.E+00/(4.4E+00-1.E+00), - 'fluid_pp(1)%pi_inf' : 4.4E+00*5.57E+08/(4.4E+00 - 1.E+00), - # ========================================================================== -})) - -# ============================================================================== +print( + json.dumps( + { + # Logistics ================================================================ + "run_time_info": "T", + # Computational Domain Parameters ========================================== + "x_domain%beg": 0, + "x_domain%end": 0.001, + "y_domain%beg": 0, + "y_domain%end": 0.001, + "m": 99, + "n": 99, + "p": 0, + "dt": 4e-9, + "t_step_start": 0, + "t_step_stop": 200, + "t_step_save": 10, + # Simulation Algorithm Parameters ========================================== + "num_patches": 1, + "model_eqns": 2, + "alt_soundspeed": "F", + "num_fluids": 1, + "mpp_lim": "F", + "mixture_err": "F", + "time_stepper": 3, + "weno_order": 5, + "weno_eps": 1.0e-16, + "teno": "T", + "teno_CT": 1e-8, + "null_weights": "F", + "mp_weno": "F", + "riemann_solver": 2, + "wave_speeds": 1, + "avg_state": 2, + "bc_x%beg": -6, + "bc_x%end": -6, + "bc_y%beg": -6, + "bc_y%end": -6, + # Formatted Database Files Structure Parameters ============================ + "format": 1, + "precision": 2, + "prim_vars_wrt": "T", + "parallel_io": "T", + # Patch 1 Liquid =========================================================== + "patch_icpp(1)%geometry": 3, + "patch_icpp(1)%x_centroid": 0.0005, + "patch_icpp(1)%y_centroid": 0.0005, + "patch_icpp(1)%length_x": 0.001, + "patch_icpp(1)%length_y": 0.001, + "patch_icpp(1)%vel(1)": 0.0, + "patch_icpp(1)%vel(2)": 0.0, + "patch_icpp(1)%pres": 1e05, + "patch_icpp(1)%alpha_rho(1)": 1100, + "patch_icpp(1)%alpha(1)": 1.0, + # Acoustic source ========================================================== + "acoustic_source": "T", + "num_source": 1, + "acoustic(1)%support": 2, + "acoustic(1)%loc(1)": 0.0005, + "acoustic(1)%loc(2)": 0.0005, + "acoustic(1)%dir": math.pi / 4, + "acoustic(1)%length": 0.0005, + "acoustic(1)%pulse": 2, + "acoustic(1)%npulse": 1, + "acoustic(1)%mag": 1.0, + "acoustic(1)%gauss_sigma_time": 2e-8, + "acoustic(1)%delay": 1e-7, + # Fluids Physical Parameters =============================================== + "fluid_pp(1)%gamma": 1.0e00 / (4.4e00 - 1.0e00), + "fluid_pp(1)%pi_inf": 4.4e00 * 5.57e08 / (4.4e00 - 1.0e00), + } + ) +) diff --git a/examples/2D_acoustic_support5/case.py b/examples/2D_acoustic_support5/case.py index 43ac05a0b2..cc8fc184e0 100644 --- a/examples/2D_acoustic_support5/case.py +++ b/examples/2D_acoustic_support5/case.py @@ -1,89 +1,77 @@ #!/usr/bin/env python3 - import json # Configuring case dictionary -print(json.dumps({ - # Logistics ================================================================ - 'run_time_info' : 'T', - # ========================================================================== - - # Computational Domain Parameters ========================================== - 'x_domain%beg' : 0, - 'x_domain%end' : 0.001, - 'y_domain%beg' : 0, - 'y_domain%end' : 0.001, - 'm' : 99, - 'n' : 99, - 'p' : 0, - 'dt' : 4e-9, - 't_step_start' : 0, - 't_step_stop' : 200, - 't_step_save' : 10, - # ========================================================================== - - # Simulation Algorithm Parameters ========================================== - 'num_patches' : 1, - 'model_eqns' : 2, - 'alt_soundspeed' : 'F', - 'num_fluids' : 1, - 'mpp_lim' : 'F', - 'mixture_err' : 'F', - 'time_stepper' : 3, - 'weno_order' : 5, - 'weno_eps' : 1.E-16, - 'teno' : 'T', - 'teno_CT' : 1E-8, - 'null_weights' : 'F', - 'mp_weno' : 'F', - 'riemann_solver' : 2, - 'wave_speeds' : 1, - 'avg_state' : 2, - 'bc_x%beg' : -6, - 'bc_x%end' : -6, - 'bc_y%beg' : -6, - 'bc_y%end' : -6, - # ========================================================================== - - # Formatted Database Files Structure Parameters ============================ - 'format' : 1, - 'precision' : 2, - 'prim_vars_wrt' :'T', - 'parallel_io' :'T', - # ========================================================================== - - # Patch 1 Liquid =========================================================== - 'patch_icpp(1)%geometry' : 3, - 'patch_icpp(1)%x_centroid' : 0.0005, - 'patch_icpp(1)%y_centroid' : 0.0005, - 'patch_icpp(1)%length_x' : 0.001, - 'patch_icpp(1)%length_y' : 0.001, - 'patch_icpp(1)%vel(1)' : 0.0, - 'patch_icpp(1)%vel(2)' : 0.0, - 'patch_icpp(1)%pres' : 1E+05, - 'patch_icpp(1)%alpha_rho(1)' : 1100, - 'patch_icpp(1)%alpha(1)' : 1.0, - # ========================================================================== - - # Acoustic source ========================================================== - 'acoustic_source' : 'T', - 'num_source' : 1, - 'acoustic(1)%support' : 5, - 'acoustic(1)%loc(1)' : 0.00006, - 'acoustic(1)%loc(2)' : 0.0005, - 'acoustic(1)%pulse' : 2, - 'acoustic(1)%npulse' : 1, - 'acoustic(1)%mag' : 1., - 'acoustic(1)%gauss_sigma_time' : 2E-8, - 'acoustic(1)%foc_length' : 0.00054, - 'acoustic(1)%aperture' : 0.0008, - 'acoustic(1)%delay' : 1E-7, - # ========================================================================== - - # Fluids Physical Parameters =============================================== - 'fluid_pp(1)%gamma' : 1.E+00/(4.4E+00-1.E+00), - 'fluid_pp(1)%pi_inf' : 4.4E+00*5.57E+08/(4.4E+00 - 1.E+00), - # ========================================================================== -})) - -# ============================================================================== +print( + json.dumps( + { + # Logistics ================================================================ + "run_time_info": "T", + # Computational Domain Parameters ========================================== + "x_domain%beg": 0, + "x_domain%end": 0.001, + "y_domain%beg": 0, + "y_domain%end": 0.001, + "m": 99, + "n": 99, + "p": 0, + "dt": 4e-9, + "t_step_start": 0, + "t_step_stop": 200, + "t_step_save": 10, + # Simulation Algorithm Parameters ========================================== + "num_patches": 1, + "model_eqns": 2, + "alt_soundspeed": "F", + "num_fluids": 1, + "mpp_lim": "F", + "mixture_err": "F", + "time_stepper": 3, + "weno_order": 5, + "weno_eps": 1.0e-16, + "teno": "T", + "teno_CT": 1e-8, + "null_weights": "F", + "mp_weno": "F", + "riemann_solver": 2, + "wave_speeds": 1, + "avg_state": 2, + "bc_x%beg": -6, + "bc_x%end": -6, + "bc_y%beg": -6, + "bc_y%end": -6, + # Formatted Database Files Structure Parameters ============================ + "format": 1, + "precision": 2, + "prim_vars_wrt": "T", + "parallel_io": "T", + # Patch 1 Liquid =========================================================== + "patch_icpp(1)%geometry": 3, + "patch_icpp(1)%x_centroid": 0.0005, + "patch_icpp(1)%y_centroid": 0.0005, + "patch_icpp(1)%length_x": 0.001, + "patch_icpp(1)%length_y": 0.001, + "patch_icpp(1)%vel(1)": 0.0, + "patch_icpp(1)%vel(2)": 0.0, + "patch_icpp(1)%pres": 1e05, + "patch_icpp(1)%alpha_rho(1)": 1100, + "patch_icpp(1)%alpha(1)": 1.0, + # Acoustic source ========================================================== + "acoustic_source": "T", + "num_source": 1, + "acoustic(1)%support": 5, + "acoustic(1)%loc(1)": 0.00006, + "acoustic(1)%loc(2)": 0.0005, + "acoustic(1)%pulse": 2, + "acoustic(1)%npulse": 1, + "acoustic(1)%mag": 1.0, + "acoustic(1)%gauss_sigma_time": 2e-8, + "acoustic(1)%foc_length": 0.00054, + "acoustic(1)%aperture": 0.0008, + "acoustic(1)%delay": 1e-7, + # Fluids Physical Parameters =============================================== + "fluid_pp(1)%gamma": 1.0e00 / (4.4e00 - 1.0e00), + "fluid_pp(1)%pi_inf": 4.4e00 * 5.57e08 / (4.4e00 - 1.0e00), + } + ) +) diff --git a/examples/2D_acoustic_support6_axisym/case.py b/examples/2D_acoustic_support6_axisym/case.py index f61c87027c..57820e744e 100644 --- a/examples/2D_acoustic_support6_axisym/case.py +++ b/examples/2D_acoustic_support6_axisym/case.py @@ -1,90 +1,78 @@ #!/usr/bin/env python3 - import json # Configuring case dictionary -print(json.dumps({ - # Logistics ================================================================ - 'run_time_info' : 'T', - # ========================================================================== - - # Computational Domain Parameters ========================================== - 'x_domain%beg' : 0, - 'x_domain%end' : 0.001, - 'y_domain%beg' : 0, - 'y_domain%end' : 0.0005, - 'cyl_coord' : 'T', - 'm' : 99, - 'n' : 49, - 'p' : 0, - 'dt' : 2e-9, - 't_step_start' : 0, - 't_step_stop' : 400, - 't_step_save' : 20, - # ========================================================================== - - # Simulation Algorithm Parameters ========================================== - 'num_patches' : 1, - 'model_eqns' : 2, - 'alt_soundspeed' : 'F', - 'num_fluids' : 1, - 'mpp_lim' : 'F', - 'mixture_err' : 'F', - 'time_stepper' : 3, - 'weno_order' : 5, - 'weno_eps' : 1.E-16, - 'teno' : 'T', - 'teno_CT' : 1E-8, - 'null_weights' : 'F', - 'mp_weno' : 'F', - 'riemann_solver' : 2, - 'wave_speeds' : 1, - 'avg_state' : 2, - 'bc_x%beg' : -6, - 'bc_x%end' : -6, - 'bc_y%beg' : -2, - 'bc_y%end' : -6, - # ========================================================================== - - # Formatted Database Files Structure Parameters ============================ - 'format' : 1, - 'precision' : 2, - 'prim_vars_wrt' :'T', - 'parallel_io' :'T', - # ========================================================================== - - # Patch 1 Liquid =========================================================== - 'patch_icpp(1)%geometry' : 3, - 'patch_icpp(1)%x_centroid' : 0.0005, - 'patch_icpp(1)%y_centroid' : 0.00025, - 'patch_icpp(1)%length_x' : 0.001, - 'patch_icpp(1)%length_y' : 0.0005, - 'patch_icpp(1)%vel(1)' : 0.0, - 'patch_icpp(1)%vel(2)' : 0.0, - 'patch_icpp(1)%pres' : 1E+05, - 'patch_icpp(1)%alpha_rho(1)' : 1100, - 'patch_icpp(1)%alpha(1)' : 1.0, - # ========================================================================== - - # Acoustic source ========================================================== - 'acoustic_source' : 'T', - 'num_source' : 1, - 'acoustic(1)%support' : 6, - 'acoustic(1)%loc(1)' : 0.00006, - 'acoustic(1)%loc(2)' : 0., - 'acoustic(1)%pulse' : 2, - 'acoustic(1)%npulse' : 1, - 'acoustic(1)%mag' : 1., - 'acoustic(1)%gauss_sigma_time' : 2E-8, - 'acoustic(1)%foc_length' : 0.00054, - 'acoustic(1)%aperture' : 0.0008, - 'acoustic(1)%delay' : 1E-7, - # ========================================================================== - - # Fluids Physical Parameters =============================================== - 'fluid_pp(1)%gamma' : 1.E+00/(4.4E+00-1.E+00), - 'fluid_pp(1)%pi_inf' : 4.4E+00*5.57E+08/(4.4E+00 - 1.E+00), - # ========================================================================== -})) - -# ============================================================================== +print( + json.dumps( + { + # Logistics ================================================================ + "run_time_info": "T", + # Computational Domain Parameters ========================================== + "x_domain%beg": 0, + "x_domain%end": 0.001, + "y_domain%beg": 0, + "y_domain%end": 0.0005, + "cyl_coord": "T", + "m": 99, + "n": 49, + "p": 0, + "dt": 2e-9, + "t_step_start": 0, + "t_step_stop": 400, + "t_step_save": 20, + # Simulation Algorithm Parameters ========================================== + "num_patches": 1, + "model_eqns": 2, + "alt_soundspeed": "F", + "num_fluids": 1, + "mpp_lim": "F", + "mixture_err": "F", + "time_stepper": 3, + "weno_order": 5, + "weno_eps": 1.0e-16, + "teno": "T", + "teno_CT": 1e-8, + "null_weights": "F", + "mp_weno": "F", + "riemann_solver": 2, + "wave_speeds": 1, + "avg_state": 2, + "bc_x%beg": -6, + "bc_x%end": -6, + "bc_y%beg": -2, + "bc_y%end": -6, + # Formatted Database Files Structure Parameters ============================ + "format": 1, + "precision": 2, + "prim_vars_wrt": "T", + "parallel_io": "T", + # Patch 1 Liquid =========================================================== + "patch_icpp(1)%geometry": 3, + "patch_icpp(1)%x_centroid": 0.0005, + "patch_icpp(1)%y_centroid": 0.00025, + "patch_icpp(1)%length_x": 0.001, + "patch_icpp(1)%length_y": 0.0005, + "patch_icpp(1)%vel(1)": 0.0, + "patch_icpp(1)%vel(2)": 0.0, + "patch_icpp(1)%pres": 1e05, + "patch_icpp(1)%alpha_rho(1)": 1100, + "patch_icpp(1)%alpha(1)": 1.0, + # Acoustic source ========================================================== + "acoustic_source": "T", + "num_source": 1, + "acoustic(1)%support": 6, + "acoustic(1)%loc(1)": 0.00006, + "acoustic(1)%loc(2)": 0.0, + "acoustic(1)%pulse": 2, + "acoustic(1)%npulse": 1, + "acoustic(1)%mag": 1.0, + "acoustic(1)%gauss_sigma_time": 2e-8, + "acoustic(1)%foc_length": 0.00054, + "acoustic(1)%aperture": 0.0008, + "acoustic(1)%delay": 1e-7, + # Fluids Physical Parameters =============================================== + "fluid_pp(1)%gamma": 1.0e00 / (4.4e00 - 1.0e00), + "fluid_pp(1)%pi_inf": 4.4e00 * 5.57e08 / (4.4e00 - 1.0e00), + } + ) +) diff --git a/examples/2D_acoustic_support9/case.py b/examples/2D_acoustic_support9/case.py index b48d13cb1d..9a7336ff3f 100644 --- a/examples/2D_acoustic_support9/case.py +++ b/examples/2D_acoustic_support9/case.py @@ -1,92 +1,80 @@ #!/usr/bin/env python3 - import json, math # Configuring case dictionary -print(json.dumps({ - # Logistics ================================================================ - 'run_time_info' : 'T', - # ========================================================================== - - # Computational Domain Parameters ========================================== - 'x_domain%beg' : 0, - 'x_domain%end' : 0.001, - 'y_domain%beg' : 0, - 'y_domain%end' : 0.001, - 'm' : 199, - 'n' : 199, - 'p' : 0, - 'dt' : 2e-9, - 't_step_start' : 0, - 't_step_stop' : 400, - 't_step_save' : 10, - # ========================================================================== - - # Simulation Algorithm Parameters ========================================== - 'num_patches' : 1, - 'model_eqns' : 2, - 'alt_soundspeed' : 'F', - 'num_fluids' : 1, - 'mpp_lim' : 'F', - 'mixture_err' : 'F', - 'time_stepper' : 3, - 'weno_order' : 5, - 'weno_eps' : 1.E-16, - 'teno' : 'T', - 'teno_CT' : 1E-8, - 'null_weights' : 'F', - 'mp_weno' : 'F', - 'riemann_solver' : 2, - 'wave_speeds' : 1, - 'avg_state' : 2, - 'bc_x%beg' : -6, - 'bc_x%end' : -6, - 'bc_y%beg' : -6, - 'bc_y%end' : -6, - # ========================================================================== - - # Formatted Database Files Structure Parameters ============================ - 'format' : 1, - 'precision' : 2, - 'prim_vars_wrt' :'T', - 'parallel_io' :'T', - # ========================================================================== - - # Patch 1 Liquid =========================================================== - 'patch_icpp(1)%geometry' : 3, - 'patch_icpp(1)%x_centroid' : 0.0005, - 'patch_icpp(1)%y_centroid' : 0.0005, - 'patch_icpp(1)%length_x' : 0.001, - 'patch_icpp(1)%length_y' : 0.001, - 'patch_icpp(1)%vel(1)' : 0.0, - 'patch_icpp(1)%vel(2)' : 0.0, - 'patch_icpp(1)%pres' : 1E+05, - 'patch_icpp(1)%alpha_rho(1)' : 1100, - 'patch_icpp(1)%alpha(1)' : 1.0, - # ========================================================================== - - # Acoustic source ========================================================== - 'acoustic_source' : 'T', - 'num_source' : 1, - 'acoustic(1)%support' : 9, - 'acoustic(1)%loc(1)' : 0.00006, - 'acoustic(1)%loc(2)' : 0.0005, - 'acoustic(1)%pulse' : 2, - 'acoustic(1)%npulse' : 1, - 'acoustic(1)%mag' : 1., - 'acoustic(1)%gauss_sigma_time' : 2E-8, - 'acoustic(1)%foc_length' : 0.00054, - 'acoustic(1)%aperture' : 0.0008, - 'acoustic(1)%num_elements' : 4, - 'acoustic(1)%element_on' : 0, - 'acoustic(1)%element_spacing_angle': math.pi/180*5, - 'acoustic(1)%delay' : 1E-7, - # ========================================================================== - - # Fluids Physical Parameters =============================================== - 'fluid_pp(1)%gamma' : 1.E+00/(4.4E+00-1.E+00), - 'fluid_pp(1)%pi_inf' : 4.4E+00*5.57E+08/(4.4E+00 - 1.E+00), - # ========================================================================== -})) - -# ============================================================================== +print( + json.dumps( + { + # Logistics ================================================================ + "run_time_info": "T", + # Computational Domain Parameters ========================================== + "x_domain%beg": 0, + "x_domain%end": 0.001, + "y_domain%beg": 0, + "y_domain%end": 0.001, + "m": 199, + "n": 199, + "p": 0, + "dt": 2e-9, + "t_step_start": 0, + "t_step_stop": 400, + "t_step_save": 10, + # Simulation Algorithm Parameters ========================================== + "num_patches": 1, + "model_eqns": 2, + "alt_soundspeed": "F", + "num_fluids": 1, + "mpp_lim": "F", + "mixture_err": "F", + "time_stepper": 3, + "weno_order": 5, + "weno_eps": 1.0e-16, + "teno": "T", + "teno_CT": 1e-8, + "null_weights": "F", + "mp_weno": "F", + "riemann_solver": 2, + "wave_speeds": 1, + "avg_state": 2, + "bc_x%beg": -6, + "bc_x%end": -6, + "bc_y%beg": -6, + "bc_y%end": -6, + # Formatted Database Files Structure Parameters ============================ + "format": 1, + "precision": 2, + "prim_vars_wrt": "T", + "parallel_io": "T", + # Patch 1 Liquid =========================================================== + "patch_icpp(1)%geometry": 3, + "patch_icpp(1)%x_centroid": 0.0005, + "patch_icpp(1)%y_centroid": 0.0005, + "patch_icpp(1)%length_x": 0.001, + "patch_icpp(1)%length_y": 0.001, + "patch_icpp(1)%vel(1)": 0.0, + "patch_icpp(1)%vel(2)": 0.0, + "patch_icpp(1)%pres": 1e05, + "patch_icpp(1)%alpha_rho(1)": 1100, + "patch_icpp(1)%alpha(1)": 1.0, + # Acoustic source ========================================================== + "acoustic_source": "T", + "num_source": 1, + "acoustic(1)%support": 9, + "acoustic(1)%loc(1)": 0.00006, + "acoustic(1)%loc(2)": 0.0005, + "acoustic(1)%pulse": 2, + "acoustic(1)%npulse": 1, + "acoustic(1)%mag": 1.0, + "acoustic(1)%gauss_sigma_time": 2e-8, + "acoustic(1)%foc_length": 0.00054, + "acoustic(1)%aperture": 0.0008, + "acoustic(1)%num_elements": 4, + "acoustic(1)%element_on": 0, + "acoustic(1)%element_spacing_angle": math.pi / 180 * 5, + "acoustic(1)%delay": 1e-7, + # Fluids Physical Parameters =============================================== + "fluid_pp(1)%gamma": 1.0e00 / (4.4e00 - 1.0e00), + "fluid_pp(1)%pi_inf": 4.4e00 * 5.57e08 / (4.4e00 - 1.0e00), + } + ) +) diff --git a/examples/2D_advection/case.py b/examples/2D_advection/case.py index 9af53e1fa6..f179472822 100644 --- a/examples/2D_advection/case.py +++ b/examples/2D_advection/case.py @@ -1,96 +1,85 @@ #!/usr/bin/env python3 - import json # Configuring case dictionary -print(json.dumps({ - # Logistics ================================================ - 'run_time_info' : 'T', - # ========================================================== - - # Computational Domain Parameters ========================== - 'x_domain%beg' : 0.E+00, - 'x_domain%end' : 1.E+00, - 'y_domain%beg' : 0.E+00, - 'y_domain%end' : 1.E+00, - 'm' : 99, - 'n' : 99, - 'p' : 0, - 'dt' : 5.E-07, - 't_step_start' : 0, - 't_step_stop' : 1000, - 't_step_save' : 100, - # ========================================================== - - # Simulation Algorithm Parameters ========================== - 'num_patches' : 2, - 'model_eqns' : 3, - 'alt_soundspeed' : 'F', - 'num_fluids' : 2, - 'mpp_lim' : 'T', - 'mixture_err' : 'T', - 'time_stepper' : 3, - 'weno_order' : 5, - 'weno_eps' : 1.E-16, - 'weno_Re_flux' : 'F', - 'weno_avg' : 'F', - 'mapped_weno' : 'T', - 'null_weights' : 'F', - 'mp_weno' : 'F', - 'riemann_solver' : 2, - 'wave_speeds' : 1, - 'avg_state' : 2, - 'bc_x%beg' : -3, - 'bc_x%end' : -3, - 'bc_y%beg' : -3, - 'bc_y%end' : -3, - # ========================================================== - - # Formatted Database Files Structure Parameters ============ - 'format' : 1, - 'precision' : 2, - 'prim_vars_wrt' :'T', - 'parallel_io' :'T', - # ========================================================== - - # Patch 1: Base ============================================ - 'patch_icpp(1)%geometry' : 3, - 'patch_icpp(1)%x_centroid' : 0.5E+00, - 'patch_icpp(1)%y_centroid' : 0.5E+00, - 'patch_icpp(1)%length_x' : 1.E+00, - 'patch_icpp(1)%length_y' : 1.E+00, - 'patch_icpp(1)%vel(1)' : 100.E+00, - 'patch_icpp(1)%vel(2)' : 100.E+00, - 'patch_icpp(1)%pres' : 1.E+05, - 'patch_icpp(1)%alpha_rho(1)' : 1000.E+00, - 'patch_icpp(1)%alpha_rho(2)' : 1., - 'patch_icpp(1)%alpha(1)' : 1.E-12, - 'patch_icpp(1)%alpha(2)' : 1. - 1.E-12, - # ========================================================== - - # Patch 2: Density to transport ============================ - 'patch_icpp(2)%geometry' : 2, - 'patch_icpp(2)%smoothen' : 'T', - 'patch_icpp(2)%smooth_patch_id' : 1, - 'patch_icpp(2)%smooth_coeff' : 0.5E+00, - 'patch_icpp(2)%x_centroid' : 0.1E+00, - 'patch_icpp(2)%y_centroid' : 0.1E+00, - 'patch_icpp(2)%radius' : 0.1E+00, - 'patch_icpp(2)%alter_patch(1)' : 'T', - 'patch_icpp(2)%vel(1)' : 100.E+00, - 'patch_icpp(2)%vel(2)' : 100.E+00, - 'patch_icpp(2)%pres' : 1.E+05, - 'patch_icpp(2)%alpha_rho(1)' : 1., - 'patch_icpp(2)%alpha_rho(2)' : 1.0, - 'patch_icpp(2)%alpha(1)' : 0, - 'patch_icpp(2)%alpha(2)' : 1., - # ========================================================== - - # Fluids Physical Parameters =============================== - 'fluid_pp(1)%gamma' : 1.E+00/(2.35E+00-1.E+00), - 'fluid_pp(1)%pi_inf' : 2.35E+00*1.E+09/(2.35E+00-1.E+00), - 'fluid_pp(2)%gamma' : 1.E+00/(1.4E+00-1.E+00), - 'fluid_pp(2)%pi_inf' : 0.E+00, - # ========================================================== -})) -# ============================================================================== +print( + json.dumps( + { + # Logistics ================================================ + "run_time_info": "T", + # Computational Domain Parameters ========================== + "x_domain%beg": 0.0e00, + "x_domain%end": 1.0e00, + "y_domain%beg": 0.0e00, + "y_domain%end": 1.0e00, + "m": 99, + "n": 99, + "p": 0, + "dt": 5.0e-07, + "t_step_start": 0, + "t_step_stop": 1000, + "t_step_save": 100, + # Simulation Algorithm Parameters ========================== + "num_patches": 2, + "model_eqns": 3, + "alt_soundspeed": "F", + "num_fluids": 2, + "mpp_lim": "T", + "mixture_err": "T", + "time_stepper": 3, + "weno_order": 5, + "weno_eps": 1.0e-16, + "weno_Re_flux": "F", + "weno_avg": "F", + "mapped_weno": "T", + "null_weights": "F", + "mp_weno": "F", + "riemann_solver": 2, + "wave_speeds": 1, + "avg_state": 2, + "bc_x%beg": -3, + "bc_x%end": -3, + "bc_y%beg": -3, + "bc_y%end": -3, + # Formatted Database Files Structure Parameters ============ + "format": 1, + "precision": 2, + "prim_vars_wrt": "T", + "parallel_io": "T", + # Patch 1: Base ============================================ + "patch_icpp(1)%geometry": 3, + "patch_icpp(1)%x_centroid": 0.5e00, + "patch_icpp(1)%y_centroid": 0.5e00, + "patch_icpp(1)%length_x": 1.0e00, + "patch_icpp(1)%length_y": 1.0e00, + "patch_icpp(1)%vel(1)": 100.0e00, + "patch_icpp(1)%vel(2)": 100.0e00, + "patch_icpp(1)%pres": 1.0e05, + "patch_icpp(1)%alpha_rho(1)": 1000.0e00, + "patch_icpp(1)%alpha_rho(2)": 1.0, + "patch_icpp(1)%alpha(1)": 1.0e-12, + "patch_icpp(1)%alpha(2)": 1.0 - 1.0e-12, + # Patch 2: Density to transport ============================ + "patch_icpp(2)%geometry": 2, + "patch_icpp(2)%smoothen": "T", + "patch_icpp(2)%smooth_patch_id": 1, + "patch_icpp(2)%smooth_coeff": 0.5e00, + "patch_icpp(2)%x_centroid": 0.1e00, + "patch_icpp(2)%y_centroid": 0.1e00, + "patch_icpp(2)%radius": 0.1e00, + "patch_icpp(2)%alter_patch(1)": "T", + "patch_icpp(2)%vel(1)": 100.0e00, + "patch_icpp(2)%vel(2)": 100.0e00, + "patch_icpp(2)%pres": 1.0e05, + "patch_icpp(2)%alpha_rho(1)": 1.0, + "patch_icpp(2)%alpha_rho(2)": 1.0, + "patch_icpp(2)%alpha(1)": 0, + "patch_icpp(2)%alpha(2)": 1.0, + # Fluids Physical Parameters =============================== + "fluid_pp(1)%gamma": 1.0e00 / (2.35e00 - 1.0e00), + "fluid_pp(1)%pi_inf": 2.35e00 * 1.0e09 / (2.35e00 - 1.0e00), + "fluid_pp(2)%gamma": 1.0e00 / (1.4e00 - 1.0e00), + "fluid_pp(2)%pi_inf": 0.0e00, + } + ) +) diff --git a/examples/2D_axisym_shockbubble/case.py b/examples/2D_axisym_shockbubble/case.py index 54a94e0a7d..426c4d1335 100644 --- a/examples/2D_axisym_shockbubble/case.py +++ b/examples/2D_axisym_shockbubble/case.py @@ -1,133 +1,119 @@ #!/usr/bin/env python3 - import math import json -ps = 248758.567 +ps = 248758.567 gam = 1.4 -rho = 1. +rho = 1.0 -c_l = math.sqrt( 1.4*ps/rho ) +c_l = math.sqrt(1.4 * ps / rho) -vel = 230. +vel = 230.0 -leng = 1. +leng = 1.0 -Ny = 100. -Nx = Ny*4 -dx = leng/Nx +Ny = 100.0 +Nx = Ny * 4 +dx = leng / Nx -time_end = 4*leng/vel +time_end = 4 * leng / vel cfl = 0.3 -dt = cfl * dx/c_l -Nt = int(time_end/dt) +dt = cfl * dx / c_l +Nt = int(time_end / dt) # Configuring case dictionary -print(json.dumps({ - # Logistics ================================================ - 'run_time_info' : 'T', - # ========================================================== - - # Computational Domain Parameters ========================== - 'x_domain%beg' : -leng/2., - 'x_domain%end' : leng/2+3*leng, - 'y_domain%beg' : 0., - 'y_domain%end' : leng/2., - 'm' : int(Nx), - 'n' : int(Ny), - 'p' : 0, - 'cyl_coord' : 'T', - 'dt' : dt, - 't_step_start' : 0, - 't_step_stop' : Nt, - 't_step_save' : int(Nt/100.), -# ========================================================== - - # Simulation Algorithm Parameters ========================== - 'num_patches' : 3, - 'model_eqns' : 2, - 'alt_soundspeed' : 'F', - 'num_fluids' : 2, - 'mpp_lim' : 'T', - 'mixture_err' : 'T', - 'time_stepper' : 3, - 'weno_order' : 5, - 'weno_eps' : 1.E-16, - 'weno_Re_flux' : 'F', - 'weno_avg' : 'F', - 'mapped_weno' : 'T', - 'null_weights' : 'F', - 'mp_weno' : 'F', - 'riemann_solver' : 2, - 'wave_speeds' : 1, - 'avg_state' : 2, - 'bc_x%beg' : -6, - 'bc_x%end' : -6, - 'bc_y%beg' : -2, - 'bc_y%end' : -6, - # ========================================================== - - # Formatted Database Files Structure Parameters ============ - 'format' : 1, - 'precision' : 2, - 'prim_vars_wrt' :'T', - 'parallel_io' :'T', - # ========================================================== - - # Patch 1: Background ============================ - 'patch_icpp(1)%geometry' : 3, - 'patch_icpp(1)%x_centroid' : 0., - 'patch_icpp(1)%y_centroid' : leng*0.25, - 'patch_icpp(1)%length_x' : 10*leng, - 'patch_icpp(1)%length_y' : leng*0.5, - 'patch_icpp(1)%vel(1)' : vel, - 'patch_icpp(1)%vel(2)' : 0.E+00, - 'patch_icpp(1)%pres' : 101325., - 'patch_icpp(1)%alpha_rho(1)' : 1.29, - 'patch_icpp(1)%alpha_rho(2)' : 0.E+00, - 'patch_icpp(1)%alpha(1)' : 1.E+00, - 'patch_icpp(1)%alpha(2)' : 0.E+00, - # ========================================================== - - # Patch 2: Shocked state ============================ - 'patch_icpp(2)%geometry' : 3, - 'patch_icpp(2)%alter_patch(1)' : 'T', - 'patch_icpp(2)%x_centroid' : -3*leng/8., - 'patch_icpp(2)%y_centroid' : 0.25*leng, - 'patch_icpp(2)%length_x' : leng/4., - 'patch_icpp(2)%length_y' : leng*0.5, - 'patch_icpp(2)%vel(1)' : vel, - 'patch_icpp(2)%vel(2)' : 0.E+00, - 'patch_icpp(2)%pres' : ps, - 'patch_icpp(2)%alpha_rho(1)' : 2.4, - 'patch_icpp(2)%alpha_rho(2)' : 0.E+00, - 'patch_icpp(2)%alpha(1)' : 1.E+00, - 'patch_icpp(2)%alpha(2)' : 0.E+00, - # ========================================================== - - # Patch 3: Bubble ====================================== - 'patch_icpp(3)%geometry' : 2, - 'patch_icpp(3)%x_centroid' : 0.E+00, - 'patch_icpp(3)%y_centroid' : 0.E+00, - 'patch_icpp(3)%radius' : leng/5., - 'patch_icpp(3)%alter_patch(1)' : 'T', - 'patch_icpp(3)%vel(1)' : 0., - 'patch_icpp(3)%vel(2)' : 0.E+00, - 'patch_icpp(3)%pres' : 101325., - 'patch_icpp(3)%alpha_rho(1)' : 0.E+00, - 'patch_icpp(3)%alpha_rho(2)' : 0.167, - 'patch_icpp(3)%alpha(1)' : 0.E+00, - 'patch_icpp(3)%alpha(2)' : 1.E+00, - # ========================================================== - - # Fluids Physical Parameters =============================== - 'fluid_pp(1)%gamma' : 1.E+00/(1.4E+00-1.E+00), - 'fluid_pp(1)%pi_inf' : 0., - 'fluid_pp(2)%gamma' : 1.E+00/(1.6666E+00-1.E+00), - 'fluid_pp(2)%pi_inf' : 0.E+00, - # ========================================================== -})) - -# ============================================================================== +print( + json.dumps( + { + # Logistics ================================================ + "run_time_info": "T", + # Computational Domain Parameters ========================== + "x_domain%beg": -leng / 2.0, + "x_domain%end": leng / 2 + 3 * leng, + "y_domain%beg": 0.0, + "y_domain%end": leng / 2.0, + "m": int(Nx), + "n": int(Ny), + "p": 0, + "cyl_coord": "T", + "dt": dt, + "t_step_start": 0, + "t_step_stop": Nt, + "t_step_save": int(Nt / 100.0), + # Simulation Algorithm Parameters ========================== + "num_patches": 3, + "model_eqns": 2, + "alt_soundspeed": "F", + "num_fluids": 2, + "mpp_lim": "T", + "mixture_err": "T", + "time_stepper": 3, + "weno_order": 5, + "weno_eps": 1.0e-16, + "weno_Re_flux": "F", + "weno_avg": "F", + "mapped_weno": "T", + "null_weights": "F", + "mp_weno": "F", + "riemann_solver": 2, + "wave_speeds": 1, + "avg_state": 2, + "bc_x%beg": -6, + "bc_x%end": -6, + "bc_y%beg": -2, + "bc_y%end": -6, + # Formatted Database Files Structure Parameters ============ + "format": 1, + "precision": 2, + "prim_vars_wrt": "T", + "parallel_io": "T", + # Patch 1: Background ============================ + "patch_icpp(1)%geometry": 3, + "patch_icpp(1)%x_centroid": 0.0, + "patch_icpp(1)%y_centroid": leng * 0.25, + "patch_icpp(1)%length_x": 10 * leng, + "patch_icpp(1)%length_y": leng * 0.5, + "patch_icpp(1)%vel(1)": vel, + "patch_icpp(1)%vel(2)": 0.0e00, + "patch_icpp(1)%pres": 101325.0, + "patch_icpp(1)%alpha_rho(1)": 1.29, + "patch_icpp(1)%alpha_rho(2)": 0.0e00, + "patch_icpp(1)%alpha(1)": 1.0e00, + "patch_icpp(1)%alpha(2)": 0.0e00, + # Patch 2: Shocked state ============================ + "patch_icpp(2)%geometry": 3, + "patch_icpp(2)%alter_patch(1)": "T", + "patch_icpp(2)%x_centroid": -3 * leng / 8.0, + "patch_icpp(2)%y_centroid": 0.25 * leng, + "patch_icpp(2)%length_x": leng / 4.0, + "patch_icpp(2)%length_y": leng * 0.5, + "patch_icpp(2)%vel(1)": vel, + "patch_icpp(2)%vel(2)": 0.0e00, + "patch_icpp(2)%pres": ps, + "patch_icpp(2)%alpha_rho(1)": 2.4, + "patch_icpp(2)%alpha_rho(2)": 0.0e00, + "patch_icpp(2)%alpha(1)": 1.0e00, + "patch_icpp(2)%alpha(2)": 0.0e00, + # Patch 3: Bubble ====================================== + "patch_icpp(3)%geometry": 2, + "patch_icpp(3)%x_centroid": 0.0e00, + "patch_icpp(3)%y_centroid": 0.0e00, + "patch_icpp(3)%radius": leng / 5.0, + "patch_icpp(3)%alter_patch(1)": "T", + "patch_icpp(3)%vel(1)": 0.0, + "patch_icpp(3)%vel(2)": 0.0e00, + "patch_icpp(3)%pres": 101325.0, + "patch_icpp(3)%alpha_rho(1)": 0.0e00, + "patch_icpp(3)%alpha_rho(2)": 0.167, + "patch_icpp(3)%alpha(1)": 0.0e00, + "patch_icpp(3)%alpha(2)": 1.0e00, + # Fluids Physical Parameters =============================== + "fluid_pp(1)%gamma": 1.0e00 / (1.4e00 - 1.0e00), + "fluid_pp(1)%pi_inf": 0.0, + "fluid_pp(2)%gamma": 1.0e00 / (1.6666e00 - 1.0e00), + "fluid_pp(2)%pi_inf": 0.0e00, + } + ) +) diff --git a/examples/2D_axisym_shockwatercavity/case.py b/examples/2D_axisym_shockwatercavity/case.py index 0ec51b9cdc..afb38766d6 100644 --- a/examples/2D_axisym_shockwatercavity/case.py +++ b/examples/2D_axisym_shockwatercavity/case.py @@ -1,5 +1,4 @@ #!/usr/bin/env python3 - import math import json @@ -7,17 +6,17 @@ patm = 101325 # Initial Droplet Diameter / Reference length - m -D0 = 2.0E-3 +D0 = 2.0e-3 # cavity to droplet ratio CtD = 0.06 # cavity relative eccentricity (distance between radii) -ecc = 0.564 +ecc = 0.564 -# initial shock distance from the y axis. Note that the droplet center is located at y = 0. Thus, the distance from the shock to +# initial shock distance from the y axis. Note that the droplet center is located at y = 0. Thus, the distance from the shock to # the droplet is about D0/8 -ISD = 5.0/8 * D0 +ISD = 5.0 / 8 * D0 ## pre-shock properties - AIR @@ -25,21 +24,21 @@ p0a = patm # density - kg/m3 -rho0a = 1.204 +rho0a = 1.204 # gamma -gama = 1.40 +gama = 1.40 # pi infinity - Pa pia = 0 # speed of sound - M/s -c_a = math.sqrt( gama * ( p0a + pia ) / rho0a ) +c_a = math.sqrt(gama * (p0a + pia) / rho0a) ## Droplet - WATER # surface tension - N / m -st = 0.00E+0 +st = 0.00e0 # Delta Pressure - Pa DP = -st * 4 / D0 @@ -51,29 +50,29 @@ rho0w = 1000 # gama -gamw = 6.12 +gamw = 6.12 # pi infty - Pa -piw = 3.43E+08 +piw = 3.43e08 # speed of sound - m/s -c_w = math.sqrt( gamw * ( p0w + piw ) / rho0w ) +c_w = math.sqrt(gamw * (p0w + piw) / rho0w) -# Shock Mach number of interest. Note that the post-shock properties can be defined in terms of either +# Shock Mach number of interest. Note that the post-shock properties can be defined in terms of either # Min or psOp0a. Just comment/uncomment appropriatelly Min = 2.146 ## Pos to pre shock ratios - AIR # pressure -psOp0a = ( Min ** 2 -1 ) * 2 * gama / ( gama + 1 ) + 1 +psOp0a = (Min**2 - 1) * 2 * gama / (gama + 1) + 1 # psOp0a = 4.5 # density -rhosOrho0a = ( 1 + ( gama + 1 ) / ( gama - 1) * psOp0a ) / ( ( gama + 1 ) / ( gama - 1) + psOp0a ) +rhosOrho0a = (1 + (gama + 1) / (gama - 1) * psOp0a) / ((gama + 1) / (gama - 1) + psOp0a) # Mach number of the shocked region - just a checker, as it must return "Min" -Ms = math.sqrt( ( gama + 1. ) / ( 2. * gama ) * ( psOp0a - 1. ) * ( p0a / ( p0a + pia ) ) + 1. ) +Ms = math.sqrt((gama + 1.0) / (2.0 * gama) * (psOp0a - 1.0) * (p0a / (p0a + pia)) + 1.0) # shock speed of sound - m/s ss = Ms * c_a @@ -87,32 +86,32 @@ rhos = rhosOrho0a * rho0a # post shock speed of sound - m/s -c_s = math.sqrt( gama * (ps + pia) / rhos ) +c_s = math.sqrt(gama * (ps + pia) / rhos) # velocity at the post shock - m/s -vel = c_a/gama * (psOp0a - 1.) * p0a / ( p0a + pia ) / Ms +vel = c_a / gama * (psOp0a - 1.0) * p0a / (p0a + pia) / Ms ## Domain boundaries - m # x direction xb = -2.4707 * D0 -xe = 3.6226 * D0 +xe = 3.6226 * D0 # y direction -yb = 0 * D0 -ye = 1.6358 * D0 +yb = 0 * D0 +ye = 1.6358 * D0 # Stretching factor, to make sure the domaing is sufficiently large after the mesh stretch -StF = 4.0 +StF = 4.0 # number of elements into y direction Ny = 1712 # number of elements into x direction -Nx = Ny*2 +Nx = Ny * 2 # grid delta x if mesh were uniform in x direction - m. Note that I do not need a measure for dy -dx = ( xe - xb ) / Nx +dx = (xe - xb) / Nx # I calculating tend twice; first is an estimate, second is # the actual value used. This is because I am getting errors in the @@ -131,17 +130,17 @@ cfl = 0.05 # time-step - s -dt = cfl * dx/ ss +dt = cfl * dx / ss # Save Frequency. Note that the number of autosaves will be SF + 1, as th IC (0.dat) is also saved SF = 400 ## making Nt divisible by SF # 1 - ensure NtA goes slightly beyond tendA -NtA = int( tendA//dt + 1 ) +NtA = int(tendA // dt + 1) # Array of saves. It is the same as Nt/Sf = t_step_save -AS = int( NtA // SF + 1 ) +AS = int(NtA // SF + 1) # Nt = total number of steps. Note that Nt >= NtA (so at least tendA is completely simulated) Nt = AS * SF @@ -150,131 +149,117 @@ tend = Nt * dt # Configuring case dictionary -print(json.dumps({ - # Logistics ================================================ - 'run_time_info' : 'T', - # ========================================================== - - # Computational Domain Parameters ========================== - 'x_domain%beg' : xb, - 'x_domain%end' : xe, - 'y_domain%beg' : yb, - 'y_domain%end' : ye, - 'stretch_x' : 'T', - 'a_x' : 20, - 'x_a' : -1.2 * D0, - 'x_b' : 1.2 * D0, - 'stretch_y' : 'T', - 'a_y' : 20, - 'y_a' : -0.0 * D0, - 'y_b' : 1.2 * D0, - 'm' : Nx, - 'n' : Ny, - 'p' : 0, - 'cyl_coord' : 'T', - 'dt' : dt, - 't_step_start' : 0, - 't_step_stop' : Nt, - 't_step_save' : AS, - # ========================================================== - - # Simulation Algorithm Parameters ========================== - 'num_patches' : 4, - 'model_eqns' : 2, - 'alt_soundspeed' : 'F', - 'num_fluids' : 2, - 'mpp_lim' : 'T', - 'mixture_err' : 'T', - 'time_stepper' : 3, - 'weno_order' : 3, - 'weno_eps' : 1.0E-16, - 'weno_Re_flux' : 'F', - 'weno_avg' : 'F', - 'mapped_weno' : 'T', - 'riemann_solver' : 2, - 'wave_speeds' : 1, - 'avg_state' : 2, - 'bc_x%beg' : -6, - 'bc_x%end' : -6, - 'bc_y%beg' : -2, - 'bc_y%end' : -6, - # ========================================================== - - # Formatted Database Files Structure Parameters ============ - 'format' : 1, - 'precision' : 2, - 'prim_vars_wrt' :'T', - 'alpha_wrt' :'T', - 'parallel_io' :'T', - # ========================================================== - # I will use 1 for WATER properties, and 2 for AIR properties - # Patch 1: Background (AIR - 2) ============================= - 'patch_icpp(1)%geometry' : 3, - 'patch_icpp(1)%x_centroid' : (xb+xe) / 2 * StF, - 'patch_icpp(1)%y_centroid' : (yb+ye) / 2 * StF, - 'patch_icpp(1)%length_x' : (xe-xb) * StF, - 'patch_icpp(1)%length_y' : (ye-yb) * StF, - 'patch_icpp(1)%vel(1)' : 0.0E+00, - 'patch_icpp(1)%vel(2)' : 0.0E+00, - 'patch_icpp(1)%pres' : p0a, - 'patch_icpp(1)%alpha_rho(1)' : 0.0E+00, - 'patch_icpp(1)%alpha_rho(2)' : rho0a, - 'patch_icpp(1)%alpha(1)' : 0.0E+00, - 'patch_icpp(1)%alpha(2)' : 1.0E+00, - # ========================================================== - - # Patch 2: Shocked state (AIR - 2) ========================= - 'patch_icpp(2)%geometry' : 3, - 'patch_icpp(2)%alter_patch(1)' : 'T', - 'patch_icpp(2)%x_centroid' : -ISD - ( xe - xb ) / 2 * StF, - 'patch_icpp(2)%y_centroid' : ( yb + ye ) / 2 * StF, - 'patch_icpp(2)%length_x' : ( xe - xb ) * StF, - 'patch_icpp(2)%length_y' : ( ye - yb ) * StF, - 'patch_icpp(2)%vel(1)' : vel, - 'patch_icpp(2)%vel(2)' : 0.0E+00, - 'patch_icpp(2)%pres' : ps, - 'patch_icpp(2)%alpha_rho(1)' : 0.0E+00, - 'patch_icpp(2)%alpha_rho(2)' : rhos, - 'patch_icpp(2)%alpha(1)' : 0.0E+00, - 'patch_icpp(2)%alpha(2)' : 1.0E+00, - # ========================================================== - - # Patch 3: Droplet (WATER - 1) ============================= - 'patch_icpp(3)%geometry' : 2, - 'patch_icpp(3)%x_centroid' : 0.0E+00, - 'patch_icpp(3)%y_centroid' : 0.0E+00, - 'patch_icpp(3)%radius' : D0/2, - 'patch_icpp(3)%alter_patch(1)' : 'T', - 'patch_icpp(3)%vel(1)' : 0.0E+00, - 'patch_icpp(3)%vel(2)' : 0.0E+00, - 'patch_icpp(3)%pres' : p0w, - 'patch_icpp(3)%alpha_rho(1)' : rho0w, - 'patch_icpp(3)%alpha_rho(2)' : 0.0E+00, - 'patch_icpp(3)%alpha(1)' : 1.0E+00, - 'patch_icpp(3)%alpha(2)' : 0.0E+00, - # ========================================================== - - # Patch 4: Cavity (AIR - 2) ================================ - 'patch_icpp(4)%geometry' : 2, - 'patch_icpp(4)%x_centroid' : ecc * D0 / 2, - 'patch_icpp(4)%y_centroid' : 0.0E+00, - 'patch_icpp(4)%radius' : CtD * D0 / 2, - 'patch_icpp(4)%alter_patch(3)' : 'T', - 'patch_icpp(4)%vel(1)' : 0.0E+00, - 'patch_icpp(4)%vel(2)' : 0.0E+00, - 'patch_icpp(4)%pres' : p0a, - 'patch_icpp(4)%alpha_rho(1)' : 0.0E+00, - 'patch_icpp(4)%alpha_rho(2)' : rho0a, - 'patch_icpp(4)%alpha(1)' : 0.0E+00, - 'patch_icpp(4)%alpha(2)' : 1.0E+00, - # ========================================================== - - # Fluids Physical Parameters =============================== - 'fluid_pp(1)%gamma' : 1.0E+00/(gamw-1), - 'fluid_pp(1)%pi_inf' : gamw*piw/(gamw-1), - 'fluid_pp(2)%gamma' : 1.0E+00/(gama-1), - 'fluid_pp(2)%pi_inf' : gama*pia/(gama-1), - # ========================================================== -})) - -# ============================================================================== +print( + json.dumps( + { + # Logistics ================================================ + "run_time_info": "T", + # Computational Domain Parameters ========================== + "x_domain%beg": xb, + "x_domain%end": xe, + "y_domain%beg": yb, + "y_domain%end": ye, + "stretch_x": "T", + "a_x": 20, + "x_a": -1.2 * D0, + "x_b": 1.2 * D0, + "stretch_y": "T", + "a_y": 20, + "y_a": -0.0 * D0, + "y_b": 1.2 * D0, + "m": Nx, + "n": Ny, + "p": 0, + "cyl_coord": "T", + "dt": dt, + "t_step_start": 0, + "t_step_stop": Nt, + "t_step_save": AS, + # Simulation Algorithm Parameters ========================== + "num_patches": 4, + "model_eqns": 2, + "alt_soundspeed": "F", + "num_fluids": 2, + "mpp_lim": "T", + "mixture_err": "T", + "time_stepper": 3, + "weno_order": 3, + "weno_eps": 1.0e-16, + "weno_Re_flux": "F", + "weno_avg": "F", + "mapped_weno": "T", + "riemann_solver": 2, + "wave_speeds": 1, + "avg_state": 2, + "bc_x%beg": -6, + "bc_x%end": -6, + "bc_y%beg": -2, + "bc_y%end": -6, + # Formatted Database Files Structure Parameters ============ + "format": 1, + "precision": 2, + "prim_vars_wrt": "T", + "alpha_wrt": "T", + "parallel_io": "T", + # I will use 1 for WATER properties, and 2 for AIR properties + # Patch 1: Background (AIR - 2) ============================= + "patch_icpp(1)%geometry": 3, + "patch_icpp(1)%x_centroid": (xb + xe) / 2 * StF, + "patch_icpp(1)%y_centroid": (yb + ye) / 2 * StF, + "patch_icpp(1)%length_x": (xe - xb) * StF, + "patch_icpp(1)%length_y": (ye - yb) * StF, + "patch_icpp(1)%vel(1)": 0.0e00, + "patch_icpp(1)%vel(2)": 0.0e00, + "patch_icpp(1)%pres": p0a, + "patch_icpp(1)%alpha_rho(1)": 0.0e00, + "patch_icpp(1)%alpha_rho(2)": rho0a, + "patch_icpp(1)%alpha(1)": 0.0e00, + "patch_icpp(1)%alpha(2)": 1.0e00, + # Patch 2: Shocked state (AIR - 2) ========================= + "patch_icpp(2)%geometry": 3, + "patch_icpp(2)%alter_patch(1)": "T", + "patch_icpp(2)%x_centroid": -ISD - (xe - xb) / 2 * StF, + "patch_icpp(2)%y_centroid": (yb + ye) / 2 * StF, + "patch_icpp(2)%length_x": (xe - xb) * StF, + "patch_icpp(2)%length_y": (ye - yb) * StF, + "patch_icpp(2)%vel(1)": vel, + "patch_icpp(2)%vel(2)": 0.0e00, + "patch_icpp(2)%pres": ps, + "patch_icpp(2)%alpha_rho(1)": 0.0e00, + "patch_icpp(2)%alpha_rho(2)": rhos, + "patch_icpp(2)%alpha(1)": 0.0e00, + "patch_icpp(2)%alpha(2)": 1.0e00, + # Patch 3: Droplet (WATER - 1) ============================= + "patch_icpp(3)%geometry": 2, + "patch_icpp(3)%x_centroid": 0.0e00, + "patch_icpp(3)%y_centroid": 0.0e00, + "patch_icpp(3)%radius": D0 / 2, + "patch_icpp(3)%alter_patch(1)": "T", + "patch_icpp(3)%vel(1)": 0.0e00, + "patch_icpp(3)%vel(2)": 0.0e00, + "patch_icpp(3)%pres": p0w, + "patch_icpp(3)%alpha_rho(1)": rho0w, + "patch_icpp(3)%alpha_rho(2)": 0.0e00, + "patch_icpp(3)%alpha(1)": 1.0e00, + "patch_icpp(3)%alpha(2)": 0.0e00, + # Patch 4: Cavity (AIR - 2) ================================ + "patch_icpp(4)%geometry": 2, + "patch_icpp(4)%x_centroid": ecc * D0 / 2, + "patch_icpp(4)%y_centroid": 0.0e00, + "patch_icpp(4)%radius": CtD * D0 / 2, + "patch_icpp(4)%alter_patch(3)": "T", + "patch_icpp(4)%vel(1)": 0.0e00, + "patch_icpp(4)%vel(2)": 0.0e00, + "patch_icpp(4)%pres": p0a, + "patch_icpp(4)%alpha_rho(1)": 0.0e00, + "patch_icpp(4)%alpha_rho(2)": rho0a, + "patch_icpp(4)%alpha(1)": 0.0e00, + "patch_icpp(4)%alpha(2)": 1.0e00, + # Fluids Physical Parameters =============================== + "fluid_pp(1)%gamma": 1.0e00 / (gamw - 1), + "fluid_pp(1)%pi_inf": gamw * piw / (gamw - 1), + "fluid_pp(2)%gamma": 1.0e00 / (gama - 1), + "fluid_pp(2)%pi_inf": gama * pia / (gama - 1), + } + ) +) diff --git a/examples/2D_bubbly_steady_shock/case.py b/examples/2D_bubbly_steady_shock/case.py index e55fedca9e..4307ca7414 100644 --- a/examples/2D_bubbly_steady_shock/case.py +++ b/examples/2D_bubbly_steady_shock/case.py @@ -1,226 +1,209 @@ import json import math -Mu = 1.84E-05 +Mu = 1.84e-05 gam_a = 1.4 gam_b = 1.1 -x0 = 10E-06 -p0 = 101325. -rho0 = 1.E+03 -c0 = math.sqrt( p0/rho0 ) -patm = 1. +x0 = 10e-06 +p0 = 101325.0 +rho0 = 1.0e03 +c0 = math.sqrt(p0 / rho0) +patm = 1.0 -#water props -n_tait = 7.1 -B_tait = 3.43E+05/ p0 -mul0 = 1.002E-03 #viscosity -ss = 0.07275 #surface tension -pv = 2.3388E+03 #vapor pressure +# water props +n_tait = 7.1 +B_tait = 3.43e05 / p0 +mul0 = 1.002e-03 # viscosity +ss = 0.07275 # surface tension +pv = 2.3388e03 # vapor pressure gamma_v = 1.33 -M_v = 18.02 -mu_v = 0.8816E-05 -k_v = 0.019426 +M_v = 18.02 +mu_v = 0.8816e-05 +k_v = 0.019426 -#air props +# air props gamma_n = 1.4 -M_n = 28.97 -mu_n = 1.8E-05 -k_n = 0.02556 +M_n = 28.97 +mu_n = 1.8e-05 +k_n = 0.02556 -#air props +# air props # gamma_gas = gamma_n gamma_gas = 1.4 -#reference bubble size -R0ref = 10.E-06 +# reference bubble size +R0ref = 10.0e-06 -pa = 0.1 * 1.E+06 / 101325. +pa = 0.1 * 1.0e06 / 101325.0 -#Characteristic velocity -uu = math.sqrt( p0/rho0 ) -#Cavitation number -Ca = (p0 - pv)/(rho0*(uu**2.)) -#Weber number -We = rho0*(uu**2.)*R0ref/ss -#Inv. bubble Reynolds number -Re_inv = mul0/(rho0*uu*R0ref) +# Characteristic velocity +uu = math.sqrt(p0 / rho0) +# Cavitation number +Ca = (p0 - pv) / (rho0 * (uu**2.0)) +# Weber number +We = rho0 * (uu**2.0) * R0ref / ss +# Inv. bubble Reynolds number +Re_inv = mul0 / (rho0 * uu * R0ref) -vft = 1E-12 -vf0 = 1E-03 +vft = 1e-12 +vf0 = 1e-03 -cact = math.sqrt(n_tait*(p0 + p0*B_tait) / ((1 - vf0) * rho0) ) -cfl = 0.3 +cact = math.sqrt(n_tait * (p0 + p0 * B_tait) / ((1 - vf0) * rho0)) +cfl = 0.3 Nx = 400 Ny = 200 -dx = 6.E-03 / (x0*float(Nx)) -dt = cfl*dx*c0/cact -dt = dt - - +dx = 6.0e-03 / (x0 * float(Nx)) +dt = cfl * dx * c0 / cact Min = 1.2 -beta = (n_tait + 1) * Min**2 / (Min**2 * (n_tait - 1 + 2*vf0) + 2 * (1 - vf0)) +beta = (n_tait + 1) * Min**2 / (Min**2 * (n_tait - 1 + 2 * vf0) + 2 * (1 - vf0)) vel = Min * cact * (beta - 1) / beta delta = (1 - vf0) + n_tait * Min**2 * (beta - 1) * (1 + B_tait) / beta # Configuring case dictionary -print(json.dumps({ - # Logistics ================================================================ - 'run_time_info' : 'F', - # ========================================================================== - - # Computational Domain Parameters ========================================== - 'x_domain%beg' : 0.0E+00, - 'x_domain%end' : 6.0E-03 / x0, - 'y_domain%beg' : 0.0E+00, - 'y_domain%end' : 3.0E-03 / x0, - 'cyl_coord' : 'F', - 'm' : Nx, - 'n' : Ny, - 'p' : 0, - 'dt' : dt, - 't_step_start' : 0, - 't_step_stop' : 1000, #3000 - 't_step_save' : 10, #10 - # ========================================================================== - - # Simulation Algorithm Parameters ========================================== - 'num_patches' : 2, - # Use the 5 equation model - 'model_eqns' : 2, - 'alt_soundspeed' : 'F', - 'num_fluids' : 1, - # Advect both volume fractions - # 'adv_alphan' : 'T', - # No need to ensure the volume fractions sum to unity at the end of each - # time step - 'mpp_lim' : 'F', - # Correct errors when computing speed of sound - 'mixture_err' : 'T', - # Use TVD RK3 for time marching - 'time_stepper' : 3, - # Reconstruct the primitive variables to minimize spurious - # Use WENO5 - 'weno_order' : 5, - 'weno_eps' : 1.E-16, - 'weno_Re_flux' : 'F', - 'weno_avg' : 'T', - 'avg_state' : 2, - # Use the mapped WENO weights to maintain monotinicity - 'mapped_weno' : 'T', - 'null_weights' : 'F', - 'mp_weno' : 'F', - # Use the HLLC Riemann solver - 'riemann_solver' : 2, - 'wave_speeds' : 1, - 'bc_x%beg' : -6, - 'bc_x%end' : -3, - 'bc_y%beg' : -3, - 'bc_y%end' : -3, - # Set IB to True and add 1 patch - 'ib' : 'T', - 'num_ibs' : 1, - # ========================================================================== - - # Formatted Database Files Structure Parameters ============================ - # Export primitive variables in double precision with parallel - # I/O to minimize I/O computational time during large simulations - 'format' : 1, - 'precision' : 2, - 'prim_vars_wrt' :'T', - # 'ib_wrt' :'T', - 'fd_order' : 1, - 'omega_wrt(3)' :'T', - 'parallel_io' :'T', - # ========================================================================== - - #Ambient State ===================================== - 'patch_icpp(1)%geometry' : 3, - 'patch_icpp(1)%x_centroid' : 3.0E-03 / x0, - 'patch_icpp(1)%y_centroid' : 1.50E-03 / x0, - 'patch_icpp(1)%length_x' : 6.0E-03 / x0, - 'patch_icpp(1)%length_y' : 3.0E-03 / x0, - 'patch_icpp(1)%alpha_rho(1)' : (1.-vf0), - 'patch_icpp(1)%alpha(1)' : vf0, - 'patch_icpp(1)%vel(1)' : 1.5, - 'patch_icpp(1)%vel(2)' : 0.0E+00, - 'patch_icpp(1)%pres' : 1.E+00, - 'patch_icpp(1)%r0' : 1., - 'patch_icpp(1)%v0' : 0.0E+00, - # # ======================================================================== - - #Shocked State ===================================== - 'patch_icpp(2)%geometry' : 3, - 'patch_icpp(2)%x_centroid' : 0.5E-03 / x0, - 'patch_icpp(2)%y_centroid' : 1.50E-03 / x0, - 'patch_icpp(2)%length_x' : 1.0E-03 / x0, - 'patch_icpp(2)%length_y' : 3.0E-03 / x0, - 'patch_icpp(2)%alpha_rho(1)' : beta, - 'patch_icpp(2)%alpha(1)' : beta*vf0, - 'patch_icpp(2)%vel(1)' : vel / c0, - 'patch_icpp(2)%vel(2)' : 0.0E+00, - 'patch_icpp(2)%pres' : delta, - 'patch_icpp(2)%r0' : 1., - 'patch_icpp(2)%v0' : 0.0E+00, - 'patch_icpp(2)%alter_patch(1)' : 'T', - # # ======================================================================== - - # Patch: Cylinder Immersed Boundary ======================================== - 'patch_ib(1)%geometry' : 4, - 'patch_ib(1)%x_centroid' : 1.5E-03 / x0, - 'patch_ib(1)%y_centroid' : 1.5E-03 / x0, - 'patch_ib(1)%c' : 1.0E-03 / x0, - 'patch_ib(1)%t' : 0.15, - 'patch_ib(1)%p' : 0.4, - 'patch_ib(1)%m' : 0.02, - 'patch_ib(1)%slip' : 'F', - 'patch_ib(1)%theta' : 15, - # # ========================================================================= - 'pref' : p0, - 'rhoref' : rho0, - # Fluids Physical Parameters =============================== - # Surrounding liquid - 'fluid_pp(1)%gamma' : 1.E+00/(n_tait-1.E+00), - 'fluid_pp(1)%pi_inf' : n_tait*B_tait/(n_tait-1.), - 'fluid_pp(1)%mul0' : mul0, - 'fluid_pp(1)%ss' : ss, - 'fluid_pp(1)%pv' : pv, - 'fluid_pp(1)%gamma_v' : gamma_v, - 'fluid_pp(1)%M_v' : M_v, - 'fluid_pp(1)%mu_v' : mu_v, - 'fluid_pp(1)%k_v' : k_v, - - # Last fluid_pp is always reserved for bubble gas state === - # if applicable ========================================== - 'fluid_pp(2)%gamma' : 1./(gamma_gas-1.), - 'fluid_pp(2)%pi_inf' : 0.0E+00, - 'fluid_pp(2)%gamma_v' : gamma_n, - 'fluid_pp(2)%M_v' : M_n, - 'fluid_pp(2)%mu_v' : mu_n, - 'fluid_pp(2)%k_v' : k_n, - # ========================================================== - - # Bubbles ================================================== - 'bubbles_euler' : 'T', - 'bubble_model' : 2, - 'polytropic' : 'T', - 'polydisperse' : 'F', - 'R0_type' : 1, - 'poly_sigma' : 0.3, - 'thermal' : 3, - 'R0ref' : x0, - 'nb' : 1, - 'Ca' : Ca, - 'Web' : We, - 'Re_inv' : Re_inv, - 'qbmm' : 'F', - 'dist_type' : 1, - 'sigR' : 0.1, - 'sigV' : 0.3, - 'rhoRV' : 0.0, - # ========================================================== - # ========================================================================== -})) +print( + json.dumps( + { + # Logistics ================================================================ + "run_time_info": "F", + # Computational Domain Parameters ========================================== + "x_domain%beg": 0.0e00, + "x_domain%end": 6.0e-03 / x0, + "y_domain%beg": 0.0e00, + "y_domain%end": 3.0e-03 / x0, + "cyl_coord": "F", + "m": Nx, + "n": Ny, + "p": 0, + "dt": dt, + "t_step_start": 0, + "t_step_stop": 1000, # 3000 + "t_step_save": 10, # 10 + # Simulation Algorithm Parameters ========================================== + "num_patches": 2, + # Use the 5 equation model + "model_eqns": 2, + "alt_soundspeed": "F", + "num_fluids": 1, + # Advect both volume fractions + # 'adv_alphan' : 'T', + # No need to ensure the volume fractions sum to unity at the end of each + # time step + "mpp_lim": "F", + # Correct errors when computing speed of sound + "mixture_err": "T", + # Use TVD RK3 for time marching + "time_stepper": 3, + # Reconstruct the primitive variables to minimize spurious + # Use WENO5 + "weno_order": 5, + "weno_eps": 1.0e-16, + "weno_Re_flux": "F", + "weno_avg": "T", + "avg_state": 2, + # Use the mapped WENO weights to maintain monotinicity + "mapped_weno": "T", + "null_weights": "F", + "mp_weno": "F", + # Use the HLLC Riemann solver + "riemann_solver": 2, + "wave_speeds": 1, + "bc_x%beg": -6, + "bc_x%end": -3, + "bc_y%beg": -3, + "bc_y%end": -3, + # Set IB to True and add 1 patch + "ib": "T", + "num_ibs": 1, + # Formatted Database Files Structure Parameters ============================ + # Export primitive variables in double precision with parallel + # I/O to minimize I/O computational time during large simulations + "format": 1, + "precision": 2, + "prim_vars_wrt": "T", + # 'ib_wrt' :'T', + "fd_order": 1, + "omega_wrt(3)": "T", + "parallel_io": "T", + # Ambient State ===================================== + "patch_icpp(1)%geometry": 3, + "patch_icpp(1)%x_centroid": 3.0e-03 / x0, + "patch_icpp(1)%y_centroid": 1.50e-03 / x0, + "patch_icpp(1)%length_x": 6.0e-03 / x0, + "patch_icpp(1)%length_y": 3.0e-03 / x0, + "patch_icpp(1)%alpha_rho(1)": (1.0 - vf0), + "patch_icpp(1)%alpha(1)": vf0, + "patch_icpp(1)%vel(1)": 1.5, + "patch_icpp(1)%vel(2)": 0.0e00, + "patch_icpp(1)%pres": 1.0e00, + "patch_icpp(1)%r0": 1.0, + "patch_icpp(1)%v0": 0.0e00, + # Shocked State ===================================== + "patch_icpp(2)%geometry": 3, + "patch_icpp(2)%x_centroid": 0.5e-03 / x0, + "patch_icpp(2)%y_centroid": 1.50e-03 / x0, + "patch_icpp(2)%length_x": 1.0e-03 / x0, + "patch_icpp(2)%length_y": 3.0e-03 / x0, + "patch_icpp(2)%alpha_rho(1)": beta, + "patch_icpp(2)%alpha(1)": beta * vf0, + "patch_icpp(2)%vel(1)": vel / c0, + "patch_icpp(2)%vel(2)": 0.0e00, + "patch_icpp(2)%pres": delta, + "patch_icpp(2)%r0": 1.0, + "patch_icpp(2)%v0": 0.0e00, + "patch_icpp(2)%alter_patch(1)": "T", + # Patch: Cylinder Immersed Boundary ======================================== + "patch_ib(1)%geometry": 4, + "patch_ib(1)%x_centroid": 1.5e-03 / x0, + "patch_ib(1)%y_centroid": 1.5e-03 / x0, + "patch_ib(1)%c": 1.0e-03 / x0, + "patch_ib(1)%t": 0.15, + "patch_ib(1)%p": 0.4, + "patch_ib(1)%m": 0.02, + "patch_ib(1)%slip": "F", + "patch_ib(1)%theta": 15, + "pref": p0, + "rhoref": rho0, + # Fluids Physical Parameters =============================== + # Surrounding liquid + "fluid_pp(1)%gamma": 1.0e00 / (n_tait - 1.0e00), + "fluid_pp(1)%pi_inf": n_tait * B_tait / (n_tait - 1.0), + "fluid_pp(1)%mul0": mul0, + "fluid_pp(1)%ss": ss, + "fluid_pp(1)%pv": pv, + "fluid_pp(1)%gamma_v": gamma_v, + "fluid_pp(1)%M_v": M_v, + "fluid_pp(1)%mu_v": mu_v, + "fluid_pp(1)%k_v": k_v, + # Last fluid_pp is always reserved for bubble gas state === + # if applicable ========================================== + "fluid_pp(2)%gamma": 1.0 / (gamma_gas - 1.0), + "fluid_pp(2)%pi_inf": 0.0e00, + "fluid_pp(2)%gamma_v": gamma_n, + "fluid_pp(2)%M_v": M_n, + "fluid_pp(2)%mu_v": mu_n, + "fluid_pp(2)%k_v": k_n, + # Bubbles ================================================== + "bubbles_euler": "T", + "bubble_model": 2, + "polytropic": "T", + "polydisperse": "F", + "R0_type": 1, + "poly_sigma": 0.3, + "thermal": 3, + "R0ref": x0, + "nb": 1, + "Ca": Ca, + "Web": We, + "Re_inv": Re_inv, + "qbmm": "F", + "dist_type": 1, + "sigR": 0.1, + "sigV": 0.3, + "rhoRV": 0.0, + } + ) +) diff --git a/examples/2D_hardcodied_ic/case.py b/examples/2D_hardcodied_ic/case.py index 96614c3b54..7be5861d5e 100644 --- a/examples/2D_hardcodied_ic/case.py +++ b/examples/2D_hardcodied_ic/case.py @@ -1,87 +1,78 @@ #!/usr/bin/env python3 - import json eps = 1e-9 # Configuring case dictionary -print(json.dumps({ - # Logistics ================================================ - 'run_time_info' : 'T', - # ========================================================== - - # Computational Domain Parameters ========================== - 'x_domain%beg' : 0.E+00, - 'x_domain%end' : 4.E+00, - 'stretch_x' : 'T', - 'a_x' : 7, - 'x_a' : -2, - 'x_b' : 2, - 'y_domain%beg' : 0.E+00, - 'y_domain%end' : 4.E+00, - 'stretch_y' : 'T', - 'a_y' : 7, - 'y_a' : -2, - 'y_b' : 2, - 'm' : 199, - 'n' : 199, - 'p' : 0, - 'dt' : 5.E-06, - 't_step_start' : 0, - 't_step_stop' : 2000, - 't_step_save' : 200, - # ========================================================== - - # Simulation Algorithm Parameters ========================== - 'num_patches' : 1, - 'model_eqns' : 3, - 'alt_soundspeed' : 'F', - 'num_fluids' : 2, - 'mpp_lim' : 'T', - 'mixture_err' : 'T', - 'time_stepper' : 3, - 'weno_order' : 5, - 'weno_eps' : 1.E-16, - 'mapped_weno' : 'T', - 'null_weights' : 'F', - 'mp_weno' : 'F', - 'riemann_solver' : 2, - 'wave_speeds' : 1, - 'avg_state' : 2, - 'bc_x%beg' : -2, - 'bc_x%end' : -7, - 'bc_y%beg' : -2, - 'bc_y%end' : -7, - # ========================================================== - - # Formatted Database Files Structure Parameters ============ - 'format' : 1, - 'precision' : 2, - 'prim_vars_wrt' :'T', - 'parallel_io' :'T', - # ========================================================== - - # Patch 1: Base ============================================ - 'patch_icpp(1)%geometry' : 7, - 'patch_icpp(1)%hcid' : 200, - 'patch_icpp(1)%x_centroid' : 4., - 'patch_icpp(1)%y_centroid' : 4., - 'patch_icpp(1)%length_x' : 8., - 'patch_icpp(1)%length_y' : 8., - 'patch_icpp(1)%vel(1)' : 0., - 'patch_icpp(1)%vel(2)' : 0., - 'patch_icpp(1)%pres' : 10, - 'patch_icpp(1)%alpha_rho(1)' : (1-eps)*1000, - 'patch_icpp(1)%alpha_rho(2)' : eps*1, - 'patch_icpp(1)%alpha(1)' : 1-eps, - 'patch_icpp(1)%alpha(2)' : eps, - # =========================================================== - - # Fluids Physical Parameters =============================== - 'fluid_pp(1)%gamma' : 1.E+00/(2.35E+00-1.E+00), - 'fluid_pp(1)%pi_inf' : 2.35E+00*1.E+09/(2.35E+00-1.E+00), - 'fluid_pp(2)%gamma' : 1.E+00/(1.4E+00-1.E+00), - 'fluid_pp(2)%pi_inf' : 0.E+00, - # ========================================================== -})) -# ============================================================================== +print( + json.dumps( + { + # Logistics ================================================ + "run_time_info": "T", + # Computational Domain Parameters ========================== + "x_domain%beg": 0.0e00, + "x_domain%end": 4.0e00, + "stretch_x": "T", + "a_x": 7, + "x_a": -2, + "x_b": 2, + "y_domain%beg": 0.0e00, + "y_domain%end": 4.0e00, + "stretch_y": "T", + "a_y": 7, + "y_a": -2, + "y_b": 2, + "m": 199, + "n": 199, + "p": 0, + "dt": 5.0e-06, + "t_step_start": 0, + "t_step_stop": 2000, + "t_step_save": 200, + # Simulation Algorithm Parameters ========================== + "num_patches": 1, + "model_eqns": 3, + "alt_soundspeed": "F", + "num_fluids": 2, + "mpp_lim": "T", + "mixture_err": "T", + "time_stepper": 3, + "weno_order": 5, + "weno_eps": 1.0e-16, + "mapped_weno": "T", + "null_weights": "F", + "mp_weno": "F", + "riemann_solver": 2, + "wave_speeds": 1, + "avg_state": 2, + "bc_x%beg": -2, + "bc_x%end": -7, + "bc_y%beg": -2, + "bc_y%end": -7, + # Formatted Database Files Structure Parameters ============ + "format": 1, + "precision": 2, + "prim_vars_wrt": "T", + "parallel_io": "T", + # Patch 1: Base ============================================ + "patch_icpp(1)%geometry": 7, + "patch_icpp(1)%hcid": 200, + "patch_icpp(1)%x_centroid": 4.0, + "patch_icpp(1)%y_centroid": 4.0, + "patch_icpp(1)%length_x": 8.0, + "patch_icpp(1)%length_y": 8.0, + "patch_icpp(1)%vel(1)": 0.0, + "patch_icpp(1)%vel(2)": 0.0, + "patch_icpp(1)%pres": 10, + "patch_icpp(1)%alpha_rho(1)": (1 - eps) * 1000, + "patch_icpp(1)%alpha_rho(2)": eps * 1, + "patch_icpp(1)%alpha(1)": 1 - eps, + "patch_icpp(1)%alpha(2)": eps, + # Fluids Physical Parameters =============================== + "fluid_pp(1)%gamma": 1.0e00 / (2.35e00 - 1.0e00), + "fluid_pp(1)%pi_inf": 2.35e00 * 1.0e09 / (2.35e00 - 1.0e00), + "fluid_pp(2)%gamma": 1.0e00 / (1.4e00 - 1.0e00), + "fluid_pp(2)%pi_inf": 0.0e00, + } + ) +) diff --git a/examples/2D_ibm/case.py b/examples/2D_ibm/case.py index 289b3633c9..6deb90e479 100644 --- a/examples/2D_ibm/case.py +++ b/examples/2D_ibm/case.py @@ -1,105 +1,96 @@ import json import math -Mu = 1.84E-05 +Mu = 1.84e-05 gam_a = 1.4 # Configuring case dictionary -print(json.dumps({ - # Logistics ================================================================ - 'run_time_info' : 'T', - # ========================================================================== - - # Computational Domain Parameters ========================================== - # For these computations, the cylinder is placed at the (0,0,0) - # domain origin. - # axial direction - 'x_domain%beg' : 0.0E+00, - 'x_domain%end' : 6.0E-03, - # r direction - 'y_domain%beg' : 0.0E+00, - 'y_domain%end' : 6.0E-03, - 'cyl_coord' : 'F', - 'm' : 400, - 'n' : 400, - 'p' : 0, - 'dt' : 0.2E-6, - 't_step_start' : 0, - 't_step_stop' : 40000, #3000 - 't_step_save' : 4000, #10 - # ========================================================================== - - # Simulation Algorithm Parameters ========================================== - # Only one patches are necessary, the air tube - 'num_patches' : 1, - # Use the 5 equation model - 'model_eqns' : 2, - 'alt_soundspeed' : 'F', - # One fluids: air - 'num_fluids' : 1, - # time step - 'mpp_lim' : 'F', - # Correct errors when computing speed of sound - 'mixture_err' : 'T', - # Use TVD RK3 for time marching - 'time_stepper' : 3, - # Use WENO5 - 'weno_order' : 5, - 'weno_eps' : 1.E-16, - 'weno_Re_flux' : 'T', - 'weno_avg' : 'T', - 'avg_state' : 2, - 'mapped_weno' : 'T', - 'null_weights' : 'F', - 'mp_weno' : 'T', - 'riemann_solver' : 2, - 'wave_speeds' : 1, - # We use ghost-cell - 'bc_x%beg' : -3, - 'bc_x%end' : -3, - 'bc_y%beg' : -3, - 'bc_y%end' : -3, - # Set IB to True and add 1 patch - 'ib' : 'T', - 'num_ibs' : 1, - 'viscous' : 'T', - # ========================================================================== - - # Formatted Database Files Structure Parameters ============================ - 'format' : 1, - 'precision' : 2, - 'prim_vars_wrt' :'T', - 'E_wrt' :'T', - 'parallel_io' :'T', - # ========================================================================== - - # Patch: Constant Tube filled with air ===================================== - # Specify the cylindrical air tube grid geometry - 'patch_icpp(1)%geometry' : 3, - 'patch_icpp(1)%x_centroid' : 3.0E-03, - # Uniform medium density, centroid is at the center of the domain - 'patch_icpp(1)%y_centroid' : 3.0E-03, - 'patch_icpp(1)%length_x' : 6.0E-03, - 'patch_icpp(1)%length_y' : 6.0E-03, - # Specify the patch primitive variables - 'patch_icpp(1)%vel(1)' : 0.05E+00, - 'patch_icpp(1)%vel(2)' : 0.0E+00, - 'patch_icpp(1)%pres' : 1.E+00, - 'patch_icpp(1)%alpha_rho(1)' : 1.E+00, - 'patch_icpp(1)%alpha(1)' : 1.E+00, - # # ======================================================================== - - # Patch: Cylinder Immersed Boundary ======================================== - 'patch_ib(1)%geometry' : 2, - 'patch_ib(1)%x_centroid' : 1.5E-03, - 'patch_ib(1)%y_centroid' : 3.0E-03, - 'patch_ib(1)%radius' : 0.2E-03, - 'patch_ib(1)%slip' : 'F', - # # ======================================================================== - - # Fluids Physical Parameters =============================================== - 'fluid_pp(1)%gamma' : 1.E+00/(gam_a-1.E+00), # 2.50(Not 1.40) - 'fluid_pp(1)%pi_inf' : 0, - 'fluid_pp(1)%Re(1)' : 2500000, - # ========================================================================== -})) +print( + json.dumps( + { + # Logistics ================================================================ + "run_time_info": "T", + # Computational Domain Parameters ========================================== + # For these computations, the cylinder is placed at the (0,0,0) + # domain origin. + # axial direction + "x_domain%beg": 0.0e00, + "x_domain%end": 6.0e-03, + # r direction + "y_domain%beg": 0.0e00, + "y_domain%end": 6.0e-03, + "cyl_coord": "F", + "m": 400, + "n": 400, + "p": 0, + "dt": 0.2e-6, + "t_step_start": 0, + "t_step_stop": 40000, # 3000 + "t_step_save": 4000, # 10 + # Simulation Algorithm Parameters ========================================== + # Only one patches are necessary, the air tube + "num_patches": 1, + # Use the 5 equation model + "model_eqns": 2, + "alt_soundspeed": "F", + # One fluids: air + "num_fluids": 1, + # time step + "mpp_lim": "F", + # Correct errors when computing speed of sound + "mixture_err": "T", + # Use TVD RK3 for time marching + "time_stepper": 3, + # Use WENO5 + "weno_order": 5, + "weno_eps": 1.0e-16, + "weno_Re_flux": "T", + "weno_avg": "T", + "avg_state": 2, + "mapped_weno": "T", + "null_weights": "F", + "mp_weno": "T", + "riemann_solver": 2, + "wave_speeds": 1, + # We use ghost-cell + "bc_x%beg": -3, + "bc_x%end": -3, + "bc_y%beg": -3, + "bc_y%end": -3, + # Set IB to True and add 1 patch + "ib": "T", + "num_ibs": 1, + "viscous": "T", + # Formatted Database Files Structure Parameters ============================ + "format": 1, + "precision": 2, + "prim_vars_wrt": "T", + "E_wrt": "T", + "parallel_io": "T", + # Patch: Constant Tube filled with air ===================================== + # Specify the cylindrical air tube grid geometry + "patch_icpp(1)%geometry": 3, + "patch_icpp(1)%x_centroid": 3.0e-03, + # Uniform medium density, centroid is at the center of the domain + "patch_icpp(1)%y_centroid": 3.0e-03, + "patch_icpp(1)%length_x": 6.0e-03, + "patch_icpp(1)%length_y": 6.0e-03, + # Specify the patch primitive variables + "patch_icpp(1)%vel(1)": 0.05e00, + "patch_icpp(1)%vel(2)": 0.0e00, + "patch_icpp(1)%pres": 1.0e00, + "patch_icpp(1)%alpha_rho(1)": 1.0e00, + "patch_icpp(1)%alpha(1)": 1.0e00, + # Patch: Cylinder Immersed Boundary ======================================== + "patch_ib(1)%geometry": 2, + "patch_ib(1)%x_centroid": 1.5e-03, + "patch_ib(1)%y_centroid": 3.0e-03, + "patch_ib(1)%radius": 0.2e-03, + "patch_ib(1)%slip": "F", + # Fluids Physical Parameters =============================================== + "fluid_pp(1)%gamma": 1.0e00 / (gam_a - 1.0e00), # 2.50(Not 1.40) + "fluid_pp(1)%pi_inf": 0, + "fluid_pp(1)%Re(1)": 2500000, + } + ) +) diff --git a/examples/2D_ibm_airfoil/case.py b/examples/2D_ibm_airfoil/case.py index bccf8d5d5c..aeebb760f5 100644 --- a/examples/2D_ibm_airfoil/case.py +++ b/examples/2D_ibm_airfoil/case.py @@ -1,115 +1,106 @@ import json import math -Mu = 1.84E-05 +Mu = 1.84e-05 gam_a = 1.4 gam_b = 1.1 # Configuring case dictionary -print(json.dumps({ - # Logistics ================================================================ - 'run_time_info' : 'T', - # ========================================================================== - - # Computational Domain Parameters ========================================== - # axial direction - 'x_domain%beg' : 0.0E+00, - 'x_domain%end' : 6.0E-03, - # r direction - 'y_domain%beg' : 0.0E+00, - 'y_domain%end' : 6.0E-03, - 'cyl_coord' : 'F', - 'm' : 200, - 'n' : 200, - 'p' : 0, - 'dt' : 0.57E-5/2, - 't_step_start' : 0, - 't_step_stop' : 7200, #3000 - 't_step_save' : 30, #10 - # ========================================================================== - - # Simulation Algorithm Parameters ========================================== - # Only one patches are necessary, the air tube - 'num_patches' : 1, - # Use the 5 equation model - 'model_eqns' : 2, - # 6 equations model does not need the K \div(u) term - 'alt_soundspeed' : 'F', - # One fluids: air - 'num_fluids' : 2, - # time step - 'mpp_lim' : 'F', - # Correct errors when computing speed of sound - 'mixture_err' : 'T', - # Use TVD RK3 for time marching - 'time_stepper' : 3, - # Reconstruct the primitive variables to minimize spurious - # Use WENO5 - 'weno_order' : 5, - 'weno_eps' : 1.E-16, - 'weno_Re_flux' : 'F', - 'weno_avg' : 'T', - 'avg_state' : 2, - # Use the mapped WENO weights to maintain monotinicity - 'mapped_weno' : 'T', - 'null_weights' : 'F', - 'mp_weno' : 'T', - # Use the HLLC Riemann solver - 'riemann_solver' : 2, - 'wave_speeds' : 1, - # We use reflective boundary conditions at octant edges and - # non-reflective boundary conditions at the domain edges - 'bc_x%beg' : -3, - 'bc_x%end' : -3, - 'bc_y%beg' : -3, - 'bc_y%end' : -3, - # Set IB to True and add 1 patch - 'ib' : 'T', - 'num_ibs' : 1, - # ========================================================================== - - # Formatted Database Files Structure Parameters ============================ - 'format' : 1, - 'precision' : 2, - 'prim_vars_wrt' :'T', - 'E_wrt' :'T', - 'parallel_io' :'T', - # ========================================================================== - - # Patch: Constant Tube filled with air ===================================== - # Specify the cylindrical air tube grid geometry - 'patch_icpp(1)%geometry' : 3, - 'patch_icpp(1)%x_centroid' : 3.0E-03, - # Uniform medium density, centroid is at the center of the domain - 'patch_icpp(1)%y_centroid' : 3.0E-03, - 'patch_icpp(1)%length_x' : 6.0E-03, - 'patch_icpp(1)%length_y' : 6.0E-03, - # Specify the patch primitive variables - 'patch_icpp(1)%vel(1)' : 0.1E+00, - 'patch_icpp(1)%vel(2)' : 0.0E+00, - 'patch_icpp(1)%pres' : 1.E+00, - 'patch_icpp(1)%alpha_rho(1)' : 0.8E+00, - 'patch_icpp(1)%alpha(1)' : 0.8E+00, - 'patch_icpp(1)%alpha_rho(2)' : 0.2E+00, - 'patch_icpp(1)%alpha(2)' : 0.2E+00, - # # ======================================================================== - - # Patch: Airfoil Immersed Boundary ======================================== - 'patch_ib(1)%geometry' : 4, - 'patch_ib(1)%x_centroid' : 1.0E-03, - 'patch_ib(1)%y_centroid' : 3.0E-03, - 'patch_ib(1)%c' : 1.0E-03, - 'patch_ib(1)%t' : 0.15, - 'patch_ib(1)%p' : 0.4, - 'patch_ib(1)%m' : 0.02, - 'patch_ib(1)%theta' : 30, - # # ======================================================================== - - # Fluids Physical Parameters =============================================== - # Use the same stiffness as the air bubble - 'fluid_pp(1)%gamma' : 1.E+00/(gam_a-1.E+00), # 2.50(Not 1.40) - 'fluid_pp(1)%pi_inf' : 0, - 'fluid_pp(2)%gamma' : 1.E+00/(gam_b-1.E+00), # 2.50(Not 1.40) - 'fluid_pp(2)%pi_inf' : 0, - # ========================================================================== -})) +print( + json.dumps( + { + # Logistics ================================================================ + "run_time_info": "T", + # Computational Domain Parameters ========================================== + # axial direction + "x_domain%beg": 0.0e00, + "x_domain%end": 6.0e-03, + # r direction + "y_domain%beg": 0.0e00, + "y_domain%end": 6.0e-03, + "cyl_coord": "F", + "m": 200, + "n": 200, + "p": 0, + "dt": 0.57e-5 / 2, + "t_step_start": 0, + "t_step_stop": 7200, # 3000 + "t_step_save": 30, # 10 + # Simulation Algorithm Parameters ========================================== + # Only one patches are necessary, the air tube + "num_patches": 1, + # Use the 5 equation model + "model_eqns": 2, + # 6 equations model does not need the K \div(u) term + "alt_soundspeed": "F", + # One fluids: air + "num_fluids": 2, + # time step + "mpp_lim": "F", + # Correct errors when computing speed of sound + "mixture_err": "T", + # Use TVD RK3 for time marching + "time_stepper": 3, + # Reconstruct the primitive variables to minimize spurious + # Use WENO5 + "weno_order": 5, + "weno_eps": 1.0e-16, + "weno_Re_flux": "F", + "weno_avg": "T", + "avg_state": 2, + # Use the mapped WENO weights to maintain monotinicity + "mapped_weno": "T", + "null_weights": "F", + "mp_weno": "T", + # Use the HLLC Riemann solver + "riemann_solver": 2, + "wave_speeds": 1, + # We use reflective boundary conditions at octant edges and + # non-reflective boundary conditions at the domain edges + "bc_x%beg": -3, + "bc_x%end": -3, + "bc_y%beg": -3, + "bc_y%end": -3, + # Set IB to True and add 1 patch + "ib": "T", + "num_ibs": 1, + # Formatted Database Files Structure Parameters ============================ + "format": 1, + "precision": 2, + "prim_vars_wrt": "T", + "E_wrt": "T", + "parallel_io": "T", + # Patch: Constant Tube filled with air ===================================== + # Specify the cylindrical air tube grid geometry + "patch_icpp(1)%geometry": 3, + "patch_icpp(1)%x_centroid": 3.0e-03, + # Uniform medium density, centroid is at the center of the domain + "patch_icpp(1)%y_centroid": 3.0e-03, + "patch_icpp(1)%length_x": 6.0e-03, + "patch_icpp(1)%length_y": 6.0e-03, + # Specify the patch primitive variables + "patch_icpp(1)%vel(1)": 0.1e00, + "patch_icpp(1)%vel(2)": 0.0e00, + "patch_icpp(1)%pres": 1.0e00, + "patch_icpp(1)%alpha_rho(1)": 0.8e00, + "patch_icpp(1)%alpha(1)": 0.8e00, + "patch_icpp(1)%alpha_rho(2)": 0.2e00, + "patch_icpp(1)%alpha(2)": 0.2e00, + # Patch: Airfoil Immersed Boundary ======================================== + "patch_ib(1)%geometry": 4, + "patch_ib(1)%x_centroid": 1.0e-03, + "patch_ib(1)%y_centroid": 3.0e-03, + "patch_ib(1)%c": 1.0e-03, + "patch_ib(1)%t": 0.15, + "patch_ib(1)%p": 0.4, + "patch_ib(1)%m": 0.02, + "patch_ib(1)%theta": 30, + # Fluids Physical Parameters =============================================== + # Use the same stiffness as the air bubble + "fluid_pp(1)%gamma": 1.0e00 / (gam_a - 1.0e00), # 2.50(Not 1.40) + "fluid_pp(1)%pi_inf": 0, + "fluid_pp(2)%gamma": 1.0e00 / (gam_b - 1.0e00), # 2.50(Not 1.40) + "fluid_pp(2)%pi_inf": 0, + } + ) +) diff --git a/examples/2D_ibm_cfl_dt/case.py b/examples/2D_ibm_cfl_dt/case.py index 5c4326d21b..426c182ba4 100644 --- a/examples/2D_ibm_cfl_dt/case.py +++ b/examples/2D_ibm_cfl_dt/case.py @@ -1,108 +1,99 @@ import json import math -Mu = 1.84E-05 +Mu = 1.84e-05 gam_a = 1.4 # Configuring case dictionary -print(json.dumps({ - # Logistics ================================================================ - 'run_time_info' : 'T', - # ========================================================================== - - # Computational Domain Parameters ========================================== - # For these computations, the cylinder is placed at the (0,0,0) - # domain origin. - # axial direction - 'x_domain%beg' : 0.0E+00, - 'x_domain%end' : 8.0E-03, - # r direction - 'y_domain%beg' : 0.0E+00, - 'y_domain%end' : 6.0E-03, - 'cyl_coord' : 'F', - 'm' : 199, - 'n' : 139, - 'p' : 0, - 'cfl_adap_dt' : 'T', - 'cfl_target' : 0.3, - 'n_start' : 0, - 't_save' : 8e-5, - 't_stop' : 8e-3, - # ========================================================================== - - # Simulation Algorithm Parameters ========================================== - # Only one patches are necessary, the air tube - 'num_patches' : 1, - # Use the 5 equation model - 'model_eqns' : 2, - 'alt_soundspeed' : 'F', - # One fluids: air - 'num_fluids' : 1, - # No need to ensure the volume fractions sum to unity at the end of each - # time step - 'mpp_lim' : 'F', - # Correct errors when computing speed of sound - 'mixture_err' : 'T', - # Use TVD RK3 for time marching - 'time_stepper' : 3, - # Use WENO5 - 'weno_order' : 5, - 'weno_eps' : 1.E-16, - # 'weno_Re_flux' : 'T', - 'weno_avg' : 'T', - 'avg_state' : 2, - 'mapped_weno' : 'T', - 'null_weights' : 'F', - 'mp_weno' : 'T', - 'riemann_solver' : 2, - 'wave_speeds' : 1, - # We use ghost-cell - 'bc_x%beg' : -3, - 'bc_x%end' : -3, - 'bc_y%beg' : -2, - 'bc_y%end' : -2, - # Set IB to True and add 1 patch - 'ib' : 'T', - 'num_ibs' : 1, - 'viscous' : 'T', - # ========================================================================== - - # Formatted Database Files Structure Parameters ============================ - 'format' : 1, - 'precision' : 2, - 'prim_vars_wrt' :'T', - 'E_wrt' :'T', - 'parallel_io' :'T', - 'c_wrt' :'T', - # ========================================================================== - - # Patch: Constant Tube filled with air ===================================== - # Specify the cylindrical air tube grid geometry - 'patch_icpp(1)%geometry' : 3, - 'patch_icpp(1)%x_centroid' : 4.0E-03, - # Uniform medium density, centroid is at the center of the domain - 'patch_icpp(1)%y_centroid' : 3.0E-03, - 'patch_icpp(1)%length_x' : 8.0E-03, - 'patch_icpp(1)%length_y' : 6.0E-03, - # Specify the patch primitive variables - 'patch_icpp(1)%vel(1)' : 5E+00, - 'patch_icpp(1)%vel(2)' : 0.0E+00, - 'patch_icpp(1)%pres' : 1.E+00, - 'patch_icpp(1)%alpha_rho(1)' : 1.E+00, - 'patch_icpp(1)%alpha(1)' : 1.E+00, - # # ======================================================================== - - # Patch: Cylinder Immersed Boundary ======================================== - 'patch_ib(1)%geometry' : 2, - 'patch_ib(1)%x_centroid' : 1.5E-03, - 'patch_ib(1)%y_centroid' : 3E-03, - 'patch_ib(1)%radius' : 0.4E-03, - 'patch_ib(1)%slip' : 'F', - # # ======================================================================== - - # Fluids Physical Parameters =============================================== - 'fluid_pp(1)%gamma' : 1.E+00/(gam_a-1.E+00), # 2.50(Not 1.40) - 'fluid_pp(1)%pi_inf' : 0, - 'fluid_pp(1)%Re(1)' : 250000, - # ========================================================================== -})) +print( + json.dumps( + { + # Logistics ================================================================ + "run_time_info": "T", + # Computational Domain Parameters ========================================== + # For these computations, the cylinder is placed at the (0,0,0) + # domain origin. + # axial direction + "x_domain%beg": 0.0e00, + "x_domain%end": 8.0e-03, + # r direction + "y_domain%beg": 0.0e00, + "y_domain%end": 6.0e-03, + "cyl_coord": "F", + "m": 199, + "n": 139, + "p": 0, + "cfl_adap_dt": "T", + "cfl_target": 0.3, + "n_start": 0, + "t_save": 8e-5, + "t_stop": 8e-3, + # Simulation Algorithm Parameters ========================================== + # Only one patches are necessary, the air tube + "num_patches": 1, + # Use the 5 equation model + "model_eqns": 2, + "alt_soundspeed": "F", + # One fluids: air + "num_fluids": 1, + # No need to ensure the volume fractions sum to unity at the end of each + # time step + "mpp_lim": "F", + # Correct errors when computing speed of sound + "mixture_err": "T", + # Use TVD RK3 for time marching + "time_stepper": 3, + # Use WENO5 + "weno_order": 5, + "weno_eps": 1.0e-16, + # 'weno_Re_flux' : 'T', + "weno_avg": "T", + "avg_state": 2, + "mapped_weno": "T", + "null_weights": "F", + "mp_weno": "T", + "riemann_solver": 2, + "wave_speeds": 1, + # We use ghost-cell + "bc_x%beg": -3, + "bc_x%end": -3, + "bc_y%beg": -2, + "bc_y%end": -2, + # Set IB to True and add 1 patch + "ib": "T", + "num_ibs": 1, + "viscous": "T", + # Formatted Database Files Structure Parameters ============================ + "format": 1, + "precision": 2, + "prim_vars_wrt": "T", + "E_wrt": "T", + "parallel_io": "T", + "c_wrt": "T", + # Patch: Constant Tube filled with air ===================================== + # Specify the cylindrical air tube grid geometry + "patch_icpp(1)%geometry": 3, + "patch_icpp(1)%x_centroid": 4.0e-03, + # Uniform medium density, centroid is at the center of the domain + "patch_icpp(1)%y_centroid": 3.0e-03, + "patch_icpp(1)%length_x": 8.0e-03, + "patch_icpp(1)%length_y": 6.0e-03, + # Specify the patch primitive variables + "patch_icpp(1)%vel(1)": 5e00, + "patch_icpp(1)%vel(2)": 0.0e00, + "patch_icpp(1)%pres": 1.0e00, + "patch_icpp(1)%alpha_rho(1)": 1.0e00, + "patch_icpp(1)%alpha(1)": 1.0e00, + # Patch: Cylinder Immersed Boundary ======================================== + "patch_ib(1)%geometry": 2, + "patch_ib(1)%x_centroid": 1.5e-03, + "patch_ib(1)%y_centroid": 3e-03, + "patch_ib(1)%radius": 0.4e-03, + "patch_ib(1)%slip": "F", + # Fluids Physical Parameters =============================================== + "fluid_pp(1)%gamma": 1.0e00 / (gam_a - 1.0e00), # 2.50(Not 1.40) + "fluid_pp(1)%pi_inf": 0, + "fluid_pp(1)%Re(1)": 250000, + } + ) +) diff --git a/examples/2D_ibm_multiphase/case.py b/examples/2D_ibm_multiphase/case.py index c4c4577093..a4af8ea219 100644 --- a/examples/2D_ibm_multiphase/case.py +++ b/examples/2D_ibm_multiphase/case.py @@ -1,106 +1,97 @@ import json import math -Mu = 1.84E-05 +Mu = 1.84e-05 gam_a = 1.4 gam_b = 1.1 # Configuring case dictionary -print(json.dumps({ - # Logistics ================================================================ - 'run_time_info' : 'T', - # ========================================================================== - - # Computational Domain Parameters ========================================== - # axial direction - 'x_domain%beg' : 0.0E+00, - 'x_domain%end' : 6.0E-03, - # r direction - 'y_domain%beg' : 0.0E+00, - 'y_domain%end' : 6.0E-03, - 'cyl_coord' : 'F', - 'm' : 400, - 'n' : 400, - 'p' : 0, - 'dt' : 0.5E-6, - 't_step_start' : 0, - 't_step_stop' : 10000, #3000 - 't_step_save' : 1000, #10 - # ========================================================================== - - # Simulation Algorithm Parameters ========================================== - # Only one patches are necessary, the air tube - 'num_patches' : 1, - # Use the 6 equation model - 'model_eqns' : 3, - 'alt_soundspeed' : 'F', - 'num_fluids' : 2, - 'mpp_lim' : 'T', - # Correct errors when computing speed of sound - 'mixture_err' : 'T', - # Use TVD RK3 for time marching - 'time_stepper' : 3, - # Use WENO5 - 'weno_order' : 5, - 'weno_eps' : 1.E-16, - 'weno_Re_flux' : 'F', - 'weno_avg' : 'T', - 'avg_state' : 2, - # Use the mapped WENO weights to maintain monotinicity - 'mapped_weno' : 'T', - 'null_weights' : 'F', - 'mp_weno' : 'T', - # Use the HLLC Riemann solver - 'riemann_solver' : 2, - 'wave_speeds' : 1, - # We use ghost-cell extrapolation at every side - 'bc_x%beg' : -3, - 'bc_x%end' : -3, - 'bc_y%beg' : -3, - 'bc_y%end' : -3, - # Set IB to True and add 1 patch - 'ib' : 'T', - 'num_ibs' : 1, - # ========================================================================== - - # Formatted Database Files Structure Parameters ============================ - 'format' : 1, - 'precision' : 2, - 'prim_vars_wrt' :'T', - 'E_wrt' :'T', - 'parallel_io' :'T', - # ========================================================================== - - # Patch: Constant Tube filled with air ===================================== - # Specify the cylindrical air tube grid geometry - 'patch_icpp(1)%geometry' : 3, - 'patch_icpp(1)%x_centroid' : 3.0E-03, - # Uniform medium density, centroid is at the center of the domain - 'patch_icpp(1)%y_centroid' : 3.0E-03, - 'patch_icpp(1)%length_x' : 6.0E-03, - 'patch_icpp(1)%length_y' : 6.0E-03, - # Specify the patch primitive variables - 'patch_icpp(1)%vel(1)' : 0.1E+00, - 'patch_icpp(1)%vel(2)' : 0.0E+00, - 'patch_icpp(1)%pres' : 1.E+00, - 'patch_icpp(1)%alpha_rho(1)' : 0.8E+00, - 'patch_icpp(1)%alpha(1)' : 0.8E+00, - 'patch_icpp(1)%alpha_rho(2)' : 0.2E+00, - 'patch_icpp(1)%alpha(2)' : 0.2E+00, - # # ======================================================================== - - # Patch: Cylinder Immersed Boundary ======================================== - 'patch_ib(1)%geometry' : 2, - 'patch_ib(1)%x_centroid' : 1.5E-03, - 'patch_ib(1)%y_centroid' : 3.0E-03, - 'patch_ib(1)%radius' : 0.2E-03, - # ========================================================================== - - # Fluids Physical Parameters =============================================== - # Specify 2 fluids - 'fluid_pp(1)%gamma' : 1.E+00/(gam_a-1.E+00), # 2.50(Not 1.40) - 'fluid_pp(1)%pi_inf' : 0, - 'fluid_pp(2)%gamma' : 1.E+00/(gam_b-1.E+00), # 2.50(Not 1.40) - 'fluid_pp(2)%pi_inf' : 0, - # ========================================================================== -})) +print( + json.dumps( + { + # Logistics ================================================================ + "run_time_info": "T", + # Computational Domain Parameters ========================================== + # axial direction + "x_domain%beg": 0.0e00, + "x_domain%end": 6.0e-03, + # r direction + "y_domain%beg": 0.0e00, + "y_domain%end": 6.0e-03, + "cyl_coord": "F", + "m": 400, + "n": 400, + "p": 0, + "dt": 0.5e-6, + "t_step_start": 0, + "t_step_stop": 10000, # 3000 + "t_step_save": 1000, # 10 + # Simulation Algorithm Parameters ========================================== + # Only one patches are necessary, the air tube + "num_patches": 1, + # Use the 6 equation model + "model_eqns": 3, + "alt_soundspeed": "F", + "num_fluids": 2, + "mpp_lim": "T", + # Correct errors when computing speed of sound + "mixture_err": "T", + # Use TVD RK3 for time marching + "time_stepper": 3, + # Use WENO5 + "weno_order": 5, + "weno_eps": 1.0e-16, + "weno_Re_flux": "F", + "weno_avg": "T", + "avg_state": 2, + # Use the mapped WENO weights to maintain monotinicity + "mapped_weno": "T", + "null_weights": "F", + "mp_weno": "T", + # Use the HLLC Riemann solver + "riemann_solver": 2, + "wave_speeds": 1, + # We use ghost-cell extrapolation at every side + "bc_x%beg": -3, + "bc_x%end": -3, + "bc_y%beg": -3, + "bc_y%end": -3, + # Set IB to True and add 1 patch + "ib": "T", + "num_ibs": 1, + # Formatted Database Files Structure Parameters ============================ + "format": 1, + "precision": 2, + "prim_vars_wrt": "T", + "E_wrt": "T", + "parallel_io": "T", + # Patch: Constant Tube filled with air ===================================== + # Specify the cylindrical air tube grid geometry + "patch_icpp(1)%geometry": 3, + "patch_icpp(1)%x_centroid": 3.0e-03, + # Uniform medium density, centroid is at the center of the domain + "patch_icpp(1)%y_centroid": 3.0e-03, + "patch_icpp(1)%length_x": 6.0e-03, + "patch_icpp(1)%length_y": 6.0e-03, + # Specify the patch primitive variables + "patch_icpp(1)%vel(1)": 0.1e00, + "patch_icpp(1)%vel(2)": 0.0e00, + "patch_icpp(1)%pres": 1.0e00, + "patch_icpp(1)%alpha_rho(1)": 0.8e00, + "patch_icpp(1)%alpha(1)": 0.8e00, + "patch_icpp(1)%alpha_rho(2)": 0.2e00, + "patch_icpp(1)%alpha(2)": 0.2e00, + # Patch: Cylinder Immersed Boundary ======================================== + "patch_ib(1)%geometry": 2, + "patch_ib(1)%x_centroid": 1.5e-03, + "patch_ib(1)%y_centroid": 3.0e-03, + "patch_ib(1)%radius": 0.2e-03, + # Fluids Physical Parameters =============================================== + # Specify 2 fluids + "fluid_pp(1)%gamma": 1.0e00 / (gam_a - 1.0e00), # 2.50(Not 1.40) + "fluid_pp(1)%pi_inf": 0, + "fluid_pp(2)%gamma": 1.0e00 / (gam_b - 1.0e00), # 2.50(Not 1.40) + "fluid_pp(2)%pi_inf": 0, + } + ) +) diff --git a/examples/2D_ibm_steady_shock/case.py b/examples/2D_ibm_steady_shock/case.py index e9358c5d3f..391f4fab10 100644 --- a/examples/2D_ibm_steady_shock/case.py +++ b/examples/2D_ibm_steady_shock/case.py @@ -1,176 +1,161 @@ import json import math -Mu = 1.84E-05 +Mu = 1.84e-05 gam_a = 1.4 gam_b = 1.1 -x0 = 10E-06 -p0 = 101325 -rho0 = 1.0 -c0 = math.sqrt( p0/rho0 ) -patm = 1. -rhoatm = 1. +x0 = 10e-06 +p0 = 101325 +rho0 = 1.0 +c0 = math.sqrt(p0 / rho0) +patm = 1.0 +rhoatm = 1.0 -#air props -n_tait = 1.4 -B_tait = 0.0 +# air props +n_tait = 1.4 +B_tait = 0.0 -vf0 = 0.0 +vf0 = 0.0 -cact = math.sqrt(n_tait*(p0 + p0*B_tait) / ((1 - vf0) * rho0) ) -cfl = 0.3 +cact = math.sqrt(n_tait * (p0 + p0 * B_tait) / ((1 - vf0) * rho0)) +cfl = 0.3 Nx = 400 Ny = 200 -dx = 6.E-03 / (x0*float(Nx)) -dt = cfl*dx*c0/cact +dx = 6.0e-03 / (x0 * float(Nx)) +dt = cfl * dx * c0 / cact vel = 1.5 -vel_ac = vel * c0 +vel_ac = vel * c0 -Min = (n_tait + 1)*vel_ac + math.sqrt((n_tait + 1)**2 * vel_ac**2 + 16 * cact**2) +Min = (n_tait + 1) * vel_ac + math.sqrt((n_tait + 1) ** 2 * vel_ac**2 + 16 * cact**2) Min = Min / (4 * cact) -beta = (n_tait + 1) * Min**2 / (Min**2 * (n_tait - 1 + 2*vf0) + 2 * (1 - vf0)) +beta = (n_tait + 1) * Min**2 / (Min**2 * (n_tait - 1 + 2 * vf0) + 2 * (1 - vf0)) delta = (1 - vf0) + n_tait * Min**2 * (beta - 1) * (1 + B_tait) / beta vel = Min * cact * (beta - 1) / (beta * c0) # Configuring case dictionary -print(json.dumps({ - # Logistics ================================================================ - 'run_time_info' : 'F', - # ========================================================================== - - # Computational Domain Parameters ========================================== - 'x_domain%beg' : 0.0E+00, - 'x_domain%end' : 6.0E-03 / x0, - 'y_domain%beg' : 0.0E+00, - 'y_domain%end' : 3.0E-03 / x0, - 'cyl_coord' : 'F', - 'm' : Nx, - 'n' : Ny, - 'p' : 0, - 'dt' : dt, - 't_step_start' : 0, - 't_step_stop' : 1000, #3000 - 't_step_save' : 10, #10 - # ========================================================================== - - # Simulation Algorithm Parameters ========================================== - 'num_patches' : 2, - # Use the 5 equation model - 'model_eqns' : 2, - 'alt_soundspeed' : 'F', - 'num_fluids' : 1, - # No need to ensure the volume fractions sum to unity at the end of each - # time step - 'mpp_lim' : 'F', - # Correct errors when computing speed of sound - 'mixture_err' : 'T', - # Use TVD RK3 for time marching - 'time_stepper' : 3, - # Reconstruct the primitive variables to minimize spurious - # Use WENO5 - 'weno_order' : 5, - 'weno_eps' : 1.E-16, - 'weno_Re_flux' : 'F', - 'weno_avg' : 'T', - 'avg_state' : 2, - # Use the mapped WENO weights to maintain monotinicity - 'mapped_weno' : 'T', - 'null_weights' : 'F', - 'mp_weno' : 'F', - # Use the HLLC Riemann solver - 'riemann_solver' : 2, - 'wave_speeds' : 1, - 'bc_x%beg' : -7, - 'bc_x%end' : -8, - 'bc_y%beg' : -3, - 'bc_y%end' : -3, - # Set IB to True and add 1 patch - 'ib' : 'T', - 'num_ibs' : 1, - # ========================================================================== - - # Formatted Database Files Structure Parameters ============================ - # Export primitive variables in double precision with parallel - # I/O to minimize I/O computational time during large simulations - 'format' : 1, - 'precision' : 2, - 'prim_vars_wrt' :'T', - 'fd_order' : 1, - 'omega_wrt(3)' :'T', - 'parallel_io' :'T', - # ========================================================================== - - #Ambient State ===================================== - 'patch_icpp(1)%geometry' : 3, - 'patch_icpp(1)%x_centroid' : 3.0E-03 / x0, - 'patch_icpp(1)%y_centroid' : 1.50E-03 / x0, - 'patch_icpp(1)%length_x' : 6.0E-03 / x0, - 'patch_icpp(1)%length_y' : 3.0E-03 / x0, - 'patch_icpp(1)%alpha_rho(1)' : rhoatm, - 'patch_icpp(1)%alpha(1)' : 1, - 'patch_icpp(1)%vel(1)' : 0.0, - 'patch_icpp(1)%vel(2)' : 0.0E+00, - 'patch_icpp(1)%pres' : patm, - 'patch_icpp(1)%r0' : 1., - 'patch_icpp(1)%v0' : 0.0E+00, - # # ======================================================================== - - #Shocked State ===================================== - 'patch_icpp(2)%geometry' : 3, - 'patch_icpp(2)%x_centroid' : 0.5E-03 / x0, - 'patch_icpp(2)%y_centroid' : 1.50E-03 / x0, - 'patch_icpp(2)%length_x' : 1.0E-03 / x0, - 'patch_icpp(2)%length_y' : 3.0E-03 / x0, - 'patch_icpp(2)%alpha_rho(1)' : beta*rhoatm, - 'patch_icpp(2)%alpha(1)' : 1., - 'patch_icpp(2)%vel(1)' : vel, - 'patch_icpp(2)%vel(2)' : 0.0E+00, - 'patch_icpp(2)%pres' : delta*patm, - 'patch_icpp(2)%r0' : 1., - 'patch_icpp(2)%v0' : 0.0E+00, - 'patch_icpp(2)%alter_patch(1)' : 'T', - # # ======================================================================== - - - # CBC Inflow / Outflow ======================================== - 'bc_x%grcbc_in' : 'T', - 'bc_x%grcbc_out' : 'F', - 'bc_x%grcbc_vel_out' : 'F', - 'bc_x%vel_in(1)' : vel, - 'bc_x%vel_in(2)' : 0, - 'bc_x%vel_in(3)' : 0, - 'bc_x%pres_in' : delta*patm, - 'bc_x%alpha_rho_in(1)' : beta*rhoatm, - 'bc_x%alpha_in(1)' : 1, - 'bc_x%vel_out(1)' : vel, - 'bc_x%vel_out(2)' : 0, - 'bc_x%vel_out(3)' : 0, - 'bc_x%pres_out' : 1., - # # ======================================================================== - - # Patch: Cylinder Immersed Boundary ======================================== - 'patch_ib(1)%geometry' : 4, - 'patch_ib(1)%x_centroid' : 1.5E-03 / x0, - 'patch_ib(1)%y_centroid' : 1.5E-03 / x0, - 'patch_ib(1)%c' : 1.0E-03 / x0, - 'patch_ib(1)%t' : 0.15, - 'patch_ib(1)%p' : 0.4, - 'patch_ib(1)%m' : 0.02, - 'patch_ib(1)%slip' : 'F', - 'patch_ib(1)%theta' : 15, - - # Fluids Physical Parameters =============================== - # Surrounding liquid - 'fluid_pp(1)%gamma' : 1.E+00/(n_tait-1.E+00), - 'fluid_pp(1)%pi_inf' : n_tait*B_tait/(n_tait-1.), - #'fluid_pp(1)%Re(1)' : 67567, - - - # ========================================================================== -})) +print( + json.dumps( + { + # Logistics ================================================================ + "run_time_info": "F", + # Computational Domain Parameters ========================================== + "x_domain%beg": 0.0e00, + "x_domain%end": 6.0e-03 / x0, + "y_domain%beg": 0.0e00, + "y_domain%end": 3.0e-03 / x0, + "cyl_coord": "F", + "m": Nx, + "n": Ny, + "p": 0, + "dt": dt, + "t_step_start": 0, + "t_step_stop": 1000, # 3000 + "t_step_save": 10, # 10 + # Simulation Algorithm Parameters ========================================== + "num_patches": 2, + # Use the 5 equation model + "model_eqns": 2, + "alt_soundspeed": "F", + "num_fluids": 1, + # No need to ensure the volume fractions sum to unity at the end of each + # time step + "mpp_lim": "F", + # Correct errors when computing speed of sound + "mixture_err": "T", + # Use TVD RK3 for time marching + "time_stepper": 3, + # Reconstruct the primitive variables to minimize spurious + # Use WENO5 + "weno_order": 5, + "weno_eps": 1.0e-16, + "weno_Re_flux": "F", + "weno_avg": "T", + "avg_state": 2, + # Use the mapped WENO weights to maintain monotinicity + "mapped_weno": "T", + "null_weights": "F", + "mp_weno": "F", + # Use the HLLC Riemann solver + "riemann_solver": 2, + "wave_speeds": 1, + "bc_x%beg": -7, + "bc_x%end": -8, + "bc_y%beg": -3, + "bc_y%end": -3, + # Set IB to True and add 1 patch + "ib": "T", + "num_ibs": 1, + # Formatted Database Files Structure Parameters ============================ + # Export primitive variables in double precision with parallel + # I/O to minimize I/O computational time during large simulations + "format": 1, + "precision": 2, + "prim_vars_wrt": "T", + "fd_order": 1, + "omega_wrt(3)": "T", + "parallel_io": "T", + # Ambient State ===================================== + "patch_icpp(1)%geometry": 3, + "patch_icpp(1)%x_centroid": 3.0e-03 / x0, + "patch_icpp(1)%y_centroid": 1.50e-03 / x0, + "patch_icpp(1)%length_x": 6.0e-03 / x0, + "patch_icpp(1)%length_y": 3.0e-03 / x0, + "patch_icpp(1)%alpha_rho(1)": rhoatm, + "patch_icpp(1)%alpha(1)": 1, + "patch_icpp(1)%vel(1)": 0.0, + "patch_icpp(1)%vel(2)": 0.0e00, + "patch_icpp(1)%pres": patm, + "patch_icpp(1)%r0": 1.0, + "patch_icpp(1)%v0": 0.0e00, + # Shocked State ===================================== + "patch_icpp(2)%geometry": 3, + "patch_icpp(2)%x_centroid": 0.5e-03 / x0, + "patch_icpp(2)%y_centroid": 1.50e-03 / x0, + "patch_icpp(2)%length_x": 1.0e-03 / x0, + "patch_icpp(2)%length_y": 3.0e-03 / x0, + "patch_icpp(2)%alpha_rho(1)": beta * rhoatm, + "patch_icpp(2)%alpha(1)": 1.0, + "patch_icpp(2)%vel(1)": vel, + "patch_icpp(2)%vel(2)": 0.0e00, + "patch_icpp(2)%pres": delta * patm, + "patch_icpp(2)%r0": 1.0, + "patch_icpp(2)%v0": 0.0e00, + "patch_icpp(2)%alter_patch(1)": "T", + # CBC Inflow / Outflow ======================================== + "bc_x%grcbc_in": "T", + "bc_x%grcbc_out": "F", + "bc_x%grcbc_vel_out": "F", + "bc_x%vel_in(1)": vel, + "bc_x%vel_in(2)": 0, + "bc_x%vel_in(3)": 0, + "bc_x%pres_in": delta * patm, + "bc_x%alpha_rho_in(1)": beta * rhoatm, + "bc_x%alpha_in(1)": 1, + "bc_x%vel_out(1)": vel, + "bc_x%vel_out(2)": 0, + "bc_x%vel_out(3)": 0, + "bc_x%pres_out": 1.0, + # Patch: Cylinder Immersed Boundary ======================================== + "patch_ib(1)%geometry": 4, + "patch_ib(1)%x_centroid": 1.5e-03 / x0, + "patch_ib(1)%y_centroid": 1.5e-03 / x0, + "patch_ib(1)%c": 1.0e-03 / x0, + "patch_ib(1)%t": 0.15, + "patch_ib(1)%p": 0.4, + "patch_ib(1)%m": 0.02, + "patch_ib(1)%slip": "F", + "patch_ib(1)%theta": 15, + # Fluids Physical Parameters =============================== + # Surrounding liquid + "fluid_pp(1)%gamma": 1.0e00 / (n_tait - 1.0e00), + "fluid_pp(1)%pi_inf": n_tait * B_tait / (n_tait - 1.0), + #'fluid_pp(1)%Re(1)' : 67567, + } + ) +) diff --git a/examples/2D_ibm_stl_MFCCharacter/case.py b/examples/2D_ibm_stl_MFCCharacter/case.py index ca7fc40ca4..598a18d26c 100644 --- a/examples/2D_ibm_stl_MFCCharacter/case.py +++ b/examples/2D_ibm_stl_MFCCharacter/case.py @@ -1,5 +1,4 @@ #!/usr/bin/env python3 - import json import math @@ -11,84 +10,75 @@ D = 0.1 # Configuring case dictionary -print(json.dumps({ - # Logistics ================================================================ - 'run_time_info' : 'T', - # ========================================================================== - - # Computational Domain Parameters ========================================== - 'x_domain%beg' : -1*D, - 'x_domain%end' : 1*D, - 'y_domain%beg' : -0.3*D, - 'y_domain%end' : 0.3*D, - 'm' : 599, - 'n' : 199, - 'p' : 0, - 'dt' : 5.0E-7, - 't_step_start' : 0, - 't_step_stop' : 6000, - 't_step_save' : 20, - # ========================================================================== - - # Simulation Algorithm Parameters ========================================== - 'num_patches' : 1, - 'model_eqns' : 2, - 'alt_soundspeed' : 'F', - 'num_fluids' : 1, - 'time_stepper' : 3, - 'weno_order' : 5, - 'weno_eps' : 1.E-16, - 'weno_Re_flux' : 'F', - 'weno_avg' : 'F', - 'avg_state' : 2, - 'mapped_weno' : 'T', - 'null_weights' : 'F', - 'mp_weno' : 'F', - 'riemann_solver' : 2, - 'wave_speeds' : 1, - 'viscous' : 'T', - 'bc_x%beg' : -3, - 'bc_x%end' : -3, - 'bc_y%beg' : -3, - 'bc_y%end' : -3, - 'ib' : 'T', - 'num_ibs' : 1, - # ========================================================================== - - # Formatted Database Files Structure Parameters ============================ - # Export primitive variables in double precision with parallel - # I/O to minimize I/O computational time during large simulations - 'format' : 1, - 'precision' : 2, - 'prim_vars_wrt' :'T', - 'parallel_io' :'T', - # ========================================================================== - - # Patch: Middle ============================================================ - 'patch_icpp(1)%geometry' : 3, - 'patch_icpp(1)%x_centroid' : 0, - 'patch_icpp(1)%y_centroid' : 0, - 'patch_icpp(1)%length_x' : 1000*D, - 'patch_icpp(1)%length_y' : 1000*D, - 'patch_icpp(1)%vel(1)' : 20, - 'patch_icpp(1)%vel(2)' : 0.0E+00, - 'patch_icpp(1)%pres' : 100000, - 'patch_icpp(1)%alpha_rho(1)' : (1.0)*rho1, - 'patch_icpp(1)%alpha(1)' : 1.0, - # ========================================================================== - 'patch_ib(1)%geometry' : 5, - 'patch_ib(1)%model_filepath' : 'Character_IBM.stl', - 'patch_ib(1)%model_translate(1)' : -0.0469828735, - 'patch_ib(1)%model_translate(2)' : -0.0094892600, - 'patch_ib(1)%model_spc' : 200, - 'patch_ib(1)%model_threshold' : 0.99, - 'patch_ib(1)%slip' : 'F', - # # ======================================================================== - - # Fluids Physical Parameters =============================================== - 'fluid_pp(1)%gamma' : 1.E+00/(gam_a-1.E+00), - 'fluid_pp(1)%pi_inf' : 0, - 'fluid_pp(1)%Re(1)' : 10000, - # ========================================================================== -})) - +print( + json.dumps( + { + # Logistics ================================================================ + "run_time_info": "T", + # Computational Domain Parameters ========================================== + "x_domain%beg": -1 * D, + "x_domain%end": 1 * D, + "y_domain%beg": -0.3 * D, + "y_domain%end": 0.3 * D, + "m": 599, + "n": 199, + "p": 0, + "dt": 5.0e-7, + "t_step_start": 0, + "t_step_stop": 6000, + "t_step_save": 20, + # Simulation Algorithm Parameters ========================================== + "num_patches": 1, + "model_eqns": 2, + "alt_soundspeed": "F", + "num_fluids": 1, + "time_stepper": 3, + "weno_order": 5, + "weno_eps": 1.0e-16, + "weno_Re_flux": "F", + "weno_avg": "F", + "avg_state": 2, + "mapped_weno": "T", + "null_weights": "F", + "mp_weno": "F", + "riemann_solver": 2, + "wave_speeds": 1, + "viscous": "T", + "bc_x%beg": -3, + "bc_x%end": -3, + "bc_y%beg": -3, + "bc_y%end": -3, + "ib": "T", + "num_ibs": 1, + # Formatted Database Files Structure Parameters ============================ + # Export primitive variables in double precision with parallel + # I/O to minimize I/O computational time during large simulations + "format": 1, + "precision": 2, + "prim_vars_wrt": "T", + "parallel_io": "T", + # Patch: Middle ============================================================ + "patch_icpp(1)%geometry": 3, + "patch_icpp(1)%x_centroid": 0, + "patch_icpp(1)%y_centroid": 0, + "patch_icpp(1)%length_x": 1000 * D, + "patch_icpp(1)%length_y": 1000 * D, + "patch_icpp(1)%vel(1)": 20, + "patch_icpp(1)%vel(2)": 0.0e00, + "patch_icpp(1)%pres": 100000, + "patch_icpp(1)%alpha_rho(1)": (1.0) * rho1, + "patch_icpp(1)%alpha(1)": 1.0, + "patch_ib(1)%geometry": 5, + "patch_ib(1)%model_filepath": "Character_IBM.stl", + "patch_ib(1)%model_translate(1)": -0.0469828735, + "patch_ib(1)%model_translate(2)": -0.0094892600, + "patch_ib(1)%model_spc": 200, + "patch_ib(1)%model_threshold": 0.99, + "patch_ib(1)%slip": "F", + # Fluids Physical Parameters =============================================== + "fluid_pp(1)%gamma": 1.0e00 / (gam_a - 1.0e00), + "fluid_pp(1)%pi_inf": 0, + "fluid_pp(1)%Re(1)": 10000, + } + ) +) diff --git a/examples/2D_ibm_stl_test/case.py b/examples/2D_ibm_stl_test/case.py index 2defd13c1c..0242e0c5a6 100644 --- a/examples/2D_ibm_stl_test/case.py +++ b/examples/2D_ibm_stl_test/case.py @@ -1,94 +1,84 @@ #!/usr/bin/env python3 - import json import math # Dynamic Viscosity Mu1 = 0.0000184 -#Mu2 = 0.01 -rho1 = 1.19 #0.2199 +# Mu2 = 0.01 +rho1 = 1.19 # 0.2199 gam_a = 1.4 # Patch Design D = 5 # Configuring case dictionary -print(json.dumps({ - # Logistics ================================================================ - 'run_time_info' : 'T', - # ========================================================================== - - # Computational Domain Parameters ========================================== - 'x_domain%beg' : -6*D, - 'x_domain%end' : 6*D, - 'y_domain%beg' : -3*D, - 'y_domain%end' : 3*D, - 'm' : 159, - 'n' : 79, - 'p' : 0, - 'dt' : 1.0E-9, - 't_step_start' : 0, - 't_step_stop' : 3000, - 't_step_save' : 30, - # ========================================================================== - - # Simulation Algorithm Parameters ========================================== - 'num_patches' : 1, - 'model_eqns' : 2, - 'alt_soundspeed' : 'F', - 'num_fluids' : 1, - 'time_stepper' : 3, - 'weno_order' : 5, - 'weno_eps' : 1.E-16, - 'weno_Re_flux' : 'F', - 'weno_avg' : 'F', - 'avg_state' : 2, - 'mapped_weno' : 'T', - 'null_weights' : 'F', - 'mp_weno' : 'F', - 'riemann_solver' : 2, - 'wave_speeds' : 1, - 'viscous' : 'F', - 'bc_x%beg' : -3, - 'bc_x%end' : -3, - 'bc_y%beg' : -3, - 'bc_y%end' : -3, - 'ib' : 'T', - 'num_ibs' : 1, - # ========================================================================== - - # Formatted Database Files Structure Parameters ============================ - # Export primitive variables in double precision with parallel - # I/O to minimize I/O computational time during large simulations - 'format' : 1, - 'precision' : 2, - 'prim_vars_wrt' :'T', - 'parallel_io' :'T', - # ========================================================================== - - # Patch: Middle ============================================================ - 'patch_icpp(1)%geometry' : 3, - 'patch_icpp(1)%x_centroid' : 0, - 'patch_icpp(1)%y_centroid' : 0, - 'patch_icpp(1)%length_x' : 1000*D, - 'patch_icpp(1)%length_y' : 1000*D, - 'patch_icpp(1)%vel(1)' : 0.001, - 'patch_icpp(1)%vel(2)' : 0.0E+00, - 'patch_icpp(1)%pres' : 100000, - 'patch_icpp(1)%alpha_rho(1)' : (1.0)*rho1, - 'patch_icpp(1)%alpha(1)' : 1.0, - # ========================================================================== - 'patch_ib(1)%geometry' : 5, - 'patch_ib(1)%model_filepath' : "Circle_IBM.stl", - 'patch_ib(1)%model_translate(1)' : -0.05, - 'patch_ib(1)%model_translate(2)' : -0.05, - 'patch_ib(1)%model_spc' : 100, - 'patch_ib(1)%model_threshold' : 0.95, - 'patch_ib(1)%slip' : 'F', - # # ======================================================================== - - # Fluids Physical Parameters =============================================== - 'fluid_pp(1)%gamma' : 1.E+00/(gam_a-1.E+00), - 'fluid_pp(1)%pi_inf' : 0, - # ========================================================================== -})) - +print( + json.dumps( + { + # Logistics ================================================================ + "run_time_info": "T", + # Computational Domain Parameters ========================================== + "x_domain%beg": -6 * D, + "x_domain%end": 6 * D, + "y_domain%beg": -3 * D, + "y_domain%end": 3 * D, + "m": 159, + "n": 79, + "p": 0, + "dt": 1.0e-9, + "t_step_start": 0, + "t_step_stop": 3000, + "t_step_save": 30, + # Simulation Algorithm Parameters ========================================== + "num_patches": 1, + "model_eqns": 2, + "alt_soundspeed": "F", + "num_fluids": 1, + "time_stepper": 3, + "weno_order": 5, + "weno_eps": 1.0e-16, + "weno_Re_flux": "F", + "weno_avg": "F", + "avg_state": 2, + "mapped_weno": "T", + "null_weights": "F", + "mp_weno": "F", + "riemann_solver": 2, + "wave_speeds": 1, + "viscous": "F", + "bc_x%beg": -3, + "bc_x%end": -3, + "bc_y%beg": -3, + "bc_y%end": -3, + "ib": "T", + "num_ibs": 1, + # Formatted Database Files Structure Parameters ============================ + # Export primitive variables in double precision with parallel + # I/O to minimize I/O computational time during large simulations + "format": 1, + "precision": 2, + "prim_vars_wrt": "T", + "parallel_io": "T", + # Patch: Middle ============================================================ + "patch_icpp(1)%geometry": 3, + "patch_icpp(1)%x_centroid": 0, + "patch_icpp(1)%y_centroid": 0, + "patch_icpp(1)%length_x": 1000 * D, + "patch_icpp(1)%length_y": 1000 * D, + "patch_icpp(1)%vel(1)": 0.001, + "patch_icpp(1)%vel(2)": 0.0e00, + "patch_icpp(1)%pres": 100000, + "patch_icpp(1)%alpha_rho(1)": (1.0) * rho1, + "patch_icpp(1)%alpha(1)": 1.0, + "patch_ib(1)%geometry": 5, + "patch_ib(1)%model_filepath": "Circle_IBM.stl", + "patch_ib(1)%model_translate(1)": -0.05, + "patch_ib(1)%model_translate(2)": -0.05, + "patch_ib(1)%model_spc": 100, + "patch_ib(1)%model_threshold": 0.95, + "patch_ib(1)%slip": "F", + # Fluids Physical Parameters =============================================== + "fluid_pp(1)%gamma": 1.0e00 / (gam_a - 1.0e00), + "fluid_pp(1)%pi_inf": 0, + } + ) +) diff --git a/examples/2D_ibm_stl_wedge/case.py b/examples/2D_ibm_stl_wedge/case.py index 6d597b8a87..106a22b045 100644 --- a/examples/2D_ibm_stl_wedge/case.py +++ b/examples/2D_ibm_stl_wedge/case.py @@ -1,95 +1,85 @@ #!/usr/bin/env python3 - import json import math # Dynamic Viscosity Mu1 = 0.0000184 -#Mu2 = 0.01 -rho1 = 1.19 #0.2199 +# Mu2 = 0.01 +rho1 = 1.19 # 0.2199 gam_a = 1.4 # Patch Design D = 0.1 # Configuring case dictionary -print(json.dumps({ - # Logistics ================================================================ - 'run_time_info' : 'T', - # ========================================================================== - - # Computational Domain Parameters ========================================== - 'x_domain%beg' : -3*D, - 'x_domain%end' : 3*D, - 'y_domain%beg' : -1.5*D, - 'y_domain%end' : 1.5*D, - 'm' : 399, - 'n' : 199, - 'p' : 0, - 'dt' : 1.0E-6, - 't_step_start' : 0, - 't_step_stop' : 1000, - 't_step_save' : 10, - # ========================================================================== - - # Simulation Algorithm Parameters ========================================== - 'num_patches' : 1, - 'model_eqns' : 2, - 'alt_soundspeed' : 'F', - 'num_fluids' : 1, - 'time_stepper' : 3, - 'weno_order' : 5, - 'weno_eps' : 1.E-16, - 'weno_Re_flux' : 'F', - 'weno_avg' : 'F', - 'avg_state' : 2, - 'mapped_weno' : 'T', - 'null_weights' : 'F', - 'mp_weno' : 'F', - 'riemann_solver' : 2, - 'wave_speeds' : 1, - 'viscous' : 'T', - 'bc_x%beg' : -3, - 'bc_x%end' : -3, - 'bc_y%beg' : -3, - 'bc_y%end' : -3, - 'ib' : 'T', - 'num_ibs' : 1, - # ========================================================================== - - # Formatted Database Files Structure Parameters ============================ - # Export primitive variables in double precision with parallel - # I/O to minimize I/O computational time during large simulations - 'format' : 1, - 'precision' : 2, - 'prim_vars_wrt' :'T', - 'parallel_io' :'T', - # ========================================================================== - - # Patch: Middle ============================================================ - 'patch_icpp(1)%geometry' : 3, - 'patch_icpp(1)%x_centroid' : 0, - 'patch_icpp(1)%y_centroid' : 0, - 'patch_icpp(1)%length_x' : 1000*D, - 'patch_icpp(1)%length_y' : 1000*D, - 'patch_icpp(1)%vel(1)' : 527.2E+00, - 'patch_icpp(1)%vel(2)' : 0.0E+00, - 'patch_icpp(1)%pres' : 10918.2549, - 'patch_icpp(1)%alpha_rho(1)' : (1.0)*rho1, - 'patch_icpp(1)%alpha(1)' : 1.0, - # ========================================================================== - 'patch_ib(1)%geometry' : 5, - 'patch_ib(1)%model_filepath' : 'Wedge2D_IBM.stl', - 'patch_ib(1)%model_translate(1)' : -0.0500000000, - 'patch_ib(1)%model_translate(2)' : -0.0373970250, - 'patch_ib(1)%model_spc' : 200, - 'patch_ib(1)%model_threshold' : 0.95, - 'patch_ib(1)%slip' : 'F', - # # ======================================================================== - - # Fluids Physical Parameters =============================================== - 'fluid_pp(1)%gamma' : 1.E+00/(gam_a-1.E+00), - 'fluid_pp(1)%pi_inf' : 0, - 'fluid_pp(1)%Re(1)' : 7535533.2, - # ========================================================================== -})) - +print( + json.dumps( + { + # Logistics ================================================================ + "run_time_info": "T", + # Computational Domain Parameters ========================================== + "x_domain%beg": -3 * D, + "x_domain%end": 3 * D, + "y_domain%beg": -1.5 * D, + "y_domain%end": 1.5 * D, + "m": 399, + "n": 199, + "p": 0, + "dt": 1.0e-6, + "t_step_start": 0, + "t_step_stop": 1000, + "t_step_save": 10, + # Simulation Algorithm Parameters ========================================== + "num_patches": 1, + "model_eqns": 2, + "alt_soundspeed": "F", + "num_fluids": 1, + "time_stepper": 3, + "weno_order": 5, + "weno_eps": 1.0e-16, + "weno_Re_flux": "F", + "weno_avg": "F", + "avg_state": 2, + "mapped_weno": "T", + "null_weights": "F", + "mp_weno": "F", + "riemann_solver": 2, + "wave_speeds": 1, + "viscous": "T", + "bc_x%beg": -3, + "bc_x%end": -3, + "bc_y%beg": -3, + "bc_y%end": -3, + "ib": "T", + "num_ibs": 1, + # Formatted Database Files Structure Parameters ============================ + # Export primitive variables in double precision with parallel + # I/O to minimize I/O computational time during large simulations + "format": 1, + "precision": 2, + "prim_vars_wrt": "T", + "parallel_io": "T", + # Patch: Middle ============================================================ + "patch_icpp(1)%geometry": 3, + "patch_icpp(1)%x_centroid": 0, + "patch_icpp(1)%y_centroid": 0, + "patch_icpp(1)%length_x": 1000 * D, + "patch_icpp(1)%length_y": 1000 * D, + "patch_icpp(1)%vel(1)": 527.2e00, + "patch_icpp(1)%vel(2)": 0.0e00, + "patch_icpp(1)%pres": 10918.2549, + "patch_icpp(1)%alpha_rho(1)": (1.0) * rho1, + "patch_icpp(1)%alpha(1)": 1.0, + "patch_ib(1)%geometry": 5, + "patch_ib(1)%model_filepath": "Wedge2D_IBM.stl", + "patch_ib(1)%model_translate(1)": -0.0500000000, + "patch_ib(1)%model_translate(2)": -0.0373970250, + "patch_ib(1)%model_spc": 200, + "patch_ib(1)%model_threshold": 0.95, + "patch_ib(1)%slip": "F", + # Fluids Physical Parameters =============================================== + "fluid_pp(1)%gamma": 1.0e00 / (gam_a - 1.0e00), + "fluid_pp(1)%pi_inf": 0, + "fluid_pp(1)%Re(1)": 7535533.2, + } + ) +) diff --git a/examples/2D_isentropicvortex/case.py b/examples/2D_isentropicvortex/case.py index b304b15fa9..e0628ce6e2 100644 --- a/examples/2D_isentropicvortex/case.py +++ b/examples/2D_isentropicvortex/case.py @@ -2,120 +2,113 @@ import json # Parameters -epsilon = '5d0' -alpha = '1d0' -gamma = '1.4' +epsilon = "5d0" +alpha = "1d0" +gamma = "1.4" # Initial conditions -vel1_i = '0d0' -vel2_i = '0d0' -T_i = '1d0' -alpha_rho1_i = '1d0' -pres_i = '1d0' +vel1_i = "0d0" +vel2_i = "0d0" +T_i = "1d0" +alpha_rho1_i = "1d0" +pres_i = "1d0" # Perturbations -vel1 = f'{vel1_i} + (y - yc)*({epsilon}/(2d0*pi))*' + \ - f'exp({alpha}*(1d0 - (x - xc)**2d0 - (y - yc)**2d0))' -vel2 = f'{vel2_i} - (x - xc)*({epsilon}/(2d0*pi))*' + \ - f'exp({alpha}*(1d0 - (x - xc)**2d0 - (y - yc)**2d0))' -alpha_rho1 = f'{alpha_rho1_i}*(1d0 - ({alpha_rho1_i}/{pres_i})*({epsilon}/(2d0*pi))*' + \ - f'({epsilon}/(8d0*{alpha}*({gamma} + 1d0)*pi))*' + \ - f'exp(2d0*{alpha}*(1d0 - (x - xc)**2d0' + \ - f'- (y - yc)**2d0))' + \ - f')**{gamma}' -pres = f'{pres_i}*(1d0 - ({alpha_rho1_i}/{pres_i})*({epsilon}/(2d0*pi))*' + \ - f'({epsilon}/(8d0*{alpha}*({gamma} + 1d0)*pi))*' + \ - f'exp(2d0*{alpha}*(1d0 - (x - xc)**2d0' + \ - f'- (y - yc)**2d0))' + \ - f')**({gamma} + 1d0)' +vel1 = f"{vel1_i} + (y - yc)*({epsilon}/(2d0*pi))*" + f"exp({alpha}*(1d0 - (x - xc)**2d0 - (y - yc)**2d0))" +vel2 = f"{vel2_i} - (x - xc)*({epsilon}/(2d0*pi))*" + f"exp({alpha}*(1d0 - (x - xc)**2d0 - (y - yc)**2d0))" +alpha_rho1 = ( + f"{alpha_rho1_i}*(1d0 - ({alpha_rho1_i}/{pres_i})*({epsilon}/(2d0*pi))*" + + f"({epsilon}/(8d0*{alpha}*({gamma} + 1d0)*pi))*" + + f"exp(2d0*{alpha}*(1d0 - (x - xc)**2d0" + + f"- (y - yc)**2d0))" + + f")**{gamma}" +) +pres = ( + f"{pres_i}*(1d0 - ({alpha_rho1_i}/{pres_i})*({epsilon}/(2d0*pi))*" + + f"({epsilon}/(8d0*{alpha}*({gamma} + 1d0)*pi))*" + + f"exp(2d0*{alpha}*(1d0 - (x - xc)**2d0" + + f"- (y - yc)**2d0))" + + f")**({gamma} + 1d0)" +) # Numerical setup Nx = 399 -dx = 10./(1.*(Nx+1)) +dx = 10.0 / (1.0 * (Nx + 1)) c = 1.4**0.5 C = 0.3 mydt = C * dx / c * 0.01 -Nt = 1/mydt +Nt = 1 / mydt # Configuring case dictionary -print(json.dumps({ - # Logistics ================================================================ - 'run_time_info' : 'T', - # ========================================================================== - - # Computational Domain Parameters ========================================== - 'x_domain%beg' : -3, - 'x_domain%end' : 3, - 'y_domain%beg' : -3, - 'y_domain%end' : 3, - 'stretch_x' : 'T', - 'stretch_y' : 'T', - 'loops_x' : 2, - 'loops_y' : 2, - 'a_x' : 1.03, - 'a_y' : 1.03, - 'x_a' : -1.5, - 'y_a' : -1.5, - 'x_b' : 1.5, - 'y_b' : 1.5, - 'm' : Nx, - 'n' : Nx, - 'p' : 0, - 'dt' : mydt, - 't_step_start' : 0, - 't_step_stop' : 10, - 't_step_save' : 1, - # ========================================================================== - - # Simulation Algorithm Parameters ========================================== - 'num_patches' : 1, - 'model_eqns' : 3, - 'alt_soundspeed' : 'F', - 'num_fluids' : 1, - 'mpp_lim' : 'F', - 'mixture_err' : 'F', - 'time_stepper' : 3, - 'weno_order' : 5, - 'weno_eps' : 1.E-16, - 'mapped_weno' : 'T', - 'null_weights' : 'F', - 'mp_weno' : 'F', - 'riemann_solver' : 2, - 'wave_speeds' : 1, - 'avg_state' : 2, - 'bc_x%beg' : -4, - 'bc_x%end' : -4, - 'bc_y%beg' : -4, - 'bc_y%end' : -4, - # ========================================================================== - - # Formatted Database Files Structure Parameters ============================ - 'format' : 1, - 'precision' : 2, - 'prim_vars_wrt' :'T', - 'parallel_io' :'F', - 'omega_wrt(3)' :'T', - 'fd_order' : 2, - # ========================================================================== - - # Patch 1 ================================================================== - 'patch_icpp(1)%geometry' : 3, - 'patch_icpp(1)%x_centroid' : 0, - 'patch_icpp(1)%y_centroid' : 0, - 'patch_icpp(1)%length_x' : 10., - 'patch_icpp(1)%length_y' : 10., - 'patch_icpp(1)%vel(1)' : vel1, - 'patch_icpp(1)%vel(2)' : vel2, - 'patch_icpp(1)%pres' : pres, - 'patch_icpp(1)%alpha_rho(1)' : alpha_rho1, - 'patch_icpp(1)%alpha(1)' : 1., - # ========================================================================== - - # Fluids Physical Parameters =============================================== - 'fluid_pp(1)%gamma' : 1.E+00/(1.4-1.E+00), - 'fluid_pp(1)%pi_inf' : 0.0, - # ========================================================================== -})) - -# ============================================================================== +print( + json.dumps( + { + # Logistics ================================================================ + "run_time_info": "T", + # Computational Domain Parameters ========================================== + "x_domain%beg": -3, + "x_domain%end": 3, + "y_domain%beg": -3, + "y_domain%end": 3, + "stretch_x": "T", + "stretch_y": "T", + "loops_x": 2, + "loops_y": 2, + "a_x": 1.03, + "a_y": 1.03, + "x_a": -1.5, + "y_a": -1.5, + "x_b": 1.5, + "y_b": 1.5, + "m": Nx, + "n": Nx, + "p": 0, + "dt": mydt, + "t_step_start": 0, + "t_step_stop": 10, + "t_step_save": 1, + # Simulation Algorithm Parameters ========================================== + "num_patches": 1, + "model_eqns": 3, + "alt_soundspeed": "F", + "num_fluids": 1, + "mpp_lim": "F", + "mixture_err": "F", + "time_stepper": 3, + "weno_order": 5, + "weno_eps": 1.0e-16, + "mapped_weno": "T", + "null_weights": "F", + "mp_weno": "F", + "riemann_solver": 2, + "wave_speeds": 1, + "avg_state": 2, + "bc_x%beg": -4, + "bc_x%end": -4, + "bc_y%beg": -4, + "bc_y%end": -4, + # Formatted Database Files Structure Parameters ============================ + "format": 1, + "precision": 2, + "prim_vars_wrt": "T", + "parallel_io": "F", + "omega_wrt(3)": "T", + "fd_order": 2, + # Patch 1 ================================================================== + "patch_icpp(1)%geometry": 3, + "patch_icpp(1)%x_centroid": 0, + "patch_icpp(1)%y_centroid": 0, + "patch_icpp(1)%length_x": 10.0, + "patch_icpp(1)%length_y": 10.0, + "patch_icpp(1)%vel(1)": vel1, + "patch_icpp(1)%vel(2)": vel2, + "patch_icpp(1)%pres": pres, + "patch_icpp(1)%alpha_rho(1)": alpha_rho1, + "patch_icpp(1)%alpha(1)": 1.0, + # Fluids Physical Parameters =============================================== + "fluid_pp(1)%gamma": 1.0e00 / (1.4 - 1.0e00), + "fluid_pp(1)%pi_inf": 0.0, + } + ) +) diff --git a/examples/2D_laplace_pressure_jump/case.py b/examples/2D_laplace_pressure_jump/case.py index 97217708d7..0bcfba3938 100644 --- a/examples/2D_laplace_pressure_jump/case.py +++ b/examples/2D_laplace_pressure_jump/case.py @@ -1,5 +1,4 @@ #!/usr/bin/env python3 - # This case file demonstrates the Laplace pressure jump of a water droplet in air. The laplace pressure jump # in 2D is given by delta = sigma / r where delta is the pressure jump, sigma is the surface tension coefficient, # and r is the radius of the droplet. The results of this simulation agree with theory to well within 1% @@ -24,109 +23,92 @@ mydt = 5e-6 -#Configuration case dictionary +# Configuration case dictionary data = { # Logistics ============================= - 'run_time_info' : 'T', - # ======================================= - + "run_time_info": "T", # Computational Domain ================== - 'x_domain%beg' : x0, - 'x_domain%end' : x1, - 'y_domain%beg' : y0, - 'y_domain%end' : y1, - 'm' : Nx, - 'n' : Ny, - 'p' : 0, - 'cyl_coord' : 'F', - 'dt' : mydt, - 't_step_start' : 0, - 't_step_stop' : 100000, - 't_step_save' : 1000, - # ======================================= - + "x_domain%beg": x0, + "x_domain%end": x1, + "y_domain%beg": y0, + "y_domain%end": y1, + "m": Nx, + "n": Ny, + "p": 0, + "cyl_coord": "F", + "dt": mydt, + "t_step_start": 0, + "t_step_stop": 100000, + "t_step_save": 1000, # Simulation Algorithm ================== - 'model_eqns' : 3, - 'alt_soundspeed' : 'F', - 'mixture_err' : 'T', - 'mpp_lim' : 'F', - 'time_stepper' : 3, - 'weno_order' : 5, - 'avg_state' : 2, - 'weno_eps' : 1e-16, - 'mapped_weno' : 'T', - 'null_weights' : 'F', - 'mp_weno' : 'T', - 'weno_Re_flux' : 'F', - 'riemann_solver' : 2, - 'wave_speeds' : 1, - 'bc_x%beg' : -2, - 'bc_x%end' : -3, - 'bc_y%beg' : -2, - 'bc_y%end' : -3, - 'num_patches' : 2, - 'num_fluids' : 2, - 'weno_avg' : 'T', - 'surface_tension' : 'T', - # ======================================= - + "model_eqns": 3, + "alt_soundspeed": "F", + "mixture_err": "T", + "mpp_lim": "F", + "time_stepper": 3, + "weno_order": 5, + "avg_state": 2, + "weno_eps": 1e-16, + "mapped_weno": "T", + "null_weights": "F", + "mp_weno": "T", + "weno_Re_flux": "F", + "riemann_solver": 2, + "wave_speeds": 1, + "bc_x%beg": -2, + "bc_x%end": -3, + "bc_y%beg": -2, + "bc_y%end": -3, + "num_patches": 2, + "num_fluids": 2, + "weno_avg": "T", + "surface_tension": "T", # Database Structure Parameters ========= - 'format' : 1, - 'precision' : 2, - 'prim_vars_wrt' : 'T', - 'cons_vars_wrt' : 'T', - 'cf_wrt' : 'T', - 'parallel_io' : 'T', - # ======================================= - - 'sigma' : 8, - + "format": 1, + "precision": 2, + "prim_vars_wrt": "T", + "cons_vars_wrt": "T", + "cf_wrt": "T", + "parallel_io": "T", + "sigma": 8, # Fluid Parameters (Water) ============== - 'fluid_pp(1)%gamma' : 1.E+00/(2.1E+00-1.E+00), - 'fluid_pp(1)%pi_inf' : 2.1E+00*1.E+06/(2.1E+00-1.E+00), - # ======================================= - + "fluid_pp(1)%gamma": 1.0e00 / (2.1e00 - 1.0e00), + "fluid_pp(1)%pi_inf": 2.1e00 * 1.0e06 / (2.1e00 - 1.0e00), # Fluid Parameters (Gas) ================ - 'fluid_pp(2)%gamma' : 1.E+00/(1.4E+00-1.E+00), - 'fluid_pp(2)%pi_inf' : 0.E+00, - # ======================================= - + "fluid_pp(2)%gamma": 1.0e00 / (1.4e00 - 1.0e00), + "fluid_pp(2)%pi_inf": 0.0e00, # Air Patch ========================== - 'patch_icpp(1)%geometry' : 3, - 'patch_icpp(1)%x_centroid' : 0, - 'patch_icpp(1)%y_centroid' : 0, - 'patch_icpp(1)%length_x' : 2, - 'patch_icpp(1)%length_y' : 2, - 'patch_icpp(1)%vel(1)' : 0.0, - 'patch_icpp(1)%vel(2)' : 0.0, - 'patch_icpp(1)%vel(3)' : 0.0, - 'patch_icpp(1)%pres' : 100000, - 'patch_icpp(1)%alpha_rho(1)': eps*1000, - 'patch_icpp(1)%alpha_rho(2)': (1-eps)*1, - 'patch_icpp(1)%alpha(1)' : eps, - 'patch_icpp(1)%alpha(2)' : 1-eps, - 'patch_icpp(1)%cf_val' : 0, - # ====================================== - + "patch_icpp(1)%geometry": 3, + "patch_icpp(1)%x_centroid": 0, + "patch_icpp(1)%y_centroid": 0, + "patch_icpp(1)%length_x": 2, + "patch_icpp(1)%length_y": 2, + "patch_icpp(1)%vel(1)": 0.0, + "patch_icpp(1)%vel(2)": 0.0, + "patch_icpp(1)%vel(3)": 0.0, + "patch_icpp(1)%pres": 100000, + "patch_icpp(1)%alpha_rho(1)": eps * 1000, + "patch_icpp(1)%alpha_rho(2)": (1 - eps) * 1, + "patch_icpp(1)%alpha(1)": eps, + "patch_icpp(1)%alpha(2)": 1 - eps, + "patch_icpp(1)%cf_val": 0, # Water Patch ======================== - 'patch_icpp(2)%alter_patch(1)' : 'T', - 'patch_icpp(2)%smoothen' : 'T', - 'patch_icpp(2)%smooth_patch_id': 1, - 'patch_icpp(2)%smooth_coeff': 0.95, - 'patch_icpp(2)%geometry' : 2, - 'patch_icpp(2)%x_centroid' : 0, - 'patch_icpp(2)%y_centroid' : 0, - 'patch_icpp(2)%radius' : r0, - 'patch_icpp(2)%vel(1)' : 0., - 'patch_icpp(2)%vel(2)' : 0., - 'patch_icpp(2)%pres' : 100000, - 'patch_icpp(2)%alpha_rho(1)': (1-eps)*1000, - 'patch_icpp(2)%alpha_rho(2)': eps*1, - 'patch_icpp(2)%alpha(1)' : (1-eps), - 'patch_icpp(2)%alpha(2)' : eps, - 'patch_icpp(2)%cf_val' : 1, - # ====================================== - + "patch_icpp(2)%alter_patch(1)": "T", + "patch_icpp(2)%smoothen": "T", + "patch_icpp(2)%smooth_patch_id": 1, + "patch_icpp(2)%smooth_coeff": 0.95, + "patch_icpp(2)%geometry": 2, + "patch_icpp(2)%x_centroid": 0, + "patch_icpp(2)%y_centroid": 0, + "patch_icpp(2)%radius": r0, + "patch_icpp(2)%vel(1)": 0.0, + "patch_icpp(2)%vel(2)": 0.0, + "patch_icpp(2)%pres": 100000, + "patch_icpp(2)%alpha_rho(1)": (1 - eps) * 1000, + "patch_icpp(2)%alpha_rho(2)": eps * 1, + "patch_icpp(2)%alpha(1)": (1 - eps), + "patch_icpp(2)%alpha(2)": eps, + "patch_icpp(2)%cf_val": 1, } print(json.dumps(data)) diff --git a/examples/2D_lid_driven_cavity/case.py b/examples/2D_lid_driven_cavity/case.py index f206396beb..9836fc90cd 100644 --- a/examples/2D_lid_driven_cavity/case.py +++ b/examples/2D_lid_driven_cavity/case.py @@ -1,83 +1,75 @@ #!/usr/bin/env python3 - import json + eps = 1e-6 # Configuring case dictionary -print(json.dumps({ - # Logistics ================================================ - 'run_time_info' : 'T', - # ========================================================== - - # Computational Domain Parameters ========================== - 'x_domain%beg' : 0., - 'x_domain%end' : 1., - 'y_domain%beg' : 0., - 'y_domain%end' : 1., - 'm' : 999, - 'n' : 999, - 'p' : 0, - 'dt' : 1.25E-04, - 't_step_start' : 0, - 't_step_stop' : 1600000, - 't_step_save' : 8000, - # ========================================================== - - # Simulation Algorithm Parameters ========================== - 'num_patches' : 1, - 'model_eqns' : 2, - 'alt_soundspeed' : 'F', - 'num_fluids' : 2, - 'mpp_lim' : 'F', - 'mixture_err' : 'T', - 'time_stepper' : 3, - 'weno_order' : 5, - 'weno_eps' : 1e-16, - 'mapped_weno' : 'T', - 'weno_Re_flux' : 'T', - 'mp_weno' : 'T', - 'weno_avg' : 'T', - 'riemann_solver' : 2, - 'wave_speeds' : 1, - 'avg_state' : 2, - 'bc_x%beg' : -16, - 'bc_x%end' : -16, - 'bc_y%beg' : -16, - 'bc_y%end' : -16, - 'bc_y%ve1' : 0.5, - 'viscous' : 'T', - # ========================================================== - - # Formatted Database Files Structure Parameters ============ - 'format' : 1, - 'precision' : 2, - 'prim_vars_wrt' :'T', - 'omega_wrt(3)' :'T', - 'fd_order' : 4, - 'parallel_io' :'T', - # ========================================================== - - # Patch 1: Base ============================================ - 'patch_icpp(1)%geometry' : 3, - 'patch_icpp(1)%x_centroid' : 0.5, - 'patch_icpp(1)%y_centroid' : 0.5, - 'patch_icpp(1)%length_x' : 1., - 'patch_icpp(1)%length_y' : 1., - 'patch_icpp(1)%vel(1)' : 0, - 'patch_icpp(1)%vel(2)' : 0., - 'patch_icpp(1)%pres' : 5, - 'patch_icpp(1)%alpha_rho(1)' : 0.5, - 'patch_icpp(1)%alpha(1)' : 0.5, - 'patch_icpp(1)%alpha_rho(2)' : 0.5, - 'patch_icpp(1)%alpha(2)' : 0.5, - # ========================================================== - - # Fluids Physical Parameters =============================== - 'fluid_pp(1)%gamma' : 1./(1.4-1.), - 'fluid_pp(1)%pi_inf' : 0., - 'fluid_pp(1)%Re(1)' : 1e4, - 'fluid_pp(2)%gamma' : 1./(1.4-1.), - 'fluid_pp(2)%pi_inf' : 0., - 'fluid_pp(2)%Re(1)' : 1e4, - # ========================================================== -})) -# ============================================================================== +print( + json.dumps( + { + # Logistics ================================================ + "run_time_info": "T", + # Computational Domain Parameters ========================== + "x_domain%beg": 0.0, + "x_domain%end": 1.0, + "y_domain%beg": 0.0, + "y_domain%end": 1.0, + "m": 999, + "n": 999, + "p": 0, + "dt": 1.25e-04, + "t_step_start": 0, + "t_step_stop": 1600000, + "t_step_save": 8000, + # Simulation Algorithm Parameters ========================== + "num_patches": 1, + "model_eqns": 2, + "alt_soundspeed": "F", + "num_fluids": 2, + "mpp_lim": "F", + "mixture_err": "T", + "time_stepper": 3, + "weno_order": 5, + "weno_eps": 1e-16, + "mapped_weno": "T", + "weno_Re_flux": "T", + "mp_weno": "T", + "weno_avg": "T", + "riemann_solver": 2, + "wave_speeds": 1, + "avg_state": 2, + "bc_x%beg": -16, + "bc_x%end": -16, + "bc_y%beg": -16, + "bc_y%end": -16, + "bc_y%ve1": 0.5, + "viscous": "T", + # Formatted Database Files Structure Parameters ============ + "format": 1, + "precision": 2, + "prim_vars_wrt": "T", + "omega_wrt(3)": "T", + "fd_order": 4, + "parallel_io": "T", + # Patch 1: Base ============================================ + "patch_icpp(1)%geometry": 3, + "patch_icpp(1)%x_centroid": 0.5, + "patch_icpp(1)%y_centroid": 0.5, + "patch_icpp(1)%length_x": 1.0, + "patch_icpp(1)%length_y": 1.0, + "patch_icpp(1)%vel(1)": 0, + "patch_icpp(1)%vel(2)": 0.0, + "patch_icpp(1)%pres": 5, + "patch_icpp(1)%alpha_rho(1)": 0.5, + "patch_icpp(1)%alpha(1)": 0.5, + "patch_icpp(1)%alpha_rho(2)": 0.5, + "patch_icpp(1)%alpha(2)": 0.5, + # Fluids Physical Parameters =============================== + "fluid_pp(1)%gamma": 1.0 / (1.4 - 1.0), + "fluid_pp(1)%pi_inf": 0.0, + "fluid_pp(1)%Re(1)": 1e4, + "fluid_pp(2)%gamma": 1.0 / (1.4 - 1.0), + "fluid_pp(2)%pi_inf": 0.0, + "fluid_pp(2)%Re(1)": 1e4, + } + ) +) diff --git a/examples/2D_lungwave/case.py b/examples/2D_lungwave/case.py index a53269ce9e..da5aa685f5 100644 --- a/examples/2D_lungwave/case.py +++ b/examples/2D_lungwave/case.py @@ -1,67 +1,66 @@ #!/usr/bin/env python3 - import math import json pi = 3.141592653589 # material parameters -#material1 :: gas -#patterson 2018 +# material1 :: gas +# patterson 2018 -gammag = 1.4 #unitless -Bg =0 #pascals -rhog = 1.18 #kg/m^3 -c_g = 347.2 #m/s -G_g = 0 #pa +gammag = 1.4 # unitless +Bg = 0 # pascals +rhog = 1.18 # kg/m^3 +c_g = 347.2 # m/s +G_g = 0 # pa - #material2 :: lung +# material2 :: lung gammal = 5.5 -Bl = 492.E+06 +Bl = 492.0e06 rhol = 996.0 c_l = 1648.7 -G_l = 1E3 +G_l = 1e3 -#primitive vartiables -patmos = 101325. #pa +# primitive vartiables +patmos = 101325.0 # pa -#problem specific variable -lambda_wave = 1E-3 +# problem specific variable +lambda_wave = 1e-3 -#define pulse -P_amp = 10.E+6 -P_len = 45 #length of the impulse -theta = -math.pi/2 #direction of propagation +# define pulse +P_amp = 10.0e6 +P_len = 45 # length of the impulse +theta = -math.pi / 2 # direction of propagation -#non-dim +# non-dim -#define characteristic density, length, time, stress material +# define characteristic density, length, time, stress material rho_char = rhog length_char = lambda_wave c_char = c_g -time_char = length_char/c_char -stress_char = rho_char*c_char*c_char/gammag - -#non-dim the properties -rhog_n = rhog/rho_char -c_g_n = c_g/c_char -rhol_n = rhol/rho_char -c_l_n = c_l/c_char -Bg_n = Bg/stress_char -Bl_n = Bl/stress_char -G_g_n = G_g/stress_char -G_l_n = G_l/stress_char -patmos_n = patmos/stress_char -P_amp_n = P_amp/stress_char - -#geometry -dlengx = 1. -dlengy = 20. +time_char = length_char / c_char +stress_char = rho_char * c_char * c_char / gammag + +# non-dim the properties +rhog_n = rhog / rho_char +c_g_n = c_g / c_char +rhol_n = rhol / rho_char +c_l_n = c_l / c_char +Bg_n = Bg / stress_char +Bl_n = Bl / stress_char +G_g_n = G_g / stress_char +G_l_n = G_l / stress_char +patmos_n = patmos / stress_char +P_amp_n = P_amp / stress_char + +# geometry +dlengx = 1.0 +dlengy = 20.0 Nx = 200 -Ny = dlengy*Nx -dx = dlengx/Nx -dy = dlengy/Ny +Ny = dlengy * Nx +dx = dlengx / Nx +dy = dlengy / Ny alphal_back = 1.0 alphag_back = 0.0 alphal_lung = 0.0 @@ -73,122 +72,107 @@ time_end = 2.5 cfl = 0.5 -dt = cfl * dx/c_l -Nt = int(time_end/dt) +dt = cfl * dx / c_l +Nt = int(time_end / dt) Nframes = 50000 tstart = 0 tstop = Nt -tsave = int(Nt/Nframes) +tsave = int(Nt / Nframes) -#interface profile +# interface profile interface_amp = 0.5 # Configuring case dictionary -print(json.dumps({ - # Logistics ================================================================ - 'run_time_info' : 'T', - # ========================================================================== - - # Computational Domain Parameters ========================================== - 'x_domain%beg' : 0., - 'x_domain%end' : dlengx, - 'y_domain%beg' : -dlengy/2., - 'y_domain%end' : dlengy/2., - 'm' : int(Nx), - 'n' : int(Ny), - 'p' : 0, - 'dt' : dt, - 't_step_start' : tstart, - 't_step_stop' : tstop, - 't_step_save' : tsave, - # ========================================================================== - - # Simulation Algorithm Parameters ========================================== - 'num_patches' : 2, - 'model_eqns' : 2, - 'alt_soundspeed' : 'F', - 'num_fluids' : 2, - 'mpp_lim' : 'T', - 'mixture_err' : 'T', - 'time_stepper' : 3, - 'weno_order' : 5, - 'weno_eps' : 1.E-16, - 'weno_Re_flux' : 'F', - 'weno_avg' : 'F', - 'mapped_weno' : 'T', - 'null_weights' : 'F', - 'mp_weno' : 'T', - 'riemann_solver' : 2, - 'wave_speeds' : 1, - 'avg_state' : 2, - 'bc_x%beg' : -1, - 'bc_x%end' : -1, - 'bc_y%beg' : -6, - 'bc_y%end' : -6, - # ========================================================================== - - # Formatted Database Files Structure Parameters ============================ - 'format' : 1, - 'precision' : 2, - 'prim_vars_wrt' :'T', - 'parallel_io' :'T', - # ========================================================================== - - # Monopole setting ========================================================= - 'acoustic_source' : 'T', # creating an acoustic wave - 'num_source' : 1, # place in the middle and expand - 'acoustic(1)%support' : 2, - 'acoustic(1)%pulse' : 1, # sine wave - 'acoustic(1)%npulse' : 1, # 1 pulse - 'acoustic(1)%wavelength' : dlengx, - 'acoustic(1)%mag' : 10.0*patmos_n, # magnitude - 'acoustic(1)%length' : 1*dlengx, # impulse length - 'acoustic(1)%loc(1)' : dlengx/2, # x_center of the domain - 'acoustic(1)%loc(2)' : 5.0*dlengx, # upper boundary of the domain - 'acoustic(1)%dir' : -math.pi/2, # direction: -pi/2 - #============================================================================== - - # Patch 1: Background ====================================================== - 'patch_icpp(1)%geometry' : 3, - 'patch_icpp(1)%x_centroid' : dlengx/2, - 'patch_icpp(1)%y_centroid' : 0., - 'patch_icpp(1)%length_x' : dlengx, - 'patch_icpp(1)%length_y' : dlengy, - 'patch_icpp(1)%vel(1)' : 0., - 'patch_icpp(1)%vel(2)' : 0.E+00, - 'patch_icpp(1)%pres' : patmos_n, - 'patch_icpp(1)%alpha_rho(1)' : rhol_n*alphal_back, - 'patch_icpp(1)%alpha_rho(2)' : rhog_n*alphag_back, - 'patch_icpp(1)%alpha(1)' : alphal_back, - 'patch_icpp(1)%alpha(2)' : alphag_back, - # ========================================================================== - - - # Patch 2: Lung ============================================================ - 'patch_icpp(2)%geometry' : 7, - 'patch_icpp(2)%hcid' : 205, - 'patch_icpp(2)%alter_patch(1)' : 'T', - 'patch_icpp(2)%x_centroid' : dlengx/2., - 'patch_icpp(2)%y_centroid' : -dlengy/4., - 'patch_icpp(2)%length_x' : dlengx, - 'patch_icpp(2)%length_y' : dlengy/2.+2, - 'patch_icpp(2)%a(2)' : interface_amp, - 'patch_icpp(2)%vel(1)' : 0.E+00, - 'patch_icpp(2)%vel(2)' : 0.0, - 'patch_icpp(2)%pres' : patmos_n, - 'patch_icpp(2)%alpha_rho(1)' : rhol_n*alphal_lung, - 'patch_icpp(2)%alpha_rho(2)' : rhog_n*alphag_lung, - 'patch_icpp(2)%alpha(1)' : alphal_lung, - 'patch_icpp(2)%alpha(2)' : alphag_lung, - # ========================================================================== - - # Fluids Physical Parameters =============================================== - 'fluid_pp(1)%gamma' : 1.E+00/(gammal-1.E+00), - 'fluid_pp(1)%pi_inf' : gammal*Bl_n/(gammal-1.E+00), - 'fluid_pp(2)%gamma' : 1.E+00/(gammag-1.E+00), - 'fluid_pp(2)%pi_inf' : gammag*Bg_n/(gammag-1.E+00), - # ========================================================================== - -})) - -# ============================================================================== +print( + json.dumps( + { + # Logistics ================================================================ + "run_time_info": "T", + # Computational Domain Parameters ========================================== + "x_domain%beg": 0.0, + "x_domain%end": dlengx, + "y_domain%beg": -dlengy / 2.0, + "y_domain%end": dlengy / 2.0, + "m": int(Nx), + "n": int(Ny), + "p": 0, + "dt": dt, + "t_step_start": tstart, + "t_step_stop": tstop, + "t_step_save": tsave, + # Simulation Algorithm Parameters ========================================== + "num_patches": 2, + "model_eqns": 2, + "alt_soundspeed": "F", + "num_fluids": 2, + "mpp_lim": "T", + "mixture_err": "T", + "time_stepper": 3, + "weno_order": 5, + "weno_eps": 1.0e-16, + "weno_Re_flux": "F", + "weno_avg": "F", + "mapped_weno": "T", + "null_weights": "F", + "mp_weno": "T", + "riemann_solver": 2, + "wave_speeds": 1, + "avg_state": 2, + "bc_x%beg": -1, + "bc_x%end": -1, + "bc_y%beg": -6, + "bc_y%end": -6, + # Formatted Database Files Structure Parameters ============================ + "format": 1, + "precision": 2, + "prim_vars_wrt": "T", + "parallel_io": "T", + # Monopole setting ========================================================= + "acoustic_source": "T", # creating an acoustic wave + "num_source": 1, # place in the middle and expand + "acoustic(1)%support": 2, + "acoustic(1)%pulse": 1, # sine wave + "acoustic(1)%npulse": 1, # 1 pulse + "acoustic(1)%wavelength": dlengx, + "acoustic(1)%mag": 10.0 * patmos_n, # magnitude + "acoustic(1)%length": 1 * dlengx, # impulse length + "acoustic(1)%loc(1)": dlengx / 2, # x_center of the domain + "acoustic(1)%loc(2)": 5.0 * dlengx, # upper boundary of the domain + "acoustic(1)%dir": -math.pi / 2, # direction: -pi/2 + # Patch 1: Background ====================================================== + "patch_icpp(1)%geometry": 3, + "patch_icpp(1)%x_centroid": dlengx / 2, + "patch_icpp(1)%y_centroid": 0.0, + "patch_icpp(1)%length_x": dlengx, + "patch_icpp(1)%length_y": dlengy, + "patch_icpp(1)%vel(1)": 0.0, + "patch_icpp(1)%vel(2)": 0.0e00, + "patch_icpp(1)%pres": patmos_n, + "patch_icpp(1)%alpha_rho(1)": rhol_n * alphal_back, + "patch_icpp(1)%alpha_rho(2)": rhog_n * alphag_back, + "patch_icpp(1)%alpha(1)": alphal_back, + "patch_icpp(1)%alpha(2)": alphag_back, + # Patch 2: Lung ============================================================ + "patch_icpp(2)%geometry": 7, + "patch_icpp(2)%hcid": 205, + "patch_icpp(2)%alter_patch(1)": "T", + "patch_icpp(2)%x_centroid": dlengx / 2.0, + "patch_icpp(2)%y_centroid": -dlengy / 4.0, + "patch_icpp(2)%length_x": dlengx, + "patch_icpp(2)%length_y": dlengy / 2.0 + 2, + "patch_icpp(2)%a(2)": interface_amp, + "patch_icpp(2)%vel(1)": 0.0e00, + "patch_icpp(2)%vel(2)": 0.0, + "patch_icpp(2)%pres": patmos_n, + "patch_icpp(2)%alpha_rho(1)": rhol_n * alphal_lung, + "patch_icpp(2)%alpha_rho(2)": rhog_n * alphag_lung, + "patch_icpp(2)%alpha(1)": alphal_lung, + "patch_icpp(2)%alpha(2)": alphag_lung, + # Fluids Physical Parameters =============================================== + "fluid_pp(1)%gamma": 1.0e00 / (gammal - 1.0e00), + "fluid_pp(1)%pi_inf": gammal * Bl_n / (gammal - 1.0e00), + "fluid_pp(2)%gamma": 1.0e00 / (gammag - 1.0e00), + "fluid_pp(2)%pi_inf": gammag * Bg_n / (gammag - 1.0e00), + } + ) +) diff --git a/examples/2D_lungwave_horizontal/case.py b/examples/2D_lungwave_horizontal/case.py index ca06daaca3..bcc19eb850 100644 --- a/examples/2D_lungwave_horizontal/case.py +++ b/examples/2D_lungwave_horizontal/case.py @@ -1,66 +1,65 @@ #!/usr/bin/env python3 - import math import json pi = 3.141592653589 # material parameters -#material1 :: gas -#patterson 2018 +# material1 :: gas +# patterson 2018 -gammag = 1.4 #unitless -Bg =0 #pascals -rhog = 1.18 #kg/m^3 -c_g = 347.2 #m/s -G_g = 0 #pa +gammag = 1.4 # unitless +Bg = 0 # pascals +rhog = 1.18 # kg/m^3 +c_g = 347.2 # m/s +G_g = 0 # pa -#material2 :: water +# material2 :: water gammal = 5.5 -Bl = 492.E+06 +Bl = 492.0e06 rhol = 996.0 c_l = 1648.7 -G_l = 1E3 +G_l = 1e3 -#primitive vartiables -patmos = 101325. #pa +# primitive vartiables +patmos = 101325.0 # pa -#problem specific variable -lambda_wave = 1E-3 +# problem specific variable +lambda_wave = 1e-3 -#define pulse -P_amp = 10.E+6 -P_len = 45 #length of the impulse -theta = -math.pi/2 #direction of propagation +# define pulse +P_amp = 10.0e6 +P_len = 45 # length of the impulse +theta = -math.pi / 2 # direction of propagation -#non-dim +# non-dim -#define characteristic density, length, time, stress material +# define characteristic density, length, time, stress material rho_char = rhog length_char = lambda_wave c_char = c_g -time_char = length_char/c_char -stress_char = rho_char*c_char*c_char/gammag - -#non-dim the properties -rhog_n = rhog/rho_char -c_g_n = c_g/c_char -rhol_n = rhol/rho_char -c_l_n = c_l/c_char -Bg_n = Bg/stress_char -Bl_n = Bl/stress_char -G_g_n = G_g/stress_char -G_l_n = G_l/stress_char -patmos_n = patmos/stress_char -P_amp_n = P_amp/stress_char - -#geometry -dlengx = 10. -dlengy = 2. +time_char = length_char / c_char +stress_char = rho_char * c_char * c_char / gammag + +# non-dim the properties +rhog_n = rhog / rho_char +c_g_n = c_g / c_char +rhol_n = rhol / rho_char +c_l_n = c_l / c_char +Bg_n = Bg / stress_char +Bl_n = Bl / stress_char +G_g_n = G_g / stress_char +G_l_n = G_l / stress_char +patmos_n = patmos / stress_char +P_amp_n = P_amp / stress_char + +# geometry +dlengx = 10.0 +dlengy = 2.0 Ny = 500 -Nx = dlengx*Ny -dx = dlengx/Nx -dy = dlengy/Ny +Nx = dlengx * Ny +dx = dlengx / Nx +dy = dlengy / Ny alphal_back = 1.0 alphag_back = 0.0 alphal_lung = 0.0 @@ -72,117 +71,104 @@ time_end = 5 cfl = 8.0 -dt = cfl * dx/c_l -Nt = int(time_end/dt) +dt = cfl * dx / c_l +Nt = int(time_end / dt) Nframes = 500 tstart = 0 tstop = Nt -tsave = int(Nt/Nframes) +tsave = int(Nt / Nframes) # Configuring case dictionary -print(json.dumps({ - # Logistics ================================================================ - 'run_time_info' : 'T', - # ========================================================================== - - # Computational Domain Parameters ========================================== - 'x_domain%beg' : -dlengx/2., - 'x_domain%end' : dlengx/2., - 'y_domain%beg' : 0., - 'y_domain%end' : dlengy, - 'm' : int(Nx), - 'n' : int(Ny), - 'p' : 0, - 'dt' : dt, - 't_step_start' : tstart, - 't_step_stop' : tstop, - 't_step_save' : tsave, - # ========================================================================== - - # Simulation Algorithm Parameters ========================================== - 'num_patches' : 2, - 'model_eqns' : 2, - 'alt_soundspeed' : 'F', - 'num_fluids' : 2, - 'mpp_lim' : 'T', - 'mixture_err' : 'T', - 'time_stepper' : 3, - 'weno_order' : 5, - 'weno_eps' : 1.E-16, - 'weno_Re_flux' : 'F', - 'weno_avg' : 'F', - 'mapped_weno' : 'T', - 'null_weights' : 'F', - 'mp_weno' : 'T', - 'riemann_solver' : 2, - 'wave_speeds' : 1, - 'avg_state' : 2, - 'bc_x%beg' : -6, - 'bc_x%end' : -6, - 'bc_y%beg' : -1, - 'bc_y%end' : -1, - # ========================================================================== - - # Formatted Database Files Structure Parameters ============================ - 'format' : 1, - 'precision' : 2, - 'prim_vars_wrt' :'T', - 'parallel_io' :'T', - # ========================================================================== - - # Monopole setting ========================================================= - 'acoustic_source' : 'T', # creating an acoustic wave - 'num_source' : 1, # place in the middle and expand - 'acoustic(1)%pulse' : 3, # square wave - 'acoustic(1)%npulse' : 1, # 1 pulse - 'acoustic(1)%mag' : 100.0*patmos_n,# magnitude - 'acoustic(1)%length' : 45.0*dlengy, # pulse length - 'acoustic(1)%support' : 2, # 2D semi infinite plane (x: -inf,inf; y:-len/2, len/2) - 'acoustic(1)%wavelength' : dlengy, # wavelength - 'acoustic(1)%loc(1)' : 0.7*dlengy, # x_center of the domain - 'acoustic(1)%loc(2)' : dlengy/2, # upper boundary of the domain - 'acoustic(1)%dir' : -math.pi, # direction: -pi/2 - - # Patch 1: Background ====================================================== - 'patch_icpp(1)%geometry' : 3, - 'patch_icpp(1)%x_centroid' : 0., - 'patch_icpp(1)%y_centroid' : dlengy/2., - 'patch_icpp(1)%length_x' : dlengx, - 'patch_icpp(1)%length_y' : dlengy, - 'patch_icpp(1)%vel(1)' : 0., - 'patch_icpp(1)%vel(2)' : 0.E+00, - 'patch_icpp(1)%pres' : patmos_n, - 'patch_icpp(1)%alpha_rho(1)' : rhol_n*alphal_back, - 'patch_icpp(1)%alpha_rho(2)' : rhog_n*alphag_back, - 'patch_icpp(1)%alpha(1)' : alphal_back, - 'patch_icpp(1)%alpha(2)' : alphag_back, - # ========================================================================== - - # Patch 2: Lung ============================================================ - 'patch_icpp(2)%geometry' : 7, - 'patch_icpp(2)%hcid' : 206, - 'patch_icpp(2)%alter_patch(1)' : 'T', - 'patch_icpp(2)%x_centroid' : -dlengx/4., - 'patch_icpp(2)%y_centroid' : dlengy/2., - 'patch_icpp(2)%length_x' : dlengx/2.+2, - 'patch_icpp(2)%length_y' : dlengy, - 'patch_icpp(2)%a(2)' : interface_amp, - 'patch_icpp(2)%vel(1)' : 0.E+00, - 'patch_icpp(2)%vel(2)' : 0.0, - 'patch_icpp(2)%pres' : patmos_n, - 'patch_icpp(2)%alpha_rho(1)' : rhol_n*alphal_lung, - 'patch_icpp(2)%alpha_rho(2)' : rhog_n*alphag_lung, - 'patch_icpp(2)%alpha(1)' : alphal_lung, - 'patch_icpp(2)%alpha(2)' : alphag_lung, - # ========================================================================== - - # Fluids Physical Parameters =============================================== - 'fluid_pp(1)%gamma' : 1.E+00/(gammal-1.E+00), - 'fluid_pp(1)%pi_inf' : gammal*Bl_n/(gammal-1.E+00), - 'fluid_pp(2)%gamma' : 1.E+00/(gammag-1.E+00), - 'fluid_pp(2)%pi_inf' : gammag*Bg_n/(gammag-1.E+00), - - #============================================================================== -})) - -# ============================================================================== +print( + json.dumps( + { + # Logistics ================================================================ + "run_time_info": "T", + # Computational Domain Parameters ========================================== + "x_domain%beg": -dlengx / 2.0, + "x_domain%end": dlengx / 2.0, + "y_domain%beg": 0.0, + "y_domain%end": dlengy, + "m": int(Nx), + "n": int(Ny), + "p": 0, + "dt": dt, + "t_step_start": tstart, + "t_step_stop": tstop, + "t_step_save": tsave, + # Simulation Algorithm Parameters ========================================== + "num_patches": 2, + "model_eqns": 2, + "alt_soundspeed": "F", + "num_fluids": 2, + "mpp_lim": "T", + "mixture_err": "T", + "time_stepper": 3, + "weno_order": 5, + "weno_eps": 1.0e-16, + "weno_Re_flux": "F", + "weno_avg": "F", + "mapped_weno": "T", + "null_weights": "F", + "mp_weno": "T", + "riemann_solver": 2, + "wave_speeds": 1, + "avg_state": 2, + "bc_x%beg": -6, + "bc_x%end": -6, + "bc_y%beg": -1, + "bc_y%end": -1, + # Formatted Database Files Structure Parameters ============================ + "format": 1, + "precision": 2, + "prim_vars_wrt": "T", + "parallel_io": "T", + # Monopole setting ========================================================= + "acoustic_source": "T", # creating an acoustic wave + "num_source": 1, # place in the middle and expand + "acoustic(1)%pulse": 3, # square wave + "acoustic(1)%npulse": 1, # 1 pulse + "acoustic(1)%mag": 100.0 * patmos_n, # magnitude + "acoustic(1)%length": 45.0 * dlengy, # pulse length + "acoustic(1)%support": 2, # 2D semi infinite plane (x: -inf,inf; y:-len/2, len/2) + "acoustic(1)%wavelength": dlengy, # wavelength + "acoustic(1)%loc(1)": 0.7 * dlengy, # x_center of the domain + "acoustic(1)%loc(2)": dlengy / 2, # upper boundary of the domain + "acoustic(1)%dir": -math.pi, # direction: -pi/2 + # Patch 1: Background ====================================================== + "patch_icpp(1)%geometry": 3, + "patch_icpp(1)%x_centroid": 0.0, + "patch_icpp(1)%y_centroid": dlengy / 2.0, + "patch_icpp(1)%length_x": dlengx, + "patch_icpp(1)%length_y": dlengy, + "patch_icpp(1)%vel(1)": 0.0, + "patch_icpp(1)%vel(2)": 0.0e00, + "patch_icpp(1)%pres": patmos_n, + "patch_icpp(1)%alpha_rho(1)": rhol_n * alphal_back, + "patch_icpp(1)%alpha_rho(2)": rhog_n * alphag_back, + "patch_icpp(1)%alpha(1)": alphal_back, + "patch_icpp(1)%alpha(2)": alphag_back, + # Patch 2: Lung ============================================================ + "patch_icpp(2)%geometry": 7, + "patch_icpp(2)%hcid": 206, + "patch_icpp(2)%alter_patch(1)": "T", + "patch_icpp(2)%x_centroid": -dlengx / 4.0, + "patch_icpp(2)%y_centroid": dlengy / 2.0, + "patch_icpp(2)%length_x": dlengx / 2.0 + 2, + "patch_icpp(2)%length_y": dlengy, + "patch_icpp(2)%a(2)": interface_amp, + "patch_icpp(2)%vel(1)": 0.0e00, + "patch_icpp(2)%vel(2)": 0.0, + "patch_icpp(2)%pres": patmos_n, + "patch_icpp(2)%alpha_rho(1)": rhol_n * alphal_lung, + "patch_icpp(2)%alpha_rho(2)": rhog_n * alphag_lung, + "patch_icpp(2)%alpha(1)": alphal_lung, + "patch_icpp(2)%alpha(2)": alphag_lung, + # Fluids Physical Parameters =============================================== + "fluid_pp(1)%gamma": 1.0e00 / (gammal - 1.0e00), + "fluid_pp(1)%pi_inf": gammal * Bl_n / (gammal - 1.0e00), + "fluid_pp(2)%gamma": 1.0e00 / (gammag - 1.0e00), + "fluid_pp(2)%pi_inf": gammag * Bg_n / (gammag - 1.0e00), + } + ) +) diff --git a/examples/2D_mixing_artificial_Ma/case.py b/examples/2D_mixing_artificial_Ma/case.py index 22ac2db743..840db2b9cf 100644 --- a/examples/2D_mixing_artificial_Ma/case.py +++ b/examples/2D_mixing_artificial_Ma/case.py @@ -1,36 +1,30 @@ #!/usr/bin/env python3 - import math import json # FLUID PROPERTIES (WATER, VAPOR & AIR) ======================================== # Water -rho_w = 1.E+03 # [kg/m3] density of water -gamma_w = 7.1 # [1] specific heat ratio -pi_inf_w = 3.06E+08 # [N/m2] water stiffness -# ============================================================================== +rho_w = 1.0e03 # [kg/m3] density of water +gamma_w = 7.1 # [1] specific heat ratio +pi_inf_w = 3.06e08 # [N/m2] water stiffness # REFERENCE VALUES ============================================================= -x_ref = 0.002475 # [m] initial vorticity thickness -u_ref = 3.4343 # [m/s] upper stream velocity -# ============================================================================== +x_ref = 0.002475 # [m] initial vorticity thickness +u_ref = 3.4343 # [m/s] upper stream velocity # NON-DIMENSIONAL NUMBERS ====================================================== -Re = 50. # [1] Reynolds number based on the upper stream - # velocity and the initial vorticity thickness -# ============================================================================== +Re = 50.0 # [1] Reynolds number based on the upper stream +# velocity and the initial vorticity thickness # SPEED OF SOUND =============================================================== -pres = 8236. # [N/m2] pressure of water -c_w = math.sqrt(gamma_w*(pres+pi_inf_w)/rho_w) -# ============================================================================== +pres = 8236.0 # [N/m2] pressure of water +c_w = math.sqrt(gamma_w * (pres + pi_inf_w) / rho_w) # MODIFIED PROPERTIES FOR ARTIFICIAL MACH NUMBER ============================== -Ma_t = 0.1 # [1] target Mach number -pi_fac = (rho_w*u_ref**2/(gamma_w*Ma_t**2)-pres)/pi_inf_w -pi_inf_w = pi_inf_w*pi_fac -c_w = math.sqrt(gamma_w*(pres+pi_inf_w)/rho_w) -# ============================================================================= +Ma_t = 0.1 # [1] target Mach number +pi_fac = (rho_w * u_ref**2 / (gamma_w * Ma_t**2) - pres) / pi_inf_w +pi_inf_w = pi_inf_w * pi_fac +c_w = math.sqrt(gamma_w * (pres + pi_inf_w) / rho_w) # SIMULATION SETUP ============================================================ # Domain size @@ -42,102 +36,86 @@ Ny = 191 # Grid spacing -dx = Lx/float(Nx+1) -dy = Ly/float(Ny+1) +dx = Lx / float(Nx + 1) +dy = Ly / float(Ny + 1) # Time advancement -cfl = 5e-1 -T = 20. -dt = cfl*dx/(1.+c_w/u_ref) -Ntfinal = int(T/dt) +cfl = 5e-1 +T = 20.0 +dt = cfl * dx / (1.0 + c_w / u_ref) +Ntfinal = int(T / dt) Ntstart = 0 -Nfiles = 20 -t_save = int(math.ceil((Ntfinal-0)/float(Nfiles))) -Nt = t_save*Nfiles -t_step_start = Ntstart -t_step_stop = int(Nt) - -# ============================================================================== - +Nfiles = 20 +t_save = int(math.ceil((Ntfinal - 0) / float(Nfiles))) +Nt = t_save * Nfiles +t_step_start = Ntstart +t_step_stop = int(Nt) # Configuring case dictionary -print(json.dumps({ - # Logistics ================================================================ - 'run_time_info' : 'T', - # ========================================================================== - - # Computational Domain Parameters ========================================== - 'x_domain%beg' : 0., - 'x_domain%end' : Lx, - 'y_domain%beg' : -Ly/2., - 'y_domain%end' : Ly/2., - 'm' : Nx, - 'n' : Ny, - 'p' : 0, - 'dt' : dt, - 't_step_start' : t_step_start, - 't_step_stop' : t_step_stop, - 't_step_save' : t_save, - # ========================================================================== - - # Simulation Algorithm Parameters ========================================== - 'num_patches' : 1, - 'model_eqns' : 2, - 'num_fluids' : 1, - 'time_stepper' : 3, - 'weno_order' : 5, - 'weno_eps' : 1.E-16, - 'weno_Re_flux' : 'T', - 'mapped_weno' : 'T', - 'riemann_solver' : 2, - 'wave_speeds' : 1, - 'avg_state' : 2, - 'bc_x%beg' : -1, - 'bc_x%end' : -1, - 'bc_y%beg' : -6, - 'bc_y%end' : -6, - 'viscous' : 'T', - # ========================================================================== - - # Formatted Database Files Structure Parameters ============================ - 'format' : 1, - 'precision' : 2, - 'cons_vars_wrt' :'T', - 'prim_vars_wrt' :'T', - 'parallel_io' :'T', - 'fd_order' : 1, - 'omega_wrt(3)' :'T', - # ========================================================================== - - # Patch 1 ================================================================== - 'patch_icpp(1)%geometry' : 3, - 'patch_icpp(1)%x_centroid' : Lx/2., - 'patch_icpp(1)%y_centroid' : 0., - 'patch_icpp(1)%length_x' : Lx, - 'patch_icpp(1)%length_y' : Ly, - 'patch_icpp(1)%alpha_rho(1)' : 1., - 'patch_icpp(1)%alpha(1)' : 1., - 'patch_icpp(1)%vel(1)' : 1., - 'patch_icpp(1)%vel(2)' : 0., - 'patch_icpp(1)%pres' : pres/(rho_w*u_ref**2), - # ========================================================================== - - # Mixing layer === ========================================================= - 'mixlayer_vel_profile' : 'T', - 'mixlayer_vel_coef' : 1., - 'mixlayer_domain' : 1., - 'mixlayer_perturb' : 'T', - # ========================================================================== - - # Artificial Mach number =================================================== - 'pi_fac' : pi_fac, - # ========================================================================== - - # Fluids Physical Parameters =============================================== - 'fluid_pp(1)%gamma' : 1.E+00/(gamma_w-1.E+00), - 'fluid_pp(1)%pi_inf' : gamma_w*(pi_inf_w/(rho_w*u_ref**2))/(gamma_w-1.E+00), - 'fluid_pp(1)%Re(1)' : Re, - # ========================================================================= -})) - -# ============================================================================== +print( + json.dumps( + { + # Logistics ================================================================ + "run_time_info": "T", + # Computational Domain Parameters ========================================== + "x_domain%beg": 0.0, + "x_domain%end": Lx, + "y_domain%beg": -Ly / 2.0, + "y_domain%end": Ly / 2.0, + "m": Nx, + "n": Ny, + "p": 0, + "dt": dt, + "t_step_start": t_step_start, + "t_step_stop": t_step_stop, + "t_step_save": t_save, + # Simulation Algorithm Parameters ========================================== + "num_patches": 1, + "model_eqns": 2, + "num_fluids": 1, + "time_stepper": 3, + "weno_order": 5, + "weno_eps": 1.0e-16, + "weno_Re_flux": "T", + "mapped_weno": "T", + "riemann_solver": 2, + "wave_speeds": 1, + "avg_state": 2, + "bc_x%beg": -1, + "bc_x%end": -1, + "bc_y%beg": -6, + "bc_y%end": -6, + "viscous": "T", + # Formatted Database Files Structure Parameters ============================ + "format": 1, + "precision": 2, + "cons_vars_wrt": "T", + "prim_vars_wrt": "T", + "parallel_io": "T", + "fd_order": 1, + "omega_wrt(3)": "T", + # Patch 1 ================================================================== + "patch_icpp(1)%geometry": 3, + "patch_icpp(1)%x_centroid": Lx / 2.0, + "patch_icpp(1)%y_centroid": 0.0, + "patch_icpp(1)%length_x": Lx, + "patch_icpp(1)%length_y": Ly, + "patch_icpp(1)%alpha_rho(1)": 1.0, + "patch_icpp(1)%alpha(1)": 1.0, + "patch_icpp(1)%vel(1)": 1.0, + "patch_icpp(1)%vel(2)": 0.0, + "patch_icpp(1)%pres": pres / (rho_w * u_ref**2), + # Mixing layer === ========================================================= + "mixlayer_vel_profile": "T", + "mixlayer_vel_coef": 1.0, + "mixlayer_domain": 1.0, + "mixlayer_perturb": "T", + # Artificial Mach number =================================================== + "pi_fac": pi_fac, + # Fluids Physical Parameters =============================================== + "fluid_pp(1)%gamma": 1.0e00 / (gamma_w - 1.0e00), + "fluid_pp(1)%pi_inf": gamma_w * (pi_inf_w / (rho_w * u_ref**2)) / (gamma_w - 1.0e00), + "fluid_pp(1)%Re(1)": Re, + } + ) +) diff --git a/examples/2D_phasechange_bubble/case.py b/examples/2D_phasechange_bubble/case.py index 2ee87e2605..66dd8bc500 100644 --- a/examples/2D_phasechange_bubble/case.py +++ b/examples/2D_phasechange_bubble/case.py @@ -3,23 +3,23 @@ ## 1 FOR BACKGROUND, 2 FOR BUBBLE # Pressure [Pa] -p01 = 5E6 +p01 = 5e6 p02 = 3550 # Temperature [K] T01 = 298.15 T02 = 298.15 -#T02 = 7.914 +# T02 = 7.914 #### FLUID PROPERTIES #### ### liquid water ### # pi infty -piwl = 1.0E+09 +piwl = 1.0e09 # qv qvwl = -1167000 # qv' -qvpwl = 0.0E0 +qvpwl = 0.0e0 # cv cvwl = 1816 # cp @@ -30,26 +30,26 @@ ## FOR PATCHES 1 & 2 ## # density -rho0wl1 = (p01 + piwl)/((gamwl-1)*cvwl*T01) -rho0wl2 = (p02 + piwl)/((gamwl-1)*cvwl*T02) +rho0wl1 = (p01 + piwl) / ((gamwl - 1) * cvwl * T01) +rho0wl2 = (p02 + piwl) / ((gamwl - 1) * cvwl * T02) # speed of sound FOR -c_wl1 = math.sqrt( gamwl * ( p01 + piwl ) / rho0wl1 ) -c_wl2 = math.sqrt( gamwl * ( p02 + piwl ) / rho0wl2 ) +c_wl1 = math.sqrt(gamwl * (p01 + piwl) / rho0wl1) +c_wl2 = math.sqrt(gamwl * (p02 + piwl) / rho0wl2) # part for Gases - relations from IMR -Ru = 8.3144598 # Universal gas constant (J/mol-K) +Ru = 8.3144598 # Universal gas constant (J/mol-K) ### Vapor water ### -Rv = Ru/(18.01528e-3) # Gas constant for vapor (Ru/molecular weight) (J/kg-K) +Rv = Ru / (18.01528e-3) # Gas constant for vapor (Ru/molecular weight) (J/kg-K) # gamma gamwv = 1.4 # cp -cpwv = Rv * gamwv/(gamwv-1) +cpwv = Rv * gamwv / (gamwv - 1) # cv -cvwv = cpwv/gamwv +cvwv = cpwv / gamwv # pi infinity -piwv = 0.0E0 +piwv = 0.0e0 # qv qvwv = 2030000 # qv' @@ -58,57 +58,57 @@ ## FOR PATCHES 1 & 2 ## # density -rho0wv1 = (p01 + piwv)/((gamwv-1)*cvwv*T01) -rho0wv2 = (p02 + piwv)/((gamwv-1)*cvwv*T02) +rho0wv1 = (p01 + piwv) / ((gamwv - 1) * cvwv * T01) +rho0wv2 = (p02 + piwv) / ((gamwv - 1) * cvwv * T02) # speed of sound -c_wv1 = math.sqrt( gamwv * ( p01 + piwv ) / rho0wv1 ) -c_wv2 = math.sqrt( gamwv * ( p02 + piwv ) / rho0wv2 ) +c_wv1 = math.sqrt(gamwv * (p01 + piwv) / rho0wv1) +c_wv2 = math.sqrt(gamwv * (p02 + piwv) / rho0wv2) ### Air ### -Ra = Ru/(28.966e-3) # Gas constant for air (Ru/molecular weight) (J/kg-K) +Ra = Ru / (28.966e-3) # Gas constant for air (Ru/molecular weight) (J/kg-K) # gamma gama = 1.4 # cp -cpa = Ra * gama/(gama-1) +cpa = Ra * gama / (gama - 1) # cv -cva = cpa/gama +cva = cpa / gama # pi infinity -pia = 0.0E0 +pia = 0.0e0 # qv -qva = 0.0E0 +qva = 0.0e0 # qv' -qvpa = 0.0E0 +qvpa = 0.0e0 ## FOR PATCHES 1 & 2 ## # density -rho0a1 = (p01 + pia)/((gama-1)*cva*T01) -rho0a2 = (p02 + pia)/((gama-1)*cva*T02) +rho0a1 = (p01 + pia) / ((gama - 1) * cva * T01) +rho0a2 = (p02 + pia) / ((gama - 1) * cva * T02) # Speed of sound -c_a1 = math.sqrt( gama * ( p01 + pia ) / rho0a1 ) -c_a2 = math.sqrt( gama * ( p02 + pia ) / rho0a2 ) +c_a1 = math.sqrt(gama * (p01 + pia) / rho0a1) +c_a2 = math.sqrt(gama * (p02 + pia) / rho0a2) ## SHOCK RELATIONS p02Op01 = p02 / p01 # Mach number of the shocked region - this should agree with Min, if everything is correct -Ms = math.sqrt( ( gama + 1. ) / ( 2. * gama ) * ( p02Op01 - 1. ) * ( p02 / ( p02 + pia ) ) + 1.0 ) +Ms = math.sqrt((gama + 1.0) / (2.0 * gama) * (p02Op01 - 1.0) * (p02 / (p02 + pia)) + 1.0) # shock speed ss = Ms * c_a1 ### volume fractions for each of the patches ### -C0 = 0.25 # vapor concentration for IMR +C0 = 0.25 # vapor concentration for IMR # water liquid -awl1 = 1.00E00-2.00E-12 -awl2 = 1.00E-12 +awl1 = 1.00e00 - 2.00e-12 +awl2 = 1.00e-12 # water vapor -awv1 = 1.00E-12 -awv2 = 1 / ( ( 1 - C0 ) / C0 * rho0wv2 / rho0a2 + 1 ) +awv1 = 1.00e-12 +awv2 = 1 / ((1 - C0) / C0 * rho0wv2 / rho0a2 + 1) # air aa1 = 1.0 - awl1 - awv1 aa2 = 1.0 - awl2 - awv2 @@ -119,7 +119,7 @@ cfl = 0.50 # Bubble Initial Radius -R0 = 30E-06 +R0 = 30e-06 # number of elements Nx0 = 400 @@ -129,18 +129,18 @@ # domain boundaries xb = 0.00 -xe = 120E-6 +xe = 120e-6 yb = 0.00 -ye = 120E-6 +ye = 120e-6 zb = 0.00 -ze = 120E-6 +ze = 120e-6 # typical cell size -dx = ( xe - xb ) / Nx -dy = ( ye - yb ) / Ny -dz = ( ze - zb ) / Nz +dx = (xe - xb) / Nx +dy = (ye - yb) / Ny +dz = (ze - zb) / Nz # time step @@ -148,7 +148,7 @@ SF = 200 # Critical time-step -tc = 0.915 * R0 * math.sqrt( rho0wl1 / p01 ) +tc = 0.915 * R0 * math.sqrt(rho0wl1 / p01) # making Nt divisible by SF # tendA = 1.5 * tc @@ -162,124 +162,121 @@ # Nt = total number of steps. Ensure Nt > NtA (so the total tendA is covered) # Nt = AS * SF -Nt = int(18E3 * tend // tc * Nx / Nx0 + 1) +Nt = int(18e3 * tend // tc * Nx / Nx0 + 1) dt = tend / Nt -AS = int( Nt//SF ) +AS = int(Nt // SF) # Total physical time # tend = Nt * dt # Configuring case dictionary ================================================== -print(json.dumps({ - # Logistics ================================================ - 'run_time_info': 'T', - # ========================================================== - # Computational Domain Parameters ========================== - 'x_domain%beg' : xb, - 'x_domain%end' : xe, - 'y_domain%beg' : yb, - 'y_domain%end' : ye, - 'stretch_x' : 'T', - 'loops_x' : 3, - 'a_x' : 4.0E0, - 'x_a' : -2.0*R0, - 'x_b' : 2.0*R0, - 'stretch_y' : 'T', - 'loops_y' : 3, - 'a_y' : 4.0E0, - 'y_a' : -2.0*R0, - 'y_b' : 2.0*R0, - 'cyl_coord' : 'T', - 'm' : Nx, - 'n' : Ny, - 'p' : 0, - 'dt' : dt, - 't_step_start' : 0, - 't_step_stop' : Nt, - 't_step_save' : AS, - # ========================================================== - # Simulation Algorithm Parameters ========================== - 'num_patches' : 2, - 'model_eqns' : 3, - 'num_fluids' : 3, - 'mpp_lim' : 'T', - 'mixture_err' : 'T', - 'relax' : 'T', - 'relax_model' : 6, - 'palpha_eps' : 1.0E-8, - 'ptgalpha_eps' : 1.0E-2, - 'time_stepper' : 3, - 'weno_order' : 3, - 'weno_eps' : 1.0E-16, - 'weno_Re_flux' : 'F', - 'weno_avg' : 'F', - 'mapped_weno' : 'T', - 'null_weights' : 'F', - 'mp_weno' : 'F', - 'riemann_solver' : 2, - 'wave_speeds' : 1, - 'avg_state' : 2, - 'bc_x%beg' : -2, - 'bc_x%end' : -6, - 'bc_y%beg' : -2, - 'bc_y%end' : -6, - # ========================================================== - # Formatted Database Files Structure Parameters ============ - 'format' : 1, - 'precision' : 2, - 'prim_vars_wrt':'T', - 'parallel_io' :'T', - # ========================================================== - # Patch 1: High pressured water ============================ - # Specify the cubic water background grid geometry - 'patch_icpp(1)%geometry' : 3, - 'patch_icpp(1)%x_centroid' : ( xe + xb ) * 500000 / 100, - 'patch_icpp(1)%y_centroid' : ( ye + yb ) * 500000 / 100, - 'patch_icpp(1)%length_x' : ( xe - xb ) * 1000000 / 100, - 'patch_icpp(1)%length_y' : ( ye - yb ) * 1000000 / 100, - 'patch_icpp(1)%vel(1)' : 0.0E+00, - 'patch_icpp(1)%vel(2)' : 0.0E+00, - 'patch_icpp(1)%pres' : p01, - 'patch_icpp(1)%alpha_rho(1)' : awl1 * rho0wl1, - 'patch_icpp(1)%alpha_rho(2)' : awv1 * rho0wv1, - 'patch_icpp(1)%alpha_rho(3)' : aa1 * rho0a1, - 'patch_icpp(1)%alpha(1)' : awl1, - 'patch_icpp(1)%alpha(2)' : awv1, - 'patch_icpp(1)%alpha(3)' : aa1, - # ========================================================== - # Patch 2: (Vapor) Bubble ================================== - 'patch_icpp(2)%geometry' : 2, - 'patch_icpp(2)%x_centroid' : xb, - 'patch_icpp(2)%y_centroid' : yb, - 'patch_icpp(2)%radius' : R0, - 'patch_icpp(2)%vel(1)' : 0.0E+00, - 'patch_icpp(2)%vel(2)' : 0.0E+00, - 'patch_icpp(2)%pres' : p02, - 'patch_icpp(2)%alpha_rho(1)' : awl2 * rho0wl2, - 'patch_icpp(2)%alpha_rho(2)' : awv2 * rho0wv2, - 'patch_icpp(2)%alpha_rho(3)' : aa2 * rho0a2, - 'patch_icpp(2)%alpha(1)' : awl2, - 'patch_icpp(2)%alpha(2)' : awv2, - 'patch_icpp(2)%alpha(3)' : aa2, - 'patch_icpp(2)%alter_patch(1)' : 'T', - # ========================================================== - # Fluids Physical Parameters =============================== - 'fluid_pp(1)%gamma' : 1.0E+00 / ( gamwl - 1 ), - 'fluid_pp(1)%pi_inf' : gamwl * piwl / ( gamwl - 1 ), - 'fluid_pp(1)%cv' : cvwl, - 'fluid_pp(1)%qv' : qvwl, - 'fluid_pp(1)%qvp' : qvpwl, - 'fluid_pp(2)%gamma' : 1.0E+00 / ( gamwv - 1 ), - 'fluid_pp(2)%pi_inf' : gamwv * piwv / ( gamwv - 1 ), - 'fluid_pp(2)%cv' : cvwv, - 'fluid_pp(2)%qv' : qvwv, - 'fluid_pp(2)%qvp' : qvpwv, - 'fluid_pp(3)%gamma' : 1.0E+00 / ( gama - 1 ), - 'fluid_pp(3)%pi_inf' : gama * pia / ( gama - 1 ), - 'fluid_pp(3)%cv' : cva, - 'fluid_pp(3)%qv' : qva, - 'fluid_pp(3)%qvp' : qvpa, - # ========================================================== -})) +print( + json.dumps( + { + # Logistics ================================================ + "run_time_info": "T", + # Computational Domain Parameters ========================== + "x_domain%beg": xb, + "x_domain%end": xe, + "y_domain%beg": yb, + "y_domain%end": ye, + "stretch_x": "T", + "loops_x": 3, + "a_x": 4.0e0, + "x_a": -2.0 * R0, + "x_b": 2.0 * R0, + "stretch_y": "T", + "loops_y": 3, + "a_y": 4.0e0, + "y_a": -2.0 * R0, + "y_b": 2.0 * R0, + "cyl_coord": "T", + "m": Nx, + "n": Ny, + "p": 0, + "dt": dt, + "t_step_start": 0, + "t_step_stop": Nt, + "t_step_save": AS, + # Simulation Algorithm Parameters ========================== + "num_patches": 2, + "model_eqns": 3, + "num_fluids": 3, + "mpp_lim": "T", + "mixture_err": "T", + "relax": "T", + "relax_model": 6, + "palpha_eps": 1.0e-8, + "ptgalpha_eps": 1.0e-2, + "time_stepper": 3, + "weno_order": 3, + "weno_eps": 1.0e-16, + "weno_Re_flux": "F", + "weno_avg": "F", + "mapped_weno": "T", + "null_weights": "F", + "mp_weno": "F", + "riemann_solver": 2, + "wave_speeds": 1, + "avg_state": 2, + "bc_x%beg": -2, + "bc_x%end": -6, + "bc_y%beg": -2, + "bc_y%end": -6, + # Formatted Database Files Structure Parameters ============ + "format": 1, + "precision": 2, + "prim_vars_wrt": "T", + "parallel_io": "T", + # Patch 1: High pressured water ============================ + # Specify the cubic water background grid geometry + "patch_icpp(1)%geometry": 3, + "patch_icpp(1)%x_centroid": (xe + xb) * 500000 / 100, + "patch_icpp(1)%y_centroid": (ye + yb) * 500000 / 100, + "patch_icpp(1)%length_x": (xe - xb) * 1000000 / 100, + "patch_icpp(1)%length_y": (ye - yb) * 1000000 / 100, + "patch_icpp(1)%vel(1)": 0.0e00, + "patch_icpp(1)%vel(2)": 0.0e00, + "patch_icpp(1)%pres": p01, + "patch_icpp(1)%alpha_rho(1)": awl1 * rho0wl1, + "patch_icpp(1)%alpha_rho(2)": awv1 * rho0wv1, + "patch_icpp(1)%alpha_rho(3)": aa1 * rho0a1, + "patch_icpp(1)%alpha(1)": awl1, + "patch_icpp(1)%alpha(2)": awv1, + "patch_icpp(1)%alpha(3)": aa1, + # Patch 2: (Vapor) Bubble ================================== + "patch_icpp(2)%geometry": 2, + "patch_icpp(2)%x_centroid": xb, + "patch_icpp(2)%y_centroid": yb, + "patch_icpp(2)%radius": R0, + "patch_icpp(2)%vel(1)": 0.0e00, + "patch_icpp(2)%vel(2)": 0.0e00, + "patch_icpp(2)%pres": p02, + "patch_icpp(2)%alpha_rho(1)": awl2 * rho0wl2, + "patch_icpp(2)%alpha_rho(2)": awv2 * rho0wv2, + "patch_icpp(2)%alpha_rho(3)": aa2 * rho0a2, + "patch_icpp(2)%alpha(1)": awl2, + "patch_icpp(2)%alpha(2)": awv2, + "patch_icpp(2)%alpha(3)": aa2, + "patch_icpp(2)%alter_patch(1)": "T", + # Fluids Physical Parameters =============================== + "fluid_pp(1)%gamma": 1.0e00 / (gamwl - 1), + "fluid_pp(1)%pi_inf": gamwl * piwl / (gamwl - 1), + "fluid_pp(1)%cv": cvwl, + "fluid_pp(1)%qv": qvwl, + "fluid_pp(1)%qvp": qvpwl, + "fluid_pp(2)%gamma": 1.0e00 / (gamwv - 1), + "fluid_pp(2)%pi_inf": gamwv * piwv / (gamwv - 1), + "fluid_pp(2)%cv": cvwv, + "fluid_pp(2)%qv": qvwv, + "fluid_pp(2)%qvp": qvpwv, + "fluid_pp(3)%gamma": 1.0e00 / (gama - 1), + "fluid_pp(3)%pi_inf": gama * pia / (gama - 1), + "fluid_pp(3)%cv": cva, + "fluid_pp(3)%qv": qva, + "fluid_pp(3)%qvp": qvpa, + } + ) +) diff --git a/examples/2D_phasechange_bubble/casefile.py b/examples/2D_phasechange_bubble/casefile.py index 65edf71e4c..da886141f3 100644 --- a/examples/2D_phasechange_bubble/casefile.py +++ b/examples/2D_phasechange_bubble/casefile.py @@ -3,23 +3,23 @@ ## 1 FOR BACKGROUND, 2 FOR BUBBLE # Pressure [Pa] -p01 = 5E6 +p01 = 5e6 p02 = 3550 # Temperature [K] T01 = 298.15 T02 = 298.15 -#T02 = 7.914 +# T02 = 7.914 #### FLUID PROPERTIES #### ### liquid water ### # pi infty -piwl = 1.0E+09 +piwl = 1.0e09 # qv qvwl = -1167000 # qv' -qvpwl = 0.0E0 +qvpwl = 0.0e0 # cv cvwl = 1816 # cp @@ -30,26 +30,26 @@ ## FOR PATCHES 1 & 2 ## # density -rho0wl1 = (p01 + piwl)/((gamwl-1)*cvwl*T01) -rho0wl2 = (p02 + piwl)/((gamwl-1)*cvwl*T02) +rho0wl1 = (p01 + piwl) / ((gamwl - 1) * cvwl * T01) +rho0wl2 = (p02 + piwl) / ((gamwl - 1) * cvwl * T02) # speed of sound FOR -c_wl1 = math.sqrt( gamwl * ( p01 + piwl ) / rho0wl1 ) -c_wl2 = math.sqrt( gamwl * ( p02 + piwl ) / rho0wl2 ) +c_wl1 = math.sqrt(gamwl * (p01 + piwl) / rho0wl1) +c_wl2 = math.sqrt(gamwl * (p02 + piwl) / rho0wl2) # part for Gases - relations from IMR -Ru = 8.3144598 # Universal gas constant (J/mol-K) +Ru = 8.3144598 # Universal gas constant (J/mol-K) ### Vapor water ### -Rv = Ru/(18.01528e-3) # Gas constant for vapor (Ru/molecular weight) (J/kg-K) +Rv = Ru / (18.01528e-3) # Gas constant for vapor (Ru/molecular weight) (J/kg-K) # gamma gamwv = 1.4 # cp -cpwv = Rv * gamwv/(gamwv-1) +cpwv = Rv * gamwv / (gamwv - 1) # cv -cvwv = cpwv/gamwv +cvwv = cpwv / gamwv # pi infinity -piwv = 0.0E0 +piwv = 0.0e0 # qv qvwv = 2030000 # qv' @@ -58,57 +58,57 @@ ## FOR PATCHES 1 & 2 ## # density -rho0wv1 = (p01 + piwv)/((gamwv-1)*cvwv*T01) -rho0wv2 = (p02 + piwv)/((gamwv-1)*cvwv*T02) +rho0wv1 = (p01 + piwv) / ((gamwv - 1) * cvwv * T01) +rho0wv2 = (p02 + piwv) / ((gamwv - 1) * cvwv * T02) # speed of sound -c_wv1 = math.sqrt( gamwv * ( p01 + piwv ) / rho0wv1 ) -c_wv2 = math.sqrt( gamwv * ( p02 + piwv ) / rho0wv2 ) +c_wv1 = math.sqrt(gamwv * (p01 + piwv) / rho0wv1) +c_wv2 = math.sqrt(gamwv * (p02 + piwv) / rho0wv2) ### Air ### -Ra = Ru/(28.966e-3) # Gas constant for air (Ru/molecular weight) (J/kg-K) +Ra = Ru / (28.966e-3) # Gas constant for air (Ru/molecular weight) (J/kg-K) # gamma gama = 1.4 # cp -cpa = Ra * gama/(gama-1) +cpa = Ra * gama / (gama - 1) # cv -cva = cpa/gama +cva = cpa / gama # pi infinity -pia = 0.0E0 +pia = 0.0e0 # qv -qva = 0.0E0 +qva = 0.0e0 # qv' -qvpa = 0.0E0 +qvpa = 0.0e0 ## FOR PATCHES 1 & 2 ## # density -rho0a1 = (p01 + pia)/((gama-1)*cva*T01) -rho0a2 = (p02 + pia)/((gama-1)*cva*T02) +rho0a1 = (p01 + pia) / ((gama - 1) * cva * T01) +rho0a2 = (p02 + pia) / ((gama - 1) * cva * T02) # Speed of sound -c_a1 = math.sqrt( gama * ( p01 + pia ) / rho0a1 ) -c_a2 = math.sqrt( gama * ( p02 + pia ) / rho0a2 ) +c_a1 = math.sqrt(gama * (p01 + pia) / rho0a1) +c_a2 = math.sqrt(gama * (p02 + pia) / rho0a2) ## SHOCK RELATIONS p02Op01 = p02 / p01 # Mach number of the shocked region - this should agree with Min, if everything is correct -Ms = math.sqrt( ( gama + 1. ) / ( 2. * gama ) * ( p02Op01 - 1. ) * ( p02 / ( p02 + pia ) ) + 1.0 ) +Ms = math.sqrt((gama + 1.0) / (2.0 * gama) * (p02Op01 - 1.0) * (p02 / (p02 + pia)) + 1.0) # shock speed ss = Ms * c_a1 ### volume fractions for each of the patches ### -C0 = 0.25 # vapor concentration for IMR +C0 = 0.25 # vapor concentration for IMR # water liquid -awl1 = 1.00E00-2.00E-12 -awl2 = 1.00E-12 +awl1 = 1.00e00 - 2.00e-12 +awl2 = 1.00e-12 # water vapor -awv1 = 1.00E-12 -awv2 = 1 / ( ( 1 - C0 ) / C0 * rho0wv2 / rho0a2 + 1 ) +awv1 = 1.00e-12 +awv2 = 1 / ((1 - C0) / C0 * rho0wv2 / rho0a2 + 1) # air aa1 = 1.0 - awl1 - awv1 aa2 = 1.0 - awl2 - awv2 @@ -119,7 +119,7 @@ cfl = 0.50 # Bubble Initial Radius -R0 = 30E-06 +R0 = 30e-06 # number of elements Nx0 = 400 @@ -129,18 +129,18 @@ # domain boundaries xb = 0.00 -xe = 120E-6 +xe = 120e-6 yb = 0.00 -ye = 120E-6 +ye = 120e-6 zb = 0.00 -ze = 120E-6 +ze = 120e-6 # typical cell size -dx = ( xe - xb ) / Nx -dy = ( ye - yb ) / Ny -dz = ( ze - zb ) / Nz +dx = (xe - xb) / Nx +dy = (ye - yb) / Ny +dz = (ze - zb) / Nz # time step @@ -148,7 +148,7 @@ SF = 200 # Critical time-step -tc = 0.915 * R0 * math.sqrt( rho0wl1 / p01 ) +tc = 0.915 * R0 * math.sqrt(rho0wl1 / p01) # making Nt divisible by SF # tendA = 1.5 * tc @@ -162,138 +162,135 @@ # Nt = total number of steps. Ensure Nt > NtA (so the total tendA is covered) # Nt = AS * SF -Nt = int(18E3 * tend // tc * Nx / Nx0 + 1) +Nt = int(18e3 * tend // tc * Nx / Nx0 + 1) dt = tend / Nt -AS = int( Nt//SF ) +AS = int(Nt // SF) # Total physical time # tend = Nt * dt # Configuring case dictionary ================================================== -print(json.dumps({ - # Logistics ================================================ - 'run_time_info': 'T', - # ========================================================== - # Computational Domain Parameters ========================== - 'x_domain%beg' : xb, - 'x_domain%end' : xe, - 'y_domain%beg' : yb, - 'y_domain%end' : ye, - 'z_domain%beg' : zb, - 'z_domain%end' : ze, - 'stretch_x' : 'T', - 'loops_x' : 3, - 'a_x' : 4.0E0, - 'x_a' : -2.0*R0, - 'x_b' : 2.0*R0, - 'stretch_y' : 'T', - 'loops_y' : 3, - 'a_y' : 4.0E0, - 'y_a' : -2.0*R0, - 'y_b' : 2.0*R0, - 'stretch_z' : 'T', - 'loops_z' : 3, - 'a_z' : 4.0E0, - 'z_a' : -2.0*R0, - 'z_b' : 2.0*R0, - 'cyl_coord' : 'F', - 'm' : Nx, - 'n' : Ny, - 'p' : Nz, - 'dt' : dt, - 't_step_start' : 0, - 't_step_stop' : Nt, - 't_step_save' : AS, - # ========================================================== - # Simulation Algorithm Parameters ========================== - 'num_patches' : 2, - 'model_eqns' : 3, - 'num_fluids' : 3, - 'mpp_lim' : 'T', - 'mixture_err' : 'T', - 'relax' : 'T', - 'relax_model' : 6, - 'palpha_eps' : 1.0E-6, - 'ptgalpha_eps' : 1.0E-2, - 'time_stepper' : 3, - 'weno_order' : 3, - 'weno_eps' : 1.0E-32, - 'weno_Re_flux' : 'F', - 'weno_avg' : 'F', - 'mapped_weno' : 'T', - 'null_weights' : 'F', - 'mp_weno' : 'F', - 'riemann_solver' : 2, - 'wave_speeds' : 1, - 'avg_state' : 2, - 'bc_x%beg' : -2, - 'bc_x%end' : -6, - 'bc_y%beg' : -2, - 'bc_y%end' : -6, - 'bc_z%beg' : -2, - 'bc_z%end' : -6, - # ========================================================== - # Formatted Database Files Structure Parameters ============ - 'format' : 1, - 'precision' : 2, - 'prim_vars_wrt':'T', - 'parallel_io' :'T', - # ========================================================== - # Patch 1: High pressured water ============================ - # Specify the cubic water background grid geometry - 'patch_icpp(1)%geometry' : 9, - 'patch_icpp(1)%x_centroid' : ( xe + xb ) * 500000 / 100, - 'patch_icpp(1)%y_centroid' : ( ye + yb ) * 500000 / 100, - 'patch_icpp(1)%z_centroid' : ( ze + zb ) * 500000 / 100, - 'patch_icpp(1)%length_x' : ( xe - xb ) * 1000000 / 100, - 'patch_icpp(1)%length_y' : ( ye - yb ) * 1000000 / 100, - 'patch_icpp(1)%length_z' : ( ze - zb ) * 1000000 / 100, - 'patch_icpp(1)%vel(1)' : 0.0E+00, - 'patch_icpp(1)%vel(2)' : 0.0E+00, - 'patch_icpp(1)%vel(3)' : 0.0E+00, - 'patch_icpp(1)%pres' : p01, - 'patch_icpp(1)%alpha_rho(1)' : awl1 * rho0wl1, - 'patch_icpp(1)%alpha_rho(2)' : awv1 * rho0wv1, - 'patch_icpp(1)%alpha_rho(3)' : aa1 * rho0a1, - 'patch_icpp(1)%alpha(1)' : awl1, - 'patch_icpp(1)%alpha(2)' : awv1, - 'patch_icpp(1)%alpha(3)' : aa1, - # ========================================================== - # Patch 2: (Vapor) Bubble ================================== - 'patch_icpp(2)%geometry' : 8, - 'patch_icpp(2)%x_centroid' : xb, - 'patch_icpp(2)%y_centroid' : yb, - 'patch_icpp(2)%z_centroid' : zb, - 'patch_icpp(2)%radius' : R0, - 'patch_icpp(2)%vel(1)' : 0.0E+00, - 'patch_icpp(2)%vel(2)' : 0.0E+00, - 'patch_icpp(2)%vel(3)' : 0.0E+00, - 'patch_icpp(2)%pres' : p02, - 'patch_icpp(2)%alpha_rho(1)' : awl2 * rho0wl2, - 'patch_icpp(2)%alpha_rho(2)' : awv2 * rho0wv2, - 'patch_icpp(2)%alpha_rho(3)' : aa2 * rho0a2, - 'patch_icpp(2)%alpha(1)' : awl2, - 'patch_icpp(2)%alpha(2)' : awv2, - 'patch_icpp(2)%alpha(3)' : aa2, - 'patch_icpp(2)%alter_patch(1)' : 'T', - # ========================================================== - # Fluids Physical Parameters =============================== - 'fluid_pp(1)%gamma' : 1.0E+00 / ( gamwl - 1 ), - 'fluid_pp(1)%pi_inf' : gamwl * piwl / ( gamwl - 1 ), - 'fluid_pp(1)%cv' : cvwl, - 'fluid_pp(1)%qv' : qvwl, - 'fluid_pp(1)%qvp' : qvpwl, - 'fluid_pp(2)%gamma' : 1.0E+00 / ( gamwv - 1 ), - 'fluid_pp(2)%pi_inf' : gamwv * piwv / ( gamwv - 1 ), - 'fluid_pp(2)%cv' : cvwv, - 'fluid_pp(2)%qv' : qvwv, - 'fluid_pp(2)%qvp' : qvpwv, - 'fluid_pp(3)%gamma' : 1.0E+00 / ( gama - 1 ), - 'fluid_pp(3)%pi_inf' : gama * pia / ( gama - 1 ), - 'fluid_pp(3)%cv' : cva, - 'fluid_pp(3)%qv' : qva, - 'fluid_pp(3)%qvp' : qvpa, - # ========================================================== -})) +print( + json.dumps( + { + # Logistics ================================================ + "run_time_info": "T", + # Computational Domain Parameters ========================== + "x_domain%beg": xb, + "x_domain%end": xe, + "y_domain%beg": yb, + "y_domain%end": ye, + "z_domain%beg": zb, + "z_domain%end": ze, + "stretch_x": "T", + "loops_x": 3, + "a_x": 4.0e0, + "x_a": -2.0 * R0, + "x_b": 2.0 * R0, + "stretch_y": "T", + "loops_y": 3, + "a_y": 4.0e0, + "y_a": -2.0 * R0, + "y_b": 2.0 * R0, + "stretch_z": "T", + "loops_z": 3, + "a_z": 4.0e0, + "z_a": -2.0 * R0, + "z_b": 2.0 * R0, + "cyl_coord": "F", + "m": Nx, + "n": Ny, + "p": Nz, + "dt": dt, + "t_step_start": 0, + "t_step_stop": Nt, + "t_step_save": AS, + # Simulation Algorithm Parameters ========================== + "num_patches": 2, + "model_eqns": 3, + "num_fluids": 3, + "mpp_lim": "T", + "mixture_err": "T", + "relax": "T", + "relax_model": 6, + "palpha_eps": 1.0e-6, + "ptgalpha_eps": 1.0e-2, + "time_stepper": 3, + "weno_order": 3, + "weno_eps": 1.0e-32, + "weno_Re_flux": "F", + "weno_avg": "F", + "mapped_weno": "T", + "null_weights": "F", + "mp_weno": "F", + "riemann_solver": 2, + "wave_speeds": 1, + "avg_state": 2, + "bc_x%beg": -2, + "bc_x%end": -6, + "bc_y%beg": -2, + "bc_y%end": -6, + "bc_z%beg": -2, + "bc_z%end": -6, + # Formatted Database Files Structure Parameters ============ + "format": 1, + "precision": 2, + "prim_vars_wrt": "T", + "parallel_io": "T", + # Patch 1: High pressured water ============================ + # Specify the cubic water background grid geometry + "patch_icpp(1)%geometry": 9, + "patch_icpp(1)%x_centroid": (xe + xb) * 500000 / 100, + "patch_icpp(1)%y_centroid": (ye + yb) * 500000 / 100, + "patch_icpp(1)%z_centroid": (ze + zb) * 500000 / 100, + "patch_icpp(1)%length_x": (xe - xb) * 1000000 / 100, + "patch_icpp(1)%length_y": (ye - yb) * 1000000 / 100, + "patch_icpp(1)%length_z": (ze - zb) * 1000000 / 100, + "patch_icpp(1)%vel(1)": 0.0e00, + "patch_icpp(1)%vel(2)": 0.0e00, + "patch_icpp(1)%vel(3)": 0.0e00, + "patch_icpp(1)%pres": p01, + "patch_icpp(1)%alpha_rho(1)": awl1 * rho0wl1, + "patch_icpp(1)%alpha_rho(2)": awv1 * rho0wv1, + "patch_icpp(1)%alpha_rho(3)": aa1 * rho0a1, + "patch_icpp(1)%alpha(1)": awl1, + "patch_icpp(1)%alpha(2)": awv1, + "patch_icpp(1)%alpha(3)": aa1, + # Patch 2: (Vapor) Bubble ================================== + "patch_icpp(2)%geometry": 8, + "patch_icpp(2)%x_centroid": xb, + "patch_icpp(2)%y_centroid": yb, + "patch_icpp(2)%z_centroid": zb, + "patch_icpp(2)%radius": R0, + "patch_icpp(2)%vel(1)": 0.0e00, + "patch_icpp(2)%vel(2)": 0.0e00, + "patch_icpp(2)%vel(3)": 0.0e00, + "patch_icpp(2)%pres": p02, + "patch_icpp(2)%alpha_rho(1)": awl2 * rho0wl2, + "patch_icpp(2)%alpha_rho(2)": awv2 * rho0wv2, + "patch_icpp(2)%alpha_rho(3)": aa2 * rho0a2, + "patch_icpp(2)%alpha(1)": awl2, + "patch_icpp(2)%alpha(2)": awv2, + "patch_icpp(2)%alpha(3)": aa2, + "patch_icpp(2)%alter_patch(1)": "T", + # Fluids Physical Parameters =============================== + "fluid_pp(1)%gamma": 1.0e00 / (gamwl - 1), + "fluid_pp(1)%pi_inf": gamwl * piwl / (gamwl - 1), + "fluid_pp(1)%cv": cvwl, + "fluid_pp(1)%qv": qvwl, + "fluid_pp(1)%qvp": qvpwl, + "fluid_pp(2)%gamma": 1.0e00 / (gamwv - 1), + "fluid_pp(2)%pi_inf": gamwv * piwv / (gamwv - 1), + "fluid_pp(2)%cv": cvwv, + "fluid_pp(2)%qv": qvwv, + "fluid_pp(2)%qvp": qvpwv, + "fluid_pp(3)%gamma": 1.0e00 / (gama - 1), + "fluid_pp(3)%pi_inf": gama * pia / (gama - 1), + "fluid_pp(3)%cv": cva, + "fluid_pp(3)%qv": qva, + "fluid_pp(3)%qvp": qvpa, + } + ) +) diff --git a/examples/2D_rayleigh_taylor/case.py b/examples/2D_rayleigh_taylor/case.py index 3f34263d34..5de033e59c 100644 --- a/examples/2D_rayleigh_taylor/case.py +++ b/examples/2D_rayleigh_taylor/case.py @@ -1,17 +1,16 @@ #!/usr/bin/env python3 - import math import json lam = 0.2 h = 1.2 -k = 2*math.pi/lam -amp = 0.05/k +k = 2 * math.pi / lam +amp = 0.05 / k # Numerical setup -x0 = -lam/2 -x1 = lam/2 -y0 = 0. +x0 = -lam / 2 +x1 = lam / 2 +y0 = 0.0 y1 = h Nx = 199 @@ -19,102 +18,86 @@ eps = 1e-6 -dx = lam/(Nx + 1) -c = math.sqrt(1.4*1e5/1) +dx = lam / (Nx + 1) +c = math.sqrt(1.4 * 1e5 / 1) cfl = 0.5 -dt = cfl*dx/c +dt = cfl * dx / c -Nt = math.ceil(2/dt) -Ns = math.ceil(Nt/100) +Nt = math.ceil(2 / dt) +Ns = math.ceil(Nt / 100) -#Configuration case dictionary +# Configuration case dictionary data = { # Logistics ============================= - 'run_time_info' : 'T', - # ======================================= - + "run_time_info": "T", # Computational Domain ================== - 'x_domain%beg' : x0, - 'x_domain%end' : x1, - 'y_domain%beg' : y0, - 'y_domain%end' : y1, - 'm' : Nx, - 'n' : Ny, - 'p' : 0, - 'cyl_coord' : 'F', - 'dt' : dt, - 't_step_start' : 0, - 't_step_stop' : Nt, - 't_step_save' : Ns, - # ======================================= - + "x_domain%beg": x0, + "x_domain%end": x1, + "y_domain%beg": y0, + "y_domain%end": y1, + "m": Nx, + "n": Ny, + "p": 0, + "cyl_coord": "F", + "dt": dt, + "t_step_start": 0, + "t_step_stop": Nt, + "t_step_save": Ns, # Simulation Algorithm ================== - 'model_eqns' : 3, - 'alt_soundspeed' : 'F', - 'mixture_err' : 'T', - 'mpp_lim' : 'T', - 'time_stepper' : 3, - 'avg_state' : 2, - 'weno_order' : 5, - 'weno_eps' : 1e-16, - 'mapped_weno' : 'T', - 'null_weights' : 'F', - 'mp_weno' : 'T', - 'weno_Re_flux' : 'T', - 'riemann_solver' : 2, - 'wave_speeds' : 1, - 'bc_x%beg' : -2, - 'bc_x%end' : -2, - 'bc_y%beg' : -16, - 'bc_y%end' : -16, - 'num_patches' : 1, - 'num_fluids' : 2, - 'viscous' : 'T', - # ======================================= - + "model_eqns": 3, + "alt_soundspeed": "F", + "mixture_err": "T", + "mpp_lim": "T", + "time_stepper": 3, + "avg_state": 2, + "weno_order": 5, + "weno_eps": 1e-16, + "mapped_weno": "T", + "null_weights": "F", + "mp_weno": "T", + "weno_Re_flux": "T", + "riemann_solver": 2, + "wave_speeds": 1, + "bc_x%beg": -2, + "bc_x%end": -2, + "bc_y%beg": -16, + "bc_y%end": -16, + "num_patches": 1, + "num_fluids": 2, + "viscous": "T", # Database Structure Parameters ========= - 'format' : 1, - 'precision' : 2, - 'prim_vars_wrt' : 'T', - 'parallel_io' : 'T', - # ======================================= - + "format": 1, + "precision": 2, + "prim_vars_wrt": "T", + "parallel_io": "T", # Fluid Parameters (Heavy Gas) ========== - 'fluid_pp(1)%gamma' : 1.E+00/(1.4E+00-1.E+00), - 'fluid_pp(1)%pi_inf' : 0.E+00, - 'fluid_pp(1)%Re(1)' : 1/0.0219, - # ======================================= - + "fluid_pp(1)%gamma": 1.0e00 / (1.4e00 - 1.0e00), + "fluid_pp(1)%pi_inf": 0.0e00, + "fluid_pp(1)%Re(1)": 1 / 0.0219, # Fluid Parameters (Light Gas) ========== - 'fluid_pp(2)%gamma' : 1.E+00/(1.4E+00-1.E+00), - 'fluid_pp(2)%pi_inf' : 0.E+00, - 'fluid_pp(2)%Re(1)' : 1/0.0073, - # ======================================= - + "fluid_pp(2)%gamma": 1.0e00 / (1.4e00 - 1.0e00), + "fluid_pp(2)%pi_inf": 0.0e00, + "fluid_pp(2)%Re(1)": 1 / 0.0073, # Body Forces =========================== - 'bf_y' : 'T', - 'k_y' : 0., - 'w_y' : 0., - 'p_y' : 0., - 'g_y' : -9.81, - # ====================================== - + "bf_y": "T", + "k_y": 0.0, + "w_y": 0.0, + "p_y": 0.0, + "g_y": -9.81, # Water Patch ========================== - 'patch_icpp(1)%geometry' : 7, - 'patch_icpp(1)%hcid' : 204, - 'patch_icpp(1)%x_centroid' : 0, - 'patch_icpp(1)%y_centroid' : h/2, - 'patch_icpp(1)%length_x' : lam, - 'patch_icpp(1)%length_y' : h, - 'patch_icpp(1)%vel(1)' : 0.0, - 'patch_icpp(1)%vel(2)' : 0.0, - 'patch_icpp(1)%pres' : 1e5, - 'patch_icpp(1)%alpha_rho(1)': (1-eps), - 'patch_icpp(1)%alpha_rho(2)': eps*1, - 'patch_icpp(1)%alpha(1)' : 1-eps, - 'patch_icpp(1)%alpha(2)' : eps, - # ====================================== - + "patch_icpp(1)%geometry": 7, + "patch_icpp(1)%hcid": 204, + "patch_icpp(1)%x_centroid": 0, + "patch_icpp(1)%y_centroid": h / 2, + "patch_icpp(1)%length_x": lam, + "patch_icpp(1)%length_y": h, + "patch_icpp(1)%vel(1)": 0.0, + "patch_icpp(1)%vel(2)": 0.0, + "patch_icpp(1)%pres": 1e5, + "patch_icpp(1)%alpha_rho(1)": (1 - eps), + "patch_icpp(1)%alpha_rho(2)": eps * 1, + "patch_icpp(1)%alpha(1)": 1 - eps, + "patch_icpp(1)%alpha(2)": eps, } print(json.dumps(data)) diff --git a/examples/2D_riemann_test/case.py b/examples/2D_riemann_test/case.py index b67bbb979c..a8ff72a42d 100644 --- a/examples/2D_riemann_test/case.py +++ b/examples/2D_riemann_test/case.py @@ -1,109 +1,98 @@ #!/usr/bin/env python3 - import json import math # Configuring case dictionary -print(json.dumps({ - # Logistics ================================================ - 'run_time_info' : 'T', - # ========================================================== - - # Computational Domain Parameters ========================== - 'x_domain%beg' : 0., - 'x_domain%end' : 1., - 'y_domain%beg' : 0., - 'y_domain%end' : 1., - 'm' : 499, - 'n' : 499, - 'p' : 0, - 'dt' : 8e-05, - 't_step_start' : 0, - 't_step_stop' : 10000, - 't_step_save' : 100, - # ========================================================== - - # Simulation Algorithm Parameters ========================== - 'num_patches' : 4, - 'model_eqns' : 2, - 'alt_soundspeed' : 'F', - 'num_fluids' : 1, - 'mpp_lim' : 'F', - 'mixture_err' : 'T', - 'time_stepper' : 3, - 'mp_weno' : 'F', - # 'recon_type' : 1, - 'weno_order' : 5, - 'weno_eps' : 1e-16, - #'muscl_order' : 2, - #'muscl_lim' : 1, - 'riemann_solver' : 2, - 'wave_speeds' : 1, - 'avg_state' : 2, - 'bc_x%beg' : -3, - 'bc_x%end' : -3, - 'bc_y%beg' : -3, - 'bc_y%end' : -3, - # ========================================================== - - # Formatted Database Files Structure Parameters ============ - 'format' : 1, - 'precision' : 2, - 'prim_vars_wrt' :'T', - 'parallel_io' :'T', - # ========================================================== - - # Patch 1: Base ============================================ - 'patch_icpp(1)%geometry' : 3, - 'patch_icpp(1)%x_centroid' : 0.4, - 'patch_icpp(1)%y_centroid' : 0.4, - 'patch_icpp(1)%length_x' : 0.8, - 'patch_icpp(1)%length_y' : 0.8, - 'patch_icpp(1)%vel(1)' : 4/math.sqrt(11), - 'patch_icpp(1)%vel(2)' : 4/math.sqrt(11), - 'patch_icpp(1)%pres' : 9/310, - 'patch_icpp(1)%alpha_rho(1)' : 77/558, - 'patch_icpp(1)%alpha(1)' : 1, - # ========================================================== - # Patch 1: Base ============================================ - 'patch_icpp(2)%geometry' : 3, - 'patch_icpp(2)%x_centroid' : 0.4, - 'patch_icpp(2)%y_centroid' : 0.9, - 'patch_icpp(2)%length_x' : 0.8, - 'patch_icpp(2)%length_y' : 0.2, - 'patch_icpp(2)%vel(1)' : 4/math.sqrt(11), - 'patch_icpp(2)%vel(2)' : 0, - 'patch_icpp(2)%pres' : 0.3, - 'patch_icpp(2)%alpha_rho(1)' : 33/62, - 'patch_icpp(2)%alpha(1)' : 1, - # ========================================================== - # Patch 1: Base ============================================ - 'patch_icpp(3)%geometry' : 3, - 'patch_icpp(3)%x_centroid' : 0.9, - 'patch_icpp(3)%y_centroid' : 0.4, - 'patch_icpp(3)%length_x' : 0.2, - 'patch_icpp(3)%length_y' : 0.8, - 'patch_icpp(3)%vel(1)' : 0, - 'patch_icpp(3)%vel(2)' : 4/math.sqrt(11), - 'patch_icpp(3)%pres' : 0.3, - 'patch_icpp(3)%alpha_rho(1)' : 33/62, - 'patch_icpp(3)%alpha(1)' : 1, - # ========================================================== - # Patch 1: Base ============================================ - 'patch_icpp(4)%geometry' : 3, - 'patch_icpp(4)%x_centroid' : 0.9, - 'patch_icpp(4)%y_centroid' : 0.9, - 'patch_icpp(4)%length_x' : 0.2, - 'patch_icpp(4)%length_y' : 0.2, - 'patch_icpp(4)%vel(1)' : 0, - 'patch_icpp(4)%vel(2)' : 0, - 'patch_icpp(4)%pres' : 1.5, - 'patch_icpp(4)%alpha_rho(1)' : 1.5, - 'patch_icpp(4)%alpha(1)' : 1., - # ========================================================== - # Fluids Physical Parameters =============================== - 'fluid_pp(1)%gamma' : 1.E+00/(1.4E+00-1.E+00), - 'fluid_pp(1)%pi_inf' : 0.E+00, - # ========================================================== -})) -# ============================================================================== +print( + json.dumps( + { + # Logistics ================================================ + "run_time_info": "T", + # Computational Domain Parameters ========================== + "x_domain%beg": 0.0, + "x_domain%end": 1.0, + "y_domain%beg": 0.0, + "y_domain%end": 1.0, + "m": 499, + "n": 499, + "p": 0, + "dt": 8e-05, + "t_step_start": 0, + "t_step_stop": 10000, + "t_step_save": 100, + # Simulation Algorithm Parameters ========================== + "num_patches": 4, + "model_eqns": 2, + "alt_soundspeed": "F", + "num_fluids": 1, + "mpp_lim": "F", + "mixture_err": "T", + "time_stepper": 3, + "mp_weno": "F", + # 'recon_type' : 1, + "weno_order": 5, + "weno_eps": 1e-16, + #'muscl_order' : 2, + #'muscl_lim' : 1, + "riemann_solver": 2, + "wave_speeds": 1, + "avg_state": 2, + "bc_x%beg": -3, + "bc_x%end": -3, + "bc_y%beg": -3, + "bc_y%end": -3, + # Formatted Database Files Structure Parameters ============ + "format": 1, + "precision": 2, + "prim_vars_wrt": "T", + "parallel_io": "T", + # Patch 1: Base ============================================ + "patch_icpp(1)%geometry": 3, + "patch_icpp(1)%x_centroid": 0.4, + "patch_icpp(1)%y_centroid": 0.4, + "patch_icpp(1)%length_x": 0.8, + "patch_icpp(1)%length_y": 0.8, + "patch_icpp(1)%vel(1)": 4 / math.sqrt(11), + "patch_icpp(1)%vel(2)": 4 / math.sqrt(11), + "patch_icpp(1)%pres": 9 / 310, + "patch_icpp(1)%alpha_rho(1)": 77 / 558, + "patch_icpp(1)%alpha(1)": 1, + # Patch 1: Base ============================================ + "patch_icpp(2)%geometry": 3, + "patch_icpp(2)%x_centroid": 0.4, + "patch_icpp(2)%y_centroid": 0.9, + "patch_icpp(2)%length_x": 0.8, + "patch_icpp(2)%length_y": 0.2, + "patch_icpp(2)%vel(1)": 4 / math.sqrt(11), + "patch_icpp(2)%vel(2)": 0, + "patch_icpp(2)%pres": 0.3, + "patch_icpp(2)%alpha_rho(1)": 33 / 62, + "patch_icpp(2)%alpha(1)": 1, + # Patch 1: Base ============================================ + "patch_icpp(3)%geometry": 3, + "patch_icpp(3)%x_centroid": 0.9, + "patch_icpp(3)%y_centroid": 0.4, + "patch_icpp(3)%length_x": 0.2, + "patch_icpp(3)%length_y": 0.8, + "patch_icpp(3)%vel(1)": 0, + "patch_icpp(3)%vel(2)": 4 / math.sqrt(11), + "patch_icpp(3)%pres": 0.3, + "patch_icpp(3)%alpha_rho(1)": 33 / 62, + "patch_icpp(3)%alpha(1)": 1, + # Patch 1: Base ============================================ + "patch_icpp(4)%geometry": 3, + "patch_icpp(4)%x_centroid": 0.9, + "patch_icpp(4)%y_centroid": 0.9, + "patch_icpp(4)%length_x": 0.2, + "patch_icpp(4)%length_y": 0.2, + "patch_icpp(4)%vel(1)": 0, + "patch_icpp(4)%vel(2)": 0, + "patch_icpp(4)%pres": 1.5, + "patch_icpp(4)%alpha_rho(1)": 1.5, + "patch_icpp(4)%alpha(1)": 1.0, + # Fluids Physical Parameters =============================== + "fluid_pp(1)%gamma": 1.0e00 / (1.4e00 - 1.0e00), + "fluid_pp(1)%pi_inf": 0.0e00, + } + ) +) diff --git a/examples/2D_shearlayer/case.py b/examples/2D_shearlayer/case.py index 0c52cba967..25826d06f4 100644 --- a/examples/2D_shearlayer/case.py +++ b/examples/2D_shearlayer/case.py @@ -1,102 +1,90 @@ #!/usr/bin/env python2 - import json -myv = 1. +myv = 1.0 Mu1 = 0.01 Mu2 = 0.01 # Configuring case dictionary -print(json.dumps({ - # Logistics ================================================================ - 'run_time_info' : 'T', - # ========================================================================== - - # Computational Domain Parameters ========================================== - 'x_domain%beg' : -0.500000000000000E+00, - 'x_domain%end' : 0.500000000000000E+00, - 'y_domain%beg' : -0.250000000000000E+00, - 'y_domain%end' : 0.250000000000000E+00, - 'm' : 319, - 'n' : 159, - 'p' : 0, - 'dt' : 10.000000000000000E-7, - 't_step_start' : 0, - 't_step_stop' : int(4E5), - 't_step_save' : int(1E4), - # ========================================================================== - - # Simulation Algorithm Parameters ========================================== - 'model_eqns' : 2, - 'num_fluids' : 2, - 'num_patches' : 2, - 'mpp_lim' : 'T', - 'mixture_err' : 'T', - 'time_stepper' : 3, - 'weno_order' : 5, - 'weno_eps' : 1.00000000000000E-16, - 'weno_Re_flux' : 'T', - 'weno_avg' : 'T', - 'mapped_weno' : 'T', - 'riemann_solver' : 2, - 'wave_speeds' : 1, - 'avg_state' : 2, - 'bc_x%beg' :-1, - 'bc_x%end' :-1, - 'bc_y%beg' :-5, - 'bc_y%end' :-5, - 'viscous' : 'T', - # ========================================================================== - - # Formatted Database Files Structure Parameters ============================ - 'format' : 1, - 'precision' : 2, - 'prim_vars_wrt' :'T', - 'parallel_io' :'T', - # ========================================================================== - - # Patch 1: initialize entire domain ======================================== - 'patch_icpp(2)%geometry' : 3, - 'patch_icpp(2)%x_centroid' : 0.00000000000000E+00, - 'patch_icpp(2)%y_centroid' : 0.00000000000000E+00, - 'patch_icpp(2)%length_x' : 2.00000000000000E+00, - 'patch_icpp(2)%length_y' : 2.00000000000000E+00, - 'patch_icpp(2)%vel(1)' : myv, - 'patch_icpp(2)%vel(2)' : 0.00000000000000E+00, - 'patch_icpp(2)%pres' : 1.01325000000000E+05, - 'patch_icpp(2)%alpha_rho(1)' : 1000.00000000000E+00, - 'patch_icpp(2)%alpha_rho(2)' : 1000.*1E-12, - 'patch_icpp(2)%alpha(1)' : 1.00000000000000E+00-1.E-12, - 'patch_icpp(2)%alpha(2)' : 1.E-12, - # ========================================================================== - - # Patch 2: overwrite lower half plane ====================================== - 'patch_icpp(1)%geometry' : 4, - 'patch_icpp(1)%x_centroid' : 0.00000000000000E+00, - 'patch_icpp(1)%y_centroid' : 0.00000000000000E+00, - #'patch_icpp(1)%length_x' : 1.00000000000000E+00, - #'patch_icpp(1)%length_y' : 0.50000000000000E+00, - 'patch_icpp(1)%normal(1)' : 0.00624987793326E+00, - 'patch_icpp(1)%normal(2)' : -0.99998046932219E+00, - #'patch_icpp(1)%smooth_patch_id': 1, - #'patch_icpp(1)%smooth_coeff' : 1.00000000000000E+00, - 'patch_icpp(1)%vel(1)' : -myv, - 'patch_icpp(1)%vel(2)' : 0.00000000000000E+00, - 'patch_icpp(1)%pres' : 1.01325000000000E+05, - 'patch_icpp(1)%alpha_rho(1)' : 1000*1.E-12, - 'patch_icpp(1)%alpha_rho(2)' : 1000.000000000000E+00, - 'patch_icpp(1)%alpha(1)' : 1.00000000000000E-12, - 'patch_icpp(1)%alpha(2)' : 1-1.00000000000000E-12, - # ========================================================================== - - # Fluids Physical Parameters =============================================== - 'fluid_pp(1)%gamma' : 1.0E+00/(4.4E+00-1.0E+00), - 'fluid_pp(1)%pi_inf' : 4.4E+00*6.0E+08/(4.4E+00-1.E+00), - 'fluid_pp(1)%Re(1)' : 1/Mu1, - 'fluid_pp(2)%gamma' : 1.0E+00/(4.4E+00-1.0E+00), - 'fluid_pp(2)%pi_inf' : 4.4E+00*6.0E+08/(4.4E+00-1.E+00), - 'fluid_pp(2)%Re(1)' : 1/Mu2, - # ========================================================================== -})) - -# ============================================================================== +print( + json.dumps( + { + # Logistics ================================================================ + "run_time_info": "T", + # Computational Domain Parameters ========================================== + "x_domain%beg": -0.500000000000000e00, + "x_domain%end": 0.500000000000000e00, + "y_domain%beg": -0.250000000000000e00, + "y_domain%end": 0.250000000000000e00, + "m": 319, + "n": 159, + "p": 0, + "dt": 10.000000000000000e-7, + "t_step_start": 0, + "t_step_stop": int(4e5), + "t_step_save": int(1e4), + # Simulation Algorithm Parameters ========================================== + "model_eqns": 2, + "num_fluids": 2, + "num_patches": 2, + "mpp_lim": "T", + "mixture_err": "T", + "time_stepper": 3, + "weno_order": 5, + "weno_eps": 1.00000000000000e-16, + "weno_Re_flux": "T", + "weno_avg": "T", + "mapped_weno": "T", + "riemann_solver": 2, + "wave_speeds": 1, + "avg_state": 2, + "bc_x%beg": -1, + "bc_x%end": -1, + "bc_y%beg": -5, + "bc_y%end": -5, + "viscous": "T", + # Formatted Database Files Structure Parameters ============================ + "format": 1, + "precision": 2, + "prim_vars_wrt": "T", + "parallel_io": "T", + # Patch 1: initialize entire domain ======================================== + "patch_icpp(2)%geometry": 3, + "patch_icpp(2)%x_centroid": 0.00000000000000e00, + "patch_icpp(2)%y_centroid": 0.00000000000000e00, + "patch_icpp(2)%length_x": 2.00000000000000e00, + "patch_icpp(2)%length_y": 2.00000000000000e00, + "patch_icpp(2)%vel(1)": myv, + "patch_icpp(2)%vel(2)": 0.00000000000000e00, + "patch_icpp(2)%pres": 1.01325000000000e05, + "patch_icpp(2)%alpha_rho(1)": 1000.00000000000e00, + "patch_icpp(2)%alpha_rho(2)": 1000.0 * 1e-12, + "patch_icpp(2)%alpha(1)": 1.00000000000000e00 - 1.0e-12, + "patch_icpp(2)%alpha(2)": 1.0e-12, + # Patch 2: overwrite lower half plane ====================================== + "patch_icpp(1)%geometry": 4, + "patch_icpp(1)%x_centroid": 0.00000000000000e00, + "patch_icpp(1)%y_centroid": 0.00000000000000e00, + #'patch_icpp(1)%length_x' : 1.00000000000000E+00, + #'patch_icpp(1)%length_y' : 0.50000000000000E+00, + "patch_icpp(1)%normal(1)": 0.00624987793326e00, + "patch_icpp(1)%normal(2)": -0.99998046932219e00, + #'patch_icpp(1)%smooth_patch_id': 1, + #'patch_icpp(1)%smooth_coeff' : 1.00000000000000E+00, + "patch_icpp(1)%vel(1)": -myv, + "patch_icpp(1)%vel(2)": 0.00000000000000e00, + "patch_icpp(1)%pres": 1.01325000000000e05, + "patch_icpp(1)%alpha_rho(1)": 1000 * 1.0e-12, + "patch_icpp(1)%alpha_rho(2)": 1000.000000000000e00, + "patch_icpp(1)%alpha(1)": 1.00000000000000e-12, + "patch_icpp(1)%alpha(2)": 1 - 1.00000000000000e-12, + # Fluids Physical Parameters =============================================== + "fluid_pp(1)%gamma": 1.0e00 / (4.4e00 - 1.0e00), + "fluid_pp(1)%pi_inf": 4.4e00 * 6.0e08 / (4.4e00 - 1.0e00), + "fluid_pp(1)%Re(1)": 1 / Mu1, + "fluid_pp(2)%gamma": 1.0e00 / (4.4e00 - 1.0e00), + "fluid_pp(2)%pi_inf": 4.4e00 * 6.0e08 / (4.4e00 - 1.0e00), + "fluid_pp(2)%Re(1)": 1 / Mu2, + } + ) +) diff --git a/examples/2D_shockbubble/case.py b/examples/2D_shockbubble/case.py index 99c364210e..37c9fb3815 100644 --- a/examples/2D_shockbubble/case.py +++ b/examples/2D_shockbubble/case.py @@ -1,128 +1,114 @@ #!/usr/bin/env python3 - import math import json -ps = 248758.567 +ps = 248758.567 gam = 1.4 -rho = 1. -c_l = math.sqrt( 1.4*ps/rho ) -vel = 230. +rho = 1.0 +c_l = math.sqrt(1.4 * ps / rho) +vel = 230.0 -leng = 1. -Ny = 100. -Nx = Ny*3 -dx = leng/Nx +leng = 1.0 +Ny = 100.0 +Nx = Ny * 3 +dx = leng / Nx -time_end = 5*leng/vel +time_end = 5 * leng / vel cfl = 0.1 -dt = cfl * dx/c_l -Nt = int(time_end/dt) +dt = cfl * dx / c_l +Nt = int(time_end / dt) # Configuring case dictionary -print(json.dumps({ - # Logistics ================================================================ - 'run_time_info' : 'T', - # ========================================================================== - - # Computational Domain Parameters ========================================== - 'x_domain%beg' : -leng/2., - 'x_domain%end' : leng/2+2*leng, - 'y_domain%beg' : -leng/2., - 'y_domain%end' : leng/2., - 'm' : int(Nx), - 'n' : int(Ny), - 'p' : 0, - 'dt' : dt, - 't_step_start' : 0, - 't_step_stop' : Nt, - 't_step_save' : int(Nt/20.), - # ========================================================================== - - # Simulation Algorithm Parameters ========================================== - 'num_patches' : 3, - 'model_eqns' : 2, - 'alt_soundspeed' : 'F', - 'num_fluids' : 2, - 'mpp_lim' : 'T', - 'mixture_err' : 'T', - 'time_stepper' : 3, - 'weno_order' : 5, - 'weno_eps' : 1.E-16, - 'weno_Re_flux' : 'F', - 'weno_avg' : 'F', - 'mapped_weno' : 'T', - 'null_weights' : 'F', - 'mp_weno' : 'F', - 'riemann_solver' : 2, - 'wave_speeds' : 1, - 'avg_state' : 2, - 'bc_x%beg' : -6, - 'bc_x%end' : -6, - 'bc_y%beg' : -6, - 'bc_y%end' : -6, - # ========================================================================== - - # Formatted Database Files Structure Parameters ============================ - 'format' : 1, - 'precision' : 2, - 'prim_vars_wrt' :'T', - 'parallel_io' :'T', - # ========================================================================== - - # Patch 1: Background ====================================================== - 'patch_icpp(1)%geometry' : 3, - 'patch_icpp(1)%x_centroid' : 0., - 'patch_icpp(1)%y_centroid' : 0., - 'patch_icpp(1)%length_x' : 10*leng, - 'patch_icpp(1)%length_y' : leng, - 'patch_icpp(1)%vel(1)' : vel, - 'patch_icpp(1)%vel(2)' : 0.E+00, - 'patch_icpp(1)%pres' : 101325., - 'patch_icpp(1)%alpha_rho(1)' : 1.29, - 'patch_icpp(1)%alpha_rho(2)' : 0.E+00, - 'patch_icpp(1)%alpha(1)' : 1.E+00, - 'patch_icpp(1)%alpha(2)' : 0.E+00, - # ========================================================================== - - # Patch 2: Shocked state =================================================== - 'patch_icpp(2)%geometry' : 3, - 'patch_icpp(2)%alter_patch(1)' : 'T', - 'patch_icpp(2)%x_centroid' : -3*leng/8., - 'patch_icpp(2)%y_centroid' : 0., - 'patch_icpp(2)%length_x' : leng/4., - 'patch_icpp(2)%length_y' : leng, - 'patch_icpp(2)%vel(1)' : vel, - 'patch_icpp(2)%vel(2)' : 0.E+00, - 'patch_icpp(2)%pres' : ps, - 'patch_icpp(2)%alpha_rho(1)' : 2.4, - 'patch_icpp(2)%alpha_rho(2)' : 0.E+00, - 'patch_icpp(2)%alpha(1)' : 1.E+00, - 'patch_icpp(2)%alpha(2)' : 0.E+00, - # ========================================================================== - - # Patch 3: Bubble ========================================================== - 'patch_icpp(3)%geometry' : 2, - 'patch_icpp(3)%x_centroid' : 0.E+00, - 'patch_icpp(3)%y_centroid' : 0.E+00, - 'patch_icpp(3)%radius' : leng/5., - 'patch_icpp(3)%alter_patch(1)' : 'T', - 'patch_icpp(3)%vel(1)' : 0., - 'patch_icpp(3)%vel(2)' : 0.E+00, - 'patch_icpp(3)%pres' : 101325., - 'patch_icpp(3)%alpha_rho(1)' : 0.E+00, - 'patch_icpp(3)%alpha_rho(2)' : 0.167, - 'patch_icpp(3)%alpha(1)' : 0.E+00, - 'patch_icpp(3)%alpha(2)' : 1.E+00, - # ========================================================================== - - # Fluids Physical Parameters =============================================== - 'fluid_pp(1)%gamma' : 1.E+00/(1.4E+00-1.E+00), - 'fluid_pp(1)%pi_inf' : 0., - 'fluid_pp(2)%gamma' : 1.E+00/(1.6666E+00-1.E+00), - 'fluid_pp(2)%pi_inf' : 0.E+00, -# ============================================================================== -})) - -# ============================================================================== +print( + json.dumps( + { + # Logistics ================================================================ + "run_time_info": "T", + # Computational Domain Parameters ========================================== + "x_domain%beg": -leng / 2.0, + "x_domain%end": leng / 2 + 2 * leng, + "y_domain%beg": -leng / 2.0, + "y_domain%end": leng / 2.0, + "m": int(Nx), + "n": int(Ny), + "p": 0, + "dt": dt, + "t_step_start": 0, + "t_step_stop": Nt, + "t_step_save": int(Nt / 20.0), + # Simulation Algorithm Parameters ========================================== + "num_patches": 3, + "model_eqns": 2, + "alt_soundspeed": "F", + "num_fluids": 2, + "mpp_lim": "T", + "mixture_err": "T", + "time_stepper": 3, + "weno_order": 5, + "weno_eps": 1.0e-16, + "weno_Re_flux": "F", + "weno_avg": "F", + "mapped_weno": "T", + "null_weights": "F", + "mp_weno": "F", + "riemann_solver": 2, + "wave_speeds": 1, + "avg_state": 2, + "bc_x%beg": -6, + "bc_x%end": -6, + "bc_y%beg": -6, + "bc_y%end": -6, + # Formatted Database Files Structure Parameters ============================ + "format": 1, + "precision": 2, + "prim_vars_wrt": "T", + "parallel_io": "T", + # Patch 1: Background ====================================================== + "patch_icpp(1)%geometry": 3, + "patch_icpp(1)%x_centroid": 0.0, + "patch_icpp(1)%y_centroid": 0.0, + "patch_icpp(1)%length_x": 10 * leng, + "patch_icpp(1)%length_y": leng, + "patch_icpp(1)%vel(1)": vel, + "patch_icpp(1)%vel(2)": 0.0e00, + "patch_icpp(1)%pres": 101325.0, + "patch_icpp(1)%alpha_rho(1)": 1.29, + "patch_icpp(1)%alpha_rho(2)": 0.0e00, + "patch_icpp(1)%alpha(1)": 1.0e00, + "patch_icpp(1)%alpha(2)": 0.0e00, + # Patch 2: Shocked state =================================================== + "patch_icpp(2)%geometry": 3, + "patch_icpp(2)%alter_patch(1)": "T", + "patch_icpp(2)%x_centroid": -3 * leng / 8.0, + "patch_icpp(2)%y_centroid": 0.0, + "patch_icpp(2)%length_x": leng / 4.0, + "patch_icpp(2)%length_y": leng, + "patch_icpp(2)%vel(1)": vel, + "patch_icpp(2)%vel(2)": 0.0e00, + "patch_icpp(2)%pres": ps, + "patch_icpp(2)%alpha_rho(1)": 2.4, + "patch_icpp(2)%alpha_rho(2)": 0.0e00, + "patch_icpp(2)%alpha(1)": 1.0e00, + "patch_icpp(2)%alpha(2)": 0.0e00, + # Patch 3: Bubble ========================================================== + "patch_icpp(3)%geometry": 2, + "patch_icpp(3)%x_centroid": 0.0e00, + "patch_icpp(3)%y_centroid": 0.0e00, + "patch_icpp(3)%radius": leng / 5.0, + "patch_icpp(3)%alter_patch(1)": "T", + "patch_icpp(3)%vel(1)": 0.0, + "patch_icpp(3)%vel(2)": 0.0e00, + "patch_icpp(3)%pres": 101325.0, + "patch_icpp(3)%alpha_rho(1)": 0.0e00, + "patch_icpp(3)%alpha_rho(2)": 0.167, + "patch_icpp(3)%alpha(1)": 0.0e00, + "patch_icpp(3)%alpha(2)": 1.0e00, + # Fluids Physical Parameters =============================================== + "fluid_pp(1)%gamma": 1.0e00 / (1.4e00 - 1.0e00), + "fluid_pp(1)%pi_inf": 0.0, + "fluid_pp(2)%gamma": 1.0e00 / (1.6666e00 - 1.0e00), + "fluid_pp(2)%pi_inf": 0.0e00, + } + ) +) diff --git a/examples/2D_shockdroplet/case.py b/examples/2D_shockdroplet/case.py index 8a225deee2..d6dbe0e5a5 100755 --- a/examples/2D_shockdroplet/case.py +++ b/examples/2D_shockdroplet/case.py @@ -4,134 +4,122 @@ Ma = 1.4 ps = 238558 -rho_post_a=2.18 -rho_a=1.204 -rho_w=1000 +rho_post_a = 2.18 +rho_a = 1.204 +rho_w = 1000 gam_a = 1.4 -gam_w=6.12 -pi_w=3.43E8 +gam_w = 6.12 +pi_w = 3.43e8 vel = 226 rho = 1 -c_l = math.sqrt( 1.4*ps/rho ) +c_l = math.sqrt(1.4 * ps / rho) eps = 1e-9 D = 0.048 -Ny = 299. -Nx =1199. -dx = 0.25/Nx #8.3e-6 +Ny = 299.0 +Nx = 1199.0 +dx = 0.25 / Nx # 8.3e-6 -time_end = 0.005#50us +time_end = 0.005 # 50us cfl = 0.25 -dt = cfl * dx/c_l #5.3E-9 -Nt = int(time_end/dt)#10000 +dt = cfl * dx / c_l # 5.3E-9 +Nt = int(time_end / dt) # 10000 -print(json.dumps({ - # Logistics ================================================ - 'run_time_info' : 'F', - # ========================================================== - - # Computational Domain Parameters ========================== - 'x_domain%beg' : -4*D, - 'x_domain%end' : 20*D, - 'y_domain%beg' : 0, - 'y_domain%end' : 6*D, - 'stretch_y' : 'T', - 'a_y' : 3.67, - 'y_a' : -5.7*D, - 'y_b' : 5.7*D, - 'loops_y' : 2, - 'm' : int(Nx), - 'n' : int(Ny), - 'p' : 0, - 'dt' : dt, - 't_step_start' : 0, - 't_step_stop' : Nt, - 't_step_save' : Nt, #math.ceil(Nt/100), - # ========================================================== - - # Simulation Algorithm Parameters ========================== - 'num_patches' : 3, - 'model_eqns' : 2, - 'alt_soundspeed' : 'F', - 'num_fluids' : 2, - 'mpp_lim' : 'T', - 'mixture_err' : 'T', - 'time_stepper' : 3, - 'weno_order' : 5, - 'weno_eps' : 1.E-16, - 'weno_Re_flux' : 'F', - 'weno_avg' : 'F', - 'mapped_weno' : 'T', - 'null_weights' : 'F', - 'mp_weno' : 'F', - 'riemann_solver' : 2, - 'wave_speeds' : 1, - 'avg_state' : 2, - 'bc_x%beg' : -6,#11, - 'bc_x%end' : -6,#12 - 'bc_y%beg' : -2, - 'bc_y%end' : -3, - # ========================================================== - - # Formatted Database Files Structure Parameters ============ - 'format' : 1, - 'precision' : 2, - 'prim_vars_wrt' :'T', - 'parallel_io' :'T', - # ========================================================== - - # Patch 1: Background ============================ - 'patch_icpp(1)%geometry' : 3, - 'patch_icpp(1)%x_centroid' : 8*D, - 'patch_icpp(1)%y_centroid' : 6*D, - 'patch_icpp(1)%length_x' : 24*D, - 'patch_icpp(1)%length_y' : 14*D, - 'patch_icpp(1)%vel(1)' : 0., - 'patch_icpp(1)%vel(2)' : 0.E+00, - 'patch_icpp(1)%pres' : 101325., - 'patch_icpp(1)%alpha_rho(1)' : eps*1000, - 'patch_icpp(1)%alpha_rho(2)' : (1-eps)*1.17, - 'patch_icpp(1)%alpha(1)' : eps, - 'patch_icpp(1)%alpha(2)' : 1 - eps, - # ========================================================== - - # Patch 2: Shocked state ============================ - 'patch_icpp(2)%geometry' : 3, - 'patch_icpp(2)%alter_patch(1)' : 'T', - 'patch_icpp(2)%x_centroid' : -2.5*D, - 'patch_icpp(2)%y_centroid' : 6*D, - 'patch_icpp(2)%length_x' : 3*D, - 'patch_icpp(2)%length_y' : 14*D, - 'patch_icpp(2)%vel(1)' : vel, - 'patch_icpp(2)%vel(2)' : 0.E+00, - 'patch_icpp(2)%pres' : ps, - 'patch_icpp(2)%alpha_rho(1)' : eps*1000, - 'patch_icpp(2)%alpha_rho(2)' : (1-eps)*rho_post_a, - 'patch_icpp(2)%alpha(1)' : eps, - 'patch_icpp(2)%alpha(2)' : 1 - eps, - # ========================================================== - - # Patch 3: Bubble ====================================== - 'patch_icpp(3)%geometry' : 2, - 'patch_icpp(3)%x_centroid' : 0, - 'patch_icpp(3)%y_centroid' : 0, - 'patch_icpp(3)%radius' : D/2, - 'patch_icpp(3)%alter_patch(1)' : 'T', - 'patch_icpp(3)%vel(1)' : 0., - 'patch_icpp(3)%vel(2)' : 0.E+00, - 'patch_icpp(3)%pres' : 101325., - 'patch_icpp(3)%alpha_rho(1)' : (1-eps)*rho_w, - 'patch_icpp(3)%alpha_rho(2)' : eps*1.17, - 'patch_icpp(3)%alpha(1)' : 1 - eps,# 0.95 - 'patch_icpp(3)%alpha(2)' : eps,#0.05, - - # ========================================================== - - # Fluids Physical Parameters =============================== - 'fluid_pp(1)%gamma' : 1.E+00/(gam_w-1.E+00), - 'fluid_pp(1)%pi_inf' : pi_w*gam_w/(gam_w-1.E+00), - 'fluid_pp(2)%gamma' : 1.E+00/(gam_a-1.E+00), - 'fluid_pp(2)%pi_inf' : 0.E+00, - # ========================================================== -})) +print( + json.dumps( + { + # Logistics ================================================ + "run_time_info": "F", + # Computational Domain Parameters ========================== + "x_domain%beg": -4 * D, + "x_domain%end": 20 * D, + "y_domain%beg": 0, + "y_domain%end": 6 * D, + "stretch_y": "T", + "a_y": 3.67, + "y_a": -5.7 * D, + "y_b": 5.7 * D, + "loops_y": 2, + "m": int(Nx), + "n": int(Ny), + "p": 0, + "dt": dt, + "t_step_start": 0, + "t_step_stop": Nt, + "t_step_save": Nt, # math.ceil(Nt/100), + # Simulation Algorithm Parameters ========================== + "num_patches": 3, + "model_eqns": 2, + "alt_soundspeed": "F", + "num_fluids": 2, + "mpp_lim": "T", + "mixture_err": "T", + "time_stepper": 3, + "weno_order": 5, + "weno_eps": 1.0e-16, + "weno_Re_flux": "F", + "weno_avg": "F", + "mapped_weno": "T", + "null_weights": "F", + "mp_weno": "F", + "riemann_solver": 2, + "wave_speeds": 1, + "avg_state": 2, + "bc_x%beg": -6, # 11, + "bc_x%end": -6, # 12 + "bc_y%beg": -2, + "bc_y%end": -3, + # Formatted Database Files Structure Parameters ============ + "format": 1, + "precision": 2, + "prim_vars_wrt": "T", + "parallel_io": "T", + # Patch 1: Background ============================ + "patch_icpp(1)%geometry": 3, + "patch_icpp(1)%x_centroid": 8 * D, + "patch_icpp(1)%y_centroid": 6 * D, + "patch_icpp(1)%length_x": 24 * D, + "patch_icpp(1)%length_y": 14 * D, + "patch_icpp(1)%vel(1)": 0.0, + "patch_icpp(1)%vel(2)": 0.0e00, + "patch_icpp(1)%pres": 101325.0, + "patch_icpp(1)%alpha_rho(1)": eps * 1000, + "patch_icpp(1)%alpha_rho(2)": (1 - eps) * 1.17, + "patch_icpp(1)%alpha(1)": eps, + "patch_icpp(1)%alpha(2)": 1 - eps, + # Patch 2: Shocked state ============================ + "patch_icpp(2)%geometry": 3, + "patch_icpp(2)%alter_patch(1)": "T", + "patch_icpp(2)%x_centroid": -2.5 * D, + "patch_icpp(2)%y_centroid": 6 * D, + "patch_icpp(2)%length_x": 3 * D, + "patch_icpp(2)%length_y": 14 * D, + "patch_icpp(2)%vel(1)": vel, + "patch_icpp(2)%vel(2)": 0.0e00, + "patch_icpp(2)%pres": ps, + "patch_icpp(2)%alpha_rho(1)": eps * 1000, + "patch_icpp(2)%alpha_rho(2)": (1 - eps) * rho_post_a, + "patch_icpp(2)%alpha(1)": eps, + "patch_icpp(2)%alpha(2)": 1 - eps, + # Patch 3: Bubble ====================================== + "patch_icpp(3)%geometry": 2, + "patch_icpp(3)%x_centroid": 0, + "patch_icpp(3)%y_centroid": 0, + "patch_icpp(3)%radius": D / 2, + "patch_icpp(3)%alter_patch(1)": "T", + "patch_icpp(3)%vel(1)": 0.0, + "patch_icpp(3)%vel(2)": 0.0e00, + "patch_icpp(3)%pres": 101325.0, + "patch_icpp(3)%alpha_rho(1)": (1 - eps) * rho_w, + "patch_icpp(3)%alpha_rho(2)": eps * 1.17, + "patch_icpp(3)%alpha(1)": 1 - eps, # 0.95 + "patch_icpp(3)%alpha(2)": eps, # 0.05, + # Fluids Physical Parameters =============================== + "fluid_pp(1)%gamma": 1.0e00 / (gam_w - 1.0e00), + "fluid_pp(1)%pi_inf": pi_w * gam_w / (gam_w - 1.0e00), + "fluid_pp(2)%gamma": 1.0e00 / (gam_a - 1.0e00), + "fluid_pp(2)%pi_inf": 0.0e00, + } + ) +) diff --git a/examples/2D_shocktube_phasechange/case.py b/examples/2D_shocktube_phasechange/case.py index 35a2861db9..34675cd270 100644 --- a/examples/2D_shocktube_phasechange/case.py +++ b/examples/2D_shocktube_phasechange/case.py @@ -1,21 +1,22 @@ #!/usr/bin/env python3 import math, json + ## 1 FOR BACKGROUND, 2 FOR SHOKED STATE, 3 FOR WATER REGION (WHEN NEEDED) # Pressure -p01 = 1.0843E+05 -p02 = 2.1114E+05 -p03 = 1.0685E+05 +p01 = 1.0843e05 +p02 = 2.1114e05 +p03 = 1.0685e05 ## FLUID PROPERTIES FOR EACH PATCH ## liquid water # pi infty -piwl = 1.0E+09 +piwl = 1.0e09 # qv qvwl = -1167000 # qv' -qvpwl = 0.0E0 +qvpwl = 0.0e0 # cv cvwl = 1816 # cp @@ -24,18 +25,18 @@ gamwl = cpwl / cvwl # density -rho0wl1 = 1.08599E+03 -rho0wl2 = 1.02883E+03 -rho0wl3 = 1.08714E+03 +rho0wl1 = 1.08599e03 +rho0wl2 = 1.02883e03 +rho0wl3 = 1.08714e03 # volume fraction -awl1 = 2.2640E-05 -awl2 = 5.7742E-05 -awl3 = 6.5969E-03 +awl1 = 2.2640e-05 +awl2 = 5.7742e-05 +awl3 = 6.5969e-03 # speed of sound -c_wl1 = math.sqrt( gamwl * ( p01 + piwl ) / rho0wl1 ) -c_wl2 = math.sqrt( gamwl * ( p02 + piwl ) / rho0wl2 ) +c_wl1 = math.sqrt(gamwl * (p01 + piwl) / rho0wl1) +c_wl2 = math.sqrt(gamwl * (p02 + piwl) / rho0wl2) ## Vapor water @@ -53,27 +54,27 @@ gamwv = cpwv / cvwv # density -rho0wv1 = 6.45561E-01 -rho0wv2 = 1.19086E+00 -rho0wv3 = 6.36894E-01 +rho0wv1 = 6.45561e-01 +rho0wv2 = 1.19086e00 +rho0wv3 = 6.36894e-01 # volume fraction -awv1 = 9.3851E-02 -awv2 = 2.9270E-02 -awv3 = 5.9082E-01 +awv1 = 9.3851e-02 +awv2 = 2.9270e-02 +awv3 = 5.9082e-01 # speed of sound -c_wv1 = math.sqrt( gamwv * ( p01 + piwv ) / rho0wv1 ) -c_wv2 = math.sqrt( gamwv * ( p02 + piwv ) / rho0wv2 ) +c_wv1 = math.sqrt(gamwv * (p01 + piwv) / rho0wv1) +c_wv2 = math.sqrt(gamwv * (p02 + piwv) / rho0wv2) # Air # pi infinity pia = 0 # qv -qva = 0E0 +qva = 0e0 # qv' -qvpa = 0E0 +qvpa = 0e0 # cv cva = 717.5 # cp @@ -81,10 +82,10 @@ # gamma gama = cpa / cva -#density -rho0a1 = 1.000227E+00 -rho0a2 = 1.845120E+00 -rho0a3 = 9.867987E-01 +# density +rho0a1 = 1.000227e00 +rho0a2 = 1.845120e00 +rho0a3 = 9.867987e-01 # volume fractions aa1 = 1 - awl1 - awv1 @@ -92,14 +93,14 @@ aa3 = 1 - awl3 - awv3 # Speed of sound -c_a1 = math.sqrt( gama * ( p01 + pia ) / rho0a1 ) -c_a2 = math.sqrt( gama * ( p02 + pia ) / rho0a2 ) +c_a1 = math.sqrt(gama * (p01 + pia) / rho0a1) +c_a2 = math.sqrt(gama * (p02 + pia) / rho0a2) ## SHOCK RELATIONS p02Op01 = p02 / p01 # Mach number of the shocked region - this should agree with Min, if everything is correct -Ms = math.sqrt( ( gama + 1. ) / ( 2. * gama ) * ( p02Op01 - 1. ) * ( p02 / ( p02 + pia ) ) + 1.0 ) +Ms = math.sqrt((gama + 1.0) / (2.0 * gama) * (p02Op01 - 1.0) * (p02 / (p02 + pia)) + 1.0) # shock speed ss = Ms * c_a1 @@ -111,25 +112,25 @@ # discretization parameters for the x direction # number of elements -Nx = 250 +Nx = 250 # domain boundaries xb = 0.00 xe = 0.25 # typical cell size -dx = ( xe - xb ) / Nx +dx = (xe - xb) / Nx # discretization parameters for the y direction # number of elements -Ny = 50 +Ny = 50 # domain boundaries yb = 0.0 ye = 0.1 # typical cell size -dy = ( ye - yb ) / Ny +dy = (ye - yb) / Ny # time step dt = cfl * dx / ss @@ -138,13 +139,13 @@ SF = 40 # making Nt divisible by SF -tendA = ( xe - xb ) / ss * 5/24 +tendA = (xe - xb) / ss * 5 / 24 # 1 - ensure NtA is sufficient to go a little beyond tendA -NtA = int( tendA//dt + 1 ) +NtA = int(tendA // dt + 1) # Array of saves. it is the same as Nt/Sf = t_step_save -AS = int( NtA // SF + 1 ) +AS = int(NtA // SF + 1) # Nt = total number of steps. Ensure Nt > NtA (so the total tendA is covered) Nt = AS * SF @@ -153,117 +154,114 @@ tend = Nt * dt # Configuring case dictionary ================================================== -print(json.dumps({ - # Logistics ================================================ - 'run_time_info': 'T', - # ========================================================== - # Computational Domain Parameters ========================== - 'x_domain%beg' : xb, - 'x_domain%end' : xe, - 'y_domain%beg' : yb, - 'y_domain%end' : ye, - 'm' : Nx, - 'n' : Ny, - 'p' : 0, - 'dt' : dt, - 't_step_start' : 0, - 't_step_stop' : Nt, - 't_step_save' : AS, - # ========================================================== - # Simulation Algorithm Parameters ========================== - 'num_patches' : 3, - 'model_eqns' : 3, - 'num_fluids' : 3, - 'mpp_lim' : 'T', - 'mixture_err' : 'T', - 'relax' : 'T', - 'relax_model' : 6, - 'palpha_eps' : 1.0E-2, - 'ptgalpha_eps' : 1.0E-2, - 'time_stepper' : 3, - 'weno_order' : 3, - 'weno_eps' : 1.0E-16, - 'mapped_weno' : 'T', - 'null_weights' : 'F', - 'mp_weno' : 'F', - 'riemann_solver' : 2, - 'wave_speeds' : 1, - 'avg_state' : 2, - 'bc_x%beg' : -6, - 'bc_x%end' : -6, - 'bc_y%beg' : -2, - 'bc_y%end' : -6, - # ========================================================== - # Formatted Database Files Structure Parameters ============ - 'format' : 1, - 'precision' : 2, - 'prim_vars_wrt':'T', - 'parallel_io' :'T', - # ========================================================== - # Patch 1 - Background ===================================== - 'patch_icpp(1)%geometry' : 3, - 'patch_icpp(1)%x_centroid' : ( xe + xb ) * 2 / 4, - 'patch_icpp(1)%y_centroid' : ( ye + yb ) * 2 / 4, - 'patch_icpp(1)%length_x' : ( xe - xb ) * 2 / 2, - 'patch_icpp(1)%length_y' : ( ye - yb ) * 2 / 2, - 'patch_icpp(1)%vel(1)' : 0.0E+00, - 'patch_icpp(1)%vel(2)' : 0.0E+00, - 'patch_icpp(1)%pres' : p01, - 'patch_icpp(1)%alpha_rho(1)' : awl1 * rho0wl1, - 'patch_icpp(1)%alpha_rho(2)' : awv1 * rho0wv1, - 'patch_icpp(1)%alpha_rho(3)' : aa1 * rho0a1, - 'patch_icpp(1)%alpha(1)' : awl1, - 'patch_icpp(1)%alpha(2)' : awv1, - 'patch_icpp(1)%alpha(3)' : aa1, - # ========================================================== - # Patch 2 - Shocked State ================================== - 'patch_icpp(2)%geometry' : 3, - 'patch_icpp(2)%x_centroid' : ( xe + xb ) * 1 / 4, - 'patch_icpp(2)%y_centroid' : ( ye + yb ) * 2 / 4, - 'patch_icpp(2)%length_x' : ( xe - xb ) * 1 / 2, - 'patch_icpp(2)%length_y' : ( ye - yb ) * 2 / 2, - 'patch_icpp(2)%vel(1)' : 0.0E00, - 'patch_icpp(2)%vel(2)' : 0.0E00, - 'patch_icpp(2)%pres' : p02, - 'patch_icpp(2)%alpha_rho(1)' : awl2 * rho0wl2, - 'patch_icpp(2)%alpha_rho(2)' : awv2 * rho0wv2, - 'patch_icpp(2)%alpha_rho(3)' : aa2 * rho0a2, - 'patch_icpp(2)%alpha(1)' : awl2, - 'patch_icpp(2)%alpha(2)' : awv2, - 'patch_icpp(2)%alpha(3)' : aa2, - 'patch_icpp(2)%alter_patch(1)' : 'T', - # ========================================================== - # patch 3: Water ============================================ - 'patch_icpp(3)%geometry' : 3, - 'patch_icpp(3)%x_centroid' : ( xe + xb ) * 2.5 / 4, - 'patch_icpp(3)%y_centroid' : ( ye + yb ) * 2 / 4, - 'patch_icpp(3)%length_x' : ( xe - xb ) * 1 / 8, - 'patch_icpp(3)%length_y' : ( ye - yb ) * 2 / 2, - 'patch_icpp(3)%vel(1)' : 0.0E00, - 'patch_icpp(3)%vel(2)' : 0.0E00, - 'patch_icpp(3)%pres' : p03, - 'patch_icpp(3)%alpha_rho(1)' : awl3 * rho0wl3, - 'patch_icpp(3)%alpha_rho(2)' : awv3 * rho0wv3, - 'patch_icpp(3)%alpha_rho(3)' : aa3 * rho0a3, - 'patch_icpp(3)%alpha(1)' : awl3, - 'patch_icpp(3)%alpha(2)' : awv3, - 'patch_icpp(3)%alpha(3)' : aa3, - 'patch_icpp(3)%alter_patch(1)' : 'T', - # Fluids Physical Parameters =============================== - 'fluid_pp(1)%gamma' : 1.0E+00 / ( gamwl - 1 ), - 'fluid_pp(1)%pi_inf' : gamwl * piwl / ( gamwl - 1 ), - 'fluid_pp(1)%cv' : cvwl, - 'fluid_pp(1)%qv' : qvwl, - 'fluid_pp(1)%qvp' : qvpwl, - 'fluid_pp(2)%gamma' : 1.0E+00 / ( gamwv - 1 ), - 'fluid_pp(2)%pi_inf' : gamwv * piwv / ( gamwv - 1 ), - 'fluid_pp(2)%cv' : cvwv, - 'fluid_pp(2)%qv' : qvwv, - 'fluid_pp(2)%qvp' : qvpwv, - 'fluid_pp(3)%gamma' : 1.0E+00 / ( gama - 1 ), - 'fluid_pp(3)%pi_inf' : gama * pia / ( gama - 1 ), - 'fluid_pp(3)%cv' : cva, - 'fluid_pp(3)%qv' : qva, - 'fluid_pp(3)%qvp' : qvpa, - # ========================================================== -})) +print( + json.dumps( + { + # Logistics ================================================ + "run_time_info": "T", + # Computational Domain Parameters ========================== + "x_domain%beg": xb, + "x_domain%end": xe, + "y_domain%beg": yb, + "y_domain%end": ye, + "m": Nx, + "n": Ny, + "p": 0, + "dt": dt, + "t_step_start": 0, + "t_step_stop": Nt, + "t_step_save": AS, + # Simulation Algorithm Parameters ========================== + "num_patches": 3, + "model_eqns": 3, + "num_fluids": 3, + "mpp_lim": "T", + "mixture_err": "T", + "relax": "T", + "relax_model": 6, + "palpha_eps": 1.0e-2, + "ptgalpha_eps": 1.0e-2, + "time_stepper": 3, + "weno_order": 3, + "weno_eps": 1.0e-16, + "mapped_weno": "T", + "null_weights": "F", + "mp_weno": "F", + "riemann_solver": 2, + "wave_speeds": 1, + "avg_state": 2, + "bc_x%beg": -6, + "bc_x%end": -6, + "bc_y%beg": -2, + "bc_y%end": -6, + # Formatted Database Files Structure Parameters ============ + "format": 1, + "precision": 2, + "prim_vars_wrt": "T", + "parallel_io": "T", + # Patch 1 - Background ===================================== + "patch_icpp(1)%geometry": 3, + "patch_icpp(1)%x_centroid": (xe + xb) * 2 / 4, + "patch_icpp(1)%y_centroid": (ye + yb) * 2 / 4, + "patch_icpp(1)%length_x": (xe - xb) * 2 / 2, + "patch_icpp(1)%length_y": (ye - yb) * 2 / 2, + "patch_icpp(1)%vel(1)": 0.0e00, + "patch_icpp(1)%vel(2)": 0.0e00, + "patch_icpp(1)%pres": p01, + "patch_icpp(1)%alpha_rho(1)": awl1 * rho0wl1, + "patch_icpp(1)%alpha_rho(2)": awv1 * rho0wv1, + "patch_icpp(1)%alpha_rho(3)": aa1 * rho0a1, + "patch_icpp(1)%alpha(1)": awl1, + "patch_icpp(1)%alpha(2)": awv1, + "patch_icpp(1)%alpha(3)": aa1, + # Patch 2 - Shocked State ================================== + "patch_icpp(2)%geometry": 3, + "patch_icpp(2)%x_centroid": (xe + xb) * 1 / 4, + "patch_icpp(2)%y_centroid": (ye + yb) * 2 / 4, + "patch_icpp(2)%length_x": (xe - xb) * 1 / 2, + "patch_icpp(2)%length_y": (ye - yb) * 2 / 2, + "patch_icpp(2)%vel(1)": 0.0e00, + "patch_icpp(2)%vel(2)": 0.0e00, + "patch_icpp(2)%pres": p02, + "patch_icpp(2)%alpha_rho(1)": awl2 * rho0wl2, + "patch_icpp(2)%alpha_rho(2)": awv2 * rho0wv2, + "patch_icpp(2)%alpha_rho(3)": aa2 * rho0a2, + "patch_icpp(2)%alpha(1)": awl2, + "patch_icpp(2)%alpha(2)": awv2, + "patch_icpp(2)%alpha(3)": aa2, + "patch_icpp(2)%alter_patch(1)": "T", + # patch 3: Water ============================================ + "patch_icpp(3)%geometry": 3, + "patch_icpp(3)%x_centroid": (xe + xb) * 2.5 / 4, + "patch_icpp(3)%y_centroid": (ye + yb) * 2 / 4, + "patch_icpp(3)%length_x": (xe - xb) * 1 / 8, + "patch_icpp(3)%length_y": (ye - yb) * 2 / 2, + "patch_icpp(3)%vel(1)": 0.0e00, + "patch_icpp(3)%vel(2)": 0.0e00, + "patch_icpp(3)%pres": p03, + "patch_icpp(3)%alpha_rho(1)": awl3 * rho0wl3, + "patch_icpp(3)%alpha_rho(2)": awv3 * rho0wv3, + "patch_icpp(3)%alpha_rho(3)": aa3 * rho0a3, + "patch_icpp(3)%alpha(1)": awl3, + "patch_icpp(3)%alpha(2)": awv3, + "patch_icpp(3)%alpha(3)": aa3, + "patch_icpp(3)%alter_patch(1)": "T", + # Fluids Physical Parameters =============================== + "fluid_pp(1)%gamma": 1.0e00 / (gamwl - 1), + "fluid_pp(1)%pi_inf": gamwl * piwl / (gamwl - 1), + "fluid_pp(1)%cv": cvwl, + "fluid_pp(1)%qv": qvwl, + "fluid_pp(1)%qvp": qvpwl, + "fluid_pp(2)%gamma": 1.0e00 / (gamwv - 1), + "fluid_pp(2)%pi_inf": gamwv * piwv / (gamwv - 1), + "fluid_pp(2)%cv": cvwv, + "fluid_pp(2)%qv": qvwv, + "fluid_pp(2)%qvp": qvpwv, + "fluid_pp(3)%gamma": 1.0e00 / (gama - 1), + "fluid_pp(3)%pi_inf": gama * pia / (gama - 1), + "fluid_pp(3)%cv": cva, + "fluid_pp(3)%qv": qva, + "fluid_pp(3)%qvp": qvpa, + } + ) +) diff --git a/examples/2D_triple_point/case.py b/examples/2D_triple_point/case.py index 59ac429b05..4d699b039c 100755 --- a/examples/2D_triple_point/case.py +++ b/examples/2D_triple_point/case.py @@ -6,112 +6,101 @@ Nx = 699 Ny = 299 -print(json.dumps({ - # Logistics ================================================ - 'run_time_info' : 'F', - # ========================================================== - - # Computational Domain Parameters ========================== - 'x_domain%beg' : 0, - 'x_domain%end' : 7, - 'y_domain%beg' : 0, - 'y_domain%end' : 3, - 'm' : int(Nx), - 'n' : int(Ny), - 'p' : 0, - 'cfl_adap_dt' : 'T', - 'cfl_target' : 0.8, - 'n_start' : 0, - 't_stop' : 4.0, - 't_save' : 0.04, - # ========================================================== - - # Simulation Algorithm Parameters ========================== - 'num_patches' : 3, - 'model_eqns' : 2, - 'alt_soundspeed' : 'F', - 'num_fluids' : 2, - 'mpp_lim' : 'T', - 'mixture_err' : 'T', - 'time_stepper' : 3, - 'weno_order' : 7, - 'weno_eps' : 1.E-16, - 'weno_Re_flux' : 'F', - 'weno_avg' : 'F', - 'mapped_weno' : 'T', - 'null_weights' : 'F', - 'mp_weno' : 'F', - 'riemann_solver' : 2, - 'wave_speeds' : 1, - 'avg_state' : 2, - 'bc_x%beg' : -3,#11, - 'bc_x%end' : -3,#12 - 'bc_y%beg' : -3, - 'bc_y%end' : -3, - # ========================================================== - - # Formatted Database Files Structure Parameters ============ - 'format' : 1, - 'precision' : 2, - 'prim_vars_wrt' :'T', - 'schlieren_wrt' :'T', - 'fd_order' : 4, - 'schlieren_alpha(1)' : 0.5, - 'schlieren_alpha(2)' : 0.5, - 'parallel_io' :'T', - # ========================================================== - - # Patch 1: Left state ==================================== - 'patch_icpp(1)%geometry' : 3, - 'patch_icpp(1)%x_centroid' : 0.5, - 'patch_icpp(1)%y_centroid' : 3, - 'patch_icpp(1)%length_x' : 1, - 'patch_icpp(1)%length_y' : 6, - 'patch_icpp(1)%vel(1)' : 0., - 'patch_icpp(1)%vel(2)' : 0., - 'patch_icpp(1)%pres' : 1., - 'patch_icpp(1)%alpha_rho(1)' : (1 - eps)*1., - 'patch_icpp(1)%alpha_rho(2)' : eps, - 'patch_icpp(1)%alpha(1)' : 1 - eps, - 'patch_icpp(1)%alpha(2)' : eps, - # ========================================================== - - # Patch 2: Top right state ================================ - 'patch_icpp(2)%geometry' : 3, - 'patch_icpp(2)%alter_patch(1)' : 'T', - 'patch_icpp(2)%x_centroid' : 4, - 'patch_icpp(2)%y_centroid' : 2.25, - 'patch_icpp(2)%length_x' : 6, - 'patch_icpp(2)%length_y' : 1.5, - 'patch_icpp(2)%vel(1)' : 0., - 'patch_icpp(2)%vel(2)' : 0., - 'patch_icpp(2)%pres' : 0.1, - 'patch_icpp(2)%alpha_rho(1)' : (1-eps)*0.125, - 'patch_icpp(2)%alpha_rho(2)' : eps, - 'patch_icpp(2)%alpha(1)' : 1 - eps, - 'patch_icpp(2)%alpha(2)' : eps, - # ========================================================== - - # Patch 3: Bottom right state ============================= - 'patch_icpp(3)%geometry' : 3, - 'patch_icpp(3)%alter_patch(1)' : 'T', - 'patch_icpp(3)%x_centroid' : 4, - 'patch_icpp(3)%y_centroid' : 0.75, - 'patch_icpp(3)%length_x' : 6, - 'patch_icpp(3)%length_y' : 1.5, - 'patch_icpp(3)%vel(1)' : 0., - 'patch_icpp(3)%vel(2)' : 0., - 'patch_icpp(3)%pres' : 0.1, - 'patch_icpp(3)%alpha_rho(1)' : eps, - 'patch_icpp(3)%alpha_rho(2)' : (1 - eps)*1., - 'patch_icpp(3)%alpha(1)' : eps,# 0.95 - 'patch_icpp(3)%alpha(2)' : 1 - eps,#0.05, - # ========================================================== - - # Fluids Physical Parameters =============================== - 'fluid_pp(1)%gamma' : 1./(1.5 - 1.), - 'fluid_pp(1)%pi_inf' : 0, - 'fluid_pp(2)%gamma' : 1./(1.4 - 1.), - 'fluid_pp(2)%pi_inf' : 0., - # ========================================================== -})) +print( + json.dumps( + { + # Logistics ================================================ + "run_time_info": "F", + # Computational Domain Parameters ========================== + "x_domain%beg": 0, + "x_domain%end": 7, + "y_domain%beg": 0, + "y_domain%end": 3, + "m": int(Nx), + "n": int(Ny), + "p": 0, + "cfl_adap_dt": "T", + "cfl_target": 0.8, + "n_start": 0, + "t_stop": 4.0, + "t_save": 0.04, + # Simulation Algorithm Parameters ========================== + "num_patches": 3, + "model_eqns": 2, + "alt_soundspeed": "F", + "num_fluids": 2, + "mpp_lim": "T", + "mixture_err": "T", + "time_stepper": 3, + "weno_order": 7, + "weno_eps": 1.0e-16, + "weno_Re_flux": "F", + "weno_avg": "F", + "mapped_weno": "T", + "null_weights": "F", + "mp_weno": "F", + "riemann_solver": 2, + "wave_speeds": 1, + "avg_state": 2, + "bc_x%beg": -3, # 11, + "bc_x%end": -3, # 12 + "bc_y%beg": -3, + "bc_y%end": -3, + # Formatted Database Files Structure Parameters ============ + "format": 1, + "precision": 2, + "prim_vars_wrt": "T", + "schlieren_wrt": "T", + "fd_order": 4, + "schlieren_alpha(1)": 0.5, + "schlieren_alpha(2)": 0.5, + "parallel_io": "T", + # Patch 1: Left state ==================================== + "patch_icpp(1)%geometry": 3, + "patch_icpp(1)%x_centroid": 0.5, + "patch_icpp(1)%y_centroid": 3, + "patch_icpp(1)%length_x": 1, + "patch_icpp(1)%length_y": 6, + "patch_icpp(1)%vel(1)": 0.0, + "patch_icpp(1)%vel(2)": 0.0, + "patch_icpp(1)%pres": 1.0, + "patch_icpp(1)%alpha_rho(1)": (1 - eps) * 1.0, + "patch_icpp(1)%alpha_rho(2)": eps, + "patch_icpp(1)%alpha(1)": 1 - eps, + "patch_icpp(1)%alpha(2)": eps, + # Patch 2: Top right state ================================ + "patch_icpp(2)%geometry": 3, + "patch_icpp(2)%alter_patch(1)": "T", + "patch_icpp(2)%x_centroid": 4, + "patch_icpp(2)%y_centroid": 2.25, + "patch_icpp(2)%length_x": 6, + "patch_icpp(2)%length_y": 1.5, + "patch_icpp(2)%vel(1)": 0.0, + "patch_icpp(2)%vel(2)": 0.0, + "patch_icpp(2)%pres": 0.1, + "patch_icpp(2)%alpha_rho(1)": (1 - eps) * 0.125, + "patch_icpp(2)%alpha_rho(2)": eps, + "patch_icpp(2)%alpha(1)": 1 - eps, + "patch_icpp(2)%alpha(2)": eps, + # Patch 3: Bottom right state ============================= + "patch_icpp(3)%geometry": 3, + "patch_icpp(3)%alter_patch(1)": "T", + "patch_icpp(3)%x_centroid": 4, + "patch_icpp(3)%y_centroid": 0.75, + "patch_icpp(3)%length_x": 6, + "patch_icpp(3)%length_y": 1.5, + "patch_icpp(3)%vel(1)": 0.0, + "patch_icpp(3)%vel(2)": 0.0, + "patch_icpp(3)%pres": 0.1, + "patch_icpp(3)%alpha_rho(1)": eps, + "patch_icpp(3)%alpha_rho(2)": (1 - eps) * 1.0, + "patch_icpp(3)%alpha(1)": eps, # 0.95 + "patch_icpp(3)%alpha(2)": 1 - eps, # 0.05, + # Fluids Physical Parameters =============================== + "fluid_pp(1)%gamma": 1.0 / (1.5 - 1.0), + "fluid_pp(1)%pi_inf": 0, + "fluid_pp(2)%gamma": 1.0 / (1.4 - 1.0), + "fluid_pp(2)%pi_inf": 0.0, + } + ) +) diff --git a/examples/2D_viscous/case.py b/examples/2D_viscous/case.py index cb70581155..6cd8a1921b 100644 --- a/examples/2D_viscous/case.py +++ b/examples/2D_viscous/case.py @@ -1,5 +1,4 @@ #!/usr/bin/env python3 - #!/usr/bin/env python3 # Dependencies and Logistics =================================================== # Command to navigate between directories @@ -7,107 +6,96 @@ import math import json -myeps=1.4/150. +myeps = 1.4 / 150.0 -p_l, p_g = 1E+06, 1E+06 -rho_l, rho_g = 1000., 1. -v_l, v_g = 500., -500. -c_l, c_g = math.sqrt( ( p_l+4.E8)/rho_l ), math.sqrt( 1.4*p_g/rho_g ) +p_l, p_g = 1e06, 1e06 +rho_l, rho_g = 1000.0, 1.0 +v_l, v_g = 500.0, -500.0 +c_l, c_g = math.sqrt((p_l + 4.0e8) / rho_l), math.sqrt(1.4 * p_g / rho_g) # Configuring case dictionary -print(json.dumps({ - # Logistics ================================================================ - 'run_time_info' : 'T', - # ========================================================================== - - # Computational Domain Parameters ========================================== - 'x_domain%beg' : -0.5, - 'x_domain%end' : 0.5, - 'y_domain%beg' : -0.5, - 'y_domain%end' : 0.5, - 'cyl_coord' : 'F', - 'm' : 99, - 'n' : 99, - 'p' : 0, - 'dt' : 5.E-10, - 't_step_start' : 0, - 't_step_stop' : 2000, - 't_step_save' : 20, - # ========================================================================== - - # Simulation Algorithm Parameters ========================================== - 'num_patches' : 2, - 'model_eqns' : 2, - 'alt_soundspeed' : 'F', - 'num_fluids' : 2, - 'mpp_lim' : 'T', - 'mixture_err' : 'T', - 'time_stepper' : 3, - 'weno_order' : 5, - 'weno_eps' : 1.E-16, - 'mapped_weno' : 'T', - 'null_weights' : 'F', - 'mp_weno' : 'F', - 'weno_Re_flux' : 'T', - 'weno_avg' : 'T', - 'riemann_solver' : 2, - 'wave_speeds' : 1, - 'avg_state' : 2, - 'bc_x%beg' : -1, - 'bc_x%end' : -1, - 'bc_y%beg' : -6, - 'bc_y%end' : -6, - 'viscous' : 'T', - # ========================================================================== - - # Formatted Database Files Structure Parameters ============================ - 'format' : 1, - 'precision' : 2, - 'prim_vars_wrt' :'T', - 'parallel_io' :'T', - # ========================================================================== - - # Patch 1: Top fluid, water ================================================ - 'patch_icpp(1)%geometry' : 3, - 'patch_icpp(1)%x_centroid' : 0., - 'patch_icpp(1)%y_centroid' : 0, - 'patch_icpp(1)%length_x' : 1.E+00, - 'patch_icpp(1)%length_y' : 1., - 'patch_icpp(1)%vel(1)' : v_l, - 'patch_icpp(1)%vel(2)' : 0.E+00, - 'patch_icpp(1)%pres' : p_l, - 'patch_icpp(1)%alpha_rho(1)' : rho_l, - 'patch_icpp(1)%alpha_rho(2)' : rho_l, - 'patch_icpp(1)%alpha(1)' : 0.5E+00, - 'patch_icpp(1)%alpha(2)' : 0.5E+00, - # ========================================================================== - - # Patch 2: Main bottom fluid, water ======================================== - 'patch_icpp(2)%geometry' : 3, - 'patch_icpp(2)%x_centroid' : 0., - 'patch_icpp(2)%y_centroid' : 0.25, - 'patch_icpp(2)%length_x' : 1.E+00, - 'patch_icpp(2)%length_y' : 0.5, - 'patch_icpp(2)%alter_patch(1)' : 'T', - 'patch_icpp(2)%vel(1)' : v_g, - 'patch_icpp(2)%vel(2)' : 0.E+00, - 'patch_icpp(2)%pres' : p_g, - 'patch_icpp(2)%alpha_rho(1)' : 0., - 'patch_icpp(2)%alpha_rho(2)' : rho_g, - 'patch_icpp(2)%alpha(1)' : 0., - 'patch_icpp(2)%alpha(2)' : 1.E+00, - # ========================================================================== - - # Fluids Physical Parameters =============================================== - 'fluid_pp(1)%gamma' : 1.E+00/(4.4E+00-1.E+00), - 'fluid_pp(2)%gamma' : 1.E+00/(4.4E+00-1.E+00), - 'fluid_pp(1)%pi_inf' : 4.4E+00*6.E+08/(4.4E+00-1.E+00), - 'fluid_pp(2)%pi_inf' : 4.4E+00*6.E+08/(4.4E+00-1.E+00), - 'fluid_pp(1)%Re(1)' : 0.0001, - 'fluid_pp(1)%Re(2)' : 0.0001, - 'fluid_pp(2)%Re(1)' : 0.0001, - 'fluid_pp(2)%Re(2)' : 0.0001, - # ========================================================================== -})) - -# ============================================================================== +print( + json.dumps( + { + # Logistics ================================================================ + "run_time_info": "T", + # Computational Domain Parameters ========================================== + "x_domain%beg": -0.5, + "x_domain%end": 0.5, + "y_domain%beg": -0.5, + "y_domain%end": 0.5, + "cyl_coord": "F", + "m": 99, + "n": 99, + "p": 0, + "dt": 5.0e-10, + "t_step_start": 0, + "t_step_stop": 2000, + "t_step_save": 20, + # Simulation Algorithm Parameters ========================================== + "num_patches": 2, + "model_eqns": 2, + "alt_soundspeed": "F", + "num_fluids": 2, + "mpp_lim": "T", + "mixture_err": "T", + "time_stepper": 3, + "weno_order": 5, + "weno_eps": 1.0e-16, + "mapped_weno": "T", + "null_weights": "F", + "mp_weno": "F", + "weno_Re_flux": "T", + "weno_avg": "T", + "riemann_solver": 2, + "wave_speeds": 1, + "avg_state": 2, + "bc_x%beg": -1, + "bc_x%end": -1, + "bc_y%beg": -6, + "bc_y%end": -6, + "viscous": "T", + # Formatted Database Files Structure Parameters ============================ + "format": 1, + "precision": 2, + "prim_vars_wrt": "T", + "parallel_io": "T", + # Patch 1: Top fluid, water ================================================ + "patch_icpp(1)%geometry": 3, + "patch_icpp(1)%x_centroid": 0.0, + "patch_icpp(1)%y_centroid": 0, + "patch_icpp(1)%length_x": 1.0e00, + "patch_icpp(1)%length_y": 1.0, + "patch_icpp(1)%vel(1)": v_l, + "patch_icpp(1)%vel(2)": 0.0e00, + "patch_icpp(1)%pres": p_l, + "patch_icpp(1)%alpha_rho(1)": rho_l, + "patch_icpp(1)%alpha_rho(2)": rho_l, + "patch_icpp(1)%alpha(1)": 0.5e00, + "patch_icpp(1)%alpha(2)": 0.5e00, + # Patch 2: Main bottom fluid, water ======================================== + "patch_icpp(2)%geometry": 3, + "patch_icpp(2)%x_centroid": 0.0, + "patch_icpp(2)%y_centroid": 0.25, + "patch_icpp(2)%length_x": 1.0e00, + "patch_icpp(2)%length_y": 0.5, + "patch_icpp(2)%alter_patch(1)": "T", + "patch_icpp(2)%vel(1)": v_g, + "patch_icpp(2)%vel(2)": 0.0e00, + "patch_icpp(2)%pres": p_g, + "patch_icpp(2)%alpha_rho(1)": 0.0, + "patch_icpp(2)%alpha_rho(2)": rho_g, + "patch_icpp(2)%alpha(1)": 0.0, + "patch_icpp(2)%alpha(2)": 1.0e00, + # Fluids Physical Parameters =============================================== + "fluid_pp(1)%gamma": 1.0e00 / (4.4e00 - 1.0e00), + "fluid_pp(2)%gamma": 1.0e00 / (4.4e00 - 1.0e00), + "fluid_pp(1)%pi_inf": 4.4e00 * 6.0e08 / (4.4e00 - 1.0e00), + "fluid_pp(2)%pi_inf": 4.4e00 * 6.0e08 / (4.4e00 - 1.0e00), + "fluid_pp(1)%Re(1)": 0.0001, + "fluid_pp(1)%Re(2)": 0.0001, + "fluid_pp(2)%Re(1)": 0.0001, + "fluid_pp(2)%Re(2)": 0.0001, + } + ) +) diff --git a/examples/2D_whale_bubble_annulus/case.py b/examples/2D_whale_bubble_annulus/case.py index 78a00f4fda..bd9edc58b9 100755 --- a/examples/2D_whale_bubble_annulus/case.py +++ b/examples/2D_whale_bubble_annulus/case.py @@ -1,5 +1,4 @@ #!/usr/bin/env python2 - import math import json @@ -7,36 +6,35 @@ # restart_name = argv[2].strip() # x0 = 10.E-06 -x0 = 1. -p0 = 101325. -rho0 = 1000. -u0 = math.sqrt( p0/rho0 ) -c0 = 1475. - +x0 = 1.0 +p0 = 101325.0 +rho0 = 1000.0 +u0 = math.sqrt(p0 / rho0) +c0 = 1475.0 -n_tait = 7.1 -B_tait = 306.E+06/p0 +n_tait = 7.1 +B_tait = 306.0e06 / p0 gamma_gas = 1.4 -pv = 2.3388E+03 -#Cavitation number -Ca = (p0-pv)/(0.5*rho0*u0**2) +pv = 2.3388e03 +# Cavitation number +Ca = (p0 - pv) / (0.5 * rho0 * u0**2) -Ly = 6./x0 -Lx = 6./x0 +Ly = 6.0 / x0 +Lx = 6.0 / x0 Ny = 249 Nx = Ny -dx = Lx/float(Nx) -dy = Ly/float(Ny) +dx = Lx / float(Nx) +dy = Ly / float(Ny) # Time stepping parameters cfl = 0.3 -dt = cfl*dx*u0/(c0) -T = 20. -Ntfinal = int(T/dt) -Ntrestart = int(Ntfinal/5.) +dt = cfl * dx * u0 / (c0) +T = 20.0 +Ntfinal = int(T / dt) +Ntrestart = int(Ntfinal / 5.0) # Init # t_start = 0 @@ -47,152 +45,130 @@ # bc_y = 8 # if restart_name == 'run': - # Simulate +# Simulate # t_start = Ntrestart t_start = 0 -Nfiles = 1E2 -t_save = int(math.ceil((Ntfinal-t_start)/float(Nfiles))) -Nt = t_save*Nfiles -bc_y = 3 +Nfiles = 1e2 +t_save = int(math.ceil((Ntfinal - t_start) / float(Nfiles))) +Nt = t_save * Nfiles +bc_y = 3 # elif restart_name != 'init': # sys.exit("incorrect restart parameter") -ang = 1. +ang = 1.0 -myr0 = 1.E+00 -vf0 = 1.E-12 -alf = 4.E-3 +myr0 = 1.0e00 +vf0 = 1.0e-12 +alf = 4.0e-3 # Configuring case dictionary -print(json.dumps({ - # Logistics ================================================================ - 'run_time_info' : 'F', - # ========================================================================== - - # Computational Domain Parameters ========================================== - 'x_domain%beg' : -Lx/2., - 'x_domain%end' : Lx/2., - 'y_domain%beg' : -Ly/2., - 'y_domain%end' : Ly/2., - 'cyl_coord' : 'F', - 'm' : Nx, - 'n' : Ny, - 'p' : 0, - 'dt' : dt, - 't_step_start' : 0, - 't_step_stop' : 1000, - 't_step_save' : 10 , - # ========================================================================== - - # Simulation Algorithm Parameters ========================================== - 'num_patches' : 3, - 'model_eqns' : 2, - 'alt_soundspeed' : 'F', - 'num_fluids' : 1, - 'mixture_err' : 'T', - 'time_stepper' : 3, - 'weno_order' : 3, - 'weno_eps' : 1.E-16, - 'weno_Re_flux' : 'F', - 'weno_avg' : 'F', - 'mapped_weno' : 'T', - 'riemann_solver' : 2, - 'wave_speeds' : 1, - 'avg_state' : 2, - 'bc_x%beg' : -1, - 'bc_x%end' : -1, - 'bc_y%beg' : -1, - 'bc_y%end' : -1, - # ========================================================================== - - # Formatted Database Files Structure Parameters ============================ - 'format' : 1, - 'precision' : 2, - 'prim_vars_wrt' :'T', - 'parallel_io' :'T', - # ========================================================================== - - # Patch 1 ================================================================== - 'patch_icpp(1)%geometry' : 3, - 'patch_icpp(1)%x_centroid' : 0., - 'patch_icpp(1)%y_centroid' : 0., - 'patch_icpp(1)%length_x' : Lx, - 'patch_icpp(1)%length_y' : Ly, - 'patch_icpp(1)%alpha_rho(1)' : (1.-vf0)*1., - 'patch_icpp(1)%alpha(1)' : vf0, - 'patch_icpp(1)%vel(1)' : 0.0, - 'patch_icpp(1)%vel(2)' : 0.00, - 'patch_icpp(1)%pres' : 1., - 'patch_icpp(1)%r0' : 1.E+00, - 'patch_icpp(1)%v0' : 0.0E+00, - # ========================================================================== - - # Patch 2 ================================================================== - 'patch_icpp(2)%geometry' : 2, - 'patch_icpp(2)%alter_patch(1)' : 'T', - 'patch_icpp(2)%x_centroid' : 0., - 'patch_icpp(2)%y_centroid' : 0., - 'patch_icpp(2)%radius' : 1.2, - 'patch_icpp(2)%alpha_rho(1)' : (1.-alf)*1., - 'patch_icpp(2)%alpha(1)' : alf, - 'patch_icpp(2)%vel(1)' : 0.0, - 'patch_icpp(2)%vel(2)' : 0.0, - 'patch_icpp(2)%pres' : 1., - 'patch_icpp(2)%r0' : 1.E+00, - 'patch_icpp(2)%v0' : 0.0E+00, - # ========================================================================== - - # # ======================================================================== - 'patch_icpp(3)%geometry' : 2, - 'patch_icpp(3)%x_centroid' : 0., - 'patch_icpp(3)%y_centroid' : 0., - 'patch_icpp(3)%radius' : 0.8, - 'patch_icpp(3)%alter_patch(1)' : 'T', - 'patch_icpp(3)%alter_patch(2)' : 'T', - 'patch_icpp(3)%alpha_rho(1)' : (1-vf0)*1., - 'patch_icpp(3)%vel(1)' : 0.00, - 'patch_icpp(3)%vel(2)' : 0.00, - 'patch_icpp(3)%pres' : 1., - 'patch_icpp(3)%alpha(1)' : vf0, - 'patch_icpp(3)%r0' : 1.E+00, - 'patch_icpp(3)%v0' : 0.0E+00, - # # ======================================================================== - - # SHB: Bubbles ============================================================= - # 'perturb_flow' : 'T', - # 'perturb_flow_fluid' : 1, - # ========================================================================== - - # Fluids Physical Parameters =============================================== - # Surrounding liquid - 'fluid_pp(1)%gamma' : 1.E+00/(n_tait-1.E+00), - 'fluid_pp(1)%pi_inf' : n_tait*B_tait/(n_tait-1.), - 'fluid_pp(2)%gamma' : 1./(gamma_gas-1.), - 'fluid_pp(2)%pi_inf' : 0.0E+00, - # ========================================================================== - # SHB: Tait EOS ============================================================ - # ========================================================================== - - # Bubbles ================================================================== - 'bubbles_euler' : 'T', - 'bubble_model' : 3, - 'polytropic' : 'T', - 'R0_type' : 1, - 'thermal' : 3, - 'R0ref' : myr0, - 'nb' : 1, - 'Ca' : Ca, - # ========================================================================== - - 'acoustic_source' : 'T', - 'num_source' : 1, - 'acoustic(1)%support' : 2, - 'acoustic(1)%loc(1)' : -1.5, - 'acoustic(1)%loc(2)' : 0.0, - 'acoustic(1)%pulse' : 1, - 'acoustic(1)%npulse' : 4, - 'acoustic(1)%dir' : 0.78539816339, - 'acoustic(1)%mag' : 1., - 'acoustic(1)%length' : 9.E+09, - 'acoustic(1)%wavelength' : 0.4, - 'rdma_mpi' : 'F', -})) \ No newline at end of file +print( + json.dumps( + { + # Logistics ================================================================ + "run_time_info": "F", + # Computational Domain Parameters ========================================== + "x_domain%beg": -Lx / 2.0, + "x_domain%end": Lx / 2.0, + "y_domain%beg": -Ly / 2.0, + "y_domain%end": Ly / 2.0, + "cyl_coord": "F", + "m": Nx, + "n": Ny, + "p": 0, + "dt": dt, + "t_step_start": 0, + "t_step_stop": 1000, + "t_step_save": 10, + # Simulation Algorithm Parameters ========================================== + "num_patches": 3, + "model_eqns": 2, + "alt_soundspeed": "F", + "num_fluids": 1, + "mixture_err": "T", + "time_stepper": 3, + "weno_order": 3, + "weno_eps": 1.0e-16, + "weno_Re_flux": "F", + "weno_avg": "F", + "mapped_weno": "T", + "riemann_solver": 2, + "wave_speeds": 1, + "avg_state": 2, + "bc_x%beg": -1, + "bc_x%end": -1, + "bc_y%beg": -1, + "bc_y%end": -1, + # Formatted Database Files Structure Parameters ============================ + "format": 1, + "precision": 2, + "prim_vars_wrt": "T", + "parallel_io": "T", + # Patch 1 ================================================================== + "patch_icpp(1)%geometry": 3, + "patch_icpp(1)%x_centroid": 0.0, + "patch_icpp(1)%y_centroid": 0.0, + "patch_icpp(1)%length_x": Lx, + "patch_icpp(1)%length_y": Ly, + "patch_icpp(1)%alpha_rho(1)": (1.0 - vf0) * 1.0, + "patch_icpp(1)%alpha(1)": vf0, + "patch_icpp(1)%vel(1)": 0.0, + "patch_icpp(1)%vel(2)": 0.00, + "patch_icpp(1)%pres": 1.0, + "patch_icpp(1)%r0": 1.0e00, + "patch_icpp(1)%v0": 0.0e00, + # Patch 2 ================================================================== + "patch_icpp(2)%geometry": 2, + "patch_icpp(2)%alter_patch(1)": "T", + "patch_icpp(2)%x_centroid": 0.0, + "patch_icpp(2)%y_centroid": 0.0, + "patch_icpp(2)%radius": 1.2, + "patch_icpp(2)%alpha_rho(1)": (1.0 - alf) * 1.0, + "patch_icpp(2)%alpha(1)": alf, + "patch_icpp(2)%vel(1)": 0.0, + "patch_icpp(2)%vel(2)": 0.0, + "patch_icpp(2)%pres": 1.0, + "patch_icpp(2)%r0": 1.0e00, + "patch_icpp(2)%v0": 0.0e00, + "patch_icpp(3)%geometry": 2, + "patch_icpp(3)%x_centroid": 0.0, + "patch_icpp(3)%y_centroid": 0.0, + "patch_icpp(3)%radius": 0.8, + "patch_icpp(3)%alter_patch(1)": "T", + "patch_icpp(3)%alter_patch(2)": "T", + "patch_icpp(3)%alpha_rho(1)": (1 - vf0) * 1.0, + "patch_icpp(3)%vel(1)": 0.00, + "patch_icpp(3)%vel(2)": 0.00, + "patch_icpp(3)%pres": 1.0, + "patch_icpp(3)%alpha(1)": vf0, + "patch_icpp(3)%r0": 1.0e00, + "patch_icpp(3)%v0": 0.0e00, + # Fluids Physical Parameters =============================================== + # Surrounding liquid + "fluid_pp(1)%gamma": 1.0e00 / (n_tait - 1.0e00), + "fluid_pp(1)%pi_inf": n_tait * B_tait / (n_tait - 1.0), + "fluid_pp(2)%gamma": 1.0 / (gamma_gas - 1.0), + "fluid_pp(2)%pi_inf": 0.0e00, + # Bubbles ================================================================== + "bubbles_euler": "T", + "bubble_model": 3, + "polytropic": "T", + "R0_type": 1, + "thermal": 3, + "R0ref": myr0, + "nb": 1, + "Ca": Ca, + "acoustic_source": "T", + "num_source": 1, + "acoustic(1)%support": 2, + "acoustic(1)%loc(1)": -1.5, + "acoustic(1)%loc(2)": 0.0, + "acoustic(1)%pulse": 1, + "acoustic(1)%npulse": 4, + "acoustic(1)%dir": 0.78539816339, + "acoustic(1)%mag": 1.0, + "acoustic(1)%length": 9.0e09, + "acoustic(1)%wavelength": 0.4, + "rdma_mpi": "F", + } + ) +) diff --git a/examples/2D_zero_circ_vortex/case.py b/examples/2D_zero_circ_vortex/case.py index 547a51dda4..203341830b 100644 --- a/examples/2D_zero_circ_vortex/case.py +++ b/examples/2D_zero_circ_vortex/case.py @@ -4,7 +4,7 @@ # Numerical setup Nx = 250 Ny = 125 -dx = 40./(1.*(Nx+1)) +dx = 40.0 / (1.0 * (Nx + 1)) M_inf = 0.3 Mv = 0.1 @@ -13,110 +13,97 @@ rho_inf = 1 gam = 1.4 -c = math.sqrt(gam*(p_inf) / rho_inf) +c = math.sqrt(gam * (p_inf) / rho_inf) u_inf = M_inf * c cfl = 0.3 -mydt = cfl * dx / c -Tfinal = 150*1 / u_inf -Nt = int(Tfinal/mydt) +mydt = cfl * dx / c +Tfinal = 150 * 1 / u_inf +Nt = int(Tfinal / mydt) # Configuring case dictionary -print(json.dumps({ - # Logistics ================================================================ - 'run_time_info' : 'T', - # ========================================================================== - - # Computational Domain Parameters ========================================== - 'x_domain%beg' : -20, - 'x_domain%end' : 20, - 'y_domain%beg' : -10, - 'y_domain%end' : 10, - 'm' : Nx, - 'n' : Ny, - 'p' : 0, - 'dt' : mydt, - 't_step_start' : 0, - 't_step_stop' : Nt, - 't_step_save' : int(Nt/100), - # ========================================================================== - - # Simulation Algorithm Parameters ========================================== - 'num_patches' : 2, - 'model_eqns' : 2, - 'alt_soundspeed' : 'F', - 'num_fluids' : 1, - 'mpp_lim' : 'F', - 'mixture_err' : 'F', - 'time_stepper' : 3, - 'weno_order' : 5, - 'weno_eps' : 1.E-16, - 'mapped_weno' : 'T', - 'null_weights' : 'F', - 'mp_weno' : 'F', - 'riemann_solver' : 2, - 'wave_speeds' : 1, - 'avg_state' : 2, - 'bc_x%beg' : -7, - 'bc_x%end' : -8, - 'bc_y%beg' : -6, - 'bc_y%end' : -6, - # ========================================================================== - - # Formatted Database Files Structure Parameters ============================ - 'format' : 1, - 'precision' : 2, - 'prim_vars_wrt' :'T', - 'parallel_io' :'T', - 'omega_wrt(3)' :'T', - 'fd_order' : 2, - # ========================================================================== - - # Patch 1 ================================================================== - 'patch_icpp(1)%geometry' : 3, - 'patch_icpp(1)%x_centroid' : 0, - 'patch_icpp(1)%y_centroid' : 0, - 'patch_icpp(1)%length_x' : 40., - 'patch_icpp(1)%length_y' : 20., - 'patch_icpp(1)%vel(1)' : u_inf, - 'patch_icpp(1)%vel(2)' : 0, - 'patch_icpp(1)%pres' : 101325, - 'patch_icpp(1)%alpha_rho(1)' : 1, - 'patch_icpp(1)%alpha(1)' : 1., - # ========================================================================== - - # Patch 2 ================================================================== - 'patch_icpp(2)%geometry' : 2, - 'patch_icpp(2)%x_centroid' : 0, - 'patch_icpp(2)%y_centroid' : 0, - 'patch_icpp(2)%radius' : 1., - 'patch_icpp(2)%vel(1)' : f"{u_inf}*(1 - ({Mv} / {M_inf}))*y*exp(0.5*(1 - sqrt(x**2 + y**2))) ", - 'patch_icpp(2)%vel(2)' : f"{u_inf}*(({Mv} / {M_inf}))*x*exp(0.5*(1 - sqrt(x**2 + y**2)))", - 'patch_icpp(2)%pres' : f"{p_inf}*(1 - 0.5*({gam} - 1)*({Mv} / {M_inf})**2*exp(0.5*(1 - sqrt(x**2 + y**2))))**({gam} / ({gam} - 1))", - 'patch_icpp(2)%alpha_rho(1)' : f"{rho_inf}*(1 - 0.5*({gam} - 1)*({Mv} / {M_inf})**2*exp(0.5*(1 - sqrt(x**2 + y**2))))**(1 / ({gam} - 1))", - 'patch_icpp(2)%alpha(1)' : 1., - 'patch_icpp(2)%alter_patch(1)' : 'T', - # ========================================================================== - - # CBC Inflow / Outflow ======================================== - 'bc_x%grcbc_in' : 'T', - 'bc_x%grcbc_out' : 'T', - 'bc_x%grcbc_vel_out' : 'T', - 'bc_x%vel_in(1)' : u_inf, - 'bc_x%vel_in(2)' : 0, - 'bc_x%vel_in(3)' : 0, - 'bc_x%pres_in' : p_inf, - 'bc_x%alpha_rho_in(1)' : rho_inf, - 'bc_x%alpha_in(1)' : 1, - 'bc_x%vel_out(1)' : u_inf, - 'bc_x%vel_out(2)' : 0, - 'bc_x%vel_out(3)' : 0, - 'bc_x%pres_out' : p_inf, - # # ======================================================================== - - # Fluids Physical Parameters =============================================== - 'fluid_pp(1)%gamma' : 1.E+00/(gam-1.E+00), - 'fluid_pp(1)%pi_inf' : 0.0, - # ========================================================================== -})) - -# ============================================================================== +print( + json.dumps( + { + # Logistics ================================================================ + "run_time_info": "T", + # Computational Domain Parameters ========================================== + "x_domain%beg": -20, + "x_domain%end": 20, + "y_domain%beg": -10, + "y_domain%end": 10, + "m": Nx, + "n": Ny, + "p": 0, + "dt": mydt, + "t_step_start": 0, + "t_step_stop": Nt, + "t_step_save": int(Nt / 100), + # Simulation Algorithm Parameters ========================================== + "num_patches": 2, + "model_eqns": 2, + "alt_soundspeed": "F", + "num_fluids": 1, + "mpp_lim": "F", + "mixture_err": "F", + "time_stepper": 3, + "weno_order": 5, + "weno_eps": 1.0e-16, + "mapped_weno": "T", + "null_weights": "F", + "mp_weno": "F", + "riemann_solver": 2, + "wave_speeds": 1, + "avg_state": 2, + "bc_x%beg": -7, + "bc_x%end": -8, + "bc_y%beg": -6, + "bc_y%end": -6, + # Formatted Database Files Structure Parameters ============================ + "format": 1, + "precision": 2, + "prim_vars_wrt": "T", + "parallel_io": "T", + "omega_wrt(3)": "T", + "fd_order": 2, + # Patch 1 ================================================================== + "patch_icpp(1)%geometry": 3, + "patch_icpp(1)%x_centroid": 0, + "patch_icpp(1)%y_centroid": 0, + "patch_icpp(1)%length_x": 40.0, + "patch_icpp(1)%length_y": 20.0, + "patch_icpp(1)%vel(1)": u_inf, + "patch_icpp(1)%vel(2)": 0, + "patch_icpp(1)%pres": 101325, + "patch_icpp(1)%alpha_rho(1)": 1, + "patch_icpp(1)%alpha(1)": 1.0, + # Patch 2 ================================================================== + "patch_icpp(2)%geometry": 2, + "patch_icpp(2)%x_centroid": 0, + "patch_icpp(2)%y_centroid": 0, + "patch_icpp(2)%radius": 1.0, + "patch_icpp(2)%vel(1)": f"{u_inf}*(1 - ({Mv} / {M_inf}))*y*exp(0.5*(1 - sqrt(x**2 + y**2))) ", + "patch_icpp(2)%vel(2)": f"{u_inf}*(({Mv} / {M_inf}))*x*exp(0.5*(1 - sqrt(x**2 + y**2)))", + "patch_icpp(2)%pres": f"{p_inf}*(1 - 0.5*({gam} - 1)*({Mv} / {M_inf})**2*exp(0.5*(1 - sqrt(x**2 + y**2))))**({gam} / ({gam} - 1))", + "patch_icpp(2)%alpha_rho(1)": f"{rho_inf}*(1 - 0.5*({gam} - 1)*({Mv} / {M_inf})**2*exp(0.5*(1 - sqrt(x**2 + y**2))))**(1 / ({gam} - 1))", + "patch_icpp(2)%alpha(1)": 1.0, + "patch_icpp(2)%alter_patch(1)": "T", + # CBC Inflow / Outflow ======================================== + "bc_x%grcbc_in": "T", + "bc_x%grcbc_out": "T", + "bc_x%grcbc_vel_out": "T", + "bc_x%vel_in(1)": u_inf, + "bc_x%vel_in(2)": 0, + "bc_x%vel_in(3)": 0, + "bc_x%pres_in": p_inf, + "bc_x%alpha_rho_in(1)": rho_inf, + "bc_x%alpha_in(1)": 1, + "bc_x%vel_out(1)": u_inf, + "bc_x%vel_out(2)": 0, + "bc_x%vel_out(3)": 0, + "bc_x%pres_out": p_inf, + # Fluids Physical Parameters =============================================== + "fluid_pp(1)%gamma": 1.0e00 / (gam - 1.0e00), + "fluid_pp(1)%pi_inf": 0.0, + } + ) +) diff --git a/examples/3D_TaylorGreenVortex/case.py b/examples/3D_TaylorGreenVortex/case.py index 31e116eb57..c883eca721 100644 --- a/examples/3D_TaylorGreenVortex/case.py +++ b/examples/3D_TaylorGreenVortex/case.py @@ -1,110 +1,100 @@ #!/usr/bin/env python3 - import math import json -N = 256 +N = 256 Re = 1600 L = 1 P0 = 101325 rho0 = 1 -C0 = math.sqrt(1.4*P0) -V0 = 0.1*C0 -mu = V0*L/Re +C0 = math.sqrt(1.4 * P0) +V0 = 0.1 * C0 +mu = V0 * L / Re cfl = 0.5 -dx = 2*math.pi*L/(N+1) +dx = 2 * math.pi * L / (N + 1) dt = cfl * dx / (C0) -tC = L/V0 -tEnd = 20*tC +tC = L / V0 +tEnd = 20 * tC -Nt = int(tEnd/dt) +Nt = int(tEnd / dt) # Configuring case dictionary -print(json.dumps({ - # Logistics ================================================ - 'run_time_info' : 'T', - # ========================================================== - - # Computational Domain Parameters ========================== - 'x_domain%beg' : -math.pi*L, - 'x_domain%end' : math.pi*L, - 'y_domain%beg' : -math.pi*L, - 'y_domain%end' : math.pi*L, - 'z_domain%beg' : -math.pi*L, - 'z_domain%end' : math.pi*L, - 'm' : N, - 'n' : N, - 'p' : N, - 'cyl_coord' : 'F', - 'dt' : dt, - 't_step_start' : 13529, - 't_step_stop' : Nt, - 't_step_save' : int(Nt/100), - # ========================================================== - - # Simulation Algorithm Parameters ========================== - 'num_patches' : 1, - 'model_eqns' : 2, - 'alt_soundspeed' : 'F', - 'num_fluids' : 1, - 'mixture_err' : 'T', - 'time_stepper' : 3, - 'weno_order' : 5, - 'weno_eps' : 1.0E-16, - 'weno_Re_flux' : 'F', - 'weno_avg' : 'F', - 'mapped_weno' : 'T', - 'riemann_solver' : 2, - 'wave_speeds' : 1, - 'avg_state' : 2, - 'bc_x%beg' : -1, - 'bc_x%end' : -1, - 'bc_y%beg' : -1, - 'bc_y%end' : -1, - 'bc_z%beg' : -1, - 'bc_z%end' : -1, - 'viscous' : 'T', - # ========================================================== - - # Formatted Database Files Structure Parameters ============ - 'format' : 1, - 'precision' : 2, - # 'prim_vars_wrt' :'T', - 'omega_wrt(1)' :'T', - 'omega_wrt(2)' :'T', - 'omega_wrt(3)' :'T', - 'qm_wrt' :'T', - 'fd_order' : 4, - 'parallel_io' :'T', - # ========================================================== - - # I will use 1 for WATER properties, and 2 for AIR properties - # Patch 1: Background (AIR - 2) ============================= - 'patch_icpp(1)%geometry' : 9, - 'patch_icpp(1)%x_centroid' : 0, - 'patch_icpp(1)%y_centroid' : 0, - 'patch_icpp(1)%z_centroid' : 0, - 'patch_icpp(1)%length_x' : 2*math.pi*L, - 'patch_icpp(1)%length_y' : 2*math.pi*L, - 'patch_icpp(1)%length_z' : 2*math.pi*L, - 'patch_icpp(1)%vel(1)' : f"{V0}*sin(x/{L})*cos(y/{L})*sin(z/{L})", - 'patch_icpp(1)%vel(2)' : f"-{V0}*cos(x/{L})*sin(y/{L})*sin(z/{L})", - 'patch_icpp(1)%vel(3)' : 0, - 'patch_icpp(1)%pres' : f"{P0} + ({rho0}*{V0}**2/16)*(cos(2*x/{L}) + cos(2*y/{L}))*(cos(2*z/{L}) + 2)", - 'patch_icpp(1)%alpha_rho(1)' : 1, - 'patch_icpp(1)%alpha(1)' : 1, - # ========================================================== - - # Fluids Physical Parameters =============================== - 'fluid_pp(1)%gamma' : 1.0E+00/(1.4-1), - 'fluid_pp(1)%pi_inf' : 0, - 'fluid_pp(1)%Re(1)' : 1/mu, - # ========================================================== -})) - -# ============================================================================== +print( + json.dumps( + { + # Logistics ================================================ + "run_time_info": "T", + # Computational Domain Parameters ========================== + "x_domain%beg": -math.pi * L, + "x_domain%end": math.pi * L, + "y_domain%beg": -math.pi * L, + "y_domain%end": math.pi * L, + "z_domain%beg": -math.pi * L, + "z_domain%end": math.pi * L, + "m": N, + "n": N, + "p": N, + "cyl_coord": "F", + "dt": dt, + "t_step_start": 13529, + "t_step_stop": Nt, + "t_step_save": int(Nt / 100), + # Simulation Algorithm Parameters ========================== + "num_patches": 1, + "model_eqns": 2, + "alt_soundspeed": "F", + "num_fluids": 1, + "mixture_err": "T", + "time_stepper": 3, + "weno_order": 5, + "weno_eps": 1.0e-16, + "weno_Re_flux": "F", + "weno_avg": "F", + "mapped_weno": "T", + "riemann_solver": 2, + "wave_speeds": 1, + "avg_state": 2, + "bc_x%beg": -1, + "bc_x%end": -1, + "bc_y%beg": -1, + "bc_y%end": -1, + "bc_z%beg": -1, + "bc_z%end": -1, + "viscous": "T", + # Formatted Database Files Structure Parameters ============ + "format": 1, + "precision": 2, + # 'prim_vars_wrt' :'T', + "omega_wrt(1)": "T", + "omega_wrt(2)": "T", + "omega_wrt(3)": "T", + "qm_wrt": "T", + "fd_order": 4, + "parallel_io": "T", + # I will use 1 for WATER properties, and 2 for AIR properties + # Patch 1: Background (AIR - 2) ============================= + "patch_icpp(1)%geometry": 9, + "patch_icpp(1)%x_centroid": 0, + "patch_icpp(1)%y_centroid": 0, + "patch_icpp(1)%z_centroid": 0, + "patch_icpp(1)%length_x": 2 * math.pi * L, + "patch_icpp(1)%length_y": 2 * math.pi * L, + "patch_icpp(1)%length_z": 2 * math.pi * L, + "patch_icpp(1)%vel(1)": f"{V0}*sin(x/{L})*cos(y/{L})*sin(z/{L})", + "patch_icpp(1)%vel(2)": f"-{V0}*cos(x/{L})*sin(y/{L})*sin(z/{L})", + "patch_icpp(1)%vel(3)": 0, + "patch_icpp(1)%pres": f"{P0} + ({rho0}*{V0}**2/16)*(cos(2*x/{L}) + cos(2*y/{L}))*(cos(2*z/{L}) + 2)", + "patch_icpp(1)%alpha_rho(1)": 1, + "patch_icpp(1)%alpha(1)": 1, + # Fluids Physical Parameters =============================== + "fluid_pp(1)%gamma": 1.0e00 / (1.4 - 1), + "fluid_pp(1)%pi_inf": 0, + "fluid_pp(1)%Re(1)": 1 / mu, + } + ) +) diff --git a/examples/3D_acoustic_support11/case.py b/examples/3D_acoustic_support11/case.py index cd1f6a8ac6..76a34033e9 100644 --- a/examples/3D_acoustic_support11/case.py +++ b/examples/3D_acoustic_support11/case.py @@ -1,118 +1,104 @@ #!/usr/bin/env python3 - import json, math # Configuring case dictionary -print(json.dumps({ - # Logistics ================================================================ - 'run_time_info' : 'T', - # ========================================================================== - - # Computational Domain Parameters ========================================== - 'x_domain%beg' : 0, - 'x_domain%end' : 0.001, - 'y_domain%beg' : 0, - 'y_domain%end' : 0.001, - 'z_domain%beg' : 0, - 'z_domain%end' : 0.001, - 'm' : 99, - 'n' : 99, - 'p' : 99, - 'dt' : 4e-9, - 't_step_start' : 0, - 't_step_stop' : 200, - 't_step_save' : 10, - # ========================================================================= - - # Simulation Algorithm Parameters ========================================== - 'num_patches' : 1, - 'model_eqns' : 2, - 'alt_soundspeed' : 'F', - 'num_fluids' : 1, - 'mpp_lim' : 'F', - 'mixture_err' : 'F', - 'time_stepper' : 3, - 'weno_order' : 5, - 'weno_eps' : 1.E-16, - 'teno' : 'T', - 'teno_CT' : 1E-8, - 'null_weights' : 'F', - 'mp_weno' : 'F', - 'riemann_solver' : 2, - 'wave_speeds' : 1, - 'avg_state' : 2, - 'bc_x%beg' : -6, - 'bc_x%end' : -6, - 'bc_y%beg' : -6, - 'bc_y%end' : -6, - 'bc_z%beg' : -6, - 'bc_z%end' : -6, - # ========================================================================== - - # Formatted Database Files Structure Parameters ============================ - 'format' : 1, - 'precision' : 2, - 'prim_vars_wrt' :'T', - 'parallel_io' :'T', - # ========================================================================== - - # Patch 1 Liquid =========================================================== - 'patch_icpp(1)%geometry' : 9, - 'patch_icpp(1)%x_centroid' : 0.0005, - 'patch_icpp(1)%y_centroid' : 0.0005, - 'patch_icpp(1)%z_centroid' : 0.0005, - 'patch_icpp(1)%length_x' : 0.001, - 'patch_icpp(1)%length_y' : 0.001, - 'patch_icpp(1)%length_z' : 0.001, - 'patch_icpp(1)%vel(1)' : 0.0, - 'patch_icpp(1)%vel(2)' : 0.0, - 'patch_icpp(1)%vel(3)' : 0.0, - 'patch_icpp(1)%pres' : 1E+05, - 'patch_icpp(1)%alpha_rho(1)' : 1100, - 'patch_icpp(1)%alpha(1)' : 1.0, - # ========================================================================== - - # Acoustic source ========================================================== - 'acoustic_source' : 'T', - 'num_source' : 2, - - 'acoustic(1)%support' : 11, - 'acoustic(1)%loc(1)' : 0.00006, - 'acoustic(1)%loc(2)' : 0.0005, - 'acoustic(1)%loc(3)' : 0.0005, - 'acoustic(1)%pulse' : 2, - 'acoustic(1)%npulse' : 1, - 'acoustic(1)%mag' : 1., - 'acoustic(1)%gauss_sigma_time' : 2E-8, - 'acoustic(1)%foc_length' : 0.00054, - 'acoustic(1)%aperture' : 0.00065, - 'acoustic(1)%element_polygon_ratio': 0.85, - 'acoustic(1)%num_elements' : 12, - 'acoustic(1)%element_on' : 0, - 'acoustic(1)%rotate_angle' : 0, - 'acoustic(1)%delay' : 1E-7, - - 'acoustic(2)%support' : 11, - 'acoustic(2)%loc(1)' : 0.00006, - 'acoustic(2)%loc(2)' : 0.0005, - 'acoustic(2)%loc(3)' : 0.0005, - 'acoustic(2)%pulse' : 2, - 'acoustic(2)%npulse' : 1, - 'acoustic(2)%mag' : 1., - 'acoustic(2)%gauss_sigma_time' : 2E-8, - 'acoustic(2)%foc_length' : 0.00054, - 'acoustic(2)%aperture' : 0.000337, - 'acoustic(2)%element_polygon_ratio': 0.85, - 'acoustic(2)%num_elements' : 6, - 'acoustic(2)%element_on' : 0, - 'acoustic(2)%rotate_angle' : math.pi/12, - 'acoustic(2)%delay' : 1E-7, - # ========================================================================== - - # Fluids Physical Parameters =============================================== - 'fluid_pp(1)%gamma' : 1.E+00/(4.4E+00-1.E+00), - 'fluid_pp(1)%pi_inf' : 4.4E+00*5.57E+08/(4.4E+00 - 1.E+00), - # ========================================================================== -})) - -# ============================================================================== +print( + json.dumps( + { + # Logistics ================================================================ + "run_time_info": "T", + # Computational Domain Parameters ========================================== + "x_domain%beg": 0, + "x_domain%end": 0.001, + "y_domain%beg": 0, + "y_domain%end": 0.001, + "z_domain%beg": 0, + "z_domain%end": 0.001, + "m": 99, + "n": 99, + "p": 99, + "dt": 4e-9, + "t_step_start": 0, + "t_step_stop": 200, + "t_step_save": 10, + # Simulation Algorithm Parameters ========================================== + "num_patches": 1, + "model_eqns": 2, + "alt_soundspeed": "F", + "num_fluids": 1, + "mpp_lim": "F", + "mixture_err": "F", + "time_stepper": 3, + "weno_order": 5, + "weno_eps": 1.0e-16, + "teno": "T", + "teno_CT": 1e-8, + "null_weights": "F", + "mp_weno": "F", + "riemann_solver": 2, + "wave_speeds": 1, + "avg_state": 2, + "bc_x%beg": -6, + "bc_x%end": -6, + "bc_y%beg": -6, + "bc_y%end": -6, + "bc_z%beg": -6, + "bc_z%end": -6, + # Formatted Database Files Structure Parameters ============================ + "format": 1, + "precision": 2, + "prim_vars_wrt": "T", + "parallel_io": "T", + # Patch 1 Liquid =========================================================== + "patch_icpp(1)%geometry": 9, + "patch_icpp(1)%x_centroid": 0.0005, + "patch_icpp(1)%y_centroid": 0.0005, + "patch_icpp(1)%z_centroid": 0.0005, + "patch_icpp(1)%length_x": 0.001, + "patch_icpp(1)%length_y": 0.001, + "patch_icpp(1)%length_z": 0.001, + "patch_icpp(1)%vel(1)": 0.0, + "patch_icpp(1)%vel(2)": 0.0, + "patch_icpp(1)%vel(3)": 0.0, + "patch_icpp(1)%pres": 1e05, + "patch_icpp(1)%alpha_rho(1)": 1100, + "patch_icpp(1)%alpha(1)": 1.0, + # Acoustic source ========================================================== + "acoustic_source": "T", + "num_source": 2, + "acoustic(1)%support": 11, + "acoustic(1)%loc(1)": 0.00006, + "acoustic(1)%loc(2)": 0.0005, + "acoustic(1)%loc(3)": 0.0005, + "acoustic(1)%pulse": 2, + "acoustic(1)%npulse": 1, + "acoustic(1)%mag": 1.0, + "acoustic(1)%gauss_sigma_time": 2e-8, + "acoustic(1)%foc_length": 0.00054, + "acoustic(1)%aperture": 0.00065, + "acoustic(1)%element_polygon_ratio": 0.85, + "acoustic(1)%num_elements": 12, + "acoustic(1)%element_on": 0, + "acoustic(1)%rotate_angle": 0, + "acoustic(1)%delay": 1e-7, + "acoustic(2)%support": 11, + "acoustic(2)%loc(1)": 0.00006, + "acoustic(2)%loc(2)": 0.0005, + "acoustic(2)%loc(3)": 0.0005, + "acoustic(2)%pulse": 2, + "acoustic(2)%npulse": 1, + "acoustic(2)%mag": 1.0, + "acoustic(2)%gauss_sigma_time": 2e-8, + "acoustic(2)%foc_length": 0.00054, + "acoustic(2)%aperture": 0.000337, + "acoustic(2)%element_polygon_ratio": 0.85, + "acoustic(2)%num_elements": 6, + "acoustic(2)%element_on": 0, + "acoustic(2)%rotate_angle": math.pi / 12, + "acoustic(2)%delay": 1e-7, + # Fluids Physical Parameters =============================================== + "fluid_pp(1)%gamma": 1.0e00 / (4.4e00 - 1.0e00), + "fluid_pp(1)%pi_inf": 4.4e00 * 5.57e08 / (4.4e00 - 1.0e00), + } + ) +) diff --git a/examples/3D_acoustic_support3/case.py b/examples/3D_acoustic_support3/case.py index d2113b87b6..cf45b0c297 100644 --- a/examples/3D_acoustic_support3/case.py +++ b/examples/3D_acoustic_support3/case.py @@ -1,97 +1,85 @@ #!/usr/bin/env python3 - import json, math # Configuring case dictionary -print(json.dumps({ - # Logistics ================================================================ - 'run_time_info' : 'T', - # ========================================================================== - - # Computational Domain Parameters ========================================== - 'x_domain%beg' : 0, - 'x_domain%end' : 0.001, - 'y_domain%beg' : 0, - 'y_domain%end' : 0.001, - 'z_domain%beg' : 0, - 'z_domain%end' : 0.001, - 'm' : 49, - 'n' : 49, - 'p' : 49, - 'dt' : 8e-9, - 't_step_start' : 0, - 't_step_stop' : 50, - 't_step_save' : 5, - # ========================================================================== - - # Simulation Algorithm Parameters ========================================== - 'num_patches' : 1, - 'model_eqns' : 2, - 'alt_soundspeed' : 'F', - 'num_fluids' : 1, - 'mpp_lim' : 'F', - 'mixture_err' : 'F', - 'time_stepper' : 3, - 'weno_order' : 5, - 'weno_eps' : 1.E-16, - 'teno' : 'T', - 'teno_CT' : 1E-8, - 'null_weights' : 'F', - 'mp_weno' : 'F', - 'riemann_solver' : 2, - 'wave_speeds' : 1, - 'avg_state' : 2, - 'bc_x%beg' : -6, - 'bc_x%end' : -6, - 'bc_y%beg' : -6, - 'bc_y%end' : -6, - 'bc_z%beg' : -6, - 'bc_z%end' : -6, - # ========================================================================== - - # Formatted Database Files Structure Parameters ============================ - 'format' : 1, - 'precision' : 2, - 'prim_vars_wrt' :'T', - 'parallel_io' :'T', - # ========================================================================== - - # Patch 1 Liquid =========================================================== - 'patch_icpp(1)%geometry' : 9, - 'patch_icpp(1)%x_centroid' : 0.0005, - 'patch_icpp(1)%y_centroid' : 0.0005, - 'patch_icpp(1)%z_centroid' : 0.0005, - 'patch_icpp(1)%length_x' : 0.001, - 'patch_icpp(1)%length_y' : 0.001, - 'patch_icpp(1)%length_z' : 0.001, - 'patch_icpp(1)%vel(1)' : 0.0, - 'patch_icpp(1)%vel(2)' : 0.0, - 'patch_icpp(1)%vel(3)' : 0.0, - 'patch_icpp(1)%pres' : 1E+05, - 'patch_icpp(1)%alpha_rho(1)' : 1100, - 'patch_icpp(1)%alpha(1)' : 1.0, - # ========================================================================== - - # Acoustic source ========================================================== - 'acoustic_source' : 'T', - 'num_source' : 1, - 'acoustic(1)%support' : 3, - 'acoustic(1)%loc(1)' : 0.0005, - 'acoustic(1)%loc(2)' : 0.0005, - 'acoustic(1)%dir' : math.pi/4, - 'acoustic(1)%length' : 0.0005, - 'acoustic(1)%height' : 0.0005, - 'acoustic(1)%pulse' : 2, - 'acoustic(1)%npulse' : 1, - 'acoustic(1)%mag' : 1., - 'acoustic(1)%gauss_sigma_time' : 2E-8, - 'acoustic(1)%delay' : 1E-7, - # ========================================================================== - - # Fluids Physical Parameters =============================================== - 'fluid_pp(1)%gamma' : 1.E+00/(4.4E+00-1.E+00), - 'fluid_pp(1)%pi_inf' : 4.4E+00*5.57E+08/(4.4E+00 - 1.E+00), - # ========================================================================== -})) - -# ============================================================================== +print( + json.dumps( + { + # Logistics ================================================================ + "run_time_info": "T", + # Computational Domain Parameters ========================================== + "x_domain%beg": 0, + "x_domain%end": 0.001, + "y_domain%beg": 0, + "y_domain%end": 0.001, + "z_domain%beg": 0, + "z_domain%end": 0.001, + "m": 49, + "n": 49, + "p": 49, + "dt": 8e-9, + "t_step_start": 0, + "t_step_stop": 50, + "t_step_save": 5, + # Simulation Algorithm Parameters ========================================== + "num_patches": 1, + "model_eqns": 2, + "alt_soundspeed": "F", + "num_fluids": 1, + "mpp_lim": "F", + "mixture_err": "F", + "time_stepper": 3, + "weno_order": 5, + "weno_eps": 1.0e-16, + "teno": "T", + "teno_CT": 1e-8, + "null_weights": "F", + "mp_weno": "F", + "riemann_solver": 2, + "wave_speeds": 1, + "avg_state": 2, + "bc_x%beg": -6, + "bc_x%end": -6, + "bc_y%beg": -6, + "bc_y%end": -6, + "bc_z%beg": -6, + "bc_z%end": -6, + # Formatted Database Files Structure Parameters ============================ + "format": 1, + "precision": 2, + "prim_vars_wrt": "T", + "parallel_io": "T", + # Patch 1 Liquid =========================================================== + "patch_icpp(1)%geometry": 9, + "patch_icpp(1)%x_centroid": 0.0005, + "patch_icpp(1)%y_centroid": 0.0005, + "patch_icpp(1)%z_centroid": 0.0005, + "patch_icpp(1)%length_x": 0.001, + "patch_icpp(1)%length_y": 0.001, + "patch_icpp(1)%length_z": 0.001, + "patch_icpp(1)%vel(1)": 0.0, + "patch_icpp(1)%vel(2)": 0.0, + "patch_icpp(1)%vel(3)": 0.0, + "patch_icpp(1)%pres": 1e05, + "patch_icpp(1)%alpha_rho(1)": 1100, + "patch_icpp(1)%alpha(1)": 1.0, + # Acoustic source ========================================================== + "acoustic_source": "T", + "num_source": 1, + "acoustic(1)%support": 3, + "acoustic(1)%loc(1)": 0.0005, + "acoustic(1)%loc(2)": 0.0005, + "acoustic(1)%dir": math.pi / 4, + "acoustic(1)%length": 0.0005, + "acoustic(1)%height": 0.0005, + "acoustic(1)%pulse": 2, + "acoustic(1)%npulse": 1, + "acoustic(1)%mag": 1.0, + "acoustic(1)%gauss_sigma_time": 2e-8, + "acoustic(1)%delay": 1e-7, + # Fluids Physical Parameters =============================================== + "fluid_pp(1)%gamma": 1.0e00 / (4.4e00 - 1.0e00), + "fluid_pp(1)%pi_inf": 4.4e00 * 5.57e08 / (4.4e00 - 1.0e00), + } + ) +) diff --git a/examples/3D_acoustic_support7/case.py b/examples/3D_acoustic_support7/case.py index e9198ab0af..d08c720637 100644 --- a/examples/3D_acoustic_support7/case.py +++ b/examples/3D_acoustic_support7/case.py @@ -1,97 +1,85 @@ #!/usr/bin/env python3 - import json # Configuring case dictionary -print(json.dumps({ - # Logistics ================================================================ - 'run_time_info' : 'T', - # ========================================================================== - - # Computational Domain Parameters ========================================== - 'x_domain%beg' : 0, - 'x_domain%end' : 0.001, - 'y_domain%beg' : 0, - 'y_domain%end' : 0.001, - 'z_domain%beg' : 0, - 'z_domain%end' : 0.001, - 'm' : 49, - 'n' : 49, - 'p' : 49, - 'dt' : 8e-9, - 't_step_start' : 0, - 't_step_stop' : 100, - 't_step_save' : 5, - # ========================================================================== - - # Simulation Algorithm Parameters ========================================== - 'num_patches' : 1, - 'model_eqns' : 2, - 'alt_soundspeed' : 'F', - 'num_fluids' : 1, - 'mpp_lim' : 'F', - 'mixture_err' : 'F', - 'time_stepper' : 3, - 'weno_order' : 5, - 'weno_eps' : 1.E-16, - 'teno' : 'T', - 'teno_CT' : 1E-8, - 'null_weights' : 'F', - 'mp_weno' : 'F', - 'riemann_solver' : 2, - 'wave_speeds' : 1, - 'avg_state' : 2, - 'bc_x%beg' : -6, - 'bc_x%end' : -6, - 'bc_y%beg' : -6, - 'bc_y%end' : -6, - 'bc_z%beg' : -6, - 'bc_z%end' : -6, - # ========================================================================== - - # Formatted Database Files Structure Parameters ============================ - 'format' : 1, - 'precision' : 2, - 'prim_vars_wrt' :'T', - 'parallel_io' :'T', - # ========================================================================== - - # Patch 1 Liquid =========================================================== - 'patch_icpp(1)%geometry' : 9, - 'patch_icpp(1)%x_centroid' : 0.0005, - 'patch_icpp(1)%y_centroid' : 0.0005, - 'patch_icpp(1)%z_centroid' : 0.0005, - 'patch_icpp(1)%length_x' : 0.001, - 'patch_icpp(1)%length_y' : 0.001, - 'patch_icpp(1)%length_z' : 0.001, - 'patch_icpp(1)%vel(1)' : 0.0, - 'patch_icpp(1)%vel(2)' : 0.0, - 'patch_icpp(1)%vel(3)' : 0.0, - 'patch_icpp(1)%pres' : 1E+05, - 'patch_icpp(1)%alpha_rho(1)' : 1100, - 'patch_icpp(1)%alpha(1)' : 1.0, - # ========================================================================== - - # Acoustic source ========================================================== - 'acoustic_source' : 'T', - 'num_source' : 1, - 'acoustic(1)%support' : 7, - 'acoustic(1)%loc(1)' : 0.00006, - 'acoustic(1)%loc(2)' : 0.0005, - 'acoustic(1)%loc(3)' : 0.0005, - 'acoustic(1)%pulse' : 2, - 'acoustic(1)%npulse' : 1, - 'acoustic(1)%mag' : 1., - 'acoustic(1)%gauss_sigma_time' : 2E-8, - 'acoustic(1)%foc_length' : 0.00054, - 'acoustic(1)%aperture' : 0.0008, - 'acoustic(1)%delay' : 1E-7, - # ========================================================================== - - # Fluids Physical Parameters =============================================== - 'fluid_pp(1)%gamma' : 1.E+00/(4.4E+00-1.E+00), - 'fluid_pp(1)%pi_inf' : 4.4E+00*5.57E+08/(4.4E+00 - 1.E+00), - # ========================================================================== -})) - -# ============================================================================== +print( + json.dumps( + { + # Logistics ================================================================ + "run_time_info": "T", + # Computational Domain Parameters ========================================== + "x_domain%beg": 0, + "x_domain%end": 0.001, + "y_domain%beg": 0, + "y_domain%end": 0.001, + "z_domain%beg": 0, + "z_domain%end": 0.001, + "m": 49, + "n": 49, + "p": 49, + "dt": 8e-9, + "t_step_start": 0, + "t_step_stop": 100, + "t_step_save": 5, + # Simulation Algorithm Parameters ========================================== + "num_patches": 1, + "model_eqns": 2, + "alt_soundspeed": "F", + "num_fluids": 1, + "mpp_lim": "F", + "mixture_err": "F", + "time_stepper": 3, + "weno_order": 5, + "weno_eps": 1.0e-16, + "teno": "T", + "teno_CT": 1e-8, + "null_weights": "F", + "mp_weno": "F", + "riemann_solver": 2, + "wave_speeds": 1, + "avg_state": 2, + "bc_x%beg": -6, + "bc_x%end": -6, + "bc_y%beg": -6, + "bc_y%end": -6, + "bc_z%beg": -6, + "bc_z%end": -6, + # Formatted Database Files Structure Parameters ============================ + "format": 1, + "precision": 2, + "prim_vars_wrt": "T", + "parallel_io": "T", + # Patch 1 Liquid =========================================================== + "patch_icpp(1)%geometry": 9, + "patch_icpp(1)%x_centroid": 0.0005, + "patch_icpp(1)%y_centroid": 0.0005, + "patch_icpp(1)%z_centroid": 0.0005, + "patch_icpp(1)%length_x": 0.001, + "patch_icpp(1)%length_y": 0.001, + "patch_icpp(1)%length_z": 0.001, + "patch_icpp(1)%vel(1)": 0.0, + "patch_icpp(1)%vel(2)": 0.0, + "patch_icpp(1)%vel(3)": 0.0, + "patch_icpp(1)%pres": 1e05, + "patch_icpp(1)%alpha_rho(1)": 1100, + "patch_icpp(1)%alpha(1)": 1.0, + # Acoustic source ========================================================== + "acoustic_source": "T", + "num_source": 1, + "acoustic(1)%support": 7, + "acoustic(1)%loc(1)": 0.00006, + "acoustic(1)%loc(2)": 0.0005, + "acoustic(1)%loc(3)": 0.0005, + "acoustic(1)%pulse": 2, + "acoustic(1)%npulse": 1, + "acoustic(1)%mag": 1.0, + "acoustic(1)%gauss_sigma_time": 2e-8, + "acoustic(1)%foc_length": 0.00054, + "acoustic(1)%aperture": 0.0008, + "acoustic(1)%delay": 1e-7, + # Fluids Physical Parameters =============================================== + "fluid_pp(1)%gamma": 1.0e00 / (4.4e00 - 1.0e00), + "fluid_pp(1)%pi_inf": 4.4e00 * 5.57e08 / (4.4e00 - 1.0e00), + } + ) +) diff --git a/examples/3D_ibm_bowshock/case.py b/examples/3D_ibm_bowshock/case.py index 43e3eaa5d5..8499802d3d 100644 --- a/examples/3D_ibm_bowshock/case.py +++ b/examples/3D_ibm_bowshock/case.py @@ -1,117 +1,107 @@ import json import math -Mu = 1.84E-05 +Mu = 1.84e-05 gam_a = 1.4 D = 0.1 # Configuring case dictionary -print(json.dumps({ - # Logistics ================================================================ - 'run_time_info' : 'T', - # ========================================================================== - - # Computational Domain Parameters ========================================== - # x direction - 'x_domain%beg' : -5*D, - 'x_domain%end' : 5.0*D, - # y direction - 'y_domain%beg' : -2.5*D, - 'y_domain%end' : 2.5*D, - # z direction - 'z_domain%beg' : -2.5*D, - 'z_domain%end' : 2.5*D, - - 'cyl_coord' : 'F', - 'm' : 512, - 'n' : 256, - 'p' : 256, - 'dt' : 1.0E-6, - 't_step_start' : 0, - 't_step_stop' : 3000, #3000 - 't_step_save' : 300, #10 - # ========================================================================== - - # Simulation Algorithm Parameters ========================================== - # Only one patches are necessary, the air tube - 'num_patches' : 1, - # Use the 5 equation model - 'model_eqns' : 2, - # 6 equations model does not need the K \div(u) term - 'alt_soundspeed' : 'F', - # One fluids: air - 'num_fluids' : 1, - # time step - 'mpp_lim' : 'F', - # Correct errors when computing speed of sound - 'mixture_err' : 'T', - # Use TVD RK3 for time marching - 'time_stepper' : 3, - # Reconstruct the primitive variables to minimize spurious - # Use WENO5 - 'weno_order' : 5, - 'weno_eps' : 1.E-16, - 'weno_Re_flux' : 'T', - 'weno_avg' : 'T', - 'avg_state' : 2, - 'mapped_weno' : 'T', - 'null_weights' : 'F', - 'mp_weno' : 'T', - 'riemann_solver' : 2, - 'wave_speeds' : 1, - # We use ghost-cell extrapolation - 'bc_x%beg' : -3, - 'bc_x%end' : -3, - 'bc_y%beg' : -3, - 'bc_y%end' : -3, - 'bc_z%beg' : -3, - 'bc_z%end' : -3, - # Set IB to True and add 1 patch - 'ib' : 'T', - 'num_ibs' : 1, - 'viscous' : 'T', - # ========================================================================== - - # Formatted Database Files Structure Parameters ============================ - 'format' : 1, - 'precision' : 2, - 'prim_vars_wrt' :'T', - 'E_wrt' :'T', - 'parallel_io' :'T', - # ========================================================================== - - # Patch: Constant Tube filled with air ===================================== - # Specify the cylindrical air tube grid geometry - 'patch_icpp(1)%geometry' : 9, - 'patch_icpp(1)%x_centroid' : 0.0, - # Uniform medium density, centroid is at the center of the domain - 'patch_icpp(1)%y_centroid' : 0.0, - 'patch_icpp(1)%z_centroid' : 0.0, - 'patch_icpp(1)%length_x' : 10*D, - 'patch_icpp(1)%length_y' : 5*D, - 'patch_icpp(1)%length_z' : 5*D, - # Specify the patch primitive variables - 'patch_icpp(1)%vel(1)' : 527.2E+00, - 'patch_icpp(1)%vel(2)' : 0.0E+00, - 'patch_icpp(1)%vel(3)' : 0.0E+00, - 'patch_icpp(1)%pres' : 10918.2549, - 'patch_icpp(1)%alpha_rho(1)' : 0.2199, - 'patch_icpp(1)%alpha(1)' : 1.E+00, - # # ======================================================================== - - # Patch: Sphere Immersed Boundary ======================================== - 'patch_ib(1)%geometry' : 8, - 'patch_ib(1)%x_centroid' : -3.0E-3, - 'patch_ib(1)%y_centroid' : 0.0, - 'patch_ib(1)%z_centroid' : 0.0, - 'patch_ib(1)%radius' : D/2, - 'patch_ib(1)%slip' : 'T', - # ========================================================================== - - # Fluids Physical Parameters =============================================== - 'fluid_pp(1)%gamma' : 1.E+00/(gam_a-1.E+00), # 2.50(Not 1.40) - 'fluid_pp(1)%pi_inf' : 0, - 'fluid_pp(1)%Re(1)' : 7535533.2, - # ========================================================================== -})) +print( + json.dumps( + { + # Logistics ================================================================ + "run_time_info": "T", + # Computational Domain Parameters ========================================== + # x direction + "x_domain%beg": -5 * D, + "x_domain%end": 5.0 * D, + # y direction + "y_domain%beg": -2.5 * D, + "y_domain%end": 2.5 * D, + # z direction + "z_domain%beg": -2.5 * D, + "z_domain%end": 2.5 * D, + "cyl_coord": "F", + "m": 512, + "n": 256, + "p": 256, + "dt": 1.0e-6, + "t_step_start": 0, + "t_step_stop": 3000, # 3000 + "t_step_save": 300, # 10 + # Simulation Algorithm Parameters ========================================== + # Only one patches are necessary, the air tube + "num_patches": 1, + # Use the 5 equation model + "model_eqns": 2, + # 6 equations model does not need the K \div(u) term + "alt_soundspeed": "F", + # One fluids: air + "num_fluids": 1, + # time step + "mpp_lim": "F", + # Correct errors when computing speed of sound + "mixture_err": "T", + # Use TVD RK3 for time marching + "time_stepper": 3, + # Reconstruct the primitive variables to minimize spurious + # Use WENO5 + "weno_order": 5, + "weno_eps": 1.0e-16, + "weno_Re_flux": "T", + "weno_avg": "T", + "avg_state": 2, + "mapped_weno": "T", + "null_weights": "F", + "mp_weno": "T", + "riemann_solver": 2, + "wave_speeds": 1, + # We use ghost-cell extrapolation + "bc_x%beg": -3, + "bc_x%end": -3, + "bc_y%beg": -3, + "bc_y%end": -3, + "bc_z%beg": -3, + "bc_z%end": -3, + # Set IB to True and add 1 patch + "ib": "T", + "num_ibs": 1, + "viscous": "T", + # Formatted Database Files Structure Parameters ============================ + "format": 1, + "precision": 2, + "prim_vars_wrt": "T", + "E_wrt": "T", + "parallel_io": "T", + # Patch: Constant Tube filled with air ===================================== + # Specify the cylindrical air tube grid geometry + "patch_icpp(1)%geometry": 9, + "patch_icpp(1)%x_centroid": 0.0, + # Uniform medium density, centroid is at the center of the domain + "patch_icpp(1)%y_centroid": 0.0, + "patch_icpp(1)%z_centroid": 0.0, + "patch_icpp(1)%length_x": 10 * D, + "patch_icpp(1)%length_y": 5 * D, + "patch_icpp(1)%length_z": 5 * D, + # Specify the patch primitive variables + "patch_icpp(1)%vel(1)": 527.2e00, + "patch_icpp(1)%vel(2)": 0.0e00, + "patch_icpp(1)%vel(3)": 0.0e00, + "patch_icpp(1)%pres": 10918.2549, + "patch_icpp(1)%alpha_rho(1)": 0.2199, + "patch_icpp(1)%alpha(1)": 1.0e00, + # Patch: Sphere Immersed Boundary ======================================== + "patch_ib(1)%geometry": 8, + "patch_ib(1)%x_centroid": -3.0e-3, + "patch_ib(1)%y_centroid": 0.0, + "patch_ib(1)%z_centroid": 0.0, + "patch_ib(1)%radius": D / 2, + "patch_ib(1)%slip": "T", + # Fluids Physical Parameters =============================================== + "fluid_pp(1)%gamma": 1.0e00 / (gam_a - 1.0e00), # 2.50(Not 1.40) + "fluid_pp(1)%pi_inf": 0, + "fluid_pp(1)%Re(1)": 7535533.2, + } + ) +) diff --git a/examples/3D_ibm_stl_ellipsoid/case.py b/examples/3D_ibm_stl_ellipsoid/case.py index a004f89d0a..2aa133ef83 100644 --- a/examples/3D_ibm_stl_ellipsoid/case.py +++ b/examples/3D_ibm_stl_ellipsoid/case.py @@ -1,107 +1,98 @@ import json import math -Mu = 1.84E-05 +Mu = 1.84e-05 gam_a = 1.4 rho1 = 0.2199 D = 0.02 # Configuring case dictionary -print(json.dumps({ - # Logistics ================================================================ - 'run_time_info' : 'T', - # ========================================================================== - - # Computational Domain Parameters ========================================== - 'x_domain%beg' : -4*D, - 'x_domain%end' : 4.0*D, - # y direction - 'y_domain%beg' : -2*D, - 'y_domain%end' : 2*D, - # z direction - 'z_domain%beg' : -2*D, - 'z_domain%end' : 2*D, - 'cyl_coord' : 'F', - 'm' : 139, - 'n' : 69, - 'p' : 69, - 'dt' : 1.0E-6, - 't_step_start' : 0, - 't_step_stop' : 1000, - 't_step_save' : 10, - # ========================================================================== - - # Simulation Algorithm Parameters ========================================== - 'num_patches' : 1, - 'model_eqns' : 2, - 'alt_soundspeed' : 'F', - 'num_fluids' : 1, - 'mpp_lim' : 'F', - 'mixture_err' : 'F', - 'time_stepper' : 3, - 'weno_order' : 5, - 'weno_eps' : 1.E-16, - 'weno_Re_flux' : 'F', - 'weno_avg' : 'T', - 'avg_state' : 2, - 'mapped_weno' : 'T', - 'null_weights' : 'F', - 'mp_weno' : 'F', - 'riemann_solver' : 2, - 'wave_speeds' : 1, - 'viscous' :'T', - 'bc_x%beg' : -3, - 'bc_x%end' : -3, - 'bc_y%beg' : -3, - 'bc_y%end' : -3, - 'bc_z%beg' : -3, - 'bc_z%end' : -3, - 'ib' : 'T', - 'num_ibs' : 1, - # ========================================================================== - - # Formatted Database Files Structure Parameters ============================ - 'format' : 1, - 'precision' : 2, - 'prim_vars_wrt' :'T', - 'E_wrt' :'T', - 'omega_wrt(1)' :'T', - 'omega_wrt(2)' :'T', - 'omega_wrt(3)' :'T', - 'parallel_io' :'T', - 'fd_order' : 2, - # ========================================================================== - - # Patch: Constant filled with air ========================================== - 'patch_icpp(1)%geometry' : 9, - 'patch_icpp(1)%x_centroid' : 0.0, - 'patch_icpp(1)%y_centroid' : 0.0, - 'patch_icpp(1)%z_centroid' : 0.0, - 'patch_icpp(1)%length_x' : 100*D, - 'patch_icpp(1)%length_y' : 50*D, - 'patch_icpp(1)%length_z' : 50*D, - 'patch_icpp(1)%vel(1)' : 527.2E+00, - 'patch_icpp(1)%vel(2)' : 0.0E+00, - 'patch_icpp(1)%vel(3)' : 0.0E+00, - 'patch_icpp(1)%pres' : 10918.2549, - 'patch_icpp(1)%alpha_rho(1)' : (1.0)*rho1, - 'patch_icpp(1)%alpha(1)' : 1.E+00, - # # ======================================================================== - - # Patch: Model Immersed Boundary =========================================== - 'patch_ib(1)%geometry' : 12, - 'patch_ib(1)%model_filepath' : 'Ellipsoid_IBM.stl', - 'patch_ib(1)%model_translate(1)' : -0.02056, - 'patch_ib(1)%model_translate(2)' : -0.01, - 'patch_ib(1)%model_translate(3)' : -0.01, - 'patch_ib(1)%model_spc' : 20, - 'patch_ib(1)%model_threshold' : 0.01, - 'patch_ib(1)%slip' : 'F', - # ========================================================================== - - # Fluids Physical Parameters =============================================== - 'fluid_pp(1)%gamma' : 1.E+00/(gam_a-1.E+00), - 'fluid_pp(1)%pi_inf' : 0, - 'fluid_pp(1)%Re(1)' : 7535533.2, - # ========================================================================== -})) \ No newline at end of file +print( + json.dumps( + { + # Logistics ================================================================ + "run_time_info": "T", + # Computational Domain Parameters ========================================== + "x_domain%beg": -4 * D, + "x_domain%end": 4.0 * D, + # y direction + "y_domain%beg": -2 * D, + "y_domain%end": 2 * D, + # z direction + "z_domain%beg": -2 * D, + "z_domain%end": 2 * D, + "cyl_coord": "F", + "m": 139, + "n": 69, + "p": 69, + "dt": 1.0e-6, + "t_step_start": 0, + "t_step_stop": 1000, + "t_step_save": 10, + # Simulation Algorithm Parameters ========================================== + "num_patches": 1, + "model_eqns": 2, + "alt_soundspeed": "F", + "num_fluids": 1, + "mpp_lim": "F", + "mixture_err": "F", + "time_stepper": 3, + "weno_order": 5, + "weno_eps": 1.0e-16, + "weno_Re_flux": "F", + "weno_avg": "T", + "avg_state": 2, + "mapped_weno": "T", + "null_weights": "F", + "mp_weno": "F", + "riemann_solver": 2, + "wave_speeds": 1, + "viscous": "T", + "bc_x%beg": -3, + "bc_x%end": -3, + "bc_y%beg": -3, + "bc_y%end": -3, + "bc_z%beg": -3, + "bc_z%end": -3, + "ib": "T", + "num_ibs": 1, + # Formatted Database Files Structure Parameters ============================ + "format": 1, + "precision": 2, + "prim_vars_wrt": "T", + "E_wrt": "T", + "omega_wrt(1)": "T", + "omega_wrt(2)": "T", + "omega_wrt(3)": "T", + "parallel_io": "T", + "fd_order": 2, + # Patch: Constant filled with air ========================================== + "patch_icpp(1)%geometry": 9, + "patch_icpp(1)%x_centroid": 0.0, + "patch_icpp(1)%y_centroid": 0.0, + "patch_icpp(1)%z_centroid": 0.0, + "patch_icpp(1)%length_x": 100 * D, + "patch_icpp(1)%length_y": 50 * D, + "patch_icpp(1)%length_z": 50 * D, + "patch_icpp(1)%vel(1)": 527.2e00, + "patch_icpp(1)%vel(2)": 0.0e00, + "patch_icpp(1)%vel(3)": 0.0e00, + "patch_icpp(1)%pres": 10918.2549, + "patch_icpp(1)%alpha_rho(1)": (1.0) * rho1, + "patch_icpp(1)%alpha(1)": 1.0e00, + # Patch: Model Immersed Boundary =========================================== + "patch_ib(1)%geometry": 12, + "patch_ib(1)%model_filepath": "Ellipsoid_IBM.stl", + "patch_ib(1)%model_translate(1)": -0.02056, + "patch_ib(1)%model_translate(2)": -0.01, + "patch_ib(1)%model_translate(3)": -0.01, + "patch_ib(1)%model_spc": 20, + "patch_ib(1)%model_threshold": 0.01, + "patch_ib(1)%slip": "F", + # Fluids Physical Parameters =============================================== + "fluid_pp(1)%gamma": 1.0e00 / (gam_a - 1.0e00), + "fluid_pp(1)%pi_inf": 0, + "fluid_pp(1)%Re(1)": 7535533.2, + } + ) +) diff --git a/examples/3D_ibm_stl_pyramid/case.py b/examples/3D_ibm_stl_pyramid/case.py index 7b58f59bf4..cf0010091f 100644 --- a/examples/3D_ibm_stl_pyramid/case.py +++ b/examples/3D_ibm_stl_pyramid/case.py @@ -1,107 +1,98 @@ import json import math -Mu = 1.84E-05 +Mu = 1.84e-05 gam_a = 1.4 rho1 = 0.2199 D = 0.1 # Configuring case dictionary -print(json.dumps({ - # Logistics ================================================================ - 'run_time_info' : 'T', - # ========================================================================== - - # Computational Domain Parameters ========================================== - 'x_domain%beg' : -1.5*D, - 'x_domain%end' : 1.5*D, - # y direction - 'y_domain%beg' : -1.5*D, - 'y_domain%end' : 1.5*D, - # z direction - 'z_domain%beg' : -1.5*D, - 'z_domain%end' : 1.5*D, - 'cyl_coord' : 'F', - 'm' : 299, - 'n' : 299, - 'p' : 299, - 'dt' : 5.0E-7, - 't_step_start' : 0, - 't_step_stop' : 1500, - 't_step_save' : 30, - # ========================================================================== - - # Simulation Algorithm Parameters ========================================== - 'num_patches' : 1, - 'model_eqns' : 2, - 'alt_soundspeed' : 'F', - 'num_fluids' : 1, - 'mpp_lim' : 'F', - 'mixture_err' : 'F', - 'time_stepper' : 3, - 'weno_order' : 5, - 'weno_eps' : 1.E-16, - 'weno_Re_flux' : 'F', - 'weno_avg' : 'T', - 'avg_state' : 2, - 'mapped_weno' : 'T', - 'null_weights' : 'F', - 'mp_weno' : 'F', - 'riemann_solver' : 2, - 'wave_speeds' : 1, - 'viscous' :'T', - 'bc_x%beg' : -3, - 'bc_x%end' : -3, - 'bc_y%beg' : -3, - 'bc_y%end' : -3, - 'bc_z%beg' : -3, - 'bc_z%end' : -3, - 'ib' : 'T', - 'num_ibs' : 1, - # ========================================================================== - - # Formatted Database Files Structure Parameters ============================ - 'format' : 1, - 'precision' : 2, - 'prim_vars_wrt' :'T', - 'E_wrt' :'T', - 'omega_wrt(1)' :'T', - 'omega_wrt(2)' :'T', - 'omega_wrt(3)' :'T', - 'parallel_io' :'T', - 'fd_order' : 2, - # ========================================================================== - - # Patch: Constant filled with air ========================================== - 'patch_icpp(1)%geometry' : 9, - 'patch_icpp(1)%x_centroid' : 0.0, - 'patch_icpp(1)%y_centroid' : 0.0, - 'patch_icpp(1)%z_centroid' : 0.0, - 'patch_icpp(1)%length_x' : 100*D, - 'patch_icpp(1)%length_y' : 50*D, - 'patch_icpp(1)%length_z' : 50*D, - 'patch_icpp(1)%vel(1)' : 527.2E+00, - 'patch_icpp(1)%vel(2)' : 0.0E+00, - 'patch_icpp(1)%vel(3)' : 0.0E+00, - 'patch_icpp(1)%pres' : 10918.2549, - 'patch_icpp(1)%alpha_rho(1)' : (1.0)*rho1, - 'patch_icpp(1)%alpha(1)' : 1.E+00, - # # ======================================================================== - - # Patch: Model Immersed Boundary =========================================== - 'patch_ib(1)%geometry' : 12, - 'patch_ib(1)%model_filepath' : '3DPyramid_IBM.stl', - 'patch_ib(1)%model_translate(1)' : -0.0500000984, - 'patch_ib(1)%model_translate(2)' : -0.0500001003, - 'patch_ib(1)%model_translate(3)' : -0.0500001003, - 'patch_ib(1)%model_spc' : 100, - 'patch_ib(1)%model_threshold' : 0.95, - 'patch_ib(1)%slip' : 'F', - # ========================================================================== - - # Fluids Physical Parameters =============================================== - 'fluid_pp(1)%gamma' : 1.E+00/(gam_a-1.E+00), - 'fluid_pp(1)%pi_inf' : 0, - 'fluid_pp(1)%Re(1)' : 7535533.2, - # ========================================================================== -})) \ No newline at end of file +print( + json.dumps( + { + # Logistics ================================================================ + "run_time_info": "T", + # Computational Domain Parameters ========================================== + "x_domain%beg": -1.5 * D, + "x_domain%end": 1.5 * D, + # y direction + "y_domain%beg": -1.5 * D, + "y_domain%end": 1.5 * D, + # z direction + "z_domain%beg": -1.5 * D, + "z_domain%end": 1.5 * D, + "cyl_coord": "F", + "m": 299, + "n": 299, + "p": 299, + "dt": 5.0e-7, + "t_step_start": 0, + "t_step_stop": 1500, + "t_step_save": 30, + # Simulation Algorithm Parameters ========================================== + "num_patches": 1, + "model_eqns": 2, + "alt_soundspeed": "F", + "num_fluids": 1, + "mpp_lim": "F", + "mixture_err": "F", + "time_stepper": 3, + "weno_order": 5, + "weno_eps": 1.0e-16, + "weno_Re_flux": "F", + "weno_avg": "T", + "avg_state": 2, + "mapped_weno": "T", + "null_weights": "F", + "mp_weno": "F", + "riemann_solver": 2, + "wave_speeds": 1, + "viscous": "T", + "bc_x%beg": -3, + "bc_x%end": -3, + "bc_y%beg": -3, + "bc_y%end": -3, + "bc_z%beg": -3, + "bc_z%end": -3, + "ib": "T", + "num_ibs": 1, + # Formatted Database Files Structure Parameters ============================ + "format": 1, + "precision": 2, + "prim_vars_wrt": "T", + "E_wrt": "T", + "omega_wrt(1)": "T", + "omega_wrt(2)": "T", + "omega_wrt(3)": "T", + "parallel_io": "T", + "fd_order": 2, + # Patch: Constant filled with air ========================================== + "patch_icpp(1)%geometry": 9, + "patch_icpp(1)%x_centroid": 0.0, + "patch_icpp(1)%y_centroid": 0.0, + "patch_icpp(1)%z_centroid": 0.0, + "patch_icpp(1)%length_x": 100 * D, + "patch_icpp(1)%length_y": 50 * D, + "patch_icpp(1)%length_z": 50 * D, + "patch_icpp(1)%vel(1)": 527.2e00, + "patch_icpp(1)%vel(2)": 0.0e00, + "patch_icpp(1)%vel(3)": 0.0e00, + "patch_icpp(1)%pres": 10918.2549, + "patch_icpp(1)%alpha_rho(1)": (1.0) * rho1, + "patch_icpp(1)%alpha(1)": 1.0e00, + # Patch: Model Immersed Boundary =========================================== + "patch_ib(1)%geometry": 12, + "patch_ib(1)%model_filepath": "3DPyramid_IBM.stl", + "patch_ib(1)%model_translate(1)": -0.0500000984, + "patch_ib(1)%model_translate(2)": -0.0500001003, + "patch_ib(1)%model_translate(3)": -0.0500001003, + "patch_ib(1)%model_spc": 100, + "patch_ib(1)%model_threshold": 0.95, + "patch_ib(1)%slip": "F", + # Fluids Physical Parameters =============================================== + "fluid_pp(1)%gamma": 1.0e00 / (gam_a - 1.0e00), + "fluid_pp(1)%pi_inf": 0, + "fluid_pp(1)%Re(1)": 7535533.2, + } + ) +) diff --git a/examples/3D_ibm_stl_test/case.py b/examples/3D_ibm_stl_test/case.py index 7d789364df..ee8b3c48d0 100644 --- a/examples/3D_ibm_stl_test/case.py +++ b/examples/3D_ibm_stl_test/case.py @@ -1,106 +1,97 @@ import json import math -Mu = 1.84E-05 +Mu = 1.84e-05 gam_a = 1.4 rho1 = 1.19 D = 3 # Configuring case dictionary -print(json.dumps({ - # Logistics ================================================================ - 'run_time_info' : 'T', - # ========================================================================== - - # Computational Domain Parameters ========================================== - 'x_domain%beg' : -4*D, - 'x_domain%end' : 4.0*D, - # y direction - 'y_domain%beg' : -2*D, - 'y_domain%end' : 2*D, - # z direction - 'z_domain%beg' : -2*D, - 'z_domain%end' : 2*D, - 'cyl_coord' : 'F', - 'm' : 99, - 'n' : 49, - 'p' : 49, - 'dt' : 1.0E-9, - 't_step_start' : 0, - 't_step_stop' : 1000, - 't_step_save' : 10, - # ========================================================================== - - # Simulation Algorithm Parameters ========================================== - 'num_patches' : 1, - 'model_eqns' : 2, - 'alt_soundspeed' : 'F', - 'num_fluids' : 1, - 'mpp_lim' : 'F', - 'mixture_err' : 'F', - 'time_stepper' : 3, - 'weno_order' : 5, - 'weno_eps' : 1.E-16, - 'weno_Re_flux' : 'F', - 'weno_avg' : 'T', - 'avg_state' : 2, - 'mapped_weno' : 'T', - 'null_weights' : 'F', - 'mp_weno' : 'F', - 'riemann_solver' : 2, - 'wave_speeds' : 1, - 'viscous' :'F', - 'bc_x%beg' : -3, - 'bc_x%end' : -3, - 'bc_y%beg' : -3, - 'bc_y%end' : -3, - 'bc_z%beg' : -3, - 'bc_z%end' : -3, - 'ib' : 'T', - 'num_ibs' : 1, - # ========================================================================== - - # Formatted Database Files Structure Parameters ============================ - 'format' : 1, - 'precision' : 2, - 'prim_vars_wrt' :'T', - 'E_wrt' :'T', - 'omega_wrt(1)' :'T', - 'omega_wrt(2)' :'T', - 'omega_wrt(3)' :'T', - 'parallel_io' :'T', - 'fd_order' : 2, - # ========================================================================== - - # Patch: Constant filled with air ========================================== - 'patch_icpp(1)%geometry' : 9, - 'patch_icpp(1)%x_centroid' : 0.0, - 'patch_icpp(1)%y_centroid' : 0.0, - 'patch_icpp(1)%z_centroid' : 0.0, - 'patch_icpp(1)%length_x' : 100*D, - 'patch_icpp(1)%length_y' : 50*D, - 'patch_icpp(1)%length_z' : 50*D, - 'patch_icpp(1)%vel(1)' : 0.001, - 'patch_icpp(1)%vel(2)' : 0.0E+00, - 'patch_icpp(1)%vel(3)' : 0.0E+00, - 'patch_icpp(1)%pres' : 100000, - 'patch_icpp(1)%alpha_rho(1)' : (1.0)*rho1, - 'patch_icpp(1)%alpha(1)' : 1.E+00, - # # ======================================================================== - - # Patch: Model Immersed Boundary =========================================== - 'patch_ib(1)%geometry' : 12, - 'patch_ib(1)%model_filepath' : "Cube_IBM.stl", - 'patch_ib(1)%model_translate(1)' : 0, - 'patch_ib(1)%model_translate(2)' : -0.05, - 'patch_ib(1)%model_translate(3)' : -0.05, - 'patch_ib(1)%model_spc' : 100, - 'patch_ib(1)%model_threshold' : 0.95, - 'patch_ib(1)%slip' : 'F', - # ========================================================================== - - # Fluids Physical Parameters =============================================== - 'fluid_pp(1)%gamma' : 1.E+00/(gam_a-1.E+00), - 'fluid_pp(1)%pi_inf' : 0, - # ========================================================================== -})) \ No newline at end of file +print( + json.dumps( + { + # Logistics ================================================================ + "run_time_info": "T", + # Computational Domain Parameters ========================================== + "x_domain%beg": -4 * D, + "x_domain%end": 4.0 * D, + # y direction + "y_domain%beg": -2 * D, + "y_domain%end": 2 * D, + # z direction + "z_domain%beg": -2 * D, + "z_domain%end": 2 * D, + "cyl_coord": "F", + "m": 99, + "n": 49, + "p": 49, + "dt": 1.0e-9, + "t_step_start": 0, + "t_step_stop": 1000, + "t_step_save": 10, + # Simulation Algorithm Parameters ========================================== + "num_patches": 1, + "model_eqns": 2, + "alt_soundspeed": "F", + "num_fluids": 1, + "mpp_lim": "F", + "mixture_err": "F", + "time_stepper": 3, + "weno_order": 5, + "weno_eps": 1.0e-16, + "weno_Re_flux": "F", + "weno_avg": "T", + "avg_state": 2, + "mapped_weno": "T", + "null_weights": "F", + "mp_weno": "F", + "riemann_solver": 2, + "wave_speeds": 1, + "viscous": "F", + "bc_x%beg": -3, + "bc_x%end": -3, + "bc_y%beg": -3, + "bc_y%end": -3, + "bc_z%beg": -3, + "bc_z%end": -3, + "ib": "T", + "num_ibs": 1, + # Formatted Database Files Structure Parameters ============================ + "format": 1, + "precision": 2, + "prim_vars_wrt": "T", + "E_wrt": "T", + "omega_wrt(1)": "T", + "omega_wrt(2)": "T", + "omega_wrt(3)": "T", + "parallel_io": "T", + "fd_order": 2, + # Patch: Constant filled with air ========================================== + "patch_icpp(1)%geometry": 9, + "patch_icpp(1)%x_centroid": 0.0, + "patch_icpp(1)%y_centroid": 0.0, + "patch_icpp(1)%z_centroid": 0.0, + "patch_icpp(1)%length_x": 100 * D, + "patch_icpp(1)%length_y": 50 * D, + "patch_icpp(1)%length_z": 50 * D, + "patch_icpp(1)%vel(1)": 0.001, + "patch_icpp(1)%vel(2)": 0.0e00, + "patch_icpp(1)%vel(3)": 0.0e00, + "patch_icpp(1)%pres": 100000, + "patch_icpp(1)%alpha_rho(1)": (1.0) * rho1, + "patch_icpp(1)%alpha(1)": 1.0e00, + # Patch: Model Immersed Boundary =========================================== + "patch_ib(1)%geometry": 12, + "patch_ib(1)%model_filepath": "Cube_IBM.stl", + "patch_ib(1)%model_translate(1)": 0, + "patch_ib(1)%model_translate(2)": -0.05, + "patch_ib(1)%model_translate(3)": -0.05, + "patch_ib(1)%model_spc": 100, + "patch_ib(1)%model_threshold": 0.95, + "patch_ib(1)%slip": "F", + # Fluids Physical Parameters =============================================== + "fluid_pp(1)%gamma": 1.0e00 / (gam_a - 1.0e00), + "fluid_pp(1)%pi_inf": 0, + } + ) +) diff --git a/examples/3D_lagrange_bubblescreen/case.py b/examples/3D_lagrange_bubblescreen/case.py index 35f7c3a935..566768c999 100644 --- a/examples/3D_lagrange_bubblescreen/case.py +++ b/examples/3D_lagrange_bubblescreen/case.py @@ -1,198 +1,181 @@ #!/usr/bin/env python3 - import math import json # Bubble screen -# Description: A planar acoustic wave interacts with a bubble cloud -# in water. The background field is modeled in using an Eulerian framework, +# Description: A planar acoustic wave interacts with a bubble cloud +# in water. The background field is modeled in using an Eulerian framework, # while the bubbles are tracked using a Lagrangian framework. -# Reference values for nondimensionalization -x0 = 1.e-03 # length - m -rho0 = 1.e+03 # density - kg/m3 -c0 = 1475. # speed of sound - m/s -p0 = rho0*c0*c0 # pressure - Pa -T0 = 298 # temperature - K +# Reference values for nondimensionalization +x0 = 1.0e-03 # length - m +rho0 = 1.0e03 # density - kg/m3 +c0 = 1475.0 # speed of sound - m/s +p0 = rho0 * c0 * c0 # pressure - Pa +T0 = 298 # temperature - K # Host properties (water) -gamma_host = 2.7466 # Specific heat ratio -pi_inf_host = 792.02e+06 # Stiffness - Pa -mu_host = 1e-3 # Dynamic viscosity - Pa.s -c_host = 1475. # speed of sound - m/s -rho_host = 1000 # density kg/m3 -T_host = 298 # temperature K +gamma_host = 2.7466 # Specific heat ratio +pi_inf_host = 792.02e06 # Stiffness - Pa +mu_host = 1e-3 # Dynamic viscosity - Pa.s +c_host = 1475.0 # speed of sound - m/s +rho_host = 1000 # density kg/m3 +T_host = 298 # temperature K # Lagrangian bubbles' properties -R_uni = 8314 # Universal gas constant - J/kmol/K -MW_g = 28.0 # Molar weight of the gas - kg/kmol -MW_v = 18.0 # Molar weight of the vapor - kg/kmol -gamma_g = 1.4 # Specific heat ratio of the gas -gamma_v = 1.333 # Specific heat ratio of the vapor -pv = 2350 # Vapor pressure of the host - Pa -cp_g = 1.e3 # Specific heat of the gas - J/kg/K -cp_v = 2.1e3 # Specific heat of the vapor - J/kg/K -k_g = 0.025 # Thermal conductivity of the gas - W/m/K -k_v = 0.02 # Thermal conductivity of the vapor - W/m/K +R_uni = 8314 # Universal gas constant - J/kmol/K +MW_g = 28.0 # Molar weight of the gas - kg/kmol +MW_v = 18.0 # Molar weight of the vapor - kg/kmol +gamma_g = 1.4 # Specific heat ratio of the gas +gamma_v = 1.333 # Specific heat ratio of the vapor +pv = 2350 # Vapor pressure of the host - Pa +cp_g = 1.0e3 # Specific heat of the gas - J/kg/K +cp_v = 2.1e3 # Specific heat of the vapor - J/kg/K +k_g = 0.025 # Thermal conductivity of the gas - W/m/K +k_v = 0.02 # Thermal conductivity of the vapor - W/m/K diffVapor = 2.5e-5 # Diffusivity coefficient of the vapor - m2/s -sigBubble = 0.069 # Surface tension of the bubble - N/m +sigBubble = 0.069 # Surface tension of the bubble - N/m mu_g = 1.48e-5 # Acoustic source properties -patm = 101325. # Atmospheric pressure - Pa -pamp = 1.e5 # Amplitude of the acoustic source - Pa -freq = 300e+03 # Source frequency - Hz -wlen = c_host/freq # Wavelength - m +patm = 101325.0 # Atmospheric pressure - Pa +pamp = 1.0e5 # Amplitude of the acoustic source - Pa +freq = 300e03 # Source frequency - Hz +wlen = c_host / freq # Wavelength - m # Domain and time set up -xb = -12.e-3 # Domain boundaries - m (x direction) -xe = 12.e-3 -yb = -2.5e-3 # Domain boundaries - m (y direction) +xb = -12.0e-3 # Domain boundaries - m (x direction) +xe = 12.0e-3 +yb = -2.5e-3 # Domain boundaries - m (y direction) ye = 2.5e-3 -zb = -2.5e-3 # Domain boundaries - m (z direction) +zb = -2.5e-3 # Domain boundaries - m (z direction) ze = 2.5e-3 -Nx = 240 # number of elements into x direction -Ny = 50 # number of elements into y direction -Nz = 50 # number of elements into z direction - -dt = 7.5e-9 # constant time-step - sec +Nx = 240 # number of elements into x direction +Ny = 50 # number of elements into y direction +Nz = 50 # number of elements into z direction -# ============================================================================== +dt = 7.5e-9 # constant time-step - sec # Configuring case dictionary -print(json.dumps({ - # Logistics ================================================ - 'run_time_info' : 'T', - # ========================================================== - - # Computational Domain Parameters ========================== - 'x_domain%beg' : xb/x0, - 'x_domain%end' : xe/x0, - 'y_domain%beg' : yb/x0, - 'y_domain%end' : ye/x0, - 'z_domain%beg' : zb/x0, - 'z_domain%end' : ze/x0, - 'stretch_z' : 'F', - 'stretch_y' : 'F', - 'stretch_x' : 'F', - 'm' : Nx, - 'n' : Ny, - 'p' : Nz, - 'dt' : dt*(c0/x0), - 't_step_start' : 0, - 't_step_stop' : 3000, - 't_step_save' : 500, - # ========================================================== - - # Simulation Algorithm Parameters ========================== - 'model_eqns' : 2, - 'time_stepper' : 3, - 'num_fluids' : 2, - 'num_patches' : 1, - 'viscous' : 'T', - 'mpp_lim' : 'F', - 'weno_order' : 5, - 'weno_eps' : 1.0E-16, - 'mapped_weno' :'T', - 'riemann_solver' : 2, - 'wave_speeds' : 1, - 'avg_state' : 2, - 'bc_x%beg' :-6, - 'bc_x%end' :-6, - 'bc_y%beg' :-1, - 'bc_y%end' :-1, - 'bc_z%beg' :-1, - 'bc_z%end' :-1, - # ========================================================== - - # Acoustic source ========================================== - 'acoustic_source' : 'T', - 'num_source' : 1, - 'acoustic(1)%support' : 3, - 'acoustic(1)%pulse' : 1, - 'acoustic(1)%npulse' : 1, - 'acoustic(1)%mag' : pamp/p0, - 'acoustic(1)%wavelength' : wlen/x0, - 'acoustic(1)%length' : 2*(ze-zb)/x0, - 'acoustic(1)%height' : 2*(ye-yb)/x0, - 'acoustic(1)%loc(1)' : -7.e-03/x0, - 'acoustic(1)%loc(2)' : 0., - 'acoustic(1)%loc(3)' : 0., - 'acoustic(1)%dir' : 0., - 'acoustic(1)%delay' : 0., - # ========================================================== - - # Formatted Database Files Structure Parameters ============ - 'format' : 1, - 'precision' : 2, - 'prim_vars_wrt' :'T', - 'parallel_io' :'T', - # ========================================================== - - # Patch 1: Water (left) ==================================== - 'patch_icpp(1)%geometry' : 9, - 'patch_icpp(1)%x_centroid' : 0., - 'patch_icpp(1)%y_centroid' : 0., - 'patch_icpp(1)%z_centroid' : 0., - 'patch_icpp(1)%length_x' : 2*(xe-xb)/x0, - 'patch_icpp(1)%length_y' : 2*(ye-yb)/x0, - 'patch_icpp(1)%length_z' : 2*(ze-zb)/x0, - 'patch_icpp(1)%vel(1)' : 0., - 'patch_icpp(1)%vel(2)' : 0., - 'patch_icpp(1)%vel(3)' : 0., - 'patch_icpp(1)%pres' : patm/p0, - 'patch_icpp(1)%alpha_rho(1)' : rho_host/rho0, - 'patch_icpp(1)%alpha_rho(2)' : 0., - 'patch_icpp(1)%alpha(1)' : 1., - 'patch_icpp(1)%alpha(2)' : 0., - # ========================================================== - - # Lagrangian Bubbles =========================== - 'bubbles_lagrange' : 'T', - 'bubble_model' : 2, # Keller-Miksis model - 'lag_params%nBubs_glb' : 1194, # Number of bubbles - 'lag_params%solver_approach' : 2, - 'lag_params%cluster_type' : 2, - 'lag_params%pressure_corrector' : 'T', - 'lag_params%smooth_type' : 1, - 'lag_params%heatTransfer_model' : 'T', - 'lag_params%massTransfer_model' : 'T', - 'lag_params%epsilonb' : 1.0, - 'lag_params%valmaxvoid' : 0.9, - 'lag_params%write_bubbles' : 'F', - 'lag_params%write_bubbles_stats' : 'F', - 'lag_params%c0' : c0, - 'lag_params%rho0' : rho0, - 'lag_params%T0' : T0, - 'lag_params%x0' : x0, - 'lag_params%diffcoefvap' : diffVapor, - 'lag_params%Thost' : T_host, - # ========================================================== - - # Fluids Physical Parameters =============================== - # Host medium - 'fluid_pp(1)%gamma' : 1.0/(gamma_host-1.0), - 'fluid_pp(1)%pi_inf' : gamma_host*(pi_inf_host/p0)/(gamma_host-1.0), - 'fluid_pp(1)%Re(1)' : 1.0/(mu_host/(rho0*c0*x0)), - 'fluid_pp(1)%mul0' : mu_host, - 'fluid_pp(1)%ss' : sigBubble, - 'fluid_pp(1)%pv' : pv, - 'fluid_pp(1)%gamma_v' : gamma_v, - 'fluid_pp(1)%M_v' : MW_v, - 'fluid_pp(1)%k_v' : k_v, - 'fluid_pp(1)%cp_v' : cp_v, - - # Bubble gas state - 'fluid_pp(2)%gamma' : 1./(gamma_g-1.), - 'fluid_pp(2)%pi_inf' : 0.0E+00, - 'fluid_pp(2)%Re(1)' : 1.0/(mu_g/(rho0*c0*x0)), - 'fluid_pp(2)%gamma_v' : gamma_g, - 'fluid_pp(2)%M_v' : MW_g, - 'fluid_pp(2)%k_v' : k_g, - 'fluid_pp(2)%cp_v' : cp_g, - # ========================================================== - })) - -# ============================================================================== +print( + json.dumps( + { + # Logistics ================================================ + "run_time_info": "T", + # Computational Domain Parameters ========================== + "x_domain%beg": xb / x0, + "x_domain%end": xe / x0, + "y_domain%beg": yb / x0, + "y_domain%end": ye / x0, + "z_domain%beg": zb / x0, + "z_domain%end": ze / x0, + "stretch_z": "F", + "stretch_y": "F", + "stretch_x": "F", + "m": Nx, + "n": Ny, + "p": Nz, + "dt": dt * (c0 / x0), + "t_step_start": 0, + "t_step_stop": 3000, + "t_step_save": 500, + # Simulation Algorithm Parameters ========================== + "model_eqns": 2, + "time_stepper": 3, + "num_fluids": 2, + "num_patches": 1, + "viscous": "T", + "mpp_lim": "F", + "weno_order": 5, + "weno_eps": 1.0e-16, + "mapped_weno": "T", + "riemann_solver": 2, + "wave_speeds": 1, + "avg_state": 2, + "bc_x%beg": -6, + "bc_x%end": -6, + "bc_y%beg": -1, + "bc_y%end": -1, + "bc_z%beg": -1, + "bc_z%end": -1, + # Acoustic source ========================================== + "acoustic_source": "T", + "num_source": 1, + "acoustic(1)%support": 3, + "acoustic(1)%pulse": 1, + "acoustic(1)%npulse": 1, + "acoustic(1)%mag": pamp / p0, + "acoustic(1)%wavelength": wlen / x0, + "acoustic(1)%length": 2 * (ze - zb) / x0, + "acoustic(1)%height": 2 * (ye - yb) / x0, + "acoustic(1)%loc(1)": -7.0e-03 / x0, + "acoustic(1)%loc(2)": 0.0, + "acoustic(1)%loc(3)": 0.0, + "acoustic(1)%dir": 0.0, + "acoustic(1)%delay": 0.0, + # Formatted Database Files Structure Parameters ============ + "format": 1, + "precision": 2, + "prim_vars_wrt": "T", + "parallel_io": "T", + # Patch 1: Water (left) ==================================== + "patch_icpp(1)%geometry": 9, + "patch_icpp(1)%x_centroid": 0.0, + "patch_icpp(1)%y_centroid": 0.0, + "patch_icpp(1)%z_centroid": 0.0, + "patch_icpp(1)%length_x": 2 * (xe - xb) / x0, + "patch_icpp(1)%length_y": 2 * (ye - yb) / x0, + "patch_icpp(1)%length_z": 2 * (ze - zb) / x0, + "patch_icpp(1)%vel(1)": 0.0, + "patch_icpp(1)%vel(2)": 0.0, + "patch_icpp(1)%vel(3)": 0.0, + "patch_icpp(1)%pres": patm / p0, + "patch_icpp(1)%alpha_rho(1)": rho_host / rho0, + "patch_icpp(1)%alpha_rho(2)": 0.0, + "patch_icpp(1)%alpha(1)": 1.0, + "patch_icpp(1)%alpha(2)": 0.0, + # Lagrangian Bubbles =========================== + "bubbles_lagrange": "T", + "bubble_model": 2, # Keller-Miksis model + "lag_params%nBubs_glb": 1194, # Number of bubbles + "lag_params%solver_approach": 2, + "lag_params%cluster_type": 2, + "lag_params%pressure_corrector": "T", + "lag_params%smooth_type": 1, + "lag_params%heatTransfer_model": "T", + "lag_params%massTransfer_model": "T", + "lag_params%epsilonb": 1.0, + "lag_params%valmaxvoid": 0.9, + "lag_params%write_bubbles": "F", + "lag_params%write_bubbles_stats": "F", + "lag_params%c0": c0, + "lag_params%rho0": rho0, + "lag_params%T0": T0, + "lag_params%x0": x0, + "lag_params%diffcoefvap": diffVapor, + "lag_params%Thost": T_host, + # Fluids Physical Parameters =============================== + # Host medium + "fluid_pp(1)%gamma": 1.0 / (gamma_host - 1.0), + "fluid_pp(1)%pi_inf": gamma_host * (pi_inf_host / p0) / (gamma_host - 1.0), + "fluid_pp(1)%Re(1)": 1.0 / (mu_host / (rho0 * c0 * x0)), + "fluid_pp(1)%mul0": mu_host, + "fluid_pp(1)%ss": sigBubble, + "fluid_pp(1)%pv": pv, + "fluid_pp(1)%gamma_v": gamma_v, + "fluid_pp(1)%M_v": MW_v, + "fluid_pp(1)%k_v": k_v, + "fluid_pp(1)%cp_v": cp_v, + # Bubble gas state + "fluid_pp(2)%gamma": 1.0 / (gamma_g - 1.0), + "fluid_pp(2)%pi_inf": 0.0e00, + "fluid_pp(2)%Re(1)": 1.0 / (mu_g / (rho0 * c0 * x0)), + "fluid_pp(2)%gamma_v": gamma_g, + "fluid_pp(2)%M_v": MW_g, + "fluid_pp(2)%k_v": k_g, + "fluid_pp(2)%cp_v": cp_g, + } + ) +) diff --git a/examples/3D_lagrange_shbubcollapse/case.py b/examples/3D_lagrange_shbubcollapse/case.py index a002472178..ff3c24dd82 100644 --- a/examples/3D_lagrange_shbubcollapse/case.py +++ b/examples/3D_lagrange_shbubcollapse/case.py @@ -1,200 +1,185 @@ #!/usr/bin/env python3 - import math import json # Single bubble collapse -# Description: A planar acoustic wave interacts with a single bubble -# in water. The background field is modeled in using an Eulerian framework, +# Description: A planar acoustic wave interacts with a single bubble +# in water. The background field is modeled in using an Eulerian framework, # while the bubbles are tracked using a Lagrangian framework. -# Reference values for nondimensionalization -x0 = 1.e-03 # length - m -rho0 = 1.e+03 # density - kg/m3 -c0 = 1475. # speed of sound - m/s -T0 = 298 # temperature - K -p0 = rho0*c0*c0 # pressure - Pa +# Reference values for nondimensionalization +x0 = 1.0e-03 # length - m +rho0 = 1.0e03 # density - kg/m3 +c0 = 1475.0 # speed of sound - m/s +T0 = 298 # temperature - K +p0 = rho0 * c0 * c0 # pressure - Pa # Host properties (water + glicerol) -gamma_host = 2.7466 # Specific heat ratio -pi_inf_host = 792.02e+06 # Stiffness - Pa -mu_host = 0.006 # Dynamic viscosity - Pa.s -c_host = 1475. # speed of sound - m/s -rho_host = 1000 # density kg/m3 -T_host = T0 # temperature K +gamma_host = 2.7466 # Specific heat ratio +pi_inf_host = 792.02e06 # Stiffness - Pa +mu_host = 0.006 # Dynamic viscosity - Pa.s +c_host = 1475.0 # speed of sound - m/s +rho_host = 1000 # density kg/m3 +T_host = T0 # temperature K # Lagrangian bubble's properties -R_uni = 8314 # Universal gas constant - J/kmol/K -MW_g = 28.0 # Molar weight of the gas - kg/kmol -MW_v = 18.0 # Molar weight of the vapor - kg/kmol -gamma_g = 1.33 # Specific heat ratio of the gas -gamma_v = 1.33 # Specific heat ratio of the vapor -pv = 2500 # Vapor pressure of the host - Pa -cp_g = 1.e3 # Specific heat of the gas - J/kg/K -cp_v = 2.1e3 # Specific heat of the vapor - J/kg/K -k_g = 0.025 # Thermal conductivity of the gas - W/m/K -k_v = 0.02 # Thermal conductivity of the vapor - W/m/K +R_uni = 8314 # Universal gas constant - J/kmol/K +MW_g = 28.0 # Molar weight of the gas - kg/kmol +MW_v = 18.0 # Molar weight of the vapor - kg/kmol +gamma_g = 1.33 # Specific heat ratio of the gas +gamma_v = 1.33 # Specific heat ratio of the vapor +pv = 2500 # Vapor pressure of the host - Pa +cp_g = 1.0e3 # Specific heat of the gas - J/kg/K +cp_v = 2.1e3 # Specific heat of the vapor - J/kg/K +k_g = 0.025 # Thermal conductivity of the gas - W/m/K +k_v = 0.02 # Thermal conductivity of the vapor - W/m/K diffVapor = 2.5e-5 # Diffusivity coefficient of the vapor - m2/s -sigBubble = 0.07 # Surface tension of the bubble - N/m +sigBubble = 0.07 # Surface tension of the bubble - N/m mu_gas = 1.48e-5 # Acoustic source properties -patm = 1.e+05 # Atmospheric pressure - Pa -pamp = 1.32e+05 # Amplitude of the acoustic source - Pa -freq = 21.4e+03 # Source frequency - Hz -wlen = c_host/freq # Wavelength - m +patm = 1.0e05 # Atmospheric pressure - Pa +pamp = 1.32e05 # Amplitude of the acoustic source - Pa +freq = 21.4e03 # Source frequency - Hz +wlen = c_host / freq # Wavelength - m # Domain and time set up -xb = -6.e-3 # Domain boundaries - m (x direction) -xe = 6.e-3 -yb = -3.e-3 # Domain boundaries - m (y direction) -ye = 3.e-3 -zb = -3.e-3 # Domain boundaries - m (z direction) -ze = 3.e-3 +xb = -6.0e-3 # Domain boundaries - m (x direction) +xe = 6.0e-3 +yb = -3.0e-3 # Domain boundaries - m (y direction) +ye = 3.0e-3 +zb = -3.0e-3 # Domain boundaries - m (z direction) +ze = 3.0e-3 -Nx = 2*60 # number of elements into x direction -Ny = 60 # number of elements into y direction -Nz = 60 # number of elements into z direction +Nx = 2 * 60 # number of elements into x direction +Ny = 60 # number of elements into y direction +Nz = 60 # number of elements into z direction -dt = 4.e-08 # time-step - sec -stopTime = 60.e-06 # stop time - sec -saveTime = 30.e-06 # save time - sec +dt = 4.0e-08 # time-step - sec +stopTime = 60.0e-06 # stop time - sec +saveTime = 30.0e-06 # save time - sec # Configuring case dictionary -print(json.dumps({ - # Logistics ================================================ - 'run_time_info' : 'T', - # ========================================================== - - # Computational Domain Parameters ========================== - 'x_domain%beg' : xb/x0, - 'x_domain%end' : xe/x0, - 'y_domain%beg' : yb/x0, - 'y_domain%end' : ye/x0, - 'z_domain%beg' : zb/x0, - 'z_domain%end' : ze/x0, - 'stretch_x' : 'F', - 'stretch_y' : 'F', - 'stretch_z' : 'F', - 'm' : Nx, - 'n' : Ny, - 'p' : Nz, - 'dt' : round(dt*c0/x0,6), - 'n_start' : 0, - 't_save' : saveTime*(c0/x0), - 't_stop' : stopTime*(c0/x0), - # ========================================================== - - # Simulation Algorithm Parameters ========================== - 'model_eqns' : 2, - 'num_fluids' : 2, - 'num_patches' : 1, - 'mpp_lim' : 'F', - 'viscous' : 'T', - 'time_stepper' : 4, # 4th/5th RKCK - 'weno_order' : 5, - 'weno_eps' : 1.0E-16, - 'mapped_weno' :'T', - 'riemann_solver' : 2, - 'wave_speeds' : 1, - 'avg_state' : 2, - 'bc_x%beg' :-6, - 'bc_x%end' :-6, - 'bc_y%beg' :-6, - 'bc_y%end' :-6, - 'bc_z%beg' :-6, - 'bc_z%end' :-6, - # ========================================================== - - # Formatted Database Files Structure Parameters ============ - 'format' : 1, - 'precision' : 2, - 'prim_vars_wrt' :'T', - 'parallel_io' :'T', - # ========================================================== - - # Patch 1: Water (left) ==================================== - 'patch_icpp(1)%geometry' : 9, - 'patch_icpp(1)%x_centroid' : 0., - 'patch_icpp(1)%y_centroid' : 0., - 'patch_icpp(1)%z_centroid' : 0., - 'patch_icpp(1)%length_x' : 2*(xe-xb)/x0, - 'patch_icpp(1)%length_y' : 2*(ye-yb)/x0, - 'patch_icpp(1)%length_z' : 2*(ze-zb)/x0, - 'patch_icpp(1)%vel(1)' : 0., - 'patch_icpp(1)%vel(2)' : 0., - 'patch_icpp(1)%vel(3)' : 0., - 'patch_icpp(1)%pres' : patm/p0, - 'patch_icpp(1)%alpha_rho(1)' : rho_host/rho0, - 'patch_icpp(1)%alpha_rho(2)' : 0., - 'patch_icpp(1)%alpha(1)' : 1., - 'patch_icpp(1)%alpha(2)' : 0., - # ========================================================== - - # Acoustic source ========================================== - 'acoustic_source' : 'T', - 'num_source' : 1, - 'acoustic(1)%support' : 3, - 'acoustic(1)%pulse' : 1, - 'acoustic(1)%npulse' : 10, - 'acoustic(1)%mag' : -pamp/p0, - 'acoustic(1)%wavelength' : wlen/x0, - 'acoustic(1)%length' : 2*(ze-zb)/x0, - 'acoustic(1)%height' : 2*(ye-yb)/x0, - 'acoustic(1)%loc(1)' : -2.E-03/x0, - 'acoustic(1)%loc(2)' : 0., - 'acoustic(1)%loc(3)' : 0., - 'acoustic(1)%dir' : 0., - 'acoustic(1)%delay' : 0., - # ========================================================== - - # Lagrangian Bubbles =========================== - 'bubbles_lagrange' : 'T', - 'bubble_model' : 2, # Keller-Miksis model - 'rkck_adap_dt' : 'T', # Activate adaptive time stepper - 'rkck_tolerance' : 1.0e-05, - 'lag_params%nBubs_glb' : 1, - 'lag_params%solver_approach' : 2, # Two-way coupled - 'lag_params%cluster_type' : 2, - 'lag_params%pressure_corrector' : 'T', - 'lag_params%smooth_type' : 1, - 'lag_params%heatTransfer_model' : 'T', - 'lag_params%massTransfer_model' : 'F', - 'lag_params%epsilonb' : 1.0, - 'lag_params%valmaxvoid' : 0.9, - 'lag_params%write_bubbles' : 'F', - 'lag_params%write_bubbles_stats' : 'F', - 'lag_params%c0' : c0, - 'lag_params%rho0' : rho0, - 'lag_params%T0' : T0, - 'lag_params%x0' : x0, - 'lag_params%diffcoefvap' : diffVapor, - 'lag_params%Thost' : T_host, - # ========================================================== - - # Fluids Physical Parameters =============================== - # Host medium - 'fluid_pp(1)%gamma' : 1.0/(gamma_host-1.0), - 'fluid_pp(1)%pi_inf' : gamma_host*(pi_inf_host/p0)/(gamma_host-1.0), - 'fluid_pp(1)%Re(1)' : 1.0/(mu_host/(rho0*c0*x0)), - 'fluid_pp(1)%mul0' : mu_host, - 'fluid_pp(1)%ss' : sigBubble, - 'fluid_pp(1)%pv' : pv, - 'fluid_pp(1)%gamma_v' : gamma_v, - 'fluid_pp(1)%M_v' : MW_v, - 'fluid_pp(1)%k_v' : k_v, - 'fluid_pp(1)%cp_v' : cp_v, - - # Bubble gas state - 'fluid_pp(2)%gamma' : 1./(gamma_g-1.), - 'fluid_pp(2)%pi_inf' : 0.0E+00, - 'fluid_pp(2)%Re(1)' : 1.0/(mu_gas/(rho0*c0*x0)), - 'fluid_pp(2)%gamma_v' : gamma_g, - 'fluid_pp(2)%M_v' : MW_g, - 'fluid_pp(2)%k_v' : k_g, - 'fluid_pp(2)%cp_v' : cp_g, - # ========================================================== - })) - -# ============================================================================== +print( + json.dumps( + { + # Logistics ================================================ + "run_time_info": "T", + # Computational Domain Parameters ========================== + "x_domain%beg": xb / x0, + "x_domain%end": xe / x0, + "y_domain%beg": yb / x0, + "y_domain%end": ye / x0, + "z_domain%beg": zb / x0, + "z_domain%end": ze / x0, + "stretch_x": "F", + "stretch_y": "F", + "stretch_z": "F", + "m": Nx, + "n": Ny, + "p": Nz, + "dt": round(dt * c0 / x0, 6), + "n_start": 0, + "t_save": saveTime * (c0 / x0), + "t_stop": stopTime * (c0 / x0), + # Simulation Algorithm Parameters ========================== + "model_eqns": 2, + "num_fluids": 2, + "num_patches": 1, + "mpp_lim": "F", + "viscous": "T", + "time_stepper": 4, # 4th/5th RKCK + "weno_order": 5, + "weno_eps": 1.0e-16, + "mapped_weno": "T", + "riemann_solver": 2, + "wave_speeds": 1, + "avg_state": 2, + "bc_x%beg": -6, + "bc_x%end": -6, + "bc_y%beg": -6, + "bc_y%end": -6, + "bc_z%beg": -6, + "bc_z%end": -6, + # Formatted Database Files Structure Parameters ============ + "format": 1, + "precision": 2, + "prim_vars_wrt": "T", + "parallel_io": "T", + # Patch 1: Water (left) ==================================== + "patch_icpp(1)%geometry": 9, + "patch_icpp(1)%x_centroid": 0.0, + "patch_icpp(1)%y_centroid": 0.0, + "patch_icpp(1)%z_centroid": 0.0, + "patch_icpp(1)%length_x": 2 * (xe - xb) / x0, + "patch_icpp(1)%length_y": 2 * (ye - yb) / x0, + "patch_icpp(1)%length_z": 2 * (ze - zb) / x0, + "patch_icpp(1)%vel(1)": 0.0, + "patch_icpp(1)%vel(2)": 0.0, + "patch_icpp(1)%vel(3)": 0.0, + "patch_icpp(1)%pres": patm / p0, + "patch_icpp(1)%alpha_rho(1)": rho_host / rho0, + "patch_icpp(1)%alpha_rho(2)": 0.0, + "patch_icpp(1)%alpha(1)": 1.0, + "patch_icpp(1)%alpha(2)": 0.0, + # Acoustic source ========================================== + "acoustic_source": "T", + "num_source": 1, + "acoustic(1)%support": 3, + "acoustic(1)%pulse": 1, + "acoustic(1)%npulse": 10, + "acoustic(1)%mag": -pamp / p0, + "acoustic(1)%wavelength": wlen / x0, + "acoustic(1)%length": 2 * (ze - zb) / x0, + "acoustic(1)%height": 2 * (ye - yb) / x0, + "acoustic(1)%loc(1)": -2.0e-03 / x0, + "acoustic(1)%loc(2)": 0.0, + "acoustic(1)%loc(3)": 0.0, + "acoustic(1)%dir": 0.0, + "acoustic(1)%delay": 0.0, + # Lagrangian Bubbles =========================== + "bubbles_lagrange": "T", + "bubble_model": 2, # Keller-Miksis model + "rkck_adap_dt": "T", # Activate adaptive time stepper + "rkck_tolerance": 1.0e-05, + "lag_params%nBubs_glb": 1, + "lag_params%solver_approach": 2, # Two-way coupled + "lag_params%cluster_type": 2, + "lag_params%pressure_corrector": "T", + "lag_params%smooth_type": 1, + "lag_params%heatTransfer_model": "T", + "lag_params%massTransfer_model": "F", + "lag_params%epsilonb": 1.0, + "lag_params%valmaxvoid": 0.9, + "lag_params%write_bubbles": "F", + "lag_params%write_bubbles_stats": "F", + "lag_params%c0": c0, + "lag_params%rho0": rho0, + "lag_params%T0": T0, + "lag_params%x0": x0, + "lag_params%diffcoefvap": diffVapor, + "lag_params%Thost": T_host, + # Fluids Physical Parameters =============================== + # Host medium + "fluid_pp(1)%gamma": 1.0 / (gamma_host - 1.0), + "fluid_pp(1)%pi_inf": gamma_host * (pi_inf_host / p0) / (gamma_host - 1.0), + "fluid_pp(1)%Re(1)": 1.0 / (mu_host / (rho0 * c0 * x0)), + "fluid_pp(1)%mul0": mu_host, + "fluid_pp(1)%ss": sigBubble, + "fluid_pp(1)%pv": pv, + "fluid_pp(1)%gamma_v": gamma_v, + "fluid_pp(1)%M_v": MW_v, + "fluid_pp(1)%k_v": k_v, + "fluid_pp(1)%cp_v": cp_v, + # Bubble gas state + "fluid_pp(2)%gamma": 1.0 / (gamma_g - 1.0), + "fluid_pp(2)%pi_inf": 0.0e00, + "fluid_pp(2)%Re(1)": 1.0 / (mu_gas / (rho0 * c0 * x0)), + "fluid_pp(2)%gamma_v": gamma_g, + "fluid_pp(2)%M_v": MW_g, + "fluid_pp(2)%k_v": k_g, + "fluid_pp(2)%cp_v": cp_g, + } + ) +) diff --git a/examples/3D_lungwave/arc_case.py b/examples/3D_lungwave/arc_case.py index 0efb7c9022..a51cca177c 100644 --- a/examples/3D_lungwave/arc_case.py +++ b/examples/3D_lungwave/arc_case.py @@ -1,70 +1,69 @@ #!/usr/bin/env python3 - import math import json pi = 3.141592653589 # material parameters -#material1 :: gas -#patterson 2018 +# material1 :: gas +# patterson 2018 -gammag = 1.4 #unitless -Bg =0 #pascals -rhog = 1.18 #kg/m^3 -c_g = 347.2 #m/s -G_g = 0 #pa +gammag = 1.4 # unitless +Bg = 0 # pascals +rhog = 1.18 # kg/m^3 +c_g = 347.2 # m/s +G_g = 0 # pa -#material2 :: water +# material2 :: water gammal = 5.5 -Bl = 492.E+06 +Bl = 492.0e06 rhol = 996.0 c_l = 1648.7 -G_l = 1E+06 +G_l = 1e06 -#primitive vartiables -patmos = 101325. #pa +# primitive vartiables +patmos = 101325.0 # pa -#problem specific variable -lambda_wave = 200.E-6 +# problem specific variable +lambda_wave = 200.0e-6 -#define pulse -P_amp = 10.E+6 -P_len = 45 #length of the impulse -theta = -math.pi/2 #direction of propagation +# define pulse +P_amp = 10.0e6 +P_len = 45 # length of the impulse +theta = -math.pi / 2 # direction of propagation -#non-dim +# non-dim -#define characteristic density, length, time, stress material #make it liquid +# define characteristic density, length, time, stress material #make it liquid rho_char = rhol length_char = lambda_wave -c_char = c_l #should be liquid -time_char = length_char/c_char -stress_char = rho_char*c_char*c_char/gammal - -#non-dim the properties -rhog_n = rhog/rho_char -c_g_n = c_g/c_char -rhol_n = rhol/rho_char -c_l_n = c_l/c_char -Bg_n = Bg/stress_char -Bl_n = Bl/stress_char -G_g_n = G_g/stress_char -G_l_n = G_l/stress_char -patmos_n = patmos/stress_char -P_amp_n = P_amp/stress_char - -#geometry -dlengx = 15. -dlengy = 1. -dlengz = 1. +c_char = c_l # should be liquid +time_char = length_char / c_char +stress_char = rho_char * c_char * c_char / gammal + +# non-dim the properties +rhog_n = rhog / rho_char +c_g_n = c_g / c_char +rhol_n = rhol / rho_char +c_l_n = c_l / c_char +Bg_n = Bg / stress_char +Bl_n = Bl / stress_char +G_g_n = G_g / stress_char +G_l_n = G_l / stress_char +patmos_n = patmos / stress_char +P_amp_n = P_amp / stress_char + +# geometry +dlengx = 15.0 +dlengy = 1.0 +dlengz = 1.0 Ny = 25 -Nx = dlengx*Ny -Nz = dlengz*Ny -dx = dlengx/Nx -dy = dlengy/Ny -dz = dlengz/Nz +Nx = dlengx * Ny +Nz = dlengz * Ny +dx = dlengx / Nx +dy = dlengy / Ny +dz = dlengz / Nz alphal_back = 1.0 alphag_back = 0.0 alphal_lung = 0.0 @@ -76,145 +75,129 @@ time_end = 50 cfl = 0.01 -dt = cfl * dx/c_l_n -Nt = int(time_end/dt) +dt = cfl * dx / c_l_n +Nt = int(time_end / dt) Nframes = 500 tstart = 0 tstop = Nt -tsave = int(Nt/Nframes) +tsave = int(Nt / Nframes) # Configuring case dictionary -print(json.dumps({ - # Logistics ================================================================ - 'run_time_info' : 'T', - #'sim_data' : 'T', - # ========================================================================== - - # Computational Domain Parameters ========================================== - 'x_domain%beg' : -dlengx/2., - 'x_domain%end' : dlengx/2., - 'y_domain%beg' : 0., - 'y_domain%end' : dlengy, - 'z_domain%beg' : 0., - 'z_domain%end' : dlengz, - 'm' : int(Nx), - 'n' : int(Ny), - 'p' : int(Nz), - 'stretch_x' : 'F', - 'a_x' : 4.0E+00, - 'x_a' : -5., - 'x_b' : 5., - 'loops_x' : 0, - 'dt' : dt, - 't_step_start' : tstart, - 't_step_stop' : tstop, - 't_step_save' : tsave, - # ========================================================================== - - # Simulation Algorithm Parameters ========================================== - 'num_patches' : 2, - 'model_eqns' : 3, - 'alt_soundspeed' : 'F', - 'num_fluids' : 2, - 'mpp_lim' : 'T', - 'mixture_err' : 'T', - 'time_stepper' : 3, - 'weno_order' : 5, - 'weno_eps' : 1.E-16, - 'weno_Re_flux' : 'F', - 'weno_avg' : 'F', - 'mapped_weno' : 'T', - 'null_weights' : 'F', - 'mp_weno' : 'T', - 'riemann_solver' : 2, - 'wave_speeds' : 1, - 'avg_state' : 2, - 'bc_x%beg' : -6, - 'bc_x%end' : -6, - 'bc_y%beg' : -1, - 'bc_y%end' : -1, - 'bc_z%beg' : -1, - 'bc_z%end' : -1, - # ========================================================================== - - # Turning on Hypoelasticity ================================================ - #'hypoelasticity' : 'T', - 'hyperelasticity' : 'F', - # ========================================================================== - - # Formatted Database Files Structure Parameters ============================ - 'format' : 1, - 'precision' : 2, - 'prim_vars_wrt' :'T', - 'parallel_io' :'T', - # ========================================================================== - - # acoustics setting ========================================================= - 'acoustic_source' : 'T', - 'num_source' : 1, - 'acoustic(1)%support' : 3, - 'acoustic(1)%loc(1)' : 4, - 'acoustic(1)%loc(2)' : dlengy/2, - #'acoustic(1)%loc(3)' : dlengz/2, - 'acoustic(1)%pulse' : 3, - 'acoustic(1)%npulse' : 1, - 'acoustic(1)%wavelength' : P_len, #wavelength of the signal - 'acoustic(1)%mag' : P_amp_n, - 'acoustic(1)%length' : dlengy, #length of the place ??? - 'acoustic(1)%height' : dlengz, - 'acoustic(1)%dir' : -math.pi, - #=========================================================================== - - # Patch 1: Background ====================================================== - 'patch_icpp(1)%geometry' : 9, - 'patch_icpp(1)%x_centroid' : 0., - 'patch_icpp(1)%y_centroid' : dlengy/2., - 'patch_icpp(1)%z_centroid' : dlengz/2., - 'patch_icpp(1)%length_x' : 2000, #dlengx, # - 'patch_icpp(1)%length_y' : dlengy, - 'patch_icpp(1)%length_z' : dlengz, - 'patch_icpp(1)%vel(1)' : 0.E+00, - 'patch_icpp(1)%vel(2)' : 0.E+00, - 'patch_icpp(1)%vel(3)' : 0.E+00, - 'patch_icpp(1)%pres' : patmos_n, - 'patch_icpp(1)%alpha_rho(1)' : rhol_n*alphal_back, - 'patch_icpp(1)%alpha_rho(2)' : rhog_n*alphag_back, - 'patch_icpp(1)%alpha(1)' : alphal_back, - 'patch_icpp(1)%alpha(2)' : alphag_back, - #'patch_icpp(1)%tau_e(1)' : 0.0, - - # ========================================================================== - - # Patch 2: Lung ============================================================ - 'patch_icpp(2)%geometry' : 13, - 'patch_icpp(2)%hcid' : 301, - #'patch_icpp(2)%geometry' : 9, - 'patch_icpp(2)%alter_patch(1)' : 'T', - 'patch_icpp(2)%x_centroid' : -998,#-dlengx/4., # - 'patch_icpp(2)%y_centroid' : dlengy/2., - 'patch_icpp(2)%z_centroid' : dlengz/2., - 'patch_icpp(2)%length_x' : 2000,#dlengx,#dlengx/2.+2, # - 'patch_icpp(2)%length_y' : dlengy, - 'patch_icpp(2)%length_z' : dlengz, - 'patch_icpp(2)%a(2)' : interface_amp, - 'patch_icpp(2)%vel(1)' : 0.E+00, - 'patch_icpp(2)%vel(2)' : 0.0, - 'patch_icpp(2)%vel(3)' : 0.0, - 'patch_icpp(2)%pres' : patmos_n, - 'patch_icpp(2)%alpha_rho(1)' : rhol_n*alphal_lung, - 'patch_icpp(2)%alpha_rho(2)' : rhog_n*alphag_lung, - 'patch_icpp(2)%alpha(1)' : alphal_lung, - 'patch_icpp(2)%alpha(2)' : alphag_lung, - # ========================================================================== - - # Fluids Physical Parameters =============================================== - 'fluid_pp(1)%gamma' : 1.E+00/(gammal-1.E+00), - 'fluid_pp(1)%pi_inf' : gammal*Bl_n/(gammal-1.E+00), - 'fluid_pp(1)%G' : G_l_n, - 'fluid_pp(2)%gamma' : 1.E+00/(gammag-1.E+00), - 'fluid_pp(2)%pi_inf' : gammag*Bg_n/(gammag-1.E+00), - 'fluid_pp(2)%G' : G_g_n, - #============================================================================== -})) - -# ============================================================================== +print( + json.dumps( + { + # Logistics ================================================================ + "run_time_info": "T", + #'sim_data' : 'T', + # Computational Domain Parameters ========================================== + "x_domain%beg": -dlengx / 2.0, + "x_domain%end": dlengx / 2.0, + "y_domain%beg": 0.0, + "y_domain%end": dlengy, + "z_domain%beg": 0.0, + "z_domain%end": dlengz, + "m": int(Nx), + "n": int(Ny), + "p": int(Nz), + "stretch_x": "F", + "a_x": 4.0e00, + "x_a": -5.0, + "x_b": 5.0, + "loops_x": 0, + "dt": dt, + "t_step_start": tstart, + "t_step_stop": tstop, + "t_step_save": tsave, + # Simulation Algorithm Parameters ========================================== + "num_patches": 2, + "model_eqns": 3, + "alt_soundspeed": "F", + "num_fluids": 2, + "mpp_lim": "T", + "mixture_err": "T", + "time_stepper": 3, + "weno_order": 5, + "weno_eps": 1.0e-16, + "weno_Re_flux": "F", + "weno_avg": "F", + "mapped_weno": "T", + "null_weights": "F", + "mp_weno": "T", + "riemann_solver": 2, + "wave_speeds": 1, + "avg_state": 2, + "bc_x%beg": -6, + "bc_x%end": -6, + "bc_y%beg": -1, + "bc_y%end": -1, + "bc_z%beg": -1, + "bc_z%end": -1, + # Turning on Hypoelasticity ================================================ + #'hypoelasticity' : 'T', + "hyperelasticity": "F", + # Formatted Database Files Structure Parameters ============================ + "format": 1, + "precision": 2, + "prim_vars_wrt": "T", + "parallel_io": "T", + # acoustics setting ========================================================= + "acoustic_source": "T", + "num_source": 1, + "acoustic(1)%support": 3, + "acoustic(1)%loc(1)": 4, + "acoustic(1)%loc(2)": dlengy / 2, + #'acoustic(1)%loc(3)' : dlengz/2, + "acoustic(1)%pulse": 3, + "acoustic(1)%npulse": 1, + "acoustic(1)%wavelength": P_len, # wavelength of the signal + "acoustic(1)%mag": P_amp_n, + "acoustic(1)%length": dlengy, # length of the place ??? + "acoustic(1)%height": dlengz, + "acoustic(1)%dir": -math.pi, + # Patch 1: Background ====================================================== + "patch_icpp(1)%geometry": 9, + "patch_icpp(1)%x_centroid": 0.0, + "patch_icpp(1)%y_centroid": dlengy / 2.0, + "patch_icpp(1)%z_centroid": dlengz / 2.0, + "patch_icpp(1)%length_x": 2000, # dlengx, # + "patch_icpp(1)%length_y": dlengy, + "patch_icpp(1)%length_z": dlengz, + "patch_icpp(1)%vel(1)": 0.0e00, + "patch_icpp(1)%vel(2)": 0.0e00, + "patch_icpp(1)%vel(3)": 0.0e00, + "patch_icpp(1)%pres": patmos_n, + "patch_icpp(1)%alpha_rho(1)": rhol_n * alphal_back, + "patch_icpp(1)%alpha_rho(2)": rhog_n * alphag_back, + "patch_icpp(1)%alpha(1)": alphal_back, + "patch_icpp(1)%alpha(2)": alphag_back, + #'patch_icpp(1)%tau_e(1)' : 0.0, + # Patch 2: Lung ============================================================ + "patch_icpp(2)%geometry": 13, + "patch_icpp(2)%hcid": 301, + #'patch_icpp(2)%geometry' : 9, + "patch_icpp(2)%alter_patch(1)": "T", + "patch_icpp(2)%x_centroid": -998, # -dlengx/4., # + "patch_icpp(2)%y_centroid": dlengy / 2.0, + "patch_icpp(2)%z_centroid": dlengz / 2.0, + "patch_icpp(2)%length_x": 2000, # dlengx,#dlengx/2.+2, # + "patch_icpp(2)%length_y": dlengy, + "patch_icpp(2)%length_z": dlengz, + "patch_icpp(2)%a(2)": interface_amp, + "patch_icpp(2)%vel(1)": 0.0e00, + "patch_icpp(2)%vel(2)": 0.0, + "patch_icpp(2)%vel(3)": 0.0, + "patch_icpp(2)%pres": patmos_n, + "patch_icpp(2)%alpha_rho(1)": rhol_n * alphal_lung, + "patch_icpp(2)%alpha_rho(2)": rhog_n * alphag_lung, + "patch_icpp(2)%alpha(1)": alphal_lung, + "patch_icpp(2)%alpha(2)": alphag_lung, + # Fluids Physical Parameters =============================================== + "fluid_pp(1)%gamma": 1.0e00 / (gammal - 1.0e00), + "fluid_pp(1)%pi_inf": gammal * Bl_n / (gammal - 1.0e00), + "fluid_pp(1)%G": G_l_n, + "fluid_pp(2)%gamma": 1.0e00 / (gammag - 1.0e00), + "fluid_pp(2)%pi_inf": gammag * Bg_n / (gammag - 1.0e00), + "fluid_pp(2)%G": G_g_n, + } + ) +) diff --git a/examples/3D_lungwave/case.py b/examples/3D_lungwave/case.py index 064dd4173b..87d107dea6 100644 --- a/examples/3D_lungwave/case.py +++ b/examples/3D_lungwave/case.py @@ -1,70 +1,69 @@ #!/usr/bin/env python3 - import math import json pi = 3.141592653589 # material parameters -#material1 :: gas -#patterson 2018 +# material1 :: gas +# patterson 2018 -gammag = 1.4 #unitless -Bg =0 #pascals -rhog = 1.18 #kg/m^3 -c_g = 347.2 #m/s -G_g = 0 #pa +gammag = 1.4 # unitless +Bg = 0 # pascals +rhog = 1.18 # kg/m^3 +c_g = 347.2 # m/s +G_g = 0 # pa -#material2 :: water +# material2 :: water gammal = 5.5 -Bl = 492.E+06 +Bl = 492.0e06 rhol = 996.0 c_l = 1648.7 -G_l = 1E+06 +G_l = 1e06 -#primitive vartiables -patmos = 101325. #pa +# primitive vartiables +patmos = 101325.0 # pa -#problem specific variable -lambda_wave = 200.E-6 +# problem specific variable +lambda_wave = 200.0e-6 -#define pulse -P_amp = 10.E+6 -P_len = 45 #length of the impulse -theta = -math.pi/2 #direction of propagation +# define pulse +P_amp = 10.0e6 +P_len = 45 # length of the impulse +theta = -math.pi / 2 # direction of propagation -#non-dim +# non-dim -#define characteristic density, length, time, stress material #make it liquid +# define characteristic density, length, time, stress material #make it liquid rho_char = rhol length_char = lambda_wave -c_char = c_l #should be liquid -time_char = length_char/c_char -stress_char = rho_char*c_char*c_char/gammal - -#non-dim the properties -rhog_n = rhog/rho_char -c_g_n = c_g/c_char -rhol_n = rhol/rho_char -c_l_n = c_l/c_char -Bg_n = Bg/stress_char -Bl_n = Bl/stress_char -G_g_n = G_g/stress_char -G_l_n = G_l/stress_char -patmos_n = patmos/stress_char -P_amp_n = P_amp/stress_char - -#geometry -dlengx = 15. -dlengy = 1. -dlengz = 1. +c_char = c_l # should be liquid +time_char = length_char / c_char +stress_char = rho_char * c_char * c_char / gammal + +# non-dim the properties +rhog_n = rhog / rho_char +c_g_n = c_g / c_char +rhol_n = rhol / rho_char +c_l_n = c_l / c_char +Bg_n = Bg / stress_char +Bl_n = Bl / stress_char +G_g_n = G_g / stress_char +G_l_n = G_l / stress_char +patmos_n = patmos / stress_char +P_amp_n = P_amp / stress_char + +# geometry +dlengx = 15.0 +dlengy = 1.0 +dlengz = 1.0 Ny = 25 -Nx = dlengx*Ny -Nz = dlengz*Ny -dx = dlengx/Nx -dy = dlengy/Ny -dz = dlengz/Nz +Nx = dlengx * Ny +Nz = dlengz * Ny +dx = dlengx / Nx +dy = dlengy / Ny +dz = dlengz / Nz alphal_back = 1.0 alphag_back = 0.0 alphal_lung = 0.0 @@ -76,144 +75,128 @@ time_end = 50 cfl = 0.01 -dt = cfl * dx/c_l_n -Nt = int(time_end/dt) +dt = cfl * dx / c_l_n +Nt = int(time_end / dt) Nframes = 500 tstart = 0 tstop = Nt -tsave = int(Nt/Nframes) +tsave = int(Nt / Nframes) # Configuring case dictionary -print(json.dumps({ - # Logistics ================================================================ - 'run_time_info' : 'T', - #'sim_data' : 'T', - # ========================================================================== - - # Computational Domain Parameters ========================================== - 'x_domain%beg' : -dlengx/2., - 'x_domain%end' : dlengx/2., - 'y_domain%beg' : 0., - 'y_domain%end' : dlengy, - 'z_domain%beg' : 0., - 'z_domain%end' : dlengz, - 'm' : int(Nx), - 'n' : int(Ny), - 'p' : int(Nz), - 'stretch_x' : 'F', - 'a_x' : 4.0E+00, - 'x_a' : -5., - 'x_b' : 5., - 'dt' : dt, - 't_step_start' : tstart, - 't_step_stop' : tstop, - 't_step_save' : tsave, - # ========================================================================== - - # Simulation Algorithm Parameters ========================================== - 'num_patches' : 2, - 'model_eqns' : 3, - 'alt_soundspeed' : 'F', - 'num_fluids' : 2, - 'mpp_lim' : 'T', - 'mixture_err' : 'T', - 'time_stepper' : 3, - 'weno_order' : 5, - 'weno_eps' : 1.E-16, - 'weno_Re_flux' : 'F', - 'weno_avg' : 'F', - 'mapped_weno' : 'T', - 'null_weights' : 'F', - 'mp_weno' : 'T', - 'riemann_solver' : 2, - 'wave_speeds' : 1, - 'avg_state' : 2, - 'bc_x%beg' : -6, - 'bc_x%end' : -6, - 'bc_y%beg' : -1, - 'bc_y%end' : -1, - 'bc_z%beg' : -1, - 'bc_z%end' : -1, - # ========================================================================== - - # Turning on Hypoelasticity ================================================ - #'hypoelasticity' : 'T', - 'hyperelasticity' : 'F', - # ========================================================================== - - # Formatted Database Files Structure Parameters ============================ - 'format' : 1, - 'precision' : 2, - 'prim_vars_wrt' :'T', - 'parallel_io' :'T', - # ========================================================================== - - # acoustics setting ========================================================= - 'acoustic_source' : 'T', - 'num_source' : 1, - 'acoustic(1)%support' : 3, - 'acoustic(1)%loc(1)' : 4, - 'acoustic(1)%loc(2)' : dlengy/2, - #'acoustic(1)%loc(3)' : dlengz/2, - 'acoustic(1)%pulse' : 3, - 'acoustic(1)%npulse' : 1, - 'acoustic(1)%wavelength' : P_len, #wavelength of the signal - 'acoustic(1)%mag' : P_amp_n, - 'acoustic(1)%length' : dlengy, #length of the place ??? - 'acoustic(1)%height' : dlengz, - 'acoustic(1)%dir' : -math.pi, - #=========================================================================== - - # Patch 1: Background ====================================================== - 'patch_icpp(1)%geometry' : 9, - 'patch_icpp(1)%x_centroid' : 0., - 'patch_icpp(1)%y_centroid' : dlengy/2., - 'patch_icpp(1)%z_centroid' : dlengz/2., - 'patch_icpp(1)%length_x' : 2000, #dlengx, # - 'patch_icpp(1)%length_y' : dlengy, - 'patch_icpp(1)%length_z' : dlengz, - 'patch_icpp(1)%vel(1)' : 0.E+00, - 'patch_icpp(1)%vel(2)' : 0.E+00, - 'patch_icpp(1)%vel(3)' : 0.E+00, - 'patch_icpp(1)%pres' : patmos_n, - 'patch_icpp(1)%alpha_rho(1)' : rhol_n*alphal_back, - 'patch_icpp(1)%alpha_rho(2)' : rhog_n*alphag_back, - 'patch_icpp(1)%alpha(1)' : alphal_back, - 'patch_icpp(1)%alpha(2)' : alphag_back, - #'patch_icpp(1)%tau_e(1)' : 0.0, - - # ========================================================================== - - # Patch 2: Lung ============================================================ - 'patch_icpp(2)%geometry' : 13, - 'patch_icpp(2)%hcid' : 301, - #'patch_icpp(2)%geometry' : 9, - 'patch_icpp(2)%alter_patch(1)' : 'T', - 'patch_icpp(2)%x_centroid' : -998,#-dlengx/4., # - 'patch_icpp(2)%y_centroid' : dlengy/2., - 'patch_icpp(2)%z_centroid' : dlengz/2., - 'patch_icpp(2)%length_x' : 2000,#dlengx,#dlengx/2.+2, # - 'patch_icpp(2)%length_y' : dlengy, - 'patch_icpp(2)%length_z' : dlengz, - 'patch_icpp(2)%a(2)' : interface_amp, - 'patch_icpp(2)%vel(1)' : 0.E+00, - 'patch_icpp(2)%vel(2)' : 0.0, - 'patch_icpp(2)%vel(3)' : 0.0, - 'patch_icpp(2)%pres' : patmos_n, - 'patch_icpp(2)%alpha_rho(1)' : rhol_n*alphal_lung, - 'patch_icpp(2)%alpha_rho(2)' : rhog_n*alphag_lung, - 'patch_icpp(2)%alpha(1)' : alphal_lung, - 'patch_icpp(2)%alpha(2)' : alphag_lung, - # ========================================================================== - - # Fluids Physical Parameters =============================================== - 'fluid_pp(1)%gamma' : 1.E+00/(gammal-1.E+00), - 'fluid_pp(1)%pi_inf' : gammal*Bl_n/(gammal-1.E+00), - 'fluid_pp(1)%G' : G_l_n, - 'fluid_pp(2)%gamma' : 1.E+00/(gammag-1.E+00), - 'fluid_pp(2)%pi_inf' : gammag*Bg_n/(gammag-1.E+00), - 'fluid_pp(2)%G' : G_g_n, - #============================================================================== -})) - -# ============================================================================== +print( + json.dumps( + { + # Logistics ================================================================ + "run_time_info": "T", + #'sim_data' : 'T', + # Computational Domain Parameters ========================================== + "x_domain%beg": -dlengx / 2.0, + "x_domain%end": dlengx / 2.0, + "y_domain%beg": 0.0, + "y_domain%end": dlengy, + "z_domain%beg": 0.0, + "z_domain%end": dlengz, + "m": int(Nx), + "n": int(Ny), + "p": int(Nz), + "stretch_x": "F", + "a_x": 4.0e00, + "x_a": -5.0, + "x_b": 5.0, + "dt": dt, + "t_step_start": tstart, + "t_step_stop": tstop, + "t_step_save": tsave, + # Simulation Algorithm Parameters ========================================== + "num_patches": 2, + "model_eqns": 3, + "alt_soundspeed": "F", + "num_fluids": 2, + "mpp_lim": "T", + "mixture_err": "T", + "time_stepper": 3, + "weno_order": 5, + "weno_eps": 1.0e-16, + "weno_Re_flux": "F", + "weno_avg": "F", + "mapped_weno": "T", + "null_weights": "F", + "mp_weno": "T", + "riemann_solver": 2, + "wave_speeds": 1, + "avg_state": 2, + "bc_x%beg": -6, + "bc_x%end": -6, + "bc_y%beg": -1, + "bc_y%end": -1, + "bc_z%beg": -1, + "bc_z%end": -1, + # Turning on Hypoelasticity ================================================ + #'hypoelasticity' : 'T', + "hyperelasticity": "F", + # Formatted Database Files Structure Parameters ============================ + "format": 1, + "precision": 2, + "prim_vars_wrt": "T", + "parallel_io": "T", + # acoustics setting ========================================================= + "acoustic_source": "T", + "num_source": 1, + "acoustic(1)%support": 3, + "acoustic(1)%loc(1)": 4, + "acoustic(1)%loc(2)": dlengy / 2, + #'acoustic(1)%loc(3)' : dlengz/2, + "acoustic(1)%pulse": 3, + "acoustic(1)%npulse": 1, + "acoustic(1)%wavelength": P_len, # wavelength of the signal + "acoustic(1)%mag": P_amp_n, + "acoustic(1)%length": dlengy, # length of the place ??? + "acoustic(1)%height": dlengz, + "acoustic(1)%dir": -math.pi, + # Patch 1: Background ====================================================== + "patch_icpp(1)%geometry": 9, + "patch_icpp(1)%x_centroid": 0.0, + "patch_icpp(1)%y_centroid": dlengy / 2.0, + "patch_icpp(1)%z_centroid": dlengz / 2.0, + "patch_icpp(1)%length_x": 2000, # dlengx, # + "patch_icpp(1)%length_y": dlengy, + "patch_icpp(1)%length_z": dlengz, + "patch_icpp(1)%vel(1)": 0.0e00, + "patch_icpp(1)%vel(2)": 0.0e00, + "patch_icpp(1)%vel(3)": 0.0e00, + "patch_icpp(1)%pres": patmos_n, + "patch_icpp(1)%alpha_rho(1)": rhol_n * alphal_back, + "patch_icpp(1)%alpha_rho(2)": rhog_n * alphag_back, + "patch_icpp(1)%alpha(1)": alphal_back, + "patch_icpp(1)%alpha(2)": alphag_back, + #'patch_icpp(1)%tau_e(1)' : 0.0, + # Patch 2: Lung ============================================================ + "patch_icpp(2)%geometry": 13, + "patch_icpp(2)%hcid": 301, + #'patch_icpp(2)%geometry' : 9, + "patch_icpp(2)%alter_patch(1)": "T", + "patch_icpp(2)%x_centroid": -998, # -dlengx/4., # + "patch_icpp(2)%y_centroid": dlengy / 2.0, + "patch_icpp(2)%z_centroid": dlengz / 2.0, + "patch_icpp(2)%length_x": 2000, # dlengx,#dlengx/2.+2, # + "patch_icpp(2)%length_y": dlengy, + "patch_icpp(2)%length_z": dlengz, + "patch_icpp(2)%a(2)": interface_amp, + "patch_icpp(2)%vel(1)": 0.0e00, + "patch_icpp(2)%vel(2)": 0.0, + "patch_icpp(2)%vel(3)": 0.0, + "patch_icpp(2)%pres": patmos_n, + "patch_icpp(2)%alpha_rho(1)": rhol_n * alphal_lung, + "patch_icpp(2)%alpha_rho(2)": rhog_n * alphag_lung, + "patch_icpp(2)%alpha(1)": alphal_lung, + "patch_icpp(2)%alpha(2)": alphag_lung, + # Fluids Physical Parameters =============================================== + "fluid_pp(1)%gamma": 1.0e00 / (gammal - 1.0e00), + "fluid_pp(1)%pi_inf": gammal * Bl_n / (gammal - 1.0e00), + "fluid_pp(1)%G": G_l_n, + "fluid_pp(2)%gamma": 1.0e00 / (gammag - 1.0e00), + "fluid_pp(2)%pi_inf": gammag * Bg_n / (gammag - 1.0e00), + "fluid_pp(2)%G": G_g_n, + } + ) +) diff --git a/examples/3D_performance_test/case.py b/examples/3D_performance_test/case.py index d1fc4c77a2..0156be6cf7 100644 --- a/examples/3D_performance_test/case.py +++ b/examples/3D_performance_test/case.py @@ -1,119 +1,107 @@ #!/usr/bin/env python3 - import json # Configuring case dictionary -print(json.dumps({ - # Logistics ================================================================ - 'run_time_info' : 'T', - # ========================================================================== - - # Computational Domain Parameters ========================================== - 'x_domain%beg' : 0.E+00, - 'x_domain%end' : 4.E-03/1.E-03, - 'y_domain%beg' : 0.E+00, - 'y_domain%end' : 4.E-03/1.E-03, - 'z_domain%beg' : 0.E+00, - 'z_domain%end' : 4.E-03/1.E-03, - 'stretch_x' : 'T', - 'a_x' : 4.E+00, - 'x_a' : -1.5E-03/1.E-03, - 'x_b' : 1.5E-03/1.E-03, - 'stretch_y' : 'T', - 'a_y' : 4.E+00, - 'y_a' : -1.5E-03/1.E-03, - 'y_b' : 1.5E-03/1.E-03, - 'stretch_z' : 'T', - 'a_z' : 4.E+00, - 'z_a' : -1.5E-03/1.E-03, - 'z_b' : 1.5E-03/1.E-03, - 'cyl_coord' : 'F', - 'm' : 200, - 'n' : 200, - 'p' : 200, - 'dt' : 0.2E-09/1.E-03, - 't_step_start' : 0, - 't_step_stop' : 30, - 't_step_save' : 30, - # ========================================================================== - - # Simulation Algorithm Parameters ========================================== - 'num_patches' : 2, - 'model_eqns' : 2, - 'alt_soundspeed' : 'F', - 'num_fluids' : 2, - 'mpp_lim' : 'T', - 'mixture_err' : 'T', - 'time_stepper' : 3, - 'weno_order' : 5, - 'weno_eps' : 1.E-16, - 'weno_Re_flux' : 'F', - 'weno_avg' : 'F', - 'avg_state' : 2, - 'mapped_weno' : 'T', - 'null_weights' : 'F', - 'mp_weno' : 'F', - 'riemann_solver' : 2, - 'wave_speeds' : 1, - 'bc_x%beg' : -2, - 'bc_x%end' : -6, - 'bc_y%beg' : -2, - 'bc_y%end' : -6, - 'bc_z%beg' : -2, - 'bc_z%end' : -6, - # ========================================================================== - - # Formatted Database Files Structure Parameters ============================ - 'format' : 1, - 'precision' : 2, - 'prim_vars_wrt' :'T', - 'parallel_io' :'T', - # ========================================================================== - - # Patch 1: High pressured water ============================================ - 'patch_icpp(1)%geometry' : 9, - 'patch_icpp(1)%x_centroid' : 80.E-03/1.E-03, - 'patch_icpp(1)%y_centroid' : 80.E-03/1.E-03, - 'patch_icpp(1)%z_centroid' : 80.E-03/1.E-03, - 'patch_icpp(1)%length_x' : 160.E-03/1.E-03, - 'patch_icpp(1)%length_y' : 160.E-03/1.E-03, - 'patch_icpp(1)%length_z' : 160.E-03/1.E-03, - 'patch_icpp(1)%vel(1)' : 0.E+00, - 'patch_icpp(1)%vel(2)' : 0.E+00, - 'patch_icpp(1)%vel(3)' : 0.E+00, - 'patch_icpp(1)%pres' : 1.E+05, - 'patch_icpp(1)%alpha_rho(1)' : 1000.E+00, - 'patch_icpp(1)%alpha_rho(2)' : 0.1E+00, - 'patch_icpp(1)%alpha(1)' : 0.9E+00, - 'patch_icpp(1)%alpha(2)' : 0.1E+00, - # ========================================================================== - - # Patch 3: Air bubble ====================================================== - 'patch_icpp(2)%geometry' : 8, - 'patch_icpp(2)%smoothen' : 'T', - 'patch_icpp(2)%smooth_patch_id' : 1, - 'patch_icpp(2)%smooth_coeff' : 0.5E+00, - 'patch_icpp(2)%x_centroid' : 0.E+00, - 'patch_icpp(2)%y_centroid' : 0.E+00, - 'patch_icpp(2)%z_centroid' : 0.E+00, - 'patch_icpp(2)%radius' : 1.E-03/1.E-03, - 'patch_icpp(2)%alter_patch(1)' : 'T', - 'patch_icpp(2)%vel(1)' : 0.E+00, - 'patch_icpp(2)%vel(2)' : 0.E+00, - 'patch_icpp(2)%vel(3)' : 0.E+00, - 'patch_icpp(2)%pres' : 1.E+03, - 'patch_icpp(2)%alpha_rho(1)' : 100.E+00, - 'patch_icpp(2)%alpha_rho(2)' : 0.9E+00, - 'patch_icpp(2)%alpha(1)' : 0.1E+00, - 'patch_icpp(2)%alpha(2)' : 0.9E+00, - # ========================================================================== - - # Fluids Physical Parameters =============================================== - 'fluid_pp(1)%gamma' : 1.E+00/(4.4E+00-1.E+00), - 'fluid_pp(1)%pi_inf' : 4.4E+00*6.E+08/(4.4E+00-1.E+00), - 'fluid_pp(2)%gamma' : 1.E+00/(1.4E+00-1.E+00), - 'fluid_pp(2)%pi_inf' : 0.E+00, - # ========================================================================== -})) - -# ============================================================================== +print( + json.dumps( + { + # Logistics ================================================================ + "run_time_info": "T", + # Computational Domain Parameters ========================================== + "x_domain%beg": 0.0e00, + "x_domain%end": 4.0e-03 / 1.0e-03, + "y_domain%beg": 0.0e00, + "y_domain%end": 4.0e-03 / 1.0e-03, + "z_domain%beg": 0.0e00, + "z_domain%end": 4.0e-03 / 1.0e-03, + "stretch_x": "T", + "a_x": 4.0e00, + "x_a": -1.5e-03 / 1.0e-03, + "x_b": 1.5e-03 / 1.0e-03, + "stretch_y": "T", + "a_y": 4.0e00, + "y_a": -1.5e-03 / 1.0e-03, + "y_b": 1.5e-03 / 1.0e-03, + "stretch_z": "T", + "a_z": 4.0e00, + "z_a": -1.5e-03 / 1.0e-03, + "z_b": 1.5e-03 / 1.0e-03, + "cyl_coord": "F", + "m": 200, + "n": 200, + "p": 200, + "dt": 0.2e-09 / 1.0e-03, + "t_step_start": 0, + "t_step_stop": 30, + "t_step_save": 30, + # Simulation Algorithm Parameters ========================================== + "num_patches": 2, + "model_eqns": 2, + "alt_soundspeed": "F", + "num_fluids": 2, + "mpp_lim": "T", + "mixture_err": "T", + "time_stepper": 3, + "weno_order": 5, + "weno_eps": 1.0e-16, + "weno_Re_flux": "F", + "weno_avg": "F", + "avg_state": 2, + "mapped_weno": "T", + "null_weights": "F", + "mp_weno": "F", + "riemann_solver": 2, + "wave_speeds": 1, + "bc_x%beg": -2, + "bc_x%end": -6, + "bc_y%beg": -2, + "bc_y%end": -6, + "bc_z%beg": -2, + "bc_z%end": -6, + # Formatted Database Files Structure Parameters ============================ + "format": 1, + "precision": 2, + "prim_vars_wrt": "T", + "parallel_io": "T", + # Patch 1: High pressured water ============================================ + "patch_icpp(1)%geometry": 9, + "patch_icpp(1)%x_centroid": 80.0e-03 / 1.0e-03, + "patch_icpp(1)%y_centroid": 80.0e-03 / 1.0e-03, + "patch_icpp(1)%z_centroid": 80.0e-03 / 1.0e-03, + "patch_icpp(1)%length_x": 160.0e-03 / 1.0e-03, + "patch_icpp(1)%length_y": 160.0e-03 / 1.0e-03, + "patch_icpp(1)%length_z": 160.0e-03 / 1.0e-03, + "patch_icpp(1)%vel(1)": 0.0e00, + "patch_icpp(1)%vel(2)": 0.0e00, + "patch_icpp(1)%vel(3)": 0.0e00, + "patch_icpp(1)%pres": 1.0e05, + "patch_icpp(1)%alpha_rho(1)": 1000.0e00, + "patch_icpp(1)%alpha_rho(2)": 0.1e00, + "patch_icpp(1)%alpha(1)": 0.9e00, + "patch_icpp(1)%alpha(2)": 0.1e00, + # Patch 3: Air bubble ====================================================== + "patch_icpp(2)%geometry": 8, + "patch_icpp(2)%smoothen": "T", + "patch_icpp(2)%smooth_patch_id": 1, + "patch_icpp(2)%smooth_coeff": 0.5e00, + "patch_icpp(2)%x_centroid": 0.0e00, + "patch_icpp(2)%y_centroid": 0.0e00, + "patch_icpp(2)%z_centroid": 0.0e00, + "patch_icpp(2)%radius": 1.0e-03 / 1.0e-03, + "patch_icpp(2)%alter_patch(1)": "T", + "patch_icpp(2)%vel(1)": 0.0e00, + "patch_icpp(2)%vel(2)": 0.0e00, + "patch_icpp(2)%vel(3)": 0.0e00, + "patch_icpp(2)%pres": 1.0e03, + "patch_icpp(2)%alpha_rho(1)": 100.0e00, + "patch_icpp(2)%alpha_rho(2)": 0.9e00, + "patch_icpp(2)%alpha(1)": 0.1e00, + "patch_icpp(2)%alpha(2)": 0.9e00, + # Fluids Physical Parameters =============================================== + "fluid_pp(1)%gamma": 1.0e00 / (4.4e00 - 1.0e00), + "fluid_pp(1)%pi_inf": 4.4e00 * 6.0e08 / (4.4e00 - 1.0e00), + "fluid_pp(2)%gamma": 1.0e00 / (1.4e00 - 1.0e00), + "fluid_pp(2)%pi_inf": 0.0e00, + } + ) +) diff --git a/examples/3D_phasechange_bubble/case.py b/examples/3D_phasechange_bubble/case.py index 9dcfcd99fb..cff5c23a22 100644 --- a/examples/3D_phasechange_bubble/case.py +++ b/examples/3D_phasechange_bubble/case.py @@ -3,23 +3,23 @@ ## 1 FOR BACKGROUND, 2 FOR BUBBLE # Pressure [Pa] -p01 = 5E6 +p01 = 5e6 p02 = 3550 # Temperature [K] T01 = 298.15 T02 = 298.15 -#T02 = 7.914 +# T02 = 7.914 #### FLUID PROPERTIES #### ### liquid water ### # pi infty -piwl = 1.0E+09 +piwl = 1.0e09 # qv qvwl = -1167000 # qv' -qvpwl = 0.0E0 +qvpwl = 0.0e0 # cv cvwl = 1816 # cp @@ -30,26 +30,26 @@ ## FOR PATCHES 1 & 2 ## # density -rho0wl1 = (p01 + piwl)/((gamwl-1)*cvwl*T01) -rho0wl2 = (p02 + piwl)/((gamwl-1)*cvwl*T02) +rho0wl1 = (p01 + piwl) / ((gamwl - 1) * cvwl * T01) +rho0wl2 = (p02 + piwl) / ((gamwl - 1) * cvwl * T02) # speed of sound FOR -c_wl1 = math.sqrt( gamwl * ( p01 + piwl ) / rho0wl1 ) -c_wl2 = math.sqrt( gamwl * ( p02 + piwl ) / rho0wl2 ) +c_wl1 = math.sqrt(gamwl * (p01 + piwl) / rho0wl1) +c_wl2 = math.sqrt(gamwl * (p02 + piwl) / rho0wl2) # part for Gases - relations from IMR -Ru = 8.3144598 # Universal gas constant (J/mol-K) +Ru = 8.3144598 # Universal gas constant (J/mol-K) ### Vapor water ### -Rv = Ru/(18.01528e-3) # Gas constant for vapor (Ru/molecular weight) (J/kg-K) +Rv = Ru / (18.01528e-3) # Gas constant for vapor (Ru/molecular weight) (J/kg-K) # gamma gamwv = 1.4 # cp -cpwv = Rv * gamwv/(gamwv-1) +cpwv = Rv * gamwv / (gamwv - 1) # cv -cvwv = cpwv/gamwv +cvwv = cpwv / gamwv # pi infinity -piwv = 0.0E0 +piwv = 0.0e0 # qv qvwv = 2030000 # qv' @@ -58,57 +58,57 @@ ## FOR PATCHES 1 & 2 ## # density -rho0wv1 = (p01 + piwv)/((gamwv-1)*cvwv*T01) -rho0wv2 = (p02 + piwv)/((gamwv-1)*cvwv*T02) +rho0wv1 = (p01 + piwv) / ((gamwv - 1) * cvwv * T01) +rho0wv2 = (p02 + piwv) / ((gamwv - 1) * cvwv * T02) # speed of sound -c_wv1 = math.sqrt( gamwv * ( p01 + piwv ) / rho0wv1 ) -c_wv2 = math.sqrt( gamwv * ( p02 + piwv ) / rho0wv2 ) +c_wv1 = math.sqrt(gamwv * (p01 + piwv) / rho0wv1) +c_wv2 = math.sqrt(gamwv * (p02 + piwv) / rho0wv2) ### Air ### -Ra = Ru/(28.966e-3) # Gas constant for air (Ru/molecular weight) (J/kg-K) +Ra = Ru / (28.966e-3) # Gas constant for air (Ru/molecular weight) (J/kg-K) # gamma gama = 1.4 # cp -cpa = Ra * gama/(gama-1) +cpa = Ra * gama / (gama - 1) # cv -cva = cpa/gama +cva = cpa / gama # pi infinity -pia = 0.0E0 +pia = 0.0e0 # qv -qva = 0.0E0 +qva = 0.0e0 # qv' -qvpa = 0.0E0 +qvpa = 0.0e0 ## FOR PATCHES 1 & 2 ## # density -rho0a1 = (p01 + pia)/((gama-1)*cva*T01) -rho0a2 = (p02 + pia)/((gama-1)*cva*T02) +rho0a1 = (p01 + pia) / ((gama - 1) * cva * T01) +rho0a2 = (p02 + pia) / ((gama - 1) * cva * T02) # Speed of sound -c_a1 = math.sqrt( gama * ( p01 + pia ) / rho0a1 ) -c_a2 = math.sqrt( gama * ( p02 + pia ) / rho0a2 ) +c_a1 = math.sqrt(gama * (p01 + pia) / rho0a1) +c_a2 = math.sqrt(gama * (p02 + pia) / rho0a2) ## SHOCK RELATIONS p02Op01 = p02 / p01 # Mach number of the shocked region - this should agree with Min, if everything is correct -Ms = math.sqrt( ( gama + 1. ) / ( 2. * gama ) * ( p02Op01 - 1. ) * ( p02 / ( p02 + pia ) ) + 1.0 ) +Ms = math.sqrt((gama + 1.0) / (2.0 * gama) * (p02Op01 - 1.0) * (p02 / (p02 + pia)) + 1.0) # shock speed ss = Ms * c_a1 ### volume fractions for each of the patches ### -C0 = 0.25 # vapor concentration for IMR +C0 = 0.25 # vapor concentration for IMR # water liquid -awl1 = 1.00E00-2.00E-12 -awl2 = 1.00E-12 +awl1 = 1.00e00 - 2.00e-12 +awl2 = 1.00e-12 # water vapor -awv1 = 1.00E-12 -awv2 = 1 / ( ( 1 - C0 ) / C0 * rho0wv2 / rho0a2 + 1 ) +awv1 = 1.00e-12 +awv2 = 1 / ((1 - C0) / C0 * rho0wv2 / rho0a2 + 1) # air aa1 = 1.0 - awl1 - awv1 aa2 = 1.0 - awl2 - awv2 @@ -119,7 +119,7 @@ cfl = 0.50 # Bubble Initial Radius -R0 = 30E-06 +R0 = 30e-06 # number of elements Nx0 = 400 @@ -129,18 +129,18 @@ # domain boundaries xb = 0.00 -xe = 120E-6 +xe = 120e-6 yb = 0.00 -ye = 120E-6 +ye = 120e-6 zb = 0.00 -ze = 120E-6 +ze = 120e-6 # typical cell size -dx = ( xe - xb ) / Nx -dy = ( ye - yb ) / Ny -dz = ( ze - zb ) / Nz +dx = (xe - xb) / Nx +dy = (ye - yb) / Ny +dz = (ze - zb) / Nz # time step @@ -148,7 +148,7 @@ SF = 200 # Critical time-step -tc = 0.915 * R0 * math.sqrt( rho0wl1 / p01 ) +tc = 0.915 * R0 * math.sqrt(rho0wl1 / p01) # making Nt divisible by SF # tendA = 1.5 * tc @@ -162,138 +162,135 @@ # Nt = total number of steps. Ensure Nt > NtA (so the total tendA is covered) # Nt = AS * SF -Nt = int(18E3 * tend // tc * Nx / Nx0 + 1) +Nt = int(18e3 * tend // tc * Nx / Nx0 + 1) dt = tend / Nt -AS = int( Nt//SF ) +AS = int(Nt // SF) # Total physical time # tend = Nt * dt # Configuring case dictionary ================================================== -print(json.dumps({ - # Logistics ================================================ - 'run_time_info': 'T', - # ========================================================== - # Computational Domain Parameters ========================== - 'x_domain%beg' : xb, - 'x_domain%end' : xe, - 'y_domain%beg' : yb, - 'y_domain%end' : ye, - 'z_domain%beg' : zb, - 'z_domain%end' : ze, - 'stretch_x' : 'T', - 'loops_x' : 3, - 'a_x' : 4.0E0, - 'x_a' : -2.0*R0, - 'x_b' : 2.0*R0, - 'stretch_y' : 'T', - 'loops_y' : 3, - 'a_y' : 4.0E0, - 'y_a' : -2.0*R0, - 'y_b' : 2.0*R0, - 'stretch_z' : 'T', - 'loops_z' : 3, - 'a_z' : 4.0E0, - 'z_a' : -2.0*R0, - 'z_b' : 2.0*R0, - 'cyl_coord' : 'F', - 'm' : Nx, - 'n' : Ny, - 'p' : Nz, - 'dt' : dt, - 't_step_start' : 0, - 't_step_stop' : Nt, - 't_step_save' : AS, - # ========================================================== - # Simulation Algorithm Parameters ========================== - 'num_patches' : 2, - 'model_eqns' : 3, - 'num_fluids' : 3, - 'mpp_lim' : 'T', - 'mixture_err' : 'T', - 'relax' : 'T', - 'relax_model' : 6, - 'palpha_eps' : 1.0E-6, - 'ptgalpha_eps' : 1.0E-2, - 'time_stepper' : 3, - 'weno_order' : 3, - 'weno_eps' : 1.0E-32, - 'weno_Re_flux' : 'F', - 'weno_avg' : 'F', - 'mapped_weno' : 'T', - 'null_weights' : 'F', - 'mp_weno' : 'F', - 'riemann_solver' : 2, - 'wave_speeds' : 1, - 'avg_state' : 2, - 'bc_x%beg' : -2, - 'bc_x%end' : -6, - 'bc_y%beg' : -2, - 'bc_y%end' : -6, - 'bc_z%beg' : -2, - 'bc_z%end' : -6, - # ========================================================== - # Formatted Database Files Structure Parameters ============ - 'format' : 1, - 'precision' : 2, - 'prim_vars_wrt':'T', - 'parallel_io' :'T', - # ========================================================== - # Patch 1: High pressured water ============================ - # Specify the cubic water background grid geometry - 'patch_icpp(1)%geometry' : 9, - 'patch_icpp(1)%x_centroid' : ( xe + xb ) * 500000 / 100, - 'patch_icpp(1)%y_centroid' : ( ye + yb ) * 500000 / 100, - 'patch_icpp(1)%z_centroid' : ( ze + zb ) * 500000 / 100, - 'patch_icpp(1)%length_x' : ( xe - xb ) * 1000000 / 100, - 'patch_icpp(1)%length_y' : ( ye - yb ) * 1000000 / 100, - 'patch_icpp(1)%length_z' : ( ze - zb ) * 1000000 / 100, - 'patch_icpp(1)%vel(1)' : 0.0E+00, - 'patch_icpp(1)%vel(2)' : 0.0E+00, - 'patch_icpp(1)%vel(3)' : 0.0E+00, - 'patch_icpp(1)%pres' : p01, - 'patch_icpp(1)%alpha_rho(1)' : awl1 * rho0wl1, - 'patch_icpp(1)%alpha_rho(2)' : awv1 * rho0wv1, - 'patch_icpp(1)%alpha_rho(3)' : aa1 * rho0a1, - 'patch_icpp(1)%alpha(1)' : awl1, - 'patch_icpp(1)%alpha(2)' : awv1, - 'patch_icpp(1)%alpha(3)' : aa1, - # ========================================================== - # Patch 2: (Vapor) Bubble ================================== - 'patch_icpp(2)%geometry' : 8, - 'patch_icpp(2)%x_centroid' : xb, - 'patch_icpp(2)%y_centroid' : yb, - 'patch_icpp(2)%z_centroid' : zb, - 'patch_icpp(2)%radius' : R0, - 'patch_icpp(2)%vel(1)' : 0.0E+00, - 'patch_icpp(2)%vel(2)' : 0.0E+00, - 'patch_icpp(2)%vel(3)' : 0.0E+00, - 'patch_icpp(2)%pres' : p02, - 'patch_icpp(2)%alpha_rho(1)' : awl2 * rho0wl2, - 'patch_icpp(2)%alpha_rho(2)' : awv2 * rho0wv2, - 'patch_icpp(2)%alpha_rho(3)' : aa2 * rho0a2, - 'patch_icpp(2)%alpha(1)' : awl2, - 'patch_icpp(2)%alpha(2)' : awv2, - 'patch_icpp(2)%alpha(3)' : aa2, - 'patch_icpp(2)%alter_patch(1)' : 'T', - # ========================================================== - # Fluids Physical Parameters =============================== - 'fluid_pp(1)%gamma' : 1.0E+00 / ( gamwl - 1 ), - 'fluid_pp(1)%pi_inf' : gamwl * piwl / ( gamwl - 1 ), - 'fluid_pp(1)%cv' : cvwl, - 'fluid_pp(1)%qv' : qvwl, - 'fluid_pp(1)%qvp' : qvpwl, - 'fluid_pp(2)%gamma' : 1.0E+00 / ( gamwv - 1 ), - 'fluid_pp(2)%pi_inf' : gamwv * piwv / ( gamwv - 1 ), - 'fluid_pp(2)%cv' : cvwv, - 'fluid_pp(2)%qv' : qvwv, - 'fluid_pp(2)%qvp' : qvpwv, - 'fluid_pp(3)%gamma' : 1.0E+00 / ( gama - 1 ), - 'fluid_pp(3)%pi_inf' : gama * pia / ( gama - 1 ), - 'fluid_pp(3)%cv' : cva, - 'fluid_pp(3)%qv' : qva, - 'fluid_pp(3)%qvp' : qvpa, - # ========================================================== -})) +print( + json.dumps( + { + # Logistics ================================================ + "run_time_info": "T", + # Computational Domain Parameters ========================== + "x_domain%beg": xb, + "x_domain%end": xe, + "y_domain%beg": yb, + "y_domain%end": ye, + "z_domain%beg": zb, + "z_domain%end": ze, + "stretch_x": "T", + "loops_x": 3, + "a_x": 4.0e0, + "x_a": -2.0 * R0, + "x_b": 2.0 * R0, + "stretch_y": "T", + "loops_y": 3, + "a_y": 4.0e0, + "y_a": -2.0 * R0, + "y_b": 2.0 * R0, + "stretch_z": "T", + "loops_z": 3, + "a_z": 4.0e0, + "z_a": -2.0 * R0, + "z_b": 2.0 * R0, + "cyl_coord": "F", + "m": Nx, + "n": Ny, + "p": Nz, + "dt": dt, + "t_step_start": 0, + "t_step_stop": Nt, + "t_step_save": AS, + # Simulation Algorithm Parameters ========================== + "num_patches": 2, + "model_eqns": 3, + "num_fluids": 3, + "mpp_lim": "T", + "mixture_err": "T", + "relax": "T", + "relax_model": 6, + "palpha_eps": 1.0e-6, + "ptgalpha_eps": 1.0e-2, + "time_stepper": 3, + "weno_order": 3, + "weno_eps": 1.0e-32, + "weno_Re_flux": "F", + "weno_avg": "F", + "mapped_weno": "T", + "null_weights": "F", + "mp_weno": "F", + "riemann_solver": 2, + "wave_speeds": 1, + "avg_state": 2, + "bc_x%beg": -2, + "bc_x%end": -6, + "bc_y%beg": -2, + "bc_y%end": -6, + "bc_z%beg": -2, + "bc_z%end": -6, + # Formatted Database Files Structure Parameters ============ + "format": 1, + "precision": 2, + "prim_vars_wrt": "T", + "parallel_io": "T", + # Patch 1: High pressured water ============================ + # Specify the cubic water background grid geometry + "patch_icpp(1)%geometry": 9, + "patch_icpp(1)%x_centroid": (xe + xb) * 500000 / 100, + "patch_icpp(1)%y_centroid": (ye + yb) * 500000 / 100, + "patch_icpp(1)%z_centroid": (ze + zb) * 500000 / 100, + "patch_icpp(1)%length_x": (xe - xb) * 1000000 / 100, + "patch_icpp(1)%length_y": (ye - yb) * 1000000 / 100, + "patch_icpp(1)%length_z": (ze - zb) * 1000000 / 100, + "patch_icpp(1)%vel(1)": 0.0e00, + "patch_icpp(1)%vel(2)": 0.0e00, + "patch_icpp(1)%vel(3)": 0.0e00, + "patch_icpp(1)%pres": p01, + "patch_icpp(1)%alpha_rho(1)": awl1 * rho0wl1, + "patch_icpp(1)%alpha_rho(2)": awv1 * rho0wv1, + "patch_icpp(1)%alpha_rho(3)": aa1 * rho0a1, + "patch_icpp(1)%alpha(1)": awl1, + "patch_icpp(1)%alpha(2)": awv1, + "patch_icpp(1)%alpha(3)": aa1, + # Patch 2: (Vapor) Bubble ================================== + "patch_icpp(2)%geometry": 8, + "patch_icpp(2)%x_centroid": xb, + "patch_icpp(2)%y_centroid": yb, + "patch_icpp(2)%z_centroid": zb, + "patch_icpp(2)%radius": R0, + "patch_icpp(2)%vel(1)": 0.0e00, + "patch_icpp(2)%vel(2)": 0.0e00, + "patch_icpp(2)%vel(3)": 0.0e00, + "patch_icpp(2)%pres": p02, + "patch_icpp(2)%alpha_rho(1)": awl2 * rho0wl2, + "patch_icpp(2)%alpha_rho(2)": awv2 * rho0wv2, + "patch_icpp(2)%alpha_rho(3)": aa2 * rho0a2, + "patch_icpp(2)%alpha(1)": awl2, + "patch_icpp(2)%alpha(2)": awv2, + "patch_icpp(2)%alpha(3)": aa2, + "patch_icpp(2)%alter_patch(1)": "T", + # Fluids Physical Parameters =============================== + "fluid_pp(1)%gamma": 1.0e00 / (gamwl - 1), + "fluid_pp(1)%pi_inf": gamwl * piwl / (gamwl - 1), + "fluid_pp(1)%cv": cvwl, + "fluid_pp(1)%qv": qvwl, + "fluid_pp(1)%qvp": qvpwl, + "fluid_pp(2)%gamma": 1.0e00 / (gamwv - 1), + "fluid_pp(2)%pi_inf": gamwv * piwv / (gamwv - 1), + "fluid_pp(2)%cv": cvwv, + "fluid_pp(2)%qv": qvwv, + "fluid_pp(2)%qvp": qvpwv, + "fluid_pp(3)%gamma": 1.0e00 / (gama - 1), + "fluid_pp(3)%pi_inf": gama * pia / (gama - 1), + "fluid_pp(3)%cv": cva, + "fluid_pp(3)%qv": qva, + "fluid_pp(3)%qvp": qvpa, + } + ) +) diff --git a/examples/3D_rayleigh_taylor/case.py b/examples/3D_rayleigh_taylor/case.py index 462eacc465..996f6e57bd 100644 --- a/examples/3D_rayleigh_taylor/case.py +++ b/examples/3D_rayleigh_taylor/case.py @@ -1,20 +1,19 @@ #!/usr/bin/env python3 - import math import json lam = 0.2 h = 1.2 -k = 2*math.pi/lam -amp = 0.05/k +k = 2 * math.pi / lam +amp = 0.05 / k # Numerical setup x0 = 0 -x1 = lam/2 -y0 = 0. +x1 = lam / 2 +y0 = 0.0 y1 = h z0 = 0 -z1 = lam/2 +z1 = lam / 2 Nx = 99 Ny = 1199 @@ -22,109 +21,93 @@ eps = 1e-6 -dx = lam/2/(Nx + 1) -c = math.sqrt(1.4*1e5/1) +dx = lam / 2 / (Nx + 1) +c = math.sqrt(1.4 * 1e5 / 1) cfl = 0.4 -dt = cfl*dx/c +dt = cfl * dx / c -Nt = math.ceil(0.2/dt) -Ns = math.ceil(Nt/100) +Nt = math.ceil(0.2 / dt) +Ns = math.ceil(Nt / 100) -#Configuration case dictionary +# Configuration case dictionary data = { # Logistics ============================= - 'run_time_info' : 'T', - # ======================================= - + "run_time_info": "T", # Computational Domain ================== - 'x_domain%beg' : x0, - 'x_domain%end' : x1, - 'y_domain%beg' : y0, - 'y_domain%end' : y1, - 'z_domain%beg' : z0, - 'z_domain%end' : z1, - 'm' : Nx, - 'n' : Ny, - 'p' : Nz, - 'cyl_coord' : 'F', - 'dt' : dt, - 't_step_start' : 0, - 't_step_stop' : Nt, - 't_step_save' : Ns, - # ======================================= - + "x_domain%beg": x0, + "x_domain%end": x1, + "y_domain%beg": y0, + "y_domain%end": y1, + "z_domain%beg": z0, + "z_domain%end": z1, + "m": Nx, + "n": Ny, + "p": Nz, + "cyl_coord": "F", + "dt": dt, + "t_step_start": 0, + "t_step_stop": Nt, + "t_step_save": Ns, # Simulation Algorithm ================== - 'model_eqns' : 2, - 'alt_soundspeed' : 'F', - 'mixture_err' : 'T', - 'mpp_lim' : 'T', - 'time_stepper' : 3, - 'avg_state' : 2, - 'weno_order' : 5, - 'weno_eps' : 1e-16, - 'mapped_weno' : 'T', - 'null_weights' : 'F', - 'mp_weno' : 'T', - 'weno_Re_flux' : 'T', - 'riemann_solver' : 2, - 'wave_speeds' : 1, - 'bc_x%beg' : -2, - 'bc_x%end' : -3, - 'bc_y%beg' : -16, - 'bc_y%end' : -16, - 'bc_z%beg' : -2, - 'bc_z%end' : -3, - 'num_patches' : 1, - 'num_fluids' : 2, - 'viscous' : 'T', - # ======================================= - + "model_eqns": 2, + "alt_soundspeed": "F", + "mixture_err": "T", + "mpp_lim": "T", + "time_stepper": 3, + "avg_state": 2, + "weno_order": 5, + "weno_eps": 1e-16, + "mapped_weno": "T", + "null_weights": "F", + "mp_weno": "T", + "weno_Re_flux": "T", + "riemann_solver": 2, + "wave_speeds": 1, + "bc_x%beg": -2, + "bc_x%end": -3, + "bc_y%beg": -16, + "bc_y%end": -16, + "bc_z%beg": -2, + "bc_z%end": -3, + "num_patches": 1, + "num_fluids": 2, + "viscous": "T", # Database Structure Parameters ========= - 'format' : 1, - 'precision' : 2, - 'prim_vars_wrt' : 'T', - 'parallel_io' : 'T', - # ======================================= - + "format": 1, + "precision": 2, + "prim_vars_wrt": "T", + "parallel_io": "T", # Fluid Parameters (Heavy Gas) ========== - 'fluid_pp(1)%gamma' : 1.E+00/(1.4E+00-1.E+00), - 'fluid_pp(1)%pi_inf' : 0.E+00, - 'fluid_pp(1)%Re(1)' : 1/0.0219, - # ======================================= - + "fluid_pp(1)%gamma": 1.0e00 / (1.4e00 - 1.0e00), + "fluid_pp(1)%pi_inf": 0.0e00, + "fluid_pp(1)%Re(1)": 1 / 0.0219, # Fluid Parameters (Light Gas) ========== - 'fluid_pp(2)%gamma' : 1.E+00/(1.4E+00-1.E+00), - 'fluid_pp(2)%pi_inf' : 0.E+00, - 'fluid_pp(2)%Re(1)' : 1/0.0073, - # ======================================= - + "fluid_pp(2)%gamma": 1.0e00 / (1.4e00 - 1.0e00), + "fluid_pp(2)%pi_inf": 0.0e00, + "fluid_pp(2)%Re(1)": 1 / 0.0073, # Body Forces =========================== - 'bf_y' : 'T', - 'k_y' : 0., - 'w_y' : 0., - 'p_y' : 0., - 'g_y' : -98.1, - # ====================================== - + "bf_y": "T", + "k_y": 0.0, + "w_y": 0.0, + "p_y": 0.0, + "g_y": -98.1, # Water Patch ========================== - 'patch_icpp(1)%geometry' : 13, - 'patch_icpp(1)%hcid' : 300, - 'patch_icpp(1)%x_centroid' : 0, - 'patch_icpp(1)%y_centroid' : h/2, - 'patch_icpp(1)%z_centroid' : 0, - 'patch_icpp(1)%length_x' : lam, - 'patch_icpp(1)%length_y' : h, - 'patch_icpp(1)%length_z' : h, - 'patch_icpp(1)%vel(1)' : 0.0, - 'patch_icpp(1)%vel(2)' : 0.0, - 'patch_icpp(1)%vel(3)' : 0.0, - 'patch_icpp(1)%pres' : 1e5, - 'patch_icpp(1)%alpha_rho(1)': (1-eps), - 'patch_icpp(1)%alpha_rho(2)': eps*1, - 'patch_icpp(1)%alpha(1)' : 1-eps, - 'patch_icpp(1)%alpha(2)' : eps, - # ====================================== - + "patch_icpp(1)%geometry": 13, + "patch_icpp(1)%hcid": 300, + "patch_icpp(1)%x_centroid": 0, + "patch_icpp(1)%y_centroid": h / 2, + "patch_icpp(1)%z_centroid": 0, + "patch_icpp(1)%length_x": lam, + "patch_icpp(1)%length_y": h, + "patch_icpp(1)%length_z": h, + "patch_icpp(1)%vel(1)": 0.0, + "patch_icpp(1)%vel(2)": 0.0, + "patch_icpp(1)%vel(3)": 0.0, + "patch_icpp(1)%pres": 1e5, + "patch_icpp(1)%alpha_rho(1)": (1 - eps), + "patch_icpp(1)%alpha_rho(2)": eps * 1, + "patch_icpp(1)%alpha(1)": 1 - eps, + "patch_icpp(1)%alpha(2)": eps, } print(json.dumps(data)) diff --git a/examples/3D_recovering_sphere/case.py b/examples/3D_recovering_sphere/case.py index 68a2cad18a..ad23891480 100644 --- a/examples/3D_recovering_sphere/case.py +++ b/examples/3D_recovering_sphere/case.py @@ -1,5 +1,4 @@ #!/usr/bin/env python3 - # This simulation shows the early stages of a cubic droplet recovering a spherical shape due to capillary # forces. While the relaxation is not complete, it demonstrates the expecteed symmetric behavior. @@ -26,118 +25,101 @@ mydt = 1e-6 -#Configuration case dictionary +# Configuration case dictionary data = { # Logistics ============================= - 'run_time_info' : 'T', - # ======================================= - + "run_time_info": "T", # Computational Domain ================== - 'x_domain%beg' : x0, - 'x_domain%end' : x1, - 'y_domain%beg' : y0, - 'y_domain%end' : y1, - 'z_domain%beg' : z0, - 'z_domain%end' : z1, - 'm' : Nx, - 'n' : Ny, - 'p' : Nz, - 'cyl_coord' : 'F', - 'dt' : mydt, - 't_step_start' : 400000, - 't_step_stop' : 1000000, - 't_step_save' : 2000, - #'t_step_stop' : 100, - #'t_step_save' : 100, - # ======================================= - + "x_domain%beg": x0, + "x_domain%end": x1, + "y_domain%beg": y0, + "y_domain%end": y1, + "z_domain%beg": z0, + "z_domain%end": z1, + "m": Nx, + "n": Ny, + "p": Nz, + "cyl_coord": "F", + "dt": mydt, + "t_step_start": 400000, + "t_step_stop": 1000000, + "t_step_save": 2000, + #'t_step_stop' : 100, + #'t_step_save' : 100, # Simulation Algorithm ================== - 'model_eqns' : 3, - 'alt_soundspeed' : 'F', - 'mixture_err' : 'T', - 'mpp_lim' : 'F', - 'time_stepper' : 3, - 'weno_order' : 3, - 'avg_state' : 2, - 'weno_eps' : 1e-16, - 'mapped_weno' : 'T', - 'null_weights' : 'F', - 'mp_weno' : 'F', - 'weno_Re_flux' : 'F', - 'riemann_solver' : 2, - 'wave_speeds' : 1, - 'bc_x%beg' : -2, - 'bc_x%end' : -3, - 'bc_y%beg' : -2, - 'bc_y%end' : -3, - 'bc_z%beg' : -2, - 'bc_z%end' : -3, - 'num_patches' : 2, - 'num_fluids' : 2, - 'weno_avg' : 'T', - 'surface_tension' : 'T', - # ======================================= - + "model_eqns": 3, + "alt_soundspeed": "F", + "mixture_err": "T", + "mpp_lim": "F", + "time_stepper": 3, + "weno_order": 3, + "avg_state": 2, + "weno_eps": 1e-16, + "mapped_weno": "T", + "null_weights": "F", + "mp_weno": "F", + "weno_Re_flux": "F", + "riemann_solver": 2, + "wave_speeds": 1, + "bc_x%beg": -2, + "bc_x%end": -3, + "bc_y%beg": -2, + "bc_y%end": -3, + "bc_z%beg": -2, + "bc_z%end": -3, + "num_patches": 2, + "num_fluids": 2, + "weno_avg": "T", + "surface_tension": "T", # Database Structure Parameters ========= - 'format' : 1, - 'precision' : 2, - 'alpha_wrt(1)' : 'T', - # 'prim_vars_wrt' : 'T', - 'cf_wrt' : 'T', - 'parallel_io' : 'T', - # ======================================= - - 'sigma' : 8.0, - + "format": 1, + "precision": 2, + "alpha_wrt(1)": "T", + # 'prim_vars_wrt' : 'T', + "cf_wrt": "T", + "parallel_io": "T", + "sigma": 8.0, # Fluid Parameters (Water) ============== - 'fluid_pp(1)%gamma' : 1.E+00/(2.1E+00-1.E+00), - 'fluid_pp(1)%pi_inf' : 2.1E+00*1.E+06/(2.1E+00-1.E+00), - # ======================================= - + "fluid_pp(1)%gamma": 1.0e00 / (2.1e00 - 1.0e00), + "fluid_pp(1)%pi_inf": 2.1e00 * 1.0e06 / (2.1e00 - 1.0e00), # Fluid Parameters (Gas) ================ - 'fluid_pp(2)%gamma' : 1.E+00/(1.4E+00-1.E+00), - 'fluid_pp(2)%pi_inf' : 0.E+00, - # ======================================= - + "fluid_pp(2)%gamma": 1.0e00 / (1.4e00 - 1.0e00), + "fluid_pp(2)%pi_inf": 0.0e00, # Air Patch ========================== - 'patch_icpp(1)%geometry' : 9, - 'patch_icpp(1)%x_centroid' : 0, - 'patch_icpp(1)%y_centroid' : 0, - 'patch_icpp(1)%z_centroid' : 0, - 'patch_icpp(1)%length_x' : 2, - 'patch_icpp(1)%length_y' : 2, - 'patch_icpp(1)%length_z' : 2, - 'patch_icpp(1)%vel(1)' : 0.0, - 'patch_icpp(1)%vel(2)' : 0.0, - 'patch_icpp(1)%vel(3)' : 0.0, - 'patch_icpp(1)%pres' : 100000, - 'patch_icpp(1)%alpha_rho(1)': eps*1000, - 'patch_icpp(1)%alpha_rho(2)': (1-eps)*1, - 'patch_icpp(1)%alpha(1)' : eps, - 'patch_icpp(1)%alpha(2)' : 1-eps, - 'patch_icpp(1)%cf_val' : 0, - # ====================================== - + "patch_icpp(1)%geometry": 9, + "patch_icpp(1)%x_centroid": 0, + "patch_icpp(1)%y_centroid": 0, + "patch_icpp(1)%z_centroid": 0, + "patch_icpp(1)%length_x": 2, + "patch_icpp(1)%length_y": 2, + "patch_icpp(1)%length_z": 2, + "patch_icpp(1)%vel(1)": 0.0, + "patch_icpp(1)%vel(2)": 0.0, + "patch_icpp(1)%vel(3)": 0.0, + "patch_icpp(1)%pres": 100000, + "patch_icpp(1)%alpha_rho(1)": eps * 1000, + "patch_icpp(1)%alpha_rho(2)": (1 - eps) * 1, + "patch_icpp(1)%alpha(1)": eps, + "patch_icpp(1)%alpha(2)": 1 - eps, + "patch_icpp(1)%cf_val": 0, # Water Patch ======================== - 'patch_icpp(2)%alter_patch(1)' : 'T', - 'patch_icpp(2)%geometry' : 9, - 'patch_icpp(2)%x_centroid' : 0, - 'patch_icpp(2)%y_centroid' : 0, - 'patch_icpp(2)%z_centroid' : 0, - 'patch_icpp(2)%length_x' : r0, - 'patch_icpp(2)%length_y' : r0, - 'patch_icpp(2)%length_z' : r0, - 'patch_icpp(2)%vel(1)' : 0., - 'patch_icpp(2)%vel(2)' : 0., - 'patch_icpp(2)%vel(3)' : 0., - 'patch_icpp(2)%pres' : 100000, - 'patch_icpp(2)%alpha_rho(1)': (1-eps)*1000, - 'patch_icpp(2)%alpha_rho(2)': eps*1, - 'patch_icpp(2)%alpha(1)' : (1-eps), - 'patch_icpp(2)%alpha(2)' : eps, - 'patch_icpp(2)%cf_val' : 1, - # ====================================== - + "patch_icpp(2)%alter_patch(1)": "T", + "patch_icpp(2)%geometry": 9, + "patch_icpp(2)%x_centroid": 0, + "patch_icpp(2)%y_centroid": 0, + "patch_icpp(2)%z_centroid": 0, + "patch_icpp(2)%length_x": r0, + "patch_icpp(2)%length_y": r0, + "patch_icpp(2)%length_z": r0, + "patch_icpp(2)%vel(1)": 0.0, + "patch_icpp(2)%vel(2)": 0.0, + "patch_icpp(2)%vel(3)": 0.0, + "patch_icpp(2)%pres": 100000, + "patch_icpp(2)%alpha_rho(1)": (1 - eps) * 1000, + "patch_icpp(2)%alpha_rho(2)": eps * 1, + "patch_icpp(2)%alpha(1)": (1 - eps), + "patch_icpp(2)%alpha(2)": eps, + "patch_icpp(2)%cf_val": 1, } print(json.dumps(data)) diff --git a/examples/3D_shockdroplet/case.py b/examples/3D_shockdroplet/case.py index aff84588bd..77f4f7cd2e 100644 --- a/examples/3D_shockdroplet/case.py +++ b/examples/3D_shockdroplet/case.py @@ -1,5 +1,4 @@ #!/usr/bin/env python3 - import math import json @@ -7,17 +6,17 @@ patm = 101325 # Initial Droplet Diameter / Reference length - m -D0 = 1.0E-3 +D0 = 1.0e-3 # cavity to droplet ratio CtD = 0.06 # cavity relative eccentricity (distance between radii) -ecc = 0.564 +ecc = 0.564 -# initial shock distance from the y axis. Note that the droplet center is located at y = 0. Thus, the distance from the shock to +# initial shock distance from the y axis. Note that the droplet center is located at y = 0. Thus, the distance from the shock to # the droplet is about D0/8 -ISD = 5.0/8 * D0 +ISD = 5.0 / 8 * D0 ## pre-shock properties - AIR @@ -25,21 +24,21 @@ p0a = patm # density - kg/m3 -rho0a = 1.204 +rho0a = 1.204 # gamma -gama = 1.40 +gama = 1.40 # pi infinity - Pa pia = 0 # speed of sound - M/s -c_a = math.sqrt( gama * ( p0a + pia ) / rho0a ) +c_a = math.sqrt(gama * (p0a + pia) / rho0a) ## Droplet - WATER # surface tension - N / m -st = 0.00E+0 +st = 0.00e0 # Delta Pressure - Pa DP = -st * 4 / D0 @@ -51,29 +50,29 @@ rho0w = 1000 # gama -gamw = 6.12 +gamw = 6.12 # pi infty - Pa -piw = 3.43E+08 +piw = 3.43e08 # speed of sound - m/s -c_w = math.sqrt( gamw * ( p0w + piw ) / rho0w ) +c_w = math.sqrt(gamw * (p0w + piw) / rho0w) -# Shock Mach number of interest. Note that the post-shock properties can be defined in terms of either +# Shock Mach number of interest. Note that the post-shock properties can be defined in terms of either # Min or psOp0a. Just comment/uncomment appropriatelly Min = 2.4 ## Pos to pre shock ratios - AIR # pressure -psOp0a = ( Min ** 2 -1 ) * 2 * gama / ( gama + 1 ) + 1 +psOp0a = (Min**2 - 1) * 2 * gama / (gama + 1) + 1 # psOp0a = 4.5 # density -rhosOrho0a = ( 1 + ( gama + 1 ) / ( gama - 1) * psOp0a ) / ( ( gama + 1 ) / ( gama - 1) + psOp0a ) +rhosOrho0a = (1 + (gama + 1) / (gama - 1) * psOp0a) / ((gama + 1) / (gama - 1) + psOp0a) # Mach number of the shocked region - just a checker, as it must return "Min" -Ms = math.sqrt( ( gama + 1. ) / ( 2. * gama ) * ( psOp0a - 1. ) * ( p0a / ( p0a + pia ) ) + 1. ) +Ms = math.sqrt((gama + 1.0) / (2.0 * gama) * (psOp0a - 1.0) * (p0a / (p0a + pia)) + 1.0) # shock speed of sound - m/s ss = Ms * c_a @@ -87,30 +86,30 @@ rhos = rhosOrho0a * rho0a # post shock speed of sound - m/s -c_s = math.sqrt( gama * (ps + pia) / rhos ) +c_s = math.sqrt(gama * (ps + pia) / rhos) # velocity at the post shock - m/s -vel = c_a/gama * (psOp0a - 1.) * p0a / ( p0a + pia ) / Ms +vel = c_a / gama * (psOp0a - 1.0) * p0a / (p0a + pia) / Ms ## Domain boundaries - m # x direction xb = -8.4707 * D0 -xe = 9.6226 * D0 +xe = 9.6226 * D0 -#xb = -10 * D0 -#xe = 10 * D0 +# xb = -10 * D0 +# xe = 10 * D0 # y direction -yb = 0 * D0 -ye = 10 * D0 +yb = 0 * D0 +ye = 10 * D0 # y direction -zb = 0 * D0 -ze = 10 * D0 +zb = 0 * D0 +ze = 10 * D0 # Stretching factor, to make sure the domaing is sufficiently large after the mesh stretch -StF = 4.0 +StF = 4.0 # number of elements into y direction Ny = 100 @@ -122,7 +121,7 @@ Nx = Ny * 2 # grid delta x if mesh were uniform in x direction - m. Note that I do not need a measure for dy -dx = ( xe - xb ) / Nx +dx = (xe - xb) / Nx # I calculating tend twice; first is an estimate, second is # the actual value used. This is because I am getting errors in the @@ -141,17 +140,17 @@ cfl = 0.05 # time-step - s -dt = cfl * dx/ ss +dt = cfl * dx / ss # Save Frequency. Note that the number of autosaves will be SF + 1, as th IC (0.dat) is also saved SF = 400 ## making Nt divisible by SF # 1 - ensure NtA goes slightly beyond tendA -NtA = int( tendA//dt + 1 ) +NtA = int(tendA // dt + 1) # Array of saves. It is the same as Nt/Sf = t_step_save -AS = int( NtA // SF + 1 ) +AS = int(NtA // SF + 1) # Nt = total number of steps. Note that Nt >= NtA (so at least tendA is completely simulated) Nt = AS * SF @@ -160,132 +159,119 @@ tend = Nt * dt # Configuring case dictionary -print(json.dumps({ - # Logistics ================================================ - 'run_time_info' : 'T', - # ========================================================== - - # Computational Domain Parameters ========================== - 'x_domain%beg' : xb, - 'x_domain%end' : xe, - 'y_domain%beg' : yb, - 'y_domain%end' : ye, - 'z_domain%beg' : zb, - 'z_domain%end' : ze, - 'stretch_x' : 'T', - 'a_x' : 20, - 'x_a' : -1.2 * D0, - 'x_b' : 1.2 * D0, - 'stretch_y' : 'T', - 'a_y' : 20, - 'y_a' : -0.0 * D0, - 'y_b' : 1.2 * D0, - 'stretch_z' : 'T', - 'a_z' : 20, - 'z_a' : -0.0 * D0, - 'z_b' : 1.2 * D0, - 'm' : Nx, - 'n' : Ny, - 'p' : Nz, - 'cyl_coord' : 'F', - 'dt' : dt, - 't_step_start' : 0, - 't_step_stop' : 50000, - 't_step_save' : 100, - # ========================================================== - - # Simulation Algorithm Parameters ========================== - 'num_patches' : 3, - 'model_eqns' : 2, - 'alt_soundspeed' : 'F', - 'num_fluids' : 2, - 'mpp_lim' : 'T', - 'mixture_err' : 'T', - 'time_stepper' : 3, - 'weno_order' : 3, - 'weno_eps' : 1.0E-16, - 'weno_Re_flux' : 'F', - 'weno_avg' : 'F', - 'mapped_weno' : 'T', - 'riemann_solver' : 2, - 'wave_speeds' : 1, - 'avg_state' : 2, - 'bc_x%beg' : -6, - 'bc_x%end' : -6, - 'bc_y%beg' : -2, - 'bc_y%end' : -3, - 'bc_z%beg' : -2, - 'bc_z%end' : -3, - # ========================================================== - - # Formatted Database Files Structure Parameters ============ - 'format' : 1, - 'precision' : 2, - 'prim_vars_wrt' :'T', - 'parallel_io' :'T', - # ========================================================== - # I will use 1 for WATER properties, and 2 for AIR properties - # Patch 1: Background (AIR - 2) ============================= - 'patch_icpp(1)%geometry' : 9, - 'patch_icpp(1)%x_centroid' : (xb+xe) / 2 * StF, - 'patch_icpp(1)%y_centroid' : (yb+ye) / 2 * StF, - 'patch_icpp(1)%z_centroid' : (yb+ye) / 2 * StF, - 'patch_icpp(1)%length_x' : (xe-xb) * StF, - 'patch_icpp(1)%length_y' : (ye-yb) * StF, - 'patch_icpp(1)%length_z' : (ze-zb) * StF, - 'patch_icpp(1)%vel(1)' : 0.0E+00, - 'patch_icpp(1)%vel(2)' : 0.0E+00, - 'patch_icpp(1)%vel(3)' : 0.0E+00, - 'patch_icpp(1)%pres' : p0a, - 'patch_icpp(1)%alpha_rho(1)' : 0.0E+00, - 'patch_icpp(1)%alpha_rho(2)' : rho0a, - 'patch_icpp(1)%alpha(1)' : 0.0E+00, - 'patch_icpp(1)%alpha(2)' : 1.0E+00, - # ========================================================== - - # Patch 2: Shocked state (AIR - 2) ========================= - 'patch_icpp(2)%geometry' : 9, - 'patch_icpp(2)%alter_patch(1)' : 'T', - 'patch_icpp(2)%x_centroid' : -ISD - ( xe - xb ) / 2 * StF, - 'patch_icpp(2)%y_centroid' : ( yb + ye ) / 2 * StF, - 'patch_icpp(2)%z_centroid' : ( zb + ze ) / 2 * StF, - 'patch_icpp(2)%length_x' : ( xe - xb ) * StF, - 'patch_icpp(2)%length_y' : ( ye - yb ) * StF, - 'patch_icpp(2)%length_z' : ( ze - zb ) * StF, - 'patch_icpp(2)%vel(1)' : vel, - 'patch_icpp(2)%vel(2)' : 0.0E+00, - 'patch_icpp(2)%vel(3)' : 0.0E+00, - 'patch_icpp(2)%pres' : ps, - 'patch_icpp(2)%alpha_rho(1)' : 0.0E+00, - 'patch_icpp(2)%alpha_rho(2)' : rhos, - 'patch_icpp(2)%alpha(1)' : 0.0E+00, - 'patch_icpp(2)%alpha(2)' : 1.0E+00, - # ========================================================== - - # Patch 3: Droplet (WATER - 1) ============================= - 'patch_icpp(3)%geometry' : 8, - 'patch_icpp(3)%x_centroid' : 0.0E+00, - 'patch_icpp(3)%y_centroid' : 0.0E+00, - 'patch_icpp(3)%z_centroid' : 0.0E+00, - 'patch_icpp(3)%radius' : D0/2, - 'patch_icpp(3)%alter_patch(1)' : 'T', - 'patch_icpp(3)%vel(1)' : 0.0E+00, - 'patch_icpp(3)%vel(2)' : 0.0E+00, - 'patch_icpp(3)%vel(3)' : 0.0E+00, - 'patch_icpp(3)%pres' : p0w, - 'patch_icpp(3)%alpha_rho(1)' : rho0w, - 'patch_icpp(3)%alpha_rho(2)' : 0.0E+00, - 'patch_icpp(3)%alpha(1)' : 1.0E+00, - 'patch_icpp(3)%alpha(2)' : 0.0E+00, - # ========================================================== - - - # Fluids Physical Parameters =============================== - 'fluid_pp(1)%gamma' : 1.0E+00/(gamw-1), - 'fluid_pp(1)%pi_inf' : gamw*piw/(gamw-1), - 'fluid_pp(2)%gamma' : 1.0E+00/(gama-1), - 'fluid_pp(2)%pi_inf' : gama*pia/(gama-1), - # ========================================================== -})) - -# ============================================================================== +print( + json.dumps( + { + # Logistics ================================================ + "run_time_info": "T", + # Computational Domain Parameters ========================== + "x_domain%beg": xb, + "x_domain%end": xe, + "y_domain%beg": yb, + "y_domain%end": ye, + "z_domain%beg": zb, + "z_domain%end": ze, + "stretch_x": "T", + "a_x": 20, + "x_a": -1.2 * D0, + "x_b": 1.2 * D0, + "stretch_y": "T", + "a_y": 20, + "y_a": -0.0 * D0, + "y_b": 1.2 * D0, + "stretch_z": "T", + "a_z": 20, + "z_a": -0.0 * D0, + "z_b": 1.2 * D0, + "m": Nx, + "n": Ny, + "p": Nz, + "cyl_coord": "F", + "dt": dt, + "t_step_start": 0, + "t_step_stop": 50000, + "t_step_save": 100, + # Simulation Algorithm Parameters ========================== + "num_patches": 3, + "model_eqns": 2, + "alt_soundspeed": "F", + "num_fluids": 2, + "mpp_lim": "T", + "mixture_err": "T", + "time_stepper": 3, + "weno_order": 3, + "weno_eps": 1.0e-16, + "weno_Re_flux": "F", + "weno_avg": "F", + "mapped_weno": "T", + "riemann_solver": 2, + "wave_speeds": 1, + "avg_state": 2, + "bc_x%beg": -6, + "bc_x%end": -6, + "bc_y%beg": -2, + "bc_y%end": -3, + "bc_z%beg": -2, + "bc_z%end": -3, + # Formatted Database Files Structure Parameters ============ + "format": 1, + "precision": 2, + "prim_vars_wrt": "T", + "parallel_io": "T", + # I will use 1 for WATER properties, and 2 for AIR properties + # Patch 1: Background (AIR - 2) ============================= + "patch_icpp(1)%geometry": 9, + "patch_icpp(1)%x_centroid": (xb + xe) / 2 * StF, + "patch_icpp(1)%y_centroid": (yb + ye) / 2 * StF, + "patch_icpp(1)%z_centroid": (yb + ye) / 2 * StF, + "patch_icpp(1)%length_x": (xe - xb) * StF, + "patch_icpp(1)%length_y": (ye - yb) * StF, + "patch_icpp(1)%length_z": (ze - zb) * StF, + "patch_icpp(1)%vel(1)": 0.0e00, + "patch_icpp(1)%vel(2)": 0.0e00, + "patch_icpp(1)%vel(3)": 0.0e00, + "patch_icpp(1)%pres": p0a, + "patch_icpp(1)%alpha_rho(1)": 0.0e00, + "patch_icpp(1)%alpha_rho(2)": rho0a, + "patch_icpp(1)%alpha(1)": 0.0e00, + "patch_icpp(1)%alpha(2)": 1.0e00, + # Patch 2: Shocked state (AIR - 2) ========================= + "patch_icpp(2)%geometry": 9, + "patch_icpp(2)%alter_patch(1)": "T", + "patch_icpp(2)%x_centroid": -ISD - (xe - xb) / 2 * StF, + "patch_icpp(2)%y_centroid": (yb + ye) / 2 * StF, + "patch_icpp(2)%z_centroid": (zb + ze) / 2 * StF, + "patch_icpp(2)%length_x": (xe - xb) * StF, + "patch_icpp(2)%length_y": (ye - yb) * StF, + "patch_icpp(2)%length_z": (ze - zb) * StF, + "patch_icpp(2)%vel(1)": vel, + "patch_icpp(2)%vel(2)": 0.0e00, + "patch_icpp(2)%vel(3)": 0.0e00, + "patch_icpp(2)%pres": ps, + "patch_icpp(2)%alpha_rho(1)": 0.0e00, + "patch_icpp(2)%alpha_rho(2)": rhos, + "patch_icpp(2)%alpha(1)": 0.0e00, + "patch_icpp(2)%alpha(2)": 1.0e00, + # Patch 3: Droplet (WATER - 1) ============================= + "patch_icpp(3)%geometry": 8, + "patch_icpp(3)%x_centroid": 0.0e00, + "patch_icpp(3)%y_centroid": 0.0e00, + "patch_icpp(3)%z_centroid": 0.0e00, + "patch_icpp(3)%radius": D0 / 2, + "patch_icpp(3)%alter_patch(1)": "T", + "patch_icpp(3)%vel(1)": 0.0e00, + "patch_icpp(3)%vel(2)": 0.0e00, + "patch_icpp(3)%vel(3)": 0.0e00, + "patch_icpp(3)%pres": p0w, + "patch_icpp(3)%alpha_rho(1)": rho0w, + "patch_icpp(3)%alpha_rho(2)": 0.0e00, + "patch_icpp(3)%alpha(1)": 1.0e00, + "patch_icpp(3)%alpha(2)": 0.0e00, + # Fluids Physical Parameters =============================== + "fluid_pp(1)%gamma": 1.0e00 / (gamw - 1), + "fluid_pp(1)%pi_inf": gamw * piw / (gamw - 1), + "fluid_pp(2)%gamma": 1.0e00 / (gama - 1), + "fluid_pp(2)%pi_inf": gama * pia / (gama - 1), + } + ) +) diff --git a/examples/3D_sphbubcollapse/case.py b/examples/3D_sphbubcollapse/case.py index 76ece2bf14..a1b6eb9295 100644 --- a/examples/3D_sphbubcollapse/case.py +++ b/examples/3D_sphbubcollapse/case.py @@ -1,145 +1,133 @@ #!/usr/bin/env python3 - import json # Configuring case dictionary -print(json.dumps({ - # Logistics ================================================================ - 'run_time_info' : 'T', - # ========================================================================== - - # Computational Domain Parameters ========================================== - # For these computations, the bubble is placed at the (0,0,0) - # domain origin. Only one octant of a full spherical bubble is - # used, with reflecting BC's at octant boundaries acting - # as the other bubble regions. - 'x_domain%beg' : 0.E+00, - 'x_domain%end' : 4.E-03/1.E-03, - 'y_domain%beg' : 0.E+00, - 'y_domain%end' : 4.E-03/1.E-03, - 'z_domain%beg' : 0.E+00, - 'z_domain%end' : 4.E-03/1.E-03, - # Grid stretching is used in the all coordinate directions - # to minimize computational costs. The grid is coarsened - # away from the bubble / origin - 'stretch_x' : 'T', - 'a_x' : 4.E+00, - 'x_a' : -1.5E-03/1.E-03, - 'x_b' : 1.5E-03/1.E-03, - 'stretch_y' : 'T', - 'a_y' : 4.E+00, - 'y_a' : -1.5E-03/1.E-03, - 'y_b' : 1.5E-03/1.E-03, - 'stretch_z' : 'T', - 'a_z' : 4.E+00, - 'z_a' : -1.5E-03/1.E-03, - 'z_b' : 1.5E-03/1.E-03, - 'cyl_coord' : 'F', - 'm' : 99, - 'n' : 99, - 'p' : 99, - 'dt' : 0.2E-09/1.E-03, - 't_step_start' : 0, - 't_step_stop' : 133300, - 't_step_save' : 100, - # ========================================================================== - - # Simulation Algorithm Parameters ========================================== - # Only two patches are necessary, the background liquid and the - # gas bubble - 'num_patches' : 2, - # Use the 6 equation model - 'model_eqns' : 3, - # 6 equations model does not need the K \div(u) term - 'alt_soundspeed' : 'F', - # Two fluids: water and air - 'num_fluids' : 2, - # time step - 'mpp_lim' : 'T', - # Correct errors when computing speed of sound - 'mixture_err' : 'T', - # Use TVD RK3 for time marching - 'time_stepper' : 3, - # Use WENO5 - 'weno_order' : 5, - 'weno_eps' : 1.E-16, - 'weno_Re_flux' : 'F', - 'weno_avg' : 'F', - 'avg_state' : 2, - # Use the mapped WENO weights to maintain monotinicity - 'mapped_weno' : 'T', - 'null_weights' : 'F', - 'mp_weno' : 'F', - # Use the HLLC Riemann solver - 'riemann_solver' : 2, - 'wave_speeds' : 1, - # We use reflective boundary conditions at octant edges and - # non-reflective boundary conditions at the domain edges - 'bc_x%beg' : -2, - 'bc_x%end' : -6, - 'bc_y%beg' : -2, - 'bc_y%end' : -6, - 'bc_z%beg' : -2, - 'bc_z%end' : -6, - # ========================================================================== - - # Formatted Database Files Structure Parameters ============================ - # Export primitive variables in double precision with parallel - # I/O to minimize I/O computational time during large simulations - 'format' : 1, - 'precision' : 2, - 'prim_vars_wrt' :'T', - 'parallel_io' :'T', - # ========================================================================== - - # Patch 1: High pressured water ============================================ - # Specify the cubic water background grid geometry - 'patch_icpp(1)%geometry' : 9, - 'patch_icpp(1)%x_centroid' : 80.E-03/1.E-03, - 'patch_icpp(1)%y_centroid' : 80.E-03/1.E-03, - 'patch_icpp(1)%z_centroid' : 80.E-03/1.E-03, - 'patch_icpp(1)%length_x' : 160.E-03/1.E-03, - 'patch_icpp(1)%length_y' : 160.E-03/1.E-03, - 'patch_icpp(1)%length_z' : 160.E-03/1.E-03, - # Specify the patch primitive variables - 'patch_icpp(1)%vel(1)' : 0.E+00, - 'patch_icpp(1)%vel(2)' : 0.E+00, - 'patch_icpp(1)%vel(3)' : 0.E+00, - 'patch_icpp(1)%pres' : 1.E+05, - 'patch_icpp(1)%alpha_rho(1)' : 1000.E+00, - 'patch_icpp(1)%alpha_rho(2)' : 0.1E+00, - 'patch_icpp(1)%alpha(1)' : 0.9E+00, - 'patch_icpp(1)%alpha(2)' : 0.1E+00, - # ========================================================================== - - # Patch 3: Air bubble ====================================================== - # Specify the spherical gas bubble grid geometry - 'patch_icpp(2)%geometry' : 8, - 'patch_icpp(2)%smoothen' : 'T', - 'patch_icpp(2)%smooth_patch_id' : 1, - 'patch_icpp(2)%smooth_coeff' : 0.5E+00, - 'patch_icpp(2)%x_centroid' : 0.E+00, - 'patch_icpp(2)%y_centroid' : 0.E+00, - 'patch_icpp(2)%z_centroid' : 0.E+00, - 'patch_icpp(2)%radius' : 1.E-03/1.E-03, - 'patch_icpp(2)%alter_patch(1)' : 'T', - # Specify the patch primitive variables - 'patch_icpp(2)%vel(1)' : 0.E+00, - 'patch_icpp(2)%vel(2)' : 0.E+00, - 'patch_icpp(2)%vel(3)' : 0.E+00, - 'patch_icpp(2)%pres' : 1.E+03, - 'patch_icpp(2)%alpha_rho(1)' : 100.E+00, - 'patch_icpp(2)%alpha_rho(2)' : 0.9E+00, - 'patch_icpp(2)%alpha(1)' : 0.1E+00, - 'patch_icpp(2)%alpha(2)' : 0.9E+00, - # ========================================================================== - - # Fluids Physical Parameters =============================================== - 'fluid_pp(1)%gamma' : 1.E+00/(4.4E+00-1.E+00), - 'fluid_pp(1)%pi_inf' : 4.4E+00*6.E+08/(4.4E+00-1.E+00), - 'fluid_pp(2)%gamma' : 1.E+00/(1.4E+00-1.E+00), - 'fluid_pp(2)%pi_inf' : 0.E+00, - # ========================================================================== -})) - -# ============================================================================== +print( + json.dumps( + { + # Logistics ================================================================ + "run_time_info": "T", + # Computational Domain Parameters ========================================== + # For these computations, the bubble is placed at the (0,0,0) + # domain origin. Only one octant of a full spherical bubble is + # used, with reflecting BC's at octant boundaries acting + # as the other bubble regions. + "x_domain%beg": 0.0e00, + "x_domain%end": 4.0e-03 / 1.0e-03, + "y_domain%beg": 0.0e00, + "y_domain%end": 4.0e-03 / 1.0e-03, + "z_domain%beg": 0.0e00, + "z_domain%end": 4.0e-03 / 1.0e-03, + # Grid stretching is used in the all coordinate directions + # to minimize computational costs. The grid is coarsened + # away from the bubble / origin + "stretch_x": "T", + "a_x": 4.0e00, + "x_a": -1.5e-03 / 1.0e-03, + "x_b": 1.5e-03 / 1.0e-03, + "stretch_y": "T", + "a_y": 4.0e00, + "y_a": -1.5e-03 / 1.0e-03, + "y_b": 1.5e-03 / 1.0e-03, + "stretch_z": "T", + "a_z": 4.0e00, + "z_a": -1.5e-03 / 1.0e-03, + "z_b": 1.5e-03 / 1.0e-03, + "cyl_coord": "F", + "m": 99, + "n": 99, + "p": 99, + "dt": 0.2e-09 / 1.0e-03, + "t_step_start": 0, + "t_step_stop": 133300, + "t_step_save": 100, + # Simulation Algorithm Parameters ========================================== + # Only two patches are necessary, the background liquid and the + # gas bubble + "num_patches": 2, + # Use the 6 equation model + "model_eqns": 3, + # 6 equations model does not need the K \div(u) term + "alt_soundspeed": "F", + # Two fluids: water and air + "num_fluids": 2, + # time step + "mpp_lim": "T", + # Correct errors when computing speed of sound + "mixture_err": "T", + # Use TVD RK3 for time marching + "time_stepper": 3, + # Use WENO5 + "weno_order": 5, + "weno_eps": 1.0e-16, + "weno_Re_flux": "F", + "weno_avg": "F", + "avg_state": 2, + # Use the mapped WENO weights to maintain monotinicity + "mapped_weno": "T", + "null_weights": "F", + "mp_weno": "F", + # Use the HLLC Riemann solver + "riemann_solver": 2, + "wave_speeds": 1, + # We use reflective boundary conditions at octant edges and + # non-reflective boundary conditions at the domain edges + "bc_x%beg": -2, + "bc_x%end": -6, + "bc_y%beg": -2, + "bc_y%end": -6, + "bc_z%beg": -2, + "bc_z%end": -6, + # Formatted Database Files Structure Parameters ============================ + # Export primitive variables in double precision with parallel + # I/O to minimize I/O computational time during large simulations + "format": 1, + "precision": 2, + "prim_vars_wrt": "T", + "parallel_io": "T", + # Patch 1: High pressured water ============================================ + # Specify the cubic water background grid geometry + "patch_icpp(1)%geometry": 9, + "patch_icpp(1)%x_centroid": 80.0e-03 / 1.0e-03, + "patch_icpp(1)%y_centroid": 80.0e-03 / 1.0e-03, + "patch_icpp(1)%z_centroid": 80.0e-03 / 1.0e-03, + "patch_icpp(1)%length_x": 160.0e-03 / 1.0e-03, + "patch_icpp(1)%length_y": 160.0e-03 / 1.0e-03, + "patch_icpp(1)%length_z": 160.0e-03 / 1.0e-03, + # Specify the patch primitive variables + "patch_icpp(1)%vel(1)": 0.0e00, + "patch_icpp(1)%vel(2)": 0.0e00, + "patch_icpp(1)%vel(3)": 0.0e00, + "patch_icpp(1)%pres": 1.0e05, + "patch_icpp(1)%alpha_rho(1)": 1000.0e00, + "patch_icpp(1)%alpha_rho(2)": 0.1e00, + "patch_icpp(1)%alpha(1)": 0.9e00, + "patch_icpp(1)%alpha(2)": 0.1e00, + # Patch 3: Air bubble ====================================================== + # Specify the spherical gas bubble grid geometry + "patch_icpp(2)%geometry": 8, + "patch_icpp(2)%smoothen": "T", + "patch_icpp(2)%smooth_patch_id": 1, + "patch_icpp(2)%smooth_coeff": 0.5e00, + "patch_icpp(2)%x_centroid": 0.0e00, + "patch_icpp(2)%y_centroid": 0.0e00, + "patch_icpp(2)%z_centroid": 0.0e00, + "patch_icpp(2)%radius": 1.0e-03 / 1.0e-03, + "patch_icpp(2)%alter_patch(1)": "T", + # Specify the patch primitive variables + "patch_icpp(2)%vel(1)": 0.0e00, + "patch_icpp(2)%vel(2)": 0.0e00, + "patch_icpp(2)%vel(3)": 0.0e00, + "patch_icpp(2)%pres": 1.0e03, + "patch_icpp(2)%alpha_rho(1)": 100.0e00, + "patch_icpp(2)%alpha_rho(2)": 0.9e00, + "patch_icpp(2)%alpha(1)": 0.1e00, + "patch_icpp(2)%alpha(2)": 0.9e00, + # Fluids Physical Parameters =============================================== + "fluid_pp(1)%gamma": 1.0e00 / (4.4e00 - 1.0e00), + "fluid_pp(1)%pi_inf": 4.4e00 * 6.0e08 / (4.4e00 - 1.0e00), + "fluid_pp(2)%gamma": 1.0e00 / (1.4e00 - 1.0e00), + "fluid_pp(2)%pi_inf": 0.0e00, + } + ) +) diff --git a/examples/3D_turb_mixing/case.py b/examples/3D_turb_mixing/case.py index 9e6a27f153..8e9de7f05b 100644 --- a/examples/3D_turb_mixing/case.py +++ b/examples/3D_turb_mixing/case.py @@ -1,20 +1,19 @@ #!/usr/bin/env python3 - import math import json # SURROUNDING FLOW ============================================================= # Nondimensional parameters -Re0 = 50. # Reynolds number -M0 = 0.2 # Mach number +Re0 = 50.0 # Reynolds number +M0 = 0.2 # Mach number # Fluid properties -gamma = 1.4 -pi_inf = 0. +gamma = 1.4 +pi_inf = 0.0 # Free stream velocity & pressure -u0 = 1. -pres0 = 1./(gamma*M0**2) +u0 = 1.0 +pres0 = 1.0 / (gamma * M0**2) # Domain size Lx = 59.0 @@ -27,111 +26,97 @@ Nz = 191 # Grid spacing -dx = Lx/float(Nx) -dy = Ly/float(Ny) -dz = Lz/float(Nz) +dx = Lx / float(Nx) +dy = Ly / float(Ny) +dz = Lz / float(Nz) # Time advancement -cfl = 0.1 -T = 100. -dt = cfl*dx/u0 -Ntfinal = int(T/dt) +cfl = 0.1 +T = 100.0 +dt = cfl * dx / u0 +Ntfinal = int(T / dt) Ntstart = 0 -Nfiles = 100 -t_save = int(math.ceil((Ntfinal-0)/float(Nfiles))) -Nt = t_save*Nfiles -t_step_start = Ntstart -t_step_stop = int(Nt) - -# ============================================================================== - +Nfiles = 100 +t_save = int(math.ceil((Ntfinal - 0) / float(Nfiles))) +Nt = t_save * Nfiles +t_step_start = Ntstart +t_step_stop = int(Nt) # Configuring case dictionary -print(json.dumps({ - # Logistics ================================================================ - 'run_time_info' : 'T', - # ========================================================================== - - # Computational Domain Parameters ========================================== - 'x_domain%beg' : 0., - 'x_domain%end' : Lx, - 'y_domain%beg' : -Ly/2., - 'y_domain%end' : Ly/2., - 'z_domain%beg' : 0., - 'z_domain%end' : Lz, - 'm' : Nx, - 'n' : Ny, - 'p' : Nz, - 'dt' : dt, - 't_step_start' : t_step_start, - 't_step_stop' : t_step_stop, - 't_step_save' : t_save, - # ========================================================================== - - # Simulation Algorithm Parameters ========================================== - 'num_patches' : 1, - 'model_eqns' : 2, - 'num_fluids' : 1, - 'time_stepper' : 3, - 'weno_order' : 5, - 'weno_eps' : 1.E-16, - 'weno_Re_flux' : 'T', - 'weno_avg' : 'T', - 'mapped_weno' : 'T', - 'riemann_solver' : 2, - 'wave_speeds' : 1, - 'avg_state' : 2, - 'bc_x%beg' : -1, - 'bc_x%end' : -1, - 'bc_y%beg' : -6, - 'bc_y%end' : -6, - 'bc_z%beg' : -1, - 'bc_z%end' : -1, - 'viscous' : 'T', - # ========================================================================== - - # Formatted Database Files Structure Parameters ============================ - 'format' : 1, - 'precision' : 2, - 'cons_vars_wrt' :'T', - 'prim_vars_wrt' :'T', - 'parallel_io' :'T', - 'fd_order' : 1, - 'omega_wrt(1)' :'T', - 'omega_wrt(2)' :'T', - 'omega_wrt(3)' :'T', - 'qm_wrt' :'T', - # ========================================================================== - - # Patch 1 ================================================================== - 'patch_icpp(1)%geometry' : 9, - 'patch_icpp(1)%x_centroid' : Lx/2., - 'patch_icpp(1)%y_centroid' : 0., - 'patch_icpp(1)%z_centroid' : Lz/2., - 'patch_icpp(1)%length_x' : Lx, - 'patch_icpp(1)%length_y' : Ly, - 'patch_icpp(1)%length_z' : Lz, - 'patch_icpp(1)%alpha_rho(1)' : 1., - 'patch_icpp(1)%alpha(1)' : 1., - 'patch_icpp(1)%vel(1)' : u0, - 'patch_icpp(1)%vel(2)' : 0., - 'patch_icpp(1)%vel(3)' : 0., - 'patch_icpp(1)%pres' : pres0, - # ========================================================================== - - # Mixing layer === ========================================================= - 'mixlayer_vel_profile' : 'T', - 'mixlayer_vel_coef' : 1., - 'mixlayer_domain' : 1., - 'mixlayer_perturb' : 'T', - # ========================================================================== - - # Fluids Physical Parameters =============================================== - # Surrounding liquid - 'fluid_pp(1)%gamma' : 1./(gamma-1.), - 'fluid_pp(1)%pi_inf' : 0., - 'fluid_pp(1)%Re(1)' : Re0, - # ========================================================================= -})) - -# ============================================================================== +print( + json.dumps( + { + # Logistics ================================================================ + "run_time_info": "T", + # Computational Domain Parameters ========================================== + "x_domain%beg": 0.0, + "x_domain%end": Lx, + "y_domain%beg": -Ly / 2.0, + "y_domain%end": Ly / 2.0, + "z_domain%beg": 0.0, + "z_domain%end": Lz, + "m": Nx, + "n": Ny, + "p": Nz, + "dt": dt, + "t_step_start": t_step_start, + "t_step_stop": t_step_stop, + "t_step_save": t_save, + # Simulation Algorithm Parameters ========================================== + "num_patches": 1, + "model_eqns": 2, + "num_fluids": 1, + "time_stepper": 3, + "weno_order": 5, + "weno_eps": 1.0e-16, + "weno_Re_flux": "T", + "weno_avg": "T", + "mapped_weno": "T", + "riemann_solver": 2, + "wave_speeds": 1, + "avg_state": 2, + "bc_x%beg": -1, + "bc_x%end": -1, + "bc_y%beg": -6, + "bc_y%end": -6, + "bc_z%beg": -1, + "bc_z%end": -1, + "viscous": "T", + # Formatted Database Files Structure Parameters ============================ + "format": 1, + "precision": 2, + "cons_vars_wrt": "T", + "prim_vars_wrt": "T", + "parallel_io": "T", + "fd_order": 1, + "omega_wrt(1)": "T", + "omega_wrt(2)": "T", + "omega_wrt(3)": "T", + "qm_wrt": "T", + # Patch 1 ================================================================== + "patch_icpp(1)%geometry": 9, + "patch_icpp(1)%x_centroid": Lx / 2.0, + "patch_icpp(1)%y_centroid": 0.0, + "patch_icpp(1)%z_centroid": Lz / 2.0, + "patch_icpp(1)%length_x": Lx, + "patch_icpp(1)%length_y": Ly, + "patch_icpp(1)%length_z": Lz, + "patch_icpp(1)%alpha_rho(1)": 1.0, + "patch_icpp(1)%alpha(1)": 1.0, + "patch_icpp(1)%vel(1)": u0, + "patch_icpp(1)%vel(2)": 0.0, + "patch_icpp(1)%vel(3)": 0.0, + "patch_icpp(1)%pres": pres0, + # Mixing layer === ========================================================= + "mixlayer_vel_profile": "T", + "mixlayer_vel_coef": 1.0, + "mixlayer_domain": 1.0, + "mixlayer_perturb": "T", + # Fluids Physical Parameters =============================================== + # Surrounding liquid + "fluid_pp(1)%gamma": 1.0 / (gamma - 1.0), + "fluid_pp(1)%pi_inf": 0.0, + "fluid_pp(1)%Re(1)": Re0, + } + ) +) diff --git a/examples/nD_perfect_reactor/analyze.py b/examples/nD_perfect_reactor/analyze.py index 2ddcd07413..ab0c6c0a94 100644 --- a/examples/nD_perfect_reactor/analyze.py +++ b/examples/nD_perfect_reactor/analyze.py @@ -13,7 +13,7 @@ Y_MAJORS = set(["H", "O", "OH", "HO2"]) Y_MINORS = set(["H2O", "H2O2"]) -Y_VARS = Y_MAJORS | Y_MINORS +Y_VARS = Y_MAJORS | Y_MINORS for name in tqdm(Y_VARS, desc="Loading Variables"): case.load_variable(f"Y_{name}", f"prim.{5 + sol.species_index(name)}") @@ -22,14 +22,18 @@ fig, axes = plt.subplots(1, 2, figsize=(12, 6)) mfc_plots = [[], []] -for y in Y_MAJORS: mfc_plots[0].append(case.plot_time(f"Y_{y}", ax=axes[0], label=f"${y}$")) -for y in Y_MINORS: mfc_plots[1].append(case.plot_time(f"Y_{y}", ax=axes[1], label=f"${y}$")) +for y in Y_MAJORS: + mfc_plots[0].append(case.plot_time(f"Y_{y}", ax=axes[0], label=f"${y}$")) +for y in Y_MINORS: + mfc_plots[1].append(case.plot_time(f"Y_{y}", ax=axes[1], label=f"${y}$")) -time_save = Tend/SAVE_COUNT +time_save = Tend / SAVE_COUNT oh_idx = sol.species_index("OH") + + def generate_ct_saves() -> tuple: - reactor = ct.IdealGasReactor(sol) + reactor = ct.IdealGasReactor(sol) reactor_network = ct.ReactorNet([reactor]) ct_time = 0.0 @@ -44,6 +48,7 @@ def generate_ct_saves() -> tuple: return ct_ts, ct_Ys, ct_rhos + ct_ts, ct_Ys, ct_rhos = generate_ct_saves() for y in Y_VARS: sns.lineplot( @@ -53,9 +58,10 @@ def generate_ct_saves() -> tuple: ax=axes[0 if y in Y_MAJORS else 1], color="white", alpha=0.5, - label=f"{y} (Cantera)" + label=f"{y} (Cantera)", ) + def find_induction_time(ts: list, Ys: list, rhos: list) -> float: for t, y, rho in zip(ts, Ys, rhos): if (y * rho / sol.molecular_weights[oh_idx]) >= 1e-6: @@ -63,16 +69,13 @@ def find_induction_time(ts: list, Ys: list, rhos: list) -> float: return None + skinner_induction_time = 0.052e-3 -ct_induction_time = find_induction_time( - ct_ts, - [y[oh_idx] for y in ct_Ys], - [rho for rho in ct_rhos] -) -mfc_induction_time = find_induction_time( +ct_induction_time = find_induction_time(ct_ts, [y[oh_idx] for y in ct_Ys], [rho for rho in ct_rhos]) +mfc_induction_time = find_induction_time( sorted(case.get_timestamps()), - [ case.get_data()[step]["Y_OH"][0] for step in sorted(case.get_timesteps()) ], - [ case.get_data()[step]["rho"][0] for step in sorted(case.get_timesteps()) ] + [case.get_data()[step]["Y_OH"][0] for step in sorted(case.get_timesteps())], + [case.get_data()[step]["rho"][0] for step in sorted(case.get_timesteps())], ) print("Induction Times ([OH] >= 1e-6):") @@ -80,12 +83,18 @@ def find_induction_time(ts: list, Ys: list, rhos: list) -> float: print(f" + Cantera: {ct_induction_time:.3e} s") print(f" + (Che)MFC: {mfc_induction_time:.3e} s") -axes[0].add_artist(axes[0].legend([ - axes[0].axvline(x=skinner_induction_time, color='r', linestyle='-'), - axes[0].axvline(x=mfc_induction_time, color='b', linestyle='-.'), - axes[0].axvline(x=ct_induction_time, color='g', linestyle=':') - ], ["Skinner et al.", "(Che)MFC", "Cantera"], - title="Induction Times", loc='lower right')) +axes[0].add_artist( + axes[0].legend( + [ + axes[0].axvline(x=skinner_induction_time, color="r", linestyle="-"), + axes[0].axvline(x=mfc_induction_time, color="b", linestyle="-."), + axes[0].axvline(x=ct_induction_time, color="g", linestyle=":"), + ], + ["Skinner et al.", "(Che)MFC", "Cantera"], + title="Induction Times", + loc="lower right", + ) +) for i in range(2): axes[i].legend(title="Species", ncol=2) diff --git a/examples/nD_perfect_reactor/case.py b/examples/nD_perfect_reactor/case.py index c1b3b082b6..09d4ad891d 100644 --- a/examples/nD_perfect_reactor/case.py +++ b/examples/nD_perfect_reactor/case.py @@ -1,128 +1,126 @@ #!/usr/bin/env python3 - # Reference: # + https://doi.org/10.1063/1.1696266 - -from mfc.case_utils import * - import json, argparse import cantera as ct -parser = argparse.ArgumentParser( - prog="nD_perfect_reactor", - formatter_class=argparse.ArgumentDefaultsHelpFormatter) +from mfc.case_utils import * -parser.add_argument("--mfc", type=json.loads, default='{}', metavar="DICT", - help="MFC's toolchain's internal state.") -parser.add_argument("--no-chem", dest='chemistry', default=True, action="store_false", - help="Disable chemistry.") -parser.add_argument("--scale", type=float, default=1, help="Scale.") -parser.add_argument("--ndim", type=int, default=1, help="Number of dimensions.") +parser = argparse.ArgumentParser(prog="nD_perfect_reactor", formatter_class=argparse.ArgumentDefaultsHelpFormatter) + +parser.add_argument( + "--mfc", + type=json.loads, + default="{}", + metavar="DICT", + help="MFC's toolchain's internal state.", +) +parser.add_argument( + "--no-chem", + dest="chemistry", + default=True, + action="store_false", + help="Disable chemistry.", +) +parser.add_argument("--scale", type=float, default=1, help="Scale.") +parser.add_argument("--ndim", type=int, default=1, help="Number of dimensions.") args = parser.parse_args() -ctfile = 'h2o2.yaml' -sol = ct.Solution(ctfile) +ctfile = "h2o2.yaml" +sol = ct.Solution(ctfile) -sol.TPX = 1_600, ct.one_atm, 'H2:0.04, O2:0.02, AR:0.94' +sol.TPX = 1_600, ct.one_atm, "H2:0.04, O2:0.02, AR:0.94" -Nx = int(25 * args.scale) +Nx = int(25 * args.scale) Tend = 1e-4 -s = 1e-2 -dt = 1e-7 +s = 1e-2 +dt = 1e-7 -NT = int(Tend / dt) +NT = int(Tend / dt) SAVE_COUNT = 20 -NS = NT // SAVE_COUNT +NS = NT // SAVE_COUNT case = { # Logistics ================================================================ - 'run_time_info' : 'T', - # ========================================================================== - + "run_time_info": "T", # Computational Domain Parameters ========================================== - 'x_domain%beg' : -s/2, - 'x_domain%end' : +s/2, - 'y_domain%beg' : -s/2, - 'y_domain%end' : +s/2, - 'z_domain%beg' : -s/2, - 'z_domain%end' : +s/2, - 'm' : Nx, - 'n' : Nx, - 'p' : Nx, - 'dt' : float(dt), - 't_step_start' : 0, - 't_step_stop' : NT, - 't_step_save' : NS, - 't_step_print' : NS, - 'parallel_io' : 'T' if args.ndim > 1 and args.mfc.get("mpi", True) else 'F', - + "x_domain%beg": -s / 2, + "x_domain%end": +s / 2, + "y_domain%beg": -s / 2, + "y_domain%end": +s / 2, + "z_domain%beg": -s / 2, + "z_domain%end": +s / 2, + "m": Nx, + "n": Nx, + "p": Nx, + "dt": float(dt), + "t_step_start": 0, + "t_step_stop": NT, + "t_step_save": NS, + "t_step_print": NS, + "parallel_io": "T" if args.ndim > 1 and args.mfc.get("mpi", True) else "F", # Simulation Algorithm Parameters ========================================== - 'model_eqns' : 2, - 'num_fluids' : 1, - 'num_patches' : 1, - 'mpp_lim' : 'F', - 'mixture_err' : 'F', - 'time_stepper' : 3, - 'weno_order' : 5, - 'weno_eps' : 1E-16, - 'weno_avg' : 'F', - 'mapped_weno' : 'T', - 'mp_weno' : 'T', - 'riemann_solver' : 1, - 'wave_speeds' : 1, - 'avg_state' : 2, - 'bc_x%beg' :-1, - 'bc_x%end' :-1, - 'bc_y%beg' :-1, - 'bc_y%end' :-1, - 'bc_z%beg' :-1, - 'bc_z%end' :-1, - + "model_eqns": 2, + "num_fluids": 1, + "num_patches": 1, + "mpp_lim": "F", + "mixture_err": "F", + "time_stepper": 3, + "weno_order": 5, + "weno_eps": 1e-16, + "weno_avg": "F", + "mapped_weno": "T", + "mp_weno": "T", + "riemann_solver": 1, + "wave_speeds": 1, + "avg_state": 2, + "bc_x%beg": -1, + "bc_x%end": -1, + "bc_y%beg": -1, + "bc_y%end": -1, + "bc_z%beg": -1, + "bc_z%end": -1, # Formatted Database Files Structure Parameters ============================ - 'format' : 1, - 'precision' : 2, - 'prim_vars_wrt' : 'T', - 'chem_wrt_T' : 'T', - # ========================================================================== - + "format": 1, + "precision": 2, + "prim_vars_wrt": "T", + "chem_wrt_T": "T", # Patch 1 ================================================================== - 'patch_icpp(1)%geometry' : 3**(args.ndim - 1), - 'patch_icpp(1)%x_centroid' : 0, - 'patch_icpp(1)%y_centroid' : 0, - 'patch_icpp(1)%z_centroid' : 0, - 'patch_icpp(1)%length_x' : s, - 'patch_icpp(1)%length_y' : s, - 'patch_icpp(1)%length_z' : s, - 'patch_icpp(1)%vel(1)' : 0, - 'patch_icpp(1)%vel(2)' : 0, - 'patch_icpp(1)%vel(3)' : 0, - 'patch_icpp(1)%pres' : sol.P, - 'patch_icpp(1)%alpha(1)' : 1, - 'patch_icpp(1)%alpha_rho(1)' : sol.density, - # ========================================================================== - + "patch_icpp(1)%geometry": 3 ** (args.ndim - 1), + "patch_icpp(1)%x_centroid": 0, + "patch_icpp(1)%y_centroid": 0, + "patch_icpp(1)%z_centroid": 0, + "patch_icpp(1)%length_x": s, + "patch_icpp(1)%length_y": s, + "patch_icpp(1)%length_z": s, + "patch_icpp(1)%vel(1)": 0, + "patch_icpp(1)%vel(2)": 0, + "patch_icpp(1)%vel(3)": 0, + "patch_icpp(1)%pres": sol.P, + "patch_icpp(1)%alpha(1)": 1, + "patch_icpp(1)%alpha_rho(1)": sol.density, # Fluids Physical Parameters =============================================== - 'fluid_pp(1)%gamma' : 1.0E+00/(4.4E+00-1.0E+00), - 'fluid_pp(1)%pi_inf' : 0, - # ========================================================================== + "fluid_pp(1)%gamma": 1.0e00 / (4.4e00 - 1.0e00), + "fluid_pp(1)%pi_inf": 0, } if args.chemistry: - case.update({ - # Chemistry ============================================================ - 'chemistry' : 'T', - 'chem_params%diffusion' : 'F', - 'chem_params%reactions' : 'T', - 'cantera_file' : ctfile, - # ====================================================================== - }) + case.update( + { + # Chemistry ============================================================ + "chemistry": "T", + "chem_params%diffusion": "F", + "chem_params%reactions": "T", + "cantera_file": ctfile, + } + ) for i in range(len(sol.Y)): - case[f'chem_wrt_Y({i + 1})'] = 'T' - case[f'patch_icpp(1)%Y({i+1})'] = sol.Y[i] + case[f"chem_wrt_Y({i + 1})"] = "T" + case[f"patch_icpp(1)%Y({i+1})"] = sol.Y[i] case = remove_higher_dimensional_keys(case, args.ndim) -if __name__ == '__main__': +if __name__ == "__main__": print(json.dumps(case)) diff --git a/examples/nD_perfect_reactor/export.py b/examples/nD_perfect_reactor/export.py index f8a27b9b45..f60f55e3fe 100644 --- a/examples/nD_perfect_reactor/export.py +++ b/examples/nD_perfect_reactor/export.py @@ -12,11 +12,13 @@ case.load_variable(f"Y_{name}", f"prim.{5 + sol.species_index(name)}") case.load_variable("rho", "prim.1") -time_save = Tend/SAVE_COUNT +time_save = Tend / SAVE_COUNT oh_idx = sol.species_index("OH") + + def generate_ct_saves() -> tuple: - reactor = ct.IdealGasReactor(sol) + reactor = ct.IdealGasReactor(sol) reactor_network = ct.ReactorNet([reactor]) ct_time = 0.0 @@ -31,6 +33,7 @@ def generate_ct_saves() -> tuple: return ct_ts, ct_Ys, ct_rhos + ct_ts, ct_Ys, ct_rhos = generate_ct_saves() with open("mfc.csv", "w") as f: @@ -47,10 +50,11 @@ def generate_ct_saves() -> tuple: keys = ["t"] + [f"Y_{_}" for _ in list(sol.species_names)] + ["rho"] writer.writerow(keys) for step in range(len(ct_ts)): - row = [ct_ts[step]] + [ ct_Ys[step][i] for i in range(len(sol.species_names)) ] + [ct_rhos[step]] + row = [ct_ts[step]] + [ct_Ys[step][i] for i in range(len(sol.species_names))] + [ct_rhos[step]] print([ct_ts[step]], row) writer.writerow(row) + def find_induction_time(ts: list, Ys: list, rhos: list) -> float: for t, y, rho in zip(ts, Ys, rhos): if (y * rho / sol.molecular_weights[oh_idx]) >= 1e-6: @@ -58,16 +62,13 @@ def find_induction_time(ts: list, Ys: list, rhos: list) -> float: return None + skinner_induction_time = 0.052e-3 -ct_induction_time = find_induction_time( - ct_ts, - [y[oh_idx] for y in ct_Ys], - [rho for rho in ct_rhos] -) -mfc_induction_time = find_induction_time( +ct_induction_time = find_induction_time(ct_ts, [y[oh_idx] for y in ct_Ys], [rho for rho in ct_rhos]) +mfc_induction_time = find_induction_time( sorted(case.get_timestamps()), - [ case.get_data()[step]["Y_OH"][0] for step in sorted(case.get_timesteps()) ], - [ case.get_data()[step]["rho"][0] for step in sorted(case.get_timesteps()) ] + [case.get_data()[step]["Y_OH"][0] for step in sorted(case.get_timesteps())], + [case.get_data()[step]["rho"][0] for step in sorted(case.get_timesteps())], ) print("Induction Times ([OH] >= 1e-6):") diff --git a/examples/scaling/case.py b/examples/scaling/case.py index 218c5ab43b..d175ddf7f1 100644 --- a/examples/scaling/case.py +++ b/examples/scaling/case.py @@ -1,19 +1,44 @@ #!/usr/bin/env python3 - import sys, json, math, typing, argparse parser = argparse.ArgumentParser( prog="scaling", description="Weak- and strong-scaling benchmark case.", - formatter_class=argparse.ArgumentDefaultsHelpFormatter) - -parser.add_argument("--mfc", type=json.loads, default='{}', metavar="DICT", - help="MFC's toolchain's internal state.") -parser.add_argument("-s", "--scaling", type=str, metavar="SCALING", choices=["weak", "strong"], help="Whether weak- or strong-scaling is being exercised.") -parser.add_argument("-m", "--memory", type=int, metavar="MEMORY", help="Weak scaling: memory per rank in GB. Strong scaling: global memory in GB. Used to determine cell count.") -parser.add_argument("-f", "--fidelity", type=str, metavar="FIDELITY", choices=["ideal", "exact"], default="ideal") -parser.add_argument("--rdma_mpi", type=str, metavar="FIDELITY", choices=["T", "F"], default="F") -parser.add_argument("--n-steps", type=int, metavar="N", default=None) + formatter_class=argparse.ArgumentDefaultsHelpFormatter, +) + +parser.add_argument( + "--mfc", + type=json.loads, + default="{}", + metavar="DICT", + help="MFC's toolchain's internal state.", +) +parser.add_argument( + "-s", + "--scaling", + type=str, + metavar="SCALING", + choices=["weak", "strong"], + help="Whether weak- or strong-scaling is being exercised.", +) +parser.add_argument( + "-m", + "--memory", + type=int, + metavar="MEMORY", + help="Weak scaling: memory per rank in GB. Strong scaling: global memory in GB. Used to determine cell count.", +) +parser.add_argument( + "-f", + "--fidelity", + type=str, + metavar="FIDELITY", + choices=["ideal", "exact"], + default="ideal", +) +parser.add_argument("--rdma_mpi", type=str, metavar="FIDELITY", choices=["T", "F"], default="F") +parser.add_argument("--n-steps", type=int, metavar="N", default=None) args = parser.parse_args() @@ -22,13 +47,15 @@ sys.exit(1) # \approx The number of cells per GB of memory. The exact value is not important. -cpg = 8000000 / 16.0 +cpg = 8000000 / 16.0 # Number of ranks. nranks = args.mfc["nodes"] * args.mfc["tasks_per_node"] + def nxyz_from_ncells(ncells: float) -> typing.Tuple[int, int, int]: - s = math.floor((ncells / 2.0) ** (1/3)) - return 2*s, s, s + s = math.floor((ncells / 2.0) ** (1 / 3)) + return 2 * s, s, s + if args.scaling == "weak": if args.fidelity == "ideal": @@ -42,7 +69,7 @@ def nxyz_from_ncells(ncells: float) -> typing.Tuple[int, int, int]: patm = 101325 # Initial Droplet Diameter / Reference length - m -D0 = 1.0E-3 +D0 = 1.0e-3 # cavity to droplet ratio CtD = 0.06 @@ -52,7 +79,7 @@ def nxyz_from_ncells(ncells: float) -> typing.Tuple[int, int, int]: # initial shock distance from the y axis. Note that the droplet center is located at y = 0. Thus, the distance from the shock to # the droplet is about D0/8 -ISD = 5.0/8 * D0 +ISD = 5.0 / 8 * D0 ## pre-shock properties - AIR @@ -69,12 +96,12 @@ def nxyz_from_ncells(ncells: float) -> typing.Tuple[int, int, int]: pia = 0 # speed of sound - M/s -c_a = math.sqrt( gama * ( p0a + pia ) / rho0a ) +c_a = math.sqrt(gama * (p0a + pia) / rho0a) ## Droplet - WATER # surface tension - N / m -st = 0.00E+0 +st = 0.00e0 # Delta Pressure - Pa DP = -st * 4 / D0 @@ -89,10 +116,10 @@ def nxyz_from_ncells(ncells: float) -> typing.Tuple[int, int, int]: gamw = 6.12 # pi infty - Pa -piw = 3.43E+08 +piw = 3.43e08 # speed of sound - m/s -c_w = math.sqrt( gamw * ( p0w + piw ) / rho0w ) +c_w = math.sqrt(gamw * (p0w + piw) / rho0w) # Shock Mach number of interest. Note that the post-shock properties can be defined in terms of either # Min or psOp0a. Just comment/uncomment appropriatelly @@ -101,14 +128,14 @@ def nxyz_from_ncells(ncells: float) -> typing.Tuple[int, int, int]: ## Pos to pre shock ratios - AIR # pressure -psOp0a = ( Min ** 2 -1 ) * 2 * gama / ( gama + 1 ) + 1 +psOp0a = (Min**2 - 1) * 2 * gama / (gama + 1) + 1 # psOp0a = 4.5 # density -rhosOrho0a = ( 1 + ( gama + 1 ) / ( gama - 1) * psOp0a ) / ( ( gama + 1 ) / ( gama - 1) + psOp0a ) +rhosOrho0a = (1 + (gama + 1) / (gama - 1) * psOp0a) / ((gama + 1) / (gama - 1) + psOp0a) # Mach number of the shocked region - just a checker, as it must return "Min" -Ms = math.sqrt( ( gama + 1. ) / ( 2. * gama ) * ( psOp0a - 1. ) * ( p0a / ( p0a + pia ) ) + 1. ) +Ms = math.sqrt((gama + 1.0) / (2.0 * gama) * (psOp0a - 1.0) * (p0a / (p0a + pia)) + 1.0) # shock speed of sound - m/s ss = Ms * c_a @@ -122,33 +149,33 @@ def nxyz_from_ncells(ncells: float) -> typing.Tuple[int, int, int]: rhos = rhosOrho0a * rho0a # post shock speed of sound - m/s -c_s = math.sqrt( gama * (ps + pia) / rhos ) +c_s = math.sqrt(gama * (ps + pia) / rhos) # velocity at the post shock - m/s -vel = c_a/gama * (psOp0a - 1.) * p0a / ( p0a + pia ) / Ms +vel = c_a / gama * (psOp0a - 1.0) * p0a / (p0a + pia) / Ms ## Domain boundaries - m # x direction xb = -8.4707 * D0 -xe = 9.6226 * D0 +xe = 9.6226 * D0 -#xb = -10 * D0 -#xe = 10 * D0 +# xb = -10 * D0 +# xe = 10 * D0 # y direction -yb = 0 * D0 -ye = 10 * D0 +yb = 0 * D0 +ye = 10 * D0 # y direction -zb = 0 * D0 -ze = 10 * D0 +zb = 0 * D0 +ze = 10 * D0 # Stretching factor, to make sure the domaing is sufficiently large after the mesh stretch StF = 4.0 # grid delta x if mesh were uniform in x direction - m. Note that I do not need a measure for dy -dx = ( xe - xb ) / Nx +dx = (xe - xb) / Nx # I calculate tend twice; first is an estimate, second is # the actual value used. This is because I am getting errors in the @@ -165,138 +192,128 @@ def nxyz_from_ncells(ncells: float) -> typing.Tuple[int, int, int]: cfl = 0.1 # time-step - s -dt = dx * cfl/ ss +dt = dx * cfl / ss # Save Frequency. Note that the number of autosaves will be SF + 1, as th IC (0.dat) is also saved SF = 400 ## making Nt divisible by SF # 1 - ensure NtA goes slightly beyond tendA -NtA = int( tendA//dt + 1 ) +NtA = int(tendA // dt + 1) # Array of saves. It is the same as Nt/Sf = t_step_save -AS = int( NtA // SF + 1 ) +AS = int(NtA // SF + 1) # Nt = total number of steps. Note that Nt >= NtA (so at least tendA is completely simulated) Nt = args.n_steps or (AS * SF) -SF = min( SF, Nt ) +SF = min(SF, Nt) # total simulation time - s. Note that tend >= tendA tend = Nt * dt # Configuring case args.mfcionary -print(json.dumps({ - # Logistics ================================================ - 'run_time_info' : 'T', - 'rdma_mpi' : args.rdma_mpi, - # ========================================================== - - # Computational Domain Parameters ========================== - 'x_domain%beg' : xb, - 'x_domain%end' : xe, - 'y_domain%beg' : yb, - 'y_domain%end' : ye, - 'z_domain%beg' : zb, - 'z_domain%end' : ze, - 'm' : Nx, - 'n' : Ny, - 'p' : Nz, - 'cyl_coord' : 'F', - 'dt' : dt, - 't_step_start' : 0, - 't_step_stop' : Nt, - 't_step_save' : SF, - # ========================================================== - - # Simulation Algorithm Parameters ========================== - 'num_patches' : 3, - 'model_eqns' : 2, - 'alt_soundspeed' : 'F', - 'num_fluids' : 2, - 'mpp_lim' : 'T', - 'mixture_err' : 'T', - 'time_stepper' : 3, - 'weno_order' : 3, - 'weno_eps' : 1.0E-16, - 'weno_Re_flux' : 'F', - 'weno_avg' : 'F', - 'mapped_weno' : 'T', - 'riemann_solver' : 2, - 'wave_speeds' : 1, - 'avg_state' : 2, - 'bc_x%beg' : -6, - 'bc_x%end' : -6, - 'bc_y%beg' : -2, - 'bc_y%end' : -3, - 'bc_z%beg' : -2, - 'bc_z%end' : -3, - # ========================================================== - - # Formatted Database Files Structure Parameters ============ - 'format' : 1, - 'precision' : 2, - 'prim_vars_wrt' :'T', - 'parallel_io' :'T', - # ========================================================== - # I will use 1 for WATER properties, and 2 for AIR properties - # Patch 1: Background (AIR - 2) ============================= - 'patch_icpp(1)%geometry' : 9, - 'patch_icpp(1)%x_centroid' : (xb+xe) / 2 * StF, - 'patch_icpp(1)%y_centroid' : (yb+ye) / 2 * StF, - 'patch_icpp(1)%z_centroid' : (yb+ye) / 2 * StF, - 'patch_icpp(1)%length_x' : (xe-xb) * StF, - 'patch_icpp(1)%length_y' : (ye-yb) * StF, - 'patch_icpp(1)%length_z' : (ze-zb) * StF, - 'patch_icpp(1)%vel(1)' : 0.0E+00, - 'patch_icpp(1)%vel(2)' : 0.0E+00, - 'patch_icpp(1)%vel(3)' : 0.0E+00, - 'patch_icpp(1)%pres' : p0a, - 'patch_icpp(1)%alpha_rho(1)' : 0.0E+00, - 'patch_icpp(1)%alpha_rho(2)' : rho0a, - 'patch_icpp(1)%alpha(1)' : 0.0E+00, - 'patch_icpp(1)%alpha(2)' : 1.0E+00, - # ========================================================== - - # Patch 2: Shocked state (AIR - 2) ========================= - 'patch_icpp(2)%geometry' : 9, - 'patch_icpp(2)%alter_patch(1)' : 'T', - 'patch_icpp(2)%x_centroid' : -ISD - ( xe - xb ) / 2 * StF, - 'patch_icpp(2)%y_centroid' : ( yb + ye ) / 2 * StF, - 'patch_icpp(2)%z_centroid' : ( zb + ze ) / 2 * StF, - 'patch_icpp(2)%length_x' : ( xe - xb ) * StF, - 'patch_icpp(2)%length_y' : ( ye - yb ) * StF, - 'patch_icpp(2)%length_z' : ( ze - zb ) * StF, - 'patch_icpp(2)%vel(1)' : vel, - 'patch_icpp(2)%vel(2)' : 0.0E+00, - 'patch_icpp(2)%vel(3)' : 0.0E+00, - 'patch_icpp(2)%pres' : ps, - 'patch_icpp(2)%alpha_rho(1)' : 0.0E+00, - 'patch_icpp(2)%alpha_rho(2)' : rhos, - 'patch_icpp(2)%alpha(1)' : 0.0E+00, - 'patch_icpp(2)%alpha(2)' : 1.0E+00, - # ========================================================== - - # Patch 3: Droplet (WATER - 1) ============================= - 'patch_icpp(3)%geometry' : 8, - 'patch_icpp(3)%x_centroid' : 0.0E+00, - 'patch_icpp(3)%y_centroid' : 0.0E+00, - 'patch_icpp(3)%z_centroid' : 0.0E+00, - 'patch_icpp(3)%radius' : D0/2, - 'patch_icpp(3)%alter_patch(1)' : 'T', - 'patch_icpp(3)%vel(1)' : 0.0E+00, - 'patch_icpp(3)%vel(2)' : 0.0E+00, - 'patch_icpp(3)%vel(3)' : 0.0E+00, - 'patch_icpp(3)%pres' : p0w, - 'patch_icpp(3)%alpha_rho(1)' : rho0w, - 'patch_icpp(3)%alpha_rho(2)' : 0.0E+00, - 'patch_icpp(3)%alpha(1)' : 1.0E+00, - 'patch_icpp(3)%alpha(2)' : 0.0E+00, - # ========================================================== - - # Fluids Physical Parameters =============================== - 'fluid_pp(1)%gamma' : 1.0E+00/(gamw-1), - 'fluid_pp(1)%pi_inf' : gamw*piw/(gamw-1), - 'fluid_pp(2)%gamma' : 1.0E+00/(gama-1), - 'fluid_pp(2)%pi_inf' : gama*pia/(gama-1), - # ========================================================== -})) +print( + json.dumps( + { + # Logistics ================================================ + "run_time_info": "T", + "rdma_mpi": args.rdma_mpi, + # Computational Domain Parameters ========================== + "x_domain%beg": xb, + "x_domain%end": xe, + "y_domain%beg": yb, + "y_domain%end": ye, + "z_domain%beg": zb, + "z_domain%end": ze, + "m": Nx, + "n": Ny, + "p": Nz, + "cyl_coord": "F", + "dt": dt, + "t_step_start": 0, + "t_step_stop": Nt, + "t_step_save": SF, + # Simulation Algorithm Parameters ========================== + "num_patches": 3, + "model_eqns": 2, + "alt_soundspeed": "F", + "num_fluids": 2, + "mpp_lim": "T", + "mixture_err": "T", + "time_stepper": 3, + "weno_order": 3, + "weno_eps": 1.0e-16, + "weno_Re_flux": "F", + "weno_avg": "F", + "mapped_weno": "T", + "riemann_solver": 2, + "wave_speeds": 1, + "avg_state": 2, + "bc_x%beg": -6, + "bc_x%end": -6, + "bc_y%beg": -2, + "bc_y%end": -3, + "bc_z%beg": -2, + "bc_z%end": -3, + # Formatted Database Files Structure Parameters ============ + "format": 1, + "precision": 2, + "prim_vars_wrt": "T", + "parallel_io": "T", + # I will use 1 for WATER properties, and 2 for AIR properties + # Patch 1: Background (AIR - 2) ============================= + "patch_icpp(1)%geometry": 9, + "patch_icpp(1)%x_centroid": (xb + xe) / 2 * StF, + "patch_icpp(1)%y_centroid": (yb + ye) / 2 * StF, + "patch_icpp(1)%z_centroid": (yb + ye) / 2 * StF, + "patch_icpp(1)%length_x": (xe - xb) * StF, + "patch_icpp(1)%length_y": (ye - yb) * StF, + "patch_icpp(1)%length_z": (ze - zb) * StF, + "patch_icpp(1)%vel(1)": 0.0e00, + "patch_icpp(1)%vel(2)": 0.0e00, + "patch_icpp(1)%vel(3)": 0.0e00, + "patch_icpp(1)%pres": p0a, + "patch_icpp(1)%alpha_rho(1)": 0.0e00, + "patch_icpp(1)%alpha_rho(2)": rho0a, + "patch_icpp(1)%alpha(1)": 0.0e00, + "patch_icpp(1)%alpha(2)": 1.0e00, + # Patch 2: Shocked state (AIR - 2) ========================= + "patch_icpp(2)%geometry": 9, + "patch_icpp(2)%alter_patch(1)": "T", + "patch_icpp(2)%x_centroid": -ISD - (xe - xb) / 2 * StF, + "patch_icpp(2)%y_centroid": (yb + ye) / 2 * StF, + "patch_icpp(2)%z_centroid": (zb + ze) / 2 * StF, + "patch_icpp(2)%length_x": (xe - xb) * StF, + "patch_icpp(2)%length_y": (ye - yb) * StF, + "patch_icpp(2)%length_z": (ze - zb) * StF, + "patch_icpp(2)%vel(1)": vel, + "patch_icpp(2)%vel(2)": 0.0e00, + "patch_icpp(2)%vel(3)": 0.0e00, + "patch_icpp(2)%pres": ps, + "patch_icpp(2)%alpha_rho(1)": 0.0e00, + "patch_icpp(2)%alpha_rho(2)": rhos, + "patch_icpp(2)%alpha(1)": 0.0e00, + "patch_icpp(2)%alpha(2)": 1.0e00, + # Patch 3: Droplet (WATER - 1) ============================= + "patch_icpp(3)%geometry": 8, + "patch_icpp(3)%x_centroid": 0.0e00, + "patch_icpp(3)%y_centroid": 0.0e00, + "patch_icpp(3)%z_centroid": 0.0e00, + "patch_icpp(3)%radius": D0 / 2, + "patch_icpp(3)%alter_patch(1)": "T", + "patch_icpp(3)%vel(1)": 0.0e00, + "patch_icpp(3)%vel(2)": 0.0e00, + "patch_icpp(3)%vel(3)": 0.0e00, + "patch_icpp(3)%pres": p0w, + "patch_icpp(3)%alpha_rho(1)": rho0w, + "patch_icpp(3)%alpha_rho(2)": 0.0e00, + "patch_icpp(3)%alpha(1)": 1.0e00, + "patch_icpp(3)%alpha(2)": 0.0e00, + # Fluids Physical Parameters =============================== + "fluid_pp(1)%gamma": 1.0e00 / (gamw - 1), + "fluid_pp(1)%pi_inf": gamw * piw / (gamw - 1), + "fluid_pp(2)%gamma": 1.0e00 / (gama - 1), + "fluid_pp(2)%pi_inf": gama * pia / (gama - 1), + } + ) +) diff --git a/examples/scaling/export.py b/examples/scaling/export.py index ba7555887e..c908fab024 100644 --- a/examples/scaling/export.py +++ b/examples/scaling/export.py @@ -1,9 +1,9 @@ import re, os, csv, glob, statistics - from dataclasses import dataclass, fields -CDIR=os.path.abspath(os.path.join("examples", "scaling")) -LDIR=os.path.join(CDIR, "logs") +CDIR = os.path.abspath(os.path.join("examples", "scaling")) +LDIR = os.path.join(CDIR, "logs") + def get_num(s: str) -> float: try: @@ -11,44 +11,46 @@ def get_num(s: str) -> float: except: return None + def get_nums(arr): return {get_num(_) for _ in arr if get_num(_)} + @dataclass(frozen=True, order=True) class Configuration: - nodes: int - mem: int + nodes: int + mem: int rdma_mpi: bool + @dataclass class Result: - ts_avg: float + ts_avg: float mpi_avg: float - init_t: float - sim_t: float + init_t: float + sim_t: float + runs = {} for logpath in glob.glob(os.path.join(LDIR, "run-*-sim*")): logdata = open(logpath, "r").read() - tss = get_nums(re.findall(r'^ TS .+', logdata, re.MULTILINE)) - mpis = get_nums(re.findall(r'^ MPI .+', logdata, re.MULTILINE)) + tss = get_nums(re.findall(r"^ TS .+", logdata, re.MULTILINE)) + mpis = get_nums(re.findall(r"^ MPI .+", logdata, re.MULTILINE)) try: perf = get_num(re.findall(r"^ Performance: .+", logdata, re.MULTILINE)[0]) except: - perf = 'N/A' + perf = "N/A" - if len(tss) == 0: tss = [-1.0] - if len(mpis) == 0: mpis = [-1.0] + if len(tss) == 0: + tss = [-1.0] + if len(mpis) == 0: + mpis = [-1.0] - pathels = os.path.relpath(logpath, LDIR).split('-') + pathels = os.path.relpath(logpath, LDIR).split("-") - runs[Configuration( - nodes=int(pathels[1]), - mem=int(pathels[2]), - rdma_mpi=pathels[3] == 'T' - )] = Result( + runs[Configuration(nodes=int(pathels[1]), mem=int(pathels[2]), rdma_mpi=pathels[3] == "T")] = Result( ts_avg=statistics.mean(tss), mpi_avg=statistics.mean(mpis), init_t=get_num(re.findall(r"Init took .+", logdata, re.MULTILINE)[0]), @@ -56,35 +58,30 @@ class Result: ) with open(os.path.join(CDIR, "export.csv"), "w") as f: - writer = csv.writer(f, delimiter=',') - writer.writerow([ - _.name for _ in fields(Configuration) + fields(Result) - ]) + writer = csv.writer(f, delimiter=",") + writer.writerow([_.name for _ in fields(Configuration) + fields(Result)]) for cfg in sorted(runs.keys()): - writer.writerow( - [ getattr(cfg, _.name) for _ in fields(Configuration) ] + - [ getattr(runs[cfg], _.name) for _ in fields(Result) ] - ) + writer.writerow([getattr(cfg, _.name) for _ in fields(Configuration)] + [getattr(runs[cfg], _.name) for _ in fields(Result)]) for rdma_mpi in (False, True): - with open( - os.path.join(CDIR, f"strong_scaling{'-rdma_mpi' if rdma_mpi else ''}.csv"), - "w" - ) as f: - writer = csv.writer(f, delimiter=',') - - for nodes in sorted({ - _.nodes for _ in runs.keys() if _.rdma_mpi == rdma_mpi - }): - row = (nodes*8,) - for mem in sorted({ - _.mem for _ in runs.keys() if _.nodes == nodes and _.rdma_mpi == rdma_mpi - }, reverse=True): - ref = runs[Configuration(nodes=sorted({ - _.nodes for _ in runs.keys() if _.rdma_mpi == rdma_mpi - })[0], mem=mem, rdma_mpi=rdma_mpi)] + with open(os.path.join(CDIR, f"strong_scaling{'-rdma_mpi' if rdma_mpi else ''}.csv"), "w") as f: + writer = csv.writer(f, delimiter=",") + + for nodes in sorted({_.nodes for _ in runs.keys() if _.rdma_mpi == rdma_mpi}): + row = (nodes * 8,) + for mem in sorted( + {_.mem for _ in runs.keys() if _.nodes == nodes and _.rdma_mpi == rdma_mpi}, + reverse=True, + ): + ref = runs[ + Configuration( + nodes=sorted({_.nodes for _ in runs.keys() if _.rdma_mpi == rdma_mpi})[0], + mem=mem, + rdma_mpi=rdma_mpi, + ) + ] run = runs[Configuration(nodes=nodes, mem=mem, rdma_mpi=rdma_mpi)] - row = (*row,run.sim_t,ref.sim_t/nodes) + row = (*row, run.sim_t, ref.sim_t / nodes) writer.writerow(row) diff --git a/misc/m_silo_proxy.f90 b/misc/m_silo_proxy.f90 index c2e57d542c..bb3055e717 100755 --- a/misc/m_silo_proxy.f90 +++ b/misc/m_silo_proxy.f90 @@ -44,7 +44,7 @@ module m_silo_proxy !> @brief Refer to page 28 of Silo's user guide (10/2007, v4.6) for !! information about this subroutine - function DBCREATE(pathname, lpathname, mode, target, & !! ---------- + function DBCREATE(pathname, lpathname, mode, target, & fileinfo, lfileinfo, filetype, status) integer :: DBCREATE @@ -59,55 +59,55 @@ function DBCREATE(pathname, lpathname, mode, target, & !! ---------- print '(A)', 'Creation of Silo-HDF5 database file is '// & 'inconsistent with use of Silo proxy module. '// & - 'Exiting ...' + 'Exiting.' stop - end function DBCREATE !! ------------------------------------------------ + end function DBCREATE !> @brief Refer to page 235 of Silo's user guide (10/2007, v4.6) !! for information about this subroutine - function DBGET2DSTRLEN() !! --------------------------------------------- + function DBGET2DSTRLEN() integer :: DBGET2DSTRLEN print '(A)', 'Attempt to query 2D string length is '// & 'inconsistent with use of Silo proxy module. '// & - 'Exiting ...' + 'Exiting.' stop - end function DBGET2DSTRLEN !! ------------------------------------------- + end function DBGET2DSTRLEN !> @brief Refer to page 234 of Silo's user guide (10/2007, v4.6) !! for information about this subroutine - function DBSET2DSTRLEN(len) !! ------------------------------------------ + function DBSET2DSTRLEN(len) integer :: DBSET2DSTRLEN integer, intent(IN) :: len print '(A)', 'Attempt to set 2D string length is '// & 'inconsistent with use of Silo proxy module. '// & - 'Exiting ...' + 'Exiting.' stop - end function DBSET2DSTRLEN !! ------------------------------------------- + end function DBSET2DSTRLEN !> @brief Refer to page 185 of Silo's user guide (10/2007, v4.6) !! for information about this subroutine - function DBMKOPTLIST(maxopts, optlist_id) !! ---------------------------- + function DBMKOPTLIST(maxopts, optlist_id) integer :: DBMKOPTLIST integer, intent(IN) :: maxopts integer, intent(IN) :: optlist_id print '(A)', 'Allocation of an options list is inconsistent '// & - 'with use of Silo proxy module. Exiting ...' + 'with use of Silo proxy module. Exiting.' stop - end function DBMKOPTLIST !! --------------------------------------------- + end function DBMKOPTLIST !> @brief Refer to page 186 of Silo's user guide (10/2007, v4.6) !! for information about this subroutine - function DBADDIOPT(optlist_id, option, ivalue) !! ----------------------- + function DBADDIOPT(optlist_id, option, ivalue) integer :: DBADDIOPT integer, intent(IN) :: optlist_id @@ -116,14 +116,14 @@ function DBADDIOPT(optlist_id, option, ivalue) !! ----------------------- print '(A)', 'Adding an option to an options list is '// & 'inconsistent with use of Silo proxy module. '// & - 'Exiting ...' + 'Exiting.' stop - end function DBADDIOPT !! ----------------------------------------------- + end function DBADDIOPT !> @brief Refer to page 186 of Silo's user guide (10/2007, v4.6) !! for information about this subroutine - function DBADDDOPT(optlist_id, option, dvalue) !! ----------------------- + function DBADDDOPT(optlist_id, option, dvalue) integer :: DBADDDOPT integer, intent(IN) :: optlist_id @@ -132,14 +132,14 @@ function DBADDDOPT(optlist_id, option, dvalue) !! ----------------------- print '(A)', 'Adding an option to an options list is '// & 'inconsistent with use of Silo proxy module. '// & - 'Exiting ...' + 'Exiting.' stop - end function DBADDDOPT !! ----------------------------------------------- + end function DBADDDOPT !> @brief Refer to page 121 of Silo's user guide (10/2007, v4.6) !! for information about this subroutine - function DBPUTMMESH(dbid, name, lname, nmesh, meshnames, & !! ----- + function DBPUTMMESH(dbid, name, lname, nmesh, meshnames, & lmeshnames, meshtypes, optlist_id, status) integer :: DBPUTMMESH @@ -155,27 +155,27 @@ function DBPUTMMESH(dbid, name, lname, nmesh, meshnames, & !! ----- print '(A)', 'Writing of multi-block mesh object into '// & 'Silo-HDF5 database file is inconsistent with '// & - 'use of Silo proxy module. Exiting ...' + 'use of Silo proxy module. Exiting.' stop - end function DBPUTMMESH !! ---------------------------------------------- + end function DBPUTMMESH !> @brief Refer to page 189 of Silo's user guide (10/2007, v4.6) !! for information about this subroutine - function DBFREEOPTLIST(optlist_id) !! ----------------------------------- + function DBFREEOPTLIST(optlist_id) integer :: DBFREEOPTLIST integer, intent(IN) :: optlist_id print '(A)', 'Deallocation of an options list is inconsistent '// & - 'with use of Silo proxy module. Exiting ...' + 'with use of Silo proxy module. Exiting.' stop - end function DBFREEOPTLIST !! ------------------------------------------- + end function DBFREEOPTLIST !> @brief Refer to page 57 of Silo's user guide (10/2007, v4.6) for !! information about this subroutine - function DBPUTQM(dbid, name, lname, xname, lxname, yname, lyname, & !! - + function DBPUTQM(dbid, name, lname, xname, lxname, yname, lyname, & zname, lzname, x, y, z, dims, ndims, datatype, & coordtype, optlist_id, status) @@ -201,14 +201,14 @@ function DBPUTQM(dbid, name, lname, xname, lxname, yname, lyname, & !! - print '(A)', 'Writing of quad mesh object into Silo-HDF5 '// & 'database file is inconsistent with use of Silo '// & - 'proxy module. Exiting ...' + 'proxy module. Exiting.' stop - end function DBPUTQM !! ------------------------------------------------- + end function DBPUTQM !> @brief Refer to page 46 of Silo's user guide (10/2007, v4.6) for !! information about this subroutine - function DBPUTCURVE(dbid, curvename, lcurvename, xvals, yvals, & !! ---- + function DBPUTCURVE(dbid, curvename, lcurvename, xvals, yvals, & datatype, npoints, optlist_id, status) integer :: DBPUTCURVE @@ -224,14 +224,14 @@ function DBPUTCURVE(dbid, curvename, lcurvename, xvals, yvals, & !! ---- print '(A)', 'Writing of curve object into Silo-HDF5 database '// & 'file is inconsistent with use of Silo proxy '// & - 'module. Exiting ...' + 'module. Exiting.' stop - end function DBPUTCURVE !! ---------------------------------------------- + end function DBPUTCURVE !> @brief Refer to page 130 of Silo's user guide (10/2007, v4.6) !! for information about this subroutine - function DBPUTMVAR(dbid, name, lname, nvar, varnames, lvarnames, & !! -- + function DBPUTMVAR(dbid, name, lname, nvar, varnames, lvarnames, & vartypes, optlist_id, status) integer :: DBPUTMVAR @@ -247,14 +247,14 @@ function DBPUTMVAR(dbid, name, lname, nvar, varnames, lvarnames, & !! -- print '(A)', 'Writing of multi-block variable into Silo-HDF5 '// & 'database file is inconsistent with use of Silo '// & - 'proxy module. Exiting ...' + 'proxy module. Exiting.' stop - end function DBPUTMVAR !! ----------------------------------------------- + end function DBPUTMVAR !> @brief Refer to page 64 of Silo's user guide (10/2007, v4.6) for !! information about this subroutine - function DBPUTQV1(dbid, name, lname, meshname, lmeshname, var, & !! ---- + function DBPUTQV1(dbid, name, lname, meshname, lmeshname, var, & dims, ndims, mixvar, mixlen, datatype, & centering, optlist_id, status) @@ -276,23 +276,23 @@ function DBPUTQV1(dbid, name, lname, meshname, lmeshname, var, & !! ---- print '(A)', 'Writing a scalar quad variable into a Silo-HDF5 '// & 'database file is inconsistent with use of Silo '// & - 'proxy module. Exiting ...' + 'proxy module. Exiting.' stop - end function DBPUTQV1 !! ------------------------------------------------ + end function DBPUTQV1 !> @brief Refer to page 31 of Silo's user guide (10/2007, v4.6) for !! information about this subroutine - function DBCLOSE(dbid) !! ----------------------------------------------- + function DBCLOSE(dbid) integer :: DBCLOSE integer, intent(IN) :: dbid print '(A)', 'Attempt to close Silo-HDF5 database file is '// & 'inconsistent with use of Silo proxy module. '// & - 'Exiting ...' + 'Exiting.' stop - end function DBCLOSE !! ------------------------------------------------- + end function DBCLOSE end module m_silo_proxy diff --git a/src/common/m_checker_common.fpp b/src/common/m_checker_common.fpp index 2d4ba3b82f..e8d6e1981d 100644 --- a/src/common/m_checker_common.fpp +++ b/src/common/m_checker_common.fpp @@ -339,11 +339,11 @@ contains if (any((/bc_${X}$%${VB2}$, bc_${X}$%${VB3}$/) /= 0._wp)) then call s_mpi_abort("bc_${X}$%beg must be -15 if "// & "bc_${X}$%${VB2}$ or bc_${X}$%${VB3}$ "// & - "is set. Exiting ...") + "is set. Exiting.") end if elseif (bc_${X}$%beg /= -16) then call s_mpi_abort("bc_${X}$%beg must be -15 or -16 if "// & - "bc_${X}$%vb[1,2,3] is set. Exiting ...") + "bc_${X}$%vb[1,2,3] is set. Exiting.") end if end if #:endfor @@ -354,11 +354,11 @@ contains if (any((/bc_${X}$%${VE2}$, bc_${X}$%${VE3}$/) /= 0._wp)) then call s_mpi_abort("bc_${X}$%end must be -15 if "// & "bc_${X}$%${VE2}$ or bc_${X}$%${VE3}$ "// & - "is set. Exiting ...") + "is set. Exiting.") end if elseif (bc_${X}$%end /= -16) then call s_mpi_abort("bc_${X}$%end must be -15 or -16 if "// & - "bc_${X}$%ve[1,2,3] is set. Exiting ...") + "bc_${X}$%ve[1,2,3] is set. Exiting.") end if end if #:endfor diff --git a/src/common/m_delay_file_access.f90 b/src/common/m_delay_file_access.f90 index df8b368dcd..48fbb9aaea 100644 --- a/src/common/m_delay_file_access.f90 +++ b/src/common/m_delay_file_access.f90 @@ -21,7 +21,7 @@ subroutine DelayFileAccess(ProcessRank) = (ProcessRank/N_PROCESSES_FILE_ACCESS)*FILE_ACCESS_DELAY_UNIT do iDelay = 1, nFileAccessDelayIterations - !-- wait my turn + ! Wait my turn call random_number(Number) Dummy = Number*Number end do diff --git a/src/common/m_eigen_solver.f90 b/src/common/m_eigen_solver.f90 index 0f72155e0f..4fef5153fb 100644 --- a/src/common/m_eigen_solver.f90 +++ b/src/common/m_eigen_solver.f90 @@ -69,11 +69,11 @@ end subroutine cg !! @param low one of two integers such that ar(i,j) and ai(i,j) !! are equal to zero if !! (1) i is greater than j and - !! (2) j=1,...,low-1 or i=igh+1,...,nl. + !! (2) j=1, ,low-1 or i=igh+1, ,nl. !! @param igh one of two integers such that ar(i,j) and ai(i,j) !! are equal to zero if !! (1) i is greater than j and - !! (2) j=1,...,low-1 or i=igh+1,...,nl. + !! (2) j=1, ,low-1 or i=igh+1, ,nl. !! @param scale the information determining the permutations and scaling !! factors used. subroutine cbal(nm, nl, ar, ai, low, igh, scale) @@ -92,8 +92,7 @@ subroutine cbal(nm, nl, ar, ai, low, igh, scale) k = 1 l = nl go to 100 -! .......... in-line procedure for row and -! column exchange .......... +! in-line procedure for row and column exchange 20 scale(ml) = j if (j == ml) go to 50 @@ -116,11 +115,10 @@ subroutine cbal(nm, nl, ar, ai, low, igh, scale) 40 end do 50 go to(80, 130), iexc -! .......... search for rows isolating an eigenvalue -! and push them down .......... +! search for rows isolating an eigenvalue and push them down 80 if (l == 1) go to 280 l = l - 1 -! .......... for j=l step -1 until 1 do -- .......... +! for j=l step -1 until 1 do 100 do 120 jj = 1, l j = l + 1 - jj @@ -135,8 +133,7 @@ subroutine cbal(nm, nl, ar, ai, low, igh, scale) 120 end do go to 140 -! .......... search for columns isolating an eigenvalue -! and push them left .......... +! search for columns isolating an eigenvalue and push them left 130 k = k + 1 140 do 170 j = k, l @@ -150,11 +147,11 @@ subroutine cbal(nm, nl, ar, ai, low, igh, scale) iexc = 2 go to 20 170 end do -! .......... now balance the submatrix in rows k to l .......... +! now balance the submatrix in rows k to l do 180 i = k, l scale(i) = 1.0_wp 180 end do -! .......... iterative loop for norm reduction .......... +! iterative loop for norm reduction 190 noconv = .false. do 270 i = k, l @@ -166,7 +163,7 @@ subroutine cbal(nm, nl, ar, ai, low, igh, scale) c = c + abs(ar(j, i)) + abs(ai(j, i)) r = r + abs(ar(i, j)) + abs(ai(i, j)) 200 end do -! .......... guard against zero c or r due to underflow .......... +! guard against zero c or r due to underflow if (c == 0.0_wp .or. r == 0.0_wp) go to 270 g = r/radix f = 1.0_wp @@ -180,7 +177,7 @@ subroutine cbal(nm, nl, ar, ai, low, igh, scale) f = f/radix c = c/b2 go to 230 -! .......... now balance .......... +! now balance 240 if ((c + r)/f >= 0.95_wp*s) go to 270 g = 1.0_wp/f scale(i) = scale(i)*f @@ -241,20 +238,20 @@ subroutine corth(nm, nl, low, igh, ar, ai, ortr, orti) ortr(ml) = 0.0_wp orti(ml) = 0.0_wp scale = 0.0_wp -! .......... scale column (algol tol then not needed) .......... +! scale column (algol tol then not needed) do 90 i = ml, igh scale = scale + abs(ar(i, ml - 1)) + abs(ai(i, ml - 1)) 90 end do if (scale == 0._wp) go to 180 mp = ml + igh -! .......... for i=igh step -1 until ml do -- .......... +! for i=igh step -1 until ml do do 100 ii = ml, igh i = mp - ii ortr(i) = ar(i, ml - 1)/scale orti(i) = ai(i, ml - 1)/scale h = h + ortr(i)*ortr(i) + orti(i)*orti(i) 100 end do -! + g = sqrt(h) call pythag(ortr(ml), orti(ml), f) if (f == 0._wp) go to 103 @@ -266,53 +263,55 @@ subroutine corth(nm, nl, low, igh, ar, ai, ortr, orti) 103 ortr(ml) = g ar(ml, ml - 1) = scale -! .......... form (i-(u*ut)/h) * a .......... +! form (i-(u*ut)/h) * a 105 do 130 j = ml, nl fr = 0.0_wp fi = 0.0_wp -! .......... for i=igh step -1 until ml do -- .......... +! for i=igh step -1 until ml do do 110 ii = ml, igh i = mp - ii fr = fr + ortr(i)*ar(i, j) + orti(i)*ai(i, j) fi = fi + ortr(i)*ai(i, j) - orti(i)*ar(i, j) 110 end do -! + fr = fr/h fi = fi/h -! + do 120 i = ml, igh ar(i, j) = ar(i, j) - fr*ortr(i) + fi*orti(i) ai(i, j) = ai(i, j) - fr*orti(i) - fi*ortr(i) 120 end do -! + 130 end do -! .......... form (i-(u*ut)/h)*a*(i-(u*ut)/h) .......... + +! form (i-(u*ut)/h)*a*(i-(u*ut)/h) do 160 i = 1, igh fr = 0.0_wp fi = 0.0_wp -! .......... for j=igh step -1 until ml do -- .......... + +! for j=igh step -1 until ml do do 140 jj = ml, igh j = mp - jj fr = fr + ortr(j)*ar(i, j) - orti(j)*ai(i, j) fi = fi + ortr(j)*ai(i, j) + orti(j)*ar(i, j) 140 end do -! + fr = fr/h fi = fi/h -! + do 150 j = ml, igh ar(i, j) = ar(i, j) - fr*ortr(j) - fi*orti(j) ai(i, j) = ai(i, j) + fr*orti(j) - fi*ortr(j) 150 end do -! + 160 end do -! + ortr(ml) = scale*ortr(ml) orti(ml) = scale*orti(ml) ar(ml, ml - 1) = -g*ar(ml, ml - 1) ai(ml, ml - 1) = -g*ai(ml, ml - 1) 180 end do -! + 200 return end subroutine corth @@ -357,7 +356,7 @@ subroutine comqr2(nm, nl, low, igh, ortr, orti, hr, hi, wr, wi, zr, zi, ierr) norm, tst1, tst2, c, d ! ierr = 0 -! .......... initialize eigenvector matrix .......... +! initialize eigenvector matrix do 101 j = 1, nl ! do 100 i = 1, nl @@ -366,18 +365,18 @@ subroutine comqr2(nm, nl, low, igh, ortr, orti, hr, hi, wr, wi, zr, zi, ierr) 100 end do zr(j, j) = 1.0_wp 101 end do -! .......... form the matrix of accumulated transformations -! from the information left by corth .......... +! form the matrix of accumulated transformations +! from the information left by corth iend = igh - low - 1 if (iend < 0) go to 180 if (iend == 0) go to 150 if (iend > 0) go to 105 -! .......... for i=igh-1 step -1 until low+1 do -- .......... +! for i=igh-1 step -1 until low+1 do 105 do 140 ii = 1, iend i = igh - ii if (abs(ortr(i)) == 0._wp .and. abs(orti(i)) == 0._wp) go to 140 if (abs(hr(i, i - 1)) == 0._wp .and. abs(hi(i, i - 1)) == 0._wp) go to 140 -! .......... norm below is negative of h formed in corth .......... +! norm below is negative of h formed in corth norm = hr(i, i - 1)*ortr(i) + hi(i, i - 1)*orti(i) ip1 = i + 1 @@ -385,30 +384,30 @@ subroutine comqr2(nm, nl, low, igh, ortr, orti, hr, hi, wr, wi, zr, zi, ierr) ortr(k) = hr(k, i - 1) orti(k) = hi(k, i - 1) 110 end do -! + do 130 j = i, igh sr = 0.0_wp si = 0.0_wp -! + do 115 k = i, igh sr = sr + ortr(k)*zr(k, j) + orti(k)*zi(k, j) si = si + ortr(k)*zi(k, j) - orti(k)*zr(k, j) 115 end do -! + sr = sr/norm si = si/norm -! + do 120 k = i, igh zr(k, j) = zr(k, j) + sr*ortr(k) - si*orti(k) zi(k, j) = zi(k, j) + sr*orti(k) + si*ortr(k) 120 end do -! + 130 end do -! + 140 end do -! .......... create real subdiagonal elements .......... +! create real subdiagonal elements 150 l = low + 1 -! + do 170 i = l, igh ll = min0(i + 1, igh) if (abs(hi(i, i - 1)) == 0._wp) go to 170 @@ -417,42 +416,42 @@ subroutine comqr2(nm, nl, low, igh, ortr, orti, hr, hi, wr, wi, zr, zi, ierr) yi = hi(i, i - 1)/norm hr(i, i - 1) = norm hi(i, i - 1) = 0.0_wp -! + do 155 j = i, nl si = yr*hi(i, j) - yi*hr(i, j) hr(i, j) = yr*hr(i, j) + yi*hi(i, j) hi(i, j) = si 155 end do -! + do 160 j = 1, ll si = yr*hi(j, i) + yi*hr(j, i) hr(j, i) = yr*hr(j, i) - yi*hi(j, i) hi(j, i) = si 160 end do -! + do 165 j = low, igh si = yr*zi(j, i) + yi*zr(j, i) zr(j, i) = yr*zr(j, i) - yi*zi(j, i) zi(j, i) = si 165 end do 170 end do -! .......... store roots isolated by cbal .......... +! store roots isolated by cbal 180 do 200 i = 1, nl if (i >= low .and. i <= igh) go to 200 wr(i) = hr(i, i) wi(i) = hi(i, i) 200 end do -! + en = igh tr = 0.0_wp ti = 0.0_wp itn = 30*nl -! .......... search for next eigenvalue .......... +! search for next eigenvalue 220 if (en < low) go to 680 its = 0 enm1 = en - 1 -! .......... look for single small sub-diagonal element -! for l=en step -1 until low do -- .......... +! look for single small sub-diagonal element +! for l=en step -1 until low do 240 do 260 ll = low, en l = en + low - ll if (l == low) go to 300 @@ -461,7 +460,7 @@ subroutine comqr2(nm, nl, low, igh, ortr, orti, hr, hi, wr, wi, zr, zi, ierr) tst2 = tst1 + abs(hr(l, l - 1)) if (tst2 == tst1) go to 300 260 end do -! .......... form shift .......... +! form shift 300 if (l == en) go to 660 if (itn == 0) go to 1000 if (its == 10 .or. its == 20) go to 320 @@ -480,22 +479,22 @@ subroutine comqr2(nm, nl, low, igh, ortr, orti, hr, hi, wr, wi, zr, zi, ierr) sr = sr - xxr si = si - xxi go to 340 -! .......... form exceptional shift .......... +! form exceptional shift 320 sr = abs(hr(en, enm1)) + abs(hr(enm1, en - 2)) si = 0.0_wp -! + 340 do 360 i = low, en hr(i, i) = hr(i, i) - sr hi(i, i) = hi(i, i) - si 360 end do -! + tr = tr + sr ti = ti + si its = its + 1 itn = itn - 1 -! .......... reduce to triangle (rows) .......... +! reduce to triangle (rows) lp1 = l + 1 -! + do 500 i = lp1, en sr = hr(i, i - 1) hr(i, i - 1) = 0.0_wp @@ -508,7 +507,7 @@ subroutine comqr2(nm, nl, low, igh, ortr, orti, hr, hi, wr, wi, zr, zi, ierr) hr(i - 1, i - 1) = norm hi(i - 1, i - 1) = 0.0_wp hi(i, i - 1) = sr/norm -! + do 490 j = i, nl yr = hr(i - 1, j) yi = hi(i - 1, j) @@ -519,9 +518,9 @@ subroutine comqr2(nm, nl, low, igh, ortr, orti, hr, hi, wr, wi, zr, zi, ierr) hr(i, j) = xr*zzr - xi*zzi - hi(i, i - 1)*yr hi(i, j) = xr*zzi + xi*zzr - hi(i, i - 1)*yi 490 end do -! + 500 end do -! + si = hi(en, en) if (abs(si) == 0._wp) go to 540 call pythag(hr(en, en), si, norm) @@ -531,18 +530,18 @@ subroutine comqr2(nm, nl, low, igh, ortr, orti, hr, hi, wr, wi, zr, zi, ierr) hi(en, en) = 0.0_wp if (en == nl) go to 540 ip1 = en + 1 -! + do 520 j = ip1, nl yr = hr(en, j) yi = hi(en, j) hr(en, j) = sr*yr + si*yi hi(en, j) = sr*yi - si*yr 520 end do -! .......... inverse operation (columns) .......... +! inverse operation (columns) 540 do 600 j = lp1, en xr = wr(j - 1) xi = wi(j - 1) -! + do 580 i = 1, j yr = hr(i, j - 1) yi = 0.0_wp @@ -555,7 +554,7 @@ subroutine comqr2(nm, nl, low, igh, ortr, orti, hr, hi, wr, wi, zr, zi, ierr) hr(i, j) = xr*zzr + xi*zzi - hi(j, j - 1)*yr hi(i, j) = xr*zzi - xi*zzr - hi(j, j - 1)*yi 580 end do -! + do 590 i = low, igh yr = zr(i, j - 1) yi = zi(i, j - 1) @@ -567,44 +566,44 @@ subroutine comqr2(nm, nl, low, igh, ortr, orti, hr, hi, wr, wi, zr, zi, ierr) zi(i, j) = xr*zzi - xi*zzr - hi(j, j - 1)*yi 590 end do 600 end do -! + if (abs(si) == 0._wp) go to 240 -! + do 630 i = 1, en yr = hr(i, en) yi = hi(i, en) hr(i, en) = sr*yr - si*yi hi(i, en) = sr*yi + si*yr 630 end do -! + do 640 i = low, igh yr = zr(i, en) yi = zi(i, en) zr(i, en) = sr*yr - si*yi zi(i, en) = sr*yi + si*yr 640 end do -! + go to 240 -! .......... a root found .......... +! a root found 660 hr(en, en) = hr(en, en) + tr wr(en) = hr(en, en) hi(en, en) = hi(en, en) + ti wi(en) = hi(en, en) en = enm1 go to 220 -! .......... all roots found. backsubstitute to find -! vectors of upper triangular form .......... +! all roots found. backsubstitute to find +! vectors of upper triangular form 680 norm = 0.0_wp -! + do i = 1, nl do j = i, nl tr = abs(hr(i, j)) + abs(hi(i, j)) if (tr > norm) norm = tr end do end do -! + if (nl == 1 .or. norm == 0._wp) go to 1001 -! .......... for en=nl step -1 until 2 do -- .......... +! for en=nl step -1 until 2 do do 800 nn = 2, nl en = nl + 2 - nn xr = wr(en) @@ -612,7 +611,7 @@ subroutine comqr2(nm, nl, low, igh, ortr, orti, hr, hi, wr, wi, zr, zi, ierr) hr(en, en) = 1.0_wp hi(en, en) = 0.0_wp enm1 = en - 1 -! .......... for i=en-1 step -1 until 1 do -- .......... +! for i=en-1 step -1 until 1 do do 780 ii = 1, enm1 i = en - ii zzr = 0.0_wp @@ -623,7 +622,7 @@ subroutine comqr2(nm, nl, low, igh, ortr, orti, hr, hi, wr, wi, zr, zi, ierr) zzr = zzr + hr(i, j)*hr(j, en) - hi(i, j)*hi(j, en) zzi = zzi + hr(i, j)*hi(j, en) + hi(i, j)*hr(j, en) 740 end do -! + yr = xr - wr(i) yi = xi - wi(i) if (yr /= 0.0_wp .or. yi /= 0.0_wp) go to 765 @@ -634,7 +633,7 @@ subroutine comqr2(nm, nl, low, igh, ortr, orti, hr, hi, wr, wi, zr, zi, ierr) if (tst2 > tst1) go to 760 765 continue call cdiv(zzr, zzi, yr, yi, hr(i, en), hi(i, en)) -! .......... overflow control .......... +! overflow control tr = abs(hr(i, en)) + abs(hi(i, en)) if (tr == 0.0_wp) go to 780 tst1 = tr @@ -644,45 +643,45 @@ subroutine comqr2(nm, nl, low, igh, ortr, orti, hr, hi, wr, wi, zr, zi, ierr) hr(j, en) = hr(j, en)/tr hi(j, en) = hi(j, en)/tr 770 end do -! + 780 end do -! + 800 end do -! .......... end backsubstitution .......... -! .......... vectors of isolated roots .......... +! end backsubstitution +! vectors of isolated roots do 840 i = 1, nl if (i >= low .and. i <= igh) go to 840 -! + do 820 j = I, nl zr(i, j) = hr(i, j) zi(i, j) = hi(i, j) 820 end do -! + 840 end do -! .......... multiply by transformation matrix to give +! multiply by transformation matrix to give ! vectors of original full matrix. -! for j=nl step -1 until low do -- .......... +! for j=nl step -1 until low do do jj = low, nl j = nl + low - jj ml = min0(j, igh) -! + do i = low, igh zzr = 0.0_wp zzi = 0.0_wp -! + do 860 k = low, ml zzr = zzr + zr(i, k)*hr(k, j) - zi(i, k)*hi(k, j) zzi = zzi + zr(i, k)*hi(k, j) + zi(i, k)*hr(k, j) 860 end do -! + zr(i, j) = zzr zi(i, j) = zzi end do end do -! + go to 1001 -! .......... set error -- all eigenvalues have not -! converged after 30*nl iterations .......... +! set error. all eigenvalues have not +! converged after 30*nl iterations 1000 ierr = en 1001 return end subroutine comqr2 @@ -718,27 +717,27 @@ subroutine cbabk2(nm, nl, low, igh, scale, ml, zr, zi) if (ml == 0) go to 200 if (igh == low) go to 120 -! + do 110 i = low, igh s = scale(i) -! .......... left hand eigenvectors are back transformed +! left hand eigenvectors are back transformed ! if the foregoing statement is replaced by -! s=1.0_wp/scale(i). .......... +! s=1.0_wp/scale(i). do 100 j = 1, ml zr(i, j) = zr(i, j)*s zi(i, j) = zi(i, j)*s 100 end do -! + 110 end do -! .......... for i=low-1 step -1 until 1, -! igh+1 step 1 until nl do -- .......... +! for i=low-1 step -1 until 1, +! igh+1 step 1 until nl do 120 do 140 ii = 1, nl i = ii if (i >= low .and. i <= igh) go to 140 if (i < low) i = low - ii k = scale(i) if (k == i) go to 140 -! + do 130 j = 1, ml s = zr(i, j) zr(i, j) = zr(k, j) @@ -747,19 +746,19 @@ subroutine cbabk2(nm, nl, low, igh, scale, ml, zr, zi) zi(i, j) = zi(k, j) zi(k, j) = s 130 end do -! + 140 end do -! + 200 return end subroutine cbabk2 subroutine csroot(xr, xi, yr, yi) real(wp), intent(in) :: xr, xi real(wp), intent(out) :: yr, yi -! + ! (yr,yi) = complex sqrt(xr,xi) ! branch chosen so that yr .ge. 0.0 and sign(yi) .eq. sign(xi) -! + real(wp) :: s, tr, ti, c tr = xr ti = xi @@ -777,14 +776,6 @@ subroutine cdiv(ar, ai, br, bi, cr, ci) real(wp), intent(in) :: ar, ai, br, bi real(wp), intent(out) :: cr, ci real(wp) :: s, ars, ais, brs, bis -! -! complex division, (cr,ci) = (ar,ai)/(br,bi) -! - ! (ar + i*ai) * (br - i*bi) /(br**2 + bi**2) - ! ((ar*br + i*ai*br) + (-i*ar*bi + ai*bi)) /(br**2 + bi**2) - ! (ar*br + ai*bi + i*(ai*br - ar*bi)) /(br**2 + bi**2) - ! cr = (ar*br + ai*bi) / (br**2._wp + bi**2._wp) - ! ci = (ai*br - ar*bi) / (br**2._wp + bi**2._wp) s = abs(br) + abs(bi) ars = ar/s @@ -800,9 +791,9 @@ end subroutine cdiv subroutine pythag(a, b, c) real(wp), intent(in) :: a, b real(wp), intent(out) :: c -! + ! finds sqrt(a**2+b**2) without overflow or destructive underflow -! + real(wp) :: p, r, s, t, u p = max(abs(a), abs(b)) if (p == 0.0_wp) go to 20 diff --git a/src/common/m_helper.fpp b/src/common/m_helper.fpp index f10f405032..b290b5bbb3 100644 --- a/src/common/m_helper.fpp +++ b/src/common/m_helper.fpp @@ -454,15 +454,15 @@ contains subroutine s_prohibit_abort(condition, message) character(len=*), intent(in) :: condition, message - print *, "" - print *, "====================================================================================================" - print *, " CASE FILE ERROR " - print *, "----------------------------------------------------------------------------------------------------" + print *, " " + print *, " " + print *, " CASE FILE ERROR " + print *, " " print *, "Prohibited condition: ", trim(condition) if (len_trim(message) > 0) then print *, "Note: ", trim(message) end if - print *, "====================================================================================================" + print *, " " print *, "" call s_mpi_abort end subroutine s_prohibit_abort diff --git a/src/common/m_mpi_common.fpp b/src/common/m_mpi_common.fpp index d504fa17ae..c13709c0bd 100644 --- a/src/common/m_mpi_common.fpp +++ b/src/common/m_mpi_common.fpp @@ -44,7 +44,7 @@ contains ! Checking whether the MPI environment has been properly initialized if (ierr /= MPI_SUCCESS) then - print '(A)', 'Unable to initialize MPI environment. Exiting ...' + print '(A)', 'Unable to initialize MPI environment. Exiting.' call MPI_ABORT(MPI_COMM_WORLD, 1, ierr) end if diff --git a/src/common/m_variables_conversion.fpp b/src/common/m_variables_conversion.fpp index a4c8b17dee..de910fc5f0 100644 --- a/src/common/m_variables_conversion.fpp +++ b/src/common/m_variables_conversion.fpp @@ -1239,7 +1239,7 @@ contains if (proc_rank == 0) then call s_mpi_abort('Conversion from primitive to '// & 'conservative variables not '// & - 'implemented. Exiting ...') + 'implemented. Exiting.') end if #endif end subroutine s_convert_primitive_to_conservative_variables diff --git a/src/post_process/m_checker.fpp b/src/post_process/m_checker.fpp index 2e587eea12..cfe8d8ad27 100644 --- a/src/post_process/m_checker.fpp +++ b/src/post_process/m_checker.fpp @@ -141,7 +141,7 @@ contains (/rho_wrt, E_wrt, pres_wrt, gamma_wrt, heat_ratio_wrt, pi_inf_wrt, & pres_inf_wrt, cons_vars_wrt, prim_vars_wrt, c_wrt, schlieren_wrt/), & alpha_rho_wrt, mom_wrt, vel_wrt, flux_wrt, alpha_wrt, omega_wrt]), & - "None of the flow variables have been selected for post-process. Exiting ...") + "None of the flow variables have been selected for post-process. Exiting.") end subroutine s_check_inputs_no_flow_variables end module m_checker diff --git a/src/post_process/m_data_input.f90 b/src/post_process/m_data_input.f90 index 9b94a0cbc4..0f28032fc6 100644 --- a/src/post_process/m_data_input.f90 +++ b/src/post_process/m_data_input.f90 @@ -112,7 +112,7 @@ subroutine s_read_serial_data_files(t_step) ! If the time-step directory is missing, the post-process exits. if (dir_check .neqv. .true.) then call s_mpi_abort('Time-step folder '//trim(t_step_dir)// & - ' is missing. Exiting ...') + ' is missing. Exiting.') end if call my_inquire(file_loc_ib, dir_check) @@ -120,7 +120,7 @@ subroutine s_read_serial_data_files(t_step) ! If the time-step directory is missing, the post-process exits. if (dir_check .neqv. .true.) then call s_mpi_abort('Time-step folder '//trim(t_step_ib_dir)// & - ' is missing. Exiting ...') + ' is missing. Exiting.') end if ! Reading the Grid Data File for the x-direction @@ -137,7 +137,7 @@ subroutine s_read_serial_data_files(t_step) close (1) else call s_mpi_abort('File x_cb.dat is missing in '// & - trim(t_step_dir)//'. Exiting ...') + trim(t_step_dir)//'. Exiting.') end if ! Computing the cell-width distribution @@ -161,7 +161,7 @@ subroutine s_read_serial_data_files(t_step) close (1) else call s_mpi_abort('File y_cb.dat is missing in '// & - trim(t_step_dir)//'. Exiting ...') + trim(t_step_dir)//'. Exiting.') end if ! Computing the cell-width distribution @@ -185,7 +185,7 @@ subroutine s_read_serial_data_files(t_step) close (1) else call s_mpi_abort('File z_cb.dat is missing in '// & - trim(t_step_dir)//'. Exiting ...') + trim(t_step_dir)//'. Exiting.') end if ! Computing the cell-width distribution @@ -217,7 +217,7 @@ subroutine s_read_serial_data_files(t_step) else call s_mpi_abort('File q_cons_vf'//trim(file_num)// & '.dat is missing in '//trim(t_step_dir)// & - '. Exiting ...') + '. Exiting.') end if end do @@ -232,7 +232,7 @@ subroutine s_read_serial_data_files(t_step) ACTION='read', & STATUS='old') else - call s_mpi_abort('File '//trim(file_loc_ib)//' is missing. Exiting ...') + call s_mpi_abort('File '//trim(file_loc_ib)//' is missing. Exiting.') end if end if @@ -254,7 +254,7 @@ subroutine s_read_serial_data_files(t_step) else print '(A)', 'File q_cons_vf'//trim(file_num)// & '.dat is missing in '//trim(t_step_dir)// & - '. Exiting ...' + '. Exiting.' call s_mpi_abort() end if end if @@ -312,7 +312,7 @@ subroutine s_read_parallel_data_files(t_step) call MPI_FILE_READ(ifile, x_cb_glb, data_size, mpi_p, status, ierr) call MPI_FILE_CLOSE(ifile, ierr) else - call s_mpi_abort('File '//trim(file_loc)//' is missing. Exiting...') + call s_mpi_abort('File '//trim(file_loc)//' is missing. Exiting.') end if ! Assigning local cell boundary locations @@ -333,7 +333,7 @@ subroutine s_read_parallel_data_files(t_step) call MPI_FILE_READ(ifile, y_cb_glb, data_size, mpi_p, status, ierr) call MPI_FILE_CLOSE(ifile, ierr) else - call s_mpi_abort('File '//trim(file_loc)//' is missing. Exiting...') + call s_mpi_abort('File '//trim(file_loc)//' is missing. Exiting.') end if ! Assigning local cell boundary locations @@ -354,7 +354,7 @@ subroutine s_read_parallel_data_files(t_step) call MPI_FILE_READ(ifile, z_cb_glb, data_size, mpi_p, status, ierr) call MPI_FILE_CLOSE(ifile, ierr) else - call s_mpi_abort('File '//trim(file_loc)//' is missing. Exiting...') + call s_mpi_abort('File '//trim(file_loc)//' is missing. Exiting.') end if ! Assigning local cell boundary locations @@ -434,12 +434,12 @@ subroutine s_read_parallel_data_files(t_step) MPI_INTEGER, status, ierr) else - call s_mpi_abort('File '//trim(file_loc)//' is missing. Exiting...') + call s_mpi_abort('File '//trim(file_loc)//' is missing. Exiting.') end if end if else - call s_mpi_abort('File '//trim(file_loc)//' is missing. Exiting...') + call s_mpi_abort('File '//trim(file_loc)//' is missing. Exiting.') end if else ! Open the file to read conservative variables @@ -532,11 +532,11 @@ subroutine s_read_parallel_data_files(t_step) MPI_INTEGER, status, ierr) else - call s_mpi_abort('File '//trim(file_loc)//' is missing. Exiting...') + call s_mpi_abort('File '//trim(file_loc)//' is missing. Exiting.') end if end if else - call s_mpi_abort('File '//trim(file_loc)//' is missing. Exiting...') + call s_mpi_abort('File '//trim(file_loc)//' is missing. Exiting.') end if end if diff --git a/src/post_process/m_data_output.fpp b/src/post_process/m_data_output.fpp index f92d44ad5c..fbe6c051b3 100644 --- a/src/post_process/m_data_output.fpp +++ b/src/post_process/m_data_output.fpp @@ -500,7 +500,7 @@ contains if (dbfile == -1) then call s_mpi_abort('Unable to create Silo-HDF5 database '// & 'slave file '//trim(file_loc)//'. '// & - 'Exiting ...') + 'Exiting.') end if ! Next, analogous steps to the ones above are carried out by the @@ -518,7 +518,7 @@ contains if (dbroot == -1) then call s_mpi_abort('Unable to create Silo-HDF5 database '// & 'master file '//trim(file_loc)//'. '// & - 'Exiting ...') + 'Exiting.') end if end if @@ -542,7 +542,7 @@ contains ! is not the case, the post-process exits. if (err /= 0) then call s_mpi_abort('Unable to create Binary database slave '// & - 'file '//trim(file_loc)//'. Exiting ...') + 'file '//trim(file_loc)//'. Exiting.') end if ! Further defining the structure of the formatted database slave @@ -572,7 +572,7 @@ contains if (err /= 0) then call s_mpi_abort('Unable to create Binary database '// & 'master file '//trim(file_loc)// & - '. Exiting ...') + '. Exiting.') end if if (output_partial_domain) then @@ -1124,7 +1124,7 @@ contains close (9) end if else - print '(A)', trim(file_loc)//' is missing. Exiting ...' + print '(A)', trim(file_loc)//' is missing. Exiting.' call s_mpi_abort end if diff --git a/src/post_process/m_mpi_proxy.fpp b/src/post_process/m_mpi_proxy.fpp index 7ac265ef9a..754ce83294 100644 --- a/src/post_process/m_mpi_proxy.fpp +++ b/src/post_process/m_mpi_proxy.fpp @@ -364,7 +364,7 @@ contains if (proc_rank == 0 .and. ierr == -1) then print '(A)', 'Unable to decompose computational '// & 'domain for selected number of '// & - 'processors. Exiting ...' + 'processors. Exiting.' call MPI_ABORT(MPI_COMM_WORLD, 1, ierr) end if @@ -484,7 +484,7 @@ contains if (proc_rank == 0 .and. ierr == -1) then print '(A)', 'Unable to decompose computational '// & 'domain for selected number of '// & - 'processors. Exiting ...' + 'processors. Exiting.' call MPI_ABORT(MPI_COMM_WORLD, 1, ierr) end if diff --git a/src/post_process/m_start_up.f90 b/src/post_process/m_start_up.f90 index 86f4419648..42df0e84c6 100644 --- a/src/post_process/m_start_up.f90 +++ b/src/post_process/m_start_up.f90 @@ -102,7 +102,7 @@ subroutine s_read_input_file read (1, fmt='(A)') line print *, 'Invalid line in namelist: '//trim(line) call s_mpi_abort('Invalid line in post_process.inp. It is '// & - 'likely due to a datatype mismatch. Exiting ...') + 'likely due to a datatype mismatch. Exiting.') end if close (1) @@ -116,7 +116,7 @@ subroutine s_read_input_file if (cfl_adap_dt .or. cfl_const_dt .or. rkck_adap_dt) cfl_dt = .true. else - call s_mpi_abort('File post_process.inp is missing. Exiting ...') + call s_mpi_abort('File post_process.inp is missing. Exiting.') end if end subroutine s_read_input_file @@ -143,7 +143,7 @@ subroutine s_check_input_file ! Constraint on the location of the case directory if (dir_check .neqv. .true.) then call s_mpi_abort('Unsupported choice for the value of '// & - 'case_dir. Exiting ...') + 'case_dir. Exiting.') end if call s_check_inputs_common() @@ -307,7 +307,7 @@ subroutine s_save_data(t_step, varname, pres, c, H) end if end do - ! Adding the species' concentrations to the formatted database file ---- + ! Adding the species' concentrations to the formatted database file if (chemistry) then do i = 1, num_species if (chem_wrt_Y(i) .or. prim_vars_wrt) then diff --git a/src/pre_process/m_check_patches.fpp b/src/pre_process/m_check_patches.fpp index a92cac471c..8ff89f2254 100644 --- a/src/pre_process/m_check_patches.fpp +++ b/src/pre_process/m_check_patches.fpp @@ -60,7 +60,7 @@ contains elseif (patch_icpp(i)%geometry == 6) then call s_mpi_abort('geometry 6 (formerly "Vortex")'// & 'is no longer supported for patch '//trim(iStr)// & - '. Exiting ...') + '. Exiting.') elseif (patch_icpp(i)%geometry == 7) then call s_check_2D_analytical_patch_geometry(i) elseif (patch_icpp(i)%geometry == 8) then diff --git a/src/pre_process/m_data_output.fpp b/src/pre_process/m_data_output.fpp index dca7f5a607..4d194c5bf3 100644 --- a/src/pre_process/m_data_output.fpp +++ b/src/pre_process/m_data_output.fpp @@ -885,7 +885,7 @@ contains write (1, '(A)') "This file may contain errors and not support all features." write (1, '(A3,A20,A20)') "#", "Conservative", "Primitive" - write (1, '(A)') "-------------------------------------------" + write (1, '(A)') " " do i = contxb, contxe write (temp, '(I0)') i - contxb + 1 write (1, '(I3,A20,A20)') i, "\alpha_{"//trim(temp)//"} \rho_{"//trim(temp)//"}", "\alpha_{"//trim(temp)//"} \rho" diff --git a/src/pre_process/m_initial_condition.fpp b/src/pre_process/m_initial_condition.fpp index c69a35f5f3..8bacdc8aa8 100644 --- a/src/pre_process/m_initial_condition.fpp +++ b/src/pre_process/m_initial_condition.fpp @@ -252,7 +252,7 @@ contains ! Unimplemented patch (formerly isentropic vortex) elseif (patch_icpp(i)%geometry == 6) then call s_mpi_abort('This used to be the isentropic vortex patch, '// & - 'which no longer exists. See Examples. Exiting ...') + 'which no longer exists. See Examples. Exiting.') ! Analytical function patch for testing purposes elseif (patch_icpp(i)%geometry == 7) then diff --git a/src/pre_process/m_mpi_proxy.fpp b/src/pre_process/m_mpi_proxy.fpp index 0686ca1516..f5655bf025 100644 --- a/src/pre_process/m_mpi_proxy.fpp +++ b/src/pre_process/m_mpi_proxy.fpp @@ -293,7 +293,7 @@ contains if (proc_rank == 0 .and. ierr == -1) then print '(A)', 'Unable to decompose computational '// & 'domain for selected number of '// & - 'processors. Exiting ...' + 'processors. Exiting.' call MPI_ABORT(MPI_COMM_WORLD, 1, ierr) end if @@ -404,7 +404,7 @@ contains if (proc_rank == 0 .and. ierr == -1) then print '(A)', 'Unable to decompose computational '// & 'domain for selected number of '// & - 'processors. Exiting ...' + 'processors. Exiting.' call MPI_ABORT(MPI_COMM_WORLD, 1, ierr) end if diff --git a/src/pre_process/m_patches.fpp b/src/pre_process/m_patches.fpp index 4adf4b0004..0afee832ed 100644 --- a/src/pre_process/m_patches.fpp +++ b/src/pre_process/m_patches.fpp @@ -2014,7 +2014,7 @@ contains end if if (proc_rank == 0) then - print *, " * Transforming model..." + print *, " * Transforming model." end if transform = f_create_transform_matrix(params) @@ -2044,7 +2044,7 @@ contains ! Interpolate the STL model along the edges (2D) and on triangle facets (3D) if (interpolate) then if (proc_rank == 0) then - print *, ' * Interpolating STL vertices...' + print *, ' * Interpolating STL vertices.' end if if (p > 0) then @@ -2200,7 +2200,7 @@ contains if (proc_rank == 0) then print *, "" - print *, " * Cleaning up..." + print *, " * Cleaning up." end if call s_model_free(model) diff --git a/src/pre_process/m_start_up.fpp b/src/pre_process/m_start_up.fpp index 3586dfde90..a23519a37b 100644 --- a/src/pre_process/m_start_up.fpp +++ b/src/pre_process/m_start_up.fpp @@ -157,7 +157,7 @@ contains read (1, fmt='(A)') line print *, 'Invalid line in namelist: '//trim(line) call s_mpi_abort('Invalid line in pre_process.inp. It is '// & - 'likely due to a datatype mismatch. Exiting ...') + 'likely due to a datatype mismatch. Exiting.') end if close (1) ! Store m,n,p into global m,n,p @@ -170,7 +170,7 @@ contains if (cfl_adap_dt .or. cfl_const_dt .or. rkck_adap_dt) cfl_dt = .true. else - call s_mpi_abort('File pre_process.inp is missing. Exiting ...') + call s_mpi_abort('File pre_process.inp is missing. Exiting.') end if end subroutine s_read_input_file @@ -198,7 +198,7 @@ contains print '(A)', 'WARNING: Ensure that compiler flags/choices in Makefiles match your compiler! ' print '(A)', 'WARNING: Ensure that preprocessor flags are enabled! ' call s_mpi_abort('Unsupported choice for the value of case_dir.'// & - 'Exiting ...') + 'Exiting.') end if call s_check_inputs_common() @@ -240,7 +240,7 @@ contains ! If the time-step directory is missing, the pre-process exits if (dir_check .neqv. .true.) then call s_mpi_abort('Time-step folder '//trim(t_step_dir)// & - ' is missing. Exiting ...') + ' is missing. Exiting.') end if ! Reading the Grid Data File for the x-direction @@ -257,7 +257,7 @@ contains close (1) else call s_mpi_abort('File x_cb.dat is missing in '// & - trim(t_step_dir)//'. Exiting ...') + trim(t_step_dir)//'. Exiting.') end if ! Computing cell-center locations @@ -287,7 +287,7 @@ contains close (1) else call s_mpi_abort('File y_cb.dat is missing in '// & - trim(t_step_dir)//'. Exiting ...') + trim(t_step_dir)//'. Exiting.') end if ! Computing cell-center locations @@ -316,7 +316,7 @@ contains close (1) else call s_mpi_abort('File z_cb.dat is missing in '// & - trim(t_step_dir)//'. Exiting ...') + trim(t_step_dir)//'. Exiting.') end if ! Computing cell-center locations @@ -357,7 +357,7 @@ contains if (any(x_cb(0:m) - x_cb(-1:m - 1) <= 0._wp)) then call s_mpi_abort('x_cb.dat in '//trim(t_step_dir)// & - ' contains non-positive cell-spacings. Exiting ...') + ' contains non-positive cell-spacings. Exiting.') end if ! Cell-boundary Data Consistency Check in y-direction @@ -367,7 +367,7 @@ contains if (any(y_cb(0:n) - y_cb(-1:n - 1) <= 0._wp)) then call s_mpi_abort('y_cb.dat in '//trim(t_step_dir)// & ' contains non-positive cell-spacings. '// & - 'Exiting ...') + 'Exiting.') end if ! Cell-boundary Data Consistency Check in z-direction @@ -377,7 +377,7 @@ contains if (any(z_cb(0:p) - z_cb(-1:p - 1) <= 0._wp)) then call s_mpi_abort('z_cb.dat in '//trim(t_step_dir)// & ' contains non-positive cell-spacings'// & - ' .Exiting ...') + ' .Exiting.') end if end if @@ -434,7 +434,7 @@ contains else call s_mpi_abort('File q_cons_vf'//trim(file_num)// & '.dat is missing in '//trim(t_step_dir)// & - '. Exiting ...') + '. Exiting.') end if end do @@ -459,7 +459,7 @@ contains else call s_mpi_abort('File pb'//trim(file_num)// & '.dat is missing in '//trim(t_step_dir)// & - '. Exiting ...') + '. Exiting.') end if end do @@ -483,7 +483,7 @@ contains else call s_mpi_abort('File mv'//trim(file_num)// & '.dat is missing in '//trim(t_step_dir)// & - '. Exiting ...') + '. Exiting.') end if end do @@ -505,7 +505,7 @@ contains else call s_mpi_abort('File ib.dat is missing in ' & //trim(t_step_dir)// & - '. Exiting ...') + '. Exiting.') end if end if @@ -549,7 +549,7 @@ contains call MPI_FILE_READ_ALL(ifile, x_cb_glb, data_size, mpi_p, status, ierr) call MPI_FILE_CLOSE(ifile, ierr) else - call s_mpi_abort('File '//trim(file_loc)//' is missing. Exiting... ') + call s_mpi_abort('File '//trim(file_loc)//' is missing. Exiting. ') end if ! Assigning local cell boundary locations @@ -574,7 +574,7 @@ contains call MPI_FILE_READ_ALL(ifile, y_cb_glb, data_size, mpi_p, status, ierr) call MPI_FILE_CLOSE(ifile, ierr) else - call s_mpi_abort('File '//trim(file_loc)//' is missing. Exiting... ') + call s_mpi_abort('File '//trim(file_loc)//' is missing. Exiting. ') end if ! Assigning local cell boundary locations @@ -599,7 +599,7 @@ contains call MPI_FILE_READ_ALL(ifile, z_cb_glb, data_size, mpi_p, status, ierr) call MPI_FILE_CLOSE(ifile, ierr) else - call s_mpi_abort('File '//trim(file_loc)//' is missing. Exiting... ') + call s_mpi_abort('File '//trim(file_loc)//' is missing. Exiting. ') end if ! Assigning local cell boundary locations @@ -715,7 +715,7 @@ contains call MPI_FILE_CLOSE(ifile, ierr) else - call s_mpi_abort('File '//trim(file_loc)//' is missing. Exiting... ') + call s_mpi_abort('File '//trim(file_loc)//' is missing. Exiting. ') end if if (ib) then @@ -736,7 +736,7 @@ contains MPI_INTEGER, status, ierr) else - call s_mpi_abort('File '//trim(file_loc)//' is missing. Exiting...') + call s_mpi_abort('File '//trim(file_loc)//' is missing. Exiting.') end if end if diff --git a/src/simulation/m_bubbles_EL.fpp b/src/simulation/m_bubbles_EL.fpp index f569083922..170bfe765e 100644 --- a/src/simulation/m_bubbles_EL.fpp +++ b/src/simulation/m_bubbles_EL.fpp @@ -430,7 +430,7 @@ contains print *, 'Reading lag_bubbles_mpi_io: ', tot_data, mytime, dt end if else - print '(a)', trim(file_loc)//' is missing. exiting ...' + print '(a)', trim(file_loc)//' is missing. exiting.' call s_mpi_abort end if @@ -989,7 +989,7 @@ contains dc = (3._wp*abs(vol)/(4._wp*pi))**(1._wp/3._wp) else - stop "Check cluterflag. Exiting ..." + stop "Check cluterflag. Exiting." end if diff --git a/src/simulation/m_data_output.fpp b/src/simulation/m_data_output.fpp index 9b617ef5e3..6417dc7975 100644 --- a/src/simulation/m_data_output.fpp +++ b/src/simulation/m_data_output.fpp @@ -149,19 +149,19 @@ contains ! Generating table header for the stability criteria to be outputted if (cfl_dt) then if (viscous) then - write (1, '(A)') '==== Time-steps ====== dt ===== Time ======= ICFL '// & - 'Max ==== VCFL Max ====== Rc Min =======' + write (1, '(A)') ' Time-steps dt = Time ICFL '// & + 'Max VCFL Max Rc Min =' else - write (1, '(A)') '=========== Time-steps ============== dt ===== Time '// & - '============== ICFL Max =============' + write (1, '(A)') ' Time-steps dt Time '// & + ' ICFL Max ' end if else if (viscous) then - write (1, '(A)') '==== Time-steps ====== Time ======= ICFL '// & - 'Max ==== VCFL Max ====== Rc Min =======' + write (1, '(A)') ' Time-steps Time ICFL '// & + 'Max VCFL Max Rc Min ' else - write (1, '(A)') '=========== Time-steps ============== Time '// & - '============== ICFL Max =============' + write (1, '(A)') ' Time-steps Time '// & + ' ICFL Max ' end if end if @@ -174,6 +174,7 @@ contains character(len=path_len + 3*name_len) :: file_path !< !! Relative path to the CoM file in the case directory integer :: i !< Generic loop iterator + do i = 1, num_fluids ! Generating the relative path to the CoM data file write (file_path, '(A,I0,A)') '/fluid', i, '_com.dat' @@ -185,23 +186,23 @@ contains position='append', & status='unknown') if (n == 0) then - write (i + 120, '(A)') '=== Non-Dimensional Time '// & - '=== Total Mass '// & - '=== x-loc '// & - '=== Total Volume ===' + write (i + 120, '(A)') ' Non-Dimensional Time '// & + ' Total Mass '// & + ' x-loc '// & + ' Total Volume ' elseif (p == 0) then - write (i + 120, '(A)') '=== Non-Dimensional Time '// & - '=== Total Mass '// & - '=== x-loc '// & - '=== y-loc '// & - '=== Total Volume ===' + write (i + 120, '(A)') ' Non-Dimensional Time '// & + ' Total Mass '// & + ' x-loc '// & + ' y-loc '// & + ' Total Volume ' else - write (i + 120, '(A)') '=== Non-Dimensional Time '// & - '=== Total Mass '// & - '=== x-loc '// & - '=== y-loc '// & - '=== z-loc '// & - '=== Total Volume ===' + write (i + 120, '(A)') ' Non-Dimensional Time '// & + ' Total Mass '// & + ' x-loc '// & + ' y-loc '// & + ' z-loc '// & + ' Total Volume ' end if end do end subroutine s_open_com_files @@ -362,18 +363,18 @@ contains end if if (icfl_max_glb /= icfl_max_glb) then - call s_mpi_abort('ICFL is NaN. Exiting ...') + call s_mpi_abort('ICFL is NaN. Exiting.') elseif (icfl_max_glb > 1._wp) then print *, 'icfl', icfl_max_glb - call s_mpi_abort('ICFL is greater than 1.0. Exiting ...') + call s_mpi_abort('ICFL is greater than 1.0. Exiting.') end if if (viscous) then if (vcfl_max_glb /= vcfl_max_glb) then - call s_mpi_abort('VCFL is NaN. Exiting ...') + call s_mpi_abort('VCFL is NaN. Exiting.') elseif (vcfl_max_glb > 1._wp) then print *, 'vcfl', vcfl_max_glb - call s_mpi_abort('VCFL is greater than 1.0. Exiting ...') + call s_mpi_abort('VCFL is greater than 1.0. Exiting.') end if end if end if @@ -1690,8 +1691,7 @@ contains real(wp) :: run_time !< Run-time of the simulation ! Writing the footer of and closing the run-time information file - write (3, '(A)') '---'// & - '---' + write (3, '(A)') ' ' write (3, '(A)') '' write (3, '(A,F9.6)') 'ICFL Max: ', icfl_max @@ -1702,8 +1702,7 @@ contains write (3, '(A)') '' write (3, '(A,I0,A)') 'Run-time: ', int(anint(run_time)), 's' - write (3, '(A)') '===='// & - '===' + write (3, '(A)') ' ' close (3) end subroutine s_close_run_time_information_file diff --git a/src/simulation/m_ibm.fpp b/src/simulation/m_ibm.fpp index 3ed21dab9b..0b07317c67 100644 --- a/src/simulation/m_ibm.fpp +++ b/src/simulation/m_ibm.fpp @@ -403,33 +403,8 @@ contains end if end if end do - - ! print *, "GP Loc: ", ghost_points(q)%loc(:) - ! print *, "Norm: ", norm(:) - ! print *, "Dist: ", abs(dist) - ! print *, "IP Loc: ", ghost_points(q)%ip_grid(:) - ! print *, "------" end do -#if 0 - if (proc_rank == 0) then - - open (unit=10, file=trim(case_dir)//'/gp.txt', status='replace') - do i = 1, num_gps - write (10, '(3F36.12)') x_cc(ghost_points(i)%loc(1)), y_cc(ghost_points(i)%loc(2)) - end do - close (10) - - open (unit=10, file=trim(case_dir)//'/ip.txt', status='replace') - do i = 1, num_gps - write (10, '(3F36.12)') ghost_points(i)%ip_loc(1), ghost_points(i)%ip_loc(2) - end do - close (10) - - end if - -#endif - end subroutine s_compute_image_points !> Function that finds the number of ghost points, used for allocating diff --git a/src/simulation/m_mpi_proxy.fpp b/src/simulation/m_mpi_proxy.fpp index 85a9deba7d..1764c06832 100644 --- a/src/simulation/m_mpi_proxy.fpp +++ b/src/simulation/m_mpi_proxy.fpp @@ -465,7 +465,7 @@ contains if (proc_rank == 0 .and. ierr == -1) then call s_mpi_abort('Unsupported combination of values '// & 'of num_procs, m, n, p and '// & - 'weno_order. Exiting ...') + 'weno_order. Exiting.') end if ! Creating new communicator using the Cartesian topology @@ -566,7 +566,7 @@ contains if (proc_rank == 0 .and. ierr == -1) then call s_mpi_abort('Unsupported combination of values '// & 'of num_procs, m, n and '// & - 'weno_order. Exiting ...') + 'weno_order. Exiting.') end if ! Creating new communicator using the Cartesian topology diff --git a/src/simulation/m_start_up.fpp b/src/simulation/m_start_up.fpp index af3c33500f..2cb6e44175 100644 --- a/src/simulation/m_start_up.fpp +++ b/src/simulation/m_start_up.fpp @@ -189,7 +189,7 @@ contains read (1, fmt='(A)') line print *, 'Invalid line in namelist: '//trim(line) call s_mpi_abort('Invalid line in simulation.inp. It is '// & - 'likely due to a datatype mismatch. Exiting ...') + 'likely due to a datatype mismatch. Exiting.') end if close (1) @@ -206,7 +206,7 @@ contains if (cfl_adap_dt .or. cfl_const_dt .or. rkck_adap_dt) cfl_dt = .true. else - call s_mpi_abort(trim(file_path)//' is missing. Exiting ...') + call s_mpi_abort(trim(file_path)//' is missing. Exiting.') end if end subroutine s_read_input_file @@ -228,7 +228,7 @@ contains call my_inquire(file_path, file_exist) if (file_exist .neqv. .true.) then - call s_mpi_abort(trim(file_path)//' is missing. Exiting ...') + call s_mpi_abort(trim(file_path)//' is missing. Exiting.') end if call s_check_inputs_common() @@ -271,7 +271,7 @@ contains call my_inquire(file_path, file_exist) if (file_exist .neqv. .true.) then - call s_mpi_abort(trim(file_path)//' is missing. Exiting ...') + call s_mpi_abort(trim(file_path)//' is missing. Exiting.') end if ! Cell-boundary Locations in x-direction @@ -286,7 +286,7 @@ contains STATUS='old') read (2) x_cb(-1:m); close (2) else - call s_mpi_abort(trim(file_path)//' is missing. Exiting ...') + call s_mpi_abort(trim(file_path)//' is missing. Exiting.') end if dx(0:m) = x_cb(0:m) - x_cb(-1:m - 1) @@ -314,7 +314,7 @@ contains STATUS='old') read (2) y_cb(-1:n); close (2) else - call s_mpi_abort(trim(file_path)//' is missing. Exiting ...') + call s_mpi_abort(trim(file_path)//' is missing. Exiting.') end if dy(0:n) = y_cb(0:n) - y_cb(-1:n - 1) @@ -336,7 +336,7 @@ contains STATUS='old') read (2) z_cb(-1:p); close (2) else - call s_mpi_abort(trim(file_path)//' is missing. Exiting ...') + call s_mpi_abort(trim(file_path)//' is missing. Exiting.') end if dz(0:p) = z_cb(0:p) - z_cb(-1:p - 1) @@ -355,7 +355,7 @@ contains STATUS='old') read (2) q_cons_vf(i)%sf(0:m, 0:n, 0:p); close (2) else - call s_mpi_abort(trim(file_path)//' is missing. Exiting ...') + call s_mpi_abort(trim(file_path)//' is missing. Exiting.') end if end do @@ -374,7 +374,7 @@ contains STATUS='old') read (2) pb_ts(1)%sf(0:m, 0:n, 0:p, r, i); close (2) else - call s_mpi_abort(trim(file_path)//' is missing. Exiting ...') + call s_mpi_abort(trim(file_path)//' is missing. Exiting.') end if end do end do @@ -390,7 +390,7 @@ contains STATUS='old') read (2) mv_ts(1)%sf(0:m, 0:n, 0:p, r, i); close (2) else - call s_mpi_abort(trim(file_path)//' is missing. Exiting ...') + call s_mpi_abort(trim(file_path)//' is missing. Exiting.') end if end do end do @@ -410,7 +410,7 @@ contains STATUS='old') read (2) ib_markers%sf(0:m, 0:n, 0:p); close (2) else - call s_mpi_abort(trim(file_path)//' is missing. Exiting ...') + call s_mpi_abort(trim(file_path)//' is missing. Exiting.') end if ! Read Levelset @@ -425,7 +425,7 @@ contains read (2) levelset%sf(0:m, 0:n, 0:p, 1:num_ibs); close (2) ! print*, 'check', STL_levelset(106, 50, 0, 1) else - call s_mpi_abort(trim(file_path)//' is missing. Exiting ...') + call s_mpi_abort(trim(file_path)//' is missing. Exiting.') end if ! Read Levelset Norm @@ -439,7 +439,7 @@ contains STATUS='old') read (2) levelset_norm%sf(0:m, 0:n, 0:p, 1:num_ibs, 1:3); close (2) else - call s_mpi_abort(trim(file_path)//' is missing. Exiting ...') + call s_mpi_abort(trim(file_path)//' is missing. Exiting.') end if do i = 1, num_ibs @@ -457,7 +457,7 @@ contains STATUS='old') read (2) airfoil_grid_u; close (2) else - call s_mpi_abort(trim(file_path)//' is missing. Exiting ...') + call s_mpi_abort(trim(file_path)//' is missing. Exiting.') end if write (file_path, '(A)') & @@ -470,7 +470,7 @@ contains STATUS='old') read (2) airfoil_grid_l; close (2) else - call s_mpi_abort(trim(file_path)//' is missing. Exiting ...') + call s_mpi_abort(trim(file_path)//' is missing. Exiting.') end if end if end do @@ -519,7 +519,7 @@ contains call MPI_FILE_READ(ifile, x_cb_glb, data_size, mpi_p, status, ierr) call MPI_FILE_CLOSE(ifile, ierr) else - call s_mpi_abort('File '//trim(file_loc)//' is missing. Exiting...') + call s_mpi_abort('File '//trim(file_loc)//' is missing. Exiting.') end if ! Assigning local cell boundary locations @@ -550,7 +550,7 @@ contains call MPI_FILE_READ(ifile, y_cb_glb, data_size, mpi_p, status, ierr) call MPI_FILE_CLOSE(ifile, ierr) else - call s_mpi_abort('File '//trim(file_loc)//' is missing. Exiting...') + call s_mpi_abort('File '//trim(file_loc)//' is missing. Exiting.') end if ! Assigning local cell boundary locations @@ -571,7 +571,7 @@ contains call MPI_FILE_READ(ifile, z_cb_glb, data_size, mpi_p, status, ierr) call MPI_FILE_CLOSE(ifile, ierr) else - call s_mpi_abort('File '//trim(file_loc)//'is missing. Exiting...') + call s_mpi_abort('File '//trim(file_loc)//'is missing. Exiting.') end if ! Assigning local cell boundary locations @@ -669,7 +669,7 @@ contains MPI_INTEGER, status, ierr) else - call s_mpi_abort('File '//trim(file_loc)//' is missing. Exiting...') + call s_mpi_abort('File '//trim(file_loc)//' is missing. Exiting.') end if ! Read Levelset @@ -689,7 +689,7 @@ contains mpi_p, status, ierr) else - call s_mpi_abort('File '//trim(file_loc)//' is missing. Exiting...') + call s_mpi_abort('File '//trim(file_loc)//' is missing. Exiting.') end if ! Read Levelset Norm @@ -709,13 +709,13 @@ contains mpi_p, status, ierr) else - call s_mpi_abort('File '//trim(file_loc)//' is missing. Exiting...') + call s_mpi_abort('File '//trim(file_loc)//' is missing. Exiting.') end if end if else - call s_mpi_abort('File '//trim(file_loc)//' is missing. Exiting...') + call s_mpi_abort('File '//trim(file_loc)//' is missing. Exiting.') end if else @@ -818,7 +818,7 @@ contains MPI_INTEGER, status, ierr) else - call s_mpi_abort('File '//trim(file_loc)//' is missing. Exiting...') + call s_mpi_abort('File '//trim(file_loc)//' is missing. Exiting.') end if ! Read Levelset @@ -838,7 +838,7 @@ contains mpi_p, status, ierr) else - call s_mpi_abort('File '//trim(file_loc)//' is missing. Exiting...') + call s_mpi_abort('File '//trim(file_loc)//' is missing. Exiting.') end if ! Read Levelset Norm @@ -858,13 +858,13 @@ contains mpi_p, status, ierr) else - call s_mpi_abort('File '//trim(file_loc)//' is missing. Exiting...') + call s_mpi_abort('File '//trim(file_loc)//' is missing. Exiting.') end if end if else - call s_mpi_abort('File '//trim(file_loc)//' is missing. Exiting...') + call s_mpi_abort('File '//trim(file_loc)//' is missing. Exiting.') end if end if diff --git a/toolchain/bootstrap/format.sh b/toolchain/bootstrap/format.sh index a2ca712489..f4baea506a 100644 --- a/toolchain/bootstrap/format.sh +++ b/toolchain/bootstrap/format.sh @@ -19,9 +19,14 @@ log "Formatting MFC:" if ! find ${@:-src} -type f | grep -Ev 'autogen' | grep -E '\.(f90|fpp)$' \ | xargs -L 1 -P ${JOBS:-1} $SHELL toolchain/bootstrap/format_file.sh; then - error "Formatting MFC failed." + error "Formatting MFC source failed." exit 1 fi -ok "Done. MFC has been formatted." +if ! find ${@:-examples} -type f | grep -E '\.(py)$' \ + | xargs -L 1 -P ${JOBS:-1} $SHELL toolchain/bootstrap/format_python.sh; then + error "Formatting MFC examples failed." + exit 1 +fi +ok "Done. MFC has been formatted." diff --git a/toolchain/bootstrap/format_python.sh b/toolchain/bootstrap/format_python.sh new file mode 100644 index 0000000000..c00213394e --- /dev/null +++ b/toolchain/bootstrap/format_python.sh @@ -0,0 +1,8 @@ +#!/bin/bash + +. toolchain/util.sh + +echo "> $1" + +black -l 200 -x "$1" &>/dev/null 2>&1 + diff --git a/toolchain/bootstrap/lint.sh b/toolchain/bootstrap/lint.sh index f8fc4f2494..20247713ea 100644 --- a/toolchain/bootstrap/lint.sh +++ b/toolchain/bootstrap/lint.sh @@ -1,7 +1,13 @@ #!/bin/bash +set -e +set -o pipefail log "(venv) Running$MAGENTA pylint$COLOR_RESET on$MAGENTA MFC$COLOR_RESET's $MAGENTA""toolchain$COLOR_RESET." pylint -d R1722,W0718,C0301,C0116,C0115,C0114,C0410,W0622,W0640,C0103,W1309,C0411,W1514,R0401,W0511,C0321,C3001 "$(pwd)/toolchain/" +log "(venv) Running$MAGENTA pylint$COLOR_RESET on$MAGENTA MFC$COLOR_RESET's $MAGENTA""examples$COLOR_RESET." + +pylint -d C0103,C0114,C0301,R0801,C0410,W0611,W1514,E0401,C0115,C0116,C0200,W1309,W0401,E0602,R1720,W0614,E1101 $(pwd)/examples/*/case.py + exit $? diff --git a/toolchain/pyproject.toml b/toolchain/pyproject.toml index a78ad7c3e3..0ede6a15c4 100644 --- a/toolchain/pyproject.toml +++ b/toolchain/pyproject.toml @@ -25,6 +25,7 @@ dependencies = [ "typos", "pylint", "fprettify", + "black", # Profiling "numpy",