FMI standard-based joint simulation method for three-dimensional models of cloud chained tool

Through cloud-based chaining tools based on FMI standards, a three-dimensional joint simulation system was established, which solved the problem of simulation integration and collaboration between different fields or different systems, and achieved standardization of the simulation process and efficient data exchange, improving the accuracy of simulation results.

CN119647051APending Publication Date: 2025-03-18BEIJING NEW ENERGY VEHICLE TECH INNOVATION CENT CO LTD
View PDF 0 Cites 2 Cited by

Patent Information

Application Number
CN202411530943.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-30
Publication Date
2025-03-18

AI Technical Summary

Technical Problem

The prior art is difficult to achieve simulation integration and coordination in different fields or between different systems, and it is difficult to establish data exchange and interface standardization between simulation software, which makes it difficult to implement simulation process management and time synchronization mechanisms.

Method used

Using cloud-based chain tools based on FMI standards, a three-dimensional joint simulation system is established, and simulation integration and collaboration between different fields or systems are achieved through refined simulation processes, and the simulation process is managed to standardize the three-dimensional joint simulation process.

Benefits of technology

Simulation integration and coordination between different fields or systems is achieved, reducing the difficulty of simulation, making three-dimensional joint simulation widely used in the simulation industry, and the simulation results are closer to real-world results.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119647051A_ABST
    Figure CN119647051A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of joint simulation, and particularly discloses an FMI standard-based joint simulation method between three-dimensional models of a cloud chained tool, which comprises the following steps of: establishing a three-dimensional joint simulation system for supporting integration and collaboration of different simulation software; dividing the three-dimensional joint simulation system into multiple types of modules according to the requirements of data exchange and time synchronization among different simulation software; and simulation software integration and collaboration among different fields or different systems are carried out by utilizing multiple types of modules, and a three-dimensional joint simulation process is managed. The three-dimensional joint simulation system is established, simulation integration and collaboration among different fields or different systems are realized through a refined simulation process, and the simulation process is managed to standardize the three-dimensional joint simulation process, so that the simulation difficulty is reduced, and the three-dimensional joint simulation can be commonly used in the simulation industry; and a simulation result is closer to a real world result.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of joint simulation technology, and in particular to a joint simulation method between three-dimensional models of cloud chain tools based on the FMI standard. Background Art

[0002] In recent years, with the development and maturity of a series of emerging technologies such as cloud computing, Internet of Things, big data, artificial intelligence, 5G, etc., products have become more and more complex, and the speed of replacement is getting faster and faster, which makes enterprises face unprecedented pressure for product innovation. As the best way to optimize product design, ensure product performance, shorten the R&D cycle, and verify complex working conditions, simulation is becoming more and more widely used and has become the cornerstone and catalyst of enterprise innovation. At present, in the field of simulation, all walks of life are more focused on single discipline and single physical field for simulation applications. Due to technical barriers, multi-disciplinary and multi-physical field joint simulation is difficult, but in the real world, any object exists in multiple physical fields, so single physical field simulation is obviously far from meeting the requirements of real-world scenarios. Therefore, in order to make the simulation results closer to the real-world results, multi-physical field and multi-disciplinary joint simulation research and application are imminent.

[0003] For joint simulation, the known technical contents include:

[0004] 1. Simulation is divided into different directions: structure, fluid, dynamics, electronic control, etc.; according to the dimension, it can be divided into one-dimensional and three-dimensional;

[0005] 2. The simulation models in different directions are completely different, and the simulation models in the same direction cannot be reused due to differences in keywords, languages, programming logic, etc.;

[0006] 3. For the FMI protocol proposed by EU Modelisar, although the co-simulation and exchange-model interfaces are defined, a feasible framework method is still needed if these interfaces are to be connected.

[0007] For joint simulation, the industry currently faces the following challenges:

[0008] 1. It is difficult to realize simulation integration and collaboration between different fields or systems;

[0009] 2. It is difficult to build a general simulation integration framework;

[0010] 3. Different simulation software architectures are different, which makes data exchange and interface standardization between simulation software a major challenge;

[0011] 4. During the simulation process, different simulation software need to maintain a time synchronization mechanism;

[0012] 5. There are many kinds of simulation software with the same functions, and their architectures are very different. Therefore, it is extremely difficult to build simulation process management tools and implement control functions such as configuration, start, pause, continue and stop of simulation tasks.

[0013] Based on this technical background, the present invention studies a joint simulation method between three-dimensional models of cloud-based chain tools based on the FMI standard. Summary of the invention

[0014] In view of the shortcomings of the prior art, the present invention provides a joint simulation method between three-dimensional models of cloud-based chain tools based on the FMI standard, establishes a three-dimensional joint simulation system, and realizes simulation integration and collaboration between different fields or different systems through a refined simulation process. The simulation process is managed to standardize the three-dimensional joint simulation process, thereby reducing the difficulty of simulation, allowing three-dimensional joint simulation to be widely used in the simulation industry and making the simulation results closer to real-world results.

[0015] In order to achieve the above object, the present invention provides a joint simulation method between three-dimensional models of cloud-based chain tools based on the FMI standard, including:

[0016] Establish a 3D joint simulation system to support the integration and collaboration of different simulation software;

[0017] According to the requirements of data exchange and time synchronization between the different simulation software, the three-dimensional joint simulation system is divided into multiple modules;

[0018] Utilize the above modules to integrate and collaborate simulation software in different fields or systems, and manage the 3D joint simulation process.

[0019] The beneficial effects of the present invention include:

[0020] (1) The present invention proposes a joint simulation method between three-dimensional models of cloud-based chain tools based on the FMI standard, establishes a three-dimensional joint simulation system, and realizes simulation integration and collaboration between different fields or different systems through a refined simulation process. The simulation process is managed to standardize the three-dimensional joint simulation process, thereby reducing the difficulty of simulation, making the three-dimensional joint simulation widely used in the simulation industry, and making the simulation results closer to the real-world results.

[0021] (2) The present invention proposes a joint simulation method between three-dimensional models of cloud-based chain tools based on the FMI standard, establishes a general simulation integration framework method, and can support the integration of different simulation software; standardizes data exchange and interfaces, and defines a unified data exchange format and interface protocol to achieve efficient and accurate data exchange between different simulation models.

[0022] (3) The present invention proposes a joint simulation method between three-dimensional models of cloud-based chain tools based on the FMI standard to achieve precise synchronization of simulation time, including fixed-step synchronization and event-driven synchronization mechanisms to meet the needs of different simulation tasks; it supports control functions such as configuration, start, pause, continue and stop of simulation tasks, as well as monitoring and logging of the simulation process.

[0023] Other features and advantages of the present invention will be described in detail in the following detailed description. BRIEF DESCRIPTION OF THE DRAWINGS

[0024] The above and other objects, features and advantages of the present invention will become more apparent through a more detailed description of exemplary embodiments of the present invention with reference to the accompanying drawings.

[0025] Figure 1 This is a flow chart of the joint simulation method between three-dimensional models of cloud-based chain tools based on the FMI standard proposed by the present invention.

[0026] Figure 2 This is a schematic diagram of the structure of a three-dimensional joint simulation system in a specific implementation of the joint simulation method between three-dimensional models of cloud-based chain tools based on the FMI standard proposed by the present invention.

[0027] Figure 3 This is a flow chart of a specific implementation of the joint simulation method between three-dimensional models of cloud-based chain tools based on the FMI standard proposed by the present invention. DETAILED DESCRIPTION

[0028] The preferred embodiments of the present invention will be described in more detail below. Although the preferred embodiments of the present invention are described below, it should be understood that the present invention can be implemented in various forms and should not be limited to the embodiments set forth herein.

[0029] The present invention provides a joint simulation method between three-dimensional models of cloud chain tools based on the FMI standard, such as Figure 1 As shown, including:

[0030] Establish a 3D joint simulation system to support the integration and collaboration of different simulation software;

[0031] According to the requirements of data exchange and time synchronization between different simulation software, the 3D joint simulation system is divided into multiple modules;

[0032] Utilize multiple types of modules to integrate and collaborate simulation software in different fields or systems, and manage the 3D joint simulation process.

[0033] In the present invention, a three-dimensional joint simulation system is established, and through a refined simulation process, simulation integration and collaboration between different fields or different systems are achieved, and the simulation process is managed to standardize the three-dimensional joint simulation process, thereby reducing the simulation difficulty, allowing the three-dimensional joint simulation to be widely used in the simulation industry, and making the simulation results closer to the real-world results.

