Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implementation of Menter's 1-eq gamma transition model #1287

Merged
merged 35 commits into from
Sep 25, 2024
Merged
Show file tree
Hide file tree
Changes from 31 commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
d2fd18c
begin transition model
Mar 13, 2024
a6ebdb5
caluclate dV/dy (Eq. 11) for the press grad
Mar 13, 2024
ec82f3a
correct the min value of gamma: 0.002
Mar 14, 2024
8b85812
positivity in the source terms for airfoil cases
Mar 15, 2024
8394039
added FSTI in TM constant (user input)
Mar 19, 2024
f3fecaa
remove unnecessary transition model TM constatns
Mar 19, 2024
3a676e0
corrected the min value of the gamma: 0.002 -> 0.02
Mar 19, 2024
b355d16
1)Implemented outlet BC for trasition model and 2) remove unnecessary…
Jun 7, 2024
96c6f3e
Generalize computation of dV/dy for moving meshes to use velocity rel…
kevingriffin1 Jul 15, 2024
e3292e7
Converted to the new STK simple_fields workflow in the transition model
Aug 21, 2024
079f34e
added some comments in the implementation
Aug 21, 2024
8777488
removed some comments throughout the codes
Sep 9, 2024
b98083e
adjust formatting
Sep 9, 2024
ac18816
implemented two options for Tu
Sep 9, 2024
164a2a6
formatting
Sep 9, 2024
b240029
add const
Sep 9, 2024
11efb04
add const2
Sep 9, 2024
c4ec892
added const3
Sep 9, 2024
a1f6543
rebase for merge
Sep 24, 2024
00b4496
create unit tests for tke & sdr of the sst-gamma
Sep 17, 2024
c945a69
create unit test for gamma node kernel
Sep 18, 2024
61c1b5d
1) used SSTKernelHex8Mesh class instead of a new calss for the transi…
Sep 19, 2024
a97e7c3
changed the implementation in SDR w/ and w/o the transition model
Sep 20, 2024
66f7807
format for CI test
Sep 20, 2024
144e94d
format for CI test2
Sep 20, 2024
41f708e
format for CI test2
Sep 20, 2024
8e945c5
added reg.test for gpu
Sep 24, 2024
67817a3
Fix for GPU
marchdf Sep 25, 2024
16c2412
documentation of the transition model
Sep 25, 2024
20984c5
documentation2
Sep 25, 2024
f08e57a
updated a gold file of the transition model
Sep 25, 2024
8d0bf47
increased title under line in docs
Sep 25, 2024
a64b2d2
removed some comments
Sep 25, 2024
1ea8d30
clean up some comments
Sep 25, 2024
5f80e08
CI test: formatting
Sep 25, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@

.. _eqn_sst_des:

Laminar-Turbulent Transition Model Formulation
++++++++++++++++++++++++++++++++++++++++++

Check failure on line 859 in docs/sphinx/source/theory/supportedEquationSet.rst

View workflow job for this annotation

GitHub Actions / Docs

WARNING: Title underline too short.
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
Loading