© 2022 Horia Metiu

WorkBookT.12. Calculate the enthalpy change

Remove["Global`*"] ;
Needs["Utilities`CleanSlate`"];
CleanSlate[];

Calculate the enthalpy change ΔH, in a transformation in which 30 moles of ethane are taken from the initial state
	(Subscript[σ, i]) = { (Subscript[T, i]) = 300 K, (Subscript[p, i])=1 atm, (Subscript[v, i])} 
to the final state
	(Subscript[σ, f])={(Subscript[T, f])=1000 K,(Subscript[p, f])=100 atm, (Subscript[v, f])}

Cell 1. The method of calculation

As explained in Chapter 12, §9, the enthalpy is a function of state and its variation during a transformation does not depend on the path. I can chose any path I want and I will pick the one that makes the calculations as simple as possible. My choice consists of two paths, performed in succession.

On path A the temperature changes and the pressure is held constant
{(Subscript[T, i])=298 K, (Subscript[p, i])=1 atm,(Subscript[v, i])} -> {(Subscript[T, f])=1000 K,(Subscript[p, i])=1 atm, (Subscript[v, 1])}
It is clever to take this path because it requires me to know 
	(Subscript[c, p])(T, p =1 atm)
for which it is easy to find data.

Along path B the transformation is
{(Subscript[T, f])=1000 K, (Subscript[p, i])=1 atm,(Subscript[v, 1])} -> {(Subscript[T, f])=1000 K, (Subscript[p, f])=100 atm,(Subscript[v, f])}

According to   Eq. 12.18 in the textbook the change of enthalpy along the isobaric path A is : 
	(Subscript[Δh, A])= h((Subscript[σ, 1])) - h((Subscript[σ, i])) = (∫_(Subscript[T, i])^(Subscript[T, f]))(Subscript[c, p])(T,(Subscript[p, i])=1 atm)dT		(1)

The enthalpy change along the isothermal path B is (see the discussion in §17 in Chapter 12,   Eq. 28 ):
 (Subscript[Δh, B])≡ h((Subscript[σ, f]))-h((Subscript[σ, 1])) = (∫_( (Subscript[v, 1]))^( (Subscript[v, f]))) {v (Subscript[(((∂p)/(∂v))), T]) + T (Subscript[(((∂p)/(∂T))), v])}dv		(2)
While evaluating this integral:
•  the temperature is constant and equal to 1000 K
• (Subscript[v, 1]) is the molar volume calculated from
	1 atm = f(1000 K, (Subscript[v, 1])) 
	where p = f(T,v) is the equation of state. 
• (Subscript[v, f]) is the volume calculated from
	100 atm = f(1000 K, (Subscript[v, f])) 
	where 1 atm where p = f(T,v) is the equation of state.

• The change of enthalpy per mole, for the complete transformation, is (see §9, Chapter 12) 
	           Δh = (Subscript[Δh, A]) + (Subscript[Δh, B])			(3)
• If I multiply this by 30 I get the enthalpy change for 30 moles.
• The data needed for evaluating the integrals are  (Subscript[c, p]) and the equation of state of ethane.

Cell 2. The data

To evaluate the equations outlined in Cell 1 I need the heat capacity at constant pressure and a good equation of state.

The heat capacity of ethane is (see Appendix 8):
	(Subscript[c, p])(T) =1.279 + 42.464 (10^(-3)) T - 16.420 (10^(-6)) (T^2) + 2.035 (10^(-9)) (T^3)    cal/K mol

cp[T_]:=1.279+42.464*10^-3 T +-16.420 10^-6 T^2 +2.035*10^-9 (T^3)
(*cal/K mol*)

Test that this function works properly

cp[x]  (*cal/K mole*)

Test that the numerical values are of correct order of magnitude

cp[500] (*cal/K mole*)

I will use the Beattie-Bridgeman equation (see Chapter 2)
p =  ((RT/(v^2))) (1 -  (c/(vT^3))) (v +B-(bB/v)) - A(1-(a/v)) 		(4)
The parameters a, A, b, B, and c, for various gases, are given in Appendix 5 of textbook.  In WorkBookT.3  I defined the function PBB[T,v,parameters] to calculate the pressure from the Beattie-Bridgeman equation.  I copy it and paste it below

Clear[pBB]
pBB[T_(*liter/mol*),v_(*liter/mol*),parameters_]:=Module[
{p1,p2,p3},
     Clear[A,a,B,b,c] ;  
    p1=1-c/(v T^3);
    p2=v+B-b B/v;
    p3=A*(1-a/v);
   ( (R T p1 p2-p3)/v^2)/.parameters (*p in atm*)];
