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

pisoFoam laplace equation

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   April 29, 2011, 08:05
Default pisoFoam laplace equation
  #1
Member
 
fisch
Join Date: Feb 2010
Posts: 97
Rep Power: 16
fisch is on a distinguished road
Hello,

i'm currently reading jasaks thesis and have a look inside the pisofoam solver.
Here is one thing i didnt understand in the following part of the solver:

U = rUA*UEqn.H();
phi = (fvc::interpolate(U) & mesh.Sf())+(maybe something)
...
fvScalarMatrix pEqn
(
fvm::laplacian(rUA, p) == fvc::div(phi)
);

Is the equation for phi representing the hole (2nd) r.h.s. of equation 3.141 in the thesis (page 146)? I thought so, because we are evaluating here the UEqn.H/a_p on the Surface multiplied by the Area.
Why are we then taking the divergence of phi in the laplace equation? This would not match the formula 3.141 or 3.143...


Can anybody help me and/or tell me my missinterpretations?
This would be great.

Thanks for any advice,

rupert
fisch is offline   Reply With Quote

Old   April 30, 2011, 02:40
Default
  #2
Senior Member
 
Alberto Passalacqua
Join Date: Mar 2009
Location: Ames, Iowa, United States
Posts: 1,912
Rep Power: 36
alberto will become famous soon enoughalberto will become famous soon enough
Hi, think to discretizing the momentum equation as

A*U = H - grad(p),

then

U = H/A - 1/A * grad(p)

The face flux is then

phi = U_f . S = (H/A)_f . S - (1/A)_f |S| snGrad(p)

OpenFOAM first computes

phi = (H/A)_f . S,

then solves the pressure equation obtained imposing

div(phi) = 0,

which leads to

laplacian (1/A*p) = div(phi)

Once this equation is solved, the flux is corrected using the second part of the flux definition.
__________________
Alberto Passalacqua

