Hello,
I'm struggling to get a script-based SPLIT unit to work. Specifically, an enthalpy balance error occurs when I use the code below and specify the outlet streams, using either a TP or PH flash. When I inspect the outlets, one can see that the flows and molar enthalpies have been distributed according to the chosen split factor, whereas the products don't exhibit the 25°C inlet temperature, but ~100°C which brings the pure water streams into the 2-phase regime at the bubble-point. I assume that I miss something for the correct flash setup of the outlets and would be happy if you could point me in the right direction. Many thanks in advance!
As I was trying to indicate, I tested already T-P or P-H as variable of state (VOS) specifications, in the asumption that the solver could then flash the stream. The attached screenshot, shows a run with your suggestion where all three VOS have been set, but unfortunatelly with the same outcome (energy balance error, wrong outlet temperatures, ...).
The used python interpereter is Python.NET which is linked to a 32-bit WinPython 3.6 environment. Do I have to import some other modules beside the used System to make this work?
I also called the .Calculate function in the hope that this triggers a fresh recalculation of the stream object and its properties, but again with no luck.
Enthalpy in DWSIM is an intensive property given in kJ/kg, so you must assign the same value of the inlet stream to the outlet ones, without any multiplication factor:
Hello,
I'm struggling to get a script-based SPLIT unit to work. Specifically, an enthalpy balance error occurs when I use the code below and specify the outlet streams, using either a TP or PH flash. When I inspect the outlets, one can see that the flows and molar enthalpies have been distributed according to the chosen split factor, whereas the products don't exhibit the 25°C inlet temperature, but ~100°C which brings the pure water streams into the 2-phase regime at the bubble-point. I assume that I miss something for the correct flash setup of the outlets and would be happy if you could point me in the right direction. Many thanks in advance!
You've commented the lines which set the outlet enthalpies.
Hi Daniel, many thanks for the feedback!
As I was trying to indicate, I tested already T-P or P-H as variable of state (VOS) specifications, in the asumption that the solver could then flash the stream. The attached screenshot, shows a run with your suggestion where all three VOS have been set, but unfortunatelly with the same outcome (energy balance error, wrong outlet temperatures, ...).
The used python interpereter is Python.NET which is linked to a 32-bit WinPython 3.6 environment. Do I have to import some other modules beside the used System to make this work?
I also called the .Calculate function in the hope that this triggers a fresh recalculation of the stream object and its properties, but again with no luck.
Last edit: PeerB 2020-05-05
Hi,
Enthalpy in DWSIM is an intensive property given in kJ/kg, so you must assign the same value of the inlet stream to the outlet ones, without any multiplication factor:
Hi,
thank you, that's the right clue! After correcting this mistake, everything looks fine :)
btw, I really like how my local Winpython distribution can be integrated and be used in DWSIM, that's a fantastic feature!
Thanks to Python.NET!