Train cfd simulation acceleration method based on neural network prediction of initial flow field

By predicting the initial flow field in train CFD simulation using neural networks, and constructing an RANS iterative initial state that matches the finite volume solver, the problems of large differences between the initial field and the convergent flow field and slow iterative convergence are solved, thereby improving the computational efficiency and accuracy of train CFD simulation.

CN123159209APending Publication Date: 2026-11-24INST OF AUTOMATION CHINESE ACAD OF SCI
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611512433.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-09-28
Publication Date
2026-11-24

AI Technical Summary

Technical Problem

In existing train CFD simulations, the difference between the conventional initial field and the convergent flow field is large, which leads to slow convergence of RANS iteration. Furthermore, existing deep learning flow field prediction methods either directly replace the numerical solver, causing prediction errors that affect engineering conclusions, or the predicted field is inconsistent with the state of the finite volume solver, making it difficult to use as the initial condition for RANS iteration and thus failing to effectively accelerate train CFD simulations.

Method used

By predicting the initial flow field in train CFD simulation based on neural networks, an initial state for RANS iteration that matches the finite volume solver is constructed. The volumetric surface flux is reconstructed using the predicted velocity, reducing the correction amount caused by the inconsistency of the initial field in the early stage of RANS iteration and improving computational efficiency.

Benefits of technology

While ensuring the accuracy of the final flow field obtained by the numerical solver iteratively, the number of iterations required to reach the preset convergence criterion is significantly reduced, thereby reducing the computational resources and time overhead for aerodynamic design with multiple shapes and operating conditions.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123159209A_ABST
    Figure CN123159209A_ABST
Patent Text Reader

Abstract

This invention provides an accelerated method for train CFD simulation based on neural network prediction of the initial flow field. The method includes: inputting the geometric information of the train to be simulated, the corresponding incoming flow conditions, and the spatial coordinates of the center of each cell in the finite volume grid of the train CFD simulation into the initial flow field prediction network to obtain the initial flow field at the center of each cell, the initial flow field including velocity; reconstructing the volume surface flux based on velocity; determining the initial state of RANS iteration based on the initial flow field and the volume surface flux; using the initial state of RANS iteration as the initial condition, iterating by the RANS solver until a preset convergence criterion is met to obtain the flow field around the train to be simulated. This method effectively reduces the number of iterations required to reach the preset convergence criterion, and while ensuring the accuracy and reliability of the final flow field results, it greatly improves the computational efficiency of train CFD simulation and reduces the computational resources and time overhead required for aerodynamic design under multiple shapes and operating conditions.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of train aerodynamics technology, and in particular to a train CFD simulation acceleration method based on neural network prediction of the initial flow field. Background Technology

[0002] The aerodynamic design of high-speed trains and maglev trains typically requires extensive aerodynamic simulations under different train geometries, incoming flow velocities, and crosswind conditions. The steady-state incompressible Reynolds-averaged method (RAR-ASM) provides results for velocity, pressure, and aerodynamic forces, and is a commonly used method in train aerodynamic analysis. However, this method requires processes such as mesh generation, turbulence modeling, and pressure-velocity coupling to achieve convergence; when the design space includes multiple train shapes and operating conditions, repeated calculations consume significant computational resources and time.

[0003] Currently, CFD (Computational Fluid Dynamics) solvers typically use uniform fields or potential flow fields as initial fields for initialization. These initial fields often differ significantly from the final converged flow field, leading to slow convergence in subsequent iterations and high computational costs. In deep learning-based flow field prediction methods, directly using the network output as the final flow field results in errors that directly impact engineering conclusions. Conversely, predicting only the central variables of the cells makes it difficult to establish a computational state that matches the initial flow field and can serve as the initial conditions for iteration. Summary of the Invention

[0004] This invention provides a method for accelerating train CFD simulation based on neural network prediction of the initial flow field, in order to solve the problems of large differences between the initial field and the converged flow field in existing train CFD simulations and slow convergence of RANS iteration.

[0005] This invention provides a method for accelerating train CFD simulation based on neural network prediction of the initial flow field, comprising: Obtain the geometric information of the train to be simulated, the corresponding incoming flow conditions, and the spatial coordinates of the center of each element in the finite volume mesh of the train CFD simulation; The geometric information, the incoming flow conditions, and the spatial coordinates of the center of each unit are input into the initial flow field prediction network to obtain the initial flow field at the center of each unit output by the initial flow field prediction network, wherein the initial flow field includes velocity. Based on the velocity, the volumetric surface flux is reconstructed, and based on the initial flow field and the volumetric surface flux, the initial state of the RANS iteration is determined. Using the initial state of the RANS iteration as the initial condition, the RANS solver iterates until the preset convergence criterion is met to obtain the flow field around the train to be simulated.

[0006] According to the present invention, a train CFD simulation acceleration method based on neural network prediction of initial flow field is provided, wherein the initial flow field prediction network includes a surface encoder and a coordinate condition decoder. The surface encoder is used to extract features from the geometric information and, based on the incoming flow conditions, modulates the extracted geometric features to obtain a shared feature representation. The coordinate condition decoder is used to map the spatial coordinates of the center of each unit to query features, and to perform attention interaction based on the query features and the shared feature representation to obtain the initial flow field at the center of each unit; In this process, the query features of different unit centers do not undergo attention interaction, and the spatial coordinates of each unit center are input into the coordinate condition decoder in batches, with each batch of query features sharing the shared feature representation.

[0007] According to the present invention, a train CFD simulation acceleration method based on neural network prediction of initial flow field is provided. The output of the initial flow field prediction network further includes the first derivative of the velocity, which is used to construct the velocity gradient tensor. The initial flow field prediction network is used to reconstruct at least one diagonal component in the velocity gradient tensor so that the trace of the velocity gradient tensor is zero.

[0008] According to the present invention, a train CFD simulation acceleration method based on neural network prediction of initial flow field is provided, which further includes, after obtaining the initial flow field at the center of each unit output by the initial flow field prediction network: The initial flow field is written into the field file corresponding to the finite volume grid; the physical boundaries in the field file retain the boundary types and specified boundary values ​​in the original case of the train CFD simulation, and the processor coupling boundaries retain their coupling types and addressing relationships; The reconstructed volumetric flux based on the velocity includes: Linear surface interpolation is performed on the velocity to obtain the surface velocity at the grid surface of the finite volume grid, and the volume surface flux is determined based on the surface velocity and the directed area vector of the grid surface. Specifically, when the mesh surface is a boundary surface, the surface velocity of the boundary surface is determined based on the velocity and the boundary type and specified boundary value retained in the field file.

[0009] According to the present invention, a method for accelerating train CFD simulation based on neural network prediction of initial flow field is provided. The initial flow field prediction network is trained based on the following steps: Training samples are obtained, which are constructed based on the converged CFD examples of the sample trains; the training samples include the sample geometry information, sample inflow conditions and spatial coordinates of the sample cell center corresponding to the sample train, as well as the converged flow field; The sample geometry, the sample inflow conditions, and the spatial coordinates of the sample cell center are input into the initial prediction network to obtain the predicted initial flow field and predicted wall distance at the center of the sample cell output by the initial prediction network. Based on the predicted initial flow field and the converged flow field, the regression loss is determined; Based on the predicted wall distance and the target wall distance, the wall distance loss is determined; the target wall distance is determined based on the minimum distance from the center of the sample cell to the center of each surface cell in the complete surface grid of the sample train. Based on the regression loss and the wall distance loss, the parameters of the initial prediction network are iterated to obtain the initial flow field prediction network.

[0010] According to the present invention, a train CFD simulation acceleration method based on neural network prediction of initial flow field is provided, wherein the training samples also include the adjacency relationship between the centers of the sample units; The predicted initial flow field includes sample velocity and sample kinematic pressure; the output of the initial prediction network also includes the sample first derivative of the sample velocity and the sample kinematic pressure gradient. The initial flow field prediction network is obtained by iterating the parameters of the initial prediction network based on the regression loss and the wall distance loss, including: Based on the aforementioned adjacency relationship, sample unit center pairs are constructed; For each sample unit center pair, based on the sample velocity and the first derivative of the sample at the center of one sample unit, a second-order Taylor expansion is performed on the sample velocity at the center of the other sample unit to obtain the velocity residual. For each sample unit center pair, based on the sample kinematic pressure and sample kinematic pressure gradient at the sample unit center on one side, a first-order Taylor expansion is performed on the sample kinematic pressure at the sample unit center on the other side to obtain the kinematic pressure residual. Based on the velocity residual and kinematic pressure residual of each sample unit center pair, the local consistency loss is determined; Based on the regression loss, the wall distance loss, and the local consistency loss, the parameters of the initial prediction network are iterated to obtain the initial flow field prediction network.

[0011] According to the present invention, a train CFD simulation acceleration method based on neural network prediction of initial flow field is provided, wherein the predicted initial flow field further includes sample turbulent kinetic energy, sample specific dissipation rate and sample turbulent kinematic viscosity; The initial flow field prediction network is obtained by iterating the parameters of the initial prediction network based on the regression loss, the wall distance loss, and the local consistency loss, including: Based on the regression loss, the wall distance loss, and the local consistency loss, the parameters of the initial prediction network are iterated to obtain the target prediction network; Based on physical consistency constraints, the target prediction network is iterated to obtain the initial flow field prediction network. The physical consistency constraints include local momentum residuals and eddy viscosity consistency constraints. The local momentum residual is determined based on the sample velocity, the sample first derivative, the sample kinematic pressure gradient, and the sample turbulent kinematic viscosity. The eddy viscosity consistency constraint is used to constrain the relationship between the product of the sample specific dissipation rate and the sample turbulent kinematic viscosity and the sample turbulent kinetic energy.

[0012] The present invention also provides a train CFD simulation acceleration device based on neural network prediction of initial flow field, comprising: The acquisition unit is used to acquire the geometric information of the train to be simulated, the corresponding incoming flow conditions, and the spatial coordinates of the center of each unit in the finite volume mesh of the train CFD simulation. The prediction unit is used to input the geometric information, the incoming flow conditions and the spatial coordinates of the center of each unit into the initial flow field prediction network to obtain the initial flow field at the center of each unit output by the initial flow field prediction network, wherein the initial flow field includes velocity; The reconstruction unit is used to reconstruct the volumetric surface flux based on the velocity, and to determine the initial state of the RANS iteration based on the initial flow field and the volumetric surface flux. The iteration unit is used to iterate the RANS solver until a preset convergence criterion is met, using the initial state of the RANS iteration as the initial condition, to obtain the flow field around the train to be simulated.

