Go to the documentation of this file.
42 namespace functionObjects
60 if (!foundObject<volScalarField>(fieldName_))
74 store(fieldName_, tfldPtr);
77 return lookupObjectRef<volScalarField>(fieldName_);
82 Foam::functionObjects::energyTransport::kappaEff()
const
88 const turbType* turbPtr = findObject<turbType>
95 return tmp<volScalarField>
113 Foam::functionObjects::energyTransport::rho()
const
120 mesh_.time().timeName(),
132 trho.ref() = lookupObject<volScalarField>(rhoName_);
139 Foam::functionObjects::energyTransport::Cp()
const
143 tmp<volScalarField>
tCp(phases_[0]*Cps_[0]);
145 for (label i = 1; i < phases_.size(); i++)
147 tCp.ref() += phases_[i]*Cps_[i];
157 mesh_.time().timeName(),
170 Foam::functionObjects::energyTransport::kappa()
const
174 tmp<volScalarField> tkappa(phases_[0]*kappas_[0]);
176 for (label i = 1; i < phases_.size(); i++)
178 tkappa.ref() += phases_[i]*kappas_[i];
188 mesh_.time().timeName(),
201 Foam::functionObjects::energyTransport::energyTransport
209 fieldName_(
dict.getOrDefault<
word>(
"field",
"T")),
210 phiName_(
dict.getOrDefault<
word>(
"phi",
"phi")),
211 rhoName_(
dict.getOrDefault<
word>(
"rho",
"rho")),
213 schemesField_(
"unknown-schemesField"),
215 multiphaseThermo_(
dict.subOrEmptyDict(
"phaseThermos")),
231 mesh_.time().timeName(),
244 if (!multiphaseThermo_.empty())
246 Cps_.setSize(multiphaseThermo_.size());
247 kappas_.setSize(Cps_.size());
248 phaseNames_.setSize(Cps_.size());
253 const word&
key = iter().keyword();
255 if (!multiphaseThermo_.isDict(
key))
258 <<
"Found non-dictionary entry " << iter()
259 <<
" in top-level dictionary " << multiphaseThermo_
292 phases_.setSize(phaseNames_.size());
307 if (Cp_.value() == 0.0 || kappa_.value() == 0.0)
310 <<
" Multiphase thermo dictionary not found and Cp/kappa "
311 <<
" for single phase are zero. Please entry either"
320 s.correctBoundaryConditions();
336 dict.readIfPresent(
"phi", phiName_);
337 dict.readIfPresent(
"rho", rhoName_);
339 schemesField_ =
dict.getOrDefault(
"schemesField", fieldName_);
341 dict.readIfPresent(
"nCorr", nCorr_);
343 if (
dict.found(
"fvOptions"))
345 fvOptions_.reset(
dict.subDict(
"fvOptions"));
364 word divScheme(
"div(phi," + schemesField_ +
")");
367 "laplacian(kappaEff," + schemesField_ +
")"
371 scalar relaxCoeff = 0.0;
372 if (mesh_.relaxEquation(schemesField_))
374 relaxCoeff = mesh_.equationRelaxationFactor(schemesField_);
382 for (label i = 0; i <= nCorr_; i++)
391 fvOptions_(rhoCp_,
s)
394 sEqn.
relax(relaxCoeff);
396 fvOptions_.constrain(sEqn);
398 sEqn.
solve(mesh_.solverDict(schemesField_));
412 mesh_.time().timeName(),
421 for (label i = 0; i <= nCorr_; i++)
429 fvOptions_(trhoCp.ref(),
s)
432 sEqn.
relax(relaxCoeff);
434 fvOptions_.constrain(sEqn);
436 sEqn.
solve(mesh_.solverDict(schemesField_));
442 <<
"Incompatible dimensions for phi: " <<
phi.dimensions() <<
nl
Defines the attributes of an object for which implicit objectRegistry management is supported,...
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
A class for handling words, derived from Foam::string.
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))
const dimensionSet dimLength(0, 1, 0, 0, 0, 0, 0)
A class for managing temporary objects.
static constexpr const zero Zero
Global zero (0)
const dimensionSet dimEnergy
const dimensionSet dimDensity
virtual bool read(const dictionary &)
Read the energyTransport data.
bool read(const char *buf, int32_t &val)
Same as readInt32.
static word timeName(const scalar t, const int precision=precision_)
static const word propertiesName
Default name of the turbulence properties dictionary.
const tmp< volScalarField > & tCp
auto key(const Type &t) -> typename std::enable_if< std::is_enum< Type >::value, typename std::underlying_type< Type >::type >::type
tmp< GeometricField< Type, fvPatchField, volMesh > > div(const GeometricField< Type, fvsPatchField, surfaceMesh > &ssf)
Ostream & endl(Ostream &os)
Add newline and flush stream.
virtual bool execute()
Calculate the energyTransport.
bool store(word &fieldName, const tmp< ObjectType > &tfield, bool cacheable=false)
Store the field in the (sub) objectRegistry under the given name.
const dimensionedScalar kappa
Coulomb constant: default SI units: [N.m2/C2].
virtual bool write()
Do nothing.
Specialization of Foam::functionObject for an Foam::fvMesh, providing a reference to the Foam::fvMesh...
Calculate the matrix for the divergence of the given field and flux.
#define forAll(list, i)
Loop across all elements in list.
tmp< volScalarField > trho
const dimensionSet dimTime(0, 0, 1, 0, 0, 0, 0)
tmp< fvMatrix< Type > > Sp(const volScalarField::Internal &, const GeometricField< Type, fvPatchField, volMesh > &)
tmp< fvMatrix< Type > > laplacian(const GeometricField< Type, fvPatchField, volMesh > &vf, const word &name)
void relax(const scalar alpha)
Relax matrix (for steady-state solution).
Calculate the matrix for the laplacian of the field.
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.
GeometricField< scalar, fvPatchField, volMesh > volScalarField
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
virtual bool read(const dictionary &dict)
Read optional controls.
Macros for easy insertion into run-time selection tables.
const dimensionSet dimMass(1, 0, 0, 0, 0, 0, 0)
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.
Calculate the matrix for implicit and explicit sources.
errorManipArg< error, int > exit(error &err, const int errNo=1)
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
tmp< fvMatrix< Type > > ddt(const GeometricField< Type, fvPatchField, volMesh > &vf)
forAllConstIters(mixture.phases(), phase)
addToRunTimeSelectionTable(functionObject, ObukhovLength, dictionary)
fileName::Type type(const fileName &name, const bool followLink=true)
Return the file type: DIRECTORY or FILE, normally following symbolic links.
const fvMesh & mesh_
Reference to the fvMesh.
virtual ~energyTransport()
Destructor.
static tmp< T > New(Args &&... args)
Construct tmp of T with forwarding arguments.
const volScalarField & Cp
defineTypeNameAndDebug(ObukhovLength, 0)
A special matrix type and solver, designed for finite volume solutions of scalar equations....
SolverPerformance< Type > solve(const dictionary &)
Solve returning the solution statistics.
const dimensionSet dimTemperature(0, 0, 0, 1, 0, 0, 0)
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for INVALID.
const Time & time() const
Return the top-level database.
tmp< GeometricField< Type, fvPatchField, volMesh > > ddt(const dimensioned< Type > dt, const fvMesh &mesh)
IncompressibleTurbulenceModel< transportModel > turbulenceModel
const dimensionSet dimVolume(pow3(dimLength))
tmp< fvMatrix< Type > > div(const surfaceScalarField &flux, const GeometricField< Type, fvPatchField, volMesh > &vf, const word &name)
const surfaceScalarField rhoCpPhi(fvc::interpolate(fluid.Cp()) *rhoPhi)
Calculate the matrix for the first temporal derivative.
const dimensionSet dimless
Dimensionless.