Grid generation method for automatic extraction of fluid domain of hydraulic structure and boundary semantic recognition

By unifying the geometric representation and flow channel identification of the 3D model of hydraulic structures, automatically extracting the fluid domain and performing boundary semantic recognition and mesh generation, the problems of manual dependence and boundary semantic disconnect in the CFD preprocessing of hydraulic structures are solved, and efficient CFD calculation preparation and multi-solver adaptation are achieved.

CN123052186APending Publication Date: 2026-11-06POWER CHINA KUNMING ENG CORP LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611253338.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-08-18
Publication Date
2026-11-06

AI Technical Summary

Technical Problem

In existing technologies, fluid domain construction in the CFD preprocessing of hydraulic structures relies on manual experience, resulting in low efficiency in boundary naming, a disconnect between mesh control strategies and boundary semantics, and a large workload in solver adaptation, leading to low computational efficiency and accuracy.

Method used

By performing unified geometric representation, geometric repair, and potential flow channel identification on the 3D model of hydraulic structures, the fluid computation domain is automatically extracted, and boundary semantic recognition and mesh generation are performed to generate a mesh that meets the requirements of CFD calculation.

Benefits of technology

It achieves automated conversion from structural solid models to CFD computable mesh models, improves preprocessing efficiency and boundary identification accuracy, supports adaptation to multiple CFD solvers, and is suitable for CFD analysis of complex hydraulic structures.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123052186A_ABST
    Figure CN123052186A_ABST
Patent Text Reader

Abstract

This invention belongs to the field of hydraulic engineering technology and relates to a mesh generation method for automatic extraction of fluid domains and semantic recognition of boundaries in hydraulic structures. The method involves acquiring a 3D model of the hydraulic structure and converting it into a unified geometric topology expression, identifying potential flow channels, automatically extracting the fluid computational domain, sealing and patching openings, constructing free liquid surface boundaries, forming a closed or semi-closed fluid domain geometric model, performing semantic recognition on the fluid domain boundary surfaces, generating boundary labels, assigning mesh generation strategies based on the boundary labels, generating surface meshes and volume meshes, establishing topological correspondences, performing mesh quality checks and local repairs, and outputting a CFD solver preprocessing file. This invention achieves full automation from the structural model to the computable fluid mesh, significantly improving preprocessing efficiency, boundary recognition accuracy, and mesh strategy adaptability. It supports multiple solver formats and is suitable for CFD analysis of complex hydraulic structures.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of water conservancy engineering technology and relates to a mesh generation method for automatic extraction of fluid domains and boundary semantic recognition of hydraulic structures. Background Technology

[0002] With the rapid development of water conservancy and hydropower projects, computational fluid dynamics (CFD) technology plays an increasingly important role in the design, hydraulic performance evaluation, and safe operation analysis of hydraulic structures. Various hydraulic structures, such as water diversion tunnels, tailrace tunnels, pressure pipelines, surge tanks, tailrace channels, inlets, outlets, branch pipes, gates, stilling basins, and pump station inlet and outlet pools, all require flow field analysis to obtain key parameters such as velocity distribution, pressure field, water level changes, vortex morphology, local head loss, flow distribution, free surface morphology, and hydraulic stability. Obtaining these hydraulic parameters provides important theoretical basis and technical support for optimal engineering design and safe operation. The primary prerequisite for flow field analysis is completing high-quality CFD preprocessing, including core steps such as fluid domain construction, boundary condition setting, surface mesh generation, volume mesh generation, and solver file configuration.

[0003] In CFD analysis, the 3D models of hydraulic structures, used as input data, primarily originate from BIM models, CAD geometric models, or engineering design platforms. These models typically represent solid components such as concrete structures, lining structures, gate structures, pipe structures, or channel structures, rather than the water fluid domain directly usable for CFD calculations. This difference between the data type and computational requirements constitutes the primary technical obstacle to CFD preprocessing in hydraulic engineering. Currently, engineers typically need to manually extract the water space from the structural entities during CFD preprocessing, performing complex operations such as Boolean difference calculations, opening closure, hole repair, patch arrangement, boundary naming, free surface construction, and mesh parameter settings.

[0004] Existing technologies suffer from the following prominent problems: First, fluid domain construction is highly dependent on human experience. The relationship between the structural model and the fluid computational domain is not a simple one-to-one correspondence. Especially in complex scenarios such as surge tanks, branch pipes, gate openings, tailrace channels, and open channel free surfaces, operators need to comprehensively judge the water space by considering the flow direction, design water level, opening location, and structural relationships. This process is cumbersome and prone to errors in computational domain construction due to human factors. Second, boundary semantic naming is inefficient. Existing software generally only provides geometric surface selection and physical grouping functions. Boundary semantics such as inlet, outlet, wall, free surface, symmetry plane, gate wall, and gate pier wall require manual selection and naming of each surface. When there are many model surfaces or multiple inlets / outlets and multiple local structures, the workload for boundary grouping is large, and problems such as missed selections, incorrect selections, and inconsistent naming are prone to occur. Third, mesh generation strategies are severely disconnected from engineering boundary semantics. Traditional mesh generation typically uses global dimensions, curvature, and boundary layer parameters as primary control conditions. However, the quality of hydraulic CFD meshes is not only related to geometry but also closely linked to boundary type and flow characteristics. Inlet and outlet sections require mesh uniformity, wall surfaces need boundary layer mesh generation, the vicinity of the free surface requires local refinement, and flow-sensitive areas such as branch junctions, sudden expansion / contraction zones, and gate pier wakes require refinement. Existing methods struggle to automatically translate boundary semantics into precise mesh control strategies. Fourth, preprocessing results are difficult to directly adapt to various CFD solvers. Different solvers have different requirements for boundary grouping, mesh format, element topology, boundary type, and region naming. Engineers typically need to manually reorganize and adapt the files after mesh generation, impacting computational efficiency and data consistency. These technical problems severely restrict the efficiency and accuracy of CFD analysis of hydraulic structures. There is an urgent need for a mesh generation method that automatically extracts fluid domain data and identifies boundary semantics for hydraulic structures, enabling automated conversion from structural entity models to CFD-computable mesh models. Summary of the Invention

[0005] The purpose of this invention is to provide a mesh generation method for automatically extracting boundary semantics of the fluid domain in hydraulic structures. This method can effectively solve the technical problems in the existing CFD preprocessing of hydraulic structures, such as fluid domain construction relying on manual experience, low efficiency of boundary naming, disconnect between mesh control strategy and boundary semantics, large workload of solver adaptation, and difficulty in directly adapting preprocessing results to various CFD solvers.

[0006] To achieve the above objectives, the technical solution adopted by the present invention is as follows: A mesh generation method for automatic extraction and semantic recognition of the boundary of the fluid domain in hydraulic structures includes the following specific steps: Step 1: Obtain the 3D model of the hydraulic structure to be processed, and convert the 3D model of the hydraulic structure into a unified geometric topology expression; Step 2: Perform geometric repair and feature filtering on the unified geometric topology expression to obtain the repaired structural entity model and its geometric feature data; Step 3: Identify potential flow channels in the structural entity model based on the geometric feature data to obtain inlet candidate region, outlet candidate region, main flow path, internal obstacle region and fluid connectivity region; Step 4: Based on the potential flow channels, automatically extract the fluid computation domain from the structural entity model; Step 5: Seal and patch the open areas in the fluid computation domain, and construct free liquid surface boundaries according to the design water level or the calculated water level to form a closed or semi-closed fluid domain geometric model. Step 6: Perform semantic recognition on the boundary surfaces of the fluid domain geometric model to generate at least one boundary label among inlet, outlet, solid wall, free liquid surface, symmetry plane, gate wall, gate pier wall, internal interface, and encrypted control area. Step 7: Assign a mesh generation strategy according to the boundary label; generate surface meshes and volume meshes for the fluid domain geometry model according to the mesh generation strategy; and establish the topological correspondence between element, surface, and boundary groups. Step 8: Perform quality checks and local repairs on the generated mesh to obtain a fluid dynamics mesh that meets the requirements of CFD calculations. Output a CFD solver preprocessing file containing fluid domain mesh, boundary semantic grouping, boundary condition recommendation information, and element topology information.

[0007] Preferably, in step 1, the three-dimensional model of the hydraulic structure includes at least one hydraulic structure model selected from the following: water diversion tunnel, tailrace tunnel, pressure pipeline, surge chamber, tailrace channel, inlet, outlet, branch pipe, gate, stilling basin, and pump station inlet and outlet pools. The data format of the three-dimensional model includes at least one of STEP, IGES, SAT, IFC, RVT converted files, STL, OBJ, or custom engineering model formats; the unified geometric topology expression includes the hierarchical topological relationship of entities, shells, faces, loops, edges, and points, and records the area, centroid, normal, curvature, elevation, boundary loop, adjacent face, component name, and engineering attribute information of each geometric face.

[0008] Preferably, in step 2, geometric repair includes at least one of gap merging, duplicate surface deletion, small hole filling, damaged edge repair, non-manifold edge processing, thin surface cleaning, local overlapping surface correction, and small feature filtering; The feature selection further includes retaining key components that affect the flow regime based on the semantics of hydraulic components. The key components include at least one of gate piers, guide walls, diversion piers, bottom sills, cantilever sills, gates, gate slots, branch pipe ribs, and trash racks.

[0009] Preferably, in step 3, the potential flow channel identification includes at least one of opening ring identification, centerline identification, and cavity connectivity domain identification; The open loop identification includes extracting free boundary loops from the unified geometric topology expression, calculating the area, closure error, fitting plane, normal vector, centroid position, and end position of each free boundary loop, and constructing an opening confidence index based on the area, closure error, angle between the normal vector and the local centerline direction, and end position. When the opening confidence index is greater than the preset threshold, the corresponding free boundary ring is determined as an entrance candidate region or an exit candidate region. The opening credibility index Popen is obtained by weighting the opening area normalization score A, opening closure score C, opening normal angle score D and end position score T using weighting coefficients w1, w2, w3 and w4.

[0010] Preferably, the centerline identification includes sampling the inner wall of the suspected flow channel, constructing a cross-sectional point set or distance field based on the sampling points, extracting the flow channel center point sequence, performing curve fitting on the center point sequence to obtain the main path centerline, and constructing a centerline topology map for flow channels with branches. In the centerline topology map, the nodes represent inlet, outlet, bifurcation point, confluence point or cross-sectional control point, and the edges represent main tunnel, branch tunnel, branch pipe or channel flow segment. The cavity connectivity identification includes constructing a bounding volume surrounding the structural entity model, performing a spatial difference operation on the bounding volume and the structural entity model to obtain candidate cavities, and performing connectivity search starting from the inlet candidate region, the outlet candidate region, or a user-specified seed point. Cavity regions connected to the inlet and outlet candidate regions are retained, while dead cavities, construction holes, maintenance cavities, or external air regions that are unrelated to the main path are removed.

[0011] Preferably, in step 4, the extraction method of the fluid computational domain includes at least one of the following: bounding volume Boolean difference extraction, cavity flooding extraction, centerline section sweep extraction, or templated parameter construction. For water diversion tunnels, tailrace tunnels, and pressure pipelines, the centerline cross-section sweep method is preferred for constructing the fluid computation domain; For pressure regulating chambers, tailrace channels, stilling basins, and pump station inlet and outlet pools, the fluid computation domain is constructed primarily using cavity connectivity identification and open closure methods.

[0012] Preferably, in step 5, the opening sealing surface patching includes performing planar fitting on the boundary rings corresponding to the entrance candidate region and the exit candidate region. When the boundary rings meet the planarity requirements, the sealing surface is directly generated based on the boundary rings. When the boundary rings do not meet the planarity requirements, the boundary ring points are projected onto the fitting plane and the sealing surface is generated. The generated sealing surface is stitched with the adjacent wall surface, and the boundary semantic candidate labels of the sealing surface are recorded. The free surface boundary construction includes obtaining the design water level or the calculated water level, constructing a horizontal cutting surface with the design water level or the calculated water level, calculating the intersection line between the horizontal cutting surface and the candidate fluid space, generating a free surface boundary ring based on the intersection line, generating a free surface patch inside the free surface boundary ring, and marking it as a free surface boundary candidate surface.

[0013] Preferably, in step 6, boundary semantic recognition includes at least one of rule-based semantic recognition, face adjacency graph-based semantic recognition, and machine learning model-based semantic recognition. The rule-based semantic recognition includes determining the semantic label of the boundary surface based on whether the boundary surface is a sealing surface, the angle between the boundary surface normal and the main direction, the elevation of the boundary surface, the distance between the boundary surface and the centerline endpoint, whether the boundary surface is a horizontal plane, whether the boundary surface is on the model's symmetry plane, and whether the boundary surface is associated with the attributes of the engineering component. The identification of the entrance and exit includes obtaining the normal vector of the opening and sealing surface and the direction of the local centerline corresponding to its location. When the normal vector is opposite to the main direction, the corresponding sealing surface is identified as the entrance. When the normal vector is consistent with the main direction, the corresponding sealing surface is identified as the exit. The identification of free liquid surfaces includes determining whether the boundary surface normal is close to the vertical direction, whether the boundary surface elevation is close to the design water level or the calculated water level, and whether the boundary surface is located in the upper part of the fluid domain. If the preset conditions are met at the same time, the corresponding boundary surface will be identified as a free liquid surface. For solid wall identification, this includes identifying fluid domain boundary surfaces other than inlets, outlets, free liquid surfaces, symmetry surfaces, and internal interfaces as solid walls, or identifying lining surfaces, channel bottom plates, side walls, gate pier surfaces, gate surfaces, guide wall surfaces, and energy dissipation structure surfaces as solid walls based on structural component semantics.

