Co-simulation method and apparatus based on functional model units
By establishing point-to-point direct communication links in complex industrial systems and using the zero-order hold algorithm, the computational divergence problem in multi-scale multiphysics simulation is solved, achieving robust real-time co-simulation and improving computational robustness and real-time inference performance.
Patent Information
- Application Number
- CN202611331095.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2026-08-31
- Publication Date
- 2026-11-10
- Estimated Expiration
- 2046-08-31
AI Technical Summary
Existing technologies suffer from problems such as solver Jacobian matrix deviation, sudden step size reduction, and global divergence when performing high-fidelity, real-time simulations of multi-scale and multi-physics characteristics of complex industrial systems. Furthermore, they suffer from high communication latency, rigid interface topology configuration, and a lack of exception handling mechanisms.
By establishing a point-to-point direct communication link between the one-dimensional system thermal-hydraulic model and the three-dimensional fluid-structure dynamics model, data exchange is carried out using functional model units (FMUs). Zero-order hold (ZOH) and time barrier algorithms are adopted to suspend the data interaction of the underlying sockets under asynchronous timing, ensuring smooth collaborative simulation under a unified time barrier.
It achieves robust real-time co-simulation, eliminates dependence on third-party main control buses, reduces underlying communication latency, avoids computational divergence, and improves computational robustness and real-time inference performance.
Smart Images

Figure CN122864259B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of data processing technology, and more specifically, to a co-simulation method and apparatus based on functional model units. Background Technology
[0002] As complex industrial systems such as marine nuclear power systems and large-scale thermal-hydraulic networks move towards digitalization and intelligence, high-fidelity, real-time simulation of the multi-scale, multi-physics characteristics of these systems under extreme transient conditions (such as alternating inertial force fields and large load steps) has become a core component of digital twin platform construction and hardware-in-the-loop control strategy verification. For complex power systems including reactor cores, steam generators, and secondary loop networks, a single solution dimension is insufficient to balance global evolution efficiency with local high fidelity. Therefore, it is necessary to co-simulate heterogeneous physical models of different dimensions, such as one-dimensional thermal-hydraulic models and three-dimensional fluid-structure dynamics models. However, when a one-dimensional thermal-hydraulic model is solved using an implicit variable-step integrator, it undergoes a large number of micro-exploratory step calculations during the process. If new boundary data is introduced through the network during this period, it will cause the solver's Jacobian matrix to deviate, the step size to shrink abruptly, or even global divergence and collapse. In addition, the related co-simulation architecture also suffers from technical problems such as high communication latency, rigid interface topology configuration, and a lack of anomaly handling mechanisms.
[0003] Therefore, how to effectively isolate the interference of the solver's trial step and achieve the coordinated advancement of highly robust real-time co-simulation has become a technical problem that the industry urgently needs to solve. Summary of the Invention
[0004] This application provides a co-simulation method and apparatus based on functional model units to solve the technical problem of effectively isolating solver trial step interference and achieving robust real-time co-simulation in the collaborative process.
[0005] Firstly, this application provides a co-simulation method based on functional model units, applied to a simulation system. The simulation system includes a first functional model unit for a one-dimensional system thermal-hydraulic model, a one-dimensional simulation solver, and a second functional model unit for a three-dimensional fluid-structure dynamics model. A point-to-point direct communication link is established between the first and second functional model units. The method includes: When the first functional model unit receives a data call request sent by the one-dimensional simulation solver, the target simulation time corresponding to this call is determined; If the target simulation time is less than the exchange trigger time between the first functional model unit and the second functional model unit, the cross-process data interaction of the underlying socket of the first functional model unit is suspended. The exchange trigger time is the difference between the next data exchange time and the preset tolerance. When the target simulation time is greater than or equal to the exchange trigger time, the suspended state of the underlying socket is released, the first functional model unit and the second functional model unit are controlled to exchange boundary data, and the state of the object to be simulated at the target simulation time is simulated based on the boundary data.
[0006] In some embodiments, when the target simulation time is less than the exchange trigger time between the first functional model unit and the second functional model unit, the method further includes: Intercept network communication and data retrieval requests of the underlying socket; Zero-order preservation is performed on the three-dimensional boundary data sent by the second functional model unit that the first functional model unit received at the last data exchange time.
[0007] In some embodiments, after performing zero-order preservation on the three-dimensional boundary data sent by the second functional model unit received by the first functional model unit at the last data exchange time, the method further includes sending the three-dimensional boundary data to the one-dimensional simulation solver.
[0008] In some embodiments, the functional model unit is either the first functional model unit or the second functional model unit, and the functional model unit is obtained based on the following steps: Obtain the number of pre-configured interface variables and communication parameters; Source code is generated based on the number of interface variables and the communication parameters. The source code defines the underlying socket communication logic and functional model interface standard. Compile the source code into a dynamic link library; Based on the dynamic link library and model description file, generate functional model units that conform to the functional model interface standard.
[0009] In some embodiments, the point-to-point direct communication link is established based on the following steps: A Transmission Control Protocol (TCP) listening socket is created based on the underlying socket, and the TCP listening socket is bound to a preset port, so that the first functional model unit enters the listening state. The second functional model unit is controlled to initiate a connection request to the preset port; After the first functional model unit and the second functional model unit are successfully connected, the no-delay option is enabled in the network protocol stack to disable the data splicing and sending algorithm in order to establish the point-to-point direct communication link.
[0010] In some embodiments, controlling the exchange of boundary data between the first functional model unit and the second functional model unit includes: Configure fixed-length floating-point arrays of the same size for the first functional model unit and the second functional model unit respectively; Based on the fixed-length floating-point array and the bit-addressing of contiguous memory blocks across processes, the latest one-dimensional boundary data determined by the first functional model unit is written into the second functional model unit, and the latest three-dimensional boundary data determined by the second functional model unit is written into the first functional model unit.
[0011] In some embodiments, the boundary data includes the latest one-dimensional boundary data and the latest three-dimensional boundary data, and the simulation of the state of the object to be simulated at the target simulation time based on the boundary data includes: The latest three-dimensional boundary data is obtained, which includes translational acceleration, angular velocity, and angular acceleration extracted based on the scale model; The translational acceleration is retained at its original ratio, while the angular velocity and angular acceleration are amplified based on a preset scaling factor to obtain full-size dynamic parameters. The state of the object to be simulated at the target simulation time is simulated based on the full-size dynamic parameters and the latest one-dimensional boundary data.
[0012] In some embodiments, it also includes: When the functional model unit is in a preset working stage, a status information packet is broadcast to a preset local address; The status information package includes the current simulation timestamp and the current call stage identifier of the functional model unit, and the preset working stages include the network blocking waiting stage and the boundary data exchange completion stage.
[0013] In some embodiments, after broadcasting the status information packet to the preset local address, the method further includes: If the simulation time deviation between the first functional model unit and the second functional model unit is greater than a preset time deviation threshold, and / or the response timeout duration of the functional model unit is greater than a preset anti-disconnection threshold, the point-to-point direct communication link shall be interrupted.
[0014] Secondly, this application provides a co-simulation device based on functional model units, applied to a simulation system. The simulation system includes a first functional model unit for a one-dimensional system thermal-hydraulic model, a one-dimensional simulation solver, and a second functional model unit for a three-dimensional fluid-structure dynamics model. A point-to-point direct communication link is established between the first functional model unit and the second functional model unit. The device includes: The calling module is used to determine the target simulation time corresponding to this call when the first functional model unit receives a data call request sent by the one-dimensional simulation solver; The suspension module is used to suspend the cross-process data interaction of the underlying socket of the first functional model unit when the target simulation time is less than the exchange trigger time between the first functional model unit and the second functional model unit. The exchange trigger time is the difference between the next data exchange time and a preset tolerance. The interaction module is used to release the suspended state of the underlying socket when the target simulation time is greater than or equal to the exchange trigger time, control the first functional model unit and the second functional model unit to exchange boundary data, and simulate the state of the object to be simulated at the target simulation time based on the boundary data.
[0015] The co-simulation method and apparatus based on functional model units provided in this application can eliminate dependence on third-party master buses and reduce underlying communication latency by establishing a point-to-point direct communication link between the first and second functional model units. By suspending the data interaction of the underlying socket when the target simulation time is less than the exchange trigger time, data interference under asynchronous timing can be blocked at the physical level, avoiding computational divergence of the one-dimensional simulation solver due to boundary step. By releasing the suspension and exchanging boundary data when the target simulation time is greater than or equal to the exchange trigger time, the smooth coordination of the one-dimensional system thermal-hydraulic model and the three-dimensional fluid-structure dynamics model under a unified time wall can be ensured, thereby improving the computational robustness and real-time inference performance of the co-simulation. Attached Figure Description
[0016] To more clearly illustrate the technical solutions in this application or related technologies, the drawings used in the description of the embodiments or related technologies will be briefly introduced below. Obviously, the drawings described below are some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0017] Figure 1 This is a flowchart illustrating the co-simulation method based on functional model units provided in the embodiments of this application.
[0018] Figure 2 A schematic diagram of the simulation system provided in the embodiments of this application.
[0019] Figure 3 This is a schematic diagram of the graphical user interface of the FMU automated packaging, compilation, and co-simulation main control platform provided in the embodiments of this application.
[0020] Figure 4 This is a schematic diagram of the internal structure of the FMU co-simulation working folder and components provided in the embodiments of this application.
[0021] Figure 5 This is a schematic diagram of the structure of a one-dimensional system thermal-hydraulic model provided in an embodiment of this application.
[0022] Figure 6 A schematic diagram of the modeling of the three-dimensional fluid-structure dynamics model provided in the embodiments of this application.
[0023] Figure 7 This is a schematic diagram of the transient attitude simulation of a ship under wave load provided in an embodiment of this application.
[0024] Figure 8 The transient curve of X-axis translational acceleration provided in the embodiments of this application.
[0025] Figure 9 The transient curve of Z-axis translational acceleration provided in the embodiments of this application.
[0026] Figure 10 The transient curves of X and Y axis angular acceleration provided in the embodiments of this application.
[0027] Figure 11 The transient curves of X and Y axis angular velocity are provided for embodiments of this application.
[0028] Figure 12 The transient curves of Euler angles on the X and Y axes provided in the embodiments of this application.
[0029] Figure 13 The transient response curve of the total mass flow rate of the object to be simulated is provided for the embodiments of this application.
[0030] Figure 14 The transient response curve of the deaerator mass flow rate provided in the embodiments of this application.
[0031] Figure 15 The transient response curve of the high-pressure cylinder output power provided in the embodiments of this application.
[0032] Figure 16 The transient response curve of the low-pressure cylinder output power provided in the embodiments of this application.
[0033] Figure 17 The transient response curve of the output steam flow rate of the steam-water separator provided in the embodiments of this application.
[0034] Figure 18 The transient response curve of the output water flow rate of the steam-water separator provided in the embodiments of this application.
[0035] Figure 19 The transient response curve of the condenser output flow provided in the embodiment of this application.
[0036] Figure 20 The transient response curve of the condenser output specific enthalpy provided in the embodiments of this application.
[0037] Figure 21 This is a schematic diagram of the structure of a co-simulation device based on functional model units provided in an embodiment of this application.
[0038] Figure 22 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation
[0039] To make the objectives, technical solutions, and advantages of this application clearer, the technical solutions of this application will be clearly and completely described below with reference to the accompanying drawings of the embodiments. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0040] It should be noted that the terms "first," "second," etc., used in this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this application described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or device that includes a series of steps or modules is not necessarily limited to those steps or modules explicitly listed, but may include other steps or modules not explicitly listed or inherent to such processes, methods, products, or devices.
[0041] Figure 1 A flowchart illustrating the co-simulation method based on functional model units provided in this application embodiment is shown below. Figure 1 As shown, the method includes steps 110 to 130. These method steps are merely one possible implementation of this application.
[0042] Step 110: When the first functional model unit receives a data call request sent by the one-dimensional simulation solver, determine the target simulation time corresponding to this call.
[0043] Specifically, the co-simulation method based on functional model units provided in this application embodiment is applied to a simulation system, which can be deployed in a computer device.
[0044] like Figure 2 As shown, the simulation system includes a first functional model unit of a one-dimensional system thermal-hydraulic model, a one-dimensional simulation solver, and a second functional model unit of a three-dimensional fluid-structure dynamics model. A point-to-point direct communication link is established between the first functional model unit and the second functional model unit.
[0045] The execution subject of the co-simulation method based on functional model units provided in this application embodiment is a co-simulation device based on functional model units. This device can be a hardware device set independently in the simulation system, or it can be a software program running in the simulation system.
[0046] The one-dimensional system thermal-hydraulic model of this application embodiment is a mathematical model used to describe the fluid flow and heat transfer characteristics of a thermal-hydraulic system.
[0047] A one-dimensional simulation solver is an integrator that loads and drives the first functional model unit to perform time-progression calculations. It is used to solve the differential-algebraic equations of a one-dimensional system thermal-hydraulic model. The one-dimensional simulation solver can be an implicit variable-step integrator such as the Differential / Algebraic System Solver (DASSL) built into software such as Dynamic Modeling Laboratory (Dymola).
[0048] Three-dimensional fluid-structure dynamics models are mathematical models used to describe the interaction between fluids and solid structures, and can calculate the six degrees of freedom motion of an object in a fluid.
[0049] A Functional Mock-up Unit (FMU) is a standardized simulation component that is packaged according to the Functional Mock-up Interface (FMI) standard and includes a model description file and executable code. In this application, the FMU refers to either the first functional model unit or the second functional model unit.
[0050] A point-to-point direct communication link refers to a communication connection established directly between the first functional model unit and the second functional model unit without going through a third-party middleware, used to realize direct data exchange between the two.
[0051] A data retrieval request is a retrieval instruction sent by the one-dimensional simulation solver to the first functional model unit as the simulation progresses, in order to obtain the boundary data required for the current simulation.
[0052] To ensure the efficiency of the overall system simulation, the one-dimensional system thermal-hydraulic model typically sets a relatively large macroscopic communication step size. Within this macroscopic communication step size, a variable step-size integrator within the one-dimensional simulation solver is used for microscopic exploration to advance the simulation. During the simulation, each time the one-dimensional simulation solver calls the state stepping interface of the first functional model unit, it sends a data call request. The data call request carries the current absolute integration time currentCommunicationPoint and the current attempt to advance step size communicationStepSize. The current attempt to advance step size is the microscopic exploration step, which is the time step size of a single attempt by the one-dimensional simulation solver to calculate forward.
[0053] After receiving a data request, the first functional model unit will calculate and determine the target simulation time target_time based on the current absolute integration time and the current step size for advancing, as shown in the following formula: target_time=currentCommunicationPoint+communicationStepSize; Meanwhile, the kernel of the co-simulation device maintains a physical exchange time wall generated by accumulating the set macroscopic communication step size. The physical exchange time wall is the next data exchange time next_exchange_time, so as to facilitate the subsequent definition of macroscopic and microscopic timing synchronization.
[0054] Step 120: If the target simulation time is less than the exchange trigger time between the first functional model unit and the second functional model unit, suspend the cross-process data interaction of the underlying socket of the first functional model unit. The exchange trigger time is the difference between the next data exchange time and the preset tolerance.
[0055] Specifically, the preset tolerance refers to a very small rounding tolerance (Epsilon, EPS) pre-set to absorb rounding errors in computer floating-point operations when judging the relationship between the target simulation time and the next data exchange time. Its value is several orders of magnitude smaller than the minimum effective time step of the simulation system. The low-level socket is a programming interface used for network communication. In this application, it is used to realize cross-process data transmission between the first functional model unit and the second functional model unit. When it is in a suspended state, it will no longer receive external boundary data.
[0056] When the target simulation time is less than the difference between the next data exchange time and the preset tolerance, i.e. the exchange trigger time, it proves that the current call belongs to the variable step size micro-exploration stage or the Jacobian matrix correction stage of the one-dimensional simulation solver. At this time, in order to prevent the introduction of external boundary data at asynchronous time from causing the internal micro-exploration to diverge, the time barrier algorithm built into the co-simulation device will intervene and suspend the cross-process data interaction of the bottom socket of the first functional model unit, thereby physically blocking the micro-exploration step and intercepting the second functional model unit from sending new three-dimensional boundary data to the first functional model unit.
[0057] Step 130: When the target simulation time is greater than or equal to the exchange trigger time, release the suspended state of the underlying socket, control the first functional model unit and the second functional model unit to exchange boundary data, and simulate the state of the object to be simulated at the target simulation time based on the boundary data.
[0058] Specifically, boundary data refers to the physical quantity parameters exchanged between the first functional model unit and the second functional model unit, which are used to drive the calculation of the other model.
[0059] The object to be simulated refers to a physical system that needs to be jointly simulated, characterized by a one-dimensional system thermal-hydraulic model and a three-dimensional fluid-structure dynamics model.
[0060] When the one-dimensional simulation solver converges internally and the target simulation time is greater than or equal to the exchange trigger time, the suspended state is released, i.e., the time barrier is removed. At this time, the first functional model unit initiates a single blocking bidirectional data exchange. For example, the first functional model unit initiates a data exchange based on the Transmission Control Protocol (TCP) through a point-to-point direct communication link, sending the feedback variables of the one-dimensional system thermal-hydraulic model, i.e. the latest one-dimensional boundary data, to the second functional model unit. The second functional model unit injects the received latest one-dimensional boundary data into the three-dimensional fluid-structure dynamics model and pulls the latest three-dimensional boundary data to send to the first functional model unit.
[0061] After the boundary data of the first and second functional model units are successfully interchanged, the one-dimensional simulation solver updates the one-dimensional system thermal-hydraulic model using the latest three-dimensional boundary data, and the three-dimensional simulation solver updates the three-dimensional fluid-structure dynamics model using the latest one-dimensional boundary data, thereby completing the state simulation of the object to be simulated at the target simulation time. In addition, the physical exchange time wall is automatically pushed back by one macroscopic communication step, thereby starting the next round of joint simulation of the first and second functional model units. The three-dimensional simulation solver is the solver built into the three-dimensional system simulation software. The three-dimensional system simulation software in this embodiment is the three-dimensional computational fluid dynamics (CFD) software.
[0062] The co-simulation method based on functional model units provided in this application eliminates dependence on third-party master buses and reduces underlying communication latency by establishing a point-to-point direct communication link between the first and second functional model units. By suspending the data interaction of the underlying socket when the target simulation time is less than the exchange trigger time, data interference under asynchronous timing can be blocked at the physical level, avoiding computational divergence of the one-dimensional simulation solver due to boundary step jumps. By releasing the suspension and exchanging boundary data when the target simulation time is greater than or equal to the exchange trigger time, smooth collaboration between the one-dimensional system thermal-hydraulic model and the three-dimensional fluid-structure dynamics model under a unified time wall can be ensured, thereby improving the computational robustness and real-time inference performance of the co-simulation.
[0063] It should be noted that each implementation method of this application can be freely combined, rearranged, or executed individually, and does not need to rely on or depend on a fixed execution order.
[0064] In some embodiments, when the target simulation time is less than the exchange trigger time between the first functional model unit and the second functional model unit, the method further includes: Intercept network communication and data retrieval requests from the underlying socket; The zero-order preservation is performed on the three-dimensional boundary data sent by the second functional model unit received by the first functional model unit at the last data exchange time, and the three-dimensional boundary data is sent to the one-dimensional simulation solver.
[0065] Specifically, three-dimensional boundary data refers to the dynamic parameters calculated by the three-dimensional fluid-structure dynamics model, including translational acceleration, angular velocity, and angular acceleration. Zero-order hold (ZOH) refers to the method of continuously outputting the boundary data received at the time of the previous exchange as a constant value between two data exchanges between the first functional model unit and the second functional model unit, without performing any interpolation or extrapolation.
[0066] In co-simulation, the one-dimensional simulation solver of the internally driven one-dimensional system thermal-hydraulic model will perform extremely high-frequency micro-variable step-size probing when solving nonlinear algebraic equations. If new three-dimensional boundary data is forcibly introduced through network interaction during the probing step, it will cause the Jacobian matrix to deviate severely and thus trigger a global divergence collapse. To address this, this application embeds the ZOH time barrier algorithm in the state stepping interface of the first functional model unit imported as a component, such as the standard interface fmi2DoStep.
[0067] When the target simulation time is less than the exchange trigger time, the ZOH time barrier intervenes. This intervention operation includes two aspects: First, it directly suspends and intercepts any TCP network communication and external data retrieval requests of the underlying socket; second, it performs ZOH processing on the three-dimensional boundary data sent by the second functional model unit that was successfully received at the last data exchange time, outputs it as a constant boundary as is and sends it to the one-dimensional simulation solver, and immediately returns a normal step signal, such as the fmi2OK status code in the FMI standard. This mechanism builds a stable local iterative environment for the one-dimensional simulation solver and avoids system deadlock caused by small external disturbances.
[0068] The co-simulation method based on functional model units provided in this application can physically block the high-frequency probing of one-dimensional simulation solvers by embedding the ZOH time barrier algorithm at the bottom layer of the FMU. This can overcome the problem that multi-rate rigid solvers are prone to divergence and collapse, and achieve smooth bridging across multiple scales. By ignoring the strict timestamps and forcing the micro-probing step size to correspond synchronously with the macro-communication step size, such as forcing the 0.01s micro-probing step size of the second functional model unit to correspond with the 0.1s macro-communication step size of the first functional model unit, the computationally intensive three-dimensional fluid computation can drive global inference with only one-tenth of the original overhead. This solves the problem of serious waste of computing resources caused by time step scaling in traditional coupling.
[0069] In some embodiments, in addition to the ZOH method described above, the operation of processing the received boundary data and sending it to the solver can also employ First-Order Hold (FOH) based on historical gradients for linear extrapolation, or dynamic boundary smoothing techniques such as high-order spline interpolation prediction. Furthermore, for simulation systems with extremely high rigidity or extremely severe nonlinearity, the explicit loose coupling of exchanging boundary data once per macroscopic communication step can be extended to implicit strong coupling, that is, multiple TCP bidirectional communication iterations are performed within the same macroscopic communication step until the boundary residuals converge before the time wall is moved. Therefore, any time control logic that can physically block trial step interference and solve the clock alignment problem of heterogeneous solvers can be applied to the method of this application.
[0070] In some embodiments, the functional model unit is a first functional model unit or a second functional model unit, and the functional model unit is obtained based on the following steps: Obtain the number of pre-configured interface variables and communication parameters; The source code is generated based on the number of interface variables and communication parameters. The source code defines the underlying socket communication logic and functional model interface standard. Compile the source code into a dynamic link library; Functional model units conforming to the functional model interface standard are generated based on dynamic link libraries and model description files.
[0071] Specifically, the number of interface variables refers to the number of input and output variables that need to be exchanged between the first functional model unit and the second functional model unit, as pre-configured by the user.
[0072] Communication parameters refer to the network parameters that users pre-configure to establish point-to-point direct communication links.
[0073] A Dynamic Link Library (DLL) is an executable binary file generated by compiling source code and can be dynamically loaded at runtime, containing all the computational logic of the FMU.
[0074] A model description file is an Extensible Markup Language (XML) format file that conforms to the FMI standard. It is used to describe the input and output variables, parameters, and model properties of the FMU.
[0075] Functional Model Interface (FMU) standards are open interface specifications used to enable interoperability between models of different simulation tools. They define the encapsulation format, calling interface, and data exchange method of the FMU.
[0076] The embodiments of this application do not rely on a third-party co-simulation master control platform, but instead use a generation engine to generate a peer-to-peer communication carrier, namely FMU.
[0077] Figure 3 This is a schematic diagram of the graphical user interface of the FMU automated packaging, compilation, and co-simulation main control platform provided in the embodiments of this application, as shown below. Figure 3 As shown, users can configure the bidirectional communication interface topology in the Graphical User Interface (GUI). Specifically, they can define the data interface topology of the solver corresponding to the FMU with one click in the variable and communication parameter configuration area to obtain relevant parameters. The first functional model unit will be loaded into the one-dimensional system simulation software and called by the one-dimensional simulation solver, and the second functional model unit will be loaded into the three-dimensional CFD software and driven by the three-dimensional simulation solver.
[0078] It can obtain the number of interface variables between the first functional model unit and the second functional model unit set by the user in the GUI, that is, the number of interface variables between the 3D CFD software (such as Fluent) and the 1D system simulation software (such as Dymola). For example, the number of six-degree-of-freedom parameters extracted by the second functional model unit as a detector and sent to the 1D system simulation software corresponding to the first functional model unit; it can also obtain the number of interface variables between the 1D system simulation software and the 3D CFD software, such as the number of system reaction forces and mass flow rates calculated by the 1D system simulation software for components and fed back to the 3D CFD software.
[0079] Simultaneously, it acquires the set communication parameters, including macroscopic communication step size, microscopic probe step size (such as Fluent step size), and the binding network interconnection protocol (Internet Protocol, IP) address and dedicated TCP port number for cross-process or cross-platform communication, such as... Figure 3 The interlocked communication port 50505, total analog duration, and coupling synchronization strategies such as ZOH frequency scaling synchronization are included.
[0080] After the parameters are acquired and configured, the generation engine automatically parses the number of input interface variables and communication parameters in the background, and automatically splices and overloads them using a preset C++ language code template to generate the underlying source code. This source code not only automatically integrates the underlying socket communication logic and ZOH time barrier logic, but also overloads the functional model interface standard, that is, it defines the functional model interface standard. For example, it defines the core interface functions required by the FMI2.0 standard specification, such as the instantiation interface fmi2Instantiate, the state stepping interface fmi2DoStep, and the instance release interface fmi2FreeInstance. Subsequently, the generation engine calls the Cross-Platform Make (CMake) toolchain and the Microsoft Visual C++ (MSVC) compiler to compile the source code into a cross-platform dependency-free DLL in a static linking manner.
[0081] Figure 4 This is a schematic diagram of the FMU co-simulation working folder and the internal structure of the components provided in the embodiments of this application, as shown below. Figure 4As shown, after compiling the DLL file, the generation engine uses a Universally Unique Identifier (UUID) to generate a unique model identifier and automatically generates a matching model description file, namely the XML format modelDescription.xml file located in the FMU root directory. Finally, this XML file is packaged together with the binary DLL file placed in a specific level directory (such as binaries / win64) to generate an independent .fmu file conforming to the FMI standard, which is the final generated FMU entity of this application. Figure 4 The files Dymola_Coupler.fmu and Fluent_Coupler.fmu are mentioned.
[0082] In this embodiment, the generated FMU is no longer a black box that passively accepts scheduling from the main control platform, but an intelligent plug-in with embedded active network communication capabilities. The FMU file is imported as a dynamic boundary receiving component into the graphical modeling interface of the one-dimensional system simulation software, which represents the pipeline topology and component connection relationship, as the first functional model unit. It is also loaded into the computational domain of the three-dimensional CFD software as a data detector and transmitter through the FMI interface or the corresponding encapsulator as the second functional model unit.
[0083] The generation engine can also be written in languages such as Java, Go, or C#; the generated FMU can also be compatible with the newer FMI 3.0 standard, which supports more granular clock synchronization and virtual time events; it can even be not limited to the FMI specification, but can generate customized components that are directly compatible with other system simulation tool modules, such as Simulink S-Function, Matrix Lab executable files (MATLAB MEX, MEX), or non-standard self-developed interfaces. As long as a decentralized component plus detector peer-to-peer plug-in architecture is adopted, rather than relying on a huge third-party centralized master bus, it is within the scope of protection of this application.
[0084] The co-simulation method based on functional model units provided in this application provides an end-to-end graphical automated generation engine to parse parameters and automatically generate source code containing communication logic. This breaks through the rigid interface in traditional hard-coded coupling and the limitation that a one-dimensional system thermal-hydraulic model and a three-dimensional fluid-structure dynamics model must be completely reconstructed. It enables adaptive configuration of bidirectional interface topology for heterogeneous models. By automatically compiling the source code and packaging it into standardized FMU communication nodes with peer architecture, it can reduce the engineering deployment threshold and development cost of heterogeneous multiphysics co-simulation and realize plug-and-play FMU, a network communication carrier for complex heterogeneous models.
[0085] In some embodiments, a point-to-point direct communication link is established based on the following steps: A Transmission Control Protocol (TCP) listening socket is created based on the underlying socket, and the TCP listening socket is bound to a preset port, so that the first functional model unit enters the listening state. The second functional model unit is controlled to initiate a connection request to a preset port; After the first functional model unit and the second functional model unit are successfully connected, the no-delay option is enabled in the network protocol stack to disable the data splicing and sending algorithm in order to establish a point-to-point direct communication link.
[0086] Specifically, a Transmission Control Protocol (TCP) listening socket refers to a server socket created based on the TCP and used to wait for a client to initiate a connection request. The second functional model unit can be used as the client and the first functional model unit as the server.
[0087] The listening state refers to the working state of the first functional model unit after binding to the preset port, waiting for the second functional model unit to initiate a connection request.
[0088] During the initialization phase of the co-simulation startup, when the one-dimensional system simulation software calls the instantiation interface fmi2Instantiate function of the first functional model unit inside, and the three-dimensional CFD software calls the instantiation interface fmi2Instantiate function of the second functional model unit inside, the first and second functional model units begin to autonomously establish a low-level client / server (C / S) communication peer-to-peer network, completely bypassing the middleware layer.
[0089] The first functional model unit in the one-dimensional system simulation software uses the underlying network library of the operating system, such as ws2_32 in the Windows environment, to call the socket creation interface socket() to create a transmission control protocol listening socket and bind it to the preset port configured by the generation engine, such as binding it to port 50505, so that the first functional model unit enters the blocking listening state and assumes the role of server.
[0090] Simultaneously, the second functional model unit in the 3D CFD software, acting as a client, initiates a connection request to the preset port of the server's IP address.
[0091] After the connection is established, the first and second functional model units execute the security verification protocol. The client sends characteristic bytes, the server confirms and sends back the confirmation. After the verification is successful, in order to solve the problem that the transmission of high-frequency, small-volume data packets (often containing only a few double-precision floating-point numbers) in the co-simulation is prone to causing TCP network blocking and waiting, the sockets of the first and second functional model units force the call to the setsockopt interface to explicitly enable the no-delay option in the network protocol stack, that is, to enable the TCP_NODELAY option, so as to disable the data splicing and sending algorithm at the network card hardware level. The data splicing and sending algorithm is the Nagle algorithm, which ensures that any small data stream can bypass the default TCP buffer assembly mechanism, thereby establishing a direct microsecond-level point-to-point direct data link.
[0092] Regarding the extended configuration of the underlying communication base, in addition to using TCP with TCP_NODELAY enabled as a microsecond-level point-to-point direct communication link and supplementing it with User Datagram Protocol (UDP) as an asynchronous monitoring link, the communication protocol can also be replaced or reconstructed according to the specific operating environment.
[0093] For example, in a single-machine multi-core or co-simulation scenario within the same computing node, TCP sockets can be replaced with shared memory to achieve extremely fast physical memory-level replacement. In a distributed cloud-native cluster, lightweight and high-concurrency communication middleware such as Quick UDP Internet Connections (QUIC), Zero Message Queue (ZeroMQ), and high-performance remote procedure call (gRPC) can be introduced to replace native sockets. Therefore, this application is not limited to a specific network protocol. Its core architecture is to build a direct link that bypasses conventional queuing and blocking, enables bidirectional replacement of small data packets across processes, and provides supporting bypass monitoring.
[0094] The co-simulation method based on functional model units provided in this application eliminates the millisecond-level waiting latency of conventional network buffers by establishing a point-to-point C / S direct peer-to-peer architecture within the simulation software and explicitly disabling the data splicing and sending algorithm. This avoids data packets from being blocked and waiting under the default congestion control of TCP. Through this decentralized microsecond-level underlying communication base, sub-millisecond-level bidirectional permutation of tiny data packets can be achieved, thereby meeting the hard real-time constraints of high-frequency transient interactions in multiphysics co-simulation.
[0095] In some embodiments, step 130 includes: Configure fixed-length floating-point arrays of the same size for the first functional model unit and the second functional model unit respectively; Using fixed-length floating-point arrays and bit-addressing of contiguous memory blocks across processes, the latest one-dimensional boundary data determined by the first functional model unit is written into the second functional model unit, and the latest three-dimensional boundary data determined by the second functional model unit is written into the first functional model unit.
[0096] Specifically, a fixed-length floating-point array refers to a double-precision floating-point array of fixed length that is pre-allocated within the first functional model unit and the second functional model unit, used to store the boundary data to be exchanged.
[0097] In the co-simulation device of this embodiment, the generation engine allocates a double-precision fixed-length floating-point array inside the FMU during the FMU encapsulation stage. For example, the fmi2Real vr[] array variable in the functional model interface standard. The fixed-length floating-point arrays allocated to the first functional model unit and the second functional model unit have the same size.
[0098] Therefore, in order to further improve efficiency during the rapid replacement of multiphysics boundary data, this application abandons the traditional lightweight data exchange format (JavaScript Object Notation, JSON) and other serialization and parsing operations during cross-platform transmission. Instead, it directly uses the underlying point-to-point direct communication link and the bit-by-bit addressing and direct read-write operations of the cross-process continuous memory block to complete the data transfer of multiphysics boundary variables. That is, the latest one-dimensional boundary data calculated by the first functional model unit is directly written bit by bit into the memory area corresponding to the second functional model unit, and the latest three-dimensional boundary data extracted by the second functional model unit is written bit by bit into the memory area of the first functional model unit.
[0099] The co-simulation method based on functional model units provided in this application, by pre-configuring fixed-length floating-point arrays of the same size and adopting a continuous memory block bit-addressing mechanism, can eliminate the cumbersome serialization and deserialization parsing process during data interaction, realize direct reading and writing of multi-physics boundary data, thereby further compressing the physical calculation time of the underlying communication and improving the execution efficiency of co-simulation.
[0100] In some embodiments, the boundary data includes the latest one-dimensional boundary data and the latest three-dimensional boundary data, and step 130 includes: Acquire the latest 3D boundary data, which includes translational acceleration, angular velocity, and angular acceleration extracted based on the scaled model; The translational acceleration is preserved in its original proportion, while the angular velocity and angular acceleration are amplified based on a preset scaling factor to obtain full-size dynamic parameters. The state of the object to be simulated at the target simulation time is simulated based on full-size dynamic parameters and the latest one-dimensional boundary data.
[0101] Specifically, a scaled-down model refers to a three-dimensional fluid-structure dynamics model constructed by reducing it to a certain scale, and its geometric dimensions have a fixed scaling ratio relationship with the actual physical system; full-scale dynamic parameters refer to the dynamic parameters of the object to be simulated, obtained by enlarging the dynamic parameters calculated by the scaled-down model according to the similarity criterion.
[0102] To clarify the logical interactions between components, the overall structure of the simulation system is further explained here, such as... Figure 2 As shown, the simulation system includes three-dimensional CFD software for computational fluid dynamics and one-dimensional system simulation software (such as Modelica) for system-level simulation. The second functional model unit is loaded into the three-dimensional CFD software as a data detector and boundary transmitter; the first functional model unit is loaded into the one-dimensional system simulation software as a dynamic boundary receiver component to drive the one-dimensional system thermal-hydraulic model. The two form a closed loop through a point-to-point direct communication link established at the bottom layer.
[0103] In the actual simulation, since three-dimensional fluid-structure dynamics models are often based on scaled-down models, while one-dimensional system thermal-hydraulic models are usually full-scale models, the first functional model unit not only undertakes communication tasks, but also integrates a multi-scale physical dimension mapping layer to perform time-series mapping and the entire process of co-simulation.
[0104] Specifically, based on the Froude similarity criterion, the first functional model unit will automatically perform dynamic scaling after receiving the latest three-dimensional boundary data sent by the second functional model unit.
[0105] For example, if the object to be simulated is a floating nuclear energy system in a marine environment facing complex sea conditions, the latest three-dimensional boundary data acquired is miniature hull data, including translational acceleration, angular velocity vector, and angular acceleration. The preset scaling factors include a first preset scaling factor and a second preset scaling factor. The first functional model unit retains the translational acceleration at its original 1:1 scale; simultaneously, it scales the acquired angular velocity vector according to the first preset scaling factor. Magnify, and scale the angular acceleration according to the second preset scaling factor. By magnifying the data, we can obtain the full-scale dynamic parameters.
[0106] Both the first and second preset scaling factors are based on the Froude similarity criterion, according to the geometric scaling ratio between the scaled-down model and the full-size model. The derived conversion coefficients of spatiotemporal physical quantities.
[0107] During the simulation of the state of the object to be simulated, the miniature hull data reflecting the effects of high-frequency ocean wave loads is extracted by three-dimensional CFD software, transmitted via TCP, amplified by the Froude similarity criterion of the first functional model unit, and smoothed and filtered by ZOH before being injected into the one-dimensional system thermal-hydraulic model in real time.
[0108] The secondary loop network is the core thermal-hydraulic subsystem in a marine floating nuclear energy system responsible for converting reactor thermal energy into mechanical energy to perform work. When the secondary loop network model receives the aforementioned amplified full-scale dynamic parameters (such as translational acceleration and angular velocity), the underlying equations of the one-dimensional system thermal-hydraulic model instantly perceive the dynamic gravity projection and apparent centrifugal force. The asymmetric three-dimensional compact arrangement causes phase misalignment in the local gravity pressure drop of each pipe section. The one-dimensional system thermal-hydraulic model calculates the resulting large mass flow rate oscillations and transient pressure drops, and simultaneously utilizes the high-speed rotor's rotational inertia and the three-dimensional... The transient gyro torque mechanical loss is calculated by the cross product of the alternating angular velocities. These system-level thermal and work feedback parameters serve as the latest one-dimensional boundary data. When the target simulation time is greater than or equal to the exchange trigger time, they are packaged by the first functional model unit and transmitted back to the second functional model unit in the three-dimensional CFD software via a TCP point-to-point direct communication link to correct the wave-facing speed and propulsion of the three-dimensional fluid-structure dynamics model. Subsequently, the one-dimensional simulation solver and the three-dimensional simulation solver simulate the state of the simulated object at the target simulation time based on their respective latest boundary data.
[0109] This system, based on a first functional model unit, a second functional model unit, and a highly synchronized bidirectional physical causal closed loop, provides a hard real-time joint computing platform for the anti-sway control strategy of the simulated object under extreme conditions.
[0110] In terms of physical quantity processing and multi-scale mapping extensions, depending on the different fluid physical properties, similarity criteria such as Reynolds number, Mach number, or Strouhal number can be used for dimensional reconstruction. In a full-size 1:1 digital twin model without scaling, the dimensional scaling function can be directly turned off. Any specific method of reconstructing physical source terms based on heterogeneous model spatial matching and dimensional mapping can fall within the protection scope of this application.
[0111] The co-simulation method based on functional model units provided in this application integrates a multi-scale physical dimension mapping layer within the first functional model unit and dynamically scales the extracted three-dimensional data based on similarity criteria. This allows for seamless bridging of scaled-down three-dimensional fluid-structure dynamics models and full-size one-dimensional system thermal-hydraulic models, eliminating dimensional misalignment in heterogeneous spaces. By constructing a highly synchronized bidirectional physical causal closed loop, it can accurately and stably calculate the transient response and high-frequency oscillation characteristics of the system under the coupling of multiple physical fields such as alternating gravity, centrifugal force, and gyroscopic torque. This provides a high-fidelity, hard real-time co-computing foundation for the anti-disturbance control and safety assessment of complex industrial systems under extreme conditions.
[0112] In some embodiments, the method further includes: When the functional model unit is in a preset working stage, a status information packet is broadcast to a preset local address; The status information package includes the current simulation timestamp and the current call stage identifier of the functional model unit, and the preset working stages include the network blocking waiting stage and the boundary data exchange completion stage. If the simulation time deviation between the first functional model unit and the second functional model unit is greater than a preset time deviation threshold, and / or the response timeout duration of the functional model unit is greater than a preset anti-disconnection threshold, the point-to-point direct communication link will be interrupted.
[0113] Specifically, the local address refers to the default network address used for broadcast status information packets, which is usually the local loopback address.
[0114] The current invocation stage identifier is an enumerated value used to identify the current working stage of the FMU.
[0115] The preset time deviation threshold refers to the maximum allowable deviation value that is pre-set to determine whether the simulation time of the first functional model unit and the second functional model unit is synchronized.
[0116] The response timeout duration refers to the length of time that the FMU takes from sending a status information packet to receiving a response.
[0117] The preset anti-disconnection threshold refers to the maximum allowable response timeout duration that is pre-set to determine whether the FMU has disconnected or crashed.
[0118] Among them, the preset time deviation threshold and the preset anti-disconnection threshold are empirical thresholds statically given in the simulation initialization configuration file based on the network latency benchmark of the simulation hardware and the average micro-iteration time of the solver.
[0119] In co-simulation under complex scenarios, strong bidirectional coupling is prone to global deadlock. For example, Fluent may hang due to excessive mesh deformation, which will cause Dymola on the other end to be blocked indefinitely on the network receiving function. To address this, this application establishes a completely independent lightweight UDP asynchronous monitoring link in addition to the point-to-point direct communication link. The UDP asynchronous monitoring link can be written in Python.
[0120] When the FMU is in a preset working phase, that is, during each network congestion waiting phase at the FMU's underlying layer, and during the phase when the macro communication step size is completed and the boundary data exchange is finished, the FMU's built-in code will call the connectionless UDP socket to broadcast a miniature status information packet to a preset local address, such as broadcasting a status information packet to a local loopback address such as 127.0.0.1 or an independent port such as port 50506.
[0121] The status information packet specifically includes the FMU's own simulation timestamp and the current call stage identifier.
[0122] In this embodiment, a lightweight UDP asynchronous monitoring link is run independently of the one-dimensional simulation solver and the three-dimensional simulation solver, and the UDP heartbeat signal is received in a non-blocking mode.
[0123] In the asynchronous monitoring link, the asynchronous monitoring thread compares the current simulation timestamp of the first functional model unit with that of the second functional model unit in real time through status information packets to determine the simulation time deviation. When the simulation time deviation between the first and second functional model units is found to be greater than the preset time deviation threshold, an abnormal clock deviation is determined, and / or when the response timeout duration of the FMU is detected to be greater than the preset anti-disconnection threshold, direct intervention will be initiated to forcibly interrupt the point-to-point direct communication link. At the same time, an exception will be thrown and the one-dimensional simulation solver and the three-dimensional simulation solver will be instructed to save the current calculation snapshot. This status monitoring mechanism gives the simulation system a powerful anti-disconnection and troubleshooting capability.
[0124] The aforementioned status monitoring mechanism can also replace UDP with a TCP control channel or a memory-based status flag polling mechanism.
[0125] The co-simulation method based on functional model units provided in this application establishes an independent asynchronous monitoring link outside the point-to-point direct communication link and broadcasts status information packets at high frequency. When single-point calculation divergence or severe network congestion occurs, an independent thread can promptly compare the current simulation timestamp and trigger an anti-disconnection abnormal truncation mechanism. This can effectively solve the predicament of global indefinite deadlock caused by the collapse of one party's physical model calculation in bidirectional co-simulation, which is very easy to fall into. This enhances the underlying robustness and fault-finding and recovery capabilities of the entire simulation system, and improves simulation efficiency and accuracy.
[0126] In some embodiments, the one-dimensional system thermal-hydraulic model and the three-dimensional fluid-structure dynamics model are constructed based on the following methods: First, specific physical field models are established in simulation software belonging to different professional solvers of different dimensions, and their respective solution domains and interaction boundaries are clearly defined.
[0127] (1) Establish a one-dimensional system thermal-hydraulic model adapted to the conditions of the ocean non-inertial frame.
[0128] Figure 5 A schematic diagram of the structure of a one-dimensional system thermo-hydraulic model provided in the embodiments of this application is shown below. Figure 5 As shown, in a one-dimensional system simulation software, a full-scale spatial topology model of the secondary loop system, including the condenser, feedwater pump, secondary loop side of the steam generator, high-pressure cylinder, and low-pressure cylinder, is constructed to obtain a one-dimensional system thermal-hydraulic model. In order to enable the one-dimensional system thermal-hydraulic model to perceive the swaying in three-dimensional space, an additional momentum source term is explicitly injected into the underlying partial differential equation of fluid momentum conservation. This source term includes the additional pressure drop in the non-inertial frame induced by the combined effects of ship translational acceleration, Euler swaying, centrifugal force, and Coriolis force.
[0129] (2) Establish a high-fidelity three-dimensional fluid-structure dynamics model under marine conditions.
[0130] Figure 6 A schematic diagram of the modeling of the three-dimensional fluid-structure dynamics model provided in the embodiments of this application, as shown below. Figure 6 As shown, in 3D CFD software, a 3D geometric mesh model of the hull and key equipment is established based on a specific scaling ratio, such as the Froude similarity criterion, to obtain a 3D fluid-structure dynamics model. Figure 6The green rectangle at the top represents the liquid surface where the ship is located. Its mesh is finer, and a Volume of Fluid (VOF) multiphase flow model is used to track the free surface of nonlinear waves. Combined with dynamic mesh technology, the six-degree-of-freedom alternating motion of the ship under wave load is calculated. The ship's center of mass velocity is calculated in real time through a user-defined function (UDF) to provide feedback thrust to simulate self-propulsion. In each micro-exploration step, the ship's three-dimensional translational acceleration, Euler angle, angular velocity and angular acceleration and other high-frequency dynamic boundary data are accurately solved and extracted.
[0131] Figure 7 This is a schematic diagram illustrating the transient attitude simulation of a ship under wave loads provided in an embodiment of this application. Figure 7 It includes four subgraphs: (a), (b), (c), and (d). Figure 7 Image (a) shows the typical pitching and rolling posture of the hull; Figure 7 (b) shows the typical pitching and rolling posture of the hull; Figure 7 Image (c) shows the typical starboard rolling posture of the hull; Figure 7 Figure (d) shows the typical port roll posture of the hull. The four sub-figures also illustrate the evolution of the free surface representing waves around the hull, demonstrating the ability of the three-dimensional fluid-structure dynamics model to capture the coupled motion of waves and the hull. Overall, Figure 7 The aim is to visually verify that the three-dimensional fluid-structure dynamics model can effectively simulate the complex transient attitude changes of ships under nonlinear wave loads, and to provide an intuitive basis for the subsequent extraction of boundary data such as translational acceleration, angular velocity and angular acceleration.
[0132] In some embodiments, this application takes the joint solution and co-simulation problem of complex industrial systems with multiple scales and multiple physics fields, such as marine floating nuclear energy systems, under extreme transient conditions as a scenario. A one-dimensional system thermo-hydraulic model including apparent gravity source terms and a high-fidelity three-dimensional fluid-structure dynamics model for solving six-degree-of-freedom motion characteristics are established. A topology adaptive generation engine is used to automatically encapsulate the underlying network communication logic and physical dimension scaling mechanism into a standard communication FMU. The generated FMUs are then imported into the one-dimensional system simulation software and the three-dimensional CFD software as dynamic boundary components and data detectors, respectively, to construct an equivalent physical topology mapping between the two ends of the isolated solver. The ZOH time barrier algorithm is embedded into the underlying state stepping interface of the two FMUs to construct a mechanism for one-dimensional simulation. The solver's trial step characteristics are synchronized by physical barriers and macroscopic time walls. Then, during joint scheduling, the first functional model unit acts as the server, and the second functional model unit acts as the client. A TCP microsecond-level point-to-point direct communication link with Nagle's algorithm disabled is established to perform bidirectional physical quantity replacement of continuous memory blocks, and an asynchronous monitoring link based on the UDP protocol is established simultaneously. Finally, this TCP / UDP interlocked dual-link architecture is used to drive the one-dimensional and three-dimensional simulation solvers to stably advance and interact with high-frequency boundary data within their respective microscopic trial step sizes in real time. Based on this, combined with the global absolute physical clock comparison results of the UDP bypass, an anti-disconnection anomaly truncation is executed when a single-point divergence or network congestion occurs, thereby achieving high robustness of the joint simulation method and enabling real-time joint simulation.
[0133] To further verify the effectiveness and accuracy of the co-simulation method based on functional model units provided in this application for multiphysics mapping and timing synchronization, this application uses a marine floating nuclear energy system as the simulation object for explanation.
[0134] The simulation of the simulation object based on the functional model unit provided in this application is performed. The simulation results show that the parameters of each fluid component fluctuate violently during the complex sea state simulation of the simulation object in a completely steady state for tens of seconds. Thanks to the continuous regularization step (regStep) mechanism introduced by the fluid bottom partial differential equation of the one-dimensional system thermal-hydraulic model, the simulation architecture of this application smoothly supports the operation of this mechanism. When the first functional model unit encounters instantaneous flow reversal and low flow velocity oscillation zone, it achieves a smooth transition of fluid property partial derivatives without any Jacobian matrix singularity or sudden collapse of calculation step size. In addition, the external UDP asynchronous monitoring link does not trigger timeout and disconnection alarms throughout the process.
[0135] Figure 8 The transient curve of X-axis translational acceleration provided in the embodiments of this application is as follows. Figure 9The transient curve of Z-axis translational acceleration provided in the embodiments of this application is as follows. Figure 10 The transient curves of X and Y axis angular acceleration provided in the embodiments of this application are as follows. Figure 11 The transient curves of X and Y axis angular velocity provided in the embodiments of this application are as follows. Figure 12 These are the transient curves of Euler angles along the X and Y axes provided in the embodiments of this application. In the figure, Time represents time. Figures 8 to 12 As shown, in the very early stages of motion, the X-axis translational acceleration (Acceleration-x, Acc-x) dominates. Because a wave-advancing self-propulsion control law is embedded in the 3D CFD software via a user-defined function (UDF) as the external load boundary of the 3D fluid-structure dynamics model, it drives the hull to generate corresponding motion attitudes in the 3D flow field. ,in, To provide thrust for self-propelled navigation against the waves, To control the gain, For the target speed, Given the ship's current speed, acceleration from a standstill or initial low speed results in an Acc-x speed as high as -6.5 m / s². 2 The dramatic abrupt changes and high-frequency step excitation occur when the Euler angles (Euler_x, Euler_y) are still in a stage of slight fluctuations. The unit of Euler angles (Euler) is radians (rad). According to the dynamic pipeline momentum equation reconstructed from the underlying layer, the translational acceleration term in the apparent gravity pressure drop source term plays a decisive role at this time: ,in, For apparent gravitational pressure drop, For fluid density, For the length of the pipe section, The direction vector for pipe segment layout. It is the gravitational acceleration vector. This is the translational acceleration vector of the ship's hull.
[0136] The effective gravitational field is pushed by this linear momentum, inducing strong alternation of water pressure. The total mass flow of the simulated object exhibits extremely high sensitivity, showing violent oscillations with high-frequency peaks. As the total mass flow is forced to deviate from the steady-state reference value, the transient momentum of the working blades of the high-pressure turbine and low-pressure turbine becomes unstable, generating a sharp initial power spike in a very short time.
[0137] As the speed stabilizes, the translational acceleration tends to fluctuate quasi-periodically near 0. However, under the continuous load of nonlinear waves, the angular motion of the hull becomes dominant, and the roll angle (Euler_x) widens and climbs to an extreme value. After Froude scaling transformation of the first functional model unit, the corrected full-size angular acceleration (Alpha) and angular velocity (Omega) induce a wide-amplitude alternating oscillation. The angular acceleration term in the momentum equation excited by rotation... With centrifugal force term The dramatic increase in weight causes the high-positioned steam generator to experience flow oscillations under the impact of swaying inertial forces. It is the full-size angular acceleration vector. This is the position vector of the equipment deviating from the center of the swing. This is the full-size angular velocity vector, while the turbine's output power (Power) Macroscopically, it primarily depends on the steam mass flow rate through the blade channel. Enthalpy drop ,Right now The power pulsation trajectory of the high-pressure cylinder follows the fluctuation of the total mass flow rate in a macroscopic trend, and the flow oscillation of the steam generator directly leads to the fluctuation of power.
[0138] Throughout the entire process, the nonlinear drop in turbine power is greater than the deviation in the mass flow rate of the simulated object's loop. This phenomenon is a pure dissipation result of the combined effects of thermal hydraulics and rigid body dynamics. As the angular velocity vector reaches its peak amplitude, an alternating gyroscopic torque is generated at the bottom layer of the high-speed turbine rotor. ,in, Let be the moment of inertia of the turbine rotor. The angular velocity vector of the rotor's high-speed spin. The transient angular velocity vector of the hull as it sways with the waves is directly converted into a large portion of the shaft mechanical friction power loss in the governing equations and then subtracted. The fluid frequently accelerates and decelerates with the waves, and the nonlinear frictional resistance generated in the pipe network (related to the flow velocity) contributes to this. square The two hard losses (proportional to each other) irreversibly consumed the system head, and these two losses were superimposed on the trough of the alternating flow, resulting in an overall power loss.
[0139] Figure 13 The transient response curve of the total mass flow rate of the object to be simulated provided in the embodiments of this application is shown. Figure 14 The transient response curve of the deaerator mass flow rate provided in the embodiments of this application is as follows. Figure 15 The transient response curve of the high-pressure cylinder output power provided in the embodiments of this application is as follows. Figure 16 The transient response curve of the low-pressure cylinder output power provided in the embodiments of this application is as follows. Figure 17The transient response curve of the output steam flow rate of the steam-water separator provided in the embodiments of this application is shown. Figure 18 The transient response curve of the output water flow rate of the steam-water separator provided in the embodiments of this application is shown. Figure 19 The transient response curve of the condenser output flow rate provided in the embodiments of this application is as follows. Figure 20 The transient response curve of the condenser output specific enthalpy provided in the embodiments of this application is as follows: Figures 13 to 20 As shown, the moisture separator, an internal component of the simulated object, exhibits complex interphase flow distribution and transient fluctuation characteristics under marine conditions. Because the internal moisture separation flow physical model incorporates an abnormal water-carrying model driven by both roll angle and weightlessness amplitude, when the ship experiences large-angle rolls and undulations under marine conditions, the two-phase gravity field and centrifugal force field inside the moisture separator are distorted, directly interfering with the gas-liquid gravity separation efficiency. This results in wide-amplitude nonlinear periodic oscillations in both the output steam flow and output water flow. However, the large-capacity moisture separator acts as a physical buffer, performing low-pass filtering on the high-frequency flow pulsations from the upstream steam generator. This low-pass filtering not only broadens and flattens the output steam waveform, leading to waveform reshaping of the downstream low-pressure cylinder's power output, but also explains why the low-pressure cylinder power exhibits a significant phase lag and peak flattening compared to the high-pressure cylinder.
[0140] Under marine conditions, the fluid components of the simulated object exhibit significant heterogeneous transient response characteristics due to differences in their topological location and thermodynamic mechanisms. As a direct-contact mixing device, the transient flow rate of the deaerator's steam inlet branch is directly constrained by the pressure difference between the steam header and the deaerator. Due to the free surface sloshing of the condenser under marine conditions, the condensate flow rate sent to the deaerator from the condenser outlet undergoes high-frequency alternation. This high-frequency fluctuating cold water input disrupts the steam-water phase change equilibrium inside the deaerator, triggering microscopic high-frequency fluctuations in local spatial pressure. These pressure fluctuations are fed back to the extraction steam line, ultimately manifesting as high-frequency spikes on the macroscopic steam inlet flow curve. Conversely, the total mass flow rate of the entire system is dominated by the upstream high-level steam generator, whose gas phase volume and system thermal inertia act as a physical buffer, smoothing out high-frequency pressure fluctuations and only responding to low-frequency fluctuations in the macroscopic space.
[0141] Furthermore, in the very early acceleration phase of the simulation (0~0.2 s), the condenser experienced an initial flow spike due to a sudden change in drastic translational acceleration, but the corresponding output enthalpy did not show a significant response. This phenomenon reveals the difference between momentum transfer and energy transfer in the system: translational acceleration, as an apparent gravity source, drives the incompressible liquid column to produce displacement and fluctuations in a short time; however, the condenser's large fluid heat capacity brings about thermal inertial hysteresis, and the short-term flow pulse is insufficient to cause drastic fluctuations in the macroscopic thermal balance of the internal condensate. It was not until the flow rate dropped in the later stages of the simulation, causing the heat to be unable to be discharged in time, that the enthalpy generated a significant peak.
[0142] It should be noted that this application uses the transient calculation of the entire secondary loop network of a marine floating nuclear power system under extreme sea conditions as an example for fluid-structure interaction. However, this application is not limited to this specific application scenario. It can also be applied to the joint simulation of thermal management systems of space stations and spacecraft under microgravity or variable acceleration conditions, the simulation of battery thermal control systems of new energy vehicles under extreme acceleration and deceleration conditions, the simulation of lubrication and cooling systems of offshore wind turbine gearboxes, and the transient safety assessment of land-based nuclear power plants / chemical plants under seismic loads. In addition to nuclear power secondary loops, this application can be further extended to the simulation of primary loop systems, containment systems, and even multiphysics coupling of aero-engines, and other more extensive and complex industrial systems.
[0143] The co-simulation device based on functional model units provided in the embodiments of this application will be described below. The co-simulation device based on functional model units described below and the co-simulation method based on functional model units described above can be referred to in correspondence.
[0144] Figure 21 This is a schematic diagram of the structure of the co-simulation device based on functional model units provided in the embodiments of this application, as shown below. Figure 21 As shown, the device is used in a simulation system, which includes a first functional model unit for a one-dimensional system thermal-hydraulic model, a one-dimensional simulation solver, and a second functional model unit for a three-dimensional fluid-structure dynamics model. A point-to-point direct communication link is established between the first and second functional model units. The device includes: The calling module 2110 is used to determine the target simulation time corresponding to this call when the first functional model unit receives a data call request sent by the one-dimensional simulation solver; The suspension module 2120 is used to suspend the cross-process data interaction of the underlying socket of the first functional model unit when the target simulation time is less than the exchange trigger time between the first functional model unit and the second functional model unit. The exchange trigger time is the difference between the next data exchange time and the preset tolerance. The interaction module 2130 is used to release the suspended state of the underlying socket when the target simulation time is greater than or equal to the exchange trigger time, control the first functional model unit and the second functional model unit to exchange boundary data, and simulate the state of the object to be simulated at the target simulation time based on the boundary data.
[0145] Specifically, according to the embodiments of this application, any and multiple modules among the calling module 2110, the suspending module 2120 and the interaction module 2130 can be merged into one module, or any one of the modules can be split into multiple modules.
[0146] Alternatively, at least some of the functionality of one or more of these modules can be combined with at least some of the functionality of other modules and implemented in a single module.
[0147] According to embodiments of this application, at least one of the calling module 2110, the suspending module 2120, and the interaction module 2130 can be at least partially implemented as hardware circuitry, such as a Field Programmable Gate Array (FPGA), a Programmable Logic Array (PLA), a System-on-a-Chip, a System-on-a-Substrate, a System-on-a-Package, an Application Specific Integrated Circuit (ASIC), or any other reasonable means of integrating or packaging the circuitry, or implemented in hardware or firmware, or in any one of the three implementation methods of software, hardware, and firmware, or in a suitable combination of any of them.
[0148] Alternatively, at least one of the calling module 2110, the suspending module 2120, and the interaction module 2130 may be implemented at least partially as a computer program module that can perform corresponding functions when the computer program module is run.
[0149] In some embodiments, the suspend module 2120 is further configured to: Intercept network communication and data retrieval requests from the underlying socket; Zero-order preservation is performed on the three-dimensional boundary data sent by the second functional model unit that the first functional model unit received at the last data exchange time.
[0150] In some embodiments, the device further includes a construction module, which is specifically used for: A Transmission Control Protocol (TCP) listening socket is created based on the underlying socket, and the TCP listening socket is bound to a preset port, so that the first functional model unit enters the listening state. The second functional model unit is controlled to initiate a connection request to a preset port; After the first functional model unit and the second functional model unit are successfully connected, the no-delay option is enabled in the network protocol stack to disable the data splicing and sending algorithm in order to establish a point-to-point direct communication link.
[0151] In some embodiments, the device further includes a broadcast module, which is specifically used for: When the functional model unit is in a preset working stage, a status information packet is broadcast to a preset local address; The status information package includes the current simulation timestamp and the current call stage identifier of the functional model unit. The preset working stages include the network blocking waiting stage and the boundary data exchange completion stage.
[0152] It should be noted that the co-simulation device based on functional model units provided in this application embodiment can implement all the method steps implemented in the above-mentioned co-simulation method embodiment based on functional model units, and can achieve the same technical effect. Here, the parts that are the same as those in the method embodiment and the beneficial effects will not be described in detail.
[0153] Figure 22 This is a schematic diagram of the structure of the electronic device provided in the embodiments of this application, such as... Figure 22 As shown, the electronic device may include a processor 2210, a communication interface 2220, a memory 2230, and a communication bus 2240, wherein the processor 2210, the communication interface 2220, and the memory 2230 communicate with each other through the communication bus 2240. The processor 2210 can call the computer program in the memory 2230 to execute the above-described method.
[0154] Furthermore, when the logical instructions in the aforementioned memory can be implemented as software functional modules and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to related technologies, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0155] On the other hand, this application also provides a computer program product, which includes a computer program that can be stored on a non-transitory computer-readable storage medium. When the computer program is executed by a processor, the computer can perform the methods provided in the above embodiments.
[0156] On the other hand, embodiments of this application also provide a non-transitory computer-readable storage medium storing a computer program for causing a processor to execute the methods provided in the above embodiments.
[0157] The non-transitory computer-readable storage medium can be any available medium or data storage device that the processor can access, including but not limited to magnetic memory (e.g., floppy disk, hard disk, magnetic tape, magneto-optical disk (MO)), optical memory (e.g., CD, DVD, BD, HVD), and semiconductor memory (e.g., ROM, EPROM, EEPROM, non-volatile memory (NAND FLASH), solid-state drive (SSD)).
[0158] The device embodiments described above are merely illustrative. The modules described as separate components may or may not be physically separate. The components shown as modules may or may not be physical modules; that is, they may be located in one place or distributed across multiple network modules. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Those skilled in the art can understand and implement this without any creative effort.
[0159] Through the above description of the embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus necessary general-purpose hardware platforms, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solutions, in essence or the parts that contribute to the related technology, can be embodied in the form of software products. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods described in the various embodiments or some parts of the embodiments.
[0160] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application.
Claims
1. A co-simulation method based on functional model units, characterized in that, The method is applied to a simulation system, which includes a first functional model unit for a one-dimensional system thermo-hydraulic model, a one-dimensional simulation solver, and a second functional model unit for a three-dimensional fluid-structure dynamics model. A point-to-point direct communication link is established between the first and second functional model units. When the first functional model unit receives a data call request sent by the one-dimensional simulation solver, the target simulation time corresponding to this call is determined; If the target simulation time is less than the exchange trigger time between the first functional model unit and the second functional model unit, the cross-process data interaction of the underlying socket of the first functional model unit is suspended. The exchange trigger time is the difference between the next data exchange time and the preset tolerance. When the target simulation time is greater than or equal to the exchange trigger time, the suspended state of the underlying socket is released, the first functional model unit and the second functional model unit are controlled to exchange boundary data, and the state of the object to be simulated at the target simulation time is simulated based on the boundary data. Wherein, when the target simulation time is less than the exchange trigger time between the first functional model unit and the second functional model unit, the method further includes: Intercept the network communication and data retrieval requests of the underlying socket; perform zero-order preservation on the three-dimensional boundary data sent by the second functional model unit that the first functional model unit received at the last data exchange moment; The point-to-point direct communication link is established based on the following steps: A Transmission Control Protocol (TCP) listening socket is created based on the underlying socket, and the TCP listening socket is bound to a preset port, so that the first functional model unit enters the listening state; the second functional model unit is controlled to initiate a connection request to the preset port; after the first functional model unit and the second functional model unit are successfully connected, the no-delay option is enabled in the network protocol stack to disable the data splicing and sending algorithm, so as to establish the point-to-point direct communication link. The method further includes: when the functional model unit is in a preset working stage, broadcasting a status information packet to a preset local address; wherein, the status information packet includes the current simulation timestamp and the current calling stage identifier of the functional model unit, and the preset working stage includes a network blocking waiting stage and a boundary data exchange completion stage; After broadcasting the status information packet to the preset local address, the method further includes: If the simulation time deviation between the first functional model unit and the second functional model unit is greater than a preset time deviation threshold, and / or the response timeout duration of the functional model unit is greater than a preset anti-disconnection threshold, the point-to-point direct communication link shall be interrupted.
2. The co-simulation method based on functional model units according to claim 1, characterized in that, After performing zero-order preservation on the three-dimensional boundary data sent by the second functional model unit received by the first functional model unit at the last data exchange time, the method further includes sending the three-dimensional boundary data to the one-dimensional simulation solver.
3. The co-simulation method based on functional model units according to claim 1, characterized in that, The functional model unit is either the first functional model unit or the second functional model unit, and the functional model unit is obtained based on the following steps: Obtain the number of pre-configured interface variables and communication parameters; Source code is generated based on the number of interface variables and the communication parameters. The source code defines the underlying socket communication logic and functional model interface standard. Compile the source code into a dynamic link library; Based on the dynamic link library and model description file, generate functional model units that conform to the functional model interface standard.
4. The co-simulation method based on functional model units according to claim 1, characterized in that, The control of the first functional model unit and the second functional model unit to exchange boundary data includes: Configure fixed-length floating-point arrays of the same size for the first functional model unit and the second functional model unit respectively; Based on the fixed-length floating-point array and the bit-addressing of contiguous memory blocks across processes, the latest one-dimensional boundary data determined by the first functional model unit is written into the second functional model unit, and the latest three-dimensional boundary data determined by the second functional model unit is written into the first functional model unit.
5. The co-simulation method based on functional model units according to claim 4, characterized in that, The boundary data includes the latest one-dimensional boundary data and the latest three-dimensional boundary data. Simulating the state of the object to be simulated at the target simulation time based on the boundary data includes: The latest three-dimensional boundary data is obtained, which includes translational acceleration, angular velocity, and angular acceleration extracted based on the scale model; The translational acceleration is retained at its original ratio, while the angular velocity and angular acceleration are amplified based on a preset scaling factor to obtain full-size dynamic parameters. The state of the object to be simulated at the target simulation time is simulated based on the full-size dynamic parameters and the latest one-dimensional boundary data.
6. A co-simulation device based on functional model units, characterized in that, The device is applied to a simulation system, which includes a first functional model unit for a one-dimensional system thermal-hydraulic model, a one-dimensional simulation solver, and a second functional model unit for a three-dimensional fluid-structure dynamics model. A point-to-point direct communication link is established between the first and second functional model units. The calling module is used to determine the target simulation time corresponding to this call when the first functional model unit receives a data call request sent by the one-dimensional simulation solver; The suspension module is used to suspend the cross-process data interaction of the underlying socket of the first functional model unit when the target simulation time is less than the exchange trigger time between the first functional model unit and the second functional model unit. The exchange trigger time is the difference between the next data exchange time and a preset tolerance. The interaction module is used to release the suspended state of the underlying socket when the target simulation time is greater than or equal to the exchange trigger time, control the first functional model unit and the second functional model unit to exchange boundary data, and simulate the state of the object to be simulated at the target simulation time based on the boundary data. The suspending module is also used for: Intercept the network communication and data retrieval requests of the underlying socket; perform zero-order preservation on the three-dimensional boundary data sent by the second functional model unit that the first functional model unit received at the last data exchange moment; The device further includes a construction module, which is used to create a Transmission Control Protocol (TCP) listening socket based on the underlying socket and bind the TCP listening socket to a preset port, so that the first functional model unit enters a listening state; controls the second functional model unit to initiate a connection request to the preset port; after the first functional model unit and the second functional model unit are successfully connected, enables the no-delay option in the network protocol stack to disable the data splicing and sending algorithm, so as to establish the point-to-point direct communication link; The device further includes a broadcast module, which is used to broadcast a status information packet to a preset local address when the functional model unit is in a preset working stage; wherein, the status information packet includes the current simulation timestamp and the current calling stage identifier of the functional model unit, and the preset working stage includes a network blocking waiting stage and a boundary data exchange completion stage; After broadcasting the status information packet to the preset local address, the method further includes: If the simulation time deviation between the first functional model unit and the second functional model unit is greater than a preset time deviation threshold, and / or the response timeout duration of the functional model unit is greater than a preset anti-disconnection threshold, the point-to-point direct communication link shall be interrupted.
Citation Information
Patent Citations
Time synchronization and data exchange apparatus and method used for combined simulation of power system and information communication system
CN105930580A
Distributed integrated simulation method and system for multi-source heterogeneous model
CN111985102A
