64 void Foam::solvers::isothermalFilm::correctCoNum()
68 CoNum = 0.5*
gMax(sumPhi/mesh.V().field())*runTime.deltaTValue();
71 0.5*(
gSum(sumPhi)/
gSum(mesh.V().field()))*runTime.deltaTValue();
78 void Foam::solvers::isothermalFilm::continuityErrors()
82 correctContinuityError();
84 if (mass.
value() > small)
88 runTime.deltaT()*magSf*contErr()
114 bool Foam::solvers::isothermalFilm::initFilmMesh()
119 DynamicList<label> wallPatchIDs_;
121 const polyBoundaryMesh& bm = mesh.boundaryMesh();
125 const polyPatch&
p = bm[
patchi];
127 if (isA<filmWallPolyPatch>(
p))
129 wallPatchIDs_.append(
patchi);
137 <<
"The number of film wall faces in the mesh "
139 <<
" is not equal to the number of cells "
147 <<
"There are no filmWall faces in the mesh"
151 wallPatchIDs.transfer(wallPatchIDs_);
159 const polyPatch&
p = bm[
patchi];
161 if (isA<filmSurfacePolyPatch>(
p))
163 if (surfacePatchID == -1)
170 <<
"More than one filmSurface patch defined: "
171 << surfacePatchID <<
" and " <<
patchi
177 if (surfacePatchID == -1)
179 Info<<
"The filmSurface patch is not defined"
189 const polyPatch& wallp = bm[
patchi];
190 const labelList& fCells = wallp.faceCells();
192 UIndirectList<vector>(nHat_, fCells) = wallp.faceNormals();
193 UIndirectList<scalar>(magSf_, fCells) = wallp.magFaceAreas();
196 nHat_.correctBoundaryConditions();
198 VbyA_.primitiveFieldRef() = mesh.V()/magSf_;
199 VbyA_.correctBoundaryConditions();
207 wordList alphaTypes(delta_.boundaryField().types());
211 if (!delta_.boundaryField()[
patchi].assignable())
213 alphaTypes[
patchi] = fixedValueFvPatchScalarField::typeName;
222 if (surfacePatchID != -1)
244 thermoPtr_(thermoPtr),
245 thermo_(thermoPtr_()),
287 initialised_(initFilmMesh()),
316 deltaWet(
"deltaWet",
dimLength, thermo_.properties()),
341 fvc::
flux(alpha_*thermo_.
rho()*U_)
358 thermocapillary(!
isType<surfaceTensionModels::constant>(surfaceTension())),
380 alphaRhoPhi(alphaRhoPhi_),
420 return mesh.boundary()[surfacePatchID];
427 return refCast<const mappedPatchBase>(
surfacePatch().patch());
469 if (
pimple.correctTransport())
471 momentumTransport->correct();
#define forAll(list, i)
Loop across all elements in list.
Macros for easy insertion into run-time selection tables.
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
static const char *const typeName
IOobject defines the attributes of an object for which implicit objectRegistry management is supporte...
const word & name() const
Return name.
const dictionary & controlDict() const
Return the control dict.
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
T lookupOrDefault(const word &, const T &, bool recursive=false, bool patternMatch=true) const
Find and return a T,.
const Type & value() const
Return const reference to value.
Mesh data needed to do the Finite Volume discretisation.
const fvSchemes & schemes() const
Return the fvSchemes.
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
void setFluxRequired(const word &name) const
Engine which provides mapping between two patches.
Abstract base class for turbulence models (RAS, LES and laminar).
Base-class for fluid thermodynamic properties based on density.
Abstract base class for run-time selectable region solvers.
const Time & runTime
Time.
const fvMesh & mesh
Region mesh.
Solver module for flow of compressible isothermal liquid films.
virtual void thermophysicalPredictor()
Construct and solve the energy equation,.
isothermalFilm(fvMesh &mesh, autoPtr< rhoThermo >)
Construct from region mesh and thermophysical properties.
virtual void postSolve()
Called after the PIMPLE loop at the end of the time-step.
autoPtr< filmCompressible::momentumTransportModel > momentumTransport
Pointer to the momentum transport model.
const volScalarField & alpha
Film volume fraction in the cell layer.
const mappedPatchBase & surfacePatchMap() const
Return the film surface patch region-region map.
virtual void moveMesh()
Called at the start of the PIMPLE loop to move the mesh.
virtual scalar maxDeltaT() const
Return the current maximum time-step for stable solution.
virtual void pressureCorrector()
Construct and solve the pressure equation in the PISO loop.
virtual void postCorrector()
Correct the momentum and thermophysical transport modelling.
const fvPatch & surfacePatch() const
Return the film surface patch.
void readControls()
Read controls.
virtual void preSolve()
Called at the start of the time-step, before the PIMPLE loop.
virtual ~isothermalFilm()
Destructor.
'Patch' on surface as subset of triSurface.
Abstract base-class for surface tension models which return the surface tension coefficient field.
This boundary condition applies a zero-gradient condition from the patch internal field onto the patc...
Foam::fvModels & fvModels(Foam::fvModels::New(mesh))
pimpleControl pimple(mesh)
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
Calculate the first temporal derivative.
Calculate the divergence of the given field.
Calculate the face-flux of the given field.
Surface integrate surfaceField creating a volField. Surface sum a surfaceField creating a volField.
Volume integrate volField creating a volField.
volScalarField alpha(IOobject("alpha", runTime.name(), mesh, IOobject::READ_IF_PRESENT, IOobject::AUTO_WRITE), lambda *max(Ua &U, zeroSensitivity))
tmp< VolField< Type > > surfaceSum(const SurfaceField< Type > &ssf)
dimensioned< Type > domainIntegrate(const VolField< Type > &vf)
addToRunTimeSelectionTable(solver, compressibleMultiphaseVoF, fvMesh)
defineTypeNameAndDebug(compressibleMultiphaseVoF, 0)
errorManipArg< error, int > exit(error &err, const int errNo=1)
List< word > wordList
A List of words.
Type gSum(const FieldField< Field, Type > &f)
List< label > labelList
A List of labels.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Ostream & endl(Ostream &os)
Add newline and flush stream.
const dimensionSet dimless
bool isType(const Type &t)
Check the typeid.
const dimensionSet dimLength
layerAndWeight min(const layerAndWeight &a, const layerAndWeight &b)
T returnReduce(const T &Value, const BinaryOp &bop, const int tag=Pstream::msgType(), const label comm=UPstream::worldComm)
dimensioned< scalar > mag(const dimensioned< Type > &)
tmp< DimensionedField< TypeR, GeoMesh > > New(const tmp< DimensionedField< TypeR, GeoMesh >> &tdf1, const word &name, const dimensionSet &dimensions)
const dimensionSet dimArea
word name(const complex &)
Return a string representation of a complex.
Type gMax(const FieldField< Field, Type > &f)
fluidMulticomponentThermo & thermo