[0034] According to the present invention, a three-dimensional co-simulation system includes a coupling controller, at least two three-dimensional solvers, and an adapter matched with each three-dimensional solver;

[0035] Each 3D solver includes a 3D model, a solver, a simulation parameter module and a mesh module;

[0036] The mesh modules are used to map meshes between the three-dimensional solvers.

[0037] The coupling controller includes a global simulation control module, a coupling mode module, a grid control algorithm module, a simulation step time control module, a communication control module and a simulation parameter control module;

[0038] The adapter is used to adapt the models exported by different software for joint simulation. The setting parameters include: parallel settings, input and output parameters, number of parameter mappings, number of computing cores, result output iteration interval, result output format, network type, mapping interface, and number of mapping interfaces;

[0039] The setting parameters of the coupling controller include: simulation type, simulation market, simulation cycle size, number of simulation cycles, distributed computing, model dimension, relaxation factor, communication method, mesh geometry filtering level, mesh mapping algorithm, mesh mapping constraints and network type;

[0040] The coupling methods set in the coupling mode module include: explicit-serial, explicit-parallel, implicit-serial and implicit-parallel methods. For implicit-serial and implicit-parallel methods, the coupling methods set include: aitken algorithm, IQN-ILS algorithm and IQN-IMVJ algorithm;

[0041] The 3D joint simulation system supports time synchronization control, time step self-loop control, single / bidirectional coupling, multiple FMU modules, and surface coupling and volume coupling methods of 3D physical fields.

[0042] According to the present invention, the operation process of the three-dimensional joint simulation system includes:

[0043] Input multiple FMU files into the 3D co-simulation system;

[0044] Collaboratively configure the initialization parameters of multiple FMU files;

[0045] Build XML files and modify data files in 3D model configuration;

[0046] Compress data files to the cloud;

[0047] Conduct 3D co-simulation in the cloud;

[0048] Feedback and inspection of 3D co-simulation results.

[0049] According to the present invention, the multiple types of modules include basic grid type modules, basic communication type modules, core function modules, heterogeneous grid mapping modules, explicit / implicit coupling scheme modules, data communication modules, and toolkit modules;

[0050] The basic mesh class module belongs to the mesh class, which includes the Vertex class and the Data class, which are used to save the coupled mesh and coupled data classes;

[0051] The functions of the Data class include: initializing data objects, getting and setting data values ​​and gradients, managing time step storage, moving to the next time window, and allocating memory as needed;

[0052] The data structure of the Data class contains data name, ID, dimension, spatial dimension and waveform information. When creating an object, make sure that dimensions are greater than 0.

[0053] The data structure of the Data class is:

[0054]

[0055]

[0056] The functions of the Data class include:

[0057] values() and gradients() functions, which are used by users to access and modify sample data and gradients;

[0058] sampleAtTime(double time) function, used to obtain the sample value at a specific time;

[0059] setSampleAtTime(double time,const time::Sample&sample) function is used to set the sample value at the specified time;

[0060] moveToNextWindow() function, used to advance the time step storage, ensure data synchronization with time and memory management;

[0061] allocateValues(int expectedCount) function, which is used to dynamically adjust the size of data and gradients according to the expected number;

[0062] toZero() function, used to reset all data values ​​and gradients to zero;

[0063] requireDataGradient() function, used to enable gradient storage function;

[0064] The data structure of the Vertex class is:

[0065]

[0066]

[0067] The Vertex class includes several methods for managing vertex attributes, including getting and setting dimensions, global index, ownership status, and marking status.

[0068] The code of the Vertex class overloads the output operator << and outputs the vertex coordinates in Well-Known Text (WKT) format through the formatted output function (v.getCoords().transpose().format(utils::eigenio::wkt())).

[0069] According to the present invention, the basic communication module includes:

[0070] com class, which defines the data communication abstraction layer and implementation, and implements the underlying functions of MPI communication and Sockets communication;

[0071] Communication class, which defines the basic operations of the communication module, including initialization, sending and receiving data, and managing communication resources, and implements the specific functions of MPI or Sockets communication, including init(), finalize(), send(), and receive() functions, which are used to ensure the reasonable allocation and release of system resources before and after the communication starts and ends, and to ensure that data can be effectively transmitted between nodes;

[0072] The SerializedMesh class is used for serialization and deserialization of mesh::Mesh mesh objects, including the following member variables:

[0073] sizes: a vector containing the mesh dimensions, the number of vertices, edges, triangles and tetrahedrons;

[0074] coords: a vector containing vertex coordinates;

[0075] ids: contains global IDs, or pairs of global IDs and local IDs, defining local IDs of edges, triangles, and tetrahedrons, depending on the connectivity of the mesh;

[0076] The SerializedConnectionMap class is responsible for serialization and deserialization of the ConnectionMap object, including a member variable:

[0077] content: a vector containing the number of entries, rank and size of the entry;

[0078] The SerializedBoundingBox class is responsible for the serialization and deserialization of mesh::BoundingBox objects, including one member variable:

[0079] coords: a vector containing the bounding box coordinates;

[0080] The SerializedBoundingBoxMap class is used for serialization and deserialization of BoundingBoxMap objects and includes two member variables:

[0081] info: a vector containing the number of entries and dimensions;

[0082] coords: a vector containing the bounding box coordinates;

[0083] The SerializedStamples class is used for serialization and deserialization of coupled data and includes three member variables:

[0084] _values: A vector storing serialized values ​​of time steps;

[0085] _gradients: A vector storing serialized values ​​of gradients;

[0086] _timeSteps: the number of time steps stored;

[0087] The MPICommunication base class is used to provide basic MPI point-to-point communication, including subclasses MPIDirectCommunication, MPISinglePortsCommunication, and MPIPortsCommunication;

[0088] SocketCommunication class, used to implement the Communication interface and use sockets for inter-process communication;

[0089] SocketCommunicationFactory class, used to create SocketCommunication instances;

[0090] SocketSendQueue class, used to manage the socket send queue to ensure the sequential execution of asynchronous send operations;

[0091] SocketRequest class, used to manage asynchronous requests.

[0092] Preferably, the core functional modules include:

[0093] Mapping class, used to calculate the grid data mapping relationship between participants;

[0094] cplscheme class, which is used to call coupling data and communication objects and implement coupling schemes for coupled simulations. It implements four coupling schemes for users: serial, parallel, implicit, and explicit.

[0095] The acceleration class is used to provide acceleration solutions for solving nonlinear equations. It provides users with three different types of acceleration methods: normal sub-relaxation, adaptive sub-relaxation, and quasi-Newton variants.

[0096] The m2n class defines the logical part of parallel communication between participants based on the con class and is used to implement a distributed intercommunication model.

[0097] According to the present invention, the heterogeneous grid mapping module includes nearest neighbor mapping, nearest projection mapping and radial basis function mapping;

[0098] The heterogeneous grid mapping module establishes the basic framework of heterogeneous grid mapping by designing the base class Mapping, which provides a unified interface and basic functions for various specific mapping methods. The implementation methods include:

[0099] Mapping constructor: initializes mapping constraints and dimensions;

[0100] setMeshes, getInputMesh, getOutputMesh: set and get meshes;

[0101] computeMapping, hasComputedMapping, hasConstraint, isScaledConsistent, requiresInitialGuess, initialGuess, clear: mapping related operations;

[0102] Map series methods: perform mapping operations;

[0103] tagMeshFirstRound and tagMeshSecondRound: mesh tagging operations;

[0104] scaleConsistentMapping: scale consistent mapping;

[0105] getName: returns the name of the mapping method;

[0106] The nearest neighbor mapping is implemented by designing the NearestNeighborBaseMapping class, which inherits from the Mapping class. The constructor contains constraint, dimensions, hasGradient, mappingName, and mappingNameShort information. The implementation methods include:

[0107] computeMapping: calculates mapping coefficients;

[0108] clear: delete the calculated mapping;

[0109] onMappingComputed: matches the offset of the gradient mapping;

[0110] tagMeshFirstRound and tagMeshSecondRound: tag mesh operations;

[0111] The NearestNeighborGradientMapping and NearestNeighborMapping classes inherit from NearestNeighborBaseMapping and are used for nearest neighbor gradient mapping and nearest neighbor mapping respectively. They overload the mapConservative and mapConsistent methods to implement specific mapping operations.

[0112] Recently, projection mapping was implemented by designing the BarycentricBaseMapping class, which inherits from Mapping. The constructor has two parameters: constraint and dimensions. The implementation methods include:

