|
[Sponsors] |
September 19, 2013, 14:01 |
runtime.loop() and runtime.run()
|
#1 |
New Member
Join Date: Apr 2012
Posts: 9
Rep Power: 14 |
I am using sonicFoam in the versions 2.1.1 and 2.2.1 in a fairly simple setup.
In version 2.1.1 sonicFoam is using runtime.loop() for time iteration, while in 2.2.1 it has been changed to runtime.run(). I also manually changed version 2.1.1 to runtime.run() to be able to access the variable time step. However, I realized that I get different results for runtime.run() and for runtime.loop() independent of the Open Foam version. So it seems to be a problem with the time iteration. Does anyone else had similar problems? |
|
September 20, 2013, 03:46 |
|
#2 |
Member
Hassan
Join Date: Oct 2012
Location: Iran
Posts: 63
Rep Power: 14 |
Hi CoolKau,
What's the meaning of this part of the code in the application solver? Code:
while (runTime.loop()) { ... } Hassan |
|
September 20, 2013, 12:39 |
|
#3 | |
New Member
Join Date: Apr 2012
Posts: 9
Rep Power: 14 |
Quote:
Hi Hassan, I am not entirely sure what the difference of both of them are. It is my first time to dig deeper into the source code. They are basically running the solver repeatedly until the final time is reached. I know that one does allow for a variable time step (.run) and the other does not. Also .\src\OpenFOAM\db\time.h has some annotations in it. But the only difference is that one iterates the time, while the other one just checks if the final time has been reached. This is all I found out so far. |
||
September 28, 2013, 12:59 |
|
#4 |
New Member
Join Date: Apr 2013
Posts: 24
Rep Power: 13 |
http://foam.sourceforge.net/docs/cpp...3d8c7fdc4638d9
This actually contains the same information as you already mentioned: One is incrementing the time and is checking whether final time has been reached (loop), whilst the other one is only checking whether the final time has been reached (run), WITHOUT incrementing the timestep. Please look into the 2 very short examples provided in my link to see how to use them: When using run, you need to increment the time manually as part of the iteration. If using loop, you do not need to do that. So i guess the old version of sonicFoam didnt increment the time step during the iterated routine while the new version, which is using runtime.run() is calling a routine which is incrementing the time step somewhere in the process.. Georg. |
|
October 30, 2013, 08:00 |
|
#5 | |
New Member
Join Date: Apr 2012
Posts: 9
Rep Power: 14 |
Quote:
Hi Georg, thanks for your reply. Do you think you could check you sent the right link? Also, so far I would think both functions work as they should. the time is iterated. However, I am still struggling to understand why both time function give different results. They both should just run the solver and stop it when the time limit is reached. |
||
November 6, 2013, 04:08 |
|
#6 |
New Member
Join Date: Apr 2013
Posts: 24
Rep Power: 13 |
Actually I wanted to post this link No idea what went wrong:
http://foam.sourceforge.net/docs/cpp/a02307.html Does sonicFoam 2.2.1 is giving you different results than sonicFoam 2.1.1 (in the original version without changing anything)? Or do the differences only appear when you start changing from runTime.loop() to runTime.run() (or the other way round) in one of the two solvers? |
|
August 5, 2014, 14:14 |
|
#7 |
New Member
Join Date: Apr 2012
Posts: 9
Rep Power: 14 |
Hi Georg,
I am sorry for the late reply because I went on to different projects outside of the CFD world. 2.2.1 and the original 2.1.1 give different results. When switching 2.1.1 over to runtime.run() (same as 2.2.1) both versions agree. Therefore I thought the error is not in the version but in the time iteration. |
|
Tags |
runtime |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Difference between runTime.run() and runTime.loop() | JimKnopf | OpenFOAM Programming & Development | 4 | May 19, 2016 07:18 |