CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM Running, Solving & CFD (http://www.cfd-online.com/Forums/openfoam-solving/)
-   -   On the pimpleFoam solution algorithm (http://www.cfd-online.com/Forums/openfoam-solving/84516-pimplefoam-solution-algorithm.html)

vkrastev February 1, 2011 09:23

On the pimpleFoam solution algorithm
 
Hi all, I'm trying to go deeper into the solution algorithm implemented in the pimpleFoam transient solver, especially for what concerns URANS incompressible applications. This is what I have understood about the solver till now (please, correct me if I'm wrong)

1) At the beginning of the time step, the solver applies the PISO algorithm for pressure-velocity coupling (with a given number of PISO loops, tipically 2) and then solves the transport equations for the turbulent quantities

2) If the outer loops parameter (nOuterCorrectors) is set > 1, the solver turns back and performs an additional integration (formally identical to the procedure described in point (1) ), but this time using as initial values the final values (eventually under-relaxed) obtained after the previous time integration.

3) Point 2 is repeted a number of times depending on the nOuterCorrectors value

First question: if all of those statements are correct, this means that with nOuterCorrectors set to 1 the whole procedure reduces to the classical PISO algorithm, is it right?

Second question: using the outer loops (and under-relaxation) allows to increase a lot the Courant number without loosing stability of the solution. However, what is the dependency between the number of the outer loops and the max Co allowed? I mean, using only one additional loop (thus performing two complete integrations per time step) is enough for pushing the max Co above 2 (maybe 4-5)?

Third question: what about the time accuracy? Of course the time resolution is far less critical in the URANS approach than in the LES one, but how will be affected the solution by a very large time step (assuming that the outer correction still preserves from instability)?

Any opinion and/or suggestion will be really appreciated

Thank you all

V.

vkrastev February 2, 2011 05:28

So no one interested in this topic?

V.

santos February 2, 2011 05:45

I am very interested on this topic.

From my limited knowledge on PIMPLE, I would say that the answer to your first question is positive.

Your second question is more difficult to answer. I have used PIMPLE-based solvers quite a lot, mostly using maxCo=1, so what PIMPLE gives me is more stability in each time-step iteration in comparison to PISO. Working with maxCo>1 has mixed results in my case-studies: I can work with, eg, maxCo = 2, but anything higher than that blows-up the simulations.

Regards,
Jose

vkrastev February 2, 2011 07:26

Quote:

Originally Posted by santos (Post 293230)
I am very interested on this topic.

From my limited knowledge on PIMPLE, I would say that the answer to your first question is positive.

Your second question is more difficult to answer. I have used PIMPLE-based solvers quite a lot, mostly using maxCo=1, so what PIMPLE gives me is more stability in each time-step iteration in comparison to PISO. Working with maxCo>1 has mixed results in my case-studies: I can work with, eg, maxCo = 2, but anything higher than that blows-up the simulations.

Regards,
Jose

Hi Josè, thanks for the reply! About my second question, at this moment I'm running an exeternal aerodynamics case in URANS mode (Realizable k-epsilon turbulence model, mesh of about 3 milions cells) using the pimpleFoam solver: the case is running with nOuterCorrectors set to 2 (thus, only one additional integration over the time step), number of PISO correctors also equal to 2 and with a constant time step value wich corresponds to a max Co of about 3.4. Well, the run seems to go ahead without stability issues, but it's still too early to say if the results will be also reasonable or not...As you have noticed, my questions come from two issues which I consider quite interesting in running unsteady simulations: the first one is to speed up as much as possible the solution (here in my department the available computing power is quite low...) and you will probably agree with me that running with 2 outer correctors and a max Co equal to 2 would improve the stability (as actually did in your cases), but should also not have a noticeable impact on the computing time (the time step doubles, but you have to integrate over it 2 times); the second one can be summarized as follows: ok, my run goes on with 2 outer correctors and a max Co of 3.4, I'm so happy about it, but...will it be accurate as (or at least nearly as) the same run with, for instance, no additional time step integration but max Co equal to 1? Is it possible to identify a good compromise between these two factors (speed and accuracy)? And if so, would it depend from other factors (such as, for instance the number PISO correctors in the single sub-step)? However, I'll let you know what happens with my ongoing run...

