35 namespace laminarModels
40 template<
class BasicMomentumTransportModel>
41 PtrList<dimensionedScalar>
48 return readModeCoefficients(this->
type(), name, dims);
52 template<
class BasicMomentumTransportModel>
63 if (modeCoefficients_.size())
68 <<
"Using 'modes' list, '" <<
name <<
"' entry will be ignored."
105 template<
class BasicMomentumTransportModel>
114 if (modeCoefficients_.size())
116 for(
label modei=1; modei<modeCoefficients_.size(); modei++)
118 nuMSum += nuM[modei];
126 template<
class BasicMomentumTransportModel>
133 return -
fvm::Sp(this->alpha_*this->rho_/lambdas_[modei],
sigma);
139 template<
class BasicMomentumTransportModel>
162 modeCoefficients_(this->typeDict(
type).subOrEmptyDict(
"modes")),
164 nModes_(modeCoefficients_.size() ? modeCoefficients_.size() : 1),
168 lambdas_(readModeCoefficients(
"lambda",
dimTime)),
170 nuMSum_(sumNuM(nuM_)),
176 this->groupName(
"sigma"),
177 this->runTime_.
name(),
194 this->groupName(
"sigma" +
name(modei)),
195 this->runTime_.name(),
203 Info<<
" Reading mode stress field "
214 this->runTime_.name(),
234 this->runTime_.name(),
250 template<
class BasicMomentumTransportModel>
255 if (modeCoefficients_.size())
257 this->typeDict().lookup(
"modes") >> modeCoefficients_;
261 lambdas_ = readModeCoefficients(
"lambda",
dimTime);
262 nuMSum_ = sumNuM(nuM_);
273 template<
class BasicMomentumTransportModel>
278 this->groupName(
"nuEff"),
284 template<
class BasicMomentumTransportModel>
294 template<
class BasicMomentumTransportModel>
301 this->groupName(
"devTau"),
305 this->alpha_*this->rho_*this->nuMSum_*
fvc::grad(this->U_)
310 this->alpha_*this->rho_*sigma_
322 template<
class BasicMomentumTransportModel>
323 template<
class RhoFieldType>
327 const RhoFieldType&
rho,
341 template<
class BasicMomentumTransportModel>
347 return DivDevTau(this->rho_,
U);
351 template<
class BasicMomentumTransportModel>
359 return DivDevTau(
rho,
U);
363 template<
class BasicMomentumTransportModel>
386 uniformDimensionedScalarField rLambda
395 this->runTime_.constant(),
405 - nuM_[modei]*rLambda*
twoSymm(gradU)
416 "div(" + alphaRhoPhi.
name() +
',' + sigma_.name() +
')'
420 + sigmaSource(modei,
sigma)
426 sigmaEqn.
solve(
"sigma");
434 for (
label modei = 1; modei<sigmas_.size(); modei++)
436 sigmaSum += sigmas_[modei];
#define forAll(list, i)
Loop across all elements in list.
#define forAllConstIter(Container, container, iter)
Iterate across all elements in the container object of type.
static fvModels & New(const word &name, const fvMesh &mesh)
Construct and return the named DemandDrivenMeshObject.
Generic GeometricField class.
static tmp< GeometricField< Type, GeoMesh, PrimitiveField > > New(const word &name, const Internal &, const PtrList< Patch > &, 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 keywords followed by any number of values (e.g. words and numbers) or sub-dictionaries.
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 correct()
Predict the laminar viscosity.
BasicMomentumTransportModel::rhoField rhoField
Generalised Maxwell model for viscoelasticity using the upper-convected time derivative of the stress...
volSymmTensorField sigma_
Single or mode sum viscoelastic stress.
virtual tmp< fvSymmTensorMatrix > sigmaSource(const label modei, volSymmTensorField &sigma) const
virtual void correct()
Correct the Maxwell stress.
label nModes_
Number of modes.
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.
virtual tmp< surfaceVectorField > devTau() const
Return the effective surface stress.
PtrList< volSymmTensorField > sigmas_
Mode viscoelastic stresses.
dimensionedScalar sumNuM(const PtrList< dimensionedScalar > &nuM) const
Return the sum of the given list of mode viscosities.
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
Read a coefficient for all modes and return as a list.
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))
Foam::fvMesh mesh(Foam::IOobject(regionName, runTime.name(), runTime, Foam::IOobject::MUST_READ), false)
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].
const dimensionSet kinematicStress
static tmp< SurfaceField< Type > > interpolate(const VolField< Type > &tvf, const surfaceScalarField &faceFlux, Istream &schemeData)
Interpolate field onto faces using scheme given by Istream.
static tmp< SurfaceField< typename innerProduct< vector, Type >::type > > dotInterpolate(const surfaceVectorField &Sf, const VolField< Type > &tvf)
Interpolate field onto faces.
tmp< VolField< typename outerProduct< vector, Type >::type > > grad(const SurfaceField< Type > &ssf)
tmp< VolField< Type > > div(const SurfaceField< Type > &ssf)
tmp< SurfaceField< Type > > snGrad(const VolField< Type > &vf, const word &name)
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)
const unitSet & lookup(const word &unitName)
Lookup and return the named unit from the table.
const dimensionSet & dimKinematicViscosity
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.
void dev2(pointPatchField< tensor > &, const pointPatchField< tensor > &)
const dimensionSet & dimTime
word name(const LagrangianState state)
Return a string representation of a Lagrangian state enumeration.
void twoSymm(pointPatchField< tensor > &, const pointPatchField< tensor > &)
void T(GeometricField< Type, GeoMesh, PrimitiveField1 > &gf, const GeometricField< Type, GeoMesh, PrimitiveField2 > &gf1)
fileType type(const fileName &, const bool checkVariants=true, const bool followLink=true)
Return the file type: directory or file.