Skip to content

Commit

Permalink
FDS Source: Move some variables out of WALL
Browse files Browse the repository at this point in the history
  • Loading branch information
mcgratta committed Sep 25, 2023
1 parent 04365fd commit 4900705
Show file tree
Hide file tree
Showing 5 changed files with 55 additions and 39 deletions.
9 changes: 6 additions & 3 deletions Source/ccib.f90
Original file line number Diff line number Diff line change
Expand Up @@ -1673,6 +1673,7 @@ SUBROUTINE GET_FH_FROM_PRHS_AND_BCS(NM,DT,CYL_FCT,UNKH,NUNKH,IPZ,F_H)
! Local variables:
INTEGER :: I,J,K,IROW,IW,IIG,JJG,KKG,IOR,ICFACE,IFACE,JFACE,ILH,JLH,KLH,IRC
TYPE (WALL_TYPE), POINTER :: WC=>NULL()
TYPE (EXTERNAL_WALL_TYPE), POINTER :: EWC=>NULL()
TYPE(CFACE_TYPE), POINTER :: CFA=>NULL()
REAL(EB) :: IDX, AF, VAL, BCV

Expand Down Expand Up @@ -1708,9 +1709,10 @@ SUBROUTINE GET_FH_FROM_PRHS_AND_BCS(NM,DT,CYL_FCT,UNKH,NUNKH,IPZ,F_H)
IFACE= CFA%CUT_FACE_IND1
JFACE= CFA%CUT_FACE_IND2
WC => WALL(CUT_FACE(IFACE)%IWC)
EWC => EXTERNAL_WALL(CUT_FACE(IFACE)%IWC)

! DIRICHLET boundaries:
IF_CFACE_DIRICHLET: IF (WC%PRESSURE_BC_INDEX==DIRICHLET) THEN
IF_CFACE_DIRICHLET: IF (EWC%PRESSURE_BC_TYPE==DIRICHLET) THEN

! Gasphase cell indexes:
BC => BOUNDARY_COORD(WC%BC_INDEX); IF(ZONE_SOLVE(PRESSURE_ZONE(BC%IIG,BC%JJG,BC%KKG))%CONNECTED_ZONE_PARENT/=IPZ) CYCLE
Expand Down Expand Up @@ -1747,14 +1749,15 @@ SUBROUTINE GET_FH_FROM_PRHS_AND_BCS(NM,DT,CYL_FCT,UNKH,NUNKH,IPZ,F_H)
WALL_CELL_LOOP_1: DO IW=1,N_EXTERNAL_WALL_CELLS

WC => WALL(IW)
EWC => EXTERNAL_WALL(IW)
! Drop if this is a cut-face or NULL Boundary. Dealt with external CFACE.
IF (WC%CUT_FACE_INDEX>0 .OR. WC%BOUNDARY_TYPE==NULL_BOUNDARY) CYCLE
! Gasphase cell indexes:
BC => BOUNDARY_COORD(WC%BC_INDEX); IF(ZONE_SOLVE(PRESSURE_ZONE(BC%IIG,BC%JJG,BC%KKG))%CONNECTED_ZONE_PARENT/=IPZ) CYCLE
IIG = BC%IIG; JJG = BC%JJG; KKG = BC%KKG; IOR = BC%IOR

! NEUMANN boundaries:
IF_NEUMANN: IF (WC%PRESSURE_BC_INDEX==NEUMANN) THEN
IF_NEUMANN: IF (EWC%PRESSURE_BC_TYPE==NEUMANN) THEN
! Define cell size, normal to WC:
SELECT CASE (IOR)
CASE(-1) ! -IAXIS oriented, high face of IIG cell.
Expand Down Expand Up @@ -1790,7 +1793,7 @@ SUBROUTINE GET_FH_FROM_PRHS_AND_BCS(NM,DT,CYL_FCT,UNKH,NUNKH,IPZ,F_H)
ENDIF IF_NEUMANN

