41 DemandDrivenMeshObject
52 mesh.pointsInstance(),
66 mesh.pointsInstance(),
76 calcLeastSquaresVectors();
88 void Foam::leastSquaresVectors::calcLeastSquaresVectors()
95 const fvMesh& mesh = this->mesh();
99 const labelUList& neighbour = mesh.neighbour();
111 label own = owner[facei];
112 label nei = neighbour[facei];
117 dd[own] += (1 - w[facei])*wdd;
118 dd[nei] += w[facei]*wdd;
123 pVectors_.boundaryFieldRef();
130 const fvPatch&
p = pw.patch();
140 const vector& d = pd[patchFacei];
142 dd[faceCells[patchFacei]] +=
143 ((1 - pw[patchFacei])*pMagSf[patchFacei]/
magSqr(d))*
sqr(d);
150 const vector& d = pd[patchFacei];
152 dd[faceCells[patchFacei]] +=
166 label own = owner[facei];
167 label nei = neighbour[facei];
170 scalar magSfByMagSqrd = magSf[facei]/
magSqr(d);
172 pVectors_[facei] = (1 - w[facei])*magSfByMagSqrd*(invDd[own] & d);
173 nVectors_[facei] = -w[facei]*magSfByMagSqrd*(invDd[nei] & d);
183 const fvPatch&
p = pw.patch();
193 const vector& d = pd[patchFacei];
195 patchLsP[patchFacei] =
196 ((1 - pw[patchFacei])*pMagSf[patchFacei]/
magSqr(d))
197 *(invDd[faceCells[patchFacei]] & d);
204 const vector& d = pd[patchFacei];
206 patchLsP[patchFacei] =
207 pMagSf[patchFacei]*(1.0/
magSqr(d))
208 *(invDd[faceCells[patchFacei]] & d);
216 <<
"Finished calculating least square gradient vectors" <<
endl;
223 calcLeastSquaresVectors();
static const Foam::dimensionedScalar C("C", Foam::dimTemperature, 234.5)
#define forAll(list, i)
Loop across all elements in list.
GeometricBoundaryField< Type, PatchField, GeoMesh > Boundary
Type of the boundary field.
virtual bool movePoints()
Delete the least square vectors when the mesh moves.
virtual ~leastSquaresVectors()
Destructor.
leastSquaresVectors(const fvMesh &)
Construct given an fvMesh.
#define InfoInFunction
Report an information message using Foam::Info.
VolField< vector > volVectorField
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
dimensionedSymmTensor sqr(const dimensionedVector &dv)
Ostream & endl(Ostream &os)
Add newline and flush stream.
const dimensionSet dimless
SymmTensor< scalar > symmTensor
SymmTensor of scalars.
SurfaceField< scalar > surfaceScalarField
const dimensionSet dimLength
Vector< scalar > vector
A scalar version of the templated Vector.
defineTypeNameAndDebug(combustionModel, 0)
dimensioned< vector > dimensionedVector
Dimensioned vector obtained from generic dimensioned type.
Field< vector > vectorField
Specialisation of Field<T> for vector.
Field< symmTensor > symmTensorField
Specialisation of Field<T> for symmTensor.
dimensionedSphericalTensor inv(const dimensionedSphericalTensor &dt)
UList< label > labelUList
fvsPatchField< vector > fvsPatchVectorField
dimensioned< scalar > magSqr(const dimensioned< Type > &)
fvsPatchField< scalar > fvsPatchScalarField