37 namespace filmSeparationModels
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())
121 if (isA<processorFaPatch>(phip.patch()))
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);
150 areaCosAngle.correctBoundaryConditions();
151 areaCosAngle.write();
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;
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)
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.
addToRunTimeSelectionTable(filmSeparationModel, FriedrichModel, dictionary)
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.
const Time & time() const
Return reference to time.
T & ref() const
Return non-const reference to the contents of a non-null managed pointer.
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 minInvR1() const noexcept
const T & cref() const
Return const reference to the object or to the contents of a (non-null) managed pointer.
const edgeScalarField & phi2s() const noexcept
Access continuity flux.
bool writeTime() const noexcept
True if this is a write interval.
quaternion normalised(const quaternion &q)
Return the normalised (unit) quaternion of the given quaternion.
const dimensionSet dimless
Dimensionless.
dimensionedScalar sigma("sigma", dimMass/sqr(dimTime), transportProperties)
label nFaces() const noexcept
Number of patch faces.
Macros for easy insertion into run-time selection tables.
#define forAll(list, i)
Loop across all elements in list.
dimensionedScalar pos(const dimensionedScalar &ds)
const dimensionedScalar e
Elementary charge.
const uniformDimensionedVectorField & g() const noexcept
Gravity.
const faMesh & mesh() const noexcept
Return const access to the finite-area mesh.
const areaScalarField & h() const noexcept
Access const reference h.
const faMesh & regionMesh() const
Return the region mesh database.
static tmp< T > New(Args &&... args)
Construct tmp with forwarding arguments.
OwenRyleyModel(const regionModels::areaSurfaceFilmModels::liquidFilmBase &film, const dictionary &dict)
Construct from the base film model and dictionary.
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
A Vector of values with scalar precision, where scalar is float/double depending on the compilation f...
int debug
Static debugging option.
const dimensionedScalar h
Planck constant.
A base class for filmSeparation models.
virtual tmp< scalarField > separatedMassRatio() const
Calculate the mass ratio of film separation.
Internal::FieldType & primitiveFieldRef(const bool updateAccessTime=true)
Return a reference to the internal field values.
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.
defineTypeNameAndDebug(FriedrichModel, 0)
const labelList & edgeNeighbour() const noexcept
Edge neighbour addressing.
const areaVectorField & Uf() const noexcept
Access const reference Uf.
const regionModels::areaSurfaceFilmModels::liquidFilmBase & film() const
Return const access to the film properties.
IOobject newIOobject(const word &name, IOobjectOption ioOpt) const
Create an IOobject at the current time instance (timeName) with the specified options.
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...
Do not request registration (bool: false)
scalar minHbyR1() const noexcept
dimensioned< typename typeOfMag< Type >::type > magSqr(const dimensioned< Type > &dt)
const labelList & edgeOwner() const noexcept
Edge owner addressing.
tmp< GeometricField< typename outerProduct< vector, Type >::type, faPatchField, areaMesh >> grad(const GeometricField< Type, faePatchField, edgeMesh > &ssf)
dimensionSet clamp(const dimensionSet &a, const dimensionSet &range)
static constexpr const zero Zero
Global zero (0)
const dimensionSet dimVelocity