44 MeshObject_type(
mesh),
46 skewCorrectionVectors_
50 "skewCorrectionVectors",
51 mesh_.pointsInstance(),
61 calcSkewCorrectionVectors();
69 void Foam::skewCorrectionVectors::calcSkewCorrectionVectors()
79 const labelUList& neighbour = mesh_.neighbour();
83 label own = owner[facei];
84 label nei = neighbour[facei];
87 vector Cpf = Cf[facei] -
C[own];
89 skewCorrectionVectors_[facei] =
90 Cpf - ((Sf[facei] & Cpf)/(Sf[facei] & d))*d;
94 skewCorrectionVectors_.boundaryFieldRef();
96 forAll(skewCorrVecsBf, patchi)
100 if (!patchSkewCorrVecs.coupled())
102 patchSkewCorrVecs =
Zero;
106 const fvPatch&
p = patchSkewCorrVecs.patch();
108 const vectorField& patchFaceCentres = Cf.boundaryField()[patchi];
109 const vectorField& patchSf = Sf.boundaryField()[patchi];
115 patchFaceCentres[patchFacei] -
C[faceCells[patchFacei]];
117 patchSkewCorrVecs[patchFacei] =
120 (patchSf[patchFacei] & Cpf)/
121 (patchSf[patchFacei] & patchD[patchFacei])
122 )*patchD[patchFacei];
127 scalar skewCoeff = 0.0;
129 if (Sf.primitiveField().size())
132 max(
mag(skewCorrectionVectors_)*mesh_.deltaCoeffs()).value();
137 if (skewCoeff < 1
e-5)
148 Info<<
" Finished constructing skew correction vectors" <<
endl;
155 calcSkewCorrectionVectors();
fvsPatchField< vector > fvsPatchVectorField
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
label max(const labelHashSet &set, label maxValue=labelMin)
Find the max value in labelHashSet, optionally limited by second argument.
constexpr char nl
The newline '\n' character (0x0a)
skewCorrectionVectors(const fvMesh &mesh)
Construct given fvMesh.
GeometricField< vector, fvsPatchField, surfaceMesh > surfaceVectorField
Ostream & endl(Ostream &os)
Add newline and flush stream.
GeometricBoundaryField< vector, fvsPatchField, surfaceMesh > Boundary
Type of boundary fields.
const dimensionSet dimless
Dimensionless.
GeometricField< vector, fvPatchField, volMesh > volVectorField
UList< label > labelUList
A UList of labels.
#define forAll(list, i)
Loop across all elements in list.
const dimensionedScalar e
Elementary charge.
#define DebugInFunction
Report an information message using Foam::Info.
virtual bool movePoints()
Update the correction vectors when the mesh moves.
int debug
Static debugging option.
defineTypeNameAndDebug(combustionModel, 0)
Skew-correction vectors for the skewness-corrected interpolation scheme.
Mesh data needed to do the Finite Volume discretisation.
messageStream Info
Information stream (stdout output on master, null elsewhere)
Field< vector > vectorField
Specialisation of Field<T> for vector.
virtual ~skewCorrectionVectors()
Destructor.
Defines the attributes of an object for which implicit objectRegistry management is supported...
static constexpr const zero Zero
Global zero (0)