Skip to content

Fix the derivatives of the density of supersaturated moist air - #4836

Open
henrikt-ma wants to merge 2 commits into
modelica:masterfrom
henrikt-ma:moist-air-density-derivative
Open

henrikt-ma wants to merge 2 commits into
modelica:masterfrom
henrikt-ma:moist-air-density-derivative

Conversation

@henrikt-ma

Copy link
Copy Markdown
Contributor

rho_pTX_der did not match rho_pTX for supersaturated moist air, where it was off by up to 60 % in the temperature direction:

  • The dry air density derivative was evaluated at the total pressure and its derivative, instead of the partial pressure of the dry air.
  • Below 273.16 K, the vapor density was missing from the gas density, and its derivative was instead added to the derivative of the specific volume.
  • xws_pT_der lacked the term for the pressure derivative of the saturation humidity ratio.

The derivatives now agree with finite differences of rho_pTX.

@MatthiasBSchaefer: Note that unlike many other recently opened PRs addressing unit inconsistencies, this PR changes values. It makes it a good test case for CI testing of a PR, and if needed we should also re-generate reference results to avoid that tests break when this is merged.

@henrikt-ma henrikt-ma added the L: Media Issue addresses Modelica.Media label Oct 19, 2026
@beutlich
beutlich force-pushed the moist-air-density-derivative branch from 55d92a3 to a90d352 Compare October 20, 2026 20:27
rho_pTX_der did not match rho_pTX for supersaturated moist air, where it
was off by up to 60 % in the temperature direction:

- The dry air density derivative was evaluated at the total pressure
  and its derivative, instead of the partial pressure of the dry air.
- Below 273.16 K, the vapor density was missing from the gas density,
  and its derivative was instead added to the derivative of the specific
  volume.
- xws_pT_der lacked the term for the pressure derivative of the
  saturation humidity ratio.

The derivatives now agree with finite differences of rho_pTX.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@beutlich
beutlich force-pushed the moist-air-density-derivative branch from a90d352 to bf83bc7 Compare October 20, 2026 20:40

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.

2 participants