From 650e116c81c3e38000f877109c662e5125119658 Mon Sep 17 00:00:00 2001 From: Sigfried Haering Date: Wed, 24 Jul 2024 10:46:25 -0700 Subject: [PATCH] added error msg when stabalization requested and not 3d (add support later) and added test case --- src/tomboulides.cpp | 6 ++ test/.gitattributes | 2 + test/Makefile.am | 6 +- test/inputs/input.stabChan.ini | 96 +++++++++++++++++++ test/lomach-chan-stab.test | 30 ++++++ test/meshes/channel182p4_25x9p4_THIN.msh | 3 + test/ref_solns/stabChan/restart_output.sol.h5 | 3 + 7 files changed, 144 insertions(+), 2 deletions(-) create mode 100644 test/inputs/input.stabChan.ini create mode 100755 test/lomach-chan-stab.test create mode 100755 test/meshes/channel182p4_25x9p4_THIN.msh create mode 100644 test/ref_solns/stabChan/restart_output.sol.h5 diff --git a/src/tomboulides.cpp b/src/tomboulides.cpp index 5a8eb9f8e..3517eca96 100644 --- a/src/tomboulides.cpp +++ b/src/tomboulides.cpp @@ -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() { diff --git a/test/.gitattributes b/test/.gitattributes index 0c1274b58..f943ebe51 100644 --- a/test/.gitattributes +++ b/test/.gitattributes @@ -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 diff --git a/test/Makefile.am b/test/Makefile.am index 9d1314f3d..decc49ce4 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -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 \ @@ -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 = @@ -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 \ diff --git a/test/inputs/input.stabChan.ini b/test/inputs/input.stabChan.ini new file mode 100644 index 000000000..f0f020c28 --- /dev/null +++ b/test/inputs/input.stabChan.ini @@ -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 diff --git a/test/lomach-chan-stab.test b/test/lomach-chan-stab.test new file mode 100755 index 000000000..22580cb18 --- /dev/null +++ b/test/lomach-chan-stab.test @@ -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 +} diff --git a/test/meshes/channel182p4_25x9p4_THIN.msh b/test/meshes/channel182p4_25x9p4_THIN.msh new file mode 100755 index 000000000..ec72d1aa7 --- /dev/null +++ b/test/meshes/channel182p4_25x9p4_THIN.msh @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b8bba9f4101291f8cfce812f02d669bdbe7178b74674a08eb745bb96531cd9bb +size 673400 diff --git a/test/ref_solns/stabChan/restart_output.sol.h5 b/test/ref_solns/stabChan/restart_output.sol.h5 new file mode 100644 index 000000000..c8b8feb37 --- /dev/null +++ b/test/ref_solns/stabChan/restart_output.sol.h5 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2737ebf44db149c10aab0c9ecc049448df6ae6a1e8ff3d77de5b3314408c0ab3 +size 150168