Page 1 of 1
Restarting from a text file
Posted: Fri Oct 17, 2014 3:28 pm
by cyrillic
I have found something I can't explain in the process I've been using. The process in Saturne 2.0 is
1) I find a velocity solution in a periodic case (driven by a velocity source in ustsns) and output it to a text file.
2) I start a non periodic case and at the end of iteration 2 I stop and read the velocity text file on to the grid in rtp and rtpa in usproj.
3) I then restart this with a frozen velocity to simulate the transport of some scalars.
What I have found is that when I create the restart file in step 2, variation of the velocity source term in ustsns affects the final result.
If I create two restarts using two different velocity source terms, even though the velocity solutions are identical because I read them from the same text file, I will end up with two different scalar solutions.
Can anyone explain how ustsns affects the restart files, and if so how could I fix it?
Cheers,
Stuart
Re: Restarting from a text file
Posted: Fri Oct 17, 2014 11:13 pm
by Yvan Fournier
Hello,
I'm not quite sure I understand:
Do you use the same base mesh for the periodic and non-periodic case ? If so, you could directly use a simple restart, if you deactivate reading of the auxiliary restart file (which contains face data, which is different between a periodic and non-periodic mesh), things might work.
Also, it is not clear in your explanation if you checked that the text file is identical in both cases, or if you are using the same restart file or simply assuming it should be the same.
You can compare values in restart files using "cs_io_dump --diff <file1> <file2>"
Finally, in which file do you read your text file ?
Regards,
Yvan
Re: Restarting from a text file
Posted: Sun Oct 19, 2014 2:57 pm
by cyrillic
Let me clarify a bit. I use only one mesh and I produce a single text file with the velocity and pressure information.
I start my scalar simulations by running a 2 iteration simulation, and in usproj the velocity and pressure is read in (rtp, rtpa) at the end of both iterations 1 and 2. This produces my restart file for the rest of the scalar simulation. I restart with a frozen velocity and I thought just the cell centre velocity information was enough.
What I have found is that the velocity source in ustsns can affect the creation of the restart files. (For the 2 iteration simulation I would set it equal to the value used in the periodic simulation, but I forgot this once, leaving it at a higher value, and found this problem)
Therefore in the two iteration simulation the velocity source does something to the solution that will affect the restarted scalar simulation later, even though the cell centre velocities are correct.
My theory is that the face values are not updated in the restarted simulation as a result of the frozen velocity. At the end of iteration 1, the cell centre velocity is made correct (read from the text file). In iteration 2 the velocity evolves because the velocity source is different (this will also occur very slightly even when it matches the periodic case). The face values are calculated from the incorrect cell centre velocities. At the end of iteration 2 the cell centres are restored to the correct values. And the restarted scalar simulation depends on the face values, so the answers are different.
What do you think?
Re: Restarting from a text file
Posted: Sun Oct 19, 2014 11:35 pm
by Yvan Fournier
Hello,
This seems plausible, but to better understand what is going on, I recommend comparing the restart files (both main and auxiliary, or in Code_Saturne 2.0 terms, suiva / suiavx) in both cases.
The cs_io_dump --diff utility will telle you which fields are the same, which are not, so verifying hypotheses will be easier.
Regards,
Yvan