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

Problems about setReference() and solve PPE

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   April 24, 2016, 10:23
Post Problems about setReference() and solve PPE
  #1
New Member
 
Zhanchao Hu
Join Date: Apr 2016
Posts: 8
Rep Power: 10
chaochaoyoyo is on a distinguished road
Hi everyone,

I am now solving a Rayleigh-Bernard problem by my own solver (SIMPLER). The boundary condition for dynamic pressure is zeroGradient. But the difficulty in solving Pressure Poisson Eqaution(PPE) hindered me for a long time.

1. I have tried to use setReference(). The solution is converged quickly. But it is obvious the reference point has a bad influence on the solution. The solution changes drastically as the reference point changes. I can't figure out the reason. Could any one tell me the skills in set reference pressure to make the solution accurate?

2. The other method I want to implement is to change continuity equation as:

\frac{1}{\beta }\frac{{\partial {p^k} - {p^{k - 1}}}}{{\partial t}} + \frac{{\partial \rho }}{{\partial t}} + \nabla  \cdot (\rho \vec u) = 0

By doing this, the PPE is more diagonally dominant. And when the solution of PPE converged, p_k=p_{k-1}, the continuity equation become the right one. This can be called an equivalent artificial compressibility method.

But I don't know how this method can be implemented in Openfoam. Becasue it requires to change the RHS of PPE during the solve() process (the fvc::ddt(1/beta,p) should be changed after each iteration). Could any one tells me how can I realize this method in OpenFOAM? Do I have to rewrite solve() function?

Any suggestions will be appreciated.


Zhanchao

Last edited by chaochaoyoyo; April 25, 2016 at 01:21.
chaochaoyoyo is offline   Reply With Quote

Old   April 24, 2016, 13:30
Default
  #2
Super Moderator
 
Tobi's Avatar
 
Tobias Holzmann
Join Date: Oct 2010
Location: Tussenhausen
Posts: 2,708
Blog Entries: 6
Rep Power: 51
Tobi has a spectacular aura aboutTobi has a spectacular aura aboutTobi has a spectacular aura about
Send a message via ICQ to Tobi Send a message via Skype™ to Tobi
Hello,

I am not so familiar with your method (reference would be nice). If you want to change the pressure equation, just do it:

Code:
            fvScalarMatrix pEqn
            (
                fvm::div(phid, p)
              - fvm::laplacian(rho*rAU, p)
              ==
                fvOptions(psi, p, rho.name())
            );
You should also be able to do this using the fvOptions feature of openFoam. But with the pressure / velocity coupling I am not familiar - sorry.
__________________
Keep foaming,
Tobias Holzmann
Tobi is offline   Reply With Quote

Old   April 24, 2016, 21:55
Cool
  #3
New Member
 
Zhanchao Hu
Join Date: Apr 2016
Posts: 8
Rep Power: 10
chaochaoyoyo is on a distinguished road
Quote:
Originally Posted by Tobi View Post
Hello,

I am not so familiar with your method (reference would be nice). If you want to change the pressure equation, just do it:

Code:
            fvScalarMatrix pEqn
            (
                fvm::div(phid, p)
              - fvm::laplacian(rho*rAU, p)
              ==
                fvOptions(psi, p, rho.name())
            );
You should also be able to do this using the fvOptions feature of openFoam. But with the pressure / velocity coupling I am not familiar - sorry.
Hi Tobi,

What you suggest is very helpful. Thank you.

I am reading some materials about fvOptions(). Do you know whether or not the fvOptions() function modify the source term during pEqn.solve() process? If it does, this is what I am looking for!

Best regards,
Zhanchao
chaochaoyoyo is offline   Reply With Quote

Old   April 25, 2016, 02:47
Default
  #4
Super Moderator
 
Tobi's Avatar
 
Tobias Holzmann
Join Date: Oct 2010
Location: Tussenhausen
Posts: 2,708
Blog Entries: 6
Rep Power: 51
Tobi has a spectacular aura aboutTobi has a spectacular aura aboutTobi has a spectacular aura about
Send a message via ICQ to Tobi Send a message via Skype™ to Tobi
Hello,

the function solve() only solves your matrix that you build before. The matrix you want to solve is that one

Code:
fvScalarMatrix pEqn
(

);
If you modify this equation, you will also solve a modified pressure equation. So if you set a source in the fvOptions for the pEqn, it will be replaced in the term on the RHS named fvOptions(psi, p, rho.name()).
__________________
Keep foaming,
Tobias Holzmann
Tobi 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



All times are GMT -4. The time now is 11:30.