CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Running, Solving & CFD

Nonorthogonal correction

Register Blogs Community New Posts Updated Threads Search

Like Tree8Likes
  • 4 Post By hjasak
  • 2 Post By MichiB
  • 2 Post By MichiB

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   August 8, 2008, 10:05
Default Where can I find the piece of
  #1
Senior Member
 
Maka Mohu
Join Date: Mar 2009
Posts: 305
Rep Power: 18
maka is on a distinguished road
Where can I find the piece of code that describes how the non-orthogonal correction is implemented in a solver like icoFoam? Thanks.
maka is offline   Reply With Quote

Old   August 9, 2008, 07:17
Default The code for icoFoam is in $
  #2
Member
 
Ola Widlund
Join Date: Mar 2009
Location: Sweden
Posts: 87
Rep Power: 17
olwi is on a distinguished road
The code for icoFoam is in
$FOAM_APP/solvers/incompressible/icoFoam

/Ola
olwi is offline   Reply With Quote

Old   August 9, 2008, 15:33
Default yes, I have read the code but
  #3
Senior Member
 
Maka Mohu
Join Date: Mar 2009
Posts: 305
Rep Power: 18
maka is on a distinguished road
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.
maka is offline   Reply With Quote

Old   August 9, 2008, 17:49
Default 42
  #4
nadine
Guest
 
Posts: n/a
42
  Reply With Quote

Old   August 9, 2008, 18:58
Default Try: - my Thesis for a refere
  #5
Senior Member
 
Hrvoje Jasak
Join Date: Mar 2009
Location: London, England
Posts: 1,907
Rep Power: 33
hjasak will become famous soon enough
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
fumiya, Tobi, AshwaniAssam and 1 others like this.
__________________
Hrvoje Jasak
Providing commercial FOAM/OpenFOAM and CFD Consulting: http://wikki.co.uk
hjasak is offline   Reply With Quote

Old   August 12, 2008, 06:17
Default Thanks Hrv for your help.
  #6
Senior Member
 
Maka Mohu
Join Date: Mar 2009
Posts: 305
Rep Power: 18
maka is on a distinguished road
Thanks Hrv for your help.
maka is offline   Reply With Quote

Old   August 27, 2008, 12:07
Default Hi Hrv do i need to checkme
  #7
Senior Member
 
wayne.zhang
Join Date: Mar 2009
Location: Shanghai, Shanghai, P.R.China
Posts: 309
Rep Power: 18
waynezw0618 is on a distinguished road
Send a message via MSN to waynezw0618 Send a message via Skype™ to waynezw0618
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
waynezw0618 is offline   Reply With Quote

Old   August 27, 2008, 12:33
Default 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
hjasak will become famous soon enough
No, just run it with a corrected snGrad scheme.

Hrv
__________________
Hrvoje Jasak
Providing commercial FOAM/OpenFOAM and CFD Consulting: http://wikki.co.uk
hjasak is offline   Reply With Quote

Old   October 18, 2011, 07:14
Default
  #9
New Member
 
Michael Buchmayr
Join Date: Mar 2010
Posts: 16
Rep Power: 16
MichiB is on a distinguished road
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.
fumiya and Niteck like this.
MichiB is offline   Reply With Quote

Old   October 25, 2011, 11:55
Default
  #10
New Member
 
Michael Buchmayr
Join Date: Mar 2010
Posts: 16
Rep Power: 16
MichiB is on a distinguished road
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.
kaifu and fumiya like this.
MichiB is offline   Reply With Quote

Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


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


All times are GMT -4. The time now is 16:10.