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 IOobject::scopedName(typeName,
"contactForceMask"),
112 filmModel_.regionMesh(),
117 filmModel_.regionMesh(),
142 auto&
force = tForce.ref().primitiveFieldRef();
159 const label cellO = own[facei];
160 const label cellN = nbr[facei];
163 if ((
alpha[cellO] > 0.5) && (
alpha[cellN] < 0.5))
167 else if ((
alpha[cellO] < 0.5) && (
alpha[cellN] > 0.5))
172 if (celli != -1 && mask_[celli] > 0.5)
176 gradAlpha[celli]/(
mag(gradAlpha[celli]) + ROOTVSMALL);
178 force[celli] += Ccf_*
n*
sigma[celli]*(1 - cosTheta)/invDx;
186 const fvPatchField<scalar>& alphaPf =
alpha.boundaryField()[patchi];
187 const fvPatchField<scalar>& maskPf = mask_.
boundaryField()[patchi];
188 const fvPatchField<scalar>& sigmaPf =
sigma.boundaryField()[patchi];
189 const fvPatchField<scalar>& thetaPf =
theta.boundaryField()[patchi];
190 const scalarField& invDx = alphaPf.patch().deltaCoeffs();
191 const labelUList& faceCells = alphaPf.patch().faceCells();
195 if (maskPf[facei] > 0.5)
197 label cellO = faceCells[facei];
199 if ((
alpha[cellO] > 0.5) && (alphaPf[facei] < 0.5))
203 /(
mag(gradAlpha[cellO]) + ROOTVSMALL);
204 const scalar cosTheta =
cos(
degToRad(thetaPf[facei]));
206 Ccf_*
n*sigmaPf[facei]*(1 - cosTheta)/invDx[facei];
222 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))
static word scopedName(const std::string &scope, const word &name)
Create scope:name or scope_name string.
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.
static tmp< T > New(Args &&... args)
Construct tmp with forwarding arguments.
static tmp< GeometricField< vector, fvPatchField, volMesh > > New(const word &name, IOobjectOption::registerOption regOpt, const Mesh &mesh, const dimensionSet &dims, const word &patchFieldType=fvPatchField< vector >::calculatedType())
Return tmp field (NO_READ, NO_WRITE) from name, mesh, dimensions and patch type. [Takes current timeN...
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.
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 dimensionSet dimArea(sqr(dimLength))
static constexpr const zero Zero
Global zero (0)