36 namespace regionModels
38 namespace areaSurfaceFilmModels
68 scalarField& invR1 = tinvR1.ref().primitiveFieldRef();
71 const scalar rMin = 1
e-6;
80 const scalar rMax = 1e6;
83 if ((
mag(invR1[i]) < 1/rMax))
113 const label cellO = own[edgei];
114 const label cellN = nbr[edgei];
116 if (
phi[edgei] > phiMax[cellO])
118 phiMax[cellO] =
phi[edgei];
119 cosAngle[cellO] = -
gHat_ & UHat[cellN];
121 if (-
phi[edgei] > phiMax[cellN])
123 phiMax[cellN] = -
phi[edgei];
124 cosAngle[cellN] = -
gHat_ & UHat[cellO];
128 cosAngle *=
pos(invR1);
136 mesh.newIOobject(
"cosAngle"),
141 volCosAngle.correctBoundaryConditions();
152 curvatureSeparation::curvatureSeparation
159 gradNHat_(
fac::
grad(film.regionMesh().faceAreaNormals())),
160 deltaByR1Min_(coeffDict_.getOrDefault<scalar>(
"deltaByR1Min", 0)),
163 coeffDict_.getOrDefault<scalar>(
"definedPatchRadii", 0)
165 magG_(
mag(film.
g().value())),
169 coeffDict_.getOrDefault<scalar>(
"fThreshold", 1
e-8)
173 coeffDict_.getOrDefault<scalar>(
"minInvR1", 5)
176 if (
magG_ < ROOTVSMALL)
179 <<
"Acceleration due to gravity must be non-zero" 217 const scalar R1 = 1.0/(invR1[i] + ROOTVSMALL);
218 const scalar R2 = R1 +
delta[i];
221 const scalar Fi = -
delta[i]*
rho[i]*magSqrU[i]*72.0/60.0*invR1[i];
228 const scalar Fs =
sigma[i]/R2;
230 Fnet[i] = Fi +
Fb + Fs;
240 massToInject = separated*availableMass;
241 diameterToInject = separated*
delta;
242 availableMass -= separated*availableMass;
251 mesh.newIOobject(
"Fnet"),
262 mesh.newIOobject(
"separated"),
267 areaSeparated.write();
273 mesh.newIOobject(
"massToInject"),
278 areaMassToInject.write();
284 mesh.newIOobject(
"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.
dimensioned< Type > sum(const DimensionedField< Type, GeoMesh > &f1)
Calculate the second temporal derivative.
MinMax< scalar > scalarMinMax
A scalar min/max range.
errorManipArg< error, int > exit(error &err, const int errNo=1)
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
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)
const edgeScalarField & phi2s() const noexcept
Access continuity flux.
const dimensionSet dimless
Dimensionless.
defineTypeNameAndDebug(kinematicThinFilm, 0)
dimensionedScalar sigma("sigma", dimMass/sqr(dimTime), transportProperties)
scalar definedPatchRadii_
Patch radius.
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.
#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 uniformDimensionedVectorField & g() const noexcept
Gravity.
const areaScalarField & h() const noexcept
Access const reference h.
const faMesh & regionMesh() const
Return the region mesh database.
autoPtr< surfaceVectorField > Uf
static tmp< GeometricField< scalar, faPatchField, areaMesh > > New(const word &name, IOobjectOption::registerOption regOpt, const Mesh &mesh, const dimensionSet &dims, const word &patchFieldType=faPatchField< scalar >::calculatedType())
Return tmp field (NO_READ, NO_WRITE) from name, mesh, dimensions and patch type. [Takes current timeN...
const uniformDimensionedVectorField & g
const dimensionSet dimForce
int debug
Static debugging option.
scalar minInvR1_
Minimum inv R1 for separation.
Internal::FieldType & primitiveFieldRef(const bool updateAccessTime=true)
Return a reference to the internal field values.
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 areaVectorField & Uf() const noexcept
Access const reference Uf.
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.
vector gHat_
Direction of gravity vector.
Do not request registration (bool: false)
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)
dimensionSet clamp(const dimensionSet &a, const dimensionSet &range)
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.