Hi Daniel,
Thank you for answer. I rewrited script as UO, it seems to be OK.
Now I read some properties from input stream. Some are OK, but with some I have problem.
Vapor mass fraction:
y = input.GetProp("massfraction", "Vapor", None, "Vapor", "mass")
It works, but returns a bad result.
Surface tension:
surfTenL = input.GetProp("surfaceTension", "Liquid", None, "LIquid", "mass")
TypeError: At least one element in the source array could not be cast down to the destination array type.
Vapor specific volume:
vv = input.GetProp("spec_vol", "Vapor", None, "Vapor", "mass")
StandardError: Error in the application.
Milos
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi Daniel
Something has been solved, but the problem with "surface tension" is failing to solve for me.
surfTen = outlet.GetProp("surfaceTension", "Overall", None, "LIquid", "")
TypeError: At least one element in the source array could not be cast down to the destination array type.
I do not understand exactly what each parameter means, but I tried different combinations, all with the same error.
I do not know if it is related, but in Tutorials - Object Property Codes-Material Stream property surface tension does not exist.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi,
I'm trying to write a simple script to overwrite some values using the example that works:
Import clr
from DWSIM import *
Input = ims1
T = 350
etc.
But right after start I get an error:
File "<string>", line 3, in <module>
NameError: name 'ims1' is not defined
What am I doing wrong?
ims1 is defined only for scripts inside the Script Unit Operation, not for global flowsheet scripts.
Hi Daniel,
Thank you for answer. I rewrited script as UO, it seems to be OK.
Now I read some properties from input stream. Some are OK, but with some I have problem.
Vapor mass fraction:
y = input.GetProp("massfraction", "Vapor", None, "Vapor", "mass")
It works, but returns a bad result.
Surface tension:
surfTenL = input.GetProp("surfaceTension", "Liquid", None, "LIquid", "mass")
TypeError: At least one element in the source array could not be cast down to the destination array type.
Vapor specific volume:
vv = input.GetProp("spec_vol", "Vapor", None, "Vapor", "mass")
StandardError: Error in the application.
Milos
Take a look at the other script samples (Hydrocyclone and Membrane).
Hi Daniel
Something has been solved, but the problem with "surface tension" is failing to solve for me.
surfTen = outlet.GetProp("surfaceTension", "Overall", None, "LIquid", "")
TypeError: At least one element in the source array could not be cast down to the destination array type.
I do not understand exactly what each parameter means, but I tried different combinations, all with the same error.
I do not know if it is related, but in Tutorials - Object Property Codes-Material Stream property surface tension does not exist.
Your syntax is wrong (the third argument must be an empty array).
Surface tension is stored as a mixture property in the Material Stream. You can get its value in a much easier way:
surft = outlet.Phases[0].Properties.surfaceTension
This will return the surface tension in N/m.