Simulation methods and electronic devices for physical systems

By discretizing objects into basic geometric units and constructing a dual-scale contact constraint model, the coupling problem between different types of objects is solved and efficient physical system simulation is achieved.

CN115408733BActive Publication Date: 2025-10-03PEKING UNIV +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210803437.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-07-07
Publication Date
2025-10-03
Estimated Expiration
2042-07-07

AI Technical Summary

Technical Problem

The existing holistic and partitioning methods cannot effectively solve the coupling problem between different types of objects.

Method used

Each object is discretized into multiple geometric basic units, and a model of the physical system is constructed through dual-scale contact constraints and linear complementary problem models. The state variables are solved using the Lagrangian solver and linear interpolation algorithm to handle the interactions between rigid bodies, deformable objects and fluids.

Benefits of technology

It achieves the simultaneous processing of coupling problems between different types of objects, improves the efficiency and accuracy of the simulation method, and is suitable for the simulation of various physical systems.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115408733B_ABST
    Figure CN115408733B_ABST
Patent Text Reader

Abstract

The present invention discloses a simulation method and electronic device for physical systems, relating to the field of computer graphics. The simulation method includes: discretizing each object into multiple geometric primitives according to preset rules; obtaining a first state variable of the physical system at a first moment; performing collision detection on the geometric primitives in the physical system to obtain the contact occurring in the physical system at the first moment; constructing a model of the physical system based on the first state variable of the physical system at the first moment; constructing constraints for the physical system based on the first state variable of the physical system at the first moment and the contact occurring in the physical system at the first moment; the constraints of the physical system including at least a two-scale contact constraint; and solving the model based on the constraints of the physical system to obtain the first state variable of the physical system at a second moment. This simulation method and electronic device can solve the problem of handling interactions between multiple objects.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of computer graphics, and more particularly, to a simulation method and electronic device for a physical system. Background Art

[0002] In the computer graphics community, numerical solutions to multiphysics coupling problems can be broadly categorized into two types: global and partitioned approaches. Global approaches aim to solve a single set of equations for the entire problem by treating the dynamics of each object within the same mathematical framework, while partitioned approaches address the coupling problem by splitting the equations and solving the dynamics of each domain sequentially. Current global and partitioned approaches are not suitable for solving coupling problems between different types of objects. Summary of the Invention

[0003] An object of the present disclosure is to provide a simulation method and electronic device for a physical system, which can solve the coupling problem between different types of objects.

[0004] According to the first aspect of the present disclosure, a simulation method for a physical system is provided. The physical system includes multiple objects, and the method includes: discretizing each object into multiple geometric basic units according to a preset rule; obtaining a first state variable of the physical system at a first moment; wherein the first state variable of the physical system includes the state variable of the center of the object and the state variable of the center of the geometric basic unit; performing collision detection on the geometric basic units in the physical system to obtain the contact occurring in the physical system at the first moment; constructing a model of the physical system based on the first state variable of the physical system at the first moment; constructing constraints of the physical system based on the first state variable of the physical system at the first moment and the contact occurring in the physical system at the first moment; the constraints of the physical system include at least a dual-scale contact constraint, wherein the dual-scale contact constraint is a constraint based on both the global scale and the local scale for the contact; solving the model based on the constraints of the physical system to obtain the first state variable of the physical system at a second moment; wherein the second moment is the moment after the first moment.

[0005] Optionally, each object is discretized into multiple geometric basic units according to preset rules, including: discretizing the fluid into multiple groups of fluid particles, each group of fluid particles includes a first fluid particle and a second fluid particle with the same spherical center, the first fluid particle is a sphere with a first radius, the second fluid particle is a sphere with a second radius, and the second radius is greater than the first radius; discretizing filamentous objects into line segments, and deleting overlapping contact points between adjacent line segments; discretizing two-dimensional non-filamentous objects into triangles; discretizing three-dimensional solids into tetrahedrons, and embedding an unsigned distance field at the vertices of the tetrahedrons; and discretizing rigid objects into cubes.

[0006] Optionally, obtaining the first state variable of the physical system at the first moment includes: calling a Lagrangian solver to calculate the second state variable of the physical system at the first moment; wherein the second state variable of the physical system includes the state variables of the vertices of the geometric basic unit; according to the state variables of the vertices of the geometric basic unit at the first moment, using a linear interpolation algorithm to determine the state variable of the center of the geometric basic unit at the first moment; according to the state variables of the center of the geometric basic unit at the first moment, using a linear interpolation algorithm to determine the state variable of the center of the object at the first moment.

[0007] Optionally, solving the model based on the constraints of the physical system to obtain the first state variable of the physical system at the second moment includes: solving the model based on the constraints of the physical system to obtain the state variable of the center of the object at the second moment, and the relative state variable of the center of the geometric basic unit at the second moment; superimposing the state variable of the center of the object at the second moment to the relative state variable of the center of the geometric basic unit at the second moment to obtain the state variable of the center of the geometric basic unit at the second moment.

