Skip to content

Commit 7f09aad

Browse files
authored
Merge pull request #13924 from drjfloyd/master
FDS Source: Fix double adjust issue in Issue #13234 by MPI exchange of VENT areas
2 parents 6c5dd0e + 4f8b6e8 commit 7f09aad

File tree

8 files changed

+186
-79
lines changed

8 files changed

+186
-79
lines changed

Manuals/FDS_User_Guide/FDS_User_Guide.tex

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1739,7 +1739,7 @@ \subsubsection{Circular Vents}
17391739
\begin{lstlisting}
17401740
&SURF ID='BURNER', MASS_FLUX(1)=0.02, SPEC_ID(1)='PROPANE', TAU_MF(1)=0.01 /
17411741
&VENT XB=-0.6,0.6,-0.6,0.6,0,0, XYZ=0,0,0, RADIUS=0.5, SURF_ID='BURNER',
1742-
SPREAD_RATE=0.05 /
1742+
SPREAD_RATE=0.05/
17431743
\end{lstlisting}
17441744
The \ct{XB} coordinates designate the orientation of the vent. In this case, the extent of the area specified by \ct{XB} is large enough to contain the entire circle. Note also in this example that the parameter \ct{SPREAD_RATE} causes the fire to spread outward at a rate of 0.05~m/s. The mass flux of propane through the vent is plotted in Fig.~\ref{circ_burn}. Notice that the mass flux increases following a ``t-squared'' profile. This is what is expected of a fire which spreads radially at a linear rate. In this case, the fire reaches the \ct{RADIUS} of the circle in 10~s, as expected. Note also that the parameter \ct{TAU_MF} indicates that the fuel should ramp up quickly once the flame front reaches a given grid cell. In other words, \ct{TAU_MF} controls the local ramp-up of fuel; the \ct{SPREAD_RATE} controls the global ramp-up. Following the ramp-up, the fuel flows at a rate equal to the area of the circle times the mass flux of fuel per unit area. Even if the circle is crudely resolved on a coarse grid, the fuel flow rate will be adjusted to produce the desired value governed by the circular vent.
17451745
\begin{figure}[h]
@@ -8700,9 +8700,9 @@ \subsection{Freezing the Output Value, Example Case: \ct{hrr_freeze}}
87008700
\subsection{Example Case: Heat Release Rate of a Spreading Fire}
87018701
\label{spreading_fire}
87028702

8703-
In this example, a fire spreads radially from a single point as directed by the parameters \ct{SPREAD_RATE} and \ct{XYZ} on a \ct{VENT} line. Usually, the user specifies the heat release rate per unit area (\ct{HRRPUA}) for each burning surface cell on the corresponding \ct{SURF} line, but in this case, a specific time \ct{RAMP} for the {\em total} heat release rate is specified. The following input lines show how the user-specified \ct{RAMP} called \ct{'HRR'} controls the total HRR of the growing fire. The key point is that the user-specified {\em total} HRR is divided by the area of burning surface, and this heat release rate per unit area is imposed on all burning cells. Regardless of the fact that the spreading fire reaches a barrier and is stopped from spreading radially, the user-specified \ct{RAMP} controls the HRR, as shown in Fig.~\ref{spreading_fire_hrr}.
8703+
In this example, a fire spreads radially from a single point as directed by the parameters \ct{SPREAD_RATE} and \ct{XYZ} on a \ct{VENT} line. Usually, the user specifies the heat release rate per unit area (\ct{HRRPUA}) for each burning surface cell on the corresponding \ct{SURF} line, but in this case, a specific time \ct{RAMP} for the {\em total} heat release rate is specified. The following input lines show how the user-specified \ct{RAMP} called \ct{'HRR'} controls the total HRR of the growing fire. The key point is that the user-specified {\em total} HRR is divided by the area of burning surface, and this heat release rate per unit area is imposed on all burning cells. Normally FDS will adjust a mass flux input (\ct{MASS_FLUX}, \ct{HRRPUA} ,etc.) input to account for any differences in the area of the \ct{VENT} as specified with \ct{XB} and the area is it is actually resolved on the grid. In this case we are using control functions to determine the heat release rate. In this case the control logic is directly computing the required flux based on the area as resolved so no additional correction is needed. When false, the \ct{AREA_ADJUST} flag prevents any additional adjustment. Regardless of the fact that the spreading fire reaches a barrier and is stopped from spreading radially, the user-specified \ct{RAMP} controls the HRR, as shown in Fig.~\ref{spreading_fire_hrr}.
87048704
\begin{lstlisting}
8705-
&VENT SURF_ID='FIRE', XB=1.0,7.0,1.0,7.0,0.0,0.0, XYZ=3.0,3.0,0.0, SPREAD_RATE=0.1 /
8705+
&VENT SURF_ID='FIRE', XB=1.0,7.0,1.0,7.0,0.0,0.0, XYZ=3.0,3.0,0.0, SPREAD_RATE=0.1, AREA_ADJUST=F /
87068706

