西安交通大学工程期末编程大作业(完整版

整理文档很辛苦,赏杯茶钱您下走!

免费阅读已结束,点击下载阅读编辑剩下 ...

阅读已结束,您可以下载文档离线阅读编辑

资源描述

1高等工程热力学作业姓名:XX班级:XXXX学号:XXXXXXX2第一章1.用PR方程计算制冷剂R32,R125,和混合制冷剂R410a(R32/R125:50/50Wt%)的pvT性质。程序说明:进入程序后选择所要计算的制冷剂,输入p,T后可得其比体积(两相区时分别输出气液相比体积)源程序:#includeiostream.h#includemath.h#defineR8.31451doubleNewton(doubleA,doubleB,doublex){doublex0;doublef,df;do{x0=x;f=x*x*x-(1-B)*x*x+(A-3*B*B-2*B)*x-(A*B-B*B-B*B*B);df=3*x*x-2*(1-B)*x+(A-3*B*B-2*B);x=x-f/df;}while(fabs(x-x0)1e-6);returnx;}voidR32(doubleT,doublep,double*a,double*b,double*M){doubleTc,pc,w,k,a1,Tr;*M=52.024e-3;Tc=351.255;pc=5780000;w=0.277;k=0.37464+1.54226*w-0.26992*w*w;Tr=T/Tc;a1=pow(1+k*(1-pow(Tr,0.5)),2);*a=0.45727*a1*R*R*Tc*Tc/pc;*b=0.07780*R*Tc/pc;}voidR125(doubleT,doublep,double*a,double*b,double*M){doubleTc,pc,w,k,a1,Tr;3*M=120.03e-3;Tc=339.45;pc=3630600;w=0.299;k=0.37464+1.54226*w-0.26992*w*w;Tr=T/Tc;a1=pow(1+k*(1-pow(Tr,0.5)),2);*a=0.45727*a1*R*R*Tc*Tc/pc;*b=0.07780*R*Tc/pc;}voidR410a(doubleT,doublep,double*a,double*b,double*M){doublea1,a2,b1,b2,x1,x2,k12,M1,M2;k12=0.01;R32(T,p,&a1,&b1,&M1);R125(T,p,&a2,&b2,&M2);x1=1/(1+M1/M2);x2=1/(1+M2/M1);*a=x1*x1*a1+x2*x2*a2+2*x1*x2*(1-k12)*sqrt(a1*a2);*b=x1*b1+x2*b2;*M=x1*M1+x2*M2;}voidmain(){doubleM,T,a,b,p,A,B;inti;N1:coutpleaseenter1(R32),2(R125)or3(R410a)endl;cini;if(i!=1&&i!=2&&i!=3){coutThenumberiswrongendl;gotoN1;}coutpleaseenterT(K)endl;cinT;coutpleaseenterp(Mpa)endl;cinp;p=p*1e6;if(i==1){R32(T,p,&a,&b,&M);}elseif(i==2)4{R125(T,p,&a,&b,&M);}elseif(i==3){R410a(T,p,&a,&b,&M);}A=a*p/(R*R*T*T);B=b*p/(R*T);doublez1=Newton(A,B,1000);doublez2=Newton(A,B,0.001);if(fabs(z1-z2)1e-4){doublev1=z1*R*T/p/M;cout单位比体积为:v1m^3/kgendl;}else{doublev1=z1*R*T/p/M;doublev2=z2*R*T/p/M;cout气体单位比体积为:v1m^3/kgendl;cout液体单位比体积为:v2m^3/kgendl;}}(一)pleaseenter1(R32),2(R125)or3(R410a)1pleaseenterT(K)300pleaseenterp(Mpa)1.7499气体单位比体积为:0.0214228m^3/kg液体单位比体积为:0.00122247m^3/kgPressanykeytocontinue(二)pleaseenter1(R32),2(R125)or3(R410a)2pleaseenterT(K)300pleaseenterp(Mpa)1.7499气体单位比体积为:0.00762949m^3/kg液体单位比体积为:0.000859649m^3/kg5Pressanykeytocontinue(三)pleaseenter1(R32),2(R125)or3(R410a)3pleaseenterT(K)300pleaseenterp(Mpa)1.7499气体单位比体积为:0.0147329m^3/kg液体单位比体积为:0.00105639m^3/kgPressanykeytocontinue第二章1.利用热力学普遍关系式推导:pvTpsssvTTvT证明:pvgccRgpgggvRcRRRcpvvpvp由理想气体状态方程得:gpRvTp,gvRpTv代入可得:pvpvvpccvppvTvTpTT根据热力状态基本表达式得:1pscvTp,1vscTpv代入得:pvvpssvpTpvTTTTTvp利用麦克斯韦关系式:TvpTsvTvvTsp6得:11VpsTTspvTvTTTpvsps带入倒数关系1pTvpTs,1vTpvTspvvpsspvTTTT由麦克斯韦关系:TvspvT得pvTpsssvTTvT2.利用热力学普遍关系式推导第三dh和ds方程:pppvTTdhvcdpcdvpvpvpvccTTdsdpdvTpTv解:若状态方程以p,v为独立变量(1)比焓的变化为:pvhhdhdpdvpv式中:vvvvvvvvhhspTTTTvcvppTTppTppppphThTcpvvT代回得:7pppvTTdhvcdpcdvpv(2)比熵的变化pvssdsdpdvpv2.2vvvvvscsTTppTpTvvvvvscsTTppTpT代回得:pvpvccTTdsdpdvTpTv3.推导PR方程的导出热力性质余函数rh、rs。解:PR方程:RTapvbvvbbvblnvrRTvapdvRTvvlnvRTRTavdvRTvbvvvbbvbvlnlnlnvvvavRTvbRTvdvRTvvbbvbvlnlnvvbavRTdvRTvvvbbvbv上式中:1110.4142.41422vvadvadvvvbbvbvbvbb8110.4140.41422vvadvdvvbvbb0.414ln2.41422avbvbb0.414lnlnln2.41422rvbavbvaRTRTvvbvb所以:0.414lnlnln2.41422rvvbvbvsssaaRRTvvbvb其中:aT。rrrhhhaTspvv0.414ln12.41422TavbvavRTvbvbvvbbvbb0.414ln2.41422TavbbavRTvbvbvvbbvbb4.用PR方程计算工质R32,R125,和混合工R32/R125的导出热力性质焓和熵。(一)计算R32,R125的焓熵值源程序#includeiostream.h#includemath.h#defineR8.31doubleget_a(doublew,doubleT,doubleTc,doublepc){doublek=0.37464+1.54226*w-0.26992*w*w;doublear=(1+k*(1-sqrt(T/Tc)))*(1+k*(1-sqrt(T/Tc)));doublea=0.45724*ar*R*R*Tc*Tc/pc;returna;}doubleget_b(doubleTc,doublepc){doubleb=0.0778*R*Tc/pc;returnb;}9doubleNewton(doubleA,doubleB,doublex){doublex0;doublef,df;do{x0=x;f=x*x*x-(1-B)*x*x+(A-3*B*B-2*B)*x-(A*B-B*B-B*B*B);df=3*x*x-2*(1-B)*x+(A-3*B*B-2*B);x=x-f/df;}while(fabs(x-x0)1e-6);returnx;}doubleget_ar(doubleT,doublev,doublevv,doublea,doubleb){doublear=R*T*log((v-b)/v)-a*log((v-0.414*b)/(v+2.414*b))/(2*1.414*b)+R*T*log(v/vv);returnar;}doubleget_sr(doubleT,doublev,doublevv,doublea,doubleb,doublebb){doublesr=-1*R*log((v-b)/v)+bb*log((v-0.414*b)/(v+2.414*b))/(2*1.414*b)-R*log(v/vv);returnsr;}voidget_hr(doubleTc,doublepc,doublew,doubleT,doublep,double*hr,double*sr,doublezz){doublea=get_a(w,T,Tc,pc);doubleb=get_b(Tc,pc);doublebb=(get_a(w,T+0.25,Tc,pc)-get_a(w,T-0.25,Tc,pc))/0.5;doubleA=a*p/(R*R*T*T);doubleB=b*p/(R*T);doublez=Newton(A,

1 / 25
下载文档,编辑使用

©2015-2020 m.777doc.com 三七文档.

备案号:鲁ICP备2024069028号-1 客服联系 QQ:2149211541

×
保存成功