MFIX  2016-1
physprop_mod.f
Go to the documentation of this file.
1 !vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvC
2 ! C
3 ! Module: physprop C
4 ! Purpose: Common block containing physical property data C
5 ! C
6 ! Author: M. Syamlal Date: dd-mmm-yy C
7 ! Reviewer: Date: dd-mmm-yy C
8 ! C
9 !^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^C
10  MODULE physprop
11 
12 ! Modules
13 !---------------------------------------------------------------------//
14  Use param, only: dim_m, dim_n, dim_n_g, dim_n_s
15 !---------------------------------------------------------------------//
16 
17 
18 ! Number of solids phases
19  INTEGER :: mmax
20 
21 ! Real number of solids phases for GHD theory
22  INTEGER :: smax
23 
24 ! Particle diameters
25  DOUBLE PRECISION :: d_p0(dim_m)
26 
27 ! Constant or baseline solids phase densities.
28  DOUBLE PRECISION :: ro_s0(dim_m)
29 
30 ! Constant solids phase species mass fractions. These values delinate
31 ! the baseline/initial solids phase composition for ariable density
32  DOUBLE PRECISION :: x_s0(dim_m, dim_n_s)
33 
34 ! Density of solid species (constant)
35  DOUBLE PRECISION :: ro_xs0(dim_m, dim_n_s)
36 
37 ! The index of an inert solids phase species. This is needed for
38 ! calculating the variable solids phase density.
39  INTEGER :: inert_species(dim_m)
40 
41 ! Inert solids phase species mass fraction in dilute region. This is needed for
42 ! calculating the variable solids phase density.
43  DOUBLE PRECISION :: dil_inert_x_vsd(dim_m)
44 
45 ! Factor to define dilute region for special treatment of
46 ! the variable solids phase density.
47  DOUBLE PRECISION :: dil_factor_vsd
48 
49 ! Particle shape factor
50  DOUBLE PRECISION :: shape_factor(dim_m)
51 
52 ! Specified constant solids viscosity
53  DOUBLE PRECISION mu_s0(dim_m)
54 
55 ! Flag indicates whether the phase becomes close-packed at ep_star
56  LOGICAL :: close_packed (dim_m)
57 
58 ! Specified constant gas density
59  DOUBLE PRECISION ro_g0
60 
61 ! Specified constant gas viscosity
62  DOUBLE PRECISION mu_g0
63 
64 ! Virtual (added) mass coefficient Cv
65  DOUBLE PRECISION cv
66 
67 ! Gas viscosity
68  DOUBLE PRECISION, DIMENSION(:), ALLOCATABLE :: mu_g
69 
70 ! Average molecular weight of gas
71  DOUBLE PRECISION mw_avg
72 
73 ! Constant constant-pressure specific heat of gas
74  DOUBLE PRECISION c_pg0
75 
76 ! Reference temperature for enthalpy calculations (K)
77  DOUBLE PRECISION, PARAMETER :: t_ref = 298
78 
79 ! Constant pressure specific heat of gas
80  DOUBLE PRECISION, DIMENSION(:), ALLOCATABLE :: c_pg
81 
82 ! Constant constant-pressure specific heat of solids
83  DOUBLE PRECISION c_ps0(dim_m)
84 
85 ! Constant pressure specific heat of solids
86  DOUBLE PRECISION, DIMENSION(:, :), ALLOCATABLE :: c_ps
87 
88 ! Specified constant gas conductivity
89  DOUBLE PRECISION :: k_g0
90 
91 ! Conductivity of gas
92  DOUBLE PRECISION, DIMENSION(:), ALLOCATABLE :: k_g
93 
94 ! Specified constant solids conductivity
95  DOUBLE PRECISION k_s0(dim_m)
96 
97 ! Conductivity of solids
98  DOUBLE PRECISION, DIMENSION(:, :), ALLOCATABLE :: k_s
99 
100 ! Granular Temperature Conductivity (associated with temperature grad)
101  DOUBLE PRECISION, DIMENSION(:, :), ALLOCATABLE :: kth_s
102 
103 ! Granular Temperature Conductivity (associated with volume fraction grad)
104  DOUBLE PRECISION, DIMENSION(:, :), ALLOCATABLE :: kphi_s
105 
106 ! Specified constant gas diffusivity
107  DOUBLE PRECISION dif_g0
108 
109 ! Diffusivity of gas species N
110  DOUBLE PRECISION, DIMENSION(:, :), ALLOCATABLE :: dif_g
111 
112 ! Specified constant solids diffusivity
113  DOUBLE PRECISION dif_s0(dim_m)
114 
115 ! Diffusivity of solids species N
116  DOUBLE PRECISION, DIMENSION(:, :, :), ALLOCATABLE :: dif_s
117 
118 ! Total number of gas or solids species
119  INTEGER :: nmax(0:dim_m) ! Runtime (all phases)
120  INTEGER :: nmax_g ! Number of gas phase species
121  INTEGER :: nmax_s(dim_m) ! Number of solids phase species
122 
123 ! Molecular weight of gas species
124  DOUBLE PRECISION :: mw_g (dim_n_g)
125 
126 ! Molecular weight of solids species
127  DOUBLE PRECISION :: mw_s (dim_m, dim_n_s)
128 
129 ! Molecular weight of gas mixture
130  DOUBLE PRECISION, DIMENSION(:), ALLOCATABLE :: mw_mix_g
131 
132 ! Logical for reading thermochemical database.
133  LOGICAL :: database_read = .true.
134 
135 ! Polynomical coefficients for calculating specific heat.
136  DOUBLE PRECISION alow (7,0:dim_m, dim_n) ! Tlow --> Tcom
137  DOUBLE PRECISION ahigh(7,0:dim_m, dim_n) ! Tcom --> Thigh
138 
139 ! Range where the polynomials are valid.
140  DOUBLE PRECISION thigh(0:dim_m, dim_n) ! Upper bound
141  DOUBLE PRECISION tlow (0:dim_m, dim_n) ! Lower bound
142  DOUBLE PRECISION tcom (0:dim_m, dim_n) ! Switch from low to high
143 
144 ! Heat of formation at Tref divided by the gas constant.
145  DOUBLE PRECISION hfrefor(0:dim_m, dim_n)
146 
147 ! Reference values.
148  DOUBLE PRECISION icpor_l(0:dim_m, dim_n)
149  DOUBLE PRECISION icpor_h(0:dim_m, dim_n)
150 
151 CONTAINS
152 
153 !vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvC
154 ! C
155 ! Module name: CALC_MW (X_g, DIM, L, NMAX, MW_g) C
156 ! Purpose: Calculate average molecular weight of gas C
157 ! C
158 ! Author: M. Syamlal Date: 19-OCT-92 C
159 ! Reviewer: P. Nicoletti Date: 11-DEC-92 C
160 ! C
161 ! Revision Number: C
162 ! Purpose: C
163 ! Author: Date: dd-mmm-yy C
164 ! Reviewer: Date: dd-mmm-yy C
165 ! C
166 ! Literature/Document References: C
167 ! C
168 ! Variables referenced:None C
169 ! Variables modified:None C
170 ! C
171 ! Local variables: SUM, N C
172 ! C
173 !^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^C
174 !
175  DOUBLE PRECISION FUNCTION calc_mw (X_G, DIM, L, NMAX, MW_G)
176 !...Translated by Pacific-Sierra Research VAST-90 2.06G5 12:17:31 12/09/98
177 !...Switches: -xf
178 !-----------------------------------------------
179 ! M o d u l e s
180 !-----------------------------------------------
181  USE param
182  USE param1
183  USE toleranc
184  IMPLICIT NONE
185 !-----------------------------------------------
186 ! D u m m y A r g u m e n t s
187 !-----------------------------------------------
188 !
189 ! Mass fraction array's Ist dimension
190  INTEGER DIM
191 !
192 !
193 ! Max of X_g array 2nd index and MW_g array index
194  INTEGER NMAX
195 !
196 ! Mass fraction array
197 !
198  DOUBLE PRECISION X_g(dim, nmax)
199 !
200 ! Moleculare weight array
201 !
202  DOUBLE PRECISION MW_g(nmax)
203 !
204 ! Mass fraction array Ist index
205  INTEGER L
206 !
207 ! Local variable
208 !
209 ! local sum
210  DOUBLE PRECISION SUM
211 !
212 ! local index
213  INTEGER NN
214 !-----------------------------------------------
215 !
216  sum = zero
217  DO nn = 1, nmax
218  sum = sum + x_g(l,nn)/mw_g(nn)
219  END DO
220  calc_mw = one/max(sum,omw_max)
221 !
222  RETURN
223  END FUNCTION calc_mw
224 
225 !vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvC
226 ! C
227 ! FUNCTION: blend_function C
228 ! Purpose: To calculate blending function C
229 ! C
230 ! Author: S. Pannala Date: 28-FEB-06 C
231 ! Reviewer: Date: C
232 ! Modified: Date: 24-OCT-06 C
233 ! C
234 ! C
235 ! Literature/Document References: C
236 ! Variables referenced: C
237 ! Variables modified: C
238 ! C
239 ! Local variables: C
240 ! C
241 !^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^C
242 
243  DOUBLE PRECISION FUNCTION blend_function(IJK)
245 !-----------------------------------------------
246 ! Modules
247 !-----------------------------------------------
248  USE compar
249  USE constant
250  USE fldvar
251  USE fun_avg
252  USE functions
253  USE geometry
254  USE indices
255  USE param
256  USE param1
257  USE run
258  USE toleranc
259  USE visc_s
260  IMPLICIT NONE
261 !-----------------------------------------------
262 ! Dummy arguments
263 !-----------------------------------------------
264 ! IJK index
265  INTEGER, INTENT(IN) :: IJK
266 !-----------------------------------------------
267 ! Local variables
268 !-----------------------------------------------
269 ! Logical to see whether this is the first entry to this routine
270  LOGICAL,SAVE:: FIRST_PASS = .true.
271 ! Blend Factor
272  Double Precision:: blend, blend_right
273 ! Scale Factor
274  Double Precision, Save:: scale
275 ! Midpoint
276  Double Precision, Save:: ep_mid_point
277 !-----------------------------------------------
278 
279 ! Tan hyperbolic blending of stresses
280  IF(tanh_blend) THEN
281  IF(ep_g(ijk) .LT. ep_g_blend_end(ijk).AND. ep_g(ijk) .GT. ep_g_blend_start(ijk)) THEN
282  ep_mid_point = (ep_g_blend_end(ijk)+ep_g_blend_start(ijk))/2.0d0
283  blend = tanh(2.0d0*pi*(ep_g(ijk)-ep_mid_point)/ &
284  (ep_g_blend_end(ijk)-ep_g_blend_start(ijk)))
285  blend = (blend+1.0d0)/2.0d0
286  ELSEIF(ep_g(ijk) .GE. ep_g_blend_end(ijk)) THEN
287  blend = 1.0d0
288  ELSEIF(ep_g(ijk) .LE. ep_g_blend_start(ijk)) THEN
289  blend = 0.0d0
290  ENDIF
291 
292 ! Truncated and Scaled Sigmoidal blending of stresses
293  ELSEIF(sigm_blend) THEN
294  IF(first_pass) THEN
295  blend_right = 1.0d0/(1+0.01d0**((ep_g_blend_end(ijk)-ep_star_array(ijk))&
296  /(ep_g_blend_end(ijk)-ep_g_blend_start(ijk))))
297  blend_right = (blend_right+1.0d0)/2.0d0
298  scale = 1.0d0/blend_right
299  write(*,*) 'Blending value at end and scaling factor', blend_right, scale
300  first_pass = .false.
301  ENDIF
302  IF(ep_g(ijk) .LT. ep_g_blend_end(ijk)) THEN
303  blend = scale/(1+0.01d0**((ep_g(ijk)-ep_star_array(ijk))&
304  /(ep_g_blend_end(ijk)-ep_g_blend_start(ijk))))
305  ELSEIF(ep_g(ijk) .GE. ep_g_blend_end(ijk)) THEN
306  blend = 1.0d0
307  ENDIF
308 
309  ENDIF
310 
311  blend_function = blend
312 
313  RETURN
314  END FUNCTION blend_function
315 
316  END MODULE physprop
double precision cv
Definition: physprop_mod.f:65
integer, parameter dim_n_g
Definition: param_mod.f:69
double precision, dimension(dim_m) c_ps0
Definition: physprop_mod.f:83
double precision, dimension(:,:), allocatable c_ps
Definition: physprop_mod.f:86
double precision, dimension(dim_m) shape_factor
Definition: physprop_mod.f:50
double precision, dimension(dim_m) d_p0
Definition: physprop_mod.f:25
double precision, dimension(:), allocatable ep_g
Definition: fldvar_mod.f:15
double precision, dimension(0:dim_m, dim_n) icpor_l
Definition: physprop_mod.f:148
double precision, dimension(:,:), allocatable dif_g
Definition: physprop_mod.f:110
double precision function blend_function(IJK)
Definition: physprop_mod.f:244
double precision, dimension(0:dim_m, dim_n) thigh
Definition: physprop_mod.f:140
integer, parameter dim_n
Definition: param_mod.f:73
double precision c_pg0
Definition: physprop_mod.f:74
double precision, parameter one
Definition: param1_mod.f:29
double precision, dimension(:,:), allocatable kphi_s
Definition: physprop_mod.f:104
logical sigm_blend
Definition: run_mod.f:163
double precision, dimension(dim_m) dif_s0
Definition: physprop_mod.f:113
double precision, parameter omw_max
Definition: toleranc_mod.f:37
double precision, dimension(0:dim_m, dim_n) tcom
Definition: physprop_mod.f:142
double precision mu_g0
Definition: physprop_mod.f:62
integer, parameter dim_m
Definition: param_mod.f:67
double precision, dimension(dim_m, dim_n_s) x_s0
Definition: physprop_mod.f:32
double precision, dimension(dim_m, dim_n_s) ro_xs0
Definition: physprop_mod.f:35
double precision function calc_mw(X_G, DIM, L, NMAX, MW_G)
Definition: physprop_mod.f:176
logical, dimension(dim_m) close_packed
Definition: physprop_mod.f:56
double precision, dimension(:,:), allocatable kth_s
Definition: physprop_mod.f:101
double precision, dimension(dim_n_g) mw_g
Definition: physprop_mod.f:124
double precision, dimension(0:dim_m, dim_n) hfrefor
Definition: physprop_mod.f:145
double precision, dimension(:), allocatable ep_star_array
Definition: visc_s_mod.f:54
double precision, dimension(7, 0:dim_m, dim_n) alow
Definition: physprop_mod.f:136
double precision, dimension(:), allocatable ep_g_blend_end
Definition: visc_s_mod.f:60
integer mmax
Definition: physprop_mod.f:19
double precision ro_g0
Definition: physprop_mod.f:59
integer, dimension(dim_m) inert_species
Definition: physprop_mod.f:39
double precision, dimension(dim_m) k_s0
Definition: physprop_mod.f:95
double precision, dimension(dim_m) dil_inert_x_vsd
Definition: physprop_mod.f:43
double precision, dimension(:), allocatable ep_g_blend_start
Definition: visc_s_mod.f:57
double precision, dimension(:,:,:), allocatable dif_s
Definition: physprop_mod.f:116
Definition: run_mod.f:13
double precision k_g0
Definition: physprop_mod.f:89
Definition: param_mod.f:2
logical database_read
Definition: physprop_mod.f:133
integer nmax_g
Definition: physprop_mod.f:120
double precision, dimension(:), allocatable mw_mix_g
Definition: physprop_mod.f:130
integer, dimension(0:dim_m) nmax
Definition: physprop_mod.f:119
double precision, dimension(7, 0:dim_m, dim_n) ahigh
Definition: physprop_mod.f:137
double precision, dimension(:), allocatable mu_g
Definition: physprop_mod.f:68
double precision mw_avg
Definition: physprop_mod.f:71
double precision, dimension(dim_m, dim_n_s) mw_s
Definition: physprop_mod.f:127
integer, parameter dim_n_s
Definition: param_mod.f:71
double precision, dimension(:), allocatable k_g
Definition: physprop_mod.f:92
integer smax
Definition: physprop_mod.f:22
logical tanh_blend
Definition: run_mod.f:162
double precision, dimension(dim_m) ro_s0
Definition: physprop_mod.f:28
double precision, dimension(dim_m) mu_s0
Definition: physprop_mod.f:53
double precision, parameter pi
Definition: constant_mod.f:158
double precision, parameter t_ref
Definition: physprop_mod.f:77
double precision dif_g0
Definition: physprop_mod.f:107
double precision, dimension(0:dim_m, dim_n) tlow
Definition: physprop_mod.f:141
integer, dimension(dim_m) nmax_s
Definition: physprop_mod.f:121
double precision, dimension(:,:), allocatable k_s
Definition: physprop_mod.f:98
double precision, dimension(0:dim_m, dim_n) icpor_h
Definition: physprop_mod.f:149
double precision, parameter zero
Definition: param1_mod.f:27
double precision, dimension(:), allocatable c_pg
Definition: physprop_mod.f:80
double precision dil_factor_vsd
Definition: physprop_mod.f:47