Hello,
I just create a stream with multiple components and I want to extract properties of stream via python scripting.
i want to extract Temperature, Pressure, and component mole fractions. i used GetProp function as below:
but an Error occurs:
Error UO-01: CapeComputationException : Error in the application.
at DWSIM.Thermodynamics.Streams.MaterialStream.ThrowCAPEException(Exception& ex, String name, String description, String interf, String moreinfo, String operation, String scope, Int32 code) in C:\Users\Daniel\source\repos\DanWBR\dwsim6\DWSIM.Thermodynamics\Material Stream\MaterialStream.vb:line 6015
at DWSIM.Thermodynamics.Streams.MaterialStream.GetProp(String property, String phase, Object compIds, String calcType, String basis) in C:\Users\Daniel\source\repos\DanWBR\dwsim6\DWSIM.Thermodynamics\Material Stream\MaterialStream.vb:line 3307
what does it mean and what should I do?
I also want to set new properties to the oms1 and I think I will encounter the same Error as well. also, I have not found any documentation of DWSIM inbuilt python function like above. where can I find the documentation( with explanation and example) too?
Regards
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hello Daniel,
Thanks for your guidance. I really appreciate your help! The documentations helps me a lot.
I have some questions in my mind. I wonder how the Get.overallcompostion() return the value, because I did not see any explanation in source. For example:
if I have 4 components with various mole fractions :
Mole_Fractions = ims1.Getoverallcomposition()
is Mole_Fractions a vector with 4 values? like [mole_frac1, mole_frac2, mole_frac3, mole_frac4]
Also, How can i see the value of the variables in DWSIM python scripting?
in python, I mostly use print(), is there any function like this in DWSIM?
Regards
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Mole_Fractions is a vector. To see the variable values you can either put a breakpoint somewhere and run the script in the debug mode (third PLAY icon in the menubar) or do
Flowsheet.WriteMessage(text)
❤️
1
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hello,
I just create a stream with multiple components and I want to extract properties of stream via python scripting.
i want to extract Temperature, Pressure, and component mole fractions. i used GetProp function as below:
ims1.GetProp('Temperature', 'Overall', None, '','')
ims1.GetProp('Pressure', 'Overall', None, '','')
ims1.GetProp('fraction', 'Overall', Ethylene, '', 'mole')
ims1.GetProp('fraction', 'Overall', Oxygen, '', 'mole')
but an Error occurs:
Error UO-01: CapeComputationException : Error in the application.
at DWSIM.Thermodynamics.Streams.MaterialStream.ThrowCAPEException(Exception& ex, String name, String description, String interf, String moreinfo, String operation, String scope, Int32 code) in C:\Users\Daniel\source\repos\DanWBR\dwsim6\DWSIM.Thermodynamics\Material Stream\MaterialStream.vb:line 6015
at DWSIM.Thermodynamics.Streams.MaterialStream.GetProp(String property, String phase, Object compIds, String calcType, String basis) in C:\Users\Daniel\source\repos\DanWBR\dwsim6\DWSIM.Thermodynamics\Material Stream\MaterialStream.vb:line 3307
what does it mean and what should I do?
I also want to set new properties to the oms1 and I think I will encounter the same Error as well. also, I have not found any documentation of DWSIM inbuilt python function like above. where can I find the documentation( with explanation and example) too?
Regards
Hi Amir,
you can just do
to set properties:
https://dwsim.inforside.com.br/api_help60/html/T_DWSIM_Thermodynamics_Streams_MaterialStream.htm
Hello Daniel,
Thanks for your guidance. I really appreciate your help! The documentations helps me a lot.
I have some questions in my mind. I wonder how the Get.overallcompostion() return the value, because I did not see any explanation in source. For example:
if I have 4 components with various mole fractions :
Mole_Fractions = ims1.Getoverallcomposition()
is Mole_Fractions a vector with 4 values? like [mole_frac1, mole_frac2, mole_frac3, mole_frac4]
Also, How can i see the value of the variables in DWSIM python scripting?
in python, I mostly use print(), is there any function like this in DWSIM?
Regards
Hi Amir,
Mole_Fractions is a vector. To see the variable values you can either put a breakpoint somewhere and run the script in the debug mode (third PLAY icon in the menubar) or do
So much appreciation Mr Medeiros! These tips help me out a lot.