Skip to content

Commit

Permalink
update 2D RTI case
Browse files Browse the repository at this point in the history
  • Loading branch information
wilfonba committed Jun 1, 2024
1 parent d539d3f commit dbadf7a
Show file tree
Hide file tree
Showing 2 changed files with 111 additions and 9 deletions.
97 changes: 97 additions & 0 deletions examples/2D_dam_break/case.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
#!/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,
'adv_alphan' : 'T',
'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/(6.12E+00-1.E+00),
'fluid_pp(1)%pi_inf' : 6.12E+00*3.43e8/(6.12E+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,
# ==========================================================
}))
# ==============================================================================
23 changes: 14 additions & 9 deletions src/pre_process/include/2dHardcodedIC.fpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
real(kind(0d0)) :: eps
real(kind(0d0)) :: r, rmax, gam, umax, p0

real(kind(0d0)) :: rhoH, rhoL, pRef, pInt, h, lam, wl, amp, intH
real(kind(0d0)) :: rhoH, rhoL, pRef, pInt, h, lam, wl, amp, intH, alph

Check warning on line 6 in src/pre_process/include/2dHardcodedIC.fpp

View workflow job for this annotation

GitHub Actions / Spell Check

"alph" should be "alpha".

eps = 1e-9

Expand Down Expand Up @@ -80,17 +80,22 @@

intH = amp*sin(2*pi*x_cc(i)/lam - pi/2) + h

alph = 5d-1*(1 + tanh((y_cc(j) - intH)/2.5e-3))

Check warning on line 83 in src/pre_process/include/2dHardcodedIC.fpp

View workflow job for this annotation

GitHub Actions / Spell Check

"alph" should be "alpha".

if (alph < eps) alph = eps

Check warning on line 85 in src/pre_process/include/2dHardcodedIC.fpp

View workflow job for this annotation

GitHub Actions / Spell Check

"alph" should be "alpha".

Check warning on line 85 in src/pre_process/include/2dHardcodedIC.fpp

View workflow job for this annotation

GitHub Actions / Spell Check

"alph" should be "alpha".
if (alph > 1-eps) alph = 1-eps

Check warning on line 86 in src/pre_process/include/2dHardcodedIC.fpp

View workflow job for this annotation

GitHub Actions / Spell Check

"alph" should be "alpha".

Check warning on line 86 in src/pre_process/include/2dHardcodedIC.fpp

View workflow job for this annotation

GitHub Actions / Spell Check

"alph" should be "alpha".

if (y_cc(j) > intH) then
q_prim_vf(advxb)%sf(i, j, 0) = 1d0 - eps
q_prim_vf(advxe)%sf(i, j, 0) = eps
q_prim_vf(contxb)%sf(i, j, 0) = (1d0 - eps)*rhoH
q_prim_vf(contxe)%sf(i, j, 0) = eps*rhoL
q_prim_vf(advxb)%sf(i, j, 0) = alph

Check warning on line 89 in src/pre_process/include/2dHardcodedIC.fpp

View workflow job for this annotation

GitHub Actions / Spell Check

"alph" should be "alpha".
q_prim_vf(advxe)%sf(i, j, 0) = 1-alph

Check warning on line 90 in src/pre_process/include/2dHardcodedIC.fpp

View workflow job for this annotation

GitHub Actions / Spell Check

"alph" should be "alpha".
q_prim_vf(contxb)%sf(i, j, 0) = alph*rhoH

Check warning on line 91 in src/pre_process/include/2dHardcodedIC.fpp

View workflow job for this annotation

GitHub Actions / Spell Check

"alph" should be "alpha".
q_prim_vf(contxe)%sf(i, j, 0) = (1-alph)*rhoL

Check warning on line 92 in src/pre_process/include/2dHardcodedIC.fpp

View workflow job for this annotation

GitHub Actions / Spell Check

"alph" should be "alpha".
q_prim_vf(E_idx)%sf(i, j, 0) = pref + rhoH * 9.81 * (1.2 - y_cc(j))
else
q_prim_vf(advxb)%sf(i, j, 0) = eps
q_prim_vf(advxe)%sf(i, j, 0) = 1d0 - eps
q_prim_vf(contxb)%sf(i, j, 0) = eps*rhoH
q_prim_vf(contxe)%sf(i, j, 0) = (1d0 - eps)*rhoL
q_prim_vf(advxb)%sf(i, j, 0) = alph
q_prim_vf(advxe)%sf(i, j, 0) = 1-alph
q_prim_vf(contxb)%sf(i, j, 0) = alph*rhoH
q_prim_vf(contxe)%sf(i, j, 0) = (1-alph)*rhoL
pInt = pref + rhoH * 9.81 * (1.2 - intH)
q_prim_vf(E_idx)%sf(i,j,0) = pInt + rhoL * 9.81 * (intH - y_cc(j))
end if
Expand Down

0 comments on commit dbadf7a

Please sign in to comment.