Skip to content

Commit ea16db9

Browse files
committed
added example case
1 parent ed207ac commit ea16db9

File tree

5 files changed

+126
-1
lines changed

5 files changed

+126
-1
lines changed

examples/2D_hardcodied_ic/case.py

Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
#!/usr/bin/env python3
2+
3+
import json
4+
5+
eps = 1e-9
6+
7+
# Configuring case dictionary
8+
print(json.dumps({
9+
# Logistics ================================================
10+
'run_time_info' : 'T',
11+
# ==========================================================
12+
13+
# Computational Domain Parameters ==========================
14+
'x_domain%beg' : 0.E+00,
15+
'x_domain%end' : 4.E+00,
16+
'stretch_x' : 'T',
17+
'a_x' : 7,
18+
'x_a' : -2,
19+
'x_b' : 2,
20+
'y_domain%beg' : 0.E+00,
21+
'y_domain%end' : 4.E+00,
22+
'stretch_y' : 'T',
23+
'a_y' : 7,
24+
'y_a' : -2,
25+
'y_b' : 2,
26+
'm' : 199,
27+
'n' : 199,
28+
'p' : 0,
29+
'dt' : 5.E-07,
30+
't_step_start' : 0,
31+
't_step_stop' : 100000,
32+
't_step_save' : 1000,
33+
# ==========================================================
34+
35+
# Simulation Algorithm Parameters ==========================
36+
'num_patches' : 1,
37+
'model_eqns' : 3,
38+
'alt_soundspeed' : 'F',
39+
'num_fluids' : 2,
40+
'adv_alphan' : 'T',
41+
'mpp_lim' : 'T',
42+
'mixture_err' : 'T',
43+
'time_stepper' : 3,
44+
'weno_order' : 5,
45+
'weno_eps' : 1.E-16,
46+
'mapped_weno' : 'T',
47+
'null_weights' : 'F',
48+
'mp_weno' : 'F',
49+
'riemann_solver' : 2,
50+
'wave_speeds' : 1,
51+
'avg_state' : 2,
52+
'bc_x%beg' : -2,
53+
'bc_x%end' : -2,
54+
'bc_y%beg' : -6,
55+
'bc_y%end' : -6,
56+
# ==========================================================
57+
58+
# Formatted Database Files Structure Parameters ============
59+
'format' : 1,
60+
'precision' : 2,
61+
'prim_vars_wrt' :'T',
62+
'parallel_io' :'T',
63+
# ==========================================================
64+
65+
# Patch 1: Base ============================================
66+
'patch_icpp(1)%geometry' : 7,
67+
'patch_icpp(1)%hcid' : 200,
68+
'patch_icpp(1)%x_centroid' : 4.,
69+
'patch_icpp(1)%y_centroid' : 4.,
70+
'patch_icpp(1)%length_x' : 8.,
71+
'patch_icpp(1)%length_y' : 8.,
72+
'patch_icpp(1)%vel(1)' : 0.,
73+
'patch_icpp(1)%vel(2)' : 0.,
74+
'patch_icpp(1)%pres' : 100,
75+
'patch_icpp(1)%alpha_rho(1)' : (1-eps)*1000,
76+
'patch_icpp(1)%alpha_rho(2)' : eps*1,
77+
'patch_icpp(1)%alpha(1)' : 1-eps,
78+
'patch_icpp(1)%alpha(2)' : eps,
79+
# ===========================================================
80+
81+
# Fluids Physical Parameters ===============================
82+
'fluid_pp(1)%gamma' : 1.E+00/(2.35E+00-1.E+00),
83+
'fluid_pp(1)%pi_inf' : 2.35E+00*1.E+09/(2.35E+00-1.E+00),
84+
'fluid_pp(2)%gamma' : 1.E+00/(1.4E+00-1.E+00),
85+
'fluid_pp(2)%pi_inf' : 0.E+00,
86+
# ==========================================================
87+
}))
88+
# ==============================================================================

src/pre_process/include/1dHardcodedIC.fpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
#:def Hardcoded1DVariables()
2+
! Place any declaration of intermediate variables here
3+
4+
5+
#:enddef
6+
17
#:def Hardcoded1D()
28

39
if (patch_icpp(patch_id)%hcid == 100) then

src/pre_process/include/2dHardcodedIC.fpp

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,25 @@
1+
#:def Hardcoded2DVariables()
2+
3+
real(kind(0d0)) :: eps
4+
5+
eps = 1e-9
6+
7+
#:enddef
8+
19
#:def Hardcoded2D()
210

3-
if (patch_icpp(patch_id)%hcid == 200) then
11+
if (patch_icpp(patch_id)%hcid == 200) then ! 2D_hardcoded_ic example case
12+
13+
if (y_cc(j) <= (-x_cc(i)**3 + 1)**(1d0/3d0)) then
14+
! Volume Fractions
15+
q_prim_vf(advxb)%sf(i, j, 0) = eps
16+
q_prim_vf(advxe)%sf(i, j, 0) = 1d0-eps
17+
! Denssities
18+
q_prim_vf(contxb)%sf(i, j, 0) = eps*1000d0
19+
q_prim_vf(contxe)%sf(i, j, 0) = (1d0-eps)*1d0
20+
! Pressure
21+
q_prim_vf(E_idx)%sf(i, j, 0) = 1d0
22+
end if
423

524
end if
625

src/pre_process/include/3dHardcodedIC.fpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
#:def Hardcoded3DVariables()
2+
! Place any declaration of intermediate variables here
3+
4+
5+
#:enddef
6+
17
#:def Hardcoded3D()
28

39
if (patch_icpp(patch_id)%hcid == 300) then

src/pre_process/m_patches.fpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -785,6 +785,8 @@ contains
785785
! Generic loop iterators
786786
integer :: i, j, k
787787
788+
@:Hardcoded1DVariables()
789+
788790
pi_inf = fluid_pp(1)%pi_inf
789791
gamma = fluid_pp(1)%gamma
790792
lit_gamma = (1d0 + gamma)/gamma
@@ -890,6 +892,8 @@ contains
890892
891893
integer :: i, j, k !< generic loop iterators
892894
895+
@:Hardcoded2DVariables()
896+
893897
pi_inf = fluid_pp(1)%pi_inf
894898
gamma = fluid_pp(1)%gamma
895899
lit_gamma = (1d0 + gamma)/gamma
@@ -949,6 +953,8 @@ contains
949953
950954
integer :: i, j, k !< generic loop iterators
951955
956+
@:Hardcoded3DVariables()
957+
952958
pi_inf = fluid_pp(1)%pi_inf
953959
gamma = fluid_pp(1)%gamma
954960
lit_gamma = (1d0 + gamma)/gamma

0 commit comments

Comments
 (0)