MomentumTransportModels: Update of the TurbulenceModels library for all flow types

providing the shear-stress term in the momentum equation for incompressible and
compressible Newtonian, non-Newtonian and visco-elastic laminar flow as well as
Reynolds averaged and large-eddy simulation of turbulent flow.

The general deviatoric shear-stress term provided by the MomentumTransportModels
library is named divDevTau for compressible flow and divDevSigma (sigma =
tau/rho) for incompressible flow, the spherical part of the shear-stress is
assumed to be either included in the pressure or handled separately.  The
corresponding stress function sigma is also provided which in the case of
Reynolds stress closure returns the effective Reynolds stress (including the
laminar contribution) or for other Reynolds averaged or large-eddy turbulence
closures returns the modelled Reynolds stress or sub-grid stress respectively.
For visco-elastic flow the sigma function returns the effective total stress
including the visco-elastic and Newtonian contributions.

For thermal flow the heat-flux generated by thermal diffusion is now handled by
the separate ThermophysicalTransportModels library allowing independent run-time
selection of the heat-flux model.

During the development of the MomentumTransportModels library significant effort
has been put into rationalising the components and supporting libraries,
removing redundant code, updating names to provide a more logical, consistent
and extensible interface and aid further development and maintenance.  All
solvers and tutorials have been updated correspondingly and backward
compatibility of the input dictionaries provided.

Henry G. Weller
CFD Direct Ltd.
This commit is contained in:
Henry Weller
2020-04-14 20:44:22 +01:00
parent 08e686eb18
commit de66b1be68
833 changed files with 3717 additions and 4015 deletions

View File

@ -0,0 +1,131 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2020 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#include "objectFunction1.H"
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
template <class PrimitiveType>
Foam::objectFunction1::objectFunction1
(
const word& entryName,
const dictionary& dict,
const type<PrimitiveType>&
)
:
autoPtr<Function1<PrimitiveType>>
(
Function1<PrimitiveType>::New(entryName, dict).ptr()
)
{}
// * * * * * * * * * * * * * * * * Selectors * * * * * * * * * * * * * * * * //
template <template <class> class ObjectType>
Foam::autoPtr<Foam::objectFunction1> Foam::objectFunction1::New
(
const word& entryName,
const dictionary& dict,
const word& objectName,
const objectRegistry& db
)
{
autoPtr<objectFunction1> ptr
(
db.foundObject<ObjectType<scalar>>(objectName)
? new objectFunction1(entryName, dict, type<scalar>())
: db.foundObject<ObjectType<vector>>(objectName)
? new objectFunction1(entryName, dict, type<vector>())
: db.foundObject<ObjectType<symmTensor>>(objectName)
? new objectFunction1(entryName, dict, type<symmTensor>())
: db.foundObject<ObjectType<sphericalTensor>>(objectName)
? new objectFunction1(entryName, dict, type<sphericalTensor>())
: db.foundObject<ObjectType<tensor>>(objectName)
? new objectFunction1(entryName, dict, type<tensor>())
: nullptr
);
if (!ptr.valid())
{
// Spit lookup error
db.lookupObject<regIOobject>(objectName);
}
return ptr;
}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::objectFunction1::~objectFunction1()
{}
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
template <class PrimitiveType>
PrimitiveType Foam::objectFunction1::value
(
const scalar x
) const
{
return autoPtr<Function1<PrimitiveType>>::operator*().value(x);
}
template <class PrimitiveType>
Foam::tmp<Foam::Field<PrimitiveType>> Foam::objectFunction1::value
(
const scalarField& x
) const
{
return autoPtr<Function1<PrimitiveType>>::operator*().value(x);
}
template <class PrimitiveType>
PrimitiveType Foam::objectFunction1::integrate
(
const scalar x1,
const scalar x2
) const
{
return autoPtr<Function1<PrimitiveType>>::operator*().integrate(x1, x2);
}
template <class PrimitiveType>
Foam::tmp<Foam::Field<PrimitiveType>> Foam::objectFunction1::integrate
(
const scalarField& x1,
const scalarField& x2
) const
{
return autoPtr<Function1<PrimitiveType>>::operator*().integrate(x1, x2);
}
// ************************************************************************* //