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(),
131 trho.ref() = lookupObject<volScalarField>(rhoName_);
138 Foam::functionObjects::energyTransport::Cp()
const
142 tmp<volScalarField>
tCp(phases_[0]*Cps_[0]);
144 for (label i = 1; i < phases_.size(); i++)
146 tCp.ref() += phases_[i]*Cps_[i];
156 mesh_.time().timeName(),
168 Foam::functionObjects::energyTransport::kappa()
const
172 tmp<volScalarField> tkappa(phases_[0]*kappas_[0]);
174 for (label i = 1; i < phases_.size(); i++)
176 tkappa.ref() += phases_[i]*kappas_[i];
186 mesh_.time().timeName(),
198 Foam::functionObjects::energyTransport::energyTransport
206 fieldName_(
dict.getOrDefault<
word>(
"field",
"T")),
207 phiName_(
dict.getOrDefault<
word>(
"phi",
"phi")),
208 rhoName_(
dict.getOrDefault<
word>(
"rho",
"rho")),
210 schemesField_(
"unknown-schemesField"),
212 multiphaseThermo_(
dict.subOrEmptyDict(
"phaseThermos")),
228 mesh_.time().timeName(),
240 if (!multiphaseThermo_.empty())
242 Cps_.setSize(multiphaseThermo_.size());
243 kappas_.setSize(Cps_.size());
244 phaseNames_.setSize(Cps_.size());
249 const word& key = iter().keyword();
251 if (!multiphaseThermo_.isDict(key))
254 <<
"Found non-dictionary entry " << iter()
255 <<
" in top-level dictionary " << multiphaseThermo_
261 phaseNames_[
phasei] = key;
288 phases_.setSize(phaseNames_.size());
303 if (Cp_.value() == 0.0 || kappa_.value() == 0.0)
306 <<
" Multiphase thermo dictionary not found and Cp/kappa "
307 <<
" for single phase are zero. Please entry either"
316 s.correctBoundaryConditions();
332 dict.readIfPresent(
"phi", phiName_);
333 dict.readIfPresent(
"rho", rhoName_);
335 schemesField_ =
dict.getOrDefault(
"schemesField", fieldName_);
337 dict.readIfPresent(
"nCorr", nCorr_);
339 if (
dict.found(
"fvOptions"))
341 fvOptions_.reset(
dict.subDict(
"fvOptions"));
360 word divScheme(
"div(phi," + schemesField_ +
")");
363 "laplacian(kappaEff," + schemesField_ +
")"
367 scalar relaxCoeff = 0.0;
368 if (mesh_.relaxEquation(schemesField_))
370 relaxCoeff = mesh_.equationRelaxationFactor(schemesField_);
378 for (label i = 0; i <= nCorr_; i++)
387 fvOptions_(rhoCp_,
s)
390 sEqn.
relax(relaxCoeff);
392 fvOptions_.constrain(sEqn);
394 sEqn.
solve(mesh_.solverDict(schemesField_));
408 mesh_.time().timeName(),
417 for (label i = 0; i <= nCorr_; i++)
425 fvOptions_(trhoCp.ref(),
s)
428 sEqn.
relax(relaxCoeff);
430 fvOptions_.constrain(sEqn);
432 sEqn.
solve(mesh_.solverDict(schemesField_));
438 <<
"Incompatible dimensions for phi: " <<
phi.dimensions() <<
nl
Defines the attributes of an object for which implicit objectRegistry management is supported,...
const dimensionSet dimless(0, 0, 0, 0, 0, 0, 0)
Dimensionless.
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
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)
word name(const complex &c)
Return string representation of complex.
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)
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.