Design of PLC Integrated Process Simulation Software for Steam Generator Using Matlab Simulink

This paper describes the work done in order to make Matlab Simulink based steam generator simulator in the simulation of a steam generator. The steam generator under this research is operated with the steam quality of 72%, O2 content is 1.2%, designed steam volume flow is 3600 barrel per day at a maximum and designed fuel gas volume flow is 1300 Thousand Standard Cubic Feet (MSCF) per day at a maximum. The simulator program of the steam generator is separated into individual components consisting of Burner, Radiant, Convection, Exhaust Stack, Feedwater Pump Discharge and Steam Discharge. Within the components, thermodynamics and heat transfer principles such as conduction, convection, radiation and also conservation of mass, momentum, and energy were applied to compute the pressure values, temperature values, and flow rate values of simulated field device based on the command and setpoint from PLC. The validation process has been done with the steam generator is operating in a steady state to the 10 important process parameters of the steam generator. The error percentage calculated from a difference between the simulation result value and the actual value from field data reference divide by actual value from field data reference. The error percentage results are as following : Fuel Gas Orifice Differential Pressure : 2.39%, Fuel Gas Pressure : 1.37%, Fuel Gas Temperature : 5.95%, Fuel Gas Flow Rate : 1.25%, Feedwater Orifice Differential Pressure : 1.94%, Feedwater Pressure : 1.54%, Feedwater Flow Rate : 0.92%, Steam Orifice Differential Pressure 3.26%, Steam Discharge Pressure 1.93% and Steam Quality : 0.05%.


Introduction
EOR (Enhanced Oil Recovery) is a production method applied to an oil production field to increase the amount of oilfield production. The EOR serves to increase the production of an oil field when the natural pressure in the oil well, which drives the oil out to the surface has diminished with the age of an oil field, so a method is needed to push the oil out of the well. There are various methods applied in EOR, one of which is a steam flood or thermal injection.
Thermal injection is one of the techniques for increasing the amount of crude oil that can be extracted from an oil field. Steam flooding is one means of introducing heat into the reservoir by injecting steam into the well. In order to produce steam, several steam generators are operated to produce steam with the specific steam flow and steam quality. The steam generator under this research is operated with the steam quality of 72%, O2 content is 1.2%, designed steam volume flow is 3600 barrel per day at a maximum and designed fuel gas volume flow is 1300 Thousand Standard Cubic Feet (MSCF) per day at a maximum.
Oil Field D is an oil field operated by PT C. The steam injection method is the most suitable method for heavy oil type produced by Oil Field D. Heavy oil is a type of oil that has a high viscosity, so it takes steam to reduce the level of the viscosity of the fluid so that the process of removing the oil more easily and efficiently. Figure 1 below provides an illustration of an oil field production system using a steam injection system. To produce steam for steam flood process, PT C operates a natural gas-fired steam generator to produce steam with certain steam pressure and steam quality. This steam generator works based on the principles of heat transfer physics, thermodynamic physics and fluid mechanics operating under the control of instrumentation and control systems based on Programmable Logic Controller (PLC).
During the lifecycle of a steam generator unit, necessary activities from an operation, maintenance and optimization will be carried out. Depending on the scope of activities, operators, technicians or engineers may be involved in some of the phases. An operator that is responsible for carrying out operation phase or technicians which are responsible for carrying out maintenance phase shall be competent to carry out activities which they are accountable. Competency only is achieved with the right methods of training activities, the most effective training method is hands-on training which will put trainee into real situations and scenarios. On the other side, engineers that are responsible for carrying out optimization phase will need effective tools for research and experiments activities.
The Matlab Simulink based steam generator simulator software will be proposed as a part of steam generator simulation system that can be used for training purposes or for research purposes. The Steam generator simulation system will be consisting of Allen-Bradley Controllogix Programmable Logic Controller (PLC) and Rockwell FTview ME human-machine interface (HMI) software that they are loaded with and run the existing steam generator control system logic programs. The Allen-Bradley Controllogix PLC acquires data of simulated field device from Simulink based steam generator simulator software, processes the logic and control program and then send the command of simulated field actuator to Simulink based steam generator simulator software through Matlab OPC Toolbox connections.
The simulator program of the steam generator is separated into individual components consisting of Burner, Radiant, Convection, Exhaust Stack, Feedwater Pump Discharge and Steam Discharge. Within the components, thermodynamics and heat transfer principles such as conduction, convection, radiation and also conservation of mass, momentum, and energy were applied to compute the pressure values, temperature values, and flow rate values of simulated field device based on the command and setpoint from PLC.
The objectives of this research are : 1. Design and build a mathematical model of physical processes within the steam generator system. 2. Design and build a computer simulation for steam generator physics process based on the mathematical models resulted. 3. Integrate simulation system with existing steam generator PLC based control systems for learning and research tools.
Limitations of the design of the steam generator simulation are as following : 1. Simulation built with Matlab Simulink programming language and communication between PLC and Simulink is using ethernet network.
2. The inputs of this simulation are the actuator control commands of the PLC while the outputs are the simulated value of the sensors. 3. Sensors to be simulated are limited to the 10 sensors available in the field operation data recording system according to Table 1. 4. The analysis is limited to steady-state conditions and the tolerance range of the simulated results is 10% against the field operation data.

