Skip to content

Commit 53c637d

Browse files
committed
Add CheMFC test cases
1 parent 23df5d6 commit 53c637d

File tree

16 files changed

+663
-35
lines changed

16 files changed

+663
-35
lines changed

examples/1D_inert_shocktube/case.py

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,20 @@
44
# + https://doi.org/10.1016/j.compfluid.2013.10.014: 4.3. Multi-component inert shock tube
55

66
import json
7+
import argparse
8+
79
import cantera as ct
810

11+
parser = argparse.ArgumentParser(
12+
prog="nD_inert_shocktube",
13+
formatter_class=argparse.ArgumentDefaultsHelpFormatter)
14+
15+
parser.add_argument("--mfc", type=str, default='{}', metavar="DICT")
16+
parser.add_argument("--no-chem", dest='chem', default=True, action="store_false",
17+
help="Disable chemistry.")
18+
19+
args = parser.parse_args()
20+
921
ctfile = 'h2o2.yaml'
1022
sol_L = ct.Solution(ctfile)
1123
sol_L.TPX = 400, 8000, 'H2:2,O2:1,AR:7'
@@ -18,7 +30,6 @@
1830
dt = 5e-9
1931
Tend = 40e-6
2032

21-
chemistry = True
2233
NT = int(Tend / dt)
2334
SAVE_COUNT = 200
2435
NS = NT // SAVE_COUNT
@@ -62,7 +73,7 @@
6273
# ==========================================================================
6374

6475
# Chemistry ================================================================
65-
'chemistry' : 'F' if not chemistry else 'T',
76+
'chemistry' : 'F' if not args.chem else 'T',
6677
'chem_params%advection' : 'T',
6778
'chem_params%diffusion' : 'F',
6879
'chem_params%reactions' : 'T',
@@ -104,7 +115,7 @@
104115
# ==========================================================================
105116
}
106117

107-
if chemistry:
118+
if args.chem:
108119
for i in range(len(sol_L.Y)):
109120
case[f'patch_icpp(1)%Y({i+1})'] = sol_L.Y[i]
110121
case[f'patch_icpp(2)%Y({i+1})'] = sol_R.Y[i]

examples/nD_perfect_reactor/analyze.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
import matplotlib.pyplot as plt
55

66
import mfc.viz
7-
from case import dt, NS, Tend, SAVE_COUNT, sol
7+
from case import dt, Tend, SAVE_COUNT, sol
88

99

1010
case = mfc.viz.Case(".", dt)

examples/nD_perfect_reactor/case.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
import cantera as ct
1010

1111
parser = argparse.ArgumentParser(
12-
prog="nD_Reactor",
12+
prog="nD_perfect_reactor",
1313
formatter_class=argparse.ArgumentDefaultsHelpFormatter)
1414

1515
parser.add_argument("--mfc", type=str, default='{}', metavar="DICT")
@@ -28,10 +28,10 @@
2828
Nx = 25 * args.scale
2929
Tend = 1e-4
3030
s = 1e-2
31-
dt = 1e-9
31+
dt = 2e-7
3232

3333
NT = int(Tend / dt)
34-
SAVE_COUNT = 2000
34+
SAVE_COUNT = 100
3535
NS = NT // SAVE_COUNT
3636

3737
case = {

tests/1550B67E/golden-metadata.txt

Lines changed: 117 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

tests/1550B67E/golden.txt

Whitespace-only changes.

tests/5DCF300C/golden-metadata.txt

Lines changed: 117 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)