Software implementation of calculation of technical characteristics of water treatment systems in power engineering Inna Pivovarova 1, Alexander V. Matveev 1 and Anna Pevneva 2 1 Saint Petersburg University of State Fire Service of EMERCOM of Russia, 149, Moskovsky Prosp., Saint Petersburg, 196105, Russia 2 Saint Petersburg National Research University of Information Technologies, Mechanics and Optics University ITMO, 49, Kronverksky Prosp, Saint Petersburg, 197101, Russia Abstract The paper proposes a developed software application for automating the calculation of the technical characteristics of continuous ionites units with a fluidized ionite bed used in the water treatment system of the energy complex. The program is designed to calculate the structural and hydraulic parameters of an ion-exchange parallel-point filter used in water softening and demineralization schemes at water treatment facilities of heat power facilities. The necessary initial data, formulas are given, on the basis of which the algorithm is compiled, logical structures are developed and a software solution is obtained. The importance of work on ensuring high quality of water heat carriers for ensuring long-term and uninterrupted operation of the energy complex from the point of view of technogenic safety, as well as reducing capital and operating costs is shown. The possibility of using the developed software application in training specialists, as well as directly in working conditions, is described. Keywords 1 Automation, filters, water treatment system, software application, energy, industrial safety 1. Introduction Modern energy development requires the use of a huge amount of various resources, including water. Water is used as a heat carrier, diluent and cooling component. Each individual production or technology requires the production of water of a certain quality. Compliance with the water regime is one of the key tasks to ensure reliable and safe operation of energy complexes. The service life of all equipment depends on the purity of the coolant, even small deviations from the norms can lead to increased corrosion, deterioration of heat transfer and premature failure [1-2]. The main feature of the equipment of the enterprises of the energy complex is operation at high thermal loads. Such modes require strict limitation of the thickness of deposits on the heating surfaces. The source of scale formation is the impurities supplied with the make-up water. That is why the most important task for the energy complex is to ensure high quality of water heat carriers. Each water source requires an individual analysis and calculation of a water treatment plant for industrial use. Industrial water treatment is a complex of operations that provide water purification - the removal of harmful impurities from it, which are in a molecularly dissolved, colloidal and suspended state. The main operations of water treatment: cleaning from suspended impurities by sedimentation and filtration, softening, and in some cases - desalination, neutralization, degassing and disinfection. The article describes the developed software application for automating the calculation of the parameters of the water purification filter. A filter of the FIPa type is considered - ion-exchange parallel- flow filter. Such filters are used in water softening and desalination schemes at water treatment plants Proceedings of MIP Computing-V 2022: V International Scientific Workshop on Modeling, Information Processing and Computing, January 25, 2022, Krasnoyarsk, Russia EMAIL: i_pivovarova@mail.ru (Inna Pivovarova); fcvega_10@mail.ru (Alexander V. Matveev); pevnevaa@inbox.ru (Anna Pevneva) ORCID: 0000-0002-2569-5588 (Inn Pivovarova); 0000-0002-0778-3218 (Alexander V. Matveev ) © 2022 Copyright for this paper by its authors. Use permitted under Creative Commons License Attribution 4.0 International (CC BY 4.0). CEUR Workshop Proceedings (CEUR-WS.org) of power plants, industrial and heating boilers [3]. Ionite filters are designed for water treatment in order to remove scale-forming cations (Ca2 + and Mg2 +) from it in the process of hydrogen-sodium- cationization or ammonium-sodium-cationization, as well as sulfate, chloride and nitrate anions in the process of desalting natural waters. Feedwater systems of high-pressure boilers and many technological systems of energy complexes require almost complete removal of all ions, including carbon dioxide and silica [4]. Ion exchange systems are used to effectively remove dissolved ions from water. Therefore, it is not surprising that ion-exchange technologies occupy the main share in water purification at currently operating power plants and thermal installations not only in Russia, but also in European countries [5]. 2. Materials and methods Ionites are solid insoluble substances capable of exchanging their ions for ions from the surrounding solution. These are usually synthetic organic resins with acidic or alkaline groups. Ionites are solid insoluble substances capable of exchanging their ions for ions from the surrounding solution. These are usually synthetic organic resins with acidic or alkaline groups. Ionites are divided into cationites that absorb cations, anionites that absorb anions, and amphoteric ionites that have both of these properties. They are widely used for water desalination [6]. Ion-exchange materials of natural and artificial origin, such as cationites and anionites, are used as filter loading in ionite filters. The filter consists of:  Enclosures  Bottom and top switchgear  Pipelines  Shut-off valves  Sampling devices Purification (filtration) at stage I FIP (additional purification at stage II FIP) of the incoming stream from dissolved ionic impurities occurs due to the exchange of metal cations (anions of acid residues) for an equivalent amount of Na + or H + cations (anions of Cl- or OH- groups) in grains filtering material (cation or anion). After filtration is completed, the filter stops and is disconnected from the working manifold. A technological operation is carried out to loosen the ionite, designed to eliminate its compaction. After loosening, the ionite is regenerated [7]. 2.1. Calculation part As a mathematical apparatus for calculating the filter parameters, the method of Yu.I. Dytnersky (in accordance with the Manual to SNiP 2.04.03-85), when the value of the hydraulic characteristics obtained from the initial group of data is compared with the theoretical value for the required degree of purification [8-9]. The formulas used for the calculation are as follows: Sorption isotherm equation The sorption isotherm equation for the exchange of equally charged H+ ions for Na+ on the basis of the mass action law is written as follows: 𝐾 𝑋 𝐶/𝐶 (1) 𝑋∗ 1 𝐾 1 𝐶/𝐶 where 𝑋 – total exchange capacity, 𝐾 – equilibrium constant, 𝐶 – final concentration. 2.1.1. Liquid flow rate The fictitious fluid velocity in the fluidized bed is found from the equation connecting the criteria Re, Аr with the porosity of the bed е: 𝐴𝑟 ∙ 𝜀 . 𝑅𝑒 18 0.61√𝐴𝑟 ∙ 𝜀 . (2) The porosity of the bed in ionites with a fluidized bed can be determined from the operating data of industrial ionites, according to which the height of the fluidized bed is 1.5-2 times the height of the fixed bed. Taking into account these data, taking the porosity of the fixed bed ε0 = 0,4, it is possible to obtain the interval of porosity variation ε = 0,6-0,7. The porosity of the bed in this interval: ε = 0,65. Density of the swollen cationite particle: 𝜌 𝜌 / 1 – 0.4 (3) Archimedes criterion: 𝐴𝑟 𝑑 𝜌 𝜌 – 𝜌 𝑔/µ Liquid rate: 𝑤 𝑅𝑒 µ / 𝑑𝜌 Apparatus diameter: 𝐷 𝑉/ 0.785𝑤 After finding the diameter, it is required to round it to the number presented in the range of standard filter diameters. Determination of limiting diffusion resistance: The phase in which the limiting diffusion resistance is concentrated can be determined by the value of the Biot criterion: 𝐵𝑖’ 𝛽с 𝑅 / 𝜌 𝐷 G , where R is the particle radius, m; 𝛽с – coefficient of external mass transfer, m/s; 𝐷 – effective diffusion coefficient in the particle, m2/s; 𝐺 is the tangent of the angle of inclination of the equilibrium line, m3/kg; 𝜌 – ionite density, kg/m3. At 𝐵𝑖’ 20 he overall mass transfer rate is determined by internal diffusion, while at 𝐵𝑖’ 1,0 external diffusion resistance is predominant. The external mass transfer coefficient 𝛽с is determined by the criterion equation 𝑁𝑢’ 2,0 1,5 Р𝑟’ , 1 – е 𝑅𝑒 , (4) where 𝑃𝑟’ µ /с ∙ 𝐷 ; 𝐷 1,17 ∙ 10– m2/s. The external mass transfer coefficient is determined by the formula: 𝛽 𝑁𝑢’𝐷 /𝑑 (5) In the region of relatively low concentrations, the equilibrium dependence is close to linear. Approximately, the sorption exchange isotherm can be assumed to be linear with the slope tangent equal to 𝑋 ∗ 𝐶 /𝐶 , where 𝐶 – average ion concentration Na+. The average concentration of Na+ ions in the flow can be found as the average logarithmic 𝐶 𝐶 (6) 𝐶 ln 𝐶 /𝐶 Average tangent of the slope of the equilibrium dependence: G 𝑋 ∗ 𝐶 /𝐶 (7) Bio criterion: 𝛽𝑅 (8) 𝐵𝑖 𝜌𝐷 G where 𝜌 𝑣– / 1 – 𝜀 . 2.1.2. Average residence time of ionite particles in the apparatus The degree of processing of a spherical ionite grain , which is in a liquid medium with a concentration of Cav at Bi → 0 for time t, is determined by the following expression: 𝑋к 3𝛽 𝜏 (9) ∗ 1 exp 𝑋 𝐶 𝜌 G𝑅 where 𝑋к – final concentration of Na+ in the cationite, kg/kg. Due to the fact that in cylindrical apparatuses with a fluidized bed, the solid phase is completely mixed, the density of the distribution of ionite particles over the residence time is determined by the ratio [10]: 1 𝜏 (10) 𝜌 𝜏 exp 𝜏 𝜏 Assuming that the equilibrium concentration in the ionite corresponds to the average concentration in the fluid flow (𝐶 ), it is possible to find the average degree of ionite processing throughout the bed: 𝑋к 𝑅𝜌 𝐺 (11) ∗ 1 𝑋 𝐶 3𝛽 𝜏 𝑅𝜌 G The final concentration of Na+ ions in the cationite is found from the material balance, having previously determined the minimum and operating consumption of the ionite. The minimum flow rate is found from the condition of equilibrium of the solid phase with the solution leaving the apparatus: 𝑉 𝐶 𝐶 (12) 𝐺 ∗ 𝑋 𝐶 According to experimental data, the working consumption of the sorbent is 1.1-1.3 times higher than the minimum [11]. Taking the ratio of the working and minimum costs equal to 1.2, the working consumption of cationite is obtained: 𝐺 1,2𝐺 Average residence time of cationite particles: 𝑅𝜌 G/𝑋 ∗ 𝐶 (13) 𝜏 3𝛽 1 𝑋к /𝑋 ∗ 𝐶 2.1.3. Height of the fluidized ionite bed Volumetric ionite consumption 𝑉 𝐺 /𝜌 Fluidized bed volume 𝑉с 𝑉 𝜏 / 𝑙– 𝜀 Fluidized bed height Нс 𝑉с /0,785𝐷 The volume of the fluidized bed and its height can be determined by integrating the mass transfer equation written for a fluidized bed of infinitesimal height. This approach gives the following calculation formula for the volume of the fluidized bed 𝑉 𝐶 𝐶∗ 𝑋 (14) 𝑉 ln 𝐾 𝐶 𝐶∗ 𝑋 where 𝐾 – volumetric mass transfer coefficient, c-1. Taking into account the fact that the limiting resistance of mass transfer is concentrated in the liquid phase, it is obtained 𝐾 𝛽а 𝛽 1 – 𝜀 6/𝑑 (15) The value 𝐶 ∗ 𝑋к is determined from the isotherm equation. As you can see, the calculation algorithm is quite cumbersome and requires a certain loss of working time [12]. Therefore, to automate the process of selecting parameters for a filter from the standard range, it was decided to make a software application. 2.2. Development of a software application for performance of calculations The project is developed in the Java programming language using modern programming techniques, such as anonymous functions (also known as lambda expressions), dynamic arrays, hash tables. The features available in Java SE 8 are used. The MVC (Model-View-Controller) scheme is applied, which assumes the division of the program code into 3 parts, describing, respectively, the visual component displayed on the screen, the so-called controller, that is, the part of the program code that ensures coordination between the visual and computational parts, and directly the part of the code that implements business logic. The external view of the project directory is shown in Figure 1. The algorithm is as follows: 1. Read the necessary parameters from the form, sufficient for further calculations 2. Find the filter diameter 3. Search the database to refine the diameter 4. Display the result on the form Figure 1: The directory of the Filter project A limited set of cationites is used to calculate the values. The values are given in Table 1. The parameters used are written to a file, which is then loaded into the database. Table 1 Dependence of technological parameters on the brand of cationite used (initial data for calculation) Total exchange Equilibrium Cationite Diameter (d), Density (ρ), Sp.volume,(ν0) capacity, X0 constant, brand mm kg/m3 Sm3/g mmol‐eq / g 𝐾 КУ‐1 1.2 700 3.2 1.9 1.1 КУ‐2‐8 0.9 800 2.9 4.75 1.2 КУ‐23 0.75 920 4.3 3.15 1.85 КБ‐4П‐2 0.95 750 2.8 5.25 2.5 Thus, there is a need for the following structures: filter, cationite - represent a table entry, and in the following classes: an application that coordinates the work, a form - a visual display of information on the screen, a class that performs the necessary calculations, a database - loads from files and software provides the necessary information for certain requests. Additionally, one utility class has been introduced, which also represents a database, which in response returns strings in Russian and English. 3. Results and discussion The Application class has a main (String[] args), method, which is the entry point to the program. In this procedure, databases When the form display method is called, a separate thread is launched, which in a loop processes screen events and calls the methods that have been subscribed (using the Listener programming pattern). When you click on the "Calculate" button, the entered values are checked, and if they correspond to the logic of the task, then the Application class is called to perform calculations - the process () method is called, the arguments of which are the initial parameters. Thus, separation is performed: for the form to work, the module that performs the calculations is not directly required, and vice versa, the calculation part is in no way connected with the implementation of the form. The main project class makes sequential calls to the calculation class, the database class and again to the calculation class to determine the output parameters. Then the obtained values are transferred to the form, on which the information is displayed. Working procedure with the program: 1. The user starts the program, the main form of the application is displayed on the screen (Figure 2) Figure 2: Main application form (English) 2. If you wish to work in Russian, the author, using the File -> Language -> menu, selects the Russian interface language 3. The user enters the required parameters that determine the operating mode of the filter, cationite and the level of water pollution 4. The program checks the entered values, and in case of successful verification, the calculation is performed. The calculated values are placed at the bottom of the screen form (Figure 3) 5. To exit the program, click on the "Exit" button, on the icon for closing the window, or using the File -> Exit item. Figure 3: Form with calculated values 4. Conclusion The practical significance of the work carried out on the development of the software application is obvious and consists in simplifying and automating the calculations of the parameters of the cleaning filter. For the developed software application, a Certificate of state registration was obtained and its work was tested in the university educational process. Competent selection of filter parameters for a water treatment system can not only improve the economic component of the energy complex, but is also very important in the field of technogenic safety. Ionic impurities can seriously affect the reliability and efficiency of the entire technological system. Hardness ions, such as calcium and magnesium, must be removed from the water supply system before it can be used as feed water in the energy system. Overheating caused by the accumulation of scale or deposits formed by these impurities can lead to catastrophic pipe failures, costly production losses and unplanned downtime. 5. References [1] V. G. Starchak, et al, Povysheniye effektivnosti vodoochistki — put' k ekologicheskoy bezopasnosti i resursosberezheniyu, Voda i ekologiya: problemy i resheniya 3 (2018) 48-53. doi: 10.23968/2305–3488.2018.20.3. [2] D. Choshnova, Improving of the water preparation systems in the industry thermal power plants, Proceedings of the MATEC Web of Conferences 145 (2017) 1-7. doi: 10.1051/matecconf/201814505016 [3] Zh. S. Nurullin, I. G. Sheshegova, Raschet i proyektirovaniye ustanovok vodopodgotovki, Izd-vo Kazansk. gos. arkhitekt.-stroit. un-ta, 2015. [4] A. V. Bondarev, et al, Modeling an automated management system of technological processes in public energetics, Journal of Physics. Conf. Series 1515 (2020). doi: 10.1088/1742- 6596/1399/5/05500 [5] J. Marek, State-of-the-Art Water Treatment in Czech Power Sector: Industry-Proven Case Studies Showing Economic and Technical Benefits of Membrane and Other Novel Technologies for Each Particular Water Cycle, Membranes 11(2) (2021). doi:10.3390/membranes11020098 [6] A. P. Vergun, Ionoobmennyye tekhnologii, Tomskiy politekhnicheskiy universitet, 2017. [7] Tekhnicheskiye kharakteristiki FIP, 2016. URL: https://www.teko-filter.ru/production/filtr-dly- ochistki [8] Yu. I. Dytnerskiy, Osnovnyye protsessy i apparaty khimicheskoy tekhnologii, Khimiya, Moskva, 1991. [9] G. A. Nikolaev et al, Mass transfer processes, VSGTU Publishing House, Ulan-Ude, 2005. [10] L. O. Shtripling, F. P. Turenko, Osnovy ochistki stochnykh vod i pererabotki tverdykh otkhodov, Izd-vo OmGTU, Omsk, 2005. [11] Yu. P Klapshin, Umyagcheniye vody ionoobmennym i barometricheskim metodami, Nizhniy Novgoro, 2011. [12] L. Ansorge, M. Zeman, Model of Water Needs for Energy Production, Statistika 96 (2016) 36-46.