[0113] Use the LinearCellInterpolationMapping class to inherit BarycentricBaseMapping and define a cell mapping class based on linear interpolation;

[0114] Use NearestProjectionMapping to inherit BarycentricBaseMapping to implement linear interpolation of orthogonal projection to the nearest triangle / edge / vertex;

[0115] Overload mapConservative and mapConsistent to implement specific mapping operations;

[0116] The radial basis function mapping is implemented through the evaluate method in the GaussianRBF class. The implementation methods include:

[0117] Use the RBFSolver class to calculate the coefficients of RBF interpolation and use these coefficients during interpolation;

[0118] Use RBFSolver::computeCoefficients to calculate the RBF coefficients required for interpolation;

[0119] Use RBFSolver::interpolate to interpolate the calculated coefficients to the new data points;

[0120] The RBFInterpolationMapping class inherits from the Mapping class and uses RBF for data mapping to achieve specific grid data mapping;

[0121] Call the computeMapping method to calculate and store the mapping relationship of RBF interpolation;

[0122] Override mapConsistent and mapConservative to use RBF interpolation to consistently and conservatively map the data.

[0123] According to the present invention, the explicit / implicit coupling scheme module adopts a partition coupling technical solution;

[0124] Partition coupling is divided into serial coupling and parallel coupling according to the calculation order of the solver;

[0125] Parallel coupling derives from explicit coupling schemes and implicit coupling;

[0126] The classes required to implement the coupling scheme of the explicit / implicit coupling scheme module include:

[0127] BaseCouplingScheme abstract base class, used to define the basic interface and functions of the standard coupling scheme;

[0128] CouplingMode enumeration class, used to define the coupling mode;

[0129] CouplingData coupling data class is used to manage data exchange related to specific grids and data;

[0130] The BiCouplingScheme class and the MultiCouplingScheme class both inherit the BaseCouplingScheme abstract base class and are used to implement the dual-participant coupling scheme and the multi-participant coupling scheme respectively;

[0131] The BiCouplingScheme class, inherited from BaseCouplingScheme, is used for the coupling scheme of two participants;

[0132] The MultiCouplingScheme class, inherited from BaseCouplingScheme, is used for multi-participant coupling schemes;

[0133] ParallelCouplingScheme and SerialCouplingScheme classes, which are used for the specific implementation of parallel and serial coupling respectively;

[0134] The pseudo-code flow of the algorithm showing coupling includes:

[0135] 1. Initialization:

[0136] Call the initialize() method to set the initial time and time window;

[0137] 2. Advance time step:

[0138] Call the advance() method, and then call the firstSynchronization(), firstExchange(), secondSynchronization(), and secondExchange() methods in sequence;

[0139] 3. Data synchronization and exchange;

[0140] 4. Data sending and receiving:

[0141] Use sendData() and receiveData() methods to actually transfer data;

[0142] 5. End:

[0143] Call the finalize() method to end the coupling scheme;

[0144] The implicitly coupled algorithm pseudocode includes:

[0145] 1. Initialization:

[0146] Call the initialize() method, set the initial time and time window, and perform initial data exchange;

[0147] 2. Advance time step:

[0148] Call the doImplicitStep() method to perform implicit iteration:

[0149] measureConvergence(); Check whether the convergence conditions are met;

[0150] If not converged, repeat the data exchange exchangeFirstData() and exchangeSecondData();

[0151] 3. Data exchange and convergence detection:

[0152] Use sendConvergence() and receiveConvergence() to exchange and detect convergence information;

[0153] 4. End:

[0154] When hasConverged() returns true, call finalize() to end the coupling scheme.

[0155] According to the present invention, the data communication module is based on two basic communication modes, MPI and Socket, and adopts a distributed intercommunication model to realize a point-to-point communication mode that supports large-scale parallel communication;

[0156] Base class M2N management of distributed intercommunication model communication class;

[0157] The base class M2N is implemented by the BoundM2N class. The implementation methods include:

[0158] Manages the entire communication lifecycle from connection preparation, primary and secondary ranking connections to final resource cleanup using prepareEstablishment(), connectPrimaryRanks(), connectSecondaryRanks(), and cleanupEstablishment();

[0159] Use the prepareEstablishment() method to initialize the resources and configuration required for the connection;

[0160] Establish communication channels between primary and secondary participants via connectPrimaryRanks() and connectSecondaryRanks();

[0161] Use preConnectSecondaryRanks() to provide pre-configuration of secondary connections;

[0162] Use the cleanupEstablishment() method to ensure that necessary cleanup operations are performed after the connection is established to keep the system clean and running efficiently;

[0163] Use waitForSecondaryRanks() to ensure that the primary level will communicate only after all secondary levels are ready, thereby ensuring the synchronization and reliability of data transmission.

[0164] In the present invention, a general simulation integration framework method is established to support the integration of different simulation software; data exchange and interfaces are standardized, and a unified data exchange format and interface protocol are defined to achieve efficient and accurate data exchange between different simulation models.

[0165] According to the present invention, the toolkit module is used for model parsing, intermediate format configuration file parsing, and simulation data export;

[0166] Model analysis is used to analyze uploaded multiple 3D models to facilitate joint simulation;

[0167] When the intermediate format configuration file is in XML format, it is parsed using an XML parser;

[0168] XML parsers include:

[0169] ConfigParser, used to read and parse XML files, manage tags and callbacks;

[0170] XMLTag, represents an XML tag, including the tag name, attributes, subtags and callback mechanism;

[0171] XMLAttribute, which represents an attribute of an XML tag, including the attribute name, default value, options, and validation function;

[0172] ConfigurationContext, used to pass configuration context information, including name, order, and size;

[0173] NoPListener, as a listener class that does not perform any operations, for testing purposes;

[0174] The parsing process of the XML parser includes:

[0175] Read the XML file through the readXmlFile method;

[0176] Connect the actual XML tags and predefined tags through the connectTags method;

[0177] Use the OnStartElement, OnEndElement, and OnTextSection methods to handle the callback functions of the start tag, end tag, and text segment during XML parsing;

[0178] Use the MessageProxy method to proxy libxml2's error and warning messages;

[0179] The simulation data export formats include vtk, vtp, vtu and csv;

[0180] The implementation process of simulation data export includes:

[0181] Design the Export abstract base class as the base class for all exported classes;

[0182] Define the pure virtual function doExport and implement it in the subclass;

[0183] Design ExportCSV class, ExportVTK class, ExportVTP class, ExportVTU class and ExportXML class, inherit Export, implement doExport function, and export various types of files.

[0184] In the present invention, accurate synchronization of simulation time is achieved, including fixed-step synchronization and event-driven synchronization mechanisms to meet the needs of different simulation tasks; control functions such as configuration, start, pause, continue and stop of simulation tasks, as well as monitoring and logging of the simulation process are supported.

[0185] The present invention will be described in more detail below by way of examples.

[0186] Embodiment 1:

[0187] This embodiment proposes a joint simulation method between three-dimensional models of cloud-based chain tools based on the FMI standard, and its functions include:

[0188] The 3D joint simulation system can adapt to the models exported by multiple tool software for joint simulation. The parameters in the adapter can be set, including: parallel settings, input and output parameters, parameter mapping quantity, number of computing cores, result output iteration interval, result output format, network type, mapping interface, number of mapping interfaces, etc.

[0189] The master control coupler of the three-dimensional joint simulation system also includes the settings of the following parameters: simulation type, simulation market, simulation cycle size, number of simulation cycles, distributed computing, model dimension, relaxation factor, communication method, mesh geometry filtering level, mesh mapping algorithm, mesh mapping constraints, and network type;

[0190] For different coupling methods: there are explicit-serial, explicit-parallel, implicit-serial, implicit-parallel. For the implicit method, you can set: aitken algorithm, IQN-ILS algorithm, IQN-IMVJ algorithm. You need to set these three algorithms additionally.

[0191] In addition, the system also supports time synchronization control and time step self-loop control; it also supports single / bidirectional coupling and multiple FMU module sources, and supports surface coupling and volume coupling methods of three-dimensional physical fields;

[0192] In this embodiment, Figure 3 As shown in the figure, the system operation process includes:

[0193] Step 1. The system operator or engineer inputs several FMU files for the system;

[0194] Step 2. Collaboratively configure the initialization parameters of the FMU file;

[0195] Step 3. Build the XML file and modify the data in the model configuration;

[0196] Step 4. Compress the file to the cloud;

