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

How to restart simulation without being forced to write each variable ?

Register Blogs Members List Search Today's Posts Mark Forums Read

Like Tree1Likes
  • 1 Post By Flowkersma

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   June 9, 2020, 10:32
Default How to restart simulation without being forced to write each variable ?
  #1
New Member
 
Philomène Vergnol
Join Date: Apr 2020
Posts: 11
Rep Power: 6
pvergnol is on a distinguished road
Hello everyone,

In order to save some disk space, I use a function object in my controlDict in order to write only some variables.
It works perfectly well, except that when I pause a simulation and want to resume it, an error message tells me that the files for the other variables (the ones that were not written) are missing and the simulation cannot resume.
So I am stuck having to choose between being able to resume stopped simulations or being able to have enough disk space left.

Do you have an idea how to deal with this ?

I use OF v7.
Here is my controlDict and the error message is in the attached file :

Code:
application     compressibleInterFoam;

startFrom       latestTime;

startTime       0;

stopAt          endTime;

endTime         25;

deltaT          0.001;

writeControl    runTime;

writeInterval   26;

purgeWrite      0;

writeFormat     ascii;

writePrecision  6;

writeCompression off;

timeFormat      general;

timePrecision   6;

runTimeModifiable false;

adjustTimeStep  yes;

maxCo           1;
maxAlphaCo      0.2;
maxDeltaT       0.01;

functions
{

	writeObjects2
		{
			type        		writeObjects;
			libs        		("libutilityFunctionObjects.so");
			objects     		(U p p_rgh T alpha.water);
			writeOption 		autoWrite;
			writeControl    	adjustableRunTime;
			writeInterval  		0.02;
		}
}
Thank you in advance.
Attached Files
File Type: txt error_message.txt (6.5 KB, 2 views)
pvergnol is offline   Reply With Quote

Old   June 9, 2020, 10:54
Default
  #2
Senior Member
 
Mikko
Join Date: Jul 2014
Location: The Hague, The Netherlands
Posts: 243
Rep Power: 13
Flowkersma is on a distinguished road
Hi Philomène,

Have you considered using purgeWrite? Then you can only keep the most recent restart file(s) and the rest of them are deleted. In addition to this you could define function objects to save other transient data that you want for post-processing.

Best, Mikko
pvergnol likes this.
Flowkersma is offline   Reply With Quote

Old   June 11, 2020, 05:38
Smile
  #3
New Member
 
Philomène Vergnol
Join Date: Apr 2020
Posts: 11
Rep Power: 6
pvergnol is on a distinguished road
Hello Mikko,
This is a great idea and I am trying it, but I doesn't seem to work at the moment :
I put purgeWrite = 2 in the controlDict, and let the rest of the parameters the same.
This way, I thought there would be every restart variables written in the 2 last time directories, and for the rest of the directories only the ones I want for post-processing.
Unfortunately there are only the "post-process variables" in each time directory, even in the last two.
It seems that the function object sort of "overrules" the purgeWrite parameter.
Any idea ?

Thank you,
Philomène
pvergnol is offline   Reply With Quote

Old   June 11, 2020, 05:49
Smile
  #4
New Member
 
Philomène Vergnol
Join Date: Apr 2020
Posts: 11
Rep Power: 6
pvergnol is on a distinguished road
Hello again,

Actually I had forgotten to change the writeControl , for which I had put a value larger than the simulation time in order to have only the results from the function object written.
I changed it to writeControl = timeStep and writeInterval = 1 to have them written each time step.
Now the purgeWrite works well : I only have the last 2 time directories that are kept with all the "restart variables", but it also erases the results from the function object ("post-process variables" that are supposed to be written every 2 time steps).
This time it seems that the purgeWrite kind of "overrules" the function object.
How can one make them work together ?

Best,
Philomène
pvergnol is offline   Reply With Quote

Old   June 12, 2020, 20:03
Default
  #5
Senior Member
 
Claudio Boezio
Join Date: May 2020
Location: Europe
Posts: 137
Rep Power: 7
Ship Designer is on a distinguished road
Hello Philomène,

Did I understand correctly, do you want to keep only the last two time folders (steps) but the data written to postProcessing for all the time steps you specified? How do you "pause" the simulation, by pausing the execution of the program (e.g. key combination in Terminal) or by modifying endTime and restarting it later on?

To save disk space you could try using writeFormat binary; instead of ascii.
Ship Designer is offline   Reply With Quote

Old   June 15, 2020, 05:14
Default
  #6
New Member
 
Philomène Vergnol
Join Date: Apr 2020
Posts: 11
Rep Power: 6
pvergnol is on a distinguished road
Hello Claudio,

I would like to keep the data folders (time + postprocessing variables) for the time steps I specified in the writeObject function : every 0.02 s.
In addition to that, I would like to keep the last 2 data folders that contain all the variables that are needed to restart the simulation.

I stop the simulation using CTRL+C in the terminal.
I restart it the same way I started it at the beginning, but latestTime is used for startTime.

And I will also try writeFormat binary, thank you.
pvergnol is offline   Reply With Quote

Reply

Tags
compressibleinterfoam, restart, resume, simulation, variable

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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
Restart 1-D simulation MarcoMazzetta CONVERGE 1 December 6, 2017 15:40
restart simulation darookie CFX 8 January 14, 2013 03:18
Variable of concentration for multiphase simulation syens CFX 0 February 21, 2012 10:30
emag beta feature: charge density charlotte CFX 4 March 22, 2011 10:14
Restart of FSI simulation V. Kumar CFX 3 July 20, 2006 14:23


All times are GMT -4. The time now is 11:15.