87078707
&SURF ID='FIRE', HRRPUA=1., RAMP_Q='HRRPUA RAMP' /
87088708
&RAMP ID='HRRPUA RAMP', T=0, F=0, CTRL_ID_DEP='HRRPUA CTRL' /
@@ -13621,6 +13621,7 @@ \section{\texorpdfstring{{\tt VENT}}{VENT} (Vent Parameters)}
1362113621
\hline
1362213622
Keyword & Type & Description & Units & Default \\ \hline \hline
1362313623
\endhead
13624+
\ct{AREA_ADJUST} & Logical & Section~\ref{spreading_fire} & & \ct{F} \\ \hline
1362413625
\ct{COLOR } & Character & Section~\ref{info:colors} & & \\ \hline
1362513626
\ct{CTRL_ID } & Character & Section~\ref{info:activate_deactivate} & & \\ \hline
1362613627
\ct{DB } & Character & Section~\ref{info:VENT_Basics} & & \\ \hline

Source/cons.f90

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -378,7 +378,7 @@ MODULE GLOBAL_CONSTANTS
378378
TYPE (MPI_COMM), ALLOCATABLE, DIMENSION(:) :: MPI_COMM_CLOSE_NEIGHBORS !< MPI communicator for the a given mesh and its neighbors
379379
INTEGER, ALLOCATABLE, DIMENSION(:) :: MPI_COMM_NEIGHBORS_ROOT !< The rank of the given mesh within the MPI communicator
380380
INTEGER, ALLOCATABLE, DIMENSION(:) :: MPI_COMM_CLOSE_NEIGHBORS_ROOT !< The rank of the given mesh within the MPI communicator
381-
INTEGER, ALLOCATABLE, DIMENSION(:) :: COUNTS,DISPLS,COUNTS_10,DISPLS_10,COUNTS_20,DISPLS_20
381+
INTEGER, ALLOCATABLE, DIMENSION(:) :: COUNTS,DISPLS,COUNTS_10,DISPLS_10,COUNTS_20,DISPLS_20,COUNTS_VENT,DISPLS_VENT
382382

383383
! Time parameters
384384

@@ -753,6 +753,9 @@ MODULE GLOBAL_CONSTANTS
753753
REAL(EB), ALLOCATABLE, DIMENSION(:) :: EXTERNAL_RAMP
754754
LOGICAL, ALLOCATABLE, DIMENSION(:) :: EXTERNAL_CTRL
755755

756+
! VENT array
757+
REAL(EB), ALLOCATABLE, DIMENSION(:,:) :: VENT_TOTAL_AREA
758+
756759
END MODULE GLOBAL_CONSTANTS
757760

758761

Source/func.f90

