Hi, I am trying to use the Script Manager to create a kinetic reaction for a methanol synthesis. The corresponding file is attached below. If I want to solve the Flowsheet DWSIm throws an EOF and ode solver error. Now im wondering if I am using the right syntax. More specific, do I just have to use the variables Ri and Pi or do I have to import respectively calculate the partial pressure myself. Because If I am simulating the reaction via the rate expressions it works perfectly fine.
Could anyone help me? I attached my DWSIM model below.
Thanks in advance.
Lukas
you get a EOF error because your equation for r has some missing brackets.
In your scripts you don't need to import Ri and Pi from the inlet stream as the partial pressures are directly passed, so use in the equations T, P, R1, R2 ... P1 P2.
I run the model, but after quite long it failed ... so a closer look to the script expressions is needed.
Hope it helps.
Luca
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hello Luca!
Could you please help me with similar issue?
I am using Lukas's script as a basis to learn how to use DWSIM, and I am encountering issue with naming of variables. DWSIM states that T, or, i presume, P1,P2... are not defined.
Please see the file attached.
P.S. That is when I am running debugger, otherwise everything seems to run smoothly.
You can't run this script in debug mode because the variables are set by the reactor when it is being calculated. You can always use print() or Flowsheet.WriteMessage() to display something in the Log Panel.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi, I am trying to use the Script Manager to create a kinetic reaction for a methanol synthesis. The corresponding file is attached below. If I want to solve the Flowsheet DWSIm throws an EOF and ode solver error. Now im wondering if I am using the right syntax. More specific, do I just have to use the variables Ri and Pi or do I have to import respectively calculate the partial pressure myself. Because If I am simulating the reaction via the rate expressions it works perfectly fine.
Could anyone help me? I attached my DWSIM model below.
Thanks in advance.
Lukas
Hi Lukas,
you get a EOF error because your equation for r has some missing brackets.
In your scripts you don't need to import Ri and Pi from the inlet stream as the partial pressures are directly passed, so use in the equations T, P, R1, R2 ... P1 P2.
I run the model, but after quite long it failed ... so a closer look to the script expressions is needed.
Hope it helps.
Luca
Hello Luca!
Could you please help me with similar issue?
I am using Lukas's script as a basis to learn how to use DWSIM, and I am encountering issue with naming of variables. DWSIM states that T, or, i presume, P1,P2... are not defined.
Please see the file attached.
P.S. That is when I am running debugger, otherwise everything seems to run smoothly.
Last edit: Mykhailo Vilboi 2022-12-25
Mykhailo,
I am experiencing the same trouble.
Did you figure out a different way to access reactor variables?
Thanks
You can't run this script in debug mode because the variables are set by the reactor when it is being calculated. You can always use print() or Flowsheet.WriteMessage() to display something in the Log Panel.
Thank you so much Daniel. I was stuck on this for a long time.
For what it's worth, the print functio doesnt work for me but the Flowsheet.WriteMessage(str(var)) does.
Thanks a lot Luca! The flowsheet was solved even faster as with the rate expressions. Altough I'm not geeting excactly the same results.