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)), scalar(-1));
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_ = film.
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->
film());
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();
const polyBoundaryMesh & boundaryMesh() const
Return boundary mesh.
tmp< GeometricField< typename outerProduct< vector, Type >::type, fvPatchField, volMesh >> grad(const GeometricField< Type, fvsPatchField, surfaceMesh > &ssf)
virtual 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.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
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...
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.
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)
void size(const label)
Override size to be inconsistent with allocated storage.
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
const dimensionedScalar sigma
Stefan-Boltzmann constant: default SI units: [W/m2/K4].
#define forAllReverse(list, i)
Reverse loop across all elements in list.
static word timeName(const scalar, const int precision=precision_)
Return time name of given scalar time.
Operations on lists of strings.
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.
addToRunTimeSelectionTable(surfaceFilmRegionModel, kinematicSingleLayer, mesh)
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.
GeometricField< scalar, fvPatchField, volMesh > volScalarField
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.
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.
virtual const volVectorField & nHat() const
Return the patch normal vectors.
virtual const surfaceScalarField & phi() const
Return the film flux [kg.m/s].
const fvMesh & regionMesh() const
Return the region mesh database.
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.
const dimensionedVector & g() const
Return the accleration due to gravity.
dimensioned< scalar > magSqr(const dimensioned< Type > &)
const surfaceScalarField & magSf() const
Return cell face area magnitudes.
const dimensionSet dimForce
Internal::FieldType & primitiveFieldRef()
Return a reference to the internal field.
Base class for film injection models, handling mass transfer from the film.
const volScalarField & delta() const
Return const access to the film thickness [m].
dimensioned< Type > min(const dimensioned< Type > &, const dimensioned< Type > &)
fileName::Type type(const fileName &, const bool followLink=true)
Return the file type: DIRECTORY or FILE.
const labelUList & owner() const
Internal face owner.
virtual ~curvatureSeparation()
Destructor.
const fvPatch & patch() const
Return patch.
const dimensionSet dimless(0, 0, 0, 0, 0, 0, 0)
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.
const volScalarField & sigma() const
Return const access to the surface tension [kg/s2].
Mesh data needed to do the Finite Volume discretisation.
A List with indirect addressing.
dimensioned< scalar > mag(const dimensioned< Type > &)
const doubleScalar e
Elementary charge.
virtual const volScalarField & rho() const
Return the film density [kg/m3].
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)
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 dimensionSet dimVelocity