Skip to content

Commit

Permalink
FDS Source: Add layer arrays to ONE_D
Browse files Browse the repository at this point in the history
  • Loading branch information
mcgratta committed Jan 6, 2024
1 parent 1eb6995 commit 72743be
Show file tree
Hide file tree
Showing 5 changed files with 121 additions and 110 deletions.
97 changes: 50 additions & 47 deletions Source/func.f90
Original file line number Diff line number Diff line change
Expand Up @@ -1711,7 +1711,7 @@ SUBROUTINE PACK_BOUNDARY_ONE_D(NM,IC,RC,OS,OD_INDEX,UNPACK_IT,COUNT_ONLY)
INTEGER, INTENT(IN) :: NM,OD_INDEX
INTEGER, INTENT(INOUT) :: IC,RC
LOGICAL, INTENT(IN) :: UNPACK_IT,COUNT_ONLY
INTEGER :: I1,I2,NN
INTEGER :: I1,NN,NL
TYPE(BOUNDARY_ONE_D_TYPE), POINTER :: ONE_D
TYPE(STORAGE_TYPE), POINTER :: OS

Expand All @@ -1733,68 +1733,61 @@ SUBROUTINE PACK_BOUNDARY_ONE_D(NM,IC,RC,OS,OD_INDEX,UNPACK_IT,COUNT_ONLY)

IF (UNPACK_IT .AND. CHECK_BOUNDARY_ONE_D_ARRAYS) CALL REALLOCATE_BOUNDARY_ONE_D(ONE_D)

I2 = IC

I1 = I2+1 ; I2 = I1 + ONE_D%N_LAYERS - 1
IF (.NOT.COUNT_ONLY) CALL EQUATE(OS%INTEGERS(I1:I2) , ONE_D%N_LAYER_CELLS(1:I2-I1+1) , UNPACK_IT)

IC = I2 ! Update Integer Counter

I2 = RC ! I1 and I2 continue counting reals

I1 = I2+1 ; I2 = I1 + ONE_D%N_MATL - 1
IF (.NOT.COUNT_ONLY) CALL EQUATE(OS%REALS(I1:I2) , ONE_D%M_DOT_S_PP(1:I2-I1+1) , UNPACK_IT)

I1 = I2+1 ; I2 = I1 + ONE_D%N_CELLS_MAX
IF (.NOT.COUNT_ONLY) CALL EQUATE(OS%REALS(I1:I2) , ONE_D%X(0:I2-I1) , UNPACK_IT)

I1 = I2+1 ; I2 = I1 + ONE_D%N_CELLS_MAX + 1
IF (.NOT.COUNT_ONLY) CALL EQUATE(OS%REALS(I1:I2) , ONE_D%TMP(0:I2-I1) , UNPACK_IT)
DO NL=1,ONE_D%N_LAYERS
IC=IC+1 ; IF (.NOT.COUNT_ONLY) CALL EQUATE(OS%INTEGERS(IC) , ONE_D%N_LAYER_CELLS(NL) , UNPACK_IT)
IC=IC+1 ; IF (.NOT.COUNT_ONLY) CALL EQUATE(OS%INTEGERS(IC) , ONE_D%N_LAYER_CELLS_MAX(NL) , UNPACK_IT)
ENDDO

I1 = I2+1 ; I2 = I1 + ONE_D%N_CELLS_MAX + 1
IF (.NOT.COUNT_ONLY) CALL EQUATE(OS%REALS(I1:I2) , ONE_D%DELTA_TMP(0:I2-I1) , UNPACK_IT)
I1 = RC+1 ; RC = I1 + ONE_D%N_MATL - 1
IF (.NOT.COUNT_ONLY) CALL EQUATE(OS%REALS(I1:RC) , ONE_D%M_DOT_S_PP(1:RC-I1+1) , UNPACK_IT)

