|
[Sponsors] |
How to carry out multiple solving iterations within one time step |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
June 6, 2020, 09:47 |
How to carry out multiple solving iterations within one time step
|
#1 |
Member
Wenming Yang
Join Date: Jun 2018
Posts: 42
Rep Power: 7 |
Dear Foamers,
I am trying to solve two coupled equations with OpenFOAM. The solutions converge very slowly and I have to make several iterations within one time step. I have used piso corrections in the runTime loop and solving the two equations sequentially in each correction loop. But it seems that the solution of the current correction iteration does not read solutions of the former iteration. Does anyone has ideas about this problem or any instructions about the solving of coupled equations using OpenFOAM? Thanks in advance. |
|
June 6, 2020, 20:27 |
|
#2 | |
New Member
Sen Wang
Join Date: Jul 2018
Location: Singapore / Notre Dame, U.S.
Posts: 19
Blog Entries: 1
Rep Power: 7 |
Dear Wenming,
Quote:
Could you upload your solver (including the createFields.H file). For piso corrections (i haven't looked into the internals), but i suspect it explicitly works with p, U and phi (for optimization), most likely a tmp<type> object is used for storing intermediate geometricField data, or use the prevIter() method from the geometricField. So in summary it looks like a storage/IO issue, so a test case could be helpful. If not solving fluid motion, i don't recommend using pisoControl directly (a personal preference). Cheers, Sen |
||
June 7, 2020, 04:54 |
|
#3 |
Member
Wenming Yang
Join Date: Jun 2018
Posts: 42
Rep Power: 7 |
Dear Sen,
Thank you for your reply. Yes, you are right. The settings for IOobject such as volVectorField M ( IOobject ( "M", runTime.timeName(), mesh, IOobject::MUST_READ, IOobject::AUTO_WRITE ), mesh ); dose not work for the iteration within time steps. Following your advice, I tried to store the intermediate field data by adding a sentence like M.storePrevIter(); but it does not work either. I also tried to change the piso correction to the PIMPLE outer correction for the iteration within one time loop. The results were not changed. The problem is also that the previous results of the inner iteration was not read by the current interation. |
|
June 7, 2020, 06:09 |
|
#4 |
Member
alexander thierfelder
Join Date: Dec 2019
Posts: 71
Rep Power: 6 |
won't a simple "for" or "while" loop in your runtime loop work?
Code:
while (runTime.loop()) { runTime++; for (int i=0; i<nTotalCycles; ++i) { #include "Eqn1.H" #include "Eqn2.H" } runTime.write(); } Code:
while (runTime.loop()) { runTime++; while ( ! convCrit) { #include "Eqn1.H" #include "Eqn2.H" #include "convergenceCriterium.H" } runTime.write(); } |
|
June 7, 2020, 07:35 |
|
#5 |
Member
Wenming Yang
Join Date: Jun 2018
Posts: 42
Rep Power: 7 |
Dear Alexander,
Thank you for your suggestions. I tried that but it dose not work either. The problem is that the solving of Eqn2 does not read the results of Eqn1 in your reply within one time step. |
|
June 7, 2020, 20:08 |
|
#6 |
New Member
Sen Wang
Join Date: Jul 2018
Location: Singapore / Notre Dame, U.S.
Posts: 19
Blog Entries: 1
Rep Power: 7 |
Hi Wenming,
i am confused about why your Eqn2 is not reading your Eqn1's results. After computation of Eqn1, M should be the updated result which can be directly accessed in Eqn2. Maybe you can check if your scope is set correctly? So for your Eqn1.H, you should not have a set of curly brackets {} surrounding all your code. You can have curly brackets for Eqn2 though. Sorry since I can't see your code, I can only guess at the possible errors that could happen. Hope this helps. Sen |
|
June 9, 2020, 03:13 |
|
#7 |
Member
Wenming Yang
Join Date: Jun 2018
Posts: 42
Rep Power: 7 |
Dear Sen,
Thanks a lot for your suggestions. I checked and found that the curly brackets do not influence the results. Maybe you are right. Eqn2 should read the results of Eqn1 automatically although its results have not been written out . My problem may come from the fact that I am solving a steady problem using a transient solver but the convergence of the steady problem is time dependent. So although the Eqn2 and Eqn1 are solved and converged by several innter iterations, the whole problem is not converged because the time dose not evolve. I have started another thread to talk about this problem. |
|
June 9, 2020, 03:17 |
|
#8 |
Member
alexander thierfelder
Join Date: Dec 2019
Posts: 71
Rep Power: 6 |
||
June 9, 2020, 03:46 |
|
#9 |
Member
Wenming Yang
Join Date: Jun 2018
Posts: 42
Rep Power: 7 |
Dear Sen,
Please follow the link below Why the convergence of a steady problem also need several time evolution steps |
|
Tags |
coupled problems, multiple iterations |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
pressure in incompressible solvers e.g. simpleFoam | chrizzl | OpenFOAM Running, Solving & CFD | 13 | March 28, 2017 05:49 |
pimpleFoam: turbulence->correct(); is not executed when using residualControl | hfs | OpenFOAM Running, Solving & CFD | 3 | October 29, 2013 08:35 |
pisoFoam with k-epsilon turb blows up - Some questions | Heroic | OpenFOAM Running, Solving & CFD | 26 | December 17, 2012 03:34 |
IcoFoam parallel woes | msrinath80 | OpenFOAM Running, Solving & CFD | 9 | July 22, 2007 02:58 |
Could anybody help me see this error and give help | liugx212 | OpenFOAM Running, Solving & CFD | 3 | January 4, 2006 18:07 |