Merge branch 'feature-turbulence-model-hierarchy' into 'develop'

ENH: Regroup and unify various virtual functions in laminar/RAS/LES models

See merge request Development/openfoam!487
This commit is contained in:
Andrew Heather
2021-10-22 16:29:13 +00:00
36 changed files with 143 additions and 736 deletions

View File

@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2016 OpenFOAM Foundation
Copyright (C) 2019-2020 OpenCFD Ltd.
Copyright (C) 2019-2021 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -168,21 +168,6 @@ public:
return epsilon_;
}
//- Return the (estimated) specific dissipation rate
virtual tmp<volScalarField> omega() const
{
return tmp<volScalarField>::New
(
IOobject
(
IOobject::groupName("omega", this->alphaRhoPhi_.group()),
this->runTime_.timeName(),
this->mesh_
),
epsilon_/(Cmu_*k_)
);
}
//- Solve the turbulence equations and correct the turbulence viscosity
virtual void correct();
};

View File

@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2016 OpenFOAM Foundation
Copyright (C) 2019-2020 OpenCFD Ltd.
Copyright (C) 2019-2021 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -191,21 +191,6 @@ public:
return epsilon_;
}
//- Return the (estimated) specific dissipation rate
virtual tmp<volScalarField> omega() const
{
return tmp<volScalarField>::New
(
IOobject
(
IOobject::groupName("omega", this->alphaRhoPhi_.group()),
this->runTime_.timeName(),
this->mesh_
),
epsilon_/(Cmu_*k_)
);
}
//- Solve the turbulence equations and correct the turbulence viscosity
virtual void correct();
};

View File

@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2015 OpenFOAM Foundation
Copyright (C) 2019-2020 OpenCFD Ltd.
Copyright (C) 2019-2021 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -179,21 +179,6 @@ public:
return epsilon_;
}
//- Return the (estimated) specific dissipation rate
virtual tmp<volScalarField> omega() const
{
return tmp<volScalarField>::New
(
IOobject
(
IOobject::groupName("omega", this->alphaRhoPhi_.group()),
this->runTime_.timeName(),
this->mesh_
),
epsilon_/(Cmu_*k_)
);
}
//- Solve the turbulence equations and correct the turbulence viscosity
virtual void correct();
};

View File

@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2015 OpenFOAM Foundation
Copyright (C) 2019-2020 OpenCFD Ltd.
Copyright (C) 2019-2021 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -166,21 +166,6 @@ public:
return epsilon_;
}
//- Return the (estimated) specific dissipation rate
virtual tmp<volScalarField> omega() const
{
return tmp<volScalarField>::New
(
IOobject
(
IOobject::groupName("omega", this->alphaRhoPhi_.group()),
this->runTime_.timeName(),
this->mesh_
),
epsilon_/(0.09*k_)
);
}
//- Solve the turbulence equations and correct the turbulence viscosity
virtual void correct();
};

View File

@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2015 OpenFOAM Foundation
Copyright (C) 2019-2020 OpenCFD Ltd.
Copyright (C) 2019-2021 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -197,21 +197,6 @@ public:
return epsilon_;
}
//- Return the (estimated) specific dissipation rate
virtual tmp<volScalarField> omega() const
{
return tmp<volScalarField>::New
(
IOobject
(
IOobject::groupName("omega", this->alphaRhoPhi_.group()),
this->runTime_.timeName(),
this->mesh_
),
epsilon_/(Cmu_*k_)
);
}
virtual const volScalarField& q() const
{
return q_;

View File

@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2013-2016 OpenFOAM Foundation
Copyright (C) 2019-2020 OpenCFD Ltd.
Copyright (C) 2019-2021 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -248,21 +248,6 @@ public:
return epsilon_;
}
//- Return the (estimated) specific dissipation rate
virtual tmp<volScalarField> omega() const
{
return tmp<volScalarField>::New
(
IOobject
(
IOobject::groupName("omega", this->alphaRhoPhi_.group()),
this->runTime_.timeName(),
this->mesh_
),
epsilon_/(Cmu_*k_)
);
}
//- Solve the turbulence equations and correct the turbulence viscosity
virtual void correct();
};

View File

