ThermofluidStream
ThermofluidStream copied to clipboard
Ideal gas check
ThermofluidStream.Processes.Compressor, ThermofluidStream.Processes.Fan and ThermofluidStream.Processes.Turbine checks if ideal gas law is applicable using:
Real R_in(unit="J/(kg.K)") = p_in/Medium.temperature(inlet.state)/Medium.density(inlet.state);
Real R_out(unit="J/(kg.K)") = p_out/Medium.temperature(outlet.state)/Medium.density(outlet.state);
equation
// test for ideal gas
assert(abs(R_in- R_in)/R_in < max_rel_R, "Medium in compressor is assumed to be ideal gas, but check failed", dropOfCommons.assertionLevel);
- It should probably be
abs(R_out- R_in)/R_in < max_rel_Rinstead ofabs(R_in- R_in)/R_in < max_rel_R - We should rather base that check on compressibility factor, i.e. something like
Z_in = (p*v/(R*T))_in;
Z_out = (p*v/(R*T))_out;
assert(abs(Z_in-1) < error_IdealGas_max);
assert(abs(Z_out-1) < error_IdealGas_max);