|
[Sponsors] |
April 27, 2011, 19:44 |
save the last timestep
|
#1 |
New Member
Join Date: Mar 2010
Posts: 25
Rep Power: 16 |
Hi, I have only a short question. Is it possible to save the timestep before foam shut down? I have a long calculation with adjustable timestep and long write intervals. The 'purgeWrite' option doesen't work well for me. Thanks and best regards
|
|
April 27, 2011, 20:06 |
|
#2 |
Senior Member
Marco A. Turcios
Join Date: Mar 2009
Location: Vancouver, BC, Canada
Posts: 740
Rep Power: 28 |
When does your simulation end? If you know how long you are going to run it, then you just need to match your interval in such a way you get an integer number of steps. Otherwise you need to add
Code:
runTime.writeNow() Code:
return 0; |
|
April 29, 2011, 00:19 |
|
#3 |
Member
Tony
Join Date: Jun 2010
Posts: 54
Rep Power: 15 |
In your system/controlDict you can use:
stopAt writeNow; This will stop and write your fields. Hope this helps. |
|
November 28, 2011, 10:24 |
|
#4 |
Senior Member
Aram Amouzandeh
Join Date: Mar 2009
Location: Vienna, Vienna, Austria
Posts: 190
Rep Power: 17 |
dear all!
i have to stop my simulation and write the current time step after a pre-specified ClockTime -> clockTimeLimit. For this task I used the runTime.writeAndEnd() function in the main while-loop of the solver: Code:
while (runTime.run()) { . . . runTime.write(); Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s" << " ClockTime = " << runTime.elapsedClockTime() << " s" << nl << endl; if(runTime.elapsedClockTime() >= clockTimeLimit) { Info<< " Time limit reached." << nl << " Stop simulation and write current time step." << nl << endl; runTime.writeAndEnd(); } } Does somebody have an idea what is going wrong here? Thanks in advance! Cheers, Aram |
|
November 28, 2011, 14:18 |
|
#5 |
Senior Member
Aram Amouzandeh
Join Date: Mar 2009
Location: Vienna, Vienna, Austria
Posts: 190
Rep Power: 17 |
hi!
i changed the code and now it seems to work in parallel: Code:
scalar clockTime = runTime.elapsedClockTime(); reduce(clockTime, sumOp<scalar>()); if(clockTime/Pstream::nProcs() >= clockTimeLimit) { Info<< " CPU time limit " << clockTimeLimit << " s reached." << nl << " Stop simulation and write current time step." << nl << endl; runTime.writeAndEnd(); } aram |
|
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Restart 2-way FSI with different timestep? | Lance | CFX | 10 | April 17, 2013 01:37 |
Adequate timestep selection for multidomain problem | gerardosrez | CFX | 6 | November 28, 2010 18:50 |
Use of Timestep in obtaining solution. | hagupta | CFX | 7 | February 28, 2006 14:14 |
Timestep selection | Jindra Kosprdova | CFX | 9 | April 28, 2005 07:41 |
timestep in transinet simulations | caty | CFX | 1 | April 18, 2005 20:54 |