Skip to content

Commit

Permalink
Implementation of Menter's 1-eq gamma transition model (#1287)
Browse files Browse the repository at this point in the history

---------


Co-authored-by: Kevin Griffin <[email protected]>
Co-authored-by: Marc Henry de Frahan <[email protected]>
  • Loading branch information
3 people authored Sep 25, 2024
1 parent e3751ee commit 6155b17
Show file tree
Hide file tree
Showing 27 changed files with 1,679 additions and 110 deletions.
9 changes: 8 additions & 1 deletion docs/sphinx/references/references.bib
Original file line number Diff line number Diff line change
Expand Up @@ -412,4 +412,11 @@ @book{wilcox1998turbulence
volume={2},
year={1998},
publisher={DCW industries La Canada, CA}
}
}

@article{Menter:2015,
Author = {Menter, F. R. and Smirnov, P. E., and Liu, T and Avancha, R.},
Journal = {Flow Turbulence Combust},
Title = {A One-Equation Local Correlation-Based Transition Model},
Year = {2015}
}
35 changes: 35 additions & 0 deletions docs/sphinx/source/theory/supportedEquationSet.rst
Original file line number Diff line number Diff line change
Expand Up @@ -855,6 +855,41 @@ where :math:`\Omega` is the earth's angular velocity and :math:`\lambda` is the

.. _eqn_sst_des:

Laminar-Turbulent Transition Model Formulation
++++++++++++++++++++++++++++++++++++++++++++++
To account for the effects of the laminar-turbulent boundary layer transition,
Menter's one-equation :math:`\gamma` transition model :cite:`Menter:2015` is coupled with the SST model.
The model consists of single transport equation for intermittency

.. math::
\frac{D(\rho \gamma)}{Dt}=P_{\gamma}-D_{\gamma}+\frac{\partial }{\partial x_j}\left[ (\mu + \frac{\mu_t}{\sigma_{\gamma}} )\frac{\partial \gamma}{\partial x_j} \right]
The production term, :math:`P_{\gamma}`, and destruction term, :math:`D_{\gamma}`, are as:

.. math::
P_{\gamma}=F_{length} \rho S \gamma (1-\gamma) F_{onset}, \quad D_{\gamma}=C_{a2} \rho \Omega \gamma F_{turb} (C_{e2}\gamma-1)
The model constants are:

.. math::
F_{length}=100, \quad c_{e2}=50, \quad c_{a2}=0.06, \quad \sigma_{\gamma}=1.0
The transition onset criteria of the model are defined as:

.. math::
F_{onset1}=\frac{Re_{v}}{2.2Re_{\theta c}}, \quad F_{onset2}=(F_{onset1},2.0 )
.. math::
F_{onset3}=\max \left(1- \left (\frac{R_{T}}{3.5}\right)^3,0 \right ), \quad F_{onset}=\max(F_{onset2}-F_{onset3},0)
.. math::
F_{turb}=e^{-\left ( \frac{R_{T}}{2} \right )^{4}}, \quad R_T=\frac{\rho k}{\mu \omega}, \quad Re_v=\frac{\rho d_{w}^2S}{\mu}
The transition onset occurs once the scaled vorticity Reynolds number, :math:`Re_{v}/2.2`, exceeds the critical momentum thickness Reynolds number, :math:`Re_{\theta c}`, from the empirical correlations.

The output intermittency from the transition model is applied to both the production and destruction terms of the turbulent kinetic energy
transport equation.

Detached Eddy Simulation (DES) Formulation
++++++++++++++++++++++++++++++++++++++++++

Expand Down
14 changes: 3 additions & 11 deletions include/Enums.h
Original file line number Diff line number Diff line change
Expand Up @@ -245,12 +245,8 @@ enum TurbulenceModelConstant {
TM_sdrAmb = 63,
TM_avgTimeCoeff = 64,
TM_alphaInf = 65,
TM_caOne = 66,
TM_caTwo = 67,
TM_ceOne = 68,
TM_ceTwo = 69,
TM_c0t = 70,
TM_END = 71
TM_fsti = 66,
TM_END = 67
};

