42 namespace functionObjects
60 if (!foundObject<volScalarField>(fieldName_))
75 store(fieldName_, tfldPtr);
78 return lookupObjectRef<volScalarField>(fieldName_);
83 Foam::functionObjects::energyTransport::kappaEff()
const 89 const turbType* turbPtr = findObject<turbType>
115 Foam::functionObjects::energyTransport::rho()
const 127 trho.ref() = lookupObject<volScalarField>(rhoName_);
134 Foam::functionObjects::energyTransport::Cp()
const 138 tmp<volScalarField>
tCp(phases_[0]*Cps_[0]);
140 for (label i = 1; i < phases_.size(); i++)
142 tCp.ref() += phases_[i]*Cps_[i];
158 Foam::functionObjects::energyTransport::kappa()
const 162 tmp<volScalarField> tkappa(phases_[0]*kappas_[0]);
164 for (label i = 1; i < phases_.size(); i++)
166 tkappa.ref() += phases_[i]*kappas_[i];
183 Foam::functionObjects::energyTransport::energyTransport
191 fieldName_(
dict.getOrDefault<
word>(
"field",
"T")),
192 phiName_(
dict.getOrDefault<
word>(
"phi",
"phi")),
193 rhoName_(
dict.getOrDefault<
word>(
"rho",
"rho")),
195 schemesField_(
"unknown-schemesField"),
197 multiphaseThermo_(
dict.subOrEmptyDict(
"phaseThermos")),
226 if (!multiphaseThermo_.empty())
228 Cps_.setSize(multiphaseThermo_.size());
229 kappas_.setSize(Cps_.size());
230 phaseNames_.
setSize(Cps_.size());
235 const word&
key = iter().keyword();
242 <<
"Found non-dictionary entry " << iter()
243 <<
" in top-level dictionary " << multiphaseThermo_
276 phases_.setSize(phaseNames_.
size());
291 if (Cp_.
value() == 0.0 || kappa_.
value() == 0.0)
294 <<
" Multiphase thermo dictionary not found and Cp/kappa " 295 <<
" for single phase are zero. Please entry either" 304 s.correctBoundaryConditions();
320 dict.readIfPresent(
"phi", phiName_);
321 dict.readIfPresent(
"rho", rhoName_);
323 schemesField_ =
dict.getOrDefault(
"schemesField", fieldName_);
325 dict.readIfPresent(
"nCorr", nCorr_);
327 if (
dict.found(
"fvOptions"))
329 fvOptions_.reset(
dict.subDict(
"fvOptions"));
348 word divScheme(
"div(phi," + schemesField_ +
")");
351 "laplacian(kappaEff," + schemesField_ +
")" 355 scalar relaxCoeff = 0;
356 mesh_.relaxEquation(schemesField_, relaxCoeff);
363 for (label i = 0; i <= nCorr_; i++)
372 fvOptions_(rhoCp_,
s)
375 sEqn.
relax(relaxCoeff);
377 fvOptions_.constrain(sEqn);
379 sEqn.
solve(schemesField_);
396 for (label i = 0; i <= nCorr_; i++)
404 fvOptions_(trhoCp.ref(),
s)
407 sEqn.relax(relaxCoeff);
409 fvOptions_.constrain(sEqn);
411 sEqn.solve(schemesField_);
417 <<
"Incompatible dimensions for phi: " <<
phi.dimensions() <<
nl
const Type & value() const noexcept
Return const reference to value.
void size(const label n)
Older name for setAddressableSize.
defineTypeNameAndDebug(ObukhovLength, 0)
fvMatrix< scalar > fvScalarMatrix
const GeometricField< Type, PatchField, GeoMesh > & oldTime() const
Return old time field.
errorManipArg< error, int > exit(error &err, const int errNo=1)
error FatalError
Error stream (stdout output on all processes), with additional 'FOAM FATAL ERROR' header text and sta...
A list of keyword definitions, which are a keyword followed by a number of values (eg...
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
const tmp< volScalarField > & tCp
tmp< GeometricField< Type, fvPatchField, volMesh > > div(const GeometricField< Type, fvsPatchField, surfaceMesh > &ssf)
constexpr char nl
The newline '\n' character (0x0a)
virtual bool read(const dictionary &)
Read the energyTransport data.
Ostream & endl(Ostream &os)
Add newline and flush stream.
tmp< volScalarField > trho
Calculate the matrix for the laplacian of the field.
virtual bool execute()
Calculate the energyTransport.
virtual bool write()
Do nothing.
IncompressibleTurbulenceModel< transportModel > turbulenceModel
const dimensionSet dimless
Dimensionless.
const Time & time() const
Return the top-level database.
const dimensionedScalar kappa
Coulomb constant: default SI units: [N.m2/C2].
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
const surfaceScalarField rhoCpPhi(fvc::interpolate(fluid.Cp()) *rhoPhi)
Macros for easy insertion into run-time selection tables.
#define forAll(list, i)
Loop across all elements in list.
tmp< GeometricField< Type, fvPatchField, volMesh > > ddt(const dimensioned< Type > dt, const fvMesh &mesh)
GeometricField< scalar, fvPatchField, volMesh > volScalarField
fileName::Type type(const fileName &name, const bool followLink=true)
Return the file type: DIRECTORY or FILE, normally following symbolic links.
const dimensionSet dimVolume(pow3(dimLength))
virtual ~energyTransport()
Destructor.
void setSize(const label n)
Alias for resize()
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for expressions::valueTypeCode::INVALID.
static const word propertiesName
Default name of the turbulence properties dictionary.
A class for handling words, derived from Foam::string.
Type * getObjectPtr(const word &name, const bool recursive=false) const
Return non-const pointer to the object of the given Type, using a const-cast to have it behave like a...
const dimensionSet dimTemperature(0, 0, 0, 1, 0, 0, 0)
tmp< fvMatrix< Type > > ddt(const GeometricField< Type, fvPatchField, volMesh > &vf)
bool store(word &fieldName, const tmp< ObjectType > &tfield, bool cacheable=false)
Store the field in the (sub) objectRegistry under the given name.
Calculate the matrix for the first temporal derivative.
static tmp< T > New(Args &&... args)
Construct tmp with forwarding arguments.
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.
zeroField Sp(const Foam::zero, const GeometricField< Type, fvPatchField, volMesh > &)
A no-op source.
static tmp< GeometricField< scalar, fvPatchField, volMesh > > New(const word &name, IOobjectOption::registerOption regOpt, const Mesh &mesh, const dimensionSet &dims, const word &patchFieldType=fvPatchField< scalar >::calculatedType())
Return tmp field (NO_READ, NO_WRITE) from name, mesh, dimensions and patch type. [Takes current timeN...
SolverPerformance< Type > solve(const dictionary &)
Solve returning the solution statistics.
static word timeName(const scalar t, const int precision=precision_)
Return a time name for the given scalar time value formatted with the given precision.
tmp< fvMatrix< Type > > div(const surfaceScalarField &flux, const GeometricField< Type, fvPatchField, volMesh > &vf, const word &name)
const volScalarField & Cp
addToRunTimeSelectionTable(functionObject, ObukhovLength, dictionary)
void relax(const scalar alpha)
Relax matrix (for steady-state solution).
const dimensionSet dimEnergy
static tmp< GeometricField< Type, fvsPatchField, surfaceMesh > > interpolate(const GeometricField< Type, fvPatchField, volMesh > &tvf, const surfaceScalarField &faceFlux, Istream &schemeData)
Interpolate field onto faces using scheme given by Istream.
const dimensionSet dimDensity
Calculate the matrix for the divergence of the given field and flux.
const dimensionSet dimLength(0, 1, 0, 0, 0, 0, 0)
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.
tmp< fvMatrix< Type > > laplacian(const GeometricField< Type, fvPatchField, volMesh > &vf, const word &name)
auto key(const Type &t) -> typename std::enable_if< std::is_enum< Type >::value, typename std::underlying_type< Type >::type >::type
Automatically write from objectRegistry::writeObject()
const dimensionSet dimTime(0, 0, 1, 0, 0, 0, 0)
virtual bool read(const dictionary &dict)
Read optional controls.
Specialization of Foam::functionObject for an Foam::fvMesh, providing a reference to the Foam::fvMesh...
const dimensionSet dimMass(1, 0, 0, 0, 0, 0, 0)
A class for managing temporary objects.
GeometricField< scalar, fvsPatchField, surfaceMesh > surfaceScalarField
gmvFile<< "tracers "<< particles.size()<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().x()<< " ";}gmvFile<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().y()<< " ";}gmvFile<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().z()<< " ";}gmvFile<< nl;forAll(lagrangianScalarNames, i){ word name=lagrangianScalarNames[i];IOField< scalar > s(IOobject(name, runTime.timeName(), cloud::prefix, mesh, IOobject::MUST_READ, IOobject::NO_WRITE))
Defines the attributes of an object for which implicit objectRegistry management is supported...
Request registration (bool: true)
const fvMesh & mesh_
Reference to the fvMesh.
Do not request registration (bool: false)
Calculate the finiteVolume matrix for implicit and explicit sources.
forAllConstIters(mixture.phases(), phase)
const dictionary * findDict(const word &keyword, enum keyType::option matchOpt=keyType::REGEX) const
Find and return a sub-dictionary pointer if present (and it is a dictionary) otherwise return nullptr...
static constexpr const zero Zero
Global zero (0)