[0008] Optionally, after obtaining the first state variable of the physical system at the second moment, the method further includes: determining the state variable of the vertex of the geometric basic unit at the second moment according to the state variable of the center of the geometric basic unit at the second moment.

[0009] Optionally, obtaining a model of the physical system includes: obtaining an LCP model of the physical system.

[0010] Optionally, the dual-scale contact constraints of the physical system at the first moment include:

[0011]

[0012]

[0013]

[0014]

[0015] in:

[0016] i represents a geometric unit involved in contact, I represents the object to which geometric unit i belongs; j represents another geometric unit involved in contact, J represents the object to which geometric unit j belongs; the symbol "T" represents the transposition operation; M i is the mass matrix of geometric unit i; M I is the mass matrix of object I; M j is the mass matrix of geometric unit j; M Jis the mass matrix of object J; V′ i is the first-order derivative of the generalized velocity vector of geometric unit i; V′ I is the first-order derivative of the generalized velocity vector of object I; V′ j is the first-order derivative of the generalized velocity vector of the geometric unit j; V′ J is the first-order derivative of the generalized velocity vector of object J; Y i Y is the Jacobian matrix defined based on the center of the geometric basic unit i; I Y is the Jacobian matrix defined based on the center of object I; j Y is the Jacobian matrix defined based on the center of the geometric basic unit j; J is the Jacobian matrix defined based on the center of object J; w I is the global constraint weight of object I, w J is the global constraint weight of object J, and λ is the constraint force vector.

[0017] Optionally, the global constraint weight w of the object is determined by the following formula,

[0018]

[0019] Where E is the Young's modulus of the object, Δt is the preset time step, and δ is δ = 5×10 -5 .

[0020] Optionally, the constraints of the physical system further include a non-penetration constraint of the physical system at the first moment, and / or a friction constraint of the physical system at the first moment.

[0021] According to a second aspect of the present disclosure, an electronic device is provided, comprising a memory and a processor, wherein the memory is used to store a computer program; and the processor is used to execute the computer program to implement the physical system-oriented simulation method described in any one of the first aspects of the present disclosure.

[0022] According to the simulation method and electronic device for physical systems of the embodiments of the present disclosure, each object can be discretized into its corresponding type of geometric basic unit, so that the method can simultaneously handle the interaction between rigid bodies, deformable objects and fluids, thereby solving the coupling problem between different types of objects.

[0023] Other features and advantages of the present disclosure will become apparent from the following detailed description of exemplary embodiments of the present disclosure with reference to the accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS

[0024] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments of the present disclosure and, together with the description, serve to explain the principles of the present disclosure.

[0025] Figure 1 is a flow chart of a simulation method for a physical system according to an embodiment of the present disclosure;

[0026] Figure 2(a)-2(e) is a schematic diagram of discretization into geometric basic units according to an embodiment of the present disclosure;

[0027] Figure 3 is a block diagram of an electronic device according to an embodiment of the present disclosure. DETAILED DESCRIPTION

[0028] Various exemplary embodiments of the present disclosure will now be described in detail with reference to the accompanying drawings. It should be noted that unless otherwise specifically stated, the relative arrangement of components and steps, numerical expressions and numerical values ​​set forth in these embodiments do not limit the scope of the present disclosure.

[0029] The following description of at least one exemplary embodiment is merely illustrative in nature and is in no way intended to limit the present disclosure, its application, or uses.

[0030] Technologies, methods, and equipment known to ordinary technicians in the relevant art may not be discussed in detail, but where appropriate, the technologies, methods, and equipment should be considered part of the specification.

[0031] In all examples shown and discussed herein, any specific values ​​should be interpreted as merely exemplary and not limiting. Therefore, other examples of the exemplary embodiments may have different values.

[0032] It should be noted that like reference numerals and letters refer to like items in the following figures, and therefore, once an item is defined in one figure, it need not be further discussed in subsequent figures.

[0033] The embodiments of the present disclosure provide a simulation method for a physical system, which can be applied to a physical system having multiple objects. For example, a physical system includes a water flow and a sphere floating in the water flow, where both the water flow and the sphere are objects in the physical system.

[0034] The physical system-oriented simulation method includes steps S201-S206:

[0035] Step S201: discretize each object into a plurality of geometric basic units according to preset rules.

[0036] Step S202: Obtain a first state variable of the physical system at a first moment.

[0037] Step S203: perform collision detection on the geometric basic units in the physical system to obtain the contact that occurs in the physical system at the first moment.

[0038] Step S204: construct a model of the physical system according to the first state variable of the physical system at the first moment.

[0039] Step S205: Constructing constraints for the physical system based on the first state variable of the physical system at the first moment and the contact occurring in the physical system at the first moment. The constraints for the physical system include at least a dual-scale contact constraint, where the dual-scale contact constraint is a constraint on the contact based on both a global scale and a local scale.