I1 = I2+1 ; I2 = I1 + ONE_D%N_LAYERS - 1
IF (.NOT.COUNT_ONLY) CALL EQUATE(OS%REALS(I1:I2) , ONE_D%LAYER_THICKNESS(1:I2-I1+1) , UNPACK_IT)
I1 = RC+1 ; RC = I1 + ONE_D%N_CELLS_MAX
IF (.NOT.COUNT_ONLY) CALL EQUATE(OS%REALS(I1:RC) , ONE_D%X(0:RC-I1) , UNPACK_IT)

I1 = I2+1 ; I2 = I1 + ONE_D%N_LAYERS - 1
IF (.NOT.COUNT_ONLY) CALL EQUATE(OS%REALS(I1:I2) , ONE_D%MIN_DIFFUSIVITY(1:I2-I1+1) , UNPACK_IT)
I1 = RC+1 ; RC = I1 + ONE_D%N_CELLS_MAX + 1
IF (.NOT.COUNT_ONLY) CALL EQUATE(OS%REALS(I1:RC) , ONE_D%TMP(0:RC-I1) , UNPACK_IT)

I1 = I2+1 ; I2 = I1 + ONE_D%N_CELLS_MAX - 1
IF (.NOT.COUNT_ONLY) CALL EQUATE(OS%REALS(I1:I2) , ONE_D%RHO_C_S(1:I2-I1+1) , UNPACK_IT)
I1 = RC+1 ; RC = I1 + ONE_D%N_CELLS_MAX + 1
IF (.NOT.COUNT_ONLY) CALL EQUATE(OS%REALS(I1:RC) , ONE_D%DELTA_TMP(0:RC-I1) , UNPACK_IT)

I1 = I2+1 ; I2 = I1 + ONE_D%N_CELLS_MAX + 1
IF (.NOT.COUNT_ONLY) CALL EQUATE(OS%REALS(I1:I2) , ONE_D%K_S(0:I2-I1) , UNPACK_IT)
DO NL=1,ONE_D%N_LAYERS
RC=RC+1 ; IF (.NOT.COUNT_ONLY) CALL EQUATE(OS%REALS(RC) , ONE_D%LAYER_THICKNESS(NL) , UNPACK_IT)
RC=RC+1 ; IF (.NOT.COUNT_ONLY) CALL EQUATE(OS%REALS(RC) , ONE_D%MIN_DIFFUSIVITY(NL) , UNPACK_IT)
RC=RC+1 ; IF (.NOT.COUNT_ONLY) CALL EQUATE(OS%REALS(RC) , ONE_D%DDSUM(NL) , UNPACK_IT)
RC=RC+1 ; IF (.NOT.COUNT_ONLY) CALL EQUATE(OS%REALS(RC) , ONE_D%SMALLEST_CELL_SIZE(NL) , UNPACK_IT)
RC=RC+1 ; IF (.NOT.COUNT_ONLY) CALL EQUATE(OS%REALS(RC) , ONE_D%STRETCH_FACTOR(NL) , UNPACK_IT)
RC=RC+1 ; IF (.NOT.COUNT_ONLY) CALL EQUATE(OS%REALS(RC) , ONE_D%HEAT_SOURCE(NL) , UNPACK_IT)
RC=RC+1 ; IF (.NOT.COUNT_ONLY) CALL EQUATE(OS%REALS(RC) , ONE_D%CELL_SIZE_FACTOR(NL) , UNPACK_IT)
RC=RC+1 ; IF (.NOT.COUNT_ONLY) CALL EQUATE(OS%REALS(RC) , ONE_D%CELL_SIZE(NL) , UNPACK_IT)
ENDDO

I1 = I2+1 ; I2 = I1 + ONE_D%N_LAYERS - 1
IF (.NOT.COUNT_ONLY) CALL EQUATE(OS%REALS(I1:I2) , ONE_D%DDSUM(1:I2-I1+1) , UNPACK_IT)
I1 = RC+1 ; RC = I1 + ONE_D%N_CELLS_MAX - 1
IF (.NOT.COUNT_ONLY) CALL EQUATE(OS%REALS(I1:RC) , ONE_D%RHO_C_S(1:RC-I1+1) , UNPACK_IT)

