Skip to content

Correct T_pSX in moist air to avoid simulation error when size X is 1#303

Merged
RaphaelGebhart merged 1 commit into
DLR-SR:mainfrom
CorentinLepais:MoistAir_T_psX_simulationError
Apr 28, 2026
Merged

Correct T_pSX in moist air to avoid simulation error when size X is 1#303
RaphaelGebhart merged 1 commit into
DLR-SR:mainfrom
CorentinLepais:MoistAir_T_psX_simulationError

Conversation

@CorentinLepais
Copy link
Copy Markdown
Contributor

The current implementation of the function T_psX in Moist Air leads to a simulation error when using the function without providing the complete mass fraction X vector {X[Water],X[Air]}. The function has been updated to test the size of the input mass fraction vector X and re-calculate the mass fraction of air X[Air] if missing.

Closes #302

@CorentinLepais CorentinLepais added this to the next-MINOR-version milestone Apr 8, 2026
@CorentinLepais CorentinLepais self-assigned this Apr 8, 2026
@CorentinLepais
Copy link
Copy Markdown
Contributor Author

Regression tests ok

@CorentinLepais CorentinLepais requested a review from Nicsda April 8, 2026 18:21
@CorentinLepais CorentinLepais marked this pull request as ready for review April 8, 2026 18:21
@RaphaelGebhart RaphaelGebhart requested review from RaphaelGebhart and removed request for Nicsda April 28, 2026 06:03
@RaphaelGebhart
Copy link
Copy Markdown
Collaborator

@CorentinLepais Works perfect for me. Would you suggest to create also a pull request for the MSL?

Attached my test example, which could easily be adapted to the MSL.
MoistAirEntropy.txt

@RaphaelGebhart RaphaelGebhart merged commit a68a1f7 into DLR-SR:main Apr 28, 2026
4 checks passed
@CorentinLepais
Copy link
Copy Markdown
Contributor Author

I already created an issue in the MSL:Simulation error when using MoistAir.T_psX and described the problem and the solution but I did not create a pull request neither added a test example so if you want you can just update the issue with it

@RaphaelGebhart
Copy link
Copy Markdown
Collaborator

I already created an issue in the MSL:Simulation error when using MoistAir.T_psX and described the problem and the solution but I did not create a pull request neither added a test example so if you want you can just update the issue with it

Ok i created a pull request :)
modelica/ModelicaStandardLibrary#4781

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.

Simulation error when using MoistAir.T_psX

2 participants