Wolfram Research

Function Repository Resource:

EquationOfStateConstants (1.0.0) current version: 1.0.1 »

Source Notebook

Calculate the constants associated with an equation of state

Contributed by: Jan Mangaldan

ResourceFunction["EquationOfStateConstants"]["name","eos"]

gives the values of the constants associated with the equation of state "eos" for the chemical "name".

ResourceFunction["EquationOfStateConstants"][entity,"eos"]

gives the values of the constants for the given entity.

ResourceFunction["EquationOfStateConstants"][assoc,"eos"]

uses the association assoc to look up properties needed to compute the constants.

Details

An equation of state is a thermodynamic equation that relates state variables (e.g. pressure, volume and temperature) and describes the state of matter under a given set of physical conditions.
The following equations of state are supported:
"Berthelot"Berthelot equation
"Dieterici"Dieterici equation
"CarnahanStarling"Carnahan-Starling equation
"RedlichKwong"Redlich-Kwong equation
"VanDerWaals"van der Waals equation
In ResourceFunction["EquationOfStateConstants"][assoc,"eos"], assoc must be given as an association containing the following elements:
"CriticalPressure"critical pressure
"CriticalTemperature"critical temperature

Examples

Basic Examples (5) 

Get the van der Waals constants for argon:

In[1]:=
{a, b} = ResourceFunction["EquationOfStateConstants"][
  Entity["Element", "Argon"], "VanDerWaals"]
Out[1]=

Compare with the result of ChemicalData:

In[2]:=
ChemicalData[Entity["Element", "Argon"], EntityProperty["Chemical", "VanDerWaalsConstants"]] // UnitConvert
Out[2]=

Use the van der Waals constants to compute the pressure of argon, given a molar volume of 1 L/mol at a temperature of 1800 °C:

In[3]:=
FormulaData["VanDerWaalsEquation", Join[Thread[{"a", "b"} -> {a, b}], {QuantityVariable[
\!\(\*SubscriptBox[\("V"\), \("m"\)]\),"MolarVolume"] -> Quantity[1., ("Liters")/("Moles")], QuantityVariable["T","Temperature"] -> Quantity[1800., "DegreesCelsius"]}]]
Out[3]=

Compare with the result of using the ideal gas equation:

In[4]:=
FormulaData[{"IdealGasLaw", "Volume"}, {QuantityVariable["V","Volume"] -> Quantity[1., "Liters"], QuantityVariable["n","Amount"] -> Quantity[1., "Moles"], QuantityVariable["T","Temperature"] -> Quantity[1800., "DegreesCelsius"]}]
Out[4]=

Compare with the result of using ThermodynamicData:

In[5]:=
ThermodynamicData["Argon", "Pressure", {"Density" -> Entity["Element", "Argon"][
     EntityProperty["Element", "MolarMass"]]/(Quantity[1., (
      "Liters")/("Moles")]), "Temperature" -> Quantity[1800., "DegreesCelsius"]}]
Out[5]=

Scope (2) 

The Redlich–Kwong equation of state:

In[6]:=
FormulaData["RedlichKwongEquation"]
Out[6]=

Use the Redlich–Kwong equation to compute the molar volume of ethane at standard temperature and pressure:

In[7]:=
FormulaData["RedlichKwongEquation", Join[Thread[{"a", "b"} -> ResourceFunction["EquationOfStateConstants"]["Ethane", "RedlichKwong"]], {QuantityVariable["P","Pressure"] -> Quantity[1., "Bars"], QuantityVariable["T","Temperature"] -> Quantity[273.15, "Kelvins"]}]] // Last // Quiet
Out[7]=

Compare with the result of using the van der Waals equation:

In[8]:=
FormulaData["VanDerWaalsEquation", Join[Thread[{"a", "b"} -> ResourceFunction["EquationOfStateConstants"]["Ethane", "VanDerWaals"]], {QuantityVariable["P","Pressure"] -> Quantity[1., "Bars"], QuantityVariable["T","Temperature"] -> Quantity[273.15, "Kelvins"]}]] // Quiet
Out[8]=