static const std::string TurbulenceModelConstantNames[] = {
Expand Down Expand Up @@ -320,11 +316,7 @@ static const std::string TurbulenceModelConstantNames[] = {
"sdr_amb",
"avgTimeCoeff",
"alphaInf",
"caOne",
"caTwo",
"ceOne",
"ceTwo",
"c0t",
"fsti",
"END"};

enum ActuatorType {
Expand Down
5 changes: 5 additions & 0 deletions include/GammaEquationSystem.h
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,15 @@ class GammaEquationSystem : public EquationSystem
VectorFieldType* dgamdx_;
ScalarFieldType* gamTmp_;
ScalarFieldType* minDistanceToWall_;
VectorFieldType* dwalldistdx_;
ScalarFieldType* nDotV_;
VectorFieldType* dnDotVdx_;
ScalarFieldType* visc_;
ScalarFieldType* tvisc_;
ScalarFieldType* evisc_;
ScalarNodalGradAlgDriver nodalGradAlgDriver_;
ScalarNodalGradAlgDriver wallDistGradAlgDriver_;
ScalarNodalGradAlgDriver nDotVGradAlgDriver_;

std::unique_ptr<Algorithm> effDiffFluxAlg_;
};
Expand Down
6 changes: 0 additions & 6 deletions include/NaluParsedTypes.h
Original file line number Diff line number Diff line change
Expand Up @@ -63,12 +63,6 @@ struct GammaInf
GammaInf() : gamma_(1.0) {}
};

struct GammaOpen
{
double gamma_;
GammaOpen() : gamma_(1.0) {}
};

struct Temperature
{
double temperature_;
Expand Down
2 changes: 1 addition & 1 deletion include/NaluParsing.h
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ struct OpenUserData : public UserData
MixtureFraction mixFrac_;
VolumeOfFluid volumeOfFluid_;
MassFraction massFraction_;
GammaOpen gamma_;
GammaInf gamma_;

bool uSpec_;
bool pSpec_;
Expand Down
2 changes: 1 addition & 1 deletion include/ShearStressTransportEquationSystem.h
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ class ShearStressTransportEquationSystem : public EquationSystem

const double tkeMinValue_{1.0e-8};
const double sdrMinValue_{1.0e-8};
const double gammaMinValue_{0.0};
const double gammaMinValue_{0.02};
const double gammaMaxValue_{1.0};
};

Expand Down
12 changes: 5 additions & 7 deletions include/node_kernels/BLTGammaM2015NodeKernel.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@ class BLTGammaM2015NodeKernel : public NGPNodeKernel<BLTGammaM2015NodeKernel>
stk::mesh::NgpField<double> visc_;
stk::mesh::NgpField<double> dudx_;
stk::mesh::NgpField<double> minD_;
stk::mesh::NgpField<double> dwalldistdx_;
stk::mesh::NgpField<double> dnDotVdx_;
stk::mesh::NgpField<double> dualNodalVolume_;
stk::mesh::NgpField<double> coordinates_;
stk::mesh::NgpField<double> velocityNp1_;
Expand All @@ -68,16 +70,12 @@ class BLTGammaM2015NodeKernel : public NGPNodeKernel<BLTGammaM2015NodeKernel>
unsigned viscID_{stk::mesh::InvalidOrdinal};
unsigned dudxID_{stk::mesh::InvalidOrdinal};
unsigned minDID_{stk::mesh::InvalidOrdinal};
unsigned dwalldistdxID_{stk::mesh::InvalidOrdinal};
unsigned dnDotVdxID_{stk::mesh::InvalidOrdinal};
unsigned dualNodalVolumeID_{stk::mesh::InvalidOrdinal};
unsigned gamintID_{stk::mesh::InvalidOrdinal};

NodeKernelTraits::DblType caOne_;
NodeKernelTraits::DblType caTwo_;
NodeKernelTraits::DblType ceOne_;
NodeKernelTraits::DblType ceTwo_;