[0013] The present invention also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and running on the processor, wherein the processor executes the computer program to implement the train CFD simulation acceleration method based on neural network prediction of initial flow field as described above.

[0014] The present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the train CFD simulation acceleration method based on neural network prediction of the initial flow field as described above.

[0015] The train CFD simulation acceleration method based on neural network prediction of the initial flow field provided by this invention overcomes the shortcomings of traditional schemes, such as large differences between the conventional initial field and the convergent flow field and slow RANS iteration convergence. It also avoids the problem that the error caused by directly replacing the final CFD solution with the neural network output will affect the engineering conclusion. By reconstructing the volume surface flux from the predicted velocity, a RANS iteration initial state matching the velocity and surface flux is constructed, reducing the correction amount caused by the inconsistency of the initial field in the early stage of RANS iteration. This allows subsequent iterations to focus on correcting prediction errors and local residuals, thereby effectively reducing the number of iterations required to reach the preset convergence criterion. While ensuring that the final flow field is obtained iteratively by the numerical solver and the results are accurate and reliable, it greatly improves the computational efficiency of train CFD simulation and reduces the computational resources and time costs required for multi-shape and multi-condition aerodynamic design. Attached Figure Description

[0016] To more clearly illustrate the technical solutions in this invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of this invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.

[0017] Figure 1 This is a flowchart illustrating the train CFD simulation acceleration method based on neural network prediction of the initial flow field provided by the present invention. Figure 2 This is a schematic diagram of the train geometry, simulation conditions, and training samples provided by the present invention; Figure 3 This is a schematic diagram of the structure of the train CFD simulation acceleration device based on neural network prediction of the initial flow field provided by the present invention; Figure 4 This is a schematic diagram of the structure of the electronic device provided by the present invention. Detailed Implementation

[0018] To make the objectives, technical solutions, and advantages of this invention clearer, the technical solutions of this invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of this invention. All other embodiments obtained by those skilled in the art based on the embodiments of this invention without creative effort are within the scope of protection of this invention.

[0019] With the development of rail transit technology, the operating speed of high-speed trains and maglev trains is constantly increasing. The aerodynamic performance of trains has an increasingly significant impact on their operational safety, economy and ride comfort. Aerodynamic shape design has become a key part of the train research and development process.

[0020] The aerodynamic design of trains typically requires extensive aerodynamic simulations under different train geometries, incoming flow velocities, and crosswind conditions to evaluate the aerodynamic performance of each design scheme under various operating conditions. The Reynolds-Averaged Navier-Stokes (RANS) method, which provides results for velocity, pressure, wake, and aerodynamic forces, is a commonly used numerical method in train aerodynamic analysis. However, RANS simulations require mesh generation, turbulence modeling, pressure-velocity coupling, and multiple rounds of nonlinear iteration to achieve convergence; when the design space includes multiple train shapes and operating conditions, repeated calculations consume significant computational resources and time.

[0021] In actual RANS simulations, iterative solutions need to start from a certain initial field. However, existing CFD solvers typically use uniform fields or potential flow fields as initial fields. These initial fields often differ significantly from the final converged flow field, making it particularly difficult to simultaneously characterize the pressure distribution in the stagnation zone at the vehicle front, the velocity gradient near the vehicle body, the low-speed wake region, and the distribution of turbulent variables. This results in subsequent RANS iterations requiring a lengthy adjustment process to gradually establish the overall flow structure from an initial state that deviates significantly from the actual flow. Convergence is slow, requiring a large number of iterations to reach the preset convergence criteria, leading to high computational costs.

[0022] To alleviate the aforementioned problems, existing solutions have attempted to introduce deep learning technology into flow field calculations. However, existing deep learning-based flow field predictions often directly replace numerical solvers, reconstruct parts of the flow field, or perform predictions on fixed regular meshes. If the network output is directly used as the final flow field, the prediction error of the neural network will directly affect the engineering conclusions, making it difficult to meet the reliability requirements of train aerodynamic design. On the other hand, if only the element center variables are predicted, the predicted field is inconsistent with the computational state of the finite volume solver, making it difficult to form a computational state that matches the predicted initial flow field and can be used as the initial condition for RANS iteration. Even if the prediction results are used for initialization, the inconsistency within the initial state will generate additional correction amounts in the early stages of iteration, weakening the acceleration effect of the predicted flow field.

[0023] In short, in existing train CFD simulations, the difference between the conventional initial field and the convergent flow field is large, resulting in slow convergence and a large number of iterations in RANS iterations. Existing deep learning flow field prediction methods either directly replace numerical solvers, causing prediction errors that affect engineering conclusions, or the prediction field is inconsistent with the state of the finite volume solver, making it difficult to use as the initial condition for RANS iterations. Neither of these methods can effectively accelerate train CFD simulations while ensuring the reliability of the results.

[0024] To address these issues, this invention provides an accelerated train CFD simulation method based on neural network prediction of the initial flow field. This method aims to solve problems such as significant differences between the initial and convergent flow fields in existing train CFD simulations, inconsistencies between the predicted field and the finite volume solver state, and the large number of iterations required for RANS solutions to reach a preset convergence criterion. The method uses a neural network to predict the initial flow field on a finite volume grid for different train geometries and incoming flow conditions. Based on the predicted velocity, the volumetric surface flux is reconstructed to construct an initial RANS iteration state that matches the finite volume solver. The RANS solver then iterates from this initial state until the preset convergence criterion is met. This reduces the number of iterations required to reach the preset convergence criterion, improving the computational efficiency of train CFD simulations and reducing the computational resources and time overhead required for aerodynamic design under various shapes and conditions, while ensuring the final flow field is still obtained through numerical solver iterations and the results are accurate and reliable.

[0025] Figure 1 This is a flowchart illustrating the train CFD simulation acceleration method based on neural network prediction of the initial flow field provided by the present invention. This method can be applied to a computational platform for train aerodynamic simulation. The specific execution entity can be a server, workstation, or processor in a high-performance computing cluster that carries the CFD simulation task, or it can be an independent computing device that interacts with the CFD solution platform. Figure 1 As shown, the method includes: Step 110: Obtain the geometric information of the train to be simulated, the corresponding incoming flow conditions, and the spatial coordinates of the center of each element in the finite volume mesh of the train CFD simulation. Step 120: Input the geometric information, incoming flow conditions and spatial coordinates of the center of each unit into the initial flow field prediction network to obtain the initial flow field at the center of each unit output by the initial flow field prediction network. The initial flow field includes velocity. Step 130: Reconstruct the volumetric surface flux based on velocity, and determine the initial state of the RANS iteration based on the initial flow field and the volumetric surface flux; Step 140: Using the initial state of the RANS iteration as the initial condition, the RANS solver iterates until the preset convergence criterion is met to obtain the flow field around the train to be simulated.

[0026] Specifically, considering the significant difference between conventional initial fields such as uniform fields and potential flow fields and convergent flow fields in existing train CFD simulations, which leads to slow convergence of RANS iterations, the primary consideration in this embodiment of the invention is how to provide a starting point for RANS iterations that is closer to the convergent flow field. That is, how to quickly obtain an initial flow field that reflects the main characteristics of the mainstream, near-wall, and wake for different train geometries and incoming flow conditions, and make this initial flow field participate in subsequent iterations in a form that matches the finite volume solver.

[0027] Unlike schemes that directly use the output of the neural network as the final flow field, in this embodiment of the invention, the role of the neural network is only to provide the initial flow field for iteration. The final flow field and aerodynamic results such as drag coefficient and lift coefficient are still obtained by the RANS solver through numerical iteration. This utilizes the high efficiency of neural network prediction while retaining the reliability of the results brought about by the iterative correction of the numerical solver.

[0028] Understandably, in practical applications, before accelerating train CFD simulation, it is necessary to first determine the train to be simulated. The train to be simulated here refers to the train for which aerodynamic simulation analysis is required. It can be a high-speed train, a maglev train, or other types of rail transit vehicles such as EMU trains and intercity trains. Its shape can be a complete train shape, a simplified shape including the front, body and rear, or a shape with minor modifications to the front or local curved surfaces on the basic shape. This embodiment of the invention does not make specific limitations in this regard.

[0029] For the train to be simulated, CFD simulation is to perform computational fluid dynamics simulation on the flow field around the train. For example, it can be steady-state incompressible RANS simulation, which can provide results such as velocity, pressure, wake and aerodynamic force around the train, and can be used for train aerodynamic shape design and evaluation.

[0030] Once the train to be simulated is determined, geometric information characterizing the geometry of its outer surface can be obtained. This geometric information can be a surface point cloud, surface mesh, or surface file of the train, or it can be a CAD geometric model that can be converted into a surface point cloud or surface mesh. This embodiment of the invention does not specifically limit this. For example, the surface mesh or surface file of the train to be simulated can be obtained first, and then a surface point cloud can be sampled from the surface mesh, using this surface point cloud as the geometric information input to the network. Here, the sampling method can be random sampling, uniform sampling, or curvature-based adaptive sampling, etc.

[0031] In addition to acquiring geometric information, this embodiment of the invention also requires acquiring the incoming flow conditions corresponding to the train to be simulated, which characterize the incoming flow conditions of the train to be simulated; these conditions include at least incoming flow velocity information, such as free incoming flow velocity. , ,in The longitudinal inflow component is used to characterize the relative inflow velocity in the direction of train travel. The lateral inflow component characterizes crosswind conditions. By including both longitudinal and lateral inflow velocities in the inflow conditions, simulation conditions under different train speeds and crosswind conditions can be covered. Inflow conditions may also include other parameters that describe inflow conditions, such as inflow wind direction angle and inflow turbulence intensity; however, this embodiment of the invention does not specifically limit these parameters.

[0032] Furthermore, it is necessary to obtain the spatial coordinates of the center of each element within a finite volume mesh corresponding to the geometry of the train to be simulated. Here, the finite volume mesh refers to the volume mesh used in train CFD simulation, which is based on the finite volume method to discretize the computational domain. Its mesh elements can be tetrahedral, hexahedral, polyhedral, or a mixture thereof. The mesh can be pre-generated by a general mesh generation tool for the geometry and computational domain of the train to be simulated. The spatial coordinates of each element center are the three-dimensional coordinates of the geometric center of each volume mesh element in the finite volume mesh. These coordinates can be directly read from the mesh data of the finite volume solver or calculated based on the mesh node coordinates; this embodiment of the invention does not specifically limit this. The obtained element centers can be all element centers of the finite volume mesh or only some element centers, such as only obtaining the element centers of key regions like the near-wall region and the wake region of the train.

