BIM-Based Automated Multi-Air Distribution Layout Generation for Ofﬁce Buildings: A Case Study

: Although HVAC (Heating Ventilation, and Air Conditioning) layout design has transitioned from 2D drawings to 3D BIM models, the traditional manual process of sizing and placing terminal units is still a time-consuming task, which can lead to inappropriate airﬂow and wastage of resources due to human error. The purpose of this paper is to develop a highly robust method for sizing and placing HVAC terminal units in rooms, while also systematically avoiding obstacles based on the locations of air terminal units and FCUs (Fan Coil Units) to which they belong. The method employs a “scan” approach to solve the problem of insufﬁcient robustness caused by the traditional grid division method. Rule-based iterative algorithms are utilized for the sizing of terminals, airﬂow veriﬁcation, and obstacle avoidance to generate a complete set of FCU and CAV (Constant Air Volume) system terminal layouts within a building. The method was tested for the automated design of HVAC terminal layouts in six different buildings and successfully completed the task within seconds, demonstrating the method’s immediacy and robustness. Moreover, airﬂow organization tests showed that the terminal layouts generated by the algorithm had a 95% pass rate, indicating the effectiveness of the method.


Introduction
The AEC industry has made significant technological advancements in recent years, especially in information technology, resulting in the development of various integrated building design tools.These tools cover building energy modeling and simulation, system design and selection, computer-aided design (CAD), building acoustics design, and building code analysis [1].Building Information Modeling (BIM) technology has brought a great deal of convenience to AEC designs, as BIM models are integrated, parametric, and visual, eliminating the need for traditional two-dimensional (CAD) drawings and enabling direct design based on BIM models.Later, BuildingSMART brings up the idea of openBIM, it expands upon the advantages of Building Information Modeling (BIM), enhancing the accessibility, usability, management, and sustainability of digital data in the building asset industry [2].Additionally, researchers have explored using artificial intelligence algorithms in building and air-conditioning system design.Sönmez reviewed recent algorithm applications in automatic building design and noted that while most of these algorithms are designed for specific case-study buildings, there is still no method available to automate the majority of repetitive processes in building design [3].
Designing HVAC (Heating, Ventilation, and Air Conditioning) terminal units in buildings is a labor-intensive and time-consuming task.It involves adding hypothetical parameters and performing rigorous verifications to meet design requirements.This complex and iterative process often leads designers to rely on experiential parameters for increased efficiency, bypassing the traditional step-by-step approach.However, such reliance on experience can introduce errors due to careless verification, which significantly affects downstream work like air duct and water pipe plans that require placement and sizing steps.Consequently, designers spend considerable time modifying these plans, resulting in delays.Additionally, the challenge of quickly obtaining the terminal unit layout and sizing results can impact related research.For example, in building energy prediction, white-box models like EnergyPlus consider only sizing parameters, neglecting layout information.The verification process and airflow organization in the actual layout can influence sizing results, a factor often overlooked in energy models.
Although the design process for HVAC terminal units can be tedious, the process is clear and amenable to automation and tooling.Runde et al. proposed a top-down approach for automated HVAC system design, which consists of conceptual and detailed design stages [4].Stanescu, Kajl, and Lamarche optimized several design parameters of HVAC systems using Evolutionary Algorithm (EA) [5].Medjdoub, Richens, and Barnard implemented a semi-automatic selection and layout design of low-rise building hot water systems in CAD using a case-study approach [6].Wang et al. introduced artificial intelligence (AI) technology to simplify the rule-based design process of HVAC systems [7].
According to the literature review, the automatic design of HVAC systems has mainly focused on the overall framework, load prediction, and generation of air and water piping systems.However, there is limited literature on automatic terminal unit layout design within building spaces, which is often overlooked in related research.For example, Chen et al. investigated the automatic pipe layout optimization algorithm of the air distribution system with the manually designed results of air outlets and FCU terminal units as inputs [8].Chen Zhe divided the room into concave and convex polygons and used the convex properties of the room vertices to split the concave polygons into multiple convex polygons to create different spaces.Finally, the grid method was used to evenly arrange devices within the outer rectangle of each convex polygon and complete the layout design by deleting air outlets outside the space [9].The grid division concept, similar to this approach, has been widely applied from its initial use in building structural strength analysis to almost all disciplines, such as computer science [10], architecture [11], mechanical engineering [12], aerospace engineering [13], and shipbuilding [14].In the field of architecture, the application of grid division is mainly reflected in model processing for computational simulation and numerical simulation [15][16][17].
Existing room grid partitioning methods are primarily designed for simple polygons, but they encounter difficulties when dealing with complex polygons.This often results in grid merging errors and irregular grid formations.These methods assume that building walls intersect orthogonally, disregarding the fact that building edges can have non-orthogonal connections.Real buildings often have walls with sloping and curved shapes, and partitioning rooms based on these assumptions results in fragmented layouts that deviate from strict orthogonality.Additionally, traversing numerous approximate line endpoints in curved walls increases computation time and reduces algorithm robustness.The current grid partitioning method for HVAC terminal layout has limitations in complexshaped rooms, and performing geometric analysis on such rooms presents a challenge that tests the algorithm's robustness.
Furthermore, the placement of HVAC terminals is not only determined by the shape of the room but also by the relative positions of rooms.For example, in the FCU system, FCU terminals connect supply and return pipes that are usually located in corridors.To save on piping costs, FCUs are often placed on the side of the room adjacent to the corridor.This demands higher standards for the terminal placement algorithm, since an algorithm that does not consider duct and piping layout habits could result in complex or illogical layouts.Uniformly placing HVAC terminals in rooms after dividing them fails to consider relationships between HVAC design habits and various types of terminals in the room.
Currently, there is no practical example of a fully automated HVAC terminal layout and sizing algorithm for engineering applications on the market.This paper proposes a robust algorithm for the automatic layout of HVAC air outlets/inlets and FCU in building rooms.It showcases the automated design process and presents results from a study conducted on six real building models with different volumes and features.The ultimate goal of this research is to reduce the time spent by designers in the iterative process of manual layout, selection, and verification and to provide HVAC terminal layout design results that can rival those of engineers in the field.The research content of this article includes the following sections: Section 1 introduces and reviews the literature.Section 2 describes the algorithm framework of the article, with a detailed explanation of the input and output under this framework.Section 3 introduces a scanning line generation terminal layout plan and corresponding sizing method, from the definition of scanning line and its parameters to the detailed explanation of different scanning methods and corresponding sizing and verification steps for different air terminal types and FCU fan terminal layout selection.Section 4 introduces an obstacle avoidance plan that considers the overall connection after determining various terminal placement and selection information results.In Section 5, the article verifies the proposed method through six different typical office building models.Section 6 presents the conclusion of this research.

