Skip to content

Commit 1311211

Browse files
authored
Merge pull request #190 from DrAlienTech/master
2 parents 8aae1f7 + da0ff1c commit 1311211

File tree

3 files changed

+89
-1
lines changed

3 files changed

+89
-1
lines changed

examples/1D_laxshocktube/README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Lax shock tube problem (1D)
2+
3+
Reference: P. D. Lax, Weak solutions of nonlinear hyperbolic equations and their numerical computation, Communications on pure and applied mathematics 7 (1) (1954) 159–193.

examples/1D_laxshocktube/case.py

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

misc/viz.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
print(f" * Reading data files...")
4141

4242
dfs = {}
43-
for f in glob.glob(os.path.join(DIRPATH, 'D', f'{cfg[0]}.*.*.dat')):
43+
for f in glob.glob(os.path.join(DIRPATH, 'D', f'{cfg[0]}.*.*.dat')):
4444
proc, t_step = int(f.split('.')[-3]), int(f.split('.')[-2])
4545

4646
if t_step != dfs:

0 commit comments

Comments
 (0)