GeekoCFD - A free distribution based on openSUSE 64 bit with CFD tools, including OpenFOAM. Available as in both physical and virtual formats (current status: http://albertopassalacqua.com/?p=1541)
OpenQBMM - An open-source implementation of quadrature-based moment methods.

To obtain more accurate answers, please specify the version of OpenFOAM you are using.
alberto is offline   Reply With Quote

Old   April 30, 2011, 08:37
Default
  #3
Member
 
fisch
Join Date: Feb 2010
Posts: 97
Rep Power: 16
fisch is on a distinguished road
Quote:
Originally Posted by alberto View Post
Hi, think to discretizing the momentum equation as

A*U = H - grad(p),

then

U = H/A - 1/A * grad(p)

The face flux is then

phi = U_f . S = (H/A)_f . S - (1/A)_f |S| snGrad(p)

OpenFOAM first computes

phi = (H/A)_f . S,

then solves the pressure equation obtained imposing

div(phi) = 0,

which leads to

laplacian (1/A*p) = div(phi)

Once this equation is solved, the flux is corrected using the second part of the flux definition.

Hello Alberto, thank you for the reply.

Maybe i have problems understanding the commands...

I understand that taking the divergence of equation phi = U_f . S = (H/A)_f . S - (1/A)_f |S| snGrad(p) removes the left hand side and the right hand side = 0 is building then the poisson equation... right?

But I thought that (1/A)_f |S| snGrad(p) == div[(1/A) * grad(p)] == laplace (1/A * p)
Herein snGrad(p) is the gradient of p at the surfaces.
is this not right?

Having a look on the equation for pressure on http://openfoamwiki.net/index.php/Th...hm_in_OpenFOAM at chapter 2 (the last equation) this would lead (for me) to a pressure equation like:
laplacian (1/A*p) = (H/A)_f . S = phi
(and not div(phi))

Do you understand my problem? where is my misinterpretation???


Thank you a lot,
rupert
fisch is offline   Reply With Quote

Old   April 30, 2011, 16:57
Default
  #4
Senior Member
 
Alberto Passalacqua
Join Date: Mar 2009
Location: Ames, Iowa, United States
Posts: 1,912
Rep Power: 36
alberto will become famous soon enoughalberto will become famous soon enough
Quote:
Originally Posted by fisch View Post
But I thought that (1/A)_f |S| snGrad(p) == div[(1/A) * grad(p)] == laplace (1/A * p)
Herein snGrad(p) is the gradient of p at the surfaces.
is this not right?
Yes, since you basically dot with the surface vector.

Quote:
Having a look on the equation for pressure on http://openfoamwiki.net/index.php/Th...hm_in_OpenFOAM at chapter 2 (the last equation) this would lead (for me) to a pressure equation like:
laplacian (1/A*p) = (H/A)_f . S = phi
(and not div(phi))
If you define

phi = (H/A)_f . S - (1/A)_f |S| snGrad(p)

you have

div(phi) = 0

implies

div((H/A)_f . S) = laplacian(1/A*p),

which is exactly

div(phi) = laplacian(1/A*p)

Best,
__________________
Alberto Passalacqua

GeekoCFD - A free distribution based on openSUSE 64 bit with CFD tools, including OpenFOAM. Available as in both physical and virtual formats (current status: http://albertopassalacqua.com/?p=1541)
OpenQBMM - An open-source implementation of quadrature-based moment methods.

To obtain more accurate answers, please specify the version of OpenFOAM you are using.

Last edited by alberto; May 2, 2011 at 03:12. Reason: Added missing S
alberto is offline   Reply With Quote

Old   May 1, 2011, 06:47
Default
  #5
Member
 
fisch
Join Date: Feb 2010
Posts: 97
Rep Power: 16
fisch is on a distinguished road
Good morning,
i hope that i'm not bugging you, but:

you confirmed that
a) (1/A)_f |S| snGrad(p) == div[(1/A) * grad(p)] == laplace (1/A * p)
right?

If a) works it will make the phi equation from
phi = (H/A)_f - (1/A)_f |S| snGrad(p)
to
b) phi = (H/A)_f - laplace (1/A*p)

div(b) leads to
0 = div((H/A)_f) - div(laplace (1/A*p))
or not?

I think that my problem lies in a)
If (1/A)_f |S| snGrad(p) would be equal to (1/A) * grad(p) this would solve my problems... Is this the case? This would mean that
snGrad(p) == grad(p) (defined at the cellcenter) * normalvector (at the surfaces)

Hope you can finally help me

Thanks,
rupert
fisch is offline   Reply With Quote

Old   May 1, 2011, 18:19
Default
  #6
Senior Member
 
Alberto Passalacqua
Join Date: Mar 2009
Location: Ames, Iowa, United States
Posts: 1,912
Rep Power: 36
alberto will become famous soon enoughalberto will become famous soon enough
Quote:
Originally Posted by fisch View Post
Good morning,
i hope that i'm not bugging you, but:

you confirmed that
a) (1/A)_f |S| snGrad(p) == div[(1/A) * grad(p)] == laplace (1/A * p)
right?
No. How can

div(1/A grad(p))

be equal to

(1/A)_f |S| snGrad(p) ?

You have to think to the velocity predictor

U = H/A - 1/A grad(p),

interpolate it on cell faces, and obtain U_f. At that point you dot it with the surface vector, and, at that point, you have the snGrad(p).

Best,
__________________
Alberto Passalacqua

