I'm currently trying to create a dynamic simulation by familiarizing myself with simple process simulations.
I can plot simple values like Temperature, Pressure and Massflow, because Daniel referenced them in various examples on the infosite.
When it comes to parameters like phase count of a fluid, concentration of a certain compound in the gaseous phase or the removed heat of a cooling block I run into the problem of not knowing the specific description I have to use in my scripts to get the results I want to plot on my graph.
Is there some way of finding the correct wording I need, like a online database or a bigger list of examples?
As an example. If I try to get the molar fraction of water in the vapour phase in a Liquid-Vapor-Mixture, how do I achieve it? Is this the right basic approach?
You can also set a breaking point on your script code and run the script in debug mode (third 'play' button on the toolbar). This will give you a list of all variables and their properties as the code runner stops at the breaking point location.
Thanks a lot Luca and Daniel, your solutions really helped me get a lot further.
Daniel, as I understand your response, the debug mode is only availible in DWSIM and not in New UI right. I have solely been working on New UI, so I have some open questions.
The window "Variables" only appears shortly after I press "debug" and doesn't stay open, how do I access it?
Building on Lucas answer, about displaying the attributes of MassFlows, I need to ask how to open the list of attributes of Flowsheet Objects like Reactors, Heaters and Compressors.
Thank you again guys.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
However sometime, to retrieve useful parameters you need dig into the properties of subobjects but to understand in which and where, you need to go through the source code, as Daniel mentioned, to see where they calculated and stored.
As an example, for a cstr if you want to have information regarding the reaction kinetics you should have in your script something like
My project does indeed include accessing and tweaking reaction parameters, especially the "Conversion Expression" of some main chemical reactions .
Does the scheme you wrote translate to a Conversion Reactor and can I directly change the expressions in my dynamic simulation?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
In principle yes, you could access the reaction(s) kinetic parameters through a script and 'dynamically' change them.
For an first outlook on how the parameters are handled inside DWSim and how you can access them , have a look at this code
On the specific topic of the conversion calcualtion, refer to a recent thread in the Help section as Daniel is fixing for DW rel 5.8 a current inconsistency in the UOM conversion.
Luca
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hello Community,
I'm currently trying to create a dynamic simulation by familiarizing myself with simple process simulations.
I can plot simple values like Temperature, Pressure and Massflow, because Daniel referenced them in various examples on the infosite.
When it comes to parameters like phase count of a fluid, concentration of a certain compound in the gaseous phase or the removed heat of a cooling block I run into the problem of not knowing the specific description I have to use in my scripts to get the results I want to plot on my graph.
Is there some way of finding the correct wording I need, like a online database or a bigger list of examples?
As an example. If I try to get the molar fraction of water in the vapour phase in a Liquid-Vapor-Mixture, how do I achieve it? Is this the right basic approach?
Thanks in advance.
Last edit: Patrick Veiltl 2019-09-24
Hi Patrick,
One basic way to see the available parameters for example in one stream is to list object properties through the command dir().
Example:
or for components composition
you can use either GetPhase('Liquid') or GetPhase('Vapor') to retrieve the parameters in the single phases.
Hope this helps.
Luca
You can also set a breaking point on your script code and run the script in debug mode (third 'play' button on the toolbar). This will give you a list of all variables and their properties as the code runner stops at the breaking point location.
Last edit: Daniel Medeiros 2019-09-24
Also, when clicking on a property item with the right mouse button you'll have access to the API help and source code location for that property:
Thanks a lot Luca and Daniel, your solutions really helped me get a lot further.
Daniel, as I understand your response, the debug mode is only availible in DWSIM and not in New UI right. I have solely been working on New UI, so I have some open questions.
The window "Variables" only appears shortly after I press "debug" and doesn't stay open, how do I access it?
Building on Lucas answer, about displaying the attributes of MassFlows, I need to ask how to open the list of attributes of Flowsheet Objects like Reactors, Heaters and Compressors.
Thank you again guys.
Well, the scheme is pretty the same as for the material streams, i.e.
However sometime, to retrieve useful parameters you need dig into the properties of subobjects but to understand in which and where, you need to go through the source code, as Daniel mentioned, to see where they calculated and stored.
As an example, for a cstr if you want to have information regarding the reaction kinetics you should have in your script something like
Hope this helps.
Luca
Yes this definetly helps, thank you Luca!
My project does indeed include accessing and tweaking reaction parameters, especially the "Conversion Expression" of some main chemical reactions .
Does the scheme you wrote translate to a Conversion Reactor and can I directly change the expressions in my dynamic simulation?
Patrick,
Maybe inspecting the conversion reactor calculate routine will give you some insights:
https://github.com/DanWBR/dwsim5/blob/windows/DWSIM.UnitOperations/Reactors/Conversion.vb#L116
In principle yes, you could access the reaction(s) kinetic parameters through a script and 'dynamically' change them.
For an first outlook on how the parameters are handled inside DWSim and how you can access them , have a look at this code
https://github.com/DanWBR/dwsim5/blob/windows/DWSIM.UnitOperations/Reactors/CSTR.vb#L126
On the specific topic of the conversion calcualtion, refer to a recent thread in the Help section as Daniel is fixing for DW rel 5.8 a current inconsistency in the UOM conversion.
Luca
Ok, I will certainly take a look at it. Thank you both a lot for your support.