How can I know what is the density of the Medium of StandardWater
used in Modelica? With which function can I directly specify the density of the StandardWater
?
First, instantiate the medium package in your model, e.g.
package Medium = Modelica.Media.Water.StandardWater;
Then, create a thermodynamic state, given e.g. pressure/temperature or pressure/enthalpy;
Medium.ThermodynamicState state = Medium.setState_pT(p=2e5, T=80+273.15);
And, finally, look up the density with the state
Medium.Density rho = Medium.density(state);