ThermofluidStream icon indicating copy to clipboard operation
ThermofluidStream copied to clipboard

Ideal gas check

Open RaphaelGebhart opened this issue 1 year ago • 0 comments

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);
  1. It should probably be abs(R_out- R_in)/R_in < max_rel_R instead of abs(R_in- R_in)/R_in < max_rel_R
  2. 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);

RaphaelGebhart avatar Mar 15 '24 11:03 RaphaelGebhart