@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2016 OpenFOAM Foundation
Copyright (C) 2017-2019 OpenCFD Ltd.
Copyright (C) 2017-2021 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -346,25 +346,6 @@ public:
return k_;
}
//- Return the turbulence kinetic energy dissipation rate
virtual tmp<volScalarField> epsilon() const
{
return tmp<volScalarField>
(
new volScalarField
(
IOobject
(
"epsilon",
this->mesh_.time().timeName(),
this->mesh_
),
betaStar_*k_*omega_,
omega_.boundaryField().types()
)
);
}
//- Return the turbulence kinetic energy dissipation rate
virtual tmp<volScalarField> omega() const
{

View File

@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2017 OpenFOAM Foundation
Copyright (C) 2019-2020 OpenCFD Ltd.
Copyright (C) 2019-2021 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -28,6 +28,7 @@ License
#include "DeardorffDiffStress.H"
#include "fvOptions.H"
#include "calculatedFvPatchField.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -140,48 +141,6 @@ bool DeardorffDiffStress<BasicTurbulenceModel>::read()
}
template<class BasicTurbulenceModel>
tmp<volScalarField> DeardorffDiffStress<BasicTurbulenceModel>::epsilon() const
{
volScalarField k(this->k());
return tmp<volScalarField>
(
new volScalarField
(
IOobject
(
IOobject::groupName("epsilon", this->alphaRhoPhi_.group()),
this->runTime_.timeName(),
this->mesh_,
IOobject::NO_READ,
IOobject::NO_WRITE
),
this->Ce_*k*sqrt(k)/this->delta()
)
);
}
template<class BasicTurbulenceModel>
tmp<volScalarField> DeardorffDiffStress<BasicTurbulenceModel>::omega() const
{
volScalarField k(this->k());
volScalarField epsilon(this->Ce_*k*sqrt(k)/this->delta());
return tmp<volScalarField>::New
(
IOobject
(
IOobject::groupName("omega", this->alphaRhoPhi_.group()),
this->runTime_.timeName(),
this->mesh_
),
epsilon/(0.09*k)
);
}
template<class BasicTurbulenceModel>
void DeardorffDiffStress<BasicTurbulenceModel>::correct()
{

View File

@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2016 OpenFOAM Foundation
Copyright (C) 2019-2020 OpenCFD Ltd.
Copyright (C) 2019-2021 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -150,12 +150,6 @@ public:
//- Read model coefficients if they have changed
virtual bool read();
//- Return the turbulence kinetic energy dissipation rate
virtual tmp<volScalarField> epsilon() const;
//- Return the specific dissipation rate
virtual tmp<volScalarField> omega() const;
//- Correct sub-grid stress, eddy-Viscosity and related properties
virtual void correct();
};

View File

