Skip to content

Initialize all IF97 saturation boundary properties - #4860

Open
hechuan9 wants to merge 1 commit into
modelica:masterfrom
hechuan9:fix/if97-boundary-properties
Open

hechuan9 wants to merge 1 commit into
modelica:masterfrom
hechuan9:fix/if97-boundary-properties

Conversation

@hechuan9

@hechuan9 hechuan9 commented Nov 5, 2026

Copy link
Copy Markdown

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

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Issue with uninitialized record fields

2 participants