[0033] Furthermore, after obtaining the aforementioned geometric information, incoming flow conditions, and spatial coordinates of each unit center, these three elements can be input into the initial flow field prediction network for prediction. This initial flow field prediction network is a trained neural network that takes the geometric information and incoming flow conditions of the train to be simulated as input, and the spatial coordinates of each unit center as query input, outputting the initial flow field at each unit center.

[0034] Here, the initial flow field prediction network can be trained using the converged sample train CFD examples as supervised data. That is, the training samples can cover a variety of train geometry and incoming flow conditions. Each sample can include the sample geometry information of the sample train, the sample incoming flow conditions, the spatial coordinates of the sample cell center, and the converged flow field variables, so that the network can learn the mapping relationship from the train geometry and incoming flow conditions to the converged flow field. The specific network structure is not limited. For example, it can be a network based on an attention mechanism, or a network based on point cloud feature extraction, graph neural network, multilayer perceptron, or other networks that can process geometric input and output flow field variables at arbitrary spatial coordinates.

[0035] In the network prediction process, surface geometry and incoming flow conditions can be encoded by the network to obtain features representing the current train-condition combination. Then, the spatial coordinates of each unit center are used as query points and input into the network, which outputs the initial flow field at each unit center. Since the initial flow field prediction network only needs one forward inference to give the global initial flow field, its computational cost is extremely small compared to the numerical iteration process.

[0036] The initial flow field at the center of each cell in the network output includes at least velocity, i.e., the predicted three-dimensional velocity. It can characterize the motion state of the fluid at the center of each unit; in addition to velocity, the initial flow field can also include flow field variables such as kinematic pressure, turbulent kinetic energy, specific dissipation rate, and turbulent kinematic viscosity; among them, kinematic pressure is the pressure variable obtained by dividing the static pressure by the fluid density, which is suitable for incompressible finite volume solvers.

[0037] It should be noted that the network output can be trained and predicted in a normalized variable space; for example, the speed can be modulated by the incoming flow speed. Normalization, kinematic stress can be calculated according to... Normalize, then restore before using for numerical initialization.

[0038] Then, the volumetric surface flux can be reconstructed based on the predicted velocity. Here, volumetric surface flux refers to the volumetric flow rate of fluid passing through each grid surface of the finite volume grid; it is a surface physical quantity upon which the finite volume solver relies in the pressure-velocity coupled iteration. Considering that if only the initial flow field at the cell center is written into the grid, and the surface flux is inconsistent with the predicted velocity, additional corrections will be generated in the early stages of the RANS iteration due to the inconsistency within the initial state, weakening the acceleration effect of the initial flow field, therefore, in this embodiment of the invention, the volumetric surface flux is obtained from velocity reconstruction, rather than being independently predicted by the network, thus maintaining local consistency with the velocity.

[0039] Specifically, for any grid surface, the surface velocity at the grid surface can be determined by interpolation based on the velocities at the centers of adjacent cells. The surface velocity is then multiplied by the directed area vector of the grid surface to obtain the volumetric surface flux. Here, the directed area vector is a vector whose magnitude is equal to the area of ​​the grid surface and whose direction is along the normal to the grid surface. For boundary surfaces, the corresponding surface velocity and surface flux can be determined by combining the boundary conditions.

[0040] After reconstructing the surface flux, the initial state for RANS iteration can be determined. Here, the initial state for RANS iteration refers to the complete initial computational state required for the RANS solver to begin iteration. It includes the surface flux and the initial flow field written into the finite volume mesh, i.e., the internal field values ​​at the center of each element. In addition, the initial state for RANS iteration can also include boundary condition information from the original train CFD simulation example. That is, when constructing the initial state for RANS iteration, the physical boundary conditions of the original example can be retained, ensuring that the initial flow field, surface flux, and boundary information are mutually matched. The initial state for RANS iteration constructed in this way is consistent with the data organization of the finite volume solver at the velocity, flux, and boundary levels, and can be directly used as the initial conditions for the solver.

[0041] After this, the RANS solver can be started iterating using the determined initial state of the RANS iteration as the initial condition. The initial condition here refers to the flow field state used when the RANS solver begins iteration. The RANS solver is a finite volume solver based on the Reynolds-averaged Navier-Stokes equations for numerical solution. It can be a steady-state incompressible solver from open-source platforms such as OpenFOAM, or other commercial or self-developed finite volume solvers; this embodiment of the invention does not specifically limit its use. The RANS solver can use a pressure-velocity coupled algorithm for iteration and can use a turbulence model to close the Reynolds stress.

[0042] It should be noted that during the iteration process, the RANS governing equations, turbulence closure model, boundary conditions, and numerical discretization settings of the original train CFD simulation can remain unchanged. That is, the neural network only changes the starting point of the iteration, without changing the problem to be solved.

[0043] The RANS solver iterates continuously until a preset convergence criterion is met. Here, the preset convergence criterion is a pre-set condition used to determine whether the RANS iteration has converged. It can be that the residuals of each equation decrease to a preset threshold, or that aerodynamic coefficients such as drag coefficient and lift coefficient enter a preset stable range, or it can be a combination of the two. This embodiment of the invention does not specifically limit this.

[0044] Because the initial flow field predicted in this embodiment of the invention is closer to the convergent flow field corresponding to the train geometry and incoming flow conditions than conventional initial fields such as uniform fields, potential flow fields, and empirically given turbulent fields, and retains the main flow characteristics such as the main pressure distribution near the train head, mainstream deflection, and low-speed wake region, RANS iteration is mainly used to correct prediction errors and local residuals, without having to rebuild the overall flow structure from a conventional initial field, thus reducing the number of iterations required to reach the preset convergence criterion. After iterative convergence, the flow field around the train to be simulated can be obtained. This flow field is the finally converged flow field result, including the distribution of velocity and pressure around the train, and can be further used to calculate aerodynamic results such as drag coefficient and lift coefficient for train aerodynamic shape design and evaluation.

[0045] In one example, a dataset containing 50 basic train geometries and a total of 500 CFD samples was constructed. For the train geometries that were not trained, after initialization with the initial flow field predicted in the embodiments of the present invention, under the same mesh and solver settings, the average number of convergence steps for the drag coefficient and lift coefficient to reach the stable range showed an acceleration effect of approximately 2.36 times and 2.14 times, respectively, compared with the default potential flow initialization.

[0046] The train CFD simulation acceleration method based on neural network prediction of the initial flow field provided by this invention overcomes the shortcomings of traditional schemes, such as large differences between the conventional initial field and the convergent flow field and slow RANS iteration convergence. It also avoids the problem that the error caused by directly replacing the final CFD solution with the neural network output will affect the engineering conclusion. By reconstructing the volume surface flux from the predicted velocity, a RANS iteration initial state matching the velocity and surface flux is constructed, reducing the correction amount caused by the inconsistency of the initial field in the early stage of RANS iteration. This allows subsequent iterations to focus on correcting prediction errors and local residuals, thereby effectively reducing the number of iterations required to reach the preset convergence criterion. While ensuring that the final flow field is obtained iteratively by the numerical solver and the results are accurate and reliable, it greatly improves the computational efficiency of train CFD simulation and reduces the computational resources and time costs required for multi-shape and multi-condition aerodynamic design.

[0047] Based on the above embodiments, the initial flow field prediction network includes a surface encoder and a coordinate condition decoder; The surface encoder is used to extract features from geometric information and modulates the extracted geometric features based on the incoming flow conditions to obtain a shared feature representation; The coordinate condition decoder is used to map the spatial coordinates of each cell center to query features, and performs attention interaction based on the query features and shared feature representations to obtain the initial flow field at each cell center; In this system, there is no attention interaction between query features of different unit centers. The spatial coordinates of each unit center are input into the coordinate condition decoder in batches, and the query features of each batch share the same feature representation.

[0048] Specifically, considering that the finite volume meshes used in train CFD simulations are typically large, with the number of cell centers potentially reaching millions or even higher, and that different train geometries and operating conditions correspond to different mesh sizes and topologies, binding the network structure to fixed regular meshes or fixed voxel meshes would make it difficult to adapt to different mesh sizes and unseen train geometries. Therefore, in this embodiment of the invention, the initial flow field prediction network is designed as an encoding / decoding structure including a surface encoder and a coordinate condition decoder, so that the encoding process of train geometry and incoming flow conditions is decoupled from the decoding and prediction process of flow field variables at cell centers.

[0049] That is, for each train-condition combination, the geometric information and incoming flow conditions only need to be encoded once to obtain a shared feature representation. Subsequently, any number and any location of cell centers can be decoded from this shared feature representation in a query manner to obtain the initial flow field at the corresponding location. In one specific implementation, this initial flow field prediction network can be called a VolumeUniField network.

[0050] In detail, after the geometric information and incoming flow conditions are input into the initial flow field prediction network, the surface encoder first extracts features from the geometric information. Here, the surface encoder is a network module that extracts features from geometric information, such as surface point clouds. It can adopt a multi-layered hierarchical processing structure, that is, the input surface point coordinates are linearly projected into multiple local window attention blocks. In each local window attention block, the surface point features are subjected to attention calculation within the local window to extract local geometric features. Adjacent layers can reduce the number of labels and adjust the feature dimensions through window-level aggregation, thereby gradually expanding the receptive field in the process of deepening layer by layer, realizing hierarchical geometric feature extraction from local to global.

[0051] Furthermore, to enhance information exchange between adjacent windows, conventional window partitioning and half-window shift partitioning can be used between adjacent attention layers. That is, adjacent layers are divided into windows in the conventional way and by shifting half the window size, respectively, so that surface point features that were originally in different windows can interact in adjacent layers.

[0052] It should be noted that the surface encoder can receive surface point coordinates in a randomly shuffled order as input, and does not require surface normals or point areas as necessary inputs. Therefore, it has lower requirements for the acquisition and organization of geometric information, making it easier to process train geometry from different sources.

[0053] While performing feature extraction, the surface encoder also modulates the extracted geometric features based on the incoming flow conditions to inject information about the incoming flow conditions into the geometric features. This modulation essentially adjusts the numerical distribution of the geometric features using the incoming flow conditions, enabling the same train geometry to generate different feature representations under different incoming flow conditions. Specific modulation methods can include adaptive layer normalization, where normalized incoming flow conditions are normalized through an adaptive layer to modulate the surface features of each layer of the surface encoder; or feature splicing, conditional bias injection, etc. This embodiment of the invention does not specifically limit these methods.

