inversa lu

16
PROYECTO PROYECTO CALCULO DE LA CALCULO DE LA DENSIDAD Y EL VOLUMEN DENSIDAD Y EL VOLUMEN MOLAR DE UNA MOLAR DE UNA COMPOSICIÓN GASEOSA COMPOSICIÓN GASEOSA JUAN CAMILO CORTES COD : 2042097 FERNANDO ANDRES FUENTES COD: 2042087 NATALIA GRAJALES GARCIA COD: 2061840

Upload: natalia

Post on 24-Jun-2015

1.029 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Inversa lu

PROYECTOPROYECTOCALCULO DE LA CALCULO DE LA DENSIDAD Y EL DENSIDAD Y EL

VOLUMEN MOLAR DE VOLUMEN MOLAR DE UNA COMPOSICIÓN UNA COMPOSICIÓN

GASEOSAGASEOSA JUAN CAMILO CORTES COD :

2042097 FERNANDO ANDRES FUENTES COD:

2042087 NATALIA GRAJALES GARCIA COD:

2061840

Page 2: Inversa lu
Page 3: Inversa lu

program proyecto2

integer::opcioninteger::FM,CMreal::bm,suma,ac,A,ma,c,d,e,f,Pe,Q,P,T,De,

th,Z1,Z2,Z3,u,v,Zr1,Zr2,Zr3,Zi2,Zi3real::Zg,Vm,densidad,ui,uoreal,allocatable::M(:,:),R(:,:)real,dimension(10)::ai,bi,mi,alfa,yimi

write(*,*)'_____Menu______'write(*,*)' 'write(*,*)'oprima:'write(*,*)' 'write(*,*)'1.Calcula la densidad y Vm'write(*,*)' 'write(*,*)'oprima cualquier numero para

salir'read(*,*)opcion

Page 4: Inversa lu

do while(opcion==1) open(unit=10,file='datos.txt',action='read')

read(10,*)FM,CM

allocate (M(FM,CM),R(FM,CM))

do i=1,FM,1 read(10,*)M(i,1:CM)

end do

close(10) suma=0.0 do i=1,FM,1 suma=suma+M(i,1) end do

Abre el archivo , lee los datos

Page 5: Inversa lu

write(*,*)' 'write(*,*)'la suma de las composiciones es =',sumabm=0.0ma=0.0

if(suma==1)then write(*,*)' ' write(*,*)'Escriba los valores de Presion y Temperatura'write(*,*)' 'write(*,*)'Presion:'read(*,*)Pwrite(*,*)' 'write(*,*)'Temperatura:'read(*,*)Twrite(*,*)' ‘

do i=1,FM,1 ai(i)=0.45724*((10.737*M(i,3))**2)ai(i)=ai(i)/M(i,4)

Page 6: Inversa lu

bi(i)=0.07780*10.737*M(i,3)/M(i,4)

mi(i)=0.3746+(1.5423*M(i,5))-(0.2699*(M(i,5)**2))

alfa(i)=(1+(mi(i)*(1-((T/(M(i,3)))**0.5))))**2

bm=bm+(M(i,1)*bi(i))

ma=ma+((M(i,1))*(M(i,2)))

yimi(i)=(M(i,1))*(M(i,2))

end do

open(unit=20,file='tabla.txt' ,action='write',status='replace')

do i=1,FM,1

Page 7: Inversa lu

R(i,1)=ai(i) R(i,2)=bi(i) R(i,3)=yimi(i) R(i,4)=mi(i) R(i,5)=alfa(i)

end do

do i=1,FM,1 write(20,*)(R(i,1:CM)) end do

close(20)

call calculos(M,ac,ai,alfa,A,P,T,B,bm,FM)

c=1.0 d=B-1e=A-(3*(B**2))-(2*B)f=(A*B)-(B**2)-(B**3)

SUBRUTINA

Page 8: Inversa lu

