A physical constraint hierarchical rule knowledge enhanced retrieval method and system for CFD agents, an electronic device, and a storage medium

CN123013753APending Publication Date: 2026-10-30AVIC SHENYANG AERODYNAMICS RES INST
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611092715.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-07-22
Publication Date
2026-10-30

AI Technical Summary

Technical Problem

[0006]本发明要解决的技术问题是:现有CFD求解器参数自动配置方法难以同时满足知识复用、物理约束确定性执行和开放参数智能生成的需求,容易因关键硬约束未被检索、参数间级联关系未被传播或辅助决策模型输出不稳定而导致仿真发散、配置文件错误或结果失真

Benefits of technology

[0056]1.本发明将CFD参数知识分为硬约束、软推荐和经验启发三层,避免了传统RAG检索结果扁平化导致的约束强度混淆;

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123013753A_ABST
    Figure CN123013753A_ABST
Patent Text Reader

Abstract

The application discloses a physical constraint layered rule knowledge enhanced retrieval method and system for a CFD agent, an electronic device and a storage medium, and belongs to the field of computational fluid dynamics and artificial intelligence. The method divides CFD solver parameter knowledge into a hard constraint layer, a soft recommendation layer and an experience heuristic layer, and establishes structured rules for parameters such as CFL number, flux format, turbulence model, multi-grid, boundary condition and convergence control. A constraint propagation graph is constructed with rules as nodes and parameter coupling relationships as directed edges, so that rules triggered by working conditions can automatically cascade to activate associated constraints. A query context is constructed according to Mach number, Reynolds number, attack angle, turbulence model and grid dimension, and hard constraint deterministic retrieval, soft recommendation scoring retrieval and historical case similarity retrieval are respectively performed. The method can avoid the omission of key constraints caused by the probability output of a large language model, and improve the stability, traceability and engineering reliability of CFD automatic configuration.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the fields of computational fluid dynamics and artificial intelligence, specifically relating to a method and system for enhancing knowledge retrieval based on hierarchical rules of physical constraints for CFD agents. Background Technology

[0002] CFD (Computational Fluid Dynamics) simulations typically involve steps such as geometry processing, mesh generation, boundary condition specification, solver selection, numerical format configuration, time progression control, convergence criterion setting, and post-processing analysis. Among these, solver parameter configuration is a crucial step affecting computational stability, convergence speed, and result accuracy. Taking compressible flow solutions as an example, engineers need to set parameters such as flux scheme, limiters, CFL number, CFL growth strategy, number of multigrid layers, turbulence model, wall functions, residual smoothing, entropy correction, preprocessing switch, and monitoring output intervals.

[0003] In current engineering practice, solver parameter configuration mainly relies on the experience of CFD engineers or solver manuals. For standard cases, engineers can quickly provide initial parameters based on past experience; however, for new configurations, new meshes, new Mach number ranges, or multi-physics coupled scenarios, there are complex coupling relationships between parameters, and changing a single parameter often requires simultaneous adjustment of multiple related parameters. For example, when using an explicit Runge-Kutta time-progression scheme, the CFL number needs to be within the stability domain; when using a transonic upwind scheme, entropy correction needs to be enabled to suppress non-physical expansion shock waves; when selecting an inviscid Euler model, turbulence model and viscous flux-related settings need to be disabled; and when adjusting the coarse level of a multigrid, the coarse mesh CFL ratio also needs to be checked simultaneously.

[0004] While existing CFD agents based on large language models can generate parameters from natural language descriptions, their outputs are probabilistic and prone to problems such as incomplete formatting, parameter values ​​that do not meet solver requirements, and omission of key physical constraints. RAG methods that rely solely on vector retrieval also have limitations: retrieval results are typically flattened text fragments, unable to distinguish between hard constraints that must be strictly enforced and flexibly adjustable empirical suggestions, and unable to automatically propagate cascaded constraints between parameters.

[0005] Therefore, a method is needed that can utilize knowledge bases and historical cases, and deterministically execute CFD numerical stability theory, physical model constraints, and parameter coupling relationships, so that the CFD agent is protected by physical constraints before and after calling the auxiliary decision model, thereby reducing the probability of computational divergence and improving the reliability of automatic configuration. Summary of the Invention

[0006] The technical problem this invention aims to solve is that existing automatic parameter configuration methods for CFD solvers cannot simultaneously meet the requirements of knowledge reuse, deterministic execution of physical constraints, and intelligent generation of open parameters. They are prone to simulation divergence, configuration file errors, or result distortion due to key hard constraints not being retrieved, cascade relationships between parameters not being propagated, or unstable output of auxiliary decision-making models.

