44 MeshObject_type(
mesh),
46 skewCorrectionVectors_
50 "skewCorrectionVectors",
51 mesh_.pointsInstance(),
61 calcSkewCorrectionVectors();
69void 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();
static const Foam::dimensionedScalar C("", Foam::dimTemperature, 234.5)
Graphite solid properties.
C() noexcept
Default construct.
GeometricBoundaryField< vector, fvsPatchField, surfaceMesh > Boundary
const Internal::FieldType & primitiveField() const noexcept
Return a const-reference to the internal field values.
const Boundary & boundaryField() const noexcept
Return const-reference to the boundary field.
@ NO_REGISTER
Do not request registration (bool: false).
@ NO_READ
Nothing to be read.
@ NO_WRITE
Ignore writing from objectRegistry::writeObject().
Defines the attributes of an object for which implicit objectRegistry management is supported,...
const fvMesh & mesh() const noexcept
void size(const label n)
Older name for setAddressableSize.
Smooth ATC in cells next to a set of patches supplied by type.
Mesh data needed to do the Finite Volume discretisation.
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Skew-correction vectors for the skewness-corrected interpolation scheme.
virtual bool movePoints()
Update the correction vectors when the mesh moves.
virtual ~skewCorrectionVectors()
Destructor.
skewCorrectionVectors(const fvMesh &mesh)
Construct given fvMesh.
A Vector of values with scalar precision, where scalar is float/double depending on the compilation f...
#define defineTypeNameAndDebug(Type, DebugSwitch)
Define the typeName and debug information.
#define DebugInFunction
Report an information message using Foam::Info.
Namespace for handling debugging switches.
GeometricField< vector, fvsPatchField, surfaceMesh > surfaceVectorField
label max(const labelHashSet &set, label maxValue=labelMin)
Find the max value in labelHashSet, optionally limited by second argument.
GeometricField< vector, fvPatchField, volMesh > volVectorField
const dimensionSet dimless
Dimensionless.
messageStream Info
Information stream (stdout output on master, null elsewhere).
Ostream & endl(Ostream &os)
Add newline and flush stream.
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
Field< vector > vectorField
Specialisation of Field<T> for vector.
static constexpr const zero Zero
Global zero (0).
UList< label > labelUList
A UList of labels.
fvsPatchField< vector > fvsPatchVectorField
constexpr char nl
The newline '\n' character (0x0a).
#define forAll(list, i)
Loop across all elements in list.