60 deltaCoeffs_(nullptr),
61 nonOrthDeltaCoeffs_(nullptr),
62 nonOrthCorrectionVectors_(nullptr)
96 return (*deltaCoeffs_);
103 if (!nonOrthDeltaCoeffs_)
105 makeNonOrthDeltaCoeffs();
108 return (*nonOrthDeltaCoeffs_);
115 if (!nonOrthCorrectionVectors_)
117 makeNonOrthCorrectionVectors();
120 return (*nonOrthCorrectionVectors_);
135 void Foam::surfaceInterpolation::makeWeights()
const
139 Pout<<
"surfaceInterpolation::makeWeights() : "
140 <<
"Constructing weighting factors for face interpolation"
149 mesh_.pointsInstance(),
163 const labelUList& neighbour = mesh_.neighbour();
178 const scalar SfdOwn =
mag(Sf[facei]&(Cf[facei] -
C[owner[facei]]));
179 const scalar SfdNei =
mag(Sf[facei]&(
C[neighbour[facei]] - Cf[facei]));
180 const scalar SfdOwnNei = SfdOwn + SfdNei;
182 if (SfdNei/vGreat < SfdOwnNei)
184 w[facei] = SfdNei/SfdOwnNei;
188 const scalar dOwn =
mag(Cf[facei] -
C[owner[facei]]);
189 const scalar dNei =
mag(
C[neighbour[facei]] - Cf[facei]);
190 const scalar dOwnNei = dOwn + dNei;
192 w[facei] = dNei/dOwnNei;
197 weights.boundaryFieldRef();
206 Pout<<
"surfaceInterpolation::makeWeights() : "
207 <<
"Finished constructing weighting factors for face interpolation"
213 void Foam::surfaceInterpolation::makeDeltaCoeffs()
const
217 Pout<<
"surfaceInterpolation::makeDeltaCoeffs() : "
218 <<
"Constructing interpolation factors array for face gradient"
231 mesh_.pointsInstance(),
247 const labelUList& neighbour = mesh_.neighbour();
251 deltaCoeffs[facei] = 1.0/
mag(
C[neighbour[facei]] -
C[owner[facei]]);
255 deltaCoeffs.boundaryFieldRef();
264 void Foam::surfaceInterpolation::makeNonOrthDeltaCoeffs()
const
268 Pout<<
"surfaceInterpolation::makeNonOrthDeltaCoeffs() : "
269 <<
"Constructing interpolation factors array for face gradient"
281 "nonOrthDeltaCoeffs",
282 mesh_.pointsInstance(),
298 const labelUList& neighbour = mesh_.neighbour();
305 vector unitArea = Sf[facei]/magSf[facei];
321 nonOrthDeltaCoeffs.boundaryFieldRef();
327 nonOrthDeltaCoeffsBf[
patchi] =
333 void Foam::surfaceInterpolation::makeNonOrthCorrectionVectors()
const
337 Pout<<
"surfaceInterpolation::makeNonOrthCorrectionVectors() : "
338 <<
"Constructing non-orthogonal correction vectors"
346 "nonOrthCorrectionVectors",
347 mesh_.pointsInstance(),
362 const labelUList& neighbour = mesh_.neighbour();
369 vector unitArea = Sf[facei]/magSf[facei];
372 corrVecs[facei] = unitArea -
delta*NonOrthDeltaCoeffs[facei];
380 corrVecs.boundaryFieldRef();
386 if (!patchCorrVecs.coupled())
388 patchCorrVecs =
Zero;
393 = NonOrthDeltaCoeffs.boundaryField()[
patchi];
395 const fvPatch&
p = patchCorrVecs.patch();
402 Sf.boundaryField()[
patchi][patchFacei]
403 /magSf.boundaryField()[
patchi][patchFacei];
407 patchCorrVecs[patchFacei] =
408 unitArea -
delta*patchNonOrthDeltaCoeffs[patchFacei];
415 Pout<<
"surfaceInterpolation::makeNonOrthCorrectionVectors() : "
416 <<
"Finished constructing non-orthogonal correction vectors"
424 Pout<<
"surfaceInterpolation allocated :" <<
endl;
433 Pout<<
" Delta coefficients" <<
endl;
436 if (nonOrthDeltaCoeffs_)
438 Pout<<
" Non-orthogonal delta coefficients" <<
endl;
441 if (nonOrthCorrectionVectors_)
443 Pout<<
" Non-orthogonal correction vectors" <<
endl;
#define forAll(list, i)
Loop across all elements in list.
Generic GeometricField class.
GeometricBoundaryField< Type, GeoMesh, PrimitiveField > Boundary
Type of the boundary field.
Mesh data needed to do the Finite Volume discretisation.
static const word & calculatedType()
Return the type of the calculated for of fvsPatchField.
Cell to surface interpolation scheme. Included in fvMesh.
bool movePoints()
Do what is necessary if the mesh has moved.
const surfaceVectorField & nonOrthCorrectionVectors() const
Return reference to non-orthogonality correction vectors.
const surfaceScalarField & weights() const
Return reference to linear difference weighting factors.
const surfaceScalarField & deltaCoeffs() const
Return reference to cell-centre difference coefficients.
surfaceInterpolation(const fvMesh &)
Construct given an fvMesh.
void printAllocated() const
Print a list of all the currently allocated data.
const surfaceScalarField & nonOrthDeltaCoeffs() const
Return reference to non-orthogonal cell-centre difference.
void clearOut()
Clear all geometry and addressing.
~surfaceInterpolation()
Destructor.
Template functions to aid in the implementation of demand driven data.
const dimensionSet dimless
static const coefficient C("C", dimTemperature, 234.5)
VolField< vector > volVectorField
Ostream & endl(Ostream &os)
Add newline and flush stream.
const dimensionSet & dimLength
void deleteDemandDrivenData(DataType *&dataPtr)
SurfaceField< scalar > surfaceScalarField
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
Vector< scalar > vector
A scalar version of the templated Vector.
Field< vector > vectorField
Specialisation of Field<T> for vector.
prefixOSstream Pout(cout, "Pout")
tmp< DimensionedField< scalar, GeoMesh, Field > > mag(const DimensionedField< Type, GeoMesh, PrimitiveField > &df)
SurfaceField< vector > surfaceVectorField
defineTypeNameAndDebug(atmosphericBoundaryLayer, 0)
UList< label > labelUList
fvsPatchField< vector > fvsPatchVectorField
fvsPatchField< scalar > fvsPatchScalarField
dimensioned< Type > max(const DimensionedField< Type, GeoMesh, PrimitiveField > &df)