Water quality simulation method for plant-network-river integrated water supply
By constructing two-dimensional river channel and one-dimensional water supply network water quality models and using Python scripts to achieve data exchange, the problems of slow calculation speed and lack of integrated prediction in existing water supply system simulation software are solved, and efficient water quality simulation and prediction of water supply systems are realized.
Patent Information
- Application Number
- PCT/CN2024/128329
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2024-07-12
- Filing Date
- 2024-10-30
- Publication Date
- 2026-01-15
AI Technical Summary
Existing water supply system simulation software is insufficient in terms of computing speed and secondary development capabilities, and lacks an integrated water quality prediction model, making it difficult to comprehensively assess water quality changes throughout the entire water intake and supply process.
A two-dimensional river hydrodynamic and water quality model was constructed using OpenFOAM software, and a water supply network water quality prediction model was established using EPANET-MSX software. A data exchange interface was implemented through Python scripts, and the models were integrated into a water supply water quality simulation method that simulates the dynamics of river water source and water intake water quality, as well as the changes in water quality of the water supply network.
It enables comprehensive assessment and prediction of the entire water supply system, improves simulation efficiency and adaptability, provides time-history graphs of water quality parameters, and supports water supply companies and water conservancy departments in information management and water quality assurance.
Smart Images

Figure CN2024128329_15012026_PF_FP_ABST
Abstract
Description
A water quality simulation method for integrated water supply from water plants, networks, and rivers. Technical Field
[0001] This invention relates to water supply network hydrodynamic water quality simulation technology, and in particular to a water quality simulation method for integrated water supply from plant to network to river. Background Technology
[0002] In the simulation of hydrodynamics and water quality at water sources, classic software includes HEC-RAS: developed by the U.S. Army Corps of Engineers Hydrological Research Center, it possesses complete one- and two-dimensional coupled hydrodynamic and water environment simulation capabilities, capable of simulating hydraulic structures such as sluices, culverts, bridges, and pumping stations. Additionally, MIKE is widely used for hydrodynamic, water quality, sediment, and ecological simulation of estuaries, rivers, and lakes, including one-, two-, and three-dimensional scenarios. Delft3D is another option: a three-dimensional hydrodynamic-water quality model system containing modules for flow, hydrodynamics, waves, sediment, water quality, and ecology, with online dynamic coupling between these modules. WASP6 and WASP7: the WASP model, developed by the U.S. Environmental Protection Agency, is a comprehensive water quality simulation model capable of simulating water quality changes in rivers, reservoirs, and lakes. However, these models and methods have some limitations, such as slow computation speed and the lack of open-source code for some parts, hindering secondary development.
[0003] In the field of water quality simulation for 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 accurately simulated residual chlorine changes in actual networks using a first-order residual chlorine decay kinetic model based on EPANET. EPANET and EPANET-MSX have also proven to be important tools in water supply network adjustment calculations and multi-source water supply problems (rivers, reservoirs, and wells, etc.). EPANET-MSX adds multi-species water quality simulation capabilities to EPANET, enabling the analysis of more complex biochemical reactions within the network, such as the oxidation of heavy metals and adsorption on pipe walls; and the use of residual chlorine decay models combined with relevant optimization algorithms to select the locations of secondary chlorination and pressurization points.
[0004] There is currently very little research on the simulation of the entire water intake and supply process, while the demand for integrated water quality prediction models for water supply is becoming increasingly strong.
[0005] It should be noted that the information disclosed in the background section above is only for understanding the background of this application, and therefore may include information that does not constitute prior art known to those skilled in the art.
[0006] Summary of the Invention
[0007] The main objective of this invention is to overcome the deficiencies of the aforementioned background technology and provide a water quality simulation method for integrated water supply from plant to river.
[0008] To achieve the above objectives, the present invention adopts the following technical solution:
[0009] A water quality simulation method for integrated water supply systems (plant, network, and river) includes the following steps:
[0010] S1. River water source simulation: Combining the collected river topography data and river shoreline data, a two-dimensional river hydrodynamic and water quality model is constructed. This model is configured with boundary hydrodynamic and water quality parameters to simulate the hydrodynamic and water quality conditions of the river water source.
[0011] S2. Water quality dynamic analysis at the water intake: The two-dimensional river hydrodynamic water quality model is used to monitor and analyze the temporal changes of water quality parameters at the water intake, providing key data for dynamic water quality assessment.
[0012] S3. Construction of Water Quality Prediction Model for Water Supply Network: Construct a water quality prediction model for the water supply network. This model integrates multiple water source inputs and simplifies water purification plants as treatment nodes on the pipeline system, simulating their treatment effect on water quality, including the removal efficiency of specific pollutants.
[0013] S4. Data Interface Development: By constructing a data interface, data exchange and synchronization between the two-dimensional river hydrodynamic water quality model and the water supply network water quality prediction model are realized, ensuring the consistency and continuity of data between the models;
[0014] S5. One-dimensional pipeline network hydrodynamic and water quality simulation: The water supply network water quality prediction model is based on the data obtained from the two-dimensional river hydrodynamic and water quality model to perform one-dimensional hydrodynamic and water quality simulation of the water supply network. The water quality and hydrodynamic parameters provided by the two-dimensional river hydrodynamic and water quality model are used as boundary conditions or initial conditions and input into the water supply network water quality prediction model to predict water quality changes and hydraulic behavior in the water supply network.
[0015] S6. Integrated Model Integration and Automation: 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 plant, network and river, so as to automate the entire water quality change simulation process.
[0016] In some optional implementations, in step S1, a two-dimensional river hydrodynamic and water quality model is constructed using OpenFOAM software, and in step S2, the changes in water quality parameters at the water intake are monitored using the Probe function of OpenFOAM to obtain time-series change data of water quality parameters.
[0017] In some optional implementations, step S2 specifically includes:
[0018] S2.1. Establish a geometric model of the riverbank and export it in a format suitable for mesh generation software;
[0019] S2.2. Based on the characteristics of the river channel, a two-dimensional grid adapted to the river channel morphology is drawn using grid generation software, and the output is in a format suitable for the computational fluid dynamics software OpenFOAM;
[0020] S2.3. Convert the exported mesh file to a format recognizable by OpenFOAM software and save it as a standard mesh file in the case folder;
[0021] S2.4. Configure the properties of the mesh in the OpenFOAM software. For two-dimensional simulations, specify the upper and lower boundary conditions and set the dimensions in the vertical direction.
[0022] S2.5. Use the built-in tools of OpenFOAM software to extract the coordinate data of the grid center;
[0023] S2.6. Perform terrain data interpolation, combine terrain data with grid data, use interpolation techniques to obtain terrain depth information at the grid center, and export the data;
[0024] S2.7. Integrate the interpolated terrain data into the OpenFOAM software model to provide accurate terrain conditions for simulation;
[0025] 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 decay characteristics of pollutants;
[0026] S2.9. Set up monitoring points in OpenFOAM software to track and record changes in water quality parameters at specific locations over time.
[0027] 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.
[0028] In some optional implementations, step S3 specifically includes:
[0029] S3.1. Collect data on the topology, pipe segment characteristics, node characteristics, and boundary conditions of the water supply network;
[0030] S3.2. Create point objects in the water supply network, such as nodes, reservoirs, and pools, as well as line objects, such as pipe segments, valves, and pumps;
[0031] S3.3. Define attribute fields for point objects and line objects respectively, including but not limited to node number, coordinates, elevation, water demand, reservoir number, total head, pool size, pipe section specifications, valve type, pump performance, etc.
[0032] S3.4. Set parameters such as the simulation time step and total duration to provide time control for the simulation process;
[0033] S3.5. Define the hydrodynamic conditions of the pipeline network, including pressure, flow rate, head, etc., and ensure that the hydrodynamic status of all nodes and pipe sections is set correctly;
[0034] S3.6. According to the simulation requirements, add the corresponding chemical species and set their chemical properties and kinetic parameters;
[0035] S3.7. Configure the initial state of the pipeline network, including the initial concentration of water components, flow rate, etc., to prepare for simulation calculations;
[0036] S3.8. Simulate the water treatment process by adding a Source module to the model.
[0037] In some optional implementations, in step S4, a data interface is built by writing a Python script to realize data exchange between the OpenFOAM software and the EPANET-MSX software, converting the water quality and hydrodynamic parameters output by OpenFOAM into the input format required by the EPANET-MSX software.
[0038] In some optional implementations, step S4 specifically includes:
[0039] S4.1. Determine the storage path for the CSV file showing the time-series changes of water quality parameters at the intake, exported by the probe function of OpenFOAM software;
[0040] S4.2. Develop Python functions to read water quality parameter data, including water concentration data, from the OpenFOAM software;
[0041] S4.3. Convert the read water quality concentration data into relative coefficients by standardizing them by dividing each value in the concentration column by the first value in the column;
[0042] S4.4. Determine the storage path for the input files of the EPANET-MSX software;
[0043] S4.5. Use Python code to automatically update the calculated relative coefficients to the PATTERNS section of the EPANET-MSX model file;
[0044] S4.6. In the EPANET-MSX model file, replace the original time pattern with the newly calculated relative coefficients to reflect the temporal changes in water quality parameters.
[0045] In some optional implementations, step S6 specifically includes:
[0046] S6.1. Create a Python script, use the subprocess module in the Python script, specify the path and name of the OpenFOAM example, and call the OpenFOAM solver to run the simulation;
[0047] S6.2. Run the Python data transfer interface via a Python script to synchronize data between different software.
[0048] S6.3. Use a Python script to call the EPANET-MSX library to perform water quality simulation of the water supply network;
[0049] S6.4. Parse water quality parameter information for a specific node segment from the output file of EPANET-MSX;
[0050] S6.6. Convert the parsed time data into hourly floating-point numbers to suit plotting requirements;
[0051] S6.7. Define the plotting function in Python, set the image format, and prepare to generate the time series curve;
[0052] S6.8. Using the defined plotting functions, generate time-series curves of water quality parameters for specific node pipe sections.
[0053] A computer-readable storage medium storing a computer program that, when executed by a processor, implements the water quality simulation method for integrated water supply from a plant to a river network.
[0054] A computer program product includes a computer program that, when executed by a processor, implements the water quality simulation method for integrated water supply from plant to river.
[0055] The present invention has the following beneficial effects:
[0056] The water quality simulation method for integrated water supply systems (including water intake channels, water purification plants, and water supply networks) of this invention, by constructing a water quality simulation model, can comprehensively assess and predict the operational status of the entire water supply system, from the intake channel and water purification plant to the water supply network. This has significant implications for the interconnection and joint supply of water networks, collaborative prevention and control, and water quality safety assurance. This invention establishes a two-dimensional river hydrodynamic water quality model and a one-dimensional water supply plant network model, and achieves data exchange and synchronization between the two-dimensional river hydrodynamic water quality model and the water supply network water quality prediction model through a data interface. It simulates complex biochemical reactions within the water supply plant network. The data exchange interface enables real-time updates of the inlet boundary conditions of the water purification plant and simplifies the water purification plant as a treatment node on the pipeline system, thus realistically reflecting 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 integrated water quality numerical model for integrated water supply systems (including water intake channels, water purification plants, and water supply networks). This model can be run with a single click via automated scripts and automatically plotted as result curves, forming a water quality simulation scheme that is easy to apply and promote. This method not only possesses high operability and potential for secondary development, but also allows for personalized customization based on actual needs, enhancing the model's adaptability and flexibility. Furthermore, this invention is easy to implement, automatically generating time-history diagrams of water quality parameters, simplifying the operational process and improving implementation efficiency. Water supply companies and water conservancy departments can utilize this invention to establish an information management system for water supply networks, conduct long-term water quality prediction simulations, and provide a scientific basis for research on daily management and maintenance of the network, enhanced water disinfection, energy conservation and consumption reduction, and water quality stability assurance measures under extreme disasters. It has high practical value and broad application prospects.
[0057] In a preferred embodiment, the water quality simulation method for integrated water supply of the plant, network, and river of the present invention can be based on the open-source computational fluid dynamics software OpenFOAM and the EPANET-MSX network multi-species response code, as well as the data exchange interface, to build an integrated model, realize the overall evaluation of the water intake river, water purification plant, and water supply network, and 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.
[0058] Other beneficial effects of the embodiments of the present invention will be further described below. Attached Figure Description
[0059] Figure 1 is a schematic diagram of the water quality simulation method for integrated water supply of plant, network and river according to an embodiment of the present invention.
[0060] Figure 2 is a spatiotemporal distribution diagram of trivalent As elements in the river channel in an embodiment of the present invention.
[0061] Figures 3a and 3b are the coordinates of the water intake point and the extraction of water quality time history data according to an embodiment of the present invention.
[0062] Figure 4 illustrates 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 reactions 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.
[0063] Figure 5 shows the time history of water quality parameter changes at node A, which is automatically generated according to an embodiment of the present invention.
[0064] Figure 6 shows the time history of water quality parameter changes in pipe segment 1 automatically generated according to an embodiment of the present invention. Detailed Implementation
[0065] The embodiments of the present invention will be described in detail below. It should be emphasized that the following description is merely exemplary and not intended to limit the scope and application of the present invention.
[0066] It should be noted that when a component is referred to as "fixed to" or "set on" another component, it can be directly on or indirectly on that other component. When a component is referred to as "connected to" another component, it can be directly connected to or indirectly connected to that other component. Furthermore, a connection can be used for fixing, coupling, or communication.
[0067] It should be understood that the terms "length", "width", "up", "down", "front", "back", "left", "right", "vertical", "horizontal", "top", "bottom", "inner", and "outer" indicate the orientation or positional relationship based on the orientation or positional relationship shown in the accompanying drawings. They 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 device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation. Therefore, they should not be construed as limitations on the present invention.
[0068] Furthermore, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature. In the description of embodiments of the present invention, "a plurality of" means two or more, unless otherwise explicitly specified.
[0069] Referring to Figure 1, an embodiment of the present invention provides a water quality simulation method for integrated water supply from plant to river network, comprising the following steps:
[0070] S1. River water source simulation: Combining the collected river topography data and river shoreline data, a two-dimensional river hydrodynamic and water quality model is constructed. This model is configured with boundary hydrodynamic and water quality parameters to simulate the hydrodynamic and water quality conditions of the river water source.
[0071] S2. Water quality dynamic analysis at the water intake: The two-dimensional river hydrodynamic water quality model is used to monitor and analyze the temporal changes of water quality parameters at the water intake, providing key data for dynamic water quality assessment.
[0072] S3. Construction of Water Quality Prediction Model for Water Supply Network: Construct a water quality prediction model for the water supply network. This model integrates multiple water source inputs and simplifies water purification plants as treatment nodes on the pipeline system, simulating their treatment effect on water quality, including the removal efficiency of specific pollutants.
[0073] S4. Data Interface Development: By constructing a data interface, data exchange and synchronization between the two-dimensional river hydrodynamic water quality model and the water supply network water quality prediction model are realized, ensuring the consistency and continuity of data between the models;
[0074] S5. One-dimensional pipeline network hydrodynamic and water quality simulation: The water supply network water quality prediction model is based on the data obtained from the two-dimensional river hydrodynamic and water quality model to perform one-dimensional hydrodynamic and water quality simulation of the water supply network. The water quality and hydrodynamic parameters provided by the two-dimensional river hydrodynamic and water quality model are used as boundary conditions or initial conditions and input into the water supply network water quality prediction model to predict water quality changes and hydraulic behavior in the water supply network.
[0075] S6. Integrated Model Integration and Automation: 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 plant, network and river, so as to automate the entire water quality change simulation process.
[0076] The water quality simulation method for integrated water supply of plants, networks and rivers in the preferred embodiment of the present invention can be constructed based on the open-source computational fluid dynamics software OpenFOAM and EPANET-MSX multi-species response code for pipeline networks. It can realize the overall evaluation of water intake river, water purification plant and water supply 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.
[0077] This invention provides an integrated water quality simulation model for water supply systems, encompassing water purification plants, water supply networks, and natural waterways within a unified framework. This allows for a comprehensive assessment and prediction of the entire water supply system's operational status, significantly contributing to interconnected water supply, coordinated prevention and control, and water quality assurance in water network construction. Addressing current challenges, this invention establishes a two-dimensional river hydrodynamic and water quality model and a one-dimensional water supply plant network model based on OpenFOAM. It integrates EPANET-MSX code to simulate complex biochemical reactions within the water supply plant network and establishes a data exchange interface to update the water purification plant's inlet boundary conditions based on changes in river intake water quality. The water purification plant is simplified as a special treatment node on the pipeline system, enabling a more realistic prediction of hydraulic and water quality changes in urban water supply networks. This provides technical support for predicting adequate drinking water supply and water quality assurance.
[0078] As an alternative embodiment, other software, including HEC-RAS, MIKE, EFDC, etc., can be used for river hydrodynamic and water quality simulation, and other software, including EPANET, can be used for water supply network hydrodynamic and water quality simulation.
[0079] The following describes specific embodiments of the present invention.
[0080] A water quality simulation method for integrated water supply systems (plant, network, and river) includes the following steps:
[0081] (1) First, it is necessary to obtain the riverbank, topography, and water level, flow rate and water quality monitoring data at the boundary of the target calculation area as the prerequisite input conditions for OpenFOAM to calculate the river hydrodynamic and water quality simulation.
[0082] (2) Hydrodynamic and water quality simulation of the source water channel: The model was built based on the open-source 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.
[0083] (3) Based on the Linux system, write a data transmission interface from OpenFOAM to EPANET-MSX to realize one-way data transmission between OpenFOAM and EPANET-MSX (because there is no situation where the water from the waterworks flows back into the river during the water supply process). The output file format of OpenFOAM is csv, while the input file formats of EPANET-MSX are inp and msx.
[0084] (4) For the necessary pipe sections, nodes and reservoir layers of the water supply network, the attribute fields are reasonably designed to meet the needs of numerical calculation for establishing a hydrodynamic water quality model of the water supply network. In this 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, the hydraulic water quality model of the water supply network is established using EPANET-MSX.
[0085] (5) Write Python scripts to enable one-click operation of OpenFOAM, data transmission interface and EPANET-MSX on Linux system, and automatically output the water quality parameter time-history curve of the required node or pipe section.
[0086] The specific process of step (2) includes: creating a geometric shoreline model of the river channel using CAD software and exporting it in a format recognizable by the mesh drawing software ICEM, such as sat or igs. Then, depending on the complexity of the river channel, use ICEM to draw a two-dimensional structured or unstructured mesh, export it in Fluent format, and then use the FluentMeshToFoam command to convert it into a mesh format recognizable by OpenFOAM, saving it to the PolyMesh file in the example folder. It should be noted that OpenFOAM's mesh is in 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, typically 0.5 and -0.5. After completing the shoreline grid drawing, the river topographic data needs to be interpolated onto the grid. OpenFOAM's variable calculation results, such as flow velocity, water level, and concentration, are stored in the center of the grid cells. The topographic data is also stored in the cell centers. Therefore, the coordinates of the grid centers need to be obtained first. The code `postProcess-time 0-func writeCellCentres` can be used to output the results to the Cx, Cy, and Cz files in the folder with a time step of 0. After obtaining the grid center coordinates, the topographic and grid data are imported into Tecplot. The `Interpolate` command is used to interpolate the depth of the grid centers (positive direction is downward). The `write data file` command is used to export the interpolated topographic data and copy it to the `depth` file in OpenFOAM. Then, the control parameters, initial conditions, and boundary conditions for running OpenFOAM are defined, such as the time step, total duration, physical model, river inlet and outlet flow velocity, pressure, concentration conditions, pollutant diffusion, and attenuation coefficient. Finally, using the probe function in the openFOAM built-in postProcessing library, a probes file is created in the system folder of the OpenFOAM example to analyze the time-series changes of water quality parameters at a specific coordinate (water intake).
[0087] Step (3) involves the following steps: First, specify the path to the CSV file containing the water quality parameters of the intake point exported by the probe function in OpenFOAM. Then, write a Python function to read the file data from OpenFOAM. This file is mainly divided into two columns: one for time and the other for water quality concentration. Divide each number in the water quality concentration column by the first number in the column to convert the concentration into a relative coefficient. Next, specify the path to the EPANET-MSX input file example1.msx and use Python code to automatically update the calculated relative coefficients into the PATTERNS section of example1.msx, replacing the original time pattern. PATTERNS is used to define the time pattern of external source intensity that varies over time. Its format includes the pattern name and a series of baseline relative coefficients. Finally, a communication bridge is established between OpenFOAM, Python, and EPANET-MSX.
[0088] The specific process of step (4) includes: First, it is necessary to collect data such as the topology of the pipeline network, pipe segment characteristics, node characteristics, and boundary conditions. Point objects and line objects need to be established, where point objects include nodes, reservoirs, pools, etc.; line objects include pipe segments, valves, pumps, etc. Node attribute fields are: node number, X coordinate, Y coordinate, elevation, water demand, mode; reservoir field attributes are: reservoir number, X coordinate, Y coordinate, total head, mode; pool field attributes are: pool, X coordinate, Y coordinate, elevation, initial water level, minimum water level, maximum water level, diameter, minimum volume, volume curve; pipe segment attribute fields are: pipe segment number, starting node, ending node, length, diameter, roughness coefficient, loss coefficient, initial state; valve attribute fields are: valve number, starting node, ending node, diameter, type, setting, loss coefficient; pump attribute fields are: pump number, starting node, ending node, pump curve. Next, configure simulation parameters, such as setting the simulation time step and total duration. Simultaneously, define the hydrodynamic conditions of the pipe network, including pressure, flow rate, and head, ensuring that the hydrodynamic states of all nodes and pipe segments are correctly set. Also, add the corresponding chemical species and reactions according to the water quality components to be simulated, and set their chemical properties and kinetic parameters. Set the initial state of the pipe network, including the initial concentration and flow velocity of the water quality components, to prepare for the hydrodynamic and water quality simulation calculations. The water treatment plant can be implemented by adding a Source module to the msx input file to simulate the process of adding a specific concentration of chlorine to the water treatment plant.
[0089] Step (5) involves creating a Python script, using the subprocess module to call the OpenFOAM solver (specifying the path and name of the OpenFOAM example), and running the Python data transfer interface and the EPANET-MSX library in the same way within the same script. Subsequently, the required water quality parameter time-history curves are plotted based on the output file example1.rpt of the EPANET-MSX code. This involves parsing and extracting information from specific node pipe sections, applying time conversion functions to convert time data to hourly floating-point numbers, defining plotting functions, setting image formats, generating water quality parameter time-history curves for specific node pipe sections, and finally testing the Python script on a Linux system to ensure all functions work correctly, achieving integrated operation of hydrodynamic and water quality simulation calculations from the estuary to the water supply network.
[0090] In this embodiment of the invention, the output files of OpenFOAM are a series of folders with different time series, each containing the specific values of different parameters at the current time. However, the input files (inp and msx) of EPANET-MSX have specific input format requirements, preventing direct data transfer between the two program codes. Considering that the water supply process is a unidirectional transportation process, a data transmission interface for river hydrodynamics and water quality, as well as the hydrodynamics and water quality of the water supply network, is written in Python. A script is also written to enable one-click execution of the three sets of program codes and automatic plotting of result curves for nodes and pipe segments. This ultimately forms a water quality simulation scheme for integrated water supply systems (plant, network, and river) that can be widely applied. Using the data transmission interface between the open-source OpenFOAM code (based on Linux) and the one-dimensional pipeline open-source code EPANET-MSX, the system can generate result curves.
[0091] The technical solution block diagram of this invention is shown in Figure 1.
[0092] Example
[0093] Due to the discharge of industrial and agricultural wastewater, trivalent As elements in the river undergo convective diffusion under hydraulic action, further affecting the water intake of water treatment plants. After being adsorbed by coagulation, sedimentation, and sedimentation at the water treatment plants, trivalent As elements enter the water supply network, subsequently affecting the oxidation and adsorption of As elements in the network, posing a potential threat to the safety of residents' drinking water. This simulation example lasted for two days. This example demonstrates the applicability of the proposed method. Figure 2 shows the spatiotemporal distribution of trivalent As elements in the river in OpenFOAM. Figures 3a and 3b show the coordinates of the water intake point and the extraction of water quality time-series data.
[0094] As shown in Figure 4, the water quality model of the water supply network is constructed. It mainly considers the oxidation and adsorption reactions of trivalent As elements in the network under the action of chloride ions, which involves the interaction between the pipe wall and the flowing water source. Since the waterworks mainly treats trivalent As elements through coagulation, sedimentation and adsorption, a certain proportion of them can be reduced.
[0095] Finally, follow the steps in Part 3 to set the relevant running parameters, and run the Python code with one click to complete the execution of the three programs and generate graphs.
[0096] The automatically generated time history of water quality parameter changes is shown, taking node A and pipe segment 1 as examples. Figure 5 shows the trend of As element change at node A. Figure 6 shows the trend of As element change in pipe segment 1.
[0097] The application scenarios of this invention include the following aspects:
[0098] Water supply companies can use this method to establish an information management system for water supply networks, conduct long-term water quality prediction simulations, and integrate this system for daily network management and maintenance, providing a basis for enhanced disinfection of water supply and energy conservation and consumption reduction in water supply systems. Water conservancy departments can use this method to conduct research on water quality stability assurance measures under extreme disasters and formulate water quality maintenance plans for situations such as deterioration in water intake quality. The integrated plant-network-river water quality prediction model constructed by this invention automatically generates time-history diagrams of water quality parameters for designated node pipe sections due to changes in external water quality. It is simple to operate, easy to implement, and can achieve water quality prediction simulation throughout the entire water intake process.
[0099] In summary, the integrated water supply water quality simulation method of this invention, by constructing a water quality simulation model, can comprehensively assess and predict the operational status of the entire water supply system, from the intake river and water purification plant to the water supply network. 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 achieve data exchange and synchronization between the two-dimensional river hydrodynamic water quality model and the water supply network water quality prediction model, complex biochemical reactions within the water supply plant network are simulated. The data exchange interface enables real-time updates of the inlet boundary conditions of the water purification plant, simplifying the water purification plant as a treatment node on the pipeline system, thus realistically reflecting 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 integrated water quality numerical model for integrated water supply systems. This model can be run with a single click via automated scripts and automatically plotted as result curves, forming a water quality simulation scheme that is easy to apply and promote. This invention is easy to implement, can automatically generate water quality parameter time-history diagrams, simplifies the operation process, and improves implementation efficiency. This invention is of significant importance for the interconnection and joint supply of water networks, collaborative prevention and control, and water quality safety assurance. Water supply companies and water conservancy departments can use this invention to establish an information management system for water supply networks, conduct long-term water quality prediction simulations, and provide a scientific basis for the research on daily management and maintenance of the network, enhanced water disinfection, energy conservation and consumption reduction, and water quality stability assurance measures under extreme disasters.
[0100] This invention also provides a storage medium for storing a computer program, which, when executed, performs at least the methods described above.
[0101] This invention also provides a control device, including a processor and a storage medium for storing a computer program; wherein the processor executes the computer program by performing at least the method described above.
[0102] This invention also provides a processor that executes a computer program, at least performing the methods described above.
[0103] The storage medium can be implemented by any type of non-volatile storage device, or a combination thereof. The non-volatile memory can be read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), magnetic random access memory (FRAM), flash memory, magnetic surface memory, optical disc, or compact disc read-only memory (CD-ROM); the magnetic surface memory can be a disk drive or magnetic tape drive. The storage medium described in the embodiments of this invention is intended to include, but is not limited to, these and any other suitable types of memory.
[0104] In the several embodiments provided by this invention, it should be understood that the disclosed systems and methods can be implemented in other ways. The device embodiments described above are merely illustrative. For example, the division of units is only a logical functional division, and in actual implementation, there may be other division methods, such as: multiple units or components can be combined, or integrated into another system, or some features can be ignored or not executed. In addition, the coupling, direct coupling, or communication connection between the various components shown or discussed can be through some interfaces, and the indirect coupling or communication connection between devices or units can be electrical, mechanical, or other forms.
[0105] The units described above as separate components may or may not be physically separate. The components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of the units may be selected to achieve the purpose of this embodiment according to actual needs.
[0106] In addition, in the various embodiments of the present invention, each functional unit can be integrated into one processing unit, or each unit can be a separate unit, or two or more units can be integrated into one unit; the integrated unit can be implemented in hardware or in the form of hardware plus software functional units.
[0107] Those skilled in the art will understand that all or part of the steps of the above method embodiments can be implemented by hardware related to program instructions. The aforementioned program can be stored in a computer-readable storage medium. When the program is executed, it performs the steps of the above method embodiments. The aforementioned storage medium includes various media capable of storing program code, such as mobile storage devices, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0108] Alternatively, if the integrated units of this invention are implemented as software functional modules and sold or used as independent products, they can also be stored in a computer-readable storage medium. Based on this understanding, the technical solutions of the embodiments of this invention, or the parts that contribute to the prior art, 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 methods described in the various embodiments of this invention. The aforementioned storage medium includes various media capable of storing program code, such as mobile storage devices, ROM, RAM, magnetic disks, or optical disks.
[0109] The methods disclosed in the several method embodiments provided by this invention can be arbitrarily combined without conflict to obtain new method embodiments.
[0110] The features disclosed in the several product embodiments provided by this invention can be arbitrarily combined without conflict to obtain new product embodiments.
[0111] The features disclosed in the several method or device embodiments provided by the present invention can be arbitrarily combined without conflict to obtain new method or device embodiments.
[0112] The above description, in conjunction with specific preferred embodiments, provides a further detailed explanation of the present invention. It should not be construed that the specific implementation of the present invention is limited to these descriptions. For those skilled in the art, various equivalent substitutions or obvious modifications can be made without departing from the concept of the present invention, and all such modifications, achieving the same performance or application, should be considered within the scope of protection of the present invention.
Claims
1. A water quality simulation method for integrated water supply from water plants, networks, and rivers, characterized in that, Includes the following steps: S1. Combining the collected river topography data and river shoreline data, a two-dimensional river hydrodynamic and water quality model is constructed. This model is configured with boundary hydrodynamic and water quality parameters to simulate the hydrodynamic and water quality conditions of the river source. S2. By using the two-dimensional river hydrodynamic water quality model, the temporal changes of water quality parameters at the water intake are monitored and analyzed, providing key data for dynamic water quality assessment. S3. Construct a water quality prediction model for the water supply network. This model integrates multiple water source inputs and simplifies the water purification plant as a treatment node on the pipeline system, simulating 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 are achieved by constructing a data interface; S5. The water supply network water quality prediction model is based on the data obtained from the two-dimensional river hydrodynamic water quality model to perform a one-dimensional hydrodynamic water quality simulation of the water supply network. The water quality and hydrodynamic parameters provided by the two-dimensional river hydrodynamic water quality model are used as boundary conditions or initial conditions and input into the water supply network water quality prediction model 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 integrated water quality numerical model for plant-network-river water supply, so as to automate the entire water quality change simulation process.
2. The water quality simulation method for integrated plant-network-river water supply as described in claim 1, characterized in that, In step S1, a two-dimensional river hydrodynamic and water quality model is constructed using OpenFOAM software. In step S2, the changes in water quality parameters at the water intake are monitored using the Probe function of OpenFOAM to obtain time-series data on the changes in water quality parameters.
3. The water quality simulation method for integrated plant-network-river water supply as described in claim 2, characterized in that, Step S2 specifically includes: S2.
1. Establish a geometric model of the riverbank and export it in a format suitable for mesh generation software; S2.
2. Based on the characteristics of the river channel, a two-dimensional grid adapted to the river channel morphology is drawn using grid generation software, and the output is in a format suitable for the computational fluid dynamics software OpenFOAM; S2.
3. Convert the exported mesh file to a format recognizable by OpenFOAM software and save it as a standard mesh file in the case folder; S2.
4. Configure the properties of the mesh in the OpenFOAM software. For two-dimensional simulations, specify the upper and lower boundary conditions and set the dimensions in the vertical direction. S2.
5. Use the built-in tools of OpenFOAM software to extract the coordinate data of the grid center; S2.
6. Perform terrain data interpolation, combine terrain data with grid data, use interpolation techniques to obtain terrain depth information at the grid center, and export the data; S2.
7. Integrate the interpolated terrain data into the OpenFOAM software 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 decay characteristics of pollutants; S2.
9. Set up monitoring points in OpenFOAM software to track and record changes in water quality parameters at specific locations over time.
4. The water quality simulation method for integrated water supply from plant to river as described in claim 2 or 3, characterized in that, In step S3, the EPANET-MSX software is used to establish a water quality prediction model for the water supply network based on the collected data on the network topology, pipe segment characteristics, node characteristics, and boundary conditions.
5. The water quality simulation method for integrated plant-network-river water supply as described in claim 4, characterized in that, Step S3 specifically includes: S3.
1. Collect data on the topology, pipe 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. The point objects include nodes, reservoirs, and water tanks, and the line objects include pipe segments, valves, and water pumps. S3.
3. Define attribute fields for point objects and line objects respectively; S3.
4. Set the simulation parameters to provide time control for the simulation process; S3.
5. Define the hydrodynamic conditions of the pipeline network and set the hydrodynamic state of all nodes and pipe segments; S3.
6. According to the simulation requirements, add the corresponding chemical species and set their chemical properties and kinetic parameters; S3.
7. Initial state of water quality components in the configuration pipeline network; S3.
8. Simulate the water treatment process by adding a Source module to the model.
6. The water quality simulation method for integrated water supply from plant to river as described in claim 4, characterized in that, In step S4, a data interface is built by writing a Python script to realize data exchange between the OpenFOAM software and the EPANET-MSX software, converting the water quality and hydrodynamic parameters output by OpenFOAM into the input format required by the EPANET-MSX software.
7. The water quality simulation method for integrated plant-network-river water supply as described in claim 6, characterized in that, Step S4 specifically includes: S4.
1. Determine the storage path for the CSV file showing the time-series changes of water quality parameters at the intake, exported by the probe function of OpenFOAM software; S4.
2. Develop Python functions to read water quality parameter data, including water concentration data, from the OpenFOAM software; S4.
3. Convert the read water quality concentration data into relative coefficients by standardizing them by dividing each value in the concentration column by the first value in the column; S4.
4. Determine the storage path for the input files of the EPANET-MSX software; 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 coefficients to reflect the temporal changes in water quality parameters.
8. The water quality simulation method for integrated water supply from plant to river as described 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 example, and call the OpenFOAM solver to run the simulation; S6.
2. Run the Python data transfer interface via a Python script to synchronize data between different software. S6.
3. Use a Python script to call the EPANET-MSX library to perform water quality simulation of the water supply network; S6.
4. Parse water quality parameter information for a specific node segment from the output file of EPANET-MSX; S6.
6. Convert the parsed time data into hourly floating-point numbers to suit plotting requirements; S6.
7. Define the plotting function in Python, set the image format, and prepare to generate time series curves. picture; S6.
8. Using the defined plotting functions, generate time-series curves of water quality parameters for specific node pipe sections.
9. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by the processor, it implements the water quality simulation method for integrated water supply of plants, networks and rivers as described in any one of claims 1-8.
10. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by the processor, it implements the water quality simulation method for integrated water supply of plants, networks and rivers as described in any one of claims 1-8.
Citation Information
Patent Citations
Water quality and water ecology integrated early warning system, control device and storage medium
CN109558973A
Plant-network-river integrated classified intelligent scheduling method
CN112950096A
Regional enterprise, plant, network and river integrated joint optimization scheduling system and method
CN113011662A
Water quality simulation method for plant-network-river integrated water supply
CN118504467A
AU2020101392A4
Cited By
Chlorination method and device for water supply network
CN121929796A