pisoFoam laplace equation
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)
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,
Hi, think to discretizing the momentum equation as
A*U = H - grad(p),
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,
phi = (H/A)_f . S - (1/A)_f |S| snGrad(p)
div(phi) = 0
div((H/A)_f . S) = laplacian(1/A*p),
which is exactly
div(phi) = laplacian(1/A*p)
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)
If a) works it will make the phi equation from
phi = (H/A)_f - (1/A)_f |S| snGrad(p)
b) phi = (H/A)_f - laplace (1/A*p)
div(b) leads to
0 = div((H/A)_f) - div(laplace (1/A*p))
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 :D
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).
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)???
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.
thank you very much
learn a lot!
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!
|All times are GMT -4. The time now is 10:20.|