[0054] After the feature extraction and modulation described above, the surface encoder can ultimately generate a feature representation that simultaneously characterizes the geometry and incoming flow conditions of the simulated train, i.e., a shared feature representation. For example, it can be represented as a shared surface memory. , ,in, Represents surface point clouds, This represents the normalized incoming flow condition. The parameter is Surface encoder.

[0055] It is worth noting here that the shared feature representation is called shared because it only needs to be generated once under the current train-condition combination and can be used by all subsequent unit centers in the decoding and prediction process.

[0056] Then, the coordinate condition decoder decodes and predicts the initial flow field at the center of each cell based on the shared feature representation. Here, the coordinate condition decoder is a network module that performs query-based decoding based on the spatial coordinates of the cell center.

[0057] Specifically, for the spatial coordinates of any unit center, the coordinate condition decoder first maps them to query features. For example, three-dimensional coordinates can be mapped to query features through a linear layer. Subsequently, the query feature interacts with the shared feature representation through attention. The query feature passes through multiple decoder blocks in sequence. In each decoder block, the query feature provides the Query, and the shared feature representation provides the Key and Value for multi-head cross-attention calculation. The query feature is then updated by a feedforward network, allowing it to extract geometric and operational information related to the unit center location from the shared feature representation during the block-by-block interaction. Finally, the output layer at the end of the coordinate condition decoder outputs the initial flow field at the unit center based on the updated query feature.

[0058] Here, the initial flow field output by the coordinate condition decoder includes at least velocity. For example, the output layer can output at least three velocity components, and can further output RANS variables such as kinematic pressure, turbulent kinetic energy, specific dissipation rate, and turbulent kinematic viscosity.

[0059] It is worth noting that in this embodiment of the invention, there is no attention interaction between the query features at different cell centers. That is, attention interaction only occurs between the query features and the shared feature representation, and each query point is independent and undependent. As a result, the prediction result (initial flow field) at any cell center depends only on the spatial coordinates of that cell center and the shared feature representation, and is independent of the number, position, and order of other query points in the same batch. Therefore, the network is not bound to a fixed voxel grid or a fixed number of query points, thus enabling it to adapt to finite volume grids of arbitrary size and topology.

[0060] Based on this, in actual prediction, the spatial coordinates of each cell center can be input into the coordinate condition decoder in batches. That is, for a large-scale finite volume grid, the spatial coordinates of all cell centers can be divided into multiple query batches and input into the coordinate condition decoder in sequence for prediction. Since there is no attention interaction between the query features of different cell centers, batch querying is equivalent to inputting all query points at once in terms of prediction results. The batch division method and the number of query points in each batch can be flexibly determined according to conditions such as video memory capacity and computing resources. This embodiment of the invention does not impose specific limitations on this.

[0061] Furthermore, the query features of each batch share the shared feature representation. That is, during the entire batch query process, the surface encoder does not need to encode for each batch repeatedly. All batches use the shared feature representation obtained by the next encoding of the same train-condition combination. This allows the same train-condition combination to adapt to any number of grid cell centers with low repetitive encoding overhead, and to complete the prediction of the global initial flow field of a large-scale finite volume grid without changing the current train-condition shared representation.

[0062] In this embodiment of the invention, a surface encoder extracts features from geometric information and modulates the geometric features using incoming flow conditions to obtain a shared feature representation that is encoded once and reused multiple times. Then, a coordinate condition decoder uses the spatial coordinates of the center of each cell as a query and interacts with the shared feature representation to decode the initial flow field at the center of each cell, thus decoupling geometry-condition encoding from flow field decoding. Furthermore, it can directly perform global initial flow field prediction on the original finite volume grid with low repetitive encoding overhead, thereby improving the adaptability of the initial flow field prediction network to different grid sizes and unseen train geometry, while taking into account the efficiency and flexibility of large-scale grid prediction.

[0063] Based on the above embodiments, the output of the initial flow field prediction network also includes the first derivative of the velocity, which is used to construct the velocity gradient tensor; The initial flow field prediction network is used to reconstruct at least one diagonal component in the velocity gradient tensor so that the trace of the velocity gradient tensor is zero.

[0064] Specifically, considering that independently predicted flow field variables may not satisfy the physical relationships that the flow itself should follow, thereby weakening the role of the initial flow field as the initial value for RANS iteration, in this embodiment of the invention, the initial flow field prediction network outputs the first derivative of the velocity in addition to the initial flow field at the center of each unit, and directly embeds the continuity condition of incompressible flow at the network output structure level to improve the physical consistency of the initial flow field.

[0065] The first derivative can form the velocity gradient tensor. Here, the first derivative is the partial derivative of each velocity component along each coordinate direction, and the arrangement of the first derivatives according to the components forms the velocity gradient tensor. .

[0066] That is, let the spatial coordinates be... The speed is , Let the transpose be the component of the velocity gradient tensor. satisfy: in, Indicates the first velocity component Along the first Each coordinate direction The first derivative; and All are component indices, and there are three component indices in total, therefore the velocity gradient tensor It is a 3×3 tensor containing nine components; among which , and For the diagonal components, represent the first derivatives of the three velocity components along their own coordinate directions.

[0067] Here, the first derivative of velocity can be directly output by the initial flow field prediction network for the spatial coordinates of each cell center, just like the velocity. That is, while outputting the initial flow field at the center of each cell, the network also outputs the first derivative of the velocity at that cell center as an auxiliary quantity. Since the first derivative is directly output by the network, rather than being obtained by automatically differentiating the centers of all grid cells, there is no need to bear the additional computational overhead caused by automatically differentiating large-scale query points.

[0068] In addition, the first derivative of velocity can be used in network training to constrain the consistency between derivative predictions and flow field predictions, thereby improving the physical consistency of the predicted field.

[0069] Furthermore, for the three-dimensional incompressible flow involved in train aerodynamics, the flow field should satisfy the continuity condition, that is, the velocity divergence is zero; and the velocity divergence is exactly equal to the trace of the velocity gradient tensor, that is, the sum of the three diagonal components of the velocity gradient tensor: in, This represents the trace of the velocity gradient tensor. In other words, if the trace of the velocity gradient tensor is zero, then the velocity gradient tensor satisfies the continuity condition of incompressible flow at the center of each element.

[0070] However, if the network independently outputs all components of the velocity gradient tensor, the sum of the three diagonal components is usually not zero, meaning that the independently predicted velocity gradient is unlikely to satisfy the continuity condition. Therefore, in this embodiment of the invention, the initial flow field prediction network does not independently predict all components of the velocity gradient tensor, but reconstructs at least one diagonal component of the velocity gradient tensor. That is, at least one diagonal component is not directly output by the network, but is calculated based on the remaining components directly output by the network according to the continuity condition, so that the trace of the reconstructed velocity gradient tensor is zero.

[0071] In one implementation, the network can directly output, except... The other eight components are directly output. , Two diagonal components and all six off-diagonal components, and reconstruct the remaining diagonal components according to the following formula. : Therefore, regardless of the values ​​of the eight components directly output by the network, the reconstructed velocity gradient tensor always satisfies That is, its trace is zero, and the continuity condition is directly embedded in the output structure of the network, without relying on the soft constraints of the loss function to approximate its satisfaction.

[0072] It is understandable that the reconstructed diagonal components are not limited to It can also be or This means that the network can directly output the remaining eight components, and then reconstruct any selected diagonal component according to the continuity condition. In addition, the number of reconstructed diagonal components is at least one, as long as the trace of the reconstructed velocity gradient tensor is zero.

[0073] In this embodiment of the invention, the initial flow field prediction network outputs the first derivative of velocity to form a velocity gradient tensor while outputting the initial flow field. By reconstructing at least one diagonal component in the velocity gradient tensor to make the trace of the velocity gradient tensor zero, the continuity condition of three-dimensional incompressible flow is directly embedded into the network output in a structured manner. This ensures that the predicted velocity gradient satisfies the physical constraint of zero divergence at the center of each cell, avoiding the problem of difficulty in satisfying the continuity condition when independently predicting all velocity gradient components. This improves the physical consistency of the initial flow field and its derivative auxiliary quantities, which helps to reduce the difference between the initial flow field and the corresponding converged flow field, thereby improving the quality of the initial flow field as the initial value for RANS iteration.

[0074] Based on the above embodiments, after obtaining the initial flow field at the center of each unit output by the initial flow field prediction network, the method further includes: The initial flow field is written into the field file corresponding to the finite volume mesh; the physical boundaries in the field file retain the boundary types and specified boundary values ​​in the original case of the train CFD simulation, and the processor coupling boundaries retain their coupling types and addressing relationships; In step 130, the volumetric surface flux is reconstructed based on velocity, including: Linear surface interpolation is performed on the velocity to obtain the surface velocity at the mesh surface of the finite volume mesh, and the volume surface flux is determined based on the surface velocity and the directed area vector of the mesh surface. Specifically, when the mesh surface is a boundary surface, the surface velocity of the boundary surface is determined based on the velocity and the boundary type and specified boundary value retained in the field file.

[0075] Specifically, considering that the initial flow field prediction network outputs the flow field variable values ​​at the center of each cell, while the complete computational state on which the finite volume solver depends includes not only the internal field values ​​at the center of the cell, but also the boundary field information on the boundary and the surface flux on each grid surface; if the initial flow field is not written in the same data form as the finite volume solver, or if the boundary information, surface flux and velocity do not match, it is difficult to form a computational state that can be directly used as the initial condition for RANS iteration.

[0076] Based on this, in this embodiment of the invention, after obtaining the initial flow field at the center of each cell output by the initial flow field prediction network, the initial flow field is first written into the field file and the boundary information of the original calculation is retained. Then, the volumetric surface flux is reconstructed based on velocity through linear surface interpolation, thereby constructing a complete initial calculation state in which the internal field, boundary field, and surface flux are mutually matched. The field file is a file in the finite volume solver used to store the distribution of each flow field variable within the computational domain. The field file includes the internal field values ​​at the center of each cell and the boundary field information at each boundary.

[0077] Taking the finite volume solver as the OpenFOAM solver as an example, the original example of train CFD simulation can adopt the k-ω SST (Shear Stress Transport) turbulence model, and the mesh generation, boundary condition settings, and solver parameter configuration can be completed in advance; after the initial flow field prediction network completes the query of all element centers, the kinematic pressure can be... ,speed Turbulent kinetic energy Specific dissipation rate and turbulent kinematic viscosity The internal field values ​​are written into the field file corresponding to the OpenFOAM mesh.