[0197] Step 5. Perform three-dimensional joint simulation;

[0198] Step 6. Send back and check the simulation results;

[0199] In this embodiment, the schematic diagram of the three-dimensional joint simulation system is as follows: Figure 2 As shown;

[0200] In this embodiment, the three-dimensional joint simulation system is divided into multiple modules, and the three-dimensional joint simulation method is specifically described in combination with the following multiple modules;

[0201] Module 1. Basic mesh class: The mesh class stores coupled meshes and coupled data classes, and is the basis for other components. The mesh is composed of vertices, so the two most basic classes of the mesh class are the Vertex class and the Data class. The Data object is responsible for managing and manipulating data, including sample values ​​and gradients. The main functions include initializing data objects, getting and setting data values ​​and gradients, managing time step storage, moving to the next time window, and allocating memory as needed. The code ensures the consistency of data dimensions and storage, and ensures the correctness of operations through assertions and debugging information. The overall design emphasizes flexibility and performance optimization, especially memory management when processing large-scale data. The data structure contains information such as data name, ID, dimension, spatial dimension, and waveform. When creating an object, it will pre-judge to ensure that dimensions are greater than 0. Its data structure is as follows:

[0202]

[0203]

[0204] The implementation of the Data class revolves around data management; through the values() and gradients() functions, users can access and modify sample data and gradients; the sampleAtTime(double time) function allows obtaining sample values ​​at a specific time, while setSampleAtTime(double time,const ime::Sample&sample) is used to set sample values ​​at a specified time; the moveToNextWindow() function is used to advance time step storage to ensure that data is synchronized with time steps; in terms of memory management, the allocateValues(int expectedCount) function is used to dynamically adjust the size of data and gradients according to the expected number; the toZero() function can reset all data values ​​and gradients to zero, and requireDataGradient() enables the gradient storage function; these functions together ensure that the Data class can effectively manage complex data operations and time step management, and support efficient numerical calculations and simulations;

[0205] The Vertex class contains the following data structures, which have different coordinate information depending on the input dimension;

[0206]

[0207]

[0208] It includes several methods for managing vertex attributes, such as getting and setting dimensions (getDimensions), global indexes (getGlobalIndex and setGlobalIndex), ownership status (isOwner and setOwner), and tag status (isTagged and tag); in addition, the code also overloads the output operator <<, and outputs the coordinates of the vertex in Well-Known Text (WKT) format through the formatted output function (v.getCoords().transpose().format(utils::eigenio::wkt())), which is convenient for viewing the specific location of the vertex during debugging or recording; these functions enable the Vertex class to effectively manage various attributes of vertices in mesh operations;

[0209] Module 2. Basic communication class: The com class defines the data communication abstraction layer and implementation, and implements the underlying functions of MPI communication and Sockets communication;

[0210] The Communication class is responsible for defining the basic operations of the communication module, including initialization, sending and receiving data, and managing communication resources. It is usually the basis for other communication implementations (such as MPI communication and Sockets communication). By publicly inheriting the Communication class and overriding functions, the specific functions of MPI or Sockets communication can be implemented. The init() and finalize() functions are responsible for setting up and cleaning up the communication environment to ensure the reasonable allocation and release of system resources before and after the communication starts. The send() and receive() functions provide basic sending and receiving functions to ensure that data can be effectively transmitted between nodes.

[0211] During the transmission process, mesh data (coupling data, boundary data, mesh data) needs to be transmitted in a serialized manner, so it is necessary to design the com::series interface to serialize and deserialize the data and implement five classes: SerializedMesh, SerializedConnectionMap, SerializedBoundingBox, SerializedBoundingBoxMap, and SerializedStamples.

[0212] The SerializedMesh class is responsible for serializing and deserializing mesh::Mesh mesh objects and has the following member variables:

[0213] sizes: a vector containing the mesh dimensions, the number of vertices, edges, triangles and tetrahedrons;

[0214] coords: a vector containing vertex coordinates;

[0215] ids: Depending on the connectivity of the mesh, this may contain global IDs or (global ID, local ID) pairs defining local IDs of edges, triangles, and tetrahedrons;

[0216] Use the serialize method to serialize the given mesh::Mesh; the addToMesh method adds the serialized mesh to the actual mesh; verify the correctness of the content through assertValid; the send function sends the serialized mesh data; override receive to receive the serialized mesh data and verify it; use the broadcastSend and broadcastReceive functions to broadcast and receive the serialized mesh data;

[0217] The SerializedConnectionMap class is responsible for serialization and deserialization of the ConnectionMap object and contains a member variable:

[0218] content: a vector containing the number of entries, rank and size of the entry;

[0219] serialize serializes the given ConnectionMap; toConnectionMap builds and returns the connection map represented by the serialized state; assertValid verifies the correctness of the content; send sends the serialized connection map; receive receives and verifies the serialized connection map; broadcastSend and broadcastReceive broadcast and receive serialized connection maps;

[0220] The SerializedBoundingBox class is responsible for serializing and deserializing mesh::BoundingBox objects and contains one member variable:

[0221] coords: a vector containing the bounding box coordinates;

[0222] serialize serializes the given mesh::BoundingBox; toBoundingBox constructs and returns the bounding box represented by the serialized state; assertValid verifies the correctness of the content; send sends the serialized bounding box; receive receives and verifies the serialized bounding box;

[0223] The SerializedBoundingBoxMap class is responsible for serializing and deserializing BoundingBoxMap objects and has two member variables:

[0224] info: a vector containing the number of entries and dimensions;

[0225] coords: a vector containing the bounding box coordinates;

[0226] serialize serializes the given BoundingBoxMap; toBoundingBoxMap builds and returns the bounding box map represented by the serialized state; assertValid verifies the correctness of the content; send sends the serialized bounding box map; receive receives and verifies the serialized bounding box map; broadcastSend and broadcastReceive broadcast send and receive serialized bounding box maps;

[0227] The SerializedStamples class is responsible for serializing and deserializing coupled data and has three member variables:

[0228] values: a vector storing serialized values ​​of time steps;

[0229] gradients: a vector storing serialized values ​​of gradients;

[0230] timeSteps: the number of time steps stored;

[0231] serialize serializes the given CouplingData; empty creates a SerializedStamples with an allocated buffer; deserializeInto deserializes the serialized data into the provided CouplingData; values ​​and gradients return references to the serialized values ​​and gradients; nTimeSteps returns the number of time steps; and has the following private methods:

[0232] allocate: allocates _values ​​and _gradients according to data;

[0233] serializeValues ​​and serializeGradients: serialize the values ​​and gradients of data;

[0234] deserialize: deserialize _values ​​and _gradients into the time step storage of the data;

[0235] MPI communication is used to pass messages and exchange data between multiple computing nodes to achieve parallel computing. It can be used in high-performance computing (HPC) and parallel computing clusters. According to the degree of distribution of joint simulation, three classes, MPIDirectCommunication, MPISinglePortsCommunication and MPIPortsCommunication, are designed to achieve single-machine parallel computing, single-port parallel computing and multi-port parallel computing respectively. These three classes are based on the MPICommunication class, which is a base class that provides basic MPI point-to-point communication implementation. Its main functions include sending and receiving various data types (strings, integers, double-precision floating-point numbers and Boolean values). Each data type has synchronous and asynchronous sending and receiving methods. This class defines the basic structure of communication, and the specific connection establishment method is implemented by its subclasses (MPIDirectCommunication, MPISinglePortsCommunication and MPIPortsCommunication). The main methods are:

[0236] acceptConnection and requestConnection methods: used to accept and request connections; if the local and global communicators are equal, call the utils::Parallel::splitCommunicator() method to split the communicators;

[0237] reduceSum and allreduceSum methods: used to perform MPI reduction operations and sum the data between processes;

[0238] broadcast method: used to broadcast data to all processes;

[0239] adjustRank method: adjust ranking for direct communication;

[0240] MPIDirectCommunication inherits from MPICommunication and implements the direct communication method. This class is suitable for situations where all processes are in the same MPI communicator. It has the following main methods:

[0241] acceptConnection and requestConnection methods: used to accept and request connections; if the local and global communicators are equal, call the utils::Parallel::splitCommunicator() method to split the communicators;

[0242] reduceSum and allreduceSum methods: used to perform MPI reduction operations and sum the data between processes;

[0243] broadcast method: used to broadcast data to all processes;

[0244] adjustRank method: adjust ranking for direct communication;

[0245] MPIPortsCommunication provides a connection method based on MPI ports (part of MPI 2.0) for participants running in different process groups; the main methods are:

