File: /nfs/home/0/users/jenkins/mfix.git/model/usr_drag.f

1     !vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv!
2     !                                                                      !
3     !  Module name: USR_DRAG                                               !
4     !                                                                      !
5     !  Purpose: Provide a hook for user defined drag law implementation.   !
6     !                                                                      !
7     !  This routine is called from inside fluid (TFM) and particle (DES)   !
8     !  loops. The fluid cell index (IJK) and phase (TFM) or particle index !
9     !  (DES) is passed.                                                    !
10     !                                                                      !
11     !  ***************************   WARNING   **************************  !
12     !  *----------------------------------------------------------------*  !
13     !  * The dummy arguments changed in the 2015-1 MFIX Release.        *  !
14     !  *                                                                *  !
15     !  *   1) Phase index (M) is now particle index (NP) for DES. This  *  !
16     !  *      is reflected in the name change M --> M_NP.               *  !
17     !  *                                                                *  !
18     !  *   2) The fluid velocity was added as a dummy argument. This    *  !
19     !  *      provides access to the interpolated gas velocity for      *  !
20     !  *      coupled DES simulations.                                  *  !
21     !  *                                                                *  !
22     !  ******************************************************************  !
23     !                                                                      !
24     !^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^!
25           SUBROUTINE DRAG_USR(IJK, M_NP, lDgA, EPg, Mug, ROg, VREL, DPM, &
26              ROs, lUg, lVg, lWg)
27     
28           use error_manager
29     
30           IMPLICIT NONE
31     
32     ! Index of fluid cell:
33           INTEGER, INTENT(IN) :: IJK
34     ! TFM SOLIDS --> Index of phase (M)
35     ! DES SOLIDS --> Index of particle (NP); M = PIJK(NP,5)
36           INTEGER, INTENT(IN) :: M_NP
37     
38     ! drag coefficient
39           DOUBLE PRECISION, INTENT(OUT) :: lDgA
40     ! gas volume fraction
41           DOUBLE PRECISION, INTENT(IN) :: EPg
42     ! gas laminar viscosity
43           DOUBLE PRECISION, INTENT(IN) :: Mug
44     ! gas density
45           DOUBLE PRECISION, INTENT(IN) :: ROg
46     ! Magnitude of gas-solids relative velocity
47           DOUBLE PRECISION, INTENT(IN) :: VREL
48     ! particle diameter of solids phase M or
49     ! average particle diameter if PCF
50           DOUBLE PRECISION, INTENT(IN) :: DPM
51     ! particle density of solids phase M
52           DOUBLE PRECISION, INTENT(IN) :: ROs
53     ! fluid velocity components:
54     ! o TFM: Averaged from faces to cell center
55     ! o DES: Interpolated to the particle's position
56           DOUBLE PRECISION, INTENT(IN) :: lUg, lVg, lWg
57     
58     
59     ! The following error message is used to make sure that if a user
60     ! defined drag law is invoked, that this routine has been modified.
61     
62     
63     !- REMOVE THE FOLLOWING ---------------------------------------------->>
64     
65           lDgA = 0.0
66     
67           CALL INIT_ERR_MSG('USR_DRAG')
68           WRITE(ERR_MSG,9999)
69           CALL FLUSH_ERR_MSG(ABORT=.TRUE.)
70     
71      9999 FORMAT('ERROR 9999: The user-defined drag routine was invoked ', &
72              'but this',/'generic error message exits. Either choose a ',  &
73              'different drag law',/'or correct mfix/model/usr_drag.f')
74     
75     !- END REMOVE --------------------------------------------------------<<
76     
77           RETURN
78           END SUBROUTINE DRAG_USR
79