I1 = I2+1 ; I2 = I1 + ONE_D%N_LAYERS - 1
IF (.NOT.COUNT_ONLY) CALL EQUATE(OS%REALS(I1:I2) , ONE_D%SMALLEST_CELL_SIZE(1:I2-I1+1) , UNPACK_IT)
I1 = RC+1 ; RC = I1 + ONE_D%N_CELLS_MAX + 1
IF (.NOT.COUNT_ONLY) CALL EQUATE(OS%REALS(I1:RC) , ONE_D%K_S(0:RC-I1) , UNPACK_IT)

I1 = I2+1 ; I2 = I1 + ONE_D%N_LPC - 1
IF (.NOT.COUNT_ONLY) CALL EQUATE(OS%REALS(I1:I2) , ONE_D%PART_MASS(1:I2-I1+1) , UNPACK_IT)
I1 = RC+1 ; RC = I1 + ONE_D%N_LPC - 1
IF (.NOT.COUNT_ONLY) CALL EQUATE(OS%REALS(I1:RC) , ONE_D%PART_MASS(1:RC-I1+1) , UNPACK_IT)

I1 = I2+1 ; I2 = I1 + ONE_D%N_LPC - 1
IF (.NOT.COUNT_ONLY) CALL EQUATE(OS%REALS(I1:I2) , ONE_D%PART_ENTHALPY(1:I2-I1+1) , UNPACK_IT)
I1 = RC+1 ; RC = I1 + ONE_D%N_LPC - 1
IF (.NOT.COUNT_ONLY) CALL EQUATE(OS%REALS(I1:RC) , ONE_D%PART_ENTHALPY(1:RC-I1+1) , UNPACK_IT)

DO NN=1,ONE_D%N_MATL
I1 = I2+1 ; I2 = I1 + ONE_D%N_LAYERS - 1
IF (.NOT.COUNT_ONLY) CALL EQUATE(OS%REALS(I1:I2) , ONE_D%MATL_COMP(NN)%MASS_FRACTION(1:I2-I1+1) , UNPACK_IT)
I1 = RC+1 ; RC = I1 + ONE_D%N_LAYERS - 1
IF (.NOT.COUNT_ONLY) CALL EQUATE(OS%REALS(I1:RC) , ONE_D%MATL_COMP(NN)%MASS_FRACTION(1:RC-I1+1) , UNPACK_IT)
ENDDO

DO NN=1,ONE_D%N_MATL
I1 = I2+1 ; I2 = I1 + (ONE_D%N_CELLS_MAX+2) - 1
IF (.NOT.COUNT_ONLY) CALL EQUATE(OS%REALS(I1:I2) , ONE_D%MATL_COMP(NN)%RHO(0:I2-I1) , UNPACK_IT)
I1 = RC+1 ; RC = I1 + (ONE_D%N_CELLS_MAX+2) - 1
IF (.NOT.COUNT_ONLY) CALL EQUATE(OS%REALS(I1:RC) , ONE_D%MATL_COMP(NN)%RHO(0:RC-I1) , UNPACK_IT)
ENDDO

DO NN=1,ONE_D%N_MATL
I1 = I2+1 ; I2 = I1 + (ONE_D%N_CELLS_MAX+2) - 1
IF (.NOT.COUNT_ONLY) CALL EQUATE(OS%REALS(I1:I2) , ONE_D%MATL_COMP(NN)%RHO_DOT(0:I2-I1) , UNPACK_IT)
I1 = RC+1 ; RC = I1 + (ONE_D%N_CELLS_MAX+2) - 1
IF (.NOT.COUNT_ONLY) CALL EQUATE(OS%REALS(I1:RC) , ONE_D%MATL_COMP(NN)%RHO_DOT(0:RC-I1) , UNPACK_IT)
ENDDO

RC = I2

END SUBROUTINE PACK_BOUNDARY_ONE_D


