CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   CFX (https://www.cfd-online.com/Forums/cfx/)
-   -   Mass fraction query of mass flow (https://www.cfd-online.com/Forums/cfx/239386-mass-fraction-query-mass-flow.html)

Nheni November 3, 2021 10:16

Mass fraction query of mass flow
 
Dear All,

I have a multicomponent gas simulation, where I want to monitor the mass flow rate through a surface, and the mass fraction of this flow. So, I need to know, how the flow is divided between the two components.
I had two idea to realize this, but none of it works. Both idea is based on components flow monitoring, from which I can calculate the ratio:
- gas1.massFlow()@surface - this function prefix is need to be a phase, but I have components, I think this is the reason why it is not worked
- massFlowInt(gas1. Mass Fraction)@surface - I don't know what is this, but it is not the expected ratio

I'm out of ideas, could you possibly help? Do you have experiences?

Thank you,
Henrietta

evcelica November 3, 2021 11:59

Hmmm.... not sure on this, but possibly:
massFlowAve(gas1.Mass Fraction)@surface
Go to the functions calculator to find a nice list of usable functions to try out. Click on the "display function" box to see the exact function it is evaluating, which you can then put in expression form for future use once you figure out what is correct.

Nheni November 4, 2021 08:47

Evcelica,

Thank you, it is a super opportunity this Function Calculator, I didn't know it until now :) But sadly the recommended expression isn't work.
Anyone else have any other suggestion?

Thanks

Opaque November 4, 2021 12:24

What about writing in mathematical terms what you would like to see?

Say

A = integral over the area of ( .... )

Which is the integrand you want?

Then, we find out what CEL expression is required.

evcelica November 4, 2021 15:42

The expression I gave you should work, I just tested it on a multicomponent flow.
But so did your original expression "massFlowInt(gas1.Mass Fraction)@surface" (though I did have to remove the space between the period and the M in Mass)
In fact I get consistent results from each:

In my test:
massFlow()@surface = -20.7947 [kg s^-1]
massFlowInt(Argon.Mass Fraction)@surface = -2.37778 [kg s^-1]
massFlowInt(Air.Mass Fraction)@surface = -18.4169 [kg s^-1]
massFlowAve(Argon.Mass Fraction)@surface = 0.114345
massFlowAve(Air.Mass Fraction)@surface = 0.885655
My mass flow Integrals sum to the total mass flow, and agree with the 11.4% and 88.6% values given my the massFlowAve expressions.

Perhaps you are doing something else wrong?
1.) Is this "surface" some surface with fluid flowing across it? (opening, inlet, outlet, or a surface you defined in the volume? It needs to be, as there is no mass flow across a solid surface like a wall.
2.) Is "gas1" the name of one of your components in your gas? Can you plot the variable "gas1.Mass Fraction" on your surface. It should be a standard variable if so.

Opaque November 4, 2021 16:42

Quote:

Originally Posted by Nheni (Post 815710)
- gas1.massFlow()@surface - this function prefix is need to be a phase, but

I have components, I think this is the reason why it is not worked

From the above, it seems you have a fluid mixture named gas1 made out of several components, correct?

The above in mathematical form is

Integral over surface of (gas1.density * Velocity dot Normal Area vector)

Quote:

Originally Posted by Nheni (Post 815710)
- massFlowInt(gas1. Mass Fraction)@surface - I don't know what is this, but it is not the expected ratio

Fixing the space after the ".", the syntax is

{Phase}.massFlowInt([Material].Mass Fraction)@surface

{Phase} is optional, and only required when there is more than one phase in the model.
[Material] is required to qualify the mass fraction of interest

The expression above in mathematical form is

Integral over surface of (Phase.Density * Material.Mass Fraction * Velocity dot Normal Area Vector)

Nheni November 10, 2021 05:17

Thanks for your help!

In the model there is a gas mixture of two components (gas1 and gas2). The gas mixture flows (in) from the outer fluid1 domain through a porous domain to the inner fluid2 domain. The interested surface is the porous-fluid2 interface.

Evcelica, I checked these values in my simulation, and it shows a perfect correlation, but... When I monitor the changes (increase)of the mass of gas1 and gas2 in fluid2, and calculate the mass fraction for that mass increase, then this mass fraction is not the same to the one got from monitoring the mass fraction based on your suggestion. It would be important for me to get the same ratio from surface queries, because I want to omit fluid1 and porous domain, and I have to know, what mass flow and mass fraction do I need to define on the boundary of fluid2.

I know, it's not a simple problem, but I really don't understand why the mass fraction is not the same calculated from mass increases in fluid2 and from the surface values.

Thanks again,
Henrietta

Opaque November 10, 2021 10:44

Advice: write down the mathematical formalism of what you are evaluating, and how you want to use it. Otherwise, there will be a lot of iterations just to decipher we use different terminology.

evcelica November 10, 2021 11:46

Like Opaque implies,
Please explain, I don't understand what you mean by the change of the mass?
Pictures would help. Are you compressing this gas into some volume? Does this volume have an exit?

Nheni November 11, 2021 09:09

Initially, I have gas1 in each domain, then I compressing gas2 into fluid1. Neither volume have an exit, but the mixture flow through the porous domain into fluid2. I monitor 4 thing:

- gas1 mass in fluid2: volumeAve(gas1.Mass Concentration)@fluid2*volume()@fluid2
-gas2 mass in fluid2: volumeAve(gas2.Mass Concentration)@fluid2*volume()@fluid2
-mass fraction at porous fluid interface: areaAve(gas1.Mass Fraction)@interface
-mass flow rate through porous fluid interface: massFlow()@interface

Then I do calculations in excel after exporting the monitor points:
- gas1 and gas2 mass increase at every timestep(m(timestep n.)-m(timestep n-1.))
- from that step by step change I calculate the mass fraction: gas1 mass increase/(gas1 mass increase and gas2 mass increase)

In principle, the mixture enters fluid2 with above calculated mass fraction, but this is not the same with the monitored mass fraction at the interface.

When I omit fluid1 and porous domain, I defined to the boundary:
simulation1: mass flow rate average and the mass fraction (calculated from mass increase)
simulation2: mass flow rate average and the mass fraction(obtained from interface monitor point).
The simulation1 gives exactly the same result (gas mixture mass fraction) as in the original simulation.

So the question again: Why the results obtained in two ways do not match? And how do I retrieve this value from the interface to get the same result?

Thank you, I hope this description already clarifies the problem.
Henrietta

Opaque November 12, 2021 11:46

Again, you are not explaining the mathematical model or your goals, but rather your steps using ANSYS CFX.

Those are very different contexts where the first one will set the tone for understanding by others, while the second one assumes everyone else understands what you want and need to help you find an error in your approach.

So far I have understood you have two volumes connected via an interface. Within a volume you have a mixture of two materials that is being compressed.

Then, a bunch of expressions with no clear goal that relates to one another.

evcelica November 16, 2021 01:43

I don't understand either.
I don't think areaAve(gas1.Mass Fraction)@interface should be used. It should be massFlowAve.

Nheni November 16, 2021 10:52

As I wrote in my first post, my goal is to monitor the mass flow rate through an interface, and the mass fraction of this flow. (via surface queries)
I can’t provide more definitions than described, but a different approach to the problem is going on, so my question has become irrelevant.
I apologize, and thank you for your time!


All times are GMT -4. The time now is 11:57.