Artificial compressibility in open foam
Is there Artificial Compressibility solver in openfoam first introduced by Chorin?

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. 
Artificial compressibility is a method used in timemarching algorithms to solve for incompressible flows. All of the solvers in OpenFOAM so far have been pressurebased solvers, so artificial compressibility is not used.

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); 
Thank you all!

to edit SIMPLE solver
Quote:
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 
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 preconditioning. 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.6extend version.

Artificial Compressibility method
Quote:
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 
dear M. Mahdi Salehi,
the above code is applicable for which solver for example, for icoFoam or SimpleFoam. 
It's a standalone solver.

what is the difference between time preconditioning in openfoam and the artificial co
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 
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 "allspeed" 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 lowMach 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 
Hi,
thank you for your reply, You are exactly correct, one more issue if I want to implement convection schemes like LaxFriedrich Method or Roe scheme, is there any suitable scheme to edit or I should write a new code. 
Acm
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, 
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. 9171, 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.

Acm
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, 
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. 
hi
Dear G. D. McBain,
Thank you very much for your valuable suggestions, I will try it Regards, 
dear foamers,
anybody can help me where the code is available for the the following method. http://openfoamwiki.net/index.php/TestLucaG Regards, 
hello,
I would like to improve the code of M. Mahdi Salehi for unsteady problems, which is possible by using a certain amount of pseudotimesteps 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 timesteps in OpenFoam. Any idea ? 
All times are GMT 4. The time now is 13:54. 