[0040] Step S206: Solve the model based on the constraints of the physical system to obtain a first state variable of the physical system at a second moment, where the second moment is a moment after the first moment.

[0041] In the embodiment of the present disclosure, the next moment of the current moment is determined with a preset duration as the time step, that is, the next moment is one time step later than the current moment, and the second moment is one time step later than the first moment.

[0042] In the disclosed embodiments, the first state variables of the physical system include the state variables of the center of the object and the state variables of the center of the geometric primitive. The state variables of the center of the object specifically include the position, linear velocity, angular velocity, and mass matrix of the object center. The state variables of the center of the geometric primitive specifically include the position, linear velocity, angular velocity, and mass matrix of the geometric primitive.

[0043] That is to say, in the embodiment of the present disclosure, the state variables of the center of the object at the first moment and the state variables of the center of the geometric basic unit at the first moment are used to predict the state variables of the center of the object at the second moment and the state variables of the center of the geometric basic unit at the second moment.

[0044] In the embodiment of the present disclosure, the geometric basic units include target spheres, line segments, triangles, tetrahedrons, and cubes. In step S201, each object is discretized into multiple geometric basic units according to a preset rule, which may include:

[0045] The fluid is discretized into multiple groups of fluid particles, each group of fluid particles includes a first fluid particle and a second fluid particle with the same spherical center. The first fluid particle is a sphere with a first radius, and the second fluid particle is a sphere with a second radius, wherein the second radius is greater than the first radius. As shown in Figure 2(a), the sphere corresponding to radius h is the first fluid particle, and the sphere corresponding to radius H is the second fluid particle, and the radius of the second fluid particle is greater than the radius of the first fluid particle. Decomposing the fluid into first fluid particles with a smaller radius is beneficial for calculating non-penetration constraints. Decomposing the fluid into second fluid particles with a larger radius is beneficial for calculating friction constraints and can reflect the viscosity of the fluid.

[0046] Discretize the filamentary object into line segments and delete the overlapping contact points between adjacent line segments. During discretization, adjacent line segments may overlap. To avoid erroneous collision detection and response, overlapping contact points can be deleted in the disclosed embodiment. As shown in Figure 2(b), line segment 1 is x0-x1, and line segment 2 is x0-x2. Delete the overlapping contact point x0 of these two line segments. After deletion, line segment 1 no longer contains the point x0, and line segment 2 no longer contains the point x0.

[0047] As shown in Figure 2(c), a two-dimensional non-filamentary object is discretized into triangles. For example, a cloth surface or a planar shell can be discretized into triangles.

[0048] As shown in Figure 2(d), the three-dimensional solid is discretized into tetrahedrons. In the embodiment of the present disclosure, an unsigned distance field can be embedded in the vertices of the tetrahedron to improve the robustness of the simulation process.

[0049] As shown in Figure 2(e), rigid objects are discretized into cubes. For example, obstacles or static boundaries can be discretized into cubes.

[0050] According to the simulation method of the embodiment of the present disclosure, each object can be discretized into its corresponding type of geometric basic unit, so that the simulation method can simultaneously process the interaction between rigid bodies, deformable objects and fluids, thereby solving the coupling problem between different types of objects.

[0051] <Black box independent solution state variables>

[0052] For step S202, obtaining the first state variable of the physical system at the first moment may include steps S2021-S2023.

[0053] Step S2021: Call the Lagrangian solver to calculate the second state variable of the physical system at the first moment. The second state variable of the physical system includes the state variables of the vertices of the geometric basic unit.

[0054] In this step, each object in the physical system can be treated as an isolated black box. The Lagrangian solver is called separately to solve its dynamics problem using the dynamics algorithm corresponding to the object's type, thereby determining the state variables of the vertices of each geometric unit in the object at the first moment. For example, if an object is an elastic body, the Lagrangian solver is called using the dynamics algorithm for elastic bodies to calculate the state variables of the vertices of each geometric unit in the object at the first moment. Since each object is treated as an isolated black box, the independence between solver modules is high, which facilitates code reuse.

[0055] The state variables of the vertices of the geometric basic unit may include the linear velocity, angular velocity, quaternion and inertia matrix of the vertices of the geometric basic unit.

[0056] Step S2022: Determine the state variable of the center of the geometric basic unit at the first moment using a linear interpolation algorithm according to the state variables of the vertices of the geometric basic unit at the first moment.

[0057] Step S2023: Determine the state variable of the center of the object at the first moment using a linear interpolation algorithm according to the state variable of the center of the geometric basic unit at the first moment.

[0058] In step S203 , collision detection is performed on the geometric basic units in the physical system to obtain the contact occurring in the physical system at the first moment.

