Commit 52d83407 authored by Henry Weller's avatar Henry Weller
Browse files

TurbulenceModels: Added validate function

Moved correctNut call from constructors to the new validate function to
avoid problems with construction order and field availability for the
calculation of nut.

To ensure nut is physical and consistent with the turbulence fields the
validate function should be called after the construction of the
turbulence model, fvOptions and any other fields that the calculation of
nut might depend on.
parent 90afa6dd
......@@ -74,7 +74,6 @@ buoyantKEpsilon<BasicTurbulenceModel>::buoyantKEpsilon
{
if (type == typeName)
{
kEpsilon<BasicTurbulenceModel>::correctNut();
this->printCoeffs(type);
}
}
......
......@@ -181,14 +181,6 @@ LamBremhorstKE::LamBremhorstKE
if (type == typeName)
{
printCoeffs(type);
// Correct nut for single-phase solvers only.
// For multiphase solvers the phase construction is not complete
// at this point.
if (isType<geometricOneField>(alpha))
{
correctNut();
}
}
}
......
......@@ -331,14 +331,6 @@ LienCubicKE::LienCubicKE
if (type == typeName)
{
printCoeffs(type);
// Correct nut for single-phase solvers only.
// For multiphase solvers the phase construction is not complete
// at this point.
if (isType<geometricOneField>(alpha))
{
correctNut();
}
}
}
......
......@@ -225,14 +225,6 @@ LienLeschziner::LienLeschziner
if (type == typeName)
{
printCoeffs(type);
// Correct nut for single-phase solvers only.
// For multiphase solvers the phase construction is not complete
// at this point.
if (isType<geometricOneField>(alpha))
{
correctNut();
}
}
}
......
......@@ -223,14 +223,6 @@ ShihQuadraticKE::ShihQuadraticKE
if (type == typeName)
{
printCoeffs(type);
// Correct nut for single-phase solvers only.
// For multiphase solvers the phase construction is not complete
// at this point.
if (isType<geometricOneField>(alpha))
{
correctNut();
}
}
}
......
......@@ -593,6 +593,10 @@ bool kkLOmega::read()
}
void kkLOmega::validate()
{}
void kkLOmega::correct()
{
eddyViscosity<incompressible::RASModel>::correct();
......
......@@ -301,6 +301,10 @@ public:
return epsilon_;
}
//- Validate the turbulence fields after construction
// Update turbulence viscosity and other derived fields as requires
virtual void validate();
//- Solve the turbulence equations and correct the turbulence viscosity
virtual void correct();
};
......
......@@ -208,14 +208,6 @@ qZeta::qZeta
if (type == typeName)
{
printCoeffs(type);
// Correct nut for single-phase solvers only.
// For multiphase solvers the phase construction is not complete
// at this point.
if (isType<geometricOneField>(alpha))
{
correctNut();
}
}
}
......
......@@ -96,9 +96,6 @@ NicenoKEqn<BasicTurbulenceModel>::NicenoKEqn
{
if (type == typeName)
{
// Cannot correct nut yet: construction of the phases is not complete
// correctNut();
this->printCoeffs(type);
}
}
......
......@@ -73,9 +73,6 @@ SmagorinskyZhang<BasicTurbulenceModel>::SmagorinskyZhang
{
if (type == typeName)
{
// Cannot correct nut yet: construction of the phases is not complete
// correctNut();
this->printCoeffs(type);
}
}
......
......@@ -75,7 +75,6 @@ continuousGasKEqn<BasicTurbulenceModel>::continuousGasKEqn
{
if (type == typeName)
{
kEqn<BasicTurbulenceModel>::correctNut();
this->printCoeffs(type);
}
}
......
......@@ -107,9 +107,6 @@ LaheyKEpsilon<BasicTurbulenceModel>::LaheyKEpsilon
if (type == typeName)
{
this->printCoeffs(type);
// Cannot correct nut yet: construction of the phases is not complete
// correctNut();
}
}
......
......@@ -89,8 +89,6 @@ continuousGasKEpsilon<BasicTurbulenceModel>::continuousGasKEpsilon
{
if (type == typeName)
{
// Cannot correct nut yet: construction of the phases is not complete
// kEpsilon<BasicTurbulenceModel>::correctNut();
this->printCoeffs(type);
}
}
......
......@@ -76,8 +76,6 @@ kOmegaSSTSato<BasicTurbulenceModel>::kOmegaSSTSato
{
if (type == typeName)
{
// Cannot correct nut yet: construction of the phases is not complete
// correctNut();
this->printCoeffs(type);
}
}
......
......@@ -112,14 +112,6 @@ DeardorffDiffStress<BasicTurbulenceModel>::DeardorffDiffStress
{
this->printCoeffs(type);
this->boundNormalStress(this->R_);
// Correct nut for single-phase solvers only.
// For multiphase solvers the phase construction is not complete
// at this point.
if (isType<geometricOneField>(alpha))
{
correctNut();
}
}
}
......
......@@ -114,14 +114,6 @@ Smagorinsky<BasicTurbulenceModel>::Smagorinsky
if (type == typeName)
{
this->printCoeffs(type);
// Correct nut for single-phase solvers only.
// For multiphase solvers the phase construction is not complete
// at this point.
if (isType<geometricOneField>(alpha))
{
correctNut();
}
}
}
......
......@@ -319,14 +319,6 @@ SpalartAllmarasDES<BasicTurbulenceModel>::SpalartAllmarasDES
if (type == typeName)
{
this->printCoeffs(type);
// Correct nut for single-phase solvers only.
// For multiphase solvers the phase construction is not complete
// at this point.
if (isType<geometricOneField>(alpha))
{
correctNut();
}
}
}
......
......@@ -144,14 +144,6 @@ WALE<BasicTurbulenceModel>::WALE
if (type == typeName)
{
this->printCoeffs(type);
// Correct nut for single-phase solvers only.
// For multiphase solvers the phase construction is not complete
// at this point.
if (isType<geometricOneField>(alpha))
{
correctNut();
}
}
}
......
......@@ -186,14 +186,6 @@ dynamicKEqn<BasicTurbulenceModel>::dynamicKEqn
if (type == typeName)
{
this->printCoeffs(type);
// Correct nut for single-phase solvers only.
// For multiphase solvers the phase construction is not complete
// at this point.
if (isType<geometricOneField>(alpha))
{
correctNut();
}
}
}
......
......@@ -123,14 +123,6 @@ dynamicLagrangian<BasicTurbulenceModel>::dynamicLagrangian
if (type == typeName)
{
this->printCoeffs(type);
// Correct nut for single-phase solvers only.
// For multiphase solvers the phase construction is not complete
// at this point.
if (isType<geometricOneField>(alpha))
{
correctNut();
}
}
}
......
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