Commit 277351c8 authored by Henry's avatar Henry
Browse files

TurbulenceModels: ensure alphat is corrected after nut by arranging the call from correctNut

This is as temporary fix pending the completion of the selectable thermal transport layer
parent 823b5622
......@@ -28,7 +28,7 @@ License
// * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * //
template<class BasicTurbulenceModel>
void Foam::eddyDiffusivity<BasicTurbulenceModel>::correctAlphat()
void Foam::eddyDiffusivity<BasicTurbulenceModel>::correctNut()
{
alphat_ = this->rho_*this->nut()/Prt_;
alphat_.correctBoundaryConditions();
......@@ -135,12 +135,4 @@ bool Foam::eddyDiffusivity<BasicTurbulenceModel>::read()
}
template<class BasicTurbulenceModel>
void Foam::eddyDiffusivity<BasicTurbulenceModel>::correct()
{
BasicTurbulenceModel::correct();
correctAlphat();
}
// ************************************************************************* //
......@@ -68,7 +68,7 @@ protected:
// Protected Member Functions
virtual void correctAlphat();
virtual void correctNut();
public:
......@@ -157,9 +157,6 @@ public:
{
return this->transport_.alphaEff(alphat(patchi), patchi);
}
//- Correct the turbulent thermal diffusivity for enthalpy
virtual void correct();
};
......
......@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2013-2014 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2013-2015 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
......@@ -61,6 +61,11 @@ protected:
geometricOneField rho_;
//- ***HGW Temporary function to be removed when the run-time selectable
// thermal transport layer is complete
virtual void correctNut()
{}
private:
......
turbulenceModelName -> propertiesName
modelName -> type
* Header
*** Includes
- Remove
#include "RASModel.H"
+ Add
#include "turbulentTransportModel.H"
#include "eddyViscosity.H"
*** Base class
- Change
RASModel -> eddyViscosity<RASModel>
*** Protected data
- Remove
volScalarField nut_;
*** Constructor
+ Add
const geometricOneField& alpha,
const geometricOneField& rho,
.
const surfaceScalarField& alphaRhoPhi,
*** Private member functions
+ Add
// Protected Member Functions
virtual void correctNut();
*** Member functions
- Remove
//- Return the turbulence viscosity
virtual tmp<volScalarField> nut() const
{
return nut_;
}
//- Return the Reynolds stress tensor
virtual tmp<volSymmTensorField> R() const;
//- Return the effective stress tensor including the laminar stress
virtual tmp<volSymmTensorField> devReff() const;
//- Return the source term for the momentum equation
virtual tmp<fvVectorMatrix> divDevReff(volVectorField& U) const;
//- Return the source term for the momentum equation
virtual tmp<fvVectorMatrix> divDevRhoReff
(
const volScalarField& rho,
volVectorField& U
) const;
+ Move to top
//- Read RASProperties dictionary
virtual bool read();
* Source
*** Includes
+ Add
#include "bound.H"
- Remove
#include "backwardsCompatibilityWallFunctions.H"
*** Constructor
+ Add arguments
const geometricOneField& alpha,
const geometricOneField& rho,
.
const surfaceScalarField& alphaRhoPhi,
+ Replace
RASModel(modelName, U, phi, transport, turbulenceModelName),
with
eddyViscosity<RASModel>
(
type,
alpha,
rho,
U,
alphaRhoPhi,
phi,
transport,
propertiesName
),
+ Replace
autoCreate.*mesh_) -> mesh_
NO_READ -> MUST_READ
- Remove
nut_
(
IOobject
(
"nut",
runTime_.timeName(),
mesh_,
IOobject::NO_READ,
IOobject::AUTO_WRITE
),
autoCreateNut("nut", mesh_)
)
+ Replace
nut_ = k_/omega_;
nut_.correctBoundaryConditions();
printCoeffs();
with
if (type == typeName)
{
correctNut();
printCoeffs(type);
}
*** Member functions
+ Move read to top
+ Add after read
void kOmega::correctNut()
{
....
nut_.correctBoundaryConditions();
}
- Remove
//- Return the Reynolds stress tensor
virtual tmp<volSymmTensorField> R() const;
//- Return the effective stress tensor including the laminar stress
virtual tmp<volSymmTensorField> devReff() const;
//- Return the source term for the momentum equation
virtual tmp<fvVectorMatrix> divDevReff(volVectorField& U) const;
//- Return the source term for the momentum equation
virtual tmp<fvVectorMatrix> divDevRhoReff
(
const volScalarField& rho,
volVectorField& U
) const;
*** correct()
- Replace
// Re-calculate viscosity
nut_ = Cmu_*sqr(k_)/epsilon_;
nut_.correctBoundaryConditions();
with
correctNut();
......@@ -39,6 +39,8 @@ void DeardorffDiffStress<BasicTurbulenceModel>::correctNut()
{
this->nut_ = Ck_*sqrt(this->k())*this->delta();
this->nut_.correctBoundaryConditions();
BasicTurbulenceModel::correctNut();
}
......
......@@ -69,6 +69,8 @@ void Smagorinsky<BasicTurbulenceModel>::correctNut()
this->nut_ = Ck_*this->delta()*sqrt(k);
this->nut_.correctBoundaryConditions();
BasicTurbulenceModel::correctNut();
}
......
......@@ -170,6 +170,8 @@ void SpalartAllmarasDES<BasicTurbulenceModel>::correctNut
{
this->nut_ = nuTilda_*fv1;
this->nut_.correctBoundaryConditions();
BasicTurbulenceModel::correctNut();
}
......
......@@ -89,6 +89,8 @@ void WALE<BasicTurbulenceModel>::correctNut()
{
this->nut_ = Ck_*this->delta()*sqrt(this->k(fvc::grad(this->U_)));
this->nut_.correctBoundaryConditions();
BasicTurbulenceModel::correctNut();
}
......
......@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
......@@ -32,6 +32,33 @@ namespace Foam
namespace LESModels
{
// * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * //
template<class BasicTurbulenceModel>
void kEqn<BasicTurbulenceModel>::correctNut()
{
this->nut_ = Ck_*sqrt(k_)*this->delta();
this->nut_.correctBoundaryConditions();
BasicTurbulenceModel::correctNut();
}
template<class BasicTurbulenceModel>
tmp<fvScalarMatrix> kEqn<BasicTurbulenceModel>::kSource() const
{
return tmp<fvScalarMatrix>
(
new fvScalarMatrix
(
k_,
dimVolume*this->rho_.dimensions()*k_.dimensions()
/dimTime
)
);
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
template<class BasicTurbulenceModel>
......@@ -129,29 +156,6 @@ tmp<volScalarField> kEqn<BasicTurbulenceModel>::epsilon() const
}
template<class BasicTurbulenceModel>
void kEqn<BasicTurbulenceModel>::correctNut()
{
this->nut_ = Ck_*sqrt(k_)*this->delta();
this->nut_.correctBoundaryConditions();
}
template<class BasicTurbulenceModel>
tmp<fvScalarMatrix> kEqn<BasicTurbulenceModel>::kSource() const
{
return tmp<fvScalarMatrix>
(
new fvScalarMatrix
(
k_,
dimVolume*this->rho_.dimensions()*k_.dimensions()
/dimTime
)
);
}
template<class BasicTurbulenceModel>
void kEqn<BasicTurbulenceModel>::correct()
{
......
......@@ -39,6 +39,8 @@ void LRR<BasicTurbulenceModel>::correctNut()
{
this->nut_ = this->Cmu_*sqr(k_)/epsilon_;
this->nut_.correctBoundaryConditions();
BasicTurbulenceModel::correctNut();
}
......
......@@ -56,6 +56,8 @@ void LaunderSharmaKE<BasicTurbulenceModel>::correctNut()
{
this->nut_ = Cmu_*fMu()*sqr(k_)/epsilon_;
this->nut_.correctBoundaryConditions();
BasicTurbulenceModel::correctNut();
}
......
......@@ -40,6 +40,8 @@ void RNGkEpsilon<BasicTurbulenceModel>::correctNut()
{
this->nut_ = Cmu_*sqr(k_)/epsilon_;
this->nut_.correctBoundaryConditions();
BasicTurbulenceModel::correctNut();
}
......
......@@ -124,6 +124,8 @@ void SpalartAllmaras<BasicTurbulenceModel>::correctNut
{
this->nut_ = nuTilda_*fv1;
this->nut_.correctBoundaryConditions();
BasicTurbulenceModel::correctNut();
}
......
......@@ -40,6 +40,8 @@ void kEpsilon<BasicTurbulenceModel>::correctNut()
{
this->nut_ = Cmu_*sqr(k_)/epsilon_;
this->nut_.correctBoundaryConditions();
BasicTurbulenceModel::correctNut();
}
......@@ -133,7 +135,7 @@ kEpsilon<BasicTurbulenceModel>::kEpsilon
(
"C3",
this->coeffDict_,
0
-0.33
)
),
sigmak_
......@@ -185,8 +187,8 @@ kEpsilon<BasicTurbulenceModel>::kEpsilon
if (type == typeName)
{
correctNut();
this->printCoeffs(type);
correctNut();
}
}
......
......@@ -106,6 +106,46 @@ tmp<volScalarField> kOmegaSST<BasicTurbulenceModel>::kOmegaSST::F23() const
}
// * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * //
template<class BasicTurbulenceModel>
void kOmegaSST<BasicTurbulenceModel>::correctNut()
{
this->nut_ =
a1_*k_/max(a1_*omega_, F23()*sqrt(2.0)*mag(symm(fvc::grad(this->U_))));
this->nut_.correctBoundaryConditions();
BasicTurbulenceModel::correctNut();
}
template<class BasicTurbulenceModel>
tmp<fvScalarMatrix> kOmegaSST<BasicTurbulenceModel>::kSource() const
{
return tmp<fvScalarMatrix>
(
new fvScalarMatrix
(
k_,
dimVolume*this->rho_.dimensions()*k_.dimensions()/dimTime
)
);
}
template<class BasicTurbulenceModel>
tmp<fvScalarMatrix> kOmegaSST<BasicTurbulenceModel>::omegaSource() const
{
return tmp<fvScalarMatrix>
(
new fvScalarMatrix
(
omega_,
dimVolume*this->rho_.dimensions()*omega_.dimensions()/dimTime
)
);
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
......@@ -335,43 +375,6 @@ bool kOmegaSST<BasicTurbulenceModel>::read()
}
template<class BasicTurbulenceModel>
void kOmegaSST<BasicTurbulenceModel>::correctNut()
{
this->nut_ =
a1_*k_/max(a1_*omega_, F23()*sqrt(2.0)*mag(symm(fvc::grad(this->U_))));
this->nut_.correctBoundaryConditions();
}
template<class BasicTurbulenceModel>
tmp<fvScalarMatrix> kOmegaSST<BasicTurbulenceModel>::kSource() const
{
return tmp<fvScalarMatrix>
(
new fvScalarMatrix
(
k_,
dimVolume*this->rho_.dimensions()*k_.dimensions()/dimTime
)
);
}
template<class BasicTurbulenceModel>
tmp<fvScalarMatrix> kOmegaSST<BasicTurbulenceModel>::omegaSource() const
{
return tmp<fvScalarMatrix>
(
new fvScalarMatrix
(
omega_,
dimVolume*this->rho_.dimensions()*omega_.dimensions()/dimTime
)
);
}
template<class BasicTurbulenceModel>
void kOmegaSST<BasicTurbulenceModel>::correct()
{
......
......@@ -78,6 +78,8 @@ void realizableKE<BasicTurbulenceModel>::correctNut
{
this->nut_ = rCmu(gradU, S2, magS)*sqr(k_)/epsilon_;
this->nut_.correctBoundaryConditions();
BasicTurbulenceModel::correctNut();
}
......
......@@ -25,8 +25,6 @@ License
#include "v2f.H"
#include "bound.H"
#include "fixedValueFvPatchField.H"
#include "zeroGradientFvPatchField.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
......@@ -58,6 +56,8 @@ void v2f<BasicTurbulenceModel>::correctNut()
{
this->nut_ = min(CmuKEps_*sqr(k_)/epsilon_, this->Cmu_*v2_*Ts());
this->nut_.correctBoundaryConditions();
BasicTurbulenceModel::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