! DIRICHLET boundaries:
IF_DIRICHLET: IF (WC%PRESSURE_BC_INDEX==DIRICHLET) THEN
IF_DIRICHLET: IF (EWC%PRESSURE_BC_TYPE==DIRICHLET) THEN
! Global matrix solve, skip INTERPOLATED boundaries.
IF (PRES_FLAG/=ULMAT_FLAG .AND. WC%BOUNDARY_TYPE==INTERPOLATED_BOUNDARY) CYCLE
! Here case where SOLID and OPEN or interpolated are mixed on a boundary:
Expand Down
2 changes: 0 additions & 2 deletions Source/func.f90
Original file line number Diff line number Diff line change
Expand Up @@ -1580,9 +1580,7 @@ SUBROUTINE PACK_WALL(NM,OS,WC,SURF_INDEX,RC,IC,LC,UNPACK_IT,COUNT_ONLY)
IC=IC+1 ; IF (.NOT.COUNT_ONLY) CALL EQUATE(OS%INTEGERS(IC),WC%BACK_MESH,UNPACK_IT)
IC=IC+1 ; IF (.NOT.COUNT_ONLY) CALL EQUATE(OS%INTEGERS(IC),WC%BACK_SURF,UNPACK_IT)
IC=IC+1 ; IF (.NOT.COUNT_ONLY) CALL EQUATE(OS%INTEGERS(IC),WC%BOUNDARY_TYPE,UNPACK_IT)
IC=IC+1 ; IF (.NOT.COUNT_ONLY) CALL EQUATE(OS%INTEGERS(IC),WC%SURF_INDEX_ORIG,UNPACK_IT)
IC=IC+1 ; IF (.NOT.COUNT_ONLY) CALL EQUATE(OS%INTEGERS(IC),WC%OBST_INDEX,UNPACK_IT)
IC=IC+1 ; IF (.NOT.COUNT_ONLY) CALL EQUATE(OS%INTEGERS(IC),WC%PRESSURE_BC_INDEX,UNPACK_IT)
IC=IC+1 ; IF (.NOT.COUNT_ONLY) CALL EQUATE(OS%INTEGERS(IC),WC%VENT_INDEX,UNPACK_IT)
IC=IC+1 ; IF (.NOT.COUNT_ONLY) CALL EQUATE(OS%INTEGERS(IC),WC%JD11_INDEX,UNPACK_IT)
IC=IC+1 ; IF (.NOT.COUNT_ONLY) CALL EQUATE(OS%INTEGERS(IC),WC%JD12_INDEX,UNPACK_IT)
Expand Down
45 changes: 25 additions & 20 deletions Source/init.f90
Original file line number Diff line number Diff line change
Expand Up @@ -2296,6 +2296,7 @@ SUBROUTINE INITIALIZE_POISSON_SOLVER(NM)
INTEGER, POINTER, DIMENSION(:) :: NOC
TYPE (VENTS_TYPE), POINTER :: VT
TYPE (WALL_TYPE), POINTER :: WC
TYPE (EXTERNAL_WALL_TYPE), POINTER :: EWC
TYPE (MESH_TYPE), POINTER :: M
TYPE (BOUNDARY_COORD_TYPE), POINTER :: BC

Expand Down Expand Up @@ -2570,31 +2571,32 @@ SUBROUTINE INITIALIZE_POISSON_SOLVER(NM)

