35 namespace regionModels
37 namespace surfaceFilmModels
68 const scalar rMin = 1
e-6;
72 forAll(definedPatchRadii_, i)
75 const scalar definedInvR1 =
76 1.0/
max(rMin, definedPatchRadii_[i].
second());
81 const scalar rMax = 1e6;
84 if (
mag(invR1[i]) < 1/rMax)
114 const label cellO = own[facei];
115 const label cellN = nbr[facei];
117 if (phi[facei] > phiMax[cellO])
119 phiMax[cellO] = phi[facei];
120 cosAngle[cellO] = -gHat_ & nf[facei];
122 if (-phi[facei] > phiMax[cellN])
124 phiMax[cellN] = -phi[facei];
125 cosAngle[cellN] = -gHat_ & -nf[facei];
137 const label celli = faceCells[i];
138 if (phip[i] > phiMax[celli])
140 phiMax[celli] = phip[i];
141 cosAngle[celli] = -gHat_ & nf[i];
159 zeroGradientFvPatchScalarField::typeName
162 volCosAngle.correctBoundaryConditions();
166 return max(
min(cosAngle, scalar(1)), scalar(-1));
182 coeffDict_.lookupOrDefault<scalar>(
"deltaByR1Min", scalar(0))
184 deltaStable_(coeffDict_.lookupOrDefault(
"deltaStable", scalar(0))),
185 definedPatchRadii_(),
189 if (magG_ < rootVSmall)
192 <<
"Acceleration due to gravity must be non-zero" 196 gHat_ = film.
g().
value()/magG_;
200 coeffDict_.lookup(
"definedPatchRadii")
215 if (!uniquePatchIDs.found(patchi))
217 const scalar radius = prIn[i].second();
220 uniquePatchIDs.insert(patchi);
225 definedPatchRadii_.
transfer(prData);
245 refCast<const kinematicSingleLayer>(this->
film());
261 const scalar Fthreshold = 1
e-10;
269 const scalar R1 = 1.0/(invR1[i] + rootVSmall);
270 const scalar R2 = R1 + delta[i];
273 const scalar Fi = -delta[i]*rho[i]*magSqrU[i]*72.0/60.0*invR1[i];
277 - 0.5*rho[i]*
magG_*invR1[i]*(
sqr(R1) -
sqr(R2))*cosAngle[i];
280 const scalar Fs = sigma[i]/R2;
282 Fnet[i] = Fi + Fb + Fs;
284 if (Fnet[i] + Fthreshold < 0 && delta[i] >
deltaStable_)
292 massToEject = separated*availableMass;
293 diameterToEject = separated*
delta;
294 availableMass -= separated*availableMass;
298 if (debug && mesh.time().writeTime())
305 mesh.time().timeName(),
311 zeroGradientFvPatchScalarField::typeName
314 volFnet.correctBoundaryConditions();
const polyBoundaryMesh & boundaryMesh() const
Return boundary mesh.
labelList first(const UList< labelPair > &p)
tmp< GeometricField< typename outerProduct< vector, Type >::type, fvPatchField, volMesh >> grad(const GeometricField< Type, fvsPatchField, surfaceMesh > &ssf)
const volVectorField & U() const
Return the film velocity [m/s].
#define forAll(list, i)
Loop across all elements in list.
const surfaceVectorField & Sf() const
Return cell face area vectors.
layerAndWeight max(const layerAndWeight &a, const layerAndWeight &b)
tmp< scalarField > calcCosAngle(const surfaceScalarField &phi) const
Calculate the cosine of the angle between gravity vector and.
Base class for surface film models.
errorManipArg< error, int > exit(error &err, const int errNo=1)
Kinematic form of single-cell layer surface film model.
A list of keyword definitions, which are a keyword followed by any number of values (e...
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
A 2-tuple for storing two objects of different types.
scalar deltaStable_
Stable film thickness - drips only formed if thickness.
const Boundary & boundaryField() const
Return const-reference to the boundary field.
T & ref() const
Return non-const reference or generate a fatal error.
tmp< vectorField > nf() const
Return face normals.
dimensionedSymmTensor sqr(const dimensionedVector &dv)
Base class for film ejection models, handling mass transfer from the film.
void size(const label)
Override size to be inconsistent with allocated storage.
static tmp< GeometricField< scalar, fvPatchField, volMesh > > New(const word &name, const Internal &, const PtrList< fvPatchField< scalar >> &)
Return a temporary field constructed from name,.
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
#define forAllReverse(list, i)
Reverse loop across all elements in list.
const dimensionSet dimless
scalar magG_
Magnitude of gravity vector.
const Time & time() const
Return the top-level database.
tmp< volScalarField > calcInvR1(const volVectorField &U) const
Calculate local (inverse) radius of curvature.
Macros for easy insertion into run-time selection tables.
dimensioned< Type > sum(const DimensionedField< Type, GeoMesh > &df)
const surfaceFilmRegionModel & film() const
Return const access to the film surface film model.
const labelUList & neighbour() const
Internal face neighbour.
bool findStrings(const wordReListMatcher &matcher, const std::string &str)
Return true if string matches one of the regular expressions.
bool writeTime() const
Return true if this is a write time.
addToRunTimeSelectionTable(ejectionModel, BrunDrippingEjection, dictionary)
const dimensionedScalar sigma
Stefan-Boltzmann constant: default SI units: [W/m^2/K^4].
A 1D vector of objects of type <T> that resizes itself as necessary to accept the new objects...
Calculate the gradient of the given field.
static word timeName(const scalar, const int precision=curPrecision_)
Return time name of given scalar time.
virtual const labelUList & faceCells() const
Return faceCells.
wordList names() const
Return a list of patch names.
void append(const T &)
Append an element at the end of the list.
const Type & value() const
Return const reference to value.
const volVectorField & nHat() const
Return the patch normal vectors.
const surfaceScalarField & phi() const
Return the film flux [kg m/s].
const fvMesh & regionMesh() const
Return the region mesh database.
layerAndWeight min(const layerAndWeight &a, const layerAndWeight &b)
const dimensionSet dimForce
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
const dimensionedVector & g() const
Return the acceleration due to gravity.
dimensioned< scalar > magSqr(const dimensioned< Type > &)
const surfaceScalarField & magSf() const
Return cell face area magnitudes.
Internal::FieldType & primitiveFieldRef()
Return a reference to the internal field.
void addToEjectedMass(const scalar dMass)
Add to ejected mass.
const dimensionSet dimVelocity
const volScalarField & delta() const
Return const access to the film thickness [m].
tmp< volScalarField > sigma() const
Return the surface tension coefficient [kg/s^2].
const labelUList & owner() const
Internal face owner.
labelList second(const UList< labelPair > &p)
virtual ~curvatureSeparation()
Destructor.
const fvPatch & patch() const
Return patch.
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.
Mesh data needed to do the Finite Volume discretisation.
fileType type(const fileName &, const bool checkVariants=true, const bool followLink=true)
Return the file type: directory or file.
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
dimensioned< scalar > mag(const dimensioned< Type > &)
const doubleScalar e
Elementary charge.
const volScalarField & rho() const
Return the film density [kg/m^3].
A class for managing temporary objects.
An indexed form of CGAL::Triangulation_face_base_2<K> used to keep track of the vertices in the trian...
void transfer(List< T > &)
Transfer contents of the argument List into this.
IOobject defines the attributes of an object for which implicit objectRegistry management is supporte...
defineTypeNameAndDebug(kinematicSingleLayer, 0)
curvatureSeparation(surfaceFilmRegionModel &film, const dictionary &dict)
Construct from surface film model.
scalar deltaByR1Min_
Minimum gravity driven film thickness (non-dimensionalised delta/R1)
An abstract base class with a fat-interface to all derived classes covering all possible ways in whic...