summaryrefslogtreecommitdiff
path: root/3689/CH6/EX6.15/6_15.sce
blob: 1698ede83d602580bbdcde188b9adec3aad68ca0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
////
//Variable Declaration
m = 1000.0                //mass of mercury, g
Pi  = 1.00     //Intial pressure and temperature, bar, K
Ti = 300
Pf = 300.     //Final pressure and temperature, bar, K
Tf  = 600.0
rho = 13534.              //Density of mercury, kg/m3
beta = 18.1e-4            //Thermal exapansion coefficient for Hg, /K 
kapa = 3.91e-6            //Isothermal compressibility for Hg, /Pa
Cpm = 27.98               //Molar Specific heat at constant pressure, J/(mol.K) 
M = 200.59                //Molecular wt of Hg, g/mol

//Calculations
Vi = m*1e-3/rho
Vf = Vi*exp(-kapa*(Pf-Pi))
Ut = m*Cpm*(Tf-Ti)/M 
Up =  (beta*Ti/kapa-Pi)*1e5*(Vf-Vi) + (Vi-Vf+Vf*log(Vf/Vi))*1e5/kapa
dU = Ut + Up
Ht = m*Cpm*(Tf-Ti)/M
Hp = ((1 + beta*(Tf-Ti))*Vi*exp(-kapa*Pi)/kapa)*(exp(-kapa*Pi)-exp(-kapa*Pf))
dH =  Ht + Hp
//Results
printf("\n Internal energy change is %6.2e J/mol in which \ncontribution of temperature dependent term %6.4f percent",dU,Ut*100/dH)

printf("\n Enthalpy change is %4.3e J/mol in which \ncontribution of temperature dependent term %4.1f percent",dH,Ht*100/dH)