Pe=((3*(e/c))-((d/c)**2))/3Q=((2*((d/c)**3))-(9*(d*e/(c**2)))+(27*f/c))/27De=((Pe/3)**3)+((Q/2)**2)

if(De<0)then write(*,*)'todas las raices son reales' th=(cos(-Q/(2*sqrt(((abs(Pe))**3)/27)))) Z1=(2*sqrt((abs(Pe))/3)*cos(th/3))-(d/(3*c)) Z2=(-2*sqrt((abs(Pe))/3)*cos((th+3.1416)/3))-(d/(3*c)) Z3=(-2*sqrt((abs(Pe))/3)*cos((th-3.1416)/3))-(d/(3*c))

if(Z1>Z2.and.Z1>Z3)then Zg=Z1 else if(Z2>Z3)then Zg=Z2 else Zg=Z3 end if end ifelse

Page 9: Inversa lu

if(De==0)then write(*,*)'Existen solo raices reales dos de ellas son iguales' else write(*,*)' ' write(*,*)'Existen raices reales e imaginarias' u=((abs((-Q/2)+sqrt(De))))**(1.0/3.0) v=((abs((-Q/2)-sqrt(De))))**(1.0/3.0) end if

Zr1=(u+v)-(d/(3*c)) Zr2=(-(u+v)/2)-(d/(3*c)) Zr3=(-(u+v)/2)-(d/(3*c)) Zi2=(sqrt(3.0))*(u-v)/2 Zi3=-(sqrt(3.0))*(u-v)/2

if(Zr1>Zr2)then Zg=Zr1 else Zg=Zr2 end if

Page 10: Inversa lu

end if

densidad=(P*ma)/(Zg*10.737*T)Vm=Zg*10.737*T/P

write(*,*)' 'write(*,*)'el valor de Zg es:',Zgwrite(*,*)' 'write(*,*)'la densidad es:',densidadwrite(*,*)' 'write(*,*)'el volumen molar del gas es:',vmwrite(*,*)' ‘

open(unit=30,file='resultados.txt' ,action='write',status='replace')write(30,*)'el Zg es:',Zg,'la densidad es:',densidad,'el Vm es',Vmclose(30)

Page 11: Inversa lu

elsewrite(*,*)' 'write(*,*)'ERROR:la suma de las composiciones es diferente de uno corrija los datos '

end if

write(*,*)'_____Menu______'write(*,*)' 'write(*,*)'oprima:'write(*,*)' 'write(*,*)'1.Calcula la densidad y Vm'write(*,*)' 'write(*,*)'oprima cualquier numero para salir'read(*,*)opcion

end do

end program proyecto2

Page 12: Inversa lu

subroutine calculos(M,ac,ai,alfa,A,P,T,B,bm,FM) integer::FMreal,dimension(10,10)::Mreal,dimension(10)::ai,alfareal::ac,A,P,T,B,bm do i=1,FM,1 do j=1,FM,1 ac=ac+((M(i,1)*M(j,1))*((ai(i)*ai(j)*alfa(i)*alfa(j))**0.5)) A=ac*P/((10.737*T)**2) B=bm*P/(10.737*T) end do end doreturnend subroutine calculos

VOLVER

Page 13: Inversa lu

calcular la densidad de una fase gaseosa con la siguiente composicion a 4000 psia y a 160 ºF = 619.67 R :

Componente

Xi Mi Tc Pc W

C1 0.8600 16.04 343.000 667.8 0.0104

C2 0.0500 30.07 549.590 706.5 0.0879

C3 0.0500 44.10 665.730 616.0 0.1522

iC4 0.0200 58.12 734.150 529.1 0.1852

iC5 0.0100 72.15 828.770 488.6 0.2280

iC6 0.0095 86.18 913.270 436.9 0.2994

iC7 0.0005 215.0 1159.67 285.0 0.52

Page 14: Inversa lu
Page 15: Inversa lu
Page 16: Inversa lu