[0014] Preferably, the semantic recognition based on the surface adjacency graph includes constructing a boundary surface adjacency graph with the fluid domain boundary surface as the graph node and the shared edge relationship or spatial adjacency relationship between the boundary surfaces as the graph edge. For each graph node, node features are constructed including area, normal, elevation, curvature, distance from the centerline, distance from the inlet / outlet, whether it is a sealing surface, whether it is a horizontal surface, and the attributes of the component to which it belongs. Based on the node features and adjacency relationship, boundary semantic labels are output. The semantic recognition based on the machine learning model includes extracting the geometric parameters, topological adjacency relationships, multi-view rendered image features, and engineering attribute text features of the boundary surface. The geometric parameters, topological adjacency relationships, multi-view rendered image features, and engineering attribute text features are input into the trained semantic recognition model, and the semantic label probability of the boundary surface is output. When the probability of the highest semantic label is lower than the preset confidence threshold, rule-based semantic recognition is invoked to correct the error or a manual confirmation prompt is output.

[0015] Preferably, in step 7, the mesh generation strategy includes at least one of the following: inlet / outlet cross-section densification strategy, wall boundary layer strategy, free surface densification strategy, branch pipe intersection zone densification strategy, bend densification strategy, sudden expansion / contraction zone densification strategy, and internal obstacle wake zone densification strategy. The mesh generation strategy includes at least one of the following: global size field, curvature size field, boundary semantic size field, near-wall boundary layer size field, free liquid surface densification size field, and flow-sensitive region size field. The local mesh size h(x) is determined by taking the minimum value of the global base size h0, curvature control size hc(x), boundary semantic control size hs(x), near-wall boundary layer control size hw(x), free surface control size hfs(x), and flow-sensitive region control size hr(x). The inlet and outlet cross-section densification strategy includes setting local mesh sizes smaller than the global base size for the inlet and outlet surfaces, and setting downstream densification zones and upstream densification zones for the outlet along the main flow direction to ensure uniform mesh distribution and smooth transition with adjacent volume meshes. The wall boundary layer strategy includes calculating the first layer height based on the wall boundary label, target y+, flow velocity, fluid density, dynamic viscosity or empirical friction velocity, setting the number of boundary layer layers, growth rate and total thickness according to the calculation model requirements, generating prism layers or near-wall densification layers on the wall, and performing boundary layer compression, merging or local reconstruction on narrow gaps, sharp corners, intersections and local curvature abrupt regions. The free liquid surface densification strategy includes setting a strip densification zone within a preset range above and below the free liquid surface according to the free liquid surface boundary label or the design water level, and setting a local densification size for the free liquid surface areas such as the inlet air intake vortex, the pressure regulating chamber water surface fluctuation, the open channel free liquid surface and the tailrace channel water surface area. The flow-sensitive area size field includes at least one local area of ​​intensified control, such as the branch pipe intersection area, bend, sudden expansion area, sudden contraction area, gate pier wake area, gate opening, sill, bottom sill, stilling basin, and inlet vortex area.

[0016] Preferably, in step 7, the volume mesh generation method includes at least one of the following: centerline swept hexahedral mesh generation, unstructured tetrahedral mesh generation, polyhedral mesh generation, prism boundary layer hybrid mesh generation, and octree cut-cell mesh generation; For water diversion tunnels, tailrace tunnels, and pressure pipelines, O-type, H-type, or C-type cross-sectional topologies are generated based on the centerline and cross-sectional sequence, and structured or semi-structured hexahedral meshes are generated by sweeping along the centerline. For fluid domains such as surge tanks, tailrace channels, stilling basins, and pools, surface meshes are generated based on boundary semantic size fields and filled with tetrahedral, polyhedral, or hybrid meshes. For complex, large-scale fluid domains, boundary cutting is performed based on the background octree mesh to generate a cut-cell mesh, and excessively small cut cells are merged or locally reconstructed.

[0017] Preferably, in step 8, the mesh quality check includes a closure check, a boundary semantic consistency check, and a mesh cell quality check; the closure check includes checking free edges, non-manifold edges, isolated cavities, normal consistency, and inlet / outlet connectivity. The boundary semantic consistency check includes checking for the existence of unclassified boundary surfaces, whether inlet and outlet are missing, whether the free surface elevation is reasonable, whether the outlet normal is consistent with the outflow direction, and whether the boundary grouping is continuous; the grid cell quality check includes at least one of skewness, non-orthogonality, aspect ratio, volume ratio, minimum volume, boundary layer growth rate, and prism layer collapse rate. When the local mesh does not meet the quality threshold, perform at least one of the following repair operations: local smoothing, local re-subdivision, local refinement, small volume element merging, surface normal correction, boundary layer compression, or boundary layer reconstruction.

[0018] Preferably, in step 8, the CFD solver preprocessing file includes at least one of Fluent mesh file, OpenFOAM mesh file, CGNS file, VTK file, or custom solver mesh file; The recommended boundary conditions include at least one of the following: velocity inlet, flow inlet, pressure outlet, outflow boundary, solid wall, rough wall surface, free liquid surface, symmetry plane, porous media interface, and internal region interface.

[0019] Compared with the prior art, the present invention has the following beneficial effects: 1. Automated fluid domain construction capability: This invention achieves the function of automatically identifying potential flow channels and inversely calculating the fluid computation domain from the structural entity model by performing unified geometric expression, geometric repair, potential flow channel identification, and automatic fluid domain extraction on the three-dimensional model of hydraulic structures. This effectively reduces the workload of tedious operations such as manually performing Boolean difference operations, opening closure, hole repair, surface preparation, and fluid domain construction in traditional methods, and significantly improves the efficiency of CFD preprocessing.

[0020] 2. Intelligent boundary semantic recognition capability: This invention combines rule-based semantic recognition, face adjacency graph-based semantic recognition, and machine learning model-based semantic recognition to automatically identify CFD boundary types such as inlet, outlet, solid wall, free liquid surface, and symmetry plane based on open loop features, centerline direction, design water level, boundary surface elevation, normal relationship, and engineering component semantics. This effectively reduces the problems of omission, incorrect selection, and inconsistent naming that are prone to occur in the manual face-by-face selection and naming process, and improves the accuracy and consistency of boundary grouping.

[0021] 3. Semantic-driven mesh strategy allocation capability: This invention achieves integrated automatic control of inlet and outlet section densification, wall boundary layer generation, free liquid surface densification, and densification of flow-sensitive areas such as branch pipe junctions, bends, sudden expansion and contraction zones, and gate pier wake zones by directly using boundary semantic recognition results for mesh size field and mesh strategy allocation. This enables the generated mesh to better adapt to the special mesh quality requirements of hydraulic CFD calculations and improves the reliability of numerical simulation results.

[0022] 4. Multi-solver adaptation output capability: This invention can automatically output CFD solver preprocessing files containing fluid domain mesh, boundary semantic grouping, boundary condition recommendation information, and element topology relationships. It supports the file format requirements of multiple mainstream CFD solvers such as Fluent, OpenFOAM, CGNS, and VTK, which is conducive to engineers to quickly carry out calculations and avoids the problem of manually organizing adaptation files after mesh generation in traditional methods, significantly improving computational efficiency and data consistency.

[0023] 5. Wide engineering applicability: This invention is applicable to various complex hydraulic structures such as water diversion tunnels, tailrace tunnels, pressure pipelines, surge chambers, tailrace channels, inlets, outlets, branch pipes, gates, stilling basins, and pump station inlet and outlet pools. It has strong engineering adaptability and application value, and can meet the pre-processing requirements of CFD analysis for various types of hydraulic structures in water conservancy and hydropower projects.

[0024] This invention belongs to the field of hydraulic engineering technology and relates to a mesh generation method for automatic extraction of fluid domains and semantic recognition of boundaries in hydraulic structures. The method involves acquiring a 3D model of the hydraulic structure and converting it into a unified geometric topology expression, identifying potential flow channels, automatically extracting the fluid computational domain, sealing and patching openings, constructing free liquid surface boundaries, forming a closed or semi-closed fluid domain geometric model, performing semantic recognition on the fluid domain boundary surfaces, generating boundary labels, assigning mesh generation strategies based on the boundary labels, generating surface meshes and volume meshes, establishing topological correspondences, performing mesh quality checks and local repairs, and outputting a CFD solver preprocessing file. This invention achieves full automation from the structural model to the computable fluid mesh, significantly improving preprocessing efficiency, boundary recognition accuracy, and mesh strategy adaptability. It supports multiple solver formats and is suitable for CFD analysis of complex hydraulic structures. Attached Figure Description

[0025] Figure 1 is a flowchart of a mesh generation method for automatic extraction of fluid domain and boundary semantic recognition of hydraulic structures provided by an embodiment of the present invention; Figure 2 is a schematic diagram of the unified geometric topology of the three-dimensional model of the mesh generation method for automatic extraction of fluid domain and boundary semantic recognition of hydraulic structures provided in an embodiment of the present invention. Figure 3 is a schematic diagram of the potential flow channel identification and automatic fluid domain extraction process of the mesh generation method for automatic extraction of fluid domain and boundary semantic recognition of hydraulic structures provided in an embodiment of the present invention. Figure 4 is a schematic diagram of the boundary semantic recognition process of the mesh generation method for automatic extraction of fluid domain and boundary semantic recognition of hydraulic structures provided in an embodiment of the present invention. Figure 5 is a schematic diagram of semantically driven mesh size field generation for the mesh generation method of automatic extraction of fluid domain and boundary semantic recognition of hydraulic structures provided in an embodiment of the present invention. Detailed Implementation

[0026] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of this application, and not all of the embodiments. Based on the embodiments of this application, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of this application.

[0027] The terms "first," "second," and "third" in this application are for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated. Therefore, a feature defined as "first," "second," or "third" may explicitly or implicitly include at least one of those features. In the description of this application, "multiple" means at least two, such as two, three, etc., unless otherwise explicitly specified. All directional indications in the embodiments of this application, such as up, down, left, right, front, back, etc., are only used to explain the relative positional relationships and movements between components in a specific orientation as shown in the accompanying drawings. If the specific orientation changes, the directional indications will change accordingly. Furthermore, the terms "including" and "having," and any variations thereof, are intended to cover non-exclusive inclusion. For example, a process, method, product, or device that includes a series of steps or units is not limited to the listed steps or units, but may optionally include steps or units not listed, or may optionally include other steps or units inherent to these processes, methods, products, or devices.

[0028] References to embodiments herein mean that a particular feature, structure, or characteristic described in connection with an embodiment may be included in at least one embodiment of this application. The appearance of this phrase in various places throughout the specification does not necessarily refer to the same embodiment, nor is it a mutually exclusive, independent, or alternative embodiment. It will be explicitly and implicitly understood by those skilled in the art that the embodiments described herein can be combined with other embodiments.

[0029] According to the first embodiment of the present invention, referring to Figure 1 This invention claims protection for a mesh generation method for automatic extraction of fluid domains and boundary semantic recognition in hydraulic structures, comprising the following steps: Step 1: Obtain the 3D model of the hydraulic structure to be processed, and convert the 3D model of the hydraulic structure into a unified geometric topology expression; Step 2: Perform geometric repair and feature filtering on the unified geometric topology expression to obtain the repaired structural entity model and its geometric feature data; Step 3: Identify potential flow channels in the structural entity model based on the geometric feature data to obtain inlet candidate region, outlet candidate region, main flow path, internal obstacle region and fluid connectivity region; Step 4: Based on the potential flow channels, automatically extract the fluid computation domain from the structural entity model; Step 5: Seal and patch the open areas in the fluid computation domain, and construct free liquid surface boundaries according to the design water level or the calculated water level to form a closed or semi-closed fluid domain geometric model. Step 6: Perform semantic recognition on the boundary surfaces of the fluid domain geometric model to generate at least one boundary label among inlet, outlet, solid wall, free liquid surface, symmetry plane, gate wall, gate pier wall, internal interface, and encrypted control area. Step 7: Assign a mesh generation strategy according to the boundary label; generate surface meshes and volume meshes for the fluid domain geometry model according to the mesh generation strategy; and establish the topological correspondence between element, surface, and boundary groups. Step 8: Perform quality checks and local repairs on the generated mesh to obtain a fluid dynamics mesh that meets the requirements of CFD calculations. Output a CFD solver preprocessing file containing fluid domain mesh, boundary semantic grouping, boundary condition recommendation information, and element topology information.

[0030] Furthermore, in step 1, the three-dimensional model of the hydraulic structure includes at least one hydraulic structure model among water diversion tunnel, tailrace tunnel, pressure pipeline, surge chamber, tailrace channel, inlet, outlet, branch pipe, gate, stilling basin, and pump station inlet and outlet pools. The data format of the three-dimensional model includes at least one of STEP, IGES, SAT, IFC, RVT converted file, STL, OBJ or custom engineering model format; The unified geometric topology representation includes hierarchical topological relationships of entities, shells, faces, loops, edges, and points, and records the area, centroid, normal, curvature, elevation, boundary loops, adjacent faces, component name, and engineering attribute information of each geometric face. Figure 2 This is a schematic diagram illustrating the unified geometric topology representation of a three-dimensional model of a hydraulic structure provided in an embodiment of the present invention.

[0031] Furthermore, in step 2, geometric repair includes at least one of the following: gap merging, duplicate surface deletion, small hole filling, damaged edge repair, non-manifold edge processing, thin surface cleaning, local overlapping surface correction, and small feature filtering; The feature selection further includes retaining key components that affect the flow regime based on the semantics of hydraulic components. The key components include at least one of gate piers, guide walls, diversion piers, bottom sills, cantilever sills, gates, gate slots, branch pipe ribs, and trash racks.

[0032] Furthermore, in step 3, the potential flow channel identification includes at least one of opening ring identification, centerline identification, and cavity connectivity domain identification; The open loop identification includes extracting free boundary loops from the unified geometric topology expression, calculating the area, closure error, fitting plane, normal vector, centroid position, and end position of each free boundary loop, and constructing an opening confidence index based on the area, closure error, angle between the normal vector and the local centerline direction, and end position. When the opening confidence index is greater than the preset threshold, the corresponding free boundary ring is determined as an entrance candidate region or an exit candidate region. The opening credibility index Popen is obtained by weighting the opening area normalization score A, opening closure score C, opening normal angle score D and end position score T using weighting coefficients w1, w2, w3 and w4.

