Skip to content

Commit

Permalink
added error msg when stabalization requested and not 3d (add support …
Browse files Browse the repository at this point in the history
…later) and added test case
  • Loading branch information
Sigfried Haering committed Jul 24, 2024
1 parent ed1b848 commit 650e116
Show file tree
Hide file tree
Showing 7 changed files with 144 additions and 2 deletions.
6 changes: 6 additions & 0 deletions src/tomboulides.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,12 @@ Tomboulides::Tomboulides(mfem::ParMesh *pmesh, int vorder, int porder, temporalS
tps->getInput("loMach/tomboulides/streamwise-stabilization", sw_stab_, false);
tps->getInput("loMach/tomboulides/Reh_offset", re_offset_, 1.0);
tps->getInput("loMach/tomboulides/Reh_factor", re_factor_, 0.01);

if ((sw_stab_ == true) && (dim_ != 3)) {
if (rank0_) std::cout << " ERROR: streamwise stabalization only implemented for 3D simulations. exiting..." << endl;
assert(false);
exit(1);
}
}

Tomboulides::~Tomboulides() {
Expand Down
2 changes: 2 additions & 0 deletions test/.gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -53,3 +53,5 @@ ref_solns/spongeBox/restart_output.sol.h5 filter=lfs diff=lfs merge=lfs -text
meshes/spongeBox.msh filter=lfs diff=lfs merge=lfs -text
ref_solns/lequere-varmu/restart_output-lequere-varmu.sol.h5 filter=lfs diff=lfs merge=lfs -text
ref_solns/lequere-varmu/reference-lequere-varmu.sol.h5 filter=lfs diff=lfs merge=lfs -text
meshes/channel182p4_25x9p4_THIN.msh filter=lfs diff=lfs merge=lfs -text
ref_solns/stabChan/restart_output.sol.h5 filter=lfs diff=lfs merge=lfs -text
6 changes: 4 additions & 2 deletions test/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ EXTRA_DIST = tap-driver.sh test_tps_splitcomm.py soln_differ inputs meshes lte-
ref_solns/aveLoMach/*.h5 \
ref_solns/reactBinDiff/*.h5 \
ref_solns/reactSingleRx/*.h5 \
ref_solns/stabChan/*.h5 \
vpath.sh die.sh count_gpus.sh sniff_mpirun.sh \
cyl3d.gpu.test cyl3d.mflow.gpu.test wedge.gpu.test \
averaging.gpu.test cyl3d.test cyl3d.gpu.python.test cyl3d.mflow.test cyl3d.dtconst.test \
Expand All @@ -49,7 +50,7 @@ EXTRA_DIST = tap-driver.sh test_tps_splitcomm.py soln_differ inputs meshes lte-
sgsSmag.test sgsSigma.test heatEq.test sponge.test plate.test pipe.mix.test lte2noneq-restart.test \
coupled-3d.interface.test plasma.axisym.test plasma.axisym.lte1d.test \
lomach-flow.test lomach-lequere.test interpInlet.test sgsLoMach.test autoPeriodic.test aveLoMach.test \
reactFlow-binDiff.test reactFlow-singleRx.test
reactFlow-binDiff.test reactFlow-singleRx.test lomach-chan-stab.test

TESTS = vpath.sh
XFAIL_TESTS =
Expand Down Expand Up @@ -117,7 +118,8 @@ TESTS += cyl3d.test \
autoPeriodic.test \
aveLoMach.test \
reactFlow-binDiff.test \
reactFlow-singleRx.test
reactFlow-singleRx.test \
loMach-chan-stab.test

if PYTHON_ENABLED
TESTS += cyl3d.python.test \
Expand Down
96 changes: 96 additions & 0 deletions test/inputs/input.stabChan.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
[solver]
type = loMach

[loMach]
mesh = meshes/channel182p4_25x9p4_THIN.msh
order = 1
nFilter = 0
filterWeight = 1.0
maxIters = 100
outputFreq = 100
fluid = dry_air
refLength = 1.0
equation_system = navier-stokes
enablePressureForcing = True
pressureGrad = '0.00005372 0.0 0.0'
enableGravity = False
gravity = '0.0 0.0 0.0'
openSystem = False
sgsModel = none
flow-solver = tomboulides
thermo-solver = calorically-perfect

[loMach/calperfect]
viscosity-model = sutherland
sutherland/mu0 = 1.68e-5
sutherland/T0 = 273.0
sutherland/S0 = 110.4
numerical-integ = false
Prandtl = 0.72
#ic = channel
hsolve-atol = 1.0e-12
msolve-atol = 1.0e-12
hsolve-rtol = 1.0e-10
msolve-rtol = 1.0e-10
hsolve-maxIters = 2000
msolve-maxIters = 2000
streamwise-stabilization = true
Reh_offset = 1.0
Reh_factor = 0.01

[loMach/tomboulides]
ic = channel
numerical-integ = false
psolve-atol = 1.0e-14
hsolve-atol = 1.0e-12
msolve-atol = 1.0e-12
psolve-rtol = 1.0e-10
hsolve-rtol = 1.0e-10
msolve-rtol = 1.0e-10
psolve-maxIters = 2000
hsolve-maxIters = 2000
msolve-maxIters = 2000
streamwise-stabilization = true
Reh_offset = 1.0
Reh_factor = 0.001

[io]
outdirBase = output
#enableRestart = True
#restartMode = variableP

[time]
integrator = curlcurl
cfl = 0.4
dt_initial = 1.0e-4
dtFactor = 0.01
#dt_fixed = 1.0e-4
bdfOrder = 2

[spongeMultiplier]
uniform = true
uniformMult = 1.0

[initialConditions]
rho = 1.0
rhoU = 1.0
rhoV = 0.0
rhoW = 0.0
temperature = 300.0
pressure = 101325.0

[boundaryConditions/wall1]
patch = 4
type = viscous_isothermal
temperature = 300
velocity = '0.0 0.0 0.0'

[boundaryConditions]
numWalls = 1
numInlets = 0
numOutlets = 0

[periodicity]
enablePeriodic = True
periodicX = True
periodicZ = True
30 changes: 30 additions & 0 deletions test/lomach-chan-stab.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#!./bats
# -*- mode: sh -*-

TEST="stabChan"
RUNFILE="inputs/input.stabChan.ini"
EXE="../src/tps"
RESTART="ref_solns/stabChan/restart_output.sol.h5"

setup() {
SOLN_FILE=restart_output.sol.h5
REF_FILE=ref_solns/stabChan/restart_output.sol.h5
OUT_FILE=output_solns/restart_output_stabChan.sol.h5
}

@test "[$TEST] check for input file $RUNFILE" {
test -s $RUNFILE
}

@test "[$TEST] run tps with input -> $RUNFILE" {
rm -rf output/*
rm -f $SOLN_FILE
$EXE --runFile $RUNFILE
test -s $SOLN_FILE
}

@test "[$TEST] verify tps output with input -> $RUNFILE" {
test -s $SOLN_FILE
test -s $REF_FILE
h5diff -r --relative=1e-10 $SOLN_FILE $REF_FILE /velocity
}
3 changes: 3 additions & 0 deletions test/meshes/channel182p4_25x9p4_THIN.msh
Git LFS file not shown
3 changes: 3 additions & 0 deletions test/ref_solns/stabChan/restart_output.sol.h5
Git LFS file not shown

0 comments on commit 650e116

Please sign in to comment.