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

Artificial compressibility in open foam

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   November 18, 2010, 17:00
Default Artificial compressibility in open foam
  #1
Senior Member
 
Join Date: Nov 2009
Location: Michigan
Posts: 135
Rep Power: 17
doubtsincfd is on a distinguished road
Is there Artificial Compressibility solver in openfoam first introduced by Chorin?
doubtsincfd is offline   Reply With Quote

Old   November 19, 2010, 02:27
Default
  #2
Senior Member
 
Nakul
Join Date: Apr 2010
Location: India
Posts: 147
Rep Power: 16
nakul is on a distinguished road
Hi

The description of the available solvers can be found in User'd Guide and in the source code locate in "$/applications/solvers/".

You may find suitable solver four your specific problem.

If you just elaborate exactly what you want to do then it would be easier to suggest some perticular solver.
nakul is offline   Reply With Quote

Old   November 19, 2010, 09:06
Default
  #3
Senior Member
 
David Boger
Join Date: Mar 2009
Location: Penn State Applied Research Laboratory
Posts: 146
Rep Power: 17
boger is on a distinguished road
Artificial compressibility is a method used in time-marching algorithms to solve for incompressible flows. All of the solvers in OpenFOAM so far have been pressure-based solvers, so artificial compressibility is not used.
__________________
David A. Boger
boger is offline   Reply With Quote

Old   November 19, 2010, 15:08
Default
  #4
Member
 
M. Mahdi Salehi
Join Date: Mar 2009
Location: Vancouver, BC, Canada
Posts: 50
Rep Power: 17
smehdi609 is on a distinguished road
It's not hard to implement the artificial compressibility method. I wrote one long time ago, just as a CFD fun !
It's not in a coupled way though !
The time loop looks like this:


do
{
runTime++;
counter++;
Info<< "Time = " << runTime.timeName() << nl << endl;

fvScalarMatrix pEqn
(
fvm::ddt(p)
+ (1/beta)*fvc::div(phi)

);
pEqn.setReference(pRefCell, pRefValue);
volScalarField p_old = p;
pEqn.solve();
p_residual = max(mag(p_old - p)).value();

fvVectorMatrix UEqn
(
fvm::ddt(U)
+ fvm::div(phi, U)
- fvm::laplacian(nu, U)
);

volVectorField U_old = U;
solve(UEqn == -fvc::grad(p));
u_residual = max(mag(U_old - U)).value();
Info << "Residual in U: " << u_residual << " Residual in P: "
<< p_residual << endl;


max_residual = max(u_residual, p_residual);
//solve(UEqn == -fvc::grad(p));
phi = linearInterpolate(U) & mesh.Sf();

}while (max_residual > epsilon);
scleakey likes this.
smehdi609 is offline   Reply With Quote

Old   November 28, 2010, 03:35
Default
  #5
Senior Member
 
Join Date: Nov 2009
Location: Michigan
Posts: 135
Rep Power: 17
doubtsincfd is on a distinguished road
Thank you all!
doubtsincfd is offline   Reply With Quote

Old   December 20, 2010, 00:19
Default to edit SIMPLE solver
  #6
Member
 
nsreddy
Join Date: Sep 2010
Posts: 40
Rep Power: 16
nsreddysrsit is on a distinguished road
Quote:
Originally Posted by boger View Post
Artificial compressibility is a method used in time-marching algorithms to solve for incompressible flows. All of the solvers in OpenFOAM so far have been pressure-based solvers, so artificial compressibility is not used.
Dear David A. Boger,
Is it possible to write a code for the artificial compressibility method or manipulating the given solvers (like SIMPLE) in OpenFOAM.

With Regargs
N.S. Reddy,
DS college of Engg,
Bangalore
nsreddysrsit is offline   Reply With Quote

Old   December 20, 2010, 08:47
Default
  #7
Senior Member
 
David Boger
Join Date: Mar 2009
Location: Penn State Applied Research Laboratory
Posts: 146
Rep Power: 17
boger is on a distinguished road
I'm sure it's possible, but it's not clear to me what you're trying to achieve. My interpretation of the artificial compressibility method is that it is a method to extend an efficient compressible solver to incompressible flows through pre-conditioning. If you simply want to solve for incompressible flow, you already have solvers here to choose from. If you simply want to add an artificial compressibility term to simpleFoam, you can read how to do that in one of the posts above, although I'm not sure what exactly it buys you. If you're determined to write an artificial compressibility code and want it to be block coupled, then I would look at the new block coupling methods that were released in the 1.6-extend version.
__________________
David A. Boger
boger is offline   Reply With Quote

Old   December 21, 2010, 00:52
Default Artificial Compressibility method
  #8
Member
 