Algorithm Structure
In this section, this paper will introduce the overall structure of the algorithm, as shown in Figure 1.In the entire HVAC design process, the task of layout and sizing of terminals is an intermediate task that follows the calculation of building energy consumption and is closely followed by the layout of air ducts and water pipes.Therefore, it is necessary to define the input and output of the algorithm to a certain extent, as given in Table 1: robust algorithm for the automatic layout of HVAC air outlets/inlets and FCU in building rooms.It showcases the automated design process and presents results from a study conducted on six real building models with different volumes and features.The ultimate goal of this research is to reduce the time spent by designers in the iterative process of manual layout, selection, and verification and to provide HVAC terminal layout design results that can rival those of engineers in the field.The research content of this article includes the following sections: Section 1 introduces and reviews the literature.Section 2 describes the algorithm framework of the article, with a detailed explanation of the input and output under this framework.Section 3 introduces a scanning line generation terminal layout plan and corresponding sizing method, from the definition of scanning line and its parameters to the detailed explanation of different scanning methods and corresponding sizing and verification steps for different air terminal types and FCU fan terminal layout selection.Section 4 introduces an obstacle avoidance plan that considers the overall connection after determining various terminal placement and selection information results.In Section 5, the article verifies the proposed method through six different typical office building models.Section 6 presents the conclusion of this research.

Algorithm Structure
In this section, this paper will introduce the overall structure of the algorithm, as shown in Figure 1.In the entire HVAC design process, the task of layout and sizing of terminals is an intermediate task that follows the calculation of building energy consumption and is closely followed by the layout of air ducts and water pipes.Therefore, it is necessary to define the input and output of the algorithm to a certain extent, as given in Table 1:

Overall Structure
In this section, we will introduce the algorithm's functional modules.We will also provide a detailed overview of the multi-system layout and sizing process in a room in Section 2.2, as these tasks are typically performed by iterating through rooms in a thermal zone.This will aid readers' comprehension of Chapters 3 and 4.
In Figure 1a, the pre-processing of room information is mainly responsible for integrating and enhancing room information, as well as filtering non-HVAC rooms and segmenting complex connected space.
(a) Firstly, the algorithm retrieves and processes input information from the BIM model based on room names in the thermal zone.This includes extracting the room's base surface geometry and converting it to a Polygon format using the Shapely library in Python.The room's height, elevation, maximum air supply, and associated columns are also recorded.These steps integrate the input data from the BIM model for further operations.(b) The next step is to remove non-air-conditioned areas within the thermal zone.Rooms that are too small, with an area less than 7 m 2 , or with a perimeter less than 15 m, as well as rooms mislabeled as "office", "meeting room," etc., are not suitable as independent air-conditioned rooms and are excluded from the analysis.(c) Room segmentation is mainly aimed at the phenomenon of inconsistent terminal orientation in "L-shaped" or "complex connected" rooms, which is closely related to the orientation of the room centerline, the relative position of the room to the corridor and the air-conditioning room, and the cost of pipelines and airflow organization habits.By segmenting the rooms with large bends in the centerline and distributing the load separately based on the area of each polygon, the multiple polygons with different terminal orientations can be arranged without introducing unnecessary parameters for the room shape centerline direction.
Section 3 is the core of this algorithm.This section will introduce a placement and selection algorithm that combines the scanning idea with airflow organization verification to propose a more robust terminal placement algorithm and enable a reasonable sizing process.
Section 4 mainly deals with individual collisions and systematic collisions that may occur in the layout algorithm, as well as addressing the misalignment of air terminals caused by fragmentation or non-orthogonal wall lines.

Generation and Sizing Algorithm Structure
In Figure 1b, after pre-processing the input according to the methods described above, the researcher applies a scan placement algorithm to initially place air outlets in the room.The placement is then verified through indoor average air velocity checks.If the check fails, the scan parameters will be adjusted and a new placement is attempted until the required indoor average air velocity is achieved.The air outlet sizing is determined by the actual airflow volume carried by the air outlet and provided sample, and the jet range of the selected air outlet is also verified.If it does not meet the requirements, the air outlet will be resized.Once the supply air outlet placement and sizing are complete, the next step is to determine the placement and sizing based on the system type input by the designer.
After placing the supply air outlets, return air inlets are required for CAV systems.The scan algorithm is used to obtain preliminary layout results for the return air inlet, taking into account the room's geometry and the location of the AC room.Finally, return air inlet sizing is performed, followed by obstacle avoidance.
For FCU systems, the necessary terminals to be added are the FCU terminals and fresh air outlets.Before determining the exact location of the FCU terminal, there is a question of how to assign the already placed supply air outlets to the FCU terminal to be placed.The placement of the FCU terminal also needs to consider the orientation and the direction of the water pipe connector of the sized FCU terminal.Moreover, since there is an inevitable connection (duct) between the FCU terminal and the air outlets, the algorithm needs to consider not only the obstacle avoidance for each individual terminal but also the potential collisions between the system formed by the FCU and the air outlets and the room edges or columns.Finally, the algorithm needs to perform placement and sizing with obstacle avoidance for a small number of fresh air inlets.

