Project Programming C
Transcript of Project Programming C
8/20/2019 Project Programming C
http://slidepdf.com/reader/full/project-programming-c 1/6
UNIVERSITI TEKNOLOGI MALAYSIA
FACULTY
OF
MECHANICAL
ENGINEERING
SME 1013
PROGRAMMING FOR ENGINEER
PROJECT 1 C PROGRAMMING
NAME
:
MOHD
FIRDAUS
BIN
MOHD
NASIR
MATRIK : SXO81059MMJ04
SECTION : 1
LECTURE : DR YUSSOFF
8/20/2019 Project Programming C
http://slidepdf.com/reader/full/project-programming-c 2/6
Universiti Teknologi Malaysia'
Fakulti Kejuruteraan Mekanikal
SME/SKMM 1013 Programming for Engineers
2011-2012-02
Project -
C
Programming
Psychrometry deals with the properties of moist air. When the atmospheric pressure (total
pressure)
P
(kPa), the air dry bulb temperature
T
cae , and the relative humidity
RH (%)
are
known, the following properties can be calculated:
where
p . = 0.00008T
3
- 0.0007T2 + 0.0754T +
4 8 7 ~
(kPa)
P
v
=RH ) . . . .
(kPa)
w
0622
P
P,
. . . H • • • • • H • " " " .
1
/ L
= 100 P
[P - p ] .... .
..
.
..
.... .... ................. ....... (
)
p . P - P
v
h=
1.00ST +
w 2S00
+
1.88T .
.... ... .
... . ...... (kJlkgdryair
p.
= saturation pressure
of
water at dry bulb temperature
T
P
v
= partial pressure
of
water vapor
w
= humidity ratio
j.1
=
percentage saturation
h
=
specific enthalpy
of
air-vapor mixture
RH =
relative humidity
Write a C program to tabulate the following properties for 18°C
T
40°C
in
increment of
2°C,
and
40 RH 100
in increment
of
10
:
• w
• / L
• h
Tabulate for P = 101.325 kPa and P =
95
kPa.
Refer
http://www.fkm .
utm my/ myusofflw
.doc
for a sample of tabulated property .
Be creative when tabulating the proper ties
Your report submission must include the source code and the computer generated outputs.
Briefly discuss the results obtained and give your conclusions.
The report
is
due on
13
thoMay
2012.
8/20/2019 Project Programming C
http://slidepdf.com/reader/full/project-programming-c 3/6
SOLUTION
SOURCE CODE
1) P=101.325 Kpa
#include <stdio.h>
main(){
float t,h,p,ps[12],rh,pv[12][7],w[12][7],mu[12][7],temp[12];
int i,j;
p=101.325;
i=-1;{ for(t=18; t<=40; t=t+2)
i=i+1;
j=-1;
for(rh=40; rh<=100; rh=rh+2)
j=j+1;temp[i]=t;
ps [i]=(0.00008*pow(t,3)) + (0.0007*pow(t,2)) + (0.0754*t) + 0.4875;
pv[i][j] =((rh*ps[i])/100);
w[i][j] =0.622*pv[i][j]/(p-pv[i][j]);
mu[12][7] =(100*pv[i][j]/ps[i])*((p-ps[i])/(p-pv[i][j]));
h=(1.005*t) + (w[i][j]*(2500+(1.88*t)));
}
printf(" Relative Humidity(Percent) \n");
printf(" -----------------------------------------------------------------\n");
printf(" T(C) 40 50 60 70 80 90 100 \n");
printf(" -----------------------------------------------------------------\n");
for(i=0;i<=1;++i)for(j=0;j<=0;++j)
printf(" %.2d %.4f %.4f %.4f %.4f %.4f %.4f %.4f \n",pv[i][0], pv[i][1], pv[i][2],
pv[i][3], pv[i][4], pv[i][5], pv[i][6], pv[i][7]);
system("pause");
}
8/20/2019 Project Programming C
http://slidepdf.com/reader/full/project-programming-c 4/6
2) P=95 Kpa
#include <stdio.h>
main()
{
float t,h,p,ps[12],rh,pv[12][7],w[12][7],mu[12][7],temp[12];
int i,j; p=95;
i=-1;for(t=18; t<=40; t=t+2)
{ i=i+1;
j=-1;
for(rh=40; rh<=100; rh=rh+2)
j=j+1;temp[i]=t;
ps [i]=(0.00008*pow(t,3)) + (0.0007*pow(t,2)) + (0.0754*t) + 0.4875;
pv[i][j] =((rh*ps[i])/100);
w[i][j] =0.622*pv[i][j]/(p-pv[i][j]);
mu[12][7] =(100*pv[i][j]/ps[i])*((p-ps[i])/(p-pv[i][j]));h=(1.005*t) + (w[i][j]*(2500+(1.88*t)));
}
printf(" Relative Humidity(Percent) \n");
printf(" -----------------------------------------------------------------\n");
printf(" T(C) 40 50 60 70 80 90 100 \n");
printf(" -----------------------------------------------------------------\n");
for(i=0;i<=1;++i)
for(j=0;j<=0;++j)
printf(" %.2d %.4f %.4f %.4f %.4f %.4f %.4f %.4f \n",pv[i][0], pv[i][1], pv[i][2],
pv[i][3], pv[i][4], pv[i][5], pv[i][6], pv[i][7]);
system("pause");
}
8/20/2019 Project Programming C
http://slidepdf.com/reader/full/project-programming-c 5/6
3) Graf
Humi di t y Rat i o of Ai r( P = 101. 325 kPa)
Rel at i ve Humi di t y ( %)- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
T( C) 40 50 60 70 80 90 100- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -18. 0. 00516 0. 00646 0. 00777 0. 00909 0. 01041 0. 01173 0. 0130620. 0. 00584 0. 00731 0. 00880 0. 01029 0. 01179 0. 01329 0. 0148022. 0. 00660 0. 00827 0. 00995 0. 01164 0. 01334 0. 01505 0. 0167624. 0. 00745 0. 00935 0. 01125 0. 01316 0. 01509 0. 01703 0. 0189826. 0. 00841 0. 01055 0. 01271 0. 01487 0. 01706 0. 01926 0. 0214728. 0. 00949 0. 01191 0. 01434 0. 01680 0. 01927 0. 02176 0. 0242830. 0. 01069 0. 01342 0. 01617 0. 01895 0. 02175 0. 02458 0. 0274332. 0. 01203 0. 01511 0. 01822 0. 02136 0. 02453 0. 02773 0. 0309634. 0. 01351 0. 01698 0. 02049 0. 02404 0. 02763 0. 03125 0. 03492
36. 0. 01516 0. 01907 0. 02302 0. 02702 0. 03108 0. 03518 0. 0393438. 0. 01698 0. 02137 0. 02582 0. 03034 0. 03491 0. 03956 0. 0442640. 0. 01899 0. 02392 0. 02892 0. 03401 0. 03917 0. 04442 0. 04975- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Humi di t y Rat i o of Ai r( P = 95 kPa)
Rel at i ve Humi di t y ( %)- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
T( C) 40 50 60 70 80 90 100- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
18. 0. 00516 0. 00646 0. 00777 0. 00909 0. 01041 0. 01173 0. 0130620. 0. 00584 0. 00731 0. 00880 0. 01029 0. 01179 0. 01329 0. 0148022. 0. 00660 0. 00827 0. 00995 0. 01164 0. 01334 0. 01505 0. 0167624. 0. 00745 0. 00935 0. 01125 0. 01316 0. 01509 0. 01703 0. 0189826. 0. 00841 0. 01055 0. 01271 0. 01487 0. 01706 0. 01926 0. 0214728. 0. 00949 0. 01191 0. 01434 0. 01680 0. 01927 0. 02176 0. 0242830. 0. 01069 0. 01342 0. 01617 0. 01895 0. 02175 0. 02458 0. 0274332. 0. 01203 0. 01511 0. 01822 0. 02136 0. 02453 0. 02773 0. 0309634. 0. 01351 0. 01698 0. 02049 0. 02404 0. 02763 0. 03125 0. 0349236. 0. 01516 0. 01907 0. 02302 0. 02702 0. 03108 0. 03518 0. 0393438. 0. 01698 0. 02137 0. 02582 0. 03034 0. 03491 0. 03956 0. 0442640. 0. 01899 0. 02392 0. 02892 0. 03401 0. 03917 0. 04442 0. 04975- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
8/20/2019 Project Programming C
http://slidepdf.com/reader/full/project-programming-c 6/6
4) Conclusion
From the above table we can see that the value slightly different when the pressure was change from
101.325 Kpa to 95 Kpa. Due to pressure drop the condensation was happen and resulted the relative
humidity become higher instead higher pressure apply.