nsreddy
Join Date: Sep 2010
Posts: 40
Rep Power: 16
nsreddysrsit is on a distinguished road
Quote:
Originally Posted by boger View Post
I'm sure it's possible, but it's not clear to me what you're trying to achieve. My interpretation of the artificial compressibility method is that it is a method to extend an efficient compressible solver to incompressible flows through pre-conditioning. If you simply want to solve for incompressible flow, you already have solvers here to choose from. If you simply want to add an artificial compressibility term to simpleFoam, you can read how to do that in one of the posts above, although I'm not sure what exactly it buys you. If you're determined to write an artificial compressibility code and want it to be block coupled, then I would look at the new block coupling methods that were released in the 1.6-extend version.
Dear David A. Boger,
Thanks a lot for your kind information, actually I am trying to use compressible 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. can u please send me a format of the code. My email id is "nsreddysrsit@gmail.com". Once again thanks.


With Regards
N.S. Reddy,
DS college of Engg,
Bangalore
nsreddysrsit is offline   Reply With Quote

Old   February 23, 2011, 01:21
Default
  #9
Member
 
nsreddy
Join Date: Sep 2010
Posts: 40
Rep Power: 16
nsreddysrsit is on a distinguished road
dear M. Mahdi Salehi,
the above code is applicable for which solver for example, for icoFoam or SimpleFoam.
nsreddysrsit is offline   Reply With Quote

Old   February 23, 2011, 02:41
Default
  #10
Member
 
M. Mahdi Salehi
Join Date: Mar 2009
Location: Vancouver, BC, Canada
Posts: 50
Rep Power: 17
smehdi609 is on a distinguished road
It's a stand-alone solver.
smehdi609 is offline   Reply With Quote

Old   February 23, 2011, 20:32
Default what is the difference between time preconditioning in openfoam and the artificial co
  #11
Member
 
nsreddy
Join Date: Sep 2010
Posts: 40
Rep Power: 16
nsreddysrsit is on a distinguished road
thank you Mr. M. Mahdi Salehi, I understood, my doubt is, is it possible to modify icoFoam, simpleFoam or rhoCentralFoam to Artificial Compressibility Method.
and one More question what is the difference between time preconditioning in openfoam and the artificial compressibility method.

Regards
N.S.Reddy
nsreddysrsit is offline   Reply With Quote

Old   February 24, 2011, 14:29
Default
  #12
Member
 
M. Mahdi Salehi
Join Date: Mar 2009
Location: Vancouver, BC, Canada
Posts: 50
Rep Power: 17
smehdi609 is on a distinguished road
Hi,
Yes, you can modify them to get the artificial compressibility method. However, your new solver is just the artificial compressibility solver. I do not think you can easily make this to be an "all-speed" method so that you can run both the compressible and incompressible flows with the same solver. (I am not quit sure though)

About your second question, basically both the artificial compressibility method and preconditioning methods remove the stiffness of the system of equations in low-Mach number regimes caused by the spread in wave speed. In the artificial compressibility method you tweak your governing equations to remove the stiffness. In the preconditioning method the stiffness is removed mathematically by multiplying the equations by a matrix.
Cheers
Mahdi
smehdi609 is offline   Reply With Quote

Old   February 24, 2011, 20:58
Default
  #13
Member
 
nsreddy
Join Date: Sep 2010
Posts: 40
Rep Power: 16
nsreddysrsit is on a distinguished road
Hi,
thank you for your reply, You are exactly correct, one more issue if I want to implement convection schemes like Lax-Friedrich Method or Roe scheme, is there any suitable scheme to edit or I should write a new code.
nsreddysrsit is offline   Reply With Quote

Old   September 5, 2011, 21:50
Default Acm
  #14
Member
 
venkat
Join Date: Mar 2011
Location: Bangalore,india
Posts: 47
Rep Power: 15
venkataramana is on a distinguished road
hi,
anybody working on artificial Compressibility method in openFoam, any comments on this method are welcome, if anybody working on this please provide the information about it.

thanks in advance,
Best Regards,
venkataramana is offline   Reply With Quote

Old   September 5, 2011, 23:34
Default
  #15
New Member
 
G. D. McBain
Join Date: Apr 2010
Posts: 3
Rep Power: 16
gdmcbain is on a distinguished road
I've been thinking about writing an artificial compressibility solver for OpenFOAM, partly because I noticed that all the existing viscous incompressible solvers (that I'm aware of) ignore the viscous term in the boundary condition for the pressure Poisson equation at solid walls. Actually that boundary condition is not strictly the job of the solver, but in the case files, a zero Neumann condition is applied, and I'm not too sure how one would go about specifying the correct viscous condition there, since they involve the velocity's second derivative (Peyret & Taylor 1983, eqs. 6.2.29, 6.3.8a; Anderson, Tannehill, & Pletcher 1984, eq. 9-171, p. 514). The point is that with artificial compressibility or similar, e.g. the "conjugate gradient" algorithms introduced to finite element methods by Glowinski & Pironneau (1979), one doesn't formulate a Poisson equation for pressure and so doesn't need to formulate boundary conditions for it.