@ -70,6 +70,15 @@ Foam::LESModel<BasicTurbulenceModel>::LESModel
turbulence_(LESDict_.getOrDefault<Switch>("turbulence", true)),
printCoeffs_(LESDict_.getOrDefault<Switch>("printCoeffs", false)),
coeffDict_(LESDict_.optionalSubDict(type + "Coeffs")),
Ce_
(
dimensioned<scalar>::getOrAddToDict
(
"Ce",
LESDict_,
1.048
)
),
kMin_
(
dimensioned<scalar>::getOrAddToDict
@ -188,6 +197,8 @@ bool Foam::LESModel<BasicTurbulenceModel>::read()
delta_().read(LESDict_);
Ce_.readIfPresent(LESDict_);
kMin_.readIfPresent(LESDict_);
return true;
@ -197,6 +208,43 @@ bool Foam::LESModel<BasicTurbulenceModel>::read()
}
template<class BasicTurbulenceModel>
Foam::tmp<Foam::volScalarField>
Foam::LESModel<BasicTurbulenceModel>::epsilon() const
{
return tmp<volScalarField>::New
(
IOobject
(
IOobject::groupName("epsilon", this->alphaRhoPhi_.group()),
this->mesh_.time().timeName(),
this->mesh_
),
this->Ce()*pow(this->k(), 1.5)/this->delta()
);
}
template<class BasicTurbulenceModel>
Foam::tmp<Foam::volScalarField>
Foam::LESModel<BasicTurbulenceModel>::omega() const
{
const scalar betaStar = 0.09;
const dimensionedScalar k0(sqr(dimLength/dimTime), SMALL);
return tmp<volScalarField>::New
(
IOobject
(
IOobject::groupName("omega", this->alphaRhoPhi_.group()),
this->mesh_.time().timeName(),
this->mesh_
),
this->epsilon()/(betaStar*(this->k() + k0))
);
}
template<class BasicTurbulenceModel>
void Foam::LESModel<BasicTurbulenceModel>::correct()
{

View File

@ -6,6 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2013-2017 OpenFOAM Foundation
Copyright (C) 2021 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -60,10 +61,9 @@ class LESModel
:
public BasicTurbulenceModel
{
protected:
// Protected data
// Protected Data
//- LES coefficients dictionary
dictionary LESDict_;
@ -77,6 +77,9 @@ protected:
//- Model coefficients dictionary
dictionary coeffDict_;
//- Empirical model constant
dimensionedScalar Ce_;
//- Lower limit of k
dimensionedScalar kMin_;
@ -182,6 +185,12 @@ public:
return coeffDict_;
}
// Return the empirical model constant
const dimensionedScalar& Ce() const noexcept
{
return Ce_;
}
//- Return the lower allowable limit for k (default: SMALL)
const dimensionedScalar& kMin() const
{
@ -220,6 +229,12 @@ public:
return this->nut(patchi) + this->nu(patchi);
}
//- Return the turbulence kinetic energy dissipation rate
virtual tmp<volScalarField> epsilon() const;
//- Return the specific dissipation rate
virtual tmp<volScalarField> omega() const;
//- Solve the turbulence equations and correct the turbulence viscosity
virtual void correct();
};

View File

@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2013-2017 OpenFOAM Foundation
Copyright (C) 2016-2020 OpenCFD Ltd.
Copyright (C) 2016-2021 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -27,7 +27,6 @@ License
\*---------------------------------------------------------------------------*/
#include "LESeddyViscosity.H"
#include "zeroGradientFvPatchField.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -61,16 +60,6 @@ LESeddyViscosity<BasicTurbulenceModel>::LESeddyViscosity
phi,
transport,
propertiesName
),
Ce_
(
dimensioned<scalar>::getOrAddToDict
(
"Ce",
this->coeffDict_,
1.048
)
)
{}
@ -82,8 +71,6 @@ bool LESeddyViscosity<BasicTurbulenceModel>::read()
{
if (eddyViscosity<LESModel<BasicTurbulenceModel>>::read())
{
Ce_.readIfPresent(this->coeffDict());
return true;
}
@ -91,57 +78,6 @@ bool LESeddyViscosity<BasicTurbulenceModel>::read()
}
template<class BasicTurbulenceModel>
tmp<volScalarField> LESeddyViscosity<BasicTurbulenceModel>::epsilon() const
{
tmp<volScalarField> tk(this->k());
tmp<volScalarField> tepsilon
(
new volScalarField
(
IOobject
(
IOobject::groupName("epsilon", this->alphaRhoPhi_.group()),
this->runTime_.timeName(),
this->mesh_,
IOobject::NO_READ,
IOobject::NO_WRITE
),
Ce_*tk()*sqrt(tk())/this->delta(),
zeroGradientFvPatchField<scalar>::typeName
)
);
volScalarField& epsilon = tepsilon.ref();
epsilon.correctBoundaryConditions();
return tepsilon;
}
template<class BasicTurbulenceModel>
tmp<volScalarField> LESeddyViscosity<BasicTurbulenceModel>::omega() const
{
tmp<volScalarField> tk(this->k());
tmp<volScalarField> tepsilon(this->epsilon());
auto tomega = tmp<volScalarField>::New
(
IOobject
(
IOobject::groupName("omega", this->alphaRhoPhi_.group()),
this->runTime_.timeName(),
this->mesh_
),
tepsilon()/(0.09*tk())
);
auto& omega = tomega.ref();
omega.correctBoundaryConditions();
return tomega;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace LESModels

View File

@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2013-2016 OpenFOAM Foundation
Copyright (C) 2019-2020 OpenCFD Ltd.
Copyright (C) 2019-2021 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -69,13 +69,6 @@ class LESeddyViscosity
void operator=(const LESeddyViscosity&) = delete;
protected:
// Protected data
dimensionedScalar Ce_;
public:
typedef typename BasicTurbulenceModel::alphaField alphaField;
@ -107,12 +100,6 @@ public:
//- Read model coefficients if they have changed
virtual bool read();
//- Return sub-grid dissipation rate
virtual tmp<volScalarField> epsilon() const;
//- Return sub-grid specific dissipation rate
virtual tmp<volScalarField> omega() const;
};

View File

@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2017 OpenFOAM Foundation
Copyright (C) 2019-2020 OpenCFD Ltd.
Copyright (C) 2019-2021 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -139,46 +139,6 @@ bool Smagorinsky<BasicTurbulenceModel>::read()
}
template<class BasicTurbulenceModel>
tmp<volScalarField> Smagorinsky<BasicTurbulenceModel>::epsilon() const
{
volScalarField k(this->k(fvc::grad(this->U_)));
return tmp<volScalarField>
(
new volScalarField
(
IOobject
(
IOobject::groupName("epsilon", this->alphaRhoPhi_.group()),
this->runTime_.timeName(),
this->mesh_
),
this->Ce_*k*sqrt(k)/this->delta()
)
);
}
template<class BasicTurbulenceModel>
tmp<volScalarField> Smagorinsky<BasicTurbulenceModel>::omega() const
{
volScalarField k(this->k(fvc::grad(this->U_)));
volScalarField epsilon(this->Ce_*k*sqrt(k)/this->delta());
return tmp<volScalarField>::New
(
IOobject
(
IOobject::groupName("omega", this->alphaRhoPhi_.group()),
this->runTime_.timeName(),
this->mesh_
),
epsilon/(0.09*k)
);
}
template<class BasicTurbulenceModel>
void Smagorinsky<BasicTurbulenceModel>::correct()
{

View File

@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2016 OpenFOAM Foundation
Copyright (C) 2019-2020 OpenCFD Ltd.
Copyright (C) 2019-2021 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -162,12 +162,6 @@ public:
return k(fvc::grad(this->U_));
}
//- Return sub-grid dissipation rate
virtual tmp<volScalarField> epsilon() const;
//- Return sub-grid specific dissipation rate
virtual tmp<volScalarField> omega() const;
//- Correct Eddy-Viscosity and related properties
virtual void correct();
};

View File

@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2015-2017 OpenFOAM Foundation
Copyright (C) 2019-2020 OpenCFD Ltd.
Copyright (C) 2019-2021 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -170,49 +170,6 @@ bool WALE<BasicTurbulenceModel>::read()
}
template<class BasicTurbulenceModel>
tmp<volScalarField> WALE<BasicTurbulenceModel>::epsilon() const
{
volScalarField k(this->k(fvc::grad(this->U_)));
return tmp<volScalarField>
(
new volScalarField
(
IOobject
(
IOobject::groupName("epsilon", this->alphaRhoPhi_.group()),
this->runTime_.timeName(),
this->mesh_,
IOobject::NO_READ,
IOobject::NO_WRITE
),
this->Ce_*k*sqrt(k)/this->delta()
)
);
}
template<class BasicTurbulenceModel>
tmp<volScalarField> WALE<BasicTurbulenceModel>::omega() const
{
volScalarField k(this->k(fvc::grad(this->U_)));
volScalarField epsilon(this->Ce_*k*sqrt(k)/this->delta());
return tmp<volScalarField>::New
(
IOobject
(
IOobject::groupName("omega", this->alphaRhoPhi_.group()),
this->runTime_.timeName(),
this->mesh_
),
epsilon/(0.09*k)
);
}
template<class BasicTurbulenceModel>
void WALE<BasicTurbulenceModel>::correct()
{

View File

@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2015-2016 OpenFOAM Foundation
Copyright (C) 2019-2020 OpenCFD Ltd.
Copyright (C) 2019-2021 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -154,12 +154,6 @@ public:
return k(fvc::grad(this->U_));
}
//- Return sub-grid dissipation rate
virtual tmp<volScalarField> epsilon() const;
//- Return sub-grid specific dissipation rate
virtual tmp<volScalarField> omega() const;
//- Correct Eddy-Viscosity and related properties
virtual void correct();
};

View File

@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2017 OpenFOAM Foundation
Copyright (C) 2019-2020 OpenCFD Ltd.
Copyright (C) 2019-2021 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -219,45 +219,6 @@ bool dynamicKEqn<BasicTurbulenceModel>::read()
}
template<class BasicTurbulenceModel>
tmp<volScalarField> dynamicKEqn<BasicTurbulenceModel>::epsilon() const
{
return tmp<volScalarField>
(
new volScalarField
(
IOobject
(
IOobject::groupName("epsilon", this->alphaRhoPhi_.group()),
this->runTime_.timeName(),
this->mesh_,
IOobject::NO_READ,
IOobject::NO_WRITE
),
Ce()*k()*sqrt(k())/this->delta()
)
);
}
template<class BasicTurbulenceModel>
tmp<volScalarField> dynamicKEqn<BasicTurbulenceModel>::omega() const
{
volScalarField epsilon(Ce()*k()*sqrt(k())/this->delta());
return tmp<volScalarField>::New
(
IOobject
(
IOobject::groupName("omega", this->alphaRhoPhi_.group()),
this->runTime_.timeName(),
this->mesh_
),
epsilon/(0.09*k())
);
}
template<class BasicTurbulenceModel>
void dynamicKEqn<BasicTurbulenceModel>::correct()
{

View File

@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2016 OpenFOAM Foundation
Copyright (C) 2019-2020 OpenCFD Ltd.
Copyright (C) 2019-2021 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -178,12 +178,6 @@ public:
return k_;
}
//- Return sub-grid dissipation rate
virtual tmp<volScalarField> epsilon() const;
//- Return sub-grid specific dissipation rate
virtual tmp<volScalarField> omega() const;
//- Return the effective diffusivity for k
tmp<volScalarField> DkEff() const
{

View File

@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2017 OpenFOAM Foundation
Copyright (C) 2020 OpenCFD Ltd.
Copyright (C) 2020-2021 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -139,45 +139,6 @@ bool kEqn<BasicTurbulenceModel>::read()
}
template<class BasicTurbulenceModel>
tmp<volScalarField> kEqn<BasicTurbulenceModel>::epsilon() const
{
return tmp<volScalarField>
(
new volScalarField
(
IOobject
(
IOobject::groupName("epsilon", this->alphaRhoPhi_.group()),
this->runTime_.timeName(),
this->mesh_,
IOobject::NO_READ,
IOobject::NO_WRITE
),
this->Ce_*k()*sqrt(k())/this->delta()
)
);
}
template<class BasicTurbulenceModel>
tmp<volScalarField> kEqn<BasicTurbulenceModel>::omega() const
{
volScalarField epsilon(this->Ce_*k()*sqrt(k())/this->delta());
return tmp<volScalarField>::New
(
IOobject
(
IOobject::groupName("omega", this->alphaRhoPhi_.group()),
this->runTime_.timeName(),
this->mesh_
),
epsilon/(0.09*k())
);
}
template<class BasicTurbulenceModel>
void kEqn<BasicTurbulenceModel>::correct()
{

View File

@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2016 OpenFOAM Foundation
Copyright (C) 2019-2020 OpenCFD Ltd.
Copyright (C) 2019-2021 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -148,12 +148,6 @@ public:
return k_;
}
//- Return sub-grid dissipation rate
virtual tmp<volScalarField> epsilon() const;
//- Return sub-grid specific dissipation rate
virtual tmp<volScalarField> omega() const;
//- Return the effective diffusivity for k
tmp<volScalarField> DkEff() const
{

View File

@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2016 OpenFOAM Foundation
Copyright (C) 2019-2020 OpenCFD Ltd.
Copyright (C) 2019-2021 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -199,21 +199,6 @@ public:
return epsilon_;
}
//- Return the (estimated) specific dissipation rate
virtual tmp<volScalarField> omega() const
{
return tmp<volScalarField>::New
(
IOobject
(
IOobject::groupName("omega", this->alphaRhoPhi_.group()),
this->mesh_.time().timeName(),
this->mesh_
),
epsilon_/(Cmu_*k_)
);
}
//- Return the effective diffusivity for R
tmp<volSymmTensorField> DREff() const;

