I added the following line to the script after the SetFlashSpec() function call: outlet.PropertyPackage.DW_CalcEquilibrium(PropertyPackages.FlashSpec.P, PropertyPackages.FlashSpec.H) I get an error: This error was raised during the calculation of a Unit Operation or Material Stream. System.Exception: Python Script error, line 27: Object reference not set to an instance of an object. at DWSIM.UnitOperations.UnitOperations.CustomUO.Calculate(Object args) in C:\Users\Daniel\source\repos\DanWBR\dwsim\DWSIM.UnitOperations\UnitOperations\PythonScriptUO.vb:line...
Daniel, thank you for the quick response! Could you please explain, why you do not call the DW_CalcEquilibrium function, but instead only specify the flash type with SetFlashSpec? When I calculate the flowsheet from your file I see in the output panel that x2 equals 1.0. At the same time the pop-up table for the outlet stream shows that the stream is V + L, and the vapor fraction is 0.99957. It looks like the output for x2 value is incorrect. Another confusing thing is that I have the same results...
Hi all, I'm writing a simple python module, which would be able to process water steam + CO2 mixture. I want to change the enthalpy of the mixture so that the water is partially condensed at the outlet. I used a template to set up the outlet stream properties (pressure, enthalpy, molar fractions, flowrate) and then call DW_CalcEquilibrium function. As I understand, the vapor fraction in this case is set to 1, even if the actual enthalpy value is below the saturation value for water at the given partial...