119 const bool useOldTime =
120 psi().hasStoredOldTimes()
121 &&
psi().nOldTimes(
false)
124 LagrangianMesh::fractionName
134 if (!psiInterpolationPtr_.valid())
136 psiInterpolationPtr_ =
145 if (useOldTime && !psi0InterpolationPtr_.valid())
147 psi0InterpolationPtr_ =
156 tmp<Field<Type>> tpsic =
157 psiInterpolationPtr_->interpolate
159 subMesh.
sub(
mesh.coordinates()),
169 tmp<Field<Type>> tpsi0c =
170 psi0InterpolationPtr_->interpolate
172 subMesh.
sub(
mesh.coordinates()),
178 SubField<scalar> fraction =
182 .lookupObject<LagrangianScalarInternalDynamicField>
184 LagrangianMesh::fractionName
188 tpsic = (1 - fraction)*tpsi0c + fraction*tpsic;
192 return tmp<LagrangianSubField<Type>>
194 new LagrangianSubField<Type>
219 name_(clouds::coupled::carrierName(
psi.
name())),
220 functorPtr_(nullptr),
222 psiInterpolationPtr_(nullptr),
223 psi0InterpolationPtr_(nullptr)
235 psiInterpolationPtr_(nullptr),
236 psi0InterpolationPtr_(nullptr)
247 tpsi_ = functorPtr_->operator()();
266 if (tpsi_.valid() && tpsi_.isTmp())
270 tpsi_.ref().nullOldestTime();
274 tpsi_.ref().oldTime();
275 tpsi_.ref() = functorPtr_->operator()();
279 psiInterpolationPtr_.clear();
280 psi0InterpolationPtr_.clear();
Class to store an evaluation function.
Function(const word &name, const F &f)
Construct from a name and a function.
virtual tmp< VolField< Type > > operator()() const
Evaluate the field.
virtual ~Function()
Destructor.
virtual ~Functor()
Destructor.
virtual tmp< VolField< Type > > operator()() const =0
Evaluate the field.
A field interpolated from the carrier to the cloud. Uses CloudDerivedField to provide flexible access...
const VolField< Type > & psi() const
Access the carrier field.
void reset(const bool predict)
Reset.
const word & name() const
Carrier field name.
CarrierField(const VolField< Type > &)
Construct from a reference to a carrier field.
A field derived from other state fields of the cloud. Stores and virtualises a function or a method w...
void clear(const bool final)
Clear.
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
Generic GeometricField class.
static tmp< GeometricField< Type, GeoMesh, PrimitiveField > > New(const word &name, const Internal &, const PtrList< Patch > &, const HashPtrTable< Source > &=HashPtrTable< Source >())
Return a temporary field constructed from name,.
Class containing Lagrangian geometry and topology.
const LagrangianSchemes & schemes() const
Access the schemes.
Simple wrapper to provide an optional reference to a Lagrangian model.
ITstream & interpolation(const word &name) const
Get the interpolation scheme for the given field name.
Mesh that relates to a sub-section of a Lagrangian mesh. This is used to construct fields that relate...
SubList< Type > sub(const List< Type > &list) const
Return a sub-list corresponding to this sub-mesh.
LagrangianGroup group() const
Return the group.
const LagrangianMesh & mesh() const
Return the mesh.
const word & name() const
Return const reference to name.
const Time & time() const
Return the top-level database.
bool foundObject(const word &name) const
Is the named Type in registry.
A class for managing temporary objects.
bool isTmp() const
Return true if this is really a temporary object.
A class for handling words, derived from string.
Foam::fvMesh mesh(Foam::IOobject(regionName, runTime.name(), runTime, Foam::IOobject::MUST_READ), false)
const volScalarField & psi
autoPtr< CompressibleMomentumTransportModel > New(const volScalarField &rho, const volVectorField &U, const surfaceScalarField &phi, const viscosity &viscosity)
const dimensionedScalar F
Faraday constant: default SI units: [C/mol].
static tmp< SurfaceField< Type > > interpolate(const VolField< Type > &tvf, const surfaceScalarField &faceFlux, Istream &schemeData)
Interpolate field onto faces using scheme given by Istream.
const HashTable< dimensionSet > & dimensions()
Get the table of dimension sets.
word name(const LagrangianState state)
Return a string representation of a Lagrangian state enumeration.