> restart;#'therm_proc6.mws'.22-6-05.

Elementary procedures available. Examples with H2O.

Note that 0-references for u (h for the case) and s are taken at the liquid state in the triple point (as in Mollier diagram), and that vapour values are computed through the boiling line (where the hlv-data is available) instead of through the triple line.

> read"../therm_eq.m":read"../therm_proc.m":with(therm_proc):

> su:="H2O";dat:=[T1=300*K_];Wdat:=get_gas_data(su),get_liq_data(su):get_pv_data(su):

`:=`(su,

`:=`(dat, [T1 = `+`(`*`(300, `*`(K_)))])

The 6 functions programmed are: pv,hl,hv,hlv,sl,sv. For enthalpies:

> hl=hl(T);hl_:=subs(Wdat,T=T1,dat,hl(T));hv=hl(T);hv_:=subs(Wdat,T=T1,dat,hv(T));hlv=hlv(T);hlv_:=subs(Wdat,T=T1,dat,hlv(T));

hl = `*`(c, `*`(`+`(T, `-`(T[f]))))

`:=`(hl_, `+`(`/`(`*`(112860., `*`(J_)), `*`(kg_))))

hv = `*`(c, `*`(`+`(T, `-`(T[f]))))

`:=`(hv_, `+`(`/`(`*`(2536756.0, `*`(J_)), `*`(kg_))))

hlv = `+`(h[lv0], `*`(`+`(c[p], `-`(c)), `*`(`+`(T, `-`(T[b])))))

`:=`(hlv_, `+`(`/`(`*`(2423896.0, `*`(J_)), `*`(kg_))))

you may verify that hlv=hv-hl.

Antoine's fitting is used for vapour pressure.

> get_pv_data(gen):'pv(T)'=pv(T);get_pv_data(su):'pv(T)'=pv(T);pv300_:=evalf(subs(dat,pv(T1)));

Substance, gen, `not in`, `../pv.asc`

pv(T) = exp(`+`(A, `-`(`/`(`*`(B), `*`(`+`(T, C))))))

pv(T) = `+`(`*`(0.1e4, `*`(exp(`+`(16.54, `-`(`/`(`*`(3985.), `*`(`+`(`/`(`*`(T), `*`(K_)), `-`(39.00))))))), `*`(Pa_))))

`:=`(pv300_, `+`(`*`(3567.270580, `*`(Pa_))))

and for entropies:

> sl=sl(T);sl_:=evalf(subs(Wdat,T=T1,dat,sl(T)));sv=sv(T,p);sv_:=evalf(subs(Const,Wdat,T=T1,p=pv300_,dat,sv(T,p)));slv:='hlv/T';slv_:=subs(dat,hlv_/T1);

sl = `*`(c, `*`(ln(`/`(`*`(T), `*`(T[f])))))

`:=`(sl_, `+`(`/`(`*`(394.2186406, `*`(J_)), `*`(kg_, `*`(K_)))))

sv = `+`(`*`(c, `*`(ln(`/`(`*`(T[b]), `*`(T[f]))))), `/`(`*`(h[lv0]), `*`(T[b])), `*`(c[p], `*`(ln(`/`(`*`(T), `*`(T[b]))))), `-`(`*`(R, `*`(ln(`/`(`*`(p), `*`(p0)))))))

`:=`(sv_, `+`(`/`(`*`(8479.357493, `*`(J_)), `*`(kg_, `*`(K_)))))

`:=`(slv, `/`(`*`(hlv), `*`(T)))

`:=`(slv_, `+`(`/`(`*`(8079.653333, `*`(J_)), `*`(kg_, `*`(K_)))))

and again you may verify that slv=sv-sl.

and again you may verify that slv=sv-sl.

Additionaly, a procedure is available to evaluate the exit conditions upon isentropic expansion of a vapor (presumably falling into the wet region).

NOTE: it assumes gas_data & liq_data available in dat. Makes available all other values!!!

> dat:=op(dat),Wdat,Const:

> dat1:=[T3=800*K_,p3=1e6*Pa_,p4=1e4*Pa_];wet_vap(op(subs(dat1,[T3,p3,p4])));evalf([T4=T4_,h4l=h4l_,h4v=h4v_,s4l=s4l_,s4v=s4v_],3);'T4'=TKC(T4_);

`:=`(dat1, [T3 = `+`(`*`(800, `*`(K_))), p3 = `+`(`*`(0.1e7, `*`(Pa_))), p4 = `+`(`*`(0.1e5, `*`(Pa_)))])

`Point 4s inside wet bell`, [x4s_ = .95, h4s_ = `+`(`/`(`*`(0.25e7, `*`(J_)), `*`(kg_))), s3_ = `+`(`/`(`*`(0.77e4, `*`(J_)), `*`(kg_, `*`(K_))))]

[T4 = `+`(`*`(319., `*`(K_))), h4l = `+`(`/`(`*`(0.192e6, `*`(J_)), `*`(kg_))), h4v = `+`(`/`(`*`(0.257e7, `*`(J_)), `*`(kg_))), s4l = `+`(`/`(`*`(650., `*`(J_)), `*`(kg_, `*`(K_)))), s4v = `+`(`/`(`*...

T4 = `+`(`*`(45.7, `*`(`?`)))

>