Best Regards

V.

tehache February 2, 2011 10:12

It probably all depends on your case - but, for my calculations, experience has shown that, when using CrankNicholson=1 for time discretization, results do not depend (much..) on timestep, as long as it remains stable, which is up to max. Co around 10-15. Euler, however, is rather sensitive to time step size. I would perform a small test series with different timesteps.

vkrastev February 2, 2011 10:46

Quote:

Originally Posted by tehache (Post 293284)
It probably all depends on your case

I agree.


Quote:

Originally Posted by tehache (Post 293284)
when using CrankNicholson=1 for time discretization

What do you mean exactly? In OF 1.6 (don't know if it's still true for later releases) if you want to integrate your unsteady problem using the Crank Nicolson metod you simply have to use the arithmetic mean of the explicit and fully implicit terminologies implemented in OF (0.5*(fvc::...+fvm::...))


Quote:

Originally Posted by tehache (Post 293284)
Euler, however, is rather sensitive to time step size

.

Again, what do you mean with Euler? Fully explicit (fvc::...) or fully implicit (fvm::...)? If the latter, this time step dependency sounds a bit strange to me, as it should be at least as stable as the Crank Nicolson one...


Quote:

Originally Posted by tehache (Post 293284)
I would perform a small test series with different timesteps.

I agree once again...the problem is that I have to delay this sistematic study because our computing facilities are at the moment saturated by much "heavier" runs (such as the once described above...) :D

Thanks for the reply

V.

vkrastev February 2, 2011 13:10

Ok, I got it: you are talking about differencing schemes and not integration methods...However, still the higher time step sensitivity of the Euler scheme sounds strange to me...And, by the way, what exactly is the Crank-Nicolson differencing scheme (as I've read tons of literature about the integration method, bot nothing about a differencing scheme called this way...sorry for my ignorance)?

Best Regards

V.

fsaltara February 2, 2011 14:53

pimple and courant number
 
I have carried out some experiments and I think that:

1) Yes, if you use nOuterCorrectors=1, it is a PISO methos. But in this case you must not underrelax.

2) Simulating laminar flow around a circular cylinder (Re=180), I tried nOuterCorrectors=10 and this allowed me to have maxCo=5.

vkrastev February 3, 2011 05:44

Quote:

Originally Posted by fsaltara (Post 293321)
1) Yes, if you use nOuterCorrectors=1, it is a PISO methos. But in this case you must not underrelax.

Ok, that's my understanding too.

Quote:

Originally Posted by fsaltara (Post 293321)
2) Simulating laminar flow around a circular cylinder (Re=180), I tried nOuterCorrectors=10 and this allowed me to have maxCo=5.

That's interesting, but what about the computing time? Using 10 outer correctors and max Co equal to 5 seems not so convenient in that sense compared with, for instance, 1 outer corrector and max Co equal to 1...Have you increased a lot the outer correctors for some specific reason (need for better accuracy and/or stability compared with the max Co=1 and nOuterCorrectors=1 case)?

Thanks for sharing your experience

V.

fsaltara February 3, 2011 11:48

pimple and courant number
 
I was simply testing the software, and you are right about the time. Does not make sense to use a lot of outer corretions. It is better to use a lower value of maxCo and stick to one or two outer corrections.

tehache February 7, 2011 06:11

Vesselin,

Sorry for the inaccuracy and saying integration instead of differencing...
Crank-Nicholson to me means second order, implicit time differentiation, as opposed to first order for Euler. And just to clarify: I did not say Crank-Nicholson was more stable, I wanted to say that (as to be expected for a second order scheme..) results depend much less on time step size using that scheme, something one easily forgets as all tutorials I have seen seem to be set to use Euler scheme.

vkrastev February 7, 2011 06:39

Quote:

Originally Posted by tehache (Post 293941)
Vesselin,

