53 const word& sourceName,
54 const word& modelType,
60 film_(mesh.lookupObject<solvers::isothermalFilm>(
solver::typeName)),
61 cloudFieldsTransferred_(false),
62 correctEjection_(false),
79 film_.thermo.he().name(),
87 if (ejection_.valid() && correctEjection_)
93 correctEjection_ =
false;
100 inline Foam::fv::filmCloudTransfer::CloudToFilmTransferRate
116 if (cloudFieldsTransferred_)
118 const fvMesh& cloudMesh = film_.surfacePatchMap().nbrMesh();
119 const label cloudPatchi = film_.surfacePatchMap().nbrFvPatch().index();
122 film_.surfacePatchMap().fromNeighbour
124 prop/cloudMesh.
boundary()[cloudPatchi].magSf()
127 tSu.
ref().primitiveFieldRef() /= film_.VbyA;
128 tSu.
ref().primitiveFieldRef() /= mesh().time().deltaTValue();
147 if (&
alpha == &film_.alpha && &eqn.
psi() == &film_.alpha)
149 eqn += CloudToFilmTransferRate<scalar>(massFromCloud_,
dimMass);
151 if (ejection_.valid())
159 <<
"Support for field " <<
alpha.name() <<
" is not implemented"
178 if (&
he == &film_.thermo.he() && &eqn.
psi() == &film_.thermo.he())
180 eqn += CloudToFilmTransferRate<scalar>(energyFromCloud_,
dimEnergy);
182 if (ejection_.valid())
190 <<
"Support for field " <<
he.name() <<
" is not implemented"
209 if (&
U == &film_.U && &
U == &film_.U)
211 eqn += CloudToFilmTransferRate<vector>(momentumFromCloud_,
dimMomentum);
213 if (ejection_.valid())
221 <<
"Support for field " <<
U.name() <<
" is not implemented"
229 const fvMesh& cloudMesh = film_.surfacePatchMap().nbrMesh();
230 const label cloudPatchi = film_.surfacePatchMap().nbrFvPatch().index();
233 if (massFromCloud_.size() != nCloudPatchFaces)
235 massFromCloud_.setSize(nCloudPatchFaces);
236 momentumFromCloud_.setSize(nCloudPatchFaces);
237 energyFromCloud_.setSize(nCloudPatchFaces);
241 momentumFromCloud_ =
Zero;
242 energyFromCloud_ = 0;
244 cloudFieldsTransferred_ =
true;
247 correctEjection_ =
true;
259 massFromCloud_[facei] += mass;
260 momentumFromCloud_[facei] += momentum;
261 energyFromCloud_[facei] += energy;
267 inline Foam::fv::filmCloudTransfer::filmToCloudTransfer
272 return film_.surfacePatchMap().toNeighbour
274 Field<Type>(prop, film_.surfacePatch().faceCells())
281 return ejection_.valid();
288 return filmToCloudTransfer<scalar>
292 *mesh().time().deltaTValue()
293 *film_.alpha()*film_.rho()*ejection_->rate()
302 return filmToCloudTransfer<scalar>(ejection_->diameter());
309 return filmToCloudTransfer<scalar>(film_.delta);
316 return filmToCloudTransfer<vector>(film_.U);
323 return filmToCloudTransfer<scalar>(film_.rho);
330 return filmToCloudTransfer<scalar>(film_.thermo.T());
337 return filmToCloudTransfer<scalar>(film_.thermo.Cp());
346 cloudFieldsTransferred_ =
false;
348 if (ejection_.valid())
350 ejection_->topoChange(map);
360 cloudFieldsTransferred_ =
false;
362 if (ejection_.valid())
364 ejection_->mapMesh(map);
374 cloudFieldsTransferred_ =
false;
376 if (ejection_.valid())
378 ejection_->distribute(map);
385 if (ejection_.valid())
387 ejection_->movePoints();
Macros for easy insertion into run-time selection tables.
Pre-declare SubField and related Field type.
Generic GeometricField class.
A List with indirect addressing.
label size() const
Return the number of elements in the UPtrList.
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
A list of keyword definitions, which are a keyword followed by any number of values (e....
Dimension set for the base types.
Generic dimensioned Type class.
A special matrix type and solver, designed for finite volume solutions of scalar equations....
Mesh data needed to do the Finite Volume discretisation.
const fvBoundaryMesh & boundary() const
Return reference to boundary mesh.
Finite volume model abstract base class.
Film<->cloud transfer model.
virtual bool movePoints()
Update for mesh motion.
virtual wordList addSupFields() const
Return the list of fields for which the option adds source term.
tmp< Field< scalar > > deltaToCloud() const
Transfer the film delta field to the cloud.
void resetFromCloudFields()
Reset the fields accumulated cloud transfer fields.
tmp< Field< scalar > > TToCloud() const
Transfer the film temperature field to the cloud.
virtual void correct()
Solve the film and update the sources.
virtual void addSup(const volScalarField &rho, const volScalarField &alpha, fvMatrix< scalar > &eqn) const
Add source to phase continuity equation.
tmp< Field< scalar > > CpToCloud() const
Transfer the film heat capacity field to the cloud.
tmp< Field< scalar > > ejectedDiameterToCloud() const
Transfer the ejected droplet diameter to the cloud.
virtual void topoChange(const polyTopoChangeMap &)
Update topology using the given map.
virtual void distribute(const polyDistributionMap &)
Redistribute or update using the given distribution map.
tmp< Field< vector > > UToCloud() const
Transfer the film velocity field to the cloud.
virtual void mapMesh(const polyMeshMap &)
Update from another mesh using the given map.
filmCloudTransfer(const word &sourceName, const word &modelType, const fvMesh &mesh, const dictionary &dict)
Construct from explicit source name and mesh.
void parcelFromCloud(const label facei, const scalar mass, const vector &momentum, const scalar energy)
Transfer parcel properties from cloud to the film.
tmp< Field< scalar > > ejectedMassToCloud() const
Transfer the ejected mass to the cloud.
bool ejecting() const
Return true if the film is ejecting to the cloud.
tmp< Field< scalar > > rhoToCloud() const
Transfer the film density field to the cloud.
Class containing mesh-to-mesh mapping information after a mesh distribution where we send parts of me...
Class containing mesh-to-mesh mapping information.
Class containing mesh-to-mesh mapping information after a change in polyMesh topology.
Abstract base class for run-time selectable region solvers.
A class for managing temporary objects.
T & ref() const
Return non-const reference or generate a fatal error.
A class for handling words, derived from string.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
Calculate the matrix for implicit and explicit sources.
volScalarField alpha(IOobject("alpha", runTime.name(), mesh, IOobject::READ_IF_PRESENT, IOobject::AUTO_WRITE), lambda *max(Ua &U, zeroSensitivity))
autoPtr< CompressibleMomentumTransportModel > New(const volScalarField &rho, const volVectorField &U, const surfaceScalarField &phi, const viscosity &viscosity)
addToRunTimeSelectionTable(fvConstraint, bound, dictionary)
defineTypeNameAndDebug(bound, 0)
tmp< fvMatrix< Type > > Sp(const volScalarField::Internal &, const VolField< Type > &)
errorManipArg< error, int > exit(error &err, const int errNo=1)
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
const dimensionSet dimEnergy
Ostream & endl(Ostream &os)
Add newline and flush stream.
const dimensionSet dimMomentum
const dimensionSet dimTime
const dimensionSet dimVolume
typename VolField< Type >::Internal VolInternalField
const dimensionSet dimMass
fileType type(const fileName &, const bool checkVariants=true, const bool followLink=true)
Return the file type: directory or file.