Page 1 of 1

Gasmixture, and mass source term (usphyv, ustsma)

Posted: Tue Oct 16, 2012 3:42 pm
by Quentin Bey
Hello,

I'm trying to use Code_Saturne with : passive scalar transportation, a fluid density which depends on this scalar and a mass source term. I don't get the expected results, can you please give me some help ?

My case contains a passive scalar, I'll call the volume fraction of gas number 2.
I try to compute a gas (number 2) evolving in another gas (number 1) which is the reference. Thus the fluid density is based on user subroutine usphyv, using this relation
The flow in my duct is already established and in all the domain at the beginning of simulation.

I want to add a mass source term of gas number 2. I've used the ustsma subroutine : I called GETCEL to catch cells and with VOL_SOURCE the total volume of caught cells :

Code: Select all

    DO IELTSM = 1, NCESMP

      ! Mass source term
      SMACEL(IELTSM,ipr(IPHAS)) = 1.2266d-3 / VOL_SOURCE

      ITYPSM(IELTSM,isca(1)) = 1
      SMACEL(IELTSM,isca(1)) = 1d0

    ENDDO ! DO IELTSM = 1, NCESMP
When reading the listing file at the end of computation, I found a difference between my inlet mass flow rate and the outlet one of 1.2266d-3 kg/s showing my "SMACEL(IELTSM,ipr(IPHAS))" implementation is good. But when I want to monitor my mass of gas number 2 in the domain, I found a ratio of (I use this formula : with the mass of gas 2, the volume of the cell.)

It seems like my mass source term don't care about my usphyv law, is that true ? Did I make a mistake using ustsma subroutine ?

I've tried it on Code_Saturne 2.0.0rc1 and 2.3.1.

Thank you for any help you might bring me !

Quentin

Re: Gasmixture, and mass source term (usphyv, ustsma)

Posted: Wed Oct 17, 2012 10:27 pm
by Yvan Fournier
Hello,

Did you postprocess and visualize , to check its mean value and check if the second fluid fills the whole domain (if I understand the issue/your check correctly) ?

Regards,

Yvan

Re: Gasmixture, and mass source term (usphyv, ustsma)

Posted: Thu Oct 18, 2012 1:44 pm
by Quentin Bey
Hello Yvan,

Actually, I've post-processed to monitor the mass of gas 2 injected each second. I expected to found again my 1.2266d-3 kg/s I've put in ustsma, but I don't.

Let me explain my case again, I've joined a scheme. My domain is filled with gas 1 at t=0, with an inlet at the beginning of duct supplying it with gas 1 () at a velocity of 0.9m/s. In the middle of my duct I've put a source of gas 2 () which might provide a mass flow of 1.2266d-3 kg/s of gas 2 (and 0kg/s of gas 1).

My domain is long enough to ensure that no gas 2 left it during the unsteady simulation.

In the Cas_Test_Source_Vol_Chimique_CS_2.3.zip archive, you can find my user subroutines and the XML file describing the case. If needed, I can also provide you the mesh file (.med) which weight more than 7Mo.

Thank you,

Best regards,

Quentin

Re: Gasmixture, and mass source term (usphyv, ustsma)

Posted: Fri Oct 19, 2012 1:29 am
by Yvan Fournier
Hello,

I'll be on holiday next week, so I'll let others look at this (Ill probably delete this post, as it is just a "please wait" post, but don't be surprised if you need to wait a few days before you get an answer).

Regards,

Yvan

Re: Gasmixture, and mass source term (usphyv, ustsma)

Posted: Mon Oct 22, 2012 7:22 pm
by Jacques Fontaine
Hello,

Could you post your mesh?
I will try to reproduce your case.
Regards,
JF

Re: Gasmixture, and mass source term (usphyv, ustsma)

Posted: Wed Oct 24, 2012 2:23 pm
by Quentin Bey
Hello Jacques,

Please find my mesh joined to this message. Thanks for you interest.

Regards,

Quentin

Re: Gasmixture, and mass source term (usphyv, ustsma)

Posted: Tue Nov 20, 2012 7:43 pm
by Jacques Fontaine
Hello,

I'm sorry for the delay.
Your result is not surprising because in ustsma you are injecting gaz mixture with in other words at the beginning of the computation you are mainly injecting gas 1 (and not 2) and you do no retrieve your 1.22e-3 kg/s of gas 2 but 1.22e-3 kg/S of (gas 1 - gas 2).
Regards,
JF

Re: Gasmixture, and mass source term (usphyv, ustsma)

Posted: Fri Nov 30, 2012 5:00 pm
by Quentin Bey
Hello Jacques,

Thanks for your reply.

That was my question, so I inject mixtured gas which density is .
It means that at the beginnig, when my domain is empty of scalar () I can 'precisely' control the injected quantity of gas 2 using ustsma subroutine, but during the filling of the domain, the scalar in the source cells rises and it becomes very hard to keep control of the injected quantity of gas 2.
Do you have an idea, or a clue, of how the source term smacel should look like to be generic and inject constantly the quantity Q during all the simulation regardless of the scalar concentration in source cells ? If not, don't worry.

Thank you,

Best regards,

Quentin

Re: Gasmixture, and mass source term (usphyv, ustsma)

Posted: Sun Dec 16, 2012 7:18 pm
by Jacques Fontaine
Hello,
You can't control the injection of gas 1 or 2 it's alway a mixture.
If you want to create a classic inlet in your domain you can use the thin walls (cs_user_mesh.c) to transform a n internal face into boundary face.

JF