[0033] The centerline identification includes sampling the inner wall of the suspected flow channel, constructing a cross-sectional point set or distance field based on the sampling points, extracting the flow channel center point sequence, performing curve fitting on the center point sequence to obtain the main path centerline, and constructing a centerline topology map for flow channels with branches. The nodes in the centerline topology map represent inlet, outlet, bifurcation point, confluence point or cross-sectional control point, and the edges represent main tunnel, branch tunnel, branch pipe or channel flow segment. The cavity connectivity identification includes constructing a bounding volume surrounding the structural entity model, performing a spatial difference operation on the bounding volume and the structural entity model to obtain candidate cavities, and performing connectivity search starting from the inlet candidate region, the outlet candidate region, or a user-specified seed point. Cavity regions connected to the inlet and outlet candidate regions are retained, while dead cavities, construction holes, maintenance cavities, or external air regions that are unrelated to the main path are removed.

[0034] Furthermore, in step 4, the extraction method of the fluid computational domain includes at least one of the following: bounding volume Boolean difference extraction, cavity flooding extraction, centerline section sweep extraction, or templated parameter construction. For water diversion tunnels, tailrace tunnels, and pressure pipelines, the centerline cross-section sweep method is preferred for constructing the fluid computation domain; For pressure regulating chambers, tailrace channels, stilling basins, and pump station inlet and outlet pools, the fluid computation domain is constructed primarily using cavity connectivity identification and open closure methods.

[0035] Further, in step 5, the opening sealing surface repair includes performing planar fitting on the boundary rings corresponding to the entrance candidate region and the exit candidate region. When the boundary ring meets the planarity requirement, the sealing surface is directly generated based on the boundary ring. When the boundary ring does not meet the planarity requirement, the boundary ring points are projected onto the fitting plane and the sealing surface is generated. The generated sealing surface is stitched with the adjacent wall surface, and the boundary semantic candidate label of the sealing surface is recorded. The free surface boundary construction includes obtaining the design water level or the calculated water level, constructing a horizontal cutting surface with the design water level or the calculated water level, calculating the intersection line between the horizontal cutting surface and the candidate fluid space, generating a free surface boundary ring based on the intersection line, generating a free surface patch inside the free surface boundary ring, and marking it as a free surface boundary candidate surface.

[0036] Furthermore, in step 6, boundary semantic recognition includes at least one of rule-based semantic recognition, face adjacency graph-based semantic recognition, and machine learning model-based semantic recognition; The rule-based semantic recognition includes determining the semantic label of the boundary surface based on whether the boundary surface is a sealing surface, the angle between the boundary surface normal and the main direction, the elevation of the boundary surface, the distance between the boundary surface and the centerline endpoint, whether the boundary surface is a horizontal plane, whether the boundary surface is on the model's symmetry plane, and whether the boundary surface is associated with the attributes of the engineering component. The identification of the entrance and exit includes obtaining the normal vector of the opening and sealing surface and the direction of the local centerline corresponding to its location. When the normal vector is opposite to the main direction, the corresponding sealing surface is identified as the entrance. When the normal vector is consistent with the main direction, the corresponding sealing surface is identified as the exit. The identification of free liquid surfaces includes determining whether the boundary surface normal is close to the vertical direction, whether the boundary surface elevation is close to the design water level or the calculated water level, and whether the boundary surface is located in the upper part of the fluid domain. If the preset conditions are met at the same time, the corresponding boundary surface will be identified as a free liquid surface. For solid wall identification, this includes identifying fluid domain boundary surfaces other than inlets, outlets, free liquid surfaces, symmetry surfaces, and internal interfaces as solid walls, or identifying lining surfaces, channel bottom plates, side walls, gate pier surfaces, gate surfaces, guide wall surfaces, and energy dissipation structure surfaces as solid walls based on structural component semantics.

[0037] The semantic recognition based on the surface adjacency graph includes constructing a boundary surface adjacency graph with the fluid domain boundary surface as the graph node and the shared edge relationship or spatial adjacency relationship between the boundary surfaces as the graph edge. It also constructs node features for each graph node, including area, normal, elevation, curvature, distance from the centerline, distance from the inlet / outlet, whether it is a sealed surface, whether it is a horizontal surface, and the attributes of the component to which it belongs. Based on the node features and adjacency relationship, it outputs boundary semantic labels. The semantic recognition based on the machine learning model includes extracting the geometric parameters, topological adjacency relationships, multi-view rendered image features, and engineering attribute text features of the boundary surface. The geometric parameters, topological adjacency relationships, multi-view rendered image features, and engineering attribute text features are input into the trained semantic recognition model, and the semantic label probability of the boundary surface is output. When the probability of the highest semantic label is lower than the preset confidence threshold, rule-based semantic recognition is invoked to correct the error or a manual confirmation prompt is output.

[0038] Furthermore, in step 7, the mesh generation strategy includes at least one of the following: inlet / outlet cross-section densification strategy, wall boundary layer strategy, free liquid surface densification strategy, branch pipe intersection zone densification strategy, bend densification strategy, sudden expansion / contraction zone densification strategy, and internal obstacle wake zone densification strategy. The mesh generation strategy includes at least one of the following: global size field, curvature size field, boundary semantic size field, near-wall boundary layer size field, free liquid surface densification size field, and flow-sensitive region size field. The local mesh size h(x) is determined by taking the minimum value of the global base size h0, curvature control size hc(x), boundary semantic control size hs(x), near-wall boundary layer control size hw(x), free surface control size hfs(x), and flow-sensitive region control size hr(x). The inlet and outlet cross-section densification strategy includes setting local mesh sizes smaller than the global base size for the inlet and outlet surfaces, and setting downstream densification zones and upstream densification zones for the outlet along the main flow direction to ensure uniform mesh distribution and smooth transition with adjacent volume meshes. The wall boundary layer strategy includes calculating the first layer height based on the wall boundary label, target y+, flow velocity, fluid density, dynamic viscosity or empirical friction velocity, setting the number of boundary layer layers, growth rate and total thickness according to the calculation model requirements, generating prism layers or near-wall densification layers on the wall, and performing boundary layer compression, merging or local reconstruction on narrow gaps, sharp corners, intersections and local curvature abrupt regions. The free liquid surface densification strategy includes setting a strip densification zone within a preset range above and below the free liquid surface according to the free liquid surface boundary label or the design water level, and setting a local densification size for the free liquid surface areas such as the inlet air intake vortex, the pressure regulating chamber water surface fluctuation, the open channel free liquid surface and the tailrace channel water surface area. The flow-sensitive area size field includes at least one local area of ​​intensified control, such as the branch pipe intersection area, bend, sudden expansion area, sudden contraction area, gate pier wake area, gate opening, sill, bottom sill, stilling basin, and inlet vortex area.

[0039] Furthermore, in step 7, the volume mesh generation method includes at least one of the following: centerline swept hexahedral mesh generation, unstructured tetrahedral mesh generation, polyhedral mesh generation, prism boundary layer hybrid mesh generation, and octree cut-cell mesh generation; For water diversion tunnels, tailrace tunnels, and pressure pipelines, O-type, H-type, or C-type cross-sectional topologies are generated based on the centerline and cross-sectional sequence, and structured or semi-structured hexahedral meshes are generated by sweeping along the centerline. For fluid domains such as surge tanks, tailrace channels, stilling basins, and pools, surface meshes are generated based on boundary semantic size fields and filled with tetrahedral, polyhedral, or hybrid meshes. For complex, large-scale fluid domains, boundary cutting is performed based on the background octree mesh to generate a cut-cell mesh, and excessively small cut cells are merged or locally reconstructed.

[0040] Furthermore, in step 8, the mesh quality check includes closure check, boundary semantic consistency check, and mesh cell quality check; the closure check includes checking free edges, non-manifold edges, isolated cavities, normal consistency, and inlet / outlet connectivity; The boundary semantic consistency check includes checking for the existence of unclassified boundary surfaces, whether inlet and outlet are missing, whether the free surface elevation is reasonable, whether the outlet normal is consistent with the outflow direction, and whether the boundary grouping is continuous; the grid cell quality check includes at least one of skewness, non-orthogonality, aspect ratio, volume ratio, minimum volume, boundary layer growth rate, and prism layer collapse rate. When the local mesh does not meet the quality threshold, perform at least one of the following repair operations: local smoothing, local re-meshment, local refinement, small volume element merging, surface normal correction, boundary layer compression, or boundary layer reconstruction. The CFD solver preprocessing file includes at least one of the following: Fluent mesh file, OpenFOAM mesh file, CGNS file, VTK file, or custom solver mesh file; The recommended boundary conditions include at least one of the following: velocity inlet, flow inlet, pressure outlet, outflow boundary, solid wall, rough wall surface, free liquid surface, symmetry plane, porous media interface, and internal region interface.

[0041] This embodiment relates to a mesh generation method for automatic fluid domain extraction and boundary semantic recognition in hydraulic structures. The method covers the complete technical flow from inputting a 3D model of the hydraulic structure to outputting a CFD solver preprocessing file, including ten core steps: establishing a unified geometric topology representation, geometric repair and feature selection, potential flow channel identification, automatic extraction of the fluid computational domain, construction of opening closures and free surfaces, boundary semantic recognition, semantic-driven mesh strategy allocation, surface and volume mesh generation, mesh quality checking and local repair, and outputting the CFD solver preprocessing file.

[0042] Step S1: Obtain the 3D model of the hydraulic structure and convert it into a unified geometric topology representation. The method supports reading 3D model data of hydraulic structures in multiple formats. The data format of the 3D model includes at least one of the following: STEP format, IGES format, SAT format, IFC format, RVT conversion file format, STL format, OBJ format, or a custom engineering model format. The 3D model of the hydraulic structure includes at least one of the following hydraulic structure models: water diversion tunnel, tailrace tunnel, pressure pipeline, surge tank, tailrace channel, inlet, outlet, branch pipe, gate, stilling basin, and pump station inlet and outlet pools.

[0043] After reading the original 3D model file, the method performs a geometric kernel transformation, converting the model data into an internal unified geometric topology representation data structure. This unified geometric topology representation employs a hierarchical topology organization, sequentially including entity level, shell level, face level, ring level, edge level, and point level from high to low dimensions. The entity level records the overall geometric and topological information of the 3D entity; the shell level records the set of boundary shell faces of the entity; the face level records the complete information of each geometric face, including the face's geometric parameters and topological adjacency relationships; the ring level records the constituent edges and points of each face's boundary ring; the edge level records the coordinates of the two endpoints and curve parameters of each edge; and the point level records the 3D coordinates of each vertex.

[0044] During the establishment of the unified geometric topology representation, the method calculates and stores the following attribute information for each geometric surface: geometric area, obtained by summing the triangular facets constituting the surface; geometric centroid, calculated based on the area-weighted average of the surface centroid coordinates; surface normal, obtained by the area-weighted average of the surface normals or by differentiation based on surface parameters; principal curvature and secondary curvature, obtained by eigenvalue analysis of the second derivative matrix of the surface; average elevation, determined based on the arithmetic mean or area-weighted average of the z-coordinates of the surface vertices; boundary ring identifier, recording the numbers of all boundary rings that the surface participates in; adjacent surface list, recording the numbers of all adjacent surfaces that share a common edge with the surface; component name, recording the structural component or component combination to which the surface belongs in the original model; engineering attribute information, recording the extended attributes of the surface such as material type, surface roughness, and design function.

[0045] The method simultaneously constructs a face-to-face adjacency graph data structure. This structure uses geometric faces as graph nodes and shared edges between faces as graph edges, establishing a topological connectivity index between fluid domain boundary faces. This index supports neighborhood propagation calculations and graph traversal operations in subsequent boundary semantic recognition processes. For complex models, the method also establishes a hierarchical component tree structure to record the assembly relationships and spatial dependencies between components in the model, providing a structured data foundation for subsequent feature selection and component semantic recognition.

[0046] Step S2: Perform geometric repair and feature filtering on the unified geometric topology representation. The input original 3D model usually has various geometric defects and topological problems. If these problems are not addressed, they will affect the accuracy of subsequent flow channel identification and fluid domain extraction. The method performs a methodological geometric repair operation on the unified geometric topology representation to eliminate defects in the model and obtain a high-quality structural entity model and its geometric feature data.

[0047] The geometric repair operation comprises at least one or more of the following sub-steps: Gap merging is implemented. The method detects gaps between faces in the model. For adjacent edges or faces with a spacing less than a preset geometric tolerance threshold, the method determines the gap type based on the normal relationship and relative position of the geometric faces on both sides of the gap. For coplanar or nearly coplanar gaps, the method eliminates the gap by extending and re-stitching the face patches; for gaps with minor misalignments, the method restores topological continuity by redefining edges and reconstructing face patches. The geometric tolerance threshold is set according to the model accuracy requirements, typically ranging from 0.01% to 0.1% of the model feature size.

[0048] Duplicate face removal. The method detects duplicate faces with overlapping or partially overlapping areas in the model. For duplicate faces with overlapping areas exceeding a preset threshold, the method retains the most representative one based on the face's origin attribute, normal consistency, and the semantics of the component to which it belongs, and deletes the remaining redundant faces. The overlap ratio threshold typically ranges from 0.8 to 0.95. For completely overlapping faces with opposite normals, the method determines it as an incorrect face flip and performs a face normal unification operation.

