From be7c3263f09a7d2db4b551f9c151ad14ec41ad60 Mon Sep 17 00:00:00 2001 From: HOS Date: Wed, 20 Mar 2024 09:39:28 +0100 Subject: [PATCH] ManyMoreGibbsEtc --- Modelica/Media/R134a.mo | 4 ++-- Modelica/Media/package.mo | 24 ++++++++++++------------ 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/Modelica/Media/R134a.mo b/Modelica/Media/R134a.mo index 99dfe8e7b5..59818e03cb 100644 --- a/Modelica/Media/R134a.mo +++ b/Modelica/Media/R134a.mo @@ -1591,9 +1591,9 @@ Proceedings of the Joint Meeting of IIR Commissions B1, B2, E1, and E2, Padua, I // assert(getPhase_ph(state.p, state.h)==1, "Function for velocity of sound is only valid for one-phase regime!"); else f := f_R134a(state.d, state.T); - a := abs(R134aData.data.R_s*state.T*(2*f.delta*f.fdelta + f.delta*f.delta + a := sqrt(abs(R134aData.data.R_s*state.T*(2*f.delta*f.fdelta + f.delta*f.delta *f.fdeltadelta - ((f.delta*f.fdelta - f.delta*f.tau*f.fdeltatau)*(f.delta - *f.fdelta - f.delta*f.tau*f.fdeltatau))/(f.tau*f.tau*f.ftautau)))^0.5; + *f.fdelta - f.delta*f.tau*f.fdeltatau))/(f.tau*f.tau*f.ftautau)))); end if; annotation (Documentation(info="

This function calculates the velocity of sound of R134a from the state record (e.g., use setState_phX function for input). The velocity of sound is modelled by the fundamental equation of state of Tillner-Roth and Baehr (1994).

