Skip to content

Commit 9c19680

Browse files
authored
Merge pull request #14176 from drjfloyd/master
FDS Source: fix circle rectangle chord only intersection area Issue #…
2 parents a857d15 + e01721d commit 9c19680

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

Source/func.f90

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9299,25 +9299,25 @@ REAL(EB) FUNCTION CIRCLE_CELL_INTERSECTION_AREA(X0,Y0,RAD,X1,X2,Y1,Y2)
92999299
CASE (0)
93009300
! First four cases are more than half the cirlce outside the rectangle.
93019301
! Can only have one edge where this is the case without having a corner inside. This edge makes a chord.
9302-
! Intersection area is the circle area minus the area of the chord.
9302+
! Intersection area is the area of the chord.
93039303
IF (X2 <= X0 .AND. X2 > X0-RAD) THEN
93049304
THETA = 2._EB*ACOS((X0-X2)/RAD)
9305-
CIRCLE_CELL_INTERSECTION_AREA = R2*(PI - 0.5_EB*(THETA-SIN(THETA)))
9305+
CIRCLE_CELL_INTERSECTION_AREA = 0.5_EB*(THETA-SIN(THETA))
93069306
RETURN
93079307
ENDIF
93089308
IF (Y2 <= Y0 .AND. Y2 > Y0-RAD) THEN
93099309
THETA = 2._EB*ACOS((Y0-Y2)/RAD)
9310-
CIRCLE_CELL_INTERSECTION_AREA = R2*(PI - 0.5_EB*(THETA-SIN(THETA)))
9310+
CIRCLE_CELL_INTERSECTION_AREA = 0.5_EB*(THETA-SIN(THETA))
93119311
RETURN
93129312
ENDIF
93139313
IF (X1 >= X0 .AND. X1 < X0+RAD) THEN
93149314
THETA = 2._EB*ACOS((X1-X0)/RAD)
9315-
CIRCLE_CELL_INTERSECTION_AREA = R2*(PI - 0.5_EB*(THETA-SIN(THETA)))
9315+
CIRCLE_CELL_INTERSECTION_AREA = 0.5_EB*(THETA-SIN(THETA))
93169316
RETURN
93179317
ENDIF
93189318
IF (Y1 >= Y0 .AND. Y1 < Y0+RAD) THEN
93199319
THETA = 2._EB*ACOS((X1-X0)/RAD)
9320-
CIRCLE_CELL_INTERSECTION_AREA = R2*(PI - 0.5_EB*(THETA-SIN(THETA)))
9320+
CIRCLE_CELL_INTERSECTION_AREA = 0.5_EB*(THETA-SIN(THETA))
93219321
RETURN
93229322
ENDIF
93239323
! Remaining cases is where one or more rectangle edges are inside but the corners are outside

0 commit comments

Comments
 (0)