Compute the constants for the Dieterici equation for Freon C-318 by supplying explicit values for the critical temperature and pressure:

In[9]:=
{a, b} = ResourceFunction[
  "EquationOfStateConstants"][<|
   "CriticalTemperature" -> Quantity[115.23, "DegreesCelsius"], "CriticalPressure" -> Quantity[2777., "Kilopascals"]|>, "Dieterici"]
Out[9]=

Use the constants to compute the pressure at -10 °C of C-318 with a molar volume of 500 mL/mol:

In[10]:=
UnitConvert[(Quantity[1, "MolarGasConstant"] T)/(Subscript[V, m] - b)
    Exp[-(a/(
     Quantity[1, "MolarGasConstant"] T Subscript[V, m]))] /. {Subscript[V, m] -> Quantity[500., ("Milliliters")/("Moles")], T -> Quantity[263.15, "Kelvins"]}, "Bars"]
Out[10]=

Applications (3) 

Compute the Redlich–Kwong constants for a gas mixture that is 70% nitrogen and 30% oxygen by weight, using mixing rules for the constants:

In[11]:=
(* mole fractions *)

molFrac = Normalize[{Quantity[0.7, "Grams"], Quantity[0.3, "Grams"]}/{Entity["Chemical", "MolecularNitrogen"][
      EntityProperty["Chemical", "MolarMass"]], Entity["Chemical", "MolecularOxygen"][
      EntityProperty["Chemical", "MolarMass"]]}, Total];
{a1, b1} = ResourceFunction["EquationOfStateConstants"][
   Entity["Chemical", "MolecularNitrogen"], "RedlichKwong"];
{a2, b2} = ResourceFunction["EquationOfStateConstants"][
   Entity["Chemical", "MolecularOxygen"], "RedlichKwong"];
{a, b} = {a1 
\!\(\*SubscriptBox[\(molFrac\), \(\(\[LeftDoubleBracket]\)\(1\)\(\[RightDoubleBracket]\)\)]\)^2 + Sqrt[a1 a2] 
\!\(\*SubscriptBox[\(molFrac\), \(\(\[LeftDoubleBracket]\)\(1\)\(\[RightDoubleBracket]\)\)]\) 
\!\(\*SubscriptBox[\(molFrac\), \(\(\[LeftDoubleBracket]\)\(2\)\(\[RightDoubleBracket]\)\)]\) + a2 
\!\(\*SubscriptBox[\(molFrac\), \(\(\[LeftDoubleBracket]\)\(2\)\(\[RightDoubleBracket]\)\)]\)^2, 
\!\(\*SubscriptBox[\(molFrac\), \(\(\[LeftDoubleBracket]\)\(1\)\(\[RightDoubleBracket]\)\)]\) b1 + 
\!\(\*SubscriptBox[\(molFrac\), \(\(\[LeftDoubleBracket]\)\(2\)\(\[RightDoubleBracket]\)\)]\) b2}
Out[11]=

Compute the density of the mixture at standard temperature and pressure:

In[12]:=
\[Rho] = {0.7, 0.3} . {Entity["Chemical", "MolecularNitrogen"][
     EntityProperty["Chemical", "MolarMass"]], Entity["Chemical", "MolecularOxygen"][
     EntityProperty["Chemical", "MolarMass"]]}/
  Last[Quiet[
    FormulaData["RedlichKwongEquation", Join[Thread[{"a", "b"} -> {a, b}], {QuantityVariable[
        "P","Pressure"] -> Quantity[1., "Bars"], QuantityVariable["T","Temperature"] -> Quantity[273.15, "Kelvins"]}]]]]
Out[12]=

Compute the mass of 10 L of the mixture:

In[13]:=
UnitConvert[\[Rho] Quantity[10, "Liters"], "Grams"]
Out[13]=

Version History

  • 1.0.1 – 27 March 2024
  • 1.0.0 – 14 June 2021

Source Metadata

Author Notes

Support for other equations of state will be added in a future update.

License Information