[0246] acceptConnection and requestConnection methods: used to accept and request connections through the MPI port;

[0247] prepareEstablishment and cleanupEstablishment methods: used to prepare and clean up the connection establishment process;

[0248] _communicators field: stores the mapping from remote ranking to communicators;

[0249] _portName field: stores the port name used for the connection;

[0250] The MPISinglePortsCommunication class further simplifies the connection based on MPI ports and centralizes the establishment of a single global communicator; the main methods are:

[0251] _direct field: stores the direct communication channel based on MPI_COMM_SELF;

[0252] _global field: used to store the global communicator. Once established, it becomes the default communicator.

[0253] In addition, it is necessary to establish the factory classes required for MPI communication. The MPIPortsCommunicationFactory and MPISinglePortsCommunicationFactory classes are used to create MPIPortsCommunication and MPISinglePortsCommunication instances respectively, and provide newCommunication and addressDirectory methods.

[0254] Based on TCP / IP sockets, Sockets is used as the underlying communication mechanism to achieve communication between computing nodes; it allows connections to be established between computing nodes on different physical machines or virtual machines; it designs an asynchronous socket communication system based on boost::asio, which supports synchronous and asynchronous transmission of multiple data types; it provides a flexible interface for establishing, managing, and closing communication connections, which is suitable for efficient inter-process communication; communication is implemented by the SocketCommunication class, and the SocketCommunicationFactory class is used to create a SocketCommunication instance; the SocketSendQueue class manages the socket's send queue to ensure the sequential execution of asynchronous send operations; the SocketRequest class inherits Request and is used to manage asynchronous requests;

[0255] The SocketCommunication class implements the Communication interface and uses sockets for inter-process communication; the constructor SocketCommunication(unsigned shortportNumber,bool reuseAddress,std::string networkName,std::string addressDirectory): is used to initialize communication, including port number, whether to reuse addresses, network name and address directory; getRemoteCommunicatorSize obtains the size of the remote communicator; cceptConnection is used to accept connections, which can be used as a server or a client; requestConnection is used to request a connection, and can also be used as a client to request a connection with the server; closeConnection closes the connection; send sends data, which can send strings, integers, double-precision numbers and Boolean values, and supports synchronous and asynchronous sending; receive receives data, which supports receiving strings, integers, double-precision numbers and Boolean values, and supports synchronous and asynchronous receiving; prepareEstablishment and cleanupEstablishment are used to prepare and clean up related operations for connection establishment;

[0256] The SocketCommunicationFactory class is used to create a SocketCommunication instance; the constructor SocketCommunicationFactory(unsigned short portNumber, bool reuseAddress, std::string networkName, std::string addressDirectory): initializes the factory, including the port number, whether to reuse the address, the network name, and the address directory; newCommunication creates a new SocketCommunication instance; addressDirectory returns the address directory;

[0257] The SocketSendQueue class manages the socket's send queue to ensure the sequential execution of asynchronous send operations; dispatch puts data into the queue and starts processing the queue; sendCompleted notifies the queue that the last asynchronous send operation has been completed; process processes the send requests in the queue;

[0258] The SocketRequest class inherits Request and is used to manage asynchronous requests; complete marks the request as completed; test tests whether the request is completed; wait waits for the request to complete;

[0259] Module 3. Core functional module: The core functional module includes four parts: mapping class, cplscheme class, acceleration class and m2n class; mapping class calculates the grid data mapping relationship between participants; cplscheme class calls coupling data and communication objects, and implements coupling schemes for coupling simulation, and realizes four coupling schemes for users: serial, parallel, implicit and explicit; acceleration class provides acceleration schemes to speed up the solution of nonlinear equations; provides users with three different types of acceleration methods: constant (normal sub-relaxation), Aitken (adaptive sub-relaxation) and quasi-Newton variants (IQN-ILS, IQN-IMVJ); m2n class defines the logical part of parallel communication between participants based on con class, and realizes the distributed intercommunication model (DICM);

[0260] Below we explain the detailed design of three key technologies in the 3D co-simulation framework: heterogeneous grid mapping, explicit / implicit coupling scheme, and data communication function design;

[0261] Module 4. Heterogeneous grid mapping: Since different physical fields have very different requirements on grid type and density, and multi-physics coupling calculations often require parameter transfer at the interface; therefore, how to achieve accurate and efficient data transfer at the interface of heterogeneous grids is the key to solving three-dimensional multi-physics coupling analysis; To deal with this problem, the 3D coupler provides the following three methods for data transfer between heterogeneous grids: nearest neighbor mapping, nearest projection mapping, and radial basis function mapping;

[0262] By designing the base class Mapping, a basic framework for heterogeneous grid mapping is established, which provides a unified interface and basic functions for various specific mapping methods; it has the following methods:

[0263] Mapping constructor: initializes mapping constraints, dimensions, etc.;

[0264] setMeshes, getInputMesh, getOutputMesh: set and get meshes;

[0265] computeMapping, hasComputedMapping, hasConstraint, isScaledConsistent, requiresInitialGuess, initialGuess, clear: mapping related operations;

[0266] Map series methods: perform mapping operations;

[0267] tagMeshFirstRound and tagMeshSecondRound: mesh tagging operations;

[0268] scaleConsistentMapping: scale consistent mapping;

[0269] getName: returns the name of the mapping method;

[0270] The principle of nearest neighbor mapping is to find the node on the input grid that is closest to the node on the output grid in terms of geometric distance. The distance is usually Euclidean distance. Then, based on the nearest relationship found, the value of the node on the input grid is copied to the node on the output grid. The advantage of this method is that it is easy to implement and does not need to consider any grid information other than the node position, which can reduce memory consumption.

[0271] Based on the above theory, the NearestNeighborBaseMapping class is designed, which inherits from the Mapping class. The constructor contains information such as constraint (mapping constraint), dimensions (dimensions of the grid), hasGradient (whether it contains gradient information), mappingName and mappingNameShort (mapping name); it mainly has the following methods:

[0272] computeMapping: calculates mapping coefficients;

[0273] clear: delete the calculated mapping;

[0274] onMappingComputed: matches the offset of the gradient mapping;

[0275] tagMeshFirstRound and tagMeshSecondRound: tag mesh operations;

[0276] The NearestNeighborGradientMapping and NearestNeighborMapping classes inherit from NearestNeighborBaseMapping and are used for nearest neighbor gradient mapping and nearest neighbor mapping respectively. They overload the mapConservative and mapConsistent methods to implement specific mapping operations.

[0277] The closest projection mapping is suitable for situations where there are mesh elements, such as edges, triangles, or quadrilaterals, so the solver must provide a mesh; the principle of this method is to make an orthogonal projection from the node of the output mesh to the nearest element of the input mesh, and then for this nearest element, the data of the element nodes are added according to the weight by the area weighting method to calculate the value of the projection point;

[0278] Based on the above theory about the nearest projection mapping, the BarycentricBaseMapping class is designed, which inherits from Mapping, indicating that this is a geometry-based interpolation mapping class; the constructor has two parameters: constraint (mapping constraint) and dimensions (dimensions of the grid); the LinearCellInterpolationMapping class inherits from BarycentricBaseMapping, indicating that this is a cell mapping class based on linear interpolation; NearestProjectionMapping inherits from BarycentricBaseMapping, and implements linear interpolation of orthogonal projection to the nearest triangle / edge / vertex; the mapConservative and mapConsistent methods are overloaded to implement specific mapping operations;

[0279] Interpolation with radial basis functions is suitable for scattered data and does not require other information except the coordinates of the grid nodes; the interpolation result is defined as the weighted sum of the radial symmetric functions at the input grid nodes; the RadialBasisFunction class defines the interface and basic operations of the radial basis function and provides the basic functions for calculating the value of the radial basis function; through the evaluate method in the GaussianRBF class, a common radial basis function, the Gaussian radial basis function, can be specifically implemented; the RBFSolver class is responsible for calculating the coefficients of RBF interpolation and using these coefficients in interpolation; use RBFSolver::computeCoefficients to calculate the RBF coefficients required for interpolation; use RBFSolver::interpolate to interpolate the calculated coefficients for new data points; the RBFInterpolationMapping class inherits from the Mapping class, uses RBF for data mapping, and implements specific grid data mapping; the method computeMapping needs to be called to calculate and store the mapping relationship of the RBF interpolation; rewrite mapConsistent and mapConservative to use RBF interpolation to map the data consistently and conservatively;