WALL_CELL_LOOP: DO IW=1,M%N_EXTERNAL_WALL_CELLS
WC => M%WALL(IW)
EWC => M%EXTERNAL_WALL(IW)
BC => M%BOUNDARY_COORD(WC%BC_INDEX)
IOR = BC%IOR
SELECT CASE(IOR)
CASE( 1)
IF (LBC==FISHPAK_BC_NEUMANN_NEUMANN .OR. &
LBC==FISHPAK_BC_NEUMANN_DIRICHLET .OR. LBC==6) WC%PRESSURE_BC_INDEX = NEUMANN
LBC==FISHPAK_BC_NEUMANN_DIRICHLET .OR. LBC==6) EWC%PRESSURE_BC_TYPE = NEUMANN
IF (LBC==FISHPAK_BC_DIRICHLET_DIRICHLET .OR. &
LBC==FISHPAK_BC_DIRICHLET_NEUMANN .OR. LBC==5) WC%PRESSURE_BC_INDEX = DIRICHLET
LBC==FISHPAK_BC_DIRICHLET_NEUMANN .OR. LBC==5) EWC%PRESSURE_BC_TYPE = DIRICHLET
CASE(-1)
IF (LBC==FISHPAK_BC_DIRICHLET_NEUMANN .OR. &
LBC==FISHPAK_BC_NEUMANN_NEUMANN .OR. LBC==6) WC%PRESSURE_BC_INDEX = NEUMANN
LBC==FISHPAK_BC_NEUMANN_NEUMANN .OR. LBC==6) EWC%PRESSURE_BC_TYPE = NEUMANN
IF (LBC==FISHPAK_BC_DIRICHLET_DIRICHLET .OR. &
LBC==FISHPAK_BC_NEUMANN_DIRICHLET .OR. LBC==5) WC%PRESSURE_BC_INDEX = DIRICHLET
LBC==FISHPAK_BC_NEUMANN_DIRICHLET .OR. LBC==5) EWC%PRESSURE_BC_TYPE = DIRICHLET
CASE( 2)
IF (MBC==FISHPAK_BC_NEUMANN_NEUMANN .OR. MBC==FISHPAK_BC_NEUMANN_DIRICHLET) WC%PRESSURE_BC_INDEX = NEUMANN
IF (MBC==FISHPAK_BC_DIRICHLET_DIRICHLET .OR. MBC==FISHPAK_BC_DIRICHLET_NEUMANN) WC%PRESSURE_BC_INDEX = DIRICHLET
IF (MBC==FISHPAK_BC_NEUMANN_NEUMANN .OR. MBC==FISHPAK_BC_NEUMANN_DIRICHLET) EWC%PRESSURE_BC_TYPE = NEUMANN
IF (MBC==FISHPAK_BC_DIRICHLET_DIRICHLET .OR. MBC==FISHPAK_BC_DIRICHLET_NEUMANN) EWC%PRESSURE_BC_TYPE = DIRICHLET
CASE(-2)
IF (MBC==FISHPAK_BC_NEUMANN_NEUMANN .OR. MBC==FISHPAK_BC_DIRICHLET_NEUMANN) WC%PRESSURE_BC_INDEX = NEUMANN
IF (MBC==FISHPAK_BC_DIRICHLET_DIRICHLET .OR. MBC==FISHPAK_BC_NEUMANN_DIRICHLET) WC%PRESSURE_BC_INDEX = DIRICHLET
IF (MBC==FISHPAK_BC_NEUMANN_NEUMANN .OR. MBC==FISHPAK_BC_DIRICHLET_NEUMANN) EWC%PRESSURE_BC_TYPE = NEUMANN
IF (MBC==FISHPAK_BC_DIRICHLET_DIRICHLET .OR. MBC==FISHPAK_BC_NEUMANN_DIRICHLET) EWC%PRESSURE_BC_TYPE = DIRICHLET
CASE( 3)
IF (NBC==FISHPAK_BC_NEUMANN_NEUMANN .OR. NBC==FISHPAK_BC_NEUMANN_DIRICHLET) WC%PRESSURE_BC_INDEX = NEUMANN
IF (NBC==FISHPAK_BC_DIRICHLET_DIRICHLET .OR. NBC==FISHPAK_BC_DIRICHLET_NEUMANN) WC%PRESSURE_BC_INDEX = DIRICHLET
IF (NBC==FISHPAK_BC_NEUMANN_NEUMANN .OR. NBC==FISHPAK_BC_NEUMANN_DIRICHLET) EWC%PRESSURE_BC_TYPE = NEUMANN
IF (NBC==FISHPAK_BC_DIRICHLET_DIRICHLET .OR. NBC==FISHPAK_BC_DIRICHLET_NEUMANN) EWC%PRESSURE_BC_TYPE = DIRICHLET
CASE(-3)
IF (NBC==FISHPAK_BC_NEUMANN_NEUMANN .OR. NBC==FISHPAK_BC_DIRICHLET_NEUMANN) WC%PRESSURE_BC_INDEX = NEUMANN
IF (NBC==FISHPAK_BC_DIRICHLET_DIRICHLET .OR. NBC==FISHPAK_BC_NEUMANN_DIRICHLET) WC%PRESSURE_BC_INDEX = DIRICHLET
IF (NBC==FISHPAK_BC_NEUMANN_NEUMANN .OR. NBC==FISHPAK_BC_DIRICHLET_NEUMANN) EWC%PRESSURE_BC_TYPE = NEUMANN
IF (NBC==FISHPAK_BC_DIRICHLET_DIRICHLET .OR. NBC==FISHPAK_BC_NEUMANN_DIRICHLET) EWC%PRESSURE_BC_TYPE = DIRICHLET
END SELECT
ENDDO WALL_CELL_LOOP

