ENH: RASModel: regroup omega/epsilon virtual functions

This commit is contained in:
Kutalmis Bercin
2021-08-19 14:52:25 +01:00
parent 52be5d0428
commit ec62cda73a
18 changed files with 61 additions and 264 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-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) 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();
};