I have problem with output temperature. In script is the temperature set, but output material stream has a wrong value. Can you help me ?
Flowsheet is attached.
When the stream contains a single compound, the spec is automatically set to pressure/enthalpy, so you must set the stream enthalpy instead of temperature, which will then be calculated by the flash algorithm.
Regards
Daniel
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Thank you,
but how can I get the enthalpy of input streams ? Is this right:
H1i = i1.GetProp("enthalpy", "Overall", None, "", "")
H2i = i2.GetProp("enthalpy", "Overall", None, "", "")
next lines are not funcional :
H1 = float(H1i[0])
H2 = float(H2i[0])
What is wrong ?
When I will set the enthalpy of output stream, can I write :
out.SetProp("enthalpy", "Overall", None, "", "", H)
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hello everyone,
I have tried basically the same syntax Petr was talking about, namely:
H = feed.GetProp("enthalpy", "Overall", None, "", "mass")
but also
H = feed.GetProp("enthalpy", "Vapor", None, "", "mass")
for a feed stream.
If I print the result I have in all cases that H equals the total (mixture) specific enthalpy, but I can't get the specific enthalpies of the vapor or liquid phases. Also, I expected H to be an array with as many elements as the number of compounds (like when I call the property "fraction"), while H is a single element array.
Where am I doing wrong?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Your syntax will return a single enthalpy value for the phase you've specified. Is your stream single phase or mixed? Why would you expect an array with enthalpy values for each compound?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Ok Daniel. I was trying, as an exercise, to reproduce the functioning of a mixer. Initially it didn't work using the overall values, but maybe there was some other error.
Now it seems that the Python UnitOp works.
So, in any case, the enthalpy returned will always be a single value and not an array: either overall, or relative to the single phase.
Hi Petr, Antonio and Daniel,
as I was searching on the word ejector in DWSIM it came up with this thread.
Is there an existing ejector unit operation?
I'm looking for a gas-gas ejector and so far I didn't find much ...
Best Regards,
Vincent
Last edit: Vincent Doucet 2020-05-18
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi Vincent, I think a specific unit operation does not exist, and you should try to simulate the ejector putting together other unit-ops, namely expander, mixer, compressor.
Maybe this paper could inspire some ideas: https://pdfslide.net/documents/ejector-modeling-in-hysys.html
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I have problem with output temperature. In script is the temperature set, but output material stream has a wrong value. Can you help me ?
Flowsheet is attached.
When the stream contains a single compound, the spec is automatically set to pressure/enthalpy, so you must set the stream enthalpy instead of temperature, which will then be calculated by the flash algorithm.
Regards
Daniel
Thank you,
but how can I get the enthalpy of input streams ? Is this right:
H1i = i1.GetProp("enthalpy", "Overall", None, "", "")
H2i = i2.GetProp("enthalpy", "Overall", None, "", "")
next lines are not funcional :
H1 = float(H1i[0])
H2 = float(H2i[0])
What is wrong ?
When I will set the enthalpy of output stream, can I write :
out.SetProp("enthalpy", "Overall", None, "", "", H)
Solved !
Right was :
H1i = i1.GetProp("enthalpy", "Overall", None, "", "mass")
H2i = i2.GetProp("enthalpy", "Overall", None, "", "mass")
h1 = 0
h2 = 0
for i in range(0, n):
h1 += H1i[i] # J/kg
h2 += H2i[i] # J/kg
H = h1+h2
out.SetProp("enthalpy", "Overall", None, "", "mass", [H]) # J/kg
Thank you Daniel
Regards
Petr Záruba
Hello everyone,
I have tried basically the same syntax Petr was talking about, namely:
H = feed.GetProp("enthalpy", "Overall", None, "", "mass")
but also
H = feed.GetProp("enthalpy", "Vapor", None, "", "mass")
for a feed stream.
If I print the result I have in all cases that H equals the total (mixture) specific enthalpy, but I can't get the specific enthalpies of the vapor or liquid phases. Also, I expected H to be an array with as many elements as the number of compounds (like when I call the property "fraction"), while H is a single element array.
Where am I doing wrong?
Your syntax will return a single enthalpy value for the phase you've specified. Is your stream single phase or mixed? Why would you expect an array with enthalpy values for each compound?
Ok Daniel. I was trying, as an exercise, to reproduce the functioning of a mixer. Initially it didn't work using the overall values, but maybe there was some other error.
Now it seems that the Python UnitOp works.
So, in any case, the enthalpy returned will always be a single value and not an array: either overall, or relative to the single phase.
sorry, there was a typo in the script.
the acquisition of the input properties should have been:
M1 = in1.GetProp("totalflow", "Overall", None, "", "mass")[0]
m1 = in1.GetProp("totalflow", "Overall", None, "", "mole")[0]
f1 = in1.GetProp("fraction", "Overall", None, "", "mole")
P1 = in1.GetProp("pressure", "Overall", None, "", "")[0]
T1 = in1.GetProp("temperature", "Overall", None, "", "")[0]
H1 = in1.GetProp("enthalpy", "Overall", None, "", "mass")[0]
but at this point I wonder why it worked...
Antonio, there is a mixer sample which can be added as a Snippet through the script editor:
Thanks Daniel, I will study the code.
Hi Petr, Antonio and Daniel,
as I was searching on the word ejector in DWSIM it came up with this thread.
Is there an existing ejector unit operation?
I'm looking for a gas-gas ejector and so far I didn't find much ...
Best Regards,
Vincent
Last edit: Vincent Doucet 2020-05-18
Hi Vincent, I think a specific unit operation does not exist, and you should try to simulate the ejector putting together other unit-ops, namely expander, mixer, compressor.
Maybe this paper could inspire some ideas:
https://pdfslide.net/documents/ejector-modeling-in-hysys.html