Lines changed: 106 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -3248,65 +3248,122 @@ SUBROUTINE BLOCK_MESH_INTERSECTION_VOLUME(NM,X1,X2,Y1,Y2,Z1,Z2,VOLUME_ADJUST)
32483248
END SUBROUTINE BLOCK_MESH_INTERSECTION_VOLUME
32493249

32503250

3251-
!> \brief Estimate area of intersection of circle and rectangle
3251+
!> \brief Estimate area of intersection of circle and grid cell
32523252
!> \param X0 x-coordinate of the center of the circle (m)
32533253
!> \param Y0 y-coordinate of the center of the circle (m)
32543254
!> \param RAD Radius of the circle (m)
3255-
!> \param X1 Lower x-coordinate of the rectangle (m)
3256-
!> \param X2 Upper x-coordinate of the rectangle (m)
3257-
!> \param Y1 Lower y-coordinate of the rectangle (m)
3258-
!> \param Y2 Upper y-coordinate of the rectangle (m)
3255+
!> \param X1 Lower x-coordinate of the grid cell (m)
3256+
!> \param X2 Upper x-coordinate of the grid cell (m)
3257+
!> \param Y1 Lower y-coordinate of the grid cell (m)
3258+
!> \param Y2 Upper y-coordinate of the grid cell (m)
32593259

32603260
REAL(EB) FUNCTION CIRCLE_CELL_INTERSECTION_AREA(X0,Y0,RAD,X1,X2,Y1,Y2)
32613261

32623262
REAL(EB), INTENT(IN) :: X0,Y0,RAD,X1,X2,Y1,Y2
3263-
INTEGER :: NX,NY,II,JJ
3264-
REAL(EB) :: DELTA_AREA,XX,YY,CIRCLE_BBOX_AREA,RECT_BBOX_AREA,CX1,CY1,BBDX,BBDY
3263+
INTEGER :: FC
3264+
REAL(EB) :: XC,YC,XP1,XP2,YP1,YP2
3265+
REAL(EB) :: RC,R2,THETA
32653266

3266-
CIRCLE_BBOX_AREA = 4._EB*RAD*RAD
3267-
RECT_BBOX_AREA = (X2-X1)*(Y2-Y1)
3267+
R2 = RAD**2
3268+
FC = 0
32683269

3269-
CIRCLE_CELL_INTERSECTION_AREA = 0._EB
3270+
! No overlap
32703271

