gasmixture with saturne

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

gasmixture with saturne

Post by martin »

hello,
is it possible to simulate the mixture of two gases with saturne?
There are two constant Volumes with different gases, pressures and temperatures. During the Simulation the gases should start to mix.
I already meshed two cylinders in salome. But now I`m not able to set them together and declare the different parameters.
Yvan Fournier
Posts: 4208
Joined: Mon Feb 20, 2012 3:25 pm

Re: gasmixture with saturne

Post by Yvan Fournier »

Hello,

Yes, it is possible to simulate this, using an extra scalar variable per gas above 1 to define its volume fraction (the sum of volume fractions being 1). You then need to use user-defined physical laws (whether using MEI expressions in the GUI, or a user subroutine) defining the mixture's property based on the volume fraction of each gas.

In your initial conditions, the volume fraction of the second gas will be 0 in the first cylinder, 1 in the second. At calculation start, I assume both cylinders communicate, so the gases can mix (otherwise, defining the opening of a valve for example my require using time-dependent boundary conditions; as long as you do not need to change the mesh during the calculation, this is relatively straightforward).

Regards,

Yvan
martin

Re: gasmixture with saturne

Post by martin »

thx for your help.
To simulate different Temperatures in each Volume is working now.
But how exactly can I declare the different pressures and fluid properties? In the "physical properties" folder is no field to select a zone.

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

Re: gasmixture with saturne

Post by Yvan Fournier »

Hello,

You cannot simulate multiple pressures under Code_Saturne. What you can do is consider that the gas you are simulating is a mixture, with a global pressure which is the sum of the partial pressures of the 2 fluids.

You then need to use an additional (user) scalar variable to define the volume fraction "alpha" of the second fluid (the volume fraction of the first is then 1 - alpha), and define global (variable) fluid properties based on that volume fraction. I ma not sure what diffusivity properties you should set for the volume fraction.

I attach here an xml file and user subroutines from an example (for Code_Saturne 2.3) illustrating this for a mix of Helium and CO2 (Helium being injected in the CO2).

I might not have much access to my e-mail these next few days, so I hope this is sufficient to illustrate the way this can be done.

Best regards,

Yvan
Attachments
echo.xml
XML (main) setup
(9.62 KiB) Downloaded 303 times
cs_user_physical_properties.f90
Physical properties for mixture
(62.72 KiB) Downloaded 321 times
Post Reply