[0078] It should be noted that if the network output is obtained in a normalized variable space, the prediction results must be restored to their corresponding physical dimensions before writing them into the field file. Furthermore, the written internal field values ​​can cover all cell centers of the finite volume mesh, or only some cell centers; uncovered cell centers can be filled using conventional initial field values.

[0079] During the writing process to the field file, the boundary types and defined boundary values ​​from the original calculation example are retained for the physical boundaries in the field file. Here, physical boundaries refer to boundaries corresponding to actual physical conditions, such as train walls, ground, inlet and outlet flows, and far-field boundaries. Boundary types refer to the types of boundary conditions, such as fixed-value boundaries, zero-gradient boundaries, wall boundaries, inlet boundaries, and outlet boundaries. Defined boundary values ​​are the boundary data given for the corresponding boundaries in the original calculation example, such as the inlet velocity value given at the inlet or the no-slip condition given at the wall.

[0080] In short, when writing the initial flow field, only the internal field values ​​are replaced, without changing the boundary condition settings on the physical boundary. This ensures that the initial flow field and the physical boundary conditions of the original example are compatible, and the problem solved by subsequent RANS iterations remains consistent with the original example.

[0081] Furthermore, considering that train CFD simulations are typically performed in a parallel computing environment, where the computational domain is decomposed into multiple partitions and allocated to multiple processors, processor coupling boundaries exist between these partitions. Here, the processor coupling boundary refers to the boundary formed at the intersection of adjacent partitions due to the decomposition of the computational domain, used for exchanging data between processors. It is not a physical boundary, but rather an internal coupling interface introduced by parallel computing; the coupling type refers to the coupling method adopted by the processor coupling boundary, and the addressing relationship refers to the correspondence between the cells and surfaces on both sides of the processor coupling boundary.

[0082] In this embodiment of the invention, the processor coupling boundary retains its coupling type and addressing relationship. That is, in the case of parallel computing, the internal field values ​​of the corresponding partitions can be written to each decomposed processor directory, while the coupling type and addressing relationship of the processor coupling boundary are not changed. This ensures that the data exchange relationship between each partition after writing the initial flow field is consistent with the original calculation example, and the parallel solution can proceed normally.

[0083] In addition, in this embodiment of the invention, the reconstruction of the volume surface flux is achieved by linear surface interpolation, that is, based on the mesh geometry, the velocity at the center of the adjacent cell of the mesh surface is linearly interpolated to obtain the velocity value at the mesh surface, that is, the surface velocity; the interpolation weight can be determined according to the mesh geometry, such as the distance from the mesh surface to the center of the adjacent cells on both sides.

[0084] After obtaining the surface velocity, the surface velocity can be multiplied by the directed area vector of the grid surface to obtain the volumetric surface flux of the grid surface.

[0085] Specifically, for each grid surface Volumetric surface flux It can be constructed according to the following formula: in, For grid surface A directed area vector, that is, a vector whose magnitude is equal to the area of ​​the mesh surface and whose direction is along the normal to the mesh surface; This represents the velocity at the centers of adjacent cells on the mesh surface, based on the mesh geometry. Perform linear interpolation to obtain the mesh surface. The velocity value at that location; Represents the mesh surface The surface velocity at that location.

[0086] It is worth noting that the mesh surfaces in a finite volume mesh can be divided into internal surfaces and boundary surfaces. Internal surfaces have mesh cells on both sides, and their surface velocities can be directly interpolated from the velocities of the centers of adjacent cells using linear surface interpolation. Boundary surfaces, however, have mesh cells on only one side and the computational domain boundary on the other, making direct interpolation from the centers of cells on both sides impossible. Therefore, in this embodiment of the invention, when the mesh surface is a boundary surface, the surface velocity of the boundary surface is determined based on the velocity and the boundary type and specified boundary values ​​retained in the field file. That is, the surface velocity at the boundary surface is determined according to the boundary type and specified boundary values ​​retained in the field file of the boundary to which the boundary surface belongs, combined with the velocity at the center of the inner cell of the boundary surface.

[0087] For example, for an inlet boundary with a given fixed velocity value, the surface velocity of the boundary surface can be directly taken from the reserved boundary value; for a non-slip wall boundary, the surface velocity of the boundary surface can be determined according to the wall conditions; for an outlet boundary of the zero gradient type, the surface velocity of the boundary surface can be extrapolated from the velocity at the center of the inner element. Thus, the surface flux at the boundary surface is consistent with the reserved boundary conditions, avoiding contradictions in the initial state at the boundary.

[0088] In this embodiment of the invention, an initial state for RANS iteration that matches the internal field value, boundary information, and surface flux is constructed. This avoids the problems of velocity-flux inconsistency caused by independently predicting surface flux and the mismatch between boundary information and the initial flow field. It is compatible with parallel computing scenarios, reduces the correction amount caused by the inconsistency of the initial state in the early stage of RANS iteration, and further reduces the number of iterations required to reach the preset convergence criterion.

[0089] Based on the above embodiments, the initial flow field prediction network is trained according to the following steps: Training samples are obtained and constructed based on the train CFD examples of the converged sample trains. The training samples include the sample geometry information, sample inflow conditions and spatial coordinates of the sample cell center, as well as the converged flow field. The sample geometry, sample inflow conditions, and spatial coordinates of the sample cell center are input into the initial prediction network to obtain the predicted initial flow field and predicted wall distance at the sample cell center output by the initial prediction network. The regression loss is determined based on the predicted initial flow field and the convergent flow field; The wall distance loss is determined based on the predicted wall distance and the target wall distance; the target wall distance is determined based on the minimum distance from the center of the sample cell to the center of each surface cell in the complete surface mesh of the sample train. Based on regression loss and wall distance loss, the parameters of the initial prediction network are iterated to obtain the initial flow field prediction network.

[0090] Specifically, since the prediction capability of the initial flow field prediction network comes from learning the mapping relationship between train geometry, incoming flow conditions and converged flow field, and the train shape is often modified at a small scale at the front and local curved surfaces, while this region has a large near-wall pressure gradient and turbulence changes, conventional networks are difficult to fully retain such local geometric differences. Therefore, in this embodiment of the invention, the converged train CFD example is used as the supervision data to construct training samples, and a wall distance auxiliary supervision task is introduced on the basis of the main flow field variable regression task, and the initial flow field prediction network is obtained through joint training.

[0091] In detail, this process involves first obtaining training samples based on converged sample train CFD examples. These sample trains are the train objects used to construct the training data, and can include various types such as high-speed trains and maglev trains. That is, a complete train CFD simulation is performed on the sample trains and iterated until convergence is achieved. Then, the data required for training is extracted from the converged examples.

[0092] Each training sample includes the sample geometry information corresponding to the sample train, the sample inflow conditions, the spatial coordinates of the sample cell center, and the converged flow field. The sample geometry information represents the outer surface geometry of the sample train; for example, it can be a surface point cloud sampled from the sample train's surface mesh. The sample inflow conditions represent the inflow conditions of the converged example; for example, they can include longitudinal and lateral inflow velocities. The spatial coordinates of the sample cell center are the three-dimensional coordinates of the center of the volume grid cell in the finite volume grid of the example. The converged flow field is the flow field variable value at the center of each sample cell after the example has iteratively converged; for example, it can include converged velocity, kinematic pressure, turbulent kinetic energy, specific dissipation rate, turbulent kinematic viscosity, etc., which serve as the supervised target for network regression learning.

[0093] To enable the network to adapt to different train geometry and incoming flow conditions, the training samples can cover a variety of train geometry and incoming flow conditions. Figure 2 These are schematic diagrams of the train geometry, simulation conditions, and training samples provided by this invention, as shown below. Figure 2 As shown in (a) and (b), a dataset covering a variety of train geometries and incoming flow conditions can be constructed. In one example, 50 basic train geometries can be selected, including high-speed train geometry and maglev train geometry; for each basic geometry, 10 CFD cases with different geometric scaling and incoming flow conditions are constructed, resulting in a total of 500 samples.

[0094] Furthermore, to increase sample diversity, the train length can vary from 20 m to 80 m, and the train width and height can be scaled independently within a small range; the incoming flow velocity can be sampled within the range of 40 m / s to 100 m / s for the longitudinal component and 0 m / s to 20 m / s for the lateral component. In a single training and testing run, 450 examples corresponding to 45 basic geometries can be used for network training, while 50 examples corresponding to the remaining 5 basic geometries are used for testing to verify the network's generalization ability to train geometries not included in the training.

[0095] It should be noted that, considering the significant differences in the numerical ranges of different flow field variables, training directly using variables in physical dimensions may affect the stability of the training and the balance between the variables. Therefore, before training, each variable can be normalized according to the incoming flow velocity. For example, the velocity can be normalized according to the incoming flow velocity modulus. Normalization, kinematic stress can be calculated according to... Normalize, and then restore to the corresponding physical dimensions before being used for numerical initialization.

[0096] Then, the sample geometry, sample inflow conditions, and spatial coordinates of the sample cell center are input into the initial prediction network to obtain the predicted initial flow field and predicted wall distance at the sample cell center output by the initial prediction network.

[0097] The initial prediction network here refers to the network whose parameters have not yet converged during the training process and is undergoing parameter iteration. Its network structure is the same as the initial flow field prediction network after training is completed. After training, it becomes the initial flow field prediction network. Its processing of input information is consistent with the prediction process of the initial flow field prediction network. That is, it takes the sample geometric information and sample inflow conditions as input conditions, takes the spatial coordinates of the sample unit center as the spatial query position, and outputs the prediction results at the center of each sample unit.

[0098] Unlike the inference phase, the network output during the training phase includes not only the predicted initial flow field, such as sample velocity, sample kinematic pressure, sample turbulent kinetic energy, sample specific dissipation rate, and sample turbulent kinematic viscosity, but also the predicted wall distance. Here, the predicted wall distance refers to the distance from the spatial coordinates of the sample cell center to the sample train geometry wall predicted by the network. It is used as an auxiliary prediction target in training to improve the network's sensitivity to the train wall position and local surface changes.

[0099] Next, the regression loss can be determined based on the predicted initial flow field and the converged flow field. This regression loss measures the difference between the predicted initial flow field at the center of each sample cell and the converged flow field, which serves as the monitoring target. It can take the form of L1 loss, L2 loss, or other regression losses; this embodiment of the invention does not specifically limit this. For example, the mainstream field regression loss can be the sum of the L1 differences between the predicted and converged values ​​of the five mainstream field variables: sample velocity, sample kinematic pressure, sample turbulent kinetic energy, sample specific dissipation rate, and sample turbulent kinematic viscosity. By minimizing the regression loss, the network learns the mapping relationship from the sample train geometry and sample inflow conditions to the converged flow field.

