Go to the documentation of this file.
37 namespace reconstruction
49 leastSquareGrad<scalar> lsGrad(
"polyDegree1",mesh_.
geometricD());
62 DynamicField<vector> cellCentre(100);
63 DynamicField<scalar> phiValues(100);
74 for (
const label gblIdx : stencil[celli])
78 exchangeFields_.
getValue(mesh_.
C(), mapCC, gblIdx)
86 cellCentre -= mesh_.
C()[celli];
87 interfaceNormal_[i] = lsGrad.grad(cellCentre, phiValues);
94 Foam::reconstruction::gradAlpha::gradAlpha
112 isoFaceTol_(modelDict().getOrDefault<scalar>(
"isoFaceTol", 1
e-8)),
113 surfCellTol_(modelDict().getOrDefault<scalar>(
"surfCellTol", 1
e-8)),
115 sIterPLIC_(mesh_,surfCellTol_)
125 const bool uptodate = alreadyReconstructed(forceUpdate);
127 if (uptodate && !forceUpdate)
132 if (mesh_.topoChanging())
135 if (interfaceCell_.size() != mesh_.nCells())
137 interfaceCell_.resize(mesh_.nCells());
140 interfaceCell_ =
false;
142 interfaceLabels_.clear();
146 if (sIterPLIC_.isASurfaceCell(alpha1_[celli]))
148 interfaceCell_[celli] =
true;
149 interfaceLabels_.append(celli);
152 interfaceNormal_.resize(interfaceLabels_.size());
158 forAll(interfaceLabels_, i)
160 const label celli = interfaceLabels_[i];
161 if (
mag(interfaceNormal_[i]) == 0)
166 sIterPLIC_.vofCutCell
175 if (sIterPLIC_.cellStatus() == 0)
177 normal_[celli] = sIterPLIC_.surfaceArea();
178 centre_[celli] = sIterPLIC_.surfaceCentre();
179 if (
mag(normal_[celli]) == 0)
181 normal_[celli] =
Zero;
182 centre_[celli] =
Zero;
187 normal_[celli] =
Zero;
188 centre_[celli] =
Zero;
203 if (
mag(normal_[celli]) != 0)
205 vector n = normal_[celli]/
mag(normal_[celli]);
206 scalar cutValue = (centre_[celli] - mesh_.C()[celli]) & (
n);
213 alpha1_[celli] =
cutCell.VolumeOfFluid();
217 alpha1_.correctBoundaryConditions();
218 alpha1_.oldTime () = alpha1_;
219 alpha1_.oldTime().correctBoundaryConditions();
Type getValue(const GeometricField< Type, fvPatchField, volMesh > &phi, const Map< Type > &valuesFromOtherProc, const label gblIdx) const
void clear()
Clear the addressed list, i.e. set the size to zero.
tmp< GeometricField< typename outerProduct< vector, Type >::type, fvPatchField, volMesh >> reconstruct(const GeometricField< Type, fvsPatchField, surfaceMesh > &ssf)
defineTypeNameAndDebug(isoAlpha, 0)
Map< Type > getDatafromOtherProc(const boolList &zone, const GeometricField< Type, fvPatchField, volMesh > &phi)
Returns stencil and provides a Map with globalNumbering.
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))
const labelListList & getStencil()
Stencil reference.
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.
addToRunTimeSelectionTable(reconstructionSchemes, isoAlpha, components)
static zoneDistribute & New(const fvMesh &)
void setUpCommforZone(const boolList &zone, bool updateStencil=true)
Update stencil with boolList the size has to match mesh nCells.
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)
DynamicField< label > interfaceLabels_
List of cell labels that have an interface.