int timeStepCount;
int maxStepCount;
NodeKernelTraits::DblType fsti_;

const int nDim_;
};
Expand Down
84 changes: 84 additions & 0 deletions include/node_kernels/SDRSSTBLTM2015NodeKernel.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
// Copyright 2017 National Technology & Engineering Solutions of Sandia, LLC
// (NTESS), National Renewable Energy Laboratory, University of Texas Austin,
// Northwest Research Associates. Under the terms of Contract DE-NA0003525
// with NTESS, the U.S. Government retains certain rights in this software.
//
// This software is released under the BSD 3-clause license. See LICENSE file
// for more details.
//

#ifndef SDRSSTBLTM2015NODEKERNEL_H
#define SDRSSTBLTM2015NODEKERNEL_H

#include "node_kernels/NodeKernel.h"
#include "FieldTypeDef.h"

#include "stk_mesh/base/BulkData.hpp"
#include "stk_mesh/base/Ngp.hpp"
#include "stk_mesh/base/NgpField.hpp"
#include "stk_mesh/base/Types.hpp"

namespace sierra {
namespace nalu {

class Realm;

class SDRSSTBLTM2015NodeKernel : public NGPNodeKernel<SDRSSTBLTM2015NodeKernel>
{
public:
SDRSSTBLTM2015NodeKernel(const stk::mesh::MetaData&);

SDRSSTBLTM2015NodeKernel() = delete;

KOKKOS_DEFAULTED_FUNCTION
virtual ~SDRSSTBLTM2015NodeKernel() = default;

virtual void setup(Realm&) override;

KOKKOS_FUNCTION
virtual void execute(
NodeKernelTraits::LhsType&,
NodeKernelTraits::RhsType&,
const stk::mesh::FastMeshIndex&) override;

private:
stk::mesh::NgpField<double> tke_;
stk::mesh::NgpField<double> sdr_;
stk::mesh::NgpField<double> density_;
stk::mesh::NgpField<double> tvisc_;
stk::mesh::NgpField<double> dudx_;
stk::mesh::NgpField<double> dkdx_;
stk::mesh::NgpField<double> dwdx_;
stk::mesh::NgpField<double> dualNodalVolume_;
stk::mesh::NgpField<double> fOneBlend_;

unsigned tkeID_{stk::mesh::InvalidOrdinal};
unsigned sdrID_{stk::mesh::InvalidOrdinal};
unsigned densityID_{stk::mesh::InvalidOrdinal};
unsigned tviscID_{stk::mesh::InvalidOrdinal};
unsigned dudxID_{stk::mesh::InvalidOrdinal};
unsigned dkdxID_{stk::mesh::InvalidOrdinal};
unsigned dwdxID_{stk::mesh::InvalidOrdinal};
unsigned dualNodalVolumeID_{stk::mesh::InvalidOrdinal};
unsigned fOneBlendID_{stk::mesh::InvalidOrdinal};

NodeKernelTraits::DblType betaStar_;
NodeKernelTraits::DblType tkeProdLimitRatio_;
NodeKernelTraits::DblType sigmaWTwo_;
NodeKernelTraits::DblType betaOne_;
NodeKernelTraits::DblType betaTwo_;
NodeKernelTraits::DblType gammaOne_;
NodeKernelTraits::DblType gammaTwo_;
NodeKernelTraits::DblType sdrAmb_;

const int nDim_;

bool lengthScaleLimiter_;
NodeKernelTraits::DblType corfac_;
NodeKernelTraits::DblType referenceVelocity_;
};

} // namespace nalu
} // namespace sierra

#endif /* SDRSSTBLTM2015NODEKERNEL_H */
75 changes: 75 additions & 0 deletions include/node_kernels/TKESSTBLTM2015NodeKernel.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
// Copyright 2017 National Technology & Engineering Solutions of Sandia, LLC
// (NTESS), National Renewable Energy Laboratory, University of Texas Austin,
// Northwest Research Associates. Under the terms of Contract DE-NA0003525
// with NTESS, the U.S. Government retains certain rights in this software.
//
// This software is released under the BSD 3-clause license. See LICENSE file
// for more details.
//