[0100] Simultaneously, the wall distance loss can be determined based on the predicted wall distance and the target wall distance. Here, the target wall distance refers to the actual wall distance used as the monitoring target, which is determined based on the minimum distance from the center of the sample cell to the center of each surface cell in the complete surface mesh of the sample train. The complete surface mesh refers to all surface meshes of the sample train, and its set of surface cell centers can be denoted as... .

[0101] It is worth noting that when calculating the target wall distance, the centers of all surface cells of the complete surface mesh are used, rather than just the sampled point cloud of the network input. This allows for a more accurate target wall distance and avoids distance errors caused by sparse sampling.

[0102] In one implementation, for the spatial coordinates of the sample cell center That is, spatial query location, distance from the target wall. This allows you to query the location of each surface cell in the complete surface mesh. The square root of the minimum Euclidean distance is calculated using the following formula: Using the square root of the distance can compress the range of variation in the far-field distance and improve the relative resolution of the near-wall small-distance region, making wall distance monitoring more focused on the near-wall region.

[0103] Once the target wall distance is obtained, the wall distance loss can be constructed by minimizing the difference between the predicted wall distance and the target wall distance. The difference can be measured using L1 loss, L2 loss, etc., and this embodiment of the invention does not specifically limit this method. By supervising the wall distance loss, the network is forced to retain information about the precise position of the train wall in its internal feature representation, thereby improving the network's near-wall sensitivity to changes in the train's front and other local curved surfaces, enabling the network to distinguish small-scale modifications to the train's shape in local areas such as the front.

[0104] Finally, based on the regression loss and wall distance loss, the initial prediction network undergoes parameter iteration. That is, with the goal of minimizing the loss, the network parameters are updated through backpropagation and an optimizer to obtain the initial flow field prediction network. The total loss can be obtained by a weighted sum of the regression loss and the wall distance loss. The weights of each loss term can be adjusted based on the training effect; this embodiment of the invention does not impose specific limitations on this. The hyperparameters used for training, such as the optimizer, learning rate, batch size, and number of training epochs, can be determined based on the data scale and hardware conditions.

[0105] When the parameter iteration meets the training termination condition, such as loss convergence or reaching the preset number of training rounds, the trained network is obtained, which is the initial flow field prediction network. This network can be used for the initial flow field prediction of the train to be simulated.

[0106] In this embodiment of the invention, training samples are constructed based on converged train CFD examples, enabling the network to learn the mapping relationship from train geometry and incoming flow conditions to the converged flow field, thereby possessing generalized prediction capabilities for unseen train geometry. Furthermore, a wall distance loss is introduced for joint training on top of the mainstream field variable regression loss, allowing the network to retain information on the precise location of the train wall in the feature representation. This improves the network's near-wall sensitivity to changes in the train head and other local curved surfaces, which helps reduce the difference between the predicted initial flow field and the corresponding converged flow field, thereby improving the quality and acceleration effect of the initial flow field as the initial value for RANS iteration.

[0107] Based on the above embodiments, the training samples also include the adjacency relationship between the centers of the sample units; The initial flow field prediction includes sample velocity and sample kinematic pressure; the output of the initial prediction network also includes the sample first derivative of the sample velocity and the sample kinematic pressure gradient. Based on regression loss and wall distance loss, the parameters of the initial prediction network are iterated to obtain the initial flow field prediction network, including: Based on adjacency relationships, sample unit center pairs are constructed; For each sample unit center pair, based on the sample velocity and the first derivative of the sample at the center of one sample unit, a second-order Taylor expansion is performed on the sample velocity at the center of the other sample unit to obtain the velocity residual. For each sample unit center pair, based on the sample kinematic pressure and sample kinematic pressure gradient at the sample unit center on one side, a first-order Taylor expansion is performed on the sample kinematic pressure at the sample unit center on the other side to obtain the kinematic pressure residual. Based on the velocity residual and kinematic pressure residual of each sample unit center pair, the local consistency loss is determined; Based on regression loss, wall distance loss, and local consistency loss, the parameters of the initial prediction network are iterated to obtain the initial flow field prediction network.

[0108] Specifically, in this embodiment of the invention, in addition to sample geometric information, sample inflow conditions, spatial coordinates of sample cell centers and converged flow field, the training samples also include the adjacency relationship between sample cell centers, that is, the adjacency relationship between sample cell centers in a finite volume grid, which can be directly determined by the grid topology. For example, the cell centers of two grid cells sharing the same grid surface are adjacent to each other. This adjacency relationship can be extracted from the grid data of the simulation when constructing training samples based on the converged train CFD simulation.

[0109] Accordingly, the predicted initial flow field includes sample velocity and sample kinematic pressure; sample velocity is the velocity at the center of the sample cell output by the initial prediction network, and sample kinematic pressure is the kinematic pressure at the center of the sample cell; based on this, the output of the initial prediction network also includes the sample first derivative and sample second derivative of the sample velocity, as well as the sample kinematic pressure gradient.

[0110] Let the spatial coordinates be , Indicates transpose, sample rate is ; The first derivative of a sample is the first partial derivative of each sample velocity component along each coordinate direction, and it can form the sample velocity gradient tensor. , of which components Indicates the first Each sample velocity component Along the first Each coordinate direction The first derivative of , i.e.: The second derivative of a sample is the second partial derivative of the velocity component of each sample with respect to its coordinate direction, and it can form the velocity Hessian tensor. , of which components Indicates the first Each sample velocity component Regarding the first Each coordinate direction and the Each coordinate direction The second derivative, i.e.: The sample kinematic pressure gradient is the gradient of the sample kinematic pressure along each coordinate direction. ; among which components Indicates sample kinematic pressure Along the first Each coordinate direction The gradient, i.e.: The above a, b, and c are all component indicators ranging from 1 to 3.

[0111] It should be noted that for any sample velocity component, the sample second derivative satisfies symmetry. Therefore, each sample velocity component corresponds to six independent Hessian components, and the three sample velocity components correspond to a total of eighteen independent Hessian components. The network outputs eighteen independent components to fully represent the velocity Hessian tensor. The aforementioned derivative auxiliary quantities are all directly output by the initial prediction network with respect to the spatial coordinates of the sample cell center, rather than being obtained through automatic differentiation calculation.

[0112] Based on this, the process of training the initial prediction network using regression loss and wall distance loss can specifically include: First, based on adjacency relationships, sample unit center pairs are constructed. Here, a sample unit center pair consists of two adjacent sample unit centers. ,in and These are the centers of the sample units on either side of the pair. In actual training, they can be selected based on adjacency relationships in each training batch. The selection of adjacent sample unit center pairs can be random or based on a balanced selection of regions, etc., and this embodiment of the invention does not specifically limit this. For each sample unit center pair, the coordinate difference between the centers of the two sample units can be recorded as... , .

[0113] Next, for each pair of sample cell centers, based on the sample velocity and first derivative at the center of one sample cell, a second-order Taylor expansion is performed on the sample velocity at the center of the other sample cell to obtain the velocity residual. That is, using the field value and derivative at the center of one sample cell as a reference, the expansion is performed along the coordinate difference direction to the second-order term to approximate the field value at the center of the other sample cell; the velocity residual is the difference between the approximate value of the second-order Taylor expansion and the sample velocity directly predicted by the network at the center of the other sample cell.

[0114] Specifically, with Sample speed at the location The sample velocity gradient tensor formed by the first derivative of the sample and the sample velocity gradient tensor ,right Sample speed at the location A second-order Taylor expansion can be used to construct a system based on the Taylor series. point to Positive velocity residual This process can be represented as: in, The velocity vector of the incoming flow. Its modulus is used to make the velocity residual dimensionless, so as to eliminate the influence of the difference in the magnitude of the downstream velocity under different operating conditions on the magnitude of the residual.

[0115] Simultaneously, for each sample unit center pair, based on the sample kinematic pressure and gradient at the sample unit center on one side, a first-order Taylor expansion is performed on the sample kinematic pressure at the sample unit center on the other side to obtain the kinematic pressure residual. That is, using the sample kinematic pressure and its gradient at the sample unit center on one side as a reference, the expansion is performed along the coordinate difference direction to a first-order term to approximate the kinematic pressure at the sample unit center on the other side; the kinematic pressure residual is the difference between the approximate value of the first-order Taylor expansion and the sample kinematic pressure directly predicted by the network at the sample unit center on the other side.

[0116] Specifically, with Sample kinematic pressure at the location and sample kinematic pressure gradient ,right Sample kinematic pressure A first-order Taylor expansion can be used to construct a system composed of... point to Kinematic stress positive residual This process can be represented as: in, Used to make the kinematic pressure residual dimensionless.

[0117] In this embodiment of the invention, the sample velocity adopts a second-order Taylor consistency constraint, and the sample kinematic pressure adopts a first-order Taylor consistency constraint, which is compatible with the derivative order required for solving the velocity field and pressure field in finite volume.

[0118] It is worth noting that the above positive residuals are based on Field value and derivative at point The field value at that point is obtained by expanding it; similarly, the reference side of the expansion can be interchanged, i.e., with... The sample velocity, sample first derivative, sample kinematic pressure, and sample kinematic pressure gradient at the point of origin, for The sample velocity and sample kinematic pressure at the location are subjected to second-order Taylor expansion and first-order Taylor expansion, respectively, to construct a system based on these parameters. point to velocity reverse residual Inverse residuals of kinematic stress In other words, for each sample unit center pair, one side can be interchanged with the other, thus obtaining two sets of residuals, one in the forward direction and one in the reverse direction, on the same sample unit center pair, forming a bidirectional local Taylor expansion residual. This ensures that the consistency constraint is applied in both directions of the sample unit center pair, making the constraint more sufficient.

[0119] Then, the local consistency loss can be determined based on the velocity residual and kinematic pressure residual of each sample cell center pair. This local consistency loss is used to comprehensively measure the Taylor expansion residuals across all sample cell center pairs.

[0120] In one implementation, the forward and backward residuals of each sample unit center pair can be included in the local consistency loss, i.e., the local consistency loss. It can be represented as: in, This represents the number of center pairs of the sample units; This represents the summation of center pairs over all sample cells; and They represent and L1 norm; and Then it means and The absolute value of.

