A water quality simulation method for integrated water supply of plant, grid and river
By constructing a two-dimensional river hydrodynamic water quality model and a one-dimensional water supply pipe network water quality prediction model, and realizing data exchange, the problems of slow calculation speed and lack of integrated water supply water quality prediction model in the existing technology are solved, and the water supply system is realized. Comprehensive assessment and prediction improve model adaptability and operational efficiency.
Patent Information
- Application Number
- CN202410931458.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-12
- Publication Date
- 2024-10-18
- Estimated Expiration
- 2044-07-12
AI Technical Summary
The existing water source hydrodynamic water quality simulation software has slow calculation speed, and some programs are not open source, which limits secondary development. It also lacks an integrated water supply water quality prediction model, making it difficult to comprehensively evaluate the entire process of water intake and water supply.
A water quality simulation method for integrated plant, network and river water supply is adopted. By constructing a two-dimensional river hydrodynamic water quality model and a one-dimensional water supply pipe network water quality prediction model, combined with OpenFOAM and EPANET-MSX software, data exchange and synchronization are realized and integrated into a complete Water quality numerical model to automatically simulate water quality changes.
It achieves comprehensive assessment and prediction of the entire water supply system from water intake rivers, water quality purification plants to water supply pipe networks, improves the adaptability and flexibility of the model, simplifies the operation process, improves implementation efficiency, and has high operability and secondary The development potential is suitable for interconnection and joint supply of water network construction and water quality security guarantee.
Smart Images

