File: RELATIVE:/../../../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 initialize the      !
8     !        DEM model                                                     !
9     !                                                                      !
10     !^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^!
11           SUBROUTINE CHECK_IC_DEM
12     
13     
14     ! Runtime Flag: Generate initial particle configuration.
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
22     
23           USE discretelement, only: DES_CONTINUUM_HYBRID
24     
25     ! direction wise spans of the domain and grid spacing in each direction
26           Use geometry, only: zlength
27     ! Use the error manager for posting error messages.
28     !---------------------------------------------------------------------//
29           use error_manager
30     
31           use toleranc
32     
33           implicit none
34     
35     ! Initialize the error manager.
36           CALL INIT_ERR_MSG("CHECK_IC_DEM")
37     
38     ! Determine the domain volume which is used to calculate the total
39     ! number of particles and the number of particles in each phase.
40     ! Values of DZ(1) or zlength are guaranteed at this point due to
41     ! check_data_03. If the user left both undefined and NO_K = .T., then
42     ! they are set to ONE. If dz(1) is undefined but zlength is defined,
43     ! then dz(1) is set to zlength (and vice versa).  If both are defined
44     ! they must be equal.
45           IF(DIMN.EQ.2) THEN
46              IF (DES_MMAX.EQ.1) THEN
47     ! Warn the user if the domain depth is not equal to the particle
48     ! diameter as it may cause problems for coupled simulations.
49     ! The user should also be aware of this when interpreting
50     ! volume/void fraction calculations (including bulk density).
51                 IF(.NOT.COMPARE(ZLENGTH,DES_D_P0(1))) THEN
52                    WRITE(ERR_MSG, 1000)
53                    CALL FLUSH_ERR_MSG
54                 ENDIF
55              ELSE
56     ! Let the user know basis of depth dimension for calculating number of
57     ! particles. this will also be important when considering volume/void
58     ! fraction calculations.
59                 WRITE(ERR_MSG, 1001)
60                 CALL FLUSH_ERR_MSG
61              ENDIF
62           ENDIF
63     
64     
65      1000 FORMAT(' Message: ',&
66           'WARNING: zlength or dz(1) is used to calculate the ',&
67           'number of particles in the 2D simulation when ',&
68           'GENER_PART_CONFIG is T and DIMN = 2.',/10X,'This depth ',&
69           'does not equal D_P0(1).')
70     
71      1001 FORMAT(' Message: ',&
72           'WARNING: zlength or dz(1) is used to calculate the ',&
73           'number of particles in the 2D simulation when ',&
74           'GENER_PART_CONFIG is T and DIMN = 2.')
75     
76     
77           IF (Gener_part_config.and.DES_CONTINUUM_HYBRID) THEN
78              WRITE(ERR_MSG, 999)
79              CALL FLUSH_ERR_MSG(ABORT=.TRUE.)
80           ENDIF
81     
82      999  format('Error # 999: Gener_part_config set to', &
83           ' true for DES_continuum hybrid', /, &
84           ' This is not allowed, specify the initial particle', &
85           ' configuration explicitly', /, &
86           ' See MFIX readme', /,  &
87           ' Please correct the data file.')
88     
89           CALL FINL_ERR_MSG
90     
91           END SUBROUTINE CHECK_IC_DEM
92