Air Terminal Generation and Sizing by Scan Line
In this section, we propose a scan-based method for generating terminal layouts in HVAC systems.As an essential part of the layout algorithm, it is crucial for this method to have the robustness and the ability to generate results for layouts in various types of rooms.Therefore, we avoid imposing too many assumptions and constraints, as past research has shown that too many assumptions and conditions can hinder the algorithm's effectiveness in correctly handling room layouts.Furthermore, algorithms with numerous special cases and corresponding patch-up methods can be difficult to maintain, leading to a need for a complete rewrite.
We classify the geometry of eight types of rooms based on the geometric information of the room boundary, the incenter of the room, and the incenter of the air-conditioning room (or shaft).By doing so, we can quickly determine the orientation of the FCU, the direction of the airflow organization, and the direction of the scan line for each room geometry scenario.These classifications enable us to determine the spatial layout of each terminal in various room geometries.Next, this paper introduces the commonly used indoor average air velocity v a as a basis for determining whether the generated terminal layout meets basic airflow organization requirements.The spacing between terminals A x (or A y ) is iteratively updated, and the range of the air outlet is checked during the subsequent selection process to ensure that the air supplied by the air outlet meets the service area it belongs to.
In Section 3.1, this paper defines the "scan line" and the parameters related to the scenario classification mentioned earlier, and the eight scenarios derived from them will also be presented and explained.Section 3.2 shows how the scan line generates supply, return, and fresh air outlets, respectively.Section 3.3 introduces how the algorithm performs airflow organization verification and outlet sizing based on the initial scanning results to ensure that the automatically generated outlet layout can meet the airflow organization requirements of conventional design.Section 3.4 provides a detailed description of the layout and sizing of FCU outlets.

Definition of Scan Line and Its Parameters
Figure 2 shows a possible air outlet layout plan for a room after scanning, while Figure 3 illustrates different scenarios that may exist for the room to be arranged.Table 2 summarizes the information involved in both figures: direction of the airflow organization, and the direction of the scan line for each room geometry scenario.These classifications enable us to determine the spatial layout of each terminal in various room geometries.Next, this paper introduces the commonly used indoor average air velocity  as a basis for determining whether the generated terminal layout meets basic airflow organization requirements.The spacing between terminals Ax (or Ay) is iteratively updated, and the range of the air outlet is checked during the subsequent selection process to ensure that the air supplied by the air outlet meets the service area it belongs to.
In Section 3.1, this paper defines the "scan line" and the parameters related to the scenario classification mentioned earlier, and the eight scenarios derived from them will also be presented and explained.Section 3.2 shows how the scan line generates supply, return, and fresh air outlets, respectively.Section 3.3 introduces how the algorithm performs airflow organization verification and outlet sizing based on the initial scanning results to ensure that the automatically generated outlet layout can meet the airflow organization requirements of conventional design.Section 3.4 provides a detailed description of the layout and sizing of FCU outlets.Table 2. Definition of parameters used in the algorithm.

Parameter Content Purpose Example
Plant room/shaft incenter The center of the maximum inscribed circle in the floor plan of the plant room/shaft.

The basis of scenario classification
Point (x, y, z)

Room incenter
The center of the maximum inscribed circle in the floor plan of the room.Point (x, y, z) The length in meters of the x-axis of the minimum bounding box, based on the orthogonal axis aligned with the building orientation.

The basis of scenario classification
The length in meters of the y-axis of the minimum bounding box, based on the orthogonal axis aligned with the building orientation.

Scan direction
Refers to the direction of the scan line from the starting point to the ending point (orthogonal form) Determine direction for scan line (0,1)

Scan line
The scan line can be moved in two dimensions along the determined scan direction, as shown in Figure 2. The scan line can pass through the polygon of the room floor and the overlapping part with the polygon becomes the "valid scan line".
Where the air terminal is generated LineString ((x1, y1), (x2, y2)) The reference distance is generally 3-5 m for ceiling diffusers, and it can be iterated during the subsequent airflow verification process.The unit is meter (m).

Layout parameter
Scan granularity (r) The step length during the scanning line movement, which is adjustable and defaults to 0.1 m.
Layout parameter r = 0.1 m Based on the above parameters, this paper distinguishes eight (4 × 2) basic scenarios by the relative position relationship between Point (x plant room , y plant room , z plant room ) and Point (x room , y room , z room ), and the factor of L x /L y , as shown in Figure 3.For example, Figure 3a represents the scenario where L x /L y < 1 and the air-conditioning room is located in the upper left corner of the room to be arranged.In this situation, the air duct design often needs to extend from the air-conditioning room through corridors or adjacent rooms into the room to be arranged, with the aim of reducing the resistance of the air duct and considering the economy of the pipeline construction.Therefore, the air duct is likely to enter from the left or upper wall.If L x > L y , the scan lines can obtain more stable results with more default spacing by scanning parallel to the longer y-axis direction.Additionally, when the spacing distance A y is adjusted, the scan lines scanned in the y-axis direction can accommodate larger-scale spacing distance adjustments.In the arrangement of the return air inlet in the CAV system, placing it on the long side means higher stability of airflow organization and can also offset the air supply and return pipes to reduce collision.
Thus, in this scenario, the direction of the scan lines can be determined, and the orientation of the return air inlet can also be known.
Consider placing diffusers near the air-conditioning water supply for FCU terminals instead of the air-conditioning room.FCUs require chilled water from the water supply pipe for cooling, and the fan in the FCU provides air supply in the room.FCUs typically have limited air pressure for ceiling diffusers (50-60 pa), while ceiling diffusers can dissipate higher air pressure (15-20 pa).This restricts the use of one to two ceiling diffusers with an FCU, especially in large rooms with a large aspect ratio, where only one row of diffusers may be feasible.To accommodate the possibility of using two diffusers and considering the proximity to the shaft, placing diffusers near the air-conditioning water supply is recommended.
The factors considered by the system when classifying scenarios are generally applicable to BIM building models and there are almost no exceptions.Therefore, the scenarios identified can cover the real scenarios in the vast majority of building instances.The factors considered by the system when classifying scenarios are generally applicable to BIM building models and there are almost no exceptions.Therefore, the scenarios identified can cover the real scenarios in the vast majority of building instances.

