Get the previous time step values for temperature field

Questions and remarks about code_saturne usage
Forum rules
Please read the forum usage recommendations before posting.
Post Reply
Cbarnaud
Posts: 36
Joined: Tue Oct 22, 2019 10:28 am

Get the previous time step values for temperature field

Post by Cbarnaud »

Hello all

I'm using code_saturne 6.0 and I need, for an extra calculation, to get the previous values of the temperature field, itemp.
I've seen that the option of keeping the previous time step is disabled for temperature and I wonder how to activate it.
I've tried to use "call field_set_n_previous(itemp,1)" in the initialization but it seems not working. Indeed, I have no longer errors when I compile my code with "call field_get_val_prev_s(itemp, cvara_temp)" but I have one when I run the code with the "cs run --param DATA/setup.xml --nprocs 24" for the line where I use cvara_temp :
"Fortran runtime error: Index '1' of dimension 1 of array 'cvara_temp' above upper bound of 0"

So it seems that it didn't save the previous step correctly.
Do you have any recommendations to make it work?

Best regards,
Camille.
Yvan Fournier
Posts: 4077
Joined: Mon Feb 20, 2012 3:25 pm

Re: Get the previous time step values for temperature field

Post by Yvan Fournier »

Hello,

Could you post the setup (except for the mesh unless it is small) ?

If the temperature is a resolved field, it should save its previous value.

But itemp might not be initialized to the correct value (iscal(iscalt)). You may want to check this first. Also, in the setup.log, you have more info on options for each field.

Best regards,

Yvan
Post Reply