39 namespace regionModels
41 namespace areaSurfaceFilmModels
69 scalarField& invR1 = tinvR1.ref().primitiveFieldRef();
72 const scalar rMin = 1
e-6;
81 const scalar rMax = 1e6;
84 if ((
mag(invR1[i]) < 1/rMax))
114 const label cellO = own[edgei];
115 const label cellN = nbr[edgei];
117 if (
phi[edgei] > phiMax[cellO])
119 phiMax[cellO] =
phi[edgei];
120 cosAngle[cellO] = -
gHat_ & UHat[cellN];
122 if (-
phi[edgei] > phiMax[cellN])
124 phiMax[cellN] = -
phi[edgei];
125 cosAngle[cellN] = -
gHat_ & UHat[cellO];
129 cosAngle *=
pos(invR1);
140 film().primaryMesh(),
146 volCosAngle.primitiveFieldRef() = cosAngle;
147 volCosAngle.correctBoundaryConditions();
151 return max(
min(cosAngle, scalar(1)), scalar(-1));
157 curvatureSeparation::curvatureSeparation
164 gradNHat_(
fac::
grad(film.regionMesh().faceAreaNormals())),
165 deltaByR1Min_(coeffDict_.getOrDefault<scalar>(
"deltaByR1Min", 0)),
168 coeffDict_.getOrDefault<scalar>(
"definedPatchRadii", 0)
170 magG_(
mag(film.
g().value())),
174 coeffDict_.getOrDefault<scalar>(
"fThreshold", 1
e-8)
178 coeffDict_.getOrDefault<scalar>(
"minInvR1", 5)
181 if (
magG_ < ROOTVSMALL)
184 <<
"Acceleration due to gravity must be non-zero" 222 const scalar R1 = 1.0/(invR1[i] + ROOTVSMALL);
223 const scalar R2 = R1 +
delta[i];
226 const scalar Fi = -
delta[i]*
rho[i]*magSqrU[i]*72.0/60.0*invR1[i];
233 const scalar Fs =
sigma[i]/R2;
235 Fnet[i] = Fi +
Fb + Fs;
245 massToInject = separated*availableMass;
246 diameterToInject = separated*
delta;
247 availableMass -= separated*availableMass;
259 film().primaryMesh(),
265 volFnet.primitiveFieldRef() = Fnet;
274 film().primaryMesh(),
280 areaSeparated.primitiveFieldRef() = separated;
281 areaSeparated.write();
289 film().primaryMesh(),
295 areaMassToInject.primitiveFieldRef() = massToInject;
296 areaMassToInject.write();
304 film().primaryMesh(),
310 areaInvR1.primitiveFieldRef() = invR1;
Finite area mesh (used for 2-D non-Euclidian finite area method) defined using a patch of faces on a ...
const Type & value() const noexcept
Return const reference to value.
void size(const label n)
Older name for setAddressableSize.
void addToInjectedMass(const scalar dMass)
Add to injected mass.
Calculate the second temporal derivative.
errorManipArg< error, int > exit(error &err, const int errNo=1)
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
const areaScalarField & h() const
Access const reference h.
error FatalError
Error stream (stdout output on all processes), with additional 'FOAM FATAL ERROR' header text and sta...
A list of keyword definitions, which are a keyword followed by a number of values (eg...
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
label max(const labelHashSet &set, label maxValue=labelMin)
Find the max value in labelHashSet, optionally limited by second argument.
virtual const areaScalarField & sigma() const =0
Access const reference sigma.
dimensionedSymmTensor sqr(const dimensionedVector &dv)
dimensionedSphericalTensor inv(const dimensionedSphericalTensor &dt)
scalar deltaByR1Min_
Minimum gravity driven film thickness (non-dimensionalised delta/R1)
Operations on lists of strings.
const uniformDimensionedVectorField & g() const
Gravity.
bool writeTime() const noexcept
True if this is a write time.
const dimensionSet dimless
Dimensionless.
const Time & time() const
Return the top-level database.
label nFaces() const noexcept
Number of mesh faces.
defineTypeNameAndDebug(kinematicThinFilm, 0)
dimensionedScalar sigma("sigma", dimMass/sqr(dimTime), transportProperties)
scalar definedPatchRadii_
List of radii for patches - if patch not defined, radius calculated based on mesh geometry...
Base class for film injection models, handling mass transfer from the film.
areaTensorField gradNHat_
Gradient of surface normals.
Macros for easy insertion into run-time selection tables.
tmp< scalarField > calcCosAngle(const edgeScalarField &phi) const
Calculate the cosine of the angle between gravity vector and cell out flow direction.
dimensioned< Type > sum(const DimensionedField< Type, GeoMesh > &df)
#define forAll(list, i)
Loop across all elements in list.
tmp< areaScalarField > calcInvR1(const areaVectorField &U, const scalarField &calcCosAngle) const
Calculate local (inverse) radius of curvature.
dimensionedScalar pos(const dimensionedScalar &ds)
fileName::Type type(const fileName &name, const bool followLink=true)
Return the file type: DIRECTORY or FILE, normally following symbolic links.
const dimensionedScalar e
Elementary charge.
scalar fThreshold_
Threshold force for separation.
addToRunTimeSelectionTable(liquidFilmBase, kinematicThinFilm, dictionary)
const areaVectorField & Uf() const
Access const reference Uf.
const faMesh & regionMesh() const
Return the region mesh database.
const edgeScalarField & phi2s() const
Access continuity flux.
autoPtr< surfaceVectorField > Uf
label min(const labelHashSet &set, label minValue=labelMax)
Find the min value in labelHashSet, optionally limited by second argument.
const uniformDimensionedVectorField & g
const dimensionSet dimForce
int debug
Static debugging option.
scalar minInvR1_
Minimum inv R1 for separation.
Curvature film separation model.
const dimensionSet dimLength(0, 1, 0, 0, 0, 0, 0)
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.
virtual const areaScalarField & rho() const =0
Access const reference rho.
const dimensionSet dimMass(1, 0, 0, 0, 0, 0, 0)
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...
scalar magG_
Magnitude of gravity vector.
Defines the attributes of an object for which implicit objectRegistry management is supported...
vector gHat_
Direction of gravity vector.
dimensioned< typename typeOfMag< Type >::type > magSqr(const dimensioned< Type > &dt)
tmp< GeometricField< typename outerProduct< vector, Type >::type, faPatchField, areaMesh >> grad(const GeometricField< Type, faePatchField, edgeMesh > &ssf)
GeometricField< scalar, faPatchField, areaMesh > areaScalarField
static constexpr const zero Zero
Global zero (0)
const dimensionSet dimVelocity
const liquidFilmBase & film() const
Return const access to the film surface film model.