Merge branch 'feature-turbModel-access' into 'develop'

ENH: improve access to the inner content of turbulence models

See merge request Development/openfoam!344
This commit is contained in:
Andrew Heather
2020-03-11 16:32:20 +00:00
44 changed files with 527 additions and 37 deletions

View File

@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2016 OpenFOAM Foundation
Copyright (C) 2019 OpenCFD Ltd.
Copyright (C) 2019-2020 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -233,6 +233,14 @@ Foam::RASModels::kineticTheoryModel::epsilon() const
}
Foam::tmp<Foam::volScalarField>
Foam::RASModels::kineticTheoryModel::omega() const
{
NotImplemented;
return nullptr;
}
Foam::tmp<Foam::volSymmTensorField>
Foam::RASModels::kineticTheoryModel::R() const
{

View File

@ -6,6 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2016 OpenFOAM Foundation
Copyright (C) 2020 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -205,6 +206,9 @@ public:
//- Return the turbulence kinetic energy dissipation rate
virtual tmp<volScalarField> epsilon() const;
//- Return the specific dissipation rate
virtual tmp<volScalarField> omega() const;
//- Return the Reynolds stress tensor
virtual tmp<volSymmTensorField> R() const;

View File

@ -6,6 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2013-2016 OpenFOAM Foundation
Copyright (C) 2020 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -119,6 +120,14 @@ Foam::RASModels::phasePressureModel::epsilon() const
}
Foam::tmp<Foam::volScalarField>
Foam::RASModels::phasePressureModel::omega() const
{
NotImplemented;
return nullptr;
}
Foam::tmp<Foam::volSymmTensorField>
Foam::RASModels::phasePressureModel::R() const
{

View File

@ -6,6 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2013-2016 OpenFOAM Foundation
Copyright (C) 2020 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -164,6 +165,9 @@ public:
//- Return the turbulence kinetic energy dissipation rate
virtual tmp<volScalarField> epsilon() const;
//- Return the specific dissipation rate
virtual tmp<volScalarField> omega() const;
//- Return the Reynolds stress tensor
virtual tmp<volSymmTensorField> R() const;

View File

@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2016 OpenFOAM Foundation
Copyright (C) 2019 OpenCFD Ltd.
Copyright (C) 2019-2020 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -168,6 +168,21 @@ 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 OpenCFD Ltd.
Copyright (C) 2019-2020 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -191,6 +191,21 @@ 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 OpenCFD Ltd.
Copyright (C) 2019-2020 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -179,6 +179,21 @@ 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 OpenCFD Ltd.
Copyright (C) 2019-2020 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -166,6 +166,21 @@ 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 OpenCFD Ltd.
Copyright (C) 2019-2020 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -197,6 +197,21 @@ 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 OpenCFD Ltd.
Copyright (C) 2019-2020 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -248,6 +248,21 @@ 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) 2016-2017, OpenCFD Ltd.
Copyright (C) 2016-2020 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -501,7 +501,11 @@ void kOmegaSSTBase<BasicEddyViscosityModel>::correct()
tmp<volTensorField> tgradU = fvc::grad(U);
volScalarField S2(2*magSqr(symm(tgradU())));
volScalarField::Internal GbyNu0((tgradU() && dev(twoSymm(tgradU()))));
volScalarField::Internal GbyNu0
(
this->type() + ":GbyNu",
(tgradU() && dev(twoSymm(tgradU())))
);
volScalarField::Internal G(this->GName(), nut*GbyNu0);
// Update omega and G at the wall
@ -519,6 +523,8 @@ void kOmegaSSTBase<BasicEddyViscosityModel>::correct()
volScalarField::Internal gamma(this->gamma(F1));
volScalarField::Internal beta(this->beta(F1));
GbyNu0 = GbyNu(GbyNu0, F23(), S2());
// Turbulent frequency equation
tmp<fvScalarMatrix> omegaEqn
(
@ -526,7 +532,7 @@ void kOmegaSSTBase<BasicEddyViscosityModel>::correct()
+ fvm::div(alphaRhoPhi, omega_)
- fvm::laplacian(alpha*rho*DomegaEff(F1), omega_)
==
alpha()*rho()*gamma*GbyNu(GbyNu0, F23(), S2())
alpha()*rho()*gamma*GbyNu0
- fvm::SuSp((2.0/3.0)*alpha()*rho()*gamma*divU, omega_)
- fvm::Sp(alpha()*rho()*beta*omega_(), omega_)
- fvm::SuSp

View File

@ -230,7 +230,11 @@ protected:
const volScalarField::Internal& F1
) const
{
return blend(F1, beta1_, beta2_);
return tmp<volScalarField::Internal>::New
(
this->type() + ":beta",
blend(F1, beta1_, beta2_)
);
}
tmp<volScalarField::Internal> gamma
@ -238,7 +242,11 @@ protected:
const volScalarField::Internal& F1
) const
{
return blend(F1, gamma1_, gamma2_);
return tmp<volScalarField::Internal>::New
(
this->type() + ":gamma",
blend(F1, gamma1_, gamma2_)
);
}
virtual void correctNut(const volScalarField& S2);

