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(),
219 template<
class BasicMomentumTransportModel>
224 if (modeCoefficients_.size())
226 this->coeffDict().lookup(
"modes") >> modeCoefficients_;
229 nuM_.read(this->coeffDict());
231 lambdas_ = readModeCoefficients(
"lambda",
dimTime);
242 template<
class BasicMomentumTransportModel>
247 this->groupName(
"nuEff"),
253 template<
class BasicMomentumTransportModel>
263 template<
class BasicMomentumTransportModel>
270 this->groupName(
"devTau"),
274 this->alpha_*this->rho_*this->nuM_*
fvc::grad(this->U_)
279 this->alpha_*this->rho_*sigma_
291 template<
class BasicMomentumTransportModel>
292 template<
class RhoFieldType>
296 const RhoFieldType&
rho,
310 template<
class BasicMomentumTransportModel>
316 return DivDevTau(this->rho_,
U);
320 template<
class BasicMomentumTransportModel>
328 return DivDevTau(
rho,
U);
332 template<
class BasicMomentumTransportModel>
364 this->runTime_.constant(),
385 "div(" + alphaRhoPhi.
name() +
',' + sigma_.name() +
')'
389 + sigmaSource(modei,
sigma)
395 sigmaEqn.
solve(
"sigma");
403 for (
label modei = 1; modei<sigmas_.size(); modei++)
405 sigmaSum += sigmas_[modei];
#define forAll(list, i)
Loop across all elements in list.
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.
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 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.
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.
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 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].
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)
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
void dev2(LagrangianPatchField< tensor > &f, const LagrangianPatchField< tensor > &f1)
Ostream & endl(Ostream &os)
Add newline and flush stream.
const dimensionSet dimKinematicViscosity
void twoSymm(LagrangianPatchField< tensor > &f, const LagrangianPatchField< tensor > &f1)
void T(LagrangianPatchField< Type > &f, const LagrangianPatchField< Type > &f1)
const dimensionSet dimTime
word name(const LagrangianState state)
Return a string representation of a Lagrangian state enumeration.
fileType type(const fileName &, const bool checkVariants=true, const bool followLink=true)
Return the file type: directory or file.