[0121] It is understood that the residual measurement method is not limited to L1 norm, and other measurement methods such as L2 norm can also be used. This embodiment of the invention does not make specific limitations on this.

[0122] Finally, based on the regression loss, wall distance loss, and local consistency loss, the initial prediction network is iterated to obtain the initial flow field prediction network. Here, the total loss can be obtained by weighted summation of the regression loss, wall distance loss, and local consistency loss. The weights of each loss term can be adjusted according to the training effect, and this embodiment of the invention does not specifically limit this. The parameter iteration process has been previously described and will not be repeated here.

[0123] In this embodiment of the invention, without performing automatic differentiation on the center of all grid cells, a local consistency constraint is established between the derivative auxiliary quantity and the predicted flow field, as well as the predicted field value of the center of adjacent sample cells. This avoids the training overhead caused by large-scale automatic differentiation and improves the local consistency and spatial compatibility between sample velocity, sample kinematic pressure and their derivatives.

[0124] Based on the above embodiments, the prediction of the initial flow field also includes the sample turbulent kinetic energy, sample specific dissipation rate, and sample turbulent kinematic viscosity; Based on the regression loss, wall distance loss, and local consistency loss, the initial prediction network is iterated to obtain the initial flow field prediction network, including: Based on regression loss, wall distance loss, and local consistency loss, the parameters of the initial prediction network are iterated to obtain the target prediction network; Based on physical consistency constraints, parameter iteration is performed on the target prediction network to obtain the initial flow field prediction network; Among them, physical consistency constraints include local momentum residuals and eddy viscosity consistency constraints; The local momentum residual is determined based on the sample velocity, the sample first derivative, the sample kinematic pressure gradient, and the sample turbulent kinematic viscosity. Eddy viscosity consistency constraint is used to constrain the relationship between the product of sample specific dissipation rate and sample turbulent kinematic viscosity and sample turbulent kinetic energy.

[0125] Specifically, in this embodiment of the invention, a two-stage strategy is adopted for training the initial prediction network. In the first stage, the network is trained based on regression loss, wall distance loss, and local consistency loss to establish a stable geometric flow field mapping. In the second stage, based on the network parameters obtained in the first stage, physical consistency constraints, including local momentum residuals and eddy viscosity consistency constraints, are further added for training to improve the compatibility of the prediction field.

[0126] In detail, in this embodiment of the invention, the predicted initial flow field includes not only sample velocity and sample kinematic pressure, but also sample turbulent kinetic energy, sample specific dissipation rate, and sample turbulent kinematic viscosity. That is, the initial prediction network also outputs the predicted turbulent kinetic energy, specific dissipation rate, and turbulent kinematic viscosity at the center of each sample cell. Among them, the sample turbulent kinetic energy represents the kinetic energy level of turbulent fluctuations at that location, the sample specific dissipation rate represents the specific dissipation rate of turbulent kinetic energy, and the sample turbulent kinematic viscosity, i.e., eddy viscosity, represents the equivalent viscous effect of turbulence on momentum transport. All three are turbulent variables in RANS turbulence modeling, and their supervision target is the corresponding turbulent variable value in the convergent flow field, and can be included in the regression loss.

[0127] Next, the initial prediction network can be iterated based on regression loss, wall distance loss, and local consistency loss to obtain the target prediction network. This target prediction network is the one trained in the first stage, with its parameters initially converged. It has established a stable mapping from sample geometry and inflow conditions to the converged flow field, and possesses wall distance sensing capability and local consistency between the predicted field value and the predicted derivative. In other words, the first stage can use regression loss, wall distance supervision loss, and local derivative consistency loss in combination for training, enabling the network to establish a stable geometric flow field mapping.

[0128] Following this, the target prediction network can be iterated based on physical consistency constraints to obtain the initial flow field prediction network. That is, the second stage begins training with the network parameters obtained in the first stage, and further incorporates physical consistency constraints into the training process, building upon the regression loss, wall distance loss, and local consistency loss. Here, physical consistency constraints are the constraints that ensure the predicted flow field variables satisfy the relationships required by the flow control equations and the turbulence model. These constraints include local momentum residuals and eddy viscosity consistency constraints.

[0129] Among them, the local momentum residual is determined based on the sample velocity, the sample first derivative, the sample kinematic pressure gradient, and the sample turbulent kinematic viscosity. It is used to measure the degree of deviation of the predicted field from the steady-state incompressible momentum equation in the local neighborhood of the center of each sample cell; that is, it is used to constrain the local compatibility between the predicted pressure and velocity.

[0130] Specifically, when the effective viscosity is approximated as constant within a local neighborhood, the steady-state incompressible local momentum residual... It can be represented as: in, For sample speed; The sample velocity gradient tensor is composed of the first derivatives of the samples. For convection terms; For fluid kinematic viscosity; The turbulent kinematic viscosity of the sample; This refers to the local effective viscosity. For the Laplace term of the sample velocity, it is determined by the second derivative of the sample. The kinematic pressure gradient of the sample.

[0131] By reducing the local momentum residual in the second-stage parameter iteration, for example by incorporating its norm as a loss term into the training objective, the sample velocity, sample kinematic pressure, and their derivatives can be made to locally satisfy the equilibrium relationship of the steady-state incompressible momentum equation, thereby giving the predicted initial flow field better pressure-velocity local compatibility.

[0132] Eddy viscosity consistency constraints are used to constrain the relationship between the product of the sample specific dissipation rate and the sample turbulent kinematic viscosity and the sample turbulent kinetic energy. The eddy viscosity consistency constraints here are constructed for the relationship between eddy viscosity, turbulent kinetic energy, and specific dissipation rate in the turbulence model used by the RANS solver.

[0133] In one implementation, the RANS solver employs a k-ω SST turbulence model, in which eddy viscosity is constrained by turbulent kinetic energy and specific dissipation rate; that is, the turbulent kinematic viscosity is no greater than the ratio of turbulent kinetic energy to dissipation rate. Based on this characteristic, the predicted sample turbulent kinetic energy can be... Sample dissipation rate and sample turbulent kinematic viscosity Apply branch consistency constraints, i.e., construct SST consistency constraints, in the convergent flow field satisfying The region that makes the predicted value satisfy That is, the product of the sample specific dissipation rate and the sample turbulent kinematic viscosity is equal to the sample turbulent kinetic energy; in the convergent flow field, the following conditions are met. In areas where violations are prohibited The prediction is penalized by constraining the product of the sample specific dissipation rate and the sample turbulent kinematic viscosity to be no greater than the sample turbulent kinetic energy.

[0134] At the same time, it can also be used for , and Nonnegativity constraints are applied to ensure that the predicted values ​​of each turbulent variable conform to their physical meaning. It should be noted that this eddy viscosity consistency constraint does not replace the SST transport equation, but is used to improve the compatibility between the predicted initial flow field and the subsequent SST solution, so that the turbulent variables written into the solver satisfy the variable relationships required by the turbulence model, avoiding additional adjustment processes caused by the contradiction between turbulent variables in the early stage of RANS iteration.

[0135] In the second stage, the total loss can be obtained by weighted summation of the regression loss, wall distance loss, local consistency loss, loss term corresponding to local momentum residual, and loss term corresponding to eddy viscosity consistency constraint. The weight of each loss term can be adjusted according to the training effect, and this embodiment of the invention does not specifically limit this.

[0136] When the parameter iteration in the second stage meets the training termination condition, the initial flow field prediction network trained in two stages is obtained. This network can be used to predict the initial flow field of the train to be simulated. Through two-stage training, the network first establishes a stable geometric flow field mapping, and then improves the physical compatibility of the prediction field on this basis, avoiding the interference of physical constraints on the basic mapping learning in the early stage of training.

[0137] In this embodiment of the invention, a two-stage training strategy is employed. First, the network is trained based on regression loss, wall distance loss, and local consistency loss to establish a stable geometric flow field mapping. On this basis, local momentum residuals and eddy viscosity consistency constraints are added for parameter iteration, so that the sample velocity, sample kinematic pressure, and their derivatives locally satisfy the equilibrium relationship of the steady-state incompressible momentum equation. The sample turbulent kinetic energy, sample specific dissipation rate, and sample turbulent kinematic viscosity satisfy the variable relationship required by the turbulence model. This improves the physical compatibility between velocity, pressure, and turbulence variables in the predicted initial flow field and its compatibility with RANS solutions, reduces the difference between the predicted initial flow field and the converged flow field, reduces the correction amount in the early stage of RANS iteration, and thus enhances the acceleration effect of the predicted initial flow field on RANS iteration.

[0138] The train CFD simulation acceleration device based on neural network prediction of initial flow field provided by the present invention will be described below. The train CFD simulation acceleration device based on neural network prediction of initial flow field described below can be referred to in correspondence with the train CFD simulation acceleration method based on neural network prediction of initial flow field described above.

[0139] Figure 3 This is a schematic diagram of the train CFD simulation acceleration device based on neural network prediction of the initial flow field provided by the present invention, as shown in the figure. Figure 3 As shown, the device includes: The acquisition unit 310 is used to acquire the geometric information of the train to be simulated, the corresponding incoming flow conditions, and the spatial coordinates of the center of each unit in the finite volume mesh of the train CFD simulation. The prediction unit 320 is used to input the geometric information, the incoming flow conditions and the spatial coordinates of the center of each unit into the initial flow field prediction network to obtain the initial flow field at the center of each unit output by the initial flow field prediction network, wherein the initial flow field includes velocity. Reconstruction unit 330 is used to reconstruct the volumetric surface flux based on the velocity, and to determine the initial state of RANS iteration based on the initial flow field and the volumetric surface flux. The iteration unit 340 is used to iterate the RANS solver until the preset convergence criterion is met, using the initial state of the RANS iteration as the initial condition, to obtain the flow field around the train to be simulated.

[0140] The train CFD simulation acceleration device based on neural network prediction of the initial flow field provided by this invention overcomes the shortcomings of traditional schemes, such as large differences between the conventional initial field and the converged flow field and slow RANS iteration convergence. It also avoids the problem that the error caused by directly replacing the final CFD solution with the neural network output will affect the engineering conclusion. By reconstructing the volume surface flux from the predicted velocity, a RANS iteration initial state matching the velocity and surface flux is constructed, reducing the correction amount caused by the inconsistency of the initial field in the early stage of RANS iteration. This allows subsequent iterations to focus on correcting prediction errors and local residuals, thereby effectively reducing the number of iterations required to reach the preset convergence criterion. While ensuring that the final flow field is obtained iteratively by the numerical solver and the results are accurate and reliable, it greatly improves the computational efficiency of train CFD simulation and reduces the computational resources and time overhead required for multi-shape and multi-condition aerodynamic design.

