12 #include "version.inc" 32 DOUBLE PRECISION,
PARAMETER :: flag_overlap = 0.20d0
34 INTEGER :: I, LL, cc, CC_START, CC_END
37 DOUBLE PRECISION :: OVERLAP_N, OVERLAP_T(3)
39 DOUBLE PRECISION :: SQRT_OVERLAP
43 DOUBLE PRECISION :: R_LM,DIST_CI,DIST_CL
46 DOUBLE PRECISION :: V_REL_TRANS_NORM, rad
49 DOUBLE PRECISION :: DIST(3), NORMAL(3), DIST_MAG, POS(3)
51 DOUBLE PRECISION :: VREL_T(3)
53 DOUBLE PRECISION :: FN(3), FT(3)
55 DOUBLE PRECISION :: FC_TMP(3)
57 DOUBLE PRECISION :: TOW_FORCE(3)
59 DOUBLE PRECISION :: TOW_TMP(3,2)
61 DOUBLE PRECISION :: QQ_TMP
64 INTEGER :: PHASEI, PHASELL
66 DOUBLE PRECISION :: ETAN_DES, ETAT_DES
67 DOUBLE PRECISION :: KN_DES, KT_DES
69 DOUBLE PRECISION :: FORCE_COH, EQ_RADIUS, DistApart
71 LOGICAL,
PARAMETER :: report_excess_overlap = .false.
73 DOUBLE PRECISION :: FNMD, FTMD, MAG_OVERLAP_T, TANGENT(3)
75 integer :: nn, mm, box_id, box_id2
82 IF(use_cohesion) postcohesive(:) =
zero 95 print *,
" TOTAL NUM OF NEIGHBORS IS ",neighbor_index(max_pip-1)
97 open (unit=123,file=
"neighbors.txt",action=
"write",status=
"replace")
101 IF (ll.gt.1) cc_start = neighbor_index(ll-1)
102 cc_end = neighbor_index(ll)
104 DO cc = cc_start, cc_end-1
115 if (pair(1).eq.0 .and. pair(2).eq.0)
exit 117 if ( des_radius(pair(1))+des_radius(pair(2))> sqrt(dot_product
then 118 print *,
"invalid pair: ",pair(1),pair(2)
143 IF(is_nonexistent(ll)) cycle
144 pos = des_pos_new(ll,:)
148 IF (ll.gt.1) cc_start = neighbor_index(ll-1)
149 cc_end = neighbor_index(ll)
151 DO cc = cc_start, cc_end-1
153 IF(is_nonexistent(i)) cycle
155 r_lm = rad + des_radius(i)
156 dist(:) = des_pos_new(i,:) - pos(:)
157 dist_mag = dot_product(dist,dist)
162 IF(use_cohesion .AND. van_der_waals)
THEN 163 IF(dist_mag < (r_lm+vdw_outer_cutoff)**2)
THEN 164 eq_radius = 2d0 * des_radius(ll)*des_radius(i) / &
165 (des_radius(ll)+des_radius(i))
166 IF(dist_mag > (vdw_inner_cutoff+r_lm)**2)
THEN 167 distapart = (sqrt(dist_mag)-r_lm)
168 force_coh = hamaker_constant * eq_radius /
172 force_coh = 2d0 *
pi * surface_energy * eq_radius *
176 fc_tmp(:) = dist(:)*force_coh/sqrt(dist_mag)
180 postcohesive(ll) = postcohesive(ll) + force_coh / pmass
198 pft_neighbor(:,cc) = 0.0
205 print *,
"SAP DIDNT FIND PAIR: ",ll,i
206 print *,
"PARTICLE (",ll,
"): ",des_pos_new(:,ll),
" WITH RADIUS: " 207 "PARTICLE (",i,
"): ",des_pos_new(:,i),
" WITH RADIUS: " 210 print *,
" ****** ",sqrt(dot_product(des_pos_new(:,ll
" *********" 217 if (
boxhandle(ll)%list(mm)%sap_id < 0 ) cycle
218 print *,
" PARTICLE ",ll,
" IS IN ",
boxhandle(ll)%list
230 if (.not.found) cycle
240 IF(dist_mag == 0)
THEN 242 error_stop
"division by zero" 243 8550
FORMAT(
'distance between particles is zero:',2(2x,i10))
246 dist_mag = sqrt(dist_mag)
247 normal(:)= dist(:)/dist_mag
250 overlap_n = r_lm-dist_mag
255 CALL cfrelvel(ll, i, v_rel_trans_norm, vrel_t, &
262 IF (des_coll_model_enum .EQ. hertzian)
THEN 263 sqrt_overlap = sqrt(overlap_n)
264 kn_des = hert_kn(phasell,phasei)*sqrt_overlap
265 kt_des = hert_kt(phasell,phasei)*sqrt_overlap
266 sqrt_overlap = sqrt(sqrt_overlap)
267 etan_des = des_etan(phasell,phasei)*sqrt_overlap
268 etat_des = des_etat(phasell,phasei)*sqrt_overlap
274 etan_des = des_etan(phasell,phasei)
275 etat_des = des_etat(phasell,phasei)
279 fn(:) = -(kn_des * overlap_n * normal(:) + &
280 etan_des * v_rel_trans_norm * normal(:))
283 overlap_t(:) = dtsolid*vrel_t(:) + pft_neighbor(:,cc)
284 mag_overlap_t = sqrt(dot_product(overlap_t,overlap_t))
287 IF(mag_overlap_t > 0.0)
THEN 289 ftmd = kt_des*mag_overlap_t
291 fnmd = mew*sqrt(dot_product(fn,fn))
293 tangent = overlap_t/mag_overlap_t
297 overlap_t = (fnmd/kt_des) * tangent
306 ft = ft - etat_des * vrel_t(:)
309 pft_neighbor(:,cc) = overlap_t(:)
314 dist_cl = dist_mag/2.d0 + (des_radius(ll)**2 - &
315 des_radius(i)**2)/(2.d0*dist_mag)
317 dist_ci = dist_mag - dist_cl
319 tow_force(:) = des_crossprdct(normal(:), ft(:))
320 tow_tmp(:,1) = dist_cl*tow_force(:)
321 tow_tmp(:,2) = dist_ci*tow_force(:)
325 fc_tmp(:) = fc_tmp(:) + fn(:) + ft(:)
327 fc(ll,:) = fc(ll,:) + fc_tmp(:)
330 fc(i,1) = fc(i,1) - fc_tmp(1)
332 fc(i,2) = fc(i,2) - fc_tmp(2)
334 fc(i,3) = fc(i,3) - fc_tmp(3)
337 tow(ll,:) = tow(ll,:) + tow_tmp(:,1)
340 tow(i,1) = tow(i,1) + tow_tmp(1,2)
342 tow(i,2) = tow(i,2) + tow_tmp(2,2)
344 tow(i,3) = tow(i,3) + tow_tmp(3,2)
353 IF(use_cohesion .AND. van_der_waals .AND. grav_mag >
zero)
THEN 354 postcohesive(:) = postcohesive(:)/grav_mag
361 include
'functions.inc' 374 IF(overlap_n > flag_overlap*des_radius(ll) .OR. &
375 overlap_n > flag_overlap*des_radius(i))
THEN 378 des_radius(ll), des_radius(i), overlap_n
383 1000
FORMAT(
'WARNING: Excessive overplay detected between ', &
384 'particles ',a,
' and ',/a,
' at time ',g11.4,
'.',/ &
385 'RADII: ',g11.4,
' and ',g11.4,4x,
'OVERLAP: ',g11.4)
subroutine, public reset_pairs(this)
double precision, parameter one
subroutine print_excess_overlap
logical, dimension(dim_m) calc_cond_des
subroutine cfrelvel(L, II, VRN, VSLIP, NORM, DIST_LI)
subroutine calc_force_dem
double precision, parameter small_number
logical function, public is_pair(this, i0, j0)
subroutine, public get_pair(this, pair)
type(multisap_t) multisap
character(len=line_length), dimension(line_count) err_msg
double precision, dimension(:), allocatable q_source
subroutine, public calc_dem_force_with_wall_stl
double precision, parameter pi
type(boxhandlelist_t), dimension(:), allocatable boxhandle
double precision function des_conduction(I, J, CENTER_DIST, iM, iIJK)
double precision, parameter zero
subroutine flush_err_msg(DEBUG, HEADER, FOOTER, ABORT, LOG, CALL_TREE)