{"title":"Development of a scripting tool for the fast and batch generation of orthogonal hexahedral mesh for CFD analysis in built environments","authors":"Zhenyu Sun , Tengfei Zhang , Wei Liu","doi":"10.1016/j.buildenv.2025.113102","DOIUrl":null,"url":null,"abstract":"<div><div>In the application of computational fluid dynamics (CFD), a mesh is used to discretize the computational domain and describe its boundaries where the governing equations are solved. In built environments, typical flow features such as wall-bounded flow can be well simulated with a hexahedral mesh, which also provides better control over the overall number of mesh cells. However, in the generation of a structured hexahedral mesh, connectivity modifications propagate through the mesh, resulting in a complex spatial partition of blocks, which significantly increases the workload. Whether using ICEM CFD or <span>blockMesh</span>, the workload caused by block partition is nearly unavoidable. Therefore, this study developed a scripting tool for the fast and batch generation of orthogonal hexahedral meshes. The tool can automatically generate blocks for uniform meshes by inputting characteristic coordinates and global mesh size. It also supports the input of the first layer mesh size, growth rate, and maximum mesh size to automatically generate sub-blocks further for non-uniform meshes. The definition of a boundary only requires inputting the diagonal coordinates of the surface. Additionally, this investigation use a staggered addition method that can quickly identify whether the partitioning of boundary condition is correct and output the reasons and locations of errors. The generated hexahedral mesh can serve as a pre-mesh for creating hybrid meshes, offering flexibility for non-orthogonal geometries. The tool is open-source on GitHub and the link is <span><span>https://github.com/mathslw/meshTool2025</span><svg><path></path></svg></span>.</div></div>","PeriodicalId":9273,"journal":{"name":"Building and Environment","volume":"281 ","pages":"Article 113102"},"PeriodicalIF":7.1000,"publicationDate":"2025-05-17","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"0","resultStr":null,"platform":"Semanticscholar","paperid":null,"PeriodicalName":"Building and Environment","FirstCategoryId":"5","ListUrlMain":"https://www.sciencedirect.com/science/article/pii/S0360132325005839","RegionNum":1,"RegionCategory":"工程技术","ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"Q1","JCRName":"CONSTRUCTION & BUILDING TECHNOLOGY","Score":null,"Total":0}
引用次数: 0
Abstract
In the application of computational fluid dynamics (CFD), a mesh is used to discretize the computational domain and describe its boundaries where the governing equations are solved. In built environments, typical flow features such as wall-bounded flow can be well simulated with a hexahedral mesh, which also provides better control over the overall number of mesh cells. However, in the generation of a structured hexahedral mesh, connectivity modifications propagate through the mesh, resulting in a complex spatial partition of blocks, which significantly increases the workload. Whether using ICEM CFD or blockMesh, the workload caused by block partition is nearly unavoidable. Therefore, this study developed a scripting tool for the fast and batch generation of orthogonal hexahedral meshes. The tool can automatically generate blocks for uniform meshes by inputting characteristic coordinates and global mesh size. It also supports the input of the first layer mesh size, growth rate, and maximum mesh size to automatically generate sub-blocks further for non-uniform meshes. The definition of a boundary only requires inputting the diagonal coordinates of the surface. Additionally, this investigation use a staggered addition method that can quickly identify whether the partitioning of boundary condition is correct and output the reasons and locations of errors. The generated hexahedral mesh can serve as a pre-mesh for creating hybrid meshes, offering flexibility for non-orthogonal geometries. The tool is open-source on GitHub and the link is https://github.com/mathslw/meshTool2025.
期刊介绍:
Building and Environment, an international journal, is dedicated to publishing original research papers, comprehensive review articles, editorials, and short communications in the fields of building science, urban physics, and human interaction with the indoor and outdoor built environment. The journal emphasizes innovative technologies and knowledge verified through measurement and analysis. It covers environmental performance across various spatial scales, from cities and communities to buildings and systems, fostering collaborative, multi-disciplinary research with broader significance.