[0059] In the disclosed embodiments, collision detection involves detecting interactions between geometric primitives in a physical system. Through collision detection, the first contact point in the physical system is determined. Specifically, for each contact point, the position of the contact point, the linear velocity of the geometric primitives involved in the contact, and the orientation of each geometric primitive involved in the contact are determined. The velocity used in subsequent dual-scale constraints, non-penetration constraints, and friction constraints can be linear velocity.

[0060] For fluid objects, discrete second fluid particles can be selected for collision detection. The second fluid particles and first fluid particles share the same sphere center. If the second fluid particles are detected as not in contact, it can be determined that their corresponding first fluid particles are also not in contact. If contact is detected between the second fluid particles, the contact locations of the second fluid particles can be used to infer whether their corresponding first fluid particles are in contact. For fluid objects, selecting discrete second fluid particles with larger radii for collision detection can reduce the time overhead of collision detection.

[0061] In step S204, an LCP (Linear Complementarity Problem) model of the physical system is constructed according to the first state variable of the physical system at the first moment.

[0062] In the embodiment of the present disclosure, the physical system can be expressed as a linear complementation problem (LCP), resulting in the following LCP model:

[0063] M(s)s”=f(s,s')+Y T λ

[0064]

[0065] s'=Qv

[0066] u T z=0

[0067] u≡Yv+b≥0

[0068] z≡Pλ+c≥0

[0069] In the above LCP model formula:

[0070] The symbol “T” represents a transpose operation. The symbol “≡” represents identity.

[0071] s is the generalized state vector of the geometric unit in matrix form. In three-dimensional space, the generalized state vector s includes the vector x representing the position and the quaternion q representing the rotation. R is a common notation, R 7 This means that s is a 7-dimensional vector.

[0072] s' is the first-order derivative of s, and s" is the second-order derivative of s. s and the first-order derivative of s' are initialized at the beginning of each time step. The generalized state vector s is a 7-dimensional vector, while the generalized velocity vector v has only six degrees of freedom (three for translation and three for rotation). The transformation matrix Q can be used to map v to the first-order derivative of s, that is, s'=Qv. Q is the transformation matrix from quaternion to Euler space angle, which is a 7×6 matrix.

[0073] M() is the mass matrix function of the geometric basic unit, and its calculation result is the mass matrix of the geometric basic unit. f() is the generalized force vector function, and the calculation result of f() is the interaction force between the geometric basic units.

[0074] Y represents the Jacobian matrix. λ is the constraint force vector. u and z are two intermediate variables. v is the generalized velocity vector. P is the inverse matrix of the product of the Jacobian matrix of the geometric unit and the mass matrix. b is the preset first correction parameter, which can be set by the user according to different application scenarios. c is the preset second correction parameter, which can be set by the user according to different application scenarios. The symbol "T" represents the transpose operation.

[0075] In this embodiment, the physical system is formulated as a linear complementation problem, which allows for simultaneous dynamic modeling of different geometric units, thus improving overall efficiency.

[0076] In step S205 , a dual-scale contact constraint of the physical system is constructed according to the first state variable of the physical system at the first moment and the contact occurring with the physical system at the first moment.

[0077] The two-scale contact constraints of the physical system include:

[0078]

[0079]

[0080]

[0081]

[0082] In the above two-scale contact constraint formula:

[0083] i represents a geometric unit involved in contact, and I represents the object to which geometric unit i belongs. j represents another geometric unit involved in contact, and J represents the object to which geometric unit j belongs. The symbol "T" represents a transpose operation.

[0084] M i is the mass matrix of geometric unit i. I is the mass matrix of object I. M j is the mass matrix of geometric unit j. J is the mass matrix of object J.

[0085] V′ i is the first-order derivative of the generalized velocity vector of geometric unit i. V′ I is the first-order derivative of the generalized velocity vector of object I. V′ j V′ is the first-order derivative of the generalized velocity vector of the geometric unit j. J is the first-order derivative of the generalized velocity vector of object J.

[0086] Y i Y is the Jacobian matrix defined based on the center of the geometric unit i. I Y is the Jacobian matrix defined based on the center of object I. j Y is the Jacobian matrix defined based on the center of the geometric unit j. J The Jacobian matrix defined based on the center of object J.

[0087] w I is the global constraint weight of object I. J is the global constraint weight of object J. λ is the constraint force vector.

[0088] The value of the global constraint w of the object is between 0 and 1. Modifying its value can control the stiffness of the material. If w is set to 0, only the original scale dynamic results are solved; if w is set to 1, each object is treated as a rigid body for solution. In order to ensure the propagation of strain inside the deformation, the time step must be less than the minimum transmitted wave period. However, calculations with small time steps are slow, and it is hoped that the time step should not be too small. In order to alleviate the conflicting requirements on the step size, a weight coefficient δ is proposed in the embodiment of the present disclosure.

[0089] For any object, the global constraint weight of the object is determined by the following formula, taking into account the stiffness and time step of the object:

[0090]

[0091] Where E is the Young's modulus of the object, Δt is the time step, and the weight coefficient δ is a positive value, set to δ = 5×10 -5 , e is a natural constant.

[0092] In this embodiment, the constraints of the physical system include dual-scale constraints, which take into account the constraints of geometric basic units and objects at the same time, and can alleviate the propagation speed difference caused by increasing the time step. At the same time, the global constraint variable w is introduced as a parameter, allowing users to adjust the hardness of the elastic body according to their desired effect.

[0093] In one example, the constraints of the physical system further include non-penetration constraints of the physical system.

[0094] In step S205 , a non-penetration constraint of the physical system is constructed according to the first state variable of the physical system at the first moment and the contact occurring between the physical system and the physical system at the first moment.

[0095] The non-penetration constraint of the physical system is:

[0096]

[0097]

[0098]

[0099]

[0100] In the above non-penetration constraint formula:

[0101] i represents a geometric unit involved in contact, and I represents the object to which geometric unit i belongs. j represents another geometric unit involved in contact, and J represents the object to which geometric unit j belongs. The symbol "T" represents the transpose operation.

[0102] Y n,i Y is the Jacobian matrix of geometric element i in the contact direction. n,I Y is the Jacobian matrix of object I in the contact direction. n,j Y is the Jacobian matrix of geometric basic unit j in the contact direction. n,J is the Jacobian matrix of object J in the contact direction.

[0103] n iis the unit vector in the contact direction of geometric unit i. j is the unit vector in the contact direction of geometric unit j.

[0104] r i,1 is the vector from the center of geometric unit i to the contact point. I,1 is the vector from the center of object I to the contact point. j,1 is the vector from the center of geometric unit j to the contact point. J,1 is the vector from the center of object J to the contact point.

[0105] For fluid objects, the larger the radius used for processing non-penetration, the slower the calculation. In this embodiment, for fluid objects, the first fluid particles with a smaller discrete radius can be selected to participate in constructing the above-mentioned non-penetration constraint, thereby ensuring accuracy while reducing calculation overhead.

[0106] In this embodiment, the constraints of the physical system also include non-penetration constraints of the physical system at the first moment, and include non-penetration constraints at two scales: object and geometric unit, which can make the prediction result more accurate.

[0107] In one example, the constraints of the physical system further include friction constraints of the physical system.

[0108] In step S205 , a friction constraint of the physical system is constructed according to the first state variable of the physical system at the first moment and the contact that occurs with the physical system at the first moment.

[0109] The friction constraint of the physical system is:

[0110]

[0111]

[0112]

[0113]

[0114]

[0115] In the above friction constraint formula:

[0116] i represents a geometric unit involved in contact, and I represents the object to which geometric unit i belongs. j represents another geometric unit involved in contact, and J represents the object to which geometric unit j belongs. The symbol "T" represents the transpose operation.

[0117] V i V is the velocity vector of geometric unit i in the contact direction.I V is the velocity vector of object I in the contact direction. j V is the velocity vector of the geometric unit j in the contact direction. J is the velocity vector of object J in the contact direction.

[0118] is the geometric basic unit i in τ 1 The Jacobian matrix in the direction, is the geometric basic unit i in τ 2 Jacobian matrix in the direction. is the geometric basic unit j in τ 1 The Jacobian matrix in the direction, is the geometric basic unit j in τ 2 Jacobian matrix in the direction. is the object I at τ 1 Jacobian matrix in the direction. is the object I at τ 2 Jacobian matrix in the direction. For object J at τ 1 Jacobian matrix in the direction. For object J at τ 2 Jacobian matrix in the direction.

[0119] r i,1 is the vector from the center of geometric unit i to the contact point. I,1 is the vector from the center of object I to the contact point. j,1 is the vector from the center of geometric unit j to the contact point. J,1 is the vector from the center of object J to the contact point.

[0120] w I Represents the global constraint weight of object I. w J Represents the global constraint weight of object J. τ 1 and τ 2 are two unit vectors perpendicular to the contact direction, which can be determined based on the results of collision detection. τ is 0.

[0121] In the embodiment of the present disclosure, when solving the friction constraint, the projected Jacobi method can be used for solution.

[0122] In this embodiment, for a fluid object, second fluid particles with a larger discretized radius may be selected to participate in the friction constraint, thereby reducing computational overhead while ensuring accuracy.

[0123] In this embodiment, the constraints of the physical system also include the friction constraints of the physical system at the first moment, and include friction at two scales: object and geometric unit, which can make the prediction result more accurate.

[0124] <Solve the state variables for the next time step>

[0125] In one example, step S206 , solving the model based on the constraints of the physical system to obtain a first state variable of the physical system at the second moment, may include steps S2061 - S2062 .

[0126] Step S2061: Solve the model based on the constraints of the physical system to obtain the state variables of the center of the object at the second moment and the relative state variables of the center of the geometric basic unit at the second moment.

[0127] In the disclosed embodiment, the relative state variable of the center of the geometric basic unit refers to the state variable of the center of the geometric basic unit relative to a reference point, where the reference point is the center of the object to which the geometric basic unit belongs.

[0128] Step S2062: Superimpose the state variable of the center of the object at the second moment onto the relative state variable of the center of the geometric basic unit at the second moment to obtain the state variable of the center of the geometric basic unit at the second moment.

[0129] In the first approach, after obtaining the first state variable of the physical system at the second moment in step S206, the first state variable of the physical system at the third moment can be predicted based on a similar approach as described in steps S203-S206. The third moment is a moment after the second moment, i.e., one time step later than the second moment.

[0130] In the second manner, after obtaining the first state variable of the physical system at the second moment in step S206, step S207 may be further included.

[0131] Step S207: Determine the state variables of the vertices of the geometric unit at the second moment based on the state variables of the center of the geometric unit at the second moment. In step S207, an interpolation method such as a FLIP (Fluid-Implicit-Particle) algorithm can be used to determine the state variables of the vertices of the geometric unit at the second moment based on the state variables of the center of the geometric unit at the second moment.

[0132] After determining the state variables of the vertices of the geometric basic unit at the second moment in step S207, the state variables of the vertices of the geometric basic unit at the second moment determined in step S207 are used as an input of the Lagrangian solver, and the state variables of the vertices of the geometric basic unit at the second moment are re-determined based on a method similar to step S2021; after re-determining the state variables of the vertices of the geometric basic unit at the second moment, the first state variables of the physical system at the second moment are again determined based on a method similar to steps S2022-2023.

[0133] After the first state variable of the physical system at the second moment is determined again, the first state variable of the physical system at the third moment can be predicted based on a similar method to steps S203-S206 described above. The third moment is a moment after the second moment, that is, the third moment is one time step later than the second moment.

[0134] In the disclosed embodiments, the state variables of the physical system at several subsequent time steps can be predicted using the two aforementioned methods. In the second method, by invoking a Lagrangian solver to redetermine the state variables of the vertices of the geometric primitives at the second time step, the error in the previous prediction process can be reduced, making subsequent prediction results more accurate.

[0135] The physical system simulation method proposed in the embodiments of this disclosure is computer-based. Each object can be discretized into its corresponding geometric basic unit, allowing the system to simultaneously handle the interactions between rigid bodies, deformable objects, and fluids. Furthermore, each solver is treated as a black box, and the modules are highly independent, facilitating code reuse.

[0136] The physical system-oriented simulation method proposed in the embodiment of the present disclosure proposes a dual-scale contact constraint, which can control the stiffness of each multi-physics module separately.

[0137] The physical system-oriented simulation method proposed in the embodiments of the present disclosure expands the constraint conditions and introduces non-penetration constraints and friction constraints to uniformly establish the relationship between solid-solid and flow-solid interactions.

[0138] The physical system-oriented simulation method proposed in the embodiments of the present disclosure can be applied to the simulation calculation of the interaction between physical objects of different materials in computer animation, virtual surgery, computer-aided engineering, etc., such as the special effects of floods impacting trees (elastic bodies) and bricks (rigid bodies) in animation scenes; calculating the interaction forces between blood (fluid) and organs (elastic bodies) and tools (rigid bodies) in virtual surgery; simulating the interaction between propeller blades (rigid bodies) and airflow (fluid) in engineering design, etc. Compared with previous methods, the physical system-oriented simulation method proposed in the embodiments of the present disclosure can calculate corresponding results for different object materials, is compatible with more simulation methods, and can obtain results that are closer to reality for different time steps.

[0139] In this embodiment, an electronic device is also provided for implementing the physical system simulation method of any embodiment of the present disclosure. Figure 3 As shown, the electronic device 5000 may further include a processor 5200 and a memory 5100, wherein the memory 5100 is used to store computer programs, and the processor 5200 is used to execute the computer programs to implement the physical system-oriented simulation method of any embodiment of the present disclosure.

[0140] In the embodiment of the present disclosure, the processor 5200 provides a setting interface for each parameter that can be set by the user, so that the user can set it according to his or her own needs.

[0141] In this embodiment, a computer-readable storage medium is also provided, which stores a computer program that can be read and executed by a computer. When read and executed by the computer, the computer program is used to execute a simulation method for a physical system as in any embodiment of the present disclosure.

[0142] In this embodiment, a chip is also provided, which includes a processor and a memory, the memory is used to store a computer program, and the processor is used to execute the computer program to implement the physical system-oriented simulation method of any embodiment of the present disclosure.

[0143] The present disclosure may be a system, method and / or computer program product. The computer program product may include a computer-readable storage medium carrying computer-readable program instructions for causing a processor to implement various aspects of the present disclosure.

[0144] A computer-readable storage medium can be a tangible device that can hold and store instructions for use by an instruction execution device. A computer-readable storage medium can be, for example, but not limited to, an electrical storage device, a magnetic storage device, an optical storage device, an electromagnetic storage device, a semiconductor storage device, or any suitable combination thereof. More specific examples (a non-exhaustive list) of computer-readable storage media include: a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), a static random access memory (SRAM), a portable compact disc read-only memory (CD-ROM), a digital versatile disk (DVD), a memory stick, a floppy disk, a mechanical encoding device, such as a punch card or a raised structure in a groove on which instructions are stored, and any suitable combination thereof. As used herein, a computer-readable storage medium is not to be construed as a transient signal per se, such as a radio wave or other freely propagating electromagnetic wave, an electromagnetic wave propagating through a waveguide or other transmission medium (e.g., a light pulse through a fiber optic cable), or an electrical signal transmitted through an electrical wire.

