49 const GeometricField<Type, fvPatchField, volMesh>& vsf,
60 const fvMesh& mesh = vsf.mesh();
64 tmp<GeometricField<GradType, fvPatchField, volMesh>> tsecondfGrad
68 "leastSquaresGrad(" + vsf.name() +
")" 70 const GeometricField<GradType, fvPatchField, volMesh>& secondfGrad =
73 tmp<GeometricField<GradType, fvPatchField, volMesh>> tfGrad
75 new GeometricField<GradType, fvPatchField, volMesh>
88 GeometricField<GradType, fvPatchField, volMesh>& fGrad = tfGrad.ref();
108 Type dDotGradDelta = 0.5*
110 (C[nei[facei]] - C[own[facei]])
111 & (secondfGrad[nei[facei]] - secondfGrad[own[facei]])
114 fGrad[own[facei]] -= lambda[facei]*ownLs[facei]*dDotGradDelta;
115 fGrad[nei[facei]] -= (1.0 - lambda[facei])*neiLs[facei]*dDotGradDelta;
121 if (secondfGrad.boundaryField()[
patchi].coupled())
124 ownLs.boundaryField()[
patchi];
128 const fvPatch& p = vsf.boundaryField()[
patchi].patch();
135 const Field<GradType> neighbourSecondfGrad
137 secondfGrad.boundaryField()[
patchi].patchNeighbourField()
140 forAll(faceCells, patchFacei)
142 fGrad[faceCells[patchFacei]] -=
143 0.5*lambdap[patchFacei]*patchOwnLs[patchFacei]
147 neighbourSecondfGrad[patchFacei]
148 - secondfGrad[faceCells[patchFacei]]
155 fGrad.correctBoundaryConditions();
fvsPatchField< vector > fvsPatchVectorField
tmp< GeometricField< typename outerProduct< vector, Type >::type, fvPatchField, volMesh >> grad(const GeometricField< Type, fvsPatchField, surfaceMesh > &ssf)
#define forAll(list, i)
Loop across all elements in list.
GeometricField< vector, fvsPatchField, surfaceMesh > surfaceVectorField
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.
Abstract base class with a fat-interface to all derived classes covering all possible ways in which t...
volVectorField vectorField(fieldObject, mesh)
typeOfRank< typename pTraits< arg1 >::cmptType, direction(pTraits< arg1 >::rank)+direction(pTraits< arg2 >::rank) >::type type
Generic GeometricField class.
UList< label > labelUList
tmp< DimensionedField< TypeR, GeoMesh > > New(const tmp< DimensionedField< TypeR, GeoMesh >> &tdf1, const word &name, const dimensionSet &dimensions)
Mesh data needed to do the Finite Volume discretisation.
volScalarField scalarField(fieldObject, mesh)
fileName::Type type(const fileName &)
Return the file type: DIRECTORY or FILE.
U correctBoundaryConditions()
A class for managing temporary objects.
GeometricField< scalar, fvsPatchField, surfaceMesh > surfaceScalarField