SetAttributes[pBB,HoldAll];

The parameters for ethane are given in Appendix 5.

ethaneParam={A->5.8800,B->0.09400,a->0.05861,
		b->0.01915,c->90.0*10^4, R->0.08205(*liter atm/mol K*)};

Check that PBB works and gives reasonable results. At 300 K and a volume of 24 liters, the pressure should be close to 1 atm.

pBB[300,24,ethaneParam]

Cell 3:  The enthalpy change (Subscript[Δh, A]) along path A

Calculate the integral  	
	(Subscript[Δh, A])=  (∫_(Subscript[T, i])^(Subscript[T, f]))(Subscript[c, p])(T,(Subscript[p, i])=1 atm)dT
Use for (Subscript[Δh, A]) units of kcal/mole K. Because the data for (Subscript[c, p]) is given in cal/mol K,  I divide (Subscript[c, p]) by 1000 to get it in kcal/mole K

ΔhA=Integrate[cp[T],{T,300,1000}]/1000 (*kcal/mol*)

The change of the enthalpy in a process taking place at constant pressure is the amount of heat exchanged between the system and the medium. The positive sign means that heat was given to the medium. This is no surprise: to increase the temperature I must give the system heat.

Cell 4:  The enthalpy change (Subscript[Δh, B])  along path B

To calculate (Subscript[Δh, B]) I must evaluate the integral 
		(∫_(Subscript[v, 1])^( (Subscript[v, f]))) {v (Subscript[(((∂p)/(∂v))), T]) + T (Subscript[(((∂p)/(∂T))), v])}dv

First, I calculate the volumes (Subscript[v, 1])and (Subscript[v, f]) . I use the function VolumeG   (see Chapter 3 and WorkBookT.3 which explains how the molar volume is calculated).

volumeG[T_,p_,f_,parameters_]:=
Module[{R=0.082 (*liter atm/mol*),eq,sol},
Clear[a,b,c,A,B,C0,γ];
	eq=p==f[T,v ,parameters];
		v/.FindRoot[eq,{v,R T/p}] ];

I want to create replacement rules for the volumes.

volumeRules={v1->volumeG[1000,1,pBB,ethaneParam], vf->volumeG[1000,100,pBB,ethaneParam]}(*liter/mole*)

I have now all the information I need to evaluate the  change of enthalpy  	
		ΔhB = (∫_( (Subscript[v, 1]))^( (Subscript[v, f]))) {v (Subscript[(((∂p)/(∂v))), T]) + T (Subscript[(((∂p)/(∂T))), T])}dv
with 
		T = 1000 K

I calculate the integrals successively
		term1 ≡ (∫_( (Subscript[v, 1]))^( (Subscript[v, f]))) v (Subscript[(((∂p)/(∂v))), T]) dv       
		term2 ≡ (∫_( (Subscript[v, 1]))^( (Subscript[v, f])))  T (Subscript[(((∂p)/(∂T))), T])dv
		ΔhB = term1 + term2
The integration gives the enthalpy change in units of liter atm/mole. I have to convert it to kcal/mol. The conversion factor is (Appendix 7)  
	1 liter atm = 24.2147 cal = 0.024216 kcal

Evaluate 
	term1 ≡ 0.024216 (∫_( (Subscript[v, 1]))^( (Subscript[v, f]))) v (Subscript[(((∂p)/(∂v))), T]) dv 
for 
	T = 1000 K

term1= 0.024216*Integrate[v D[pBB[1000,v,ethaneParam],v]  ,{v,v1,vf},GenerateConditions->False]/.T->1000 /.volumeRules  (*kcal/mole*)

Evaluate 
	term2 ≡ 0.0242157 (∫_( (Subscript[v, 1]))^( (Subscript[v, f])))  T (Subscript[(((∂p)/(∂T))), T])dv
for 	
	T = 1000 K

term2=0.0242157*Integrate[ T D[pBB[T,v,ethaneParam],T] ,{v,v1,vf},GenerateConditions->False]/.T->1000 /.volumeRules(*kcal/mole*)

The change of enthalpy along path B:

ΔhB=term1 +term2 (*kcal/mole*)

In this particular case the change of enthalpy with pressure is very small, compared to the change obtained when we varied the temperature.  This happens because the temperature is high and the gas is nearly ideal.  The enthalpy of an ideal gas is independent of pressure.

Cell 5:  The enthalpy change Δh = (Subscript[Δh, A])+(Subscript[Δh, B])

Δh=ΔhA +ΔhB  (*kcal/mol*)

For 30 moles the change in enthalpy is

30*Δh (*kcal*)