Skip to content

Commit

Permalink
Merge pull request firemodels#13518 from drjfloyd/master
Browse files Browse the repository at this point in the history
FDS Source: Add error codes and address Issue firemodels#12788
  • Loading branch information
drjfloyd authored Oct 3, 2024
2 parents a0a60e2 + 2a2a043 commit a3c47d7
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 37 deletions.
10 changes: 8 additions & 2 deletions Manuals/FDS_User_Guide/FDS_User_Guide.tex
Original file line number Diff line number Diff line change
Expand Up @@ -5353,7 +5353,7 @@ \subsubsection{Single Step Reaction}
SPEC_ID_N_S = 'PROPANE','OXYGEN'
N_S = 0.1,1.65 /
\end{lstlisting}
The array {\ct SPEC\_ID\_NU} contains the list of tracked species participating in the reaction as a product or reactant. Note that a primitive species with {\ct LUMPED\_COMPONENT\_ONLY=T} cannot be used in a reaction since it is not tracked separately. The array {\ct SPEC\_ID\_N\_S} contains the list of species with the exponents, {\ct N\_S}, in Eq.~(\ref{eq:finite_rate}). This array must contain only primitive species, i.e., no species mixtures. The array of stoichiometric coefficients, {\ct NU}, can be taken directly from Eq.~(\ref{eq:propane_1step}).
The array {\ct SPEC\_ID\_NU} contains the list of tracked species participating in the reaction as a product or reactant. Note that a primitive species with {\ct LUMPED\_COMPONENT\_ONLY=T} cannot be used in a reaction since it is not tracked separately. The array {\ct SPEC\_ID\_N\_S} contains the list of species with the exponents, {\ct N\_S}, in Eq.~(\ref{eq:finite_rate}). This array must contain only primitive species, i.e., no species mixtures. The array of stoichiometric coefficients, {\ct NU}, can be taken directly from Eq.~(\ref{eq:propane_1step}). If any of {\ct SPEC\_ID\_NU} is a lumped species and a reactant (this would include product species when {\ct REVERSE=T}), then {\ct SPEC\_ID\_N\_S} and {\ct N\_S} must be defined to identify which specific species inside the lumped species are reactants.

\subsection{Multiple Step Reaction}

Expand Down Expand Up @@ -14030,7 +14030,13 @@ \chapter{Error Codes}
562 \> {\ct VENT ID \ldots used for localized leakage has SURF\_ID HVAC. } \> Section~\ref{info:local_leakage} \\
563 \> {\ct VENT ID \ldots used for localized leakage has a DEVC\_ID or CTRL\_ID. } \> Section~\ref{info:local_leakage} \\
564 \> {\ct VENT: \ldots is used for HVAC and attached to a removable OBST. } \> Section~\ref{info:HVACnode} \\
\> \> \\
565 \> {\ct REAC: \ldots FALLOFF-LINDEMANN reactions must have A\_LOW\_PR and } \> Section~\ref{info:falloff_reactions} \\
\> {\ct E\_LOW\_PR } \\
566 \> {\ct REAC: \ldots FALLOFF-TROE reactions must have A\_LOW\_PR, E\_LOW\_PR, } \> Section~\ref{info:falloff_reactions} \\
\> {\ct A\_TROE, T1\_TROE, and T3\_TROE. } \\
567 \> {\ct REAC: \ldots Tracked species \ldots used in a finite rate reaction } \> Section~\ref{info:finite} \\
\> {\ct without N\_S defined is not a primitive species. } \\
\> \> \\
601 \> {\ct OBST \ldots\ MULT\_ID \ldots\ not found. } \> Section~\ref{info:MULT} \\
602 \> {\ct OBST \ldots\ SHAPE requires RADIUS. } \> Section~\ref{info:multobst} \\
603 \> {\ct OBST \ldots\ SHAPE requires HEIGHT. } \> Section~\ref{info:multobst} \\
Expand Down
72 changes: 37 additions & 35 deletions Source/read.f90
Original file line number Diff line number Diff line change
Expand Up @@ -4644,7 +4644,7 @@ SUBROUTINE READ_REAC
RN%A_LOW_PR = A_LOW_PR
RN%E_LOW_PR = E_LOW_PR*1000._EB ! Convert from J/mol to J/kmol
IF (A_LOW_PR < 0._EB .OR. E_LOW_PR < -1.E20_EB) THEN
WRITE(MESSAGE,'(A,I0,A)') 'ERROR(XXX): REAC ',NR,' FALLOFF-LINDEMANN reactions must have A_LOW_PR amd E_LOW_PR.'
WRITE(MESSAGE,'(A,I0,A)') 'ERROR(565): REAC ',NR,' FALLOFF-LINDEMANN reactions must have A_LOW_PR amd E_LOW_PR.'
CALL SHUTDOWN(MESSAGE) ; RETURN
ENDIF
RN%N_T_LOW_PR = N_T_LOW_PR
Expand All @@ -4656,7 +4656,7 @@ SUBROUTINE READ_REAC
RN%N_T_LOW_PR = N_T_LOW_PR
IF (A_LOW_PR < 0._EB .OR. E_LOW_PR < -1.E20_EB .OR. A_TROE < -1.E20_EB .OR. &
T1_TROE < -1.E20_EB .OR. T3_TROE < -1.E20_EB) THEN
WRITE(MESSAGE,'(A,I0,A)') 'ERROR(XXX): REAC ',NR,&
WRITE(MESSAGE,'(A,I0,A)') 'ERROR(566): REAC ',NR,&
' FALLOFF-TROE reactions must have A_LOW_PR, E_LOW_PR, A_TROE, T1_TROE, and T3_TROE.'
CALL SHUTDOWN(MESSAGE) ; RETURN
ENDIF
Expand Down Expand Up @@ -5095,42 +5095,44 @@ SUBROUTINE PROC_REAC_1
CALL SHUTDOWN(MESSAGE) ; RETURN
ENDIF

