CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Running, Solving & CFD

Possibility to perform two simple.loop inside the same code

Register Blogs Community New Posts Updated Threads Search

 
 
LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
Old   August 23, 2018, 17:05
Default Possibility to perform two simple.loop inside the same code
  #1
Member
 
Pablo Alarcón
Join Date: Mar 2018
Location: Liège
Posts: 59
Rep Power: 8
palarcon is on a distinguished road
Good morning everybody

I would like to know if it is possible to perform two simple.loop inside the same code. In simplified words, what I want to do is something like this algorithm

Code:
int main(...)
{
while(it <= maxIter)
{
     ...
     while (simple.loop())     // first loop
     {
          ...
          #include "UEqn.H"
          #include "pEqn.H"
          ...
     }
     ...
     while (simple.loop())     // second loop
     {
          ...
          #include "UEqn2.H"
          #include "pEqn2.H"
          ...
     }
     ...
}
...
}
The problem is that when I code like that, the solver enter the first loop and solve the flow but then doesn't enter the second loop.

My guess is that happens because simple.loop already have an stop signal recorded, so when I try to enter the second loop by means of while (simple.loop()) for the second loop, simply doesn't enter because the while(simple.loop()) condition was already fulfilled in the first loop.

Is there any way to restart or put to zero the simple.loop in order to be able to enter to the second loop?

Any insight, references to documentation or examples, or threads in the forum I may have missed are welcome.
palarcon is offline   Reply With Quote

 


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
[isoAdvector] Issues with modification of IsoAdvector Code raunakbardia OpenFOAM Community Contributions 16 September 4, 2020 05:36
possibility to perform two simple.loop inside the same code palarcon OpenFOAM Programming & Development 5 August 28, 2018 09:48
Type mismatch: Assigning a scalar to a Field<Type> inside templated BC code karlli OpenFOAM Programming & Development 2 August 28, 2017 01:25
public CFD Code development Heinz Wilkening Main CFD Forum 38 March 5, 1999 11:44
What kind of Cmmercial CFD code you feel well? Lans Main CFD Forum 13 October 27, 1998 10:20


All times are GMT -4. The time now is 16:06.