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
81 GeometricField<GradType, fvPatchField, volMesh>& fGrad = tfGrad.ref();
101 Type dDotGradDelta = 0.5*
103 (C[nei[facei]] - C[own[facei]])
104 & (secondfGrad[nei[facei]] - secondfGrad[own[facei]])
107 fGrad[own[facei]] -= lambda[facei]*ownLs[facei]*dDotGradDelta;
108 fGrad[nei[facei]] -= (1.0 - lambda[facei])*neiLs[facei]*dDotGradDelta;
114 if (secondfGrad.boundaryField()[
patchi].coupled())
117 ownLs.boundaryField()[
patchi];
121 const fvPatch& p = vsf.boundaryField()[
patchi].patch();
128 const Field<GradType> neighbourSecondfGrad
130 secondfGrad.boundaryField()[
patchi].patchNeighbourField()
133 forAll(faceCells, patchFacei)
135 fGrad[faceCells[patchFacei]] -=
136 0.5*lambdap[patchFacei]*patchOwnLs[patchFacei]
140 neighbourSecondfGrad[patchFacei]
141 - secondfGrad[faceCells[patchFacei]]
148 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.
rDeltaT correctBoundaryConditions()
GeometricField< vector, fvsPatchField, surfaceMesh > surfaceVectorField
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
Mesh data needed to do the Finite Volume discretisation.
autoPtr< BasicCompressibleMomentumTransportModel > New(const volScalarField &rho, const volVectorField &U, const surfaceScalarField &phi, const typename BasicCompressibleMomentumTransportModel::transportModel &transport)
volScalarField scalarField(fieldObject, mesh)
fileType type(const fileName &, const bool checkVariants=true, const bool followLink=true)
Return the file type: directory or file.
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.
A class for managing temporary objects.
GeometricField< scalar, fvsPatchField, surfaceMesh > surfaceScalarField