Where can I find the piece of
Where can I find the piece of code that describes how the non-orthogonal correction is implemented in a solver like icoFoam? Thanks.
The code for icoFoam is in $
The code for icoFoam is in
yes, I have read the code but
yes, I have read the code but the implementation of how the non-orthogonal correction is implemented is internal and does not show on the icoFoam.C. I read that non-orthogonal grid will result when treating a laplacian term in some terms that will be treated explicitly. May be that is why there is a loop. But I'm looking for the details of how such terms are implemented in openfoam.
for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
fvm::laplacian(rUA, p) == fvc::div(phi)
if (nonOrth == nNonOrthCorr)
phi -= pEqn.flux();
Try: - my Thesis for a refere
- my Thesis for a reference
- gaussLaplacianScheme.C, line 165
where the correction comes from the snGradScheme, eg. correctedSnGrad.C, line 89:
Thanks Hrv for your help.
Thanks Hrv for your help.
Hi Hrv do i need to checkme
do i need to checkmesh before calculation,and creat the nonorth information file in the constant dictionary? to let the Non-orthogonal correction affect.
No, just run it with a correct
No, just run it with a corrected snGrad scheme.
I've been struggling to fully understand the laplacian schemes, and I think this may be the right thread to get some enlightment.
I'm still stuck at two points...
I was able to follow the overrelaxed approach (as explained in Hrv's thesis) until this point:
00066 fvm.upper() = deltaCoeffs.internalField()*gammaMagSf.internalFie ld();
Line 0066 fills the upper array of the fvMatrix with coefficients Gamma*[S^2/(d dot S)].
Tell me if I'm completely wrong, but I think this only holds true for scalar fields.
However, if you take the laplacian of a vector field (e.g. laplacian(nu,U)),
you should end up with a tensor dotted with the orthogonal part of the surface normal vector.
This should give off-diagonal contributions that should end up in the source term, right?
Where do they come into play? I couldn't figure it out yet.
The second question that I have concerns the non-orthogonol correction:
00156 const surfaceVectorField Sn(mesh.Sf()/mesh.magSf());
00158 const surfaceVectorField SfGamma(mesh.Sf() & gamma);
00159 const GeometricField<scalar, fvsPatchField, surfaceMesh> SfGammaSn
00161 SfGamma & Sn
00163 const surfaceVectorField SfGammaCorr(SfGamma - SfGammaSn*Sn);
00165 tmp<fvMatrix<Type> > tfvm = fvmLaplacianUncorrected(SfGammaSn, vf);
00166 fvMatrix<Type>& fvm = tfvm();
00168 tmp<GeometricField<Type, fvsPatchField, surfaceMesh> > tfaceFluxCorrection
00169 = gammaSnGradCorr(SfGammaCorr, vf);
00171 if (this->tsnGradScheme_().corrected())
00173 tfaceFluxCorrection() +=
00177 fvm.source() -= mesh.V()*fvc::div(tfaceFluxCorrection())().internalField();
At line 00163 the non-orthogonal part of the surface vector is calculated.
It should be gamma&(S - (d*S^2)/(d dot S)) (following Hrv's thesis).
However this doesn't correspond to the equation in line 00163.
I guess the programming is correct, since nobody ever complained in the forums,
but maybe someone knows the answer to my (probably stupid) questions.
For those who have problems understanding the laplacians in OpenFOAM, I found the answers to my questions in Ferzinger & Perić (1997) -> Chapter 8, Diffusive Fluxes
Hrv's PhD is a good lecture for laplacians in OpenFOAM, and F&P rounds the missing details up.
|All times are GMT -4. The time now is 15:27.|