Commit 47139f99 authored by Ned Coltman's avatar Ned Coltman
Browse files

[test][rans][sst] Add a test for the SST Turbulence Model

parent 42345180
......@@ -43,6 +43,18 @@ dumux_add_test(NAME test_ff_rans_lauferpipe_lowrekepsilon
-Problem.Name test_ff_rans_lauferpipe_lowrekepsilon
-RANS.IsFlatWallBounded True")
dumux_add_test(NAME test_ff_rans_lauferpipe_sst
SOURCES main.cc
COMPILE_DEFINITIONS TYPETAG=PipeLauferKOmegaSST
LABELS freeflow rans
CMAKE_GUARD HAVE_UMFPACK
COMMAND ${CMAKE_SOURCE_DIR}/bin/testing/runtest.py
CMD_ARGS --script fuzzy
--files ${CMAKE_SOURCE_DIR}/test/references/test_ff_rans_lauferpipe_sst-reference.vtu
${CMAKE_CURRENT_BINARY_DIR}/test_ff_rans_lauferpipe_sst-00053.vtu
--command "${CMAKE_CURRENT_BINARY_DIR}/test_ff_rans_lauferpipe_sst params.input
-Problem.Name test_ff_rans_lauferpipe_sst
-RANS.IsFlatWallBounded False")
add_executable(test_ff_rans_lauferpipe_komega EXCLUDE_FROM_ALL main.cc)
target_compile_definitions(test_ff_rans_lauferpipe_komega PUBLIC "TYPETAG=PipeLauferKOmega")
......@@ -142,6 +154,21 @@ dumux_add_test(NAME test_ff_ransni_lauferpipe_lowrekepsilon
-Problem.Name ./test_ff_ransni_lauferpipe_lowrekepsilon")
target_compile_definitions(test_ff_ransni_lauferpipe_lowrekepsilon PUBLIC "NONISOTHERMAL=1")
dumux_add_test(NAME test_ff_ransni_lauferpipe_sst
SOURCES main.cc
COMPILE_DEFINITIONS TYPETAG=PipeLauferNIKOmegaSST
LABELS freeflow rans
CMAKE_GUARD HAVE_UMFPACK
COMMAND ${CMAKE_SOURCE_DIR}/bin/testing/runtest.py
CMD_ARGS --script fuzzy
--files ${CMAKE_SOURCE_DIR}/test/references/test_ff_ransni_lauferpipe_sst-reference.vtu
${CMAKE_CURRENT_BINARY_DIR}/test_ff_ransni_lauferpipe_sst-00034.vtu
--command "${CMAKE_CURRENT_BINARY_DIR}/test_ff_ransni_lauferpipe_sst params_nonisothermal.input
-Problem.Name test_ff_ransni_lauferpipe_sst
-RANS.IsFlatWallBounded False")
target_compile_definitions(test_ff_ransni_lauferpipe_sst PUBLIC "NONISOTHERMAL=1")
dumux_add_test(NAME test_ff_ransni_lauferpipe_komega
SOURCES main.cc
COMPILE_DEFINITIONS TYPETAG=PipeLauferNIKOmega
......
......@@ -18,6 +18,7 @@ EnableGravity = false
[RANS]
EddyViscosityModel = "baldwinLomax"
WallNormalAxis = 1
TurbulenceModel = SST
[KEpsilon]
YPlusThreshold = 10. # should be small (10-30) for coarse grids
......
......@@ -24,6 +24,7 @@ TurbulentPrandtlNumber = 0.85
WallNormalAxis = 1
IsFlatWallBounded = True
WriteFlatWallBoundedFields = True
TurbulenceModel = SST
[Assembly]
NumericDifferenceMethod = 0
......
......@@ -92,7 +92,7 @@ public:
viscosityTilde_ = 1e-3 * turbulenceProperties.viscosityTilde(inletVelocity_, diameter, kinematicViscosity);
turbulentKineticEnergy_ = turbulenceProperties.turbulentKineticEnergy(inletVelocity_, diameter, kinematicViscosity);
if (ModelTraits::turbulenceModel() == TurbulenceModel::komega)
if (ModelTraits::turbulenceModel() == TurbulenceModel::komega || ModelTraits::turbulenceModel() == TurbulenceModel::sst)
dissipation_ = turbulenceProperties.dissipationRate(inletVelocity_, diameter, kinematicViscosity);
else
dissipation_ = turbulenceProperties.dissipation(inletVelocity_, diameter, kinematicViscosity);
......@@ -203,7 +203,8 @@ public:
PrimaryVariables dirichlet([[maybe_unused]] const Element& element, const SubControlVolume& scv) const
{
if constexpr (ModelTraits::turbulenceModel() == TurbulenceModel::kepsilon
|| ModelTraits::turbulenceModel() == TurbulenceModel::komega)
|| ModelTraits::turbulenceModel() == TurbulenceModel::komega
|| ModelTraits::turbulenceModel() == TurbulenceModel::sst)
return dirichletTurbulentTwoEq_(element, scv);
else
{
......@@ -257,7 +258,7 @@ private:
bool isUpperWall_(const GlobalPosition& globalPos) const
{ return globalPos[1] > this->gridGeometry().bBoxMax()[1] - eps_; }
//! Initial conditions for the komega, kepsilon and lowrekepsilon turbulence models
//! Initial conditions for the turbulence models
void setInitialAtPos_([[maybe_unused]] PrimaryVariables& values,
[[maybe_unused]] const GlobalPosition &globalPos) const
{
......@@ -282,7 +283,7 @@ private:
}
}
//! Boundary condition types for the one-eq turbulence model
//! Boundary condition types for the turbulence models
void setBcTypes_([[maybe_unused]] BoundaryTypes& values,
[[maybe_unused]] const GlobalPosition& pos) const
{
......@@ -328,9 +329,10 @@ private:
return pvIdx == Indices::dissipationEqIdx;
return false;
}
else if constexpr (ModelTraits::turbulenceModel() == TurbulenceModel::komega)
else if constexpr (ModelTraits::turbulenceModel() == TurbulenceModel::komega ||
ModelTraits::turbulenceModel() == TurbulenceModel::sst)
{
// For the komega model we set a fixed dissipation (omega) for all cells at the wall
// For the komega and sst models we set a fixed dissipation (omega) for all cells at the wall
for (const auto& scvf : scvfs(fvGeometry))
if (this->boundaryTypes(element, scvf).hasWall() && pvIdx == Indices::dissipationIdx)
return true;
......@@ -340,7 +342,7 @@ private:
return ParentType::isDirichletCell(element, fvGeometry, scv, pvIdx);
}
//! Specialization for the kepsilon and komega
//! Specialization for the kepsilon, sst, and komega models
template<class Element, class SubControlVolume>
PrimaryVariables dirichletTurbulentTwoEq_(const Element& element,
const SubControlVolume& scv) const
......@@ -358,8 +360,9 @@ private:
}
else
{
static_assert(ModelTraits::turbulenceModel() == TurbulenceModel::komega, "Only valid for Komega");
// For the komega model we set a fixed value for the dissipation
static_assert(ModelTraits::turbulenceModel() == TurbulenceModel::komega
|| ModelTraits::turbulenceModel() == TurbulenceModel::sst, "Only valid for Komega");
// For the komega and sst models we set a fixed value for the dissipation
const auto wallDistance = ParentType::wallDistance(elementIdx);
using std::pow;
values[Indices::dissipationEqIdx] = 6.0 * ParentType::kinematicViscosity(elementIdx)
......
......@@ -44,6 +44,8 @@
#include <dumux/freeflow/rans/twoeq/kepsilon/problem.hh>
#include <dumux/freeflow/rans/twoeq/komega/model.hh>
#include <dumux/freeflow/rans/twoeq/komega/problem.hh>
#include <dumux/freeflow/rans/twoeq/sst/model.hh>
#include <dumux/freeflow/rans/twoeq/sst/problem.hh>
#include <dumux/freeflow/rans/twoeq/lowrekepsilon/problem.hh>
#include <dumux/freeflow/rans/twoeq/lowrekepsilon/model.hh>
......@@ -61,12 +63,14 @@ struct PipeLauferOneEq { using InheritsFrom = std::tuple<RANSModel, OneEq>; };
struct PipeLauferKOmega { using InheritsFrom = std::tuple<RANSModel, KOmega>; };
struct PipeLauferLowReKEpsilon { using InheritsFrom = std::tuple<RANSModel, LowReKEpsilon>; };
struct PipeLauferKEpsilon { using InheritsFrom = std::tuple<RANSModel, KEpsilon>; };
struct PipeLauferKOmegaSST { using InheritsFrom = std::tuple<RANSModel, SST>; };
// Non-Isothermal Typetags
struct PipeLauferNIZeroEq { using InheritsFrom = std::tuple<RANSModel, ZeroEqNI>; };
struct PipeLauferNIOneEq { using InheritsFrom = std::tuple<RANSModel, OneEqNI>; };
struct PipeLauferNIKOmega { using InheritsFrom = std::tuple<RANSModel, KOmegaNI>; };
struct PipeLauferNILowReKEpsilon { using InheritsFrom = std::tuple<RANSModel, LowReKEpsilonNI>; };
struct PipeLauferNIKEpsilon { using InheritsFrom = std::tuple<RANSModel, KEpsilonNI>; };
struct PipeLauferNIKOmegaSST { using InheritsFrom = std::tuple<RANSModel, SSTNI>; };
} // end namespace TTag
// the fluid system
......
This diff is collapsed.
This diff is collapsed.
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment