MomentumTransportModels: Added omega() function

Replaces the local definition of the omega function in
functionObjects::turbulenceFields.

Will also be used in interfacial transfers and coupling in multiphase turbulence
modelling where different turbulence models are used in different phases.
This commit is contained in:
Henry Weller
2022-02-15 22:03:12 +00:00
parent 76b50e704d
commit fb4e237292
32 changed files with 303 additions and 117 deletions

View File

@ -279,6 +279,14 @@ Foam::RASModels::kineticTheoryModel::epsilon() const
} }
Foam::tmp<Foam::volScalarField>
Foam::RASModels::kineticTheoryModel::omega() const
{
NotImplemented;
return nut_;
}
Foam::tmp<Foam::volSymmTensorField> Foam::tmp<Foam::volSymmTensorField>
Foam::RASModels::kineticTheoryModel::sigma() const Foam::RASModels::kineticTheoryModel::sigma() const
{ {

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2021 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -203,6 +203,9 @@ public:
//- Return the turbulence kinetic energy dissipation rate //- Return the turbulence kinetic energy dissipation rate
virtual tmp<volScalarField> epsilon() const; virtual tmp<volScalarField> epsilon() const;
//- Return the turbulence specific dissipation rate
virtual tmp<volScalarField> omega() const;
//- Return the stress tensor [m^2/s^2] //- Return the stress tensor [m^2/s^2]
virtual tmp<volSymmTensorField> sigma() const; virtual tmp<volSymmTensorField> sigma() const;

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2013-2021 OpenFOAM Foundation \\ / A nd | Copyright (C) 2013-2022 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -114,6 +114,14 @@ Foam::RASModels::phasePressureModel::epsilon() const
} }
Foam::tmp<Foam::volScalarField>
Foam::RASModels::phasePressureModel::omega() const
{
NotImplemented;
return nut_;
}
Foam::tmp<Foam::volSymmTensorField> Foam::tmp<Foam::volSymmTensorField>
Foam::RASModels::phasePressureModel::sigma() const Foam::RASModels::phasePressureModel::sigma() const
{ {

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2013-2021 OpenFOAM Foundation \\ / A nd | Copyright (C) 2013-2022 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -145,6 +145,9 @@ public:
//- Return the turbulence kinetic energy dissipation rate //- Return the turbulence kinetic energy dissipation rate
virtual tmp<volScalarField> epsilon() const; virtual tmp<volScalarField> epsilon() const;
//- Return the turbulence specific dissipation rate
virtual tmp<volScalarField> omega() const;
//- Return the stress tensor [m^2/s^2] //- Return the stress tensor [m^2/s^2]
virtual tmp<volSymmTensorField> sigma() const; virtual tmp<volSymmTensorField> sigma() const;

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2021 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -161,6 +161,17 @@ public:
return epsilon_; return epsilon_;
} }
//- Return the turbulence specific dissipation rate
virtual tmp<volScalarField> omega() const
{
return volScalarField::New
(
"omega",
epsilon_/(Cmu_*k_),
epsilon_.boundaryField().types()
);
}
//- Solve the turbulence equations and correct the turbulence viscosity //- Solve the turbulence equations and correct the turbulence viscosity
virtual void correct(); virtual void correct();

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2021 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -187,6 +187,17 @@ public:
return epsilon_; return epsilon_;
} }
//- Return the turbulence specific dissipation rate
virtual tmp<volScalarField> omega() const
{
return volScalarField::New
(
"omega",
epsilon_/(Cmu_*k_),
epsilon_.boundaryField().types()
);
}
//- Solve the turbulence equations and correct the turbulence viscosity //- Solve the turbulence equations and correct the turbulence viscosity
virtual void correct(); virtual void correct();
}; };

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2021 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -175,6 +175,17 @@ public:
return epsilon_; return epsilon_;
} }
//- Return the turbulence specific dissipation rate
virtual tmp<volScalarField> omega() const
{
return volScalarField::New
(
"omega",
epsilon_/(Cmu_*k_),
epsilon_.boundaryField().types()
);
}
//- Solve the turbulence equations and correct the turbulence viscosity //- Solve the turbulence equations and correct the turbulence viscosity
virtual void correct(); virtual void correct();
}; };

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2021 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -162,6 +162,17 @@ public:
return epsilon_; return epsilon_;
} }
//- Return the turbulence specific dissipation rate
virtual tmp<volScalarField> omega() const
{
return volScalarField::New
(
"omega",
epsilon_/(0.09*k_),
epsilon_.boundaryField().types()
);
}
//- Solve the turbulence equations and correct the turbulence viscosity //- Solve the turbulence equations and correct the turbulence viscosity
virtual void correct(); virtual void correct();
}; };

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2021 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -193,6 +193,17 @@ public:
return epsilon_; return epsilon_;
} }
//- Return the turbulence specific dissipation rate
virtual tmp<volScalarField> omega() const
{
return volScalarField::New
(
"omega",
epsilon_/(Cmu_*k_),
epsilon_.boundaryField().types()
);
}
virtual const volScalarField& q() const virtual const volScalarField& q() const
{ {
return q_; return q_;

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2021 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -140,7 +140,7 @@ template<class BasicMomentumTransportModel>
tmp<volScalarField> tmp<volScalarField>
DeardorffDiffStress<BasicMomentumTransportModel>::epsilon() const DeardorffDiffStress<BasicMomentumTransportModel>::epsilon() const
{ {
volScalarField k(this->k()); const volScalarField k(this->k());
return volScalarField::New return volScalarField::New
( (
@ -150,6 +150,20 @@ DeardorffDiffStress<BasicMomentumTransportModel>::epsilon() const
} }
template<class BasicMomentumTransportModel>
tmp<volScalarField>
DeardorffDiffStress<BasicMomentumTransportModel>::omega() const
{
const volScalarField k(this->k());
return volScalarField::New
(
IOobject::groupName("omega", this->alphaRhoPhi_.group()),
(this->Ce_/this->Ck_)*sqrt(k)/this->delta()
);
}
template<class BasicMomentumTransportModel> template<class BasicMomentumTransportModel>
void DeardorffDiffStress<BasicMomentumTransportModel>::correct() void DeardorffDiffStress<BasicMomentumTransportModel>::correct()
{ {

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2021 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -140,6 +140,9 @@ public:
//- Return the turbulence kinetic energy dissipation rate //- Return the turbulence kinetic energy dissipation rate
virtual tmp<volScalarField> epsilon() const; virtual tmp<volScalarField> epsilon() const;
//- Return the turbulence specific dissipation rate
virtual tmp<volScalarField> omega() const;
//- Correct sub-grid stress, eddy-Viscosity and related properties //- Correct sub-grid stress, eddy-Viscosity and related properties
virtual void correct(); virtual void correct();

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2013-2021 OpenFOAM Foundation \\ / A nd | Copyright (C) 2013-2022 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -57,6 +57,16 @@ LESeddyViscosity<BasicMomentumTransportModel>::LESeddyViscosity
viscosity viscosity
), ),
Ck_
(
dimensioned<scalar>::lookupOrAddToDict
(
"Ck",
this->coeffDict_,
0.094
)
),
Ce_ Ce_
( (
dimensioned<scalar>::lookupOrAddToDict dimensioned<scalar>::lookupOrAddToDict
@ -76,6 +86,7 @@ bool LESeddyViscosity<BasicMomentumTransportModel>::read()
{ {
if (eddyViscosity<LESModel<BasicMomentumTransportModel>>::read()) if (eddyViscosity<LESModel<BasicMomentumTransportModel>>::read())
{ {
Ck_.readIfPresent(this->coeffDict());
Ce_.readIfPresent(this->coeffDict()); Ce_.readIfPresent(this->coeffDict());
return true; return true;
@ -101,6 +112,20 @@ LESeddyViscosity<BasicMomentumTransportModel>::epsilon() const
} }
template<class BasicMomentumTransportModel>
tmp<volScalarField>
LESeddyViscosity<BasicMomentumTransportModel>::omega() const
{
tmp<volScalarField> tk(this->k());
return volScalarField::New
(
IOobject::groupName("omega", this->alphaRhoPhi_.group()),
(Ce_/Ck_)*sqrt(tk())/this->delta()
);
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace LESModels } // End namespace LESModels

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2013-2021 OpenFOAM Foundation \\ / A nd | Copyright (C) 2013-2022 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -58,6 +58,7 @@ protected:
// Protected data // Protected data
dimensionedScalar Ck_;
dimensionedScalar Ce_; dimensionedScalar Ce_;
@ -98,6 +99,9 @@ public:
//- Return sub-grid disipation rate //- Return sub-grid disipation rate
virtual tmp<volScalarField> epsilon() const; virtual tmp<volScalarField> epsilon() const;
//- Return the turbulence specific dissipation rate
virtual tmp<volScalarField> omega() const;
// Member Operators // Member Operators

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2021 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -46,7 +46,7 @@ tmp<volScalarField> Smagorinsky<BasicMomentumTransportModel>::k
volScalarField a(this->Ce_/this->delta()); volScalarField a(this->Ce_/this->delta());
volScalarField b((2.0/3.0)*tr(D)); volScalarField b((2.0/3.0)*tr(D));
volScalarField c(2*Ck_*this->delta()*(dev(D) && D)); volScalarField c(2*this->Ck_*this->delta()*(dev(D) && D));
return volScalarField::New return volScalarField::New
( (
@ -61,7 +61,7 @@ void Smagorinsky<BasicMomentumTransportModel>::correctNut()
{ {
volScalarField k(this->k(fvc::grad(this->U_))); volScalarField k(this->k(fvc::grad(this->U_)));
this->nut_ = Ck_*this->delta()*sqrt(k); this->nut_ = this->Ck_*this->delta()*sqrt(k);
this->nut_.correctBoundaryConditions(); this->nut_.correctBoundaryConditions();
fvConstraints::New(this->mesh_).constrain(this->nut_); fvConstraints::New(this->mesh_).constrain(this->nut_);
} }
@ -90,16 +90,6 @@ Smagorinsky<BasicMomentumTransportModel>::Smagorinsky
alphaRhoPhi, alphaRhoPhi,
phi, phi,
viscosity viscosity
),
Ck_
(
dimensioned<scalar>::lookupOrAddToDict
(
"Ck",
this->coeffDict_,
0.094
)
) )
{ {
if (type == typeName) if (type == typeName)
@ -114,29 +104,7 @@ Smagorinsky<BasicMomentumTransportModel>::Smagorinsky
template<class BasicMomentumTransportModel> template<class BasicMomentumTransportModel>
bool Smagorinsky<BasicMomentumTransportModel>::read() bool Smagorinsky<BasicMomentumTransportModel>::read()
{ {
if (LESeddyViscosity<BasicMomentumTransportModel>::read()) return LESeddyViscosity<BasicMomentumTransportModel>::read();
{
Ck_.readIfPresent(this->coeffDict());
return true;
}
else
{
return false;
}
}
template<class BasicMomentumTransportModel>
tmp<volScalarField> Smagorinsky<BasicMomentumTransportModel>::epsilon() const
{
volScalarField k(this->k(fvc::grad(this->U_)));
return volScalarField::New
(
IOobject::groupName("epsilon", this->alphaRhoPhi_.group()),
this->Ce_*k*sqrt(k)/this->delta()
);
} }

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2021 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -90,11 +90,6 @@ class Smagorinsky
{ {
protected: protected:
// Protected data
dimensionedScalar Ck_;
// Protected Member Functions // Protected Member Functions
//- Return SGS kinetic energy //- Return SGS kinetic energy
@ -149,9 +144,6 @@ public:
return k(fvc::grad(this->U_)); return k(fvc::grad(this->U_));
} }
//- Return sub-grid disipation rate
virtual tmp<volScalarField> epsilon() const;
//- Correct Eddy-Viscosity and related properties //- Correct Eddy-Viscosity and related properties
virtual void correct(); virtual void correct();

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2021 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -189,6 +189,17 @@ public:
return epsilon_; return epsilon_;
} }
//- Return the turbulence specific dissipation rate
virtual tmp<volScalarField> omega() const
{
return volScalarField::New
(
"omega",
epsilon_/(Cmu_*k_),
epsilon_.boundaryField().types()
);
}
//- Return the effective diffusivity for R //- Return the effective diffusivity for R
tmp<volSymmTensorField> DREff() const; tmp<volSymmTensorField> DREff() const;

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2021 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -183,6 +183,17 @@ public:
return epsilon_; return epsilon_;
} }
//- Return the turbulence specific dissipation rate
virtual tmp<volScalarField> omega() const
{
return volScalarField::New
(
"omega",
epsilon_/(Cmu_*k_),
epsilon_.boundaryField().types()
);
}
//- Solve the turbulence equations and correct the turbulence viscosity //- Solve the turbulence equations and correct the turbulence viscosity
virtual void correct(); virtual void correct();

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2021 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -188,6 +188,17 @@ public:
return epsilon_; return epsilon_;
} }
//- Return the turbulence specific dissipation rate
virtual tmp<volScalarField> omega() const
{
return volScalarField::New
(
"omega",
epsilon_/(Cmu_*k_),
epsilon_.boundaryField().types()
);
}
//- Solve the turbulence equations and correct the turbulence viscosity //- Solve the turbulence equations and correct the turbulence viscosity
virtual void correct(); virtual void correct();

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2015-2021 OpenFOAM Foundation \\ / A nd | Copyright (C) 2015-2022 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -180,6 +180,17 @@ public:
return epsilon_; return epsilon_;
} }
//- Return the turbulence specific dissipation rate
virtual tmp<volScalarField> omega() const
{
return volScalarField::New
(
"omega",
epsilon_/(Cmu_*k_),
epsilon_.boundaryField().types()
);
}
//- Return the effective diffusivity for R //- Return the effective diffusivity for R
tmp<volSymmTensorField> DREff() const; tmp<volSymmTensorField> DREff() const;

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2021 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -344,6 +344,24 @@ SpalartAllmaras<BasicMomentumTransportModel>::epsilon() const
} }
template<class BasicMomentumTransportModel>
tmp<volScalarField>
SpalartAllmaras<BasicMomentumTransportModel>::omega() const
{
WarningInFunction
<< "Turbulence specific dissipation rate not defined for "
<< "Spalart-Allmaras model. Returning zero field"
<< endl;
return volScalarField::New
(
"omega",
this->mesh_,
dimensionedScalar(dimless/dimTime, 0)
);
}
template<class BasicMomentumTransportModel> template<class BasicMomentumTransportModel>
void SpalartAllmaras<BasicMomentumTransportModel>::correct() void SpalartAllmaras<BasicMomentumTransportModel>::correct()
{ {

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2021 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -194,6 +194,9 @@ public:
//- Return the turbulence kinetic energy dissipation rate //- Return the turbulence kinetic energy dissipation rate
virtual tmp<volScalarField> epsilon() const; virtual tmp<volScalarField> epsilon() const;
//- Return the turbulence specific dissipation rate
virtual tmp<volScalarField> omega() const;
//- Solve the turbulence equations and correct the turbulence viscosity //- Solve the turbulence equations and correct the turbulence viscosity
virtual void correct(); virtual void correct();

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2021 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -181,6 +181,17 @@ public:
return epsilon_; return epsilon_;
} }
//- Return the turbulence specific dissipation rate
virtual tmp<volScalarField> omega() const
{
return volScalarField::New
(
"omega",
epsilon_/(Cmu_*k_),
epsilon_.boundaryField().types()
);
}
//- Solve the turbulence equations and correct the turbulence viscosity //- Solve the turbulence equations and correct the turbulence viscosity
virtual void correct(); virtual void correct();

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2021 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -189,6 +189,17 @@ public:
return epsilon_; return epsilon_;
} }
//- Return the turbulence specific dissipation rate
virtual tmp<volScalarField> omega() const
{
return volScalarField::New
(
"omega",
epsilon_/(0.09*k_),
epsilon_.boundaryField().types()
);
}
//- Solve the turbulence equations and correct the turbulence viscosity //- Solve the turbulence equations and correct the turbulence viscosity
virtual void correct(); virtual void correct();
}; };

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2012-2021 OpenFOAM Foundation \\ / A nd | Copyright (C) 2012-2022 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -238,6 +238,17 @@ public:
return epsilon_; return epsilon_;
} }
//- Return the turbulence specific dissipation rate
virtual tmp<volScalarField> omega() const
{
return volScalarField::New
(
"omega",
epsilon_/(Cmu_*k_),
epsilon_.boundaryField().types()
);
}
//- Return turbulence stress normal to streamlines //- Return turbulence stress normal to streamlines
virtual tmp<volScalarField> v2() const virtual tmp<volScalarField> v2() const
{ {

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2016-2021 OpenFOAM Foundation \\ / A nd | Copyright (C) 2016-2022 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -212,7 +212,7 @@ Foam::laminarModel<BasicMomentumTransportModel>::k() const
( (
IOobject::groupName("k", this->alphaRhoPhi_.group()), IOobject::groupName("k", this->alphaRhoPhi_.group()),
this->mesh_, this->mesh_,
dimensionedScalar(sqr(this->U_.dimensions()), 0) dimensionedScalar(sqr(dimVelocity), 0)
); );
} }
@ -225,7 +225,20 @@ Foam::laminarModel<BasicMomentumTransportModel>::epsilon() const
( (
IOobject::groupName("epsilon", this->alphaRhoPhi_.group()), IOobject::groupName("epsilon", this->alphaRhoPhi_.group()),
this->mesh_, this->mesh_,
dimensionedScalar(sqr(this->U_.dimensions())/dimTime, 0) dimensionedScalar(sqr(dimVelocity)/dimTime, 0)
);
}
template<class BasicMomentumTransportModel>
Foam::tmp<Foam::volScalarField>
Foam::laminarModel<BasicMomentumTransportModel>::omega() const
{
return volScalarField::New
(
IOobject::groupName("omega", this->alphaRhoPhi_.group()),
this->mesh_,
dimensionedScalar(dimless/dimTime, 0)
); );
} }

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2016-2021 OpenFOAM Foundation \\ / A nd | Copyright (C) 2016-2022 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -168,6 +168,10 @@ public:
// i.e. 0 for laminar flow // i.e. 0 for laminar flow
virtual tmp<volScalarField> epsilon() const; virtual tmp<volScalarField> epsilon() const;
//- Return the turbulence specific dissipation rate,
// i.e. 0 for laminar flow
virtual tmp<volScalarField> omega() const;
//- Return the stress tensor [m^2/s^2], i.e. 0 for laminar flow //- Return the stress tensor [m^2/s^2], i.e. 0 for laminar flow
virtual tmp<volSymmTensorField> sigma() const; virtual tmp<volSymmTensorField> sigma() const;

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2013-2021 OpenFOAM Foundation \\ / A nd | Copyright (C) 2013-2022 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -206,6 +206,9 @@ public:
//- Return the turbulence kinetic energy dissipation rate //- Return the turbulence kinetic energy dissipation rate
virtual tmp<volScalarField> epsilon() const = 0; virtual tmp<volScalarField> epsilon() const = 0;
//- Return the turbulence specific dissipation rate
virtual tmp<volScalarField> omega() const = 0;
//- Return the stress tensor [m^2/s^2] //- Return the stress tensor [m^2/s^2]
virtual tmp<volSymmTensorField> sigma() const = 0; virtual tmp<volSymmTensorField> sigma() const = 0;

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2013-2021 OpenFOAM Foundation \\ / A nd | Copyright (C) 2013-2022 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -237,6 +237,17 @@ public:
return epsilon_; return epsilon_;
} }
//- Return the turbulence specific dissipation rate
virtual tmp<volScalarField> omega() const
{
return volScalarField::New
(
"omega",
epsilon_/(Cmu_*k_),
epsilon_.boundaryField().types()
);
}
//- Solve the turbulence equations and correct the turbulence viscosity //- Solve the turbulence equations and correct the turbulence viscosity
virtual void correct(); virtual void correct();

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2018-2021 OpenFOAM Foundation \\ / A nd | Copyright (C) 2018-2022 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -207,6 +207,17 @@ public:
return epsilon_; return epsilon_;
} }
//- Return the turbulence specific dissipation rate
virtual tmp<volScalarField> omega() const
{
return volScalarField::New
(
"omega",
epsilon_/(Cmu_*k_),
epsilon_.boundaryField().types()
);
}
//- Solve the turbulence equations and correct the turbulence viscosity //- Solve the turbulence equations and correct the turbulence viscosity
virtual void correct(); virtual void correct();

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2013-2021 OpenFOAM Foundation \\ / A nd | Copyright (C) 2013-2022 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -191,7 +191,7 @@ bool Foam::functionObjects::turbulenceFields::execute()
} }
case compressibleField::omega: case compressibleField::omega:
{ {
processField<scalar>(f, omega(model)); processField<scalar>(f, model.omega());
break; break;
} }
case compressibleField::nut: case compressibleField::nut:
@ -249,7 +249,7 @@ bool Foam::functionObjects::turbulenceFields::execute()
} }
case compressibleField::omega: case compressibleField::omega:
{ {
processField<scalar>(f, omega(model)); processField<scalar>(f, model.omega());
break; break;
} }
case compressibleField::nut: case compressibleField::nut:
@ -308,7 +308,7 @@ bool Foam::functionObjects::turbulenceFields::execute()
} }
case incompressibleField::omega: case incompressibleField::omega:
{ {
processField<scalar>(f, omega(model)); processField<scalar>(f, model.omega());
break; break;
} }
case incompressibleField::nut: case incompressibleField::nut:

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2013-2021 OpenFOAM Foundation \\ / A nd | Copyright (C) 2013-2022 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -161,10 +161,6 @@ protected:
const tmp<GeometricField<Type, fvPatchField, volMesh>>& tvalue const tmp<GeometricField<Type, fvPatchField, volMesh>>& tvalue
); );
//- Return omega calculated from k and epsilon
template<class Model>
tmp<volScalarField> omega(const Model& model) const;
public: public:

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2012-2020 OpenFOAM Foundation \\ / A nd | Copyright (C) 2012-2022 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -73,37 +73,4 @@ void Foam::functionObjects::turbulenceFields::processField
} }
template<class Model>
Foam::tmp<Foam::volScalarField>
Foam::functionObjects::turbulenceFields::omega
(
const Model& model
) const
{
const scalar Cmu = 0.09;
// Assume k and epsilon are available
const volScalarField k(model.k());
const volScalarField epsilon(model.epsilon());
return tmp<volScalarField>
(
new volScalarField
(
IOobject
(
IOobject::groupName("omega", phaseName_),
k.mesh().time().timeName(),
k.mesh(),
IOobject::NO_READ,
IOobject::NO_WRITE,
false
),
epsilon/(Cmu*k),
epsilon.boundaryField().types()
)
);
}
// ************************************************************************* // // ************************************************************************* //