Message Boards Message Boards

0
|
7691 Views
|
3 Replies
|
1 Total Likes
View groups...
Share
Share this post:

Calculate the entropy of saturated vapor?

Posted 6 years ago

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]]
POSTED BY: Glenn Carlson
3 Replies
Posted 6 years 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.

POSTED BY: Glenn Carlson

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 BY: Michael Rogers
Posted 6 years 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}]]
POSTED BY: Glenn Carlson
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