A parallel computing method and system for numerical simulation of casting flow field
By separating the trial speed and divergence values of the parallel calculation grid in the numerical simulation of the casting flow field, and correcting the grid that does not meet the convergence conditions in parallel, solving the problem of low solution efficiency of nonlinear explicit equation systems in the prior art, achieving efficient parallel calculations, significantly improving the calculation speed.
Patent Information
- Application Number
- CN202110308148.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-03-23
- Publication Date
- 2025-06-17
- Estimated Expiration
- 2041-03-23
AI Technical Summary
The prior art is difficult to efficiently solve nonlinear explicit equation systems in parallel in numerical simulation of casting flow fields, resulting in low computational efficiency and inability to fully utilize computer hardware capabilities.
By separating and parallelizing the trial speed values and divergence values of each grid at the current time, and computing the pressure and speed correction values of the grid that do not meet the convergence conditions in parallel until all grids meet the convergence conditions, parallel computing of the nonlinear explicit solution process is realized.
It improves the efficiency of flow field calculation, reduces the operating pressure of the main process, makes the computer load relatively balanced, gives full play to the computer performance, and significantly shortens the time of the numerical simulation calculation process.
Smart Images

Figure CN113094878B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field related to numerical simulation calculations, and more specifically, relates to a parallel computing method and system for numerical simulation of casting flow fields. Background Art
[0002] In the numerical simulation calculation of casting flow fields, solving non-linear explicit equations often requires multiple iterations, increasing the complexity of numerical calculations. Taking the SOLA method commonly used in the process of casting flow field simulation as an example, according to the initial conditions or the velocity and pressure fields at the previous moment, the trial velocity at the current moment is calculated by the explicit difference format of the momentum equation, and then it is judged whether the trial velocity satisfies the continuity equation through the calculation of divergence. If the continuity equation is not satisfied, the pressure value must be corrected, and then the corrected velocity of the fluid element is obtained according to the momentum equation, and the above process is repeated until the continuity condition is satisfied. Since the velocity values of the upstream and downstream units of the element are also corrected during the process of correcting the velocity of the fluid element, that is, there is a problem of non-linear explicit solution, which makes it difficult to perform parallel solution of multiple units.
[0003] Traditional methods used in domestic and foreign casting simulations can only perform parallel solution of the initial trial velocity and divergence values. They calculate each fluid element one by one. After all elements meet the convergence conditions, the calculation of the trial velocity at the next moment is carried out in each sub-process. The memory pressure of the main process is relatively large, the improvement of the calculation speed is small, the overall calculation efficiency is low, and the hardware capabilities of the computer cannot be fully utilized. Facing the increasing scale of the casting flow field simulation problem and the continuous improvement of the solution accuracy, how to accelerate the calculation speed of the simulation has become an urgent problem to be solved. Summary of the Invention
[0004] Aiming at the defects and improvement requirements of the prior art, the present invention provides a parallel computing method and system for numerical simulation of casting flow fields, which improves the efficiency of flow field calculation by realizing parallel solution of a large number of non-linear explicit equations in the casting flow field simulation technology.
[0005] To achieve the above object, the present invention provides a parallel computing method for numerical simulation of casting flow fields, including the following steps:
[0006] S1: Import the flow field model of the casting and perform grid division on the model; according to the number of grids obtained by grid division, initialize the same number of processing units, and the processing units are used to store the trial velocity values of the corresponding grids and the velocity correction values for the surrounding grids;
[0007] S2: Parallelly calculate the trial velocity values of each grid at the current moment from the velocity field and pressure field information at the initial or previous moment;
[0008] S3: Compute the divergence values of each grid in parallel. If the divergence value of any grid does not meet the convergence condition, compute the pressure correction value, the velocity correction value of itself, and the velocity correction value for the surrounding grids of all grids that do not meet the convergence condition in parallel, and store the velocity correction value for the surrounding grids into the corresponding processing units; Based on the velocity correction value of each grid itself and the velocity correction value generated by the surrounding grids for it, correct the velocity of each grid until all grids meet the convergence condition;
[0009] S4: Repeat the execution of S2 - S3 until the calculation of all time steps is completed.
[0010] Furthermore, step S2 includes: According to the momentum conservation equation, compute the trial velocity values of each grid at the current moment in parallel from the initial or previous moment's velocity field and pressure field information;
[0011] The discrete form of the momentum conservation equation is as follows:
[0012]
[0013]
[0014]
[0015] In the formula, n represents the previous moment, n + 1 represents the current moment, are the trial velocities at the current moment in the three directions respectively, are the velocities at the previous moment in the three directions respectively, δt is the time step, are the pressure values of the grid cells (i,j,k), (i + 1,j,k), (i,j + 1,k), (i,j,k + 1) at the current moment respectively, ρ is the density of the fluid, g x 、g y 、g z are the components of the gravitational acceleration in the three directions, FUX, FUY, FUZ, FVX, FVY, FVZ, FWX, FWY, FWZ are convection terms, VISX1, VISY1, VISZ1 are diffusion terms, and VISX2, VISY2, VISZ2 are source terms.
[0016] Furthermore, in step S3, according to the mass conservation equation, compute the divergence values of each grid in parallel;
[0017] The discrete form of the mass conservation equation is as follows:
[0018]
[0019] The divergence value of the grid cell (i,j,k) is:
[0020]
[0021] In the formula, δx i , δy i , δz k are the lengths of a single grid in the x, y, and z directions, respectively.
[0022] Further, in step S3, if then it is considered that the convergence condition is satisfied, where ε min is the convergence threshold.
[0023] Further, in step S3, before performing velocity correction on the grids that do not satisfy the convergence condition, pressure correction is first performed to make the velocity field of the fluid satisfy the continuity condition through the corrected pressure value. The pressure correction method is as follows:
[0024] p n+1 = p n + δp n
[0025] In the formula, p n+1 , p n are the pressure values at the current time and the previous time, respectively; δP n is the pressure correction amount, where The calculation formula of
[0026]
[0027] Further, in step S3,
[0028]
[0029]
[0030]
[0031] In the formula, is the value after the trial calculation velocity correction of the grid cell (i, j, k) itself, is the velocity correction value of the grid cell (i, j, k) to the surrounding grid cells.
[0032] According to another aspect of the present invention, a parallel computing system for numerical simulation of the casting flow field is provided, including:
[0033] A meshing and initial module, configured to import the flow field model of the casting and perform meshing on the model; according to the number of meshes obtained by meshing, initialize the same number of processing units, and the processing units are used to store the trial calculation velocity values of the corresponding meshes and the velocity correction values for the surrounding meshes;
[0034] A trial velocity calculation module, which is used to parallelly calculate the trial velocity values of each grid at the current moment from the initial or previous moment's velocity field and pressure field information;
[0035] A correction module, which is used to parallelly calculate the divergence values of each grid. If the divergence value of any grid does not meet the convergence condition, it parallelly calculates the pressure correction value of itself, the velocity correction value of itself, and the velocity correction value for the surrounding grids of all grids that do not meet the convergence condition, and stores the velocity correction value for the surrounding grids into the corresponding processing unit; based on the velocity correction value of each grid itself and the velocity correction value generated by the surrounding grids for it, corrects the velocity of each grid until all grids meet the convergence condition;
[0036] A repetition module, which is used to repeatedly execute the trial velocity calculation module and the correction module until the calculation of all time steps is completed.
[0037] According to another aspect of the present invention, there is provided an electronic device, including: a processor; a memory, which stores a computer-executable program, and when the program is executed by the processor, it enables the processor to execute the parallel calculation method for casting flow field numerical simulation as described above.
[0038] According to another aspect of the present invention, there is provided a computer-readable storage medium, on which a computer program is stored, and when the program is executed by a processor, it implements the parallel calculation method for casting flow field numerical simulation as described above.
[0039] Generally speaking, through the above technical solutions conceived by the present invention, the following beneficial effects can be achieved:
[0040] The present invention separates the correction steps of the iterative solution of the nonlinear explicit equations in the casting flow field calculation. Specifically, first, it parallelly calculates the trial velocity values and divergence values of each grid at the current moment; then, it parallelly calculates the pressure correction value of itself, the velocity correction value of itself, and the velocity correction value for the surrounding grids of all grids that do not meet the convergence condition, and stores the velocity correction value for the surrounding grids into the corresponding processing unit to achieve parallel correction; thereby realizing the parallel calculation of the nonlinear explicit solution process, reducing the operation pressure of the main process, making the computer load more balanced, being able to give full play to the performance of the computer, greatly improving the calculation efficiency of the nonlinear explicit solution process in casting flow simulation, being able to greatly shorten the time of the numerical simulation calculation process, and having great significance for the improvement of the performance of casting numerical simulation software. Description of the Drawings
[0041] Figure 1 is a flowchart of the parallel calculation method for casting flow field numerical simulation provided by the present invention;
[0042] Figure 2 This is a schematic diagram of the processing of a certain grid cell by this algorithm when dealing with a two-dimensional model to calculate a single time step. Specific implementation manners
[0043] In order to make the objectives, technical solutions and advantages of the present invention clearer, the present invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not used to limit the present invention. In addition, the technical features involved in the various embodiments of the present invention described below can be combined with each other as long as they do not conflict with each other.
[0044] Refer to Figure 1 , the present invention provides a parallel computing method for numerical simulation of casting flow fields, adopting the idea of separating and parallelly processing the non-linear explicit solution process. This method is applicable to two-dimensional models and three-dimensional models. Refer to Figure 2 , taking the two-dimensional model as an example to illustrate the numerical simulation calculation of the flow field. The specific implementation steps are as follows:
[0045] S1: Initialization of calculation conditions. After importing the data model into the simulation software, perform initial grid meshing on the model, then discretize the mathematical model, and set the corresponding initial conditions and boundary conditions, and gradually solve the discretized model.
[0046] Define the number of processing units according to the number of grids obtained by grid meshing. Without loss of generality, assume that the meshing result contains p×q grid cells, then define p×q Uint i,j units (0≤i<p, 0≤j<q). The "unit" mentioned here is a defined data type, which includes a set of trial velocity values VelocitySet and a set of influence values InfluenceSet, which includes the influence of the unit grid on its surrounding grids.
[0047] S2: Parallelly solve the trial velocity values of each unit according to the momentum conservation equation. The discrete form of the two-dimensional momentum conservation equation is as follows:
[0048]
[0049]
[0050] More specifically, calculate the trial velocity of the grid cell Uint i,j in the subprocess: First, according to the initial conditions or the velocity field and pressure field at the previous moment (n moment), calculate the trial velocity values in two directions of the unit Uint i,j at the current moment (n+1 moment) by the explicit difference format of the momentum conservation equation Subsequently, it is stored in VelocitySet.
[0051] S3: Calculate the divergence of each cell according to the mass conservation equation (continuity equation). For example, take the cell Uint i,j as an example, that is, calculate its divergence The divergence calculation formula for two-dimensional grid cells is as follows:
[0052]
[0053] Use the divergence to judge the convergence. If the divergence value of any grid does not meet the convergence condition, parallelly calculate the pressure correction value and velocity correction value of all cells Uint that do not meet the convergence condition. Similar to the pressure correction method in three-dimensional form, the pressure correction amount in two-dimensional form is as follows: i,j
[0054]
[0055] In the formula, The calculation formula of
[0056]
[0057] After correcting the pressure, correct the velocity of the cell Uint i,j The formula is as follows:
[0058]
[0059] The calculation formula for the velocity correction value of the cell Uint i,j to the surrounding grids is:
[0060]
[0061] Store the velocity correction value to the surrounding grids in the set InfluenceSet as the influence value of this cell on the surrounding cells; parallelly correct the values of each cell. More specifically, allocate the cell Uint i,j in the subprocess, query the influence value of its surrounding grid cell U k on it, that is, search for the influence value of U k on Uint k in the InfluenceSet of the cell U ij Then correct the trial velocity value of Uint k according to the influence value of U i,j on Uint i,j until all grids meet the convergence condition.
[0062] S4: Repeat the execution of S2 - S3 until the calculations for all time steps are completed.
[0063] The present invention also provides a parallel computing system for numerical simulation of the casting flow field, including:
[0064] A meshing and initialization module, configured to import the flow field model of the casting and perform mesh meshing on the model; according to the number of meshes obtained from the mesh meshing, initialize the same number of processing units, where the processing units are used to store the trial velocity values of the corresponding meshes and the velocity correction values for the surrounding meshes;
[0065] A trial velocity calculation module, configured to parallel - calculate the trial velocity values of each mesh at the current moment from the velocity field and pressure field information of the initial or previous moment;
[0066] A correction module, configured to parallel - calculate the divergence values of each mesh. If the divergence value of any mesh does not meet the convergence condition, parallel - calculate the pressure correction values of all non - converging meshes themselves, the velocity correction values of themselves, and the velocity correction values for the surrounding meshes, and store the velocity correction values for the surrounding meshes into the corresponding processing units; based on the velocity correction values of each mesh itself and the velocity correction values generated by the surrounding meshes for it, correct the velocity of each mesh until all meshes meet the convergence condition;
[0067] A repetition module, configured to repeat the execution of the trial velocity calculation module and the correction module until the calculations for all time steps are completed.
[0068] In the embodiments of the present application, the implementation of each module in the parallel computing system for numerical simulation of the casting flow field can be in the form of a computer program. This computer program can run on a terminal or a server. The program module formed by this computer program can be stored in the memory of an electronic device. When this computer program is executed by a processor, the steps of the method described in the embodiments of the present application are implemented.
[0069] The embodiments of the present application also provide a computer - readable storage medium. One or more non - volatile computer - readable storage media containing computer - executable instructions, when the computer - executable instructions are executed by one or more processors, cause the processors to execute the steps of the parallel computing method for numerical simulation of the casting flow field.
[0070] Any reference to memory, storage, database, or other media used in this application may include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory may include random access memory (RAM), which acts as an external cache memory. By way of illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDR SDRAM), enhanced SDRAM (ESDRAM), Synchlink DRAM (SLDRAM), Rambus direct RAM (RDRAM), direct Rambus dynamic RAM (DRDRAM), and Rambus dynamic RAM (RDRAM).
[0071] Those skilled in the art will readily understand that the above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent replacements, and improvements made within the spirit and principles of the present invention should be included within the protection scope of the present invention.
Claims
1. A parallel computing method for numerical simulation of the casting flow field, characterized in that, Including the following steps: S1: Import the flow field model of the casting, and perform mesh division on the model; Initialize the same number of processing units according to the number of meshes obtained from the mesh division. The processing units are used to store the trial velocity values of the corresponding meshes and the velocity correction values for the surrounding meshes; The meshing result contains p×q mesh elements, and p×q Uint i,j elements are defined, where 0 ≤ i < p and 0 ≤ j < q. Each Uint i,j element includes a set of trial velocity values VelocitySet and a set of influence values InfluenceSet; S2: According to the momentum conservation equation, based on the velocity field and pressure field information at the initial or previous moment, calculate the trial velocity values of each grid at the current moment in parallel; the discrete form of the momentum conservation equation is as follows: Where n represents the previous moment and n+1 represents the current moment. are the trial velocities at the current moment in three directions respectively. are the velocities at the previous moment in three directions respectively, and δt is the time step. are the pressure values at the current moment of the grid cells (i,j,k), (i+1,j,k), (i,j+1,k), (i,j,k+1) respectively, ρ is the density of the fluid, and g x and g y and g z are the components of the gravitational acceleration in three directions. FUX, FUY, FUZ, FVX, FVY, FVZ, FWX, FWY, FWZ are convection terms, VISX1, VISY1, VISZ1 are diffusion terms, and VISX2, VISY2, VISZ2 are source terms. In the subprocess, according to the initial conditions or the velocity field and pressure field at the nth moment, the trial velocity values of the unit Uint at the (n+1)th moment are calculated by the explicit difference scheme of the momentum conservation equation. i,j The trial velocity values in two directions are then stored in VelocitySet. S3: According to the mass conservation equation, calculate the divergence values of each grid in parallel. If the divergence value of any grid does not meet the convergence condition, calculate the pressure correction value of the grid itself, the velocity correction value of the grid itself, and the velocity correction value for the surrounding grids of all grids that do not meet the convergence condition in parallel, and store the velocity correction value for the surrounding grids into the corresponding processing unit; Based on the velocity correction value of each grid itself and the velocity correction value generated by the surrounding grids for it, correct the velocity of each grid until all grids meet the convergence condition; the discrete form of the mass conservation equation is as follows: The divergence value of the grid cell (i, j, k) is: where δx i , δy j , δz k are the lengths of a single grid in the x, y, and z directions respectively; allocate the unit Uint i,j in the subprocess, and query the surrounding grid cells U k for their influence values on it, that is, search for the velocity influence value of U k on Uint k in the InfluenceSet of U ij , and then correct the trial velocity value of Uint k according to the magnitude of the influence value of U i,j on Uint i,j until all grids meet the convergence conditions; S4: Repeat the execution of S2 - S3 until the calculation of all time steps is completed.
2. The method according to claim 1, characterized in that, In step S3, if it is considered that the convergence condition is satisfied, where ε min is the convergence threshold.
3. The method according to claim 1, characterized in that, In step S3, before performing velocity correction on the grids that do not meet the convergence condition, first perform pressure correction. By correcting the pressure value, the velocity field of the fluid meets the continuity condition. The pressure correction method is as follows: p n+1 = p n + δp n where p n+1 , p n are the pressure values at the current moment and the previous moment respectively; δP n is the pressure correction amount, wherein, the calculation formula of 4. The method according to claim 3, characterized in that, In step S3, In the formula, is the value after self-trial speed correction of the grid cell (i, j, k), is the speed correction value of the grid cell (i, j, k) to the surrounding grid cells.
5. A parallel computing system for numerical simulation of the casting flow field, characterized in that, Including: Meshing and initial module, used to import the flow field model of the casting, perform meshing on the model; according to the number of grids obtained by meshing, initialize the same number of processing units, and the processing units are used to store the trial velocity values of the corresponding grids and the velocity correction values for the surrounding grids; Trial velocity calculation module, used to calculate the trial velocity values of each grid at the current moment in parallel according to the momentum conservation equation, based on the velocity field and pressure field information at the initial or previous moment; the discrete form of the momentum conservation equation is as follows: where n represents the previous moment and n + 1 represents the current moment, which are the trial velocities at the current moment in three directions respectively, which are the velocities at the previous moment in three directions respectively, and δt is the time step, which are the pressure values at the current moment of the grid cells (i, j, k), (i + 1, j, k), (i, j + 1, k), (i, j, k + 1) respectively, ρ is the density of the fluid, g x and g y and g z are the components of the gravitational acceleration in three directions, FUX, FUY, FUZ, FVX, FVY, FVZ, FWX, FWY, FWZ are convection terms, VISX1, VISY1, VISZ1 are diffusion terms, and VISX2, VISY2, VISZ2 are source terms; Correction module, used to calculate the divergence values of each grid in parallel according to the mass conservation equation. If the divergence value of any grid does not meet the convergence condition, calculate the pressure correction value of the grid itself, the velocity correction value of the grid itself, and the velocity correction value for the surrounding grids of all grids that do not meet the convergence condition in parallel, and store the velocity correction value for the surrounding grids into the corresponding processing unit; Based on the velocity correction value of each grid itself and the velocity correction value generated by the surrounding grids for it, correct the velocity of each grid until all grids meet the convergence condition; the discrete form of the mass conservation equation is as follows: The divergence value of the grid cell (i, j, k) is: where δx i and δy j and δz k are the lengths of a single grid in the x, y, and z directions, respectively; Repeat module, used to repeat the execution of the trial velocity calculation module and the correction module until the calculation of all time steps is completed.
6. An electronic device, characterized in that, Including: Processor; Memory, which stores a computer - executable program. When the program is executed by the processor, the processor executes the parallel calculation method for numerical simulation of the casting flow field as described in any one of claims 1 - 4.
7. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the program is executed by the processor, it implements the parallel calculation method for numerical simulation of the casting flow field as described in any one of claims 1 - 4.