35 namespace laminarModels
40 template<
class BasicMomentumTransportModel>
41 PtrList<dimensionedScalar>
50 if (modeCoefficients_.size())
55 <<
"Using 'modes' list, '" <<
name <<
"' entry will be ignored."
59 forAll(modeCoefficients_, modei)
68 modeCoefficients_[modei].lookup(
name)
82 this->coeffDict_.lookup(
name)
91 template<
class BasicMomentumTransportModel>
98 return -
fvm::Sp(this->alpha_*this->rho_/lambdas_[modei],
sigma);
104 template<
class BasicMomentumTransportModel>
129 this->coeffDict().
found(
"modes")
132 this->coeffDict().lookup(
"modes")
137 nModes_(modeCoefficients_.size() ? modeCoefficients_.size() : 1),
141 lambdas_(readModeCoefficients(
"lambda",
dimTime)),
147 this->groupName(
"sigma"),
148 this->runTime_.
name(),
164 this->groupName(
"sigma" +
name(modei)),
165 this->runTime_.name(),
173 Info<<
" Reading mode stress field "
184 this->runTime_.name(),
203 this->runTime_.name(),
215 if (
type == typeName)
224 template<
class BasicMomentumTransportModel>
229 if (modeCoefficients_.size())
231 this->coeffDict().lookup(
"modes") >> modeCoefficients_;
234 nuM_.read(this->coeffDict());
236 lambdas_ = readModeCoefficients(
"lambda",
dimTime);
247 template<
class BasicMomentumTransportModel>
252 this->groupName(
"nuEff"),
258 template<
class BasicMomentumTransportModel>
268 template<
class BasicMomentumTransportModel>
275 template<
class BasicMomentumTransportModel>
280 this->groupName(
"devTau"),
281 this->alpha_*this->rho_*sigma_
282 - (this->alpha_*this->rho_*this->nu())
288 template<
class BasicMomentumTransportModel>
298 this->alpha_*this->rho_*this->nuM_*
fvc::grad(
U)
300 +
fvc::div(this->alpha_*this->rho_*sigma_)
307 template<
class BasicMomentumTransportModel>
328 template<
class BasicMomentumTransportModel>
360 this->runTime_.constant(),
381 "div(" + alphaRhoPhi.
name() +
',' + sigma_.name() +
')'
385 + sigmaSource(modei,
sigma)
391 sigmaEqn.
solve(
"sigma");
399 for (
label modei = 1; modei<sigmas_.size(); modei++)
401 sigmaSum += sigmas_[modei];
#define forAll(list, i)
Loop across all elements in list.
Generic GeometricField class.
static tmp< GeometricField< Type, PatchField, GeoMesh > > New(const word &name, const Internal &, const PtrList< PatchField< Type >> &, const HashPtrTable< Source > &=HashPtrTable< Source >())
Return a temporary field constructed from name,.
IOobject defines the attributes of an object for which implicit objectRegistry management is supporte...
const word & name() const
Return name.
A templated 1D list of pointers to objects of type <T>, where the size of the array is known and used...
bool set(const label) const
Is element set.
A list of keyword definitions, which are a keyword followed by any number of values (e....
static autoPtr< dictionary > New(Istream &)
Construct top-level dictionary on freestore from Istream.
Dimension set for the base types.
Finite volume constraints.
bool constrain(fvMatrix< Type > &eqn) const
Apply constraints to an equation.
A special matrix type and solver, designed for finite volume solutions of scalar equations....
void relax(const scalar alpha)
Relax matrix (for steady-state solution).
SolverPerformance< Type > solve(const dictionary &)
Solve segregated or coupled returning the solution statistics.
tmp< fvMatrix< Type > > source(const VolField< Type > &field) const
Return source for an equation.
Templated abstract base class for laminar transport models.
BasicMomentumTransportModel::alphaField alphaField
virtual void printCoeffs(const word &type)
Print model coefficients.
virtual void correct()
Predict the laminar viscosity.
BasicMomentumTransportModel::rhoField rhoField
volSymmTensorField sigma_
Single or mode sum viscoelastic stress.
virtual tmp< fvSymmTensorMatrix > sigmaSource(const label modei, volSymmTensorField &sigma) const
virtual tmp< volSymmTensorField > sigma() const
Return the stress tensor [m^2/s^2].
virtual void correct()
Correct the Maxwell stress.
virtual tmp< volScalarField > nuEff() const
Return the effective viscosity, i.e. the laminar viscosity.
virtual tmp< fvVectorMatrix > divDevTau(volVectorField &U) const
Return the source term for the momentum equation.
PtrList< volSymmTensorField > sigmas_
Mode viscoelastic stresses.
Maxwell(const alphaField &alpha, const rhoField &rho, const volVectorField &U, const surfaceScalarField &alphaRhoPhi, const surfaceScalarField &phi, const viscosity &viscosity, const word &type=typeName)
Construct from components.
PtrList< dimensionedScalar > readModeCoefficients(const word &name, const dimensionSet &dims) const
virtual tmp< volSymmTensorField > devTau() const
Return the effective stress tensor.
virtual bool read()
Read model coefficients if they have changed.
A class for managing temporary objects.
Templated form of IOobject providing type information for file reading and header type checking.
bool headerOk()
Read header (uses typeGlobalFile to find file) and check.
Abstract base class for all fluid physical properties.
A class for handling words, derived from string.
static const word null
An empty word.
Foam::fvConstraints & fvConstraints(Foam::fvConstraints::New(mesh))
Foam::fvModels & fvModels(Foam::fvModels::New(mesh))
volScalarField alpha(IOobject("alpha", runTime.name(), mesh, IOobject::READ_IF_PRESENT, IOobject::AUTO_WRITE), lambda *max(Ua &U, zeroSensitivity))
#define IOWarningInFunction(ios)
Report an IO warning using Foam::Warning.
const dimensionedScalar sigma
Stefan-Boltzmann constant: default SI units: [W/m^2/K^4].
tmp< VolField< typename outerProduct< vector, Type >::type > > grad(const SurfaceField< Type > &ssf)
tmp< VolField< Type > > div(const SurfaceField< Type > &ssf)
tmp< fvMatrix< Type > > laplacian(const VolField< Type > &vf, const word &name)
tmp< fvMatrix< Type > > div(const surfaceScalarField &flux, const VolField< Type > &vf, const word &name)
tmp< fvMatrix< Type > > Sp(const volScalarField::Internal &, const VolField< Type > &)
tmp< fvMatrix< Type > > ddt(const VolField< Type > &vf)
dimensionedSymmTensor dev2(const dimensionedSymmTensor &dt)
dimensionedSymmTensor dev(const dimensionedSymmTensor &dt)
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Ostream & endl(Ostream &os)
Add newline and flush stream.
word name(const bool)
Return a word representation of a bool.
const dimensionSet dimKinematicViscosity
dimensionedSymmTensor twoSymm(const dimensionedSymmTensor &dt)
const dimensionSet dimTime
void T(FieldField< Field, Type > &f1, const FieldField< Field, Type > &f2)
fileType type(const fileName &, const bool checkVariants=true, const bool followLink=true)
Return the file type: directory or file.