3271-
BBOX_IF: IF (RECT_BBOX_AREA<CIRCLE_BBOX_AREA) THEN ! more efficient to descretize the rectangle
3272-
! make area elements nominally square
3273-
IF ((X2-X1)<(Y2-Y1)) THEN
3274-
NX = 50
3275-
BBDX = (X2-X1)/REAL(NX,EB)
3276-
NY = NINT((Y2-Y1)/BBDX)
3277-
BBDY = (Y2-Y1)/REAL(NY,EB)
3278-
ELSE
3279-
NY = 50
3280-
BBDY = (Y2-Y1)/REAL(NY,EB)
3281-
NX = NINT((X2-X1)/BBDY)
3282-
BBDX = (X2-X1)/REAL(NX,EB)
3283-
ENDIF
3284-
DELTA_AREA = BBDX*BBDY
3285-
DO JJ=1,NY
3286-
DO II=1,NX
3287-
XX = X1 + BBDX*(II-0.5_EB)
3288-
YY = Y1 + BBDY*(JJ-0.5_EB)
3289-
IF ( ((XX-X0)**2+(YY-Y0)**2)<RAD**2 ) CIRCLE_CELL_INTERSECTION_AREA = CIRCLE_CELL_INTERSECTION_AREA + DELTA_AREA
3290-
ENDDO
3291-
ENDDO
3292-
ELSE BBOX_IF ! more efficient to descretize the circle
3293-
NX = 50
3294-
NY = 50
3295-
CX1 = X0-RAD
3296-
CY1 = Y0-RAD
3297-
BBDX = 2._EB*RAD/REAL(NX,EB)
3298-
BBDY = BBDX
3299-
DELTA_AREA = BBDX*BBDY
3300-
DO JJ=1,NY
3301-
DO II=1,NX
3302-
XX = CX1 + BBDX*(II-0.5_EB)
3303-
YY = CY1 + BBDY*(JJ-0.5_EB)
3304-
IF ( ((XX-X0)**2+(YY-Y0)**2)<RAD**2 .AND. &
3305-
XX>=X1 .AND. XX<=X2 .AND. &
3306-
YY>=Y1 .AND. YY<=Y2 ) CIRCLE_CELL_INTERSECTION_AREA = CIRCLE_CELL_INTERSECTION_AREA + DELTA_AREA
3307-
ENDDO
3308-
ENDDO
3309-
ENDIF BBOX_IF
3272+
IF ((X2 < X0-RAD) .OR. (X1 > X0+RAD) .OR. (Y2 < Y0-RAD) .OR. (Y1 > Y0+RAD)) THEN
3273+
CIRCLE_CELL_INTERSECTION_AREA = 0._EB
3274+
RETURN
3275+
ENDIF
3276+
3277+
! Count corners inside circle
3278+
RC = (X1-X0)**2+(Y1-Y0)**2
3279+
IF (RC <= R2) FC=IBSET(FC,0)
3280+
RC = (X1-X0)**2+(Y2-Y0)**2
3281+
IF (RC <= R2) FC=IBSET(FC,1)
3282+
RC = (X2-X0)**2+(Y2-Y0)**2
3283+
IF (RC <= R2) FC=IBSET(FC,2)
3284+
RC = (X2-X0)**2+(Y1-Y0)**2
3285+
IF (RC <= R2) FC=IBSET(FC,3)
3286+
3287+
SELECT CASE(FC)
3288+
! Grid cell surrounds the circle: area of circle
3289+
CASE (0)
3290+
CIRCLE_CELL_INTERSECTION_AREA = PI*R2
3291+
! One corner in the circle: chord + area of triangle
3292+
CASE(1,2,4,8)
3293+
SELECT CASE(FC)
3294+
CASE(1)
3295+
XC=X1
3296+
YC=Y1
3297+
YP1=SQRT(R2-(X1-X0)**2)+Y0
3298+
XP1=SQRT(R2-(Y1-Y0)**2)+X0
3299+
CASE(2)
3300+
XC=X1
3301+
YC=Y2
3302+
YP1=Y0-SQRT(R2-(X1-X0)**2)
3303+
XP1=SQRT(R2-(Y2-Y0)**2)+X0
3304+
CASE(4)
3305+
XC=X2
3306+
YC=Y2
3307+
YP1=Y0-SQRT(R2-(X2-X0)**2)
3308+
XP1=X0-SQRT(R2-(Y2-Y0)**2)
3309+
CASE(8)
3310+
XC=X2
3311+
YC=Y1
3312+
YP1=SQRT(R2-(X2-X0)**2)+Y0
3313+
XP1=X0-SQRT(R2-(Y1-Y0)**2)
3314+
END SELECT
3315+
THETA = 2._EB*ASIN(0.5_EB*SQRT((XC-XP1)**2+(YC-YP1)**2)/RAD)
3316+
CIRCLE_CELL_INTERSECTION_AREA = 0.5_EB*R2*(THETA-SIN(THETA)) + 0.5_EB*ABS(XC-XP1)*ABS(YC-YP1)
3317+
! Two corners in the circle: chord + trapezoid
3318+
CASE(3)
3319+
XP1=SQRT(R2-(Y1-Y0)**2)+X0
3320+
XP2=SQRT(R2-(Y2-Y0)**2)+X0
3321+
THETA = 2._EB*ASIN(0.5_EB*SQRT((XP1-XP2)**2+(Y2-Y1)**2)/RAD)
3322+
CIRCLE_CELL_INTERSECTION_AREA = 0.5_EB*R2*(THETA-SIN(THETA)) + 0.5_EB*(Y2-Y1)*(XP1+XP2-2._EB*X1)
3323+
CASE(6)
3324+
YP1=Y0-SQRT(R2-(X1-X0)**2)
3325+
YP2=Y0-SQRT(R2-(X2-X0)**2)
3326+
THETA = 2._EB*ASIN(0.5_EB*SQRT((X2-X1)**2+(YP2-YP1)**2)/RAD)
3327+
CIRCLE_CELL_INTERSECTION_AREA = 0.5_EB*R2*(THETA-SIN(THETA)) + 0.5_EB*(X2-X1)*(2._EB*Y2-YP1-YP2)
3328+
CASE(9)
3329+
YP1=SQRT(R2-(X1-X0)**2)+Y0
3330+
YP2=SQRT(R2-(X2-X0)**2)+Y0
3331+
THETA = 2._EB*ASIN(0.5_EB*SQRT((X2-X1)**2+(YP2-YP1)**2)/RAD)
3332+
CIRCLE_CELL_INTERSECTION_AREA = 0.5_EB*R2*(THETA-SIN(THETA)) + 0.5_EB*(X2-X1)*(YP1+YP2-2._EB*Y1)
3333+
CASE(12)
3334+
XP1=X0-SQRT(R2-(Y1-Y0)**2)
3335+
XP2=X0-SQRT(R2-(Y2-Y0)**2)
3336+
THETA = 2._EB*ASIN(0.5_EB*SQRT((XP1-XP2)**2+(Y2-Y1)**2)/RAD)
3337+
CIRCLE_CELL_INTERSECTION_AREA = 0.5_EB*R2*(THETA-SIN(THETA)) + 0.5_EB*(Y2-Y1)*(2._EB*X2-XP1-XP2)
3338+
! Three corners in the circle: chord + irregular pentagon (two rectangles and a triangle)
3339+
CASE(7)
3340+
YP1=Y0-SQRT(R2-(X2-X0)**2)
3341+
XP1=SQRT(R2-(Y1-Y0)**2)+X0
3342+
THETA = 2._EB*ASIN(0.5_EB*SQRT((XP1-X2)**2+(YP1-Y1)**2)/RAD)
3343+
CIRCLE_CELL_INTERSECTION_AREA = 0.5_EB*R2*(THETA-SIN(THETA)) + (Y2-Y1)*(XP1-X1) + (X2-XP1)*(Y2-YP1) + &
3344+
0.5_EB*(X2-XP1)*(YP1-Y1)
3345+
CASE(11)
3346+
YP1=SQRT(R2-(X2-X0)**2)+Y0
3347+
XP1=SQRT(R2-(Y2-Y0)**2)+X0
3348+
THETA = 2._EB*ASIN(0.5_EB*SQRT((XP1-X2)**2+(YP1-Y2)**2)/RAD)
3349+
CIRCLE_CELL_INTERSECTION_AREA = 0.5_EB*R2*(THETA-SIN(THETA)) + (Y2-Y1)*(XP1-X1) + (X2-XP1)*(YP1-Y1) + &
3350+
0.5_EB*(X2-XP1)*(Y2-YP1)
3351+
CASE(13)
3352+
YP1=SQRT(R2-(X1-X0)**2)+Y0
3353+
XP1=X0-SQRT(R2-(Y2-Y0)**2)
3354+
THETA = 2._EB*ASIN(0.5_EB*SQRT((XP1-X1)**2+(YP1-Y2)**2)/RAD)
3355+
CIRCLE_CELL_INTERSECTION_AREA = 0.5_EB*R2*(THETA-SIN(THETA)) + (Y2-Y1)*(X2-XP1) + (XP1-X1)*(YP1-Y1) + &
3356+
0.5_EB*(XP1-X1)*(Y2-YP1)
3357+
CASE(14)
3358+
YP1=Y0-SQRT(R2-(X1-X0)**2)
3359+
XP1=X0-SQRT(R2-(Y1-Y0)**2)
3360+
THETA = 2._EB*ASIN(0.5_EB*SQRT((XP1-X1)**2+(YP1-Y1)**2)/RAD)
3361+
CIRCLE_CELL_INTERSECTION_AREA = 0.5_EB*R2*(THETA-SIN(THETA)) + (Y2-Y1)*(X2-XP1) + (XP1-X1)*(Y2-YP1) + &
3362+
0.5_EB*(XP1-X1)*(YP1-Y1)
3363+
! Entire grid cell is in circle: area of grid cell
3364+
CASE(15)
3365+
CIRCLE_CELL_INTERSECTION_AREA = (X2-X1)*(Y2-Y1)
3366+
END SELECT
33103367