#ifndef TKESSTBLTM2015NODEKERNEL_H
#define TKESSTBLTM2015NODEKERNEL_H

#include "node_kernels/NodeKernel.h"
#include "FieldTypeDef.h"
#include "stk_mesh/base/BulkData.hpp"
#include "stk_mesh/base/Ngp.hpp"
#include "stk_mesh/base/NgpField.hpp"
#include "stk_mesh/base/Types.hpp"

namespace sierra {
namespace nalu {

class Realm;

class TKESSTBLTM2015NodeKernel : public NGPNodeKernel<TKESSTBLTM2015NodeKernel>
{
public:
TKESSTBLTM2015NodeKernel(const stk::mesh::MetaData&);

TKESSTBLTM2015NodeKernel() = delete;

KOKKOS_DEFAULTED_FUNCTION
virtual ~TKESSTBLTM2015NodeKernel() = default;

virtual void setup(Realm&) override;

KOKKOS_FUNCTION
virtual void execute(
NodeKernelTraits::LhsType&,
NodeKernelTraits::RhsType&,
const stk::mesh::FastMeshIndex&) override;

private:
stk::mesh::NgpField<double> tke_;
stk::mesh::NgpField<double> sdr_;
stk::mesh::NgpField<double> gamint_;
stk::mesh::NgpField<double> density_;
stk::mesh::NgpField<double> tvisc_;
stk::mesh::NgpField<double> visc_;
stk::mesh::NgpField<double> dudx_;
stk::mesh::NgpField<double> wallDist_;
stk::mesh::NgpField<double> dualNodalVolume_;

unsigned tkeID_{stk::mesh::InvalidOrdinal};
unsigned sdrID_{stk::mesh::InvalidOrdinal};
unsigned gamintID_{stk::mesh::InvalidOrdinal};
unsigned densityID_{stk::mesh::InvalidOrdinal};
unsigned viscID_{stk::mesh::InvalidOrdinal};
unsigned tviscID_{stk::mesh::InvalidOrdinal};
unsigned dudxID_{stk::mesh::InvalidOrdinal};
unsigned wallDistID_{stk::mesh::InvalidOrdinal};
unsigned dualNodalVolumeID_{stk::mesh::InvalidOrdinal};

NodeKernelTraits::DblType betaStar_;
NodeKernelTraits::DblType tkeProdLimitRatio_;
NodeKernelTraits::DblType tkeAmb_;
NodeKernelTraits::DblType sdrAmb_;

const int nDim_;
};

} // namespace nalu
} // namespace sierra

#endif /* TKESSTBLTM2015NODEKERNEL_H */
2 changes: 2 additions & 0 deletions reg_tests/CTestList.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,7 @@ if(NOT ENABLE_CUDA AND NOT ENABLE_ROCM)
add_test_r(airfoilRANSEdgeNGPHypre.rst 2)
add_test_r(fsiTurbineSurrogate 4)
add_test_r(VOFZalDisk 4)
add_test_r(airfoilSST_Gamma_Trans 4)

if (ENABLE_TRILINOS_SOLVERS)
add_test_r(aslNeutralEdgeSST 4)
Expand Down Expand Up @@ -302,6 +303,7 @@ else()
add_test_r(ablNeutralNGPHypreSegregated 2)
add_test_r(multiElemCylinder 2)
add_test_r(VOFZalDisk 2)
add_test_r(airfoilSST_Gamma_Trans 4)
endif()

if (ENABLE_TIOGA AND ENABLE_TRILINOS_SOLVERS)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
9886408.858641421 1 0.0146628
3938.732212071351 2 0.0293255
43.78119071175424 3 0.0439883
26.35564999333952 4 0.058651
18.24183547843733 5 0.0733138
Loading

0 comments on commit 6155b17

Please sign in to comment.