[0049] Small hole filling processing. The method identifies hole regions in the model. Holes are divided into two categories: internal holes and boundary holes. Internal holes are usually caused by missing facets or triangulation errors. The method fills them by plane fitting of the hole boundary loop and generating a minimum area filling surface. Boundary holes require further assessment of their engineering significance: if the boundary hole is a flow channel opening in a hydraulic structure or a reserved opening in the project, the method retains the hole as a potential inlet or outlet; if the boundary hole is an omission in model repair or a geometric error, the method performs a filling operation. The criterion for small holes is that the hole area is less than 0.01% to 0.1% of the main surface area of ​​the model.

[0050] Damaged edge repair. The method detects damaged edges in the model. Damaged edges include dangling edges, degenerate edges, and self-intersecting edges. Dangling edges are edges belonging to only one face; the method eliminates dangling edges through face extension or edge stitching. Degenerate edges are short edges with near-zero length or repeated vertices; the method repairs degenerate edges through vertex merging and edge folding. Self-intersecting edges are abnormal intersections between edges or between edges and faces; the method eliminates self-intersections through local reconstruction.

[0051] Non-manifold edge handling. The method detects non-manifold edges in the model. A non-manifold edge is a shared edge that belongs to three or more faces simultaneously, or an edge that belongs to two non-adjacent faces simultaneously. For non-manifold edges, the method re-segments the local topology and restores the manifold structure through edge splitting, face separation, or local reconstruction.

[0052] Thin-surface cleanup. The method detects thin surfaces in the model whose thickness is much smaller than the model's feature size. Thin surfaces are usually caused by model simplification or transformation errors. The method determines whether cleanup is necessary based on the area ratio and geometric location of the thin surface. For isolated small-area thin surfaces, the method performs deletion and fills the voids by extending surrounding surfaces; for large-area thin surfaces, the method restores solid integrity through surface merging and geometric reconstruction.

[0053] Local overlapping surface correction. The method detects local overlapping regions between faces in the model. Overlapping regions may be caused by model transformation errors or legacy Boolean operations. The method eliminates overlaps by trimming and re-stitching face patches, restoring the correct topological boundaries.

[0054] Feature filtering is performed after geometric repair. The method classifies and filters geometric features according to semantic rules of hydraulic components. The method identifies and retains key components that affect the flow regime, including gate piers, guide walls, diversion piers, sills, cantilever sills, gates, gate slots, branch pipe ribs, and trash racks. The method performs geometric fidelity processing on these key components to ensure that their boundary details and flow-sensitive features are not simplified. For geometric details that do not affect flow calculations, including small chamfers, small bolt holes, small embedded parts, small decorative components, and local surface irregularities, the method performs simplification processing. Simplification methods include geometric surface merging, small feature elimination, and curvature smoothing. The control parameters for the degree of simplification include the simplified feature size threshold and the curvature variation tolerance.

[0055] The method generates a structural entity model after geometric repair and feature filtering, and outputs a geometric feature dataset. The geometric feature data includes the geometric parameters of each facet, topological adjacency relationships, semantic labels of the associated components, key component identifiers, and simplified operation records. This dataset provides structured input for subsequent potential flow channel identification.

[0056] Step S3: Identify potential flow channels based on geometric feature data. The method performs flow channel analysis on the repaired structural entity model to identify potential flow channel regions within the model. Potential flow channel identification includes three core identification strategies: open loop identification, centerline identification, and cavity connectivity domain identification. The method selects one or more strategies in combination to perform the identification based on the model's structural characteristics.

[0057] An opening loop identification strategy is used to identify possible entry and exit regions in the model. The method retrieves free boundary loops within a unified geometric topology representation. A free boundary loop is defined as a cycle of boundary edges belonging to only one geometric surface. In the model topology, free boundary loops correspond to boundary contours formed by cuts or openings on the model surface. After extracting all free boundary loops, the method calculates the following geometric properties for each loop: Opening area calculation. For each free boundary loop, the method constructs a closed polygonal planar region using the coordinate data of the edges and points that make up the boundary loop. The area is calculated using the Gaussian area formula or the triangulated surface accumulation method. For non-planar boundary loops, the method first projects the boundary loop onto the fitted plane and then calculates the projected area. The normalized score A of the opening area is determined based on the ratio of the opening area to the overall size of the model. A typical calculation method is that A equals the quotient of the opening area divided by the surface area of ​​the circumscribed sphere of the model.

[0058] Closure calculation. The method calculates the ratio of the actual length of the boundary loop to the perimeter of the fitted ellipse or polygon. The closure score C reflects the regularity of the boundary loop; the closure of an ideal circle or ellipse boundary loop is close to 1.0. The formula for calculating closure is that C equals the normalized result of the ratio of the reciprocal of the actual length of the boundary loop to the fitted perimeter.

[0059] Calculation of the opening normal. The method involves performing plane fitting on the points constituting the boundary loop to obtain the normal vector of the fitted plane. Plane fitting employs either the least squares method or singular value decomposition. The direction of the normal vector is determined according to the right-hand rule, ensuring that the normal vector points into the fluid domain. The angle between the opening normal and the local centerline direction is calculated using the vector dot product.

[0060] Calculation of the centroid and end positions of the openings. The method involves calculating the area centroid coordinates of the boundary loop. For non-planar boundary loops, the centroid is the arithmetic mean of the coordinates of all component points. The end positions are used to determine the relative positional relationship of the openings within the model.

[0061] Based on the above attributes, the method constructs an opening confidence index, Popen. The opening confidence index comprehensively evaluates the probability that a free boundary loop will become a true flow channel inlet or outlet. The opening confidence index Popen is calculated using the following formula: Popen = w 1 A + w 2 C + w 3 D + w 4 T in, Popen As an indicator of the credibility of the opening, A The score is the normalized score for the opening area, with a value ranging from 0 to 1. C The score represents the degree of opening closure, with a value ranging from 0 to 1. D The score is the angle between the opening normal and the local centerline direction, with a value ranging from 0 to 1. T The score is given for the end position, with a value ranging from 0 to 1. w 1. w 2. w 3.w 4 is the weighting coefficient, which satisfies w 1 + w 2+ w 3 + w The condition 4 = 1. The weighting coefficient is set according to the type and characteristics of the hydraulic structure, and the typical value range is... w 1. Take 0.3 to 0.4. w 2. Take 0.2 to 0.3. w 3. Take 0.2 to 0.3. w 4. Take a value of 0.1 to 0.2.

[0062] When the open credibility index Popen When the value exceeds the preset threshold, the system will identify the corresponding free boundary ring as an entry candidate region or an exit candidate region. The preset threshold typically ranges from 0.5 to 0.7, and can be adjusted according to the complexity of the model and the requirements for recognition accuracy.

[0063] A centerline identification strategy is used to extract spatial paths within the flow channel. The method samples the suspected inner wall surface of the flow channel. Sampling methods include uniform sampling based on the distance field, adaptive sampling based on curvature, or cross-sectional sampling based on projection. The method constructs a cross-sectional point set or distance field based on the sampled points. The cross-sectional point set is obtained by intersecting the inner wall surface of a cutting plane perpendicular to the suspected flow direction. The distance field is constructed by solving for the shortest distance from each point in the fluid domain to the flow channel wall.

[0064] The method extracts the flow channel center point sequence from a cross-sectional point set or a distance field. For each cross-section, the center point is taken as the centroid of the cross-sectional point set or the location of the local maximum of the distance field. The center points of adjacent cross-sections are connected by spatial lines to form a center point sequence. The method performs curve fitting on the center point sequence. Curve fitting uses B-spline curves, NURBS curves, or piecewise polynomial curves. The fitting process includes parameterization, basis function selection, and least squares optimization. The fitted curve is the flow channel centerline. For flow channels with branches, the method constructs a centerline topology graph. The data structure of the centerline topology graph uses the centerline endpoints, bifurcation points, and confluence points as graph nodes, and the centerline segments as graph edges. Graph nodes record node type, spatial coordinates, and connecting edge numbers; graph edges record edge type, main or branch hole identifier, edge length, and curve parameters. The centerline topology graph can accurately represent the topology of branch pipes, multiple branches, and complex connected regions.

[0065] A cavity connectivity identification strategy is used to identify fluid spaces within closed or semi-closed structures. The method constructs a bounding volume surrounding the structural entity model. The bounding volume can take the form of an axis-aligned bounding box, a directional bounding box, or a convex hull. The size of the bounding volume is slightly larger than the model's circumscribed dimension, typically 1.05 to 1.2 times the circumscribed dimension. The method performs a spatial difference operation between the bounding volume and the structural entity model. The spatial difference operation is implemented using Boolean subtraction, and the result is the candidate cavity region located inside the bounding volume but outside the structural entity.

[0066] The method starts from the candidate inlet region, candidate outlet region, or user-specified seed point and performs a connected component search on candidate cavities. The connected component search employs either a flooding-fill algorithm or a graph traversal algorithm. During the search, the method determines the connectivity of each region based on its spatial adjacency and topological connectivity. The method retains cavity regions connected to the candidate inlet and outlet regions as mainstream path connected regions. The method removes isolated regions unrelated to the mainstream path, including dead cavities, construction holes, maintenance cavities, or external air regions. A dead cavity is defined as a region that is not connected to any inlet or outlet. Construction holes and maintenance cavities are identified using a hole area threshold and geometric feature matching.

[0067] Step S4: Extracting the fluid computational domain based on potential flow channels. The method automatically extracts the fluid computational domain from the structural entity model based on the potential flow channel information identified in Step S3. The fluid computational domain extraction methods include four main approaches: bounding volume Boolean difference extraction, cavity flooding extraction, centerline section sweep extraction, and templated parameter construction. The method selects the most suitable extraction method or combination of methods based on the flow channel type and geometric characteristics. Figure 3 is a schematic diagram of the potential flow channel identification and automatic fluid domain extraction process provided in this embodiment of the invention.

[0068] The bounding volume Boolean difference extraction method is suitable for fluid spaces within closed structures. The method constructs a bounding box or bounding surface that completely encloses the structural entity. The bounding box is a cuboid composed of six axis-aligned planes, and the bounding surface is an outer surface slightly larger than the entity. The method performs a spatial Boolean difference operation between the bounding volume and the structural entity. The result of the Boolean difference operation is the remaining region after subtracting the space occupied by the structural entity from the interior of the bounding volume; this is the candidate region for the fluid computational domain. The method performs post-processing on the Boolean difference results, including fragmentation elimination, connected component filtering, and boundary simplification.

[0069] The cavity flooding extraction method is suitable for complex, interconnected cavity regions. The method starts with the inlet seed point identified in step S3 and performs three-dimensional flooding filling. The flooding filling expands outward along spatial adjacency relationships, with the filling range limited to the cavity space inside the structural entity. During the filling process, the method records the filling boundary, which is the fluid domain boundary surface. The flooding filling terminates when it encounters the structural entity wall or reaches a preset filling distance. This method can automatically handle fluid domains with complex internal channels and multiple inlet connections.

[0070] The centerline sweep extraction method is suitable for flow channel structures with a clearly defined centerline, such as water diversion tunnels, tailrace tunnels, and pressure pipelines. The method first obtains the flow channel centerline extracted in step S3. Then, a series of cross-sections are arranged along the centerline. The cross-section positions are determined based on the centerline curvature and the rate of change of the cross-section shape: in areas of high curvature and significant changes in cross-section shape, the cross-section spacing is appropriately increased; in flat and uniform areas, the cross-section spacing can be appropriately increased. Typical cross-section spacing is 0.5 to 2 times the equivalent diameter of the flow channel.

[0071] The method generates a cross-sectional profile on each section. The profile is obtained by intersecting the normal plane at the centerline point with the channel wall. The profile is represented as an ordered sequence of points or a parametric curve. For each section, the method generates a normalized topological mesh. Normalized topological meshes include O-type, H-type, and C-type topologies. O-type topology is suitable for circular or near-circular sections, with the mesh distributed radially and circumferentially along the section; H-type topology is suitable for rectangular or trapezoidal sections, with the mesh distributed along the length and width of the section; C-type topology is suitable for semi-open sections or sections with partial openings. The method maintains the node correspondence between adjacent sections, ensuring topological consistency of elements in the sweep direction.

[0072] The method sweeps along the centerline to connect nodes of adjacent sections, generating volume elements. For straight pipe sections or sections with small curvature, the sweep generates a regular hexahedral mesh. For curved sections, the method performs a rotational transformation on the section based on the centerline curvature, ensuring that the section normal is always perpendicular to the local centerline tangent. The rotational transformation is smoothed using interpolation to avoid abrupt changes at the bend apex. For regions with changing cross-sectional shapes, the method connects adjacent sections with different topologies through a gradual transition. The 3D mesh generated by the sweep forms the computational domain for pipe-like fluids.

[0073] The template-based parameter construction method is suitable for rapid fluid domain generation of typical hydraulic structures. The method pre-defines parameterized templates for typical hydraulic structures such as diversion tunnels, tailrace tunnels, pressure pipelines, surge tanks, tailrace channels, stilling basins, and inlets / outlets. Each template defines the standard geometry and fluid domain construction rules for each structure. Users select the corresponding template and input key geometric parameters, including dimensions, elevation, and connectivity. The method automatically generates the fluid computational domain based on the parameterized geometry and fluid domain construction rules. This approach significantly improves processing efficiency for typical scenarios.

[0074] Step S5: Seal and patch the opening regions of the fluid computational domain and construct free surface boundaries. The fluid computational domain extracted in Step S4 typically has inlet and outlet openings. The method needs to perform sealing and patching operations on these opening regions. Simultaneously, for fluid domains with free surfaces, such as surge tanks, tailrace channels, and open channels, the method needs to construct free surface boundaries.

[0075] The opening sealing and patching operation includes the following sub-steps: Boundary loop extraction. The method identifies open boundary loops in the boundary surfaces of the fluid computational domain. An open boundary loop is a cycle of boundary edges belonging to only one boundary surface and not stitched together by other surfaces. The method extracts the constituent edges and constituent points of each open boundary loop, recording the topological structure and geometric coordinates of the boundary loop.

