Methods of mathematical modeling of fire extinguishing systems and their implementation in the ISIGR software package

. The basis of fire protection of production, retail, warehouse, and other facilities are automatic fire extinguishing installations, internal fire fighting mains, and water curtains, which are an integral part of the water supply system. When designing such systems one shall perform the hydraulic analysis, the results of which allow selecting the required equipment mix, estimating performance of systems under different modes, and so on. The hydraulic analysis is usually performed either manually/with partial automation or using algorithms that implement numerical simulation methods. The latter requires readily available programs that greatly simplify making up the system of equations by forming an analytical model from the nodes and connecting branches. The software products currently available on the domestic market are either fail to deliver the expected benefits or have high cost and require user training. We present the conceptual and mathematical statement of the flow distribution problem with non-fixed nodal flows for an arbitrary pipeline system, including fire-fighting one, and the corresponding modification of the nodal pressure method that factors in the dependence of the flow through the nozzles (sprinkler, drencher) on the pressure (head) upstream. This and other problems lend themselves to solving with the help of the "ISIGR" online application package.


Introduction
Automatic fire-extinguishing installations (AFI), internal fire-fighting mains (IFM), and water curtains are essential engineering structures that allow a prompt fire response in office, retail, manufacturing, entertainment, storage, and other facilities. When designing firefighting systems, one shall perform the hydraulic analysis, the results of which allow selecting a required configuration of a network, the mix and specification of the equipment; factoring in the joint operation of its individual units, the effect of all local pressure losses; estimating the performance of systems under various modes, and so on.
Notwithstanding the availability of methods for modeling pipeline systems (PLS) that serve arbitrary purposes [1], including those of the types covered herein [2], such work is still carried out by means of manual calculation [3,4]. On the one hand, this is due to the peculiarities of fire-fighting systems (dendriform or multi-path configuration, small dimensionality, and equivalence of dead-end branches of the network) that lend themselves naturally to performing the hydraulic analysis "manually" (SP 5.13130.2015) [5]. On the other hand, in the case of looped circuits, there are no implementations of numerical simulation methods in the form of simple, convenient, and affordable computer programs.
The most popular programs available on the domestic market for the hydraulic analysis of fire-fighting systems are covered below.
"TAKT-Voda (Russia, taktvoda.taktprog.ru) and GidRAVPT (Russia, gidravpt.ru) enable one to generate final drawings for Autodesk AutoCAD SCC projects of PLSs, which facilitates further work for users but have the following drawbacks: a) drawings are generated on the basis of the model and parameters of its elements whose topology is pre-defined in tabular form, but this is limited to the set of ready-made templates of the model's fragments (sections), which is not convenient from the user's standpoint and is not efficient; b) the increase in the dimensionality of models can adversely affect the convenience of inputting and changing the parameters of their elements; c) they rely on automation of the method of "manual" calculation instead of adopting numerical modeling methods.
"MagiCAD" (Finland, ventsoft.ru), "SprinkCAD" (USA, sprinkcad.com) are systems of programs and modules developed within the framework of BIM-technologies ( Building Information Modeling) for displaying three-dimensional models and performing the hydraulic analysis of the AFI and IFM in Autodesk AutoCAD and Revit. WaterGEMS (USA, bentley.com) [6] can also be applied to modeling fire-extinguishing systems, however, it is designed for complex development and implementation of digital twins of water supply systems. It has the ability to integrate with AutoCAD, ArcGIS, etc. The main disadvantage of these programs is their high cost and a steep learning curve on the part of the user.

