1 !vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv! 2 ! ! 3 ! Module name: USR_RATES ! 4 ! ! 5 ! Purpose: Hook for user defined reaction rates. ! 6 ! ! 7 ! Author: J.Musser Date: 10-Oct-12 ! 8 ! ! 9 ! Comments: Write reaction rates in units of moles/sec.cm^3 (cgs) or ! 10 ! kmoles/sec.m^3 (SI). Units should match those specified in the data ! 11 ! file. 12 ! ! 13 ! Example reaction: Methane combustion ! 14 ! ! 15 ! mfix.dat input: ! 16 !``````````````````````````````````````````````````````````````````````! 17 ! @(RXNS) ! 18 ! CH4_Comb { chem_eq = "CH4 + 2.0*O2 --> CO2 + 2.0*H2O" } ! 19 ! @(END) ! 20 !``````````````````````````````````````````````````````````````````````! 21 ! ! 22 ! usr_rates.f input: ! 23 !``````````````````````````````````````````````````````````````````````! 24 ! c_O2 = (RO_g(IJK)*X_g(IJK,O2)/MW_g(O2)) ! 25 ! c_CH4 = (RO_g(IJK)*X_g(IJK,CH4)/MW_g(CH4)) ! 26 ! RATES(CH4_Comb) = 2.0d5 * EP_g(IJK) * c_O2 * c_CH4 ! 27 !``````````````````````````````````````````````````````````````````````! 28 ! * Species alias and reaction names given in the data file can be ! 29 ! used in reference to the reaction index in RATES and a species ! 30 ! index in gas/solids phase variables. ! 31 ! ! 32 ! * Additional information is provided in section 5.11 of the code ! 33 ! Readme. ! 34 ! ! 35 !^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^! 36 SUBROUTINE USR_RATES(IJK, RATES) 37 38 USE param 39 USE param1 40 USE parallel 41 USE fldvar 42 USE rxns 43 USE energy 44 USE geometry 45 USE run 46 USE indices 47 USE physprop 48 USE constant 49 USE funits 50 USE compar 51 USE sendrecv 52 USE toleranc 53 USE usr 54 USE fun_avg 55 56 IMPLICIT NONE 57 58 INTEGER, INTENT(IN) :: IJK 59 60 DOUBLE PRECISION, DIMENSION(NO_OF_RXNS), INTENT(OUT) :: RATES 61 62 INCLUDE 'species.inc' 63 64 ! Reaction specific variables: 65 !`````````````````````````````````````````````````````````````````````// 66 67 ! Reaction rates: 68 !`````````````````````````````````````````````````````````````````````// 69 ! Include reaction rates here. Reaction rates should be stored in the 70 ! variable RATES. The reaction name given in the data file can be used 71 ! to store the rate in the appropriate array location. Additional 72 ! input format parameters are given in Section 4.11 of the code Readme. 73 74 RATES(:) = ZERO 75 76 RETURN 77 78 END SUBROUTINE USR_RATES 79