Background
Computational Fluid Dynamics (CFD for short) is based on hydrodynamics and computer science, and an approximate solution of a Fluid control equation is obtained by starting from a calculation method and utilizing the quick calculation capability of a computer, so that the Computational Fluid Dynamics is an important technical means for researching related theories of hydrodynamics and engineering application.
Because problems in actual engineering usually cannot be analyzed and the cost for making a model is high, a great amount of CFD is usually relied on to carry out numerical simulation in the product design process, and the accuracy and the speed of CFD calculation results directly determine the length of a design iteration period. Therefore, how to improve the calculation speed and accuracy of CFD has been a key area of research.
The product structure in actual engineering is often extremely complex, in order to ensure accuracy, a sufficiently fine physical model and a sufficiently dense grid are required to be used for numerical simulation, so that the calculation speed is greatly reduced, and if some calculation problems are met, the design iteration cycle is also prolonged; conversely, if the model is simplified, the computation speed may be increased, but the accuracy will be affected. Especially, when local optimization iteration is performed, even if the model is changed a little, the same long numerical simulation time is needed, and the time is wasted.
In addition, because the required computing resources are often very huge, in order to save resources, the optimization of different parts of the product needs to unify the iteration cycle and calculate uniformly, so that the local optimization works in an elbow manner, and the working efficiency is influenced.
Therefore, when the product is optimized in local detail, the traditional calculation method wastes calculation resources seriously, limits the speed of optimization iteration, and needs a new flexible and quick calculation method aiming at local parts.
Disclosure of Invention
The invention aims to solve the problems of wasting computing resources, limiting the speed of optimization iteration and the like in the prior art, and provides a CFD local rapid computing method, which mainly aims at the complex original model and the algorithm which finish CFD computing, and realizes the CFD local rapid computing of a new model and the new algorithm after the local geometric structure of the complex original model and the complex original algorithm is modified.
A CFD local rapid calculation method is realized by the following steps:
step one, mapping;
mapping the CFD calculation result of the original example which is calculated to a new example which is not calculated;
step two, partitioning;
carrying out blocking processing on the new example obtained in the step one, and separating the part of the new example, which has a difference with the geometric structure of the original example, to obtain a blocking example;
step three, example processing;
processing the blocking calculation example obtained in the step two to obtain a blocking calculation example for independent calculation;
step four, calculating;
and calling the block calculation example obtained in the CFD software calculation step three to finish the CFD local quick calculation.
The invention has the beneficial effects that: the invention splits a large and complex complete example, and only calculates the required local part, thereby greatly reducing the calculation resource, accelerating the single iterative calculation speed, leading the local optimization to obtain the timely feedback and greatly reducing the iterative period;
the invention can make the local optimization work more flexibly and dispersedly, and avoid the situation that a plurality of local optimization works are mutually locked when synchronously carried out;
the method of the invention applies a mapping interpolation method to provide a reasonable initial field for CFD calculation, can accelerate calculation convergence and reduce iteration times;
the invention can realize fast self-defined calculation region division, and is convenient for users to adjust the block calculation region so as to give consideration to calculation speed and accuracy.
Detailed Description
In a first embodiment, the present embodiment is described with reference to fig. 1, and a method for local fast CFD calculation is implemented by the following steps:
1. mapping;
and (3) performing interpolation mapping on the CFD calculation result of the original calculation example which is subjected to calculation into a new calculation example which is not subjected to calculation by adopting an interpolation mapping tool, and performing reasonable assignment on the grid area which is not subjected to mapping by adopting a custom tool, thereby providing an accurate boundary condition and a reasonable initial field for the calculation of the subsequent block calculation example.
Since the new and old algorithms only have slight geometrical structure difference, the calculation results are almost the same in the areas far away from the geometrical difference, so the new algorithm can directly use the calculation results of the original algorithm in most areas, and the areas do not need further calculation. The new example thus has areas that need to be calculated and areas that do not need to be calculated.
2. Block processing;
the new algorithm is subjected to parallel block processing by using a parallel block tool, a local geometric structure of the new algorithm, which is different from the geometric structure of the original algorithm, can be accurately positioned by using a self-defined block method in the process, and the local geometric structure is separated from the complete structure, so that the corresponding local grid and the corresponding physical field are separated into the block algorithm which cannot be calculated yet.
In this embodiment, the grid and the physical field of the operator are divided into a plurality of parallel sub-operators before parallel computation is performed, and each computer thread only needs to compute a single parallel sub-operator, so that the parallel computation efficiency is higher than that of single-core computation. But the parallel sub-algorithm cannot independently calculate because the parallel sub-algorithm needs to transmit data through a newly-built boundary.
Based on the above principle, the new example is subjected to parallel blocking processing, and is divided into an area requiring calculation and an area not requiring calculation, and the former is called a blocking example. At the moment, the block calculation example is not different from the parallel sub-calculation example, the boundary condition is connected with other parallel sub-calculation examples, and the files such as physical properties are lacked, so that independent calculation cannot be carried out.
3. Example processing;
the grid and the physical field of the block calculation example which can not be calculated are transplanted into an independent calculation example file, the boundary conditions are modified, and necessary files such as the gravity acceleration, the material physical property, the turbulence model and the like are supplemented to enable the block calculation example to become the block calculation example which can be independently calculated.
4. Calculating;
and calling CFD software to calculate a block calculation example to obtain a calculation result and finish the local rapid calculation of the CFD.
In a second specific embodiment, the present embodiment is an application example of the CFD local fast calculation method according to the first specific embodiment:
the present embodiment takes CFD simulation calculation of a turbine guide vane as an example. After the original example A is calculated, the local geometry of the original example A is modified (one air film hole at the leaf back is deleted) to generate a new example B, and the CFD local calculation steps of the new example B are as follows:
1. the calculation result of the example A is subjected to interpolation mapping to the example B, the process calls a tool mapFields of OpenFOAM software, and a user-defined tool is adopted to reasonably assign a physical field corresponding to a grid area which cannot be mapped by the example B, so that an accurate boundary condition and a reasonable initial field are provided for the calculation of the subsequent block-based example;
2. the method comprises the following steps of performing parallel block processing on an operator B, calling a tool decomposePar of OpenFOAM software in the process, and realizing automatic self-defined block division based on the tool, so that leaf back regions modified by the operator A and the operator B can be accurately positioned, and the local geometric structure is separated from a complete structure, so that a corresponding local grid and a corresponding physical field are separated into a block operator C which cannot be calculated;
3. transplanting a blocking example C, modifying the boundary conditions of the blocking example C, supplementing necessary files such as material thermophysical properties, turbulence model parameters and the like, wherein the example C can carry out independent calculation and the process is mainly realized by an automatic script;
4. and (4) calculating an example C, completing the local rapid calculation of the CFD, and calling OpenFOAM software in the process.
In the actual operation of the calculation method described in this embodiment, only the example positions of the example a and the example B and the parameters required for the custom partitioning need to be filled in the file, and only the written script needs to be run to realize the above-described whole flow, so that the CFD local fast calculation is realized.
In this embodiment, the number of grids in the example B is about 1315 ten thousand, if the calculation occupies about 10G of memory according to the conventional calculation method, the single-step iteration time is about 62.5 s; however, by adopting the method of the embodiment, only the calculation example C is needed, the number of grids is about 145 ten thousand, the memory occupied by calculation is about 1.2G, the single-step iteration time is about 4.6s, and the method of the embodiment has obvious advantages compared with the traditional method.
The technical features of the embodiments described above may be arbitrarily combined, and for the sake of brevity, all possible combinations of the technical features in the embodiments described above are not described, but should be considered as being within the scope of the present specification as long as there is no contradiction between the combinations of the technical features.
The above-mentioned embodiments only express several embodiments of the present invention, and the description thereof is more specific and detailed, but not construed as limiting the scope of the invention. It should be noted that, for a person skilled in the art, several variations and modifications can be made without departing from the inventive concept, which falls within the scope of the present invention. Therefore, the protection scope of the present patent shall be subject to the appended claims.