NU_Y = 0._EB
IF (RN%N_SPEC_READ > 0) THEN
DO NS=1,RN%N_SPEC_READ
IF (TRIM(RN%SPEC_ID_N_S_READ(NS))=='null') CYCLE
NAME_FOUND = .FALSE.
DO NS2=1,N_SPECIES
IF (TRIM(RN%SPEC_ID_N_S_READ(NS))==TRIM(SPECIES(NS2)%ID) .OR. &
TRIM(RN%SPEC_ID_N_S_READ(NS))==TRIM(SPECIES(NS2)%ALT_ID)) THEN
NU_Y(NS2) = RN%N_S_READ(NS)
NAME_FOUND = .TRUE.
EXIT
IF (.NOT. RN%SIMPLE_CHEMISTRY) THEN
NU_Y = 0._EB
IF (RN%N_SPEC_READ > 0) THEN
DO NS=1,RN%N_SPEC_READ
IF (TRIM(RN%SPEC_ID_N_S_READ(NS))=='null') CYCLE
NAME_FOUND = .FALSE.
DO NS2=1,N_SPECIES
IF (TRIM(RN%SPEC_ID_N_S_READ(NS))==TRIM(SPECIES(NS2)%ID) .OR. &
TRIM(RN%SPEC_ID_N_S_READ(NS))==TRIM(SPECIES(NS2)%ALT_ID)) THEN
NU_Y(NS2) = RN%N_S_READ(NS)
NAME_FOUND = .TRUE.
EXIT
ENDIF
ENDDO
IF (.NOT. NAME_FOUND) THEN
WRITE(MESSAGE,'(A,I0,A,A,A)') &
'ERROR(204): REAC ',NR,'. Primitive species ',TRIM(RN%SPEC_ID_N_S_READ(NS)),' not found.'
CALL SHUTDOWN(MESSAGE) ; RETURN
ENDIF
ENDDO
IF (.NOT. NAME_FOUND) THEN
WRITE(MESSAGE,'(A,I0,A,A,A)') &
'ERROR(204): REAC ',NR,'. Primitive species ',TRIM(RN%SPEC_ID_N_S_READ(NS)),' not found.'
CALL SHUTDOWN(MESSAGE) ; RETURN
ENDIF
ENDDO
ELSE
DO NS=1,RN%N_SMIX
IF (TRIM(RN%SPEC_ID_NU_READ(NS))=='null') CYCLE
DO NS2=1,N_TRACKED_SPECIES
IF (TRIM(RN%SPEC_ID_NU_READ(NS))==TRIM(SPECIES_MIXTURE(NS2)%ID) .OR. &
TRIM(RN%SPEC_ID_NU_READ(NS))==TRIM(SPECIES_MIXTURE(NS2)%ALT_ID)) THEN
!IF (SPECIES_MIXTURE(NS2)%SINGLE_SPEC_INDEX < 0) THEN
! WRITE(MESSAGE,'(A,I0,A,A,A)') 'ERROR(XXX): REAC ',NR,'. Tracked species ',TRIM(RN%SPEC_ID_NU_READ(NS)),&
! ' used in a finite rate reaction without N_S defined is not a primitive species.'
! CALL SHUTDOWN(MESSAGE) ; RETURN
!ENDIF
IF (RN%NU_READ(NS)<0._EB .AND. SPECIES_MIXTURE(NS2)%SINGLE_SPEC_INDEX > 0) &
NU_Y(SPECIES_MIXTURE(NS2)%SINGLE_SPEC_INDEX) = -RN%NU_READ(NS)
EXIT
ENDIF
ELSE
DO NS=1,RN%N_SMIX
IF (TRIM(RN%SPEC_ID_NU_READ(NS))=='null') CYCLE
DO NS2=1,N_TRACKED_SPECIES
IF (TRIM(RN%SPEC_ID_NU_READ(NS))==TRIM(SPECIES_MIXTURE(NS2)%ID) .OR. &
TRIM(RN%SPEC_ID_NU_READ(NS))==TRIM(SPECIES_MIXTURE(NS2)%ALT_ID)) THEN
IF (SPECIES_MIXTURE(NS2)%SINGLE_SPEC_INDEX < 0 .AND. (RN%NU_READ(NS) < 0._EB .OR. RN%REVERSE)) THEN
WRITE(MESSAGE,'(A,I0,A,A,A)') 'ERROR(567): REAC ',NR,'. Tracked species ',TRIM(RN%SPEC_ID_NU_READ(NS)),&
' used in a finite rate reaction without N_S defined is not a primitive species.'
CALL SHUTDOWN(MESSAGE) ; RETURN
ENDIF
IF (RN%NU_READ(NS)<0._EB .AND. SPECIES_MIXTURE(NS2)%SINGLE_SPEC_INDEX > 0) &
NU_Y(SPECIES_MIXTURE(NS2)%SINGLE_SPEC_INDEX) = -RN%NU_READ(NS)
EXIT
ENDIF
ENDDO
ENDDO
ENDDO
ENDIF
ENDIF

RN%N_SPEC=0
Expand Down

0 comments on commit a3c47d7

Please sign in to comment.