33113368
END FUNCTION CIRCLE_CELL_INTERSECTION_AREA
33123369

Source/init.f90

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3331,7 +3331,15 @@ SUBROUTINE INIT_WALL_CELL(NM,I,J,K,OBST_INDEX,IW,IOR,SURF_INDEX,IERR,TT)
33313331

33323332
VT => M%VENTS(WC%VENT_INDEX)
33333333

3334-
B1%AREA_ADJUST = SF%AREA_MULTIPLIER * VT%INPUT_AREA/VT%FDS_AREA
3334+
IF (VT%AREA_ADJUST) THEN
3335+
IF (VT%RADIUS > 0._EB) THEN
3336+
B1%AREA_ADJUST = SF%AREA_MULTIPLIER * VT%UNDIVIDED_INPUT_AREA/VT%TOTAL_FDS_AREA
3337+
ELSE
3338+
B1%AREA_ADJUST = SF%AREA_MULTIPLIER * VT%INPUT_AREA/VT%FDS_AREA
3339+
ENDIF
3340+
ELSE
3341+
B1%AREA_ADJUST = SF%AREA_MULTIPLIER
3342+
ENDIF
33353343
IF (B1%AREA_ADJUST<=TWO_EPSILON_EB) B1%AREA_ADJUST = 1._EB
33363344