View File

@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2017 OpenFOAM Foundation
Copyright (C) 2019 OpenCFD Ltd.
Copyright (C) 2019-2020 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -163,6 +163,25 @@ tmp<volScalarField> DeardorffDiffStress<BasicTurbulenceModel>::epsilon() const
}
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 OpenCFD Ltd.
Copyright (C) 2019-2020 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -153,6 +153,9 @@ public:
//- 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

@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2013-2017 OpenFOAM Foundation
Copyright (C) 2016-2019 OpenCFD Ltd.
Copyright (C) 2016-2020 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -119,6 +119,29 @@ tmp<volScalarField> LESeddyViscosity<BasicTurbulenceModel>::epsilon() const
}
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 OpenCFD Ltd.
Copyright (C) 2019-2020 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -110,6 +110,9 @@ public:
//- 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 OpenCFD Ltd.
Copyright (C) 2019-2020 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -160,6 +160,25 @@ tmp<volScalarField> Smagorinsky<BasicTurbulenceModel>::epsilon() const
}
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 OpenCFD Ltd.
Copyright (C) 2019-2020 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -165,6 +165,9 @@ public:
//- 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 OpenCFD Ltd.
Copyright (C) 2019-2020 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -193,6 +193,26 @@ tmp<volScalarField> WALE<BasicTurbulenceModel>::epsilon() const
}
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 OpenCFD Ltd.
Copyright (C) 2019-2020 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -157,6 +157,9 @@ public:
//- 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 OpenCFD Ltd.
Copyright (C) 2019-2020 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -240,6 +240,24 @@ tmp<volScalarField> dynamicKEqn<BasicTurbulenceModel>::epsilon() const
}
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 OpenCFD Ltd.
Copyright (C) 2019-2020 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -181,6 +181,9 @@ public:
//- 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,6 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2017 OpenFOAM Foundation
Copyright (C) 2020 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -159,6 +160,24 @@ tmp<volScalarField> kEqn<BasicTurbulenceModel>::epsilon() const
}
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 OpenCFD Ltd.
Copyright (C) 2019-2020 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -151,6 +151,9 @@ public:
//- 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 OpenCFD Ltd.
Copyright (C) 2019-2020 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -199,6 +199,21 @@ 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 OpenCFD Ltd.
Copyright (C) 2019-2020 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -202,6 +202,21 @@ 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 OpenCFD Ltd.
Copyright (C) 2019-2020 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -202,6 +202,21 @@ 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 OpenCFD Ltd.
Copyright (C) 2019-2020 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -190,6 +190,21 @@ 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 OpenCFD Ltd.
Copyright (C) 2019-2020 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -317,7 +317,7 @@ tmp<volScalarField> SpalartAllmaras<BasicTurbulenceModel>::k() const
this->mesh_
),
this->mesh_,
dimensionedScalar(dimensionSet(0, 2, -2, 0, 0), Zero),
dimensionedScalar(sqr(dimLength)/sqr(dimTime), Zero),
zeroGradientFvPatchField<scalar>::typeName
);
}
@ -340,12 +340,34 @@ tmp<volScalarField> SpalartAllmaras<BasicTurbulenceModel>::epsilon() const
this->mesh_
),
this->mesh_,
dimensionedScalar(dimensionSet(0, 2, -3, 0, 0), Zero),
dimensionedScalar(sqr(dimLength)/pow3(dimTime), Zero),
zeroGradientFvPatchField<scalar>::typeName
);
}
template<class BasicTurbulenceModel>
tmp<volScalarField> SpalartAllmaras<BasicTurbulenceModel>::omega() const
{
WarningInFunction
<< "Specific dissipation rate not defined for "
<< "Spalart-Allmaras model. Returning zero field"
<< endl;
return tmp<volScalarField>::New
(
IOobject
(
IOobject::groupName("omega", this->alphaRhoPhi_.group()),
this->runTime_.timeName(),
this->mesh_
),
this->mesh_,
dimensionedScalar(dimless/dimTime, Zero)
);
}
template<class BasicTurbulenceModel>
void SpalartAllmaras<BasicTurbulenceModel>::correct()
{

View File

@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2016 OpenFOAM Foundation
Copyright (C) 2019 OpenCFD Ltd.
Copyright (C) 2019-2020 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -199,6 +199,9 @@ public:
//- Return the turbulence kinetic energy dissipation rate
virtual tmp<volScalarField> epsilon() const;
//- Return the (estimated) specific dissipation rate
virtual tmp<volScalarField> omega() const;
//- Solve the turbulence equations and correct the turbulence viscosity
virtual void correct();
};

