File: N:\mfix\model\check_data\check_solids_phases.f

1     !vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv!
2     !  SUBROUTINE: CHECK_SOLIDS_PHASES                                     !
3     !                                                                      !
4     !  Purpose: Driver routine for calls to solids phase checks.           !
5     !                                                                      !
6     !  Author: J.Musser                                   Date: 16-Jan-14  !
7     !                                                                      !
8     !^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^!
9           SUBROUTINE CHECK_SOLIDS_PHASES
10     
11     
12     ! Global Variables:
13     !---------------------------------------------------------------------//
14     ! Runtime flag specifying TFM solids
15           use run, only: TFM_SOLIDS
16     ! Runtime flag specifying DEM solids
17           use run, only: DEM_SOLIDS
18     ! Runtime flag specifying MPPIC solids
19           use run, only: PIC_SOLIDS
20     
21     ! Global Module procedures:
22     !---------------------------------------------------------------------//
23           use error_manager
24     
25           implicit none
26     
27     ! Local Variables:
28     !---------------------------------------------------------------------//
29     
30     !......................................................................!
31     
32     ! Initialize the error manager.
33           CALL INIT_ERR_MSG("CHECK_SOLIDS_PHASES")
34     
35     ! Impose the various model limitations.
36           CALL CHECK_SOLIDS_MODEL_LIMITATIONS
37     
38     ! Checks common to all solids models.
39           CALL CHECK_SOLIDS_COMMON_ALL
40     
41     ! Checks common to discrete solids phases (DEM, MPPIC).
42           IF(DEM_SOLIDS .OR. PIC_SOLIDS) &
43              CALL CHECK_SOLIDS_COMMON_DISCRETE
44     
45     ! Checks specific to the particular solids phase.
46           IF(TFM_SOLIDS) CALL CHECK_SOLIDS_CONTINUUM
47           IF(DEM_SOLIDS) CALL CHECK_SOLIDS_DEM
48           IF(PIC_SOLIDS) CALL CHECK_SOLIDS_MPPIC
49     
50           CALL FINL_ERR_MSG
51     
52           RETURN
53     
54           END SUBROUTINE CHECK_SOLIDS_PHASES
55     
56     
57     !vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv!
58     !  SUBROUTINE: CHECK_SOLIDS_MODEL_LIMITATIONS                          !
59     !                                                                      !
60     !  Purpose: Impose the limitations of the various solids models. These !
61     !  checks should be 'high level' in that they only ensure that models  !
62     !  are only used with phases that support them.                        !
63     !                                                                      !
64     !  Author: J.Musser                                   Date: 28-Feb-14  !
65     !                                                                      !
66     !^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^!
67           SUBROUTINE CHECK_SOLIDS_MODEL_LIMITATIONS
68     
69     ! Global Variables:
70     !---------------------------------------------------------------------//
71     ! Runtime Flag: TFM solids present.
72           use run, only: TFM_SOLIDS
73     ! Runtime Flag: DEM solids present.
74           use run, only: DEM_SOLIDS
75     ! Runtime Flag: PIC solids present.
76           use run, only: PIC_SOLIDS
77     ! Runtime Flag: Invoke a cohesion model for DES simulation.
78           use discretelement, only: USE_COHESION
79     ! Runtime Flag: Sovle energy equations
80           use run, only: ENERGY_EQ
81     ! Runtime Flag: Sovle species equations
82           use run, only: SPECIES_EQ
83     
84     ! Number of solid phases specified by the user/TFM model.
85           use physprop, only: SMAX
86     ! Number of discrete solids.
87           use discretelement, only: DES_MMAX
88     
89     ! Global Module procedures:
90     !---------------------------------------------------------------------//
91           use error_manager
92     
93           implicit none
94     
95     
96     ! Local Variables:
97     !---------------------------------------------------------------------//
98     ! Total number of solids phases.
99           INTEGER :: MMAX_TOT
100     
101     
102     !......................................................................!
103     
104     
105     ! Initialize the error manager.
106           CALL INIT_ERR_MSG("CHECK_SOLIDS_MODEL_LIMITATIONS")
107     
108     
109     ! Set up the total number of solids.
110           MMAX_TOT = SMAX + DES_MMAX
111     
112     
113     ! The cohesion model is only implemented for DEM simulations
114           IF(USE_COHESION) THEN
115              IF(TFM_SOLIDS .OR. PIC_SOLIDS) THEN
116                 WRITE(ERR_MSG, 2000)
117                 CALL FLUSH_ERR_MSG(ABORT=.TRUE.)
118              ENDIF
119     
120      2000 FORMAT('Error 2000: The solids cohesion model is only available',&
121              ' for DEM',/' solids. Please correct the mfix.dat file.')
122           ENDIF
123     
124     ! Place holder
125           IF(ENERGY_EQ .AND. (TFM_SOLIDS .OR. PIC_SOLIDS)) THEN
126     !         WRITE(ERR_MSG, 2002)
127     !         CALL FLUSH_ERR_MSG(ABORT=.TRUE.)
128     
129      2002 FORMAT('Error 2002: The solids-solids conduction model is only', &
130              ' available',/' for DEM only. Please correct the mfix.dat',   &
131              ' file.')
132           ENDIF
133     
134     
135     ! This is only implemented for pure TFM or pure DEM simulations.
136           IF(any(SPECIES_EQ(1:MMAX_TOT))) THEN
137              IF(TFM_SOLIDS .AND. DEM_SOLIDS) THEN
138                 WRITE(ERR_MSG, 5000)
139                 CALL FLUSH_ERR_MSG(ABORT=.FALSE.)
140              ENDIF
141     
142      5000 FORMAT('Error 5000: Species equations are not available with',   &
143              ' the hybrid',/'solids model. Please correct the mfix.dat',   &
144              ' file.')
145           ENDIF
146     
147     
148           CALL FINL_ERR_MSG
149     
150           RETURN
151           END SUBROUTINE CHECK_SOLIDS_MODEL_LIMITATIONS
152