52 const GeometricField<Type, fvPatchField, volMesh>& vsf,
57 typedef GeometricField<GradType, fvPatchField, volMesh> GradFieldType;
59 const fvMesh&
mesh = vsf.mesh();
61 tmp<GradFieldType> tlsGrad
78 GradFieldType& lsGrad = tlsGrad.ref();
91 const label ownFacei = own[facei];
92 const label neiFacei = nei[facei];
94 const Type deltaVsf(vsf[neiFacei] - vsf[ownFacei]);
96 lsGrad[ownFacei] += ownLs[facei]*deltaVsf;
97 lsGrad[neiFacei] -= neiLs[facei]*deltaVsf;
101 forAll(vsf.boundaryField(), patchi)
106 vsf.boundaryField()[patchi].patch().faceCells();
108 if (vsf.boundaryField()[patchi].coupled())
110 const Field<Type> neiVsf
112 vsf.boundaryField()[patchi].patchNeighbourField()
115 forAll(neiVsf, patchFacei)
117 lsGrad[faceCells[patchFacei]] +=
118 patchOwnLs[patchFacei]
119 *(neiVsf[patchFacei] - vsf[faceCells[patchFacei]]);
124 const fvPatchField<Type>& patchVsf = vsf.boundaryField()[patchi];
126 forAll(patchVsf, patchFacei)
128 lsGrad[faceCells[patchFacei]] +=
129 patchOwnLs[patchFacei]
130 *(patchVsf[patchFacei] - vsf[faceCells[patchFacei]]);
136 lsGrad.correctBoundaryConditions();
fvsPatchField< vector > fvsPatchVectorField
GeometricField< vector, fvsPatchField, surfaceMesh > surfaceVectorField
cellMask correctBoundaryConditions()
tmp< DimensionedField< TypeR, GeoMesh > > New(const tmp< DimensionedField< TypeR, GeoMesh >> &tf1, const word &name, const dimensionSet &dimensions, const bool initCopy=false)
Global function forwards to reuseTmpDimensionedField::New.
Abstract base class with a fat-interface to all derived classes covering all possible ways in which t...
typeOfRank< typename pTraits< arg1 >::cmptType, direction(pTraits< arg1 >::rank)+direction(pTraits< arg2 >::rank) >::type type
Generic GeometricField class.
UList< label > labelUList
A UList of labels.
#define forAll(list, i)
Loop across all elements in list.
Mesh data needed to do the Finite Volume discretisation.
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for expressions::valueTypeCode::INVALID.
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.
const dimensionSet dimLength(0, 1, 0, 0, 0, 0, 0)
A class for managing temporary objects.
const word extrapolatedCalculatedType
A combined zero-gradient and calculated patch field type.
static constexpr const zero Zero
Global zero (0)