Go to the documentation of this file.
43 MeshObject<fvMesh,
Foam::MoveableMeshObject, leastSquaresVectors>(
mesh),
49 mesh_.pointsInstance(),
63 mesh_.pointsInstance(),
73 calcLeastSquaresVectors();
85 void Foam::leastSquaresVectors::calcLeastSquaresVectors()
92 const fvMesh&
mesh = mesh_;
96 const labelUList& neighbour = mesh_.neighbour();
108 label own = owner[facei];
109 label nei = neighbour[facei];
114 dd[own] += (1 - w[facei])*wdd;
115 dd[nei] += w[facei]*wdd;
119 surfaceVectorField::Boundary& pVectorsBf =
120 pVectors_.boundaryFieldRef();
122 forAll(pVectorsBf, patchi)
127 const fvPatch&
p = pw.patch();
128 const labelUList& faceCells =
p.patch().faceCells();
137 const vector& d = pd[patchFacei];
139 dd[faceCells[patchFacei]] +=
140 ((1 - pw[patchFacei])*pMagSf[patchFacei]/
magSqr(d))*
sqr(d);
147 const vector& d = pd[patchFacei];
149 dd[faceCells[patchFacei]] +=
163 label own = owner[facei];
164 label nei = neighbour[facei];
167 scalar magSfByMagSqrd = magSf[facei]/
magSqr(d);
169 pVectors_[facei] = (1 - w[facei])*magSfByMagSqrd*(invDd[own] & d);
170 nVectors_[facei] = -w[facei]*magSfByMagSqrd*(invDd[nei] & d);
173 forAll(pVectorsBf, patchi)
180 const fvPatch&
p = pw.patch();
190 const vector& d = pd[patchFacei];
192 patchLsP[patchFacei] =
193 ((1 - pw[patchFacei])*pMagSf[patchFacei]/
magSqr(d))
194 *(invDd[faceCells[patchFacei]] & d);
201 const vector& d = pd[patchFacei];
203 patchLsP[patchFacei] =
204 pMagSf[patchFacei]*(1.0/
magSqr(d))
205 *(invDd[faceCells[patchFacei]] & d);
213 <<
"Finished calculating least square gradient vectors" <<
endl;
220 calcLeastSquaresVectors();
int debug
Static debugging option.
#define InfoInFunction
Report an information message using Foam::Info.
const dimensionSet dimless(0, 0, 0, 0, 0, 0, 0)
Dimensionless.
virtual ~leastSquaresVectors()
Destructor.
const dimensionSet dimLength(0, 1, 0, 0, 0, 0, 0)
static constexpr const zero Zero
Global zero.
fvsPatchField< scalar > fvsPatchScalarField
Ostream & endl(Ostream &os)
Add newline and flush stream.
virtual bool movePoints()
Delete the least square vectors when the mesh moves.
#define forAll(list, i)
Loop across all elements in list.
Field< symmTensor > symmTensorField
Specialisation of Field<T> for symmTensor.
Field< vector > vectorField
Specialisation of Field<T> for vector.
dimensioned< typename typeOfMag< Type >::type > magSqr(const dimensioned< Type > &dt)
dimensioned< vector > dimensionedVector
Dimensioned vector obtained from generic dimensioned type.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
fvsPatchField< vector > fvsPatchVectorField
leastSquaresVectors(const fvMesh &)
Construct given an fvMesh.
dimensionedSphericalTensor inv(const dimensionedSphericalTensor &dt)
SymmTensor< scalar > symmTensor
SymmTensor of scalars.
Vector< scalar > vector
A scalar version of the templated Vector.
GeometricField< vector, fvPatchField, volMesh > volVectorField
dimensionedSymmTensor sqr(const dimensionedVector &dv)
GeometricField< scalar, fvsPatchField, surfaceMesh > surfaceScalarField
UList< label > labelUList
A UList of labels.
defineTypeNameAndDebug(combustionModel, 0)