Skip to content
Snippets Groups Projects
Commit c937aac0 authored by Thomas Fetzer's avatar Thomas Fetzer
Browse files

[test][rans] Implement a proper initialization time and nuTilde BCs

parent 6ee7a240
No related branches found
No related tags found
1 merge request!1058Freeflow/oneeq
...@@ -44,7 +44,14 @@ dune_add_test(NAME test_pipe_laufer_komega ...@@ -44,7 +44,14 @@ dune_add_test(NAME test_pipe_laufer_komega
--command "${CMAKE_CURRENT_BINARY_DIR}/test_pipe_laufer_komega test_pipe_laufer_reference.input") --command "${CMAKE_CURRENT_BINARY_DIR}/test_pipe_laufer_komega test_pipe_laufer_reference.input")
target_compile_definitions(test_pipe_laufer_komega PUBLIC "KOMEGA=1") target_compile_definitions(test_pipe_laufer_komega PUBLIC "KOMEGA=1")
add_executable(test_pipe_laufer_oneeq EXCLUDE_FROM_ALL test_pipe_laufer.cc) dune_add_test(NAME test_pipe_laufer_oneeq
SOURCES test_pipe_laufer.cc
CMAKE_GUARD HAVE_UMFPACK
COMMAND ${CMAKE_SOURCE_DIR}/bin/testing/runtest.py
CMD_ARGS --script fuzzy
--files ${CMAKE_SOURCE_DIR}/test/references/pipe_laufer_oneeq.vtu
${CMAKE_CURRENT_BINARY_DIR}/pipe_laufer_reference-00046.vtu
--command "${CMAKE_CURRENT_BINARY_DIR}/test_pipe_laufer_oneeq test_pipe_laufer_reference.input")
target_compile_definitions(test_pipe_laufer_oneeq PUBLIC "ONEEQ=1") target_compile_definitions(test_pipe_laufer_oneeq PUBLIC "ONEEQ=1")
dune_add_test(NAME test_pipe_laufer_zeroeq dune_add_test(NAME test_pipe_laufer_zeroeq
......
...@@ -152,7 +152,11 @@ public: ...@@ -152,7 +152,11 @@ public:
inletTemperature_ = getParam<Scalar>("Problem.InletTemperature", 283.15); inletTemperature_ = getParam<Scalar>("Problem.InletTemperature", 283.15);
wallTemperature_ = getParam<Scalar>("Problem.WallTemperature", 323.15); wallTemperature_ = getParam<Scalar>("Problem.WallTemperature", 323.15);
sandGrainRoughness_ = getParam<Scalar>("Problem.SandGrainRoughness", 0.0); sandGrainRoughness_ = getParam<Scalar>("Problem.SandGrainRoughness", 0.0);
startWithZeroVelocity_ = getParam<bool>("Problem.StartWithZeroVelocity", false); #if ONEEQ
initializationTime_ = getParam<Scalar>("TimeLoop.Initialization", 1.0);
#else
initializationTime_ = getParam<Scalar>("TimeLoop.Initialization", -1.0);
#endif
FluidSystem::init(); FluidSystem::init();
Dumux::TurbulenceProperties<Scalar, dimWorld, true> turbulenceProperties; Dumux::TurbulenceProperties<Scalar, dimWorld, true> turbulenceProperties;
...@@ -162,8 +166,9 @@ public: ...@@ -162,8 +166,9 @@ public:
Scalar density = FluidSystem::density(fluidState, phaseIdx); Scalar density = FluidSystem::density(fluidState, phaseIdx);
Scalar kinematicViscosity = FluidSystem::viscosity(fluidState, phaseIdx) / density; Scalar kinematicViscosity = FluidSystem::viscosity(fluidState, phaseIdx) / density;
Scalar diameter = this->fvGridGeometry().bBoxMax()[1] - this->fvGridGeometry().bBoxMin()[1]; Scalar diameter = this->fvGridGeometry().bBoxMax()[1] - this->fvGridGeometry().bBoxMin()[1];
// ideally the viscosityTilde parameter as inflow for the Spalart-Allmaras model should be zero
viscosityTilde_ = getParam<Scalar>("Problem.InletViscosityTilde", viscosityTilde_ = getParam<Scalar>("Problem.InletViscosityTilde",
turbulenceProperties.viscosityTilde(inletVelocity_, diameter, kinematicViscosity)); 1e-3 * turbulenceProperties.viscosityTilde(inletVelocity_, diameter, kinematicViscosity));
turbulentKineticEnergy_ = getParam<Scalar>("Problem.InletTurbulentKineticEnergy", turbulentKineticEnergy_ = getParam<Scalar>("Problem.InletTurbulentKineticEnergy",
turbulenceProperties.turbulentKineticEnergy(inletVelocity_, diameter, kinematicViscosity)); turbulenceProperties.turbulentKineticEnergy(inletVelocity_, diameter, kinematicViscosity));
#if KOMEGA #if KOMEGA
...@@ -320,9 +325,10 @@ public: ...@@ -320,9 +325,10 @@ public:
{ {
PrimaryVariables values(0.0); PrimaryVariables values(0.0);
values[Indices::pressureIdx] = 1.0e+5; values[Indices::pressureIdx] = 1.0e+5;
values[Indices::velocityXIdx] = inletVelocity_; values[Indices::velocityXIdx] = time() > initializationTime_
if (isOnWall(globalPos) ? inletVelocity_
|| (startWithZeroVelocity_ && time() < eps_)) : time() / initializationTime_ * inletVelocity_;
if (isOnWall(globalPos))
{ {
values[Indices::velocityXIdx] = 0.0; values[Indices::velocityXIdx] = 0.0;
} }
...@@ -384,7 +390,7 @@ private: ...@@ -384,7 +390,7 @@ private:
Scalar inletTemperature_; Scalar inletTemperature_;
Scalar wallTemperature_; Scalar wallTemperature_;
Scalar sandGrainRoughness_; Scalar sandGrainRoughness_;
bool startWithZeroVelocity_; Scalar initializationTime_;
Scalar viscosityTilde_; Scalar viscosityTilde_;
Scalar turbulentKineticEnergy_; Scalar turbulentKineticEnergy_;
Scalar dissipation_; Scalar dissipation_;
......
[TimeLoop] [TimeLoop]
DtInitial = 1e-2 # [s] DtInitial = 1e-2 # [s]
TEnd = 100 # [s] TEnd = 100 # [s]
Initialization = 1.0 # [s]
[Grid] [Grid]
Verbosity = true Verbosity = true
......
This diff is collapsed.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment