For a project, I have to control DWSIM through Python to perform optimization. In order to compute the objective function, I have to simulate a process (an organic Rankine cycle with a recuperator with two recycles) for every hour of year (so 8760 points) and as you can see on the attached picture, it takes 4 to 5 seconds (it can even go to 7-8) so it will take few hours (roughly between 10h to 20h) to compute a year. As it is an optimization, the objective function will be called many times.
I wanted to know how I can speed up the convergence of the flowsheet ? I saw on DWSIM a checkbox called parallel, but I didn't see the difference in time with and without it.
And how to know if the solver (through Python) is in parallel mode with that command: Settings.SolverMode = 0 (with a special value instead of 0 ?) ?
My last question is about solving multiple flowsheets. Is it possible to solve multiple flowsheet with the same Python script (by giving different names with flowsheet_name = interf.LoadFlowsheet(path)) ?
DWSIM is not yet ready for efficient parallel flowsheet solving, it will come in a future release. For now you will need to create multiple automation instances so each flowsheet runs in a separate memory space.
Regards,
Daniel
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
running flowsheets in parallel can be done using our Multivariate Sensitivity Study (MSS).
It works for DWSIM open-source and DWSIM Pro flowsheets, and it is free to use.
We have 2 "small" agents ready for your test. Once you are ready to run the study, drop us a line at https://simulate365.com/private-support/ , and we will switch to more agents and faster virtual machines.
I have another question that I found while playing with the DWSIM Python API. I found that when I comment the following line the code is much faster (like 5s to 2.5s), is it something that you could recommend ?
errors = b.CalculateFlowsheet2(flowsheet)
Thank you in advance and have a good day,
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hello,
For a project, I have to control DWSIM through Python to perform optimization. In order to compute the objective function, I have to simulate a process (an organic Rankine cycle with a recuperator with two recycles) for every hour of year (so 8760 points) and as you can see on the attached picture, it takes 4 to 5 seconds (it can even go to 7-8) so it will take few hours (roughly between 10h to 20h) to compute a year. As it is an optimization, the objective function will be called many times.
I wanted to know how I can speed up the convergence of the flowsheet ? I saw on DWSIM a checkbox called parallel, but I didn't see the difference in time with and without it.
And how to know if the solver (through Python) is in parallel mode with that command: Settings.SolverMode = 0 (with a special value instead of 0 ?) ?
My last question is about solving multiple flowsheets. Is it possible to solve multiple flowsheet with the same Python script (by giving different names with flowsheet_name = interf.LoadFlowsheet(path)) ?
Thank you in advance and have a good day,
Last edit: Hugo Brunner 2025-03-12
Hi Hugo,
DWSIM is not yet ready for efficient parallel flowsheet solving, it will come in a future release. For now you will need to create multiple automation instances so each flowsheet runs in a separate memory space.
Regards,
Daniel
Thank you a lot for your answer.
Hi Hugo,
running flowsheets in parallel can be done using our Multivariate Sensitivity Study (MSS).
It works for DWSIM open-source and DWSIM Pro flowsheets, and it is free to use.
We have 2 "small" agents ready for your test. Once you are ready to run the study, drop us a line at https://simulate365.com/private-support/ , and we will switch to more agents and faster virtual machines.
You find our MSS here: https://simulate365.com/mss
Best,
Armin
Last edit: Simulate 365 2025-03-27
Hello Daniel,
I have another question that I found while playing with the DWSIM Python API. I found that when I comment the following line the code is much faster (like 5s to 2.5s), is it something that you could recommend ?
errors = b.CalculateFlowsheet2(flowsheet)
Thank you in advance and have a good day,