35#include "surfaceInterpolate.H"
47namespace surfaceFilmModels
87 const scalar rMin = 1
e-6;
98 const scalar rMax = 1e6;
101 if (
mag(invR1[i]) < 1/rMax)
130 label cellO = own[facei];
131 label cellN = nbr[facei];
133 if (
phi[facei] > phiMax[cellO])
135 phiMax[cellO] =
phi[facei];
136 cosAngle[cellO] = -
gHat_ & nf[facei];
138 if (-
phi[facei] > phiMax[cellN])
140 phiMax[cellN] = -
phi[facei];
141 cosAngle[cellN] = -
gHat_ & -nf[facei];
154 if (phip[i] > phiMax[celli])
156 phiMax[celli] = phip[i];
157 cosAngle[celli] = -
gHat_ & nf[i];
211 zeroGradientFvPatchScalarField::typeName
218 return max(
min(cosAngle, scalar(1)), scalar(-1));
231 gradNHat_(fvc::grad(film.nHat())),
232 deltaByR1Min_(coeffDict_.getOrDefault<scalar>(
"deltaByR1Min", 0)),
233 definedPatchRadii_(),
234 magG_(
mag(film.
g().value())),
237 if (
magG_ < ROOTVSMALL)
240 <<
"Acceleration due to gravity must be non-zero"
258 const label patchi = patchIDs[j];
260 if (!uniquePatchIDs.
found(patchi))
262 const scalar radius = prIn[i].second();
265 uniquePatchIDs.
insert(patchi);
290 refCast<const kinematicSingleLayer>(this->
film());
304 const scalar Fthreshold = 1
e-10;
311 scalar R1 = 1.0/(invR1[i] + ROOTVSMALL);
312 scalar R2 = R1 +
delta[i];
315 scalar Fi = -
delta[i]*
rho[i]*magSqrU[i]*72.0/60.0*invR1[i];
322 scalar Fs = sigma[i]/R2;
324 Fnet[i] = Fi +
Fb + Fs;
326 if (Fnet[i] + Fthreshold < 0)
334 massToInject = separated*availableMass;
335 diameterToInject = separated*
delta;
336 availableMass -= separated*availableMass;
353 zeroGradientFvPatchScalarField::typeName
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
An indexed form of CGAL::Triangulation_face_base_2<K> used to keep track of the vertices in the trian...
A 1D vector of objects of type <T> that resizes itself as necessary to accept the new objects.
void append(const T &val)
Copy append an element to the end of this list.
Internal::FieldType & primitiveFieldRef(const bool updateAccessTime=true)
Return a reference to the internal field.
const Boundary & boundaryField() const
Return const-reference to the boundary field.
void correctBoundaryConditions()
Correct boundary field.
bool insert(const Key &key)
Insert a new entry, not overwriting existing entries.
bool found(const Key &key) const
Return true if hashed entry is found in table.
Defines the attributes of an object for which implicit objectRegistry management is supported,...
virtual void correct()
Solve the turbulence equations and correct the turbulence viscosity.
bool writeTime() const noexcept
True if this is a write time.
static word timeName(const scalar t, const int precision=precision_)
A 2-tuple for storing two objects of dissimilar types. The container is similar in purpose to std::pa...
A List with indirect addressing. Like IndirectList but does not store addressing.
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,...
ITstream & lookup(const word &keyword, enum keyType::option matchOpt=keyType::REGEX) const
const Type & value() const
Return const reference to value.
Smooth ATC in cells next to a set of patches supplied by type.
Mesh data needed to do the Finite Volume discretisation.
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 surfaceVectorField & Sf() const
Return cell face area vectors.
const surfaceScalarField & magSf() const
Return cell face area magnitudes.
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
tmp< vectorField > nf() const
Return face normals.
virtual const labelUList & faceCells() const
Return faceCells.
const fvPatch & patch() const
Return patch.
A polyBoundaryMesh is a polyPatch list with additional search methods and registered IO.
wordList names() const
Return a list of patch names.
const polyBoundaryMesh & boundaryMesh() const
Return boundary mesh.
label nCells() const noexcept
Number of mesh cells.
virtual bool write(const bool valid=true) const
Write using setting from DB.
Curvature film separation model.
const fvMesh & regionMesh() const
Return the region mesh database.
Curvature film separation model.
scalar deltaByR1Min_
Minimum gravity driven film thickness (non-dimensionalised delta/R1)
volTensorField gradNHat_
Gradient of surface normals.
tmp< volScalarField > calcInvR1(const volVectorField &U) const
Calculate local (inverse) radius of curvature.
scalar magG_
Magnitude of gravity vector.
tmp< scalarField > calcCosAngle(const surfaceScalarField &phi) const
Calculate the cosine of the angle between gravity vector and.
vector gHat_
Direction of gravity vector.
List< Tuple2< label, scalar > > definedPatchRadii_
List of radii for patches - if patch not defined, radius.
virtual ~curvatureSeparation()
Destructor.
const surfaceFilmRegionModel & film() const
Return const access to the film surface film model.
Base class for film injection models, handling mass transfer from the film.
void addToInjectedMass(const scalar dMass)
Add to injected mass.
Kinematic form of single-cell layer surface film model.
Base class for surface film models.
virtual const volScalarField & sigma() const =0
Return the film surface tension [N/m].
virtual const volVectorField & U() const =0
Return the film velocity [m/s].
virtual const volScalarField & rho() const =0
Return the film density [kg/m3].
const dimensionedVector & g() const
Return the acceleration due to gravity.
virtual const volScalarField & delta() const =0
Return the film thickness [m].
const dictionary coeffDict_
Coefficients dictionary.
A class for managing temporary objects.
#define defineTypeNameAndDebug(Type, DebugSwitch)
Define the typeName and debug information.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
Calculate the divergence of the given field.
Calculate the gradient of the given field.
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)
GeometricField< scalar, fvPatchField, volMesh > volScalarField
dimensioned< Type > sum(const DimensionedField< Type, GeoMesh > &df)
const dimensionSet dimVelocity
fileName::Type type(const fileName &name, const bool followLink=true)
Return the file type: DIRECTORY or FILE, normally following symbolic links.
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
label min(const labelHashSet &set, label minValue=labelMax)
Find the min value in labelHashSet, optionally limited by second argument.
const dimensionSet dimForce
static constexpr const zero Zero
Global zero (0)
labelList findIndices(const ListType &input, typename ListType::const_reference val, label start=0)
Linear search to find all occurrences of given element.
errorManipArg< error, int > exit(error &err, const int errNo=1)
dimensioned< typename typeOfMag< Type >::type > magSqr(const dimensioned< Type > &dt)
#define forAll(list, i)
Loop across all elements in list.
#define forAllReverse(list, i)
Reverse loop across all elements in list.
Operations on lists of strings.