42namespace functionObjects
60 if (!foundObject<volScalarField>(fieldName_))
74 store(fieldName_, tfldPtr);
77 return lookupObjectRef<volScalarField>(fieldName_);
82Foam::functionObjects::energyTransport::kappaEff()
const
88 const turbType* turbPtr = findObject<turbType>
95 return tmp<volScalarField>
113Foam::functionObjects::energyTransport::rho()
const
120 mesh_.time().timeName(),
132 trho.ref() = lookupObject<volScalarField>(rhoName_);
139Foam::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(),
170Foam::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(),
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")),
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_
265 phaseNames_[
phasei] = key;
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
Macros for easy insertion into run-time selection tables.
#define addToRunTimeSelectionTable(baseType, thisType, argNames)
Add to construction table with typeName as the key.
const GeometricField< Type, PatchField, GeoMesh > & oldTime() const
Return old time field.
Defines the attributes of an object for which implicit objectRegistry management is supported,...
void setSize(const label n)
Alias for resize()
virtual bool read()
Re-read model coefficients if they have changed.
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
static autoPtr< Time > New()
Construct (dummy) Time - no functionObjects or libraries.
static word timeName(const scalar t, const int precision=precision_)
void size(const label n)
Older name for setAddressableSize.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
const dictionary & subDict(const word &keyword, enum keyType::option matchOpt=keyType::REGEX) const
Find and return a sub-dictionary.
bool isDict(const word &keyword, enum keyType::option matchOpt=keyType::REGEX) const
Check if entry is found and is a sub-dictionary.
const Type & value() const
Return const reference to value.
Abstract base-class for Time/database function objects.
Evolves a simplified energy transport equation for incompressible flows. It takes into account the in...
virtual ~energyTransport()
Destructor.
virtual bool execute()
Calculate the energyTransport.
virtual bool write()
Do nothing.
virtual bool read(const dictionary &)
Read the energyTransport data.
Specialization of Foam::functionObject for an Foam::fvMesh, providing a reference to the Foam::fvMesh...
const fvMesh & mesh_
Reference to the fvMesh.
bool store(word &fieldName, const tmp< ObjectType > &tfield, bool cacheable=false)
Store the field in the (sub) objectRegistry under the given name.
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 returning the solution statistics.
const Time & time() const
Return the top-level database.
Type * getObjectPtr(const word &name, const bool recursive=false) const
A class for managing temporary objects.
static const word propertiesName
Default name of the turbulence properties dictionary.
A class for handling words, derived from Foam::string.
#define defineTypeNameAndDebug(Type, DebugSwitch)
Define the typeName and debug information.
const tmp< volScalarField > & tCp
const volScalarField & Cp
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
Calculate the matrix for the first temporal derivative.
Calculate the matrix for the divergence of the given field and flux.
Calculate the matrix for the laplacian of the field.
Calculate the finiteVolume matrix for implicit and explicit sources.
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 surfaceScalarField rhoCpPhi(fvc::interpolate(fluid.Cp()) *rhoPhi)
const dimensionedScalar kappa
Coulomb constant: default SI units: [N.m2/C2].
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.
tmp< GeometricField< Type, fvPatchField, volMesh > > div(const GeometricField< Type, fvsPatchField, surfaceMesh > &ssf)
tmp< GeometricField< Type, fvPatchField, volMesh > > ddt(const dimensioned< Type > dt, const fvMesh &mesh)
tmp< fvMatrix< Type > > laplacian(const GeometricField< Type, fvPatchField, volMesh > &vf, const word &name)
tmp< fvMatrix< Type > > div(const surfaceScalarField &flux, const GeometricField< Type, fvPatchField, volMesh > &vf, const word &name)
tmp< fvMatrix< Type > > ddt(const GeometricField< Type, fvPatchField, volMesh > &vf)
zeroField Sp(const Foam::zero, const GeometricField< Type, fvPatchField, volMesh > &)
A no-op source.
IncompressibleTurbulenceModel< transportModel > turbulenceModel
const dimensionSet dimless
Dimensionless.
const dimensionSet dimEnergy
const dimensionSet dimLength(0, 1, 0, 0, 0, 0, 0)
const dimensionSet dimTime(0, 0, 1, 0, 0, 0, 0)
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.
Ostream & endl(Ostream &os)
Add newline and flush stream.
const dimensionSet dimTemperature(0, 0, 0, 1, 0, 0, 0)
static constexpr const zero Zero
Global zero (0)
const dimensionSet dimVolume(pow3(dimLength))
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for INVALID.
const dimensionSet dimDensity
errorManipArg< error, int > exit(error &err, const int errNo=1)
const dimensionSet dimMass(1, 0, 0, 0, 0, 0, 0)
constexpr char nl
The newline '\n' character (0x0a)
tmp< volScalarField > trho
#define forAll(list, i)
Loop across all elements in list.
#define forAllConstIters(container, iter)
Iterate across all elements of the container object with const access.