12 use in_out
, only:set_paths,read_inputs,load_old_results
13 use integration
, only:bblpreproc,bblinteg
16 public onegrowth,eta_rm,bub_vf,secondgrowth,shooting_method,&
26 use phys_prop
, only:rb_initialized
27 rb_initialized=.false.
32 rb_initialized=.false.
33 end subroutine onegrowth
42 subroutine secondgrowth
45 use fson_value_m
, only: fson_value_get
47 type(fson_value),
pointer :: json_data
51 write(*,*)
'loading input file ',trim(
inputs)
52 json_data => fson_parse(
inputs)
53 call fson_get(json_data,
"bubbleGrowth.finalTime", tend)
60 end subroutine secondgrowth
69 real(dp) function nextradius(n,rad_ini)
71 integer,
intent(in) :: n
72 real(dp),
dimension(n),
intent(in) :: rad_ini
77 end function nextradius
86 subroutine rad_residual(n,x,fvec,iflag)
88 integer,
intent(in) :: n
89 integer,
intent(inout) :: iflag
90 real(dp),
dimension(n),
intent(in) :: x
91 real(dp),
dimension(n),
intent(out) :: fvec
94 end subroutine rad_residual
103 subroutine shooting_method
107 use fson_value_m
, only: fson_value_get
108 integer,
parameter :: n=1
110 real (dp) :: rad_ini,frad_ini,tol=1e-8_dp
111 real (dp),
dimension(n) :: x,fvec,diag
112 type(fson_value),
pointer :: json_data
116 write(*,*)
'loading input file ',trim(
inputs)
117 json_data => fson_parse(
inputs)
118 call fson_get(json_data,
"initialConditions.bubbleRadius",
r0)
120 goalradius=bub_rad(
size(bub_rad(:,1)),bub_inx+1)
124 call hbrd(rad_residual,n,x,fvec,epsilon(pi),tol,info,diag)
126 write(unit=*, fmt=*)
'Shooting method failed.' 127 write(unit=*, fmt=*)
'Hbrd returned info = ',info
132 write(unit=*, fmt=*)
'First guess initial radius = ',rad_ini
133 write(unit=*, fmt=*)
'Converged initial radius = ',
r0 134 write(unit=*, fmt=*)
'Goal radius = ',
goalradius 135 write(unit=*, fmt=*)
'Final converged radius = ',
radius 136 end subroutine shooting_method
145 subroutine shooting_method_test
148 integer,
parameter :: n=1
150 real (dp) :: rad_ini,frad_ini,tol=1e-8_dp
151 real (dp),
dimension(n) :: x,fvec,diag
161 call hbrd(rad_residual,n,x,fvec,epsilon(pi),tol,info,diag)
163 write(unit=*, fmt=*)
'Shooting method failed.' 164 write(unit=*, fmt=*)
'Hbrd returned info = ',info
169 write(unit=*, fmt=*)
'First guess initial radius = ',rad_ini
170 write(unit=*, fmt=*)
'Converged initial radius = ',
r0 171 write(unit=*, fmt=*)
'Goal radius = ',
goalradius 172 write(unit=*, fmt=*)
'First guess final radius = ',frad_ini
173 write(unit=*, fmt=*)
'Final converged radius = ',
radius 174 end subroutine shooting_method_test
183 real(dp) function eta_rm(t)
185 real(dp),
intent(in) :: t
191 call pwl_interp_1d (
size(etat(:,1)), etat(:,1), etat(:,2), ni, xi, yi )
201 real(dp) function bub_vf(t)
203 real(dp),
intent(in) :: t
208 call pwl_interp_1d (
size(port(:,1)), port(:,1), port(:,2), ni, xi, yi )
character(len=99) inputs
input file
real(dp) radius
bubble radius (m)
real(dp) goalradius
final radius we want to achieve
logical shooting
am I using shooting method (t/f)
real(dp) r0
initial radius
namespace with global variables