Computer modeling and software development for unsteady chemical technological systems

The paper deals with mathematical modeling in transient conditions to create a computer system that can reflect the behavior of real industrial plants. Such systems can respond to complex and pressing questions about the stability of the industrial facilities and the time spent on transients passing through the unstable regimes. In addition, such systems have a kind of intelligence and predictive ability, as they consider partial integral and differential systems of equations that are based on physical and chemical nature of the processes occurring in devices of technological systems.


Introduction
Currently, computer-modeling systems for calculation of the operating parameters of devices for complex petrochemical plants are widespread [1][2][3][4].Such systems allow to develop chemical and mathematical models of processes as a set of systems of differential, integral, and algebraic equations, and then to solve them by various methods, including numerical.However several problems are hardly solvable for most systems.These problems are related with the modeling of non-stationary processes, depending on the astronomical time, such as changing system settings at occurrence of transient modes.The geometric dimensions of the elements affect primarily the time and nature of processes, and this determines their inertia in responding to changes in external conditions.
The article sets out the principle that is used for simulation of unsteady systems, considering the apparatuses parameters change through time at transition regime.As an example of chemical-technological system for modeling, we selected the technology of low-temperature gas separation.The choice is made in favor of this technology, as it is one of the most common and popular technologies of gas and gas condensate treatment [5][6][7][8].This is due to the relative simplicity in hardware design and management of the process At that, it allows ensuring the necessary quality of products obtained from raw materials with a wide range of parameters variation.

Technological scheme description
The working range of pressures in process scheme is from 2.50 to 7.35 MPa, the temperature ranges from minus 45 to plus 30 ° C, the amount of incoming feedstock to the installation varies from 60 to 210 nm 3 /h.In such a process scheme, there are three consecutive separation stages: at the first stage, the feed pressure is in the range of 6.0 to 7.0 MPa, a temperature of 5 to 25 °C.Then after passing through a heat exchanger and a control valve in the second stage separation, we observe the temperature decrease from minus 10 to plus 3 ° C.
In the third stage separation, we observe the decrease of the temperature of minus 35-minus 30 °C and a pressure to 3.7-5.5MPa.In each liquid separator condensation followed by separation, with the greatest number of the gas stream withdrawn from the first stage.To make the further condensation possible is necessary to change the working conditions in the separators [9][10][11][12].

Mathematical description of technological system performance
We found out that the rate of materials accumulation in the apparatus can be represented by the following differential equation: Initial conditions: 0 0, ; here ij N -amount of j-th substance in the i-th apparatus, mole; in k ij F -k-th flow rate of the j-th substance at the entrance to the i-th apparatus, mole/sec; out k ij F -k-th flow rate of the j-th substance from the i-th apparatus, mole/sec; The material balance equation supplemented by the heat balance equation in a stationary form: Initial conditions: 0 0, ; Q -amount of the heat of the j-th substance in the i-th apparatus, J; in T ij H -enthalpy of the j-th substance in the i- th apparatus at the input temperature, J/mole; out T ij H -enthalpy of the j-th substance in the i-th apparatus at the output temperature, J/mole; ij Q ' -energy, accepted by j-th substance in the i-th apparatus, J/sec.
It is shown that for the simulation of chemical-technological system consisting of a plurality of elements, mutually influencing each other, it is necessary to establish the nature of the connection between devices, which can be described by the system of equations: where in n mj F -n-th flow rate of j-th substance at the entrance to the m-th apparatus, mole/sec; out n mj F -n-th flow rate of the j-th substance from the m-th apparatus, mole/sec; in T mj H -enthalpy of the j-th substance in the m-th apparatus at the input temperature, J/mole; out T mj H -enthalpy of the j-th substance in the m-th apparatus at the output temperature, J/mole; Type of the functional dependence of the material and heat flows depends on the type and design of the equipment.
Combining the presented Expressions, we obtained the dynamic mathematical model of the low-temperature gas separation, which is a system of differential equations of the first order: DOI: Initial conditions: To solve the system of differential equations we used the Runge-Kutt method of the 4th order.

Software implementation and simulator development
Algorithm for two-and three-phase separator calculating the using a simulation of the dynamic model of lowtemperature gas separation process includes the following steps: 1.
Input data source (flow rates, compositions, temperature, pressure, levels of light and heavy liquid, the geometrical dimensions of devices, etc.).Loading is carried out with the use of databases.

