CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM (https://www.cfd-online.com/Forums/openfoam/)
-   -   The Artificial Compressibility Method (https://www.cfd-online.com/Forums/openfoam/83286-artificial-compressibility-method.html)

nsreddysrsit December 22, 2010 07:19

The Artificial Compressibility Method
 
hi Foamers,
I am trying to use compressible flow solvers ( like Roe Scheme and Riemann solver based schemes ) for solving incompressible flows. My Problem is how to write a code for the above problem in OpenFOAM using artificial compressibility method. can anybody please send me a format of the code. My email id is "nsreddysrsit@gmail.com". thanks in advance.


With Regards
N.S. Reddy,

nakul December 22, 2010 09:08

Hi,

What do you mean by the "format" of the code?

If you are asking about the way you can implement your written line into OF then have a look at the solvers in "applications" folder. You should be well versed with C++ to understand it.

The solvers there would give you an idea about the way you may write your code to integrate it into OF. Moreover you may pick up anyone of those solvers and modify it.

nsreddysrsit December 23, 2010 00:32

Quote:

Originally Posted by nakul (Post 288141)
Hi,

What do you mean by the "format" of the code?

If you are asking about the way you can implement your written line into OF then have a look at the solvers in "applications" folder. You should be well versed with C++ to understand it.

The solvers there would give you an idea about the way you may write your code to integrate it into OF. Moreover you may pick up anyone of those solvers and modify it.

Thanks nakul,
what i mean to say is whatever available algorithm in openfoam is SIMPLE algorithm(Pressure correction Method). I need to write a code for new algorithm using Artificial Compressibility method. is it possible to implement SIMPLE algorithm or i need to write a new code.

Regards,
N. S. Reddy

nakul December 23, 2010 10:36

Hi,

I still can't understand as to what you are trying to do exactly. If you want to implement some equations you may post them here (or some reference material/theory) and I would have a look.

From what you have written, all I can say is that OF is quite flexible and you can implement both SIMPLE algorithm and can implement your own specific algorithm, if you want to.

arjun December 23, 2010 20:14

First I am not openFOAM user and thus am not aware of its details. I am replying because you haven't got any helpful reply from openfoam users.

my impression is that openFOAM is pressure based solver. It means that you can not convert it into the type of solver you want to write. (Even if it might be possible by some means it would be a great amount of work). In the same amount you can write a fresh solver.

Here is one book you should consult :

Riemann Solvers and Numerical Methods for Fluid Dynamics.
E. F. Toro.

I have it here in library as hard copy and i can tell you by reading it you will get lot of help writing code.

Other than that basic idea of artificial compressibility is this. In a incompressible navier stokes solver, pressure equation that is solved for continuity is elliptic. The biggest problem with this type of equation is that matrix solver does not converge easily. But if someway diagonal dominance is increased it would converge rapidly.
So lets add a term to pressure equation:

(1/beta) dP/dt
here beta = artificial compressibility parameter ,
dt is your time step.

Beauty of this method is that now equation is not only diagonal dominant but some methods like approaximate factorization could be applied to it. For example ADI.

This is only and outline there are lot more of details that books would tell you.

nakul December 24, 2010 11:12

Hi Arjun,

You are right in saying that most of the solvers in OF are pressure based. But there is a package there which has Riemann Solvers also. Its called AeroFOAM and can be easily found by googling for it.

If by "adding artificial compressibility", it is meant that the changes to be made are just to the level mentioned above then its quite easy to make these changes without much effort.

You just need to define this parameter, them make changes to N-S equations and recompile the solver.

nsreddysrsit January 3, 2011 02:06

Quote:

Originally Posted by arjun (Post 288335)
First I am not openFOAM user and thus am not aware of its details. I am replying because you haven't got any helpful reply from openfoam users.

my impression is that openFOAM is pressure based solver. It means that you can not convert it into the type of solver you want to write. (Even if it might be possible by some means it would be a great amount of work). In the same amount you can write a fresh solver.

Here is one book you should consult :

Riemann Solvers and Numerical Methods for Fluid Dynamics.
E. F. Toro.

I have it here in library as hard copy and i can tell you by reading it you will get lot of help writing a code.

Other than that basic idea of artificial compressibility is this. In a incompressible navier stokes solver, pressure equation that is solved for continuity is elliptic. The biggest problem with this type of equation is that matrix solver does not converge easily. But if someway diagonal dominance is increased it would converge rapidly.
So lets add a term to pressure equation:

(1/beta) dP/dt
here beta = artificial compressibility parameter ,
dt is your time step.

Beauty of this method is that now equation is not only diagonal dominant but some methods like approaximate factorization could be applied to it. For example ADI.

This is only and outline there are lot more of details that books would tell you.

Hi Arjun,
thanks for your kind information and you are exactly correct. Is there any source code readily available for Artificial Compressibility method for any type of test case rather than writing a code for a new solver.


All times are GMT -4. The time now is 04:41.