35 #include "surfaceInterpolate.H" 45 namespace regionModels
47 namespace surfaceFilmModels
84 scalarField& invR1 = tinvR1.ref().primitiveFieldRef();
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];
148 const fvPatch&
pp = phip.patch();
153 label celli = faceCells[i];
154 if (phip[i] > phiMax[celli])
156 phiMax[celli] = phip[i];
157 cosAngle[celli] = -
gHat_ & nf[i];
205 mesh.time().timeName(),
216 volCosAngle.correctBoundaryConditions();
226 curvatureSeparation::curvatureSeparation
233 gradNHat_(fvc::
grad(film.nHat())),
234 deltaByR1Min_(coeffDict_.getOrDefault<scalar>(
"deltaByR1Min", 0)),
235 definedPatchRadii_(),
236 magG_(
mag(film.
g().value())),
239 if (
magG_ < ROOTVSMALL)
242 <<
"Acceleration due to gravity must be non-zero" 262 if (!uniquePatchIDs.
found(patchi))
264 const scalar radius = prIn[i].second();
267 uniquePatchIDs.insert(patchi);
292 refCast<const kinematicSingleLayer>(this->
film());
306 const scalar Fthreshold = 1
e-10;
313 scalar R1 = 1.0/(invR1[i] + ROOTVSMALL);
314 scalar R2 = R1 +
delta[i];
317 scalar Fi = -
delta[i]*
rho[i]*magSqrU[i]*72.0/60.0*invR1[i];
324 scalar Fs =
sigma[i]/R2;
326 Fnet[i] = Fi +
Fb + Fs;
328 if (Fnet[i] + Fthreshold < 0)
336 massToInject = separated*availableMass;
337 diameterToInject = separated*
delta;
338 availableMass -= separated*availableMass;
349 mesh.time().timeName(),
360 volFnet.correctBoundaryConditions();
static const word & zeroGradientType() noexcept
The type name for zeroGradient patch fields.
List< Tuple2< label, scalar > > definedPatchRadii_
List of radii for patches - if patch not defined, radius.
const labelList patchIDs(pbm.indices(polyPatchNames, true))
fvsPatchField< scalar > fvsPatchScalarField
ITstream & lookup(const word &keyword, enum keyType::option matchOpt=keyType::REGEX) const
Find and return an entry data stream. FatalIOError if not found, or not a stream. ...
const polyBoundaryMesh & pbm
const Type & value() const noexcept
Return const reference to value.
void size(const label n)
Older name for setAddressableSize.
dimensioned< Type > sum(const DimensionedField< Type, GeoMesh > &f1)
MinMax< scalar > scalarMinMax
A scalar min/max range.
vector gHat_
Direction of gravity vector.
tmp< scalarField > calcCosAngle(const surfaceScalarField &phi) const
Calculate the cosine of the angle between gravity vector and.
Base class for surface film models.
errorManipArg< error, int > exit(error &err, const int errNo=1)
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
Kinematic form of single-cell layer surface film model.
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.
A 2-tuple for storing two objects of dissimilar types. The container is similar in purpose to std::pa...
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
label max(const labelHashSet &set, label maxValue=labelMin)
Find the max value in labelHashSet, optionally limited by second argument.
dimensionedSymmTensor sqr(const dimensionedVector &dv)
Curvature film separation model.
bool found(const T &val, label pos=0) const
Same as contains()
labelList findIndices(const ListType &input, typename ListType::const_reference val, label start=0)
Linear search to find all occurrences of given element.
Operations on lists of strings.
Ignore writing from objectRegistry::writeObject()
const dimensionSet dimless
Dimensionless.
scalar magG_
Magnitude of gravity vector.
tmp< volScalarField > calcInvR1(const volVectorField &U) const
Calculate local (inverse) radius of curvature.
const dictionary coeffDict_
Coefficients dictionary.
dimensionedScalar sigma("sigma", dimMass/sqr(dimTime), transportProperties)
virtual const volScalarField & rho() const =0
Return the film density [kg/m3].
addToRunTimeSelectionTable(surfaceFilmRegionModel, kinematicSingleLayer, mesh)
Macros for easy insertion into run-time selection tables.
const surfaceFilmRegionModel & film() const
Return const access to the film surface film model.
#define forAll(list, i)
Loop across all elements in list.
GeometricField< scalar, fvPatchField, volMesh > volScalarField
fileName::Type type(const fileName &name, const bool followLink=true)
Return the file type: DIRECTORY or FILE, normally following symbolic links.
const dimensionedScalar e
Elementary charge.
A 1D vector of objects of type <T> that resizes itself as necessary to accept the new objects...
Calculate the gradient of the given field.
const polyBoundaryMesh & boundaryMesh() const noexcept
Return boundary mesh.
wordList names() const
Return a list of patch names.
virtual const volScalarField & delta() const =0
Return the film thickness [m].
const fvMesh & regionMesh() const
Return the region mesh database.
virtual const volVectorField & U() const =0
Return the film velocity [m/s].
A polyBoundaryMesh is a polyPatch list with additional search methods and registered IO...
Calculate the divergence of the given field.
void addToInjectedMass(const scalar dMass)
Add to injected mass.
const dimensionedVector & g() const
Return the acceleration due to gravity.
const uniformDimensionedVectorField & g
const dimensionSet dimForce
int debug
Static debugging option.
Base class for film injection models, handling mass transfer from the film.
virtual ~curvatureSeparation()
Destructor.
Internal::FieldType & primitiveFieldRef(const bool updateAccessTime=true)
Return a reference to the internal field values.
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.
Mesh data needed to do the Finite Volume discretisation.
A List with indirect addressing. Like IndirectList but does not store addressing. ...
Field< vector > vectorField
Specialisation of Field<T> for vector.
#define forAllReverse(list, i)
Reverse loop across all elements in list.
List< label > labelList
A List of labels.
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...
volTensorField gradNHat_
Gradient of surface normals.
virtual const volScalarField & sigma() const =0
Return the film surface tension [N/m].
defineTypeNameAndDebug(kinematicSingleLayer, 0)
scalar deltaByR1Min_
Minimum gravity driven film thickness (non-dimensionalised delta/R1)
Do not request registration (bool: false)
dimensioned< typename typeOfMag< Type >::type > magSqr(const dimensioned< Type > &dt)
uindirectPrimitivePatch pp(UIndirectList< face >(mesh.faces(), faceLabels), mesh.points())
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