Go to the documentation of this file.
44 MeshObject<fvMesh,
Foam::MoveableMeshObject, leastSquaresVectors>(
mesh),
50 mesh_.pointsInstance(),
64 mesh_.pointsInstance(),
74 calcLeastSquaresVectors();
86 void Foam::leastSquaresVectors::calcLeastSquaresVectors()
90 const fvMesh&
mesh = mesh_;
94 const labelUList& neighbour = mesh_.neighbour();
106 label own = owner[facei];
107 label nei = neighbour[facei];
112 dd[own] += (1 - w[facei])*wdd;
113 dd[nei] += w[facei]*wdd;
117 surfaceVectorField::Boundary& pVectorsBf =
118 pVectors_.boundaryFieldRef();
120 forAll(pVectorsBf, patchi)
125 const fvPatch&
p = pw.patch();
126 const labelUList& faceCells =
p.patch().faceCells();
135 const vector& d = pd[patchFacei];
137 dd[faceCells[patchFacei]] +=
138 ((1 - pw[patchFacei])*pMagSf[patchFacei]/
magSqr(d))*
sqr(d);
145 const vector& d = pd[patchFacei];
147 dd[faceCells[patchFacei]] +=
161 label own = owner[facei];
162 label nei = neighbour[facei];
165 scalar magSfByMagSqrd = magSf[facei]/
magSqr(d);
167 pVectors_[facei] = (1 - w[facei])*magSfByMagSqrd*(invDd[own] & d);
168 nVectors_[facei] = -w[facei]*magSfByMagSqrd*(invDd[nei] & d);
171 forAll(pVectorsBf, patchi)
178 const fvPatch&
p = pw.patch();
188 const vector& d = pd[patchFacei];
190 patchLsP[patchFacei] =
191 ((1 - pw[patchFacei])*pMagSf[patchFacei]/
magSqr(d))
192 *(invDd[faceCells[patchFacei]] & d);
199 const vector& d = pd[patchFacei];
201 patchLsP[patchFacei] =
202 pMagSf[patchFacei]*(1.0/
magSqr(d))
203 *(invDd[faceCells[patchFacei]] & d);
208 DebugInfo <<
"Finished calculating least square gradient vectors" <<
nl;
214 calcLeastSquaresVectors();
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 (0)
fvsPatchField< scalar > fvsPatchScalarField
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.
fvsPatchField< vector > fvsPatchVectorField
leastSquaresVectors(const fvMesh &)
Construct given an fvMesh.
dimensionedSphericalTensor inv(const dimensionedSphericalTensor &dt)
#define DebugInFunction
Report an information message using Foam::Info.
SymmTensor< scalar > symmTensor
SymmTensor of scalars, i.e. SymmTensor<scalar>.
Vector< scalar > vector
A scalar version of the templated Vector.
GeometricField< vector, fvPatchField, volMesh > volVectorField
dimensionedSymmTensor sqr(const dimensionedVector &dv)
#define DebugInfo
Report an information message using Foam::Info.
GeometricField< scalar, fvsPatchField, surfaceMesh > surfaceScalarField
UList< label > labelUList
A UList of labels.
defineTypeNameAndDebug(combustionModel, 0)