Skip to content

Commit

Permalink
Add regression test based on 1 rxn, axisymmetric torch case
Browse files Browse the repository at this point in the history
  • Loading branch information
trevilo committed Aug 26, 2024
1 parent 03810cd commit cfa7658
Show file tree
Hide file tree
Showing 7 changed files with 264 additions and 0 deletions.
226 changes: 226 additions & 0 deletions test/inputs/lomach.torch.reacting.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,226 @@
# choice of solver
[solver]
type = cycle-avg-joule-coupled


[cycle-avg-joule-coupled]
max-iters = 10
solve-em-every-n = 50
axisymmetric = True
input-power = 18000.0
initial-input-power = 18000.0
plasma-solver = lomach
fixed-conductivity = False

[loMach]
axisymmetric = true
mesh = ./meshes/torch-flow-refine.msh
ref_levels = 0
order = 3
outputFreq = 10
timingFreq = 1
openSystem = True
flow-solver = tomboulides
thermo-solver = reacting-flow
turb-model = algebraic-rans
algebraic-rans/max-mixing-length = 0.01
algebraic-rans/von-karman = 0.41
algebraic-rans/filter = True
algebraic-rans/filter-order = 1

[loMach/reacting]
eddy-Pr = 100.0
eddy-Sc = 100.0
sub-steps = 10
# linear-solver-verbosity = 1

[loMach/tomboulides]
numerical-integ = false

#[averaging]
#enableContinuation = False
#restartRMS = True
#saveMeanHist = True
#startIter = 2250000
#sampleFreq = 10

[spongeMultiplier]
plane = True
planeNormal = '0 1 0'
planePoint = '0 0.45 0'
planeWidth = 0.01
planeMult = 10.0


[io]
outdirBase = output-torch
enableRestart = True
restartMode = singleFileReadWrite
#restartFromLTE = True

# Set bdfOrder = 1 for restart testing purposes
[time]
enableConstantTimestep = True
dt_fixed = 5e-7
integrator = curlcurl
bdfOrder = 1
maxSolverIteration = 200
solverRelTolerance = 1.0e-12

[boundaryConditions]
numWalls = 4 # 3
numInlets = 1
numOutlets = 1 # 2

# NB: patch = 2 is the axis

[boundaryConditions/wall1]
# Bottom wall
patch = 3
type = viscous_isothermal
temperature = 300.0

[boundaryConditions/wall2]
# Top wall
patch = 7
type = viscous_isothermal
temperature = 300.0

[boundaryConditions/wall3]
# Torch outer wall
patch = 8
type = viscous_isothermal
temperature = 300.0

[boundaryConditions/inlet1]
patch = 4
type = uniform
velocity = '0.0 0.706'
swirl = 24.0
temperature = 300.0

[boundaryConditions/outlet1]
patch = 6
type = uniform
pressure = 0.0

[boundaryConditions/wall4]
patch = 5
type = viscous_isothermal
temperature = 300.0

#[boundaryConditions/outlet2]
#patch = 5
#type = uniform
#pressure = 0.0


###########################################
# PLASMA MODELS
###########################################
[plasma_models]
ambipolar = True
two_temperature = False
gas_model = perfect_mixture
chemistry_model = 'mass_action_law'
transport_model = argon_mixture
argon_ternary/third_order_thermal_conductivity = True

[plasma_models]
radiation_model = net_emission

[plasma_models/radiation_model/net_emission]
coefficient = tabulated
tabulated/filename = ./rad-data/nec_sample.0.h5
tabulated/x_log = False
tabulated/f_log = False
tabulated/order = 1

[atoms]
numAtoms = 2

[atoms/atom1]
name = 'Ar'
mass = 39.948e-3 # [kg/mol]

[atoms/atom2]
name = 'E'
mass = 5.48579908782496e-7 # [kg/mol]

[species]
numSpecies = 3
background_index = 3

[species/species1]
name = 'Ar.+1'
composition = '{Ar : 1, E : -1}'
formation_energy = 1520571.3883 # [J/mol] = 15.7596119 eV # Ionization energy (Not sure what the units should be here)
level_degeneracy = 4
initialMassFraction = 0.0
perfect_mixture/constant_molar_cv = 1.5
perfect_mixture/constant_molar_cp = 2.5

[species/species2]
name = 'E'
composition = '{E : 1}'
formation_energy = 0.0
level_degeneracy = 1
initialMassFraction = 0.0
initialElectronTemperature = 298.15
# if gas_model is perfect_mixture, requires heat capacities from input.
# molar heat capacities in unit of universal gas constant.
perfect_mixture/constant_molar_cv = 1.5
perfect_mixture/constant_molar_cp = 2.5

[species/species3]
name = 'Ar'
composition = '{Ar : 1}'
formation_energy = 0.0
level_degeneracy = 1
initialMassFraction = 1.0
perfect_mixture/constant_molar_cv = 1.5
perfect_mixture/constant_molar_cp = 2.5

[reactions]
number_of_reactions = 2
minimum_chemistry_temperature = 2000.0

