42 const VolField<Type>& vsf,
48 const fvMesh&
mesh = vsf.mesh();
50 tmp<VolField<GradType>> tlsGrad
65 VolField<GradType>& lsGrad = tlsGrad.ref();
78 label ownFacei = own[facei];
79 label neiFacei = nei[facei];
81 Type deltaVsf = vsf[neiFacei] - vsf[ownFacei];
83 lsGrad[ownFacei] += ownLs[facei]*deltaVsf;
84 lsGrad[neiFacei] -= neiLs[facei]*deltaVsf;
93 vsf.boundaryField()[
patchi].patch().faceCells();
95 if (vsf.boundaryField()[
patchi].coupled())
97 const Field<Type> neiVsf
99 vsf.boundaryField()[
patchi].patchNeighbourField()
102 forAll(neiVsf, patchFacei)
104 lsGrad[faceCells[patchFacei]] +=
105 patchOwnLs[patchFacei]
106 *(neiVsf[patchFacei] - vsf[faceCells[patchFacei]]);
111 const fvPatchField<Type>& patchVsf = vsf.boundaryField()[
patchi];
113 forAll(patchVsf, patchFacei)
115 lsGrad[faceCells[patchFacei]] +=
116 patchOwnLs[patchFacei]
117 *(patchVsf[patchFacei] - vsf[faceCells[patchFacei]]);
123 lsGrad.correctBoundaryConditions();
#define forAll(list, i)
Loop across all elements in list.
Generic GeometricField class.
const labelUList & owner() const
Internal face owner.
const labelUList & neighbour() const
Internal face neighbour.
virtual tmp< VolField< typename outerProduct< vector, Type >::type > > calcGrad(const VolField< Type > &vsf, const word &name) const
Return the gradient of the given field to the gradScheme::grad.
A class for managing temporary objects.
Foam::fvMesh mesh(Foam::IOobject(regionName, runTime.name(), runTime, Foam::IOobject::MUST_READ), false)
U correctBoundaryConditions()
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
const dimensionSet & dimLength
String typeName(const std::type_info &info)
Return the un-mangled name given the standard type info.
word name(const LagrangianState state)
Return a string representation of a Lagrangian state enumeration.
SurfaceField< vector > surfaceVectorField
UList< label > labelUList
fvsPatchField< vector > fvsPatchVectorField
tmp< DimensionedField< TypeR, GeoMesh, Field > > New(const tmp< DimensionedField< TypeR, GeoMesh, Field >> &tdf1, const word &name, const dimensionSet &dimensions)
fileType type(const fileName &, const bool checkVariants=true, const bool followLink=true)
Return the file type: directory or file.