Air Terminal Generation by Scan Line
Regardless of whether it is a CAV system or an FCU system, the first step of this layout algorithm is to generate the air supply outlets.Next, the layout of the return air inlets or fresh air outlets is carried out according to the different types of HVAC systems, respectively.
For each room to be dealt with, the algorithm first traverses the room's bottom polygon to obtain the minimum bounding box with Lx and Ly.Then, it compares the position of the polygon incenter with the air-conditioning room (CAV system) or air-conditioning shaft (FCU system) to determine the corresponding scenario listed in Section 3.1, thus obtaining the scanning direction of the scan line, the return air inlets direction (CAV system), the orientation of the FCU, and its water connector direction (FCU system).
The scanning step and placement of air outlets are carried out in two steps.The air supply outlets are defined based on the minimum bounding box of the room and the scanning direction determined earlier.The starting position of the scan line is determined by the minimum coordinate value of the room in the minimum bounding box along the axis of the scanning direction, while the ending position of the scan line is determined by its maximum coordinate value, as shown in Figure 2a.For example, Figure 2b corresponds to the scenario shown in Figure 3g.
Next, as shown in Figure 4., the algorithm considers the overall scanning distance to make a minor adjustment to Aoutlet_y.Specifically: (a) The spacing distance Ly is divided by Aoutlet_y (4.5 m as default) to obtain the number of rows n, which is then rounded up.Ly is then divided by n to obtain the actual value of Aoutlet_y.This step is mainly to avoid redundant space at the tail of the scan process.(b) The scan algorithm starts from the starting position of the scan line and accumulates the distance the scanning line passes through with each step (i.e., the scan granularity introduced in Section 3.1 with a default value of 0.1 m).

Air Terminal Generation by Scan Line
Regardless of whether it is a CAV system or an FCU system, the first step of this layout algorithm is to generate the air supply outlets.Next, the layout of the return air inlets or fresh air outlets is carried out according to the different types of HVAC systems, respectively.
For each room to be dealt with, the algorithm first traverses the room's bottom polygon to obtain the minimum bounding box with L x and L y .Then, it compares the position of the polygon incenter with the air-conditioning room (CAV system) or air-conditioning shaft (FCU system) to determine the corresponding scenario listed in Section 3.1, thus obtaining the scanning direction of the scan line, the return air inlets direction (CAV system), the orientation of the FCU, and its water connector direction (FCU system).
The scanning step and placement of air outlets are carried out in two steps.The air supply outlets are defined based on the minimum bounding box of the room and the scanning direction determined earlier.The starting position of the scan line is determined by the minimum coordinate value of the room in the minimum bounding box along the axis of the scanning direction, while the ending position of the scan line is determined by its maximum coordinate value, as shown in Figure 2a.For example, Figure 2b corresponds to the scenario shown in Figure 3g.
Next, as shown in Figure 4., the algorithm considers the overall scanning distance to make a minor adjustment to A outlet_y .Specifically: (a) The spacing distance L y is divided by A outlet_y (4.5 m as default) to obtain the number of rows n, which is then rounded up.L y is then divided by n to obtain the actual value of A outlet_y .This step is mainly to avoid redundant space at the tail of the scan process.(b) The scan algorithm starts from the starting position of the scan line and accumulates the distance the scanning line passes through with each step (i.e., the scan granularity introduced in Section 3.1 with a default value of 0.1 m).(c) When the scan line has passed half of A outlet_y for the first time, the signal changes to "allowed".The scan line is then allowed to place air outlets on the "valid scan line".(d) The spacing between outlets on the same line is also recalculated as the placement distance A outlet_x along the x-axis.(e) In terms of spatial height, the outlet height is set as the net height of the room H minus the reserved distance of the ceiling ∆h (default value 1 m).
(f) After the placement is completed, the accumulated scanned distance S is cleared, and the scanning line can be "allowed" again for the next placement only when the set placement distance is reached on this scan line.
(c) When the scan line has passed half of Aoutlet_y for the first time, the signal changes to "allowed".The scan line is then allowed to place air outlets on the "valid scan line".(d) The spacing between outlets on the same line is also recalculated as the placement distance Aoutlet_x along the x-axis.(e) In terms of spatial height, the outlet height is set as the net height of the room H minus the reserved distance of the ceiling Δh (default value 1 m).(f) After the placement is completed, the accumulated scanned distance S is cleared, and the scanning line can be "allowed" again for the next placement only when the set placement distance is reached on this scan line.It is worth noting that the reason why the scanning step and placement signal are set instead of directly setting the placement distance is that the valid scanning line after directly setting the placement distance may not necessarily meet the placement conditions.For example, some valid scan lines may be too short or cut off by columns, making it impossible to place the air vents.By setting the scan granularity and placement signal, the algorithm can continue to search for the next placement position when the placement condition cannot be met in real time while the signal is "allowed" until the scan line moves to a position where the outlet can be placed, and the scan line resets S and starts to recalculate the cumulative again.This procedure ensures an efficient and accurate placement of air outlets in HVAC systems.

Input
In a CAV system, the return air inlet has a larger spacing compared to the supply air outlet due to carrying a higher air volume.Specifically, the spacing Aoutlet of the return air inlet is twice that of the supply air outlet Aoutlet.The positioning of the return air inlet also influences the overall airflow direction within the room, based on the initial airflow direction determination mentioned in Section 3.1.Placing the return air inlet on the side aligned with the overall airflow direction is sufficient.By default, there is a 1 m distance between the return air inlets and the boundary of the valid scan line, which can be adjusted in the It is worth noting that the reason why the scanning step and placement signal are set instead of directly setting the placement distance is that the valid scanning line after directly setting the placement distance may not necessarily meet the placement conditions.For example, some valid scan lines may be too short or cut off by columns, making it impossible to place the air vents.By setting the scan granularity and placement signal, the algorithm can continue to search for the next placement position when the placement condition cannot be met in real time while the signal is "allowed" until the scan line moves to a position where the outlet can be placed, and the scan line resets S and starts to recalculate the cumulative again.This procedure ensures an efficient and accurate placement of air outlets in HVAC systems.
In a CAV system, the return air inlet has a larger spacing compared to the supply air outlet due to carrying a higher air volume.Specifically, the spacing A outlet of the return air inlet is twice that of the supply air outlet A outlet .The positioning of the return air inlet also influences the overall airflow direction within the room, based on the initial airflow direction determination mentioned in Section 3.1.Placing the return air inlet on the side aligned with the overall airflow direction is sufficient.By default, there is a 1 m distance between the return air inlets and the boundary of the valid scan line, which can be adjusted in the initial parameter settings.In Figure 5a, the airflow area handled by the return air inlets is more clearly depicted in a regular polygon area.uildings 2023, 13, x FOR PEER REVIEW 11 of 26 initial parameter settings.In Figure 5a, the airflow area handled by the return air inlets is more clearly depicted in a regular polygon area.For FCU systems, top-supply FCUs typically use a bottom-return configuration, eliminating the need for separate return air inlets near the room boundary.The FCU serves as a heat exchanger, while a separate fresh air inlet is required to introduce outside air into the room.The fresh air is processed by the FAU in the air-conditioning room and then supplied separately to the room.In small rooms (<50 m 2 ), strict and uniform placement of fresh air is unnecessary.However, in large spaces, designers need to consider how to introduce and mix fresh air quickly.This study adopts the same placement method for fresh air in large rooms as the return air in CAV systems for economic reasons.