[0007] This invention proposes a physical constraint hierarchical rule knowledge enhancement retrieval method system, electronic device, and storage medium for CFD agents. The method divides CFD parameter configuration knowledge into a hard constraint layer, a soft recommendation layer, and an empirical heuristic layer; it achieves automatic propagation of hard constraints and association rules through a parameter-coupled constraint propagation graph; it deterministically executes hard constraints through a hierarchical retrieval mechanism, and provides soft recommendation and empirical heuristic information to the auxiliary decision-making model; finally, it ensures that the parameters ultimately written into the solver satisfy numerical stability and physical rationality through physical consistency verification and a safe rollback mechanism.

[0008] The technical solution adopted by the present invention to solve the above-mentioned technical problems is as follows:

[0009] A method for enhancing knowledge retrieval based on hierarchical rules of physical constraints for CFD agents includes the following steps:

[0010] S1. Construct a hierarchical knowledge base of physical constraint rules.

[0011] For CFD solvers, including numerical format, time-progression format, turbulence model, boundary conditions, multigrid, convergence control, and fault repair parameters, the solver parameter configuration knowledge is encoded into structured rules. Each rule includes at least a rule identifier, rule level, parameter category, retrieval label, triggering condition, parameter action, physical basis, priority, and cascading triggering relationship. The rule level includes a hard constraint layer, a soft recommendation layer, and an experience-based heuristic layer.

[0012] S2. Establish the parameter coupling constraint propagation graph

[0013] Using rule identifiers as nodes and physical dependencies, numerical stability dependencies, and engineering configuration linkages between parameters as directed edges, a directed constraint propagation graph is constructed. When any rule is triggered by the current working condition, constraint propagation is performed along the directed edges to obtain a set of associated rules coupled with the rule.

[0014] S3. Construct a multidimensional rule index

[0015] A multi-dimensional index is constructed based on rule hierarchy, parameter category, search tag, working condition range, rule identifier and historical case features. This enables hard constraint rules to be deterministically recalled through precise tags and triggering conditions, soft recommendation rules to be recalled according to working condition similarity and priority, and experience-inspired rules to be recalled according to historical case similarity.

[0016] S4. Perform a context query based on user input or simulation task file.

[0017] Mach number, Reynolds number, angle of attack, sideslip angle, turbulence model, flow dimension, mesh type, wall boundary name, far-field boundary name, and target solution accuracy are extracted from the input to form a structured query vector;

[0018] S5, Enhanced hierarchical retrieval based on physical constraints

[0019] First, in the hard constraint layer, precise label matching and trigger condition evaluation are performed, and then association rule propagation is performed through the parameter coupling constraint propagation graph. Subsequently, in the soft recommendation layer, candidate parameter recommendations are obtained by filtering and prioritizing based on working conditions. Then, in the experience-inspired layer, historical successful cases are retrieved through vector semantic similarity to obtain parameter combinations similar to the current working conditions.

[0020] S6. Perform layered parameter injection.

[0021] The parameters obtained from the hard constraint layer are directly written into the solver configuration file as deterministic parameters or into the parameter cache as unmodifiable constraints, without going through the probabilistic generation model; the parameter suggestions obtained from the soft recommendation layer and the experience-inspired layer are input into the auxiliary decision-making model in the form of structured prompt words, and the auxiliary decision-making model generates open parameters.

[0022] S7. Perform physical consistency check and parameter rollback.

[0023] The parameters generated by the auxiliary decision-making model are subjected to hard constraint verification, parameter format verification, and parameter coupling verification. When there are parameters that violate hard constraints or whose format does not meet the solver requirements, the parameters are rolled back to the safe value specified by the hard constraints or the robust value in historical successful cases.

[0024] S8. Generate the CFD solver configuration file and use it for automatic simulation.

[0025] The validated parameters are written into XML, JSON, dictionary files, or solver input files to form a configuration file that can be directly read by the CFD solver. The rules, parameter sources, validation results, and simulation feedback of this search are recorded and used to update the rule base of the experience-inspired layer.

[0026] Preferably, in step S1, the hard constraint layer is used to express the rules that, if violated, will lead to computational divergence, solver crash, physical model mismatch, or result distortion. It includes at least the upper limit constraint of CFL number under explicit time-progression scheme, CFL growth flag constraint, entropy correction switch constraint under transonic and supersonic conditions, consistency constraint between turbulence model and viscous term opening and closing, compatibility constraint between flux scheme and Mach number interval, consistency constraint between boundary condition type and solution variable, and CFL ratio constraint of multigrid coarse mesh.

