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

Specification block not updated / solved #395

Closed
andr1976 opened this issue Dec 5, 2022 · 14 comments
Closed

Specification block not updated / solved #395

andr1976 opened this issue Dec 5, 2022 · 14 comments
Labels
enhancement New feature or request not a bug This is not a bug

Comments

@andr1976
Copy link
Contributor

andr1976 commented Dec 5, 2022

Describe the bug
When using specification block, these are not (always) updated with the solver. Some are , some are not

Expected behavior
All specification blocks should update when solver is invoked

Screenshots
image

Desktop (please complete the following information):

  • OS: [e.g. Windows,
  • Version [e.g. v8.32]

See attached file
Hydrogen_density.zip

@andr1976 andr1976 added the bug Something isn't working label Dec 5, 2022
@DanWBR
Copy link
Owner

DanWBR commented Dec 5, 2022

@andr1976 the spec is a hack. It is triggered after the source object is calculated. The final result will depend on the calculation order and how the specs are connected. I do not recommend using specs (I don't do it).

@DanWBR DanWBR added not a bug This is not a bug and removed bug Something isn't working labels Dec 5, 2022
@andr1976
Copy link
Contributor Author

andr1976 commented Dec 5, 2022

Uhh, what a shame - I find this the only simple way of avoiding too many independent specs in a flowsheet

@andr1976
Copy link
Contributor Author

andr1976 commented Dec 5, 2022

I still think this is a bug since the behaviour is unpredictable and not as expected - with a specifier you actually expect the specification to be set after the solver has been called, but this is not always the case apparently.

@DanWBR
Copy link
Owner

DanWBR commented Dec 5, 2022

I still think this is a bug since the behaviour is unpredictable and not as expected - with a specifier you actually expect the specification to be set after the solver has been called, but this is not always the case apparently.

It depends. When I had the idea to add the spec, I thought that the user would want to set a property of an object far away and ahead of the source in a well-defined flowsheet but, of course, people are using the spec for everything you can imagine. Your sample is a total hack and unexpected use case, but I understand what you want to do.

Again, python scripts are perfectly suited for what you want but I also understand that you don't want to use them. 🙂

@DanWBR
Copy link
Owner

DanWBR commented Dec 5, 2022

a script triggered after "1" finishes calculating would do the trick:

ms1 = Flowsheet.GetObject("1")
ms2 = Flowsheet.GetObject("2") 
ms3 = Flowsheet.GetObject("3") 
ms4 = Flowsheet.GetObject("4") 
ms5 = Flowsheet.GetObject("5") 

P = ms1.GetPressure()

ms2.SetPressure(P)
ms3.SetPressure(P)
ms4.SetPressure(P)
ms5.SetPressure(P)

@andr1976
Copy link
Contributor Author

andr1976 commented Dec 5, 2022

Ok I get your point, believe me I do want to use Python scripting :-)

@DanWBR DanWBR added the enhancement New feature or request label Dec 13, 2022
DanWBR added a commit that referenced this issue Dec 13, 2022
@DanWBR DanWBR changed the title [Bug] Specification block not updated / solved Specification block not updated / solved Dec 13, 2022
@DanWBR
Copy link
Owner

DanWBR commented Dec 13, 2022

@andr1976 I've added a new field to flowsheet settings, it should suit your needs.

Captura de Tela 2022-12-13 às 12 19 15

@andr1976
Copy link
Contributor Author

Wuhuuu, thats just awesome Daniel :-)

@andr1976
Copy link
Contributor Author

Now I am just being greedy here, could something similar be applied to the spreadsheet, that any imported/exported properties are updated after the solver finishes, before a final solver run to ensure everything has been updated? I know this is a separate topic.

@DanWBR
Copy link
Owner

DanWBR commented Dec 14, 2022

Now I am just being greedy here, could something similar be applied to the spreadsheet, that any imported/exported properties are updated after the solver finishes, before a final solver run to ensure everything has been updated? I know this is a separate topic.

@andr1976 maybe, if you reconsider your recent patreon decision... 🧐 👀 you know I have a lot of DWSIM and non-DWSIM stuff to do.

@andr1976
Copy link
Contributor Author

Or maybe just consider moving to DK and come work with me - we will do great things my friend, my ramblings and your ingenuity :-)

@DanWBR
Copy link
Owner

DanWBR commented Dec 14, 2022

Or maybe just consider moving to DK and come work with me - we will do great things my friend, my ramblings and your ingenuity :-)

@andr1976 pay me 10K €/month and I'll be there ✈️🚀

@andr1976
Copy link
Contributor Author

I don't see that option on Patreon, ah haha - maybe DM is better if we should continue this conversation :-)

@DanWBR
Copy link
Owner

DanWBR commented Dec 15, 2022

I don't see that option on Patreon, ah haha - maybe DM is better if we should continue this conversation :-)

@andr1976 just kidding. I'll see what I can do about th spreadsheet 😄👍🏻

@DanWBR DanWBR closed this as completed Dec 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request not a bug This is not a bug
Projects
None yet
Development

No branches or pull requests

2 participants