[0076] Plane Fitting of Boundary Loops. The method performs plane fitting on open boundary loops. The plane fitting employs least squares or singular value decomposition to calculate the best-fit plane equation for the boundary loop's constituent points. The fitted plane is expressed as plane equation coefficients and fitting residuals. The method also calculates the planeity error of the boundary loop. The planeity error is defined as the maximum or root-mean-square distance from the boundary loop's constituent points to the fitted plane.

[0077] Sealing surface generation strategy selection. The method judges the planarity of the boundary loop based on the planarity error. The planarity evaluation index is the ratio of the planarity error to the equivalent size of the boundary loop. When the ratio is less than a preset threshold, the boundary loop is determined to meet the planarity requirements; when the ratio is greater than or equal to the threshold, the boundary loop is determined to have spatial distortion. For boundary loops that meet the planarity requirements, the method directly generates a planar sealing surface based on the boundary loop contour. The sealing surface is represented by polygonal patches or NURBS surfaces. For boundary loops that do not meet the planarity requirements, the method first projects the discrete points of the boundary loop onto a fitting plane, and then generates a planar sealing surface based on the projected two-dimensional contour. The projection method uses orthogonal projection or projection along the normal of the fitting plane.

[0078] Sealing Surface Stitching and Label Recording. The method stitches the generated sealing surface to the adjacent wall surface. The stitching operation is achieved through edge matching and surface fusion. During the stitching process, the method maintains the correctness of the topological relationship between the sealing surface and the adjacent wall surface. The method also records the boundary semantic candidate labels of the sealing surface. The candidate labels are initially determined based on the position of the sealing surface in the fluid domain and its relative relationship with the mainstream path, providing input for the boundary semantic recognition in step S6.

[0079] The free surface boundary construction operation includes the following sub-steps: Water level information acquisition. The method obtains the design water level or calculated water level as the reference for free surface construction. The design water level and calculated water level can be obtained through user input, reading from configuration files, or data exchange with design software. The method supports single water level definition and multi-water level operating condition definition.

[0080] Construction of the horizontal cutting surface. The method involves constructing a horizontal cutting surface using the elevation value of the design water level or calculated water level. The horizontal cutting surface is an infinitely large plane whose z-coordinate is equal to the water level elevation. The geometric expression of the cutting surface is the plane equation where z equals the water level elevation.

[0081] Intersection line calculation. The method calculates the intersection line between the horizontal cutting surface and the candidate fluid space. The intersection line calculation uses a surface-to-plane intersection algorithm. For complex fluid domains, the horizontal cutting surface may intersect with multiple fluid domain regions, forming multiple intersection lines. The method organizes the intersection lines into an ordered sequence of boundary loops through intersection line continuity analysis.

[0082] Free surface boundary ring generation. The method generates the free surface boundary ring based on the intersection line. The direction of the boundary ring is determined according to the right-hand rule, ensuring that the normal of the boundary ring points to the outside of the fluid domain. For a closed fluid domain, the free surface boundary ring is the closed boundary profile at the top of the fluid domain. For a semi-closed fluid domain, the free surface boundary ring may intersect with the sidewall boundaries to form complex boundary shapes.

[0083] Free surface patch generation. The method generates free surface patches inside the free surface boundary ring. The patches are represented as planar triangular or quadrilateral meshes. The mesh density is determined based on local refinement requirements. The method marks the generated free surface patches as free_surface candidate boundary labels.

[0084] Step S6: Perform semantic recognition on the fluid domain boundary surfaces. The method performs semantic recognition on the boundary surfaces of the fluid domain geometric model obtained in Steps S4 and S5, automatically generating boundary labels. Boundary label types include at least one of the following: inlet label, outlet label, solid wall label, free surface label, symmetry surface label, gate wall label, gate pier wall label, internal interface label, and encrypted control area label. Boundary semantic recognition employs three strategies: rule-based semantic recognition, face adjacency graph-based semantic recognition, and machine learning model-based semantic recognition. Figure 4 This is a schematic diagram of the boundary semantic recognition process provided in an embodiment of the present invention.

[0085] Rule-based semantic recognition strategies determine the semantic type of boundary surfaces based on predefined rules. The method maintains a rule base, where each rule defines the criteria for determining a specific semantic type. The core rules in the rule base include: Sealing Surface Determination Rules. The method checks whether the boundary surface is a sealing surface. The determination conditions for a sealing surface include: the surface is generated by the sealing and patching operation in step S5, or the area of ​​the surface is approximately equal to the area of ​​the adjacent free edge ring and the normal direction is significantly different from the normal direction of the adjacent wall surface.

[0086] Mainstream direction determination rules. The method determines the mainstream direction of the fluid domain based on the centerline extracted in step S3. The mainstream direction is defined as the spatial direction from the normal to the inlet sealing surface to the normal to the outlet sealing surface. For complex flow channels, the mainstream direction may vary tangentially along the centerline.

[0087] Inlet identification rules. The method obtains the normal vector of the sealing surface and the direction of the local centerline corresponding to its location. When the normal vector of the sealing surface is opposite to the direction of the mainstream, that is, when the normal vector of the sealing surface points upstream of the fluid domain, the method determines that the sealing surface is an inlet. Inlet identification considers the sealing surface area, location, and geometric features for comprehensive evaluation.

[0088] Outlet identification rules. The method obtains the normal vector of the sealing surface and the direction of the local centerline corresponding to its location. When the normal vector of the sealing surface is consistent with the mainstream direction, that is, when the normal vector of the sealing surface points downstream of the fluid domain, the method determines that the sealing surface is an outlet. Outlet identification also needs to consider comprehensive factors such as area and location.

[0089] Free Surface Identification Rules. The method determines whether a boundary surface meets the following three conditions: the boundary surface normal is close to the vertical direction, i.e., the angle between the normal and the vertical direction is less than a preset threshold; the boundary surface elevation is close to the design water level or the calculated water level, i.e., the elevation difference is less than a preset threshold; and the boundary surface is located in the upper region of the fluid domain. When all three conditions are met, the method identifies the boundary surface as a free surface (free_surface).

[0090] Symmetry plane identification rules. The method determines whether a boundary surface lies on the model's symmetry plane. The symmetry plane is determined by analyzing the fluid domain geometry or by user specification. When a boundary surface coincides with or approximately coincides with the symmetry plane and its normal is perpendicular to the symmetry plane, the method identifies that boundary surface as a symmetry plane.

[0091] Solid wall identification rules. The method identifies all fluid domain boundary surfaces, except for inlet, outlet, free liquid surface symmetry surfaces, and internal interfaces, as solid walls. Solid wall identification also considers the semantic information of structural components. For lining surfaces, channel bottom slabs, side walls, gate pier surfaces, gate surfaces, guide wall surfaces, and energy dissipation structure surfaces, the method directly identifies them as specific types of solid walls.

[0092] Gate wall identification rules. The method identifies gate-related walls based on semantic information of structural components. Gate walls include the gate panel, gate slot, and gate support structure surfaces. Identification criteria include component names containing gate keywords, component geometric features conforming to the gate structural morphology, and component locations at critical control positions in the flow channel.

[0093] Gate pier wall identification rules. The method identifies gate pier-related walls based on the semantic information of structural components. Gate pier walls include the main surface of the gate pier and the flow guiding surface of the gate pier. Identification criteria include component names containing gate pier keywords, component locations between inlet and outlet or at flow channel bifurcation points, and component geometric features conforming to the gate pier structural morphology.

[0094] Internal interface identification rules. The method identifies the interfaces between different regions within the fluid domain. Internal interfaces may appear in branch pipe divergence areas, multi-branch confluence areas, and the location of internal baffles, etc. Internal interface identification is determined based on the geometric segmentation of the fluid domain and the topological relationship of the centerline.

[0095] The semantic recognition strategy based on face adjacency graphs organizes the fluid domain boundary surfaces into a graph structure and utilizes graph algorithms for semantic propagation and inference. The method uses the fluid domain boundary surfaces as graph nodes and the shared edge relationships or spatial adjacency relationships between boundary surfaces as graph edges to construct a boundary surface adjacency graph. Spatial adjacency relationships are determined based on the Euclidean distance and normal relationship between boundary surfaces. Spatial adjacency edges are established when the minimum distance between two boundary surfaces is less than a preset threshold and the included normal angle meets the condition.

[0096] The method constructs feature vectors for each graph node. The feature vectors contain the following dimensions: area feature, recording the geometric area of ​​the boundary surface; normal feature, recording the unit normal vector of the boundary surface; elevation feature, recording the average elevation or elevation range of the boundary surface; curvature feature, recording the Gaussian curvature or average curvature of the boundary surface; distance from centerline feature, recording the shortest distance from the boundary surface to the flow channel centerline; distance from inlet / outlet feature, recording the distance from the boundary surface to the nearest inlet or outlet; sealing surface identifier, recording whether the surface is a sealing surface; horizontal surface identifier, recording whether the surface is a horizontal surface or approximately a horizontal surface; and component attribute, recording the type of structural component to which the surface belongs.

[0097] The method employs graph convolution or label propagation algorithms based on graph node features and adjacency relationships. During algorithm iteration, node features are passed and aggregated through adjacent edges, gradually updating the semantic label probability distribution of each node. Label propagation uses a confidence-based approach: high-confidence labels are passed to low-confidence nodes through adjacency relationships; node feature similarity and edge weights are considered during the propagation process. Finally, the semantic labels of each boundary surface are output, and nodes with a highest confidence level below a preset threshold are marked as pending confirmation.

[0098] A semantic recognition strategy based on machine learning models automatically identifies boundary surface semantics using a trained deep learning model. The method extracts multimodal features of the boundary surface, including geometric parameter features, topological adjacency relationship features, multi-view rendered image features, and engineering attribute text features. Geometric parameter features include the aforementioned numerical features such as area, normal, elevation, and curvature. Topological adjacency relationship features include graph structure features such as the number of adjacent surfaces, the total length of adjacent edges, and the distribution of adjacency types. Multi-view rendered image features are obtained by rendering the boundary surface from multiple perspectives using a virtual camera, and the rendered images are input into a convolutional neural network to extract visual features. Engineering attribute text features are obtained by extracting semantic vectors from component names and annotation text using natural language processing techniques.

[0099] The method fuses multimodal features and inputs them into a trained semantic recognition model. The model employs a multi-task learning architecture, simultaneously outputting boundary type classification results and attribute regression results. Classification results include types such as inlet, outlet, solid wall, free surface, symmetry plane, gate wall, gate pier wall, and internal interface. The method sets a confidence threshold for the classification results. When the probability of the highest semantic label is higher than the threshold, that label is directly adopted; when the probability of the highest semantic label is lower than the threshold, the method calls rule-based semantic recognition for correction, or outputs a manual confirmation prompt for user decision-making.

[0100] Step S7: Assign mesh generation strategies based on boundary labels. The method automatically assigns mesh generation strategies to the fluid domain geometry model based on the boundary semantic labels identified in Step S6. Mesh generation strategies include combinations of global size fields and various local size fields. Figure 5 This is a schematic diagram illustrating the semantically driven mesh size field generation provided in an embodiment of the present invention. The local mesh size h(x) is determined by comprehensively considering multiple control factors, and the calculation formula is as follows: ( x )=min h 0, hc ( x ), hs ( x ), hw ( x ), hfs ( x ), hr ( x ) Where h0 is the global base size, hc(x) is the curvature control size, hs(x) is the boundary semantic control size, hw(x) is the near-wall boundary layer control size, hfs(x) is the free surface control size, and hr(x) is the flow-sensitive region control size. The local mesh size is taken as the minimum value of the above size fields calculated at that location to ensure that all control factors are satisfied.

[0101] The global base size h0 is specified by the user based on the required computational accuracy, or automatically recommended by the system based on the overall size of the fluid domain and computational resource constraints. Typical values ​​range from 1 / 50 to 1 / 200 of the equivalent size of the fluid domain.

[0102] The curvature control dimension hc(x) is adaptively adjusted based on the local geometric curvature. In areas with high curvature, the dimension is densified to accurately capture geometric changes, while in areas with low curvature, it is appropriately sparsed to improve efficiency. The curvature control dimension is calculated as hc(x) equal to the radius of curvature multiplied by a preset relative dimension factor. Typical values ​​for the relative dimension factor range from 0.02 to 0.05.

[0103] The boundary semantic control size hs(x) is determined based on the boundary semantic recognition results. Different target values ​​for local mesh sizes are set for different boundary types. The inlet and outlet surfaces use smaller cross-sectional refinement sizes, typically 0.2 to 0.5 times the global base size. Solid walls use medium refinement sizes. The internal interfaces have local sizes set according to regional importance. The boundary semantic control size field forms a gradient transition region near the boundary to avoid abrupt mesh changes.

[0104] The near-wall boundary layer control dimension hw(x) is used for controlling the mesh generation of the wall boundary layer. The system calculates the initial boundary layer height based on the wall boundary label, target y+ value, fluid velocity, fluid density, dynamic viscosity, or empirical friction velocity. The target y+ value is determined according to the requirements of the turbulence model: for standard wall functions, it is typically 30 to 300; for non-equilibrium wall functions or low Reynolds number models, it is typically 1 to 5. The initial layer height is calculated based on flat plate boundary layer theory or empirical formulas. The number of boundary layer layers is determined based on the target total boundary layer thickness, which is typically 0.1 to 0.2 times the head or local hydraulic diameter of the boundary layer inlet region. The growth rate is determined based on the number of layers and the total thickness, typically 1.1 to 1.3 times.

[0105] The free surface control size hfs(x) is used for mesh refinement control in the free surface region. The system sets up strip-shaped refinement zones within a preset range above and below the free surface boundary. The thickness of the strip-shaped refinement zone is determined based on the free surface fluctuation amplitude and calculation accuracy requirements, typically ranging from 0.5 to 2 times the local water depth or 0.2 to 1 meter. For the intake vortex region, the surge tank surface fluctuation region, the open channel free surface region, and the tailrace channel surface region, the system sets local refinement sizes based on the vortex intensity or surface fluctuation amplitude. Typical local refinement sizes are 0.5 to 1 times the global base size.