Expand Down Expand Up @@ -3543,7 +3545,7 @@ SUBROUTINE INIT_WALL_CELL(NM,I,J,K,OBST_INDEX,IW,IOR,SURF_INDEX,IERR,TT)

! Record original boundary condition index for exterior wall cells that might get covered up

IF (OBST_INDEX==0) WC%SURF_INDEX_ORIG = SURF_INDEX_NEW
IF (OBST_INDEX==0 .AND. IW<=M%N_EXTERNAL_WALL_CELLS) EWC%SURF_INDEX_ORIG = SURF_INDEX_NEW

END SUBROUTINE INIT_WALL_CELL

Expand Down Expand Up @@ -4555,30 +4557,32 @@ SUBROUTINE REASSIGN_WALL_CELLS(T,NM)

SUBROUTINE GET_BOUNDARY_TYPE

INTEGER :: IOR,IIG,JJG,KKG,IW_OLD,IERR,PRESSURE_BC_INDEX,ICG_OLD,II
INTEGER :: IOR,IIG,JJG,KKG,IW_OLD,IERR,PRESSURE_BC_TYPE,ICG_OLD,II
TYPE (BOUNDARY_PROP1_TYPE), POINTER :: B1,B1_OLD
TYPE (WALL_TYPE), POINTER :: WC_OLD
TYPE (EXTERNAL_WALL_TYPE), POINTER :: EWC
TYPE (STORAGE_TYPE), POINTER :: OS
TYPE (SURFACE_TYPE), POINTER :: SF

WC => MESHES(NM)%WALL(IW)
BC => MESHES(NM)%BOUNDARY_COORD(WC%BC_INDEX)

IF (IW<=N_EXTERNAL_WALL_CELLS .AND. REMOVE) THEN
EWC => MESHES(NM)%EXTERNAL_WALL(IW)
WC%BOUNDARY_TYPE = SOLID_BOUNDARY
CELL(IC)%SOLID = .TRUE.
IF (WC%SURF_INDEX_ORIG==MIRROR_SURF_INDEX) THEN
IF (EWC%SURF_INDEX_ORIG==MIRROR_SURF_INDEX) THEN
WC%BOUNDARY_TYPE = MIRROR_BOUNDARY
WC%SURF_INDEX = MIRROR_SURF_INDEX
CELL(IC)%SOLID = .TRUE.
RETURN
ENDIF
IF (WC%SURF_INDEX_ORIG==OPEN_SURF_INDEX) THEN
IF (EWC%SURF_INDEX_ORIG==OPEN_SURF_INDEX) THEN
WC%BOUNDARY_TYPE = OPEN_BOUNDARY
WC%SURF_INDEX = OPEN_SURF_INDEX
CELL(IC)%SOLID = .FALSE.
ENDIF
IF (WC%SURF_INDEX_ORIG==INTERPOLATED_SURF_INDEX) THEN
IF (EWC%SURF_INDEX_ORIG==INTERPOLATED_SURF_INDEX) THEN
WC%BOUNDARY_TYPE = INTERPOLATED_BOUNDARY
WC%SURF_INDEX = INTERPOLATED_SURF_INDEX
CELL(IC)%SOLID = .FALSE.
Expand Down Expand Up @@ -4607,7 +4611,9 @@ SUBROUTINE GET_BOUNDARY_TYPE
IF (WC%BOUNDARY_TYPE/=NULL_BOUNDARY) THEN
IF (IW<=N_EXTERNAL_WALL_CELLS) THEN
WC%OBST_INDEX = 0
WC%SURF_INDEX = WC%SURF_INDEX_ORIG
EWC => EXTERNAL_WALL(IW)
WC%SURF_INDEX = EWC%SURF_INDEX_ORIG
PRESSURE_BC_TYPE = EWC%PRESSURE_BC_TYPE ! Save this parameter and restore it after the call to INIT_WALL_CELL
ENDIF
IF (CELL(IC)%OBST_INDEX>0) THEN
WC%OBST_INDEX = CELL(IC)%OBST_INDEX
Expand All @@ -4617,10 +4623,9 @@ SUBROUTINE GET_BOUNDARY_TYPE
WC%SURF_INDEX = OBSTRUCTION(WC%OBST_INDEX)%SURF_INDEX(BC%IOR)
ENDIF
IF (OBSTRUCTION(WC%OBST_INDEX)%SURF_INDEX_INTERIOR>0) WC%SURF_INDEX = OBSTRUCTION(WC%OBST_INDEX)%SURF_INDEX_INTERIOR
PRESSURE_BC_INDEX = WC%PRESSURE_BC_INDEX ! Save this parameter and restore it after the call to INIT_WALL_CELL
CALL INIT_WALL_CELL(NM,BC%II,BC%JJ,BC%KK,WC%OBST_INDEX,IW,BC%IOR,WC%SURF_INDEX,IERR,T)
WC => MESHES(NM)%WALL(IW)
WC%PRESSURE_BC_INDEX = PRESSURE_BC_INDEX
IF (IW<=N_EXTERNAL_WALL_CELLS) EWC%PRESSURE_BC_TYPE = PRESSURE_BC_TYPE
ENDIF

