function [uf]=uf(T) 
  %liquid specific internal energy [kJ/kg] at T [celsius] 
 
 Tsat=[0:10:370,374.15];
  %saturation temperature in celsius
  
  hliq=[0.000611,41.99,83.86,125.66,167.47,209.3,251.1,293.0,334.9,376.9,419.1,461.3,503.7,546.3,589.1,632.2,675.5,719.1,763.1,807.5,852.4,897.7,943.7,990.3,1037.6,1085.8,1135.0,1185.2,1236.8,1290,1345,1402,1462,1526,1596,1672,1762,1892,2095];
  vliq=1e-3*[1.0002,1.0004,1.0018,1.0044,1.0079,1.0121,1.0171,1.0228,1.0290,1.0359,1.0435,1.0515,1.0603,1.0697,1.0798,1.0906,1.1021,1.1144,1.1275,1.1415,1.1565,1.1726,1.1900,1.2087,1.2291,1.2512,1.2755,1.3023,1.3321,1.3655,1.4036,1.4475,1.4992,1.562,1.639,1.741,1.894,2.22,3.17];
  Psat=[0.006112,0.012271,0.023368,0.042418,0.073750,0.12335,0.19919,0.31161,0.47358,0.70109,1.01325,1.4327,1.9854,2.7011,3.6136,4.7597,6.1804,7.9202,10.027,12.553,15.550,19.080,23.202,27.979,33.480,39.776,46.941,55.052,64.191,74.449,85.917,98.694,112.89,128.64,146.08,165.37,186.74,210.53,221.2];
  uliq=hliq-(1e5*Psat.*vliq)/1e3;
 %liquid saturation internal energy in kJ/kg

uf=interp1(Tsat,uliq,T);
