Source term for periodic simulation

Questions and remarks about code_saturne usage
Forum rules
Please read the forum usage recommendations before posting.
Post Reply
CTrinca
Posts: 32
Joined: Mon Mar 30, 2015 9:19 am

Source term for periodic simulation

Post by CTrinca »

Hello everyone,

I am having some troubles in running a simulation on a periodic domain. To drive the flow and to keep the flow rate at a constant value, I tried to adapt a subroutine written by Yvan Fournier I found in an old post (http://code-saturne.org/forum/viewtopic.php?f=2&t=1327). I have not had much success so far: although the mass flux reaches the desired value rather quickly, and is kept nicely steady for a while, at some point it starts to decrease, before going into pieces.
mass_flux_vs_iter.png
The simulation goes on for another few iterations, oscillating wildly until it crashes. I am attaching my version of the subroutine: does anyone find any mistake in it, or has any idea about the reason of this behaviour?
As you will see, I was trying to use a different control than that in the original script before I switched back to Yvan's formula, but this did not fix the problem.
Thanks in advance to anyone answering.
Best regards,

Cosimo
Attachments
cs_user_source_terms.f90
(8.86 KiB) Downloaded 231 times
CTrinca
Posts: 32
Joined: Mon Mar 30, 2015 9:19 am

Re: Source term for periodic simulation

Post by CTrinca »

Sorry, I noticed a little mistake: in the plot I labelled the X axis as "iteration", while it actually represents the time steps.
Post Reply