Question concerning restart

Questions and remarks about code_saturne usage
Forum rules
Please read the forum usage recommendations before posting.
Post Reply
yann_b

Question concerning restart

Post by yann_b »

Hello,

My name is Yann, I am working on the coupling of double diffusion with real gases radiation and I have some problem concerning the restart.

I am performing sequential calculation and I am using the GUI.
The same mesh is used and I do not change any parameter through the graphical interface, expect of course the 'Number of iteration'.
The restart directory is set to 'checkpoint' in the RESU directory corresponding to the calculation I want to restart.

The characteristics of my code are:
- The use of a module defined in 'user_modules.f90'. In this module I declare some arrays which allows me to easily communicate between the different subroutines;
- Precalculations related to the radiation model are performed in 'usini1.f90';
- The radiation field is calculated in 'usclim.f90';
- The radiation field (source term) is sent to 'ustssc.f90'.

When I restart, the calculation stop at 'usclim.f90' which seems logical as I need data that is supposed to be calculated by 'usini1.f90' (not called at restart).
So my question is : How can I keep data calculated before calculation in 'usini1.f90', that I can reuse when the calculation restart?

Thank you for your help

Regards,
Yann
Meskine
Posts: 26
Joined: Thu Jul 19, 2012 1:56 pm

Re: Question concerning restart

Post by Meskine »

Several things to do for a successful restart in general:

- move restart.date into /DATA and rename it "RESART" (cf runcase script)
- Change maximum iteration (ntmabs) in usini1 (max and not numbers of iteration in more !)
- Set "isuite = 1" in usini1
yann_b

Re: Question concerning restart

Post by yann_b »

Thank you Cyril for your reply and your advices,

- I was not able to found the file 'restart.date'. I am using the version 2.1.4, maybe that is an explanation.
- Neither 'ntmabs' nor 'isuite' are in 'usini1.f90'. I am using the GUI so I think I do not need to play with those parameters. Moreover the user's guide tell that we should not modified it.

Anyway, I think I identified the problem. What I would like to do is to generate a file that stores some variables in order to use them wen the calculation restart. Exactly like the 'main' and 'auxiliar' files does.

Regards,
Yann
Yvan Fournier
Posts: 4208
Joined: Mon Feb 20, 2012 3:25 pm

Re: Question concerning restart

Post by Yvan Fournier »

Hello,

In versions 2.1 and above, ntmabs is still in usini1.f90 (renamed to cs_user_parameters.f90 in version 2.2 and above), but isuite is defined automatically, and not a user setting anymore (it is determined automatically based on the presence of the restart directory in the execution directory; in version 2.0, the user needed both to define isuite and point to the correct directory, which was more error prone).

usini1.f90 is called in case of a restart, and even some model changes (such as turbulence models) are possible.

A few routines may be not be called though, though, and radiative transfer may be part of those.

To record additional data for restart, you could write it at the last time step using usproj.f90 (which is a "general purpose" routine called at the end of each time step), and use that as user data (to be placed in the DATA directory when restarting, and maybe added to the list of user data files, which is not automated if I remember correctly in version 2.1).

If not running in paralled, you may use any data format (simple text is easy to check if you are not an expert). If you are comfortable with programming and prefer "clean" code which works in parallel, you could use the checkpoint / restart functions which are defined in the source code in src/base/cs_restart.c and used in src/base/ecrava.f90 (writing) and src/base/lecam*.f90 (reading).

Note that version 2.1 is not maintained anymore (meaning in my case that Imay answer questions to which I remember the answers, but won't reinstall or run the version to test something, as I am already quite busy with other versions).

Maintained versions are 2.0, and 2.2 and above. When 3.0 is released (in a few weeks), 2.2 will become unmaintained (I forgot to mention 1.3, which will also become unmaintained when 3.0 is released. See the download section on this site for details on version lifecycles.

So if you do significant data setup/programming, I would recommend upgrading to 3.0 beta as soon as possible.

Regards,

Yvan
yann_b

Re: Question concerning restart

Post by yann_b »

Yvan, thank you for your answer,

My last question:
If usini1.f90 is called in case of a restart, what about user_module.f90?

If not, from what I understand in your last reply, I will have to record data from user_module.f90 into a file that have to be placed in the DATA directory. To do this in the clean way I should use the functions define in cs_restart.c, ecrava.f90 and lecam.f90. My problem is I can found any of these files, maybe again a problem with he version (2.1.4).

I will definitely upgrade to version 3.0 beta as soon as I can.

Thanks in advance.
Regards,

Yann
Yvan Fournier
Posts: 4208
Joined: Mon Feb 20, 2012 3:25 pm

Re: Question concerning restart

Post by Yvan Fournier »

Hello,

Nothing from cs_user_module.f90 is ever called automatically: everything the user places in this file needs to be called explicitly from another user subroutine (whether in restart mode or not).

The specificity of cs_user_module.f90 is that if a file with this name exists, it is compiled before all the others, so modules defined there will be found bu "use" statements in other user subroutines. But besides that, everything may/must be chosen/defined by the user.

Best regards,

Yvan
Post Reply