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 solids phase densities. 28 DOUBLE PRECISION :: RO_s0(DIM_M) 29 30 ! Baseline/Unreacted solids phase phase density. This value is only used 31 ! for variable solids density simulations in EOSS. 32 DOUBLE PRECISION :: BASE_ROs(DIM_M) 33 34 ! Constant solids phase species mass fractions. These values delinate 35 ! the baseline/initial solids phase composition for ariable density 36 DOUBLE PRECISION :: X_S0(DIM_M, DIM_N_s) 37 38 ! Density of solid species (constant) 39 DOUBLE PRECISION :: RO_Xs0(DIM_M, DIM_N_s) 40 41 ! The index of an inert solids phase species. This is needed for 42 ! calculating the variable solids phase density. 43 INTEGER :: INERT_SPECIES(DIM_M) 44 45 ! Inert solids phase species mass fraction in dilute region. This is needed for 46 ! calculating the variable solids phase density. 47 DOUBLE PRECISION :: DIL_INERT_X_VSD(DIM_M) 48 49 ! Factor to define dilute region for special treatment of 50 ! the variable solids phase density. 51 DOUBLE PRECISION :: DIL_FACTOR_VSD 52 53 ! Particle shape factor 54 DOUBLE PRECISION :: SHAPE_FACTOR(DIM_M) 55 56 ! Specified constant solids viscosity 57 DOUBLE PRECISION MU_s0(DIM_M) 58 59 ! Flag indicates whether the phase becomes close-packed at ep_star 60 LOGICAL :: CLOSE_PACKED (DIM_M) 61 62 ! Specified constant gas density 63 DOUBLE PRECISION RO_g0 64 65 ! Specified constant gas viscosity 66 DOUBLE PRECISION MU_g0 67 68 ! Virtual (added) mass coefficient Cv 69 DOUBLE PRECISION Cv 70 71 ! Gas viscosity 72 DOUBLE PRECISION, DIMENSION(:), ALLOCATABLE :: MU_g 73 74 ! Average molecular weight of gas 75 DOUBLE PRECISION MW_AVG 76 77 ! Constant constant-pressure specific heat of gas 78 DOUBLE PRECISION C_pg0 79 80 ! Reference temperature for enthalpy calculations (K) 81 DOUBLE PRECISION, PARAMETER :: T_ref = 298 82 83 ! Constant pressure specific heat of gas 84 DOUBLE PRECISION, DIMENSION(:), ALLOCATABLE :: C_pg 85 86 ! Constant constant-pressure specific heat of solids 87 DOUBLE PRECISION C_ps0(DIM_M) 88 89 ! Constant pressure specific heat of solids 90 DOUBLE PRECISION, DIMENSION(:, :), ALLOCATABLE :: C_ps 91 92 ! Specified constant gas conductivity 93 DOUBLE PRECISION :: K_g0 94 95 ! Conductivity of gas 96 DOUBLE PRECISION, DIMENSION(:), ALLOCATABLE :: K_g 97 98 ! Specified constant solids conductivity 99 DOUBLE PRECISION K_s0(DIM_M) 100 101 ! Conductivity of solids 102 DOUBLE PRECISION, DIMENSION(:, :), ALLOCATABLE :: K_s 103 104 ! Granular Temperature Conductivity (associated with temperature grad) 105 DOUBLE PRECISION, DIMENSION(:, :), ALLOCATABLE :: Kth_s 106 107 ! Granular Temperature Conductivity (associated with volume fraction grad) 108 DOUBLE PRECISION, DIMENSION(:, :), ALLOCATABLE :: Kphi_s 109 110 ! Specified constant gas diffusivity 111 DOUBLE PRECISION DIF_g0 112 113 ! Diffusivity of gas species N 114 DOUBLE PRECISION, DIMENSION(:, :), ALLOCATABLE :: DIF_g 115 116 ! Specified constant solids diffusivity 117 DOUBLE PRECISION DIF_s0 118 119 ! Diffusivity of solids species N 120 DOUBLE PRECISION, DIMENSION(:, :, :), ALLOCATABLE :: DIF_s 121 122 ! Total number of gas or solids species 123 INTEGER :: NMAX(0:DIM_M) ! Runtime (all phases) 124 INTEGER :: NMAX_g ! Number of gas phase species 125 INTEGER :: NMAX_s(DIM_M) ! Number of solids phase species 126 127 ! Molecular weight of gas species 128 DOUBLE PRECISION :: MW_g (DIM_N_g) 129 130 ! Molecular weight of solids species 131 DOUBLE PRECISION :: MW_s (DIM_M, DIM_N_s) 132 133 ! Molecular weight of gas mixture 134 DOUBLE PRECISION, DIMENSION(:), ALLOCATABLE :: MW_MIX_g 135 136 ! Logical for reading thermochemical database. 137 LOGICAL :: DATABASE_READ = .TRUE. 138 139 ! Polynomical coefficients for calculating specific heat. 140 DOUBLE PRECISION Alow (7,0:DIM_M, DIM_N) ! Tlow --> Tcom 141 DOUBLE PRECISION Ahigh(7,0:DIM_M, DIM_N) ! Tcom --> Thigh 142 143 ! Range where the polynomials are valid. 144 DOUBLE PRECISION Thigh(0:DIM_M, DIM_N) ! Upper bound 145 DOUBLE PRECISION Tlow (0:DIM_M, DIM_N) ! Lower bound 146 DOUBLE PRECISION Tcom (0:DIM_M, DIM_N) ! Switch from low to high 147 148 ! Heat of formation at Tref divided by the gas constant. 149 DOUBLE PRECISION HfrefoR(0:DIM_M, DIM_N) 150 151 ! Reference values. 152 DOUBLE PRECISION ICpoR_l(0:DIM_M, DIM_N) 153 DOUBLE PRECISION ICpoR_h(0:DIM_M, DIM_N) 154 155 CONTAINS 156 157 !vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvC 158 ! C 159 ! Module name: CALC_MW (X_g, DIM, L, NMAX, MW_g) C 160 ! Purpose: Calculate average molecular weight of gas C 161 ! C 162 ! Author: M. Syamlal Date: 19-OCT-92 C 163 ! Reviewer: P. Nicoletti Date: 11-DEC-92 C 164 ! C 165 ! Revision Number: C 166 ! Purpose: C 167 ! Author: Date: dd-mmm-yy C 168 ! Reviewer: Date: dd-mmm-yy C 169 ! C 170 ! Literature/Document References: C 171 ! C 172 ! Variables referenced:None C 173 ! Variables modified:None C 174 ! C 175 ! Local variables: SUM, N C 176 ! C 177 !^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^C 178 ! 179 DOUBLE PRECISION FUNCTION CALC_MW (X_G, DIM, L, NMAX, MW_G) 180 !...Translated by Pacific-Sierra Research VAST-90 2.06G5 12:17:31 12/09/98 181 !...Switches: -xf 182 !----------------------------------------------- 183 ! M o d u l e s 184 !----------------------------------------------- 185 USE param 186 USE param1 187 USE toleranc 188 IMPLICIT NONE 189 !----------------------------------------------- 190 ! D u m m y A r g u m e n t s 191 !----------------------------------------------- 192 ! 193 ! Mass fraction array's Ist dimension 194 INTEGER DIM 195 ! 196 ! 197 ! Max of X_g array 2nd index and MW_g array index 198 INTEGER NMAX 199 ! 200 ! Mass fraction array 201 ! 202 DOUBLE PRECISION X_g(DIM, NMAX) 203 ! 204 ! Moleculare weight array 205 ! 206 DOUBLE PRECISION MW_g(NMAX) 207 ! 208 ! Mass fraction array Ist index 209 INTEGER L 210 ! 211 ! Local variable 212 ! 213 ! local sum 214 DOUBLE PRECISION SUM 215 ! 216 ! local index 217 INTEGER N 218 !----------------------------------------------- 219 ! 220 SUM = ZERO 221 DO N = 1, NMAX 222 SUM = SUM + X_G(L,N)/MW_G(N) 223 END DO 224 CALC_MW = ONE/MAX(SUM,OMW_MAX) 225 ! 226 RETURN 227 END FUNCTION CALC_MW 228 229 !vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvC 230 ! C 231 ! FUNCTION: blend_function C 232 ! Purpose: To calculate blending function C 233 ! C 234 ! Author: S. Pannala Date: 28-FEB-06 C 235 ! Reviewer: Date: C 236 ! Modified: Date: 24-OCT-06 C 237 ! C 238 ! C 239 ! Literature/Document References: C 240 ! Variables referenced: C 241 ! Variables modified: C 242 ! C 243 ! Local variables: C 244 ! C 245 !^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^C 246 247 DOUBLE PRECISION FUNCTION blend_function(IJK) 248 249 !----------------------------------------------- 250 ! Modules 251 !----------------------------------------------- 252 USE compar 253 USE constant 254 USE fldvar 255 USE fun_avg 256 USE functions 257 USE geometry 258 USE indices 259 USE param 260 USE param1 261 USE run 262 USE toleranc 263 USE visc_s 264 IMPLICIT NONE 265 !----------------------------------------------- 266 ! Dummy arguments 267 !----------------------------------------------- 268 ! IJK index 269 INTEGER, INTENT(IN) :: IJK 270 !----------------------------------------------- 271 ! Local variables 272 !----------------------------------------------- 273 ! Logical to see whether this is the first entry to this routine 274 LOGICAL,SAVE:: FIRST_PASS = .TRUE. 275 ! Blend Factor 276 Double Precision:: blend, blend_right 277 ! Scale Factor 278 Double Precision, Save:: scale 279 ! Midpoint 280 Double Precision, Save:: ep_mid_point 281 !----------------------------------------------- 282 283 ! Tan hyperbolic blending of stresses 284 IF(TANH_BLEND) THEN 285 IF(EP_g(IJK) .LT. ep_g_blend_end(ijk).AND. EP_g(IJK) .GT. ep_g_blend_start(ijk)) THEN 286 ep_mid_point = (ep_g_blend_end(IJK)+ep_g_blend_start(IJK))/2.0d0 287 blend = tanh(2.0d0*pi*(ep_g(IJK)-ep_mid_point)/ & 288 (ep_g_blend_end(IJK)-ep_g_blend_start(IJK))) 289 blend = (blend+1.0d0)/2.0d0 290 ELSEIF(EP_g(IJK) .GE. ep_g_blend_end(ijk)) THEN 291 blend = 1.0d0 292 ELSEIF(EP_g(IJK) .LE. ep_g_blend_start(ijk)) THEN 293 blend = 0.0d0 294 ENDIF 295 296 ! Truncated and Scaled Sigmoidal blending of stresses 297 ELSEIF(SIGM_BLEND) THEN 298 IF(FIRST_PASS) THEN 299 blend_right = 1.0d0/(1+0.01d0**((ep_g_blend_end(IJK)-ep_star_array(IJK))& 300 /(ep_g_blend_end(IJK)-ep_g_blend_start(IJK)))) 301 blend_right = (blend_right+1.0d0)/2.0d0 302 scale = 1.0d0/blend_right 303 write(*,*) 'Blending value at end and scaling factor', blend_right, scale 304 FIRST_PASS = .FALSE. 305 ENDIF 306 IF(EP_g(IJK) .LT. ep_g_blend_end(ijk)) THEN 307 blend = scale/(1+0.01d0**((ep_g(IJK)-ep_star_array(IJK))& 308 /(ep_g_blend_end(IJK)-ep_g_blend_start(IJK)))) 309 ELSEIF(EP_g(IJK) .GE. ep_g_blend_end(ijk)) THEN 310 blend = 1.0d0 311 ENDIF 312 313 ENDIF 314 315 blend_function = blend 316 317 RETURN 318 END FUNCTION blend_function 319 320 END MODULE physprop 321