MoDeNa  1.0
Software framework facilitating sequential multi-scale modelling
Modules.F90
1 
5 
6 Module parameters
7 
8  implicit none
9  save
10 
11  integer, parameter :: nc = 3
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 real :: muhs(3)
22 real :: muhc(3)
23 real :: mudisp(3)
24 
25 
26 
27 End Module parameters
28 
29 
30 
31 
32 
33 Module vle_var
34 USE parameters, ONLY: nc,np
35 implicit none
36 
37 REAL :: tc
38 REAL :: pc
39 REAL :: rhob(2,0:nc)
40 REAL :: density(np)
41 
42 End Module vle_var
43 
44 
45 
46 
47 
48 
49 
50 
55 
56 Module basic_variables
57 
58  use parameters, only: nc, np, nsite
59  implicit none
60  save
61 
62 ! ----------------------------------------------------------------------
63 ! basic quantities defining the mixture
64 ! ----------------------------------------------------------------------
65  integer :: ncomp
66  integer :: nphas
67 
68  real :: t
69  !real :: tc
70  real :: p
71  real, dimension(np) :: dense
72  !real, dimension(np) :: rhob
73 
74  real, dimension(np, nc) :: xi
75  real, dimension(np, nc) :: lnx
76  real, dimension(nc) :: xif
77 
78  real, dimension(nc) :: mm
79  real, dimension(np, nc, nsite) :: mxx
80 
81  real :: alpha
82 
83 
84 ! ----------------------------------------------------------------------
85 ! pure component parameters
86 ! ----------------------------------------------------------------------
87  real, dimension(nc, 25) :: parame = 0.0
88  real, dimension(nc) :: chir
89  character*30, dimension(nc) :: compna
90  real, dimension(nc, nc) :: kij, lij
91  real, dimension(nc, nc) :: e_lc, s_lc
92  real, dimension(nc) :: lli, phi_criti, chap
93 
94 
95 ! ----------------------------------------------------------------------
96 ! thermodynamic quantities
97 ! ----------------------------------------------------------------------
98  real, dimension(np) :: densta
99  real, dimension(0:nc*np+6) :: val_init, val_conv
100 
101  real :: h_lv
102  real, dimension(np) :: cpres, enthal, entrop, gibbs, f_res
103 
104  real, dimension(np) :: dp_dz, dp_dz2
105 
106 
107 ! ----------------------------------------------------------------------
108 ! choice of EOS-model and solution method
109 ! ----------------------------------------------------------------------
110  integer :: eos, pol
111  integer :: num
112  character (LEN=2) :: ensemble_flag
113  character (LEN=10) :: rgt_variant
114 
115 
116 ! ----------------------------------------------------------------------
117 ! for input/output
118 ! ----------------------------------------------------------------------
119  integer :: outp, bindiag
120  real :: u_in_t, u_out_t, u_in_p, u_out_p
121 
122 
123 ! ----------------------------------------------------------------------
124 ! quantities defining the numerical procedure
125 ! ----------------------------------------------------------------------
126  integer :: n_unkw
127 
128  real :: step_a, acc_a !, acc_i
129  real, dimension(nc) :: scaling
130  real, dimension(3500) :: plv_kon
131  real, dimension(2, 3500) :: d_kond
132 
133  character*3, dimension(10) :: it, sum_rel
134  character*3 :: running
135 
136 
137 !for surfactant
138 Real :: wif_surfactant
139 LOGICAL :: surfactant
140 
141 
142 End Module basic_variables
143 
144 
145 
146 
151 
152 Module eos_variables
153 
154  use parameters, only: nc, nsite, pi, kbol, tau, nav
155  use basic_variables, only: ncomp, eos, t, p, parame, e_lc, s_lc, chir, &
156  lli, phi_criti, chap, kij, lij, ensemble_flag
157  implicit none
158  save
159 
160 ! ----------------------------------------------------------------------
161 ! basic quantities defining the mixture (single phase)
162 ! ----------------------------------------------------------------------
163  real :: x(nc)
164  real :: eta_start
165  real :: eta
166  real :: rho
167 
168 ! ----------------------------------------------------------------------
169 ! thermodynamic quantities
170 ! ----------------------------------------------------------------------
171  real :: fres
172  real :: lnphi(nc)
173  real :: pges
174  real :: pgesdz
175  real :: pgesd2
176  real :: pgesd3
177 
178  real :: h_res
179  real :: cp_res
180  real :: s_res
181 
182 ! ----------------------------------------------------------------------
183 ! quantities of fluid theory
184 ! ----------------------------------------------------------------------
185  real :: gij(nc,nc)
186  real :: mx(nc,nsite)
187 
188  real :: mseg(nc)
189  real :: dhs(nc)
190  real :: uij(nc,nc)
191  real :: sig_ij(nc,nc)
192  real :: vij(nc,nc)
193 
194  real :: um
195  real :: order1
196  real :: order2
197  real :: apar(0:6)
198  real :: bpar(0:6)
199 
200  real :: z0t
201  real :: z1t
202  real :: z2t
203  real :: z3t
204 
205  integer :: nhb_typ(nc)
206  real :: ass_d(nc,nc,nsite,nsite)
207  real :: nhb_no(nc,nsite)
208  real :: dij_ab(nc,nc)
209 
210 ! ----------------------------------------------------------------------
211 ! auxilliary quantities
212 ! ----------------------------------------------------------------------
213  real :: tfr
214  integer :: phas
215 
216  character (LEN = 2) :: dd_term, qq_term, dq_term
217 
218  real :: densav(3), denold(3)
219  real :: density_error(3)
220 
221  real :: alpha_nematic
222  real :: alpha_test(2)
223 
224 End Module eos_variables
225 
226 
227 
231 
232 Module eos_constants
233 
234  use parameters, only: nc
235  implicit none
236  save
237 
238  real, dimension(0:6,3) :: ap, bp
239  real, dimension(4,9) :: dnm
240 
241  real, dimension(28) :: c_dd, n_dd, m_dd, k_dd, o_dd
242  real, dimension(nc,nc,0:8) :: qqp2, qqp4, ddp2, ddp4, dqp2, dqp4
243  real, dimension(nc,nc,nc,0:8) :: qqp3, ddp3, dqp3
244 
245 End Module eos_constants
246 
251 
253 
254  use eos_variables, only: dd_term, qq_term, dq_term
255 
256  implicit none
257  save
258 
259  character (LEN=9) :: ideal_gas ! (yes, no)
260  character (LEN=9) :: hard_sphere ! (CSBM, no)
261  character (LEN=9) :: chain_term ! (TPT1, no)
262  character (LEN=9) :: disp_term ! (PC-SAFT, CK, no)
263  character (LEN=9) :: hb_term ! (TPT1_Chap, no)
264  character (LEN=9) :: lc_term ! (MSaupe, no)
265  character (LEN=9) :: branch_term ! (TPT2, no)
266  character (LEN=9) :: ii_term ! (......., no)
267  character (LEN=9) :: id_term ! (......., no)
268 
269  character (LEN=9) :: subtract1 ! (1PT, 2PT, no)
270  character (LEN=9) :: subtract2 ! (ITTpolar, no)
271 
272  character (LEN=9) :: save_eos_terms(10)
273 
274 End Module eos_numerical_derivatives
275 
276 
282 
283  Module starting_values
284 
285  use parameters, only: nc
286  implicit none
287  save
288 
289  REAL, DIMENSION(nc) :: rhoif, rhoi1, rhoi2, grad_fd
290  REAL :: fdenf
291 
292  End Module starting_values
293 
294 
295 
296 
297 
303  Module dft_module
304 
305  use parameters, only: nc
306  implicit none
307  save
308 
309 INTEGER, PARAMETER :: ndft = 4000
310 INTEGER, PARAMETER :: ndft2 = 4000
311 
312 INTEGER, PARAMETER :: r_grid = 200
313  integer :: discret
314  REAL :: box_l_no_unit
315 ! REAL :: pbulk
316  INTEGER :: kmax, den_step
317  LOGICAL :: shift, wca, mft
318  REAL :: rc, rg, dzr, tau_cut
319  REAL :: d_hs, dhs_st, z3t_st
320  REAL :: z_ges
321  REAL, DIMENSION(r_grid) :: x1a
322  REAL, DIMENSION(NDFT) :: x2a
323  REAL, DIMENSION(r_grid,NDFT) :: ya, y1a, y2a, y12a
324  REAL, DIMENSION(r_grid,NDFT,4,4) :: c_bicub
325  REAL :: fres_temp
326 ! REAL :: free
327 
328  REAL, DIMENSION(r_grid) :: x1a_11
329  REAL, DIMENSION(NDFT) :: x2a_11
330  REAL, DIMENSION(r_grid,NDFT) :: ya_11, y1a_11, y2a_11, y12a_11
331  REAL, DIMENSION(r_grid,NDFT,4,4) :: c_bicub_11
332  REAL, DIMENSION(r_grid) :: x1a_12
333  REAL, DIMENSION(NDFT) :: x2a_12
334  REAL, DIMENSION(r_grid,NDFT) :: ya_12, y1a_12, y2a_12, y12a_12
335  REAL, DIMENSION(r_grid,NDFT,4,4) :: c_bicub_12
336  REAL, DIMENSION(r_grid) :: x1a_22
337  REAL, DIMENSION(NDFT) :: x2a_22
338  REAL, DIMENSION(r_grid,NDFT) :: ya_22, y1a_22, y2a_22, y12a_22
339  REAL, DIMENSION(r_grid,NDFT,4,4) :: c_bicub_22
340 
341  End Module dft_module
342 
343 
344 Module rdf_variables
345 
346  implicit none
347  save
348 
349  real, dimension(0:20) :: fac(0:20)
350 
351 End Module rdf_variables
352 
353 
359 Module dft_fcn_module
360 
361 use parameters, only: nc
362  implicit none
363 
364 !INTEGER :: irc(nc),irc_j,ih,fa(nc)
365 ! REAL, DIMENSION(-NDFT:NDFT) :: zp
366 ! REAL, DIMENSION(-NDFT:NDFT) :: f_tot
367 ! REAL, DIMENSION(-NDFT:NDFT,2) :: dF_drho_tot
368 ! REAL :: rhob_dft(2,0:nc)
369  !REAL :: my0(nc)
370  REAL :: chempot_total(nc)
371  REAL :: chempot_res(nc)
372 
373 End Module dft_fcn_module
374 
375 
376 Module mod_dft
377 
378 Implicit None
379 
380 REAL :: box !box length [A]
381 !INTEGER :: ngrid !grid points
382 !INTEGER :: ngp !ghost points
383 REAL :: dzp !grid spacing [A]
384 INTEGER,allocatable :: fa(:) !grid points per sigma [-]
385 REAL, allocatable :: zp(:) !z-distance from origin [A]
386 INTEGER,allocatable :: fa_disp(:) !integraition interval for dispersion wda
387 REAL,allocatable :: ab_disp(:) !integraition interval for dispersion wda
388 REAL :: pbulk, free
389 
390 
391 
392 End Module mod_dft
393 
394 
395 
396 
397 
398 
399 
400 
401 
402 
403 !WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWW
404 ! Module Module_Heidemann_Khalil
405 !
406 ! This module ....
407 !WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWW
408 !
409  Module module_heidemann_khalil
410 
411  implicit none
412  save
413 
414  real :: error_condition2
415 
416  End Module
417 
418 
419 
420 
421 
422 
423 
424 
425 
426 
427 
428 
429 
430 
431 
432 
433 
434 
435 
436 
437 
438 
439 
440 
441 
442 
443 
444 
445 
446 
447 
448 
449 
450 
451 
452 
453 
454 
455 
456 
457 
458 
459 ! ! ! Module PARAMETERS
460 ! ! !
461 ! ! ! Implicit None
462 ! ! !
463 ! ! ! REAL, parameter :: PI = 3.141592653589793
464 ! ! ! Integer, parameter :: nc = 3
465 ! ! ! Integer, parameter :: np = 3
466 ! ! !
467 ! ! ! End Module PARAMETERS
468 ! ! !
469 ! ! !
470 ! ! !
471 ! ! !
472 ! ! !
473 ! ! !
474 ! ! !
475 ! ! !
476 ! ! ! Module BASIC_VARIABLES
477 ! ! !
478 ! ! ! Use Parameters, Only: nc
479 ! ! !
480 ! ! ! Implicit None
481 ! ! !
482 ! ! ! INTEGER :: ncomp
483 ! ! ! REAL :: t
484 ! ! ! REAL :: kij(nc,nc)
485 ! ! ! Integer :: eos, pol
486 ! ! ! Integer :: num
487 ! ! ! character (LEN=2) :: ensemble_flag
488 ! ! !
489 ! ! !
490 ! ! ! End Module BASIC_VARIABLES
491 ! ! !
492 ! ! !
493 ! ! !
494 ! ! !
495 ! ! ! Module EOS_VARIABLES
496 ! ! !
497 ! ! ! Implicit None
498 ! ! !
499 ! ! !
500 ! ! ! REAL, allocatable :: mseg(:)
501 ! ! ! REAL, allocatable :: eps(:)
502 ! ! ! REAL, allocatable :: sig(:)
503 ! ! ! REAL, allocatable :: dhs(:)
504 ! ! !
505 ! ! ! REAL :: eta
506 ! ! ! REAL :: rho
507 ! ! ! REAL, allocatable :: xx(:)
508 ! ! ! REAL,allocatable :: sig_ij(:,:), uij(:,:)
509 ! ! !
510 ! ! ! character (LEN = 2) :: dd_term, qq_term, dq_term
511 ! ! !
512 ! ! ! End Module EOS_VARIABLES
513 ! ! !
514 ! ! !
515 ! ! !
516 ! ! !
517 ! ! !
518 ! ! ! Module EOS_CONSTANTS
519 ! ! !
520 ! ! ! Implicit None
521 ! ! !
522 ! ! ! REAL :: ap(0:6,3),bp(0:6,3)
523 ! ! !
524 ! ! ! End Module EOS_CONSTANTS
525 ! ! !
526 ! ! !
527 ! ! !
528 ! ! !
529 ! ! !
530 ! ! !
531 ! ! !
532 ! ! !
WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWW This module contains constant...
Definition: modules.f90:6
WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWW This module contains paramete...
Definition: modules.f90:200
WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWW Module DFT_MODULE This module...
Definition: modules.f90:272
WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWW This module contains paramete...
Definition: modules.f90:120
WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWW This module contains the vari...
Definition: modules.f90:327
WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWW Module STARTING_VALUES This m...
Definition: modules.f90:251
WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWW This module contains paramete...
Definition: modules.f90:29
WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWW This module contains paramete...
Definition: modules.f90:220