[0145] The computer-readable program instructions described herein can be downloaded from a computer-readable storage medium to each computing / processing device, or downloaded to an external computer or external storage device via a network, such as the Internet, a local area network, a wide area network, and / or a wireless network. The network can include copper transmission cables, fiber optic transmission, wireless transmission, routers, firewalls, switches, gateway computers, and / or edge servers. The network adapter card or network interface in each computing / processing device receives the computer-readable program instructions from the network and forwards the computer-readable program instructions to be stored in the computer-readable storage medium in each computing / processing device.

[0146] The computer program instructions for performing the operations of the present disclosure may be assembly instructions, instruction set architecture (ISA) instructions, machine instructions, machine-dependent instructions, microcode, firmware instructions, state setting data, or source code or object code written in any combination of one or more programming languages, including object-oriented programming languages ​​such as Smalltalk, C++, and conventional procedural programming languages ​​such as "C" language or similar programming languages. Computer-readable program instructions may be executed entirely on a user's computer, partially on a user's computer, as an independent software package, partially on a user's computer, partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer via any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., utilizing an Internet service provider to connect via the Internet). In some embodiments, an electronic circuit, such as a programmable logic circuit, a field programmable gate array (FPGA), or a programmable logic array (PLA), may be personalized by utilizing the state information of the computer-readable program instructions. The electronic circuit may execute the computer-readable program instructions, thereby realizing various aspects of the present disclosure.

[0147] Various aspects of the present disclosure are described herein with reference to flowcharts and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the present disclosure. It should be understood that each block of the flowcharts and / or block diagrams, and combinations of blocks in the flowcharts and / or block diagrams, can be implemented by computer-readable program instructions.

[0148] These computer-readable program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, thereby producing a machine, so that when these instructions are executed by the processor of the computer or other programmable data processing device, a device is generated that implements the functions / actions specified in one or more blocks in the flowchart and / or block diagram. These computer-readable program instructions can also be stored in a computer-readable storage medium, where these instructions cause the computer, programmable data processing device, and / or other device to operate in a specific manner. Thus, the computer-readable medium storing the instructions comprises an article of manufacture that includes instructions for implementing various aspects of the functions / actions specified in one or more blocks in the flowchart and / or block diagram.

[0149] Computer-readable program instructions may also be loaded onto a computer, other programmable data processing apparatus, or other device so that a series of operational steps are performed on the computer, other programmable data processing apparatus, or other device to produce a computer-implemented process, thereby causing the instructions executed on the computer, other programmable data processing apparatus, or other device to implement the functions / actions specified in one or more blocks in the flowchart and / or block diagram.

[0150] The flowcharts and block diagrams in the accompanying drawings show the possible implementation architecture, functions and operations of the systems, methods and computer program products according to multiple embodiments of the present disclosure. In this regard, each box in the flowchart or block diagram can represent a module, program segment or part of an instruction, and the module, program segment or part of the instruction contains one or more executable instructions for implementing the specified logical function. In some alternative implementations, the functions marked in the box can also occur in an order different from that marked in the accompanying drawings. For example, two consecutive boxes can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flowchart, and the combination of boxes in the block diagram and / or flowchart, can be implemented by a dedicated hardware-based system that performs the specified function or action, or can be implemented by a combination of dedicated hardware and computer instructions. It is well known to those skilled in the art that implementation by hardware, implementation by software, and implementation by a combination of software and hardware are all equivalent.

