MFIX  2016-1
get_data.f
Go to the documentation of this file.
1 !vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvC
2 ! C
3 ! MODULE: GET_DATA C
4 ! Purpose: read and verify input data, open files C
5 ! C
6 ! Author: P. Nicoletti Date: 04-DEC-91 C
7 ! Reviewer: M.SYAMLAL, W.ROGERS, P.NICOLETTI Date: 24-JAN-92 C
8 ! C
9 !^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^C
10 MODULE read_input
11 
12  CONTAINS
13 
14  SUBROUTINE get_data
15 
16 !-----------------------------------------------
17 ! Modules
18 !-----------------------------------------------
21  USE compar
22  USE constant, only: l_scale0
23  USE cutcell
24  USE dashboard
25  USE des_allocate
26  USE des_rxns
27  USE des_thermo
28  USE desgrid, only: desgrid_init
29  USE discretelement
30  USE error_manager
31  USE funits
32  USE gridmap
33  USE iterate, only: max_nit
34  USE leqsol
35  USE mfix_pic
36  USE mpi_init_des, only: desmpi_init
37  USE parallel
38  USE param
39  USE param1
41  USE run
43  USE visc_g, only: l_scale
44 
45  IMPLICIT NONE
46 !-----------------------------------------------
47 ! Local variables
48 !-----------------------------------------------
49 ! shift DX, DY and DZ values
50  LOGICAL, PARAMETER :: SHIFT = .true.
51 
52 ! This module call routines to initialize the namelist variables.
53  CALL init_namelist
54 ! Read in the namelist variables from the ascii input file.
55  CALL read_namelist(0,"mfix.dat")
56 
57 ! Initialize the error manager. This call occurs after the mfix.dat
58 ! is read so that message verbosity can be set and the .LOG file
59 ! can be opened.
61 
62 ! Write header in the .LOG file and to screen.
63 ! Not sure if the values are correct or useful
64  CALL write_header
65 
66 ! Open files
68 
69 ! These checks verify that sufficient information was provided
70 ! to setup the domain indices and DMP gridmap.
73 
74 ! Set up the physical domain indicies (cell index max/min values).
75  CALL set_max2
76 
77 ! Set constants
78  CALL set_constants
79 
80 ! Adjust partition for better load balance (done when RE_INDEXING is .TRUE.)
81  CALL adjust_ijk_size
82 
83 ! Partition the domain and set indices
84  CALL gridmap_init
85 
86 ! Check the minimum solids phase requirements.
88 
90  CALL check_numerics
92 
93  CALL check_gas_phase
95  CALL set_parameters
96 
97 ! Basic geometry checks.
98  CALL check_geometry(shift)
99  IF(discrete_element) CALL check_geometry_des
100 
101 ! Set grid spacing variables.
102  CALL set_geometry
103  IF(discrete_element) CALL set_geometry_des
104 
109 
112 
113 
114 
115 !---------------------- DOMAIN SPECIFIC CHECKS --------------------!
116 
117 
118 ! This call needs to occur before any of the IC/BC checks.
119  CALL set_icbc_flag
120 
121 ! Compute area of boundary surfaces.
122  CALL get_bc_area
123 
124 ! Convert (mass, volume) flows to velocities.
125  CALL set_bc_flow
126 
127 ! Set the flags for identifying computational cells
128  CALL set_flags
129 ! Set arrays for computing indices
130  CALL set_increments
131  CALL set_increments3
132 
133 ! Cartesian grid implementation
135  IF(cartesian_grid) THEN
137  ELSE
139  ENDIF
140 
141  IF(discrete_element) THEN
142  CALL desgrid_init
143  CALL desmpi_init
145  ENDIF
146 
147 !-------------------------- ARRAY ALLOCATION -----------------------!
148 
149 ! Allocate array storage.
150  CALL allocate_arrays
151  IF(discrete_element) CALL des_allocate_arrays
153 
154 ! Initialize arrays.
155  CALL init_fvars
156  IF(discrete_element) CALL des_init_arrays
157 
158 ! This is all that happens in SET_L_SCALE so it needs moved, maybe
159 ! this should go in int_fluid_var.?
160 ! CALL SET_L_SCALE
161  l_scale(:) = l_scale0
162 
163 !======================================================================
164 ! Data initialization for Dashboard
165 !======================================================================
166  init_time = time
169 
172 
173  nit_min = max_nit
174  nit_max = 0
175 
176  n_dashboard = 0
177 
178 
179  RETURN
180 
181  END SUBROUTINE get_data
182 
183 !vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvC
184 ! C
185 ! Subroutine: SET_CONSTANTS C
186 ! Purpose: Set various constants C
187 ! C
188 ! Author: M. Syamlal Date: 30-JAN-92 C
189 ! C
190 !^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^C
191  SUBROUTINE set_constants
193 ! Modules
194 !---------------------------------------------------------------------//
195  USE param1, only: zero, one, undefined
196  USE constant, only: gas_const
198  USE constant, only: to_si
199  USE constant, only: k_scale
200  USE run, only: lam_hys, units
202  USE error_manager, only: flush_err_msg
203 
204  IMPLICIT NONE
205 !---------------------------------------------------------------------//
206 
207 ! Note that the cell flags are not set when this routine is called.
208 
209 ! Dimensionless constants
210  k_scale = .08d0 ! this actually isn't used anywhere...
211 
212 ! Enter the value of all constants in various units (CGS or SI)
213  IF (units == 'SI') THEN
214  IF (gravity == undefined) gravity = 9.80665d0 ! m/s2
215  gas_const = 8314.56d0 !Pa.m3/kmol.K, or kg m2/s2 kmol K (Perry and Green, 1984)
216  to_si = 0.1d0 !to convert dyne/cm2 to Pa. e.g. calc_mu_g.f
217  IF (lam_hys == undefined) lam_hys = 0.000001d0 ! m
218  ELSEIF (units == 'CGS') THEN
219  IF (gravity == undefined) gravity = 980.665d0 !cm/s2
220  gas_const = 8314.56d4 !g.cm2/s2.mol.K
221  to_si = one !does not do anything in CGS. e.g.: calc_mu_g.f
222  IF (lam_hys == undefined) lam_hys = 0.0001d0 ! cm
223  ELSE
224 ! Initialize the error manager.
225  CALL init_err_msg("SET_CONSTANTS")
226  WRITE(err_msg,1005) units
227  CALL flush_err_msg(abort=.true.)
228  CALL finl_err_msg
229  1005 FORMAT('Error 1005: Unknown UNITS = ',a,/ &
230  'Please correct the mfix.dat file.')
231  ENDIF
232 
233 ! If all components of the gravitational acceleration vector are
234 ! undefined (zero), then use the default value for the negative
235 ! y-direction. This ensures backward compatibility with the old
236 ! (legacy) GRAVITY keyword. At this point GRAVITY is defined,
237 ! either from mfix.dat or by default above
238  IF(gravity_x==zero.AND.gravity_y==zero.AND.gravity_z==zero) THEN
239  gravity_x = zero
240  gravity_y = - gravity
241  gravity_z = zero
242  ENDIF
243 
244  RETURN
245  END SUBROUTINE set_constants
246  END MODULE read_input
double precision l_scale0
Definition: constant_mod.f:177
subroutine init_error_manager
double precision dtmin
Definition: dashboard_mod.f:6
subroutine set_constants
Definition: get_data.f:192
double precision to_si
Definition: constant_mod.f:146
subroutine set_bc_flow
Definition: set_bc_flow.f:16
integer n_dashboard
Definition: dashboard_mod.f:4
subroutine des_init_arrays
subroutine check_chemical_rxns
subroutine check_run_control
subroutine finl_err_msg
subroutine write_header
Definition: write_header.f:11
subroutine check_solids_phases
subroutine, public des_allocate_arrays
double precision, parameter one
Definition: param1_mod.f:29
subroutine set_increments3
double precision gravity_z
Definition: constant_mod.f:149
subroutine get_bc_area
Definition: get_bc_area.f:24
subroutine open_files(RUN_NAME, RUN_TYPE, N_SPX)
Definition: open_files.f:10
double precision lam_hys
Definition: run_mod.f:140
subroutine check_dmp_prereqs
character(len=60) run_name
Definition: run_mod.f:24
subroutine set_geometry
Definition: set_geometry.f:10
double precision gravity_y
Definition: constant_mod.f:149
double precision gas_const
Definition: constant_mod.f:152
subroutine check_data_cartesian
subroutine check_geometry_prereqs
subroutine set_increments
subroutine allocate_arrays
integer, parameter n_spx
Definition: param1_mod.f:5
subroutine init_namelist
Definition: init_namelist.f:23
integer nit_max
Definition: dashboard_mod.f:5
double precision, parameter undefined
Definition: param1_mod.f:18
subroutine check_output_control
double precision, dimension(:), allocatable l_scale
Definition: visc_g_mod.f:24
subroutine check_numerics
double precision smmax
Definition: dashboard_mod.f:7
subroutine check_boundary_conditions
subroutine init_err_msg(CALLER)
double precision smmin
Definition: dashboard_mod.f:7
double precision init_time
Definition: dashboard_mod.f:7
double precision dtmax
Definition: dashboard_mod.f:6
subroutine set_geometry_des
subroutine des_stl_preprocessing
subroutine check_internal_surfaces
subroutine set_icbc_flag
character(len=16) run_type
Definition: run_mod.f:33
subroutine adjust_ijk_size
subroutine gridmap_init
Definition: gridmap_mod.f:170
subroutine set_parameters
Definition: set_param.f:10
subroutine get_data
Definition: get_data.f:15
double precision k_scale
Definition: constant_mod.f:174
Definition: run_mod.f:13
subroutine cut_cell_preprocessing
double precision, parameter large_number
Definition: param1_mod.f:23
Definition: param_mod.f:2
subroutine desmpi_init
logical cartesian_grid
Definition: cutcell_mod.f:13
character(len=16) units
Definition: run_mod.f:30
subroutine allocate_dummy_cut_cell_arrays
subroutine check_initial_conditions
double precision gravity
Definition: constant_mod.f:149
subroutine desgrid_init()
Definition: desgrid_mod.f:424
subroutine check_odepack_stiff_chem
subroutine init_fvars
Definition: init_fvars.f:13
character(len=line_length), dimension(line_count) err_msg
Definition: iterate.f:2
subroutine set_max2
Definition: set_max2.f:20
subroutine set_flags
Definition: set_flags.f:36
integer max_nit
Definition: iterate.f:15
subroutine check_solids_model_prereqs
subroutine check_point_sources
subroutine read_namelist(READ_ACTION, FILENAME)
Definition: read_namelist.f:10
subroutine check_geometry(SHIFT)
subroutine qmomk_allocate_arrays
subroutine check_geometry_des
double precision gravity_x
Definition: constant_mod.f:149
double precision time
Definition: run_mod.f:45
subroutine check_gas_phase
integer nit_min
Definition: dashboard_mod.f:5
double precision, parameter zero
Definition: param1_mod.f:27
subroutine flush_err_msg(DEBUG, HEADER, FOOTER, ABORT, LOG, CALL_TREE)