Expand All @@ -1804,6 +1797,7 @@ SUBROUTINE REALLOCATE_BOUNDARY_ONE_D(ONE_D)
INTEGER :: NN

IF (ALLOCATED(ONE_D%N_LAYER_CELLS)) DEALLOCATE(ONE_D%N_LAYER_CELLS) ; ALLOCATE(ONE_D%N_LAYER_CELLS(ONE_D%N_LAYERS))
IF (ALLOCATED(ONE_D%N_LAYER_CELLS_MAX)) DEALLOCATE(ONE_D%N_LAYER_CELLS_MAX) ; ALLOCATE(ONE_D%N_LAYER_CELLS_MAX(ONE_D%N_LAYERS))
IF (ALLOCATED(ONE_D%MATL_INDEX)) DEALLOCATE(ONE_D%MATL_INDEX) ; ALLOCATE(ONE_D%MATL_INDEX(ONE_D%N_MATL))

IF (ALLOCATED(ONE_D%M_DOT_S_PP)) DEALLOCATE(ONE_D%M_DOT_S_PP) ; ALLOCATE(ONE_D%M_DOT_S_PP(ONE_D%N_MATL))
Expand All @@ -1819,6 +1813,10 @@ SUBROUTINE REALLOCATE_BOUNDARY_ONE_D(ONE_D)
IF (ALLOCATED(ONE_D%PART_MASS)) DEALLOCATE(ONE_D%PART_MASS) ; ALLOCATE(ONE_D%PART_MASS(ONE_D%N_LPC))
IF (ALLOCATED(ONE_D%PART_ENTHALPY)) DEALLOCATE(ONE_D%PART_ENTHALPY) ; ALLOCATE(ONE_D%PART_ENTHALPY(ONE_D%N_LPC))
IF (ALLOCATED(ONE_D%MATL_COMP)) DEALLOCATE(ONE_D%MATL_COMP) ; ALLOCATE(ONE_D%MATL_COMP(ONE_D%N_MATL))
IF (ALLOCATED(ONE_D%STRETCH_FACTOR)) DEALLOCATE(ONE_D%STRETCH_FACTOR) ; ALLOCATE(ONE_D%STRETCH_FACTOR(ONE_D%N_LAYERS))
IF (ALLOCATED(ONE_D%HEAT_SOURCE)) DEALLOCATE(ONE_D%HEAT_SOURCE) ; ALLOCATE(ONE_D%HEAT_SOURCE(ONE_D%N_LAYERS))
IF (ALLOCATED(ONE_D%CELL_SIZE_FACTOR)) DEALLOCATE(ONE_D%CELL_SIZE_FACTOR) ; ALLOCATE(ONE_D%CELL_SIZE_FACTOR(ONE_D%N_LAYERS))
IF (ALLOCATED(ONE_D%CELL_SIZE)) DEALLOCATE(ONE_D%CELL_SIZE) ; ALLOCATE(ONE_D%CELL_SIZE(ONE_D%N_LAYERS))

DO NN=1,ONE_D%N_MATL
IF (ALLOCATED(ONE_D%MATL_COMP(NN)%MASS_FRACTION)) DEALLOCATE(ONE_D%MATL_COMP(NN)%MASS_FRACTION)
Expand All @@ -1844,6 +1842,7 @@ SUBROUTINE INITIALIZE_BOUNDARY_ONE_D(NM,OD_INDEX,SURF_INDEX)
SF => SURFACE(SURF_INDEX)