[0280] Module 5. Explicit / implicit coupling scheme: In order to control the coupling behavior of multiple solvers, a general and easy-to-implement logic scheme needs to be implemented. This scheme that controls the entire coupling solution logic is called a coupling scheme. In order to facilitate the coupling simulation between domestic commercial software, a partition coupling scheme is adopted. At the same time, the use of partition coupling is also easier to achieve large-scale parallel computing and speed up the simulation. Partition coupling means that the control equations of fluids and solids are solved separately in their respective physical domains and coupled together by satisfying the boundary conditions of the interface. Through this technical solution, three-dimensional joint simulation of solvers with different data formats and different computational grids can be achieved. Partition coupling can be divided into serial coupling and parallel coupling according to the calculation order of the solver, and parallel coupling has higher computational efficiency. At the same time, explicit coupling schemes and implicit coupling schemes can be further derived.

[0281] Before designing a specific coupling scheme, an abstract base class is needed; the BaseCouplingScheme abstract base class is designed to define the basic interface and functions of the standard coupling scheme; the CouplingMode enumeration type defines the coupling mode (explicit, implicit, undefined); the constructor and various interface functions are used to perform the joint simulation process (such as initialize, finalize, advance, etc.); data sending and receiving, time window management, coupling status query and convergence detection and other functions; a large number of pointers and data structures are used internally to ensure the performance and efficiency of the coupling process (such as DataMap, PtrAcceleration, etc.);

[0282] Design the CouplingData coupling data class to manage data exchange related to specific grids and data; include functions such as data direction, dimension, size, gradient and time step storage; provide functions such as data initialization, window switching, and iterative storage; design the CouplingScheme class to define the interface of all coupling schemes; include static constants and action enumeration Action; define virtual functions such as initialization, data synchronization, data exchange and coupling status query;

[0283] At the same time, the BiCouplingScheme class and the MultiCouplingScheme class are designed. Both classes inherit the BaseCouplingScheme abstract base class to implement the dual-participant coupling scheme and the multi-participant coupling scheme respectively.

[0284] BiCouplingScheme inherits from BaseCouplingScheme and is used for a dual-participant coupling scheme; the constructor accepts the names of the two participants and the communication object m2n::PtrM2N; defines the interface functions addDataToSend and addDataToReceive for data sending and receiving;

[0285] MultiCouplingScheme inherits from BaseCouplingScheme and is used for multi-participant coupling schemes; the constructor accepts the names of multiple participants and the communication object map std::map<std::string,m2n::PtrM2N> ; Defines the management of data sending and receiving for multiple participants;

[0286] The ParallelCouplingScheme and SerialCouplingScheme classes are used for the specific implementation of parallel and serial coupling, respectively; they contain the specific logic of the parallel and serial coupling schemes, such as the sending and receiving of time window sizes, data exchange, and iteration acceleration functions;

[0287] The explicit coupling scheme is a method that directly calculates the interaction between physical processes. In this method, coupling is achieved by solving the equations of each physical process in turn in the time step and passing the results to other physical processes. The advantages of the explicit coupling scheme are that it is relatively simple and easy to understand, and the calculation speed is fast. However, the stability of the explicit coupling scheme requires a small time step, and sometimes reducing the time step does not increase the stability of the solution. The pseudo code flow of the explicit coupling algorithm is as follows:

[0288] 1. Initialization:

[0289] Call the initialize() method to set the initial time and time window;

[0290] 2. Advance time step:

[0291] Call the advance() method, and then call the firstSynchronization(), firstExchange(), secondSynchronization(), and secondExchange() methods in sequence;

[0292] 3. Data synchronization and exchange;

[0293] 4. Data sending and receiving:

[0294] Use sendData() and receiveData() methods to actually transfer data;

[0295] 5. End:

[0296] Call the finalize() method to end the coupling scheme;

[0297] The implicit coupling scheme uses an iterative method for calculation. Compared with the explicit coupling scheme, the implicit coupling scheme has better stability and convergence, and allows the use of a larger time step; however, the implicit coupling scheme may be more difficult in terms of computational complexity and implementation. For this reason, the three-dimensional coupler of this scheme develops a relaxation method and a quasi-Newton method based on iterative solution to speed up the solution convergence; the pseudo code of the implicit coupling algorithm is as follows:

[0298] 1. Initialization:

[0299] Call the initialize() method, set the initial time and time window, and perform initial data exchange;

[0300] 2. Advance time step:

[0301] Call the doImplicitStep() method to perform implicit iteration:

[0302] measureConvergence(): Checks whether the convergence conditions are met;

[0303] If not converged, repeat the data exchange exchangeFirstData() and exchangeSecondData();

[0304] 3. Data exchange and convergence detection:

[0305] Use sendConvergence() and receiveConvergence() to exchange and detect convergence information;

[0306] 4. End:

[0307] When hasConverged() returns true, call finalize() method to end the coupling scheme;

[0308] Module 6. Data Communication: Communication is the key part of data exchange and iterative solution. In actual coupling calculation, the basic communication methods required for coupling simulation mainly include MPI and Socket communication to ensure reliable and efficient data exchange between simulation software.

[0309] MPI is a commonly used communication library in parallel computing, used for data communication and synchronization between different processes; at the same time, MPI can also realize parallel computing between processes, improving the efficiency and performance of the entire coupled simulation; Socket communication is a commonly used communication method in computer networks, which is based on the TCP / IP protocol and allows data exchange between different processes;

[0310] Based on the two basic communication methods, a distributed intercommunication model is adopted to further realize the point-to-point communication method that supports large-scale parallel communication; compared with the traditional centralized intercommunication model, the use of point-to-point communication method reduces unnecessary communication overhead and load balances the communication of programs to a certain extent;

[0311] The base class M2N class of the M2N communication class is established to manage distributed communications in multiple grids; it encapsulates the logic related to primary and secondary level communications and supports complex multi-grid and multi-participant scenarios; the BoundM2N class is a specific M2N instance, based on the M2N class, used to manage communications between specific participants; this class effectively manages the entire communication life cycle from connection preparation, primary and secondary level connections to final resource cleanup through a series of methods such as prepareEstablishment(), connectPrimaryRanks(), connectSecondaryRanks(), and cleanupEstablishment(); the prepareEstablishment() method is responsible for initializing the resources and configuration required for the connection, co The connectPrimaryRanks() and connectSecondaryRanks() methods are used to establish the communication channel between the primary and secondary participants respectively, while preConnectSecondaryRanks() provides the pre-configuration function of the secondary connection to optimize the efficiency of connection establishment; finally, the cleanupEstablishment() method ensures that the necessary cleanup operations are performed after the connection is established to keep the system clean and efficient; in addition, waitForSecondaryRanks(), as a private method, ensures that the primary level will communicate only after all secondary levels are ready, thereby ensuring the synchronization and reliability of data transmission; through these methods, the BoundM2N class realizes simplified management and efficient execution of complex multi-participant communications;

[0312] DistributedComFactory provides a flexible framework to support multiple distributed communication mechanisms by defining interfaces for creating DistributedCommunication objects. Specific factory implementations such as GatherScatterComFactory and PointToPointComFactory create corresponding DistributedCommunication instances according to specific communication requirements. The DistributedCommunication class defines a complete set of interfaces that cover all necessary communication operations between distributed solvers, ensuring data transmission and synchronization between different participants. Based on DistributedCommunication, PointToPointCommunication inherits and extends the functions of distributed communication. PointToPointComFactory uses its key method newDistributedCommunication(mesh::PtrMesh mesh), using _comFactory to create a PointToPointCommunication instance to ensure efficient point-to-point communication support for a specific mesh; in the implementation of the PointToPointCommunication class, the acceptConnection and requestConnection methods are used to accept and request connections with remote participants, respectively, and these methods are used to set up communication channels; the send and receive methods handle the sending and receiving of data, support the transmission of double-precision arrays of specified dimensions, and ensure that data is accurately transmitted between participants; in addition, the broadcastSend and broadcastReceiveAll methods are used to broadcast and receive data between all connected participants, and the scatterAllCommunicationMap and gatherAllCommunicationMap methods handle the scattering and gathering of communication maps; the private method checkBufferedRequests is responsible for checking and completing all pending communication requests to ensure the integrity and synchronization of the communication process; through these detailed implementations, PointToPointComFactory and PointToPointCommunication provide powerful point-to-point communication capabilities and support complex multi-participant distributed computing scenarios;

