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

1     !vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv!
2     !                                                                      !
3     !  Subroutine: CHECK_IC_DEM                                            !
4     !  Author:   R.Garg                                   Date: 11-Mar-14  !
5     !                                                                      !
6     !  Purpose: check the initial conditions input section for DEM model   !
7     !     - calculate the number of particles needed to initalize the      !
8     !        DEM model                                                     !
9     !                                                                      !
10     !^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^!
11           SUBROUTINE CHECK_IC_DEM
12     
13     
14     ! Runtime Flag: Generate initial particle configuation.
15           USE discretelement, only : gener_part_config
16     ! Simulation dimension (2D/3D)
17           USE discretelement, only: DIMN
18     ! Number of DEM solids phases.
19           USE discretelement, only: DES_MMAX
20     ! DEM solid phase diameters and densities.
21           USE discretelement, only: DES_D_p0, DES_RO_s
22     
23           USE discretelement, only: DES_CONTINUUM_HYBRID
24     
25           USE param1, only: UNDEFINED, UNDEFINED_I, ZERO, ONE
26     ! direction wise spans of the domain and grid spacing in each direction
27           Use geometry, only: xlength, ylength, zlength, dx, dy, dz
28     ! Use the error manager for posting error messages.
29     !---------------------------------------------------------------------//
30           use error_manager
31     
32           use toleranc
33     
34           implicit none
35     
36     ! Initialize the error manager.
37           CALL INIT_ERR_MSG("CHECK_IC_DEM")
38     
39     ! Determine the domain volume which is used to calculate the total
40     ! number of particles and the number of particles in each phase.
41     ! Values of DZ(1) or zlength are guaranteed at this point due to
42     ! check_data_03. If the user left both undefined and NO_K = .T., then
43     ! they are set to ONE. If dz(1) is undefined but zlength is defined,
44     ! then dz(1) is set to zlength (and vice versa).  If both are defined
45     ! they must be equal.
46           IF(DIMN.EQ.2) THEN
47              IF (DES_MMAX.EQ.1) THEN
48     ! Warn the user if the domain depth is not equal to the particle
49     ! diameter as it may cause problems for coupled simulations.
50     ! The user should also be aware of this when interpreting
51     ! volume/void fraction calculations (including bulk density).
52                 IF(.NOT.COMPARE(ZLENGTH,DES_D_P0(1))) THEN
53                    WRITE(ERR_MSG, 1000)
54                    CALL FLUSH_ERR_MSG
55                 ENDIF
56              ELSE
57     ! Let the user know basis of depth dimension for calculating number of
58     ! particles. this will also be important when considering volume/void
59     ! fraction calculations.
60                 WRITE(ERR_MSG, 1001)
61                 CALL FLUSH_ERR_MSG
62              ENDIF
63           ENDIF
64     
65     
66      1000 FORMAT(' Message: ',&
67           'WARNING: zlength or dz(1) is used to calculate the ',&
68           'number of particles in the 2D simulation when ',&
69           'GENER_PART_CONFIG is T and DIMN = 2.',/10X,'This depth ',&
70           'does not equal D_P0(1).')
71     
72      1001 FORMAT(' Message: ',&
73           'WARNING: zlength or dz(1) is used to calculate the ',&
74           'number of particles in the 2D simulation when ',&
75           'GENER_PART_CONFIG is T and DIMN = 2.')
76     
77     
78           IF (Gener_part_config.and.DES_CONTINUUM_HYBRID) THEN
79              WRITE(ERR_MSG, 999)
80              CALL FLUSH_ERR_MSG(ABORT=.TRUE.)
81           ENDIF
82     
83      999  format('Error # 999: Gener_part_config set to', &
84           ' true for DES_continuum hybrid', /, &
85           ' This is not allowed, specify the initial particle', &
86           ' configuration explicitly', /, &
87           ' See MFIX readme', /,  &
88           ' Please correct the data file.')
89     
90     
91     
92     
93     
94      2018 FORMAT( 'End of Message' )
95     
96     
97           CALL FINL_ERR_MSG
98     
99           END SUBROUTINE CHECK_IC_DEM
100     
101