View File

@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2016 OpenFOAM Foundation
Copyright (C) 2019-2020 OpenCFD Ltd.
Copyright (C) 2019-2021 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -202,21 +202,6 @@ public:
return epsilon_;
}
//- Return the (estimated) specific dissipation rate
virtual tmp<volScalarField> omega() const
{
return tmp<volScalarField>::New
(
IOobject
(
IOobject::groupName("omega", this->alphaRhoPhi_.group()),
this->runTime_.timeName(),
this->mesh_
),
epsilon_/(Cmu_*k_)
);
}
//- Solve the turbulence equations and correct the turbulence viscosity
virtual void correct();
};

View File

@ -187,6 +187,44 @@ bool Foam::RASModel<BasicTurbulenceModel>::read()
return false;
}
template<class BasicTurbulenceModel>
Foam::tmp<Foam::volScalarField>
Foam::RASModel<BasicTurbulenceModel>::epsilon() const
{
const scalar Cmu = 0.09;
return tmp<volScalarField>::New
(
IOobject
(
IOobject::groupName("epsilon", this->alphaRhoPhi_.group()),
this->mesh_.time().timeName(),
this->mesh_
),
Cmu*this->k()*this->omega()
);
}
template<class BasicTurbulenceModel>
Foam::tmp<Foam::volScalarField>
Foam::RASModel<BasicTurbulenceModel>::omega() const
{
const scalar betaStar = 0.09;
const dimensionedScalar k0(sqr(dimLength/dimTime), SMALL);
return tmp<volScalarField>::New
(
IOobject
(
IOobject::groupName("omega", this->alphaRhoPhi_.group()),
this->mesh_.time().timeName(),
this->mesh_
),
this->epsilon()/(betaStar*(this->k() + k0))
);
}
template<class BasicTurbulenceModel>
void Foam::RASModel<BasicTurbulenceModel>::correct()

View File

@ -6,6 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2013-2017 OpenFOAM Foundation
Copyright (C) 2021 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -228,6 +229,12 @@ public:
return this->nut(patchi) + this->nu(patchi);
}
//- Return the turbulence kinetic energy dissipation rate
virtual tmp<volScalarField> epsilon() const;
//- Return the specific dissipation rate
virtual tmp<volScalarField> omega() const;
//- Solve the turbulence equations and correct the turbulence viscosity
virtual void correct();
};

View File

@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2016 OpenFOAM Foundation
Copyright (C) 2019-2020 OpenCFD Ltd.
Copyright (C) 2019-2021 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -202,21 +202,6 @@ public:
return epsilon_;
}
//- Return the (estimated) specific dissipation rate
virtual tmp<volScalarField> omega() const
{
return tmp<volScalarField>::New
(
IOobject
(
IOobject::groupName("omega", this->alphaRhoPhi_.group()),
this->runTime_.timeName(),
this->mesh_
),
epsilon_/(Cmu_*k_)
);
}
//- Solve the turbulence equations and correct the turbulence viscosity
virtual void correct();
};

View File

@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2015-2016 OpenFOAM Foundation
Copyright (C) 2019-2020 OpenCFD Ltd.
Copyright (C) 2019-2021 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -190,21 +190,6 @@ public:
return epsilon_;
}
//- Return the (estimated) specific dissipation rate
virtual tmp<volScalarField> omega() const
{
return tmp<volScalarField>::New
(
IOobject
(
IOobject::groupName("omega", this->alphaRhoPhi_.group()),
this->runTime_.timeName(),
this->mesh_
),
epsilon_/(Cmu_*k_)
);
}
//- Return the effective diffusivity for R
tmp<volSymmTensorField> DREff() const;

View File