Sorry for the inaccuracy and saying integration instead of differencing...
Crank-Nicholson to me means second order, implicit time differentiation, as opposed to first order for Euler. And just to clarify: I did not say Crank-Nicholson was more stable, I wanted to say that (as to be expected for a second order scheme..) results depend much less on time step size using that scheme, something one easily forgets as all tutorials I have seen seem to be set to use Euler scheme.

Ok, thanks for the clarification. However, since your results are quite interesting, I have some additional questions:

1) Apart from the time differentiation choice, how did you reach a max Co of 10-15? I mean, what about the number of outer correctors, of PISO correctors and the URFs?

2) Have you also tried the backward time-differncing scheme?

Thank you once again

V.

tehache February 7, 2011 09:19

I have modified the solver to repeat the inner PISO loop until initial residuals for all equations are below a given value, 1e-4 seemed to be enough ( as INITIAL residual). For maxCo=15, this results in several (up to something like 7,8,..., depends also on mesh size) outer iterations, and doing this number of outer iterations it seems not to be important anymore how many corrector steps I do, 1 seems to be enough. URF's are 0.8 to 0.9 for pressure and momentum.

I did not try the backward time differencing scheme.

Have a lot of fun!

vkrastev February 7, 2011 09:50

Quote:

Originally Posted by tehache (Post 293968)
I have modified the solver to repeat the inner PISO loop until initial residuals for all equations are below a given value, 1e-4 seemed to be enough ( as INITIAL residual). For maxCo=15, this results in several (up to something like 7,8,..., depends also on mesh size) outer iterations, and doing this number of outer iterations it seems not to be important anymore how many corrector steps I do, 1 seems to be enough. URF's are 0.8 to 0.9 for pressure and momentum.

I did not try the backward time differencing scheme.

Have a lot of fun!

Thanks a lot, your explanations could be quite useful!

Regards

V.

arun July 25, 2011 10:46

PIMPLE solver -dieselEngineFoam
 
Hi All,
I am currently simulating direct injected diesel engine simulations with dynamic meshing dieselEngineFoam solver. I with PISO algorithm, I get maxCo number about 0.1- 0.3, with stable solution for time-step between 0.005 – 0.05 CAD, with 1mm mesh size.

The I have tried using PIMPLE solver, and the both the corrector values was set to 4. I thought but doing this I could reduce the computing time since it involves chemical reactions as well. However, from my testing so far I see that the simulations crashes during the “chemistry solve” part, when larger time-step size is being used (e.g 0.1, 0.25). So even by using PIMPLE solver I don’t really gain in reducing computing time, in fact I think it takes longer at the moment as compared to my original PISO settings, since no matter what my maxCo number is well around 0.1-0.3.

Any suggestion to reduce computing time?

So my question here, is there any other way to reduce computing time? Is it possible for me to increase the mesh size (more than 1mm) and reduce computing time by using PIMPLE?

Parallel processing is not an option here due to the version of OF i am using at the moment.

A

Djub September 6, 2012 08:28

Hi everybody,

excuse me for not answering any question. I just want to share my little experience.
I am running external aerodynamics; th egoal is about Vortex Shedding with high Reynolds number. I was running with PISO, trying to have macCo near to 1.

Then, I just changed the application to pipleFoam, with an adjustableTimeStep and maxCo = 5. In fvsolutions, I copied my solver parameters to the "Final" ones (e.g. "(U|k)" to "(U|k)Final" and choose nOuterCorrectors 2 .

And it seems to work well! In this case, my calculation is much faster! In this case, about 2,45 times faster.

sdharmar November 15, 2012 03:06

What is your mesh size and what is your maximum velocity. I am facing a similar type of problem with LES

Djub November 15, 2012 05:25

(I am not sure I am concerned by sdharmar, but I will answer anyway...)

My cell size is 1cm and my object is 10cm x 20cm. I know it seems very coarse, but it gives the results I want! (I am interested in the vortex shedding, thus in large unsteadyness, not in small eddies...)


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