MFIX  2016-1
set_bc0.f
Go to the documentation of this file.
1 !vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvC
2 ! C
3 ! Subroutine: set_bc0 C
4 ! Purpose: This subroutine does the initial setting of all boundary C
5 ! conditions. The user specifications of the boundary conditions are C
6 ! checked for veracity in various check_data/ routines: C
7 ! (e.g., check_boundary_conditions). C
8 ! C
9 ! Author: M. Syamlal Date: 29-JAN-92 C
10 ! C
11 !^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^C
12  SUBROUTINE set_bc0
13 
14 ! Modules
15 !--------------------------------------------------------------------//
16  use bc, only: ijk_p_g
17  use bc
18  use fldvar, only: x_g, t_g, p_g
20 
21  use param, only: dimension_bc
22  use param1, only: undefined_i
23 
24  use mpi_utility
25  use sendrecv
26  IMPLICIT NONE
27 
28 ! Local variables
29 !--------------------------------------------------------------------//
30 ! Local index for boundary condition
31  INTEGER :: L
32 !--------------------------------------------------------------------//
33 
34 ! Incompressible cases require that Ppg specified for one cell.
35 ! The following attempts to pick an appropriate cell.
36  CALL set_ijk_p_g
37 
38  IF(use_mms) THEN
39 ! IJK_P_G is set as UNDEFINED for MMS since current IJK_P_G setting
40 ! is not a second order operation.
42 ! Calculate MMS variables. Better place might be inside interate before
43 ! every time-step. (?)
44  CALL calculate_mms
46  END IF
47 
48  DO l = 1, dimension_bc
49  IF (bc_defined(l)) THEN
50 
51  SELECT CASE (bc_type_enum(l))
52 
53  CASE (free_slip_wall)
54  CALL set_bc0_walls(l)
55  CASE (no_slip_wall)
56  CALL set_bc0_walls(l)
57  CASE (par_slip_wall)
58  CALL set_bc0_walls(l)
59  CASE (p_outflow)
61  CALL set_bc0_outflow(l)
63  CASE (mass_outflow)
65  CALL set_bc0_inflow(l)
67  CASE (outflow)
69  CALL set_bc0_outflow(l)
71  CASE (mass_inflow)
72  CALL set_bc0_init_jet(l)
73  CALL set_bc0_inflow(l)
74  CASE (p_inflow)
75  CALL set_bc0_inflow(l)
76  END SELECT
77  ENDIF
78  ENDDO
79 
80 ! Make T_g nonzero in k=0,1 ghost layers when k-decomposition employed
81  call send_recv(t_g,2)
82  call send_recv(p_g,2)
83  call send_recv(x_g,2)
84 
85  RETURN
86  END SUBROUTINE set_bc0
87 
88 
89 !vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvC
90 ! C
91 ! Subroutine: set_bc0_walls C
92 ! Purpose: Define certain field variables at the wall boundaries C
93 ! according to the user specifications. These are not the real C
94 ! values in the wall cells, only initial guesses. C
95 ! C
96 !^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^C
97  SUBROUTINE set_bc0_walls(BCV)
98 
99 ! Modules
100 !--------------------------------------------------------------------//
101  use bc, only: bc_k_b, bc_k_t
102  use bc, only: bc_j_s, bc_j_n
103  use bc, only: bc_i_w, bc_i_e
104  use bc, only: bc_tw_g, bc_tw_s, bc_thetaw_m
105  use bc, only: bc_xw_g, bc_xw_s, bc_scalarw
106 
107  use fldvar, only: x_g, x_s, scalar
108  use fldvar, only: t_g, t_s, theta_m
109 
110  use param1, only: undefined
111  use physprop, only: smax, mmax, nmax
112  use scalars, only: nscalar
113 
114  use functions, only: is_on_mype_plus2layers, bound_funijk
115  use compar, only: dead_cell_at
116  IMPLICIT NONE
117 
118 ! Dummy arguments
119 !--------------------------------------------------------------------//
120 ! index of boundary
121  INTEGER, INTENT(IN) :: BCV
122 
123 ! Local variables
124 !--------------------------------------------------------------------//
125 ! indices
126  INTEGER :: I, J, K, IJK, M
127 !--------------------------------------------------------------------//
128 
129  DO k = bc_k_b(bcv), bc_k_t(bcv)
130  DO j = bc_j_s(bcv), bc_j_n(bcv)
131  DO i = bc_i_w(bcv), bc_i_e(bcv)
132 
133  IF (.NOT.is_on_mype_plus2layers(i,j,k)) cycle
134  IF (dead_cell_at(i,j,k)) cycle ! skip dead cells
135  ijk = bound_funijk(i,j,k)
136 
137  IF(bc_tw_g(bcv) /= undefined) t_g(ijk) = bc_tw_g(bcv)
138 
139  IF(nmax(0) > 0) &
140  WHERE (bc_xw_g(bcv,:nmax(0)) /= undefined) &
141  x_g(ijk,:nmax(0)) = bc_xw_g(bcv,:nmax(0))
142 
143  IF(smax > 0) &
144  WHERE(bc_tw_s(bcv,:smax) /= undefined) &
145  t_s(ijk,:smax) = bc_tw_s(bcv,:smax)
146 
147  IF(mmax > 0) &
148  WHERE(bc_thetaw_m(bcv,:mmax) /= undefined) &
149  theta_m(ijk,:mmax) = bc_thetaw_m(bcv,:mmax)
150 
151  DO m = 1, smax
152  IF(nmax(m) > 0) &
153  WHERE (bc_xw_s(bcv,m,:nmax(m)) /= undefined) &
154  x_s(ijk,m,:nmax(m)) = bc_xw_s(bcv,m,:nmax(m))
155  ENDDO
156 
157  IF(nscalar > 0) &
158  WHERE (bc_scalarw(bcv,:nscalar) /= undefined) &
159  scalar(ijk,:nscalar) = bc_scalarw(bcv,:nscalar)
160 
161  ENDDO ! end do (i=bc_i_w(l),bc_i_e(l))
162  ENDDO ! end do (j=bc_j_s(l),bc_j_n(l))
163  ENDDO ! end do (k=bc_k_b(l),bc_k_t(l))
164 
165  RETURN
166  END SUBROUTINE set_bc0_walls
167 
168 
169 !vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvC
170 ! C
171 ! Subroutine: set_bc0_outflow C
172 ! Purpose: Set the initial settings of the boundary conditions (if C
173 ! they are defined) for pressure outflow (PO) or outflow (O) C
174 ! boundary types. C
175 ! C
176 ! Comments: For a new run the field variables are undefined in the C
177 ! boundary cell locations, while for a restart run the field variable C
178 ! may have an existing value based on the preceding simulation. C
179 ! Regardless, a user defined BC value will supercede any existing C
180 ! value. C
181 ! C
182 ! Note: Scalar field quantities (i.e., T_G, T_s, x_g, x_s, Theta_m, C
183 ! scalar, k_turb_g, e_turb_g) do not (should not) need to be defined C
184 ! in any type of outflow boundary as the boundary values are unused C
185 ! by the corresponding matrix equation (bc_phi). The only reason C
186 ! this is potentially necessary is during a calculation another cell C
187 ! references the value of this boundary cell before the corresponding C
188 ! governing equation solver is called. C
189 ! C
190 !^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^C
191  SUBROUTINE set_bc0_outflow(BCV)
193 ! Modules
194 !--------------------------------------------------------------------//
195  use bc, only: bc_k_b, bc_k_t
196  use bc, only: bc_j_s, bc_j_n
197  use bc, only: bc_i_w, bc_i_e
198  use bc, only: bc_p_g
199  use bc, only: bc_t_g, bc_t_s, bc_theta_m
200  use bc, only: bc_x_g, bc_x_s, bc_scalar
201  use bc, only: bc_ep_g, bc_rop_s
202  use bc, only: bc_k_turb_g, bc_e_turb_g
203 
204  use constant, only: pi
205 
206  use fldvar, only: x_g, x_s, scalar
207  use fldvar, only: t_g, t_s, theta_m
208  use fldvar, only: p_g, p_star
209  use fldvar, only: k_turb_g, e_turb_g
210  use fldvar, only: ep_g, rop_s
211  use fldvar, only: d_p, ro_s
212 
213  use mms, only: use_mms
214  use mms, only: mms_p_g, mms_t_g, mms_ep_g
215  use mms, only: mms_theta_m, mms_t_s, mms_rop_s
216 
217  use param1, only: undefined, zero
218  use physprop, only: smax, mmax, nmax
219  use run, only: k_epsilon, kt_type_enum, ghd_2007
220  use scalars, only: nscalar
221  use scales, only: scale_pressure
222  use toleranc, only: tmin
223 
224  use functions, only: is_on_mype_plus2layers, bound_funijk
225  use compar, only: dead_cell_at
226  IMPLICIT NONE
227 
228 ! Dummy arguments
229 !--------------------------------------------------------------------//
230 ! index of boundary condition
231  INTEGER, INTENT(IN) :: BCV
232 
233 ! Local variables
234 !--------------------------------------------------------------------//
235 ! indices
236  INTEGER :: I, J, K, IJK, M
237 ! number densities for use in GHD theory only
238  DOUBLE PRECISION :: nM, nTOT
239 !--------------------------------------------------------------------//
240 
241 
242  DO k = bc_k_b(bcv), bc_k_t(bcv)
243  DO j = bc_j_s(bcv), bc_j_n(bcv)
244  DO i = bc_i_w(bcv), bc_i_e(bcv)
245  IF (.NOT.is_on_mype_plus2layers(i,j,k)) cycle
246  IF (dead_cell_at(i,j,k)) cycle ! skip dead cells
247  ijk = bound_funijk(i,j,k)
248 
249  p_star(ijk) = zero
250  p_g(ijk) = scale_pressure(bc_p_g(bcv))
251  IF (bc_ep_g(bcv) /= undefined) ep_g(ijk) = bc_ep_g(bcv)
252 
253  t_g(ijk)= merge(bc_t_g(bcv), tmin,&
254  bc_t_g(bcv) /= undefined)
255 
256  IF (nmax(0) > 0) &
257  WHERE (bc_x_g(bcv,:nmax(0)) /= undefined) &
258  x_g(ijk,:nmax(0)) = bc_x_g(bcv,:nmax(0))
259 
260  IF (nscalar > 0) &
261  WHERE (bc_scalar(bcv,:nscalar) /= undefined) &
262  scalar(ijk,:nscalar) = bc_scalar(bcv,:nscalar)
263 
264  IF (k_epsilon) THEN
265  IF (bc_k_turb_g(bcv) /= undefined) &
266  k_turb_g(ijk) = bc_k_turb_g(bcv)
267  IF (bc_e_turb_g(bcv) /= undefined) &
268  e_turb_g(ijk) = bc_e_turb_g(bcv)
269  ENDIF
270 
271  DO m = 1, smax
272  IF (bc_rop_s(bcv,m) /= undefined) &
273  rop_s(ijk,m) = bc_rop_s(bcv,m)
274  IF(bc_t_s(bcv,m) /= undefined) &
275  t_s(ijk,m)=bc_t_s(bcv,m)
276  IF (bc_theta_m(bcv,m) /= undefined) &
277  theta_m(ijk,m) = bc_theta_m(bcv,m)
278 
279  IF (nmax(m) > 0) &
280  WHERE (bc_x_s(bcv,m,:nmax(m)) /= undefined) &
281  x_s(ijk,m,:nmax(m)) = bc_x_s(bcv,m,:nmax(m))
282  ENDDO
283 
284 ! for GHD theory to compute mixture BC of velocity and density
285  IF(kt_type_enum == ghd_2007) THEN
286  rop_s(ijk,mmax) = zero
287  ntot = zero
288  theta_m(ijk,mmax) = zero
289  DO m = 1, smax
290  IF (bc_rop_s(bcv,m) /= undefined) THEN
291  rop_s(ijk,mmax) = rop_s(ijk,mmax) + &
292  bc_rop_s(bcv,m)
293  nm = bc_rop_s(bcv,m)*6d0 / &
294  (pi*d_p(ijk,m)**3*ro_s(ijk,m))
295  ntot = ntot + nm
296  IF (bc_theta_m(bcv,m) /= undefined) &
297  theta_m(ijk,mmax) = theta_m(ijk,mmax) + &
298  nm*bc_theta_m(bcv,m)
299  ENDIF
300  ENDDO
301  IF(rop_s(ijk,mmax) > zero) &
302  theta_m(ijk,mmax) = theta_m(ijk,mmax) / ntot
303  ENDIF ! end if(kt_type_enum== ghd_2007)
304 
305 ! Set MMS BCs when PO boundary condition is used.
306  IF (use_mms) THEN
307  p_g(ijk) = scale_pressure(mms_p_g(ijk))
308  ep_g(ijk) = mms_ep_g(ijk)
309  t_g(ijk) = mms_t_g(ijk)
310 
311  m = 1 ! Single solid phase for MMS cases
312  rop_s(ijk,m) = mms_rop_s(ijk)
313  t_s(ijk,m) = mms_t_s(ijk)
314  theta_m(ijk,m) = mms_theta_m(ijk)
315  ENDIF ! end if(USE_MMS)
316 
317  ENDDO ! do i
318  ENDDO ! do j
319  ENDDO ! do k
320 
321  RETURN
322  END SUBROUTINE set_bc0_outflow
323 
324 
325 !vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvC
326 ! C
327 ! Subroutine: set_bc0_inflow C
328 ! Purpose: Set the initial settings of the boundary conditions C
329 ! pressure inflow (PI) and. mass inflow (MI) boundary types. Also do C
330 ! mass outflow (MO) boundary types... due to velocity... C
331 ! C
332 ! Comments: Unlike the treament of PO or O boundary types no checks C
333 ! are made for these boundary types to determine whether the given C
334 ! BC value is defined before it is assigned to the field variable. C
335 ! However, the corresponding check routines generally ensure such BC C
336 ! quantities are defined for MI or PI boundaries if they are needed C
337 ! for the simulation. C
338 ! C
339 !^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^C
340  SUBROUTINE set_bc0_inflow(BCV)
342 ! Modules
343 !--------------------------------------------------------------------//
344  use bc, only: bc_plane
345  use bc, only: bc_k_b, bc_k_t
346  use bc, only: bc_j_s, bc_j_n
347  use bc, only: bc_i_w, bc_i_e
348  use bc, only: bc_u_g, bc_v_g, bc_w_g
349  use bc, only: bc_u_s, bc_v_s, bc_w_s
350  use bc, only: bc_p_g
351  use bc, only: bc_t_g, bc_t_s, bc_theta_m
352  use bc, only: bc_x_g, bc_x_s, bc_scalar
353  use bc, only: bc_ep_g, bc_rop_s
354  use bc, only: bc_k_turb_g, bc_e_turb_g
355 
356  use constant, only: pi
357 
358  use fldvar, only: u_g, v_g, w_g
359  use fldvar, only: u_s, v_s, w_s
360  use fldvar, only: x_g, x_s, scalar
361  use fldvar, only: t_g, t_s, theta_m
362  use fldvar, only: p_g, p_star
363  use fldvar, only: k_turb_g, e_turb_g
364  use fldvar, only: ep_g, rop_s
365  use fldvar, only: d_p, ro_s
366 
367  use mms, only: use_mms
368  use mms, only: mms_u_g, mms_v_g, mms_w_g
369  use mms, only: mms_u_s, mms_v_s, mms_w_s
370  use mms, only: mms_p_g, mms_t_g, mms_ep_g
371  use mms, only: mms_theta_m, mms_t_s, mms_rop_s
372 
373  use param1, only: zero
374  use physprop, only: smax, mmax, nmax
375  use run, only: k_epsilon, kt_type_enum, ghd_2007
376  use scalars, only: nscalar
377  use scales, only: scale_pressure
378 
379  use indices, only: im1, jm1, km1
380  use functions, only: is_on_mype_plus2layers, bound_funijk
381  use compar, only: dead_cell_at
382  IMPLICIT NONE
383 
384 ! Dummy arguments
385 !--------------------------------------------------------------------//
386 ! index for boundary condition
387  INTEGER, INTENT(IN) :: BCV
388 
389 ! Local variables
390 !--------------------------------------------------------------------//
391 ! indices
392  INTEGER :: I, J, K, IJK, M
393 ! ijk index for setting normal component of velocity
394  INTEGER :: FIJK
395 ! number densities for use in GHD theory only
396  DOUBLE PRECISION :: nM, nTOT
397 ! calculation for normal component of mixture velocity
398  DOUBLE PRECISION :: lvel_s
399 !--------------------------------------------------------------------//
400 
401  DO k = bc_k_b(bcv), bc_k_t(bcv)
402  DO j = bc_j_s(bcv), bc_j_n(bcv)
403  DO i = bc_i_w(bcv), bc_i_e(bcv)
404  IF (.NOT.is_on_mype_plus2layers(i,j,k)) cycle
405  IF (dead_cell_at(i,j,k)) cycle ! skip dead cells
406  ijk = bound_funijk(i,j,k)
407 
408  p_star(ijk) = zero
409  p_g(ijk) = scale_pressure(bc_p_g(bcv))
410  ep_g(ijk) = bc_ep_g(bcv)
411  t_g(ijk) = bc_t_g(bcv)
412 
413  IF (nmax(0) > 0) &
414  x_g(ijk,:nmax(0)) = bc_x_g(bcv,:nmax(0))
415 
416  IF (nscalar > 0) &
417  scalar(ijk,:nscalar) = bc_scalar(bcv,:nscalar)
418 
419  IF (k_epsilon) THEN
420  k_turb_g(ijk) = bc_k_turb_g(bcv)
421  e_turb_g(ijk) = bc_e_turb_g(bcv)
422  ENDIF
423 
424  DO m = 1, smax
425  rop_s(ijk,m) = bc_rop_s(bcv,m)
426  t_s(ijk,m) = bc_t_s(bcv,m)
427  theta_m(ijk,m) = bc_theta_m(bcv,m)
428  IF (nmax(m) > 0) &
429  x_s(ijk,m,:nmax(m)) = bc_x_s(bcv,m,:nmax(m))
430  ENDDO
431 
432  u_g(ijk) = bc_u_g(bcv)
433  v_g(ijk) = bc_v_g(bcv)
434  w_g(ijk) = bc_w_g(bcv)
435  IF (smax > 0) THEN
436  u_s(ijk,:smax) = bc_u_s(bcv,:smax)
437  v_s(ijk,:smax) = bc_v_s(bcv,:smax)
438  w_s(ijk,:smax) = bc_w_s(bcv,:smax)
439  ENDIF
440 
441 ! When the boundary plane is located on the E, N, T side of the domain
442 ! (fluid cell is located w, s, b), set the component of velocity normal
443 ! to the boundary plane of the adjacent fluid cell
444  SELECT CASE (trim(bc_plane(bcv)))
445  CASE ('W')
446  fijk = bound_funijk(im1(i),j,k)
447  u_g(fijk) = bc_u_g(bcv)
448  IF (smax >0) u_s(fijk,:smax) = bc_u_s(bcv,:smax)
449  CASE ('S')
450  fijk = bound_funijk(i,jm1(j),k)
451  v_g(fijk) = bc_v_g(bcv)
452  IF(smax>0) v_s(fijk,:smax) = bc_v_s(bcv,:smax)
453  CASE ('B')
454  fijk = bound_funijk(i,j,km1(k))
455  w_g(fijk) = bc_w_g(bcv)
456  IF (smax>0) w_s(fijk,:smax) = bc_w_s(bcv,:smax)
457  END SELECT
458 
459 ! for GHD theory to compute mixture BC of velocity and density
460  IF(kt_type_enum == ghd_2007) THEN
461  rop_s(ijk,mmax) = zero
462  ntot = zero
463  theta_m(ijk,mmax) = zero
464  u_s(ijk,mmax) = zero
465  v_s(ijk,mmax) = zero
466  w_s(ijk,mmax) = zero
467  lvel_s = zero
468  DO m = 1, smax
469  rop_s(ijk,mmax) = rop_s(ijk,mmax) + &
470  bc_rop_s(bcv,m)
471  nm = bc_rop_s(bcv,m)*6d0/ &
472  (pi*d_p(ijk,m)**3*ro_s(ijk,m))
473  ntot = ntot + nm
474  theta_m(ijk,mmax) = theta_m(ijk,mmax) + &
475  nm*bc_theta_m(bcv,m)
476  u_s(ijk,mmax) = u_s(ijk,mmax) + &
477  bc_rop_s(bcv,m)*bc_u_s(bcv,m)
478  v_s(ijk,mmax) = v_s(ijk,mmax) + &
479  bc_rop_s(bcv,m)*bc_v_s(bcv,m)
480  w_s(ijk,mmax) = w_s(ijk,mmax) + &
481  bc_rop_s(bcv,m)*bc_w_s(bcv,m)
482 ! set velocity component normal to plane in adjacent fluid cell
483  SELECT CASE (trim(bc_plane(bcv)))
484  CASE ('W')
485  lvel_s = lvel_s + bc_rop_s(bcv,m)*bc_u_s(bcv,m)
486  CASE ('S')
487  lvel_s = lvel_s + bc_rop_s(bcv,m)*bc_v_s(bcv,m)
488  CASE ('B')
489  lvel_s = lvel_s + bc_rop_s(bcv,m)*bc_w_s(bcv,m)
490  END SELECT
491  ENDDO
492  IF(rop_s(ijk,mmax) > zero) THEN
493  theta_m(ijk,mmax) = theta_m(ijk,mmax) / ntot
494  u_s(ijk,mmax) = u_s(ijk,mmax) / rop_s(ijk,mmax)
495  v_s(ijk,mmax) = v_s(ijk,mmax) / rop_s(ijk,mmax)
496  w_s(ijk,mmax) = w_s(ijk,mmax) / rop_s(ijk,mmax)
497  lvel_s = lvel_s/rop_s(ijk,mmax)
498  ENDIF
499  SELECT CASE (trim(bc_plane(bcv)))
500  CASE ('W')
501  fijk = bound_funijk(im1(i),j,k)
502  u_s(fijk,mmax) = lvel_s
503  CASE ('S')
504  fijk = bound_funijk(i,jm1(j),k)
505  v_s(fijk,mmax) = lvel_s
506  CASE ('B')
507  fijk = bound_funijk(i,j,km1(k))
508  w_s(fijk,mmax) = lvel_s
509  END SELECT
510 
511  ENDIF ! end if (trim(kt_type) ='ghd')
512 
513 ! Set MMS BCs when MI boundary condition is used.
514  IF (use_mms) THEN
515  p_g(ijk) = scale_pressure(mms_p_g(ijk))
516  ep_g(ijk) = mms_ep_g(ijk)
517  t_g(ijk) = mms_t_g(ijk)
518 
519  DO m = 1, smax
520  rop_s(ijk,m) = mms_rop_s(ijk)
521  t_s(ijk,m) = mms_t_s(ijk)
522  theta_m(ijk,m) = mms_theta_m(ijk)
523  ENDDO
524 
525  u_g(ijk) = mms_u_g(ijk)
526  v_g(ijk) = mms_v_g(ijk)
527  w_g(ijk) = mms_w_g(ijk)
528  IF (smax > 0) THEN
529  u_s(ijk,:smax) = mms_u_s(ijk)
530  v_s(ijk,:smax) = mms_v_s(ijk)
531  w_s(ijk,:smax) = mms_w_s(ijk)
532  ENDIF
533 ! When the boundary plane is W, S, or B the normal component of velocity
534 ! needs to be set for both sides of the boundary cell.
535  SELECT CASE (trim(bc_plane(bcv)))
536  CASE ('W')
537  fijk = bound_funijk(im1(i),j,k)
538  u_g(fijk) = mms_u_g(fijk)
539  IF(smax>0) u_s(fijk,:smax) = mms_u_s(fijk)
540  CASE ('S')
541  fijk = bound_funijk(i,jm1(j),k)
542  v_g(fijk) = mms_v_g(fijk)
543  IF(smax>0) v_s(fijk,:smax) = mms_v_s(fijk)
544  CASE ('B')
545  fijk = bound_funijk(i,j,km1(k))
546  w_g(fijk) = mms_w_g(fijk)
547  IF(smax>0) w_s(fijk,:smax) = mms_w_s(fijk)
548  END SELECT
549  ENDIF ! end if(USE_MMS)
550 
551  ENDDO ! do i
552  ENDDO ! do j
553  ENDDO ! do k
554 
555  RETURN
556  END SUBROUTINE set_bc0_inflow
557 
558 
559 !vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvC
560 ! C
561 ! Subroutine: set_bc0_init_jet C
562 ! Purpose: initializing time dependent jet conditions C
563 ! C
564 !^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^C
565  SUBROUTINE set_bc0_init_jet(BCV)
567 ! Modules
568 !--------------------------------------------------------------------//
569  use bc, only: bc_plane
570  use bc, only: bc_jet_g, bc_jet_g0
571  use bc, only: bc_dt_0, bc_time
572  use bc, only: bc_u_g, bc_v_g, bc_w_g
573  use param1, only: undefined
574  use run, only: time
575  IMPLICIT NONE
576 
577 ! Dummy arguments
578 !--------------------------------------------------------------------//
579 ! index of boundary
580  INTEGER, INTENT(IN) :: BCV
581 !--------------------------------------------------------------------//
582 
583  bc_jet_g(bcv) = undefined
584  IF (bc_dt_0(bcv) /= undefined) THEN
585  bc_time(bcv) = time + bc_dt_0(bcv)
586  bc_jet_g(bcv) = bc_jet_g0(bcv)
587  IF (bc_jet_g(bcv) /= undefined) THEN
588  SELECT CASE (trim(bc_plane(bcv)))
589  CASE ('W', 'E')
590  bc_u_g(bcv) = bc_jet_g(bcv)
591  CASE ('S', 'N')
592  bc_v_g(bcv) = bc_jet_g(bcv)
593  CASE ('B', 'T')
594  bc_w_g(bcv) = bc_jet_g(bcv)
595  END SELECT
596  ENDIF
597  ELSE
598  bc_time(bcv) = undefined
599  ENDIF
600  RETURN
601  END SUBROUTINE set_bc0_init_jet
602 
603 
604 !vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvC
605 ! C
606 ! Subroutine: set_bc0_init_bcdt_calcs C
607 ! Purpose: initializing time dependent outflow calculations for C
608 ! modifying outflow conditions (MO type) or simple reporting C
609 ! outflow conditions (PO or O types) C
610 ! C
611 !^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^C
612  SUBROUTINE set_bc0_init_bcdt_calcs(BCV)
614 ! Modules
615 !--------------------------------------------------------------------//
616  use bc, only: bc_dt_0, bc_time
617  use bc, only: bc_out_n
618  use bc, only: bc_mout_g, bc_mout_s
619  use bc, only: bc_vout_g, bc_vout_s
620  use physprop, only: smax
621  use param1, only: undefined, zero
622  use run, only: time
623  IMPLICIT NONE
624 ! Dummy arguments
625 !--------------------------------------------------------------------//
626 ! index of boundary
627  INTEGER, INTENT(IN) :: BCV
628 !--------------------------------------------------------------------//
629 
630 ! initializing for time dependent outflow reporting calculation
631  IF (bc_dt_0(bcv) /= undefined) THEN
632  bc_time(bcv) = time + bc_dt_0(bcv)
633  bc_out_n(bcv) = 0
634  bc_mout_g(bcv) = zero
635  bc_vout_g(bcv) = zero
636  IF (smax > 0) THEN
637  bc_mout_s(bcv,:smax) = zero
638  bc_vout_s(bcv,:smax) = zero
639  ENDIF
640  ELSE
641  bc_time(bcv) = undefined
642  ENDIF
643  RETURN
644  END SUBROUTINE set_bc0_init_bcdt_calcs
645 
646 
647 !vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv!
648 ! C
649 ! Subroutine: set_bc0_init_scalars C
650 ! Purpose: Provide a mechanism to initialize certain field variables C
651 ! in the boundary cell to the value of the neighboring fluid cell. C
652 ! It is not clear to what extent initialization is necessary as the C
653 ! governing matrix equation for each of the field variables is set C
654 ! such that the bc cells are not actually solved but are set to the C
655 ! value of the adjacent fluid cell(see bc_phi). However, there may be C
656 ! some instance in the code where the bc cells are referenced before C
657 ! the code has called the governing equation. C
658 ! This subroutine illustrates how these particular variables should C
659 ! not need (or use) bc values defined by the user! C
660 ! C
661 ! Comments: this call replaces some initializations that were C
662 ! 'inadvertently' occurring in set_bc1 C
663 ! C
664 ! WARNING: this routine only serves to initialize field variables C
665 ! whose governing solver routine invokes bc_phi! do not insert any C
666 ! other initializations here as it is likely not appropriate!! C
667 ! C
668 !^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^!
669  SUBROUTINE set_bc0_init_bcscalars(BCV)
671 ! Modules
672 !--------------------------------------------------------------------//
673  use bc, only: bc_plane
674  use bc, only: bc_k_b, bc_k_t
675  use bc, only: bc_j_s, bc_j_n
676  use bc, only: bc_i_w, bc_i_e
677 
678  use fldvar, only: t_g, t_s, theta_m
679  use fldvar, only: x_g, x_s, scalar
680  use fldvar, only: k_turb_g, e_turb_g
681  use physprop, only: smax, mmax
682  use physprop, only: nmax
683  use run, only: k_epsilon, kt_type_enum, ghd_2007
684  use scalars, only: nscalar
685 
686  use indices, only: im1, ip1, jm1, jp1, km1, kp1
687  use functions, only: is_on_mype_plus2layers, bound_funijk
688  use compar, only: dead_cell_at
689  IMPLICIT NONE
690 
691 ! Dummy arguments
692 !--------------------------------------------------------------------//
693 ! index of boundary
694  INTEGER, INTENT(IN) :: BCV
695 
696 ! Local variables
697 !--------------------------------------------------------------------//
698 ! indices of current boundary cell
699  INTEGER :: IJK, I, J, K
700 ! index of neighboring fluid cell
701  INTEGER :: FIJK
702 ! local indices
703  INTEGER :: M
704 !--------------------------------------------------------------------//
705 
706  DO k = bc_k_b(bcv), bc_k_t(bcv)
707  DO j = bc_j_s(bcv), bc_j_n(bcv)
708  DO i = bc_i_w(bcv), bc_i_e(bcv)
709  IF (.NOT.is_on_mype_plus2layers(i,j,k)) cycle
710  IF (dead_cell_at(i,j,k)) cycle ! skip dead cells
711  ijk = bound_funijk(i,j,k)
712 
713  SELECT CASE (trim(bc_plane(bcv)))
714  CASE ('W') ! fluid cell at west
715  fijk = bound_funijk(im1(i),j,k)
716  CASE ('E')
717  fijk = bound_funijk(ip1(i),j,k)
718  CASE ('S') ! fluid cell at south
719  fijk = bound_funijk(i,jm1(j),k)
720  CASE ('N')
721  fijk = bound_funijk(i,jp1(j),k)
722  CASE ('B') ! fluid cell at bottom
723  fijk = bound_funijk(i,j,km1(k))
724  CASE ('T')
725  fijk = bound_funijk(i,j,kp1(k))
726  END SELECT
727 
728  t_g(ijk) = t_g(fijk)
729  IF (nmax(0) > 0) &
730  x_g(ijk,:nmax(0)) = x_g(fijk,:nmax(0))
731 
732 ! setting scalar quantities
733  IF (nscalar >0) &
734  scalar(ijk, :nscalar) = scalar(fijk, :nscalar)
735 
736 ! setting turbulence quantities
737  IF(k_epsilon) THEN
738  k_turb_g(ijk) = k_turb_g(fijk)
739  e_turb_g(ijk) = e_turb_g(fijk)
740  ENDIF
741 
742 ! this should only loop of tfm phases
743  DO m = 1, smax
744  t_s(ijk,m) = t_s(fijk,m)
745  theta_m(ijk,m) = theta_m(fijk,m)
746  IF (nmax(m) > 0) &
747  x_s(ijk,m,:nmax(m)) = x_s(fijk,m,:nmax(m))
748  ENDDO
749 
750  IF(kt_type_enum == ghd_2007) &
751  theta_m(ijk,mmax) = theta_m(fijk,mmax)
752 
753  ENDDO
754  ENDDO
755  ENDDO
756  RETURN
757  END SUBROUTINE set_bc0_init_bcscalars
758 
759 
760 !vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv!
761 ! !
762 ! Subroutine: SET_IJK_P_G !
763 ! Purpose: Pick an appropriate control volume to specify Ppg. !
764 ! !
765 ! Author: J. Musser Date: 07-Nov-13 !
766 ! Reviewer: Date: !
767 ! !
768 !^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^!
769  SUBROUTINE set_ijk_p_g
771 ! IJK location where Ppg is fixed.
772  use bc, only: ijk_p_g
773 ! Specified constant gas density.
774  use physprop, only: ro_g0
775 
776  use bc
777  use exit, only: mfix_exit
778  use funits, only: dmp_log
782  use geometry, only: do_k
783  use geometry, only: imax1, imin1
784  use geometry, only: jmax1, jmin1
785  use geometry, only: kmax1, kmin1
786 
787 ! MFIX Runtime parameters:
788  use param, only: dimension_bc
789  use param1, only: undefined
790  use param1, only: undefined_i
791 
792  use mpi_utility
793 
794  implicit none
795 !--------------------------------------------------------------------//
796  INTEGER :: BCV
797 
798  CHARACTER(len=7) :: Map
799  CHARACTER(len=128) :: lMsg
800 
801  INTEGER :: l3
802  INTEGER :: l2, u2
803  INTEGER :: l1, u1
804 
805  LOGICAL, parameter :: setDBG = .false.
806  LOGICAL :: dFlag
807  INTEGER :: iErr
808 
809 !--------------------------------------------------------------------//
810 
811  dflag = (dmp_log .AND. setdbg)
812 
813 ! Initialize.
814  ierr = 0
816 
817 ! This is not needed for compressible cases.
818  IF(ro_g0 == undefined) THEN
819  IF(dflag) write(*,"(3x,A)") &
820  'Compressible: IJK_P_g remaining undefined.'
821  return
822  ELSEIF(ro_g0 == 0.0d0) THEN
823  IF(dflag) write(*,"(3x,A)") &
824  'No gas phase: IJK_P_g remaining undefined.'
825  return
826  ENDIF
827 
828 ! If there are no cyclic boundaries, look for a pressure outflow.
829  lpbcv: DO bcv = 1, dimension_bc
830  IF (.NOT.bc_defined(bcv)) cycle lpbcv
831  IF (bc_type_enum(bcv) == p_outflow .OR. &
832  bc_type_enum(bcv) == p_inflow) THEN
833  IF(dflag) write(*,"(3x,A)") &
834  'Outflow PC defined: IJK_P_g remaining undefined.'
835  RETURN
836  ENDIF
837  ENDDO lpbcv
838 
839 ! Initialize.
840  l3 = undefined_i
841  l2 = undefined_i; u2=l2
842  l1 = undefined_i; u1=l1
843 
844 ! If there are cyclic boundaries, flag a cell along the positive
845 ! domain extreme in the cyclic direction (e.g., JMAX1).
846  IF(cyclic_y .OR. cyclic_y_pd .OR. cyclic_y_mf) THEN
847 
848  map = 'JKI_MAP'
849  l3 = jmax1
850  l2 = kmin1; u2 = kmax1
851  l1 = imin1; u1 = imax1
852  lmsg='Cyclic in Y'
853 
854  ELSEIF(cyclic_x .OR. cyclic_x_pd .OR. cyclic_x_mf) THEN
855 
856  map = 'IKJ_MAP'
857  l3 = imax1
858  l2 = kmin1; u2 = kmax1
859  l1 = jmin1; u1 = jmax1
860  lmsg='Cyclic in X'
861 
862  ELSEIF(cyclic_z .OR. cyclic_z_pd .OR. cyclic_z_mf) THEN
863 
864  map = 'KIJ_MAP'
865  l3 = kmax1
866  l2 = imin1; u2 = imax1
867  l1 = jmin1; u1 = jmax1
868  lmsg='Cyclic in Z'
869 
870  ENDIF
871 
872 ! No cyclic boundaries or pressure outflows. The IJ plane is used in
873 ! this case to maximize search region for 2D problems.
874  IF(l3 == undefined_i) THEN
875  map = 'KIJ_MAP'
876  l3 = merge(max((kmax1-kmin1)/2+1,2), kmin1, do_k)
877  l2 = imin1; u2 = imax1
878  l1 = jmin1; u1 = jmax1
879  lmsg='Center of domain'
880  ENDIF
881 
882 ! Debugging messages.
883  IF(dflag) THEN
884  write(*,"(3/,3x,'Map: ',A)") map
885  write(*,"(/5x,'l3:',2x,I4)") l3
886  write(*,"( 5x,'l2:',2(2x,I4))") l2, u2
887  write(*,"( 5x,'l1:',2(2x,I4))") l1, u1
888  write(*,"( 5x,'Msg: ',A)") trim(lmsg)
889  ENDIF
890 
891 ! Invoke the search routine.
892  CALL ijk_pg_search(l3, l2, u2, l1, u1, map, dflag, ierr)
893 
894  IF(ierr == 0) RETURN
895 
896 ! Error management.
897  IF(dmp_log) THEN
898  SELECT CASE (ierr)
899  CASE ( 1001); WRITE(unit_log, 1001); WRITE(*,1001)
900  CASE ( 2000); WRITE(unit_log, 2000); WRITE(*,2000)
901  CASE ( 2001); WRITE(unit_log, 2001); WRITE(*,2001)
902  CASE ( 2002); WRITE(unit_log, 2002); WRITE(*,2002)
903  CASE DEFAULT
904  WRITE(unit_log, 1000) ierr
905  WRITE(*,1000) ierr
906  END SELECT
907 
908  WRITE(unit_log, 9000) map(1:1), l3, map(2:2), &
909  l2, u2, map(3:3), l1, u1
910  WRITE(*, 9000) map(1:1), l3, map(2:2), &
911  l2, u2, map(3:3), l1, u1
912 
913  WRITE(*, 9999)
914  WRITE(unit_log, 9999)
915 
916  ENDIF
917 
918 
919  CALL mfix_exit(mype)
920 
921 
922  1000 FORMAT(//1x,70('*')/' From: SET_IJK_Pg',/, &
923  ' Error 1000: Unknown error reported. x', i4.4)
924 
925  1001 FORMAT(//1x,70('*')/' From: SET_IJK_Pg',/, &
926  ' Error 1001: Invalid mapping function.')
927 
928  2000 FORMAT(//1x,70('*')/' From: SET_IJK_Pg > IJK_Pg_SEARCH',/, &
929  ' Error 2000: Unknown error reported from IJK_Pg_SEARCH.')
930 
931  2001 FORMAT(//1x,70('*')/' From: SET_IJK_Pg > IJK_Pg_SEARCH',/, &
932  ' Error 2001: Unable to locate fluid cell in search region.')
933 
934  2002 FORMAT(//1x,70('*')/' From: SET_IJK_Pg > IJK_Pg_SEARCH',/, &
935  ' Error 2002: Unable to locate fluid cell owner.')
936 
937  9000 FORMAT(/' Search plane information:',/,3x,a1,': ',i8, &
938  2(/3x,a1,': ',i8,' x ',i8))
939 
940  9999 FORMAT(/' Fatal Error --> Invoking MFIX_EXIT',/1x,70('*'),2/)
941 
942  END SUBROUTINE set_ijk_p_g
943 
944 !vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv!
945 ! !
946 ! Author: J. Musser Date: 07-Nov-13 !
947 ! Reviewer: Date: !
948 ! !
949 !^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^!
950  SUBROUTINE ijk_pg_search(ll3, ll2, lu2, ll1, lu1, lMAP, &
951  ldflag, ierr)
953 ! Modules
954 !--------------------------------------------------------------------//
955 ! IJK location where Ppg is fixed.
956  USE exit, only: mfix_exit
957  use bc, only: ijk_p_g
958  use functions
959  use indices
960  use mpi_utility
961  use param1, only: undefined_i
962  implicit none
963 
964 ! Dummy arguments
965 !--------------------------------------------------------------------//
966  INTEGER, INTENT(IN) :: ll3
967  INTEGER, INTENT(IN) :: ll2, lu2
968  INTEGER, INTENT(IN) :: ll1, lu1
969  LOGICAL, INTENT(IN) :: ldFlag
970  INTEGER, INTENT(OUT) :: iErr
971  CHARACTER(len=*), INTENT(IN) :: lMAP
972 
973 ! Local variables
974 !--------------------------------------------------------------------//
975  INTEGER :: lc2, lS2, lE2
976  INTEGER :: lc1, lS1, lE1
977  INTEGER :: I, J, K, IJK
978  LOGICAL :: recheck
979  INTEGER :: IJK_Pg_Owner, proc
980  INTEGER :: gIJK(0:numpes-1)
981  INTEGER :: I_J_K_Pg(3)
982  INTEGER :: lpCnt
983 
984  CHARACTER(len=32) :: cInt
985 
986 !--------------------------------------------------------------------//
987 
988 ! Initialize Error Flag
989  ierr = 2000
990 
991 ! Initialize the Owner ID
992  ijk_pg_owner = undefined_i
993 
994 ! Set the initial search region, a single cell.
995  ls1 = ll1 + (lu1-ll1)/2 + 1; le1 = ls1
996  ls2 = ll2 + (lu2-ll2)/2 + 1; le2 = ls2
997 
998  lpcnt = 1
999  recheck = .true.
1000  do while(recheck)
1001 
1002 ! Initialize the global IJK array to zero. Resetting this array inside
1003 ! this do-loop is most likely overkill. This loop should only cycle
1004 ! if gIJK is zero.
1005  gijk = 0
1006 
1007 ! Report debugging information for the search region.
1008  if(ldflag) then
1009  write(*,"(/5x,'Pass: ',I4)") lpcnt
1010  write(*,"( 5x,'lp2 bounds:',2(2x,I4))")ls2, le2
1011  write(*,"( 5x,'lp1 bounds:',2(2x,I4))")ls1, le1
1012  endif
1013 
1014  lp2: do lc2 = ls2, le2
1015  lp1: do lc1 = ls1, le1
1016 ! Map the loop counters to I/J/K indices.
1017  SELECT CASE (lmap)
1018  CASE ('JKI_MAP')
1019  i=lc1; j=ll3; k=lc2
1020  CASE ('IKJ_MAP')
1021  i=ll3; j=lc1; k=lc2
1022  CASE ('KIJ_MAP')
1023  i=lc2; j=lc1; k=ll3
1024  CASE DEFAULT
1025  ierr = 1001
1026  END SELECT
1027 
1028 ! Only the rank that owns this I/J/K proceeds.
1029  if(.NOT.is_on_mype_owns(i,j,k)) cycle
1030 ! Calculate the triple loop index.
1031  ijk = funijk(i,j,k)
1032 ! If there is fluid at this location, store the IJK and exit loops.
1033  if(fluid_at(ijk)) then
1034  gijk(mype) = ijk
1035  exit lp2
1036  endif
1037  enddo lp1
1038  enddo lp2
1039 
1040 ! Sync gIJK across all processes. Select the lowest ranked process that
1041 ! has gIJK defined. This choice is arbitray and doesn't really matter.
1042 ! It just needs to be consistent.
1043  CALL global_all_sum(gijk)
1044  proc_lp: do proc=0, numpes-1
1045  if(gijk(proc) /= 0) then
1046  ijk_p_g = gijk(proc)
1047  ijk_pg_owner = proc
1048  recheck = .false.
1049  exit proc_lp
1050  endif
1051  enddo proc_lp
1052 
1053 ! If the proceeding section did not find a fluid cell, expand the search
1054 ! area and try again.
1055  if(recheck) then
1056  if(ls1 > ll1 .OR. le1 < lu1 .OR. &
1057  ls2 > ll2 .OR. le2 < lu2) then
1058 ! Expand the 1-axis
1059  ls1 = max((ls1-1), ll1)
1060  le1 = min((le1+1), lu1)
1061 ! Expand the 2-axis
1062  ls2 = max((ls2-1), ll2)
1063  le2 = min((le2+1), lu2)
1064 ! The entire seach plane was checked with no fluid cell identified.
1065 ! Force IJK_P_g to undefined for later error checking.
1066  else
1067  recheck = .false.
1069  endif
1070  endif
1071  enddo
1072 
1073 ! Verify that one fluid cell was detected. Otherwise flag the possible
1074 ! errors and return.
1075  if(ijk_p_g == undefined_i) then
1076  ierr = 2001
1077  return
1078  elseif(ijk_pg_owner == undefined_i) then
1079  ierr = 2002
1080  return
1081  endif
1082 
1083 
1084 ! The owner if the IJK_Pg gets the global I/J/K values and sends
1085 ! them to all ranks.
1086  if(mype == ijk_pg_owner) then
1087  i_j_k_pg(1) = i_of(ijk_p_g)
1088  i_j_k_pg(2) = j_of(ijk_p_g)
1089  i_j_k_pg(3) = k_of(ijk_p_g)
1090  endif
1091  CALL bcast(i_j_k_pg, ijk_pg_owner)
1092 
1093  i = i_j_k_pg(1)
1094  j = i_j_k_pg(2)
1095  k = i_j_k_pg(3)
1096 
1097 ! If debugging, have PE_IO report some information before the
1098 ! data is overwritten.
1099  if(ldflag) then
1100  write(*,"(/3x,'IJK_P_g successfully identified!')")
1101  cint=''; write(cint,*) ijk_pg_owner
1102  write(*,"( 5x,'Owner Rank: ',A)")trim(adjustl(cint))
1103  cint=''; write(cint,*) ijk_p_g
1104  write(*,"(5x, 'IJK: ',A)", advance='no') trim(adjustl(cint))
1105  write(*,"(' :: ')", advance='no')
1106  cint=''; write(cint,*) i
1107  write(*,"('(',A)",advance='no') trim(adjustl(cint))
1108  cint=''; write(cint,*) j
1109  write(*,"(',',A)",advance='no') trim(adjustl(cint))
1110  cint=''; write(cint,*) k
1111  write(*,"(',',A,')',2/)") trim(adjustl(cint))
1112  endif
1113 
1114 ! Ranks that 'see' IJK_P_g store their local IJK value. Everyone else
1115 ! resets IJK_P_g to UNDEFINED_I. This removes the need for getting
1116 ! I/J/K values later on in source_PPg.
1117 ! IJK_P_g = merge(funijk(I,J,K), UNDEFINED_I, &
1118 ! IS_ON_myPE_plus2layers(I,J,K))
1119 
1120  IF(is_on_mype_plus2layers(i,j,k)) THEN
1121  ijk_p_g = funijk(i,j,k)
1122  ELSE
1124  ENDIF
1125 
1126  ierr = 0
1127  RETURN
1128  END SUBROUTINE ijk_pg_search
integer, dimension(:), allocatable ip1
Definition: indices_mod.f:50
double precision, dimension(:), allocatable mms_v_g
Definition: mms_mod.f:27
integer, dimension(dimension_bc) bc_k_b
Definition: bc_mod.f:70
double precision, dimension(dimension_bc) bc_mout_g
Definition: bc_mod.f:257
double precision, dimension(dimension_bc) bc_time
Definition: bc_mod.f:242
double precision, dimension(:,:), allocatable v_s
Definition: fldvar_mod.f:105
double precision, dimension(:), allocatable mms_u_g
Definition: mms_mod.f:26
logical dmp_log
Definition: funits_mod.f:6
double precision, dimension(dimension_bc, dim_scalar) bc_scalarw
Definition: bc_mod.f:396
double precision, dimension(dimension_bc) bc_dt_0
Definition: bc_mod.f:221
integer, dimension(:), allocatable i_of
Definition: indices_mod.f:45
double precision, dimension(:), allocatable mms_v_s
Definition: mms_mod.f:38
subroutine set_bc0_outflow(BCV)
Definition: set_bc0.f:192
double precision, dimension(:), allocatable mms_t_g
Definition: mms_mod.f:31
double precision, dimension(dimension_bc, dim_m) bc_mout_s
Definition: bc_mod.f:260
double precision, dimension(:), allocatable ep_g
Definition: fldvar_mod.f:15
double precision, dimension(dimension_bc) bc_t_g
Definition: bc_mod.f:97
double precision, dimension(:), allocatable k_turb_g
Definition: fldvar_mod.f:161
integer, dimension(dimension_bc) bc_i_w
Definition: bc_mod.f:54
double precision, dimension(:,:), allocatable w_s
Definition: fldvar_mod.f:117
integer, dimension(dimension_bc) bc_j_n
Definition: bc_mod.f:66
logical cyclic_z_mf
Definition: geometry_mod.f:165
double precision, dimension(dimension_bc, dim_m) bc_w_s
Definition: bc_mod.f:129
integer, dimension(:), allocatable im1
Definition: indices_mod.f:50
double precision, dimension(dimension_bc, dim_m, dim_n_s) bc_x_s
Definition: bc_mod.f:254
double precision, dimension(:), allocatable t_g
Definition: fldvar_mod.f:63
double precision, dimension(dimension_bc, dim_m) bc_tw_s
Definition: bc_mod.f:341
subroutine set_bc0_init_bcscalars(BCV)
Definition: set_bc0.f:670
double precision function scale_pressure(XXX)
Definition: scales_mod.f:18
subroutine set_bc0_walls(BCV)
Definition: set_bc0.f:98
double precision, dimension(:,:), allocatable scalar
Definition: fldvar_mod.f:155
double precision, dimension(dimension_bc) bc_jet_g0
Definition: bc_mod.f:227
double precision, dimension(:), allocatable p_g
Definition: fldvar_mod.f:26
integer, parameter dimension_bc
Definition: param_mod.f:61
logical cyclic_z
Definition: geometry_mod.f:153
integer, dimension(dimension_bc) bc_type_enum
Definition: bc_mod.f:146
double precision, parameter undefined
Definition: param1_mod.f:18
double precision, dimension(dimension_bc) bc_v_g
Definition: bc_mod.f:117
double precision, parameter tmin
Definition: toleranc_mod.f:34
double precision, dimension(:,:), allocatable u_s
Definition: fldvar_mod.f:93
logical cyclic_z_pd
Definition: geometry_mod.f:159
subroutine set_bc0_init_bcdt_calcs(BCV)
Definition: set_bc0.f:613
character, dimension(dimension_bc) bc_plane
Definition: bc_mod.f:217
integer, dimension(:), allocatable k_of
Definition: indices_mod.f:47
double precision, dimension(dimension_bc, dim_m) bc_thetaw_m
Definition: bc_mod.f:355
subroutine set_bc0_inflow(BCV)
Definition: set_bc0.f:341
double precision, dimension(:,:), allocatable d_p
Definition: fldvar_mod.f:57
integer kmax1
Definition: geometry_mod.f:58
subroutine mfix_exit(myID, normal_termination)
Definition: exit.f:5
integer, dimension(dimension_bc) bc_k_t
Definition: bc_mod.f:74
integer mmax
Definition: physprop_mod.f:19
logical, dimension(:,:,:), allocatable dead_cell_at
Definition: compar_mod.f:127
double precision, dimension(:,:,:), allocatable x_s
Definition: fldvar_mod.f:78
integer, dimension(:), allocatable j_of
Definition: indices_mod.f:46
integer, dimension(:), allocatable jm1
Definition: indices_mod.f:51
logical cyclic_y_pd
Definition: geometry_mod.f:157
double precision, dimension(dimension_bc, dim_m) bc_t_s
Definition: bc_mod.f:101
double precision ro_g0
Definition: physprop_mod.f:59
double precision, dimension(dimension_bc, dim_m) bc_vout_s
Definition: bc_mod.f:266
integer imax1
Definition: geometry_mod.f:54
double precision, dimension(:), allocatable mms_t_s
Definition: mms_mod.f:42
double precision, dimension(:,:), allocatable t_s
Definition: fldvar_mod.f:66
double precision, dimension(:,:), allocatable x_g
Definition: fldvar_mod.f:75
integer, dimension(dimension_bc) bc_j_s
Definition: bc_mod.f:62
Definition: exit.f:2
logical cyclic_y
Definition: geometry_mod.f:151
integer, dimension(:), allocatable jp1
Definition: indices_mod.f:51
double precision, dimension(dimension_bc) bc_tw_g
Definition: bc_mod.f:338
double precision, dimension(:), allocatable mms_u_s
Definition: mms_mod.f:37
double precision, dimension(dimension_bc, dim_scalar) bc_scalar
Definition: bc_mod.f:384
double precision, dimension(dimension_bc, dim_m, dim_n_s) bc_xw_s
Definition: bc_mod.f:371
double precision, dimension(:,:), allocatable theta_m
Definition: fldvar_mod.f:149
Definition: mms_mod.f:12
subroutine set_bc0_init_jet(BCV)
Definition: set_bc0.f:566
integer ijk_p_g
Definition: bc_mod.f:304
double precision, dimension(:), allocatable v_g
Definition: fldvar_mod.f:99
logical, dimension(dimension_bc) bc_defined
Definition: bc_mod.f:207
double precision, dimension(dimension_bc) bc_p_g
Definition: bc_mod.f:80
subroutine ijk_pg_search(ll3, ll2, lu2, ll1, lu1, lMAP, ldFlag, iErr)
Definition: set_bc0.f:952
subroutine set_ijk_p_g
Definition: set_bc0.f:770
integer, dimension(:), allocatable kp1
Definition: indices_mod.f:52
double precision, dimension(:), allocatable w_g
Definition: fldvar_mod.f:111
double precision, dimension(:), allocatable mms_ep_g
Definition: mms_mod.f:20
logical cyclic_y_mf
Definition: geometry_mod.f:163
integer jmax1
Definition: geometry_mod.f:56
Definition: run_mod.f:13
subroutine set_bc0
Definition: set_bc0.f:13
logical cyclic_x
Definition: geometry_mod.f:149
double precision, dimension(dimension_bc, dim_n_g) bc_xw_g
Definition: bc_mod.f:368
Definition: param_mod.f:2
logical cyclic_x_mf
Definition: geometry_mod.f:161
double precision, dimension(:,:), allocatable ro_s
Definition: fldvar_mod.f:45
double precision, dimension(:), allocatable mms_w_s
Definition: mms_mod.f:39
double precision, dimension(dimension_bc, dim_m) bc_v_s
Definition: bc_mod.f:121
integer, dimension(dimension_bc) bc_out_n
Definition: bc_mod.f:269
integer, dimension(0:dim_m) nmax
Definition: physprop_mod.f:119
integer jmin1
Definition: geometry_mod.f:42
logical do_k
Definition: geometry_mod.f:30
integer, dimension(:), allocatable km1
Definition: indices_mod.f:52
logical k_epsilon
Definition: run_mod.f:97
logical cyclic_x_pd
Definition: geometry_mod.f:155
double precision, dimension(:), allocatable p_star
Definition: fldvar_mod.f:142
double precision, dimension(dimension_bc) bc_u_g
Definition: bc_mod.f:109
double precision, dimension(:), allocatable mms_theta_m
Definition: mms_mod.f:45
logical use_mms
Definition: mms_mod.f:15
integer, parameter undefined_i
Definition: param1_mod.f:19
double precision, dimension(dimension_bc, dim_m) bc_u_s
Definition: bc_mod.f:113
double precision, dimension(dimension_bc) bc_e_turb_g
Definition: bc_mod.f:404
double precision, dimension(:), allocatable u_g
Definition: fldvar_mod.f:87
integer nscalar
Definition: scalars_mod.f:7
subroutine calculate_mms_source
Definition: mms_mod.f:217
double precision, dimension(dimension_bc, dim_m) bc_theta_m
Definition: bc_mod.f:105
double precision, dimension(dimension_bc, dim_n_g) bc_x_g
Definition: bc_mod.f:251
double precision, dimension(dimension_bc) bc_ep_g
Definition: bc_mod.f:77
double precision, dimension(dimension_bc) bc_k_turb_g
Definition: bc_mod.f:403
double precision, dimension(:), allocatable mms_rop_s
Definition: mms_mod.f:34
double precision, dimension(dimension_bc) bc_vout_g
Definition: bc_mod.f:263
double precision, dimension(:,:), allocatable rop_s
Definition: fldvar_mod.f:51
integer smax
Definition: physprop_mod.f:22
subroutine calculate_mms
Definition: mms_mod.f:202
double precision, parameter pi
Definition: constant_mod.f:158
integer imin1
Definition: geometry_mod.f:40
double precision time
Definition: run_mod.f:45
double precision, dimension(:), allocatable mms_p_g
Definition: mms_mod.f:23
double precision, dimension(:), allocatable e_turb_g
Definition: fldvar_mod.f:162
double precision, dimension(dimension_bc) bc_jet_g
Definition: bc_mod.f:224
double precision, dimension(dimension_bc) bc_w_g
Definition: bc_mod.f:125
integer kmin1
Definition: geometry_mod.f:44
double precision, dimension(:), allocatable mms_w_g
Definition: mms_mod.f:28
integer, dimension(dimension_bc) bc_i_e
Definition: bc_mod.f:58
double precision, parameter zero
Definition: param1_mod.f:27
double precision, dimension(dimension_bc, dim_m) bc_rop_s
Definition: bc_mod.f:92
Definition: bc_mod.f:23