MoDeNa  1.0
Software framework facilitating sequential multi-scale modelling
BubblePoint.f90
Go to the documentation of this file.
1 
4 
5 
6 
7 Module bubblepoint
8 
9  Implicit None
10 
11  Private
12  Public :: bubblepointcalculation
13 
14  Contains
15 
16 
21 
22  Subroutine bubblepointcalculation
23 
24  Use basic_variables
25  Use starting_values, Only: bubble_point_rachford_rice
26  Use utilities, Only: file_open
27 
28  !local variables
29  Integer :: converg,iterate_t
30  Real :: rhoi1(nc),rhoi2(nc)
31  Real :: H
32  CHARACTER (LEN=50) :: filename
33 
34 
35  Call read_input
36  nphas = 2
37  iterate_t = 0 !iterate pressure to reach the given liquid composition
38  !initial values of liaquid and gas packing fraction
39  dense(1) = 0.4
40  dense(2) = 1.e-05
41  !set initial mole fractions for gas and liquid phase
42  xi(1,1:ncomp) = xif(1:ncomp) !this is the fixed liquid composition
43  xi(2,1) = 0.999
44  xi(2,2:ncomp) = (1. - xi(2,1)) / REAL(ncomp-1)
45 
46  !rhoi1 and rhoi2 are output values
47  call bubble_point_rachford_rice(iterate_t,converg,rhoi1,rhoi2)
48 
49 ! write(*,*)'converg p', converg, p
50 ! write(*,*)'xl',xi(1,1:ncomp)
51 ! write(*,*)'xv',xi(2,1:ncomp)
52 
53  !Calculate solubility coefficient H of component 1
54  !according to x1*H = y1*p
55  h = xi(2,1) * p / xi(1,1)
56  filename = './out.txt'
57  CALL file_open(filename,78)
58  ! write(78,*) H / 100000.
59  ! write(*,*)'Solubility Coefficient /bar', H/100000.0
60  if (ncomp == 2) then
61  h=xi(1,1)*mm(1)/(xi(1,2)*mm(2))/p*1e5
62  write(*,*)'Solubility Coefficient g/g/bar', h
63  elseif (ncomp == 3) then
64  h=xi(1,1)*mm(1)/(xi(1,2)*mm(2)+xi(1,3)*mm(3))/p
65  h=h*1100/mm(1)/1e-3
66  write(*,*)'Solubility Coefficient mol/m3/Pa', h,mm(1)
67  endif
68  write(78,*) h
69 
70 
71  End Subroutine bubblepointcalculation
72 
73 
74 End Module bubblepoint
WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWW Module STARTING_VALUES This m...
Definition: modules.f90:251
WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWW This module contains paramete...
Definition: modules.f90:29