ONE_D%N_LAYER_CELLS(1:ONE_D%N_LAYERS) = SF%N_LAYER_CELLS(1:SF%N_LAYERS)
ONE_D%N_LAYER_CELLS_MAX(1:ONE_D%N_LAYERS) = SF%N_LAYER_CELLS_MAX(1:SF%N_LAYERS)
IF (ALLOCATED(ONE_D%MATL_INDEX) .AND. ALLOCATED(SF%MATL_INDEX)) ONE_D%MATL_INDEX(1:ONE_D%N_MATL) = SF%MATL_INDEX(1:SF%N_MATL)
ONE_D%M_DOT_S_PP = 0._EB
ONE_D%X=0._EB ; ONE_D%X(0:ONE_D%N_CELLS_INI) = SF%X_S(0:ONE_D%N_CELLS_INI)
Expand Down Expand Up @@ -1874,6 +1873,10 @@ SUBROUTINE INITIALIZE_BOUNDARY_ONE_D(NM,OD_INDEX,SURF_INDEX)
ONE_D%DELTA_TMP = 0._EB
ONE_D%LAYER_THICKNESS(1:ONE_D%N_LAYERS) = SF%LAYER_THICKNESS(1:SF%N_LAYERS)
ONE_D%MIN_DIFFUSIVITY(1:ONE_D%N_LAYERS) = SF%MIN_DIFFUSIVITY(1:SF%N_LAYERS)
ONE_D%STRETCH_FACTOR(1:ONE_D%N_LAYERS) = SF%STRETCH_FACTOR(1:SF%N_LAYERS)
ONE_D%HEAT_SOURCE(1:ONE_D%N_LAYERS) = SF%HEAT_SOURCE(1:SF%N_LAYERS)
ONE_D%CELL_SIZE(1:ONE_D%N_LAYERS) = SF%CELL_SIZE(1:SF%N_LAYERS)
ONE_D%CELL_SIZE_FACTOR(1:ONE_D%N_LAYERS) = SF%CELL_SIZE_FACTOR(1:SF%N_LAYERS)
ONE_D%RHO_C_S = 1.E6_EB
ONE_D%K_S = 0._EB
ONE_D%DDSUM(1:SF%N_LAYERS) = SF%DDSUM(1:SF%N_LAYERS)
Expand Down Expand Up @@ -2676,7 +2679,7 @@ END SUBROUTINE ASSIGN_PRESSURE_ZONE
!> \brief Determine the number of 1-D cells in a layer of solid material
!> \param DIFFUSIVITY \f$ k/(\rho c) \; (\hbox{m}^2/\hbox{s}) \f$, used to determine cell size
!> \param LAYER_THICKNESS Thickness of the material layer (m)
!> \param STRETCH_FACTOR A real number indicating the amount to stretch the second and subsequent cells in the interior
!> \param STRETCH_FACTOR A real array indicating the amount to stretch the second and subsequent cells in the interior
!> \param CELL_SIZE_FACTOR A real number indicating how much to shrink the first cell at the surface
!> \param CELL_SIZE Width of a uniform cell. This makes STRETCH_FACTOR, CELL_SIZE_FACTOR moot.
!> \param N_LAYER_CELLS_MAX Maximum number of cells to assign to the layer
Expand Down Expand Up @@ -2739,7 +2742,7 @@ SUBROUTINE GET_WALL_NODE_COORDINATES(N_CELLS,N_CELLS_OLD,N_LAYERS,N_LAYER_CELLS,
STRETCH_FACTOR,REMESH_LAYER,X_S,X_S_OLD,LAYER_THICKNESS)

INTEGER, INTENT(IN) :: N_CELLS,N_CELLS_OLD,N_LAYERS, N_LAYER_CELLS(N_LAYERS),N_LAYER_CELLS_OLD(N_LAYERS)
REAL(EB), INTENT(IN) :: SMALLEST_CELL_SIZE(N_LAYERS),STRETCH_FACTOR,X_S_OLD(0:N_CELLS_OLD),LAYER_THICKNESS(1:N_LAYERS)
REAL(EB), INTENT(IN) :: SMALLEST_CELL_SIZE(N_LAYERS),STRETCH_FACTOR(N_LAYERS),X_S_OLD(0:N_CELLS_OLD),LAYER_THICKNESS(N_LAYERS)
REAL(EB), INTENT(OUT) :: X_S(0:N_CELLS)
LOGICAL, INTENT(IN) :: REMESH_LAYER(N_LAYERS)