[0141] Figure 4 An example is a schematic diagram of the physical structure of an electronic device, such as... Figure 4 As shown, the electronic device may include: a processor 410, a communications interface 420, a memory 430, and a communications bus 440, wherein the processor 410, the communications interface 420, and the memory 430 communicate with each other through the communications bus 440. The processor 410 can call logic instructions in the memory 430 to execute a train CFD simulation acceleration method based on neural network prediction of the initial flow field. The method includes: acquiring the geometric information of the train to be simulated, the corresponding incoming flow conditions, and the spatial coordinates of the center of each cell in the finite volume grid of the train CFD simulation; inputting the geometric information, the incoming flow conditions, and the spatial coordinates of the center of each cell into the initial flow field prediction network to obtain the initial flow field at the center of each cell output by the initial flow field prediction network, wherein the initial flow field includes velocity; reconstructing the volumetric flux based on the velocity; determining the initial state of RANS iteration based on the initial flow field and the volumetric flux; using the initial state of RANS iteration as the initial condition, iterating by the RANS solver until a preset convergence criterion is met to obtain the flow field around the train to be simulated.

[0142] Furthermore, the logical instructions in the aforementioned memory 430 can be implemented as software functional units and, when sold or used as independent products, can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0143] On the other hand, the present invention also provides a computer program product, which includes a computer program stored on a non-transitory computer-readable storage medium. The computer program includes program instructions, and when the program instructions are executed by a computer, the computer can execute the train CFD simulation acceleration method based on neural network prediction of the initial flow field provided by the above methods. The method includes: acquiring the geometric information of the train to be simulated, the corresponding incoming flow conditions, and the spatial coordinates of the center of each cell in the finite volume grid of the train CFD simulation; inputting the geometric information, the incoming flow conditions, and the spatial coordinates of the center of each cell into an initial flow field prediction network to obtain the initial flow field at the center of each cell output by the initial flow field prediction network, wherein the initial flow field includes velocity; reconstructing the volumetric flux based on the velocity; determining the initial state of RANS iteration based on the initial flow field and the volumetric flux; using the initial state of RANS iteration as the initial condition, iterating by the RANS solver until a preset convergence criterion is met to obtain the flow field around the train to be simulated.

[0144] In another aspect, the present invention also provides a non-transitory computer-readable storage medium storing a computer program thereon. When executed by a processor, the computer program is implemented to perform the XXXX method provided by the above-described methods. The method includes: acquiring the geometric information of the train to be simulated, the corresponding incoming flow conditions, and the spatial coordinates of the center of each cell in the finite volume grid of the train CFD simulation; inputting the geometric information, the incoming flow conditions, and the spatial coordinates of the center of each cell into an initial flow field prediction network to obtain the initial flow field at the center of each cell output by the initial flow field prediction network, wherein the initial flow field includes velocity; reconstructing the volumetric flux based on the velocity; determining the initial state of RANS iteration based on the initial flow field and the volumetric flux; using the initial state of RANS iteration as the initial condition, iterating by the RANS solver until a preset convergence criterion is satisfied to obtain the flow field around the train to be simulated.

[0145] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Those skilled in the art can understand and implement this without any creative effort.

[0146] Through the above description of the embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus necessary general-purpose hardware platforms, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solutions, in essence or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods described in the various embodiments or some parts of the embodiments.

[0147] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A method for accelerating train CFD simulation based on neural network prediction of initial flow field, characterized in that, include: Obtain the geometric information of the train to be simulated, the corresponding incoming flow conditions, and the spatial coordinates of the center of each element in the finite volume mesh of the train CFD simulation; The geometric information, the incoming flow conditions, and the spatial coordinates of the center of each unit are input into the initial flow field prediction network to obtain the initial flow field at the center of each unit output by the initial flow field prediction network, wherein the initial flow field includes velocity. Based on the velocity, the volumetric surface flux is reconstructed, and based on the initial flow field and the volumetric surface flux, the initial state of the RANS iteration is determined. Using the initial state of the RANS iteration as the initial condition, the RANS solver iterates until the preset convergence criterion is met to obtain the flow field around the train to be simulated.

2. The train CFD simulation acceleration method based on neural network prediction of the initial flow field according to claim 1, characterized in that, The initial flow field prediction network includes a surface encoder and a coordinate condition decoder; The surface encoder is used to extract features from the geometric information and, based on the incoming flow conditions, modulates the extracted geometric features to obtain a shared feature representation. The coordinate condition decoder is used to map the spatial coordinates of the center of each unit to query features, and to perform attention interaction based on the query features and the shared feature representation to obtain the initial flow field at the center of each unit; In this process, the query features of different unit centers do not undergo attention interaction, and the spatial coordinates of each unit center are input into the coordinate condition decoder in batches, with each batch of query features sharing the shared feature representation.

3. The train CFD simulation acceleration method based on neural network prediction of the initial flow field according to claim 1, characterized in that, The output of the initial flow field prediction network also includes the first derivative of the velocity, which is used to construct the velocity gradient tensor; The initial flow field prediction network is used to reconstruct at least one diagonal component in the velocity gradient tensor so that the trace of the velocity gradient tensor is zero.

4. The train CFD simulation acceleration method based on neural network prediction of the initial flow field according to any one of claims 1 to 3, characterized in that, After obtaining the initial flow field at the center of each unit output by the initial flow field prediction network, the method further includes: The initial flow field is written into the field file corresponding to the finite volume grid; the physical boundaries in the field file retain the boundary types and specified boundary values ​​in the original case of the train CFD simulation, and the processor coupling boundaries retain their coupling types and addressing relationships; The reconstructed volumetric flux based on the velocity includes: Linear surface interpolation is performed on the velocity to obtain the surface velocity at the grid surface of the finite volume grid, and the volume surface flux is determined based on the surface velocity and the directed area vector of the grid surface. Specifically, when the mesh surface is a boundary surface, the surface velocity of the boundary surface is determined based on the velocity and the boundary type and specified boundary value retained in the field file.

5. The train CFD simulation acceleration method based on neural network prediction of the initial flow field according to any one of claims 1 to 3, characterized in that, The initial flow field prediction network is trained based on the following steps: Training samples are obtained, which are constructed based on the converged CFD examples of the sample trains; the training samples include the sample geometry information, sample inflow conditions and spatial coordinates of the sample cell center corresponding to the sample train, as well as the converged flow field; The sample geometry, the sample inflow conditions, and the spatial coordinates of the sample cell center are input into the initial prediction network to obtain the predicted initial flow field and predicted wall distance at the center of the sample cell output by the initial prediction network. Based on the predicted initial flow field and the converged flow field, the regression loss is determined; Based on the predicted wall distance and the target wall distance, determine the wall distance loss; The target wall distance is determined based on the minimum distance from the center of the sample unit to the center of each surface unit in the complete surface grid of the sample train; Based on the regression loss and the wall distance loss, the parameters of the initial prediction network are iterated to obtain the initial flow field prediction network.

6. The train CFD simulation acceleration method based on neural network prediction of the initial flow field according to claim 5, characterized in that, The training samples also include the adjacency relationships between the centers of the sample units; The predicted initial flow field includes sample velocity and sample kinematic pressure; the output of the initial prediction network also includes the sample first derivative of the sample velocity and the sample kinematic pressure gradient. The initial flow field prediction network is obtained by iterating the parameters of the initial prediction network based on the regression loss and the wall distance loss, including: Based on the aforementioned adjacency relationship, sample unit center pairs are constructed; For each sample unit center pair, based on the sample velocity and the first derivative of the sample at the center of one sample unit, a second-order Taylor expansion is performed on the sample velocity at the center of the other sample unit to obtain the velocity residual. For each sample unit center pair, based on the sample kinematic pressure and sample kinematic pressure gradient at the sample unit center on one side, a first-order Taylor expansion is performed on the sample kinematic pressure at the sample unit center on the other side to obtain the kinematic pressure residual. Based on the velocity residual and kinematic pressure residual of each sample unit center pair, the local consistency loss is determined; Based on the regression loss, the wall distance loss, and the local consistency loss, the parameters of the initial prediction network are iterated to obtain the initial flow field prediction network.

7. The train CFD simulation acceleration method based on neural network prediction of the initial flow field according to claim 6, characterized in that, The predicted initial flow field also includes sample turbulent kinetic energy, sample specific dissipation rate, and sample turbulent kinematic viscosity; The initial flow field prediction network is obtained by iterating the parameters of the initial prediction network based on the regression loss, the wall distance loss, and the local consistency loss, including: Based on the regression loss, the wall distance loss, and the local consistency loss, the parameters of the initial prediction network are iterated to obtain the target prediction network; Based on physical consistency constraints, the target prediction network is iterated to obtain the initial flow field prediction network. The physical consistency constraints include local momentum residuals and eddy viscosity consistency constraints. The local momentum residual is determined based on the sample velocity, the sample first derivative, the sample kinematic pressure gradient, and the sample turbulent kinematic viscosity. The eddy viscosity consistency constraint is used to constrain the relationship between the product of the sample specific dissipation rate and the sample turbulent kinematic viscosity and the sample turbulent kinetic energy.

8. A train CFD simulation acceleration device based on neural network prediction of initial flow field, characterized in that, include: The acquisition unit is used to acquire the geometric information of the train to be simulated, the corresponding incoming flow conditions, and the spatial coordinates of the center of each unit in the finite volume mesh of the train CFD simulation. The prediction unit is used to input the geometric information, the incoming flow conditions and the spatial coordinates of the center of each unit into the initial flow field prediction network to obtain the initial flow field at the center of each unit output by the initial flow field prediction network, wherein the initial flow field includes velocity; The reconstruction unit is used to reconstruct the volumetric surface flux based on the velocity, and to determine the initial state of the RANS iteration based on the initial flow field and the volumetric surface flux. The iteration unit is used to iterate the RANS solver until a preset convergence criterion is met, using the initial state of the RANS iteration as the initial condition, to obtain the flow field around the train to be simulated.

9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and running on the processor, characterized in that, When the processor executes the computer program, it implements the train CFD simulation acceleration method based on neural network prediction of initial flow field as described in any one of claims 1 to 7.

10. A non-transitory 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 train CFD simulation acceleration method based on neural network prediction of the initial flow field as described in any one of claims 1 to 7.