[0106] The flow-sensitive area control size hr(x) is used for localized and intensified control of areas such as branch pipe intersections, bends, sudden expansion zones, sudden contraction zones, gate pier wake zones, gate openings, sills, bottom sills, stilling basins, and inlet vortex zones.

[0107] The specific implementation of the inlet and outlet cross-section densification strategy includes: setting local grid sizes smaller than the global base size for the inlet and outlet surfaces, typically 0.2 to 0.5 times the global base size; setting downstream densification zones and upstream densification zones along the main flow direction, with the length of the densification zones determined according to the flow pattern development needs, typically 3 to 10 times the inlet diameter or equivalent hydraulic diameter; and ensuring uniform grid distribution and smooth transition with neighboring volume grids through size gradient transition.

[0108] The specific implementation of the wall boundary layer strategy includes: setting boundary layer parameters according to the wall boundary label and computational model requirements; for narrow gap regions, when the gap width is less than twice the height of the first layer, the boundary layer generation may collapse, and the method performs boundary layer compression processing to reduce the boundary layer thickness in this region to 50% to 80% of the gap width; for sharp corner and intersection edge regions, negative volume or mesh distortion may occur during the boundary layer advancement process, and the method performs boundary layer merging or local reconstruction processing; for regions with abrupt changes in local curvature, the boundary layer may be excessively twisted or penetrated, and the method performs boundary layer reconstruction processing to adjust the local cross-sectional direction and size.

[0109] The specific implementation of the free surface densification strategy includes: setting up strip densification zones within a range of 0.2 to 1 meter above and below the free surface boundary or within a range of 0.1 to 0.3 times the local water depth; the mesh size within the densification zone is 0.5 to 1 times the global base size; and the boundary of the densification zone adopts an exponential or linear gradient transition to avoid abrupt mesh changes.

[0110] The densification strategy for the junction area of ​​branch pipes determines the extent of the junction area based on the geometric topology of the branch pipes and the centerline topology. The junction area extends along each branch direction to a location 2 to 5 times the local equivalent diameter from the junction point. The grid size of the junction area is determined based on the branch angle and flow complexity, typically taking a value of 0.3 to 0.6 times the global base size.

[0111] The cornering density reduction strategy determines the density reduction area based on the centerline curvature and turning angle. Density reduction areas are set on both the inner and outer sides of the corner, with the density on the inner side typically being higher than on the outer side. The density reduction area extends along the centerline to a location 1 to 3 times the equivalent radius of the corner at the corner's endpoint.

[0112] The abrupt expansion / contraction zone densification strategy determines the densification region based on the rate of change of cross-sectional area. Locations with an area change rate greater than 20% are identified as abrupt expansion or contraction zones. The densification range extends along the flow direction to a location 3 to 5 times the equivalent diameter from the location of the area change. The grid size of the densified zone is determined based on the area change gradient and flow characteristics.

[0113] The wake region densification strategy for gate piers determines the wake region's extent based on the gate pier's geometry and layout. The wake region length is related to the gate pier width and the incoming flow Froude number, typically ranging from 3 to 10 times the gate pier width. The wake region width is determined based on the wake width development pattern. The densified region's grid size is 0.3 to 0.7 times the global base size.

[0114] The method generates surface and volume meshes according to the mesh generation strategy. Based on the mesh generation strategy assigned in step S7, the method performs surface and volume mesh generation on the fluid domain geometry model. The volume mesh generation methods include five main approaches: centerline swept hexahedral mesh generation, unstructured tetrahedral mesh generation, polyhedral mesh generation, prism boundary layer hybrid mesh generation, and octree cut-cell mesh generation. The method selects the most suitable mesh generation method or combination based on the fluid domain type and geometric characteristics.

[0115] For fluid domains with a clearly defined centerline, such as water diversion tunnels, tailrace tunnels, and pressure pipelines, the method preferentially employs a centerline-swept hexahedral mesh generation approach. The method first generates O-type, H-type, or C-type cross-sectional topologies based on the centerline and cross-sectional sequence extracted in step S3. The O-type topology is suitable for circular or near-circular cross-sections, generating mesh nodes along the radial and circumferential directions, with mesh lines closing at the center of the cross-section. The H-type topology is suitable for rectangular or trapezoidal cross-sections, generating mesh nodes along the length and width directions, with mesh lines forming a rectangular or trapezoidal outline. The C-type topology is suitable for semi-open or partially open cross-sections, with the mesh topology adapting to the shape of the opening boundaries.

[0116] The method sweeps along the centerline to connect corresponding nodes of adjacent sections, generating a hexahedral or semi-structured hexahedral mesh. During the sweeping process, the method maintains the one-to-one correspondence between nodes of adjacent sections. For curved sections, the method rotates the section according to the centerline curvature, ensuring that the section normal is always perpendicular to the local centerline tangent. For regions with gradually changing section shapes, the method smoothly transitions between different topologies of adjacent sections using interpolation. The swept mesh exhibits good orthogonality and element quality, making it suitable for numerical simulation of flow problems in long-distance pipelines.

[0117] For complex fluid domains such as surge tanks, tailrace channels, stilling basins, and pools, the method employs an unstructured mesh generation approach. The method first generates a surface mesh based on the boundary semantic size field. Surface mesh generation uses Delaunay triangulation or a leading-edge propagation algorithm. During generation, the method adjusts the mesh density according to the local refinement size allocated in step S7: regions with boundary semantic labels of inlet or outlet use a denser surface mesh; regions with boundary semantic labels of solid walls use a medium-density surface mesh; and internal regions use a relatively sparse surface mesh. After surface mesh generation, the method performs surface mesh quality optimization, including smoothing, edge flipping, and local re-meshment.

[0118] The method generates volume meshes based on surface meshes. Volume mesh filling employs the leading-edge method, Delaunay reconstruction method, or octree filling method. During filling, the method adjusts the volume mesh density according to the local refinement requirements assigned in step S7. Volume mesh types include tetrahedral meshes, polyhedral meshes, or hybrid meshes. Tetrahedral meshes are highly efficient in generation and suitable for complex geometric regions; polyhedral meshes have a relatively small number of elements and low numerical dissipation; hybrid meshes combine the advantages of both, using prism layers or tetrahedrons near the boundaries and polyhedrons or hexahedrons in the internal regions.

[0119] For complex, large-scale fluid domains, the method employs an octree cut-cell mesh generation approach. The method first generates a background octree mesh. The spatial segmentation depth of the octree mesh is determined based on the global base size and the minimum control size, typically involving 6 to 10 layers to balance computational accuracy and efficiency. The method performs boundary cutting on the octree mesh based on the fluid domain boundary faces. Boundary cutting is achieved by intersecting faces with cubes, generating irregularly cut cells (Cut-cells). The method merges excessively small cut cells, combining cells with volumes less than a threshold with adjacent cells. For boundary layer regions or flow-sensitive regions, the method inserts prism-layer meshes or locally refines the mesh as needed. The Cut-cell mesh generation method is highly efficient and suitable for rapid mesh generation of large-scale complex models.

[0120] The method simultaneously establishes topological correspondences between elements, surfaces, and boundary groups. These correspondences include: the inclusion relationship between volume elements and surface elements (i.e., which volume element boundaries a surface element belongs to); the affiliation relationship between surface elements and boundary groups (i.e., which boundary semantic label groups a surface element belongs to); and the association relationship between nodes and elements (i.e., which elements share a node with). Establishing these topological correspondences provides the data foundation for subsequent mesh quality checks and CFD solver file output.

[0121] Step S8: Perform quality checks and local repairs on the generated mesh; The method performs a standardized quality check on the surface mesh and volume mesh generated in step S7, and performs necessary local repair operations based on the check results to obtain a fluid dynamics mesh that meets the requirements of CFD calculation.

[0122] Mesh quality checks include three levels: closure checks, boundary semantic consistency checks, and mesh cell quality checks.

[0123] The closure check is used to verify the closure of the fluid domain geometry and the integrity of the mesh. The closure check items include: free edge check, which detects the presence of incompletely stitched boundary edges; free edges typically indicate topological gaps between patches; non-manifold edge check, which detects anomalous edges belonging to two or more surfaces or not belonging to a continuous sequence of surfaces; isolated cavity check, which detects the presence of completely closed isolated cavity regions that are not connected to the main fluid domain; normal consistency check, which checks whether the normal directions of adjacent patches are consistent; reversed normal directions may lead to topological errors; and inlet / outlet connectivity check, which checks whether the inlet and outlet boundaries are correctly connected to the main fluid domain and whether there are any blockages or breaks.

[0124] Boundary semantic consistency checks are used to verify the completeness and correctness of boundary semantic recognition. The boundary semantic consistency check items include: unclassified boundary surface check, detecting the existence of boundary surfaces without assigned semantic labels; unclassified surfaces may lead to missing boundary conditions; inlet and outlet missing check, checking whether the inlet and outlet boundaries are complete; in multi-inlet and multi-outlet scenarios, each needs to be checked individually; free surface elevation rationality check, checking whether the free surface elevation is consistent with the design water level or calculated water level, and whether the deviation is within the allowable range; outlet normal check, checking whether the outlet boundary normal is consistent with the outflow direction; inconsistency in normals may lead to incorrect solver boundary condition settings; and boundary group continuity check, checking whether the boundary surfaces of each boundary group are continuously distributed, and whether there are any discontinuities or overlaps between groups.

[0125] Mesh cell quality checks are used to evaluate the geometric quality of mesh cells. Mesh element quality check indicators include: Skewness, defined as the ratio of the distance from the element centroid to the centroid of the ideal shape to the radius of the element's circumcircle, reflecting the degree of skewness of the element, with a value range of 0 to 1, where 0 represents an ideal element and 1 represents an extremely skewed element; Orthogonality, defined as the cosine of the angle between the element face normal and the direction of the line connecting the centers of adjacent elements, reflecting the orthogonality of the mesh; Aspect Ratio, defined as the ratio of the longest side to the shortest side of the element, reflecting the stretching degree of the element; Volume Ratio, defined as the ratio of the volumes of adjacent elements, reflecting the smoothness of the mesh transition; Minimum Volume, detecting the existence of degenerate elements with excessively small volumes, which may lead to numerical instability; Boundary Layer Growth Rate, checking whether the thickness growth rate between adjacent boundary layers meets the set requirements, as an excessively large growth rate may cause boundary layer detachment; Prism Collapse Rate, detecting whether there are collapse points in the prism layer mesh where the thickness approaches zero, which may lead to negative volumes or solution difficulties.

[0126] The mesh element quality threshold is determined based on the required computational accuracy and solver limitations. For general CFD calculations, the skewness threshold is typically set to 0.9 to 0.95, the non-orthogonality threshold is typically set to 0.2 to 0.3 radians, and the aspect ratio threshold is typically set to 20 to 50. For high-precision calculations, the thresholds should be tightened appropriately.

[0127] Local repair operations are performed on issues identified during quality checks. Local repair methods include: local smoothing (optimizing node positions for elements that do not meet skewness or non-orthogonality requirements, using smoothing algorithms such as Laplacian smoothing, OCKS smoothing, or optimization based on target metric); local remeshing (regenerating meshes in geometrically complex regions or regions with persistently low quality); local refinement (inserting nodes to refine meshes in sparse or inaccurate regions); merging small-volume elements (merging excessively small elements with adjacent larger elements to eliminate degenerate elements); surface normal correction (flipping surfaces with reversed normals); boundary layer compression (reducing the boundary layer thickness in narrow gap regions); and boundary layer reconstruction (regenerating collapsed or distorted boundary layer meshes).

[0128] The method iteratively performs quality checks and local repair operations until all check items meet the quality requirements or the preset maximum number of iterations is reached. For special areas that still do not meet the quality requirements, the method logs warning messages and provides a manual intervention interface.

[0129] Output CFD solver preprocessing file; the method converts the quality-checked and repaired mesh data into a preprocessing file format readable by the CFD solver. The preprocessing file includes fluid domain mesh data, boundary semantic grouping, boundary condition recommendation information, and element topology relationships.

[0130] The method supports multiple CFD solver file formats for output. CFD solver preprocessing file types include: Fluent mesh files (.msh or .h5 format), containing node coordinates, volume element definitions, boundary surface definitions, and physical grouping information; OpenFOAM mesh files (polyMesh format directory structure), containing points, faces, owner, neighbor, and boundary files, with the boundary file defining the boundary patch name and type; CGNS files (HDF5 format storage, supporting large-scale parallel reading, containing mesh topology, boundary definitions, and additional data); VTK files (.vtu unstructured mesh format or .vtklegacy format), supporting visualization post-processing; and custom solver mesh files, generated according to the file format requirements of a specific solver.

[0131] Boundary condition recommendations are automatically generated based on boundary semantic recognition results. The method recommends suitable CFD boundary condition types for each boundary group. Recommended boundary condition types include: velocity-inlet (suitable for inlet boundaries, recommended parameters include inlet velocity magnitude and direction); mass-flow-inlet (suitable for inlet boundaries where mass flow rate is known); pressure-inlet (suitable for inlet boundaries where pressure is known); pressure-outlet (suitable for outlet boundaries, recommended parameters include outlet static pressure or total pressure); outflow (suitable for free outflow or unknown outlet conditions); wall (suitable for all walls in contact with structural entities, recommended parameters include wall type (smooth or rough), roughness height, and roughness constant); rough-wall (adds rough wall model parameters to the wall model); free-surface (suitable for water surface boundaries, recommended boundary condition models are based on free-surface elevation and wave characteristics); symmetry (suitable for symmetrical plane boundaries); porous-interface (suitable for porous media region boundaries); and interior-face (suitable for virtual interfaces between different regions within a fluid domain).

[0132] In the preprocessing file output by the method, the boundary group names correspond to the boundary semantic tags identified in step S6, ensuring semantic consistency between the boundary condition settings and the mesh file. The method also outputs a metadata file, recording additional information such as model name, computational conditions, mesh statistics, and recommended boundary condition parameters, facilitating subsequent computation settings and result traceability.

[0133] A specific application example is provided below. The practical application process of this invention is illustrated using a water diversion tunnel at a hydropower station as an example. This water diversion tunnel has a diameter of 8 meters, a total length of approximately 500 meters, an inlet elevation of EL.850, and an outlet elevation of EL.845. The tunnel has two bends along its length, with curvature radii of 30 meters and 50 meters respectively. The input model is a three-dimensional solid model including the tunnel lining structure, in STEP file format.

[0134] The method reads the STEP file and converts it into a unified geometric topology representation. The topology includes three types of facets: the inner surface of the lining, the outer surface of the lining, and the end openings, totaling approximately 12,000 facets. The method calculates the geometric properties of each facet, including area, centroid, normal, curvature, and elevation. A face-to-face adjacency graph is constructed to record the list of adjacent facets for each facet.

[0135] The method performs geometric repair operations. The repair includes: merging tiny gaps between the inner and outer surfaces of the lining caused by model inaccuracies, with gap widths of approximately 0.1 to 0.5 mm, achieving 100% topological continuity after repair; deleting approximately 200 duplicate small faces in the model; filling approximately 15 construction-reserved holes with diameters less than 10 mm; and merging faces in approximately 30 thin-walled areas.

[0136] During feature selection, the method identifies and retains the drag-reducing structures on the inner side of the tunnel bend and the diffusion transition section structure at the outlet. Simplification processes include merging adjacent patches with a spacing of less than 50 mm and eliminating approximately 500 small chamfer features that do not affect the flow regime.

[0137] During the potential flow channel identification process, the method extracts the free boundary loops at both ends of the tunnel. The inlet boundary loop has an area of ​​approximately 50.3 square meters, a closure degree of 0.98, and a centroid elevation of EL.850.2; the outlet boundary loop has an area of ​​approximately 50.3 square meters, a closure degree of 0.97, and a centroid elevation of EL.845.1. The opening confidence index is calculated; both the inlet and outlet indices are greater than 0.85, classifying them as high-confidence inlet and outlet. The method also extracts the tunnel centerline, which is 501.5 meters long, and identifies the locations and curvature parameters of two bends.

[0138] The fluid computational domain extraction employs a centerline cross-section sweep method. 225 cross-sections are arranged along the centerline, with a spacing of approximately 2.2 meters, and the spacing is refined to 1.5 meters in curved regions. Each cross-section generates an O-type topological mesh with 16 radial nodes and 48 circumferential nodes. The sweep along the centerline generates a hexahedral mesh with a total of approximately 1.73 million elements.

[0139] During the opening and sealing process, the method performs planar fitting on the inlet and outlet boundary rings. The inlet boundary ring has a planarity error of 2.3 mm, which meets the planarity requirements, and a planar sealing surface is directly generated. The outlet boundary ring has a spatial distortion of approximately 15 mm. The method projects the boundary ring onto the fitted plane to generate the sealing surface. After the sealing surface is stitched with the adjacent wall surface, it is recorded as inlet and outlet boundary groups.

[0140] During boundary semantic recognition, the method determines the boundary type based on the relationship between the normal of the sealing surface and the centerline direction. If the normal of the inlet sealing surface is opposite to the mainstream direction, it is identified as an inlet; if the normal of the outlet sealing surface is in the same direction as the mainstream direction, it is identified as an outlet. The inner surface of the lining is identified as a wall. The inner wall of the bend is identified as a wall and marked as a locally reinforced area.

[0141] During the mesh generation strategy allocation process, the method sets the global base size to 0.4 meters. The inlet section has a refinement size of 0.15 meters, gradually transitioning over a 10-meter downstream range. The outlet section has a refinement size of 0.2 meters, gradually transitioning over an 8-meter upstream range. The wall boundary layer adopts a k-omega SST model adaptation strategy, with a target y+ value of 1.0. The calculated first layer height is approximately 0.002 meters, with 15 boundary layers, representing a growth rate of 1.2 times. The local refinement in the curve region is reduced to 0.25 meters, and the refinement on the inside of the curve is reduced to 0.2 meters.

[0142] The mesh was generated using a centerline swept hexahedral mesh method. The maximum element skewness was 0.72, with an average of 0.15; the maximum non-orthogonality was 18.5 degrees, with an average of 6.2 degrees; and the maximum aspect ratio was 8.5, with an average of 2.3. The mesh quality meets the requirements for CFD calculations.

[0143] The quality inspection results show that: the closure check passed, with no free edges, non-manifold edges, or isolated cavities; the boundary semantic consistency check passed, all boundary surfaces were classified, and the inlet and outlet were intact; the mesh cell quality check passed, and all indicators met the threshold requirements. No local repair operation is required.

[0144] The output file is a Fluent format .msh file. The file contains 1.73 million hexahedral elements, with boundary groupings including inlets, outlets, and walls. Recommended boundary conditions are provided: for inlets, velocity-inlet is recommended, with velocity values ​​determined based on the reference flow rate; for outlets, pressure-outlet is recommended, with static pressure values ​​determined based on the downstream water level; and for walls, standard-wall-functions is recommended. The method also outputs a mesh statistics report and a table of recommended boundary condition parameters.

[0145] This embodiment fully demonstrates the complete technical implementation from inputting a 3D structural model to outputting a CFD solver preprocessing file, verifying the engineering feasibility and automated processing capability of the method of the present invention.

[0146] Example 2 This embodiment uses the tailrace channel as an example to illustrate the specific application of the present invention.

[0147] The input model is a tailrace structure model of a hydroelectric power station, including the channel floor, side walls, inlet gate section, outlet diffuser section, and open top area. The channel floor elevation gradually changes from EL.810 to EL.815, the channel width is 12 meters, the channel length is approximately 80 meters, and the side wall height is 6 meters. The model format is an RVT conversion file.

[0148] The method reads RVT files and converts them into a unified geometric topology representation. The topology includes three types of surfaces: channel bottom surface, sidewall surface, and boundary opening surface. The method identifies a large open region at the top of the tailrace channel, which corresponds to the air domain rather than the fluid domain boundary.

[0149] During the geometric repair process, the method merges the tiny gaps at the junction of the channel bottom slab and the sidewall, and repairs the localized damaged areas on the sidewall surface. Since the tailrace channel is an open channel structure, the open area at the top remains open and is not sealed.

[0150] During potential flow channel identification, the method identifies the upstream end face of the tailrace channel as the inlet boundary ring and the downstream end face as the outlet boundary ring. Since the top of the tailrace channel is open, the method does not perform centerline extraction; instead, it identifies the water space through cavity connectivity search. The search starts at the seed point of the inlet boundary ring and extends upwards along the space to search for the water-filled area. The search terminates at the lower of the sidewall top elevation EL.816 and the water level elevation EL.814.5.

[0151] The fluid computational domain extraction employs a cavity flooding extraction method. The method uses the inlet boundary ring as the seed point and performs three-dimensional flooding filling. The filling range is limited to the space enclosed by the channel floor, sidewalls, and inlet gate piers. Filling terminates at the top surface of the sidewalls and the design water level cutoff surface. The generated water fluid domain includes the flow passage between the main channel section and the gate piers.

[0152] During the opening sealing process, the method performs sealing treatment on the inlet and outlet boundary rings. Due to the approximately 5-degree axial deflection in the tailrace bend section and the approximately 8-millimeter planarity error of the outlet boundary ring, the sealing surface is generated through projection.

[0153] During the free surface construction process, the design water level EL.814.5 is obtained. A horizontal cutting surface is constructed based on this water level elevation. The intersection of the horizontal cutting surface and the channel fluid domain is calculated, generating a free surface boundary loop. Free surface patches are generated within the boundary loop and labeled with the `free_surface` boundary tag.

[0154] During boundary semantic recognition, the method identifies each boundary type based on geometric features and positional relationships. The inlet boundary ring is identified as inlet because its normal direction is opposite to the mainstream direction; the outlet boundary ring is identified as outlet because its normal direction is the same as the mainstream direction; the channel bottom plate and sidewalls are identified as wall; the top free surface is identified as free_surface; the surface of the inlet gate pier is identified as pier_wall; and the sidewall of the outlet diffusion section is identified as wall and marked as a local diffusion area.

[0155] During the mesh generation strategy allocation process, the method sets a global base size of 0.5 meters. The inlet section has a refinement size of 0.2 meters, with a gradual transition of 12 meters downstream. The outlet section has a refinement size of 0.25 meters. A strip-shaped refinement zone with a size of 0.3 meters is set within a 0.5-meter range above and below the free surface. Boundary layers are set on the bottom plate and sidewalls, with a target y+ value of 30, a first-layer height of 0.015 meters, 10 layers, and a growth rate of 1.25 times. Local refinement is set in the gate pier wake area with a size of 0.3 meters.

[0156] The mesh generation employs an unstructured tetrahedral mesh method. The method first generates a surface mesh containing approximately 85,000 triangular elements. Within the surface mesh, the inlet section, outlet section, and free surface use a denser mesh, while other areas use a medium-density mesh. Then, volume mesh filling is performed, resulting in a volume mesh containing approximately 4.2 million tetrahedral elements.

[0157] The quality inspection results show that: the closure check passed, the fluid domain is completely closed; the boundary semantic consistency check passed, all boundary surfaces have been correctly classified; the mesh cell quality check passed, the maximum skewness is 0.88, the maximum non-orthogonality is 22 degrees, which meets the calculation requirements.

[0158] The output file generates an OpenFOAM format polyMesh file. Boundary groupings include four categories: inlet, outlet, free surface, and wall. Recommended boundary conditions: for inlets, velocity-inlet is recommended, with velocity values ​​determined based on tailrace flow; for outlets, pressure-outlet is recommended, with static pressure values ​​determined based on downstream water level; for free surfaces, zero-shear boundaries or VOF model boundaries are recommended; and for walls, standard-wall-functions are recommended. The method also outputs a recommended boundary condition parameter table and a mesh statistics report.

[0159] Example 3 This embodiment uses the combination of a surge tank and a water diversion tunnel as an example to illustrate the specific application of the present invention.

[0160] The input model is a combined structure model of the upstream surge tank and water diversion tunnel of a hydropower station. The model includes a horizontal water diversion tunnel section, a vertical surge tank, an impedance orifice, a connecting diffuser section, and an emergency gate shaft. The water diversion tunnel has a diameter of 8 meters and a horizontal section length of approximately 150 meters; the surge tank has a diameter of 16 meters, a top elevation of EL.920, and a bottom elevation of EL.850; the impedance orifice has a diameter of 3 meters and is located at the bottom of the surge tank. The model format is an IFC file.

[0161] The method reads the IFC file and converts it into a unified geometric topology representation. The topology includes the inner surface of the tunnel lining, the wall of the surge tank, the wall of the impedance orifice, the wall of the gate well, and various boundary openings. The method identifies multiple connected water regions in the model, which need to be processed separately.

[0162] During the geometric repair process, the method merges the topological gaps at the connection between the tunnel and the surge tank, handles the geometric interference between the impedance orifice and the bottom of the surge tank, and repairs the boundary topology of the reserved holes in the gate well. Feature screening preserves key components that affect the flow regime, such as the impedance orifice structure, the gate slot of the gate well, and the stiffening ribs of the surge tank wall.

[0163] In the process of identifying potential flow channels, the method separately processes the water diversion tunnel section and the surge tank area. For the water diversion tunnel section, the method extracts the centerline and identifies the upstream inlet and downstream connection. For the surge tank area, the method identifies the top opening of the surge tank as a possible free surface location and the impedance orifice connection as the interface connecting to the tunnel. The method constructs a centerline topology map of the combined flow channels, with nodes including the tunnel inlet, the tunnel-surge tank connection point, the impedance orifice, the gate well, and the top surface of the surge tank.

[0164] The fluid computational domain extraction employs a combination of cavity connectivity identification and centerline sweeping. The water diversion tunnel section is extracted using a centerline cross-section sweeping method, with 85 cross-sections arranged to generate a swept hexahedral mesh. The surge tank area is extracted using a cavity connectivity method, with the impedance orifice connection point as the seed point, flooding upwards to the design water level EL.915, generating an unstructured mesh. Connectivity in the connected regions is achieved through local Boolean operations and mesh transition processing.

[0165] During the opening sealing and patching process, the method performs sealing treatment on the tunnel entrance boundary ring to generate an inlet sealing surface. A free liquid surface is generated at the design water level EL.915 at the top of the surge tank. Whether the impedance hole connection and the reserved opening of the gate well need to be sealed is determined according to the engineering design intent.

[0166] During boundary semantic recognition, the method identifies the tunnel entrance as "inlet". The free surface at the top of the surge tank is identified as "free_surface". The inner wall of the tunnel, the surge tank wall, the impedance orifice wall, and the gate well wall are identified as "wall". The area near the impedance orifice is identified as local encrypted junctions. The gate well slot area is identified as a local encrypted gate-slot.

[0167] During the mesh generation strategy allocation process, the method employs differentiated strategies based on the characteristics of different regions. The water diversion tunnel section uses a swept hexahedral mesh with a global base size of 0.4 meters and a target y+ value of 1.0 for the wall boundary layer. The surge tank area uses an unstructured tetrahedral mesh with a base size of 0.6 meters. The area near the impedance orifice is locally densified to 0.25 meters. A strip-shaped densification zone with a size of 0.35 meters is set within 1 meter above and below the free surface of the surge tank. The gate slot area of ​​the gate well is locally densified to 0.3 meters.

[0168] Mesh generation combines swept meshing and unstructured meshing methods. Approximately 850,000 hexahedral elements are generated for the water diversion tunnel section. Approximately 1.8 million tetrahedral elements are generated for the surge tank area. Mesh transitions in connecting regions are achieved through local repartitioning. The total number of mesh elements is approximately 2.7 million.

