MoDeNa  1.0
Software framework facilitating sequential multi-scale modelling
mod_basic_variables.f90
1 !WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWW
2 ! This module contains parameters and variables ....
3 ! ................
4 !WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWW
5 
6 Module parameters
7 
8  implicit none
9  save
10 
11  integer, parameter :: nc = 10
12  integer, parameter :: np = 3
13  integer, parameter :: nsite = 5
14 
15  real, parameter :: pi = 3.141592653589793
16  real, parameter :: rgas = 8.31441
17  real, parameter :: nav = 6.022045e23
18  real, parameter :: kbol = rgas / nav
19  real, parameter :: tau = pi / 3.0 / sqrt(2.0)
20 
21 End Module parameters
22 
23 
24 
25 !WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWW
26 ! This module contains parameters and variables ....
27 ! ................
28 !WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWW
29 
30 Module basic_variables
31 
32  use parameters, only: nc, np, nsite
33  implicit none
34  save
35 
36 ! ----------------------------------------------------------------------
37 ! basic quantities defining the mixture
38 ! ----------------------------------------------------------------------
39  integer :: ncomp
40  integer :: nphas
41 
42  real :: t
43  real :: p
44  real, dimension(np) :: dense
45 
46  real, dimension(np, nc) :: xi
47  real, dimension(np, nc) :: lnx
48  real, dimension(nc) :: xif
49  ! real, dimension(nc) :: rhoi_f
50  real, dimension(nc) :: my_f
51 
52  real, dimension(nc) :: mm
53  real, dimension(np, nc, nsite) :: mxx
54 
55  real :: alpha
56 
57 
58 ! ----------------------------------------------------------------------
59 ! pure component parameters
60 ! ----------------------------------------------------------------------
61  real, dimension(nc, 25) :: parame = 0.0
62  real, dimension(nc) :: chir
63  character*30, dimension(nc) :: compna
64  real, dimension(nc, nc) :: kij, lij
65  real, dimension(nc, nc) :: e_lc, s_lc
66  real, dimension(nc) :: lli, phi_criti, chap
67 
68 
69 ! ----------------------------------------------------------------------
70 ! thermodynamic quantities
71 ! ----------------------------------------------------------------------
72  real, dimension(np) :: densta
73  real, dimension(0:nc*np+6) :: val_init, val_conv
74 
75  real, dimension(np,nc) :: rhoi_cal
76  real, dimension(np) :: p_cal, z_cal
77  real, dimension(np,nc) :: my_cal
78  real, dimension(np) :: gibbs, f_res
79  real :: h_lv
80  real, dimension(np) :: enthal, entrop, cpres
81  real, dimension(np) :: speed_of_sound
82 
83  real, dimension(np) :: dp_dz, dp_dz2
84 
85 
86 ! ----------------------------------------------------------------------
87 ! choice of EOS-model and solution method
88 ! ----------------------------------------------------------------------
89  integer :: eos, pol
90  integer :: num
91  character (LEN=2) :: ensemble_flag
92  character (LEN=10) :: rgt_variant
93 
94 
95 ! ----------------------------------------------------------------------
96 ! for input/output
97 ! ----------------------------------------------------------------------
98  integer :: outp, bindiag
99  real :: u_in_t, u_out_t, u_in_p, u_out_p
100 
101 
102 ! ----------------------------------------------------------------------
103 ! quantities defining the numerical procedure
104 ! ----------------------------------------------------------------------
105  integer :: n_unkw
106 
107  real :: step_a, acc_a !, acc_i
108  real, dimension(nc) :: scaling
109  real, dimension(3500) :: plv_kon
110  real, dimension(2, 3500) :: d_kond
111 
112  character*3, dimension(10) :: it, sum_rel
113  character*3 :: running
114  logical :: check_stability_of_phases = .false.
115 
116 End Module basic_variables
117 
118 
119 
120 
121 !WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWW
122 ! This module contains parameters and variables ....
123 ! ................
124 !WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWW
125 
126 Module eos_variables
127 
128  use parameters, only: nc, nsite, pi, kbol, tau, nav
129  use basic_variables, only: ncomp, eos, t, p, parame, e_lc, s_lc, chir, &
130  lli, phi_criti, chap, kij, lij, ensemble_flag
131  implicit none
132  save
133 
134 ! ----------------------------------------------------------------------
135 ! basic quantities defining the mixture (single phase)
136 ! ----------------------------------------------------------------------
137  real :: x(nc)
138  real :: eta_start
139  real :: eta
140  real :: rho
141 
142 ! ----------------------------------------------------------------------
143 ! thermodynamic quantities
144 ! ----------------------------------------------------------------------
145  real :: fres
146  real :: lnphi(nc)
147  real :: pges
148  real :: pgesdz
149  real :: pgesd2
150  real :: pgesd3
151 
152  real :: h_res
153  real :: cp_res
154  real :: s_res
155  real :: speed_sound
156 
157 ! ----------------------------------------------------------------------
158 ! quantities of fluid theory
159 ! ----------------------------------------------------------------------
160  real :: gij(nc,nc)
161  real :: mx(nc,nsite)
162 
163  real :: mseg(nc)
164  real :: dhs(nc)
165  real :: uij(nc,nc)
166  real :: sig_ij(nc,nc)
167 
168  real :: order1
169  real :: order2
170  real :: apar(0:6)
171  real :: bpar(0:6)
172 
173  real :: z0t
174  real :: z1t
175  real :: z2t
176  real :: z3t
177 
178  integer :: nhb_typ(nc)
179  real :: ass_d(nc,nc,nsite,nsite)
180  real :: nhb_no(nc,nsite)
181  real :: dij_ab(nc,nc)
182 
183 ! ----------------------------------------------------------------------
184 ! auxilliary quantities
185 ! ----------------------------------------------------------------------
186  real :: tfr
187  integer :: phas
188 
189  character (LEN = 2) :: dd_term, qq_term, dq_term
190 
191  real :: densav(3), denold(3)
192  real :: density_error(3)
193 
194  real :: alpha_nematic
195  real :: alpha_test(2)
196 
197 End Module eos_variables
198 
199 
200 
201 !WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWW
202 ! This module contains parameters and variables ....
203 ! ................
204 !WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWW
205 
206 Module eos_constants
207 
208  use parameters, only: nc
209  implicit none
210  save
211 
212  real, dimension(0:6,3) :: ap, bp
213 
214  real, dimension(28) :: c_dd, n_dd, m_dd, k_dd, o_dd
215  real, dimension(nc,nc,0:4) :: qqp2, qqp4, ddp2, ddp4, dqp2, dqp4
216  real, dimension(nc,nc,nc,0:4) :: qqp3, ddp3, dqp3
217 
218 End Module eos_constants
219 
220 
221 !WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWW
222 ! This module contains parameters and variables ....
223 ! ................
224 !WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWW
225 
227 
228  use eos_variables, only: dd_term, qq_term, dq_term
229 
230  implicit none
231  save
232 
233  character (LEN=9) :: ideal_gas ! (yes, no)
234  character (LEN=9) :: hard_sphere ! (CSBM, no)
235  character (LEN=9) :: chain_term ! (TPT1, no)
236  character (LEN=9) :: disp_term ! (PC-SAFT, CK, no)
237  character (LEN=9) :: hb_term ! (TPT1_Chap, no)
238  character (LEN=9) :: lc_term ! (MSaupe, no)
239  character (LEN=9) :: branch_term ! (TPT2, no)
240  character (LEN=9) :: ii_term ! (......., no)
241  character (LEN=9) :: id_term ! (......., no)
242 
243  character (LEN=9) :: subtract1 ! (1PT, 2PT, no)
244  character (LEN=9) :: subtract2 ! (ITTpolar, no)
245 
246  character (LEN=9) :: save_eos_terms(12)
247 
248 End Module eos_numerical_derivatives
249 
250 
251 !WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWW
252 ! This module contains parameters and variables ....
253 ! ................
254 !WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWW
255 
256 Module fitting_rgt_parameters
257 
258  INTEGER :: critfit
259  REAL :: tcf, pcf, rcf
260  REAL :: llfit, phifit, chapfit
261 
262 End Module fitting_rgt_parameters
WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWW This module contains constant...
Definition: modules.f90:6
WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWW This module contains paramete...
Definition: modules.f90:200
WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWW This module contains paramete...
Definition: modules.f90:120
WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWW This module contains paramete...
Definition: modules.f90:29
WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWW This module contains paramete...
Definition: modules.f90:220