DLR-SR / ThermofluidStream

The DLR Thermofluid Stream Library
BSD 3-Clause "New" or "Revised" License
65 stars 27 forks source link

Medium PartialSimpleMedium and TransportDelay model #210

Open FrancNep opened 3 months ago

FrancNep commented 3 months ago

Hi,

In the model Processes.TransportDelay, the final equation h_out = u_out + p_out v_out is not true for the PartialSimpleMedium Interface (Ex : SimpleLiquiWater and ...) . The outlet state is evaluated using h_out and propagate an error on the the outlet temperature due to the term p_out v_out.

I think the best way to resolve this problem will be to use a function of the Medium package or the model BaseProperties .

u_out=Medium.specificInternalEnergy(Medium.setState_phX(p_out, h_out, Xi_out));

Or

Medium.BaseProperties medium_out;

And then medium_out.p=p_out; medium_out.Xi=Xi_out; medium_out.u=u_out; medium_out.u=h_out;

An other possibility will be to use a delay directly on the specific enthalpy and not on the specific internal energy. But is this true for a compressible fluid?

What is your feeling ?

Best regards,

François

RaphaelGebhart commented 1 month ago

Yes we might consider using a different approach, i didnt build the model, so i have no idea why they picked internal energy.

However h = u + p*v is the definition of specific enthalpy, and i wouldn't recommond neglecting p*v like PartialSimpleMedium does, and therefor i actually wouldn't recommend using PartialSimpleMedium. This will always yield errors, it just seems like people dont care about it most of the time, e.g. assuming a flow resistance to be isenthalpic (no heat flow, no work) h_in = h_out, yields for PartialSimpleMedium u_in = u_out, which yields T_in = T_out, which yields s_in = s_out, which is not what you would expect for the obviously irreversible process of a flow resistance. For the same reason one can not consider entropy to calculate the outlet state for PartialSimpleMedium, e.g. one can not use h_out = specificEnthalpy_psX(p_out, s_in, X) to calculate the outlet specific enthalpy for an ideal compressor/turbine/pump for PartialSimpleMedium, however for all other media this works, which is another example which shows that PartialSimpleMedium is not useful in my opinion.