! Special case: A BURNed_AWAY obstruction exposes a surface that also burns, in which case the surface is to ignite immediately.
Expand Down
34 changes: 22 additions & 12 deletions Source/pres.f90
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ SUBROUTINE PRESSURE_SOLVER_COMPUTE_RHS(T,DT,NM)

! Apply pressure gradients at NEUMANN boundaries: dH/dn = -F_n - d(u_n)/dt

IF_NEUMANN: IF (WC%PRESSURE_BC_INDEX==NEUMANN) THEN
IF_NEUMANN: IF (EWC%PRESSURE_BC_TYPE==NEUMANN) THEN

SELECT CASE(IOR)
CASE( 1)
Expand All @@ -96,7 +96,7 @@ SUBROUTINE PRESSURE_SOLVER_COMPUTE_RHS(T,DT,NM)

! Apply pressures at DIRICHLET boundaries, depending on the specific type

IF_DIRICHLET: IF (WC%PRESSURE_BC_INDEX==DIRICHLET) THEN
IF_DIRICHLET: IF (EWC%PRESSURE_BC_TYPE==DIRICHLET) THEN

NOT_OPEN: IF (WC%BOUNDARY_TYPE/=OPEN_BOUNDARY .AND. WC%BOUNDARY_TYPE/=INTERPOLATED_BOUNDARY) THEN

Expand Down Expand Up @@ -1126,6 +1126,7 @@ SUBROUTINE ULMAT_SOLVER_SETUP(NM)
TYPE(ZONE_MESH_TYPE), POINTER :: ZM
TYPE (MESH_TYPE), POINTER :: M=>NULL()
TYPE (WALL_TYPE), POINTER :: WC=>NULL()
TYPE (EXTERNAL_WALL_TYPE), POINTER :: EWC=>NULL()
TYPE (BOUNDARY_COORD_TYPE), POINTER :: BC
INTEGER, PARAMETER :: NULL_BTYPE=0,DIRICHLET_BTYPE=1,NEUMANN_BTYPE=2,PERIODIC_BTYPE=3

Expand Down Expand Up @@ -1207,6 +1208,7 @@ SUBROUTINE ULMAT_SOLVER_SETUP(NM)
ZBTYPE_LAST=NULL_BTYPE
WALL_LOOP: DO IW=1,M%N_EXTERNAL_WALL_CELLS
WC=>M%WALL(IW)
EWC=>M%EXTERNAL_WALL(IW)
BC=>M%BOUNDARY_COORD(WC%BC_INDEX)
IOR = BC%IOR
WALL_BTYPE=NULL_BTYPE
Expand All @@ -1224,7 +1226,7 @@ SUBROUTINE ULMAT_SOLVER_SETUP(NM)

