This function calculates the entropy of saturated vapor by taking the limit as the pressure approaches the saturation pressure from below.
However, sSatVapor[0.85] returns Limit[obj$3516393[m], m → 1, Direction → 1].
Thanks.
sSatVapor[t_] := Module[{psat, obj},
psat = ThermodynamicData["CarbonDioxide",
"LiquidVaporPhaseBoundary", {"Temperature" ->
Quantity[t, "DegreesCelsius"]}];
obj[\[Mu]_?NumericQ] :=
QuantityMagnitude[
ThermodynamicData["CarbonDioxide",
"Entropy", {"Temperature" -> Quantity[t, "DegreesCelsius"],
"Pressure" -> \[Mu]*psat}]];
Limit[obj[m], m -> 1, Direction -> 1]]
The corresponding function for the saturated liquid entropy without using the Limit function seems to work fine.
sSatLiquid[t_] := Module[{psat},
psat = ThermodynamicData["CarbonDioxide",
"LiquidVaporPhaseBoundary", {"Temperature" ->
Quantity[t, "DegreesCelsius"]}];
ThermodynamicData["CarbonDioxide",
"Entropy", {"Temperature" -> Quantity[t, "DegreesCelsius"],
"Pressure" -> 1.0001 psat}]]
mroge02
(Michael Rogers)
3
Limit[] is a symbolic limit-solver. You probably need a numerical one, NLimit in the "NumericalCalculus`" package.
Needs["NumericalCalculus`"]
sSatVapor[t_] :=
Module[{psat, obj},
psat = ThermodynamicData["CarbonDioxide",
"LiquidVaporPhaseBoundary", {"Temperature" ->
Quantity[t, "DegreesCelsius"]}];
obj[\[Mu]_?NumericQ] :=
QuantityMagnitude[
ThermodynamicData["CarbonDioxide",
"Entropy", {"Temperature" -> Quantity[t, "DegreesCelsius"],
"Pressure" -> \[Mu]*psat}]];
NLimit[obj[m], m -> 1, Direction -> 1]]
sSatVapor[10.]
(* 1784.7 *)
But I’m not sure why you cannot simply plug m = 1 directly into ThermodynamicData. It seems to work and returns 1784.68 for t == 10.
Thanks! NLimit is the answer. (Heel of palm to forehead)
I believe m=1 would work for saturated vapor, but what about saturated liquid?
Thanks again.