0% found this document useful (0 votes)
120 views

Fortran Programming Language For Antoine Equation (Finding Bubble and Dew Point)

This program uses the Newton-Raphson method to calculate bubble point temperature from a mixture's vapor pressure composition data. It initializes temperature, defines constants for three components, calculates the temperature change using Newton-Raphson iteration until convergence within 0.001, and outputs the final bubble temperature and number of iterations. Subroutines calculate vapor pressure, its derivative, and the overall residual function and its derivative for the Newton-Raphson method.

Uploaded by

DyahKuntiSurya
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
120 views

Fortran Programming Language For Antoine Equation (Finding Bubble and Dew Point)

This program uses the Newton-Raphson method to calculate bubble point temperature from a mixture's vapor pressure composition data. It initializes temperature, defines constants for three components, calculates the temperature change using Newton-Raphson iteration until convergence within 0.001, and outputs the final bubble temperature and number of iterations. Subroutines calculate vapor pressure, its derivative, and the overall residual function and its derivative for the Newton-Raphson method.

Uploaded by

DyahKuntiSurya
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

PROGRAM BUBBLE_AND_DEW_POINT_USING_NEWTON_RAPHSON

C Komponen A B C Tb
C ------------------------------------------------
C C3H8 3.92828 803.9970 -26.110 231.02
C C5H12 3.97786 1064.8400 -41.136 309.22
C C6H14 4.00139 1170.8750 -48.833 341.88

IMPLICIT NONE
INTEGER I,NC
REAL EPS,Ps,Told,Tnew,FX,DF
REAL A(5),B(5),C(5),Z(5)
COMMON /DATA/A,B,C,Z

NC = 3
Ps = 1.0
A(1) = 3.92828; B(1) = 803.9970; C(1) = -26.110; Z(1) = 0.3
A(2) = 3.97786; B(2) = 1064.8400; C(2) = -41.136; Z(2) = 0.4
A(3) = 4.00139; B(3) = 1170.8750; C(3) = -48.833; Z(3) = 0.2

WRITE(*,'(A,$)') ' Tinit = '


READ(*,*) Told
Tnew = Told - FX(NC,Ps,Told)/DF(NC,Told)

I = 1
EPS = 1.0E-4
WHILE (ABS((Tnew-Told)/Tnew) .GE. EPS) DO
Told = Tnew
I = I + 1
Tnew = Told - FX(NC,Ps,Told)/DF(NC,Told)
ENDDO
WRITE(*,*) 'The Bubble Temperature is about ', Tnew
WRITE(*,*) 'Number Iteration during process ', I

STOP
END

REAL FUNCTION FX(n,Psis,T)


REAL T,Sum
INTEGER i,n
REAL A(5),B(5),C(5),Z(5)
COMMON /DATA/A,B,C,Z
Sum = 0.0
DO i=1,n
Sum = Sum + Z(i)*Psat(A(i),B(i),C(i),T)
ENDDO
FX = Sum - Psis
END

REAL FUNCTION DF(n,T)


REAL T,Sum
INTEGER i,n
REAL A(5),B(5),C(5),Z(5)
COMMON /DATA/A,B,C,Z
Sum = 0.0
DO i=1,n
Sum = Sum + LOG(10.0)*Z(i)*
* Psat(A(i),B(i),C(i),T)/(T + C(i))*2
ENDDO
DF = Sum
END

REAL FUNCTION Psat(A,B,C,T)


REAL A,B,C,T
Psat = 10.0**(A - B/(T + C))
END

You might also like