41 DemandDrivenMeshObject
52 mesh.pointsInstance(),
66 mesh.pointsInstance(),
76 calcLeastSquaresVectors();
88 void Foam::leastSquaresVectors::calcLeastSquaresVectors()
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();
#define forAll(list, i)
Loop across all elements in list.
GeometricBoundaryField< Type, GeoMesh, PrimitiveField > Boundary
Type of the boundary field.
const volVectorField & C() const
Return cell centres.
const labelUList & owner() const
Internal face owner.
const labelUList & neighbour() const
Internal face neighbour.
const surfaceScalarField & magSf() const
Return cell face area magnitudes.
virtual bool movePoints()
Delete the least square vectors when the mesh moves.
virtual ~leastSquaresVectors()
Destructor.
leastSquaresVectors(const fvMesh &)
Construct given an fvMesh.
const surfaceScalarField & weights() const
Return reference to linear difference weighting factors.
Foam::fvMesh mesh(Foam::IOobject(regionName, runTime.name(), runTime, Foam::IOobject::MUST_READ), false)
#define InfoInFunction
Report an information message using Foam::Info.
static const coefficient C("C", dimTemperature, 234.5)
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.
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.
void sqr(LagrangianPatchField< typename outerProduct< Type, Type >::type > &f, const LagrangianPatchField< Type > &f1)
void inv(LagrangianPatchField< tensor > &f, const LagrangianPatchField< tensor > &f1)
void magSqr(LagrangianPatchField< scalar > &f, const LagrangianPatchField< Type > &f1)
UList< label > labelUList
fvsPatchField< vector > fvsPatchVectorField
fvsPatchField< scalar > fvsPatchScalarField