[0151] The embodiments of the present disclosure have been described above. The above description is exemplary, not exhaustive, and is not limited to the disclosed embodiments. Many modifications and variations will be apparent to those skilled in the art without departing from the scope and spirit of the described embodiments. The terms used herein are selected to best explain the principles of the embodiments, their practical applications, or technical improvements in the marketplace, or to enable other persons skilled in the art to understand the embodiments disclosed herein. The scope of the present disclosure is defined by the appended claims.

Claims

1. A simulation method for a physical system, characterized in that: The physical system includes a plurality of objects, and the method includes: According to the preset rules, each object is discretized into multiple geometric basic units; Acquire a first state variable of the physical system at a first moment; wherein the first state variable of the physical system includes a state variable of the center of the object and a state variable of the center of the geometric basic unit; Perform collision detection on geometric basic units in the physical system to obtain the contact that occurs in the physical system at the first moment; constructing a model of the physical system according to a first state variable of the physical system at a first moment; Constructing a constraint of the physical system based on a first state variable of the physical system at a first moment and the contact occurring in the physical system at the first moment; the constraint of the physical system at least includes a dual-scale contact constraint, wherein the dual-scale contact constraint is a constraint based on both a global scale and a local scale for the contact; The model is solved based on the constraints of the physical system to obtain a first state variable of the physical system at a second moment; wherein the second moment is a moment after the first moment.

2. The simulation method according to claim 1, wherein: According to the preset rules, each object is discretized into multiple geometric basic units, including: Discretize the fluid into multiple groups of fluid particles, each group of fluid particles includes a first fluid particle and a second fluid particle having the same spherical center, the first fluid particle is a sphere with a first radius, the second fluid particle is a sphere with a second radius, and the second radius is greater than the first radius; Discretize the filamentous object into line segments and delete the overlapping contact points between adjacent line segments; Discretize two-dimensional non-filamentary objects into triangles; Discretize the 3D solid into tetrahedrons and embed an unsigned distance field on the vertices of the tetrahedrons; Discretize rigid objects into cubes.

3. The method according to claim 1, characterized in that The obtaining of a first state variable of the physical system at a first moment includes: Invoking a Lagrangian solver to calculate a second state variable of the physical system at a first moment; wherein the second state variable of the physical system includes state variables of vertices of the geometric basic unit; Determine the state variable of the center of the geometric basic unit at the first moment using a linear interpolation algorithm according to the state variable of the vertex of the geometric basic unit at the first moment; According to the state variable of the center of the geometric basic unit at the first moment, a linear interpolation algorithm is used to determine the state variable of the center of the object at the first moment.

4. The method according to claim 1, wherein Solving the model based on the constraints of the physical system to obtain a first state variable of the physical system at a second moment includes: Solving the model based on the constraints of the physical system to obtain a state variable of the center of the object at a second moment and a relative state variable of the center of the geometric basic unit at the second moment; The state variable of the center of the object at the second moment is superimposed on the relative state variable of the center of the geometric basic unit at the second moment to obtain the state variable of the center of the geometric basic unit at the second moment.

5. The method according to claim 4, characterized in that After obtaining the first state variable of the physical system at the second moment, the method further includes: The state variables of the vertices of the geometric basic unit at the second moment are determined according to the state variables of the center of the geometric basic unit at the second moment.

6. The method according to claim 1, characterized in that The obtaining of the model of the physical system includes: Get the LCP model of the physical system.

7. The method according to claim 1, characterized in that The dual-scale contact constraints of the physical system at the first moment include: M i V′ i =(1-w I )Y i T λ M j V′ j =(1-w J )Y j T λ in: i represents a geometric unit involved in contact, I represents the object to which geometric unit i belongs; j represents another geometric unit involved in contact, J represents the object to which geometric unit j belongs; the symbol "T" represents the transposition operation; M i is the mass matrix of geometric unit i; M I is the mass matrix of object I; M j is the mass matrix of geometric unit j; M J is the mass matrix of object J; V′ i is the first-order derivative of the generalized velocity vector of geometric unit i; V′ I is the first-order derivative of the generalized velocity vector of object I; V′ j is the first-order derivative of the generalized velocity vector of the geometric unit j; V′ J is the first-order derivative of the generalized velocity vector of object J; Y i Y is the Jacobian matrix defined based on the center of the geometric basic unit i; I Y is the Jacobian matrix defined based on the center of object I; j Y is the Jacobian matrix defined based on the center of the geometric basic unit j; J is the Jacobian matrix defined based on the center of object J; w I is the global constraint weight of object I, w J is the global constraint weight of object J, and λ is the constraint force vector.

8. The simulation method according to claim 7, wherein: The global constraint weight w of the object is determined by the following formula Where E is the Young's modulus of the object, Δt is the preset time step, and δ is δ = 5×10 -5 .

9. The method according to claim 1, characterized in that The constraints of the physical system further include a non-penetration constraint of the physical system at the first moment, and / or a friction constraint of the physical system at the first moment.

10. An electronic device comprising a memory and a processor, wherein the memory is used to store a computer program; and the processor is used to execute the computer program to implement the physical system-oriented simulation method according to any one of claims 1 to 9.

Citation Information

Patent Citations

  • GPU parallel fitting simulation method based on constraint projection

    CN112862957A

  • A coupling physics field rapid solution-oriented true and false dual particle model modeling method

    CN114036815A