@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2016 OpenFOAM Foundation
Copyright (C) 2019-2020 OpenCFD Ltd.
Copyright (C) 2019-2021 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -200,21 +200,6 @@ public:
return epsilon_;
}
//- Return the (estimated) specific dissipation rate
virtual tmp<volScalarField> omega() const
{
return tmp<volScalarField>::New
(
IOobject
(
IOobject::groupName("omega", this->alphaRhoPhi_.group()),
this->runTime_.timeName(),
this->mesh_
),
epsilon_/(Cmu_*k_)
);
}
//- Solve the turbulence equations and correct the turbulence viscosity
virtual void correct();
};

View File

@ -5,7 +5,7 @@
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2019-2020 OpenCFD Ltd.
Copyright (C) 2019-2021 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -275,21 +275,6 @@ public:
return epsilon_;
}
//- Return the (estimated) specific dissipation rate
virtual tmp<volScalarField> omega() const
{
return tmp<volScalarField>::New
(
IOobject
(
IOobject::groupName("omega", this->alphaRhoPhi_.group()),
this->runTime_.timeName(),
this->mesh_
),
epsilon_/(Cmu_*k_)
);
}
//- Return the normalised wall-normal fluctuating velocity scale field
virtual tmp<volScalarField> phit() const
{

View File

@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2016 OpenFOAM Foundation
Copyright (C) 2019 OpenCFD Ltd.
Copyright (C) 2019-2021 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -179,25 +179,6 @@ public:
return omega_;
}
//- Return the turbulence kinetic energy dissipation rate
virtual tmp<volScalarField> epsilon() const
{
return tmp<volScalarField>
(
new volScalarField
(
IOobject
(
"epsilon",
this->mesh_.time().timeName(),
this->mesh_
),
Cmu_*k_*omega_,
omega_.boundaryField().types()
)
);
}
//- Solve the turbulence equations and correct the turbulence viscosity
virtual void correct();
};

View File

@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2017 OpenFOAM Foundation
Copyright (C) 2019-2020 OpenCFD Ltd.
Copyright (C) 2019-2021 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -198,21 +198,6 @@ public:
return epsilon_;
}
//- Return the (estimated) specific dissipation rate
virtual tmp<volScalarField> omega() const
{
return tmp<volScalarField>::New
(
IOobject
(
IOobject::groupName("omega", this->alphaRhoPhi_.group()),
this->runTime_.timeName(),
this->mesh_
),
epsilon_/(0.09*k_)
);
}
//- Solve the turbulence equations and correct the turbulence viscosity
virtual void correct();
};

View File

@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2013-2017 OpenFOAM Foundation
Copyright (C) 2020 OpenCFD Ltd.
Copyright (C) 2020-2021 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -145,90 +145,6 @@ Stokes<BasicTurbulenceModel>::nuEff
}
template<class BasicTurbulenceModel>
tmp<volScalarField>
Stokes<BasicTurbulenceModel>::k() const
{
return tmp<volScalarField>::New
(
IOobject
(
IOobject::groupName("k", this->alphaRhoPhi_.group()),
this->runTime_.timeName(),
this->mesh_,
IOobject::NO_READ,
IOobject::NO_WRITE,
false
),
this->mesh_,
dimensionedScalar(sqr(this->U_.dimensions()), Zero)
);
}
template<class BasicTurbulenceModel>
tmp<volScalarField>
Stokes<BasicTurbulenceModel>::epsilon() const
{
return tmp<volScalarField>::New
(
IOobject
(
IOobject::groupName("epsilon", this->alphaRhoPhi_.group()),
this->runTime_.timeName(),
this->mesh_,
IOobject::NO_READ,
IOobject::NO_WRITE,
false
),
this->mesh_,
dimensionedScalar(sqr(this->U_.dimensions())/dimTime, Zero)
);
}
template<class BasicTurbulenceModel>
tmp<volScalarField>
Stokes<BasicTurbulenceModel>::omega() const
{
return tmp<volScalarField>::New
(
IOobject
(
IOobject::groupName("omega", this->alphaRhoPhi_.group()),
this->runTime_.timeName(),
this->mesh_,
IOobject::NO_READ,
IOobject::NO_WRITE,
false
),
this->mesh_,
dimensionedScalar(dimless/dimTime, Zero)
);
}
template<class BasicTurbulenceModel>
tmp<volSymmTensorField>
Stokes<BasicTurbulenceModel>::R() const
{
return tmp<volSymmTensorField>::New
(
IOobject
(
IOobject::groupName("R", this->alphaRhoPhi_.group()),
this->runTime_.timeName(),
this->mesh_,
IOobject::NO_READ,
IOobject::NO_WRITE,
false
),
this->mesh_,
dimensionedSymmTensor(sqr(this->U_.dimensions()), Zero)
);
}
template<class BasicTurbulenceModel>
void Stokes<BasicTurbulenceModel>::correct()
{

View File

@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2013-2016 OpenFOAM Foundation
Copyright (C) 2019-2020 OpenCFD Ltd.
Copyright (C) 2019-2021 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -126,19 +126,6 @@ public:
//- Return the effective viscosity on patch
virtual tmp<scalarField> nuEff(const label patchi) const;
//- Return the turbulence kinetic energy, i.e. 0 for Stokes flow
virtual tmp<volScalarField> k() const;
//- Return the turbulence kinetic energy dissipation rate,
//- i.e. 0 for Stokes flow
virtual tmp<volScalarField> epsilon() const;
//- Return the specific dissipation rate, i.e. 0 for Stokes flow
virtual tmp<volScalarField> omega() const;
//- Return the Reynolds stress tensor, i.e. 0 for Stokes flow
virtual tmp<volSymmTensorField> R() const;
//- Correct the Stokes viscosity
virtual void correct();
};

