Skip to content

Commit

Permalink
FDS Source: Issue firemodels#13361. Add PYROLYSIS_MODEL to ONE_D
Browse files Browse the repository at this point in the history
  • Loading branch information
mcgratta committed Aug 28, 2024
1 parent 115fc27 commit 46c5505
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 12 deletions.
6 changes: 3 additions & 3 deletions Source/dump.f90
Original file line number Diff line number Diff line change
Expand Up @@ -8451,7 +8451,7 @@ REAL(EB) FUNCTION SOLID_PHASE_OUTPUT(INDX,Y_INDEX,Z_INDEX,PART_INDEX,OPT_WALL_IN
I_DEPTH = OPT_NODE_INDEX
ELSE
I_DEPTH = DV%I_DEPTH
IF (SF%PYROLYSIS_MODEL==PYROLYSIS_PREDICTED) THEN
IF (ONE_D%PYROLYSIS_MODEL==PYROLYSIS_PREDICTED) THEN
IF (DV%DEPTH > TWO_EPSILON_EB) THEN
DEPTH = DV%DEPTH
ELSE
Expand Down Expand Up @@ -9045,7 +9045,7 @@ REAL(EB) FUNCTION SOLID_PHASE_OUTPUT(INDX,Y_INDEX,Z_INDEX,PART_INDEX,OPT_WALL_IN
CASE(69) ! WALL ENTHALPY
SOLID_PHASE_OUTPUT = 0._EB
IF (SF%THERMAL_BC_INDEX==THERMALLY_THICK) THEN
IF (SF%PYROLYSIS_MODEL==PYROLYSIS_PREDICTED .OR. SF%HT_DIM>1) THEN
IF (ONE_D%PYROLYSIS_MODEL==PYROLYSIS_PREDICTED .OR. SF%HT_DIM>1) THEN
NWP = SUM(ONE_D%N_LAYER_CELLS(1:ONE_D%N_LAYERS))
X0 = SUM(ONE_D%LAYER_THICKNESS)
ELSE
Expand Down Expand Up @@ -9616,7 +9616,7 @@ SUBROUTINE DUMP_PROF(T,NM)
! Determine the number of wall points (NWP) and wall node weights (DX_WGT_S)

SF => SURFACE(SURF_INDEX)
IF (SF%PYROLYSIS_MODEL==PYROLYSIS_PREDICTED .OR. SF%HT_DIM>1 .OR. SF%VARIABLE_THICKNESS) THEN
IF (ONE_D%PYROLYSIS_MODEL==PYROLYSIS_PREDICTED .OR. SF%HT_DIM>1 .OR. SF%VARIABLE_THICKNESS) THEN
NWP = SUM(ONE_D%N_LAYER_CELLS)
IF (NWP==0) CYCLE PROF_LOOP
CALL GET_WALL_NODE_WEIGHTS(NWP,ONE_D%N_LAYERS,ONE_D%N_LAYER_CELLS,ONE_D%LAYER_THICKNESS,SF%GEOMETRY, &
Expand Down
2 changes: 2 additions & 0 deletions Source/func.f90
Original file line number Diff line number Diff line change
Expand Up @@ -1776,6 +1776,7 @@ SUBROUTINE PACK_BOUNDARY_ONE_D(NM,IC,RC,LC,OS,OD_INDEX,UNPACK_IT,COUNT_ONLY)
IC=IC+1 ; IF (.NOT.COUNT_ONLY) CALL EQUATE(OS%INTEGERS(IC),ONE_D%BACK_INDEX,UNPACK_IT)
IC=IC+1 ; IF (.NOT.COUNT_ONLY) CALL EQUATE(OS%INTEGERS(IC),ONE_D%BACK_MESH,UNPACK_IT)
IC=IC+1 ; IF (.NOT.COUNT_ONLY) CALL EQUATE(OS%INTEGERS(IC),ONE_D%BACK_SURF,UNPACK_IT)
IC=IC+1 ; IF (.NOT.COUNT_ONLY) CALL EQUATE(OS%INTEGERS(IC),ONE_D%PYROLYSIS_MODEL,UNPACK_IT)

! Check if the array bounds are appropriate

Expand Down Expand Up @@ -1939,6 +1940,7 @@ SUBROUTINE INITIALIZE_BOUNDARY_ONE_D(NM,OD_INDEX,SURF_INDEX)
ENDDO
ONE_D%BACK_MESH = NM
ONE_D%BACK_SURF = SURF_INDEX
ONE_D%PYROLYSIS_MODEL = SF%PYROLYSIS_MODEL

END SUBROUTINE INITIALIZE_BOUNDARY_ONE_D

Expand Down
1 change: 1 addition & 0 deletions Source/init.f90
Original file line number Diff line number Diff line change
Expand Up @@ -4065,6 +4065,7 @@ SUBROUTINE FIND_WALL_BACK_INDEX(NM,IW)
DO NN=1,ONE_D%N_MATL
ALLOCATE(ONE_D%MATL_COMP(NN)%MASS_FRACTION(ONE_D%N_LAYERS))
ONE_D%MATL_INDEX(NN) = MATL_INDEX(NN)
IF (MATERIAL(ONE_D%MATL_INDEX(NN))%PYROLYSIS_MODEL/=PYROLYSIS_NONE) ONE_D%PYROLYSIS_MODEL = PYROLYSIS_PREDICTED
DO NL=1,ONE_D%N_LAYERS
ONE_D%MATL_COMP(NN)%MASS_FRACTION(NL) = MATL_MASS_FRACTION(NL,NN)
ENDDO
Expand Down
1 change: 1 addition & 0 deletions Source/type.f90
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,7 @@ MODULE TYPES
INTEGER :: BACK_INDEX=0 !< WALL index of back side of obstruction or exterior wall cell
INTEGER :: BACK_MESH=0 !< Mesh number on back side of obstruction or exterior wall cell
INTEGER :: BACK_SURF=0 !< SURF_INDEX on back side of obstruction or exterior wall cell
INTEGER :: PYROLYSIS_MODEL=0 !< Indicator of a pyrolysis model used in depth

LOGICAL, ALLOCATABLE, DIMENSION(:) :: HT3D_LAYER !< (1:ONE_D\%N_LAYERS) Indicator that layer in 3D

Expand Down
18 changes: 9 additions & 9 deletions Source/wall.f90
Original file line number Diff line number Diff line change
Expand Up @@ -1947,7 +1947,7 @@ SUBROUTINE SOLID_HEAT_TRANSFER(NM,T,DT_BC,PARTICLE_INDEX,WALL_INDEX,CFACE_INDEX,
IF (SF%INTERNAL_RADIATION) Q_RAD_OUT_OLD = B1%Q_RAD_OUT
B1%Q_RAD_OUT = 0._EB

IF (SF%PYROLYSIS_MODEL==PYROLYSIS_PREDICTED) THEN
IF (ONE_D%PYROLYSIS_MODEL==PYROLYSIS_PREDICTED) THEN

IF (ALLOCATED(RHO_DOT)) DEALLOCATE(RHO_DOT)
ALLOCATE(RHO_DOT(ONE_D%N_MATL,NWP_MAX))
Expand Down Expand Up @@ -2002,7 +2002,7 @@ SUBROUTINE SOLID_HEAT_TRANSFER(NM,T,DT_BC,PARTICLE_INDEX,WALL_INDEX,CFACE_INDEX,

LAYER_DIVIDE = SF%LAYER_DIVIDE

COMPUTE_GRID: IF (SF%PYROLYSIS_MODEL==PYROLYSIS_PREDICTED .OR. SF%HT_DIM>1 .OR. SF%VARIABLE_THICKNESS) THEN
COMPUTE_GRID: IF (ONE_D%PYROLYSIS_MODEL==PYROLYSIS_PREDICTED .OR. SF%HT_DIM>1 .OR. SF%VARIABLE_THICKNESS) THEN
NWP = SUM(ONE_D%N_LAYER_CELLS(1:ONE_D%N_LAYERS))
CALL GET_WALL_NODE_WEIGHTS(NWP,ONE_D%N_LAYERS,ONE_D%N_LAYER_CELLS(1:ONE_D%N_LAYERS),ONE_D%LAYER_THICKNESS,SF%GEOMETRY, &
ONE_D%X(0:NWP),LAYER_DIVIDE,DX_S(1:NWP),RDX_S(0:NWP+1),RDXN_S(0:NWP),DX_WGT_S(0:NWP),DXF,DXB,&
Expand Down Expand Up @@ -2150,11 +2150,11 @@ SUBROUTINE SOLID_HEAT_TRANSFER(NM,T,DT_BC,PARTICLE_INDEX,WALL_INDEX,CFACE_INDEX,

Q_S = 0._EB

PYROLYSIS_PREDICTED_IF: IF (SF%PYROLYSIS_MODEL==PYROLYSIS_PREDICTED) THEN
PYROLYSIS_PREDICTED_IF: IF (ONE_D%PYROLYSIS_MODEL==PYROLYSIS_PREDICTED) THEN

CALL PERFORM_PYROLYSIS

ELSEIF (SF%PYROLYSIS_MODEL==PYROLYSIS_SPECIFIED) THEN PYROLYSIS_PREDICTED_IF
ELSEIF (ONE_D%PYROLYSIS_MODEL==PYROLYSIS_SPECIFIED) THEN PYROLYSIS_PREDICTED_IF

! Take off energy corresponding to specified burning rate
!***** Figure out what to do for adjust if different spec have different HOC
Expand Down Expand Up @@ -2251,7 +2251,7 @@ SUBROUTINE SOLID_HEAT_TRANSFER(NM,T,DT_BC,PARTICLE_INDEX,WALL_INDEX,CFACE_INDEX,
DT_BC_SUB_OLD = DT_BC_SUB
DT_BC_SUB = DT_BC/REAL(MIN(NINT(SF%TIME_STEP_FACTOR*WALL_INCREMENT),MAX(1,NINT(TMP_RATIO))),EB)
DT_BC_SUB = MIN( DT_BC-T_BC_SUB , DT_BC_SUB , DT_FO )
IF (SF%PYROLYSIS_MODEL==PYROLYSIS_PREDICTED .AND. DT_BC_SUB_OLD/=DT_BC_SUB) CALL PERFORM_PYROLYSIS
IF (ONE_D%PYROLYSIS_MODEL==PYROLYSIS_PREDICTED .AND. DT_BC_SUB_OLD/=DT_BC_SUB) CALL PERFORM_PYROLYSIS
ENDIF

T_BC_SUB = T_BC_SUB + DT_BC_SUB
Expand All @@ -2263,7 +2263,7 @@ SUBROUTINE SOLID_HEAT_TRANSFER(NM,T,DT_BC,PARTICLE_INDEX,WALL_INDEX,CFACE_INDEX,
B1%Q_RAD_OUT = B1%Q_RAD_OUT + Q_RAD_OUT*DT_BC_SUB/DT_BC
ENDIF

IF (SF%PYROLYSIS_MODEL==PYROLYSIS_PREDICTED .AND. .NOT.PRESENT(THIN_WALL_INDEX)) THEN
IF (ONE_D%PYROLYSIS_MODEL==PYROLYSIS_PREDICTED .AND. .NOT.PRESENT(THIN_WALL_INDEX)) THEN
RDT = 1._EB/(DT_BC*REAL(SF%HT_DIM,EB))
IF (PRESENT(WALL_INDEX)) THEN
IF (OBSTRUCTION(OBST_INDEX)%THIN .AND. .NOT.CELL(CELL_INDEX(BC%II,BC%JJ,BC%KK))%SOLID) RDT = 1._EB/DT_BC
Expand All @@ -2279,7 +2279,7 @@ SUBROUTINE SOLID_HEAT_TRANSFER(NM,T,DT_BC,PARTICLE_INDEX,WALL_INDEX,CFACE_INDEX,

REMESH_LAYER = .FALSE.

PYROLYSIS_PREDICTED_IF_2: IF (SF%PYROLYSIS_MODEL==PYROLYSIS_PREDICTED) THEN
PYROLYSIS_PREDICTED_IF_2: IF (ONE_D%PYROLYSIS_MODEL==PYROLYSIS_PREDICTED) THEN

! Convert Q_S to kW
DO I=1,NWP
Expand Down Expand Up @@ -2801,14 +2801,14 @@ SUBROUTINE SOLID_HEAT_TRANSFER(NM,T,DT_BC,PARTICLE_INDEX,WALL_INDEX,CFACE_INDEX,

ENDDO SUB_TIMESTEP_LOOP

IF (ALLOCATED(B1%M_DOT_G_PP_ACTUAL) .AND. SF%PYROLYSIS_MODEL==PYROLYSIS_PREDICTED) THEN
IF (ALLOCATED(B1%M_DOT_G_PP_ACTUAL) .AND. ONE_D%PYROLYSIS_MODEL==PYROLYSIS_PREDICTED) THEN
B1%M_DOT_G_PP_ADJUST = M_DOT_G_PP_ADJUST_NET
B1%M_DOT_G_PP_ACTUAL = M_DOT_G_PP_ACTUAL_NET
B1%Q_DOT_G_PP = Q_DOT_G_PP_NET
B1%Q_DOT_O2_PP = Q_DOT_O2_PP_NET
ONE_D%M_DOT_S_PP(1:ONE_D%N_MATL) = M_DOT_S_PP_NET(1:ONE_D%N_MATL)
ENDIF
IF (ALLOCATED(RHO_DOT) .AND. SF%PYROLYSIS_MODEL==PYROLYSIS_PREDICTED) DEALLOCATE(RHO_DOT)
IF (ALLOCATED(RHO_DOT) .AND. ONE_D%PYROLYSIS_MODEL==PYROLYSIS_PREDICTED) DEALLOCATE(RHO_DOT)

B1%Q_CON_F = B1%Q_CON_F / DT_BC
IF (RADIATION .AND. .NOT. SF%INTERNAL_RADIATION) B1%Q_RAD_OUT = B1%Q_RAD_OUT / DT_BC * SIGMA * B1%EMISSIVITY
Expand Down

0 comments on commit 46c5505

Please sign in to comment.