[0027] The soft recommendation layer is used to express engineering suggestions that affect convergence efficiency and accuracy but do not necessarily need to be enforced;

[0028] The experience-inspired layer is used to express the parameter combinations in historical successful examples.

[0029] Preferably, the edges of the parameter coupling constraint propagation graph include cascading relationships where one parameter action triggers another parameter action; wherein, the turbulence model selection rule triggers the turbulence model coefficient rule, wall function rule, and wall grid scale rule; the Mach number interval rule triggers the flux scheme rule, entropy correction rule, and limiter rule; the explicit time progression rule triggers the CFL upper limit rule, CFL growth flag rule, and coarse grid CFL ratio rule; and the inviscid model rule triggers the turbulence equation shutdown rule and viscous flux shutdown rule.

[0030] Preferably, the hard constraint layer retrieval in step S5 uses a trigger function. Judgment rules Whether it takes effect is indicated by the trigger function as follows:

[0031]

[0032] Where x represents the current operating condition query context. For rules The trigger condition expression, For rules Hard constraint triggering result; when At that time, the rules They are deterministically recalled and enter the constraint propagation queue.

[0033] Preferred: The soft recommendation layer in step S5 uses a comprehensive score. To sort, the formula is:

[0034]

[0035] in, This is a soft recommendation rule, where x represents the work condition query context. To determine the degree of matching between rules and operating conditions, This is the normalized value for rule priority. Success rates are used to inform historical outcomes. , γ are weighting coefficients and .

[0036] Preferably: In step S5, the experience-inspired layer retrieves historical cases using semantic vector similarity, and the similarity calculation formula is:

[0037]

[0038] Where q represents the description of the current simulation task. For the k-th historical case text, and Let be the vector representations of the two, and · represent the vector dot product. and denoted by Euclidean norm; the top K most similar historical cases are used as a source of empirical heuristic parameters.

[0039] Preferably, in step S6, the hierarchical parameter injection follows the principle of prioritizing hard constraints, when the auxiliary decision-making model outputs parameters... With hard-constrained actions In case of conflict, final parameters Determined by the following rules:

[0040]

[0041] in, Generate parameters for the model. For hard constraint safety actions, These are the parameters that will eventually be written into the solver configuration file.

[0042] Preferably, the physical consistency check includes a CFL stability check, and the CFL number satisfies:

[0043]

[0044] Where u is the local characteristic velocity or maximum wave velocity. For time step, For grid feature scale, This is the upper limit of stability determined by the time-progression format, the flux format, and the safety margin.

[0045] An automatic parameter configuration system for CFD solvers based on enhanced retrieval using a hierarchical rule knowledge base for physical constraints includes:

[0046] The rule knowledge base storage module is used to store rules for the hard constraint layer, soft recommendation layer, and experience-inspired layer.

[0047] The constraint propagation module is used to construct and traverse the parameter coupling constraint propagation graph;

[0048] The working condition analysis module is used to extract the working condition query context from user input or example files;

[0049] The hierarchical retrieval module is used to perform three-layer retrieval: hard constraints, soft recommendations, and experience-based heuristics.

[0050] The decision support module is used to generate open parameters based on soft recommendations and empirical heuristics.

[0051] The hard constraint verification module is used to perform physical consistency verification and safe rollback on the generated parameters;

[0052] The configuration file generation module is used to write the final parameters into the CFD solver configuration file.

[0053] An electronic device includes a memory and a processor, the memory storing a computer program, and the processor executing the computer program to implement the aforementioned physical constraint hierarchical rule knowledge enhancement retrieval method for CFD agents.

[0054] A computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements a physical constraint hierarchical rule knowledge enhancement retrieval method for CFD agents.

[0055] The beneficial effects of this invention are as follows:

[0056] 1. This invention divides CFD parameter knowledge into three layers: hard constraints, soft recommendations, and empirical heuristics, avoiding the confusion of constraint strength caused by the flattening of traditional RAG retrieval results;

[0057] 2. This invention automatically processes the cascading relationships between parameters through constraint propagation graphs, reducing human error.

[0058] 3. This invention overcomes the problem of unstable probabilistic output of large language models by using hard-constraint deterministic execution and post-generation verification;

[0059] 4. This invention shortens parameter tuning time by reusing successful experiences through historical case similarity retrieval;

[0060] 5. The rule base, propagation graph, and case base of this invention can all be externally extended to adapt to different CFD solvers. Attached Figure Description

[0061] Figure 1 This is a flowchart illustrating the overall process of the automatic parameter configuration method for CFD solvers based on the enhanced retrieval of a hierarchical rule knowledge base for physical constraints, as described in this invention. Detailed Implementation

[0062] The present invention will be further illustrated below with reference to specific embodiments. It should be understood that these embodiments are for illustrative purposes only and are not intended to limit the scope of the invention. After reading the present invention, any modifications of the present invention in various equivalent forms by those skilled in the art will fall within the scope defined by the appended claims. Specific implementation method one:

[0064] This embodiment of a physical constraint hierarchical rule knowledge enhancement retrieval method for CFD agents includes the following steps: S1 constructing a physical constraint hierarchical rule knowledge base; S2 establishing a parameter coupling constraint propagation graph; S3 constructing a multi-dimensional rule index; S4 constructing a working condition query context; S5 performing hierarchical retrieval enhancement; S6 performing hierarchical parameter injection; S7 performing physical consistency verification and parameter rollback; S8 generating a CFD solver configuration file and recording simulation feedback.

[0065] Hard constraint layers are used to express rules that, if violated, will lead to solution failure, computational divergence, or physical errors, and are enforced deterministically. For example, in explicit time-progression schemes, the CFL number must not exceed the stability upper limit, and the CFL growth flag must not be set to a mode that leads to exponential growth; entropy correction should be enabled in transonic and supersonic flows; turbulence equations and viscous fluxes should be disabled in inviscid models; and consistency must be maintained between the turbulence model, wall functions, and boundary layer mesh scale.

[0066] The soft recommendation layer is used to express engineering suggestions that affect convergence efficiency and accuracy but do not need to be enforced. For example, subsonic smooth flows can preferentially use the center scheme to reduce numerical dissipation; transonic flows with shock waves can preferentially use upwind schemes such as Roe, AUSM, or HLLC; high Reynolds number turbulent flows can increase the number of multi-grid layers or residual smoothing; SA turbulence models should use a more conservative coarse-grid CFL ratio at the coarse-grid level.

[0067] The empirical heuristic layer is used to express parameter combinations from historical successful examples. For example, the empirical configuration for the RAE2822 airfoil under conditions of Ma=0.734, Re=6.5×10^6, and angle of attack of 2.79° may include CFL=1.25, a multigrid 3-layer V-cycle, 3000 inner iterations, and a center flux or a validated frontal flux; for the transonic flow around the ONERA M6 wing, appropriate entropy corrections, limiters, and multigrid levels can be recorded. The empirical heuristic layer provides a reference for the auxiliary decision-making model through historical case similarity retrieval, without directly overriding hard constraints.

[0068] In this embodiment, the hard constraint triggering function is defined as:

[0069] (1)

[0070] Where x represents the current working condition query context, including Mach number, Reynolds number, angle of attack, turbulence model, mesh dimension, and solver type; This represents the i-th hard constraint rule; Representation rules The trigger condition expression; Representation rules Whether it has been triggered. When At that time, the rules It is no longer treated as a general suggestion, but rather as a hard constraint that must be executed, entering the deterministic execution queue.

[0071] The parametric coupling constraint propagation graph is defined as a directed graph G=(V,E), where For a set of rule nodes, This is the set of cascading edges between rules. Given an initial set of triggering rules. The propagation closure is defined as:

[0072] (2)

[0073] in, Indicates the initial set of rules The complete set of enforceable rules obtained after constraint propagation; and Let represent the upstream and downstream rules in the rule graph, respectively; and E represent the set of directed edges. This formula means that whenever a rule is triggered, its downstream rules with a directed dependency should also be included in the execution list, until no new reachable rules exist.

[0074] The ranking score for the soft recommendation layer uses the following comprehensive scoring formula:

[0075] (3)

[0076] in, For soft recommendation rules Overall score under current operating condition x; The degree of matching between the rule and the current working condition, with a value ranging from 0 to 1; Preset priority normalization values ​​for the rules; The success rate of this rule's adoption in historical simulations; , γ are weighting coefficients and A higher overall score indicates that the rule is more suitable as a parameter reference for auxiliary decision-making models.

[0077] The historical case similarity calculation for the experience-inspired layer uses cosine similarity:

[0078] (4)

[0079] Where q represents the current simulation task description. This represents the text of the k-th historical case. This represents the vector representation of the current task description. The vector representation of historical case text, where · represents the vector dot product. and Let represent the Euclidean norms of the corresponding vectors. The closer it is to 1, the more similar the historical cases are to the current task.

[0080] CFL stability constraints are satisfied:

[0081] (5)

[0082] Where u represents the local characteristic velocity or maximum wave velocity, Indicates the time step. Indicates the scale of grid features. This represents the upper limit of stability determined jointly by the time-progression scheme, the spatial discretization scheme, and the safety margin. In explicit time-progression schemes, if the CFL exceeds... The residuals may oscillate or diverge.

[0083] When the output parameters of the auxiliary decision-making model conflict with hard constraints, a safe rollback is executed:

[0084] (6)

[0085] in, This represents the parameters generated by the decision support model. This represents the set of allowed parameters for hard constraints. This indicates the action of the safety parameters specified by the hard constraints. This represents the parameters that will ultimately be written into the solver configuration file. This applies when the generated model parameters do not belong to the set of hard constraint allowable parameters. At this time, the system does not use the model output, but instead uses safety parameter actions. . Specific Implementation Method Two:

[0087] A method for enhancing knowledge retrieval based on hierarchical rules of physical constraints for CFD agents includes the following steps.

[0088] S1. Construct a hierarchical knowledge base of physical constraints rules. The rule base is stored in JSON, YAML, database tables, or knowledge graph formats. Each rule includes fields such as id, level, category, tags, condition, action, basis, priority, and triggers. Specifically, id is the unique identifier of the rule; level can be Hard, Soft, or Heuristic; category indicates the parameter category; tags are used for retrieval; condition is the trigger expression; action is the parameter action; basis is the physical basis; priority is the priority level; and triggers is a list of cascading trigger rules.

[0089] For example, the trigger condition for the hard constraint rule CFL-H-001 is always, the parameter action is CFL.variableFlag=0 and CFL.value≤1.5, and the physical basis is the stability constraint of the explicit Runge-Kutta propulsion; the trigger condition for the hard constraint rule ENT-H-001 is Ma≥0.8, the parameter action is entropyFixFlag=1, and the physical basis is that the transonic shock wave and expansion wave regions need to satisfy the entropy condition; the trigger condition for the hard constraint rule TURB-H-001 is turbulence_model=INVISCID, and the parameter action is to turn off the turbulence model and viscous flux.

[0090] S2. Construct the parameter coupling constraint propagation graph. The system reads the `triggers` field from the rules and constructs a directed graph G=(V,E). When rule CFL-H-001 is triggered, it can further trigger the CFL-H-002 coarse mesh CFL ratio constraint; when rule ENT-H-001 is triggered, it can further trigger the LIMITER-H-001 limiter compatibility constraint; when rule TURB-H-001 is triggered, it can further trigger the VISC-H-001 viscous flux shutdown constraint. The propagation process uses a breadth-first search, uses a `visited` set to avoid repeated traversals, and preserves the triggering order to generate a traceable log.

[0091] S3. Construct a multi-dimensional rule index. The system establishes hierarchical indexes respectively. Tag Index Category Index Rule Identifier Index and case vector index The hierarchical index is used to quickly locate the three categories of rules: Hard, Soft, and Heuristic; the tag index is used to locate rules based on keywords such as CFL, Mach, SST, SA, ROE, and boundary; the category index is used for filtering by parameters such as fluxScheme, timeScheme, turbulence, boundary, and multigrid; and the case vector index is used for experience-based heuristic retrieval.

[0092] S4. Perform a context query. For natural language input, the system calls the task parsing module to extract Ma, Re, alpha, beta, turbulence_model, dimension, mesh_file, and boundary_names; for uploaded configuration files or example documents, the system parses the file content to obtain the same fields. The resulting query context is represented as follows:

[0093] (7)

[0094] Where Ma is the incoming Mach number and Re is the Reynolds number. For the angle of attack, Sideslip angle, This vector encodes the turbulence model, where D is the spatial dimension, G is the mesh quality feature, B is the set of boundary types, and Q is the user's target accuracy or convergence requirement. This vector is used for both rule triggering and similar case retrieval.

[0095] S5. Perform hierarchical retrieval enhancement. The hard constraint layer first performs a retrieval, and all rules that satisfy formula (1) are recalled and entered into the propagation graph; after propagation, the hard constraint closure is obtained. The soft recommendation layer scores the rules using formula (3) and selects the top performers. The rules form a recommendation list. The experience-inspired layer calculates the similarity of historical cases using formula (4) and selects the top-ranked cases. Each case study forms a set of empirical parameters.

[0096] S6. Perform hierarchical parameter injection. Hard constraint parameters are not input into the auxiliary decision-making model for selection, but are directly written to the immutable constraint cache. For example, CFL.variableFlag=0 and entropyFixFlag=1 are directly entered into the final parameter table. The soft recommendation layer inputs the "recommended parameters" field into the auxiliary decision-making model, and the experience-inspired layer inputs the "similar cases" field into the auxiliary decision-making model. Based on this, the auxiliary decision-making model generates open parameters, including flux format, limiter, number of multigrid layers, convergence criterion, maximum number of iterations, and output monitoring interval.

[0097] S7. Perform physical consistency verification and safety rollback. The system checks whether the output of the auxiliary decision model satisfies the CFL stability constraint of formula (5), whether it satisfies the solver parameter enumeration format, and whether it satisfies all hard constraint rules in the propagation closure. If the output violates the hard constraints, the safety rollback of formula (6) is executed; if the output format is incomplete, for example, the limiter only outputs one enumeration value while the solver requires two enumeration values, "flow limiter + turbulence limiter", then it is automatically completed or rolled back to the safety template according to the parameter format template.

[0098] S8. Generate solver configuration file and record feedback. The system writes the final parameters to an XML, OpenFOAM dictionary file, or other solver configuration file. After starting the solution, it records the residual curve, force coefficient curve, whether divergence occurs, the final convergence step count, and repair records. If the simulation is successful, the configuration and results are written to the experience heuristic layer; if the simulation fails, the error log and repair process are written to the fault rule base. Specific implementation method three:

[0100] Taking the transonic flow around the RAE2822 airfoil using the Feilian CFD solver as an example, the user inputs the mesh file RAE2822.cgns, sets Ma=0.734, Re=6.5×10^6, angle of attack 2.79°, and the turbulence model to Spalart-Allmaras. The system constructs the query context x=[0.734,6.5e6,2.79,0,SA,2D,G,B,Q].

[0101] In the hard constraint layer, CFL-H-001 is triggered, and the system determines that CFL.variableFlag=0 and CFL.value≤1.5. Since Ma=0.734 is less than 0.8, the transonic entropy correction rule can be enabled according to the safety strategy or used as a soft recommendation. Since the turbulence model is SA rather than INVISCITED, the inviscid shutdown rule is not triggered. The propagation graph further activates the coarse mesh CFL ratio constraint, making coarseMeshRatio≤0.8.

[0102] In the soft recommendation layer, based on Ma=0.734, airfoil outflow, and the SA turbulence model, the system recommends the CENTRAL or a validated robust upwind flux scheme, CFL=1.25, multigrid 3-layer V-cycle, and residual smoothing enabled. In the empirical heuristic layer, the system retrieves historical successful cases from RAE2822 and returns an empirical range of 3000 internal iterations, CFL=1.25, 4 partitions, and convergence accuracy of 1e-10 or 1e-6.

[0103] The decision support model generates parameters after receiving soft recommendations and empirical heuristics. The system then performs hard constraint checks: if the model outputs CFL=2.0, it will fall back to a safe value of 1.25 or less due to the violation of CFL≤1.5; if the model outputs variableFlag=1, it will be directly rewritten to 0 by the hard constraint; if the model outputs limiter=VENKATAKRISHNAN but the solver template requires two values, the system will complete it to VENKATAKRISHNAN NONE_LIMITER or fall back to NONE_LIMITER NONE_LIMITER according to the historical successful parameters.

[0104] The final system generates a Feilian XML configuration file, including the partitionNumber in preprocess, the turbulence model in flow / model, the flux scheme and limiters in flow / fluxScheme, the CFL value and growth strategy in flow / timeScheme / CFL, the number of multigrid layers in flow / acceleration / multigridSolver, and the number of iterations and convergence criteria in flow / control / innerLoop. Because hard constraints are applied both before and after model output, the risk of divergence due to model instability is avoided. Specific implementation method four:

[0106] An electronic device includes a memory and a processor. The memory stores a computer program, and the processor executes the computer program to implement the steps of the CFD simulation intelligent agent and autonomous optimization method based on multimodal and knowledge enhancement as described in Specific Embodiment 1.

[0107] The computer device of the present invention may include a processor and a memory, such as a microcontroller containing a central processing unit. Furthermore, when the processor executes the computer program stored in the memory, it implements the steps described above regarding the CFD simulation intelligent agent and autonomous optimization method based on multimodal and knowledge-enhanced computing.

