57 (UHat & (UHat & -gradNHat_))
59 scalarField& invR1 = tinvR1.ref().primitiveFieldRef();
62 if (definedPatchRadii_ > 0)
64 invR1 = 1.0/
max(1
e-6, definedPatchRadii_);
102 const label cellO = own[edgei];
103 const label cellN = nbr[edgei];
104 const scalar phiEdge =
phi[edgei];
106 if (phiEdge > phiMax[cellO])
108 phiMax[cellO] = phiEdge;
109 cosAngle[cellO] = -gHat & UHat[cellN];
111 if (-phiEdge > phiMax[cellN])
113 phiMax[cellN] = -phiEdge;
114 cosAngle[cellN] = -gHat & UHat[cellO];
119 for (
const auto& phip :
phi.boundaryField())
123 const auto& edgeFaces = phip.patch().edgeFaces();
124 const auto& UHatp = UHat.
boundaryField()[phip.patch().index()];
127 const label cellO = edgeFaces[edgei];
128 if (phip[edgei] > phiMax[cellO])
130 phiMax[cellO] = phip[edgei];
131 cosAngle[cellO] = -gHat & UHatp[edgei];
137 cosAngle *=
pos(invR1);
145 mesh.newIOobject(
"cosAngle"),
151 areaCosAngle.
write();
157 mesh.newIOobject(
"InvR1"),
184 const scalar magG =
mag(
film().
g().value());
188 auto& Fnet = tFnet.ref();
194 const scalar R1 = 1.0/(invR1[i] + ROOTVSMALL);
195 const scalar R2 = R1 +
h[i];
198 const scalar Fi = -4.0/3.0*
h[i]*
rho[i]*magSqrU[i]*invR1[i];
202 -0.5*
rho[i]*magG*invR1[i]*(
sqr(R1) -
sqr(R2))*cosAngle[i];
205 const scalar Fs =
sigma[i]/R2;
207 Fnet[i] = Fi +
Fb + Fs;
216 mesh.newIOobject(
"Fnet"),
238 fThreshold_(
dict.getOrDefault<scalar>(
"fThreshold", 1
e-8)),
239 definedPatchRadii_(
dict.getOrDefault<scalar>(
"definedPatchRadii", 0)),
240 minHbyR1_(
dict.getOrDefault<scalar>(
"deltaByR1Min", 0)),
241 minInvR1_(
dict.getOrDefault<scalar>(
"minInvR1", 5)),
242 gradNHat_(
fac::grad(film.regionMesh().faceAreaNormals()))
247 <<
"Gravitational acceleration must be non-zero."
260 const auto& Fnet = tFnet.
cref();
264 auto& separated = tseparated.ref();
268 if ((Fnet[i] + fThreshold_) < 0)
CGAL::indexedFace< K > Fb
Macros for easy insertion into run-time selection tables.
#define addToRunTimeSelectionTable(baseType, thisType, argNames)
Add to construction table with typeName as the key.
const uniformDimensionedVectorField & g
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())
Internal::FieldType & primitiveFieldRef(const bool updateAccessTime=true)
Return a reference to the internal field values.
void correctBoundaryConditions()
Correct boundary field.
const Boundary & boundaryField() const noexcept
Return const-reference to the boundary field.
@ NO_REGISTER
Do not request registration (bool: false).
void size(const label n)
Older name for setAddressableSize.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
const Type & value() const noexcept
Return const reference to value.
Finite area mesh (used for 2-D non-Euclidian finite area method) defined using a patch of faces on a ...
A base class for filmSeparation models.
const regionModels::areaSurfaceFilmModels::liquidFilmBase & film() const
Return const access to the film properties.
const faMesh & mesh() const noexcept
Return const access to the finite-area mesh.
filmSeparationModel(const filmSeparationModel &)=delete
No copy construct.
Computes film-separation properties from round edges for full separation (Owen & Ryley,...
OwenRyleyModel(const regionModels::areaSurfaceFilmModels::liquidFilmBase &film, const dictionary &dict)
Construct from the base film model and dictionary.
scalar minHbyR1() const noexcept
virtual tmp< scalarField > separatedMassRatio() const
Calculate the mass ratio of film separation.
scalar minInvR1() const noexcept
virtual bool write(const bool writeOnProc=true) const
Write using setting from DB.
virtual const areaScalarField & sigma() const =0
Access const reference sigma.
const uniformDimensionedVectorField & g() const noexcept
Gravity.
virtual const areaScalarField & rho() const =0
Access const reference rho.
const areaVectorField & Uf() const noexcept
Access const reference Uf.
const areaScalarField & h() const noexcept
Access const reference h.
const edgeScalarField & phi2s() const noexcept
Access continuity flux.
const faMesh & regionMesh() const
Return the region mesh database.
A class for managing temporary objects.
const T & cref() const
Return const reference to the object or to the contents of a (non-null) managed pointer.
static tmp< T > New(Args &&... args)
Construct tmp with forwarding arguments.
#define defineTypeNameAndDebug(Type, DebugSwitch)
Define the typeName and debug information.
Namespace for handling debugging switches.
A namespace for various filmSeparation model implementations.
dimensionedScalar pos(const dimensionedScalar &ds)
label max(const labelHashSet &set, label maxValue=labelMin)
Find the max value in labelHashSet, optionally limited by second argument.
const dimensionSet dimless
Dimensionless.
dimensionedSymmTensor sqr(const dimensionedVector &dv)
quaternion normalised(const quaternion &q)
Return the normalised (unit) quaternion of the given quaternion.
const dimensionSet dimLength(0, 1, 0, 0, 0, 0, 0)
const dimensionSet dimVelocity
dimensionSet clamp(const dimensionSet &a, const dimensionSet &range)
MinMax< scalar > scalarMinMax
A scalar min/max range.
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
GeometricField< vector, faPatchField, areaMesh > areaVectorField
GeometricField< scalar, faePatchField, edgeMesh > edgeScalarField
const Type * isA(const U &obj)
Attempt dynamic_cast to Type.
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
GeometricField< scalar, faPatchField, areaMesh > areaScalarField
const dimensionSet dimForce
static constexpr const zero Zero
Global zero (0).
dimensionedSphericalTensor inv(const dimensionedSphericalTensor &dt)
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.
UList< label > labelUList
A UList of labels.
dimensioned< typename typeOfMag< Type >::type > magSqr(const dimensioned< Type > &dt)
Calculate the second temporal derivative.
dimensionedScalar sigma("sigma", dimMass/sqr(dimTime), transportProperties)
#define forAll(list, i)
Loop across all elements in list.