50void contactAngleForce::initialise()
57 if (zeroForcePatches.
size())
60 const scalar dLim =
coeffDict_.
get<scalar>(
"zeroForceDistance");
62 Info<<
" Assigning zero contact force within " << dLim
63 <<
" of patches:" <<
endl;
97contactAngleForce::contactAngleForce
100 surfaceFilmRegionModel& film,
105 Ccf_(coeffDict_.get<scalar>(
"Ccf")),
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];
215 if (
filmModel_.regionMesh().time().writeTime())
222 tfvm.ref() += tForce;
Macros for easy insertion into run-time selection tables.
const polyBoundaryMesh & pbm
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())
@ NO_REGISTER
Do not request registration (bool: false).
@ NO_READ
Nothing to be read.
@ NO_WRITE
Ignore writing from objectRegistry::writeObject().
Defines the attributes of an object for which implicit objectRegistry management is supported,...
static word scopedName(const std::string &scope, const word &name)
Create scope:name or scope_name string.
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.
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,...
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.
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...
Smooth ATC in cells next to a set of patches supplied by type.
const Time & time() const
Return the top-level database.
const labelUList & owner() const
Internal face owner. Note bypassing virtual mechanism so.
const labelUList & neighbour() const
Internal face neighbour.
const fvPatch & patch() const noexcept
Return the patch.
Abstract base class with a fat-interface to all derived classes covering all possible ways in which t...
const scalarField & deltaCoeffs() const
Return the face - cell distance coefficient except for coupled patches for which the cell-centre to c...
virtual const labelUList & faceCells() const
Return faceCells.
Fast topological mesh-wave method for calculating the distance to nearest patch for all cells and bou...
virtual bool correct(volScalarField &y)
Correct the given distance-to-patch field.
A polyBoundaryMesh is a polyPatch list with registered IO, a reference to the associated polyMesh,...
const polyBoundaryMesh & boundaryMesh() const noexcept
Return boundary mesh.
const fvMesh & regionMesh() const
Return the region mesh database.
virtual const volScalarField & magSf() const
Return the face area magnitudes / [m2].
const surfaceFilmRegionModel & film() const
Return const access to the film surface film model.
surfaceFilmRegionModel & filmModel_
Reference to the film surface film model.
Base class for film (stress-based) force models.
Base class for surface film models.
virtual const volScalarField & sigma() const =0
Return the film surface tension [N/m].
virtual const volScalarField & alpha() const =0
Return the film coverage, 1 = covered, 0 = uncovered / [].
const dictionary coeffDict_
Coefficients dictionary.
const dictionary & dict() const
Return const access to the cloud dictionary.
virtual const surfaceScalarField & deltaCoeffs() const
Return reference to cell-centre difference coefficients.
A class for managing temporary objects.
static tmp< T > New(Args &&... args)
Construct tmp with forwarding arguments.
A List of wordRe with additional matching capabilities.
A class for handling words, derived from Foam::string.
#define defineTypeNameAndDebug(Type, DebugSwitch)
Define the typeName and debug information.
Calculate the gradient of the given field.
tmp< GeometricField< typename outerProduct< vector, Type >::type, fvPatchField, volMesh > > grad(const GeometricField< Type, fvsPatchField, surfaceMesh > &ssf)
GeometricField< vector, fvPatchField, volMesh > volVectorField
const dimensionSet dimless
Dimensionless.
dimensionedScalar pos0(const dimensionedScalar &ds)
const dimensionSet dimLength(0, 1, 0, 0, 0, 0, 0)
HashSet< label, Hash< label > > labelHashSet
A HashSet of labels, uses label hasher.
GeometricField< scalar, fvPatchField, volMesh > volScalarField
const dimensionSet dimArea(sqr(dimLength))
messageStream Info
Information stream (stdout output on master, null elsewhere).
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
const word GlobalIOList< Tuple2< scalar, vector > >::typeName("scalarVectorTable")
Ostream & endl(Ostream &os)
Add newline and flush stream.
constexpr scalar degToRad() noexcept
Multiplication factor for degrees to radians conversion.
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
const dimensionSet dimForce
static constexpr const zero Zero
Global zero (0).
const dimensionSet dimVolume(pow3(dimLength))
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.
UList< label > labelUList
A UList of labels.
dimensionedScalar cos(const dimensionedScalar &ds)
dimensioned< vector > dimensionedVector
Dimensioned vector obtained from generic dimensioned type.
dimensionedScalar sigma("sigma", dimMass/sqr(dimTime), transportProperties)
#define forAll(list, i)
Loop across all elements in list.
Unit conversion functions.