33373345
IF (VT%CTRL_INDEX > 0) THEN

Source/main.f90

Lines changed: 32 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ PROGRAM FDS
7272
CHARACTER(MPI_MAX_PROCESSOR_NAME) :: PNAME
7373
LOGICAL, ALLOCATABLE, DIMENSION(:) :: LOGICAL_BUFFER_EXTERNAL
7474
REAL(EB), ALLOCATABLE, DIMENSION(:) :: REAL_BUFFER_DUCT,REAL_BUFFER_EXTERNAL
75-
REAL(EB), ALLOCATABLE, DIMENSION(:,:) :: REAL_BUFFER_10,REAL_BUFFER_20
75+
REAL(EB), ALLOCATABLE, DIMENSION(:,:) :: REAL_BUFFER_10,REAL_BUFFER_20,REAL_BUFFER_VENT
7676

7777
! Initialize OpenMP
7878

@@ -149,6 +149,10 @@ PROGRAM FDS
149149

150150
CALL MPI_INITIALIZATION_CHORES(2)
151151

152+
! Exchange VENT data
153+
154+
IF (N_VENT_TOTAL > 0) CALL EXCHANGE_VENT_AREA
155+
152156
! Initialize global parameters
153157

154158
CALL INITIALIZE_GLOBAL_VARIABLES
@@ -1053,6 +1057,7 @@ SUBROUTINE MPI_INITIALIZATION_CHORES(TASK_NUMBER)
10531057
ALLOCATE(REAL_BUFFER_DUCT((2+N_TRACKED_SPECIES)*N_DUCTNODES+N_DUCTS))
10541058
ALLOCATE(REAL_BUFFER_10(10,NMESHES))
10551059
ALLOCATE(REAL_BUFFER_20(20,NMESHES))
1060+
ALLOCATE(REAL_BUFFER_VENT(N_VENT_TOTAL,NMESHES))
10561061

