10 integer,
dimension(:),
allocatable :: fi
11 public read_inputs,save_int_header,save_int_step,save_int_close,&
16 subroutine read_inputs
19 use fson_value_m
, only: fson_value_get
20 character(len=1024) :: strval
21 type(fson_value),
pointer :: json_data
22 json_data => fson_parse(
"../inputs/wallDrainage_inputs.json")
23 call fson_get(json_data,
"initialConditions.centerThickness",
hi)
26 call fson_get(json_data,
"growthRate",
gr)
27 call fson_get(json_data,
"initialConditions.domainSize",
rd)
28 call fson_get(json_data,
"initialConditions.filmReduction",
dstr)
29 call fson_get(json_data,
"integration.initialTime",
initialtime)
30 call fson_get(json_data,
"integration.outerTimeSteps",
its)
34 print*,
'unknown growth rate model' 37 call fson_get(json_data,
"physicalProperties.viscosityModel",
viscositymodel)
39 call fson_get(json_data,
"physicalProperties.viscosity",
mu)
43 print*,
'unknown viscosity model' 46 call fson_get(json_data,
"physicalProperties.surfaceTension",
gam)
47 call fson_get(json_data,
"physicalProperties.disjoiningPressure.N",
ndp)
48 call fson_get(json_data,
"physicalProperties.disjoiningPressure.M",
mdp)
49 call fson_get(json_data,
"physicalProperties.disjoiningPressure.hst",
cdp)
50 call fson_get(json_data,
"physicalProperties.disjoiningPressure.C",
hdp)
51 call fson_get(json_data,
"physicalProperties.disjoiningPressure.B1",
bdp)
52 call fson_get(json_data,
"integration.timeStep",
timestep)
53 call fson_get(json_data,
"integration.method", strval)
54 if (strval==
"stiff")
then 57 print*,
"unknown integration method" 60 call fson_get(json_data,
"integration.internalNodes",
meshpoints)
61 call fson_get(json_data,
"integration.maxInnerTimeSteps",
maxts)
62 call fson_get(json_data,
"integration.relativeTolerance",
int_reltol)
63 call fson_get(json_data,
"integration.absoluteTolerance",
int_abstol)
64 call fson_get(json_data,
"algebraicEquationSolver.tolerance",
ae_tol)
66 call fson_destroy(json_data)
67 end subroutine read_inputs
73 subroutine save_int_header
74 use ioutils
, only: newunit
76 open (unit=newunit(fi(1)), file =
'filmthickness.csv')
77 open (unit=newunit(fi(2)), file =
'results_1d.csv')
78 write(*,
'(1x,100a12)')
'time:',
'dr:',
'total: ',
'struts:',&
79 'hmin: ',
'hloc: ',
'hcenter: ',
'havg: ' 80 write(unit=fi(2), fmt=
'(10000a12)')
'time',
'dr',
'np',
'vt',
'fs',&
81 'hmin',
'hloc',
'hcenter',
'havg' 82 end subroutine save_int_header
88 subroutine save_int_step(y,t)
89 use constants
, only: dp
91 use phys_prop
, only: volume_balance,min_film_thickness
92 real(dp),
intent(in) :: t
93 real(dp),
dimension(:),
intent(in) :: y
95 real(dp) :: fs,vt,hmin,hloc,havg
97 call volume_balance(y,vt,fs)
98 call min_film_thickness(y,hmin,hloc,havg)
99 write(*,
'(100es12.3)') t,
dr,vt,fs,hmin,hloc,y(1),havg
100 write(fi(1),
"(10000es12.4)") y(1:neq)
101 write(unit=fi(2), fmt=
'(10000es12.4)') &
102 t,
dr,dble(neq),vt,fs,hmin,hloc,y(1),havg
103 end subroutine save_int_step
109 subroutine save_int_close
112 end subroutine save_int_close
118 subroutine load_bubble_growth(matrix)
119 use constants
, only: dp
120 use ioutils
, only: newunit
122 real(dp),
dimension(:,:),
allocatable,
intent(inout) :: matrix
123 integer :: i,j,ios,fi
125 open(newunit(fi),file=
'../results/bubbleGrowth/bblgr_2_drain.out')
127 read(fi,*,iostat=ios)
131 if (
allocated(matrix))
deallocate(matrix)
132 allocate(matrix(j-1,4))
136 read(fi,*) matrix(i,:)
139 end subroutine load_bubble_growth
real(dp) gam
surface tension
integer meshpoints
number of discretization points in space
character(len=1024) growthratemodel
growth rate model (constantGrowth, fromFile)
real(dp) strutfilmparameter
parameter determining strut-film boundary
real(dp) hi
film thickness at center
real(dp) int_reltol
relative tolerance of integrator
character(len=1024) viscositymodel
viscosity model (constant, fromFile)
real(dp) cdp
disjoining pressure constant
integer int_method
type of integration method (see MF in ODEPACK)
real(dp) bdp
disjoining pressure constant, set to zero for no DP
real(dp) ndp
disjoining pressure constant
real(dp) dstr
where strut starts in initial domain
real(dp) ae_tol
tolerance of algebraic equation solver
real(dp) timestep
timestep
integer its
number of outer integration outer time steps
real(dp) int_abstol
absolute tolerance of integrator
namespace with global variables
real(dp) rd
computational domain size (radius)
real(dp) initialtime
starting time
real(dp) hdp
disjoining pressure constant
integer maxts
maximum inner time steps between t and t+h
real(dp) mdp
disjoining pressure constant
real(dp) dr
mesh points spacing