Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make permanent Custom Calculation Order #59

Closed
finardlu opened this issue Dec 8, 2020 · 9 comments
Closed

Make permanent Custom Calculation Order #59

finardlu opened this issue Dec 8, 2020 · 9 comments
Labels
enhancement New feature or request

Comments

@finardlu
Copy link

finardlu commented Dec 8, 2020

Model's calculation order can be modified by means of Ctrl+Alt Solve and reordering the calculation list.

The new order however is valid only for the current run and if I re-run the model I have again to access and reorder the calculation list.

In the attached model I tried running a script when the solver starts to load my calc order, and actually the modified calculation list is shown, but once displayed then the solver ignores it and continues...

It could be helpful to have the possibility to make permanent a custom calc order.

Luca Finardi
calcorder.zip

@AdrianDietz
Copy link

Hello Luca,

I agree with you that calculation order is part of the model, different calculation orders can lead to different results, while sometimes if used only for performance improvement.

Calculation order is important in both steady state and dynamic, specially in dynamics where the actions based on conditions that changes during the time can give completely different results, it is mainly the logic used in PLCs and DCSs that is usually represented in the PID not in the PFD (steady state).

Nevertheless, given that different options lead to different results, calculation order is part of the model and not just one of the possible options for the model. The software should be simple, straightforward while allowing to take into account all the possible situation. Nothing prevents you of having two separate model for each order, what in practice are.

With kind regards,

Adrian,

@finardlu
Copy link
Author

Hello Adrian,

thanks for your interesting comments.

I would add that even in steady state, there are circumstances where the right calculation order is what separates between a straightforward model solution and a slow unceratain convergence.
The identification of the best solution strategy is one of the value-added activities of the human part of the model building, providing the solver with a process meaningful solution sequence rather than leaving it to find a solution through basically a topological approach.

All commercial process simulators have the possibility to alter the default calculation order and DWSIM has too: what I pointed out is that DWSIM does not have the possibility to store somewhere this custom order thus forcing the user to enter it every run.

In order to have the option, as you suggested, to have the same model with different calculation orders, I'd propose DWSIM to store locally the custom calc-order and eventually to save it in the simulation file for further uses.

Kind regards.

Luca Finardi

@AdrianDietz
Copy link

Hello Luca,

We are both stating more or less the same facts, my concern is rather keeping the UI clean and the software of easy access to less skilled people, with no compromises in capabilities.
Some people is sometimes scared just at the compound selection, as they don't know how to do it properly (i.e. in Hysys EO) and the help does not always necessarily "helps".
My advise is, if implement, not something that appears to the eyes in the UI but rather something "advanced". The feature itself is rather "easy" to implement as it is only about saving data that currently is volatile between two sessions.
By the way this concept does not exist at all in the EO mode in chemical simulators.

Kind regards,

Adrian,

@DanWBR
Copy link
Owner

DanWBR commented Dec 15, 2020

Should the custom calculation order be persisted in the dwxmz file or will it be alive just during the current session?

@AdrianDietz
Copy link

Based in the current functionality the simplest way is just have it persistent, otherwise a more advanced thing would be what Luca asked for.
What would be nice to add is the possibility (possibility means option) of showing the calculation order in the flowsheet as a subscript number under each unit operation, this is really helpful to understand what you are really doing, the moving up and down in a list became a little abstract for large flowsheet.
WKR,
Adrian,

@AdrianDietz
Copy link

By the way, this is rather a question more than a statement, in the case the flowsheet has independent paths some operations are not impacted by the order in this case we could define the same "level" for two different UO, I did not investigated how parallelism is handled for UO.
i.e.
image

@finardlu
Copy link
Author

Should the custom calculation order be persisted in the dwxmz file or will it be alive just during the current session?

Ideally, once the user has modified the calculation order in the calculation order dialog, this should be maintained during the current session (but a reset button should be available to restore default).
Additionally the calculation order dialog should include an optional flag to save the calc-list in the simulation file.

Luca

@AdrianDietz
Copy link

I have the feeling that would be easier just to always save the calculation order, whether this is or not the default, and the button default to just come back if we messed up, but default is just default this means starting point, not a good/best/optimal solution.

@DanWBR
Copy link
Owner

DanWBR commented Dec 15, 2020

The calculation order is determined by the solver at the beginning of the procedure. @AdrianDietz for those parallel paths, DWSIM will determine the calculation order based on which object was added last to the flowsheet, then follow it's path backwards. It does that for all endpoint material streams. If you choose the background parallel threads solver, then those two paths will be solved in parallel, literally. It is not selected by default but really decreases the calculation times if you have such paths in your flowsheet.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants