An aircraft computing grid automatic generation method and system based on a large language model agent and an MCP protocol
Patent Information
- Application Number
- CN202611510730.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-09-28
- Publication Date
- 2026-10-30
AI Technical Summary
气动外形参数化(如CST参数化、NACA四位数系列)通常由独立几何建模工具处理,与网格生成工具之间缺乏直接参数传递通道,构型变化后需要人工重新配置网格参数
(1)显著缩短网格生成周期,降低人工经验门槛。
Smart Images

Figure CN123013302A_ABST
Abstract
Description
Technical Field
[0001] This application belongs to the field of computational fluid dynamics mesh generation technology, specifically relating to an automatic method and system for generating computational meshes for aircraft based on large language model proxies and the MCP protocol. Background Technology
[0002] In aircraft aerodynamic design, computational fluid dynamics (CFD) mesh generation is a crucial preprocessing step that determines simulation accuracy and efficiency. Traditional mesh generation tools (such as Pointwise, ICEM CFD, and snappyHexMesh) rely on engineers manually setting numerous parameters, including the first-layer mesh height, boundary layer growth rate, mesh growth rate, and near-wall refinement strategies, typically requiring 3-5 years of experience to master. Generating a typical airfoil's external flow field mesh, from geometry cleanup, surface mesh generation, boundary layer extrusion to volume mesh generation, can take even skilled engineers tens of minutes to several hours. If the mesh quality is substandard, it must be regenerated with adjusted parameters, creating an inefficient cycle of "generation—evaluation—manual adjustment—regeneration." Mesh generation, CFD solving, and post-processing often use different toolchains, with data transferred between each stage via file input and output, lacking a unified automated orchestration interface, making it difficult to meet the automatic closed-loop requirements of multidisciplinary design optimization. Different aircraft configurations (airfoil, wing, whole aircraft) have different requirements for mesh topology and generation strategies. Existing tools need to be configured independently and cannot achieve automated mesh generation for multiple configurations through a unified interface.
[0003] Large Language Modeling (LLM) has made significant progress in code generation and mathematical reasoning, but its application in engineering simulation, particularly mesh generation, remains in its early stages. Current attempts largely remain at the script generation level; LLM outputs such as Gmsh scripts or OpenFOAM configuration dictionaries still require manual review and debugging, failing to directly drive reliable mesh engine execution. There is a lack of standardized interaction protocols between LLM and engineering simulation tools, typically relying on indirect operations through generated text commands, lacking structured parameter passing, error handling, and result feedback mechanisms. Recent mesh generation systems based on multi-agent orchestration indirectly generate meshes by modifying third-party mesh engine configuration files, still depending on external tools. There are no compiled, self-developed mesh engines, and agent orchestration is based on non-standard protocols, lacking automatic tool discovery and introspection capabilities. Mesh quality assessment tools (such as checkMesh and ParaView mesh quality filters) only generate text assessment reports, lacking decision-making logic for substandard quality, the ability to interact with mesh generators, and a tiered quality threshold mechanism. Aerodynamic shape parameterization (such as CST parameterization and NACA four-digit series) is usually handled by independent geometric modeling tools, lacking a direct parameter transfer channel with mesh generation tools. After configuration changes, the mesh parameters need to be manually reconfigured.
[0004] Therefore, existing technologies lack a standardized calling protocol between LLM and mesh generation tools, the mesh generation process lacks a closed loop for automatic quality feedback correction, and multi-configuration mesh generation lacks a unified interface, making it impossible to achieve fully automated end-to-end generation from natural language requirements to high-quality aircraft computational meshes. Summary of the Invention
[0005] To address the technical problems in existing technologies, such as the lack of a standardized calling protocol between LLM and grid engines, the separation of grid quality assessment and parameter correction, and the need for independent configuration of multiple aircraft configurations, this application aims to provide an automatic generation method for aircraft computational grids based on large language model agents and the MCP protocol. It establishes an MCP protocol bridging mechanism, a closed-loop quality feedback mechanism, and a unified configuration interface to achieve fully automatic generation from natural language to high-quality computational grids.
[0006] To achieve the above technical objectives, this application specifically employs the following technical solution: In one aspect of this application, a method for automatically generating an aircraft computational grid based on a large language model agent and the MCP protocol is provided, comprising the following steps: S1. The large language model agent receives the aircraft mesh generation request input by the user in the form of natural language. The large language model agent performs semantic parsing on the natural language, extracts the mesh generation parameters and maps them into a structured parameter dictionary. The mesh generation parameters include at least the aircraft configuration parameters, the number of target mesh cells and the wall distance parameters. S2. The large language model agent acts as an MCP client, constructs a tool call request according to the JSON-RPC 2.0 standard format, and transmits the structured parameter dictionary to the MCP server through the MCP protocol; the MCP server schedules the compiled mesh engine to execute the mesh generation task according to the tool call request. S3. The compiled mesh engine automatically constructs the aircraft geometry configuration based on the aircraft configuration parameters in the structured parameter dictionary, performs node discretization on the surface of the aircraft geometry configuration, establishes structured mesh topology relationships, and generates a surface mesh. S4. The compiled mesh engine uses a hyperbolic propulsion algorithm to extrude boundary layer meshes from the wall of the aircraft geometry layer by layer. It automatically calculates the height of the first layer mesh according to the wall distance parameter, generates boundary layer structure meshes layer by layer, and further expands the mesh region towards the far field boundary to form a complete computational domain mesh. S5. After the compiled mesh engine is generated, it automatically performs mesh quality assessment, calculates quality indicators, and returns the mesh quality assessment results containing the quality indicators to the large language model agent in structured JSON format through the MCP protocol. S6. The large language model agent makes a judgment based on the mesh quality assessment result according to a preset three-level threshold. When the quality indicator meets the pass threshold, the iteration is terminated and the final mesh is output. When the quality indicator triggers the warning threshold or the fail threshold, and the number of iterations has not reached the preset maximum number of iterations, the large language model agent automatically adjusts the mesh generation parameters and repeats steps S2 to S5. When the number of iterations reaches the preset maximum number of iterations and the quality indicator still does not meet the pass threshold, the iteration is terminated, the mesh with the best current quality is output, and a quality assessment report is returned.
[0007] In one implementation, the MCP protocol in step S2 conforms to the ANSI / CTA-2115 standard; the MCP server provides a list of available tools to the large language model agent through the tools / list interface, receives and executes the tool call request through the tools / call interface, and provides the JSON Schema definition of the tool input parameters to the large language model agent through the get_skill_input_info interface, thereby realizing dynamic tool discovery and parameter introspection.
[0008] In one implementation, the compiled mesh engine in step S2 is a compiled computing core that implements numerical computation algorithms in C / C++ and encapsulates them as a Python C extension dynamic library. The compiled mesh engine does not rely on third-party mesh generation tools and is directly scheduled and executed by the MCP server.
[0009] In one implementation, the aircraft configuration parameters in step S3 include airfoil identifiers, wing identifiers, or overall aircraft identifiers; the specific method by which the compiled mesh engine automatically constructs the aircraft geometry configuration based on the aircraft configuration parameters is as follows: When the aircraft configuration parameters are airfoil identifiers, for NACA four-digit airfoils, the compiled mesh engine parses the maximum camber, maximum camber position and maximum thickness parameters corresponding to the airfoil number, calculates the arc and thickness distribution in the airfoil according to the NACA standard airfoil mathematical model, obtains the coordinates of the upper surface and lower surface of the airfoil, and generates a complete airfoil profile. The airfoil identifier supports four input formats: NACA four-digit airfoil, NACA five-digit airfoil, CST parametrically defined airfoil, and airfoil data file path.
[0010] In one implementation, the specific method for automatically calculating the height of the first layer of mesh based on the wall distance parameter in step S4 is as follows: First, the Reynolds number is calculated based on the incoming Mach number and the reference chord length; then, the wall friction coefficient is estimated using the empirical relationship of the turbulent boundary layer of a flat plate, and the wall shear stress and friction velocity are further obtained; finally, the height of the first layer of mesh is calculated based on the target wall distance parameter; when the user does not specify the height of the first layer of mesh, the compiled mesh engine automatically calculates and sets the height of the first layer of mesh based on the wall distance parameter.
[0011] In one implementation, the hyperbolic propulsion algorithm in step S4 generates boundary layer meshes layer by layer along the wall normal direction of the aircraft geometry. During the propulsion process, multiple hyperbolic sweep iterations are performed to correct the local propulsion direction. The algorithm also combines a neighborhood-averaged node normal smoothing method and a diffusion control strategy to suppress normal oscillations and maintain the continuity and orthogonality between mesh layers. The number of boundary layer layers is automatically determined based on the number of target mesh cells.
[0012] In one implementation, the quality indicators include at least the maximum non-orthogonality, the maximum aspect ratio, and the maximum skewness; the criteria for determining the three-level thresholds are as follows: For the maximum nonorthogonality, the pass threshold is less than 70°, the warning threshold is greater than or equal to 70° and less than or equal to 80°, and the fail threshold is greater than 80°. For the maximum aspect ratio, the pass threshold is less than 1000, the warning threshold is greater than or equal to 1000 and less than or equal to 5000, and the fail threshold is greater than 5000. For the maximum skew rate, the pass threshold is less than 4.0, the warning threshold is greater than or equal to 4.0 and less than or equal to 6.0, and the fail threshold is greater than 6.0.
[0013] In one implementation, the specific method by which the large language model agent automatically adjusts the mesh generation parameters in step S6 is as follows: When the maximum nonorthogonality is within the threshold range corresponding to the warning threshold or the fail threshold, increase the number of hyperbolic propulsion iterations and / or the neighborhood smoothing range; When the maximum aspect ratio is within the threshold range corresponding to the warning threshold or the fail threshold, the neighborhood smoothing range is expanded. When the maximum skew rate is within the threshold range corresponding to the warning threshold or the fail threshold, the parameters of the diffusion control strategy are adjusted.
[0014] In one implementation, the maximum number of iterations of the closed-loop quality feedback in steps S2 to S5 in step S6 is 5; when the number of iterations reaches the maximum number of iterations and the quality index still does not meet the pass threshold, the current best quality mesh is output and a quality assessment report is returned.
[0015] In one implementation, the aircraft configuration is extended through the Agent+Skill two-level registration mechanism of the MCP protocol. Each configuration corresponds to an Agent and Skill combination, sharing a unified MCP interface call paradigm.
[0016] In one implementation, the final mesh is output as multiple CFD solver-compatible formats via a plug-in format conversion layer. These multiple CFD solver-compatible formats include CGNS format, OpenFOAM polyMesh format, ANSYSFluent .msh format, STAR-CCM+ .ccm format, and SU2 .su2 format. The plug-in format conversion layer adopts a plug-in architecture, with each format corresponding to an independent conversion plug-in.
[0017] In another aspect of this application, an automatic generation system for aircraft computational grids based on large language model agents and the MCP protocol is provided, comprising: The natural language parsing module, deployed inside the large language model agent, is used to receive the aircraft mesh generation requirements input by the user in natural language form, perform semantic parsing on the natural language to extract mesh generation parameters and map them into a structured parameter dictionary; The MCP protocol bridging module includes an MCP client and an MCP server. The MCP client is used to construct a tool call request according to the JSON-RPC 2.0 standard format and transmit the structured parameter dictionary through the MCP protocol. The MCP server is used to receive the tool call request and schedule the compiled grid engine. The compiled mesh engine module is connected to the MCP server and is used to automatically construct the aircraft geometry configuration, generate surface mesh, and use the hyperbolic propulsion algorithm to extrude the boundary layer mesh layer by layer and expand it to form a complete computational domain volume mesh based on the aircraft configuration parameters in the structured parameter dictionary. The mesh quality assessment module is used to automatically calculate quality indicators after the mesh is generated, and return the mesh quality assessment results containing the quality indicators to the large language model agent in structured JSON format via the MCP protocol; A closed-loop quality feedback module is used to determine the quality of the mesh based on the mesh quality evaluation results according to a preset three-level threshold. When the quality indicator meets the pass threshold, the iteration terminates and the final mesh is output. When the quality indicator triggers the warning threshold or fail threshold, the mesh generation parameters are automatically adjusted and the compiled mesh engine module is triggered to regenerate the mesh until the quality indicator meets the pass threshold. When the number of iterations reaches the preset maximum number of iterations and the quality indicator still does not meet the pass threshold, the iteration terminates, the mesh with the best current quality is output, and a quality evaluation report is returned.
[0018] In one implementation, the MCP protocol bridging module provides a list of available tools to the large language model agent through the tools / list interface, receives and executes tool call requests through the tools / call interface, and provides the large language model agent with the JSON Schema definition of tool input parameters through the get_skill_input_info interface; the MCP protocol bridging module conforms to the ANSI / CTA-2115 standard.
[0019] In one implementation, the compiled mesh engine module is deployed as a Python C extension dynamic library. The core numerical computation algorithms of the compiled mesh engine module are compiled and executed at the C / C++ layer, including spacecraft geometry configuration analysis, surface mesh generation, hyperbolic propulsion boundary layer extrusion, normal smoothing, topology construction, and multi-format output.
[0020] In one implementation, the automatic generation system for the aircraft computational grid further includes a multi-configuration extension module. The multi-configuration extension module supports unified interface scheduling for airfoil configurations, wing configurations, and full configurations through an Agent+Skill two-level registration mechanism. Each configuration defines input parameters through an independent JSON Schema. The large language model agent dynamically discovers available configurations through the tools / list interface and obtains the corresponding input parameter Schema through the get_skill_input_info interface.
[0021] In one embodiment, the automatic generation system for aircraft computational grids further includes a format conversion module. The format conversion module adopts a plug-in architecture and outputs the standard grid data structure generated by the compiled grid engine module into any one or more of the following formats: CGNS format, OpenFOAM polyMesh format, ANSYS Fluent .msh format, STAR-CCM+ .ccm format, and SU2 .su2 format through an independent conversion plug-in.
[0022] The beneficial effects of this application are as follows: (1) Significantly shortens the grid generation cycle and lowers the threshold of human experience.
[0023] Traditional CFD mesh generation relies on engineers manually configuring more than ten parameters, and a skilled engineer can spend 30 minutes to 2 hours to complete a single mesh generation. This application automatically parses natural language requirements through a large language model agent and maps them into a structured parameter dictionary. Combined with the MCP protocol bridging, it enables one-click invocation, reducing end-to-end mesh generation time to minutes. Taking the NACA0012 airfoil 6000-element mesh in Example 1 as an example, the entire process from natural language input to obtaining a usable volume mesh and quality assessment report can be completed within 3 minutes, without the need for a professional CFD mesh engineer.
[0024] (2) Implement standardized tool calls to eliminate workflow fragmentation.
[0025] This application establishes a unified JSON-RPC 2.0 calling interface between large language model agents and compiled grid engines using the MCP protocol conforming to the ANSI / CTA-2115 standard. Parameters are passed as strongly typed structured objects, and the returned result is a machine-parseable quality assessment dictionary, eliminating problems such as parameter ambiguity, missing error handling, and difficulty in result parsing inherent in existing text script generation methods. Any AI agent supporting the MCP protocol can reuse this interface to drive the compiled grid engine, possessing the standardized advantages of tool discovery (tools / list), introspective input parameter schema (get_skill_input_info), and agent replaceability.
[0026] (3) Establish a closed-loop quality feedback mechanism to ensure grid availability.
[0027] This application automatically performs a quality assessment after mesh generation, including indicators such as maximum non-orthogonality, maximum skewness, and maximum aspect ratio, and establishes a three-level threshold judgment system. When a quality indicator triggers a warning threshold or a fail threshold, the system automatically adjusts the hyperbolic sweep iteration number, the normal smoothing neighborhood range, or recalculates the height of the first-layer mesh, triggering regeneration without manual intervention. Taking the NACA4412 airfoil in Example 3 as an example, after the maximum non-orthogonality of the initially generated mesh enters the warning range, the system automatically enhances the smoothing intensity and expands the neighborhood. After the second round of regeneration, the maximum non-orthogonality decreases from 73.50° to 62.35°, reaching the pass standard, thus realizing a fully automatic closed loop of "mesh generation → quality assessment → parameter adjustment → regeneration".
[0028] (4) Supports a unified interface for multiple aircraft configurations.
[0029] This application utilizes the Agent+Skill two-level registration mechanism of the MCP protocol to support the automatic generation of meshes for various aircraft configurations, including 2D airfoil configurations, 3D semi-model wing configurations, and full 3D configurations of the entire aircraft, through a unified tools / call interface. The input parameters for each configuration are defined by a dedicated JSON Schema. The large language model agent dynamically discovers available tools through the tools / list interface, eliminating the need for independent configuration of calling logic for each configuration and achieving automated mesh generation compatible with multiple configurations.
[0030] (5) Compiled engines ensure computational efficiency.
[0031] The compiled mesh engine used in this application implements the core numerical algorithms in C / C++ and encapsulates them as a Python C extension dynamic library. Compared with the pure Python implementation, the efficiency of high-frequency numerical operations such as hyperbolic propagation and normal smoothing is significantly improved, while maintaining good compatibility with the Python ecosystem and the MCP protocol.
[0032] (6) Multi-format output compatible with mainstream CFD solvers.
[0033] The final mesh generated in this application can be automatically converted to various CFD solver-compatible formats through a plug-in format conversion layer, including CGNS format, OpenFOAM standard polyMesh format (including node coordinates, surface connectivity, element affiliation, and boundary condition definitions), ANSYS Fluent .msh format, STAR-CCM+ .ccm format, and SU2 .su2 format. It also supports Plot3D surface mesh and OpenVSP geometry file output, realizing full automation from geometry generation to solver input file. Attached Figure Description
[0034] Figure 1 This is a schematic diagram of the automatic mesh generation method based on large language model proxy and MCP protocol in an embodiment of this application; Figure 2 This is a schematic diagram of the computational mesh for the NACA0012 airfoil, an embodiment of this application. Detailed Implementation
[0035] The technical solution of this application will be clearly and completely described below with reference to specific embodiments. However, those skilled in the art will understand that the embodiments described below are only some embodiments of this application, not all embodiments, and are only used to illustrate this application, and should not be regarded as limiting the scope of this application. Based on the embodiments in this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0036] CFD mesh generation has long relied on engineers manually setting more than ten parameters, such as the first-layer mesh height, boundary layer growth rate, and near-wall refinement strategy. A skilled engineer can spend 30 minutes to 2 hours completing a single mesh generation. If the mesh non-orthogonality exceeds the solver's tolerance limit, the engineer must manually adjust the parameters and regenerate, creating an inefficient cycle of "generation → evaluation → manual adjustment → regeneration." Existing mesh quality assessment tools (such as OpenFOAM's checkMesh) only output text reports and lack the closed-loop capability to feed the assessment results back to the generation process and trigger automatic corrections.
[0037] Following significant advancements in code generation and mathematical reasoning using large language models, some research has attempted to leverage them to generate mesh generation scripts (such as the Gmsh.geo script or OpenFOAM's snappyHexMeshDict configuration file). However, the scripts output by large language models still require manual review and debugging and cannot directly drive mesh engines for reliable execution. Furthermore, the interaction between large language models and engineering simulation tools lacks standardized protocols—large language models typically interact indirectly with tools by generating text commands, lacking structured mechanisms for parameter passing, error handling, and result feedback.
[0038] This application proposes an automatic aircraft computational mesh generation method based on a large language model agent and the MCP protocol. The MCP protocol, defined by the ANSI / CTA-2115 standard, is introduced into the field of CFD mesh generation. A standardized JSON-RPC 2.0 bridging mechanism is established between the large language model agent and the compiled mesh engine. This enables the large language model agent to directly drive the compiled mesh engine to perform mesh generation using structured parameter calls and to receive machine-parseable structured quality assessment results. This achieves a fully automated closed loop of "mesh generation - quality assessment - three-level threshold determination - automatic parameter adjustment - regeneration." Furthermore, a two-level Agent+Skill registration mechanism supports various aircraft configurations, including airfoils, wings, and the entire aircraft, through a unified interface.
[0039] In one specific implementation, the computational fluid dynamics mesh automatic generation method based on large language model proxies and the MCP protocol of this application is implemented using a four-layer hierarchical architecture. For example... Figure 1 As shown, the architecture, from top to bottom, consists of a natural language layer, a parameter mapping layer, an MCP protocol bridging layer, a compiled grid engine layer, and a closed-loop quality feedback layer. Structured data is exchanged between these layers through standardized interfaces, forming a fully automated end-to-end pipeline from user natural language input to high-quality CFD computational grid output.
[0040] like Figure 1As shown, the process begins with the user describing their mesh generation requirements in natural language. The large language model agent performs semantic parsing on the natural language input, automatically identifying key parameters such as configuration type, number of mesh cells, wall distance, and Mach number. It then performs parameter mapping and structured completion, standardizing the extracted parameters and filling in missing parameters to generate a structured parameter dictionary to ensure parameter integrity in subsequent processes. The MCP client encapsulates tool call requests according to the JSON-RPC 2.0 standard format, enabling standardized communication with lower-level tools. The MCP server schedules the corresponding tool functions after receiving the request. As the core computational module of the system, the compiled mesh engine sequentially executes aircraft geometry analysis, surface mesh generation, boundary layer hyperbolic propulsion topology, volume mesh generation and topology construction, and mesh file output. After mesh generation, it enters the quality evaluation stage. If the quality is substandard, a closed-loop quality feedback mechanism automatically adjusts parameters such as the number of boundary layer layers, the number of adjacent rings, the height of the first layer mesh, and the wall distance, re-inputting these parameters to the MCP server scheduling stage to trigger a new round of mesh generation and evaluation. If the quality meets the standards, proceed to the results output stage, outputting grid files in various formats and providing visual images and interactive links.
[0041] First layer: Natural Language Parameter Mapping Layer The natural language-parameter mapping layer is deployed within the large language model agent. After receiving the aircraft mesh generation request from the user in natural language, the large language model agent leverages the language understanding capabilities of the large language model to extract mesh generation parameters from the natural language and map them into a structured parameter dictionary. The structured parameter dictionary is organized in key-value pairs, where each key corresponds to a mesh generation parameter name, and each value corresponds to a parameter value or string identifier extracted from the natural language.
[0042] Taking the user input "Generate a mesh for an airfoil of NACA0012, 6000 elements, y+ approximately 50, Mach number 0.05" as an example, the large language model agent performs semantic parsing of the natural language. Table 1 shows examples of natural language parameter extraction and structured mapping.
[0043] Table 1 Examples of Natural Language Parameter Extraction and Structured Mapping
[0044] After extracting explicit parameters from the natural language, the large language model agent further performs parameter completion. For parameters not explicitly specified by the user in the natural language, the agent completes them according to preset default values. For example, for the blunt trailing edge ratio, if the user does not specify it, the agent sets it to 0.01. For the reference chord length, if the user does not specify it, the agent sets it to 1.0. For the first-layer mesh height, if the user does not specify it, the agent sets it to -1, indicating that the compiled mesh engine automatically calculates the first-layer mesh height based on the target wall distance parameter. After parameter extraction and completion, the agent outputs a complete structured parameter dictionary.
[0045] The natural language parameter mapping layer supports parameter extensions for various aircraft configurations. Aircraft configurations include airfoil configurations, wing configurations, and full-body configurations. While sharing basic parameters, the structured parameter dictionaries for each of these three configurations each contain configuration-specific extended parameters.
[0046] For airfoil configurations, the structured parameter dictionary includes the following parameters: airfoil model identifier parameter, used to specify the data file path for NACA four-digit airfoil, NACA five-digit airfoil, CST parametrically defined airfoil, or custom airfoil; target mesh cell count parameter, used to specify the total number of target cells in the airfoil surface mesh; target wall distance parameter, used to specify the dimensionless wall distance target value for the first layer mesh; incoming flow Mach number parameter, used to specify the far-field incoming flow Mach number to assist in the calculation of the first layer mesh height; blunt trailing edge ratio parameter, used to control the blunting degree of the airfoil trailing edge to avoid sharp trailing edge mesh singularities; first layer mesh height parameter, a positive value directly specifies the first layer mesh height, and a value of -1 indicates that it is automatically calculated by the compiled mesh engine.
[0047] For wing configurations, the structured parameter dictionary adds the following parameters to all airfoil configuration parameters: span parameter, used to specify the spanwise length of the wing; spanwise segment number parameter, used to specify the number of grid segments along the spanwise direction of the wing, with a higher spanwise segment number resulting in higher spanwise grid resolution; and the airfoil type identifier parameter, used to specify the airfoil distribution at various cross-sectional positions along the spanwise direction of the wing.
[0048] For all configurations, the structured parameter dictionary adds the following parameters to all parameters of the wing configuration: fuselage component definition parameters, used to specify the geometry and spatial position of the fuselage; horizontal tail component definition parameters, used to specify the geometry, spatial position, and mounting angle of the horizontal tail; and vertical tail component definition parameters, used to specify the geometry, spatial position, and mounting angle of the vertical tail.
[0049] After the Natural Language Parameter Mapping layer completes parameter extraction, completion, and structuring, it outputs a structured parameter dictionary to the MCP protocol bridging layer. The structured parameter dictionary is organized in JSON format, with each parameter paired with a key-value pair according to its name, ensuring that the subsequent MCP protocol bridging layer can construct JSON-RPC 2.0 tool call requests according to a unified parameter pattern.
[0050] Second layer: MCP protocol bridging layer The MCP protocol bridging layer implements a bridging mechanism compliant with the ANSI / CTA-2115 standard. The ANSI / CTA-2115 standard is a Model Context Protocol standard that defines a standardized JSON-RPC 2.0 interaction method between AI agents and external tools. The MCP protocol bridging layer enables any AI agent supporting the MCP protocol to directly drive the compiled mesh engine via structured JSON-RPC 2.0 calls, replacing the existing method where AI agents indirectly drive tools by generating text scripts.
[0051] The MCP protocol bridging layer includes the MCP server. The MCP server is named mdo-agent-deck-mcp. The MCP server provides three core tool interfaces: a mesh generation tool interface, a mesh quality review tool interface, and a parameter information query tool interface.
[0052] I. Mesh Generation Tool Interface The mesh generation tool interface is named generate-cfd-mesh. The mesh generation tool interface accepts a structured parameter dictionary as input. Table 2 shows the core parameter descriptions of the mesh generation tool interface.
[0053] Table 2. Explanation of core parameters for the Generate-CFD-Mesh tool.
[0054] After completing mesh generation, the mesh generation tool interface returns structured quality assessment results. Table 3 shows the mesh quality output metrics of the mesh generation tool interface.
[0055] Table 3 Mesh quality output metrics of the Generate-CFD-Mesh tool
[0056] II. Grid Quality Review Tool Interface The mesh quality review tool interface is named `analyze`. This interface is used to review the quality of generated meshes. It accepts `agent` and `skill` name parameters as input. The interface returns structured quality assessment results consistent with those of the mesh generation tool interface. These results include the total number of cells in the generated mesh, maximum non-orthogonality, average non-orthogonality, number of severely non-orthogonal surfaces, maximum skewness, maximum aspect ratio, mesh quality compliance indicators, quality indicator check results, visualization result file path, visualization service running status, and the address for online mesh visualization.
[0057] III. Parameter Information Query Tool Interface The parameter information query tool interface is named `get_skill_input_info`. This interface is used to query the input parameter patterns of a specific AI agent and skill combination. It accepts agent and skill name parameters as input. The interface returns a JSON schema definition of the input parameters for a specific agent+skill combination. The JSON schema definition includes the name, data type, value range, and whether each parameter is required. This interface allows large language model agents to understand the required parameters and types before calling the grid generation tool interface, enabling pattern discovery and introspection.
[0058] IV. Tool Invocation Flow of MCP Protocol Bridging Layer The large language model agent acts as an MCP client, interacting with the MCP server via the MCP protocol. The interaction flow is as follows: The large language model agent first queries the MCP server for a list of available tools via the tools / list interface. The MCP server returns a list of available tools, which includes interfaces for mesh generation tools, mesh quality review tools, and parameter information query tools.
[0059] The Large Language Model Agent queries the MCP server for the JSON Schema definition of the input parameters for a specific tool via the get_skill_input_info interface. The MCP server returns the JSON Schema definition of the input parameters for that tool. The Large Language Model Agent then constructs a structured parameter object based on the JSON Schema definition.
[0060] The large language model agent sends tool invocation requests to the MCP server via the `tools / call` interface. The tool invocation request is constructed according to the JSON-RPC 2.0 standard format. The request includes a method name and a structured parameter object. The method name is `tools / call`. The structured parameter object contains the tool name and a parameter dictionary. The tool name specifies the name of the tool interface being invoked, and the parameter dictionary contains all the key-value pairs of parameters required for mesh generation.
[0061] After receiving the tool call request, the MCP server verifies the integrity and data type correctness of the structured parameter object. Upon successful verification, the MCP server schedules the compiled mesh engine to execute the mesh generation task. After receiving the structured quality assessment results from the compiled mesh engine, the MCP server returns the results to the large language model agent in JSON-RPC 2.0 response format.
[0062] Table 4 shows a comparison of tool invocation protocols, comparing existing script generation schemes with the MCP protocol bridging scheme of this application.
[0063] Table 4 Comparison of Tool Invocation Protocols—Existing Script Generation Schemes and the MCP Protocol Bridging Scheme of This Invention
[0064] As shown in Table 4, existing solutions use text concatenation or file writing to pass parameters. Text concatenation embeds parameter values into natural language or script strings, while file writing writes parameters to a configuration file for the tool to read. This application's solution uses structured JSON-RPC 2.0 to pass parameters. Parameters are organized in key-value pairs, with clearly defined data types, eliminating parameter ambiguity.
[0065] Regarding error handling mechanisms, existing solutions obtain error information by parsing the text output by scripts, requiring manual or regular expression extraction of error codes and descriptions from unstructured text. This application's solution employs standardized error codes and an exception propagation mechanism. Error types are defined by the JSON-RPC 2.0 standard, and error information is structured as JSON objects, which can be directly parsed by machines.
[0066] Regarding tool discovery mechanisms, existing solutions use hard-coded tool lists, with tool names, input parameters, and invocation methods fixed in the calling code. Adding a new tool requires code modification. This application's solution uses the MCP's tools / list interface for dynamic discovery. The large language model agent queries the list of available tools at runtime, eliminating the need for pre-hard coding.
[0067] Regarding the result return mechanism, existing solutions indirectly obtain results using file I / O. The mesh generation tool writes the results to a file, and the large language model agent reads the file content. This application's solution directly returns results using structured JSON. The execution result of the mesh generation tool is returned directly to the large language model agent in JSON format as the response body, eliminating the need for file read / write operations.
[0068] Regarding agent compatibility, existing solutions are limited to specific large language models, each requiring a separate interface adaptation. This application's solution supports any AI agent that supports the MCP protocol, and any AI agent implementing the MCP client specification can reuse the MCP server-driven compiled mesh engine.
[0069] Regarding interface extension mechanisms, existing solutions extend interfaces by modifying script logic, requiring rewriting the script parsing logic to add new tools or modify parameters. This application's solution extends interfaces by adding new MCP tool definitions. New tool names, parameter schemas, and calling logic are simply registered in the MCP server, without affecting existing tool interfaces.
[0070] Third layer: Compiled mesh engine layer The compiled mesh engine layer is named mdo_agent_mesh. This layer employs a compiled computational core, with key numerical computation algorithms implemented in C / C++ at the lower level and encapsulated as a Python C extension dynamic library for use by the upper-layer intelligent agent. By compiling and executing high-frequency numerical computation modules, mesh generation efficiency is significantly improved while maintaining good compatibility with the Python ecosystem and the MCP protocol.
[0071] I. Automatic Airfoil Geometry Construction The compiled mesh engine first automatically constructs the airfoil geometry based on the airfoil designation input by the user. For NACA four-digit airfoils, the compiled mesh engine resolves the maximum camber, maximum camber location, and maximum thickness parameters corresponding to the airfoil designation. The NACA four-digit airfoil designation consists of four digits: the first digit represents the percentage of maximum camber to chord length, the second digit represents the maximum camber location to one-tenth of the chord length, and the third and fourth digits represent the maximum thickness to chord length. The compiled mesh engine calculates the airfoil's mid-curvature and thickness distribution based on the NACA standard airfoil mathematical model. The mid-curvature is determined by the maximum camber and maximum camber location, and the thickness distribution is determined by the maximum thickness. The compiled mesh engine overlays the mid-curvature coordinates with the thickness distribution to obtain the coordinates of the airfoil's upper and lower surfaces, generating the complete airfoil profile. This method can quickly construct standard airfoils without relying on external geometric modeling software, providing a basic geometric model for subsequent mesh generation.
[0072] II. Surface Mesh Generation and Blunt Trailing Edge Processing After obtaining the airfoil geometry, the compiled mesh engine discretizes the nodes on the airfoil surface according to the target mesh size. Node discretization uses a cosine distribution, with denser node distribution at the leading and trailing edges and sparser node distribution in the mid-section. The compiled mesh engine then establishes a structured mesh topology, forming the airfoil surface mesh. In this structured mesh topology, each internal node connects to four adjacent nodes, and boundary nodes connect to two adjacent nodes.
[0073] To avoid mesh degradation in the sharp trailing edge region, a compiled mesh engine introduces a blunt trailing edge processing mechanism. A sharp trailing edge refers to a geometry where the airfoil's trailing edge thickness is zero, and the upper and lower surfaces meet at a single point. This location is prone to generating degenerate elements with aspect ratio distortion during mesh generation. The blunt trailing edge processing mechanism constructs a finite-thickness trailing edge by controlling the trailing edge thickness ratio. The compiled mesh engine separates the coordinate points of the upper and lower surfaces at the airfoil's trailing edge location and determines the trailing edge thickness according to the blunt trailing edge ratio parameters, ensuring good element quality and numerical stability in the vicinity of the trailing edge.
[0074] After the surface mesh is generated, the compiled mesh engine outputs OpenVSP geometry files and Plot3D format surface mesh files. The OpenVSP geometry files are used for visualization and editing in aircraft geometry modeling software, while the Plot3D format surface mesh files are used for storing and exchanging structured meshes. The compiled mesh engine also retains the boundary topology information required for subsequent boundary layer propulsion. This boundary topology information includes the node number sequence and node coordinates on the airfoil wall boundary, as well as the normal direction vectors of each node on the wall boundary.
[0075] III. Hyperbolic Advancement Algorithm for Boundary Layer Mesh During the boundary layer mesh generation stage, the compiled mesh engine uses a hyperbolic propagation algorithm to extrude the boundary layer mesh layer by layer from the airfoil wall outward.
[0076] When the user does not specify the height of the first mesh layer, the compiled mesh engine automatically calculates the height of the first mesh layer based on the target wall distance, the incoming Mach number, and the reference chord length. The specific calculation method is as follows: first, the Reynolds number is calculated based on the flow conditions; then, the wall friction coefficient is estimated using empirical relationships for the turbulent boundary layer of a flat plate; further, the wall shear stress and friction velocity are obtained; finally, the height of the first mesh layer is determined based on the target wall distance, thus ensuring that the generated mesh meets the near-wall resolution requirements of the turbulence model.
[0077] After determining the initial layer height, the compiled mesh engine performs hyperbolic propagation calculations along the normal direction of the airfoil surface, generating boundary layer meshes layer by layer. The hyperbolic propagation algorithm transforms mesh generation into solving hyperbolic partial differential equations, pushing outward from the wall boundary, generating a new layer of mesh nodes with each step forward.
[0078] Multiple hyperbolic sweep iterations are introduced during the advancement process to correct local advancement directions. Hyperbolic sweep iteration refers to scanning and adjusting the generated node positions multiple times after each advancement step to make the advancement direction smoother. The compiled mesh engine combines neighborhood normal smoothing and diffusion control strategies to suppress normal oscillations. Neighborhood normal smoothing eliminates abrupt changes in local direction by weighted averaging of the normal directions of adjacent nodes, while the diffusion control strategy prevents oscillation amplification by limiting the rate of change of node displacement. This ensures continuity, smoothness, and high orthogonality between mesh layers.
[0079] The number of boundary layers is automatically determined based on the target mesh size. For example, when the target mesh size is approximately 6000 cells, the compiled mesh engine automatically generates 20 boundary layers. When the target size increases to 12000 cells, the compiled mesh engine automatically generates 36 boundary layers. The number of boundary layers increases with the target mesh size, balancing computational accuracy and mesh size requirements.
[0080] IV. Continuous Monitoring and Local Correction of Grid Quality Throughout the mesh generation process, the compiled mesh engine continuously monitors mesh quality metrics. These metrics include maximum non-orthogonality, average non-orthogonality, number of severely non-orthogonal surfaces, maximum skewness, and maximum aspect ratio. When a local region's quality exceeds a preset threshold, the compiled mesh engine automatically performs local normal correction and mesh smoothing operations until the predetermined quality standards are met.
[0081] To ensure that the mesh quality continuously meets the numerical computation requirements during boundary layer advancement, the compiled mesh engine automatically performs non-orthogonality evaluation after each mesh layer is generated. The compiled mesh engine obtains the non-orthogonality index by calculating the angle between the normal vector of a cell surface and the direction of the line connecting the centers of adjacent cells, and also counts the maximum non-orthogonality in each mesh layer. The obtained quality index is not only used for the final mesh quality evaluation, but also serves as feedback information for subsequent mesh optimization and normal correction processes, achieving closed-loop quality control during mesh generation.
[0082] During boundary layer advancement, mesh distortion and element distortion are prone to occur due to changes in airfoil geometry curvature and discontinuities in local normal directions. To address this, the compiled mesh engine introduces a neighborhood-averaged node normal smoothing method to iteratively correct the node normal directions. A local neighborhood set is constructed based on the topological relationships of several layers surrounding the node, and weighting coefficients are determined according to the distance between nodes. The node normal directions are then recalculated using a weighted average. After smoothing, normal oscillations are effectively reduced, improving stability and mesh orthogonality during boundary layer advancement.
[0083] V. Construction of Mesh Topology Connections To support normal smoothing, mesh quality assessment, and subsequent mesh operations, the compiled mesh engine constructs a complete mesh topology connection relationship. This connection relationship includes connections between nodes, node-to-face relationships, face-to-cell relationships, and cell adjacency relationships. The compiled mesh engine employs a compressed sparse storage structure to organize the topology connection relationship, reducing storage overhead and improving neighborhood search efficiency. In this structure, node numbers are sorted by spatial location, face connections are compressed and stored according to node numbers, and cell relationships are compressed and stored according to face numbers. Building upon this, the compiled mesh engine further establishes multi-layered neighborhood relationships, which refer to the first-layer, second-layer, and third-layer neighbor sets for each node. These multi-layered neighborhood relationships provide fast access capabilities for normal smoothing calculations, mesh quality analysis, and local optimization.
[0084] VI. Volume Mesh Generation Process After completing the boundary layer mesh generation and quality optimization, the compiled mesh engine automatically executes the volume mesh generation process. First, it reads the airfoil mesh data and determines the height of the first layer based on user input parameters or automatic calculation results. Then, it uses a hyperbolic propagation algorithm to generate the boundary layer structure mesh layer by layer, continuously optimizing the mesh quality using a node normal smoothing strategy. After the boundary layer region is generated, the mesh region is further expanded towards the far-field boundary to form a complete computational domain. The far-field boundary direction refers to the direction extending outward from the airfoil wall to the outer boundary of the computational domain; the distance to the far-field boundary is determined according to the computational domain size requirements. Subsequently, the volume mesh topology is constructed and a consistency check is performed. The consistency check includes checking whether the faces of each element are shared by adjacent elements, whether the normal direction of the boundary faces points outside the computational domain, and whether the element volume is positive. The compiled mesh engine ultimately obtains a volume mesh model that meets the requirements of CFD computation.
[0085] VII. Multi-format output The generated volume mesh is automatically converted into a data format recognizable by the solver. In one embodiment, the compiled mesh engine outputs an OpenFOAM standard polyMesh mesh structure. The OpenFOAM standard polyMesh mesh structure includes node coordinate data, face connectivity, element affiliation, adjacent element relationships, and boundary condition definition information. Node coordinate data stores the 3D spatial coordinates of each node. Face connectivity stores the sequence of node numbers contained in each face. Element affiliation stores the sequence of face numbers contained in each element, as well as the type identifier of each element. Adjacent element relationships store the adjacent element numbers of each element on all faces; for faces located at the boundary of the computational domain, the adjacent element numbers are marked as boundary identifiers. Boundary condition definition information divides the outer surface of the computational domain into different boundary regions, including airfoil wall boundaries, far-field boundaries, and symmetry boundaries. Airfoil wall boundaries are the aircraft surface, far-field boundaries are the outer boundaries of the computational domain, and symmetry boundaries are symmetry planes. Boundary condition definition information includes the name, type, and list of face numbers contained in each boundary region. Through the above outputs, the compiled mesh engine achieves fully automated processing from geometric input, mesh generation, quality optimization to solver input file construction.
[0086] The compiled mesh engine generates high-quality CFD volume meshes that meet engineering calculation requirements without human intervention, and returns mesh quality evaluation results to the upper-level intelligent agent through a structured interface, providing basic support for subsequent automated simulation and optimization.
[0087] Fourth layer: Closed-loop quality feedback layer The closed-loop quality feedback layer automatically performs quality assessment after mesh generation, judging according to a three-level threshold. When a warning threshold or a non-compliance threshold is triggered, the generation parameters are automatically adjusted and the mesh is regenerated, achieving closed-loop assurance of mesh quality. The three-level thresholds include the pass threshold, warning threshold, and non-compliance threshold.
[0088] I. Threshold Judgment Criteria for Three Levels of Grid Quality As shown in Table 5, the quality indicators include maximum non-orthogonality, maximum aspect ratio, and maximum skewness. Table 5 lists the calculation methods, pass thresholds, warning thresholds, non-conformance thresholds, and solver tolerance limits for each quality indicator.
[0089] Table 5. Threshold Criteria for Mesh Quality Level 3
[0090] II. Automatic Grid Quality Assessment and Feedback Optimization The closed-loop quality feedback layer automatically performs quality assessment after mesh generation. The quality assessment is performed by the compiled mesh engine, which calculates three quality metrics: maximum non-orthogonality, maximum aspect ratio, and maximum skewness.
[0091] The compiled mesh engine compares the calculated quality metrics with three threshold levels. When all three metrics—maximum non-orthogonality, maximum aspect ratio, and maximum skewness—meet the Pass threshold, the compiled mesh engine classifies the mesh quality as passable. When any one of the quality metrics falls into the Warning threshold range, the compiled mesh engine classifies the mesh quality as warningable. When any one of the quality metrics falls into the Fail threshold range, the compiled mesh engine classifies the mesh quality as unacceptable.
[0092] In some embodiments, the closed-loop quality feedback layer automatically performs feedback optimization operations based on the quality determination results: When the maximum nonorthogonality falls within the Warning threshold range, the closed-loop quality feedback layer automatically increases the number of hyperbolic push sweep iterations by 5 and increases the neighborhood smoothing range by 1 layer.
[0093] When the maximum nonorthogonality falls into the Fail threshold range, the closed-loop quality feedback layer automatically increases the number of hyperbolic push sweep iterations by 10, increases the neighborhood smoothing range by 2 layers, and decreases the grid growth rate by 0.05.
[0094] When the maximum aspect ratio falls within the Warning threshold range, the closed-loop quality feedback layer automatically increases the neighborhood smoothing range by 1 layer and increases the number of target grid cells by 1000.
[0095] When the maximum aspect ratio falls into the Fail threshold range, the closed-loop quality feedback layer automatically increases the neighborhood smoothing range by 2 layers and increases the number of target grid cells by 2000.
[0096] When the maximum skew rate falls into the Warning threshold range, the closed-loop quality feedback layer automatically multiplies the diffusion initiation factor by 2.0.
[0097] When the maximum skew rate falls into the Fail threshold range, the closed-loop quality feedback layer automatically multiplies the diffusion initiation factor by 3.0 and increases the hyperbolic push sweep iteration number by 5.
[0098] If the overall quality still does not meet the requirements, the closed-loop quality feedback layer recalculates the height of the first-layer mesh and related generation parameters, and re-executes the mesh generation process.
[0099] III. Closed-loop feedback iterative sequence The closed-loop quality feedback layer executes the quality closure according to the following iterative sequence: In the first iteration, the large language model agent calls the compiled mesh engine through the MCP protocol bridging layer to generate the initial mesh. The compiled mesh engine then passes the generated mesh to the closed-loop quality feedback layer. The closed-loop quality feedback layer performs quality evaluation, calculating the maximum non-orthogonality, maximum aspect ratio, and maximum skewness. If all three quality metrics meet the passing threshold, the closed-loop quality feedback layer terminates the iteration and outputs the final mesh. If any quality metric triggers a warning threshold or a non-compliance threshold, the closed-loop quality feedback layer automatically adjusts the corresponding parameters based on the triggered quality metric and threshold level. After parameter adjustment, the closed-loop quality feedback layer passes the adjusted parameters to the large language model agent, initiating the second iteration.
[0100] In the second iteration, the large language model agent re-invokes the compiled mesh engine to generate a new mesh based on the adjusted parameters. The closed-loop quality feedback layer performs a quality evaluation on the new mesh. If all three quality metrics meet the passing threshold, the closed-loop quality feedback layer terminates the iteration and outputs the final mesh. If the quality metrics still trigger the warning threshold or the non-compliance threshold, the closed-loop quality feedback layer continues to perform parameter adjustment operations and enters the next iteration.
[0101] Iteration Termination Conditions. The maximum number of iterations for closed-loop quality feedback is 5. The closed-loop quality feedback layer immediately terminates the iteration when all three quality metrics meet the passing threshold in any iteration. If the maximum number of iterations is reached but all quality metrics still do not meet the passing threshold, the closed-loop quality feedback layer outputs the currently best-quality mesh and returns a quality assessment report. The best-quality mesh refers to the mesh with the best overall performance across all completed iterations, considering maximum non-orthogonality, maximum aspect ratio, and maximum skewness.
[0102] This application also includes a multi-configuration extension layer, which supports automatic mesh generation for various aircraft configurations through a unified MCP tool interface. The multi-configuration extension layer employs a two-level Agent+Skill registration mechanism, with each configuration corresponding to a specific Agent and Skill combination. The Agent represents the type of aircraft configuration, and the Skill represents the operations that can be executed under that configuration. Table 6 shows the configuration of the unified MCP tool interface for multi-configuration configurations.
[0103] Table 6 Multiconfiguration Unified MCP Tool Interface
[0104] As shown in Table 6, the Agent name corresponding to the airfoil configuration is "airfoil," and the Skill name is "generate-cfd-mesh." The airfoil configuration is a two-dimensional configuration. The geometric parameterization of the airfoil configuration includes three input methods: NACA four-digit airfoil, CST parameterization definition, and airfoil data file. The NACA four-digit airfoil specifies the airfoil geometry using a four-digit number. The first digit represents the percentage of maximum camber to chord length, the second digit represents the position of maximum camber at one-tenth of the chord length, and the third and fourth digits represent the percentage of maximum thickness to chord length. The CST parameterization definition describes the airfoil geometry through a combination of class functions and shape functions, accurately describing any airfoil shape with a small number of design variables. The airfoil data file contains the coordinates of the upper and lower surfaces of the airfoil, with the file path serving as the geometric input. The mesh topology of the airfoil configuration is either a structured O-type mesh or a structured C-type mesh. The O-type mesh has a concentric ring topology, with the airfoil wall located at the innermost boundary and the outer boundary being the far-field boundary, suitable for mesh generation in airfoil flow problems. The topology of the C-type mesh is C-shaped, with the leading and trailing edge regions respectively. The mesh in the leading edge region is distributed around the leading edge point, and the mesh in the trailing edge region extends along the wake line. It is suitable for aerodynamic analysis of airfoils that include wake flow.
[0105] The Agent name for the wing configuration is "wing," and the Skill name is "generate-cfd-mesh." The wing configuration is a 3D semi-modal configuration. A 3D semi-modal configuration means that the entire aircraft is divided along a plane of symmetry, and only half of the geometry is calculated. Symmetrical boundary conditions are applied at the plane of symmetry to reduce computational resource consumption. The geometric parameterization method for the wing configuration is cross-section airfoil plus spanwise distribution. Cross-section airfoil refers to the airfoil shape at different spanwise positions. Cross-section airfoils are specified through airfoil type identifiers, and different types can be set for each cross-section airfoil. Spanwise distribution refers to the variation of geometric parameters along the spanwise direction of the wing, including span, number of spanwise segments, twist angle distribution, sweep angle distribution, and dihedral angle distribution. The mesh topology of the wing configuration is a multi-section swept O-type mesh plus a plane of symmetry. A multi-section swept O-type mesh means that O-type mesh topologies are generated at multiple spanwise cross-sections of the wing, and then swept and connected along the spanwise direction to form a 3D volume mesh. The plane of symmetry is the plane of symmetry of the aircraft. Symmetrical boundary conditions are applied to the plane of symmetry, and the mesh nodes on the plane of symmetry are restricted to move within the plane of symmetry.
[0106] The Agent name for the full architecture is "aircraft," and the Skill name is "generate-cfd-mesh." The full architecture is a 3D full-model configuration. A 3D full-model configuration refers to the complete aircraft shape, including all components such as the fuselage, wings, horizontal stabilizer, and vertical stabilizer, without using symmetry planes for segmentation. The geometric parameterization of the full architecture is a combination of wings, fuselage, and tail. The wing components include the airfoil distribution, span, number of spanwise segments, twist angle distribution, sweep angle distribution, and dihedral angle distribution. The fuselage components include the cross-sectional shape distribution, fuselage length, and maximum fuselage width. The tail components include the geometric parameters of the horizontal stabilizer and vertical stabilizer. The mesh topology of the full architecture is a partitioned hybrid mesh. A partitioned hybrid mesh means that the entire computational domain is divided into multiple sub-regions, each using a different type of mesh topology, with meshes stitched together at the boundaries of the sub-regions. Unstructured meshes are used near the fuselage to accommodate complex geometries, while structured O-type meshes are used in the wing and tail regions to ensure boundary layer resolution. Structured meshes are used in the far-field region to reduce the number of meshes and ensure computational efficiency.
[0107] The multi-configuration extension layer achieves unified scheduling across multiple configurations through a two-level Agent+Skill registration mechanism. The Agent is the primary registration unit, representing a type of aircraft configuration. The Skill is the secondary registration unit, representing the types of operations that can be executed within that configuration. Each Agent and Skill combination corresponds to a complete set of mesh generation configurations, including the geometry parameterization method, mesh topology type, input parameter schema, and invocation logic.
[0108] Each configuration is registered on the MCP server according to the Agent+Skill combination. The airfoil configuration is registered as airfoil / generate-cfd-mesh. The wing configuration is registered as wing / generate-cfd-mesh. The entire configuration is registered as aircraft / generate-cfd-mesh.
[0109] Each Agent+Skill combination shares the same MCP protocol interface. The MCP protocol interface is a tools / call interface. All configurations are invoked through the tools / call interface, and the invocation method is consistent. Input parameters are defined by a unique JSON schema for each configuration. The JSON schema for the airfoil configuration includes the airfoil type identifier, the number of target mesh cells, the target wall distance, the incoming flow Mach number, the blunt trailing edge ratio, and the first layer mesh height. The JSON schema for the wing configuration adds the span and spanwise segment count to the airfoil configuration parameters. The JSON schema for the full-frame configuration adds the fuselage, horizontal stabilizer, and vertical stabilizer component definitions to the wing configuration parameters.
[0110] The large language model agent implements introspective invocation of tools via the MCP protocol. The introspective invocation process is as follows: The large language model agent queries the MCP server for a list of available tools via the tools / list interface. The MCP server returns a list of all registered Agent+Skill combinations, including airfoil / generate-cfd-mesh, wing / generate-cfd-mesh, and aircraft / generate-cfd-mesh.
[0111] The large language model agent determines the target configuration based on the user's input natural language requirements. If the user input involves airfoil mesh generation, the large language model agent selects airfoil / generate-cfd-mesh. If the user input involves wing mesh generation, the large language model agent selects wing / generate-cfd-mesh. If the user input involves full-aircraft mesh generation, the large language model agent selects aircraft / generate-cfd-mesh.
[0112] The large language model agent queries the MCP server via the get_skill_input_info interface for the JSON schema definition of the input parameters for the selected Agent+Skill combination. The MCP server returns the corresponding JSON schema. The JSON schema contains the name, data type, value range, and whether each input parameter is required.
[0113] The large language model agent extracts parameters from natural language based on the JSON Schema definition and constructs structured parameter objects. The key-value pairs of the structured parameter objects correspond one-to-one with the parameters defined in the JSON Schema.
[0114] The large language model agent sends tool invocation requests to the MCP server via the tools / call interface. The tool invocation request includes the selected Agent name, Skill name, and a structured parameter object. The MCP server routes the request to the corresponding mesh generation configuration based on the Agent name and Skill name, and schedules the compiled mesh engine to execute the mesh generation task.
[0115] Through an introspective invocation process, the large language model agent can dynamically discover available configurations at runtime, obtain the input parameter patterns of each configuration, and automatically generate multi-configuration meshes according to a unified interface paradigm, without pre-coding the parameter lists and invocation methods for each configuration. When adding a new configuration, it is only necessary to register the new Agent+Skill combination and the corresponding JSON Schema definition in the MCP server, without modifying the invocation logic of the large language model agent or the core code of the MCP protocol bridging layer.
[0116] Example 1: Automatic generation of NACA0012 airfoil mesh The user inputs their mesh generation requirements in natural language: "Generate a NACA0012 airfoil mesh, 6000 elements, wall distance approximately 50, Mach number 0.05". The large language model agent extracts key parameters from this input. The agent identifies the airfoil type as NACA0012, the target mesh element count as 6000, the target wall distance as 50.0, and the incoming flow Mach number as 0.05. The agent completes any unspecified parameters by setting the blunt trailing edge scale to 0.01, the reference chord length to 1.0, and the first mesh layer height to -1 (indicating automatic calculation by the compiled mesh engine).
[0117] After the large language model agent completes parameter extraction and completion, it calls the mesh generation tool interface (named generate-cfd-mesh) via the tools / call interface of the MCP protocol. Upon receiving the tool call request, the MCP server verifies the completeness of the structured parameters and the correctness of their data types. After successful verification, the MCP server creates a case directory to store intermediate and result files generated during the mesh generation process. The MCP server then schedules the compiled mesh engine to execute the mesh generation task.
[0118] The compiled mesh engine first performs airfoil analysis. It analyzes the airfoil number NACA0012, identifying it as a symmetrical airfoil with a maximum thickness of 12% of the chord length. Based on the NACA standard airfoil mathematical model, the compiled mesh engine calculates the arc and thickness distribution within the airfoil, obtaining the coordinates of the upper and lower surfaces to generate the complete airfoil profile.
[0119] The compiled mesh engine then performs surface mesh generation. It samples the airfoil profile using a cosine distribution, densifies nodes at the leading and trailing edges, and sparses nodes in the mid-section, generating the airfoil surface mesh. The compiled mesh engine employs a blunt trailing edge processing mechanism to avoid mesh degradation in the sharp trailing edge region.
[0120] The compiled mesh engine performs a final volume mesh extrusion operation. It automatically calculates the height of the first mesh layer and uses a hyperbolic propagation algorithm to extrude the boundary layer. The height of the first mesh layer is calculated based on an inflow density of 1.225 kg / m³. 3 The dynamic viscosity coefficient is 1.7894 × 10⁻⁶. -5 The flow conditions are: Pa·s, sound velocity 340 m / s, incoming Mach number 0.05, and reference chord length 1.0 m. Based on these flow conditions, the compiled mesh engine calculates the first layer mesh height to be approximately 5.22 × 10⁻⁶ m. -4 m, approximately 0.522 mm. When the target mesh element count is 6000, the compiled mesh engine automatically sets the boundary layer count to 20. The compiled mesh engine uses a hyperbolic propagation algorithm and a node normal smoothing method to generate a complete external flow field mesh.
[0121] After the mesh is generated, the compiled mesh engine automatically performs a quality assessment. Table 7 shows the quality assessment results of the NACA0012 airfoil mesh.
[0122] Table 7. Quality Assessment Results of NACA0012 Airfoil Mesh
[0123] As shown in Table 7, if all four quality indicators meet the passing threshold, the compiled mesh engine determines the mesh quality to be in a passing state. The compiled mesh engine returns the mesh quality evaluation results to the large language model agent in structured JSON format. After receiving the structured quality evaluation results, the large language model agent confirms that the mesh quality meets the requirements and outputs the final mesh. Figure 2 The computational mesh for the NACA0012 airfoil is shown, in which... Figure 2 (a) is the near-field mesh for the NACA0012 airfoil. Figure 2 (b) is the far-field mesh for the NACA0012 airfoil.
[0124] Example 2: MCP Protocol Interaction The large language model agent queries the MCP server for available tools through the tools / list interface. The MCP server returns the mesh generation tool generate-cfd-mesh and the mesh quality review tool analyze, as well as the JSON schema definitions of the input parameters for each tool.
[0125] The large language model agent queries the parameter description of the airfoil / generate-cfd-mesh airfoil configuration mesh generation tool through the get_skill_input_info interface. The MCP server returns the JSON schema definition of the input parameters of the tool, including the airfoil model identifier airfoil_profile, the number of target mesh cells mesh_cells, the target wall distance y_plus, the incoming flow Mach number mach_number, the blunt trailing edge ratio blunt_te, and the first layer mesh height d0.
[0126] After the large language model agent completes tool discovery and parameter introspection, it constructs a tool call request in JSON-RPC 2.0 format. The method name is tools / call, the tool name is generate-cfd-mesh, and the parameter fields include airfoil type, number of target mesh cells, target wall distance, incoming flow Mach number, and blunt trailing edge ratio.
[0127] After verifying the parameters, the MCP server schedules the compiled mesh engine to execute the mesh generation task. Once the compiled mesh engine completes mesh generation and quality assessment, it returns the mesh quality assessment results to the MCP server. The MCP server returns a response message in JSON-RPC 2.0 format, including the actual total number of generated mesh cells (n_cells), maximum nonorthogonality (max_nonorthogonality), average nonorthogonality (avg_nonorthogonality), maximum skewness (max_skewness), maximum aspect ratio (max_aspect_ratio), the mesh quality compliance flag (mesh_ok), and the quality check results (mesh_quality_checks).
[0128] Compared with existing text script generation methods, the MCP protocol calling method has the advantages of strong parameter type passing, standardized error code propagation, dynamic tool discovery, structured result return, and the ability for any AI agent that supports the MCP protocol to reuse the MCP server to drive the compiled grid engine.
[0129] Example 3: NACA4412 Quality Feedback Iteration For the NACA4412 high-camber airfoil, due to the significant curvature change from the leading edge to the midchord, default parameters may lead to an increase in the maximum non-orthogonality in the near-field and far-field transition regions. Initial parameters were set as follows: airfoil designation naca4412, target mesh cell count 8000, target wall distance 30.0, incoming flow Mach number 0.15, hyperbolic sweep iterations 10 times, and neighborhood smoothing range 3 layers. Table 8 shows the iterative process of closed-loop feedback and automatic adjustment of the NACA4412 airfoil mesh quality.
[0130] Table 8. Examples of Mesh Quality Closed-Loop Feedback and Automatic Adjustment
[0131] As shown in Table 8, in the first iteration, the compiled mesh engine generates the mesh according to the initial parameters and then performs a quality assessment. The maximum non-orthogonality detection value is 73.50°, and the maximum aspect ratio detection value is 456.20. The maximum non-orthogonality of 73.50° falls into the warning threshold range (70°-80°), and the quality is judged as a warning state. The closed-loop quality feedback layer automatically performs parameter adjustment, increasing the number of hyperbolic sweep iterations from 10 to 15 and the neighborhood smoothing range from 3 layers to 4 layers. After the parameter adjustment is completed, the closed-loop quality feedback layer triggers the compiled mesh engine to regenerate the mesh according to the adjusted parameters.
[0132] In the second iteration, the compiled mesh engine regenerates the mesh and performs a quality assessment. The maximum non-orthogonality detection value is 62.35°, and the maximum aspect ratio detection value is 441.80. The maximum non-orthogonality of 62.35° meets the pass threshold (less than 70°), the maximum aspect ratio of 441.80 meets the pass threshold (less than 1000), and the maximum skewness meets the pass threshold (less than 4.0). Since all three quality metrics meet the pass thresholds, the closed-loop quality feedback layer terminates the iteration and outputs the final mesh.
[0133] The closed-loop quality feedback iteration process shows that the closed-loop quality feedback layer automatically adjusts the generation parameters and triggers regeneration after the maximum nonorthogonality triggers the warning threshold. The maximum nonorthogonality of the second-round mesh decreases from 73.50° to 62.35°, while the maximum aspect ratio and maximum skewness remain in the pass state, thus achieving mesh quality improvement without manual intervention.
[0134] Although the embodiments of this application have been described above in conjunction with the accompanying drawings, this application is not limited to the specific embodiments and application fields described above. The specific embodiments described above are merely illustrative and instructive, not restrictive. Those skilled in the art can make many other forms based on the guidance of this specification and without departing from the scope of protection of the claims of this application, and these are all within the scope of protection of this application.
Claims
1. A method for automatically generating aircraft computational grids based on large language model proxies and the MCP protocol, characterized in that, Includes the following steps: S1. The large language model agent receives the aircraft mesh generation request input by the user in the form of natural language. The large language model agent performs semantic parsing on the natural language, extracts the mesh generation parameters and maps them into a structured parameter dictionary. The mesh generation parameters include at least the aircraft configuration parameters, the number of target mesh cells and the wall distance parameters. S2. The large language model agent acts as an MCP client, constructs a tool call request according to the JSON-RPC 2.0 standard format, and transmits the structured parameter dictionary to the MCP server through the MCP protocol; The MCP server schedules the compiled mesh engine to execute mesh generation tasks according to the tool call request; S3. The compiled mesh engine automatically constructs the aircraft geometry configuration based on the aircraft configuration parameters in the structured parameter dictionary, performs node discretization on the surface of the aircraft geometry configuration, establishes structured mesh topology relationships, and generates a surface mesh. S4. The compiled mesh engine uses a hyperbolic propulsion algorithm to extrude boundary layer meshes from the wall of the aircraft geometry layer by layer. It automatically calculates the height of the first layer mesh according to the wall distance parameter, generates boundary layer structure meshes layer by layer, and further expands the mesh region towards the far field boundary to form a complete computational domain mesh. S5. After the compiled mesh engine is generated, it automatically performs mesh quality assessment, calculates quality indicators, and returns the mesh quality assessment results containing the quality indicators to the large language model agent in structured JSON format through the MCP protocol. S6. The large language model agent makes a judgment based on the grid quality evaluation result according to a preset three-level threshold; when the quality index meets the pass threshold, the iteration is terminated and the final grid is output. When the quality indicator triggers the warning threshold or fail threshold, and the number of iterations has not reached the preset maximum number of iterations, the large language model agent automatically adjusts the mesh generation parameters and repeats steps S2 to S5; when the number of iterations reaches the preset maximum number of iterations and the quality indicator still does not meet the pass threshold, the iteration is terminated, the current best quality mesh is output, and a quality assessment report is returned.
2. The automatic generation method for aircraft computational grids according to claim 1, characterized in that, The MCP protocol described in step S2 conforms to the ANSI / CTA-2115 standard; the MCP server provides a list of available tools to the large language model agent through the tools / list interface, receives and executes the tool call requests through the tools / call interface, and provides the large language model agent with the JSON Schema definition of tool input parameters through the get_skill_input_info interface, thereby realizing dynamic tool discovery and parameter introspection.
3. The automatic generation method for aircraft computational grids according to claim 1, characterized in that, The compiled mesh engine mentioned in step S2 is a compiled computing core that implements numerical calculation algorithms in C / C++ and encapsulates them as a Python C extension dynamic library. The compiled mesh engine does not depend on third-party mesh generation tools and is directly scheduled and executed by the MCP server.
4. The automatic generation method for aircraft computational grids according to claim 1, characterized in that, The aircraft configuration parameters mentioned in step S3 include airfoil identifiers, wing identifiers, or overall aircraft identifiers; the specific method by which the compiled mesh engine automatically constructs the aircraft geometry configuration based on the aircraft configuration parameters is as follows: When the aircraft configuration parameters are airfoil identifiers, for NACA four-digit airfoils, the compiled mesh engine parses the maximum camber, maximum camber position and maximum thickness parameters corresponding to the airfoil number, calculates the arc and thickness distribution in the airfoil according to the NACA standard airfoil mathematical model, obtains the coordinates of the upper surface and lower surface of the airfoil, and generates a complete airfoil profile. The airfoil identifier supports four input formats: NACA four-digit airfoil, NACA five-digit airfoil, CST parametrically defined airfoil, and airfoil data file path.
5. The automatic generation method for aircraft computational grids according to claim 1, characterized in that, The specific method for automatically calculating the height of the first layer of mesh in step S4 based on the wall distance parameter is as follows: First, calculate the Reynolds number based on the incoming Mach number and the reference chord length; then estimate the wall friction coefficient using the empirical relationship of the turbulent boundary layer of a flat plate, further obtain the wall shear stress and friction velocity, and finally calculate the height of the first layer of mesh based on the target wall distance parameter. When the user does not specify the height of the first layer of mesh, the compiled mesh engine automatically calculates and sets the height of the first layer of mesh based on the wall distance parameter.
6. The method for automatically generating a computational grid for an aircraft according to claim 1, characterized in that, In step S4, the hyperbolic propulsion algorithm generates boundary layer meshes layer by layer along the wall normal direction of the aircraft geometry. During the propulsion process, multiple hyperbolic sweep iterations are performed to correct the local propulsion direction. The algorithm also combines a neighborhood-averaged node normal smoothing method and a diffusion control strategy to suppress normal oscillations and maintain the continuity and orthogonality between mesh layers. The number of boundary layer layers is automatically determined based on the number of target mesh cells.
7. The method for automatically generating computational grids for aircraft according to claim 1, characterized in that, The quality indicators include at least the maximum non-orthogonality, the maximum aspect ratio, and the maximum skewness; the criteria for determining the three-level thresholds are as follows: For the maximum nonorthogonality, the pass threshold is less than 70°, the warning threshold is greater than or equal to 70° and less than or equal to 80°, and the fail threshold is greater than 80°. For the maximum aspect ratio, the pass threshold is less than 1000, the warning threshold is greater than or equal to 1000 and less than or equal to 5000, and the fail threshold is greater than 5000. For the maximum skew rate, the pass threshold is less than 4.0, the warning threshold is greater than or equal to 4.0 and less than or equal to 6.0, and the fail threshold is greater than 6.
0.
8. The method according to claim 7, characterized in that, The specific method for automatically adjusting the mesh generation parameters by the large language model agent in step S6 is as follows: When the maximum nonorthogonality is within the threshold range corresponding to the warning threshold or the fail threshold, increase the number of hyperbolic propulsion iterations and / or the neighborhood smoothing range; When the maximum aspect ratio is within the threshold range corresponding to the warning threshold or the fail threshold, the neighborhood smoothing range is expanded. When the maximum skew rate is within the threshold range corresponding to the warning threshold or the fail threshold, the parameters of the diffusion control strategy are adjusted.
9. The method for automatically generating computational grids for aircraft according to claim 1, characterized in that, The aircraft configuration is extended through the Agent+Skill two-level registration mechanism of the MCP protocol. Each configuration corresponds to an Agent and Skill combination and shares a unified MCP interface call paradigm.
10. An automatic generation system for aircraft computational grids based on large language model agents and the MCP protocol, characterized in that, include: The natural language parsing module, deployed inside the large language model agent, is used to receive the aircraft mesh generation requirements input by the user in natural language form, perform semantic parsing on the natural language to extract mesh generation parameters and map them into a structured parameter dictionary; The MCP protocol bridging module includes an MCP client and an MCP server. The MCP client is used to construct a tool call request according to the JSON-RPC2.0 standard format and transmit the structured parameter dictionary through the MCP protocol. The MCP server is used to receive the tool call request and schedule the compiled grid engine. The compiled mesh engine module is connected to the MCP server and is used to automatically construct the aircraft geometry configuration, generate surface mesh, and use the hyperbolic propulsion algorithm to extrude the boundary layer mesh layer by layer and expand it to form a complete computational domain volume mesh based on the aircraft configuration parameters in the structured parameter dictionary. The mesh quality assessment module is used to automatically calculate quality indicators after the mesh is generated, and return the mesh quality assessment results containing the quality indicators to the large language model agent in structured JSON format via the MCP protocol; The closed-loop quality feedback module is used to make a judgment based on the mesh quality evaluation results according to a preset three-level threshold; when the quality index meets the pass threshold, the iteration is terminated and the final mesh is output. When the quality metric triggers the warning threshold or fail threshold, the mesh generation parameters are automatically adjusted and the compiled mesh engine module is triggered to regenerate the mesh until the quality metric meets the pass threshold. When the number of iterations reaches the preset maximum number of iterations and the quality metric still does not meet the pass threshold, the iteration is terminated, the mesh with the best current quality is output, and a quality evaluation report is returned.