Air Distribution Checking and Air Terminal Sizing
The task of airflow organization verification is to ensure that the generated air supply outlets can meet the design requirements for thermal comfort in terms of air velocity and temperature difference in the workspace.According to the current Chinese design code "Code for design of heating, ventilation and air conditioning" (GB 50019-2003), the air velocity in the workspace should not exceed 0.2 m/s in winter and 0.3 m/s in summer.The outlet velocity u of the air supply outlet should also consider the noise generated by highspeed airflow passing through the outlet.Therefore, a lower air supply velocity should be adopted in rooms with higher requirements.The general range of air supply velocity is 2-5 m/s, and the air velocity at the return air inlet is generally limited to below 4 m/s.In addition, the effective air supply range of the air supply outlet should be verified, i.e., its range.
This study employs an empirical formula for the average indoor air velocity of diffuser air-conditioned rooms: where  -average indoor air velocity, m/s; For FCU systems, top-supply FCUs typically use a bottom-return configuration, eliminating the need for separate return air inlets near the room boundary.The FCU serves as a heat exchanger, while a separate fresh air inlet is required to introduce outside air into the room.The fresh air is processed by the FAU in the air-conditioning room and then supplied separately to the room.In small rooms (<50 m 2 ), strict and uniform placement of fresh air is unnecessary.However, in large spaces, designers need to consider how to introduce and mix fresh air quickly.This study adopts the same placement method for fresh air in large rooms as the return air in CAV systems for economic reasons.

Air Distribution Checking and Air Terminal Sizing
The task of airflow organization verification is to ensure that the generated air supply outlets can meet the design requirements for thermal comfort in terms of air velocity and temperature difference in the workspace.According to the current Chinese design code "Code for design of heating, ventilation and air conditioning" (GB 50019-2003), the air velocity in the workspace should not exceed 0.2 m/s in winter and 0.3 m/s in summer.The outlet velocity u of the air supply outlet should also consider the noise generated by high-speed airflow passing through the outlet.Therefore, a lower air supply velocity should be adopted in rooms with higher requirements.The general range of air supply velocity is 2-5 m/s, and the air velocity at the return air inlet is generally limited to below 4 m/s.In addition, the effective air supply range of the air supply outlet should be verified, i.e., its range.
This study employs an empirical formula for the average indoor air velocity of diffuser air-conditioned rooms: where v pj -average indoor air velocity, m/s; A-air-conditioned room (or zone) length, m; H-air-conditioned room (or zone) height, m; n-the ratio of jet range to room (or zone) length.
During the validation process, the assumed range is taken as 0.75 times the length of the air-conditioned zone, and the value of v pj is calculated.Then, the calculated value of v pj is multiplied by 1.2 and 0.8 for summer and winter, respectively, to check if the average indoor air velocity meets the design requirements.If v pj < 0.3 m/s for summer and v pj < 0.2 m/s for winter, it indicates that the layout method satisfies the airflow velocity check.
If the value of v pj does not meet the required range for winter or summer, the algorithm will recommend adjusting the spacing distance A and resetting the corresponding room.For example, if v pj > 0.3, the algorithm will reduce A in the range of 3-5 m with a step of 0.1 m; conversely, if v pj is too low, A will be increased because the derivative of the empirical formula is positive when A > 0.
The algorithm selects the diffuser range by comparing it with diffuser samples.Firstly, the range of diffusers with A > 0.75 is filtered out, and then the size of the air vent is selected based on the average recommended airflow velocity (supply: 2-5 m/s; return: 3-4 m/s) as the reference velocity.If there are no diffusers with the required range, it is generally due to the fact that one diffuser is responsible for too large an area.In this case, the algorithm will readjust the placement distance A by 0.1 m increments and re-layout the diffusers.

FCU Terminal Generation and Sizing
After arranging the supply air outlets, the placement of the FCU terminal is carried out.The algorithm has determined the orientation of the FCU for each room based on the initial scenario classification.To place the FCU terminal further, the algorithm groups the air outlets that are close on the x-or y-axis based on the FCU orientation as shown in Figure 6.Grouped air outlets have additional restrictions in this study as follows: (a) The distance between the air outlets in the same group should be d: 0.8 A ≤ d ≤ 1.4 A (where A is the adjusted placement spacing).(b) If the FCU orientation is along the x-axis, the difference in y-coordinate between the air outlets in the same group should be ∆y < 0.1 m.(c) If the FCU orientation is along the y-axis, the difference in x-coordinate between the air outlets in the same group should be ∆x < 0.1 m.(d) The number of air outlets in the same group should not exceed 2. (e) The air outlets that have already been assigned to a group cannot appear in another group.
After grouping the previously arranged air outlets, each group, corresponding to a terminal of the FCU system, contains one or two air outlets with their respective airflow and load information.Based on the total airflow and load of the air outlets in each group, the sizing result is generated.It should be noted that the placement of the FCU terminals is completed after sizing.The placement of some FCU terminals may be closer to the room wall than the air outlets, so it is important to consider the sizing result of the FCU.The placement is completed according to the specified direction, and the distance to adjacent air outlets should be at least 1.5 m (modifiable in the parameters) to avoid short circuits.The FCU terminals are placed by calculating the distance between the center of the FCU return air inlet and the center of the nearest air outlet and then offsetting along the axis of the air outlet connection, as shown in Figure 5b.After grouping the previously arranged air outlets, each group, corresponding to a terminal of the FCU system, contains one or two air outlets with their respective airflow and load information.Based on the total airflow and load of the air outlets in each group, the sizing result is generated.It should be noted that the placement of the FCU terminals is completed after sizing.The placement of some FCU terminals may be closer to the room wall than the air outlets, so it is important to consider the sizing result of the FCU.The placement is completed according to the specified direction, and the distance to adjacent air outlets should be at least 1.5 m (modifiable in the parameters) to avoid short circuits.The FCU terminals are placed by calculating the distance between the center of the FCU return air inlet and the center of the nearest air outlet and then offsetting along the axis of the air outlet connection, as shown in Figure 5b.