diff --git a/Modelica/Media/package.mo b/Modelica/Media/package.mo index 0b4c320d43..133167c944 100644 --- a/Modelica/Media/package.mo +++ b/Modelica/Media/package.mo @@ -7398,8 +7398,8 @@ critical pressure. pro.cp := -pro.R_s*g.tau*g.tau*g.gtautau; pro.cv := pro.R_s*(-g.tau*g.tau*g.gtautau + (g.gpi - g.tau*g.gtaupi)*(g.gpi - g.tau*g.gtaupi)/(g.gpipi)); - pro.a := abs(g.R_s*g.T*(g.gpi*g.gpi/((g.gpi - g.tau*g.gtaupi)*(g.gpi - g.tau - *g.gtaupi)/(g.tau*g.tau*g.gtautau) - g.gpipi)))^0.5; + pro.a := sqrt(abs(g.R_s*g.T*(g.gpi*g.gpi/((g.gpi - g.tau*g.gtaupi)*(g.gpi - g.tau + *g.gtaupi)/(g.tau*g.tau*g.gtautau) - g.gpipi)))); vt := g.R_s/g.p*(g.pi*g.gpi - g.tau*g.pi*g.gtaupi); vp := g.R_s*g.T/(g.p*g.p)*g.pi*g.pi*g.gpipi; pro.kappa := -1/(pro.d*g.p)*pro.cp/(vp*pro.cp + vt*vt*g.T); @@ -7461,8 +7461,8 @@ critical pressure. vp := g.R_s*g.T/(g.p*g.p)*g.pi*g.pi*g.gpipi; pro.kappa := -1/((g.p/(pro.R_s*g.T*g.pi*g.gpi))*g.p)*pro.cp/(vp*pro.cp + vt *vt*g.T); - pro.a := abs(g.R_s*g.T*(g.gpi*g.gpi/((g.gpi - g.tau*g.gtaupi)*(g.gpi - g.tau - *g.gtaupi)/(g.tau*g.tau*g.gtautau) - g.gpipi)))^0.5; + pro.a := sqrt(abs(g.R_s*g.T*(g.gpi*g.gpi/((g.gpi - g.tau*g.gtaupi)*(g.gpi - g.tau + *g.gtaupi)/(g.tau*g.tau*g.gtautau) - g.gpipi)))); d := g.p/(pro.R_s*g.T*g.pi*g.gpi); pro.dudT := (pro.p - g.T*vt/vp)/(d*d); @@ -7492,8 +7492,8 @@ critical pressure. vt := g.R_s/g.p*(g.pi*g.gpi - g.tau*g.pi*g.gtaupi); vp := g.R_s*g.T/(g.p*g.p)*g.pi*g.pi*g.gpipi; pro.kappa := -1/(pro.d*g.p)*pro.cp/(vp*pro.cp + vt*vt*g.T); - pro.a := abs(g.R_s*g.T*(g.gpi*g.gpi/((g.gpi - g.tau*g.gtaupi)*(g.gpi - g.tau - *g.gtaupi)/(g.tau*g.tau*g.gtautau) - g.gpipi)))^0.5; + pro.a := sqrt(abs(g.R_s*g.T*(g.gpi*g.gpi/((g.gpi - g.tau*g.gtaupi)*(g.gpi - g.tau + *g.gtaupi)/(g.tau*g.tau*g.gtautau) - g.gpipi)))); pro.ddpT := -(pro.d*pro.d)*vp; pro.ddTp := -(pro.d*pro.d)*vt; pro.duTp := pro.cp - g.p*vt; @@ -7530,9 +7530,9 @@ critical pressure. pro.cv := f.R_s*(-f.tau*f.tau*f.ftautau); pro.kappa := 1/(f.d*f.R_s*f.d*f.T*f.delta*f.fdelta)*((-pv*pro.cv + pt*pt*f.T) /(pro.cv)); - pro.a := abs(f.R_s*f.T*(2*f.delta*f.fdelta + f.delta*f.delta*f.fdeltadelta + pro.a := sqrt(abs(f.R_s*f.T*(2*f.delta*f.fdelta + f.delta*f.delta*f.fdeltadelta - ((f.delta*f.fdelta - f.delta*f.tau*f.fdeltatau)*(f.delta*f.fdelta - - f.delta*f.tau*f.fdeltatau))/(f.tau*f.tau*f.ftautau)))^0.5; + f.delta*f.tau*f.fdeltatau))/(f.tau*f.tau*f.ftautau)))); pro.ddph := (f.d*(pro.cv*f.d + pt))/(f.d*f.d*pd*pro.cv + f.T*pt*pt); pro.ddhp := -f.d*f.d*pt/(f.d*f.d*pd*pro.cv + f.T*pt*pt); pro.duph := -1/pro.d + p/(pro.d*pro.d)*pro.ddph; @@ -7575,9 +7575,9 @@ critical pressure. pro.cv := f.R_s*(-f.tau*f.tau*f.ftautau); pro.kappa := 1/(f.d*f.R_s*f.d*f.T*f.delta*f.fdelta)*((-pv*pro.cv + pt*pt*f.T) /(pro.cv)); - pro.a := abs(f.R_s*f.T*(2*f.delta*f.fdelta + f.delta*f.delta*f.fdeltadelta + pro.a := sqrt(abs(f.R_s*f.T*(2*f.delta*f.fdelta + f.delta*f.delta*f.fdeltadelta - ((f.delta*f.fdelta - f.delta*f.tau*f.fdeltatau)*(f.delta*f.fdelta - - f.delta*f.tau*f.fdeltatau))/(f.tau*f.tau*f.ftautau)))^0.5; + f.delta*f.tau*f.fdeltatau))/(f.tau*f.tau*f.ftautau)))); pro.ddTp := -pt/pd; pro.ddpT := 1/pd; //problem with units in last two lines @@ -7609,9 +7609,9 @@ critical pressure. *f.fdeltatau)^2/(2*f.delta*f.fdelta + f.delta*f.delta*f.fdeltadelta)); pro.cv := f.R_s*(-f.tau*f.tau*f.ftautau); pro.kappa := 1/(f.d*pro.p)*((-pv*pro.cv + pt*pt*f.T)/(pro.cv)); - pro.a := abs(f.R_s*f.T*(2*f.delta*f.fdelta + f.delta*f.delta*f.fdeltadelta + pro.a := sqrt(abs(f.R_s*f.T*(2*f.delta*f.fdelta + f.delta*f.delta*f.fdeltadelta - ((f.delta*f.fdelta - f.delta*f.tau*f.fdeltatau)*(f.delta*f.fdelta - - f.delta*f.tau*f.fdeltatau))/(f.tau*f.tau*f.ftautau)))^0.5; + f.delta*f.tau*f.fdeltatau))/(f.tau*f.tau*f.ftautau)))); pro.dudT := (pro.p - f.T*pt)/(f.d*f.d); end helmholtzToProps_dT;