69 Use basic_variables, Only: ncomp,t,p,ensemble_flag,num,parame,eos,pol,xif,compna,mm, &
70 surfactant, wif_surfactant
73 Use mod_dft
, Only: box,dzp,fa,zp,fa_disp,ab_disp,pbulk
74 Use vle_var
, ONLY: tc,pc,rhob,density
79 Use f90moduleinterfaces
85 #include <finclude/petscsys.h> 91 petscerrorcode :: ierr
95 character(80) :: filename=
'' 101 INTEGER :: position_surfactant
104 external forminitialguess
111 call petscinitialize(petsc_null_character,ierr)
112 call mpi_comm_rank(petsc_comm_world,user%rank,ierr)
113 call mpi_comm_size(petsc_comm_world,user%num_procs,ierr)
120 CALL file_open(filename,77)
124 READ (77,*) compna(i)
134 If(trim(compna(i)) ==
'surfactant')
Then 138 x_surfactant = xif(i)
139 position_surfactant = i
146 If(position_surfactant == 1)
Then 149 compna(i-1) = compna(i)
151 xif(1:ncomp) = xif(1:ncomp) / sum(xif(1:ncomp))
152 Else If(position_surfactant == ncomp + 1)
Then 153 xif(1:ncomp) = xif(1:ncomp) / sum(xif(1:ncomp))
156 If(i>position_surfactant)
Then 158 compna(i-1) = compna(i)
161 xif(1:ncomp) = xif(1:ncomp) / sum(xif(1:ncomp))
167 If(xif(1) /= xif(1))
Then 168 If(ncomp == 2) xif(1:ncomp) = 0.
169 If(ncomp > 2) xif(1:ncomp) = 1./
Real(ncomp)
184 IF ( num /= 0 )
CALL set_default_eos_numerical
199 If(surfactant) wif_surfactant = 0.01
205 CALL eos_const (ap, bp, dnm)
211 CALL vle_mix(rhob,density,chempot_total,user)
216 CALL crit_point_mix(tc,user)
233 CALL set_default_eos_numerical
240 call petscoptionsgetreal(petsc_null_character,
'-box',box,flg,ierr)
241 call petscoptionsgetint(petsc_null_character,
'-nx',ngrid,flg,ierr)
244 dzp = box /
REAL(ngrid) 246 fa(1:ncomp) = nint( parame(1:ncomp,2) / dzp )
249 ALLOCATE(fa_disp(ncomp),ab_disp(ncomp))
251 fa_disp(1:ncomp) = nint( psi_factor *
REAL(fa(1:ncomp)) )
253 if( mod(fa_disp(i),2) /= 0 ) fa_disp(i) = fa_disp(i) + 1
257 ab_disp(1:ncomp) = psi_factor * dhs(1:ncomp)
260 ngp = 2 * maxval(fa_disp(1:ncomp)) + 5
262 Allocate(zp(-ngp:ngrid+ngp))
265 zp(i) =
REAL(i) * dzp
268 pbulk = ( p * 1.e-30 ) / ( kbol*t* rhob(1,0) ) * rhob(1,0)
272 CALL perturbation_parameter
WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWW This module contains constant...
WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWW This module contains paramete...
WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWW This module contains paramete...
This module contains variables associated with the PETSc solver.
WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWW This module contains the vari...
subroutine vle_mix(rhob, density, chemPot_total, user)
subroutine formfunction(snes, X, F, user, ierr)
The subroutine FormFunction is a wrapper function which takes care of handling the global PETSc data ...
In this module, the application context is defined.
WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWW This module contains paramete...