Post-Processing
In this section, the post-processing of the initially arranged air supply outlets and FCU terminals will be carried out, including aligning the air outlets and obstacle avoidance.

Air Terminal Alignment
The positioning of FCU depends on the previously arranged air outlets.However, due to the fluctuation of the irregular room boundary, adjacent air outlets may not be aligned properly, as shown in Figure 2b.To address this issue, the algorithm needs to determine the specific direction for aligning the air outlets based on the previously determined FCU orientation.For instance, in Figure 2b, the FCU orientation is (0,1).Therefore, air diffusers with x-coordinates that are not equal but close within a certain threshold need to be aligned.If the FCU orientation is along the x-axis, air diffusers with a y-value difference of less than 0.1 m are considered to be in the same row.If the FCU orientation is along the y-axis, air diffusers with an x-value difference of less than 0.1 m are considered to be in the same column.After aligning the air diffusers, the few diffusers that deviate from the alignment are adjusted to have the same y-value or x-value, resulting in an aligned layout, as shown in Figure 5b.

Obstacle Avoidance
For the placement of air outlets, it is important to avoid obstacles such as room boundaries and columns during terminal placement tasks.Failure to do so can lead to wasted resources, decreased efficiency, and other issues during construction.The algorithm considers obstacles for individual terminals and the duct between the FCU and air outlets.
As shown in Figure 7a, if an obstacle is present within a 1000 mm radius of an air vent, the algorithm will attempt to move it up to 500 mm in the x and y directions until it no longer collides with obstacles.If no suitable position is found, the air outlet will be deleted (and re-size the remaining air outlets).The air inlet will be highlighted as problematic, and the fresh air outlet will be kept for air intake only, which takes about 10% of the air volume in a room.If a room does not have an air outlet due to the narrow width and obstacle avoidance, the algorithm will not add new ones for there is no point to place an air inlet.The FCU has its own position threshold and will not collide with air outlets.In Figure 7b, collisions mainly occur with room boundaries, detected within a 500 mm radius by the algorithm.If a collision is detected, the FCU will be moved to a new position in its current orientation until it satisfies the 500 mm threshold.To avoid collisions between the FCU and air outlets, as well as with room boundaries and columns, an air supply system consisting of a virtual duct, FCU, and air outlets was analyzed.The algorithm prioritizes avoiding collisions with room boundaries by searching for new, non-colliding positions within the radius of the air outlet.Collisions with columns, which are more common in large open spaces, require further analysis of the column's position within the system.See Figure 7c for details.
(a) When a column is located between the FCU and the first air outlet, the solution is to move the FCU to the other side of the pillar.If the distance between the column and air outlet is too close to allow the FCU to be placed properly, it is more suitable to combine the two air outlets into one larger one and then re-size the parameters based on the total airflow.The FCU should be moved to the side of the column with the air outlet.(b) When a pillar is located between the first and second air supply outlets, the solution is to remove the second outlet, transfer its airflow to the first outlet, and re-size the parameters of the first outlet according to the total airflow.(c) When a collision occurs between the column and FCU, the solution is to move the FCU towards its orientation.Due to the width of FCU being between 500 mm and 1000 mm, the probability of it colliding with the air supply outlet is not high.To avoid collisions between the FCU and air outlets, as well as with room boundaries and columns, an air supply system consisting of a virtual duct, FCU, and air outlets was analyzed.The algorithm prioritizes avoiding collisions with room boundaries by searching for new, non-colliding positions within the radius of the air outlet.Collisions with columns, which are more common in large open spaces, require further analysis of the column's position within the system.See Figure 7c for details.
(a) When a column is located between the FCU and the first air outlet, the solution is to move the FCU to the other side of the pillar.If the distance between the column and air outlet is too close to allow the FCU to be placed properly, it is more suitable to combine the two air outlets into one larger one and then re-size the parameters based on the total airflow.The FCU should be moved to the side of the column with the air outlet.(b) When a pillar is located between the first and second air supply outlets, the solution is to remove the second outlet, transfer its airflow to the first outlet, and re-size the parameters of the first outlet according to the total airflow.(c) When a collision occurs between the column and FCU, the solution is to move the FCU towards its orientation.Due to the width of FCU being between 500 mm and 1000 mm, the probability of it colliding with the air supply outlet is not high.

Case Study
This article validates the algorithm using six building models, evaluating its practicality based on three aspects: (a) Effectiveness: whether the solutions provided by the algorithm comply with relevant design standards.(b) Robustness: whether the algorithm can generate feasible solutions based on different types of building enclosures and column layouts.(c) Immediacy: whether the algorithm can produce results in a relatively short period of time.
Figure 8 shows six different office buildings with varying geometry and features, which were used in this study to validate the practicality of the algorithm.A BIM-BEM tool was developed to convert gbxml files from Revit into idf files and conduct annual energy calculations using Energyplus.Various samples of terminals were selected from a family library for reference in the sizing process, which was carried out in a Python environment and saved as a json file.Finally, the results were imported into Revit using the official API for secondary development for visualization.
PEER REVIEW 16 of 26

