Skip to content

Initialize all IF97 saturation boundary properties - #4860

Open
hechuan9 wants to merge 4 commits into
modelica:masterfrom
hechuan9:fix/if97-boundary-properties
Open

hechuan9 wants to merge 4 commits into
modelica:masterfrom
hechuan9:fix/if97-boundary-properties

Conversation

@hechuan9

@hechuan9 hechuan9 commented Nov 5, 2026

Copy link
Copy Markdown
Contributor

The IF97 boiling/dew boundary functions return records with missing fields: the Gibbs branch does not assign cv, while the region 3 Helmholtz branch does not assign cp, vt, or vp. A compiler enforcing assigned outputs rejects these calls even when a caller only needs another field.

This fills the missing properties using the existing Gibbs heat-capacity expression and the thermodynamic identities cp-cv = T*pt^2/(d^2*pd), vt = pt/(d^2*pd), and vp = -1/(d^2*pd). Previously assigned properties and the region selection are unchanged.

Adds ModelicaTest.Media.TestOnly.WaterIF97_boundaryProperties, covering both curves at 0.1, 10, 20 and 22 MPa. Heat capacities are compared to the existing Gibbs/Helmholtz boundary-property functions; volume derivatives are checked against the pressure derivatives.

Fixes #1910.

Validation on Linux at startTime=stopTime=0:

  • Rumoca 590ac739: the new test fails before the change with bpro__cv is used without a value; passes after the change.
  • OpenModelica 1.27.1: the new test initializes successfully and all assertions pass.
  • git diff --check passes.
  • No time-domain run or full library campaign was performed. Keeping this PR in draft pending CI/review.

Change size: 10 production lines and 42 test lines added in two files; no new public functions.

Signed-off-by: Chuan He <hechuan@climamind.ai>
@hechuan9
hechuan9 marked this pull request as ready for review November 5, 2026 15:26
@beutlich beutlich added the L: Media Issue addresses Modelica.Media label Nov 11, 2026
@hechuan9

Copy link
Copy Markdown
Contributor Author

A gentle follow-up on this fix for #1910. The current CI and CLA checks are passing. Would someone familiar with the IF97 functions be able to review the approach of computing the missing properties? Happy to adjust it based on your feedback. Thanks!

@maltelenz

Copy link
Copy Markdown
Contributor

@MatthiasBSchaefer The CI test run is throwing this error, can you have a look?

Error
Workflows are being blocked due to a scheduled brownout of the default pull_request_target protection for affected public repositories. This window ends at November 16, 2026 at 18:00:00 UTC. If you need these workflows to run, ask an administrator to explicitly allow pull_request_target in an applicable Actions event policy. See https://gh.io/securely-using-pull_request_target#default-policy-for-pull_request_target for guidance.

@MSL-RegressionTesting-CI MSL-RegressionTesting-CI added the ready_for_ci allow regression testing ci to run (if c-code changed or pull request from non-member) label Nov 17, 2026
@MatthiasBSchaefer

Copy link
Copy Markdown
Contributor

@MatthiasBSchaefer The CI test run is throwing this error, can you have a look?

Error
Workflows are being blocked due to a scheduled brownout of the default pull_request_target protection for affected public repositories. This window ends at November 16, 2026 at 18:00:00 UTC. If you need these workflows to run, ask an administrator to explicitly allow pull_request_target in an applicable Actions event policy. See https://gh.io/securely-using-pull_request_target#default-policy-for-pull_request_target for guidance.

Thanks for the hint,
I am aware of this issue and will introduce a policy to allow "pull request target" workflows for this specific case. Such a policy will become mandatory to run these kind of workflows on 2nd december.
For now, i simply restarted the workflow, since the brownout period is over.

@MSL-RegressionTesting-CI

Copy link
Copy Markdown

@MatthiasBSchaefer MatthiasBSchaefer removed the ready_for_ci allow regression testing ci to run (if c-code changed or pull request from non-member) label Nov 17, 2026
Signed-off-by: Chuan He <hechuan@climamind.ai>
@MSL-RegressionTesting-CI

Copy link
Copy Markdown

PR from non-member detected. Please check the changes and then add 'ready_for_ci' label to the pr and rerun the workflow

@MSL-RegressionTesting-CI

Copy link
Copy Markdown

PR from non-member detected. Please check the changes and then add 'ready_for_ci' label to the pr and rerun the workflow

@MatthiasBSchaefer MatthiasBSchaefer added the ready_for_ci allow regression testing ci to run (if c-code changed or pull request from non-member) label Nov 21, 2026
@MSL-RegressionTesting-CI

Copy link
Copy Markdown

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

L: Media Issue addresses Modelica.Media ready_for_ci allow regression testing ci to run (if c-code changed or pull request from non-member)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Issue with uninitialized record fields

5 participants