[0313] Module 7. Toolkit module: In 3D co-simulation, in addition to the core algorithms, toolkit modules are also required to support the model analysis, intermediate format configuration file analysis, simulation data export and other functions;

[0314] When using 3D co-simulation, users need to upload two 3D models; model analysis is the basis of co-simulation, because all simulation settings, including data mapping, time control, global calculation, etc., need to be completed on the basis of understanding the parameters and input and output of the model;

[0315] Another research direction of this project is model format conversion. Based on the data format documents provided by manufacturers such as Maixi, we have completed the parsing and conversion of Maixi's model files; therefore, the 3D joint simulation component can directly support Maixi's model parsing; for other 3D software such as Qflux, there are many ways to implement the model parsing function, such as 1) directly providing model parsing / conversion tools; 2) providing data format documents; 3) providing coupling file instructions, etc., which can help the coupler parse the uploaded model;

[0316] XML parser, focusing on processing XML-formatted intermediate configuration files; five main classes are designed; ConfigParser is responsible for parsing XML files, managing tags and callbacks; XMLTag represents an XML tag, including the tag's name, attributes, subtags, and callback mechanism; XMLAttribute represents an attribute of an XML tag, including the attribute's name, default value, options, and validation function; ConfigurationContext is used to pass configuration context information, including name, order, and size; NoPListener is a listener class that does not perform any operations and is used for testing purposes;

[0317] ConfigParser is the main parser class responsible for reading and parsing XML files; the CTag structure is designed to represent an XML tag, including the tag name, prefix, whether to use tags, as well as attributes and sub-tags; two constructors are used for initialization with and without callbacks respectively; the readXmlFile method reads the XML file; the actual XML tags and predefined tags are connected through the connectTags method; the OnStartElement, OnEndElement, and OnTextSection methods handle the callback functions of the start tag, end tag, and text segment during the XML parsing process; the MessageProxy method is used to proxy the error and warning information of libxml2;

[0318] In order to meet the needs of users for post-processing with different software, 3D co-simulation supports exporting simulation result data in multiple different formats, including vtk, vtp, vtu and csv; the Export abstract base class is designed, which is the base class of all export classes and defines the pure virtual function doExport, which must be implemented in the subclass; the ExportCSV class, ExportVTK class, ExportVTP class, ExportVTU class and ExportXML class are designed to inherit Export and implement the doExport function for exporting various types of files.

[0319] An embodiment of the present invention proposes a joint simulation method between three-dimensional models of cloud-based chain tools based on the FMI standard, establishes a three-dimensional joint simulation system, realizes simulation integration and collaboration between different fields or different systems through a refined simulation process, manages the simulation process, and standardizes the three-dimensional joint simulation process, thereby reducing the difficulty of simulation, allowing three-dimensional joint simulation to be widely used in the simulation industry and making simulation results closer to real-world results.

[0320] The embodiments of the present invention have been described above, and the above description is exemplary, not exhaustive, and is not limited to the disclosed embodiments. Many modifications and changes will be apparent to those skilled in the art without departing from the scope and spirit of the described embodiments.

Claims

1. A joint simulation method between three-dimensional models of cloud-based chain tools based on the FMI standard, characterized in that: include: Establish a 3D joint simulation system to support the integration and collaboration of different simulation software; According to the requirements of data exchange and time synchronization between the different simulation software, the three-dimensional joint simulation system is divided into multiple modules; The multiple types of modules are used to integrate and collaborate simulation software in different fields or systems, and manage the three-dimensional joint simulation process.

2. The method according to claim 1, characterized in that The three-dimensional joint simulation system includes a coupling controller, at least two three-dimensional solvers, and an adapter matching each three-dimensional solver; Each 3D solver includes a 3D model, a solver, a simulation parameter module and a mesh module; The three-dimensional solvers perform grid mapping through the grid module; The coupling controller includes a global simulation control module, a coupling mode module, a grid control algorithm module, a simulation step time control module, a communication control module and a simulation parameter control module; The adapter is used to adapt models exported by different software for joint simulation, wherein the setting parameters include: parallel setting, input and output parameters, number of parameter mappings, number of computing cores, result output iteration interval, result output format, network type, mapping interface, and number of mapping interfaces; The setting parameters of the coupling controller include: simulation type, simulation market, simulation cycle size, number of simulation cycles, distributed computing, model dimension, relaxation factor, communication method, mesh geometry filtering level, mesh mapping algorithm, mesh mapping constraint and network type; The coupling methods set by the coupling mode module include: explicit-serial, explicit-parallel, implicit-serial and implicit-parallel methods. For the implicit-serial and implicit-parallel methods, the coupling methods set include: aitken algorithm, IQN-ILS algorithm and IQN-IMVJ algorithm; The three-dimensional joint simulation system supports time synchronization control, time step self-loop control, single / bidirectional coupling, multiple FMU modules, and surface coupling and volume coupling methods of three-dimensional physical fields.

3. The method according to claim 1, characterized in that: The operation process of the three-dimensional joint simulation system includes: Inputting a plurality of FMU files into the three-dimensional joint simulation system; Collaboratively perform initialization parameter configuration on the multiple FMU files; Build XML files and modify data files in 3D model configuration; Compressing the data file to the cloud; Performing three-dimensional joint simulation on the cloud; The results of the three-dimensional joint simulation are transmitted back and checked.

4. The method according to claim 1, characterized in that The multiple modules include basic grid modules, basic communication modules, core function modules, heterogeneous grid mapping modules, explicit / implicit coupling scheme modules, data communication modules and toolkit modules; The basic mesh class module belongs to the mesh class, and the mesh class includes the Vertex class and the Data class, which are used to store the coupled mesh and coupled data classes; The functions of the Data class include: initializing data objects, getting and setting data values ​​and gradients, managing time step storage, moving to the next time window, and allocating memory as needed; The data structure of the Data class includes data name, ID, dimension, spatial dimension and waveform information. When creating an object, it is pre-judged to ensure that dimensions are greater than 0; The Data class data structure is: The functions of the Data class include: values() and gradients() functions, which are used by users to access and modify sample data and gradients; sampleAtTime(double time) function, used to obtain the sample value at a specific time; setSampleAtTime(double time,const time::Sample&sample) function is used to set the sample value at the specified time; moveToNextWindow() function, used to advance the time step storage, ensure data synchronization with time and memory management; allocateValues(int expectedCount) function, which is used to dynamically adjust the size of data and gradients according to the expected number; toZero() function, used to reset all data values ​​and gradients to zero; requireDataGradient() function, used to enable gradient storage function; The data structure of the Vertex class is: The Vertex class includes a number of methods for managing vertex attributes, including getting and setting dimensions, global indexes, ownership status, and marking status; The code of the Vertex class overloads the output operator << and outputs the coordinates of the vertex in Well-Known Text (WKT) format through the formatted output function (v.getCoords().transpose().format(utils::eigenio::wkt())).

5. The method according to claim 4, characterized in that The basic communication modules include: com class, which defines the data communication abstraction layer and implementation, and implements the underlying functions of MPI communication and Sockets communication; Communication class, which defines the basic operations of the communication module, including initialization, sending and receiving data, and managing communication resources, and implements the specific functions of MPI or Sockets communication, including init(), finalize(), send(), and receive() functions, which are used to ensure the reasonable allocation and release of system resources before and after the communication starts and ends, and to ensure that data can be effectively transmitted between nodes; The SerializedMesh class is used for serialization and deserialization of mesh::Mesh mesh objects, including the following member variables: sizes: a vector containing the mesh dimensions, the number of vertices, edges, triangles and tetrahedrons; coords: a vector containing vertex coordinates; ids: contains global IDs, or pairs of global IDs and local IDs, defining local IDs of edges, triangles, and tetrahedrons, depending on the connectivity of the mesh; The SerializedConnectionMap class is responsible for serialization and deserialization of the ConnectionMap object, including a member variable: content: a vector containing the number of entries, rank and size of the entry; The SerializedBoundingBox class is responsible for the serialization and deserialization of mesh::BoundingBox objects, including one member variable: coords: a vector containing the bounding box coordinates; The SerializedBoundingBoxMap class is used for serialization and deserialization of BoundingBoxMap objects and includes two member variables: info: a vector containing the number of entries and dimensions; coords: a vector containing the bounding box coordinates; The SerializedStamples class is used for serialization and deserialization of coupled data and includes three member variables: _values: A vector storing serialized values ​​of time steps; _gradients: A vector storing serialized values ​​of gradients; _timeSteps: the number of time steps stored; The MPICommunication base class is used to provide basic MPI point-to-point communication, including subclasses MPIDirectCommunication, MPISinglePortsCommunication, and MPIPortsCommunication; SocketCommunication class, used to implement the Communication interface and use sockets for inter-process communication; SocketCommunicationFactory class, used to create SocketCommunication instances; SocketSendQueue class, used to manage the socket send queue to ensure the sequential execution of asynchronous send operations; SocketRequest class, used to manage asynchronous requests.

