1 !vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv! 2 ! Module name: MAKE_ARRAYS_DES ! 3 ! Author: Jay Boyalakuntla Date: 12-Jun-04 ! 4 ! ! 5 ! Purpose: DES - allocating DES arrays 6 ! ! 7 !^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^! 8 SUBROUTINE INIT_SETTLING_DEM 9 10 ! USE param1 11 ! USE funits 12 USE run 13 ! USE compar 14 USE discretelement 15 ! USE cutcell 16 ! use desmpi 17 ! use mpi_utility 18 ! USE geometry 19 ! USE des_rxns 20 ! USE des_thermo 21 ! USE des_stl_functions 22 23 use mpi_funs_des, only: DES_PAR_EXCHANGE 24 use error_manager 25 26 IMPLICIT NONE 27 !----------------------------------------------- 28 ! Local variables 29 !----------------------------------------------- 30 INTEGER :: FACTOR 31 32 !----------------------------------------------- 33 ! Include statement functions 34 !----------------------------------------------- 35 36 37 ! Skip this routine if there are no particles. 38 IF(PARTICLES == 0) RETURN 39 ! Skip this routine if not a new run. 40 IF(RUN_TYPE /= 'NEW') RETURN 41 ! Skip if not coupled. 42 IF(.NOT.DES_CONTINUUM_COUPLED) RETURN 43 ! Skip if using cohesion. (Why?) 44 IF(USE_COHESION) RETURN 45 46 WRITE(ERR_MSG, 1100) trim(iVal(NFACTOR)) 47 CALL FLUSH_ERR_MSG(HEADER=.FALSE., FOOTER=.FALSE.) 48 1100 FORMAT('Beginning DEM settling period: ',A,' steps.') 49 50 51 ! Disable the coupling flag. 52 DES_CONTINUUM_COUPLED = .FALSE. 53 54 55 DO FACTOR = 1, NFACTOR 56 ! calculate forces 57 CALL CALC_FORCE_DEM 58 ! update particle position/velocity 59 CALL CFNEWVALUES 60 ! set the flag do_nsearch before calling particle in cell (for mpi) 61 DO_NSEARCH = (MOD(FACTOR,NEIGHBOR_SEARCH_N)==0) 62 ! exchange particle crossing boundaries and updates ghost particles 63 CALL DES_PAR_EXCHANGE 64 ! find particles on grid 65 CALL PARTICLES_IN_CELL 66 ! perform neighbor search 67 IF(DO_NSEARCH) CALL NEIGHBOUR 68 ENDDO 69 70 ! Reset the comoupling flag. 71 DES_CONTINUUM_COUPLED = .TRUE. 72 73 WRITE(ERR_MSG, 1200) 74 CALL FLUSH_ERR_MSG(HEADER=.FALSE., FOOTER=.FALSE.) 75 1200 FORMAT('DEM settling period complete.') 76 77 ! this write_des_data is needed to properly show the initial state of 78 ! the simulation (granular or coupled). In the coupled case, the 79 ! particles may have 'settled' according to above. In the granular 80 ! case, the initial state won't be written until after the particles 81 ! have moved without this call. 82 IF(PRINT_DES_DATA) CALL WRITE_DES_DATA 83 84 RETURN 85 END SUBROUTINE INIT_SETTLING_DEM 86 87