[ask for advices] A transient calculation

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

[ask for advices] A transient calculation

Post by salad »

Hi,
I want to ask for advices before i am going to do a transient calculation with Code_Saturne.
The calculation case is for exploring the transient time period between two steady states, for example, time constant. The two steady states are based on two different boundary condition values, for example, the heat flux value at heat source surfaces.
My idea is:
1. perform a steady state calculation until it is converged.
2. change the calculation to a transient type and then restart the case. Thereby, the previously calculated steady state results will be used as initial values (is this true?).
3. calculate long enough time to make sure it attains steady state again.
Please comments on my idea regarding whether it is feasible.
 
Additional questions:
1. I saw MEI options when defining boundary conditions. Can I define a boundary condition which is time dependent by using MEI?
2. Is it possible to judge whether the calculation have arrived at a steady state during the calculation time, and then perform a step change of a boundary condition?
3. Could you please introduce how to restart a calculation case? I haven't used this feature before.
Your help would be greatly appreciated.
Many thanks.
 
Best regards,
Wayne
http://code-saturne.blogspot.com/
Yvan Fournier

Re: [ask for advices] A transient calculation

Post by Yvan Fournier »

Hello Wayne,
You are correct in points 1 to 3.
For your additional questions, answers are a bit more complex:
-  You may define a velocity boundary condition depending on time using MEI, but this functionality is not yet available for scalar values, such as temperature (nothing would prevent it, but it requires adding the feature both to the GUI dialogs and to the kernel XML reader).
- You may change a boundary condition any time using Fortran user subroutines (usclim.f90). If you change the boundary condition type of any face, it is best not to have defined that BC zone using the GUI. If you only change the values, you should be able t use the GUI and override only what is necessary using usclim.f90.
Detecting convergence is a more difficult matter, as we have no automated convergence detection (though you may track values at probes of your choice).
To restart a calculation using the GUI, there is not much to do: simply go to the restart leaf in calculation management, set restart to yes, and choose a restart directory from previous results (the GUI then builds a symbolic link from RESU/RESTART.xxx to DATA/RESTART, which is where the script looks for restart files).
Without the GUI, you would have to build the DATA/RESTART link (or copy) manually, and set "isuite = 1" in usini1.f90, which is not much more complicated.
Note that in parallel, you may run and restart on a different number of processors at any time, as the restart files are partition-independent (they use global numberings and MPI data redsitribution to handle this in a transparent manner).
Regards,
   Yvan
salad

Re: [ask for advices] A transient calculation

Post by salad »

Thanks a lot, Yvan, I would try it and then report.
Best regards,
Wayne
http://code-saturne.blogspot.com/
David Monfort

Re: [ask for advices] A transient calculation

Post by David Monfort »

Let me add something to Yvan's answer regarding convergence estimation.
Indeed, you can set define some probes at well-chosen location, so that you can monitor values of interest (temperature, velocity, ...). Another solution is to monitor the "derive" value in the listing. It corresponds to the variation of the different fields between two iterations.
For instance, the velocity "derive" roughly corresponds to (for one the X component)
|u(n+1)-u(n)| / |u(n)|
Of course, both methods do not exclude each other !
Post Reply