Problem statement
The most challenging part of the hydraulic analysis of AFIs, IFMs, water curtains, and other similar PLSs is to ensure the intensity of water or water solution flow by the most remote nozzle (sprinkler, drencher, sprayer, hose nozzle, etc.) that does not fall behind the required level under, perhaps, a slight change in the intensity at other nozzles operating within the given area. In the case of the looped configuration of distribution pipelines the complexity of the analysis can multiply, therefore, it is required to solve the problem of flow distribution with non-fixed nodal flows [2,7,8].
The conventional model of flow distribution for an arbitrary pipeline system is of the form [1]: The problem consists in determining vectors x , y , P given the pre-defined matrix A , vector Q , vector-valued function f( ) x , and pressure at least at one node.
The simplest type of dependency for components f( ) x can be set as where i s -either the pressure loss of the passive branch calculated as per various formulas [9,10] or the coefficient obtained by approximation of the design head and rate specification of the pump 0 i H  -the pressure built up by the pump at 0 i x  . The theory of hydraulic circuits [1] advocates a universal approach that is based on the theoretical expansion of the initial analytical model corresponding to some real PLS, up to the cyclic (completely closed-loop) model. Such a model can be arrived at by connecting its nodes with the non-fixed flow by theoretical (dummy) branches to the node with the fixed pressure. The constitute relation of the theoretical branch, set in the form of (2), will reflect the dependence of the flow on the differential pressure at the consumer node. In this connection, the problem of calculating the flow distribution with non-fixed nodal flows can be solved in its conventional statement based on model (1) by an arbitrary method.
An alternative problem statement is to modify model (1) as follows [2,7]: where B( ) P -is an m -dimensional vector-valued function with components B ( ) that model dependence of the nodal flow on the head, and B ( ) 0( 0) if node j has a fixed flow (for general-use needs), where B j -the flow through the product, l/s; j P -the piezometric pressure upstream of it, mH2O; j K -the performance factor assumed as per engineering documentation of the product, l/(s*m 0.5 ); j z -the height of the installation of the product relative to the plane of comparison, m. The flow through the nozzles of the fire hose (fire-hose nozzle) of different designs, for example, RSP-50, RSK-50, PLC-20, and others, is modeled by the same relation. And the final result of IFM modeling is the determination of the height of the compact part of the jet, formed by fire-hose nozzles [12].
Solving this problem as based on model (3) while taking into account (4) can be achieved, for example, by means of the nodal pressure method [1] that implies a solution search in space 1 2 { , }  P P P , where 1 2 , P P -the unknown and given node pressures (piezometric pressures), respectively. The calculation method is reduced to setting up process 1 1 1 1 k k k      P P P so that at each of its k -th iterations adjustment 1 k P is found from the solution to the system. 1 1 1 2 , A A -an incidence matrix for nodes with unknown and given pressure, respectively; . The search of  , in general, can be carried out using the goldensection search method.
For comparison purposes, Fig.1 shows an example of a model that is extended to a cyclic one. The matrix M of the system of equations of method (5) will be of the form [ where  -the coefficients are defined as  (5) is also applicable to modeling flow distribution given non-fixed flow rate [7,13] and leakages [14] in water supply systems.

Implementation technology
The implementation of method (5) is based on the concept of object-oriented modeling of hydraulic circuits (OOMHC) [15] that aims at separating general methods of calculation from the particular specifics of the subject area in their implementation in the form of final programs. Achieving this goal allows overcoming wasteful duplication of modeling methods implementations among application packages that make use of these methods. The concept is subject to classical rules of object-oriented programming, which implies designing classes of objects encapsulating details of their implementation and relationships between them. This concept also defines the rules (strategy) of designing based on the needs of modeling hydraulic circuits in each particular case.
The simplest implementation of method (5) as per the concept of the OOMHC can be described as follows. Let us introduce two independent objects "Network model" and "Elements model". Properties of the first object will be responsible for information about the topology of the analytical model (numbers of end nodes) and the value of boundary conditions (consumption and pressure of the medium at the nodes). Methods of this object will be responsible for the implementation of common methods of flow distribution calculation. The properties of the second object will be responsible for the parameters of the modeled elements such as pipeline length, diameter, and material, various coefficients, etc. However, the methods of the "Elements model" object should match those required by the "Network model" object. For example, for the nodal pressure method, it is necessary to provide the calculation of head (pressure) loss and its derivative with respect to a given flow rate. During flow distribution analysis, the "Network model" object will repeatedly call these methods for each element. Specifics of modeling (4) will be left in the "Network model", and in case of the growth in the variety of models of nodal flow it will be necessary to take them out in a separate object. Figure 2 shows the aggregated flow chart of the hydraulic analysis algorithm, where interrelationships between key objects are specified by data. The flow chart omits the objects of "Topological problems" so as to isolate the methods of solving problems on the graphs to search for fragments and check the pressure setting in each of them, as well as the "System of linear equations solution" so as to isolate the methods of solving systems of linear equations.
Application of the OOMHC in development allows: introducing more advanced methods for solving standard problems without re-programming the application package (AP); quickly integrating methods for solving new problems into the AP; applying previously implemented methods to new types of PLSs in different APs intended for different purposes, regardless of their programming language; streamlining the process of maintaining, updating, and adding new components, which will simultaneously reduce the cost of development, debugging, and further elaboration of the AP; etc.

Internet-based hydraulic analysis
The concept of the OOMHC was adopted in the development of the "ISIGR" (Internet-based System for Hydraulic Analysis) AP designed for Internet-based (51.isem.irk.ru) modeling of hydraulic controls of multi-circuit pipeline systems of water and gas supply. Following on from study [16], this application package is tailored to the modeling of fire-extinguishing systems (AFIs, IFMs, water curtains) by the nodal pressure method in its modification (5). The package does not require installation on a computer, and its unorthodox implementation technology, self-explanatory interface, and ease of use allow performing contingency calculations with minimal work effort for models with the dimensionality of up to 1,000 nodes at any time, anywhere and by any number of users with an Internet connection. It can potentially be adopted in energy, housing and utilities, and construction, during design and operation, research and education, by engineers, post-graduates, and students. Developed back in 2013, the application package still knows no direct competitors, and it can rival wellestablished (paid) programs in terms of certain functions.
The graphical user interface (Fig.3) is developed on the basis of the Microsoft Silverlight component (requires a one-time installation) that is designed to develop programs that run in the Internet Explorer web browser on the Microsoft Windows XP/7/8/10 operating system, which is a standard setup.
Creating and editing PLS models is performed in a way similar to that employed by vector image editors (for example, Autodesk AutoCAD). The model consists of nodes and connecting branches that form a computational graph (system of equations) of arbitrary topology. In its current version, the application package supports the creation of the following types of connections:  "Pump", where the setting of pressure and flow characteristics in tabular and/or graphical forms is required;  "Valve" -diameter and type of the valve;  "Pipeline" -pipe length, inner diameter, and wall material, coating and its thickness, as well as the possibility of setting the diameter of the washer, local pressure losses or their percentages;  "Simple section", -pressure loss i s (e.g., for modeling fire hoses) and head/pressure (e.g., for modeling pumps);  "Flow regulator", -the "setpoint" of the required flow rate;  "Pressure regulator", -the "setpoint" of the required pressure. Accordingly, the program allows creating nodes of the following types: "Connection", "Source" (requires pressure/head setting), "Consumer" (requires fixed or non-fixed flow setting), "Nozzles" (requires performance factor setting).

Conclusion
We elucidated the relevance of the application of methods for the numerical solution of the flow distribution problem to fire-fighting pipeline systems.