35 #define declareFvmLaplacianScalarGamma(Type) \ 38 Foam::tmp<Foam::fvMatrix<Foam::Type>> \ 39 Foam::fv::relaxedNonOrthoGaussLaplacianScheme<Foam::Type, Foam::scalar>:: \ 42 const GeometricField<scalar, fvsPatchField, surfaceMesh>& gamma, \ 43 const GeometricField<Type, fvPatchField, volMesh>& vf \ 46 const fvMesh& mesh = this->mesh(); \ 48 typedef GeometricField<Type, fvsPatchField, surfaceMesh> SType; \ 50 GeometricField<scalar, fvsPatchField, surfaceMesh> gammaMagSf \ 55 tmp<fvMatrix<Type>> tfvm = fvmLaplacianUncorrected \ 58 this->tsnGradScheme_().deltaCoeffs(vf), \ 61 fvMatrix<Type>& fvm = tfvm.ref(); \ 63 if (this->tsnGradScheme_().corrected()) \ 65 tmp<SType> tCorr(this->tsnGradScheme_().correction(vf)); \ 66 const word corrName(tCorr().name()); \ 67 tmp<SType> tfaceFluxCorrection(gammaMagSf*tCorr); \ 69 tmp<SType> trelaxedCorrection(new SType(tfaceFluxCorrection())); \ 71 const word oldName(corrName + "_0"); \ 72 const scalar relax(vf.mesh().equationRelaxationFactor(corrName)); \ 73 const objectRegistry& obr = vf.db(); \ 74 if (obr.foundObject<SType>(oldName)) \ 76 SType& oldCorrection = obr.lookupObjectRef<SType>(oldName); \ 77 trelaxedCorrection.ref() *= relax; \ 78 trelaxedCorrection.ref() += (1.0-relax)*oldCorrection; \ 80 oldCorrection = trelaxedCorrection(); \ 84 SType* s = new SType(oldName, tfaceFluxCorrection); \ 88 tmp<Field<Type>> tcorr \ 93 trelaxedCorrection() \ 94 )().primitiveField() \ 97 fvm.source() -= tcorr(); \ 99 if (mesh.fluxRequired(vf.name())) \ 101 fvm.faceFluxCorrectionPtr() = trelaxedCorrection.ptr(); \ 110 Foam::tmp<Foam::GeometricField<Foam::Type, Foam::fvPatchField, Foam::volMesh>> \ 111 Foam::fv::relaxedNonOrthoGaussLaplacianScheme<Foam::Type, Foam::scalar>::fvcLaplacian \ 113 const GeometricField<scalar, fvsPatchField, surfaceMesh>& gamma, \ 114 const GeometricField<Type, fvPatchField, volMesh>& vf \ 117 const fvMesh& mesh = this->mesh(); \ 119 tmp<GeometricField<Type, fvPatchField, volMesh>> tLaplacian \ 121 fvc::div(gamma*this->tsnGradScheme_().snGrad(vf)*mesh.magSf()) \ 124 tLaplacian.ref().rename \ 126 "laplacian(" + gamma.name() + ',' + vf.name() + ')' \
#define declareFvmLaplacianScalarGamma(Type)
A Vector of values with scalar precision, where scalar is float/double depending on the compilation f...
Tensor of scalars, i.e. Tensor<scalar>.
makeFvLaplacianScheme(relaxedNonOrthoGaussLaplacianScheme)