Message Boards Message Boards

GROUPS:

Calculate the entropy of saturated vapor?

Posted 8 months ago
922 Views
|
3 Replies
|
1 Total Likes
|

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]]
3 Replies
Posted 8 months ago

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}]]

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.

Posted 8 months ago

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.

Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract