44 const VolField<Type>& vsf,
55 const fvMesh& mesh = vsf.mesh();
59 tmp<VolField<GradType>> tsecondfGrad
60 = leastSquaresGrad<Type>(mesh).grad
63 "leastSquaresGrad(" + vsf.name() +
")"
65 const VolField<GradType>& secondfGrad =
68 tmp<VolField<GradType>> tfGrad
76 VolField<GradType>& fGrad = tfGrad.ref();
96 Type dDotGradDelta = 0.5*
98 (
C[nei[facei]] -
C[own[facei]])
99 & (secondfGrad[nei[facei]] - secondfGrad[own[facei]])
102 fGrad[own[facei]] -=
lambda[facei]*ownLs[facei]*dDotGradDelta;
103 fGrad[nei[facei]] -= (1.0 -
lambda[facei])*neiLs[facei]*dDotGradDelta;
109 if (secondfGrad.boundaryField()[
patchi].coupled())
112 ownLs.boundaryField()[
patchi];
116 const fvPatch&
p = vsf.boundaryField()[
patchi].patch();
123 const Field<GradType> neighbourSecondfGrad
125 secondfGrad.boundaryField()[
patchi].patchNeighbourField()
128 forAll(faceCells, patchFacei)
130 fGrad[faceCells[patchFacei]] -=
131 0.5*lambdap[patchFacei]*patchOwnLs[patchFacei]
135 neighbourSecondfGrad[patchFacei]
136 - secondfGrad[faceCells[patchFacei]]
143 fGrad.correctBoundaryConditions();
static const Foam::dimensionedScalar C("C", Foam::dimTemperature, 234.5)
#define forAll(list, i)
Loop across all elements in list.
Generic GeometricField class.
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.
volScalarField scalarField(fieldObject, mesh)
volVectorField vectorField(fieldObject, mesh)
U correctBoundaryConditions()
dimensionedScalar lambda(viscosity->lookup("lambda"))
autoPtr< CompressibleMomentumTransportModel > New(const volScalarField &rho, const volVectorField &U, const surfaceScalarField &phi, const viscosity &viscosity)
word name(const bool)
Return a word representation of a bool.
SurfaceField< scalar > surfaceScalarField
SurfaceField< vector > surfaceVectorField
UList< label > labelUList
fvsPatchField< vector > fvsPatchVectorField
fileType type(const fileName &, const bool checkVariants=true, const bool followLink=true)
Return the file type: directory or file.