77 GradFieldType& gGrad = tgGrad.
ref();
88 const GradType Sfssf = Sf[facei]*issf[facei];
90 igGrad[owner[facei]] += Sfssf;
91 igGrad[neighbour[facei]] -= Sfssf;
97 mesh.boundary()[patchi].faceCells();
105 igGrad[pFaceCells[facei]] += pSf[facei]*pssf[facei];
111 gGrad.correctBoundaryConditions();
138 DebugPout<<
"fusedGaussGrad<Type>::calcGrad on " << vf.
name()
158 GradFieldType& gGrad = tgGrad.
ref();
160 if (this->tinterpScheme_().corrected())
162 const auto tfaceCorr(this->tinterpScheme_().
correction(vf));
163 auto& faceCorr = tfaceCorr();
165 DebugPout<<
"fusedGaussGrad<Type>::calcGrad corrected interpScheme "
166 << this->tinterpScheme_().type() <<
endl;
185 this->tinterpScheme_().weights(vf),
195 DebugPout<<
"fusedGaussGrad<Type>::calcGrad uncorrected interpScheme "
196 << this->tinterpScheme_().type() <<
endl;
206 return area*(
lambda*(ownVal - neiVal) + neiVal);
211 tinterpScheme_().weights(vf),
219 gGrad.primitiveFieldRef() /=
mesh.V();
221 gGrad.correctBoundaryConditions();
245 DebugPout<<
"fusedGaussGrad<Type>::calcGrad on " << vf.
name()
246 <<
" into " << gGrad.name() <<
endl;
250 if (this->tinterpScheme_().corrected())
252 const auto tfaceCorr(this->tinterpScheme_().
correction(vf));
253 auto& faceCorr = tfaceCorr();
255 DebugPout<<
"fusedGaussGrad<Type>::calcGrad corrected interpScheme "
256 << this->tinterpScheme_().type() <<
endl;
275 this->tinterpScheme_().weights(vf),
285 DebugPout<<
"fusedGaussGrad<Type>::calcGrad uncorrected interpScheme "
286 << this->tinterpScheme_().type() << endl;
296 return area*(
lambda*(ownVal - neiVal) + neiVal);
301 tinterpScheme_().weights(vf),
309 gGrad.primitiveFieldRef() /=
mesh.V();
311 gGrad.correctBoundaryConditions();
318template<
class GradType>
325 DebugPout<<
"fusedGaussGrad<Type>::correctBoundaryConditions on "
335 const auto& pSf =
mesh.Sf().boundaryField()[patchi];
337 const auto& snGrad = tsnGrad();
338 auto& pgrad = gGradbf[patchi];
343 const Type uncorrectSnGrad(
n & pgrad[facei]);
344 pgrad[facei] +=
n*(snGrad[facei] - uncorrectSnGrad);
const Mesh & mesh() const noexcept
Return const reference to mesh.
const dimensionSet & dimensions() const noexcept
Return dimensions.
Generic templated field type that is much like a Foam::List except that it is expected to hold numeri...
Generic GeometricField class.
Boundary & boundaryFieldRef(const bool updateAccessTime=true)
Return a reference to the boundary field.
const Boundary & boundaryField() const noexcept
Return const-reference to the boundary field.
@ 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 word & name() const noexcept
Return the object name.
const fileName & instance() const noexcept
Read access to instance path component.
Generic dimensioned Type class.
Mesh data needed to do the Finite Volume discretisation.
static const word & extrapolatedCalculatedType() noexcept
The type name for extrapolatedCalculated patch fields combines zero-gradient and calculated.
Abstract base class with a fat-interface to all derived classes covering all possible ways in which t...
virtual tmp< GeometricField< typename outerProduct< vector, Type >::type, fvPatchField, volMesh > > calcGrad(const GeometricField< Type, fvPatchField, volMesh > &vsf, const word &name) const
Return the gradient of the given field to the gradScheme::grad for optional caching.
static void correctBoundaryConditions(const GeometricField< Type, fvPatchField, volMesh > &, GeometricField< GradType, fvPatchField, volMesh > &)
Correct the boundary values of the gradient using the patchField snGrad functions.
static tmp< GeometricField< typename outerProduct< vector, Type >::type, fvPatchField, volMesh > > gradf(const GeometricField< Type, fvsPatchField, surfaceMesh > &, const word &name)
Return the gradient of the given field calculated using Gauss' theorem on the given surface field.
const fvMesh & mesh() const
Return const reference to mesh.
An abstract base class with a fat-interface to all derived classes covering all possible ways in whic...
typeOfRank< typenamepTraits< arg1 >::cmptType, direction(pTraits< arg1 >::rank)+direction(pTraits< arg2 >::rank)>::type type
A class for managing temporary objects.
T & ref() const
Return non-const reference to the contents of a non-null managed pointer.
A Vector of values with scalar precision, where scalar is float/double depending on the compilation f...
Mesh data needed to do the Finite Volume discretisation.
A class for handling words, derived from Foam::string.
Surface integrate surfaceField creating a volField. Surface sum a surfaceField creating a volField.
#define DebugPout
Report an information message using Foam::Pout.
tmp< GeometricField< Type, fvPatchField, volMesh > > surfaceSum(const GeometricField< Type, fvsPatchField, surfaceMesh > &ssf)
const dimensionSet dimLength(0, 1, 0, 0, 0, 0, 0)
Ostream & endl(Ostream &os)
Add newline and flush stream.
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
Field< vector > vectorField
Specialisation of Field<T> for vector.
static constexpr const zero Zero
Global zero (0).
tmp< fvMatrix< Type > > correction(const fvMatrix< Type > &)
Return the correction form of the given matrix by subtracting the matrix multiplied by the current fi...
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for expressions::valueTypeCode::INVALID.
UList< label > labelUList
A UList of labels.
cellMask correctBoundaryConditions()
dimensionedScalar lambda("lambda", dimTime/sqr(dimLength), laminarTransport)
#define forAll(list, i)
Loop across all elements in list.