|
[Sponsors] |
August 8, 2008, 10:05 |
Where can I find the piece of
|
#1 |
Senior Member
Maka Mohu
Join Date: Mar 2009
Posts: 305
Rep Power: 18 |
Where can I find the piece of code that describes how the non-orthogonal correction is implemented in a solver like icoFoam? Thanks.
|
|
August 9, 2008, 07:17 |
The code for icoFoam is in
$
|
#2 |
Member
Ola Widlund
Join Date: Mar 2009
Location: Sweden
Posts: 87
Rep Power: 17 |
The code for icoFoam is in
$FOAM_APP/solvers/incompressible/icoFoam /Ola |
|
August 9, 2008, 15:33 |
yes, I have read the code but
|
#3 |
Senior Member
Maka Mohu
Join Date: Mar 2009
Posts: 305
Rep Power: 18 |
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++) { fvScalarMatrix pEqn ( fvm::laplacian(rUA, p) == fvc::div(phi) ); pEqn.setReference(pRefCell, pRefValue); pEqn.solve(); if (nonOrth == nNonOrthCorr) { phi -= pEqn.flux(); } } Thanks. |
|
August 9, 2008, 17:49 |
42
|
#4 |
Guest
Posts: n/a
|
42
|
|
August 9, 2008, 18:58 |
Try:
- my Thesis for a refere
|
#5 |
Senior Member
Hrvoje Jasak
Join Date: Mar 2009
Location: London, England
Posts: 1,907
Rep Power: 33 |
Try:
- my Thesis for a reference - gaussLaplacianScheme.C, line 165 fvm.source() -= mesh.V()* fvc::div ( gammaMagSf*this->tsnGradScheme_().correction(vf) )().internalField(); where the correction comes from the snGradScheme, eg. correctedSnGrad.C, line 89: mesh.correctionVectors() & linear < typename outerProduct<vector,>::cmptType>::type >(mesh).interpolate ( gradScheme<typename>::cmptType>::New ( mesh, mesh.gradScheme(ssf.name()) )() //gaussGrad<typename>::cmptType>(mesh) .grad(vf.component(cmpt)) ) Clear? Hrv
__________________
Hrvoje Jasak Providing commercial FOAM/OpenFOAM and CFD Consulting: http://wikki.co.uk |
|
August 12, 2008, 06:17 |
Thanks Hrv for your help.
|
#6 |
Senior Member
Maka Mohu
Join Date: Mar 2009
Posts: 305
Rep Power: 18 |
Thanks Hrv for your help.
|
|
August 27, 2008, 12:07 |
Hi Hrv
do i need to checkme
|
#7 |
Senior Member
|
Hi Hrv
do i need to checkmesh before calculation,and creat the nonorth information file in the constant dictionary? to let the Non-orthogonal correction affect. thanks wayne |
|
August 27, 2008, 12:33 |
No, just run it with a correct
|
#8 |
Senior Member
Hrvoje Jasak
Join Date: Mar 2009
Location: London, England
Posts: 1,907
Rep Power: 33 |
No, just run it with a corrected snGrad scheme.
Hrv
__________________
Hrvoje Jasak Providing commercial FOAM/OpenFOAM and CFD Consulting: http://wikki.co.uk |
|
October 18, 2011, 07:14 |
|
#9 |
New Member
Michael Buchmayr
Join Date: Mar 2010
Posts: 16
Rep Power: 16 |
Hi!
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... 1) I was able to follow the overrelaxed approach (as explained in Hrv's thesis) until this point: gaussLaplacian.C: 00066 fvm.upper() = deltaCoeffs.internalField()*gammaMagSf.internalFie ld(); 00067 fvm.negSumDiag(); 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. 2) The second question that I have concerns the non-orthogonol correction: 00156 const surfaceVectorField Sn(mesh.Sf()/mesh.magSf()); 00157 00158 const surfaceVectorField SfGamma(mesh.Sf() & gamma); 00159 const GeometricField<scalar, fvsPatchField, surfaceMesh> SfGammaSn 00160 ( 00161 SfGamma & Sn 00162 ); 00163 const surfaceVectorField SfGammaCorr(SfGamma - SfGammaSn*Sn); 00164 00165 tmp<fvMatrix<Type> > tfvm = fvmLaplacianUncorrected(SfGammaSn, vf); 00166 fvMatrix<Type>& fvm = tfvm(); 00167 00168 tmp<GeometricField<Type, fvsPatchField, surfaceMesh> > tfaceFluxCorrection 00169 = gammaSnGradCorr(SfGammaCorr, vf); 00170 00171 if (this->tsnGradScheme_().corrected()) 00172 { 00173 tfaceFluxCorrection() += 00174 SfGammaSn*this->tsnGradScheme_().correction(vf); 00175 } 00176 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. |
|
October 25, 2011, 11:55 |
|
#10 |
New Member
Michael Buchmayr
Join Date: Mar 2010
Posts: 16
Rep Power: 16 |
Hi!
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. |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
About nonorthogonal correction in fvclaplacian | 7islands | OpenFOAM Running, Solving & CFD | 4 | December 9, 2012 23:54 |
When and how to apply nonOrthogonal correctors | vvqf | OpenFOAM Running, Solving & CFD | 1 | March 22, 2006 06:21 |
implementing FDM on nonorthogonal coordinate syste | yfyap | Main CFD Forum | 3 | June 13, 2001 17:51 |
on nonorthogonal boudary fitted coordinate | yf yap | Main CFD Forum | 2 | January 20, 2001 03:13 |
2nd derivative on nonorthogonal FV-mesh | Thomas Wolfanger | Main CFD Forum | 1 | June 29, 1999 12:00 |