Skip to content

Commit 733fb17

Browse files
author
Diego Vaca
committed
Lagrange bubbles fixing PR part 5
1 parent 1fb0954 commit 733fb17

File tree

11 files changed

+191
-192
lines changed

11 files changed

+191
-192
lines changed

src/common/m_constants.fpp

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -46,25 +46,28 @@ module m_constants
4646
! RKCK constants
4747
integer, parameter :: num_ts_rkck = 6 !< Number of time-stages in the RKCK stepper
4848
! RKCK 4th/5th time stepper coefficients based on Cash J. and Karp A. (1990)
49-
real(kind(0d0)), parameter :: rkck_c1 = 0.0d0, rkck_c2 = 0.2d0, rkck_c3 = 0.3d0, rkck_c4 = 0.6d0, & ! c1 c2 c3 c4 c5 c6
49+
real(kind(0d0)), parameter :: rkck_c1 = 0.0d0, rkck_c2 = 0.2d0, rkck_c3 = 0.3d0, rkck_c4 = 0.6d0, & ! c1 c2 c3 c4 c5 c6
5050
rkck_c5 = 1.0d0, rkck_c6 = 0.875d0
51-
real(kind(0.d0)), dimension(6), parameter :: rkck_coef1 = (/0.2d0, 0.0d0, 0.0d0, 0.0d0, 0.0d0, 0.0d0/) ! a21
52-
real(kind(0.d0)), dimension(6), parameter :: rkck_coef2 = (/3.0d0/40.0d0, 9.0d0/40.0d0, 0.0d0, 0.0d0, & ! a31 a32
51+
real(kind(0.d0)), dimension(6), parameter :: rkck_coef1 = (/0.2d0, 0.0d0, 0.0d0, 0.0d0, 0.0d0, 0.0d0/) ! a21
52+
real(kind(0.d0)), dimension(6), parameter :: rkck_coef2 = (/3.0d0/40.0d0, 9.0d0/40.0d0, 0.0d0, 0.0d0, & ! a31 a32
5353
0.0d0, 0.0d0/)
54-
real(kind(0.d0)), dimension(6), parameter :: rkck_coef3 = (/0.3d0, -0.9d0, 1.2d0, 0.0d0, 0.0d0, 0.0d0/) ! a41 a42 a43
55-
real(kind(0.d0)), dimension(6), parameter :: rkck_coef4 = (/-11.0d0/54.0d0, 2.5d0, -70.0d0/27.0d0, & ! a51 a52 a53 a54
54+
real(kind(0.d0)), dimension(6), parameter :: rkck_coef3 = (/0.3d0, -0.9d0, 1.2d0, 0.0d0, 0.0d0, 0.0d0/) ! a41 a42 a43
55+
real(kind(0.d0)), dimension(6), parameter :: rkck_coef4 = (/-11.0d0/54.0d0, 2.5d0, -70.0d0/27.0d0, & ! a51 a52 a53 a54
5656
35.d0/27.d0, 0.0d0, 0.0d0/)
57-
real(kind(0.d0)), dimension(6), parameter :: rkck_coef5 = (/1631.0d0/55296.0d0, 175.0d0/512.0d0, & ! a61 a62 a63 a64 a65
58-
575.d0/13824.d0, 44275.d0/110592.d0, 253.d0/4096.d0, 0.0d0/)
59-
real(kind(0.d0)), dimension(6), parameter :: rkck_coef6 = (/37.d0/378.d0, 0.0d0, 250.d0/621.d0, & ! b1 b2 b3 b4 b5 b6
57+
real(kind(0.d0)), dimension(6), parameter :: rkck_coef5 = (/1631.0d0/55296.0d0, 175.0d0/512.0d0, & ! a61 a62 a63 a64 a65
58+
575.d0/13824.d0, 44275.d0/110592.d0, &
59+
253.d0/4096.d0, 0.0d0/)
60+
real(kind(0.d0)), dimension(6), parameter :: rkck_coef6 = (/37.d0/378.d0, 0.0d0, 250.d0/621.d0, & ! b1 b2 b3 b4 b5 b6
6061
125.0d0/594.0d0, 0.0d0, 512.0d0/1771.0d0/)
61-
real(kind(0.d0)), dimension(6), parameter :: rkck_coefE = (/37.d0/378.d0 - 2825.0d0/27648.0d0, 0.0d0, & ! er1 er2 er3 er4 er5 er6 (4th/5th error)
62-
250.d0/621.d0 - 18575.0d0/48384.0d0, 125.0d0/594.0d0 - 13525.0d0/55296.0d0, &
62+
real(kind(0.d0)), dimension(6), parameter :: rkck_coefE = (/37.d0/378.d0 - 2825.0d0/27648.0d0, 0.0d0, & ! er1 er2 er3 er4 er5 er6 (4th/5th error)
63+
250.d0/621.d0 - 18575.0d0/48384.0d0, &
64+
125.0d0/594.0d0 - 13525.0d0/55296.0d0, &
6365
-277.0d0/14336.0d0, 512.0d0/1771.0d0 - 0.25d0/)
6466
! Adaptive rkck constants
6567
real(kind(0d0)), parameter :: verysmall_dt = 1.d-14 !< Very small dt, stop stepper
6668
real(kind(0d0)), parameter :: SAFETY = 0.9d0 !< Next dt will be maximum 0.9*dt if truncation error is above tolerance.
67-
real(kind(0d0)), parameter :: RNDDEC = 1.0d05 !< Need to round the relative truncation error (5th decimal) to avoid the inclusion of random decimals when dividing by a very small number (rkck_tolerance)
69+
real(kind(0d0)), parameter :: RNDDEC = 1.0d05 !< Need to round the relative truncation error (5th decimal) to avoid the inclusion of random decimals
70+
! after dividing calculated tolerance by a very small number (rkck_tolerance)
6871
real(kind(0d0)), parameter :: PSHRNK = -0.25d0 !< Factor to reduce dt when truncation error above tolerance
6972
real(kind(0d0)), parameter :: SHRNKDT = 0.5d0 !< Factor to reduce dt due to negative bubble radius
7073
real(kind(0d0)), parameter :: ERRCON = 1.89d-4 !< Limit to slightly increase dt when truncation error is between ERRCON and 1

src/simulation/m_bubbles_EL.fpp

Lines changed: 37 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ contains
162162
163163
end subroutine s_initialize_bubbles_EL_module
164164
165-
!> The purpose of this procedure is to start lagrange bubble parameters applying nondimensionalization if needed
165+
!> The purpose of this procedure is to start the lagrange bubble parameters applying nondimensionalization if needed
166166
subroutine s_start_lagrange_inputs()
167167
168168
integer :: id_bubbles, id_host
@@ -197,7 +197,7 @@ contains
197197
Web = 1d0/ss
198198
Re_inv = mul0
199199
200-
! Need improvements to accept polytropic gas compression, isothermal and adiabatic thermal models, and
200+
! Need improvement to accept polytropic gas compression, isothermal and adiabatic thermal models, and
201201
! the Gilmore and RP bubble models.
202202
polytropic = .false. ! Forcing no polytropic model
203203
thermal = 3 ! Forcing constant transfer coefficient model based on Preston et al., 2007
@@ -350,7 +350,7 @@ contains
350350
rhol, gamma, pi_inf, qv, Re)
351351
dynP = 0d0
352352
do i = 1, num_dims
353-
dynP = dynP + 0.5*q_cons_vf(contxe + i)%sf(cell(1), cell(2), cell(3))**2/rhol
353+
dynP = dynP + 0.5d0*q_cons_vf(contxe + i)%sf(cell(1), cell(2), cell(3))**2/rhol
354354
end do
355355
pliq = (q_cons_vf(E_idx)%sf(cell(1), cell(2), cell(3)) - dynP - pi_inf)/gamma
356356
if (pliq < 0) print *, "Negative pressure", proc_rank, &
@@ -359,14 +359,14 @@ contains
359359
! Initial particle pressure
360360
gas_p(bub_id, 1) = pliq + 2d0*(1d0/Web)/bub_R0(bub_id)
361361
if ((1d0/Web) /= 0d0) then
362-
pcrit = pv - 4d0*(1d0/Web)/(3.d0*sqrt(3d0*gas_p(bub_id, 1)*bub_R0(bub_id)**3/(2d0*(1d0/Web))))
362+
pcrit = pv - 4d0*(1d0/Web)/(3d0*sqrt(3d0*gas_p(bub_id, 1)*bub_R0(bub_id)**3d0/(2d0*(1d0/Web))))
363363
pref = gas_p(bub_id, 1)
364364
else
365365
pcrit = 0d0
366366
end if
367367

368368
! Initial particle mass
369-
volparticle = 4d0/3d0*pi*bub_R0(bub_id)**3 ! volume
369+
volparticle = 4d0/3d0*pi*bub_R0(bub_id)**3d0 ! volume
370370
gas_mv(bub_id, 1) = pv*volparticle*(1d0/(R_v*Tw))*(massflag) ! vapermass
371371
gas_mg(bub_id) = (gas_p(bub_id, 1) - pv*(massflag))*volparticle*(1d0/(R_n*Tw)) ! gasmass
372372
if (gas_mg(bub_id) <= 0d0) then
@@ -473,9 +473,9 @@ contains
473473
indomain = particle_in_domain(inputvals(1:3))
474474
if (indomain .and. (id > 0)) then
475475
bub_id = bub_id + 1
476-
nBubs = bub_id ! local number of bubbles
477-
lag_id(bub_id, 1) = id !global ID
478-
lag_id(bub_id, 2) = bub_id !local ID
476+
nBubs = bub_id ! local number of bubbles
477+
lag_id(bub_id, 1) = id ! global ID
478+
lag_id(bub_id, 2) = bub_id ! local ID
479479
mtn_pos(bub_id, 1:3, 1) = inputvals(1:3)
480480
mtn_posPrev(bub_id, 1:3, 1) = inputvals(4:6)
481481
mtn_vel(bub_id, 1:3, 1) = inputvals(7:9)
@@ -540,14 +540,14 @@ contains
540540
fV = intfc_vel(k, 2)
541541
fpb = gas_p(k, 2)
542542
pint = f_cpbw_KM(fR0, fR, fV, fpb)
543-
pint = pint + 0.5d0*fV**2
543+
pint = pint + 0.5d0*fV**2d0
544544
if (lag_params%cluster_type == 2) then
545545
bub_dphidt(k) = (paux - pint) + term2
546546
! Accounting for the potential induced by the bubble averaged over the control volume
547547
! Note that this is based on the incompressible flow assumption near the bubble.
548548
Rb = intfc_rad(k, 2)
549549
term1_fac = 3d0/2d0*(Rb*(Romega**2d0 - Rb**2d0))/(Romega**3d0 - Rb**3d0)
550-
bub_dphidt(k) = bub_dphidt(k)/(1 - term1_fac)
550+
bub_dphidt(k) = bub_dphidt(k)/(1d0 - term1_fac)
551551
end if
552552
end do
553553
end if
@@ -594,10 +594,10 @@ contains
594594
end do
595595
call s_convert_species_to_mixture_variables_acc(rhol, gamma, pi_inf, qv, myalpha, &
596596
myalpha_rho, Re, cell(1), cell(2), cell(3))
597-
call s_compute_cson_from_pinf(k, q_prim_vf, pinf, cell, rhol, gamma, pi_inf, cson)
597+
call s_compute_cson_from_pinf(q_prim_vf, pinf, cell, rhol, gamma, pi_inf, cson)
598598

599599
! Velocity correction due to massflux
600-
velint = fV - gas_dmvdt(k, stage)/(4d0*pi*fR**2*rhol)
600+
velint = fV - gas_dmvdt(k, stage)/(4d0*pi*fR**2d0*rhol)
601601

602602
! Interphase acceleration and update vars
603603
intfc_dveldt(k, stage) = f_rddot_KM(fpbdt, pinf, pliqint, rhol, fR, velint, fR0, cson)
@@ -641,20 +641,18 @@ contains
641641
!! @param gamma Liquid specific heat ratio
642642
!! @param pi_inf Liquid stiffness
643643
!! @param cson Calculated speed of sound
644-
subroutine s_compute_cson_from_pinf(bub_id, q_prim_vf, pinf, cell, rhol, gamma, pi_inf, cson)
644+
subroutine s_compute_cson_from_pinf(q_prim_vf, pinf, cell, rhol, gamma, pi_inf, cson)
645645
#ifdef _CRAYFTN
646646
!DIR$ INLINEALWAYS s_compute_cson_from_pinf
647647
#else
648648
!$acc routine seq
649649
#endif
650-
integer, intent(in) :: bub_id
651650
type(scalar_field), dimension(sys_size), intent(in) :: q_prim_vf
652651
real(kind(0d0)), intent(in) :: pinf, rhol, gamma, pi_inf
653652
integer, dimension(3), intent(in) :: cell
654653
real(kind(0d0)), intent(out) :: cson
655654

656655
real(kind(0d0)) :: E, H
657-
real(kind(0d0)), dimension(3) :: scoord
658656
real(kind(0d0)), dimension(num_dims) :: vel
659657
integer :: i
660658

@@ -817,7 +815,7 @@ contains
817815
real(kind(0d0)), intent(out), optional :: preterm1, term2, Romega
818816

819817
real(kind(0d0)), dimension(3) :: scoord, psi
820-
real(kind(0d0)) :: dc, vol, aux, dist
818+
real(kind(0d0)) :: dc, vol, aux
821819
real(kind(0d0)) :: volgas, term1, Rbeq, denom
822820
real(kind(0d0)) :: charvol, charpres, charvol2, charpres2
823821
integer, dimension(3) :: cellaux
@@ -998,22 +996,22 @@ contains
998996

999997
end if
1000998

1001-
if (lag_params%pressure_corrector .and. present(preterm1)) then
999+
if (lag_params%pressure_corrector) then
10021000

10031001
!Valid if only one bubble exists per cell
1004-
volgas = intfc_rad(bub_id, 2)**3
1005-
denom = intfc_rad(bub_id, 2)**2
1006-
term1 = bub_dphidt(bub_id)*intfc_rad(bub_id, 2)**2
1007-
term2 = intfc_vel(bub_id, 2)*intfc_rad(bub_id, 2)**2
1002+
volgas = intfc_rad(bub_id, 2)**3d0
1003+
denom = intfc_rad(bub_id, 2)**2d0
1004+
term1 = bub_dphidt(bub_id)*intfc_rad(bub_id, 2)**2d0
1005+
term2 = intfc_vel(bub_id, 2)*intfc_rad(bub_id, 2)**2d0
10081006

10091007
Rbeq = volgas**(1d0/3d0) !surrogate bubble radius
1010-
aux = dc**3 - Rbeq**3
1008+
aux = dc**3d0 - Rbeq**3d0
10111009
term2 = term2/denom
1012-
term2 = 3d0/2d0*term2**2*Rbeq**3*(1d0 - Rbeq/dc)/aux
1013-
preterm1 = 3d0/2d0*Rbeq*(dc**2 - Rbeq**2)/(aux*denom)
1010+
term2 = 3d0/2d0*term2**2d0*Rbeq**3d0*(1d0 - Rbeq/dc)/aux
1011+
preterm1 = 3d0/2d0*Rbeq*(dc**2d0 - Rbeq**2d0)/(aux*denom)
10141012

10151013
!Control volume radius
1016-
if (present(Romega)) Romega = dc
1014+
if (ptype == 2) Romega = dc
10171015

10181016
! Getting p_inf
10191017
if (ptype == 1) then
@@ -1167,7 +1165,7 @@ contains
11671165

11681166
lag_largestep = 0d0
11691167
remove_id = 0
1170-
!$acc parallel loop gang vector default(present) reduction(+: lag_largestep, remove_id) private(k) copyin(RKstep)
1168+
!$acc parallel loop gang vector default(present) reduction(+: lag_largestep) reduction(MAX: remove_id) private(k) copyin(RKstep)
11711169
do k = 1, nBubs
11721170

11731171
radiusOld = intfc_rad(k, 2)
@@ -1188,7 +1186,7 @@ contains
11881186
print *, 'Negative bubble radius encountered'
11891187
lag_largestep = lag_largestep + 1d0
11901188
if (dt < 2d0*verysmall_dt) then
1191-
remove_id = k
1189+
remove_id = max(remove_id, k)
11921190
end if
11931191
end if
11941192

@@ -1382,9 +1380,9 @@ contains
13821380
!! @param scoord Calculated particle coordinates
13831381
subroutine s_locate_cell(pos, cell, scoord)
13841382

1385-
real(kind(0d0)), dimension(3) :: pos
1386-
real(kind(0d0)), dimension(3), optional :: scoord
1387-
integer, dimension(3) :: cell
1383+
real(kind(0d0)), dimension(3), intent(in) :: pos
1384+
real(kind(0d0)), dimension(3), intent(out) :: scoord
1385+
integer, dimension(3), intent(inout) :: cell
13881386

13891387
integer :: i
13901388

@@ -1420,16 +1418,14 @@ contains
14201418
! In other words, the coordinate of the center of the cell is x_cc(cell).
14211419

14221420
!coordinates in computational space
1423-
if (present(scoord)) then
1424-
scoord(1) = cell(1) + (pos(1) - x_cb(cell(1) - 1))/dx(cell(1))
1425-
scoord(2) = cell(2) + (pos(2) - y_cb(cell(2) - 1))/dy(cell(2))
1426-
scoord(3) = 0d0
1427-
if (p > 0) scoord(3) = cell(3) + (pos(3) - z_cb(cell(3) - 1))/dz(cell(3))
1428-
cell(:) = int(scoord(:))
1429-
do i = 1, num_dims
1430-
if (scoord(i) < 0.0d0) cell(i) = cell(i) - 1
1431-
end do
1432-
end if
1421+
scoord(1) = cell(1) + (pos(1) - x_cb(cell(1) - 1))/dx(cell(1))
1422+
scoord(2) = cell(2) + (pos(2) - y_cb(cell(2) - 1))/dy(cell(2))
1423+
scoord(3) = 0d0
1424+
if (p > 0) scoord(3) = cell(3) + (pos(3) - z_cb(cell(3) - 1))/dz(cell(3))
1425+
cell(:) = int(scoord(:))
1426+
do i = 1, num_dims
1427+
if (scoord(i) < 0.0d0) cell(i) = cell(i) - 1
1428+
end do
14331429

14341430
end subroutine s_locate_cell
14351431

@@ -1847,7 +1843,7 @@ contains
18471843

18481844
integer :: k
18491845

1850-
!$acc parallel loop gang vector default(present) reduction(MAX: Rmax_glb) reduction(MAX: Rmin_glb) private(k)
1846+
!$acc parallel loop gang vector default(present) reduction(MAX: Rmax_glb) reduction(MIN: Rmin_glb) private(k)
18511847
do k = 1, nBubs
18521848
Rmax_glb = max(Rmax_glb, intfc_rad(k, 1)/bub_R0(k))
18531849
Rmin_glb = min(Rmin_glb, intfc_rad(k, 1)/bub_R0(k))

src/simulation/m_bubbles_EL_kernels.fpp

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -62,12 +62,12 @@ contains
6262
!$acc parallel loop gang vector default(present) private(l, s_coord, cell)
6363
do l = 1, nBubs
6464

65-
volpart = 4.0d0/3.0d0*pi*lbk_rad(l, 2)**3
65+
volpart = 4.0d0/3.0d0*pi*lbk_rad(l, 2)**3d0
6666
s_coord(1:3) = lbk_s(l, 1:3, 2)
6767
call s_get_cell(s_coord, cell)
6868

6969
strength_vol = volpart
70-
strength_vel = 4.0d0*pi*lbk_rad(l, 2)**2*lbk_vel(l, 2)
70+
strength_vel = 4.0d0*pi*lbk_rad(l, 2)**2d0*lbk_vel(l, 2)
7171

7272
if (num_dims == 2) then
7373
Vol = dx(cell(1))*dy(cell(2))*lag_params%charwidth
@@ -128,15 +128,15 @@ contains
128128
do l = 1, nBubs
129129
nodecoord(1:3) = 0
130130
center(1:3) = 0.0d0
131-
volpart = 4.0d0/3.0d0*pi*lbk_rad(l, 2)**3
131+
volpart = 4.0d0/3.0d0*pi*lbk_rad(l, 2)**3d0
132132
s_coord(1:3) = lbk_s(l, 1:3, 2)
133133
center(1:2) = lbk_pos(l, 1:2, 2)
134134
if (p > 0) center(3) = lbk_pos(l, 3, 2)
135135
call s_get_cell(s_coord, cell)
136136
call s_compute_stddsv(cell, volpart, stddsv)
137137

138138
strength_vol = volpart
139-
strength_vel = 4.0d0*pi*lbk_rad(l, 2)**2*lbk_vel(l, 2)
139+
strength_vel = 4.0d0*pi*lbk_rad(l, 2)**2d0*lbk_vel(l, 2)
140140

141141
!$acc loop collapse(3) private(cellaux, nodecoord)
142142
do i = 1, smearGrid
@@ -218,25 +218,25 @@ contains
218218
real(kind(0.d0)), intent(out) :: func
219219

220220
real(kind(0.d0)) :: distance
221-
real(kind(0.d0)) :: theta, dtheta, L2, dz, Lz2
221+
real(kind(0.d0)) :: theta, dtheta, L2, dzp, Lz2
222222
integer :: Nr, Nr_count
223223

224-
distance = sqrt((center(1) - nodecoord(1))**2 + (center(2) - nodecoord(2))**2 + (center(3) - nodecoord(3))**2)
224+
distance = sqrt((center(1) - nodecoord(1))**2d0 + (center(2) - nodecoord(2))**2d0 + (center(3) - nodecoord(3))**2d0)
225225

226226
if (num_dims == 3) then
227227
!< 3D gaussian function
228-
func = exp(-0.5d0*(distance/stddsv)**2)/(DSQRT(2.0d0*pi)*stddsv)**3
228+
func = exp(-0.5d0*(distance/stddsv)**2d0)/(DSQRT(2.0d0*pi)*stddsv)**3d0
229229
else
230230
if (cyl_coord) then
231231
!< 2D cylindrical function:
232232
! We smear particles in the azimuthal direction for given r
233233
theta = 0d0
234-
Nr = ceiling(2d0*PI*nodecoord(2)/(y_cb(cellaux(2)) - y_cb(cellaux(2) - 1)))
235-
dtheta = 2d0*PI/Nr
234+
Nr = ceiling(2d0*pi*nodecoord(2)/(y_cb(cellaux(2)) - y_cb(cellaux(2) - 1)))
235+
dtheta = 2d0*pi/Nr
236236
L2 = center(2)**2d0 + nodecoord(2)**2d0 - 2d0*center(2)*nodecoord(2)*cos(theta)
237237
distance = DSQRT((center(1) - nodecoord(1))**2d0 + L2)
238238
! Factor 2d0 is for symmetry (upper half of the 2D field (+r) is considered)
239-
func = dtheta/2d0/PI*exp(-0.5d0*(distance/stddsv)**2)/(DSQRT(2.0d0*pi)*stddsv)**3
239+
func = dtheta/2d0/pi*exp(-0.5d0*(distance/stddsv)**2d0)/(DSQRT(2.0d0*pi)*stddsv)**3d0
240240
Nr_count = 0
241241
do while (Nr_count < Nr - 1)
242242
Nr_count = Nr_count + 1
@@ -246,7 +246,7 @@ contains
246246
distance = DSQRT((center(1) - nodecoord(1))**2d0 + L2)
247247
! nodecoord(2)*dtheta is the azimuthal width of the cell
248248
func = func + &
249-
dtheta/2d0/PI*exp(-0.5d0*(distance/stddsv)**2)/(DSQRT(2.0d0*pi)*stddsv)**(3*(strength_idx + 1))
249+
dtheta/2d0/pi*exp(-0.5d0*(distance/stddsv)**2d0)/(DSQRT(2.0d0*pi)*stddsv)**(3d0*(strength_idx + 1))
250250
end do
251251
else
252252

@@ -255,16 +255,16 @@ contains
255255
theta = 0d0
256256
Nr = ceiling(lag_params%charwidth/(y_cb(cellaux(2)) - y_cb(cellaux(2) - 1)))
257257
Nr_count = 1 - mapCells
258-
dz = y_cb(cellaux(2) + 1) - y_cb(cellaux(2))
259-
Lz2 = (center(3) - (dz*(5d-1 + Nr_count) - lag_params%charwidth/2d0))**2d0
258+
dzp = y_cb(cellaux(2) + 1) - y_cb(cellaux(2))
259+
Lz2 = (center(3) - (dzp*(5d-1 + Nr_count) - lag_params%charwidth/2d0))**2d0
260260
distance = DSQRT((center(1) - nodecoord(1))**2d0 + (center(2) - nodecoord(2))**2d0 + Lz2)
261-
func = dz/lag_params%charwidth*exp(-0.5d0*(distance/stddsv)**2)/(DSQRT(2.0d0*pi)*stddsv)**3
261+
func = dzp/lag_params%charwidth*exp(-0.5d0*(distance/stddsv)**2d0)/(DSQRT(2.0d0*pi)*stddsv)**3d0
262262
do while (Nr_count < Nr - 1 + (mapCells - 1))
263263
Nr_count = Nr_count + 1
264-
Lz2 = (center(3) - (dz*(5d-1 + Nr_count) - lag_params%charwidth/2d0))**2d0
264+
Lz2 = (center(3) - (dzp*(5d-1 + Nr_count) - lag_params%charwidth/2d0))**2d0
265265
distance = DSQRT((center(1) - nodecoord(1))**2d0 + (center(2) - nodecoord(2))**2d0 + Lz2)
266266
func = func + &
267-
dz/lag_params%charwidth*exp(-0.5d0*(distance/stddsv)**2)/(DSQRT(2.0d0*pi)*stddsv)**(3*(strength_idx + 1))
267+
dzp/lag_params%charwidth*exp(-0.5d0*(distance/stddsv)**2d0)/(DSQRT(2.0d0*pi)*stddsv)**(3d0*(strength_idx + 1))
268268
end do
269269
end if
270270
end if

src/simulation/m_global_parameters.fpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -699,7 +699,7 @@ contains
699699
lag_params%write_bubbles = .false.
700700
lag_params%write_bubbles_stats = .false.
701701
lag_params%nBubs_glb = dflt_int
702-
lag_params%epsilonb = dflt_real
702+
lag_params%epsilonb = 1.0d0
703703
lag_params%charwidth = dflt_real
704704
lag_params%valmaxvoid = dflt_real
705705
lag_params%c0 = dflt_real

0 commit comments

Comments
 (0)