modelicaopenmodelica

Is there a way to define Boundary_pT with a two-phase water?


I'm trying to study a two-phase flow problem where, at the source, I have a quantity x of the mass flow as vapor. From what I understand, the “fixed composition value” “X” can help define this, but in my code, if I apply 0.95 (95% of my flow as fluid), I get the following error:

The boundary mass fractions in the “WaterIF97” medium in the “boundary_pT” model do not add up to 1 : The sum of the mass fractions of the medium “WaterIF97” in the model “Boundary_pT” does not equal 1. Instead, sum(X_boundary) = 0.95: X_boundary[1] = 0.95 “water”

I tried looking for examples with the same question but couldn't find anything.

Is there a way to define such a boundary condition with steam and liquid water?


Solution

  • In Modelica.Fluid and Modelica.Medium the vector X represents the mass fraction of different constituents in a mixture fluid. The vapor fraction/steam quality of WaterIF97 is not represented by the vector X as the vapor/liquid is regarded as the same fluid (H20).

    There is no way to directly specify the steam quality in a Boundary_pT. Instead, you must set the pressure and specific enthalpy that corresponds to your desired 95 % vapor fraction. If you use a MassFlowSource_h — in which the boundary pressure is calculated by the downstream hydraulic model — the prescribed specific enthalpy must be variable in order to maintain a constant vapor fraction during the simulation.

    You could write your own function that calculates h as a function of (p,x) or (T,x) in the two-phase region. To my knowledge there is no such function in the WaterIF97 package.