Figure CN118504467B_ABST
Abstract
Description
Technical Field
[0001] The invention relates to a water quality simulation technology for water supply network hydrodynamics, and in particular to a water quality simulation method for integrated water supply of a plant, network and river. Background Art
[0002] In the simulation of hydrodynamics and water quality at water sources, the more classic software is HEC-RAS: developed by the Hydrological Research Center of the U.S. Army Corps of Engineers, it has complete one- and two-dimensional coupled hydrodynamics and water environment simulation functions, and can simulate water conservancy structures such as gates, culverts, bridges and pumping stations. In addition, MIKE is also widely used in hydrodynamics, water quality, sediment and ecological simulation software for estuaries, rivers and lakes, which includes one-dimensional, two-dimensional and three-dimensional situations. There is also Delft3D: a three-dimensional hydrodynamic-water quality model system, which includes modules such as water flow, hydrodynamics, waves, sediment, water quality, ecology, etc., and each module is dynamically coupled online. WASP6 and WASP7: The WASP model was developed by the U.S. Environmental Protection Agency and is a comprehensive water quality simulation model that can simulate water quality changes in rivers, reservoirs and lakes. However, these model methods have more or less some problems, such as slow calculation speed and some programs are not open source, which is not conducive to secondary development.
[0003] In terms of water quality simulation of water supply networks, EPANET is an open source software widely used to simulate the hydraulic and water quality characteristics of water supply networks. Some scholars have used the residual chlorine first-order decay kinetic model based on EPANET to accurately simulate the residual chlorine changes in the actual network. EPANET and EPANET-MSX have also been proven to be important tools in the adjustment calculation of water supply networks and the supply of multiple water sources (rivers, reservoirs and wells, etc.). EPANET-MSX adds the function of multi-species water quality simulation on the basis of EPANET, which can analyze more complex biochemical reactions in the network, such as the oxidation of heavy metals in the network and adsorption on the pipe wall; the residual chlorine decay model is combined with relevant optimization algorithms to select the location of secondary chlorination and pressurization points.
[0004] Currently, there is little research on the simulation of the entire water intake and supply process, while the demand for integrated water supply water quality prediction models is becoming increasingly urgent.
[0005] It should be noted that the information disclosed in the above background technology section is only used for understanding the background of the present application, and therefore may include information that does not constitute prior art known to ordinary technicians in the field. Summary of the invention
[0006] The main purpose of the present invention is to overcome the defects of the above-mentioned background technology and provide a water quality simulation method for integrated water supply of factory, network and river.
[0007] To achieve the above object, the present invention adopts the following technical solutions:
[0008] A water quality simulation method for integrated water supply of a plant, network and river, comprising the following steps:
[0009] S1. River water source simulation: Combine the collected river topography data and river bank data to construct a two-dimensional river hydrodynamic and water quality model. The model configures boundary hydrodynamic and water quality parameters to simulate the hydrodynamic and water quality conditions of the river water source;
[0010] S2. Dynamic analysis of water quality at water intake: through the two-dimensional river hydrodynamic water quality model, monitor and analyze the temporal changes of water quality parameters at the water intake to provide key data for dynamic water quality assessment;
[0011] S3. Construction of a water quality prediction model for the water supply network: A water quality prediction model for the water supply network is constructed. The model integrates multiple water source inputs and simplifies the water purification plant into a processing node on the pipeline system to simulate its treatment effect on water quality, including the removal efficiency of specific pollutants.
[0012] S4. Data interface development: data exchange and synchronization between the two-dimensional river hydrodynamic water quality model and the water quality prediction model of the water supply network is realized by constructing a data interface to ensure the consistency and continuity of data between the models;
[0013] S5. One-dimensional network hydrodynamics and water quality simulation: The water supply network water quality prediction model performs a one-dimensional hydrodynamics and water quality simulation of the water supply network based on the data obtained from the two-dimensional river hydrodynamics and water quality model, wherein the water quality and hydrodynamic parameters provided by the two-dimensional river hydrodynamics and water quality model are input into the water supply network water quality prediction model as boundary conditions or initial conditions to predict water quality changes and hydraulic behaviors in the water supply network;
[0014] S6. Integrated model integration and automation: Integrate the river hydrodynamic water quality model and the water quality prediction model of the water supply network into a complete water quality numerical model of integrated water supply of the plant, network and river, so as to automate the entire water quality change simulation process.
[0015] In some optional embodiments, in step S1, a two-dimensional river hydrodynamic water quality model is constructed using OpenFOAM software, and in step S2, changes in water quality parameters at the water intake are monitored using the Probe function of OpenFOAM to obtain time series change data of the water quality parameters.
[0016] In some optional implementations, step S2 specifically includes:
[0017] S2.1. Establish the geometric model of the river bank and export it into a format suitable for mesh generation software;
[0018] S2.2. Based on the characteristics of the river channel, use mesh generation software to draw a two-dimensional grid that adapts to the river channel morphology and output it in a format suitable for computational fluid dynamics OpenFOAM software;
[0019] S2.3. Convert the exported mesh file into a format recognizable by OpenFOAM software and store it as a standard mesh file in the case folder;
[0020] S2.4. Set the properties of the mesh in the OpenFOAM software. For two-dimensional simulations, specify the upper and lower boundary conditions and set the vertical dimensions.
[0021] S2.5. Use the built-in tools in OpenFOAM software to extract the coordinate data of the grid center;
[0022] S2.6. Perform terrain data interpolation, combine the terrain data with the grid data, use interpolation technology to obtain the terrain depth information at the center of the grid, and export the data;
[0023] S2.7. Integrate the interpolated terrain data into the OpenFOAM model to provide accurate terrain conditions for simulation;
[0024] S2.8. Define model parameters: Set the simulation parameters of the OpenFOAM software, including time step, total simulation time, physical model settings, boundary conditions, and diffusion and attenuation characteristics of pollutants;
[0025] S2.9. Set up monitoring points in OpenFOAM to track changes in water quality parameters at specific locations over time.
[0026] In some optional implementations, in step S3, EPANET-MSX software is used to establish a water quality prediction model for the water supply network based on the collected network topology, pipe segment characteristics, node characteristics, and boundary condition data.
[0027] In some optional implementations, step S3 specifically includes:
[0028] S3.1. Collect data on the topological structure, pipe segment characteristics, node characteristics and boundary conditions of the water supply network;
[0029] S3.2. Create point objects in the water supply network, such as nodes, reservoirs, pools, etc., and line objects, such as pipe segments, valves, pumps, etc.;
[0030] S3.3. Define attribute fields for point objects and line objects, including but not limited to node number, coordinates, elevation, water demand, reservoir number, total head, tank size, pipe section specification, valve type, pump performance, etc.;
[0031] S3.4. Set the simulation time step, total duration and other parameters to provide time control for the simulation process;
[0032] S3.5. Define the hydrodynamic conditions of the network, including pressure, flow, head, etc., and ensure that the hydrodynamic conditions of all nodes and links are correctly set;
[0033] S3.6. Add corresponding chemical species according to simulation requirements and set their chemical properties and kinetic parameters;
[0034] S3.7. Configure the initial state of the pipe network, including the initial concentration and flow rate of water quality components, to prepare for simulation calculations;
[0035] S3.8. Simulate the water treatment process by adding Source modules to the model.
[0036] In some optional embodiments, in step S4, a data interface is constructed by writing a Python script to achieve data exchange between the OpenFOAM software and the EPANET-MSX software, and the water quality and hydrodynamic parameters output by OpenFOAM are converted into the input format required by the EPANET-MSX software.
[0037] In some optional implementations, step S4 specifically includes:
[0038] S4.1. Determine the storage path of the csv file of the time series changes of water quality parameters at the water intake exported by the probe function of the OpenFOAM software;
[0039] S4.2. Develop Python functions to read water quality parameter data, including water quality concentration data, from OpenFOAM software;
[0040] S4.3. Convert the read water quality concentration data into relative coefficients by normalizing each value in the concentration column by dividing the first value in the column;
[0041] S4.4. Determine the storage path for the EPANET-MSX software input files;
[0042] S4.5. Use Python code to automatically update the calculated relative coefficients to the PATTERNS section of the EPANET-MSX model file;
[0043] S4.6. In the EPANET-MSX model file, replace the original time pattern with the newly calculated relative coefficient to reflect the temporal changes of water quality parameters.
[0044] In some optional implementations, step S6 specifically includes:
[0045] S6.1. Create a Python script, use the subprocess module in the Python script, specify the path and name of the OpenFOAM case, and call the OpenFOAM solver to run the simulation;
[0046] S6.2. Run the Python Data Transfer Interface through a Python script to synchronize data between different software;
[0047] S6.3. Call the EPANET-MSX library through Python scripts to perform water quality simulation of the water supply network;
[0048] S6.4. Analyze water quality parameter information for specific node segments from EPANET-MSX output files;
[0049] S6.6. Convert the parsed time data into floating point numbers for hours to meet drawing requirements;
[0050] S6.7. Define the drawing function in Python, set the image format, and prepare to generate the timing curve graph;
[0051] S6.8. Generate a time series graph of water quality parameters for a specific node segment using the defined graphing function.
[0052] A computer-readable storage medium stores a computer program, which, when executed by a processor, implements the water quality simulation method for integrated water supply of a plant, grid and river.
[0053] A computer program product comprises a computer program, wherein when the computer program is executed by a processor, the water quality simulation method for integrated water supply of a plant, a grid and a river is implemented.
[0054] The present invention has the following beneficial effects:
[0055] The water quality simulation method for integrated water supply of the plant network river of the present invention can comprehensively evaluate and predict the operating status of the entire water supply system from the water intake river, water purification plant to the water supply network by constructing a water quality simulation model, which is of significant importance to the interconnection and supply, coordinated prevention and control, and water quality safety of water network construction. The present invention establishes a two-dimensional river hydrodynamic water quality model and a one-dimensional water supply plant network model, and realizes data exchange and synchronization between the two-dimensional river hydrodynamic water quality model and the water supply network water quality prediction model by constructing a data interface, simulating the complex biochemical reactions in the water supply plant network, and the data exchange interface can realize the real-time update of the import boundary conditions of the water purification plant, and simplify the water purification plant to a processing node on the pipeline system to truly reflect the hydraulic and water quality changes in the water supply network; the river hydrodynamic water quality model and the water supply network water quality prediction model are integrated into a complete water quality numerical model for integrated water supply of the plant network river, which can be run by one key through an automated script and the result curve is automatically drawn, forming a set of water quality simulation solutions that are easy to apply and promote. This method not only has high operability and secondary development potential, but also can be customized according to actual needs, which enhances the adaptability and flexibility of the model. At the same time, the present invention is easy to implement and can automatically generate a water quality parameter time chart, simplifying the operation process and improving the implementation efficiency. Water supply companies and water conservancy departments can use the present invention to establish an information management system for water supply networks and conduct long-term series water supply quality prediction simulations, providing a scientific basis for daily management and maintenance of the network, enhanced disinfection of water quality, energy conservation and consumption reduction, and research on water supply quality stability assurance measures under extreme disasters. It has high practical value and broad application prospects.
[0056] In a preferred embodiment, the water quality simulation method for integrated plant-network-river water supply of the present invention can be based on the open source computational fluid dynamics software OpenFOAM and EPANET-MSX pipe network multi-species reaction code, as well as a data exchange interface to construct an integrated model to achieve an overall evaluation of the water intake river-water purification plant-water supply network, and can comprehensively evaluate and predict the operating status of the entire water supply system. The constructed water quality simulation model has significant advantages such as simple structure, good performance, and low cost.
[0057] Other beneficial effects of the embodiments of the present invention will be further described below. BRIEF DESCRIPTION OF THE DRAWINGS
[0058] Figure 1 This is a block diagram of a water quality simulation method for integrated plant-grid-river water supply according to an embodiment of the present invention.
[0059] Figure 2 This is a spatiotemporal distribution diagram of the trivalent As element in the river channel in OpenFOAM according to an embodiment of the present invention.
[0060] Figure 3a and Figure 3bThey are respectively the water intake point coordinates and water quality time history data extraction diagram of an embodiment of the present invention.
[0061] Figure 4 It shows the construction of a water quality model for a water supply network according to an embodiment of the present invention, as well as the oxidation and adsorption reaction of trivalent As elements in the network under the action of chloride ions, involving the interaction process between the pipe wall and the flowing water source.
[0062] Figure 5 The automatically generated time history of water quality parameter changes of node A according to an embodiment of the present invention is shown.
[0063] Figure 6 The time history of water quality parameter changes of the pipe segment 1 automatically generated according to an embodiment of the present invention is shown. DETAILED DESCRIPTION
[0064] The following is a detailed description of the embodiments of the present invention. It should be emphasized that the following description is only exemplary and is not intended to limit the scope and application of the present invention.
[0065] It should be noted that when an element is referred to as being "fixed to" or "disposed on" another element, it can be directly on the other element or indirectly on the other element. When an element is referred to as being "connected to" another element, it can be directly connected to the other element or indirectly connected to the other element. In addition, connection can be used for fixing as well as for coupling or communication.
[0066] It should be understood that the orientation or position relationship indicated by terms such as "length", "width", "up", "down", "front", "back", "left", "right", "vertical", "horizontal", "top", "bottom", "inside" and "outside" are based on the orientation or position relationship shown in the accompanying drawings, and are only for the convenience of describing the embodiments of the present invention and simplifying the description, and do not indicate or imply that the referred device or element must have a specific orientation, be constructed and operated in a specific orientation, and therefore cannot be understood as a limitation on the present invention.
[0067] In addition, the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of the features. In the description of the embodiments of the present invention, the meaning of "plurality" is two or more, unless otherwise clearly and specifically defined.
[0068] See also Figure 1 The embodiment of the present invention provides a water quality simulation method for integrated water supply of a plant, network and river, comprising the following steps:
[0069] S1. River water source simulation: Combine the collected river topography data and river bank data to construct a two-dimensional river hydrodynamic and water quality model. The model configures boundary hydrodynamic and water quality parameters to simulate the hydrodynamic and water quality conditions of the river water source;
[0070] S2. Dynamic analysis of water quality at water intake: through the two-dimensional river hydrodynamic water quality model, monitor and analyze the temporal changes of water quality parameters at the water intake to provide key data for dynamic water quality assessment;
[0071] S3. Construction of a water quality prediction model for water supply network: A water quality prediction model for water supply network is constructed. The model integrates multiple water source inputs and simplifies the water purification plant into a processing node on the pipeline system to simulate its treatment effect on water quality, including the removal efficiency of specific pollutants.
[0072] S4. Data interface development: data exchange and synchronization between the two-dimensional river hydrodynamic water quality model and the water quality prediction model of the water supply network is realized by constructing a data interface to ensure the consistency and continuity of data between the models;
[0073] S5. One-dimensional network hydrodynamics and water quality simulation: The water supply network water quality prediction model performs a one-dimensional hydrodynamics and water quality simulation of the water supply network based on the data obtained from the two-dimensional river hydrodynamics and water quality model, wherein the water quality and hydrodynamic parameters provided by the two-dimensional river hydrodynamics and water quality model are input into the water supply network water quality prediction model as boundary conditions or initial conditions to predict water quality changes and hydraulic behaviors in the water supply network;
[0074] S6. Integrated model integration and automation: Integrate the river hydrodynamic water quality model and the water supply network water quality prediction model into a complete water quality numerical model of integrated plant-network-river water supply to automate the entire water quality change simulation process.
[0075] The water quality simulation method for integrated plant-network-river water supply of the preferred embodiment of the present invention can be constructed based on the open source computational fluid dynamics software OpenFOAM and the EPANET-MSX pipe network multi-species reaction code to achieve an overall evaluation of the water intake river-water purification plant-water supply pipe network, and can comprehensively evaluate and predict the operating status of the entire water supply system. The model has the advantages of simple structure, good performance, and low cost.
[0076] The embodiment of the present invention realizes the water quality simulation of integrated water supply of plant, network and river, that is, the water purification plant, water supply network and natural river are included in a unified framework, which can comprehensively evaluate and predict the operation status of the entire water supply system, and is of great significance to the interconnection and supply, coordinated prevention and control and water quality safety of water network construction. In view of the current problem, a two-dimensional river hydrodynamic water quality model and a one-dimensional water supply plant network model are established based on OpenFOAM. The embodiment of the present invention integrates EPANET-MSX code to realize the simulation of complex biochemical reactions in the water supply plant network, and builds a data exchange interface to realize the update of the water purification plant inlet boundary conditions according to the water quality changes at the river water intake. The water purification plant is simplified to a special processing node on the pipeline system, so as to more realistically predict the hydraulic and water quality changes in the urban water supply network, and provide technical support for the sufficient supply of drinking water and water quality assurance prediction.
[0077] As an alternative embodiment, other software including HEC-RAS, MIKE, EFDC, etc. can be used in the simulation of river hydrodynamics and water quality; other software including EPANET, etc. can be used in the simulation of water supply network hydrodynamics and water quality.
[0078] The specific embodiments of the present invention are further described below.
[0079] A water quality simulation method for integrated water supply of a plant, network and river, comprising the following steps:
[0080] (1) First, it is necessary to obtain the river bankline, topography, water level flow and water quality monitoring data at the boundary of the target calculation area as the pre-input conditions for OpenFOAM to calculate the river hydrodynamic and water quality simulation;
[0081] (2) Hydrodynamic and water quality simulation of the source water channel: a model was built based on the open source OPENFOAM software OpenFOAM, and the Probe function in the postProcessing library of OpenFOAM was used to obtain and analyze the water quality changes at the water intake;
[0082] (3) Write a data transmission interface from OpenFOAM to EPANET-MSX based on the Linux system to realize one-way data transmission between OpenFOAM and EPANET-MSX (because there is no situation where water from the water plant flows back to the river during the water supply process). The output file format of OpenFOAM is csv, while the input file format of EPANET-MSX is inp and msx.
[0083] (4) For the pipe segments, nodes, and reservoir layers that are necessary for the water supply network, their attribute fields are reasonably designed to meet the needs of establishing a hydrodynamic water quality model of the water supply network for numerical calculation. In the present invention, the water purification plant is regarded as a special node for chlorination operation, and the removal effect of specific pollutants is specially reduced. The reduction rate can be set or determined by calibration. Finally, EPANET-MSX is used to establish a hydraulic water quality model of the water supply plant network.
[0084] (5) Write a Python script to run OpenFOAM, the data transmission interface, and EPANET-MSX on a Linux system with one click, and automatically output the time history curve of the water quality parameters of the required nodes or pipe sections.
[0085] The specific process of step (2) includes: using CAD software to create a geometric shoreline model of the river channel, and exporting it to a format that can be recognized by the mesh drawing software ICEM, such as sat or igs. Then, according to the complexity of the river channel, use ICEM to draw a two-dimensional structured or unstructured grid, and export it in Fluent format, and then use the FluentMeshToFoam command to convert it to a grid format that can be recognized by OpenFOAM, and save it in a PolyMesh file in the example folder. It should be noted that the OpenFOAM grid is in a three-dimensional format. For two-dimensional problems, its method is to set the upper and lower boundaries to empty type, and set the vertical height to 1, usually 0.5 and -0.5. After completing the grid drawing of the shoreline, the terrain data of the river channel needs to be interpolated onto the grid. The variable calculation results of OpenFOAM, such as flow rate, water level and concentration, are stored in the center of the grid cell. The terrain data also exists in the center of the cell. Therefore, you need to get the coordinates of the grid center first. You can use the postProcess -time 0 -func writeCellCentres code to output the results to the Cx, Cy, and Cz files in the 0 folder with a time step of 0. After obtaining the grid center coordinates, import the terrain and grid data into Tecplot, use the Interpolate command to interpolate the depth of the grid center (positive downward), use the write data file command to export the interpolated terrain data, and copy it to the depth file in OpenFOAM, then continue to define the control parameters, initial conditions and boundary conditions of OpenFOAM operation, such as time step, total duration, physical model, river inlet and outlet flow rate, pressure, concentration conditions, diffusion of pollutants, attenuation coefficient, etc. Finally, the probe function in the postProcessing library of openFOAM is used to create a probes file in the system folder of the OpenFOAM example to analyze the temporal changes of water quality parameters at specific coordinates (water intake).
[0086] The specific process of step (3) includes: first specify the path of the csv file of the water quality parameter time history of the water intake exported by the probe function in OpenFOAM, then write a Python function to read the file data from OpenFOAM. The file is mainly divided into two columns, one for time and the other for water quality concentration. Each number in the water quality concentration column is divided by the first number in the column to convert the concentration into a relative coefficient. Then specify the path of the EPANET-MSX input file example1.msx, and use Python code to automatically update the calculated relative coefficient to the PATTERNS part in example1.msx, replacing the original time pattern. PATTERNS is used to define the time pattern of the external source intensity that changes over time. Its format includes the pattern name and a series of baseline relative coefficients. Finally, a communication bridge between OpenFOAM, Python and EPANET-MSX is established.
[0087] The specific process of step (4) includes: first, it is necessary to collect data such as the topological structure, pipe segment characteristics, node characteristics, and boundary conditions of the pipe network. Point objects and line objects need to be established, where point objects include nodes, reservoirs, and pools; line objects include pipe segments, valves, and pumps. The node attribute fields are: node number, X coordinate, Y coordinate, elevation, water demand, and mode; the reservoir field attributes are: reservoir number, X coordinate, Y coordinate, total head, and mode; the pool field attributes are: pool, X coordinate, Y coordinate, elevation, initial water level, minimum water level, maximum water level, diameter, minimum volume, and volume curve; the pipe segment attribute fields are: pipe segment number, starting node, ending node, length, diameter, roughness coefficient, loss coefficient, and initial state; the valve attribute fields are: valve number, starting node, ending node, diameter, type, setting, and loss coefficient; the pump attribute fields are: pump number, starting node, ending node, and pump curve. Then configure the simulation parameters, such as setting the simulation time step, total duration, etc., and define the hydrodynamic conditions of the pipe network, including pressure, flow, head, etc., and ensure that the hydrodynamic state of all nodes and pipe sections is set correctly. According to the water quality components that need to be simulated, add the corresponding chemical species and reactions, and set their chemical properties and kinetic parameters. Set the initial state of the pipe network, including the initial concentration and flow rate of the water quality components, to prepare for the simulation calculation of hydrodynamics and water quality. The implementation of the water plant can add the Source source module in the msx input file to simulate the process of adding a specific concentration of chlorine to the water plant.
[0088] The specific process of step (5) includes: creating a Python script, calling the OpenFOAM solver using the subprocess module, specifying the path and name of the OpenFOAM example, and in the same script, running the Python data transmission interface and the EPANET-MSX library in the same way. Subsequently, the required water quality parameter time history curve is drawn according to the output file example1.rpt of the EPANET-MSX code, which involves the analysis and extraction of specific node segment information, applying the time conversion function, converting the time data into hourly floating point numbers, and then defining the drawing function, setting the image format, and generating the water quality parameter time history curve for the specific node segment. Finally, the Python script is tested and run on the Linux system to ensure that all functions work properly and realize the integrated operation of the hydrodynamic and water quality simulation calculation from the estuary to the water supply plant network.
[0089] In the embodiment of the present invention, the result output file for OpenFOAM is a series of folders of different time series, and the folders contain the specific values of different parameters at the current time, while the input files inp files and msx files of EPANET-MSX have specific input format regulations, and data cannot be directly transmitted between the two program codes. Considering that the water supply process is a one-way transportation process, the data transmission interface of the hydrodynamic water quality of the river channel and the hydrodynamic water quality of the water supply network is written in Python language, and scripts are written to realize the one-key operation of the three sets of program codes and the automatic drawing of the result curves of nodes and pipe sections, and finally form a water quality simulation scheme for integrated water supply of plant, network and river that can be applied and promoted. Using the data transmission interface of the open source OPENFOAM code OpenFOAM based on the Linux system and the one-dimensional pipe network open source code EPANET-MSX, the result curve graph can be generated by running.
[0090] The technical solution of the embodiment of the present invention is as follows Figure 1 shown.
[0091] Examples
[0092] Due to the discharge of industrial and agricultural wastewater, trivalent As elements in the river undergo convective diffusion under the action of hydraulics, which further affects the water intake of the water plant. After coagulation, sedimentation and adsorption in the water plant, trivalent As elements enter the water supply network, which in turn affects the oxidation and adsorption of As elements in the water supply network, posing a potential threat to the safety of drinking water for residents. The simulation time of this example is two days. This example shows that this method is applicable. Figure 2 The spatial and temporal distribution of trivalent As in the river channel in OpenFOAM is shown. Figure 3a and Figure 3b The coordinates of the water intake point and the water quality history data extraction are shown.
[0093] like Figure 4 As shown in the figure, the water quality model of the water supply network is established: it mainly considers the oxidation and adsorption reaction of the trivalent As element in the network under the action of chloride ions, which involves the interaction process between the pipe wall and the flowing water source. In this process, since the treatment of the trivalent As element by the water plant is mainly coagulation, precipitation and adsorption, it can be reduced by a certain proportion.
[0094] Finally, follow the steps in the third part to set the relevant operating parameters, run the Python code with one click, and you can complete the running of the three programs and draw the graph.
[0095] Automatically generated time history of water quality parameter changes, taking node A and pipe segment 1 as an example. Figure 5 The change trend of the As element of node A is shown. Figure 6 The variation trend of As element in pipe section 1 is shown.
[0096] The application scenarios of the present invention include the following aspects:
[0097] Water supply enterprises can use this method to establish an information management system for water supply networks, conduct water supply quality prediction simulations under long time series, and use this system to carry out daily management and maintenance of the network, providing a basis for enhanced disinfection of water supply quality and energy conservation and consumption reduction of water supply systems. Water conservancy departments can use this method to carry out research on measures to ensure the stability of water supply quality in response to extreme disasters, and formulate water quality maintenance plans under the influence of deterioration of water quality in water intake. The plant-network-river integrated water supply quality prediction model constructed by the present invention automatically generates a time history diagram of water quality parameters caused by changes in external water quality for a set node pipe section. The operation is simple and easy to implement, and water quality prediction simulations for the entire water intake process can be realized.
[0098] In summary, the water quality simulation method for integrated water supply of the plant, network and river of the present invention can comprehensively evaluate and predict the operating status of the entire water supply system from the water intake river, water purification plant to the water supply network by constructing a water quality simulation model. By establishing a two-dimensional river hydrodynamic water quality model and a one-dimensional water supply plant network model, and by constructing a data interface to realize data exchange and synchronization between the two-dimensional river hydrodynamic water quality model and the water supply network water quality prediction model, the complex biochemical reactions in the water supply plant network are simulated. The data exchange interface can realize the real-time update of the import boundary conditions of the water purification plant, and simplify the water purification plant to a processing node on the pipeline system to truly reflect the hydraulic and water quality changes in the water supply network; the river hydrodynamic water quality model and the water supply network water quality prediction model are integrated into a complete water quality numerical model for integrated water supply of the plant, network and river, which can be run by one key through an automated script and the result curve is automatically drawn, forming a set of water quality simulation solutions that are easy to apply and promote. The present invention is easy to implement, can automatically generate a water quality parameter time chart, simplifies the operation process, and improves the implementation efficiency. The present invention is of great significance to the interconnection and joint supply, coordinated prevention and control, and water quality safety of water network construction. Water supply enterprises and water conservancy departments can use the present invention to establish an information management system for water supply pipe networks, conduct long-term series water supply quality prediction simulation, and provide a scientific basis for the daily management and maintenance of pipe networks, water quality enhanced disinfection, energy conservation and consumption reduction, and research on water supply quality stability assurance measures under extreme disasters.
[0099] An embodiment of the present invention further provides a storage medium for storing a computer program, which at least performs the above method when executed.
[0100] An embodiment of the present invention further provides a control device, comprising a processor and a storage medium for storing a computer program; wherein the processor is configured to execute at least the method described above when executing the computer program.
[0101] An embodiment of the present invention further provides a processor, wherein the processor executes a computer program and at least executes the method described above.
[0102] The storage medium can be implemented by any type of non-volatile storage device, or a combination thereof. Among them, the non-volatile memory can be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), a magnetic random access memory (FRAM), a ferromagnetic random access memory (Flash Memory), a magnetic surface memory, an optical disc, or a compact disc read-only memory (CD-ROM); the magnetic surface memory can be a disk memory or a tape memory. The storage medium described in the embodiments of the present invention is intended to include, but is not limited to, these and any other suitable types of memory.
[0103] In the several embodiments provided by the present invention, it should be understood that the disclosed systems and methods can be implemented in other ways. The device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as: multiple units or components can be combined, or can be integrated into another system, or some features can be ignored or not executed. In addition, the coupling, direct coupling, or communication connection between the components shown or discussed can be through some interfaces, and the indirect coupling or communication connection of the devices or units can be electrical, mechanical or other forms.
[0104] The units described above as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units; some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.
[0105] In addition, all functional units in the embodiments of the present invention may be integrated into one processing unit, or each unit may be separately used as a unit, or two or more units may be integrated into one unit; the above-mentioned integrated units may be implemented in the form of hardware or in the form of hardware plus software functional units.
[0106] A person skilled in the art can understand that: all or part of the steps of implementing the above method embodiment can be completed by hardware related to program instructions, and the aforementioned program can be stored in a computer-readable storage medium. When the program is executed, it executes the steps of the above method embodiment; and the aforementioned storage medium includes: mobile storage devices, read-only memories (ROM, Read-Only Memory), random access memories (RAM, Random Access Memory), disks or optical disks, etc. Various media that can store program codes.
[0107] Alternatively, if the above-mentioned integrated unit of the present invention is implemented in the form of a software function module and sold or used as an independent product, it can also be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the embodiment of the present invention can be essentially or partly reflected in the form of a software product that contributes to the prior art. The computer software product is stored in a storage medium and includes several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the methods described in each embodiment of the present invention. The aforementioned storage medium includes: various media that can store program codes, such as mobile storage devices, ROM, RAM, magnetic disks or optical disks.
[0108] The methods disclosed in the several method embodiments provided by the present invention can be arbitrarily combined without conflict to obtain new method embodiments.
[0109] The features disclosed in several product embodiments provided by the present invention can be arbitrarily combined without conflict to obtain new product embodiments.
[0110] The features disclosed in several method or device embodiments provided by the present invention can be arbitrarily combined without conflict to obtain new method embodiments or device embodiments.
[0111] The above contents are further detailed descriptions of the present invention in combination with specific preferred embodiments, and it cannot be determined that the specific implementation of the present invention is limited to these descriptions. For those skilled in the art of the present invention, several equivalent substitutions or obvious variations can be made without departing from the concept of the present invention, and the performance or use is the same, which should be regarded as belonging to the protection scope of the present invention.
Claims
1. A water quality simulation method for integrated water supply of a plant, network and river, characterized in that: The following steps are involved: S1. Combine the collected river topography data and river shoreline data to construct a two-dimensional river hydrodynamic and water quality model. The model configures boundary hydrodynamic and water quality parameters to simulate the hydrodynamic and water quality conditions of the river water source; S2. Monitor and analyze the temporal changes of water quality parameters at the water intake through the two-dimensional river hydrodynamic water quality model to provide key data for dynamic water quality assessment; S3. Construct a water quality prediction model for the water supply network, which integrates multiple water source inputs and simplifies the water purification plant into a processing node on the pipeline system to simulate its treatment effect on water quality; S4. Data exchange and synchronization between the two-dimensional river hydrodynamic water quality model and the water supply network water quality prediction model is achieved by constructing a data interface; S5. The water quality prediction model of the water supply network performs a one-dimensional hydrodynamic water quality simulation of the water supply network based on the data obtained from the two-dimensional river hydrodynamic water quality model, wherein the water quality and hydrodynamic parameters provided by the two-dimensional river hydrodynamic water quality model are input into the water quality prediction model of the water supply network as boundary conditions or initial conditions to predict water quality changes and hydraulic behavior in the water supply network; S6. Integrate the river hydrodynamic water quality model and the water supply network water quality prediction model into a complete water quality numerical model of integrated plant-network-river water supply to automate the entire water quality change simulation process.
2. The water quality simulation method for integrated water supply of a factory, network and river as claimed in claim 1, characterized in that: In step S1, a two-dimensional river hydrodynamic water quality model is constructed using OpenFOAM software. In step S2, the Probe function of OpenFOAM is used to monitor the changes in water quality parameters at the water intake to obtain the time series change data of the water quality parameters.
3. The water quality simulation method for integrated water supply of factory, network and river as claimed in claim 2, characterized in that: Step S2 specifically includes: S2.
1. Establish the geometric model of the river bank and export it into a format suitable for mesh generation software; S2.
2. Based on the characteristics of the river channel, use mesh generation software to draw a two-dimensional grid that adapts to the river channel morphology and output it in a format suitable for computational fluid dynamics OpenFOAM software; S2.
3. Convert the exported mesh file into a format recognizable by OpenFOAM software and store it as a standard mesh file in the case folder; S2.
4. Set the properties of the mesh in the OpenFOAM software. For two-dimensional simulations, specify the upper and lower boundary conditions and set the vertical dimensions. S2.
5. Use the built-in tools in OpenFOAM software to extract the coordinate data of the grid center; S2.
6. Perform terrain data interpolation, combine the terrain data with the grid data, use interpolation technology to obtain the terrain depth information at the center of the grid, and export the data; S2.
7. Integrate the interpolated terrain data into the OpenFOAM model to provide accurate terrain conditions for simulation; S2.
8. Define model parameters: Set the simulation parameters of the OpenFOAM software, including time step, total simulation time, physical model settings, boundary conditions, and diffusion and attenuation characteristics of pollutants; S2.
9. Set up monitoring points in OpenFOAM to track changes in water quality parameters at specific locations over time.
4. The water quality simulation method for integrated water supply of a factory, network and river as described in claim 2 or 3, characterized in that: In step S3, EPANET-MSX software is used to establish a water quality prediction model for the water supply network based on the collected network topology, pipe segment characteristics, node characteristics, and boundary condition data.
5. The water quality simulation method for integrated water supply of factory, network and river as claimed in claim 4, characterized in that: Step S3 specifically includes: S3.
1. Collect data on the topology, segment characteristics, node characteristics and boundary conditions of the water supply network; S3.
2. Create point objects and line objects in the water supply network, wherein the point objects include nodes, reservoirs, and pools, and the line objects include pipe sections, valves, and pumps; S3.
3. Define attribute fields for point objects and line objects respectively; S3.
4. Set simulation parameters to provide time control for the simulation process; S3.
5. Define the hydrodynamic conditions of the network and set the hydrodynamic states of all nodes and pipe segments; S3.
6. Add corresponding chemical species according to simulation requirements and set their chemical properties and kinetic parameters; S3.
7. Configure the initial state of water quality components in the pipe network; S3.
8. Simulate the water treatment process by adding Source modules to the model.
6. The water quality simulation method for integrated water supply of a factory, network and river as claimed in claim 4, characterized in that: In step S4, a data interface is constructed by writing a Python script to realize data exchange between OpenFOAM software and EPANET-MSX software, and the water quality and hydrodynamic parameters output by OpenFOAM are converted into the input format required by EPANET-MSX software.
7. The water quality simulation method for integrated water supply of a factory, network and river as claimed in claim 6, characterized in that: Step S4 specifically includes: S4.
1. Determine the storage path of the csv file of the time series changes of water quality parameters at the water intake exported by the probe function of the OpenFOAM software; S4.
2. Develop Python functions to read water quality parameter data, including water quality concentration data, from OpenFOAM software; S4.
3. Convert the read water quality concentration data into relative coefficients by normalizing each value in the concentration column by dividing the first value in the column; S4.
4. Determine the storage path for the EPANET-MSX software input files; S4.
5. Use Python code to automatically update the calculated relative coefficients to the PATTERNS section of the EPANET-MSX model file; S4.
6. In the EPANET-MSX model file, replace the original time pattern with the newly calculated relative coefficient to reflect the temporal changes of water quality parameters.
8. The water quality simulation method for integrated water supply of a factory, a network and a river as claimed in claim 4, characterized in that: Step S6 specifically includes: S6.
1. Create a Python script, use the subprocess module in the Python script, specify the path and name of the OpenFOAM case, and call the OpenFOAM solver to run the simulation; S6.
2. Run the Python Data Transfer Interface through a Python script to synchronize data between different software; S6.
3. Call the EPANET-MSX library through Python scripts to perform water quality simulation of the water supply network; S6.
4. Analyze water quality parameter information for specific node segments from EPANET-MSX output files; S6.
6. Convert the parsed time data into floating point numbers for hours to meet drawing requirements; S6.
7. Define the drawing function in Python, set the image format, and prepare to generate the timing curve graph; S6.
8. Generate a time series graph of water quality parameters for a specific node segment using the defined graphing function.
9. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the water quality simulation method for integrated plant-grid-river water supply as described in any one of claims 1-8 is implemented.
10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the water quality simulation method for integrated plant-grid-river water supply as described in any one of claims 1-8 is implemented.
Citation Information
Patent Citations
Sudden water pollution event coping method based on water quantity and water quality coupling model
CN112651185A
Regional enterprise, plant, network and river integrated joint optimization scheduling system and method
CN113011662A
Water quality prediction method and system integrating hydrodynamic model and mathematical model
CN116933949A
Urban water network multi-scale flood control and drainage joint optimization scheduling method and system
CN117236673A
KR20220149031A
