When I try to get the phase specifc flows from a output stream I'm always getting it as zero. This problem only occurs with the mass and mole flows. I could get the composition of the phases correctly and also get the total overall mass or mole flow correctly. I have checked and made sure that the output stream contains both vapor and liquid stream.
Is there anything differnt that we have to do for mass or mole flow of phases.
I have attached the code that I used below. This code was written inside a Custom Unit Operation.
Specs : The inlet stream contains equal composition of water and carbon monoxide at 345 K and 1 atm with a massflow of 1kg/s.
You are only calculating the phase distribution with DW_CalcEquilibrium. You need to calculate both equilibrium and phase properties, which include phase flow rates.
I recommend using
importclrclr.AddReference("DWSIM.Interfaces")fromDWSIM.Thermodynamicsimport*fromDWSIM.Interfacesimport*(...)# set flash spec of the stream to P/Homs1.SpecType=Enums.StreamSpec.Pressure_and_Enthalpy# calculate phase equilibrium and phase propertiesout.Calculate(True,True)
The first boolean argument of the Calculate function is to tell it to calculate the equilibrium, while the second one refers to the phase properties. So, True/True for both equilibrium and properties.
Last edit: Daniel Medeiros 2018-06-19
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
When I try to get the phase specifc flows from a output stream I'm always getting it as zero. This problem only occurs with the mass and mole flows. I could get the composition of the phases correctly and also get the total overall mass or mole flow correctly. I have checked and made sure that the output stream contains both vapor and liquid stream.
Is there anything differnt that we have to do for mass or mole flow of phases.
I have attached the code that I used below. This code was written inside a Custom Unit Operation.
Specs : The inlet stream contains equal composition of water and carbon monoxide at 345 K and 1 atm with a massflow of 1kg/s.
Thank You.
You are only calculating the phase distribution with DW_CalcEquilibrium. You need to calculate both equilibrium and phase properties, which include phase flow rates.
I recommend using
instead of
For more information about the StreamSpec property, see http://dwsim.inforside.com.br/api_help5/html/T_DWSIM_Interfaces_Enums_StreamSpec.htm
The first boolean argument of the Calculate function is to tell it to calculate the equilibrium, while the second one refers to the phase properties. So, True/True for both equilibrium and properties.
Last edit: Daniel Medeiros 2018-06-19
Thank you.