Case Study
This article validates the algorithm using six building models, evaluating its practicality based on three aspects: (a) Effectiveness: whether the solutions provided by the algorithm comply with relevant design standards.(b) Robustness: whether the algorithm can generate feasible solutions based on different types of building enclosures and column layouts.(c) Immediacy: whether the algorithm can produce results in a relatively short period of time.
Figure 8 shows six different office buildings with varying geometry and features, which were used in this study to validate the practicality of the algorithm.A BIM-BEM tool was developed to convert gbxml files from Revit into idf files and conduct annual energy calculations using Energyplus.Various samples of terminals were selected from a family library for reference in the sizing process, which was carried out in a Python environment and saved as a json file.Finally, the results were imported into Revit using the official API for secondary development for visualization.During the verification phase, rooms with an area greater than 1 as big rooms, and those with non-rectangular closed shapes due to their walls are considered irregular rooms.In Table 3, Case 2 prese rooms than Case 1, namely, the corridor and conference room in the up relative positions of the rooms in Case 2 are also more asymmetric, a During the verification phase, rooms with an area greater than 100 m 2 are classified as big rooms, and those with non-rectangular closed shapes due to the arrangement of their walls are considered irregular rooms.In Table 3, Case 2 presents more irregular rooms than Case 1, namely, the corridor and conference room in the upper left corner.The relative positions of the rooms in Case 2 are also more asymmetric, allowing for a better assessment of the reasonability of the algorithm's terminal orientation placement in such rooms.As a result, the overall placement complexity is higher than in Case 1. Case 3, on the other hand, boasts a high number of sloping walls and even curved walls due to a circular skylight located above the central corridor.Such a feature presents a more challenging task for the automatic generation algorithm, thus testing the robustness of the approach.Although Case 3 has more rooms and irregular spaces compared to Cases 4 and 5, most of its irregular rooms are due to slanting walls, and its dormitory rooms are more orderly arranged, resulting in a little higher complexity classification than Case 2. Case 4 may present fewer big and irregular rooms, yet its largest area, the "Hall" (1424 m 2 ), is divided into three areas, raising the difficulty of generation one level higher than the previous cases.Case 5 is on par with Case 4 regarding complexity level, as it includes several large spaces and irregular rooms.Lastly, Case 6 proves to be the most complex building, with three wings, intricate room arrangements, and a high number of irregular big rooms bordering each other.Figure 9 depicts the building plan of Case 1, which was a demonstration conducted in the early stage of our research.The building has a total area of 2184 m 2 and three floors, with this standard floor located on the third level.The layout design is neat and the terminal orientation trend is very clear.In Figure 9a, the fan coil units located on the left and right sides of the building plan are arranged on the left and right sides of the rooms, respectively.The orientation and relative position of the partitioned air-conditioning room/shaft are automatically determined to facilitate the connection of the supply/return pipes extending from the AC room/shaft.Similarly, the fresh air outlet in Figure 9a and the return air inlet in Figure 9b only need to be placed near the room edge to meet the indoor fresh air demand, because the proper placement of the air outlet near the room edge can reduce the total investment in duct material.The centrally located complex interconnecting corridor does not have a terminal placement on the upper and lower sides due to the narrow width, so the load of the corridor is transferred to the two air outlets on the wider corridors on the left and right sides, making these two air outlets appear larger.In the OFFICE1 and CORRIDOR rooms, the FCUs are sized based on the load and air volume assigned to the respective air outlets.Therefore, in OFFICE1, the sized FCU is a terminal unit with a rated cooling capacity of 11 kW, while in CORRIDOR, the selected FCU has a rated cooling capacity of 8 kW.The partial information of the sizing result is listed in Table 4.
the wider corridors on the left and right sides, making these two air outlets appear larger.In the OFFICE1 and CORRIDOR rooms, the FCUs are sized based on the load and air volume assigned to the respective air outlets.Therefore, in OFFICE1, the sized FCU is a terminal unit with a rated cooling capacity of 11 kW, while in CORRIDOR, the selected FCU has a rated cooling capacity of 8 kW.The partial information of the sizing result is listed in Table 4.The remaining five cases, shown in Figure 10, demonstrate the ability and the robustness of the algorithm to successfully arrange FCU and CAV systems in rooms of various shapes.In Case 2, the building geometry is asymmetrical.Our algorithm can automatically arrange the FCU terminals, new air supply vents (Figure 10a), and return air vents (Figure 10b) for almost all rooms, making it easy to connect the pipelines.The arrangement can be based on the position of the air-conditioning room (the test building did not specify the In Case 2, the building geometry is asymmetrical.Our algorithm can automatically arrange the FCU terminals, new air supply vents (Figure 10a), and return air vents (Figure 10b) for almost all rooms, making it easy to connect the pipelines.The arrangement can be based on the position of the air-conditioning room (the test building did not specify the location of the supply and return shaft, so the algorithm automatically refers to the location of the airconditioning room on the floor).This eliminates the need to calculate the adjacent corridors, saving computational costs.In fact, in the subsequent study of large rooms, adjacent corridors are not always the determining factor, and the position of the air-conditioning room or shaft is more important.
In Case 3, CORRIDOR is the most important room due to its skylight with curved walls (Figure 11a).Traditional grid partitioning methods struggle with incomplete grids and merging them with surrounding grids to create a zone of airflow that matches the range of the air supply outlets.However, dividing and merging room areas is not the focus of this task.The scan method effectively avoids the complexities of division and merging rules and, combined with the subsequent airflow outlet alignment feature, achieves good layout results.Similarly, in Figure 11b, the scan line only needs to determine whether the spacing distance has been reached and whether the length of the valid scan line supports the placement of the air outlet, without worrying about the geometric structure of the room boundaries.The geometric structure of the room boundaries is reflected in the length fluctuations of the scan line.
Buildings 2023, 13, x FOR PEER REVIEW 22 of 26 location of the supply and return shaft, so the algorithm automatically refers to the location of the air-conditioning room on the floor).This eliminates the need to calculate the adjacent corridors, saving computational costs.In fact, in the subsequent study of large rooms, adjacent corridors are not always the determining factor, and the position of the air-conditioning room or shaft is more important.In Case 3, CORRIDOR is the most important room due to its skylight with curved walls (Figure 11a).Traditional grid partitioning methods struggle with incomplete grids and merging them with surrounding grids to create a zone of airflow that matches the range of the air supply outlets.However, dividing and merging room areas is not the focus of this task.The scan method effectively avoids the complexities of division and merging rules and, combined with the subsequent airflow outlet alignment feature, achieves good layout results.Similarly, in Figure 11b, the scan line only needs to determine whether the spacing distance has been reached and whether the length of the valid scan line supports the placement of the air outlet, without worrying about the geometric structure of the room boundaries.The geometric structure of the room boundaries is reflected in the length fluctuations of the scan line.Cases 4 and 5 show challenges posed by large rooms.The abundance of space leads to a significant increase in the number of air outlets, demanding a specific grouping approach for assigning FCUs to outlets.Moreover, large spaces often have numerous structural columns to support the floors, making obstacle avoidance inevitable.In Case 4 (Figure 12a), there are three excavated areas in the hall, along with many columns.The leftmost row of FCUs is not aligned due to some FCUs being obstructed by columns.The algorithm decides to move the FCU closer to the column because it is closer than the air outlet, enabling it to place the FCU on one side of the outlet.Similarly, the air outlet in row 4 and column 5 is the result of the algorithm's adjustment.It moves the leftmost outlet to the right of the column to prevent the downstream air duct from colliding with the column.In Case 5 (Figure 12b), the OFFICE represents an irregular big room, which results in a deviation of the air outlet due to the fluctuation of the boundary.Such continuous deviations are unsuitable for CAV system air duct connections.The algorithm's postprocessing alignment function, with an initial threshold of 0.5 m, proved effective, resulting in a more organized layout plan of terminals.Cases 4 and 5 show challenges posed by large rooms.The abundance of space leads to a significant increase in the number of air outlets, demanding a specific grouping approach for assigning FCUs to outlets.Moreover, large spaces often have numerous structural columns to support the floors, making obstacle avoidance inevitable.In Case 4 (Figure 12a), there are three excavated areas in the hall, along with many columns.The leftmost row of FCUs is not aligned due to some FCUs being obstructed by columns.The algorithm decides to move the FCU closer to the column because it is closer than the air outlet, enabling it to place the FCU on one side of the outlet.Similarly, the air outlet in row 4 and column 5 is the result of the algorithm's adjustment.It moves the leftmost outlet to the right of the column to prevent the downstream air duct from colliding with the column.In Case 5 (Figure 12b), the OFFICE represents an irregular big room, which results in a deviation of the air outlet due to the fluctuation of the boundary.Such continuous deviations are unsuitable for CAV system air duct connections.The algorithm's post-processing alignment function, with an initial threshold of 0.5 m, proved effective, resulting in a more organized layout plan of terminals.
Case 6 (Figure 12c) is the most complex and largest building among all the tested structures, containing multiple blocks and AC rooms.It encompasses most of the irregular and large room scenarios discussed earlier.It is worth noting that since the air supply method studied in this paper is a ceiling-mounted diffuser system, we chose to validate the algorithm's performance in rooms such as "HALL" using diffusers rather than the more commonly used lateral supply air outlet.Based on the validation results of the six buildings, we conclude that the proposed algorithm is highly robust and can support the design of air supply terminals for almost all building configurations, providing a specific layout and sizing plan.Case 6 (Figure 12c) is the most complex and largest building among all the tested structures, containing multiple blocks and AC rooms.It encompasses most of the irregular and large room scenarios discussed earlier.It is worth noting that since the air supply method studied in this paper is a ceiling-mounted diffuser system, we chose to validate the algorithm's performance in rooms such as "HALL" using diffusers rather than the In addition to providing the design solutions for the air vent and FCU, this paper should also verify the air distribution of the designed air diffusers to demonstrate their effectiveness.According to the design manual, the air distribution of comfort air-conditioning should meet the following requirements: (a) When the supply air height is less than 5 m, the temperature difference of the supply air should not be greater than 10 • C; when the supply air height is greater than 10 m, the temperature difference of the supply air should not be greater than 15 • C.
or A y (a) overall structure (b) generation and sizing structure