Theoretical Review
The steam injection system at Oil Field D used steam with certain temperature and pressure generated by steam generators. The steam generators at Oil Field D is a boiler that uses natural gas fuel. Within the combustion process in the combustion chamber, natural gas will be reacted with air in a certain ratio so as to produce the most efficient combustion process. The heat generated by the combustion process in the combustion chamber will be used to heat the water in the boiler so that the water changes phase to the steam phase. The resulting steam is then injected into the injection well. In Figure 2 there is a functional organization of steam generators operated in Oil Field D, which consists of the main parts that will be based on the modeling to be developed.

Burner
In this model, the combustion process between fuel (in this case is natural gas) and oxygen occurred, which is an exothermic process that becomes a source of heat for steam generators.

Fuel
In this model, there is a process of measuring and controlling the gas flow rate regulated by the PLC through a gas flow control valve based on the amount of gas required by the ongoing combustion process. The amount of measured gas flow is determined by the pressure of the gas source, the pressure difference between the input and output of the orifice and the gas temperature.

Feedwater
In this model occurs the process of measuring the flow rate of water by PLC. The amount of measured gas flow is determined by the pressure of the water source, the pressure difference between the input and the output of the orifice measuring element and the water temperature.

Convection
In this model, the heat carried by the exhaust gas is utilized to heat the water stream convectionally before the water is fed into the Steam Generator.

Radiant
In this section, there is a transfer of heat from the process of burner model to the water stream by radiation so that the water temperature increases causing the water to changes the phase to steam phase. Some heat that is not absorbed by water will be carried away by the exhaust gas toward the Convection model. 6.
Steam In this section, there is a steam quality measurement process by PLC. The quality of steam is the percentage of vapor phase content in the fluid. The amount of steam quality is determined by the steam pressure and pressure differential between the input and output of the orifice measuring element.
In [10] Craig Pauley stated that: The measurement system of the water flow rate using an orifice plate with PLC as a flow computer presented in Figure 4 below: The measurement system of steam flow rate using orifice plate with PLC as flow computer presented in Figure 5 below: In [12] and [23] it is explained that for hydrocarbon gas, the flow calculation follows the following equation:  The process of measuring the flow of fuel gas using orifice plate with PLC as flow computer using the system presented in Figure 6 below:

Design of Simulation System
The system architecture of integrated PLC steam generator simulation is shown in Figure 7 while the connection between PLC and computer is shown in Figure  8 and Figure 9. This simulation system consists of two hardware parts as following : • Personal Computer It is running Matlab Simulink software, PLC programming software, and HMI software. The computer will be receiving commands from PLC and then send the sensor simulations to PLC through ethernet communication.

• PLC
It is controlling the process of steam generators simulated by Simulink through ethernet communication.   The modeling method used is based on the modeling structure of the process control system from the ANSI / ISA-88.01-2010 standard Batch Control Part 1: Models and terminology [17], adapted according to the requirements in modeling the physical processes within the steam generator.
All functions or data are wrapped in objects or classes [17]. Objects interact with other objects in a class to form a new object in a higher class. The advantage of this modeling method is to ease the understanding of the physics process and easy to be taught because it is structured and also ease the implementation of making the simulation program because the program can be built from several function modules which can be reused.
The proposed modeling design is presented in Figure 10 below, where the steam generator unit 14 consists of six process modules, six subprocess modules, and five control modules: Simulink simulation software will be communicated to the PLC through a gateway between Simulink OPC Toolbox and RSLinx software as shown in Figure 11 that describe details of software connection between Simulink software and PLC.