! Test for obstructions on an open boundary or mirror set to dirichlet
IF ( (WC%BOUNDARY_TYPE==SOLID_BOUNDARY .OR. WC%BOUNDARY_TYPE==MIRROR_BOUNDARY) &
.AND. WC%PRESSURE_BC_INDEX==DIRICHLET) THEN
.AND. EWC%PRESSURE_BC_TYPE==DIRICHLET) THEN
ZM%USE_FFT=.FALSE.
EXIT WALL_LOOP
ENDIF
Expand Down Expand Up @@ -1439,6 +1441,7 @@ SUBROUTINE ULMAT_SOLVE_ZONE(NM,IPZ)
REAL(EB):: SUM_FH(1:2),MEAN_FH,SUM_XH(1:2),MEAN_XH,DIV_FN_VOL,DIV_FN,IDX,AF,VAL,BCV
TYPE(ZONE_MESH_TYPE), POINTER :: ZM
TYPE (WALL_TYPE), POINTER :: WC
TYPE (EXTERNAL_WALL_TYPE), POINTER :: EWC
TYPE (CFACE_TYPE), POINTER :: CFA
TYPE (BOUNDARY_COORD_TYPE), POINTER :: BC
REAL(EB), POINTER, DIMENSION(:,:,:) :: HP=>NULL()
Expand Down Expand Up @@ -1498,9 +1501,10 @@ SUBROUTINE ULMAT_SOLVE_ZONE(NM,IPZ)
IFACE= CFA%CUT_FACE_IND1
JFACE= CFA%CUT_FACE_IND2
WC => WALL(CUT_FACE(IFACE)%IWC)
EWC => EXTERNAL_WALL(CUT_FACE(IFACE)%IWC)
BC => BOUNDARY_COORD(WC%BC_INDEX)
! DIRICHLET boundaries:
IF_CFACE_DIRICHLET: IF (WC%PRESSURE_BC_INDEX==DIRICHLET) THEN
IF_CFACE_DIRICHLET: IF (EWC%PRESSURE_BC_TYPE==DIRICHLET) THEN
! Gasphase cell indexes:
IIG = BC%IIG; JJG = BC%JJG; KKG = BC%KKG
IF(ZONE_MESH(PRESSURE_ZONE(IIG,JJG,KKG))%CONNECTED_ZONE_PARENT/=IPZ) CYCLE CFACE_LOOP
Expand Down Expand Up @@ -1534,14 +1538,15 @@ SUBROUTINE ULMAT_SOLVE_ZONE(NM,IPZ)
! Finally add External Wall cell BCs:
WALL_CELL_LOOP_1 : DO IW=1,N_EXTERNAL_WALL_CELLS
WC => WALL(IW)
EWC => EXTERNAL_WALL(IW)
! Drop if NULL or this is a cut-face. Dealt with external CFACE.
IF (WC%BOUNDARY_TYPE==NULL_BOUNDARY .OR. WC%CUT_FACE_INDEX>0) CYCLE WALL_CELL_LOOP_1
BC => BOUNDARY_COORD(WC%BC_INDEX)
! Gasphase cell indexes:
IIG = BC%IIG; JJG = BC%JJG; KKG = BC%KKG; IOR = BC%IOR
IF(ZONE_MESH(PRESSURE_ZONE(IIG,JJG,KKG))%CONNECTED_ZONE_PARENT/=IPZ) CYCLE WALL_CELL_LOOP_1
! NEUMANN boundaries:
IF_NEUMANN_1: IF (WC%PRESSURE_BC_INDEX==NEUMANN) THEN
IF_NEUMANN_1: IF (EWC%PRESSURE_BC_TYPE==NEUMANN) THEN

IROW = MUNKH(IIG,JJG,KKG)
IF(CC_IBM) THEN
Expand Down Expand Up @@ -1577,7 +1582,7 @@ SUBROUTINE ULMAT_SOLVE_ZONE(NM,IPZ)
ENDIF IF_NEUMANN_1

