39 namespace regionModels
41 namespace surfaceFilmModels
50 void contactAngleForce::initialise()
52 const wordRes zeroForcePatches
57 if (zeroForcePatches.size())
60 const scalar dLim =
coeffDict_.
get<scalar>(
"zeroForceDistance");
62 Info<<
" Assigning zero contact force within " << dLim
63 <<
" of patches:" <<
endl;
97 contactAngleForce::contactAngleForce
100 surfaceFilmRegionModel& film,
104 force(typeName, film,
dict),
105 Ccf_(coeffDict_.
get<scalar>(
"Ccf")),
110 typeName +
":contactForceMask",
112 filmModel_.regionMesh(),
116 filmModel_.regionMesh(),
140 typeName +
":contactForce",
168 const label cellO = own[facei];
169 const label cellN = nbr[facei];
172 if ((
alpha[cellO] > 0.5) && (
alpha[cellN] < 0.5))
176 else if ((
alpha[cellO] < 0.5) && (
alpha[cellN] > 0.5))
181 if (celli != -1 && mask_[celli] > 0.5)
185 gradAlpha[celli]/(
mag(gradAlpha[celli]) + ROOTVSMALL);
187 force[celli] += Ccf_*
n*
sigma[celli]*(1 - cosTheta)/invDx;
195 const fvPatchField<scalar>& alphaPf =
alpha.boundaryField()[patchi];
196 const fvPatchField<scalar>& maskPf = mask_.
boundaryField()[patchi];
197 const fvPatchField<scalar>& sigmaPf =
sigma.boundaryField()[patchi];
198 const fvPatchField<scalar>& thetaPf =
theta.boundaryField()[patchi];
199 const scalarField& invDx = alphaPf.patch().deltaCoeffs();
200 const labelUList& faceCells = alphaPf.patch().faceCells();
204 if (maskPf[facei] > 0.5)
206 label cellO = faceCells[facei];
208 if ((
alpha[cellO] > 0.5) && (alphaPf[facei] < 0.5))
212 /(
mag(gradAlpha[cellO]) + ROOTVSMALL);
213 const scalar cosTheta =
cos(
degToRad(thetaPf[facei]));
215 Ccf_*
n*sigmaPf[facei]*(1 - cosTheta)/invDx[facei];
229 tmp<fvVectorMatrix> tfvm
234 tfvm.ref() += tForce;
List< ReturnType > get(const UPtrList< T > &list, const AccessOp &aop)
List of values generated by applying the access operation to each list item.
const labelList patchIDs(pbm.indices(polyPatchNames, true))
const polyBoundaryMesh & pbm
tmp< GeometricField< typename outerProduct< vector, Type >::type, fvPatchField, volMesh >> grad(const GeometricField< Type, fvsPatchField, surfaceMesh > &ssf)
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
Base class for film (stress-based) force models.
A list of keyword definitions, which are a keyword followed by a number of values (eg...
Unit conversion functions.
virtual const volScalarField & alpha() const =0
Return the film coverage, 1 = covered, 0 = uncovered / [].
dimensioned< vector > dimensionedVector
Dimensioned vector obtained from generic dimensioned type.
Ostream & endl(Ostream &os)
Add newline and flush stream.
Ignore writing from objectRegistry::writeObject()
bool writeTime() const noexcept
True if this is a write interval.
const dimensionSet dimless
Dimensionless.
T get(const word &keyword, enum keyType::option matchOpt=keyType::REGEX) const
Find and return a T. FatalIOError if not found, or if the number of tokens is incorrect.
const Time & time() const
Return the top-level database.
const dictionary coeffDict_
Coefficients dictionary.
dimensionedScalar sigma("sigma", dimMass/sqr(dimTime), transportProperties)
Macros for easy insertion into run-time selection tables.
UList< label > labelUList
A UList of labels.
const labelUList & neighbour() const
Internal face neighbour.
#define forAll(list, i)
Loop across all elements in list.
GeometricField< scalar, fvPatchField, volMesh > volScalarField
HashSet< label, Hash< label > > labelHashSet
A HashSet of labels, uses label hasher.
const dimensionSet dimVolume(pow3(dimLength))
dimensionedScalar cos(const dimensionedScalar &ds)
Calculate the gradient of the given field.
const polyBoundaryMesh & boundaryMesh() const noexcept
Return boundary mesh.
A class for handling words, derived from Foam::string.
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
bool isCoupledPatch(const label regionPatchi) const
True if patchi on the local region is a coupled patch to the primary region.
const fvMesh & regionMesh() const
Return the region mesh database.
dimensionedScalar pos0(const dimensionedScalar &ds)
const dimensionSet dimForce
A Vector of values with scalar precision, where scalar is float/double depending on the compilation f...
static word timeName(const scalar t, const int precision=precision_)
Return a time name for the given scalar time value formatted with the given precision.
const labelUList & owner() const
Internal face owner. Note bypassing virtual mechanism so.
virtual const volScalarField & magSf() const
Return the face area magnitudes / [m2].
const dimensionSet dimLength(0, 1, 0, 0, 0, 0, 0)
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.
fvMatrix< vector > fvVectorMatrix
messageStream Info
Information stream (stdout output on master, null elsewhere)
surfaceFilmRegionModel & filmModel_
Reference to the film surface film model.
T getOrDefault(const word &keyword, const T &deflt, enum keyType::option matchOpt=keyType::REGEX) const
Find and return a T, or return the given default value. FatalIOError if it is found and the number of...
A class for managing temporary objects.
const dimensionedScalar alpha
Fine-structure constant: default SI units: [].
virtual const volScalarField & sigma() const =0
Return the film surface tension [N/m].
constexpr scalar degToRad(const scalar deg) noexcept
Conversion from degrees to radians.
Defines the attributes of an object for which implicit objectRegistry management is supported...
defineTypeNameAndDebug(kinematicSingleLayer, 0)
const Boundary & boundaryField() const noexcept
Return const-reference to the boundary field.
Do not request registration (bool: false)
virtual const surfaceScalarField & deltaCoeffs() const
Return reference to cell-centre difference coefficients.
const Time & time() const noexcept
Return the reference to the time database.
const dimensionSet dimArea(sqr(dimLength))
static constexpr const zero Zero
Global zero (0)