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

How to stop bproperlyb a job

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   October 9, 2008, 09:42
Default Dear users, 1. How can I st
  #1
Senior Member
 
stephane sanchi
Join Date: Mar 2009
Posts: 314
Rep Power: 18
openfoam_user is on a distinguished road
Dear users,

1. How can I stop 'properly' a multi-processors job that is running in background ? and maybe also save the results of the last iterations ?

2. Is it possible to plot the residuals while the job is running ?

Thanks for helping me,

Stephane.
openfoam_user is offline   Reply With Quote

Old   October 9, 2008, 16:21
Default Have a look at section 4.3 of
  #2
Assistant Moderator
 
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51
gschaider will become famous soon enoughgschaider will become famous soon enough
Have a look at section 4.3 of the 1.5 UserGuide:

Replace in the controlDict the current stopAt-Value with writeNow. Save and wait. But be sure not to mistype because then your run might stop without writing anything

Bernhard
__________________
Note: I don't use "Friend"-feature on this forum out of principle. Ah. And by the way: I'm not on Facebook either. So don't be offended if I don't accept your invitation/friend request
gschaider is offline   Reply With Quote

Old   October 10, 2008, 03:38
Default Thanks Bernhard for your help
  #3
Senior Member
 
stephane sanchi
Join Date: Mar 2009
Posts: 314
Rep Power: 18
openfoam_user is on a distinguished road
Thanks Bernhard for your help !
Stephane.
openfoam_user is offline   Reply With Quote

Old   October 10, 2008, 09:59
Default During calculation you can mak
  #4
Member
 
florian
Join Date: Mar 2009
Location: Mannheim - Vincennes - Valenciennes, Deutchland - France
Posts: 34
Rep Power: 17
floooo is on a distinguished road
During calculation you can make :

reconstructPar
paraFoam&

You can see the first output
and 20min later you can update it :

reconstructPar
in paraFoam => update content

in order to kill a job I use
ps to get the PID
kill ...

Then if you want to start from the last output, you have to modify your controlDict and change the start time.
floooo is offline   Reply With Quote

Old   October 10, 2008, 10:47
Default For solvers that I use often,
  #5
Senior Member
 
Mark Olesen
Join Date: Mar 2009
Location: https://olesenm.github.io/
Posts: 1,714
Rep Power: 40
olesen has a spectacular aura aboutolesen has a spectacular aura about
For solvers that I use often, I've added the following bits of code.

1.
At the top bit of the main(), before the time loop starts:

// define ABORT file for stopping the job
fileName abortName(args.rootPath()/args.globalCaseName()/"ABORT");
if (file(abortName))
{
Info<< "removing old ABORT file" << endl;
rm(abortName);
}


2. In the bottom part of the time loop:

runTime.write();

Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s"
<< " ClockTime = " << runTime.elapsedClockTime() << " s"
<< nl << endl;

if (file(abortName))
{
Info<< "reacting to user ABORT" << endl;
runTime.writeAndEnd();
}


3. Finally outside of the time loop:


// cleanup ABORT file
if (file(abortName))
{
rm(abortName);
}



This makes the solver react to the existence of the file 'ABORT' and works well with serial or parallel calculations.

It could make a nice functionObject, but to be convenient there'd need to be some way of defining site or user global functionObjects. Eg, via the existing etc/controlDict mechanism, or with a ~OpenFOAM/... directory expansion.
I'd certainly want to avoid adding the functionObject to every single system/controlDict!
olesen is offline   Reply With Quote

Old   October 10, 2008, 11:33
Default Mark, I am a new user of Op
  #6
Senior Member
 
stephane sanchi
Join Date: Mar 2009
Posts: 314
Rep Power: 18
openfoam_user is on a distinguished road
Mark,

I am a new user of OpenFoam !!!

into which file (controlDict) have you written these bits of code ?

Stephane
openfoam_user is offline   Reply With Quote

Old   October 10, 2008, 15:44
Default Hi Stephane! Have a look at
  #7
Assistant Moderator
 
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51
gschaider will become famous soon enoughgschaider will become famous soon enough
Hi Stephane!

Have a look at the chapter 4 of the user-guide. It is a most interesting read. Especially if you have to ask for the controlDict (which is THE most important file in any OF-case). Trust me.

Bernhard
__________________
Note: I don't use "Friend"-feature on this forum out of principle. Ah. And by the way: I'm not on Facebook either. So don't be offended if I don't accept your invitation/friend request
gschaider is offline   Reply With Quote

Old   October 13, 2008, 03:36
Default The bits of code have been add
  #8
Senior Member
 
Mark Olesen
Join Date: Mar 2009
Location: https://olesenm.github.io/
Posts: 1,714
Rep Power: 40
olesen has a spectacular aura aboutolesen has a spectacular aura about
The bits of code have been added directly into the solver itself (eg, simpleFoam, rhoSimpleFoam, rhoPorousSimpleFoam, etc.)
olesen is offline   Reply With Quote

Reply


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
Stop without res? Camilo Costa CFX 5 April 17, 2008 23:48
Stop solution Joung Lee FLUENT 0 October 14, 2005 13:18
phoenics stop Olfa Daboussi Phoenics 0 May 26, 2005 05:14
Stop iterating DAE FLUENT 0 January 7, 2004 07:58
Where to stop with mesh Slobodan Pazin FLUENT 5 November 4, 2001 12:17


All times are GMT -4. The time now is 13:48.