! DIRICHLET boundaries:
IF_DIRICHLET_1: IF (WC%PRESSURE_BC_INDEX==DIRICHLET) THEN
IF_DIRICHLET_1: IF (EWC%PRESSURE_BC_TYPE==DIRICHLET) THEN
! Here case where SOLID and OPEN or interpolated are mixed on a boundary:
IF( WC%BOUNDARY_TYPE==SOLID_BOUNDARY .OR. WC%BOUNDARY_TYPE==MIRROR_BOUNDARY) CYCLE WALL_CELL_LOOP_1
IROW = MUNKH(IIG,JJG,KKG)
Expand Down Expand Up @@ -1779,12 +1784,13 @@ SUBROUTINE ULMAT_SOLVE_ZONE(NM,IPZ)
! Fill external boundary conditions for Mesh, if necessary:
WALL_CELL_LOOP_2 : DO IW=1,N_EXTERNAL_WALL_CELLS
WC => WALL(IW)
EWC => EXTERNAL_WALL(IW)
BC => BOUNDARY_COORD(WC%BC_INDEX)
! Gasphase cell indexes:
IIG = BC%IIG; JJG = BC%JJG; KKG = BC%KKG; IOR = BC%IOR
IF(ZONE_MESH(PRESSURE_ZONE(IIG,JJG,KKG))%CONNECTED_ZONE_PARENT/=IPZ) CYCLE WALL_CELL_LOOP_2
IF (ZONE_MESH(PRESSURE_ZONE(IIG,JJG,KKG))%CONNECTED_ZONE_PARENT/=IPZ) CYCLE WALL_CELL_LOOP_2
! NEUMANN boundaries:
IF_NEUMANN_2 : IF (WC%PRESSURE_BC_INDEX==NEUMANN) THEN
IF_NEUMANN_2 : IF (EWC%PRESSURE_BC_TYPE==NEUMANN) THEN
I = BC%II; J = BC%JJ; K = BC%KK
! Define cell size, normal to WC:
SELECT CASE (IOR)
Expand All @@ -1804,7 +1810,7 @@ SUBROUTINE ULMAT_SOLVE_ZONE(NM,IPZ)
ENDIF IF_NEUMANN_2

! DIRICHLET boundaries:
IF_DIRICHLET_2 : IF (WC%PRESSURE_BC_INDEX==DIRICHLET) THEN
IF_DIRICHLET_2 : IF (EWC%PRESSURE_BC_TYPE==DIRICHLET) THEN
I = BC%II; J = BC%JJ; K = BC%KK
! Define cell size, normal to WC:
IF (WC%BOUNDARY_TYPE==SOLID_BOUNDARY .OR. WC%BOUNDARY_TYPE==MIRROR_BOUNDARY) THEN
Expand Down Expand Up @@ -2933,6 +2939,7 @@ SUBROUTINE GLMAT_SOLVER(T,DT)
#endif
INTEGER :: NM, IW, IIG, JJG, KKG, IOR, IROW, I, J, K, ICC
TYPE (WALL_TYPE), POINTER :: WC=>NULL()
TYPE (EXTERNAL_WALL_TYPE), POINTER :: EWC=>NULL()
TYPE (BOUNDARY_COORD_TYPE), POINTER :: BC
REAL(EB), POINTER, DIMENSION(:,:,:) :: HP
REAL(EB) :: SUM_FH(2), SUM_XH(2), MEAN_FH, MEAN_XH
Expand Down Expand Up @@ -3105,14 +3112,15 @@ SUBROUTINE GLMAT_SOLVER(T,DT)
! Fill external boundary conditions for Mesh, if necesary:
WALL_CELL_LOOP_2: DO IW=1,N_EXTERNAL_WALL_CELLS
WC => WALL(IW)
EWC => EXTERNAL_WALL(IW)
BC => BOUNDARY_COORD(WC%BC_INDEX)

IIG = BC%IIG; JJG = BC%JJG; KKG = BC%KKG
IF (ZONE_SOLVE(PRESSURE_ZONE(IIG,JJG,KKG))%CONNECTED_ZONE_PARENT/=IPZ) CYCLE
I = BC%II; J = BC%JJ; K = BC%KK; IOR = BC%IOR