View File

@ -245,6 +245,7 @@ void kEpsilon<BasicTurbulenceModel>::correct()
tmp<volTensorField> tgradU = fvc::grad(U);
const volScalarField::Internal GbyNu
(
this->type() + ":GbyNu",
tgradU().v() && dev(twoSymm(tgradU().v()))
);
const volScalarField::Internal G(this->GName(), nut()*GbyNu);

View File

@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2016 OpenFOAM Foundation
Copyright (C) 2019 OpenCFD Ltd.
Copyright (C) 2019-2020 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -200,6 +200,21 @@ 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

@ -275,6 +275,21 @@ 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-2017 OpenFOAM Foundation
Copyright (C) 2019 OpenCFD Ltd.
Copyright (C) 2019-2020 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -198,6 +198,21 @@ 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,6 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2013-2017 OpenFOAM Foundation
Copyright (C) 2020 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -186,6 +187,27 @@ Stokes<BasicTurbulenceModel>::epsilon() const
}
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

View File

@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2013-2016 OpenFOAM Foundation
Copyright (C) 2019 OpenCFD Ltd.
Copyright (C) 2019-2020 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -133,6 +133,9 @@ public:
//- 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;

View File

@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2016-2017 OpenFOAM Foundation
Copyright (C) 2019 OpenCFD Ltd.
Copyright (C) 2019-2020 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -283,6 +283,27 @@ Foam::laminarModel<BasicTurbulenceModel>::epsilon() const
}
template<class BasicTurbulenceModel>
Foam::tmp<Foam::volScalarField>
Foam::laminarModel<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>
Foam::tmp<Foam::volSymmTensorField>
Foam::laminarModel<BasicTurbulenceModel>::R() const

View File

@ -6,6 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2016 OpenFOAM Foundation
Copyright (C) 2020 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -179,6 +180,9 @@ public:
// i.e. 0 for laminar flow
virtual tmp<volScalarField> epsilon() const;
//- Return the specific dissipation rate, i.e. 0 for laminar flow
virtual tmp<volScalarField> omega() const;
//- Return the Reynolds stress tensor, i.e. 0 for laminar flow
virtual tmp<volSymmTensorField> R() const;

View File

@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2013-2015 OpenFOAM Foundation
Copyright (C) 2019 OpenCFD Ltd.
Copyright (C) 2019-2020 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -204,6 +204,9 @@ public:
//- Return the turbulence kinetic energy dissipation rate
virtual tmp<volScalarField> epsilon() const = 0;
//- Return the specific dissipation rate
virtual tmp<volScalarField> omega() const = 0;
//- Return the Reynolds stress tensor
virtual tmp<volSymmTensorField> R() const = 0;

View File

@ -6,6 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2018 OpenFOAM Foundation
Copyright (C) 2020 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -225,6 +226,21 @@ 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-2018 OpenFOAM Foundation
Copyright (C) 2019 OpenCFD Ltd.
Copyright (C) 2019-2020 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -233,6 +233,14 @@ Foam::RASModels::kineticTheoryModel::epsilon() const
}
Foam::tmp<Foam::volScalarField>
Foam::RASModels::kineticTheoryModel::omega() const
{
NotImplemented;
return nullptr;
}
Foam::tmp<Foam::volSymmTensorField>
Foam::RASModels::kineticTheoryModel::R() const
{

View File

@ -6,6 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2018 OpenFOAM Foundation
Copyright (C) 2020 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -205,6 +206,9 @@ public:
//- Return the turbulence kinetic energy dissipation rate
virtual tmp<volScalarField> epsilon() const;
//- Return the specific dissipation rate
virtual tmp<volScalarField> omega() const;
//- Return the Reynolds stress tensor
virtual tmp<volSymmTensorField> R() const;

View File

@ -6,6 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2013-2018 OpenFOAM Foundation
Copyright (C) 2020 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -113,6 +114,14 @@ Foam::RASModels::phasePressureModel::epsilon() const
}
Foam::tmp<Foam::volScalarField>
Foam::RASModels::phasePressureModel::omega() const
{
NotImplemented;
return nullptr;
}
Foam::tmp<Foam::volSymmTensorField>
Foam::RASModels::phasePressureModel::R() const
{

View File

@ -6,6 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2013-2018 OpenFOAM Foundation
Copyright (C) 2020 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -160,6 +161,9 @@ public:
//- Return the turbulence kinetic energy dissipation rate
virtual tmp<volScalarField> epsilon() const;
//- Return the specific dissipation rate
virtual tmp<volScalarField> omega() const;
//- Return the Reynolds stress tensor
virtual tmp<volSymmTensorField> R() const;