View File

@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2018-2020 OpenFOAM Foundation
Copyright (C) 2020 OpenCFD Ltd.
Copyright (C) 2020-2021 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -157,45 +157,6 @@ generalizedNewtonian<BasicMomentumTransportModel>::nuEff
}
template<class BasicMomentumTransportModel>
tmp<volScalarField>
generalizedNewtonian<BasicMomentumTransportModel>::k() const
{
return volScalarField::New
(
IOobject::groupName("k", this->alphaRhoPhi_.group()),
this->mesh_,
dimensionedScalar(sqr(this->U_.dimensions()), Zero)
);
}
template<class BasicMomentumTransportModel>
tmp<volScalarField>
generalizedNewtonian<BasicMomentumTransportModel>::epsilon() const
{
return volScalarField::New
(
IOobject::groupName("epsilon", this->alphaRhoPhi_.group()),
this->mesh_,
dimensionedScalar(sqr(this->U_.dimensions())/dimTime, Zero)
);
}
template<class BasicMomentumTransportModel>
tmp<volSymmTensorField>
generalizedNewtonian<BasicMomentumTransportModel>::R() const
{
return volSymmTensorField::New
(
IOobject::groupName("R", this->alphaRhoPhi_.group()),
this->mesh_,
dimensionedSymmTensor(sqr(this->U_.dimensions()), Zero)
);
}
template<class BasicMomentumTransportModel>
void generalizedNewtonian<BasicMomentumTransportModel>::correct()
{

View File

@ -6,6 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2018-2020 OpenFOAM Foundation
Copyright (C) 2021 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -135,15 +136,6 @@ public:
//- Return the effective viscosity on patch
virtual tmp<scalarField> nuEff(const label patchi) const;
//- Return the turbulence kinetic energy
virtual tmp<volScalarField> k() const;
//- Return the turbulence kinetic energy dissipation rate,
virtual tmp<volScalarField> epsilon() const;
//- Return the Reynolds stress tensor
virtual tmp<volSymmTensorField> R() const;
//- Correct the generalizedNewtonian viscosity
virtual void correct();
};

View File

@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2018 OpenFOAM Foundation
Copyright (C) 2020 OpenCFD Ltd.
Copyright (C) 2020-2021 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -226,21 +226,6 @@ public:
return epsilon_;
}
//- Return the (estimated) specific dissipation rate
virtual tmp<volScalarField> omega() const
{
return tmp<volScalarField>::New
(
IOobject
(
IOobject::groupName("omega", this->alphaRhoPhi_.group()),
this->runTime_.timeName(),
this->mesh_
),
epsilon_/(Cmu_*k_)
);
}
//- Solve the turbulence equations and correct the turbulence viscosity
virtual void correct();
};