Expand All @@ -2757,7 +2760,7 @@ SUBROUTINE GET_WALL_NODE_COORDINATES(N_CELLS,N_CELLS_OLD,N_LAYERS,N_LAYER_CELLS,
DO I=1,N_LAYER_CELLS(NL)-1
II = II + 1
IF (REMESH_LAYER(NL)) THEN
DX_S = SMALLEST_CELL_SIZE(NL)*STRETCH_FACTOR**(MIN(I-1,N_LAYER_CELLS(NL)-I))
DX_S = SMALLEST_CELL_SIZE(NL)*STRETCH_FACTOR(NL)**(MIN(I-1,N_LAYER_CELLS(NL)-I))
DX_SUM = DX_SUM + DX_S
ELSE
DX_S = X_S_OLD(I_START+I) - X_S_OLD(I_START+I-1)
Expand Down
46 changes: 28 additions & 18 deletions Source/init.f90
Original file line number Diff line number Diff line change
Expand Up @@ -1595,7 +1595,6 @@ SUBROUTINE REALLOCATE_ONE_D_ARRAYS(NM,WALL_CELL,THIN_WALL_CELL)
INTEGER, INTENT(IN) :: NM
INTEGER, INTENT(IN), OPTIONAL :: WALL_CELL,THIN_WALL_CELL
INTEGER :: NL,N_CELLS_MAX,II,NWP,N,I,ITMP,NN
REAL(EB) :: CELL_SIZE,STRETCH_FACTOR
INTEGER, ALLOCATABLE, DIMENSION(:) :: LAYER_INDEX
INTEGER, ALLOCATABLE, DIMENSION(:) :: N_LAYER_CELLS_OLD
REAL(EB), DIMENSION(MAX_LAYERS) :: LAYER_DENSITY
Expand All @@ -1622,22 +1621,13 @@ SUBROUTINE REALLOCATE_ONE_D_ARRAYS(NM,WALL_CELL,THIN_WALL_CELL)
ONE_D => M%BOUNDARY_ONE_D(WC%OD_INDEX)
BC => M%BOUNDARY_COORD(WC%BC_INDEX)
OB => M%OBSTRUCTION(WC%OBST_INDEX)
CELL_SIZE = SF%CELL_SIZE
STRETCH_FACTOR = SF%STRETCH_FACTOR
ELSEIF (PRESENT(THIN_WALL_CELL)) THEN
TW => M%THIN_WALL(THIN_WALL_CELL)
SF => SURFACE(TW%SURF_INDEX)
IF (SF%HT_DIM==1) RETURN
ONE_D => M%BOUNDARY_ONE_D(TW%OD_INDEX)
BC => M%BOUNDARY_COORD(TW%BC_INDEX)
OB => M%OBSTRUCTION(TW%OBST_INDEX)
IF (SF%CELL_SIZE<0._EB) THEN
CELL_SIZE = M%CELL_SIZE
STRETCH_FACTOR = 1._EB
ELSE
CELL_SIZE = SF%CELL_SIZE
STRETCH_FACTOR = SF%STRETCH_FACTOR
ENDIF
ENDIF

! This code is probably unnecessary. It is only in case the thickness of the solid has not been determined.
Expand Down Expand Up @@ -1677,16 +1667,16 @@ SUBROUTINE REALLOCATE_ONE_D_ARRAYS(NM,WALL_CELL,THIN_WALL_CELL)

! Get the new N_CELLS_MAX for this wall cell

CALL GET_N_LAYER_CELLS(ONE_D%MIN_DIFFUSIVITY(NL),SF%SWELL_RATIO*ONE_D%LAYER_THICKNESS(NL),STRETCH_FACTOR, &
SF%CELL_SIZE_FACTOR,CELL_SIZE,SF%N_LAYER_CELLS_MAX,N_CELLS_MAX,&
CALL GET_N_LAYER_CELLS(ONE_D%MIN_DIFFUSIVITY(NL),SF%SWELL_RATIO*ONE_D%LAYER_THICKNESS(NL),ONE_D%STRETCH_FACTOR(NL), &
ONE_D%CELL_SIZE_FACTOR(NL),ONE_D%CELL_SIZE(NL),ONE_D%N_LAYER_CELLS_MAX(NL),N_CELLS_MAX,&
ONE_D%SMALLEST_CELL_SIZE(NL),ONE_D%DDSUM(NL))

ONE_D%N_CELLS_MAX = ONE_D%N_CELLS_MAX + N_CELLS_MAX

! Get the new N_CELLS_INI for this wall cell

CALL GET_N_LAYER_CELLS(ONE_D%MIN_DIFFUSIVITY(NL),ONE_D%LAYER_THICKNESS(NL),STRETCH_FACTOR, &
SF%CELL_SIZE_FACTOR,CELL_SIZE,SF%N_LAYER_CELLS_MAX,ONE_D%N_LAYER_CELLS(NL),&
CALL GET_N_LAYER_CELLS(ONE_D%MIN_DIFFUSIVITY(NL),ONE_D%LAYER_THICKNESS(NL),ONE_D%STRETCH_FACTOR(NL), &
ONE_D%CELL_SIZE_FACTOR(NL),ONE_D%CELL_SIZE(NL),ONE_D%N_LAYER_CELLS_MAX(NL),ONE_D%N_LAYER_CELLS(NL),&
ONE_D%SMALLEST_CELL_SIZE(NL),ONE_D%DDSUM(NL))

ONE_D%N_CELLS_INI = ONE_D%N_CELLS_INI + ONE_D%N_LAYER_CELLS(NL)
Expand Down Expand Up @@ -1724,7 +1714,7 @@ SUBROUTINE REALLOCATE_ONE_D_ARRAYS(NM,WALL_CELL,THIN_WALL_CELL)
ALLOCATE(REMESH_LAYER(ONE_D%N_LAYERS)) ; REMESH_LAYER=.TRUE.
CALL GET_WALL_NODE_COORDINATES(ONE_D%N_CELLS_INI,1,ONE_D%N_LAYERS,ONE_D%N_LAYER_CELLS, &
N_LAYER_CELLS_OLD,ONE_D%SMALLEST_CELL_SIZE, &
STRETCH_FACTOR,REMESH_LAYER,ONE_D%X,X_S_OLD,ONE_D%LAYER_THICKNESS(1:ONE_D%N_LAYERS))
ONE_D%STRETCH_FACTOR,REMESH_LAYER,ONE_D%X,X_S_OLD,ONE_D%LAYER_THICKNESS(1:ONE_D%N_LAYERS))
DEALLOCATE(X_S_OLD)
DEALLOCATE(REMESH_LAYER)

Expand Down Expand Up @@ -3816,7 +3806,7 @@ SUBROUTINE FIND_WALL_BACK_INDEX(NM,IW)
LAYER_THICKNESS(N_LAYERS) = 0._EB
ENDIF
ENDIF

IF (OBST_INDEX>0) THEN
DO NN=1,N_MATLS
DO NNN=1,MAX_MATERIALS
Expand Down Expand Up @@ -3949,8 +3939,8 @@ SUBROUTINE FIND_WALL_BACK_INDEX(NM,IW)
IF (SF%VARIABLE_THICKNESS .OR. SF%HT_DIM>1) THEN
ONE_D%N_LAYERS = N_LAYERS
ONE_D%N_MATL = N_MATLS
DEALLOCATE(ONE_D%MATL_COMP) ; ALLOCATE(ONE_D%MATL_COMP(ONE_D%N_MATL))
DEALLOCATE(ONE_D%MATL_INDEX) ; ALLOCATE(ONE_D%MATL_INDEX(ONE_D%N_MATL))
DEALLOCATE(ONE_D%MATL_COMP) ; ALLOCATE(ONE_D%MATL_COMP(ONE_D%N_MATL))
DEALLOCATE(ONE_D%MATL_INDEX) ; ALLOCATE(ONE_D%MATL_INDEX(ONE_D%N_MATL))
DEALLOCATE(ONE_D%LAYER_THICKNESS) ; ALLOCATE(ONE_D%LAYER_THICKNESS(ONE_D%N_LAYERS))
ONE_D%LAYER_THICKNESS(1:ONE_D%N_LAYERS) = LAYER_THICKNESS(1:ONE_D%N_LAYERS)
DO NN=1,ONE_D%N_MATL
Expand All @@ -3960,6 +3950,26 @@ SUBROUTINE FIND_WALL_BACK_INDEX(NM,IW)
ONE_D%MATL_COMP(NN)%MASS_FRACTION(NL) = MATL_MASS_FRACTION(NL,NN)
ENDDO
ENDDO
DEALLOCATE(ONE_D%HEAT_SOURCE) ; ALLOCATE(ONE_D%HEAT_SOURCE(ONE_D%N_LAYERS)) ; ONE_D%HEAT_SOURCE = 0._EB
DEALLOCATE(ONE_D%STRETCH_FACTOR) ; ALLOCATE(ONE_D%STRETCH_FACTOR(ONE_D%N_LAYERS)) ; ONE_D%STRETCH_FACTOR =2._EB
DEALLOCATE(ONE_D%CELL_SIZE) ; ALLOCATE(ONE_D%CELL_SIZE(ONE_D%N_LAYERS)) ; ONE_D%CELL_SIZE = -1._EB
DEALLOCATE(ONE_D%CELL_SIZE_FACTOR) ; ALLOCATE(ONE_D%CELL_SIZE_FACTOR(ONE_D%N_LAYERS)) ; ONE_D%CELL_SIZE_FACTOR = 1._EB
DEALLOCATE(ONE_D%N_LAYER_CELLS_MAX) ; ALLOCATE(ONE_D%N_LAYER_CELLS_MAX(ONE_D%N_LAYERS)) ; ONE_D%N_LAYER_CELLS_MAX = 999
ONE_D%HEAT_SOURCE(1:SF%N_LAYERS) = SF%HEAT_SOURCE(1:SF%N_LAYERS)
ONE_D%STRETCH_FACTOR(1:SF%N_LAYERS) = SF%STRETCH_FACTOR(1:SF%N_LAYERS)
ONE_D%CELL_SIZE(1:SF%N_LAYERS) = SF%CELL_SIZE(1:SF%N_LAYERS)
ONE_D%CELL_SIZE_FACTOR(1:SF%N_LAYERS) = SF%CELL_SIZE_FACTOR(1:SF%N_LAYERS)
ONE_D%N_LAYER_CELLS_MAX(1:SF%N_LAYERS) = SF%N_LAYER_CELLS_MAX(1:SF%N_LAYERS)
IF (ONE_D%N_LAYERS>SF%N_LAYERS) THEN
SF_BACK => SURFACE(ONE_D%BACK_SURF)
DO NL=1,SF_BACK%N_LAYERS
ONE_D%HEAT_SOURCE(ONE_D%N_LAYERS-NL+1) = SF_BACK%HEAT_SOURCE(NL)
ONE_D%STRETCH_FACTOR(ONE_D%N_LAYERS-NL+1) = SF_BACK%STRETCH_FACTOR(NL)
ONE_D%CELL_SIZE(ONE_D%N_LAYERS-NL+1) = SF_BACK%CELL_SIZE(NL)
ONE_D%CELL_SIZE_FACTOR(ONE_D%N_LAYERS-NL+1) = SF_BACK%CELL_SIZE_FACTOR(NL)
ONE_D%N_LAYER_CELLS_MAX(ONE_D%N_LAYERS-NL+1) = SF_BACK%N_LAYER_CELLS_MAX(NL)
ENDDO
ENDIF
ENDIF

END SUBROUTINE FIND_WALL_BACK_INDEX
Expand Down
Loading

0 comments on commit 72743be

Please sign in to comment.