2.
Calculation of the devices material balance with determination of debalance value, that allows to calculate the change of device parameters in dynamic conditions.

3.
Calculation of the equilibrium constants of the phase considering the temperature, pressure and gas composition.For this, we used the methodology of phase equilibrium constants calculation of Soave-Redlich-Kwong equation for hydrocarbons and Tek-Still for polar substances.

4.
Calculation of the output flows composition (the iterative determination of the molar fraction of distillate, calculation of speed of hindered settling of methanol water droplets in the condensate layer and speed of condensate drops surfacing in the layer of methanol water).Definition of residual water content in condensate.

5.
Calculation of the process parameters (temperature, pressure, liquid level, considering the geometrical dimensions of devices).

6.
The calculation results output (flows rates and compositions, temperatures, pressures, fluid levels).The results are presented in form graphs and tables.We implemented this algorithm using object-oriented Borland Delphi 7 programming language.
Here is the part of the code implementing the algorithm above.END Each included function in the code refers to the shared database, extracts, converts and rewrites the result in appropriate fields according to unique key IDObject, associated with each element of the system.
To move to the implementation phase of the software it is necessary to develop a structure by which the work will be done with a computer model.At this stage, the following provisions are applied: 1) "Client-server" architecture type was chosen for the following reasons: А) the possibility of access to software from external workstations via network protocols.It also allows you to access an unlimited number of clients; B) all calculations must be performed on the server, thereby reducing the overall load on your workstation, and the sense of fully bring them closer to the automatic operator workstations that are used in the management of real installations.For this reason, the server provides storage for defined major databases, databases of technological schemes, as well as the ability to connect with (* .dll)libraries, containing the components of the complex simulation models (model specific devices or systems).Building relationships between the components of the structure should be carried out using a special tool to create a specific implementation of a simulation model -the designer, which allows to create any variants of technological schemes of installations); C) ensuring a high degree of protection, as well as easier organization of access control.
2) The division of management rights.In this case, it is planned to separate functionality to operators and administrators.The developed computer model should have the following features for the operators of technological installations: x the manage settings for valves and control equipment; DOI: 10.1051/ , 0100 (2016) MATEC Web of Conferences matecconf/2016 85 8501005 x setups management; x monitoring of the system devices parameters.At the same time, the administrator functional capabilities should be implemented: x operators monitoring and management during the learning process; x managing the various emergencies with the ability to create a disturbance in the system at any time; x changing the raw input parameters (composition, temperature, etc.).

Fig. 2. Scheme of interaction of software products developed within the project
The developed software interface is shown in Fig. 3.

Simulation results
The impact on the system was carried out by changing the degree of valves opening of.As constant parameters we adopted: the temperature and composition of the gas inlet; the degree of ejecting device opening; liquid level in the separator, the level of consistency is achieved by changing the degree of control valves opening in an automatic mode.
At that, there were some effects, one of which is shown in Fig. 6.
Fig. 6.Dependence of pressure in the second separator on the time As can be seen from the figure, by increasing the valve opening percent increase in pressure in the separator is not instantaneous and takes some time.The amount of time is related to geometrical dimensions of the separator and the elements included in the system.

Conclusions
The considered in the article principle of non-stationary mathematical model development can be used to create similar models for other industries [13][14][15].
A simulation model for dynamic process of low-temperature gas separation, built on the basis of the laws of phase transformations of the gas-liquid hydrocarbon systems and heat transfer processes in dynamic operating conditions of industrial installations, allows to predict the work of existing units of the technological scheme with regard to their construction.
When you change the control parameters (opening degree of control valves), chemical-technological system retains inertia, and then returns to a stable state.The simulation dynamic model of the low-temperature gas separation process makes it possible to estimate the time to reach a new steady state, to consider all the attendant fluctuations devices operating parameters included in the installation [16,17].

Fig. 1 .
Fig. 1.Structure scheme of main flows of the technological module

Fig. 3 .
Fig. 3.The main computer simulator dialog box for low-temperature separation technology: 1 -status and connected client's name; 2 -toggle panel between control screens of main devices of low-temperature separation installation; 3 -a summary table of the main devices parameters (temperature, pressure); 4 -hour counter; 5 -switch on the main dialog box; 6 -switch to a graphical representation of the results of calculations; 7 -calling the dialog box with the task of setting control valve devices.

Fig. 4 .Fig. 5 .
Fig. 4. The screen of control process parameters of second stage liquid separator and liquid heat exchanger