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

Pressure changer initialization guesses #1556

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

alma-walmsley
Copy link

Fixes # .

Summary/Motivation:

The pressure changer initialization routine does not use the normal control volume initialization routine. I assume this is because it needs to take into account ratioP for its outlet pressure guess? See d15028f.

The pressure changer initialization differs in that it sets up guesses for the outlet state before the inlet state is initialized. This means if the values of the inlet state vars were to change during the inlet initialization, the guesses for the outlet state are now incorrect. (The control volume initialization does not have this problem since it estimates the outlet state after inlet state initialization).

This occurs for me since I am setting constraints to "define" the state variables. The inlet guess may well be the default value, and change during initialization to conform to a constraint. Which is fine, except that the same (stale) inlet guess is used when initializing the outlet state block, and it may be fixed there... leading to problems in later stages of initialization.

Instead, the outlet guesses should be created from the inlet state after the inlet state is initialized.

Changes proposed in this PR:

  • Move setting guesses in state_args_out to after the properties_in initialization
  • Load guesses directly from the current inlet properties (taking into account deltaP/ratioP) - instead of using the guesses that were used previously.
  • Apply the same logic to both init_isentropic and init_adiabatic

Legal Acknowledgement

By contributing to this software project, I agree to the following terms and conditions for my contribution:

  1. I agree my contributions are submitted under the license terms described in the LICENSE.txt file at the top level of this directory.
  2. I represent I am authorized to make the contributions and grant the license. If my employer has rights to intellectual property that includes these contributions, I represent that I have received permission to make contributions and grant the required license on behalf of that employer.

@alma-walmsley
Copy link
Author

alma-walmsley commented Jan 1, 2025

I realise after writing up this PR it may be easier (and more maintainable?) to revert back to using the normal control volume initialization. I think the control volume initialization would just need to be modified to take into account ratioP when estimating the outlet state...?

Some logic would still need to be kept for the properties_isentropic guesses.

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

Successfully merging this pull request may close these issues.

1 participant