53 const word& sourceName,
54 const word& modelType,
60 film_(mesh.lookupObject<solvers::isothermalFilm>(
solver::typeName)),
61 cloudFieldsTransferred_(false),
62 correctEjection_(false),
80 film_.thermo.he().name(),
88 if (ejection_.valid() && correctEjection_)
94 correctEjection_ =
false;
101 inline Foam::fv::filmCloudTransfer::CloudToFilmTransferRate
117 if (cloudFieldsTransferred_)
120 refCast<const fvMesh>(film_.surfacePatchMap().nbrMesh());
122 const label cloudPatchi =
123 film_.surfacePatchMap().nbrPolyPatch().index();
126 film_.surfacePatchMap().fromNeighbour
128 prop/cloudMesh.
boundary()[cloudPatchi].magSf()
131 tSu.
ref().field() /= film_.VbyA;
132 tSu.
ref().field() /= mesh().time().deltaTValue();
142 const word& fieldName
151 if (fieldName ==
"pi")
154 CloudToFilmTransferRate<scalar>
163 <<
"Support for field " << fieldName <<
" is not implemented"
173 const word& fieldName
181 if (fieldName == film_.alpha.name())
183 eqn += CloudToFilmTransferRate<scalar>(massFromCloud_,
dimMass);
185 if (ejection_.valid())
193 <<
"Support for field " << fieldName <<
" is not implemented"
204 const word& fieldName
212 if (fieldName == film_.thermo.he().name())
214 eqn += CloudToFilmTransferRate<scalar>(energyFromCloud_,
dimEnergy);
216 if (ejection_.valid())
224 <<
"Support for field " << fieldName <<
" is not implemented"
235 const word& fieldName
243 eqn += CloudToFilmTransferRate<vector>(momentumFromCloud_,
dimMomentum);
245 if (ejection_.valid())
255 refCast<const fvMesh>(film_.surfacePatchMap().nbrMesh());
256 const label cloudPatchi = film_.surfacePatchMap().nbrPolyPatch().index();
259 if (massFromCloud_.size() != nCloudPatchFaces)
261 massFromCloud_.setSize(nCloudPatchFaces);
262 momentumFromCloud_.setSize(nCloudPatchFaces);
263 pressureFromCloud_.setSize(nCloudPatchFaces);
264 energyFromCloud_.setSize(nCloudPatchFaces);
268 momentumFromCloud_ =
Zero;
269 pressureFromCloud_ = 0;
270 energyFromCloud_ = 0;
272 cloudFieldsTransferred_ =
true;
275 correctEjection_ =
true;
284 const scalar pressure,
288 massFromCloud_[facei] += mass;
289 momentumFromCloud_[facei] += momentum;
290 pressureFromCloud_[facei] += pressure;
291 energyFromCloud_[facei] += energy;
297 inline Foam::fv::filmCloudTransfer::filmToCloudTransfer
302 return film_.surfacePatchMap().toNeighbour
304 Field<Type>(prop, film_.surfacePatch().faceCells())
311 return ejection_.valid();
318 return filmToCloudTransfer<scalar>
322 *mesh().time().deltaTValue()
323 *film_.alpha()*film_.rho()*ejection_->rate()
332 return filmToCloudTransfer<scalar>(ejection_->diameter());
339 return filmToCloudTransfer<scalar>(film_.delta);
346 return filmToCloudTransfer<vector>(film_.U);
353 return filmToCloudTransfer<scalar>(film_.rho);
360 return filmToCloudTransfer<scalar>(film_.thermo.T());
367 return filmToCloudTransfer<scalar>(film_.thermo.Cp());
376 cloudFieldsTransferred_ =
false;
378 if (ejection_.valid())
380 ejection_->topoChange(map);
390 cloudFieldsTransferred_ =
false;
392 if (ejection_.valid())
394 ejection_->mapMesh(map);
404 cloudFieldsTransferred_ =
false;
406 if (ejection_.valid())
408 ejection_->distribute(map);
415 if (ejection_.valid())
417 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.
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 addSup(fvMatrix< scalar > &eqn, const word &fieldName) const
Add explicit droplet impingement contribution to pressure field.
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.
tmp< Field< scalar > > ejectedMassToCloud() const
Transfer the ejected mass to the cloud.
void parcelFromCloud(const label facei, const scalar mass, const vector &momentum, const scalar pressure, const scalar energy)
Transfer parcel properties from cloud to the film.
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
const dimensionSet dimPressure
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.