55 const word& sourceName,
56 const word& modelType,
62 film_(mesh.lookupObject<solvers::isothermalFilm>(
solver::typeName)),
66 dict.lookupOrDefault<scalar>(
"deltaFactorToVoF", 1.0)
70 dict.lookupOrDefault<scalar>(
"alphaToVoF", 0.5)
74 dict.lookupOrDefault<scalar>(
"transferRateCoeff", 0.1)
95 film_.thermo.he().name(),
103 if (curTimeIndex_ == mesh().time().
timeIndex())
108 curTimeIndex_ = mesh().time().timeIndex();
110 const scalar deltaT = mesh().time().deltaTValue();
115 const labelList& faceCells = film_.surfacePatch().faceCells();
129 const label patchiVoF = film_.surfacePatchMap().nbrPolyPatch().index();
135 film_.surfacePatchMap().fromNeighbour
143 film_.surfacePatchMap().fromNeighbour
150 transferRate_ =
Zero;
154 const label celli = faceCells[facei];
158 delta[celli] > 2*deltaFactorToVoF_/deltaCoeffsVoF[facei]
159 || alphaVoF[facei] > alphaToVoF_
162 transferRate_[celli] = transferRateCoeff_/deltaT;
177 if (isType<VoFFilmTransfer>(
fvModels[i]))
181 refCast<const VoFFilmTransfer>(
fvModels[i])
186 VoFFilm.filmPatchIndex()
187 == film_.surfacePatchMap().nbrPolyPatch().index()
190 VoFFilmPtr = &VoFFilm;
198 <<
"Cannot find VoFFilmTransfer fvModel for this film "
199 "in VoF region " << film_.surfacePatchMap().nbrMesh().name()
207 template<
class Type,
class TransferRateFunc>
209 inline Foam::fv::filmVoFTransfer::VoFToFilmTransferRate
211 TransferRateFunc transferRateFunc,
219 refCast<const fvMesh>(film_.surfacePatchMap().nbrMesh())
234 film_.surfacePatchMap().fromNeighbour
236 (VoFFilm(
fvModels).*transferRateFunc)()
239 return tSu/mesh().V();
247 const word& fieldName
255 if (fieldName == film_.alpha.name())
258 VoFToFilmTransferRate<scalar>
268 <<
"Support for field " << fieldName <<
" is not implemented"
279 const word& fieldName
287 if (fieldName == film_.thermo.he().name())
290 VoFToFilmTransferRate<scalar>
300 <<
"Support for field " << fieldName <<
" is not implemented"
311 const word& fieldName
320 VoFToFilmTransferRate<vector>
329 template<
class Type,
class FieldType>
335 const labelList& faceCells = film_.surfacePatch().faceCells();
343 film_.alpha()*transferRate_*mesh().V()*
f,
354 return TransferRate<scalar>(
oneField());
361 return TransferRate<scalar>(film_.thermo.rho()());
368 return TransferRate<scalar>(film_.thermo.rho()()*film_.thermo.he()());
375 return TransferRate<vector>(film_.thermo.rho()()*film_.U());
381 transferRate_.setSize(mesh().nCells());
387 transferRate_.setSize(mesh().nCells());
393 transferRate_.setSize(mesh().nCells());
#define forAll(list, i)
Loop across all elements in list.
Macros for easy insertion into run-time selection tables.
Generic GeometricField class.
const Boundary & boundaryField() const
Return const-reference to the boundary field.
A List with indirect addressing.
A list of keyword definitions, which are a keyword followed by any number of values (e....
static autoPtr< dictionary > New(Istream &)
Construct top-level dictionary on freestore from Istream.
Dimension set for the base types.
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<->VoF transfer model.
tmp< scalarField > heTransferRate() const
Return the energy transfer rate.
tmp< vectorField > UTransferRate() const
Return the momentum transfer rate.
const volScalarField & alpha() const
tmp< scalarField > rhoTransferRate() const
Return the mass transfer rate.
Film<->VoF transfer model.
filmVoFTransfer(const word &sourceName, const word &modelType, const fvMesh &mesh, const dictionary &dict)
Construct from explicit source name and mesh.
virtual bool movePoints()
Update for mesh motion.
virtual wordList addSupFields() const
Return the list of fields for which the option adds source term.
tmp< scalarField > heTransferRate() const
Return the energy transfer rate.
virtual void correct()
Solve the film and update the sources.
tmp< scalarField > transferRate() const
Return the volume transfer rate.
virtual void addSup(const volScalarField &alpha, fvMatrix< scalar > &eqn, const word &fieldName) const
Add explicit contribution to phase continuity.
virtual void topoChange(const polyTopoChangeMap &)
Update topology using the given map.
virtual void distribute(const polyDistributionMap &)
Redistribute or update using the given distribution map.
virtual void mapMesh(const polyMeshMap &)
Update from another mesh using the given map.
tmp< vectorField > UTransferRate() const
Return the momentum transfer rate.
tmp< scalarField > rhoTransferRate() const
Return the mass transfer rate.
A class representing the concept of a field of 1 used to avoid unnecessary manipulations for objects ...
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.
Foam::fvModels & fvModels() const
Return the fvModels that are created on demand.
const fvMesh & mesh
Region mesh.
Solver module for for 2 compressible, non-isothermal immiscible fluids using a VOF (volume of fluid) ...
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.
Foam::fvModels & fvModels(Foam::fvModels::New(mesh))
#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 dimless
const dimensionSet dimMomentum
const dimensionSet dimTime
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.