[reactions/reaction1]
equation = 'Ar + E => Ar.+1 + 2 E'
reaction_energy = 1520571.3883 # [J/mol]
reactant_stoichiometry = '0 1 1'
product_stoichiometry = '1 2 0'
model = arrhenius
arrhenius/A = 74072.331348 #74072.331348
arrhenius/b = 1.511
arrhenius/E = 1176329.772504 # [J/mol]
detailed_balance = False

[reactions/reaction2]
equation = 'Ar.+1 + 2 E => Ar + E'
reaction_energy = -1520571.3883 # [J/mol]
reactant_stoichiometry = '1 2 0'
product_stoichiometry = '0 1 1'
model = arrhenius
arrhenius/A = 34126.47475259143 #34126.47475259143
arrhenius/b = 0.368
arrhenius/E = -377725.908714
detailed_balance = False

#---------------------------------------
# Controls for EM-only solver
# mesh = ../mesh/torch-em-coarse2.msh
# order = 3 # FE order (polynomial degree)
#---------------------------------------
[em]
mesh = ./meshes/torch-em-NEWCOIL.msh
order = 2 # FE order (polynomial degree)
ref_levels = 0
max_iter = 1000 # max number of iterations
rtol = 1.0e-12 # solver relative tolerance
atol = 1.0e-18 # solver absolute tolerance
top_only = false # run current through top branch only
bot_only = false # run current through bottom branch only
current_amplitude = 4e5 # run 1 of heating # A/m^2 (with reactions
current_frequency = 6e6 # 1/s
permeability = 1.25663706e-6 # m * kg / s^2 / A^2
1 change: 1 addition & 0 deletions test/meshes/.gitattributes
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
*.msh filter=lfs diff=lfs merge=lfs -text
torch-flow-refine.msh filter=lfs diff=lfs merge=lfs -text
torch-em-coarse2.msh filter=lfs diff=lfs merge=lfs -text
torch-em-NEWCOIL.msh filter=lfs diff=lfs merge=lfs -text
3 changes: 3 additions & 0 deletions test/meshes/torch-em-NEWCOIL.msh
Git LFS file not shown
26 changes: 26 additions & 0 deletions test/reactFlow-singleRx.test
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
TEST="singleReaction"
RUNFILE="inputs/input.reactSingleRx.ini"
RUNFILE_STIFF="inputs/input.reactStiffRx.ini"
RUNFILE_TORCH="inputs/lomach.torch.reacting.ini"
EXE="../src/tps"
RESTART="ref_solns/reactSingleRx/restart_output.sol.h5"

Expand All @@ -13,6 +14,10 @@ setup() {

SOLN_FILE_STIFF=restart_output-stiff.sol.h5
REF_FILE_STIFF=ref_solns/reactSingleRx/restart_output-stiff.sol.h5

RESTRT_FILE_TORCH=ref_solns/reactSingleRx/restart_output-torch.sol.IC.h5
SOLN_FILE_TORCH=restart_output-torch.sol.h5
REF_FILE_TORCH=ref_solns/reactSingleRx/restart_output-torch.sol.10.h5
}

@test "[$TEST] check for input file $RUNFILE" {
Expand Down Expand Up @@ -49,3 +54,24 @@ setup() {
h5diff -r --relative=1e-12 $SOLN_FILE_STIFF $REF_FILE_STIFF /species
h5diff -r --relative=1e-12 $SOLN_FILE_STIFF $REF_FILE_STIFF /temperature/temperature
}

@test "[$TEST] check for input file $RUNFILE_TORCH" {
test -s $RUNFILE
rm -rf $SOLN_FILE_TORCH
cp $RESTRT_FILE_TORCH $SOLN_FILE_TORCH
}

@test "[$TEST] run tps with input -> $RUNFILE_TORCH" {
rm -rf output-torch
$EXE --runFile $RUNFILE_TORCH
test -s $SOLN_FILE_TORCH
}

@test "[$TEST] verify tps output with input -> $RUNFILE_TORCH" {
test -s $SOLN_FILE_TORCH
test -s $REF_FILE_TORCH
h5diff -r --relative=1e-12 $SOLN_FILE_TORCH $REF_FILE_TORCH /velocity
h5diff -r --relative=1e-12 $SOLN_FILE_TORCH $REF_FILE_TORCH /swirl
h5diff -r --relative=1e-12 $SOLN_FILE_TORCH $REF_FILE_TORCH /species
h5diff -r --relative=1e-12 $SOLN_FILE_TORCH $REF_FILE_TORCH /temperature/temperature
}
2 changes: 2 additions & 0 deletions test/ref_solns/reactSingleRx/.gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
restart_output-torch.sol.IC.h5 filter=lfs diff=lfs merge=lfs -text
restart_output-torch.sol.10.h5 filter=lfs diff=lfs merge=lfs -text
3 changes: 3 additions & 0 deletions test/ref_solns/reactSingleRx/restart_output-torch.sol.10.h5
Git LFS file not shown
3 changes: 3 additions & 0 deletions test/ref_solns/reactSingleRx/restart_output-torch.sol.IC.h5
Git LFS file not shown

0 comments on commit cfa7658

Please sign in to comment.