It's often argued that the viscous term is negligible because it's of order of 1/Re; this is true: it's proportional to the viscosity, but if the Reynolds number is small, that's not a good argument.
  • Anderson, D. A., J. C. Tannehill, & R. H. Pletcher (1984). Computational Fluid Mechanics and Heat Transfer. Series in Computational Methods in Mechanics and Thermal Sciences. Washington: Hemisphere
  • Glowinski, R., & O. Pironneau (1979). On numerical methods for the Stokes problem. In R. Glowinksi, E. Y. Rodin, & O. C. Zienkiewicz (Eds.), Energy Methods in Finite Element Analysis, Numerical Methods in Engineering, pp. 243-264. Chichester:John Wiley & Sons
  • Peyret, R., & T. D. Taylor (1983). Computational Methods for Fluid Flow. Springer Series in Computational Physics. New York: Springer
gdmcbain is offline   Reply With Quote

Old   September 6, 2011, 03:01
Default Acm
  #16
Member
 
venkat
Join Date: Mar 2011
Location: Bangalore,india
Posts: 47
Rep Power: 15
venkataramana is on a distinguished road
Dear G. D. McBain, thank you for the information given,

I would like to create a new solver using Artificial Compressibility Method in openFoam, How to Start writing a code,any suggestions, comments are welcome. I wanted to use compressible solver Schemes for incompressible flows using Artificial Compressibility Method.

Thanks in advance,

venkataramana is offline   Reply With Quote

Old   September 6, 2011, 03:33
Default
  #17
New Member
 
G. D. McBain
Join Date: Apr 2010
Posts: 3
Rep Power: 16
gdmcbain is on a distinguished road
Dear venkataramana:

Doesn't the code posted by smehdi609 work? It looks right.

As to `how to start writing a code', I suggest reading http://openfoam.com/docs/user/compil...plications.php and then inspecting and tinkering with some of the simpler solvers provided, e.g. potentialFoam.C.

For the background on the method, try Chorin's original paper, or the book by Peyet & Taylor that I cited before. The basic idea is to locally decrease the pressure wherever the velocity is divergent (this is what smehdi609's pEqn does), and to keep iterating on that until the velocity isn't divergent anywhere. The smehdi609 code tests for the pressures no longer changing rather than testing divergence directly, but given the directness of the pressure update in the artificial compressibility method, it amounts to much the same thing.

Best of luck.
gdmcbain is offline   Reply With Quote

Old   September 6, 2011, 06:13
Default hi
  #18
Member
 
venkat
Join Date: Mar 2011
Location: Bangalore,india
Posts: 47
Rep Power: 15
venkataramana is on a distinguished road
Dear G. D. McBain,

Thank you very much for your valuable suggestions, I will try it

Regards,

venkataramana is offline   Reply With Quote

Old   January 7, 2012, 14:02
Default
  #19
Member
 
nsreddy
Join Date: Sep 2010
Posts: 40
Rep Power: 16
nsreddysrsit is on a distinguished road
dear foamers,
anybody can help me where the code is available for the the following method.
http://openfoamwiki.net/index.php/TestLucaG


Regards,

Last edited by nsreddysrsit; January 7, 2012 at 21:01.
nsreddysrsit is offline   Reply With Quote

Old   April 2, 2012, 11:17
Default
  #20
New Member
 
Gilles De Neyer
Join Date: Nov 2011
Posts: 18
Rep Power: 15
gdeneyer is on a distinguished road
hello,

I would like to improve the code of M. Mahdi Salehi for unsteady problems, which is possible by using a certain amount of pseudo-timesteps at each "real timestep" of the case.

My problem is that I don't know how I could modelize a time derivative for these pseudo time-steps in OpenFoam.

Any idea ?
gdeneyer 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
[blockMesh] BlockMesh FOAM warning gaottino OpenFOAM Meshing & Mesh Conversion 7 July 19, 2010 15:11
[Gmsh] Import problem ARC OpenFOAM Meshing & Mesh Conversion 0 February 27, 2010 11:56
Problem installing on Ubuntu 9.10 -> 'Cannot open : No such file or directory' mfiandor OpenFOAM Installation 2 January 25, 2010 10:50
[blockMesh] Axisymmetrical mesh Rasmus Gjesing (Gjesing) OpenFOAM Meshing & Mesh Conversion 10 April 2, 2007 15:00
[Gmsh] Import gmsh msh to Foam adorean OpenFOAM Meshing & Mesh Conversion 24 April 27, 2005 09:19


All times are GMT -4. The time now is 23:49.