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

All about the PIMPLE algorithm - Part II

Register Blogs Community New Posts Updated Threads Search

Rating: 3 votes, 5.00 average.

All about the PIMPLE algorithm - Part II

Posted October 21, 2014 at 18:55 by Tobi
Updated January 18, 2018 at 03:18 by Tobi (Removed content, updated content on wiki and book)

The Pimple Algorithm (21.08.2017)

In this blog I showed (since 2014) a few things about the pimple algorithm and how things are working in OpenFOAM. However, based on the fact that the explanation of the algorithm is given in my book, I removed the content here. The old revised one is still available at the wiki page. Links can be found below.



Thanks
Posted in Uncategorized
Views 24842 Comments 33 Edit Tags Email Blog Entry
« Prev     Main     Next »
Total Comments 33

Comments

  1. Old Comment
    akidess's Avatar
    Considering this post is aimed at beginners, two possible issues should be mentioned:
    1) How to choose the optimum underrelaxation parameters?
    2) Is your converged solution guaranteed to be independent of the relaxation applied?
    permalink
    Posted October 22, 2014 at 09:43 by akidess akidess is offline
  2. Old Comment
    Tobi's Avatar
    Quote:
    Originally Posted by akidess View Comment
    Considering this post is aimed at beginners, two possible issues should be mentioned:
    1) How to choose the optimum underrelaxation parameters?
    2) Is your converged solution guaranteed to be independent of the relaxation applied?
    Thanks for replaying...

    1) I think that is also dependend on the problem you want to solve (like in SIMPLE) sometimes you need more relaxation in other cases you could increase it. Maybe you can switch this parameters during simulation. At the beginning lower and then increase it.

    2) Good question. Normally after reaching the final pimple loop the relaxation factors become "1" -> ".*Final" keyword in the relaxationFactors dictionary. So there is no under-relaxation anymore and the solution is independent of the relaxation applied. But in case that you exit the pimple loop due to the fact that you reach the convergence criterion, I can not guarantee that I am right. If I compare the "InitialResiduals" the solution should be independent of the applied relaxation. I will check this.

    If you agree with the hints, I will insert it to the hints.
    If you can give me some feedback about the second hint, you are welcomed.
    Thanks for reading and your feedback.
    permalink
    Posted October 22, 2014 at 10:15 by Tobi Tobi is offline
  3. Old Comment
    Tobi's Avatar
    Quote:
    Originally Posted by akidess View Comment
    2) Is your converged solution guaranteed to be independent of the relaxation applied?
    Hello akidess,

    the solution is always independent of the relaxation (:
    I made three test cases that show the same results but there is also a interesting thing that I will mention. Thanks for your feedback!
    permalink
    Posted October 23, 2014 at 10:35 by Tobi Tobi is offline
  4. Old Comment
    Hi, I would like to clarify, how is the residualControl {} tolerance and relTol for U and p different from those specified in solver {} tolerances and relTol? Will one override another or are they totally different things?
    permalink
    Posted March 30, 2015 at 10:38 by haze_1986 haze_1986 is offline
  5. Old Comment
    I wonder too about the difference/functioning between tolerance and relTol in solver and residualControl.
    permalink
    Posted April 22, 2015 at 12:20 by ASo ASo is offline
  6. Old Comment
    Tobi's Avatar
    Hello,

    they are completely different. In the solver it specify when the solver for the matrix is moving out and in residualControl its for the outer loop. Means if all residual have reached one limit. Normally relTol is set to 0.1 or 0.01 to get faster solution in matrix calculation. For the residual control for the pimple algorithm it should be set to 0 because there the total tolerance (tol) should be the goal. Maybe its only a placeholder (i never used other values for relTol than 0, because I want to abort the PIMPLE loop if I reach the tolerance of xe-y)
    permalink
    Posted April 22, 2015 at 13:09 by Tobi Tobi is offline
  7. Old Comment
    Do you happen to know why the pressure is not relaxed in sonicFoam, compared to other compressible solvers? Do you believe it could cause problems to add a pressure relaxation?
    permalink
    Posted June 18, 2015 at 06:12 by chriss85 chriss85 is offline
  8. Old Comment
    Tobi's Avatar
    I checked the tutorial of sonicFoam and it seems that you can add relaxation factors. Why not? Its only a mathematical treatment of the equations. Means you limit the new value with limiters (relaxation factors) till you get to the last outer iteration. Here the relaxation factors has to be 1 to get the correct result.

    Why we use relaxation factors is due to the fact, that some times its better to proceed the solution in more iterations than in one.

    If you start the sonicFoam, you see the following line:

    PIMPLE: Operating solver in PISO mode

    That give you the information that the PIMPLE Algorithm is implemented. Therefore, it is possible to use PIMPLE and if you use PIMPLE you use underrelaxation. Otherwise it does not make sence.
    permalink
    Posted June 18, 2015 at 07:01 by Tobi Tobi is offline
  9. Old Comment
    What I mean is that p.relax() is not called in the code of sonicFoam, whereas it is used in other solvers such as rhoPimpleFoam for example. In sonicFoam I see relaxation being applied to EEqn and UEqn (so directly on the matrix, not on the fields).

    See https://github.com/OpenFOAM/OpenFOAM...nicFoam/pEqn.H

    compared to https://github.com/OpenFOAM/OpenFOAM...pleFoam/pEqn.H
    permalink
    Posted June 18, 2015 at 08:13 by chriss85 chriss85 is offline
  10. Old Comment
    Tobi's Avatar
    Now I get the point.
    Here I can not give you information. Maybe it should be implemented and it's forgotten till now (because if you underrelax U and E, you should also be able to implement p relaxation).

    Ask the developers or just implement it and make a study on a validation case and compare with and without.
    permalink
    Posted June 18, 2015 at 08:27 by Tobi Tobi is offline
  11. Old Comment
    I created a bug report yesterday asking about this and Henry told me that pressure relaxation is only beneficial for large timesteps with Co >> 1. sonicFoam only supports smaller time steps for which pressure relaxation is not needed and slows convergence.

    However, I'm having a different issue with sonicFoam/relaxation factors. In my own case I see a dependence of the maximum field values on the relaxation factors, even though the solution is converged. I'm using very simple boundaries and the mesh is ok according to checkMesh. I have posted an example case in this thread, would you mind taking a look?
    http://www.cfd-online.com/Forums/ope...tml#post551131

    This problem does not appear on the tutorial cases, so I guess there is something wrong with my case.
    permalink
    Posted June 19, 2015 at 09:41 by chriss85 chriss85 is offline
  12. Old Comment
    Tobi's Avatar
    Hi,

    "I created a bug report yesterday asking about this and Henry told me that pressure relaxation is only beneficial for large timesteps with Co >> 1. sonicFoam only supports smaller time steps for which pressure relaxation is not needed and slows convergence."

    That is clear. If you check this blog you see that the underrelaxation only is used to get higher Co numbers. If the Co is very small due to your timestep, the timestep itself is the limiting function.

    To your case, I will have a look at it.
    permalink
    Posted June 23, 2015 at 04:23 by Tobi Tobi is offline
  13. Old Comment
    Great one Tobi;

    I could really see what PIMPLE is doing at last.

    I tried the pitzDaily and though the initial parts work as mentioned, when i use the relaxationFactor for 'p' i get the following error:

    --> FOAM FATAL ERROR:
    previous iteration field
    IOobject: volScalarField p "/home/---/OpenFOAM/***-2.3.1/run/tutorials/incompressible/pimpleFoam/pitzDaily/0"

    not stored. Use field.storePrevIter() at start of iteration.


    Though i use the p.storePrevIter() function call before the pEqn.H file.

    On searching for over, I came to know that it was a bug in older versions and corrected from 2.0.X. Though i use 2.3.X is still have this error.

    Any ideas;

    Thanks once again;
    Saideep
    permalink
    Posted August 18, 2015 at 06:44 by Saideep Saideep is offline
  14. Old Comment
    Tobi's Avatar
    Dear Saideep,

    I am sorry but I can not tell you whats wrong in your case. Unfortunatelly I have no time for checking the stuff about storePrevIter() but I made a test with 2.3.1 and figured out that the pimple algorithm is more stable now (as far as I could find out in the few minutes).
    permalink
    Posted August 18, 2015 at 09:16 by Tobi Tobi is offline
  15. Old Comment
    Hi Tobi;

    If i relax U, i do not need storePrevIter(). Calling UEqn.relax(). {Directly working over the matrix}
    If i relax p, i need storePrevIter(). Calling p.relax(). {will relax with the variable stored in p.storepreviousIter()}.
    [http://www.cfd-online.com/Forums/openfoam-solving/59183-relaxation-factors-transient-solvers.html]

    I work with interFoam and pitzDaily is new to me. Though i change the relaxation from 0{constant result expected} to 1{dependent only over the present time computation} for U, I get the same magnitude for 'U'. I run the simulation for 1 sec just to check. Am i running the sim for very less time or am i doing wrong?

    NOTE: I am using nOuterCorrections =1. Though I think this shall not effect the behavior or values computed.

    -Saideep
    permalink
    Posted August 20, 2015 at 08:05 by Saideep Saideep is offline
  16. Old Comment
    Hi Tobi,

    many thanks for this very helpful blog entry! I have one question though: How do you decide what value you put as tolerance in residual control?
    When running a steady-state simulation I treat it this way: I am montitoring the residuals and when they are not decreasing any more on a already low level I look at the drag coefficient C_W for example and when this value is not changing anymore I am stopping the simulation and consider it as converged.

    Best regards,

    Kate
    permalink
    Posted November 5, 2015 at 12:46 by KateEisenhower KateEisenhower is offline
  17. Old Comment
    Tobi's Avatar
    Dear Kate,

    for the residual control I put values from 1e-4 to 1e-8 depending on my problem. But do not mix up that residualControl with those used within the SIMPLE algorithm. In PIMPLE we use it to abort one timestep iteration and go on in time, however using SIMPLE its the residuals to stop the whole simulation. If you are doing a steady-state simulation I assume that you are using a SIMPLE solver and therefor your explanation is correct. Always check out the values you are interested. Sometimes it could happen that the pressure / velocity has reached a low level residual but the value you are interested is still not converged.

    In your case you are doing everything well. Also you could implement some code that will check out the drag and lift coeffs. If the difference from two enclosed timesteps are less than some limit you can stop the simulation.

    Kind regards,
    Tobi
    permalink
    Posted November 9, 2015 at 04:34 by Tobi Tobi is offline
  18. Old Comment
    Dear Tobi,

    thank you for this reply. Can you give any hints how the residual control values depend on the problem, or can you recommend some literature or links on this topic?
    Indeed I am doing a simpleFoam simulation on a wing profile. Since I'm particulary interested in high AoA, I want to do a transient simulation too.

    Best regards,

    Kate
    permalink
    Posted November 9, 2015 at 04:50 by KateEisenhower KateEisenhower is offline
  19. Old Comment
    Tobi's Avatar
    About what residual control are you talking? In SIMPLE or PIMPLE algorithm?

    Normally it is depending on your problem and the amount of cells you have and so furth. I can not give you any literature nor links. Maybe you will find something in Ferziger Perić. Literature no. [1] here: http://www.holzmann-cfd.de/index.php/en/literature

    I know that there is a section about error estimation and stuff like that which will actual belong to the residuals.
    permalink
    Posted November 9, 2015 at 05:23 by Tobi Tobi is offline
  20. Old Comment
    Hi Tobi,

    I was talking about the residual control in the PIMPLE-Algorithm. Regarding my question I was not clear. I wanted to know how you decide what values to set in residual control. But I assume it is not so easy to answer. What I will do now is run a few simulations and test different values. So I can see how it changes the result in my case.
    Thank you for your literature suggestion. I'll read this section as soon as I have access to this book again. By the way, you have an interesting website.

    Best regards,

    Kate
    permalink
    Posted November 10, 2015 at 05:23 by KateEisenhower KateEisenhower is offline
 

All times are GMT -4. The time now is 20:43.