32 #include "surfaceInterpolate.H" 42 namespace regionModels
44 namespace surfaceFilmModels
84 const scalar rMin = 1
e-6;
87 forAll(definedPatchRadii_, i)
90 scalar definedInvR1 = 1.0/
max(rMin, definedPatchRadii_[i].second());
95 const scalar rMax = 1e6;
98 if (
mag(invR1[i]) < 1/rMax)
127 label cellO = own[facei];
128 label cellN = nbr[facei];
130 if (phi[facei] > phiMax[cellO])
132 phiMax[cellO] = phi[facei];
133 cosAngle[cellO] = -gHat_ & nf[facei];
135 if (-phi[facei] > phiMax[cellN])
137 phiMax[cellN] = -phi[facei];
138 cosAngle[cellN] = -gHat_ & -nf[facei];
150 label celli = faceCells[i];
151 if (phip[i] > phiMax[celli])
153 phiMax[celli] = phip[i];
154 cosAngle[celli] = -gHat_ & nf[i];
208 zeroGradientFvPatchScalarField::typeName
211 volCosAngle.correctBoundaryConditions();
215 return max(
min(cosAngle, scalar(1.0)), scalar(-1.0));
221 curvatureSeparation::curvatureSeparation
229 deltaByR1Min_(coeffDict_.lookupOrDefault<scalar>(
"deltaByR1Min", 0.0)),
230 definedPatchRadii_(),
234 if (magG_ < ROOTVSMALL)
237 <<
"Acceleration due to gravity must be non-zero" 241 gHat_ = owner.
g().
value()/magG_;
257 if (!uniquePatchIDs.found(patchi))
259 const scalar radius = prIn[i].second();
262 uniquePatchIDs.insert(patchi);
267 definedPatchRadii_.
transfer(prData);
287 refCast<const kinematicSingleLayer>(this->
owner());
301 const scalar Fthreshold = 1
e-10;
308 scalar R1 = 1.0/(invR1[i] + ROOTVSMALL);
309 scalar R2 = R1 + delta[i];
312 scalar Fi = -delta[i]*rho[i]*magSqrU[i]*72.0/60.0*invR1[i];
316 - 0.5*rho[i]*
magG_*invR1[i]*(
sqr(R1) -
sqr(R2))*cosAngle[i];
319 scalar Fs = sigma[i]/R2;
321 Fnet[i] = Fi + Fb + Fs;
323 if (Fnet[i] + Fthreshold < 0)
331 massToInject = separated*availableMass;
332 diameterToInject = separated*
delta;
333 availableMass -= separated*availableMass;
337 if (debug && mesh.time().writeTime())
344 mesh.time().timeName(),
350 zeroGradientFvPatchScalarField::typeName
353 volFnet.correctBoundaryConditions();
tmp< GeometricField< typename outerProduct< vector, Type >::type, fvPatchField, volMesh >> grad(const GeometricField< Type, fvsPatchField, surfaceMesh > &ssf)
#define forAll(list, i)
Loop across all elements in list.
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 surfaceVectorField & Sf() const
Return cell face area vectors.
errorManipArg< error, int > exit(error &err, const int errNo=1)
wordList names() const
Return a list of patch names.
const double e
Elementary charge.
A list of keyword definitions, which are a keyword followed by any number of values (e...
dimensioned< Type > max(const dimensioned< Type > &, const dimensioned< Type > &)
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
A 2-tuple for storing two objects of different types.
dimensionedSymmTensor sqr(const dimensionedVector &dv)
void size(const label)
Override size to be inconsistent with allocated storage.
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
const dimensionedVector & g() const
Return the accleration due to gravity.
const dimensionedScalar sigma
Stefan-Boltzmann constant: default SI units: [W/m2/K4].
#define forAllReverse(list, i)
Reverse loop across all elements in list.
virtual const volVectorField & U() const
Return the film velocity [m/s].
const Type & value() const
Return const reference to value.
virtual const volScalarField & rho() const
Return the film density [kg/m3].
static word timeName(const scalar, const int precision=precision_)
Return time name of given scalar time.
Operations on lists of strings.
bool writeTime() const
Return true if this is a write time.
scalar magG_
Magnitude of gravity vector.
const polyBoundaryMesh & boundaryMesh() const
Return boundary mesh.
Macros for easy insertion into run-time selection tables.
dimensioned< Type > sum(const DimensionedField< Type, GeoMesh > &df)
const fvMesh & regionMesh() const
Return the region mesh database.
bool findStrings(const wordReListMatcher &matcher, const std::string &str)
Return true if string matches one of the regular expressions.
GeometricField< scalar, fvPatchField, volMesh > volScalarField
addToRunTimeSelectionTable(surfaceFilmModel, kinematicSingleLayer, mesh)
tmp< volScalarField > calcInvR1(const volVectorField &U) const
Calculate local (inverse) radius of curvature.
A 1D vector of objects of type <T> that resizes itself as necessary to accept the new objects...
const Boundary & boundaryField() const
Return const-reference to the boundary field.
const labelUList & neighbour() const
Internal face neighbour.
Calculate the gradient of the given field.
const volScalarField & delta() const
Return const access to the film thickness / [m].
void append(const T &)
Append an element at the end of the list.
const surfaceScalarField & magSf() const
Return cell face area magnitudes.
tmp< scalarField > calcCosAngle(const surfaceScalarField &phi) const
Calculate the cosine of the angle between gravity vector and.
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
Calculate the divergence of the given field.
void addToInjectedMass(const scalar dMass)
Add to injected mass.
dimensioned< scalar > magSqr(const dimensioned< Type > &)
const dimensionSet dimForce
Internal::FieldType & primitiveFieldRef()
Return a reference to the internal field.
const volScalarField & sigma() const
Return const access to the surface tension / [m/s2].
virtual const labelUList & faceCells() const
Return faceCells.
virtual const volVectorField & nHat() const
Return the patch normal vectors.
Base class for film injection models, handling mass transfer from the film.
const fvPatch & patch() const
Return patch.
tmp< vectorField > nf() const
Return face normals.
dimensioned< Type > min(const dimensioned< Type > &, const dimensioned< Type > &)
virtual ~curvatureSeparation()
Destructor.
const dimensionSet dimless(0, 0, 0, 0, 0, 0, 0)
fileName::Type type(const fileName &)
Return the file type: DIRECTORY or FILE.
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.
const surfaceFilmModel & owner() const
Return const access to the owner surface film model.
Mesh data needed to do the Finite Volume discretisation.
A List with indirect addressing.
Base class for surface film models.
dimensioned< scalar > mag(const dimensioned< Type > &)
virtual const surfaceScalarField & phi() const
Return the film flux [kg.m/s].
const labelUList & owner() const
Internal face owner.
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...
T & ref() const
Return non-const reference or generate a fatal error.
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)
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...
const Time & time() const
Return the top-level database.
const dimensionSet dimVelocity