44 MeshObject_type(
mesh),
50 mesh_.pointsInstance(),
64 mesh_.pointsInstance(),
74 calcLeastSquaresVectors();
86void Foam::leastSquaresVectors::calcLeastSquaresVectors()
90 const fvMesh&
mesh = mesh_;
94 const labelUList& neighbour = mesh_.neighbour();
103 const label own = owner[facei];
104 const label nei = neighbour[facei];
107 const scalar magSqrDist = d.magSqr();
109 if (magSqrDist > ROOTVSMALL)
117 auto& blsP = pVectors_.boundaryField();
123 const fvPatch&
p = patchLsP.patch();
131 const vector& d = pd[patchFacei];
132 const scalar magSqrDist = d.magSqr();
134 if (magSqrDist > ROOTVSMALL)
149 const label own = owner[facei];
150 const label nei = neighbour[facei];
153 const scalar magSqrDist = d.magSqr();
155 if (magSqrDist > ROOTVSMALL)
157 pVectors_[facei] = (invDd[own] & d)/magSqrDist;
158 nVectors_[facei] = -(invDd[nei] & d)/magSqrDist;
162 pVectors_[facei] =
Zero;
163 nVectors_[facei] =
Zero;
171 const fvPatch&
p = patchLsP.patch();
179 const vector& d = pd[patchFacei];
180 const scalar magSqrDist = d.magSqr();
182 if (magSqrDist > ROOTVSMALL)
184 patchLsP[patchFacei] =
185 (invDd[
faceCells[patchFacei]] & d)/magSqrDist;
189 patchLsP[patchFacei] =
Zero;
194 DebugInfo <<
"Finished calculating least square gradient vectors" <<
endl;
200 calcLeastSquaresVectors();
static const Foam::dimensionedScalar C("", Foam::dimTemperature, 234.5)
Graphite solid properties.
@ NO_REGISTER
Do not request registration (bool: false).
@ NO_READ
Nothing to be read.
@ NO_WRITE
Ignore writing from objectRegistry::writeObject().
Defines the attributes of an object for which implicit objectRegistry management is supported,...
const fvMesh & mesh() const noexcept
Smooth ATC in cells next to a set of patches supplied by type.
Mesh data needed to do the Finite Volume discretisation.
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Least-squares gradient scheme vectors.
virtual bool movePoints()
Delete the least square vectors when the mesh moves.
virtual ~leastSquaresVectors()
Destructor.
leastSquaresVectors(const fvMesh &)
Construct given an fvMesh.
A Vector of values with scalar precision, where scalar is float/double depending on the compilation f...
#define defineTypeNameAndDebug(Type, DebugSwitch)
Define the typeName and debug information.
#define DebugInfo
Report an information message using Foam::Info.
#define DebugInFunction
Report an information message using Foam::Info.
GeometricField< vector, fvPatchField, volMesh > volVectorField
const dimensionSet dimless
Dimensionless.
dimensionedSymmTensor sqr(const dimensionedVector &dv)
const dimensionSet dimLength(0, 1, 0, 0, 0, 0, 0)
Ostream & endl(Ostream &os)
Add newline and flush stream.
Field< vector > vectorField
Specialisation of Field<T> for vector.
Field< symmTensor > symmTensorField
Specialisation of Field<T> for symmTensor.
static constexpr const zero Zero
Global zero (0).
dimensionedSphericalTensor inv(const dimensionedSphericalTensor &dt)
UList< label > labelUList
A UList of labels.
fvsPatchField< vector > fvsPatchVectorField
dimensioned< vector > dimensionedVector
Dimensioned vector obtained from generic dimensioned type.
SymmTensor< scalar > symmTensor
SymmTensor of scalars, i.e. SymmTensor<scalar>.
constexpr char nl
The newline '\n' character (0x0a).
#define forAll(list, i)
Loop across all elements in list.