Static Simulation System Testing
Static simulation system testing for subprocess module level is done by running the simulation for individual subprocess modules in Matlab Simulink environment then the result compared with reference from field operation data.
For Orifice_1 subprocess module, the water flow rate in barrel per day (BPD) is an independent variable with a fixed value in accordance with the actual pumping capacity which the value varies between 3580.5 BPD to 3585 BPD. The test results are presented in Figures 12 and Table 2. Based on the test results presented in the figure and the table above the average of the percentage of error against the field operation data is 1.13%, so it is still within the maximum error range of 10%.
For Orifice_2 subprocess module, the gas flow rate is an independent variable which the value varies from 132.39 MSCFD to 1039.90 MSCFD. Test results are presented in Figure 13 and Table 3.  against the field operation data, so it is still within the maximum error range of 10%.
For Orifice_6 subprocess module, the steam quality is an independent variable which the value varies from 20.01% to 72.08%. Test results are presented in Figure 14 and Table 4. Based on the test results presented in the above figures and tables, the average percentage error generated is 1.99% against the field operation data, so it still within the maximum error range of error of 10%.
To start static simulation system testing for unit module level, standard operation procedures for steam generators are implemented through HMI and PLC so that the steam generator unit is in normal steady state working condition. Under this condition, observations and data recording of the simulated sensors are made, the expected result is that each value recorded by the PLC should be within a certain error range.
From ten (10) static tests that conducted sequentially, one of the results presented in Table 5, the average percentage error of simulation results are presented in Table 6.  Based on the test results, the average percentage of error are as following : differential pressure of fuel gas orifice : 2.39%, fuel gas pressure: 1.37%, fuel gas temperature: 5.95%, fuel gas flow rate: 1.25 %, differential pressure of feedwater: 1.94%, feedwater pressure: 1.54%, feedwater flow rate: 0.92%, differential pressure of steam orifice: 3.26%, steam discharge pressure: 1.93% and steam quality: 0.05%.

Dynamic Simulation System Testing
For dynamic simulation system testing, standard operation procedures for steam generators are implemented through HMI and PLC so that the startup process of steam generator will be executed from standby conditions until normal steady state working condition achieved. During this process, observations and data recording of the simulated sensors are made.
Simulation data and reference operational data for steam quality and steam quality setpoint will be presented in form of X-Y chart against elapsed time which will represent the response of steam generator system to PLC control. The two graphics will then be compared to obtain a comparison of dynamic responses between the simulation results and field operational data. The parameters to be compared to two graphics are as following : • Dynamic test results for operational data are presented in Figure 15, based on the curve the following control performance parameters can be calculated : • Rise Time is approximately 40 minutes.
• Steady State Error varies within 5% range at maximum. Dynamic test results for the simulation results are presented in Figure 16, based on the curve the following control performance parameters can be calculated :

Conclusion
Based on the data and analysis of the research on "Design of Integrated PLC Process Simulation Software Using Matlab Simulink", the conclusions that can be taken are as following: 1. The physical process of steam generator can be mathematically modeled based on the thermodynamic principles, heat transfer and fluid mechanics. Errors (a difference between simulation results and field operational data) resulted from subprocess module level testing for water flow, gas flow, and steam flow are 1.13%, 7.99%, and 1.99% respectively. 2. The models then will be used to build a computer simulation of the physical process of the steam generator. Error (difference between simulation result and operational data) resulted from unit module level testing for DP Gas, Pressure Gas, Temperature Gas, Flow Gas, DP Water, Pressure Water, Flow Water, DP Steam, Pressure Steam, Steam Quality are 2.39 %, 1.37%, 5.95%, 1.25%, 1.94%, 1.54%, 0.92%, 3.26%, 1.93%, 0.05% respectively. 3. Models are implemented on Simulink and integrated to the PLC through an Ethernet data communication system to construct complete simulation system for steam generator process control. Communication test results (data sent compared to received data) gives a 0% error rate.