Commit 8a845307 authored by sergio's avatar sergio
Browse files

ENH: realizableKE and v2f use laminar nu is functions which don't allow nu < 0.

     If the solver use psiThermo rho = p*psi. If p < 0 then rho < 0 and
     consequently nu < 0. This happens for steady solvers such as rhoSimpleFoam.
     Adding limiters to laminar nu.
parent 40ef1d63
......@@ -284,6 +284,17 @@ void realizableKE<BasicTurbulenceModel>::correct()
// Update epsilon and G at the wall
epsilon_.boundaryField().updateCoeffs();
// SAF: limiting thermo->nu(). If psiThermo is used rho might be < 0
// temporarily when p < 0 then nu < 0 which needs limiting
volScalarField nuLimited
(
max
(
this->nu(),
dimensionedScalar("zero", this->nu()().dimensions(), 0.0)
)
);
// Dissipation equation
tmp<fvScalarMatrix> epsEqn
(
......@@ -294,7 +305,7 @@ void realizableKE<BasicTurbulenceModel>::correct()
C1*alpha*rho*magS*epsilon_
- fvm::Sp
(
C2_*alpha*rho*epsilon_/(k_ + sqrt(this->nu()*epsilon_)),
C2_*alpha*rho*epsilon_/(k_ + sqrt(nuLimited*epsilon_)),
epsilon_
)
+ epsilonSource()
......
......@@ -38,16 +38,47 @@ namespace RASModels
template<class BasicTurbulenceModel>
tmp<volScalarField> v2f<BasicTurbulenceModel>::Ts() const
{
return max(k_/epsilon_, 6.0*sqrt(this->nu()/epsilon_));
// SAF: limiting thermo->nu(). If psiThermo is used rho might be < 0
// temporarily when p < 0 then nu < 0 which needs limiting
return
max
(
k_/epsilon_,
6.0*sqrt
(
max
(
this->nu(),
dimensionedScalar("zero", this->nu()().dimensions(), 0.0)
)
/ epsilon_
)
);
}
template<class BasicTurbulenceModel>
tmp<volScalarField> v2f<BasicTurbulenceModel>::Ls() const
{
// SAF: limiting thermo->nu(). If psiThermo is used rho might be < 0
// temporarily when p < 0 then nu < 0 which needs limiting
return
CL_*max(pow(k_, 1.5)
/epsilon_, Ceta_*pow025(pow3(this->nu())/epsilon_));
CL_
* max
(
pow(k_, 1.5)/epsilon_,
Ceta_*pow025
(
pow3
(
max
(
this->nu(),
dimensionedScalar("zero", this->nu()().dimensions(), 0.0)
)
)/epsilon_
)
);
}
......
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