6. The method according to claim 4, characterized in that The core functional modules include: Mapping class, used to calculate the grid data mapping relationship between participants; cplscheme class, which is used to call coupling data and communication objects and implement coupling schemes for coupled simulations. It implements four coupling schemes for users: serial, parallel, implicit, and explicit. The acceleration class is used to provide acceleration solutions for solving nonlinear equations. It provides users with three different types of acceleration methods: normal sub-relaxation, adaptive sub-relaxation, and quasi-Newton variants. The m2n class defines the logical part of parallel communication between participants based on the con class and is used to implement a distributed intercommunication model.

7. The method according to claim 4, characterized in that The heterogeneous grid mapping module includes nearest neighbor mapping, nearest projection mapping and radial basis function mapping; The heterogeneous grid mapping module establishes a basic framework for heterogeneous grid mapping by designing a base class Mapping, which is used to provide a unified interface and basic functions for various specific mapping methods. The implementation method includes: Mapping constructor: initializes mapping constraints and dimensions; setMeshes, getInputMesh, getOutputMesh: set and get meshes; computeMapping, hasComputedMapping, hasConstraint, isScaledConsistent, requiresInitialGuess, initialGuess, clear: mapping related operations; Map series methods: perform mapping operations; tagMeshFirstRound and tagMeshSecondRound: mesh tagging operations; scaleConsistentMapping: scale consistent mapping; getName: returns the name of the mapping method; The nearest neighbor mapping is achieved by designing the NearestNeighborBaseMapping class, which inherits from the Mapping class. The constructor contains constraint, dimensions, hasGradient, mappingName and mappingNameShort information. The implementation method includes: computeMapping: calculates mapping coefficients; clear: delete the calculated mapping; onMappingComputed: matches the offset of the gradient mapping; tagMeshFirstRound and tagMeshSecondRound: tag mesh operations; The NearestNeighborGradientMapping and NearestNeighborMapping classes inherit from NearestNeighborBaseMapping and are used for nearest neighbor gradient mapping and nearest neighbor mapping respectively. They overload the mapConservative and mapConsistent methods to implement specific mapping operations. The nearest projection mapping is achieved by designing the BarycentricBaseMapping class, which inherits from Mapping. The constructor has two parameters: constraint and dimensions. The implementation method includes: Use the LinearCellInterpolationMapping class to inherit BarycentricBaseMapping and define a cell mapping class based on linear interpolation; Use NearestProjectionMapping to inherit BarycentricBaseMapping to implement linear interpolation of orthogonal projection to the nearest triangle / edge / vertex; Overload mapConservative and mapConsistent to implement specific mapping operations; The radial basis function mapping is implemented by the evaluate method in the GaussianRBF class, and the implementation method includes: Use the RBFSolver class to calculate the coefficients of RBF interpolation and use these coefficients during interpolation; Use RBFSolver::computeCoefficients to calculate the RBF coefficients required for interpolation; Use RBFSolver::interpolate to interpolate the calculated coefficients to the new data points; The RBFInterpolationMapping class inherits from the Mapping class and uses RBF for data mapping to achieve specific grid data mapping; Call the computeMapping method to calculate and store the mapping relationship of RBF interpolation; Override mapConsistent and mapConservative to use RBF interpolation to consistently and conservatively map the data.

8. The method according to claim 4, characterized in that The explicit / implicit coupling scheme module adopts a partition coupling technical solution; The partition coupling is divided into serial coupling and parallel coupling according to the calculation order of the solver; The parallel coupling derives explicit coupling scheme and implicit coupling; The classes required for implementing the coupling scheme of the explicit / implicit coupling scheme module include: BaseCouplingScheme abstract base class, used to define the basic interface and functions of the standard coupling scheme; CouplingMode enumeration class, used to define the coupling mode; CouplingData coupling data class is used to manage data exchange related to specific grids and data; The BiCouplingScheme class and the MultiCouplingScheme class both inherit the BaseCouplingScheme abstract base class and are used to implement the dual-participant coupling scheme and the multi-participant coupling scheme respectively; The BiCouplingScheme class, inherited from BaseCouplingScheme, is used for the coupling scheme of two participants; The MultiCouplingScheme class, inherited from BaseCouplingScheme, is used for multi-participant coupling schemes; ParallelCouplingScheme and SerialCouplingScheme classes, which are used for the specific implementation of parallel and serial coupling respectively; The pseudo code flow of the algorithm for display coupling includes: (1) Initialization: Call the initialize() method to set the initial time and time window; (2) Advancing time step: Call the advance() method, and then call the firstSynchronization(), firstExchange(), secondSynchronization(), and secondExchange() methods in sequence; (3) Data synchronization and exchange; (4) Data sending and receiving: Use sendData() and receiveData() methods to actually transfer data; (5) End: Call the finalize() method to end the coupling scheme; The implicitly coupled algorithm pseudo code includes: (1) Initialization: Call the initialize() method, set the initial time and time window, and perform initial data exchange; (2) Advancing time step: Call the doImplicitStep() method to perform implicit iteration: measureConvergence(); Check whether the convergence conditions are met; If not converged, repeat the data exchange exchangeFirstData() and exchangeSecondData(); (3) Data exchange and convergence detection: Use sendConvergence() and receiveConvergence() to exchange and detect convergence information; (4) End: When hasConverged() returns true, call finalize() to end the coupling scheme.

9. The method according to claim 4, characterized in that The data communication module is based on two basic communication modes, MPI and Socket, and adopts a distributed intercommunication model to realize a point-to-point communication mode that supports large-scale parallel communication; The base class M2N management of the distributed intercommunication model communication class; The base class M2N is implemented by the BoundM2N class, and the implementation method includes: Manages the entire communication lifecycle from connection preparation, primary and secondary ranking connections to final resource cleanup using prepareEstablishment(), connectPrimaryRanks(), connectSecondaryRanks(), and cleanupEstablishment(); Use the prepareEstablishment() method to initialize the resources and configuration required for the connection; Establish communication channels between primary and secondary participants via connectPrimaryRanks() and connectSecondaryRanks(); Use preConnectSecondaryRanks() to provide pre-configuration of secondary connections; Use the cleanupEstablishment() method to ensure that necessary cleanup operations are performed after the connection is established to keep the system clean and running efficiently; Use waitForSecondaryRanks() to ensure that the primary level will communicate only after all secondary levels are ready, thereby ensuring the synchronization and reliability of data transmission.

10. The method according to claim 4, characterized in that The toolkit module is used for model parsing, intermediate format configuration file parsing, and simulation data export; The model analysis is used to analyze uploaded multiple three-dimensional models to facilitate joint simulation; When the intermediate format configuration file is in XML format, parsing is performed using an XML parser; The XML parser includes: ConfigParser, used to read and parse XML files, manage tags and callbacks; XMLTag, represents an XML tag, including the tag name, attributes, subtags and callback mechanism; XMLAttribute, which represents an attribute of an XML tag, including the attribute name, default value, options, and validation function; ConfigurationContext, used to pass configuration context information, including name, order, and size; NoPListener, as a listener class that does not perform any operations, for testing purposes; The parsing process of the XML parser includes: Read the XML file through the readXmlFile method; Connect the actual XML tags and predefined tags through the connectTags method; Use the OnStartElement, OnEndElement, and OnTextSection methods to handle the callback functions of the start tag, end tag, and text segment during XML parsing; Use the MessageProxy method to proxy libxml2's error and warning messages; The simulation data export formats include vtk, vtp, vtu and csv; The implementation process of exporting the simulation data includes: Design the Export abstract base class as the base class for all exported classes; Define the pure virtual function doExport and implement it in the subclass; Design ExportCSV class, ExportVTK class, ExportVTP class, ExportVTU class and ExportXML class, inherit Export, implement doExport function, and export various types of files.

Citation Information

Cited By

  • Joint simulation test system for grid-connected compatibility of grid-forming type energy storage power station

    CN122394060A

  • A joint simulation test system for grid-connected compatibility of grid-connected energy storage power stations

    CN122394060B