35 namespace laminarModels
40 template<
class BasicMomentumTransportModel>
41 PtrList<dimensionedScalar>
50 if (modeCoefficients_.size())
52 if (this->coeffDict().found(name))
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>
112 const viscosity& viscosity,
129 this->coeffDict().found(
"modes")
132 this->coeffDict().lookup(
"modes")
137 nModes_(modeCoefficients_.size() ? modeCoefficients_.size() : 1),
139 nuM_(
"nuM",
dimViscosity, this->coeffDict_.lookup(
"nuM")),
141 lambdas_(readModeCoefficients(
"lambda",
dimTime)),
148 this->runTime_.timeName(),
158 sigmas_.setSize(nModes_);
165 this->runTime_.timeName(),
171 if (header.headerOk())
173 Info<<
" Reading mode stress field " 174 << header.name() <<
endl;
184 this->runTime_.timeName(),
203 this->runTime_.timeName(),
215 if (type == typeName)
217 this->printCoeffs(type);
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>
258 template<
class BasicMomentumTransportModel>
264 return this->nu(patchi);
268 template<
class BasicMomentumTransportModel>
275 template<
class BasicMomentumTransportModel>
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>
359 this->alphaRhoPhi_.group()
361 this->runTime_.constant(),
382 "div(" + alphaRhoPhi.
name() +
',' + sigma_.name() +
')' 386 + sigmaSource(modei, sigma)
387 + fvModels.source(alpha, rho, sigma)
392 sigmaEqn.solve(
"sigma");
400 for (
label modei = 1; modei<sigmas_.size(); modei++)
402 sigmaSum += sigmas_[modei];
const dimensionSet dimViscosity
tmp< GeometricField< typename outerProduct< vector, Type >::type, fvPatchField, volMesh >> grad(const GeometricField< Type, fvsPatchField, surfaceMesh > &ssf)
Templated abstract base class for laminar transport models.
#define forAll(list, i)
Loop across all elements in list.
const word & name() const
Return name.
bool set(const label) const
Is element set.
virtual tmp< volSymmTensorField > devTau() const
Return the effective stress tensor.
Templated form of IOobject providing type information for file reading and header type checking...
tmp< GeometricField< Type, fvPatchField, volMesh > > div(const GeometricField< Type, fvsPatchField, surfaceMesh > &ssf)
volScalarField alpha(IOobject("alpha", runTime.timeName(), mesh, IOobject::READ_IF_PRESENT, IOobject::AUTO_WRITE), lambda *max(Ua &U, zeroSensitivity))
static tmp< GeometricField< scalar, fvPatchField, volMesh > > New(const word &name, const Internal &, const PtrList< fvPatchField< scalar >> &)
Return a temporary field constructed from name,.
Ostream & endl(Ostream &os)
Add newline and flush stream.
BasicMomentumTransportModel::rhoField rhoField
tmp< fvMatrix< Type > > Sp(const volScalarField::Internal &, const GeometricField< Type, fvPatchField, volMesh > &)
BasicMomentumTransportModel::alphaField alphaField
PtrList< dimensionedScalar > readModeCoefficients(const word &name, const dimensionSet &dims) const
virtual tmp< volScalarField > nuEff() const
Return the effective viscosity, i.e. the laminar viscosity.
dimensionedSymmTensor twoSymm(const dimensionedSymmTensor &dt)
const dimensionSet dimTime
Dimension set for the base types.
stressControl lookup("compactNormalStress") >> compactNormalStress
dimensionedSymmTensor dev(const dimensionedSymmTensor &dt)
Foam::fvConstraints & fvConstraints
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.
virtual tmp< fvSymmTensorMatrix > sigmaSource(const label modei, volSymmTensorField &sigma) const
A class for handling words, derived from string.
static word groupName(Name name, const word &group)
virtual tmp< fvVectorMatrix > divDevTau(volVectorField &U) const
Return the source term for the momentum equation.
Info<< "Reading field p\"<< endl;volScalarField p(IOobject("p", runTime.timeName(), mesh, IOobject::MUST_READ, IOobject::AUTO_WRITE), mesh);Info<< "Reading field U\"<< endl;volVectorField U(IOobject("U", runTime.timeName(), mesh, IOobject::MUST_READ, IOobject::AUTO_WRITE), mesh);pressureReference pressureReference(p, simple.dict());mesh.schemes().setFluxRequired(p.name());Info<< "Reading field pa\"<< endl;volScalarField pa(IOobject("pa", runTime.timeName(), mesh, IOobject::MUST_READ, IOobject::AUTO_WRITE), mesh);Info<< "Reading field Ua\"<< endl;volVectorField Ua(IOobject("Ua", runTime.timeName(), mesh, IOobject::MUST_READ, IOobject::AUTO_WRITE), mesh);# 65 "/home/ubuntu/OpenFOAM-10/applications/solvers/incompressible/adjointShapeOptimisationFoam/createFields.H" 2label paRefCell=0;scalar paRefValue=0.0;setRefCell(pa, simple.dict(), paRefCell, paRefValue);mesh.schemes().setFluxRequired(pa.name());autoPtr< viscosityModel > viscosity(viscosityModel::New(mesh))
tmp< fvMatrix< Type > > ddt(const GeometricField< Type, fvPatchField, volMesh > &vf)
static const word null
An empty word.
A special matrix type and solver, designed for finite volume solutions of scalar equations. Face addressing is used to make all matrix assembly and solution loops vectorise.
tmp< fvMatrix< Type > > div(const surfaceScalarField &flux, const GeometricField< Type, fvPatchField, volMesh > &vf, const word &name)
static autoPtr< dictionary > New(Istream &)
Construct top-level dictionary on freestore from Istream.
virtual tmp< volSymmTensorField > sigma() const
Return the stress tensor [m^2/s^2].
virtual bool read()
Read model coefficients if they have changed.
void relax(const scalar alpha)
Relax matrix (for steady-state solution).
void T(FieldField< Field, Type > &f1, const FieldField< Field, Type > &f2)
word name(const complex &)
Return a string representation of a complex.
bool constrain(fvMatrix< Type > &eqn) const
Apply constraints to an equation.
Foam::fvModels & fvModels
virtual void correct()
Solve the turbulence equations and correct eddy-Viscosity and.
dimensionedSymmTensor dev2(const dimensionedSymmTensor &dt)
Finite volume constraints.
virtual void correct()
Correct the laminar viscosity.
tmp< fvMatrix< Type > > laplacian(const GeometricField< Type, fvPatchField, volMesh > &vf, const word &name)
A templated 1D list of pointers to objects of type <T>, where the size of the array is known and used...
fileType type(const fileName &, const bool checkVariants=true, const bool followLink=true)
Return the file type: directory or file.
#define IOWarningInFunction(ios)
Report an IO warning using Foam::Warning.
A class for managing temporary objects.
IOobject defines the attributes of an object for which implicit objectRegistry management is supporte...