Figure 1 .
Figure 1.Overall and local structure of the algorithm.Figure 1. Overall and local structure of the algorithm.

Figure 1 .
Figure 1.Overall and local structure of the algorithm.Figure 1. Overall and local structure of the algorithm.

Figure 2 Figure 2 .
Figure2shows a possible air outlet layout plan for a room after scanning, while Figure3illustrates different scenarios that may exist for the room to be arranged.Table2summarizes the information involved in both figures:

Figure 3 .
Figure 3. Scenario classification for different room boundary conditions.There are 8 scenarios (2 × 4) composed of 2 types of size relationships between Lx and Ly, and 4 types of relative relationships between the room to be arranged and the AC room.

Figure 3 .
Figure 3. Scenario classification for different room boundary conditions.(a-h): There are 8 scenarios (2 × 4) composed of 2 types of size relationships between L x and L y , and 4 types of relative relationships between the room to be arranged and the AC room.

Amount < 1 Figure 4 .
Figure 4. Air outlet/inlet generation flow chart in a single room.

Figure 4 .
Figure 4. Air outlet/inlet generation flow chart in a single room.

Figure 5 .
Figure 5. Generation of air inlet and fresh air outlet.

Figure 5 .
Figure 5. Generation of air inlet and fresh air outlet.

Buildings 2023 ,Figure 8 .
Figure 8. BIM models of six cases in different volumes and features.

Figure 8 .
Figure 8. BIM models of six cases in different volumes and features.

3 Figure 11 .
Figure 11.Placement result in irregular rooms of Case 3.

Figure 11 .
Figure 11.Placement result in irregular rooms of Case 3.

Table 1 .
Input and output of the algorithm.

Table 3 .
Statistics of six cases.

Table 4 .
Sizing result in Case 1.