[0108] The processor referred to can be a Central Processing Unit (CPU), such as the Intel Xeon series or AMD EPYC series; it can also be a Graphics Processing Unit (GPU), such as the NVIDIA A100, H100, or V100; or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor can be a microprocessor or any conventional processor.

[0109] The memory may primarily include a stored program area and a stored data area. The stored program area may store the operating system (such as Linux or Windows Server) and at least one application required for a given function (such as a Python runtime environment, Docker containers, database services, etc.). The stored data area may store CFD simulation data, knowledge base vectors, model weight parameters, etc. Furthermore, the memory may include high-speed random access memory (such as DDR4 / DDR5 RAM) and non-volatile memory, such as solid-state drives (SSDs), hard disk drives (HDDs), NVMe storage, smart media cards (SMCs), secure digital cards (SDs), flash cards, at least one disk storage device, flash memory device, or other volatile solid-state storage devices. Specific implementation method five:

[0111] A computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the CFD simulation intelligent agent and autonomous optimization method based on multimodal and knowledge enhancement as described in Specific Embodiment 1.

[0112] The computer-readable storage medium of the present invention can be any form of storage medium that can be read by the processor of a computer device, including but not limited to non-volatile memory, volatile memory, ferroelectric memory, etc. The computer-readable storage medium stores a computer program. When the processor of the computer device reads and executes the computer program stored in the memory, the steps of the above-mentioned CFD simulation intelligent agent and autonomous optimization method based on multimodal and knowledge enhancement can be implemented.

[0113] The computer program includes computer program code, which may be in the form of source code, object code, executable file, or certain intermediate forms. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording media, USB flash drive, portable hard drive, magnetic disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electrical carrier signals, telecommunication signals, and software distribution media, etc. It should be noted that the content included in the computer-readable medium may be appropriately added to or subtracted according to the requirements of legislation and patent practice in the jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, computer-readable media may not include electrical carrier signals and telecommunication signals.

[0114] The above description is merely a preferred embodiment of the present invention and is not intended to limit the present invention. Those skilled in the art can make various improvements, substitutions, or combinations to the above embodiments without departing from the concept of the present invention, and all such improvements, substitutions, or combinations should fall within the protection scope of the present invention.

Claims

1. A method for enhancing knowledge retrieval based on hierarchical rules of physical constraints for CFD agents, characterized in that, Includes the following steps: S1. Construct a hierarchical knowledge base of physical constraint rules. For CFD solvers, including numerical format, time-progression format, turbulence model, boundary conditions, multigrid, convergence control, and fault repair parameters, the solver parameter configuration knowledge is encoded into structured rules. Each rule includes at least a rule identifier, rule level, parameter category, retrieval label, triggering condition, parameter action, physical basis, priority, and cascading triggering relationship. The rule level includes a hard constraint layer, a soft recommendation layer, and an experience-based heuristic layer. S2. Establish the parameter coupling constraint propagation graph Using rule identifiers as nodes and physical dependencies, numerical stability dependencies, and engineering configuration linkages between parameters as directed edges, a directed constraint propagation graph is constructed. When any rule is triggered by the current working condition, constraint propagation is performed along the directed edges to obtain a set of associated rules coupled with the rule. S3. Construct a multidimensional rule index A multi-dimensional index is constructed based on rule hierarchy, parameter category, search tag, working condition range, rule identifier and historical case features. This enables hard constraint rules to be deterministically recalled through precise tags and triggering conditions, soft recommendation rules to be recalled according to working condition similarity and priority, and experience-inspired rules to be recalled according to historical case similarity. S4. Perform a context query based on user input or simulation task file. Mach number, Reynolds number, angle of attack, sideslip angle, turbulence model, flow dimension, mesh type, wall boundary name, far-field boundary name, and target solution accuracy are extracted from the input to form a structured query vector; S5, Enhanced hierarchical retrieval based on physical constraints First, in the hard constraint layer, precise label matching and trigger condition evaluation are performed, and then association rule propagation is performed through the parameter coupling constraint propagation graph. Subsequently, in the soft recommendation layer, candidate parameter recommendations are obtained by filtering and prioritizing based on working conditions. Then, in the experience-inspired layer, historical successful cases are retrieved through vector semantic similarity to obtain parameter combinations similar to the current working conditions. S6. Perform layered parameter injection. The parameters obtained from the hard constraint layer are directly written into the solver configuration file as deterministic parameters or into the parameter cache as unmodifiable constraints, without going through the probabilistic generation model; the parameter suggestions obtained from the soft recommendation layer and the experience-inspired layer are input into the auxiliary decision-making model in the form of structured prompt words, and the auxiliary decision-making model generates open parameters. S7. Perform physical consistency check and parameter rollback. The parameters generated by the auxiliary decision-making model are subjected to hard constraint verification, parameter format verification, and parameter coupling verification. When there are parameters that violate hard constraints or whose format does not meet the solver requirements, the parameters are rolled back to the safe value specified by the hard constraints or the robust value in historical successful cases. S8. Generate the CFD solver configuration file and use it for automatic simulation. The validated parameters are written into XML, JSON, dictionary files, or solver input files to form a configuration file that can be directly read by the CFD solver. The rules, parameter sources, validation results, and simulation feedback of this search are recorded and used to update the rule base of the experience-inspired layer.

