Skip to content

Commit 05b507f

Browse files
authored
Merge pull request #14082 from cxp484/master
2 parents 97976da + d8cbcd8 commit 05b507f

30 files changed

+1698
-232
lines changed

Manuals/FDS_Technical_Reference_Guide/Combustion_Chapter.tex

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -342,16 +342,16 @@ \subsection{Finite-Rate Chemistry (Detailed Chemical Mechanism)}
342342
\label{detailed_chemistry_using_mechanism}
343343
A chemical mechanism represents different chemical pathways using multiple species and reactions. Typically, these mechanisms are available in Chemkin or Cantera YAML formats. Such a mechanism can be represented as:
344344
\begin{equation}\label{eq:chemistry_mechanism}
345-
\sum_{j=1}^{N_{sp}}{\nu}_{ji}^{'} \ X_j \Leftrightarrow \sum_{j=1}^{N_{sp}}{\nu}_{ji}^{''} \ X_j, i=1,2,3,...,N_{reac}
345+
\sum_{j=1}^{N_{\text{s}}}{\nu}_{ji}^{'} \ X_j \Leftrightarrow \sum_{j=1}^{N_{\text{s}}}{\nu}_{ji}^{''} \ X_j, i=1,2,3,...,N_\text{r}
346346
\end{equation}
347-
Here, $X_j$ represents the chemical symbol of the $j$th species (i.e. $\mathrm{CH_4, H_2, O_2}$); ${\nu}_{ji}^{'}$ and ${\nu}_{ji}^{''}$ are the stoichiometric coefficients of the $j$th species in the $i$th reaction; ${N_{sp}}$ and ${N_{reac}}$ are the total number of species and total number of reactions, respectively.
347+
Here, $X_j$ represents the chemical symbol of the $j$th species (i.e. $\mathrm{CH_4, H_2, O_2}$); ${\nu}_{ji}^{'}$ and ${\nu}_{ji}^{''}$ are the stoichiometric coefficients of the $j$th species in the $i$th reaction; ${N_{\text{s}}}$ and ${N_\text{r}}$ are the total number of species and total number of reactions, respectively.
348348
The rate of change of the molar concentration \si{(kmol/m^3/s)} of each species can be represented using the following system of ordinary differential equations (ODEs):
349349
\begin{equation}\label{eq:chemistry_ode_system}
350-
\frac{\d C_k}{\d t} = \dot{\omega_k} = \sum_{i=1}^{N_{reac}} b_{i} \ \nu_{ki} \ r_i
350+
\frac{\d C_k}{\d t} = \dot{\omega_k} = \sum_{i=1}^{N_\text{r}} b_{i} \ \nu_{ki} \ r_i
351351
\end{equation}
352352
The right-hand side of the above equation represents contributions from each reaction to the $j$th species. Here, $C_k$ is the molar concentration \si {(kmol/m^3)} of the $k$th species; $b_i$ is the reaction rate modification coefficient of the $i$th reaction due to third-body effects and pressure; $\nu_{ki} = {\nu}_{ki}^{''} - {\nu}_{ki}^{'}$; and $r_i$ is the reaction progress rate of the $i$th reaction.
353353
\begin{equation}\label{eq:reaction_progress_rate}
354-
r_i = k_{f,i} \prod_{j=1}^{N_{sp}} (C_j)^{{\nu}_{ji}^{'}} - k_{r,i} \prod_{j=1}^{N_{sp}} (C_j)^{{\nu}_{ji}^{''}}
354+
r_i = k_{f,i} \prod_{j=1}^{N_{\text{s}}} (C_j)^{{\nu}_{ji}^{'}} - k_{r,i} \prod_{j=1}^{N_{\text{s}}} (C_j)^{{\nu}_{ji}^{''}}
355355
\end{equation}
356356
Here, $k_{f,i}$ and $k_{r,i}$ are the forward and reverse reaction rate coefficients, respectively. The $k_{f,i}$ can be calculated using Eq.~(\ref{eq:rate_cons}), and the $k_{r,i}$ can be calculated by obtaining the equilibrium constant, as shown in Eq.~(\ref{eq:equilibrium_const}).
357357

@@ -365,7 +365,7 @@ \subsection{Finite-Rate Chemistry (Detailed Chemical Mechanism)}
365365
\end{equation}
366366
For third-body reactions, presence of (or collission with) a third body (any other molecule) modify the reaction rate. If the third-body efficiency of species $j$ in reaction $i$ (denoted as $\alpha_{ij}$) is provided, then
367367
\be
368-
\eta_{\mathrm{tb},i} = \sum_{j=1}^{N_{sp}} \alpha_{ij}C_{j}
368+
\eta_{\mathrm{tb},i} = \sum_{j=1}^{N_{\text{s}}} \alpha_{ij}C_{j}
369369
\ee
370370
If the third-body efficiency is not provided, the default value of $\alpha_{ij}$ is 1.0.
371371

@@ -398,7 +398,7 @@ \subsection{Finite-Rate Chemistry (Detailed Chemical Mechanism)}
398398

399399
To solve the reactive system, we assume a constant pressure reactor. For that, the concentration ODEs in the form of Eq.~(\ref{eq:chemistry_ode_system}) need to be solved along with a ODE of temperature given by:
400400
\begin{equation}\label{eq:TemperatureDerivative}
401-
\frac{\d T}{\d t} = \dot{T} = -\frac{1}{\rho c_p} \sum_{j=1}^{N_{sp}}h_j W_j \dot{\omega_j}
401+
\frac{\d T}{\d t} = \dot{T} = -\frac{1}{\rho c_p} \sum_{j=1}^{N_{\text{s}}}h_j W_j \dot{\omega_j}
402402
\end{equation}
403403
Here, $\rho$ is the density $\mathrm{(kg/m^3)}$, $c_p$ is the specific heat of the mixture (J/kg/K), $h_k$ is the absolute enthalpy that includes enthalpy of formation (J/kg), $W_j$ is the molecular weight (kg/kmol) of species $j$, and $\dot{\omega}$ is the species production rate given by Eq.~(\ref{eq:chemistry_ode_system}).
404404
To solve the system of ODEs, we first convert the mass fraction of species to molar concentrations using $C_j=Y_j\rho/W_j$. Then, CVODE from Sundials \cite{cvodeDoc:2024} is used to solve the system of ODEs by supplying an analytical Jacobian. The details of analytical Jacobian formulation is provided in the Appendix \ref{chemistry_analytical_jacobian}.

Manuals/FDS_Verification_Guide/FDS_Verification_Guide.tex

Lines changed: 108 additions & 26 deletions
Large diffs are not rendered by default.

Source/chem.f90

Lines changed: 48 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ MODULE CVODE_INTERFACE
1717

1818
LOGICAL :: DEBUG=.FALSE.
1919
REAL(EB), PARAMETER :: MIN_CHEM_TMP=200._EB
20+
REAL(EB) :: CUR_CFD_TIME
2021

2122
PUBLIC CVODE_SERIAL
2223

@@ -27,8 +28,8 @@ MODULE CVODE_INTERFACE
2728
!> \param TN_C is the current time
2829
!> \param SUNVEC_Y is the current array of molar concentrations, temperature and pressure.
2930
!> \param SUNVEC_F is the array of derivatives returned
30-
!> \param USER_DATA ??
31-
31+
!> \param USER_DATA is the user data array. Not yet used in FDS.
32+
!> \details The right hand side function of the ode d[c]/dt = wdot (=f). Provides the Derivative function to CVODE.
3233
INTEGER(C_INT) FUNCTION RHSFN(TN_C, SUNVEC_Y, SUNVEC_F, USER_DATA) &
3334
RESULT(IERR) BIND(C,NAME='RHSFN')
3435

@@ -65,7 +66,7 @@ END FUNCTION RHSFN
6566

6667

6768

68-
!> \brief Calculate derivative (fvec) for a given cvec(n_tracked_species+2)
69+
!> \brief Calculate derivative (fvec) for a given concentration vector cvec(n_tracked_species+2)
6970
!> \param CVEC is the current array of molar concentrations, temperature and pressure.
7071
!> \param FVEC is the array of derivatives returned
7172

@@ -77,7 +78,7 @@ SUBROUTINE DERIVATIVE(CVEC,FVEC)
7778
REAL(EB) :: R_F,MIN_SPEC(N_TRACKED_SPECIES), KG, TMP, RHO, &
7879
K_0, K_INF, P_RI, FCENT, B_I, RRTMP, THIRD_BODY_ENHANCEMENT, PR
7980
INTEGER :: I,NS, ITMP
80-
REAL(EB) :: ZZ(N_TRACKED_SPECIES), CP, HS_I, DG
81+
REAL(EB) :: ZZ(N_TRACKED_SPECIES), CP, HS_I, DG
8182
TYPE(REACTION_TYPE), POINTER :: RN
8283

8384
TMP = MAX(CVEC(N_TRACKED_SPECIES+1), MIN_CHEM_TMP)
@@ -161,7 +162,7 @@ END SUBROUTINE DERIVATIVE
161162
!> \brief Calculate fall-off function
162163
!> \param TMP is the current temperature.
163164
!> \param P_RI is the reduced pressure
164-
!> \param RN is the reaction
165+
!> \param RNI is the index of reaction
165166

166167
REAL(EB) FUNCTION CALCFCENT(TMP, P_RI, RNI)
167168
REAL(EB), INTENT(IN) :: TMP, P_RI
@@ -194,10 +195,16 @@ END FUNCTION CALCFCENT
194195

195196

196197

197-
!> \the jacobian of the ode right hand side function j = df/dy
198-
!> \param TN_C is the current time
198+
!> \brief The jacobian of the ode right hand side function j = df/dy
199+
!> \param TN_C is the current time provided by CVODE during callback, not the actual CFD time.
199200
!> \param SUNVEC_Y is the current array of molar concentrations, temperature and pressure.
200201
!> \param SUNVEC_F is the array of derivatives returned
202+
!> \param SUNMAT_J is the Jacobian array returned to CVODE
203+
!> \param USER_DATA is the user data array. Not yet used in FDS.
204+
!> \param TMP1 is not yet used in FDS.
205+
!> \param TMP2 is not yet used in FDS.
206+
!> \param TMP3 is not yet used in FDS.
207+
!> \details The jacobian of the ode right hand side function j = df/dy. Provides the Jacobian function to CVODE.
201208

202209
INTEGER(C_INT) FUNCTION JACFN(TN_C, SUNVEC_Y, SUNVEC_F, SUNMAT_J, &
203210
USER_DATA, TMP1, TMP2, TMP3) &
@@ -255,7 +262,7 @@ INTEGER(C_INT) FUNCTION JACFN(TN_C, SUNVEC_Y, SUNVEC_F, SUNMAT_J, &
255262
END FUNCTION JACFN
256263

257264

258-
!> \brief Calculate the jacobian matrix (jmat[n_tracked_species+2,
265+
!> \brief Calculate the analytical jacobian jmat[n_tracked_species+2,n_tracked_species+2]
259266
!> \param CVEC is the current array of molar concentrations, temperature and pressure.
260267
!> \param FVEC is the array of derivatives passed as input
261268
!> \param JMAT is the jacobian matrix returned
@@ -352,7 +359,7 @@ SUBROUTINE JACOBIAN(CVEC,FVEC, JMAT)
352359
!Contribution of qi
353360
DO NS1 = 1, RN%N_SPEC
354361
DO NS=1,RN%N_SMIX_FR
355-
DCVEC1 = R_F*RN%NU_NN(RN%NU_INDEX(NS))/CVEC(YP2ZZ(RN%N_S_INDEX(NS1)))
362+
DCVEC1 = R_F*RN%NU_NN(RN%NU_INDEX(NS))*RN%N_S(NS1)/CVEC(YP2ZZ(RN%N_S_INDEX(NS1)))
356363
JMAT((YP2ZZ(RN%N_S_INDEX(NS1))),RN%NU_INDEX(NS)) = &
357364
JMAT((YP2ZZ(RN%N_S_INDEX(NS1))),RN%NU_INDEX(NS))+ DCVEC1
358365
ENDDO
@@ -429,6 +436,7 @@ END SUBROUTINE JACOBIAN
429436

430437

431438
!> \brief Print the component of jacobian matrix
439+
!> \param JMAT is the Jacobian matrix.
432440
SUBROUTINE PRINT_JMAT(JMAT)
433441
REAL(EB), INTENT(IN) :: JMAT(N_TRACKED_SPECIES+2, N_TRACKED_SPECIES+2)
434442
INTEGER :: NS, NS2
@@ -477,10 +485,13 @@ END SUBROUTINE PRINT_JMAT
477485

478486
!> \brief Calculate DBIDC of reactions
479487
!> \param TMP is the current temperature.
480-
!> \param RN is the reaction
481-
!> \param CVEC is the array of concentrations
482-
!> \param PR is the PRESSURE RATIO.
483-
!> \param F is the FALLOFF FUNCTION VALUE.
488+
!> \param RNI is the reaction index.
489+
!> \param K0 is the low pressure rate coeff.
490+
!> \param KINF is the high pressure rate coeff.
491+
!> \param PR is the pressure ratio.
492+
!> \param F is the falloff function value.
493+
!> \param DBIDC is the derivative of modification factor w.r.t concentration (out).
494+
!> \param DBIDT is the derivative of modification factor w.r.t temperature (out).
484495

485496
SUBROUTINE CALC_FALLOFF_DBIDC_AND_DBIDT(TMP, RNI, K0, KINF, PR, F, DBIDC, DBIDT)
486497
REAL(EB), INTENT(IN) :: TMP, PR, K0, KINF, F
@@ -515,6 +526,11 @@ SUBROUTINE CALC_FALLOFF_DBIDC_AND_DBIDT(TMP, RNI, K0, KINF, PR, F, DBIDC, DBIDT)
515526
END SUBROUTINE CALC_FALLOFF_DBIDC_AND_DBIDT
516527

517528
!> \brief Calculate derivative of TROE function w.r.t concentration
529+
!> \param PR is the pressure ratio.
530+
!> \param F is the falloff function value.
531+
!> \param DPRDC is the derivative of TROE function w.r.t concentration.
532+
!> \param TMP is the current temperature.
533+
!> \param RNI is the reaction index
518534
REAL(EB) FUNCTION DDC_TROE(PR, F, DPRDC, TMP, RNI)
519535
REAL(EB), INTENT(IN) :: PR, F, DPRDC, TMP
520536
INTEGER, INTENT(IN) :: RNI
@@ -547,6 +563,11 @@ END FUNCTION DDC_TROE
547563

548564

549565
!> \brief Calculate derivative of TROE function w.r.t temperature
566+
!> \param PR is the pressure ratio.
567+
!> \param F is the falloff function value.
568+
!> \param DPRDT is the derivative of TROE function w.r.t temperature.
569+
!> \param TMP is the current temperature.
570+
!> \param RNI is the reaction index
550571
REAL(EB) FUNCTION DDTMP_TROE(PR, F, DPRDT, TMP, RNI)
551572
REAL(EB), INTENT(IN) :: PR, F, DPRDT, TMP
552573
INTEGER, INTENT(IN) :: RNI
@@ -586,15 +607,15 @@ END FUNCTION DDTMP_TROE
586607

587608

588609

589-
!> \cvode interface for ODE integrator
590-
!> \Call sundials cvode in serial mode.
610+
!> \brief cvode interface for ODE integrator. Call sundials cvode in serial mode.
591611
!> \param ZZ species mass fraction array
592612
!> \param TMP_IN is the temperature
593613
!> \param PR_IN is the pressure
594614
!> \param TCUR is the start time in seconds
595615
!> \param TEND is the end time in seconds
596616
!> \param RTOL is the relative error for all the species (REAL_EB)
597617
!> \param ATOL is the absolute error tolerance array for the species (REAL_EB)
618+
!> \details This is the interface subroutine to the other modules.
598619

599620
SUBROUTINE CVODE_SERIAL(CC,TMP_IN, PR_IN, TCUR,TEND, RTOL, ATOL)
600621
USE PHYSICAL_FUNCTIONS, ONLY : MOLAR_CONC_TO_MASS_FRAC, CALC_EQUIV_RATIO
@@ -740,12 +761,13 @@ SUBROUTINE CVODE_SERIAL(CC,TMP_IN, PR_IN, TCUR,TEND, RTOL, ATOL)
740761

741762
IF (IERR_C .NE. CV_SUCCESS) THEN
742763
IF (IERR_C == CV_TOO_MUCH_WORK) THEN
743-
WRITE(LU_ERR,'(A, 3E12.2, A)')" WARN: CVODE took all internal substeps. TSTART, TEND, DT=", TCUR, TEND, (TEND-TCUR), &
764+
WRITE(LU_ERR,'(A, 2E18.8, A)')" WARN: CVODE took all internal substeps. CUR_CFD_TIME, DT=", CUR_CFD_TIME, (TEND-TCUR), &
744765
". If the warning persists, reduce the timestep."
745766
ELSE
746-
WRITE(LU_ERR,'(A, I4, A, 3E12.2, A)')" WARN: CVODE didn't finish ODE solution with message code:", IERR_C, &
747-
" and TSTART, TEND, DT=", TCUR, TEND, (TEND-TCUR), ". If the warning persists, reduce the timestep."
767+
WRITE(LU_ERR,'(A, I4, A, 2E18.8, A)')" WARN: CVODE didn't finish ODE solution with message code:", IERR_C, &
768+
" and CUR_CFD_TIME, DT=", CUR_CFD_TIME, (TEND-TCUR), ". If the warning persists, reduce the timestep."
748769
ENDIF
770+
749771
IF (DEBUG) THEN
750772
CALL MOLAR_CONC_TO_MASS_FRAC(CC(1:N_TRACKED_SPECIES), ZZ(1:N_TRACKED_SPECIES))
751773
CALL CALC_EQUIV_RATIO(ZZ(1:N_TRACKED_SPECIES), EQUIV)
@@ -772,7 +794,12 @@ SUBROUTINE CVODE_SERIAL(CC,TMP_IN, PR_IN, TCUR,TEND, RTOL, ATOL)
772794
END SUBROUTINE CVODE_SERIAL
773795

774796

775-
!> \brief error handler function, such that CVODE() doesn't output the error directly to stderr.
797+
!> \brief CVODE error handler callback function, such that CVODE() doesn't output the error directly to stderr.
798+
!> \param ERR_CODE The error code send by CVODE
799+
!> \param MOD_NAME The module name where error occured send by CVODE
800+
!> \param FUNC_NAME The functio name where error occured send by CVODE
801+
!> \param MESSAGE The error message
802+
!> \param USER_DATA User data, not used in FDS.
776803
SUBROUTINE FDS_CVODE_ERR_HANDLER( ERR_CODE, MOD_NAME, FUNC_NAME, MESSAGE, USER_DATA) &
777804
BIND(C,NAME='FDS_CVODE_ERR_HANDLER')
778805
INTEGER(C_INT), VALUE :: ERR_CODE
@@ -837,6 +864,8 @@ END SUBROUTINE FDS_CVODE_ERR_HANDLER
837864

838865

839866

867+
!> \brief print CVODE statistics from a CVODE memory object.
868+
!> \param CVODE_MEM CVODE memory object.
840869
SUBROUTINE CVODESTATS(CVODE_MEM)
841870

842871
!======= INCLUSIONS ===========

Source/fire.f90

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ MODULE FIRE
88
USE COMP_FUNCTIONS, ONLY: CURRENT_TIME
99
USE SOOT_ROUTINES, ONLY: SOOT_SURFACE_OXIDATION
1010
#ifdef WITH_SUNDIALS
11-
USE CVODE_INTERFACE
11+
USE CVODE_INTERFACE, ONLY: CUR_CFD_TIME, CVODE_SERIAL
1212
#endif
1313

1414
IMPLICIT NONE (TYPE,EXTERNAL)
@@ -821,7 +821,6 @@ SUBROUTINE COMBUSTION_MODEL(T,DT,ZZ_GET,Q_OUT,MIX_TIME_OUT,CHI_R_OUT,CHEM_SUBIT_
821821
! May be used with N_FIXED_CHEMISTRY_SUBSTEPS, but default mode is to use error estimator and variable DT_SUB
822822

823823
RICH_EX_LOOP: DO RICH_ITER = 1,RICH_ITER_MAX
824-
825824
DT_SUB = MIN(DT_SUB_NEW,DT-DT_ITER)
826825
! FDS Tech Guide (E.3), (E.4), (E.5)
827826
CALL FIRE_RK2(A1,ZZ_MIXED,ZZ_0,ZETA_1,ZETA_0,DT_SUB,1,TMP_IN,RHO_HAT,CELL_MASS,TAU_MIX,&
@@ -869,6 +868,9 @@ SUBROUTINE COMBUSTION_MODEL(T,DT,ZZ_GET,Q_OUT,MIX_TIME_OUT,CHI_R_OUT,CHEM_SUBIT_
869868
DO NS =1,N_TRACKED_SPECIES
870869
ATOL(NS) = DBLE(SPECIES_MIXTURE(NS)%ODE_ABS_ERROR)
871870
ENDDO
871+
#ifdef WITH_SUNDIALS
872+
CUR_CFD_TIME = T ! Set current cfd time in cvode, for logging purpose.
873+
#endif
872874
CALL CVODE(ZZ_MIXED,TMP_IN,PRES_IN, T1,T2, GLOBAL_ODE_REL_ERROR, ATOL)
873875
Q_REAC_SUB = 0._EB
874876
END SELECT INTEGRATOR_SELECT
@@ -995,7 +997,7 @@ SUBROUTINE CVODE(ZZ, TMP_IN, PRES_IN, TCUR,TEND, GLOBAL_ODE_REL_ERROR, ATOL)
995997
! Convert to concentration
996998
CC = 0._EB
997999
DO NS =1,N_TRACKED_SPECIES
998-
CC(NS) = RHO_IN*ZZ(NS)/SPECIES_MIXTURE(NS)%MW ! [RHO]= kg/m3, [MW] = gm/mol = kg/kmol, [CC] = kmol/m3
1000+
CC(NS) = RHO_IN*ZZ(NS)/SPECIES_MIXTURE(NS)%MW ! [RHO]= kg/m3, [MW] = g/mol = kg/kmol, [CC] = kmol/m3
9991001
ENDDO
10001002
WHERE(CC<0._EB) CC=0._EB
10011003

Source/read.f90

Lines changed: 17 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -4512,7 +4512,7 @@ SUBROUTINE READ_REAC
45124512
CRITICAL_FLAME_TEMPERATURE,HEAT_OF_COMBUSTION,HOC_COMPLETE,E,C,H,N,O, &
45134513
N_T,NU(MAX_SPECIES),N_S(MAX_SPECIES),THIRD_EFF(MAX_SPECIES),&
45144514
FUEL_C_TO_CO_FRACTION,FUEL_H_TO_H2_FRACTION,FUEL_N_TO_HCN_FRACTION,AUTO_IGNITION_TEMPERATURE, A_LOW_PR, &
4515-
E_LOW_PR,N_T_LOW_PR, A_TROE, T1_TROE, T2_TROE, T3_TROE, SUMNU
4515+
E_LOW_PR,N_T_LOW_PR, A_TROE, T1_TROE, T2_TROE, T3_TROE
45164516
REAL(EB) :: E_TMP=0._EB,S_TMP=0._EB,ATOM_COUNTS(118),MW_FUEL=0._EB,H_F=0._EB,PR_TMP=0._EB
45174517
LOGICAL :: L_TMP,CHECK_ATOM_BALANCE,REVERSE,THIRD_BODY
45184518
TYPE(REACTION_TYPE), POINTER, DIMENSION(:) :: REAC_TEMP
@@ -4826,23 +4826,7 @@ SUBROUTINE READ_REAC
48264826
ALLOCATE(RN%SPEC_ID_NU_READ(RN%N_SMIX))
48274827
RN%SPEC_ID_NU_READ = 'null'
48284828
RN%SPEC_ID_NU_READ(1:RN%N_SMIX)=SPEC_ID_NU(1:RN%N_SMIX)
4829-
4830-
SUMNU = 0._EB
4831-
DO NS = 1, RN%N_SMIX
4832-
IF (NU(NS) .LT. 0._EB) THEN
4833-
SUMNU = SUMNU - NU(NS)
4834-
ENDIF
4835-
ENDDO
4836-
4837-
IF (RN%REACTYPE==THREE_BODY_ARRHENIUS_TYPE) THEN
4838-
RN%A_SI = RN%A_IN*(1000._EB)**(-SUMNU) ![kmol/m3]^(-sum(nu)). Here 1000 is for conversion from mol/cm3 to kmol/m3
4839-
ELSE
4840-
RN%A_SI = RN%A_IN*(1000._EB)**(1-SUMNU) ![kmol/m3]^(1-sum(nu))
4841-
ENDIF
4842-
4843-
IF (RN%REACTYPE == FALLOFF_LINDEMANN_TYPE .OR. RN%REACTYPE == FALLOFF_TROE_TYPE) THEN
4844-
RN%A_LOW_PR = RN%A_LOW_PR*(1000._EB)**(-SUMNU)
4845-
ENDIF
4829+
48464830
ELSE SIMPLE_IF
48474831
RN%N_SMIX = 3
48484832
RN%N_SPEC_READ = 0
@@ -5254,6 +5238,21 @@ SUBROUTINE PROC_REAC_1
52545238
RN%RHO_EXPONENT = RN%RHO_EXPONENT + RN%N_S(NS)
52555239
ENDDO
52565240

5241+
IF(.NOT. RN%REVERSE) THEN
5242+
IF (RN%REACTYPE==THREE_BODY_ARRHENIUS_TYPE) THEN
5243+
RN%A_SI = RN%A_IN*(1000._EB)**(-RN%RHO_EXPONENT) ![kmol/m3]^(-sum(nu)). Here 1000 is for conversion from mol/cm3 to kmol/m3
5244+
ELSE
5245+
RN%A_SI = RN%A_IN*(1000._EB)**(1-RN%RHO_EXPONENT) ![kmol/m3]^(1-sum(nu))
5246+
ENDIF
5247+
5248+
IF (RN%REACTYPE == FALLOFF_LINDEMANN_TYPE .OR. RN%REACTYPE == FALLOFF_TROE_TYPE) THEN
5249+
RN%A_LOW_PR = RN%A_LOW_PR*(1000._EB)**(-RN%RHO_EXPONENT)
5250+
ENDIF
5251+
ELSE
5252+
RN%A_SI = REACTION(RN%REVERSE_INDEX)%A_SI
5253+
RN%A_LOW_PR = REACTION(RN%REVERSE_INDEX)%A_LOW_PR
5254+
ENDIF
5255+
52575256
RN%RHO_EXPONENT = RN%RHO_EXPONENT - 1._EB ! subtracting 1 accounts for division by rho in Eq. (5.40)
52585257
RN%A_PRIME = RN%A_PRIME * 1000._EB*SPECIES_MIXTURE(RN%FUEL_SMIX_INDEX)%MW ! conversion terms in Eq. (5.37)
52595258

0 commit comments

Comments
 (0)