[0169] The quality inspection results show that: the combined fluid domain closure check passed, and the topological connectivity between different regions is correct; the boundary semantic consistency check passed, and all region boundaries are correctly classified; the grid cell quality check passed, and the grid quality of each region meets the requirements.

[0170] The output file generates a Fluent format file, containing various boundary groupings such as inlets, outlets, free surfaces, walls, and junctions. Recommended boundary conditions: for inlets, velocity-inlet is recommended; the internal fluid domain of the pressure regulating well is treated as an interior region; for free surfaces, VOF free surface model boundaries are recommended; for walls, standard-wall-functions are recommended; boundary conditions for locally refined zones inherit from adjacent wall settings. The method outputs a complete preprocessing file and a table of recommended boundary condition parameters.

[0171] In the several embodiments provided in this application, it should be understood that the disclosed methods, apparatuses, and approaches can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another method, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces, or indirect coupling or communication connection between apparatuses or units, and may be electrical, mechanical, or other forms.

[0172] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated units described above can be implemented in hardware or as software functional units. The above are merely embodiments of this application and do not limit the patent scope of this application. Any equivalent structural or procedural transformations made based on the description and drawings of this application, or direct or indirect applications in other related technical fields, are similarly included within the patent protection scope of this application.

[0173] The specific embodiments of the invention have been described in detail above, but they are only examples, and this application is not limited to the specific embodiments described above. For those skilled in the art, any equivalent modifications or substitutions to the invention are also within the scope of this application. Therefore, all equivalent changes, modifications, and improvements made without departing from the spirit and principles of this application should be covered within the scope of this application.

Claims

1. A mesh generation method for automatic extraction of fluid domains and boundary semantic recognition in hydraulic structures, characterized in that, Includes the following steps: Step 1: Obtain the 3D model of the hydraulic structure to be processed, and convert the 3D model of the hydraulic structure into a unified geometric topology expression; Step 2: Perform geometric repair and feature filtering on the unified geometric topology expression to obtain the repaired structural entity model and its geometric feature data; Step 3: Identify potential flow channels in the structural entity model based on the geometric feature data to obtain inlet candidate region, outlet candidate region, main flow path, internal obstacle region and fluid connectivity region; Step 4: Based on the potential flow channels, automatically extract the fluid computation domain from the structural entity model; Step 5: Seal and patch the open areas in the fluid computation domain, and construct free liquid surface boundaries according to the design water level or calculated water level to form a closed or semi-closed fluid domain geometric model. Step 6: Perform semantic recognition on the boundary surfaces of the fluid domain geometric model to generate at least one boundary label among inlet, outlet, solid wall, free liquid surface, symmetry plane, gate wall, gate pier wall, internal interface, and encrypted control area. Step 7: Assign a mesh generation strategy according to the boundary label; generate surface meshes and volume meshes for the fluid domain geometry model according to the mesh generation strategy; and establish the topological correspondence between element, surface, and boundary groups. Step 8: Perform quality checks and local repairs on the generated mesh to obtain a fluid dynamics mesh that meets the requirements of CFD calculations. Output a CFD solver preprocessing file containing fluid domain mesh, boundary semantic grouping, boundary condition recommendation information, and element topology information.

2. The method according to claim 1, characterized in that, In step 1, the three-dimensional model of the hydraulic structure includes at least one hydraulic structure model among water diversion tunnel, tailrace tunnel, pressure pipeline, surge chamber, tailrace channel, inlet, outlet, branch pipe, gate, stilling basin, and pump station inlet and outlet pools. The data format of the three-dimensional model includes at least one of STEP, IGES, SAT, IFC, RVT converted files, STL, OBJ, or custom engineering model formats; the unified geometric topology expression includes the hierarchical topological relationship of entities, shells, faces, loops, edges, and points, and records the area, centroid, normal, curvature, elevation, boundary loop, adjacent face, component name, and engineering attribute information of each geometric face.

3. The method according to claim 2, characterized in that, In step 2, geometric repair includes at least one of the following: gap merging, duplicate surface deletion, small hole filling, damaged edge repair, non-manifold edge processing, thin surface cleaning, local overlapping surface correction, and small feature filtering. The feature selection further includes retaining key components that affect the flow regime based on the semantics of hydraulic components. The key components include at least one of gate piers, guide walls, diversion piers, bottom sills, cantilever sills, gates, gate slots, branch pipe ribs, and trash racks.

4. The method according to claim 3, characterized in that, In step 3, potential flow channel identification includes at least one of opening ring identification, centerline identification, and cavity connectivity domain identification; The open loop identification includes extracting free boundary loops from the unified geometric topology expression, calculating the area, closure error, fitting plane, normal vector, centroid position, and end position of each free boundary loop, and constructing an opening confidence index based on the area, closure error, angle between the normal vector and the local centerline direction, and end position. When the opening confidence index is greater than a preset threshold, the corresponding free boundary ring is determined as an inlet candidate region or an outlet candidate region. The opening credibility index Popen is obtained by weighting the opening area normalization score A, opening closure score C, opening normal angle score D and end position score T using weighting coefficients w1, w2, w3 and w4. The centerline identification includes sampling the inner wall of the suspected flow channel, constructing a cross-sectional point set or distance field based on the sampling points, extracting the flow channel center point sequence, performing curve fitting on the center point sequence to obtain the main path centerline, and constructing a centerline topology map for flow channels with branches. The nodes in the centerline topology map represent inlet, outlet, bifurcation point, confluence point or cross-sectional control point, and the edges represent main tunnel, branch tunnel, branch pipe or channel flow segment. The cavity connectivity identification includes constructing a bounding volume surrounding the structural entity model, performing a spatial difference operation on the bounding volume and the structural entity model to obtain candidate cavities, and performing connectivity search starting from the inlet candidate region, the outlet candidate region, or a user-specified seed point. Cavity regions connected to the inlet and outlet candidate regions are retained, while dead cavities, construction holes, maintenance cavities, or external air regions that are unrelated to the main path are removed.

5. The method according to claim 4, characterized in that, In step 4, the extraction method of the fluid computational domain includes at least one of the following: bounding volume Boolean difference extraction, cavity flooding extraction, centerline section sweep extraction, or templated parameter construction. For water diversion tunnels, tailrace tunnels, and pressure pipelines, the centerline cross-section sweep method is preferred for constructing the fluid computation domain; For pressure regulating chambers, tailrace channels, stilling basins, and pump station inlet and outlet pools, the fluid computation domain is constructed primarily using cavity connectivity identification and open closure methods.

6. The method according to claim 5, characterized in that, In step 5, the opening sealing and patching process includes performing planar fitting on the boundary rings corresponding to the candidate inlet and candidate outlet regions. When the boundary rings meet the planarity requirements, the sealing surface is directly generated based on the boundary rings. When the boundary rings do not meet the planarity requirements, the boundary ring points are projected onto the fitting plane and the sealing surface is generated. The generated sealing surface is then stitched with the adjacent wall surface, and the boundary semantic candidate labels of the sealing surface are recorded. The free surface boundary construction includes obtaining the design water level or the calculated water level, constructing a horizontal cutting surface with the design water level or the calculated water level, calculating the intersection line between the horizontal cutting surface and the candidate fluid space, generating a free surface boundary ring based on the intersection line, generating a free surface patch inside the free surface boundary ring, and marking it as a free surface boundary candidate surface.

7. The method according to claim 6, characterized in that, In step 6, boundary semantic recognition includes at least one of rule-based semantic recognition, face adjacency graph-based semantic recognition, and machine learning model-based semantic recognition. The rule-based semantic recognition includes determining the semantic label of the boundary surface based on whether the boundary surface is a sealing surface, the angle between the boundary surface normal and the main direction, the elevation of the boundary surface, the distance between the boundary surface and the centerline endpoint, whether the boundary surface is a horizontal plane, whether the boundary surface is on the model's symmetry plane, and whether the boundary surface is associated with the attributes of the engineering component. The identification of the entrance and exit includes obtaining the normal vector of the opening and sealing surface and the direction of the local centerline corresponding to its location. When the normal vector is opposite to the main direction, the corresponding sealing surface is identified as the entrance. When the normal vector is consistent with the main direction, the corresponding sealing surface is identified as the exit. The identification of free liquid surfaces includes determining whether the boundary surface normal is close to the vertical direction, whether the boundary surface elevation is close to the design water level or the calculated water level, and whether the boundary surface is located in the upper part of the fluid domain. If the preset conditions are met at the same time, the corresponding boundary surface will be identified as a free liquid surface. For solid wall identification, this includes identifying fluid domain boundary surfaces other than inlets, outlets, free liquid surfaces, symmetry planes and internal interfaces as solid walls, or identifying lining surfaces, channel bottom plates, side walls, gate pier surfaces, gate surfaces, guide wall surfaces and energy dissipation structure surfaces as solid walls based on the semantics of structural components. The semantic recognition based on the surface adjacency graph includes constructing a boundary surface adjacency graph with the fluid domain boundary surface as the graph node and the shared edge relationship or spatial adjacency relationship between the boundary surfaces as the graph edge. It also constructs node features for each graph node, including area, normal, elevation, curvature, distance from the centerline, distance from the inlet / outlet, whether it is a sealed surface, whether it is a horizontal surface, and the attributes of the component to which it belongs. Based on the node features and adjacency relationship, it outputs boundary semantic labels. The semantic recognition based on the machine learning model includes extracting the geometric parameters, topological adjacency relationships, multi-view rendered image features, and engineering attribute text features of the boundary surface. The geometric parameters, topological adjacency relationships, multi-view rendered image features, and engineering attribute text features are input into the trained semantic recognition model, and the semantic label probability of the boundary surface is output. When the probability of the highest semantic label is lower than the preset confidence threshold, rule-based semantic recognition is invoked to correct the error or a manual confirmation prompt is output.

8. The method according to claim 7, wherein in step 7, the mesh generation strategy includes at least one of the following: inlet / outlet cross-section densification strategy, wall boundary layer strategy, free liquid surface densification strategy, branch pipe intersection zone densification strategy, bend densification strategy, sudden expansion / contraction zone densification strategy, and internal obstacle wake zone densification strategy; The mesh generation strategy includes at least one of the following: global size field, curvature size field, boundary semantic size field, near-wall boundary layer size field, free liquid surface densification size field, and flow-sensitive region size field. The local mesh size h(x) is determined by taking the minimum value of the global base size h0, curvature control size hc(x), boundary semantic control size hs(x), near-wall boundary layer control size hw(x), free surface control size hfs(x), and flow-sensitive region control size hr(x). The inlet and outlet cross-section densification strategy includes setting local mesh sizes smaller than the global base size for the inlet and outlet surfaces, and setting downstream densification zones and upstream densification zones for the outlet along the main flow direction to ensure uniform mesh distribution and smooth transition with adjacent volume meshes. The wall boundary layer strategy includes calculating the first layer height based on the wall boundary label, target y+, flow velocity, fluid density, dynamic viscosity or empirical friction velocity, setting the number of boundary layer layers, growth rate and total thickness according to the calculation model requirements, generating prism layers or near-wall densification layers on the wall, and performing boundary layer compression, merging or local reconstruction on narrow gaps, sharp corners, intersections and local curvature abrupt regions. The free liquid surface densification strategy includes setting a strip densification zone within a preset range above and below the free liquid surface according to the free liquid surface boundary label or the design water level, and setting a local densification size for the free liquid surface areas such as the inlet air intake vortex, the pressure regulating chamber water surface fluctuation, the open channel free liquid surface and the tailrace channel water surface area. The flow-sensitive area size field includes at least one local area of ​​intensified control, such as the branch pipe intersection area, bend, sudden expansion area, sudden contraction area, gate pier wake area, gate opening, sill, bottom sill, stilling basin, and inlet vortex area.

9. The method according to claim 8, wherein in step 7, the volume mesh generation method includes at least one of the following: centerline swept hexahedral mesh generation, unstructured tetrahedral mesh generation, polyhedral mesh generation, prism boundary layer hybrid mesh generation, and octree cut-cell mesh generation; For water diversion tunnels, tailrace tunnels, and pressure pipelines, O-type, H-type, or C-type cross-section topologies are generated based on the centerline and cross-section sequence, and structured or semi-structured hexahedral meshes are generated by sweeping along the centerline. For fluid domains such as surge tanks, tailrace channels, stilling basins, and pools, surface meshes are generated based on boundary semantic size fields and filled with tetrahedral, polyhedral, or hybrid meshes. For complex, large-scale fluid domains, boundary cutting is performed based on the background octree mesh to generate a cut-cell mesh, and excessively small cut cells are merged or locally reconstructed.

10. The method according to claim 9, wherein in step 8, the mesh quality check includes a closure check, a boundary semantic consistency check, and a mesh cell quality check; the closure check includes checking free edges, non-manifold edges, isolated cavities, normal consistency, and inlet / outlet connectivity; The boundary semantic consistency check includes checking for the existence of unclassified boundary surfaces, whether inlet and outlet are missing, whether the free surface elevation is reasonable, whether the outlet normal is consistent with the outflow direction, and whether the boundary grouping is continuous; the grid cell quality check includes at least one of skewness, non-orthogonality, aspect ratio, volume ratio, minimum volume, boundary layer growth rate, and prism layer collapse rate. When the local mesh does not meet the quality threshold, perform at least one of the following repair operations: local smoothing, local re-meshment, local refinement, small volume element merging, surface normal correction, boundary layer compression, or boundary layer reconstruction. The CFD solver preprocessing file includes at least one of the following: Fluent mesh file, OpenFOAM mesh file, CGNS file, VTK file, or custom solver mesh file; The recommended boundary conditions include at least one of the following: velocity inlet, flow inlet, pressure outlet, outflow boundary, solid wall, rough wall surface, free liquid surface, symmetry plane, porous media interface, and internal region interface.