Go to the documentation of this file.
37 namespace reconstruction
50 leastSquareGrad<scalar> lsGrad(
"polyDegree1",mesh_.
geometricD());
65 DynamicField<vector> cellCentre(100);
66 DynamicField<scalar> phiValues(100);
77 for (
const label gblIdx : stencil[celli])
81 exchangeFields.getValue(mesh_.
C(), mapCC, gblIdx)
85 exchangeFields.getValue(
phi, mapPhi, gblIdx)
89 cellCentre -= mesh_.
C()[celli];
90 interfaceNormal_[i] = lsGrad.grad(cellCentre, phiValues);
97 Foam::reconstruction::gradAlpha::gradAlpha
115 isoFaceTol_(modelDict().getOrDefault<scalar>(
"isoFaceTol", 1
e-8)),
116 surfCellTol_(modelDict().getOrDefault<scalar>(
"surfCellTol", 1
e-8)),
117 sIterPLIC_(mesh_,surfCellTol_)
128 const bool uptodate = alreadyReconstructed(forceUpdate);
130 if (uptodate && !forceUpdate)
135 if (mesh_.topoChanging())
138 if (interfaceCell_.size() != mesh_.nCells())
140 interfaceCell_.resize(mesh_.nCells());
143 interfaceCell_ =
false;
145 interfaceLabels_.clear();
149 if (sIterPLIC_.isASurfaceCell(alpha1_[celli]))
151 interfaceCell_[celli] =
true;
152 interfaceLabels_.append(celli);
155 interfaceNormal_.resize(interfaceLabels_.size());
161 forAll(interfaceLabels_, i)
163 const label celli = interfaceLabels_[i];
164 if (
mag(interfaceNormal_[i]) == 0)
169 sIterPLIC_.vofCutCell
178 if (sIterPLIC_.cellStatus() == 0)
180 normal_[celli] = sIterPLIC_.surfaceArea();
181 centre_[celli] = sIterPLIC_.surfaceCentre();
182 if (
mag(normal_[celli]) == 0)
184 normal_[celli] =
Zero;
185 centre_[celli] =
Zero;
190 normal_[celli] =
Zero;
191 centre_[celli] =
Zero;
206 if (
mag(normal_[celli]) != 0)
208 vector n = normal_[celli]/
mag(normal_[celli]);
209 scalar cutValue = (centre_[celli] - mesh_.C()[celli]) & (
n);
216 alpha1_[celli] =
cutCell.VolumeOfFluid();
220 alpha1_.correctBoundaryConditions();
221 alpha1_.oldTime () = alpha1_;
222 alpha1_.oldTime().correctBoundaryConditions();
tmp< GeometricField< typename outerProduct< vector, Type >::type, fvPatchField, volMesh >> reconstruct(const GeometricField< Type, fvsPatchField, surfaceMesh > &ssf)
defineTypeNameAndDebug(isoAlpha, 0)
tmp< GeometricField< typename outerProduct< vector, Type >::type, fvPatchField, volMesh >> grad(const GeometricField< Type, fvsPatchField, surfaceMesh > &ssf)
const dimensionSet dimLength(0, 1, 0, 0, 0, 0, 0)
static constexpr const zero Zero
Global zero (0)
Class for cutting a cell, cellI, of an fvMesh, mesh_, at its intersection with an surface defined by ...
const volScalarField & alpha1
const Vector< label > & geometricD() const
Return the vector of geometric directions in mesh.
boolList interfaceCell_
Is interface cell?
#define forAll(list, i)
Loop across all elements in list.
dimensioned< vector > dimensionedVector
Dimensioned vector obtained from generic dimensioned type.
virtual void mapAlphaField() const
map VoF Field in case of refinement
virtual void reconstruct(bool forceUpdate=true)
Reconstruct interface.
const dimensionSet dimArea(sqr(dimLength))
GeometricField< scalar, fvPatchField, volMesh > volScalarField
const volVectorField & C() const
Return cell centres as volVectorField.
Service routines for cutting a cell, celli, of an fvMesh, mesh_, at its intersection with a surface.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Macros for easy insertion into run-time selection tables.
#define addProfilingInFunction(name)
addToRunTimeSelectionTable(reconstructionSchemes, isoAlpha, components)
static zoneDistribute & New(const fvMesh &)
List< labelList > labelListList
A List of labelList.
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
const dimensionedScalar e
Elementary charge.
Original code supplied by Henning Scheufler, DLR (2019)
void clear() noexcept
Clear the addressed list, i.e. set the size to zero.
DynamicField< label > interfaceLabels_
List of cell labels that have an interface.