How to carry out multiple solving iterations within one time step
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. |
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 |
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. |
won't a simple "for" or "while" loop in your runtime loop work?
Code:
Code:
while (runTime.loop()) |
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. |
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 |
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. |
Quote:
maybe you post the link here for anyone who has similar issues |
|
All times are GMT -4. The time now is 13:43. |