! NEUMANN boundaries:
IF_NEUMANN2: IF (WC%PRESSURE_BC_INDEX==NEUMANN) THEN
IF_NEUMANN2: IF (EWC%PRESSURE_BC_TYPE==NEUMANN) THEN
! Define cell size, normal to WC:
SELECT CASE (IOR)
CASE(-1) ! -IAXIS oriented, high face of IIG cell.
Expand All @@ -3131,7 +3139,7 @@ SUBROUTINE GLMAT_SOLVER(T,DT)
ENDIF IF_NEUMANN2

! DIRICHLET boundaries:
IF_DIRICHLET2: IF (WC%PRESSURE_BC_INDEX==DIRICHLET) THEN
IF_DIRICHLET2: IF (EWC%PRESSURE_BC_TYPE==DIRICHLET) THEN
IF (WC%BOUNDARY_TYPE==INTERPOLATED_BOUNDARY .OR. &
WC%BOUNDARY_TYPE== NULL_BOUNDARY ) CYCLE ! No need for these, that's the whole point of a
! global solve.
Expand Down Expand Up @@ -3296,6 +3304,7 @@ SUBROUTINE CHECK_UNSUPPORTED_MESH(SUPPORTED_MESH)
LOGICAL, ALLOCATABLE, DIMENSION(:) :: COUNTED
INTEGER, ALLOCATABLE, DIMENSION(:) :: DIRI_SET,MESH_LIST
TYPE (WALL_TYPE), POINTER :: WC=>NULL()
TYPE (EXTERNAL_WALL_TYPE), POINTER :: EWC=>NULL()

INTEGER :: NOM,IW,NMLOC,NSETS,ISET,PIVOT,PIVOT_LOC,MESHES_LEFT,CTMSH_LO,CTMSH_HI

Expand Down Expand Up @@ -3447,7 +3456,8 @@ SUBROUTINE CHECK_UNSUPPORTED_MESH(SUPPORTED_MESH)
! OPEN_BOUNDARY condition.
DO IW=1,N_EXTERNAL_WALL_CELLS
WC => WALL(IW)
IF (WC%PRESSURE_BC_INDEX==DIRICHLET .AND. WC%BOUNDARY_TYPE==OPEN_BOUNDARY) DIRI_SET(ISET) = 1
EWC => EXTERNAL_WALL(IW)
IF (EWC%PRESSURE_BC_TYPE==DIRICHLET .AND. WC%BOUNDARY_TYPE==OPEN_BOUNDARY) DIRI_SET(ISET) = 1
ENDDO
ENDDO
ENDDO SETS_LOOP
Expand Down
4 changes: 2 additions & 2 deletions Source/type.f90
Original file line number Diff line number Diff line change
Expand Up @@ -395,9 +395,7 @@ MODULE TYPES
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 :: BOUNDARY_TYPE=0 !< Descriptor: SOLID, MIRROR, OPEN, INTERPOLATED, etc
INTEGER :: SURF_INDEX_ORIG=0 !< Original SURFace index for this cell
INTEGER :: OBST_INDEX=0 !< Index of the OBSTruction
INTEGER :: PRESSURE_BC_INDEX !< Poisson boundary condition, NEUMANN or DIRICHLET
INTEGER :: VENT_INDEX=0 !< Index of the VENT containing this cell
INTEGER :: JD11_INDEX=0
INTEGER :: JD12_INDEX=0
Expand All @@ -424,6 +422,8 @@ MODULE TYPES
INTEGER :: JJO_MAX !< Maximum J index of adjacent cell in other mesh
INTEGER :: KKO_MIN !< Minimum K index of adjacent cell in other mesh
INTEGER :: KKO_MAX !< Maximum K index of adjacent cell in other mesh
INTEGER :: PRESSURE_BC_TYPE !< Poisson boundary condition, NEUMANN or DIRICHLET
INTEGER :: SURF_INDEX_ORIG=0 !< Original SURFace index for this cell
REAL(EB) :: AREA_RATIO !< Ratio of face areas of adjoining cells
REAL(EB), ALLOCATABLE, DIMENSION(:) :: FVN !< Flux-limited \f$ \int \rho Y_\alpha u_n \f$
REAL(EB), ALLOCATABLE, DIMENSION(:) :: FVNS !< Estimated value of FVN at next time step
Expand Down

0 comments on commit 4900705

Please sign in to comment.