MFIX  2016-1
des_thermo_cond_mod.f
Go to the documentation of this file.
1 !vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv!
2 ! !
3 ! Module name: DES_CONDUCTION !
4 ! !
5 ! Purpose: !
6 ! !
7 ! Author: J.Musser Date: 25-Jun-10 !
8 ! !
9 ! Comments: !
10 ! !
11 ! REF: Batchelor and O'Brien, "Thermal or electrical conduction !
12 ! through a granular material," Proceedings of the Royal Society !
13 ! of London. Series A, Mathematical and Physical Sciences, !
14 ! Vol. 355, no 1682, pp. 313-333, July 1977. !
15 ! !
16 ! REF: Rong and Horio, "DEM simulation of char combustion in a !
17 ! fluidized bed," in Second International Conference on CFD in !
18 ! the materials and Process Industries, Melbourne, 1999, pp. !
19 ! 65-70. !
20 ! !
21 ! REF: Xavier and Davidson, "Heat transfer to surfaces immersed in !
22 ! fluidised beds, particularly tub arrays," in Fluidization: !
23 ! Proceedings of the Second Engineering Foundation Conference, !
24 ! Cambridge, England, 2-6 April, 1978, pp. 333-338. !
25 ! !
26 ! REF: Zhou, Yu, and Zulli, "Particle scale study of heat transfer in !
27 ! packed and bubbling fluidized beds," AIChE Journal, Vol. 55, !
28 ! no 4, pp 868-884, 2009. !
29 ! !
30 !^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^!
32 
33 
34  IMPLICIT NONE
35  DOUBLE PRECISION, DIMENSION(:,:), ALLOCATABLE :: des_qw_cond
36  LOGICAL :: do_area_correction
37  CONTAINS
38 
39 
40 
41  FUNCTION des_conduction(I, J, CENTER_DIST, iM, iIJK)
42 
43  use constant
44  use des_thermo
45  use discretelement
46  use funits
47  use param1, only: zero, undefined
48  use physprop
49  use run, only: units
50  IMPLICIT NONE
51 
52 ! Passed variables
53 !---------------------------------------------------------------------//
54 ! Index of particle being looped over
55  INTEGER, INTENT(IN) :: I,J
56 ! Index of fluid cell containing particle I
57  INTEGER, INTENT(IN) :: iIJK
58 ! Solid phase indices for the given particles
59  INTEGER, INTENT(IN) :: iM
60 ! Distance between the centers of particle I and particle J (magnitude)
61  DOUBLE PRECISION, INTENT(IN) :: CENTER_DIST
62  DOUBLE PRECISION :: DES_CONDUCTION
63 
64 ! Local variables
65 !---------------------------------------------------------------------//
66 ! Solid phase indices for the given particles
67  INTEGER jM
68 ! Radius of smaller particle
69  DOUBLE PRECISION MIN_RAD
70 ! Radius of larger particle
71  DOUBLE PRECISION MAX_RAD
72 ! Rate of particle-particle conduction
73  DOUBLE PRECISION Q_pp
74 ! Rate of particle-fluid-particle conduction
75  DOUBLE PRECISION Q_pfp
76 ! Outer radius of region delineating particle-fluid-particle conduction
77  DOUBLE PRECISION RD_OUT
78 ! Inner radius of region delineating particle-fluid-particle conduction
79  DOUBLE PRECISION RD_IN
80 ! The radius of the fluid lens containing the larger particle
81  DOUBLE PRECISION LENS_RAD
82 ! Temperature difference between two particles
83  DOUBLE PRECISION DeltaTp
84 ! Effective thermal conductivity
85  DOUBLE PRECISION lK_eff
86 ! Radius of contact area
87  DOUBLE PRECISION lRadius
88 ! Particle overlap (simulated and corrected)
89  DOUBLE PRECISION OLAP_Sim, OLAP_actual
90 ! Corrected center distance
91  DOUBLE PRECISION CENTER_DIST_CORR
92 ! Gas thermal conductivity
93  DOUBLE PRECISION :: K_gas
94 ! Overlap distance between each particle and contact plane
95  DOUBLE PRECISION :: OLAP_1, OLAP_2
96 ! Effective Lens for particles 1 and 2 (req'd for analytic calculation)
97  DOUBLE PRECISION :: RLENS_1, RLENS_2
98 ! Effective minimum conduction distance for particles 1 and 2
99  DOUBLE PRECISION :: S_1, S_2
100 ! Effective thermal conductance for particles 1 and 2
101  DOUBLE PRECISION :: H_1, H_2
102 ! Analytic thermal conductance between particles
103  DOUBLE PRECISION :: H
104 ! Dummy variable for calculations
105  DOUBLE PRECISION :: RATIO
106 ! Functions
107 !---------------------------------------------------------------------//
108  ! DOUBLE PRECISION :: EVAL_H_PFP
109 
110 ! Identify the solid phases of the neighbor particle
111  jm = pijk(j,5)
112 
113 ! Determine the radius of the larger and smaller particle
114  min_rad = min(des_radius(i), des_radius(j))
115  max_rad = max(des_radius(i), des_radius(j))
116 
117  deltatp = des_t_s(j) - des_t_s(i)
118 
119 ! Calculate the particle-particle conduction
120 ! REF: Batchelor and O'Brien, 1977 (MODIFIED)
121 !---------------------------------------------------------------------//
122  q_pp = 0.0
123 
124 ! Initialize corrected center-center distance
125  center_dist_corr = center_dist
126  IF(center_dist < (max_rad + min_rad)) THEN
127 ! Correct particle overlap to account for artificial softening
128  olap_sim = max_rad + min_rad - center_dist
129  IF(do_area_correction)THEN
130  IF(im.ge.jm)THEN
131  olap_actual = correct_olap(olap_sim,jm,im)
132  ELSE
133  olap_actual = correct_olap(olap_sim,im,jm)
134  ENDIF
135  center_dist_corr = max_rad + min_rad - olap_actual
136  ENDIF
137 ! Effective thermal conductivity
138  lk_eff = k_eff(k_s0(im),k_s0(jm))
139 ! Effective contact area's radius
140  lradius = radius(max_rad, min_rad)
141 ! Compute time-correction term (not done yet)
142  ! CALL CALC_TIME_CORRECTION (.... )
143 ! Inter-particle heat transfer
144  q_pp = 2.0d0 * lk_eff * lradius * deltatp
145 
146 ! Assign the inter-particle heat transfer to both particles.
147  ENDIF
148 
149 !! IF(.TRUE.)THEN ! NEW WAY
150 !---------------------------------------------------------------------//
151 ! Calculate the particle-fluid-particle conduction
152 ! REF: Rong and Horio, 1999 (MODIFIED)
153 !---------------------------------------------------------------------//
154  lens_rad = max_rad * (1.0d0 + flpc)
155  olap_actual = max_rad + min_rad - center_dist_corr
156 ! check to see if particles are within lens thickness from eachother
157 ! a negative overlap indicates particles are separated
158  IF(olap_actual > (-max_rad*flpc))THEN
159  rd_out = radius(lens_rad, min_rad)
160  ! get overlap between each particle and contact plane
161  ratio = olap_actual / max_rad
162  olap_1 = max_rad*max_rad*(ratio-0.5d0*ratio*ratio)/center_dist_corr
163  olap_2 = olap_actual - olap_1
164  ! get effective minimum conduction distance for each particle
165  ratio = (olap_actual + des_min_cond_dist) / max_rad
166  s_1 = (max_rad*max_rad*(ratio-0.5d0*ratio*ratio)/&
167  &(center_dist_corr-des_min_cond_dist)) - olap_1
168  s_2 = des_min_cond_dist - s_1
169  ! get effective lens radius for particle-contact plane
170  rlens_1 = sqrt(rd_out*rd_out+(min_rad-olap_1)**2.0)
171  rlens_2 = sqrt(rd_out*rd_out+(max_rad-olap_2)**2.0)
172 
173 
174 ! GET GAS THERMAL CONDUCTIVITY (default calculation is done in calc_k_g and is for air)
175  if(k_g0.eq.undefined)then
176  ! Compute gas conductivity as is done in calc_k_g
177  ! But use average of particle and wall temperature to be gas temperature
178  k_gas = 6.02d-5*sqrt(0.5d0*(des_t_s(i)+des_t_s(j))/300.d0) ! cal/(s.cm.K)
179  ! 1 cal = 4.183925D0 J
180  IF (units == 'SI') k_gas = 418.3925d0*k_gas !J/s.m.K
181  else
182  k_gas=k_g0
183  endif
184 
185  h_1 = eval_h_pfp(rlens_1, s_1, olap_1,min_rad)*min_rad*k_gas
186  h_2 = eval_h_pfp(rlens_2, s_2, olap_2,max_rad)*max_rad*k_gas
187  IF(h_1.eq.zero.OR.h_2.eq.zero)THEN
188  h = zero
189  ELSE
190  h = h_1*h_2/(h_1+h_2)
191  ENDIF
192 
193  q_pfp = h *deltatp
194 ! Particle-fluid-particle is analytically computed using conductance for each
195 ! particle to the contact plane. The effective lens radius and minimum conduction
196 ! distance are first calculated for each particle-fluid-contact_plane conduction.
197 
198  ELSE
199  q_pfp = zero
200  ENDIF
201  des_conduction = q_pp + q_pfp
202 
203 
204  !! ENDIF ! NEW WAY
205 !-------------------------------------------------------------------------------------
206 ! OLD WAY
207 !-------------------------------------------------------------------------------------
208 !! IF(.FALSE.)THEN
209 ! Calculate the particle-fluid-particle conduction
210 ! REF: Rong and Horio, 1999 (MODIFIED)
211 !---------------------------------------------------------------------//
212 ! Calculate the radius of the fluid lens surrounding the larger particle
213 ! Default FLPC = 0.2
214 !! LENS_RAD = MAX_RAD * (1.0D0 + FLPC)
215 
216 ! Calculate the outer radial distance of the region for particle-fluid-
217 ! particle heat conduction.
218 !! RD_OUT = RADIUS( LENS_RAD, MIN_RAD)
219 
220 ! If the value returned is less than zero, then the fluid lens
221 ! surrounding the larger particle does not intersect with the surface
222 ! of the smaller particle. In this case, particle-fluild-particle
223 ! conduction does not occur.
224 !! Q_pfp = 0.0
225 !! IF(RD_OUT .GT. ZERO)THEN
226 ! Calculate the distance from the line connecting the particles' centers
227 ! to the point of contact between the two particles. This value is
228 ! zero if the particles are not touching and is the radius of the
229 ! shared contact area otherwise.
230 !! RD_IN = ZERO
231 !! IF(CENTER_DIST_CORR < (MAX_RAD + MIN_RAD) ) &
232 !! RD_IN = RADIUS(MAX_RAD, MIN_RAD)
233 ! Calculate the rate of heat transfer between the particles through the
234 ! fluid using adaptive Simpson's rule to manage the integral.
235 !! Q_pfp = K_g(iIJK) * DeltaTp * &
236 !! ADPT_SIMPSON(RD_IN,RD_OUT)
237 
238 !! ENDIF ! RD_OUT > ZERO
239 !! ENDIF ! OLD WAY
240 
241  ! Return total heat flux
242 !! DES_CONDUCTION = Q_pp + Q_pfp
243 !! ------------------------------------------------------------------//
244 ! END OLD WAY
245 !! ------------------------------------------------------------------//
246 
247  RETURN
248 
249  CONTAINS
250 
251 !......................................................................!
252 ! Subroutine Procedure: FUNCTION RADIUS !
253 ! !
254 ! Propose: Calculate the center line radius between two particles. !
255 ! Depending on what is given as input, this function calculates: !
256 ! 1) radius of contact area between two particles !
257 ! 2) radius delineating particle-fluid-particle region. !
258 !......................................................................!
259  DOUBLE PRECISION FUNCTION radius(R1, R2)
261  IMPLICIT NONE
262 
263 ! Radius values
264  DOUBLE PRECISION, INTENT(IN) :: R1, R2
265 ! Distance between particle centers
266  DOUBLE PRECISION BETA
267 ! Generic value
268  DOUBLE PRECISION VALUE
269 
270 ! Calculate
271  VALUE = (r1**2 - r2**2 + center_dist_corr**2)/(2.0d0 * r1 * center_dist_corr)
272 ! Check to ensure that VALUE is less than or equal to one. If VALUE is
273 ! greater than one, the triangle inequality has been violated. Therefore
274 ! there is no intersection between the fluid lens surrounding the larger
275 ! particle and the surface of the smaller particle.
276 ! Thus, there is no particle-fluid-particle heat transfer.
277  IF( VALUE .GT. 1.0d0) THEN
278  radius = -1.0d0
279  ELSE
280 ! Calculate beta (Law of cosines)
281  beta = acos( VALUE )
282 ! Calculate the radius
283  radius = r1 * sin(beta)
284  ENDIF
285 
286  RETURN
287  END FUNCTION radius
288 
289 !......................................................................!
290 ! Subroutine Procedure: FUNCTION K_eff !
291 ! !
292 ! Propose: Calculate the effective thermal conductivity of two !
293 ! particles with conductivities K1 and K2 !
294 !......................................................................!
295  DOUBLE PRECISION FUNCTION k_eff(K1, K2)
297  IMPLICIT NONE
298 
299 ! Thermal conductivities
300  DOUBLE PRECISION, INTENT(IN) :: K1, K2
301 
302  k_eff = 2.0d0 * (k1*k2)/(k1 + k2)
303 
304  RETURN
305  END FUNCTION k_eff
306 
307 !``````````````````````````````````````````````````````````````````````!
308 ! Function: F !
309 ! !
310 ! Purpose: This function defines the region of particle-fluid-particle !
311 ! heat transfer. Note that this function develops a !
312 ! singularity at the boundary of the contact region when two !
313 ! particles are touching. This singularity is resolved by !
314 ! making the assumption that the surfaces of two particles !
315 ! never directly touch (c.f. Rong and Horio, 1999). By !
316 ! default, it is assumed that the particles are separated by !
317 ! a minimum length of 4.0x10^(-10) meters. This value may be !
318 ! modified by specifying a different value in the mfix.dat !
319 ! file under the variable name DES_MIN_COND_DIST. !
320 ! !
321 ! Note, the closer this value is to zero, the harder it will !
322 ! be for the quadrature routine to converge. !
323 !......................................................................!
324  DOUBLE PRECISION FUNCTION f(R)
326  USE des_thermo
327  IMPLICIT NONE
328 
329  DOUBLE PRECISION, INTENT(IN) :: R
330 
331  f = (2.0d0*pi*r)/max((center_dist_corr - sqrt(max_rad**2-r**2) - &
332  sqrt(min_rad**2-r**2)), des_min_cond_dist)
333 
334  IF( mfix_isnan(f))print*,'F IS NAN'
335 
336  END FUNCTION f
337 
338 !``````````````````````````````````````````````````````````````````````!
339 ! Function: ADPT_SIMPSON !
340 ! !
341 ! Purpose: This function applies adaptive Simpson's Rule to solve the !
342 ! definite integral of the function F. !
343 ! !
344 ! *NOTE: This route will return the result of the method even !
345 ! if convergence has not been achieved. If this occurs, a !
346 ! message will be written to the log file to notify the user. !
347 !......................................................................!
348  DOUBLE PRECISION FUNCTION adpt_simpson(A, B)
350  IMPLICIT NONE
351 
352 ! Bounds of integration
353  DOUBLE PRECISION, INTENT(IN) :: A, B
354 ! Maximum recursive depth
355  INTEGER, PARAMETER :: Kmax = 25
356 ! Current depth of recursion
357  INTEGER :: K
358 ! Array storage for recursion
359  DOUBLE PRECISION :: V(kmax,6)
360 ! Step size
361  DOUBLE PRECISION :: H
362 ! Simpson's Rule evaluated on the left and right intervals
363  DOUBLE PRECISION :: lS, rS
364 ! Value of the function F evaluate at the midpoints of the left and
365 ! right intervals
366  DOUBLE PRECISION :: rF, lF
367 ! Local error bound
368  DOUBLE PRECISION :: Err_BND
369 ! Convergence bound
370  DOUBLE PRECISION :: EPS = 10.0**(-2)
371 
372 ! Error indicating that an error has been specified to the user.
373  LOGICAL, SAVE :: ADPT_SIMPSON_ERR = .false.
374 
375 ! Initialize variables
376  v(:,:) = 0.0d0 !
377  adpt_simpson = 0.0d0 ! Integral value
378  h = (b-a)/2.0d0 ! Dynamic interval length
379 ! Calculate Simpson's Rule over the interval [A,B]
380  ls = (f(a) + 4.0d0*f((a+b)/2.0d0) + f(b))*(h/3.0d0)
381 ! Initialize the storage vector for the first pass
382  v(1,:) = (/ a, h, f(a), f((a+b)/2.0d0), f(b), ls/)
383  k = 1
384 ! Enter recursion calculations
385  DO
386 ! Establish the new interval length
387  h = v(k,2)/2.0d0
388 ! Evaluate the function on the left interval
389  lf = f(v(k,1) + h)
390 ! Calculate Simpson's Rule over the left interval
391  ls = (v(k,3) + 4.0d0*lf + v(k,4))*(h/3.0d0)
392 ! Evaluate the function on the right interval
393  rf = f(v(k,1) + 3.0d0*h)
394 ! Calculate Simpson's Rule over the right interval
395  rs = (v(k,4) + 4.0d0*rf + v(k,5))*(h/3.0d0)
396 ! Evaluate the error bound
397  err_bnd = (30.0d0*eps*h)/(b-a)
398 ! Check to see if conversion on the interval has been met
399  IF( abs(ls + rs - v(k,6)) .LT. err_bnd)THEN
400 ! Update the integral value
401  adpt_simpson = adpt_simpson + ls + rs + &
402  (1.0d0/15.0d0)*(ls + rs - v(k,6))
403 ! Decrement the recursion counter
404  k = k - 1
405 ! If K=0, then integration has been successfully completed over the
406 ! entire interval [A,B].
407  IF( k == 0) RETURN
408  ELSEIF( (k .GE. kmax) .OR. &
409  (h == (b-a)*(1.0d0/2.0d0)**(kmax+3))) THEN
410 ! Flag that the method did not converge.
411  IF(.NOT.adpt_simpson_err)THEN
412  WRITE(*,1000)
413  WRITE(unit_log,1000)
414  adpt_simpson_err = .true.
415  ENDIF
416 ! Update the integral value
417  adpt_simpson = adpt_simpson + ls + rs + &
418  (1.0d0/15.0d0)*(ls + rs - v(k,6))
419 ! Decrement the recursion counter
420  k = k - 1
421  ELSE
422 ! Refine the subintervals through recursive splitting of the intervals
423  v(k+1,:) = (/v(k,1) + 2.0d0*h, h, v(k,4), rf, v(k,5), rs/)
424  v(k,:) = (/v(k,1), h, v(k,3), lf, v(k,4), ls/)
425 ! Increment level counter
426  k = k+1
427  ENDIF
428  ENDDO
429 
430  1000 FORMAT(/1x,70('*'),/' From: DES_COND_EQ',/, ' Message: ', &
431  'Integration of the particle-fluid-particle equation did ', &
432  'not',/' converge! No definite bound can be placed on the ', &
433  'error.',/' Future convergence messages will be suppressed!', &
434  /1x,70('*'))
435 
436  END FUNCTION adpt_simpson
437 
438  DOUBLE PRECISION FUNCTION eval_h_pfp(RLENS_dim,S,OLAP_dim,RP)
439  USE constant
440  USE param1
441 
442  IMPLICIT NONE
443  ! Note: Function inputs dimensional quantities
444  DOUBLE PRECISION, intent(in) :: RLENS_dim, S, OLAP_dim, RP
445  ! BELOW VARIABLES ARE NONDIMENSIONALIZED BY RP
446  DOUBLE PRECISION :: RLENS, OLAP, KN
447  DOUBLE PRECISION :: TERM1,TERM2,TERM3
448  DOUBLE PRECISION :: Rout,Rkn
449  DOUBLE PRECISION, PARAMETER :: TWO = 2.0d0
450 
451  rlens = rlens_dim/rp
452  kn = s/rp
453  olap = olap_dim/rp
454 
455  IF(-olap.ge.(rlens-one))THEN
456  rout = zero
457  ELSEIF(olap.le.two)THEN
458  rout = sqrt(rlens**2-(one-olap)**2)
459  ELSE
460  WRITE(*,*)'ERROR: Extremeley excessive overlap (Olap > Diam)'
461  WRITE(*,*)'OLAP = ',olap_dim,olap, rp
462  WRITE(*,*)'RLENS_dim',rlens_dim, rlens
463  write(*,*)'S, Kn', s,kn
464  stop
465  ENDIF
466  rout=min(rout,one)
467 
468  IF(olap.ge.zero)THEN
469  ! particle in contact(below code verified)
470  term1 = pi*((one-olap)**2-(one-olap-kn)**2)/kn
471  term2 = two*pi*(sqrt(one-rout**2)-(one-olap-kn))
472  term3 = two*pi*(one-olap)*log((one-olap-sqrt(one-rout**2))/kn)
473  eval_h_pfp = term1+term2+term3
474  ELSE
475  IF(-olap.ge.kn)THEN
476  rkn = zero
477  ELSE
478  rkn=sqrt(one-(one-olap-kn)**2)
479  ENDIF
480 
481  term1 = (rkn**2/(two*kn))+sqrt(one-rout**2)-sqrt(one-rkn**2)
482  term2 = (one-olap)*log((one-olap-sqrt(one-rout**2))/(one-olap-sqrt(one-rkn**2)))
483  eval_h_pfp = two*pi*(term1+term2)
484 
485  ENDIF
486  RETURN
487  END FUNCTION eval_h_pfp
488 
489  END FUNCTION des_conduction
490 
491 !vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv!
492 ! !
493 ! Module name: DES_CONDUCTION !
494 ! !
495 ! Purpose: Compute conductive heat transfer with wall !
496 ! !
497 ! Author: A.Morris Date: 07-Jan-16 !
498 ! !
499 !^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^!
500  FUNCTION des_conduction_wall(OLAP, K_sol, K_wall, K_gas, TWall, &
501  tpart, rpart, rlens, m)
502  USE param1, only: zero
503  USE des_thermo, only: des_min_cond_dist
504 
505  DOUBLE PRECISION :: DES_CONDUCTION_WALL
506  DOUBLE PRECISION, intent(in) :: OLAP, K_sol, K_wall, K_gas, TWall&
507  & ,TPart,RPart, RLens
508  DOUBLE PRECISION :: Rin, Rout
509  DOUBLE PRECISION :: OLAP_ACTUAL, TAUC_CORRECTION
510  DOUBLE PRECISION :: KEff
511  DOUBLE PRECISION :: Q_pw, Q_pfw
512  INTEGER :: M ! Solids phase index
513 
514  ! Initialize variables
515  q_pw = zero
516  q_pfw= zero
517  olap_actual = olap
518 
519  ! Check to see if particle is in contact (P-W) conduction
520  IF(olap.gt.zero)THEN
521  ! Compute effective solids conductivity
522  keff = 2.0d0*k_sol*k_wall/(k_sol+k_wall)
523  ! Correct for overlap using "area" correction terms
524  IF(do_area_correction)THEN
525  olap_actual = correct_olap(olap,m,-1) ! (-1 indicates wall)
526  ENDIF
527  ! Compute inner Rad
528  rin = sqrt(2.0d0*olap_actual*rpart-olap_actual*olap_actual)
529  ! Compute time correction term (commented out for now)
530  ! CALL CALC_TIME_CORRECTION(TAUC_CORRECTION,M,-1)
531  ! Compute heat transfer (particle-wall)
532  q_pw = 2.0d0*rin*keff*(twall-tpart)
533  ENDIF
534  ! Compute heat transfer (particle-fluid-wall)
535  q_pfw=eval_h_pfw(rlens,des_min_cond_dist, olap_actual, rpart) * &
536  & k_gas*rpart*(twall-tpart)
537 
538  des_conduction_wall=q_pw+q_pfw
539 
540  RETURN
541  END FUNCTION des_conduction_wall
542 
543 
544 ! THIS FUNCTION COMPUTES THE OVERLAP THAT WOULD OCCUR (for a given force)
545 ! IF ACTUAL MATERIAL PROPERTIES WERE USED.
546  FUNCTION correct_olap(OLAP,M,L)
547  use discretelement
548  IMPLICIT NONE
549  DOUBLE PRECISION :: CORRECT_OLAP
550  DOUBLE PRECISION, INTENT (IN) :: OLAP
551  INTEGER, INTENT (IN) :: M, L
552  DOUBLE PRECISION :: KN_ACTUAL, KN_SIM
553  ! L=-1 corresponds to wall
554  IF(l.eq.-1)THEN
555  ! WALL CONTACT
556  IF(des_coll_model_enum .EQ. hertzian)THEN
557  correct_olap = (hert_kwn(m)/hert_kwn_actual(m))**(2.0d0/3.0d0)*olap
558  ELSE
559  correct_olap = (kn_w*olap/hert_kwn_actual(m))**(2.0d0/3.0d0)
560  ENDIF
561  ELSE
562  ! PARTICLE-PARTICLE
563  IF(des_coll_model_enum .EQ. hertzian)THEN
564  correct_olap = (hert_kn(m,l)/hert_kn_actual(m,l))**(2.0d0/3.0d0)*olap
565  ELSE
566  correct_olap = (kn*olap/hert_kn_actual(m,l))**(2.0d0/3.0d0)
567  ENDIF
568  ENDIF
569  RETURN
570  END FUNCTION correct_olap
571 
572 
573  DOUBLE PRECISION FUNCTION eval_h_pfw(RLENS_dim,S,OLAP_dim,RP)
575  USE param1
576 
577  IMPLICIT NONE
578  ! Note: Function inputs dimensional quantities
579  DOUBLE PRECISION, intent(in) :: RLENS_dim, S, OLAP_dim, RP
580  ! BELOW VARIABLES ARE NONDIMENSIONALIZED BY RP
581  DOUBLE PRECISION :: RLENS, OLAP, KN
582  DOUBLE PRECISION :: TERM1,TERM2,TERM3
583  DOUBLE PRECISION :: Rout,Rkn
584  DOUBLE PRECISION, PARAMETER :: TWO = 2.0d0
585 
586  rlens = rlens_dim/rp
587  kn = s/rp
588  olap = olap_dim/rp
589 
590  IF(-olap.ge.(rlens-one))THEN
591  rout = zero
592  ELSEIF(olap.le.two)THEN
593  rout = sqrt(rlens**2-(one-olap)**2)
594  ELSE
595  WRITE(*,*)'ERROR: Extremeley excessive overlap (Olap > Diam)'
596  WRITE(*,*)'OLAP = ',olap_dim,olap, rp
597  WRITE(*,*)'RLENS_dim',rlens_dim, rlens
598  write(*,*)'S, Kn', s,kn
599  stop
600  ENDIF
601  rout=min(rout,one)
602 
603  IF(olap.ge.zero)THEN
604  ! particle in contact(below code verified)
605  term1 = pi*((one-olap)**2-(one-olap-kn)**2)/kn
606  term2 = two*pi*(sqrt(one-rout**2)-(one-olap-kn))
607  term3 = two*pi*(one-olap)*log((one-olap-sqrt(one-rout**2))/kn)
608  eval_h_pfw = term1+term2+term3
609  ELSE
610  IF(-olap.ge.kn)THEN
611  rkn = zero
612  ELSE
613  rkn=sqrt(one-(one-olap-kn)**2)
614  ENDIF
615 
616  term1 = (rkn**2/(two*kn))+sqrt(one-rout**2)-sqrt(one-rkn**2)
617  term2 = (one-olap)*log((one-olap-sqrt(one-rout**2))/(one-olap-sqrt(one-rkn**2)))
618  eval_h_pfw = two*pi*(term1+term2)
619 
620  ENDIF
621  RETURN
622  END FUNCTION eval_h_pfw
623 
624 
625  SUBROUTINE calc_time_correction(time_corr, phaseI, phaseJ)
626  use discretelement, only: tau_c_base_actual, tauw_c_base_actual
627  use discretelement, only: tau_c_base_sim, tauw_c_base_sim
628  use discretelement, only: des_coll_model_enum, hertzian
629  IMPLICIT NONE
630  INTEGER, intent (in) :: phaseI, phaseJ
631  DOUBLE PRECISION :: time_corr, tau_actual, tau_sim
632  DOUBLE PRECISION :: vimp ! impact veloctiy
633  INTEGER :: M, N
634  vimp = 1.0d0
635  time_corr = 1.0d0
636  if (phasej == -1) then
637  ! Wall contact
638  m = phasei
639  IF (des_coll_model_enum .EQ. hertzian) THEN
640  time_corr = tauw_c_base_actual(m) / tauw_c_base_sim(m)
641  ELSE
642  vimp = 1.0d0
643  if (vimp .le. 0.0d0)then
644  time_corr = 1.0d0
645  else
646  time_corr = tauw_c_base_actual(m)*vimp**(-0.2d0) / tauw_c_base_sim(m)
647  endif
648  ENDIF
649 
650  ELSE
651  ! particle-particle contact
652  if (phasei .le. phasej)then
653  m = phasei
654  n = phasej
655  else
656  m = phasej
657  n = phasei
658  endif
659 
660  IF (des_coll_model_enum .EQ. hertzian) THEN
661  time_corr = tau_c_base_actual(m,n) / tau_c_base_sim(m,n)
662  ELSE
663  vimp = 1.0d0
664  if (vimp .le. 0.0d0)then
665  time_corr = 1.0d0
666  else
667  time_corr = tau_c_base_actual(m,n)*vimp**(-0.2d0) / tau_c_base_sim(m,n)
668  endif
669  ENDIF
670  ENDIF
671  time_corr = time_corr **(2.0d0/3.0d0)
672  ! TEMPORARY
673  time_corr = 1.0d0
674  RETURN
675  END SUBROUTINE calc_time_correction
676 
677 
678 
679  END MODULE des_thermo_cond
double precision function eval_h_pfw(RLENS_dim, S, OLAP_dim, RP)
double precision, dimension(:), allocatable des_t_s
double precision, parameter one
Definition: param1_mod.f:29
double precision flpc
double precision des_min_cond_dist
double precision, parameter undefined
Definition: param1_mod.f:18
double precision function correct_olap(OLAP, M, L)
double precision function k_eff(K1, K2)
double precision function f(POS, ALPHAC, D_Target, L, N)
double precision, dimension(dim_m) k_s0
Definition: physprop_mod.f:95
integer, parameter unit_log
Definition: funits_mod.f:21
Definition: run_mod.f:13
double precision k_g0
Definition: physprop_mod.f:89
double precision function radius(R1, R2)
character(len=16) units
Definition: run_mod.f:30
double precision function des_conduction_wall(OLAP, K_sol, K_wall, K_gas, TWall, TPart, Rpart, RLens, M)
logical function mfix_isnan(x)
Definition: utilities_mod.f:14
subroutine calc_time_correction(time_corr, phaseI, phaseJ)
double precision, dimension(:,:), allocatable des_qw_cond
double precision, parameter pi
Definition: constant_mod.f:158
double precision function des_conduction(I, J, CENTER_DIST, iM, iIJK)
double precision, parameter zero
Definition: param1_mod.f:27
double precision function adpt_simpson(A, B)