41 MeshObject<fvMesh,
Foam::MoveableMeshObject, leastSquaresVectors>(mesh),
47 mesh_.pointsInstance(),
61 mesh_.pointsInstance(),
71 calcLeastSquaresVectors();
83 void Foam::leastSquaresVectors::calcLeastSquaresVectors()
90 const fvMesh& mesh =
mesh_;
106 label own = owner[facei];
107 label nei = neighbour[facei];
109 vector d = C[nei] - C[own];
112 dd[own] += (1 - w[facei])*wdd;
113 dd[nei] += w[facei]*wdd;
117 surfaceVectorField::Boundary& pVectorsBf =
118 pVectors_.boundaryFieldRef();
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];
164 vector d = C[nei] - C[own];
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);
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);
211 <<
"Finished calculating least square gradient vectors" <<
endl;
218 calcLeastSquaresVectors();
fvsPatchField< vector > fvsPatchVectorField
fvsPatchField< scalar > fvsPatchScalarField
#define forAll(list, i)
Loop across all elements in list.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Field< symmTensor > symmTensorField
Specialisation of Field<T> for symmTensor.
dimensionedSymmTensor sqr(const dimensionedVector &dv)
dimensionedSphericalTensor inv(const dimensionedSphericalTensor &dt)
dimensioned< vector > dimensionedVector
Dimensioned vector obtained from generic dimensioned type.
Ostream & endl(Ostream &os)
Add newline and flush stream.
leastSquaresVectors(const fvMesh &)
Construct given an fvMesh.
Vector< scalar > vector
A scalar version of the templated Vector.
GeometricField< vector, fvPatchField, volMesh > volVectorField
UList< label > labelUList
virtual bool movePoints()
Delete the least square vectors when the mesh moves.
const labelUList & neighbour() const
Internal face neighbour.
SymmTensor< scalar > symmTensor
SymmTensor of scalars.
dimensioned< scalar > magSqr(const dimensioned< Type > &)
defineTypeNameAndDebug(combustionModel, 0)
const labelUList & owner() const
Internal face owner.
virtual ~leastSquaresVectors()
Destructor.
const dimensionSet dimless(0, 0, 0, 0, 0, 0, 0)
const dimensionSet dimLength(0, 1, 0, 0, 0, 0, 0)
Field< vector > vectorField
Specialisation of Field<T> for vector.
GeometricField< scalar, fvsPatchField, surfaceMesh > surfaceScalarField
#define InfoInFunction
Report an information message using Foam::Info.