2. The method for enhancing knowledge retrieval based on hierarchical rules of physical constraints for CFD agents according to claim 1, characterized in that: In step S1, the hard constraint layer is used to express rules that, if violated, will lead to computational divergence, solver crash, physical model mismatch, or result distortion; the soft recommendation layer is used to express engineering suggestions that affect convergence efficiency and accuracy but do not need to be enforced; and the experience-inspired layer is used to express parameter combinations from historical successful cases.

3. The method for enhancing knowledge retrieval based on hierarchical rules of physical constraints for CFD agents according to claim 1, characterized in that: In step S5, the hard constraint layer retrieval uses a trigger function. Judgment rules Whether it takes effect is indicated by the trigger function as follows: Where x represents the current operating condition query context. For rules The trigger condition expression, For rules Hard constraint triggering result; when At that time, the rules They are deterministically recalled and enter the constraint propagation queue.

4. The method for enhancing knowledge retrieval based on hierarchical rules of physical constraints for CFD agents according to claim 1, characterized in that: In step S5, the soft recommendation layer uses a comprehensive score. To sort, the formula is: in, This is a soft recommendation rule, where x represents the work condition query context. To determine the degree of matching between rules and operating conditions, This is the normalized value for rule priority. Success rates are used to inform historical outcomes. , γ are weighting coefficients and .

5. The method for enhancing knowledge retrieval based on hierarchical rules of physical constraints for CFD agents according to claim 1, characterized in that: In step S5, the experience-inspired layer retrieves historical cases using semantic vector similarity. The similarity calculation formula is as follows: Where q represents the description of the current simulation task. For the k-th historical case text, and Let be the vector representations of the two, and · represent the vector dot product. and denoted by Euclidean norm; the top K most similar historical cases are used as a source of empirical heuristic parameters.

6. The method for enhancing knowledge retrieval based on hierarchical rules of physical constraints for CFD agents according to claim 1, characterized in that: In step S6, the hierarchical parameter injection follows the principle of prioritizing hard constraints. When the auxiliary decision-making model outputs parameters... With hard-constrained actions In case of conflict, final parameters Determined by the following rules: in, Generate parameters for the model. For hard constraint safety actions, These are the parameters that will eventually be written into the solver configuration file.

7. The method for enhancing knowledge retrieval based on hierarchical rules of physical constraints for CFD agents according to claim 1, characterized in that: The physical consistency check includes a CFL stability check, and the CFL number satisfies: Where u is the local characteristic velocity or maximum wave velocity. For time step, For grid feature scale, This is the upper limit of stability determined by the time-progression format, the flux format, and the safety margin.

8. An automatic parameter configuration system for CFD solvers based on enhanced retrieval using a hierarchical knowledge base of physical constraints, characterized in that, include: The rule knowledge base storage module is used to store rules for the hard constraint layer, soft recommendation layer, and experience-inspired layer. The constraint propagation module is used to construct and traverse the parameter coupling constraint propagation graph; The working condition analysis module is used to extract the working condition query context from user input or example files; The hierarchical retrieval module is used to perform three-layer retrieval: hard constraints, soft recommendations, and experience-based heuristics. The decision support module is used to generate open parameters based on soft recommendations and empirical heuristics. The hard constraint verification module is used to perform physical consistency verification and safe rollback on the generated parameters; The configuration file generation module is used to write the final parameters into the CFD solver configuration file.

9. An electronic device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that: When the processor executes the computer program, it implements the physical constraint hierarchical rule knowledge enhancement retrieval method for CFD agents as described in any one of claims 1 to 8.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the physical constraint hierarchical rule knowledge enhancement retrieval method for CFD agents as described in any one of claims 1 to 8.