This function computes the specific entropy.
The specific entropy of the mixture is obtained from
s = ss + sm,
where ss is the entropy change due to the state change (relative to the reference temperature) and sm is the entropy change due to mixing of the dry air and water vapor.
The entropy change due to change in state is obtained from
ss = cv ln(T/T0) + R ln(v/v0)
= cv ln(T/T0) + R ln(ρ0/ρ)
If we assume ρ = p0/(R T), and because cp = cv + R, we can write
ss = cv ln(T/T0) + R ln(T/T0)
=cp ln(T/T0).
Next, the entropy of mixing is obtained from a reversible isothermal expansion process. Hence,
sm = -R ∑i( Xi ⁄ Mi ln(Yi p/p0)),
where R is the gas constant, X is the mass fraction, M is the molar mass, and Y is the mole fraction.
To obtain the state for a given pressure, entropy and mass fraction, use IDEAS.Media.Air.setState_psX.
This function is only valid for a relative humidity below 100%.