10571062
IF (READ_EXTERNAL) THEN
10581063
ALLOCATE(REAL_BUFFER_EXTERNAL(N_RAMP))
@@ -1063,11 +1068,13 @@ SUBROUTINE MPI_INITIALIZATION_CHORES(TASK_NUMBER)
10631068
ALLOCATE(COUNTS_10(0:N_MPI_PROCESSES-1))
10641069
ALLOCATE(COUNTS_20(0:N_MPI_PROCESSES-1))
10651070
ALLOCATE(COUNTS_TP(0:N_MPI_PROCESSES-1))
1071+
ALLOCATE(COUNTS_VENT(0:N_MPI_PROCESSES-1))
10661072

10671073
ALLOCATE(DISPLS(0:N_MPI_PROCESSES-1))
10681074
ALLOCATE(DISPLS_10(0:N_MPI_PROCESSES-1))
10691075
ALLOCATE(DISPLS_20(0:N_MPI_PROCESSES-1))
10701076
ALLOCATE(DISPLS_TP(0:N_MPI_PROCESSES-1))
1077+
ALLOCATE(DISPLS_VENT(0:N_MPI_PROCESSES-1))
10711078
ALLOCATE(I_OFFSET(NMESHES))
10721079

10731080
COUNTS = 0
@@ -1092,6 +1099,8 @@ SUBROUTINE MPI_INITIALIZATION_CHORES(TASK_NUMBER)
10921099
DISPLS(N) = COUNTS(N-1) + DISPLS(N-1)
10931100
DISPLS_TP(N) = COUNTS_TP(N-1) + DISPLS_TP(N-1)
10941101
ENDDO
1102+
COUNTS_VENT = COUNTS*N_VENT_TOTAL
1103+
DISPLS_VENT = DISPLS*N_VENT_TOTAL
10951104
COUNTS_10 = COUNTS*10
10961105
DISPLS_10 = DISPLS*10
10971106
COUNTS_20 = COUNTS*20
@@ -4260,6 +4269,28 @@ SUBROUTINE CHECK_FREEZE_VELOCITY_STATUS
42604269
END SUBROUTINE CHECK_FREEZE_VELOCITY_STATUS
42614270

42624271

4272+
!> \brief Exchange FDS VENT areas so each process knows the total FDS area
4273+
4274+
SUBROUTINE EXCHANGE_VENT_AREA
4275+
INTEGER:: NM,NV
4276+
4277+
IF (N_MPI_PROCESSES>1) THEN
4278+
REAL_BUFFER_VENT = VENT_TOTAL_AREA
4279+
CALL MPI_ALLGATHERV(MPI_IN_PLACE,0,MPI_DATATYPE_NULL,REAL_BUFFER_VENT,&
4280+
COUNTS_VENT,DISPLS_VENT,MPI_DOUBLE_PRECISION,MPI_COMM_WORLD,IERR)
4281+
VENT_TOTAL_AREA = REAL_BUFFER_VENT
4282+
ENDIF
4283+
4284+
DO NM=1,NMESHES
4285+
IF (PROCESS(NM)/=MY_RANK) CYCLE
4286+
DO NV=1,MESHES(NM)%N_VENT
4287+
MESHES(NM)%VENTS(NV)%TOTAL_FDS_AREA=SUM(VENT_TOTAL_AREA(MESHES(NM)%VENTS(NV)%TOTAL_INDEX,:))
4288+
ENDDO
4289+
ENDDO
4290+
4291+
END SUBROUTINE EXCHANGE_VENT_AREA
4292+
4293+
42634294
!> \brief Gather revision dates, etc, from subroutines
42644295
!> \param REVISION String containing the revision number
42654296
!> \param REVISION_DATE String containing the date of the last code revision

0 commit comments

Comments
 (0)