GeekoCFD - A free distribution based on openSUSE 64 bit with CFD tools, including OpenFOAM. Available as in both physical and virtual formats (current status: http://albertopassalacqua.com/?p=1541)
OpenQBMM - An open-source implementation of quadrature-based moment methods.

To obtain more accurate answers, please specify the version of OpenFOAM you are using.
alberto is offline   Reply With Quote

Old   May 2, 2011, 02:58
Default
  #7
Member
 
fisch
Join Date: Feb 2010
Posts: 97
Rep Power: 16
fisch is on a distinguished road
Quote:
Originally Posted by alberto View Post
If you define
phi = (H/A)_f - (1/A)_f |S| snGrad(p)
you have
div(phi) = 0
implies
div((H/A)_f) = laplacian(1/A*p),
which is exactly
div(phi) = laplacian(1/A*p)
Hi,

using your definition for phi: "phi = (H/A)_f - (1/A)_f |S| snGrad(p)"

Div of this equation leads to " 0 = div((H/A)_f) - div( (1/A)_f) |S| snGrad(p))"

How can you say here that div( (1/A)_f) |S| snGrad(p)) is equal to laplacian(1/A*p)???
fisch is offline   Reply With Quote

Old   May 2, 2011, 03:22
Default
  #8
Senior Member
 
Alberto Passalacqua
Join Date: Mar 2009
Location: Ames, Iowa, United States
Posts: 1,912
Rep Power: 36
alberto will become famous soon enoughalberto will become famous soon enough
Quote:
Originally Posted by fisch View Post
Hi,

using your definition for phi: "phi = (H/A)_f - (1/A)_f |S| snGrad(p)"

Div of this equation leads to " 0 = div((H/A)_f) - div( (1/A)_f) |S| snGrad(p))"

How can you say here that div( (1/A)_f) |S| snGrad(p)) is equal to laplacian(1/A*p)???
By definition, the Laplacian of a function defined on a Euclidean space is the divergence of the gradient of the same function. The surface-normal gradient originates from the dot product of the interpolated velocity on cell faces with the face area vector.

The only element that probably can cause confusion is the norm of the surface, which is not in the code, since operators take care of it.

Best,
__________________
Alberto Passalacqua

GeekoCFD - A free distribution based on openSUSE 64 bit with CFD tools, including OpenFOAM. Available as in both physical and virtual formats (current status: http://albertopassalacqua.com/?p=1541)
OpenQBMM - An open-source implementation of quadrature-based moment methods.

To obtain more accurate answers, please specify the version of OpenFOAM you are using.
alberto is offline   Reply With Quote

Old   May 2, 2011, 05:04
Default
  #9
Member
 
fisch
Join Date: Feb 2010
Posts: 97
Rep Power: 16
fisch is on a distinguished road
thank you very much
fisch is offline   Reply With Quote

Old   October 29, 2011, 08:14
Default learn a lot!
  #10
New Member
 
charlse
Join Date: Mar 2011
Location: china
Posts: 6
Rep Power: 15
star shower is on a distinguished road
I learn a lot! Thank you!
For me, the relationship of div(phi)=0 is doubted. Now I know, phi is a scalar, and its div is zero!

Last edited by star shower; October 29, 2011 at 09:11.
star shower is offline   Reply With Quote

Old   July 16, 2013, 22:13
Default
  #11
Senior Member
 
Dongyue Li
Join Date: Jun 2012
Location: Beijing, China
Posts: 838
Rep Power: 17
sharonyue is on a distinguished road
Quote:
Originally Posted by star shower View Post
I learn a lot! Thank you!
For me, the relationship of div(phi)=0 is doubted. Now I know, phi is a scalar, and its div is zero!
I dont think its because phi is a scalar then div(phi) =0, But Im also confused it too. http://www.cfd-online.com/Forums/ope...tml#post440172
sharonyue 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
mass flow in is not equal to mass flow out saii CFX 12 March 19, 2018 05:21
Calculation of the Governing Equations Mihail CFX 7 September 7, 2014 06:27
Constant velocity of the material Sas CFX 15 July 13, 2010 08:56
Fast iterative methods (for Laplace equation)? pzhang Main CFD Forum 2 September 30, 2008 16:28
discretization of laplace equation using FVM stein Main CFD Forum 2 November 9, 2005 12:58


All times are GMT -4. The time now is 13:29.