54 const word& sourceName,
55 const word& modelType,
61 VoF_(mesh.lookupObject<solvers::compressibleVoF>(
solver::typeName)),
62 filmPatchName_(
dict.lookup(
"filmPatch")),
63 filmPatchi_(mesh.boundaryMesh().findPatchID(filmPatchName_)),
64 phaseName_(
dict.lookup(
"phase")),
67 phaseName_ == VoF_.
mixture.phase1Name()
73 phaseName_ == VoF_.
mixture.phase1Name()
80 dict.lookupOrDefault<scalar>(
"deltaFactorToFilm", 0.5)
84 dict.lookupOrDefault<scalar>(
"alphaToFilm", 0.1)
88 dict.lookupOrDefault<scalar>(
"transferRateCoeff", 0.1)
109 thermo_.rho()().
name(),
118 if (curTimeIndex_ == mesh().time().
timeIndex())
123 curTimeIndex_ = mesh().time().timeIndex();
126 const scalar deltaT = mesh().time().deltaTValue();
136 mesh().boundary()[filmPatchi_].deltaCoeffs();
138 const labelList& faceCells = mesh().boundary()[filmPatchi_].faceCells();
143 const mappedPatchBase& VoFFilmPatchMap = refCast<const mappedPatchBase>
166 transferRate_ =
Zero;
170 const label celli = faceCells[facei];
175 &&
delta[facei] < 2*deltaFactorToFilm_/deltaCoeffs[facei]
176 &&
alpha[facei] < alphaToFilm_
179 transferRate_[celli] = transferRateCoeff_/deltaT;
185 template<
class Type,
class TransferRateFunc>
187 inline Foam::fv::VoFFilmTransfer::filmVoFTransferRate
189 TransferRateFunc transferRateFunc,
193 const mappedPatchBase& VoFFilmPatchMap = refCast<const mappedPatchBase>
195 mesh().boundaryMesh()[filmPatchi_]
202 refCast<const fvMesh>(VoFFilmPatchMap.
nbrMesh())
210 if (isType<filmVoFTransfer>(
fvModels[i]))
212 filmVoFPtr = &refCast<const filmVoFTransfer>(
fvModels[i]);
219 <<
"Cannot find filmVoFTransfer fvModel for the film region "
237 (filmVoFPtr->*transferRateFunc)()
240 return tSu/mesh().V();
247 const word& fieldName
255 if (fieldName == alpha_.name())
258 filmVoFTransferRate<scalar>
268 <<
"Support for field " << fieldName <<
" is not implemented"
278 const word& fieldName
286 if (fieldName == thermo_.rho()().name())
289 filmVoFTransferRate<scalar>
299 <<
"Support for field " << fieldName <<
" is not implemented"
310 const word& fieldName
318 if (fieldName == thermo_.he().name())
321 filmVoFTransferRate<scalar>
331 <<
"Support for field " << fieldName <<
" is not implemented"
341 const word& fieldName
350 filmVoFTransferRate<vector>
355 -
fvm::Sp(alpha_()*thermo_.rho()()*transferRate_, eqn.
psi());
359 template<
class Type,
class FieldType>
365 const labelList& faceCells = mesh().boundary()[filmPatchi_].faceCells();
373 alpha_()*transferRate_*mesh().V()*
f,
384 return TransferRate<scalar>(thermo_.rho()());
391 return TransferRate<scalar>(thermo_.rho()()*thermo_.he()());
398 return TransferRate<vector>(thermo_.rho()()*VoF_.U());
404 transferRate_.setSize(mesh().nCells());
410 transferRate_.setSize(mesh().nCells());
416 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.
const word & name() const
Return name.
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.
Finite volume model abstract base class.
Film<->VoF 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< scalarField > heTransferRate() const
Return the energy transfer rate.
VoFFilmTransfer(const word &sourceName, const word &modelType, const fvMesh &mesh, const dictionary &dict)
Construct from explicit source name and mesh.
virtual void correct()
Solve the film and update the sources.
virtual void addSup(fvMatrix< scalar > &eqn, const word &fieldName) const
Add implicit contribution to phase-fraction equation.
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.
Film<->VoF transfer model.
tmp< scalarField > heTransferRate() const
Return the energy transfer rate.
tmp< scalarField > transferRate() const
Return the volume transfer rate.
tmp< vectorField > UTransferRate() const
Return the momentum transfer rate.
tmp< scalarField > rhoTransferRate() const
Return the mass transfer rate.
Engine which provides mapping between two patches.
const polyPatch & nbrPolyPatch() const
Get the patch to map from.
const polyMesh & nbrMesh() const
Get the mesh for the region to map from.
tmp< Field< Type > > fromNeighbour(const Field< Type > &nbrFld) const
Map/interpolate the neighbour patch field to this patch.
const Type & lookupObject(const word &name) const
Lookup and return the object of the given Type and name.
label index() const
Return the index of this patch in the boundaryMesh.
Class containing mesh-to-mesh mapping information after a mesh distribution where we send parts of me...
Class containing mesh-to-mesh mapping information.
A patch is a list of labels that address the faces in the global face list.
const polyBoundaryMesh & boundaryMesh() const
Return boundaryMesh reference.
Class containing mesh-to-mesh mapping information after a change in polyMesh topology.
Abstract base class for run-time selectable region solvers.
Solver module for flow of compressible isothermal liquid films.
const volScalarField & delta
Film thickness.
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 dimTime
const dimensionSet dimVolume
typename VolField< Type >::Internal VolInternalField
const dimensionSet dimMass
const dimensionSet dimVelocity
word name(const complex &)
Return a string representation of a complex.
fileType type(const fileName &, const bool checkVariants=true, const bool followLink=true)
Return the file type: directory or file.
faceListList boundary(nPatches)