Event-triggered control for greenhouse temperature under natural ventilation based on computational fluid dynamics

In this paper, the event-triggered control for greenhouse temperature based on Computational Fluid Dynamics (CFD) is investigated. To overcome the deficiency of sensor which can only represent the temperature value of some points inside the greenhouse, CFD technology is used to simulate and output the temperature field data of the entire greenhouse. Furthermore, in order to reduce the network resource consumption, the event-triggered mechanism is adopted in CFD simulation output-controller channel. When the greenhouse temperature meets the event-triggered condition, the simulated data is transmitted to the controller. Moreover, multi-objective particle swarm optimization (MOPSO) is used to design the controller to solve the contradiction between energy consumption and control accuracy in the control process. Finally, a numerical simulation example is provided to illustrate the effectiveness of given event-triggered scheme for greenhouse temperature under natural ventilation based on CFD simulation. The simulation results show that the control scheme given in this paper can effectively regulate the greenhouse internal temperature and meet the control requirements.


Introduction
In recent years, more and more attention has been paid to the research and application of agricultural technology, especially the study of greenhouse. Among the greenhouse environmental factors, temperature is an important factor affecting the growth of crops. How to control the greenhouse temperature more effectively is still one important topic (Willits & Peet, 1998). Now, considerable research effort has been made on the control problem of temperature in the greenhouse with a rich body of results available in the literature, but there are still many problems to be improved in the field of greenhouse control, such as the complexity of greenhouse model and effectiveness of greenhouse environmental control and so on (Fitzrodriguez et al., 2010).
In most cases, the use of sensors to sense the greenhouse internal temperature will lead to the control process can only obtain local environmental information, resulting in poor temperature uniformity. Computer fluid dynamics (CFD) as a technology has been widely used in greenhouse control field. CFD technology is a numerical simulation technology, which can obtain the spatial distribution of greenhouse environmental field and is conducive to the regulation of greenhouse environment from tiny details and has the advantages of short CONTACT Hua Yang yanghua@sxau.edu.cn, 331336198@qq.com test cycle and low cost. In 1989, CFD is first applied in the field of greenhouse environmental control (Okshima et al., 1989). CFD technology is used to study the ventilation process of single span greenhouses, and the validity and superiority of numerical simulation method are verified (Mistriotis et al., 1997). It is prove that CFD model is effective in studying the influence of solar thermal load on greenhouse microclimate (Saberian & Sajadiye, 2019). The influence of ventilation structure on single-span greenhouse ventilation is studied by CFD (Akrami et al., 2020). Some researchers begin to use CFD technology to design greenhouse environmental control scheme . CFD prediction model for the inner environment of glass greenhouse is developed and validated (Jeong et al., 2020). A control method of greenhouse temperature uniformity based on CFD is proposed (Li et al., 2012). In this paper, the effect of greenhouse temperature at different heights is considered, and the temperature of the greenhouse is simulated by CFD. Moreover, in order to save the resource of the communication network, the event-triggered mechanism is adopted in CFD simulation output-controller channel. The time-driven control system continually samples within a fixed time period, and the control signal is produced periodically. It will lead to redundant sampling and control behaviour that wastes computing and communication resources (Cao et al., 2014). In contrast, in event-triggered control systems, the dynamic evolution of system variables determines whether control actions are performed (Heemels et al., 2013).
Furthermore, the precision and energy consumption in the control process are two aspects that people are concerned about (Bajer & Krejcar, 2015). Under the condition of natural ventilation, the precision and energy consumption of greenhouse control scheme have a conflict with each other (Bournet & Boulard, 2010). For the problem of multi-objective conflict, many researchers use MOPSO (multi-objective particle swarm optimization) algorithm to design multi-objective optimization controller. A new MOPSO algorithm is proposed to determine the optimal location and size of both distributed power supply (DGs) and shunt capacitor bank (SCBs) simultaneously (Zeinalzadeh et al., 2015). The research shows that MOPSO algorithm can effectively deal with multiobjective conflicts in the control process. And MOPSO algorithm has the advantages of fast search speed, simple structure and easy implementation.
In this paper, an event-triggered scheme based on CFD is proposed for a greenhouse in Jinzhong City, Shanxi Province, China. CFD technology is used to simulate greenhouse temperature field. Event-triggered mechanism is adopted in the CFD simulation output-controller channel to reduce the resource consumption of communication network. When CFD simulation output of greenhouse temperature meets the event-triggered condition, simulation data is transmitted to the control centre. Considering the conflict between control accuracy and energy consumption in the control process, MOPSO algorithm is used to design the controller. The main contributions of this paper are highlighted as follows: (1) A new control scheme including CFD technology, event-triggered strategy and MOPSO algorithm is proposed. MOPSO algorithm is adopted to design the controller. It solves the contradiction between control accuracy and energy consumption, and has an effective combination of three technologies in greenhouse control field. (2) An event-triggered control scheme based CFD has been designed for greenhouse. It is adopted in CFD simulation output-controller channel to save the resource of the communication network.
This paper is organized as follows. In Section 2, the problem formulation and preliminaries are introduced, including the heat transfer model of greenhouse air and the basic equation used in CFD simulation. In Section 3, the control system is described and the event-triggered mechanism is established. In Section 4, the design of controller is introduced. The simulation and performance evaluations are presented in Section 5. Finally, the paper points out possible future research topics in Section 6.

Greenhouse temperature model
The greenhouse environment is a very complex dynamic system, which is affected by many indoor and outdoor disturbances. The outdoor disturbance includes outdoor air temperature, humidity, solar radiation intensity, wind speed, etc. Indoor disturbance includes heating system, crops and soil heat dissipation. Under the action of these disturbances, indoor temperature always maintains dynamic thermal balance. Heat transmission model of greenhouse air temperature under natural ventilation is expressed as follows: where C i is the heat capacity of the greenhouse air and T is the greenhouse internal temperature, the left-hand side of the equation represents the change in the heat of greenhouse air. Q rad is the change in the heat of the greenhouse air caused by solar radiation. Q cov is the convective heat flow between the indoor air and the covering material. Q soil is the convective heat flow between the indoor air and the soil surface. And Q vent represents heat flow caused by natural ventilation. This control system adopts natural ventilation to regulate the greenhouse temperature, and the controller of this research scheme is u = [u 1 , u 2 , u 3 ], where u 1 represents the opening angle of the left skylight, u 2 is the opening angle of the right skylight and u 3 is the opening and closing degrees of the door. The controller is obtained by solving the MOPSO algorithm. These symbol models are as follows: where η is the radiation conversion factor and G is the outdoor solar radiation intensity.
where k cov is the cover heat transfer coefficient, T o is the outside temperature of the greenhouse.
where k soil is the surface soil heat transfer coefficient and T s is the surface soil temperature.

CFD modelling
In the process of CFD numerical simulation, the movement of indoor air is regarded as the movement of fluid. Mass conservation law, momentum conservation law and energy conservation law are used as the fundamental governing equations in CFD simulation. It combines the three-dimensional turbulence equation and radiation equation, the greenhouse temperature at different time is simulated by changing boundary conditions and grid.

Fundamental governing equation
(1) Mass conservation equation The mass conservation equation refers to the mass flowing into the microelement in unit time is equal to the mass flowing out, and its differential equation is expressed as shown above. ρ (kg/m 3 ) is the fluid's density which is a function of space position and time. u, ν, ω are the components of the fluid velocity in the x, y and z directions.
(2) Momentum conservation equation where μ e is the effective viscosity, μ l (N · s/m 2 ) is the hydrodynamic viscosity, μ t (m 2 /s) is the turbulent viscosity and it can be expressed as a function of k and ε: μ t = C μ ρk 2 /ε. C μ is the empirical constant with a value of 1.44, k (m 2 /s 2 ) is the turbulence energy, ε (m 2 /s 3 ) is the turbulent dissipation rate, p (Pa) is the pressure.
T ref is the air reference temperature, g (m/s 2 ) is the gravitational acceleration, β is the coefficient of air expansion and it can be calculated by β = T −1 .
(3) Energy conservation equation where S T is the source item, λ e is the effective thermal conductivity, λ l (W/(m·K)) is the thermal conductivity of fluid, λ t (W/(m·K)) is the turbulent thermal conductivity, and σ l = 0.71, σ t = 0.9.

Three-dimensional turbulence equation
Air flow in the greenhouse is regarded as turbulence. Fluent provides a variety of turbulence models, and Renormalization group (RNG) k − ε model is selected in this paper. The second-order correlation of velocity pulsation is expressed as the product of average velocity gradient and turbulent viscosity coefficient on the premise of isotropy. It is expressed as follows: where η = S k /ε, η 0 = 4.38, ξ = 0.012, C 1ε , C 2ε , C 3ε are the empirical constants. C μ represents the model constant, G k is the turbulent kinetic energy due to the mean velocity gradient. G b is the turbulent kinetic energy due to buoyancy, Y M is the effect of compressible turbulent pulsating expansion on total dissipation rate. α k , α ε are the inverses of effective turbulent Prandtl number for turbulent kinetic energy k and dissipation rate ε. S k , S ε are user-defined source item.

Radiation equation
For radiation heat transmission, Fluent provides discrete propagation radiation model (DTRM), P1 model, Rossland model, Discrete ordinates model (DO) and Surface-to-Surface (S2S) radiation model. Due to the high precision of DO model, DO radiation model is selected in this study to simulate greenhouse radiation heat transmission. The specific model is expressed as follows: ∇ · (I λ (r, s)s) + (α + σ s )I λ (r, s) where ∇ is an operational symbol that determines the divergence of parameters in parentheses. I λ represents the intensity of the radiation at the wavelength, r is the position vector, s is the direction vector and s is the scattering direction vector. α stands for spectral absorption coefficient, σ is the Stefan-Boltzmann constant and the value is 5.672 × 10 −8 (W/(M 2 · K 4 )). σ s is the scattering coefficient and n is the refractive index. φ represents the phase function and is the solid angle of radiation.

The discretization of a continuous field
The essence of computational fluid dynamics is to discretize the governing equation at points over a given region (e.g. the finite-difference method) or regional discretization (such as finite element method and finite volume method), which is transformed into algebraic squares that defined on each grid point or subregion groups of equations (usually linearized if they are nonlinear) and then iteratively solves using linear algebra. In this paper, the finite volume method is used to convert nonlinear partial differential equations into linear algebraic equations on grid units. Then the solution of the flow field is obtained by solving the linear equations. Meshing can divide contiguous spaces into interconnected meshes unit. Each grid cell consists of a control point in the centre of the geometry and a grid surface or line around the grid cell. The ultimate goal of solving the governing equation is to obtain the values of the flow field variables at all control points. In the simulation, the coupling calculation method of pressure and velocity is selected as SIMPLE method, the discrete format of pressure is selected as standard format, the second-order upwind format is selected for momentum and energy, and the first-order upwind format is selected for turbulent pulsation kinetic energy k and dissipation rate ε.
The computational flow chart of CFD calculation is shown in Figure 1.

System description
CFD technology is used to simulate the indoor temperature, and the simulation results are used for subsequent control. The control scheme flow chart is shown in Figure 2.
It can be seen from Figure 2, in the greenhouse system using CFD simulation, the factors affecting the greenhouse temperature include outdoor environment, initial conditions, material characteristics of the greenhouse and physical structure of the greenhouse. When indoor temperature meets the set event-triggered conditions, the controller works to get the optimal control output and sends instructions to the actuator. The actuator adjusts the opening angle of the skylight according to the control instruction. At this time, the physical structure of the greenhouse makes a change, the indoor temperature also changes, and so on, until the simulated temperature value is close to the set temperature (the optimal temperature for crop growth).

Event-triggered mechanism
The trigger time is denoted by t k (k = 0, 1, 2 . . .). If the trigger condition is satisfied at time t k , then the next where ε r = y(t k + r) − y(t k ), t 0 = 0, μ > 0 is a given constant, is a symmetric positive definite matrix. It can be seen from the event-triggered condition (16), the eventtriggered time depends on: (1) ε r = y(t k + r) − y(t k ) (r = 1, 2, 3, . . .): The error between the current output value and the latest trigger output value.

Controller design
In the whole control scheme, we take the physical structure, initial conditions and boundary conditions of the greenhouse as the input of CFD simulation, and then the output of greenhouse temperature field simulation data is obtained by CFD calculation. If the simulation results meet the event trigger condition, the data at that time will be transferred to the control centre and the MOPSO optimization algorithm will be used to solve the controller u. When u changes, the physical structure of the greenhouse will also change, leading to changes in the input conditions of CFD.

Control performance indicators
In order to balance control performance and control energy consumption, MOPSO algorithm is adopted to design the controller and the overall performance of the system is measured by temperature deviation indicator and motor energy consumption indicator.

Temperature deviation indicator
In the whole greenhouse temperature control system, the deviation value between the controlled indoor temperature and the set temperature is what we are most concerned about. In this paper, J 1 is used to represent the temperature deviation indicator.
where n represents the number of observation points selected. T j represents the simulation temperature at the observation point j and T set i is the temperature set value at the i layer.

Energy consumption indicator
Energy consumption has always been a hot issue in greenhouse environmental control. The greenhouse studied that consists of 6 skylights on the north side and 6 skylights on the south side and the maximum opening angle of each skylight is 27 • . The maximum height of the shutter door is 2 m. It defines the opening angle change of the left skylight as u 1 , the opening angle change of the right skylight as u 2 , and the height change of shutter door as u 3 . In this study, an energy consumption indicator is introduced to measure the energy consumption in the control process of the system and it is represented by J 2 .
where u j is the degree of change in actuator j, ϕ j is the unit energy consumption of actuator j.

Overall control indicator
The total control indicators of the system is defined as J.
where τ 1 and τ 2 respectively are the weight coefficients of temperature deviation indicators and energy consumption indicator.

MOPSO algorithm
In this section, MOPSO is used to optimize the system. This problem is rewritten as a general nonlinear problem: subject to MOPSO simplifies the solution of multiple optimization problems to each bird in the flock by imitating the flight path of the flock. After updating a series of velocity and displacement, the position of optimal particle in the solution space is obtained. The MOPSO algorithm is shown in Figure 3.

The simulation and performance evaluations
In this part, the proposed scheme is simulated and verified. The greenhouse in this paper is a natural ventilated glass greenhouse and it has a span of 8 m, a shoulder height of 4.5 m, a top height of 5.5 m and a total length of 12 m. The indoor temperature field is simulated by CFD technology. The initial state and boundary conditions when establishing the model are shown in Table 1. Through the establishment of Gambit model and the calculation of Fluent model, the CFD simulation result of greenhouse temperature is shown in Figure 4. In the whole simulated temperature field, 18 points are randomly selected as temperature monitoring points. In order to measure the temperature change in the vertical direction inside the greenhouse, observation points are arranged in sections 0.5 m (the height of the crop canopy), 1 m (the height close to the crop canopy) and 4 m (the height above the greenhouse) from the bottom up. The coordinates of the temperature monitoring points are given in Table 2.

Air
Density/ kg · m −3 1.225 Thermal conductivity/ W · (m · K) −1 0.0242 specific heat capacity/ kJ · (kg · K) −1 1006.43 coefficient of thermal expansion/ K −1 3.356 × 10 −3 Glass Density/ kg · m −3 2220 Thermal conductivity/ W · (m · K) −1 1.15 specific heat capacity/ kJ · (kg · K) −1 830 Thickness/ m 0.004 Soil Density/ kg · m −3 2800 Thermal conductivity/ W · (m · K) −1 2.25 specific heat capacity/ KJ · (kg · K) −1 856 Boundary conditions Entrance velocity/ m · s −1 2.0 inlet temperature / K 300 outlet temperature/ K 301.5 Glass wall temperature/ K 300 Soil surface temperature/ K 295 Figure 4 is CFD simulation result of greenhouse temperature. It can be seen from the figure that the temperature inside the greenhouse is gradually decreasing from top to bottom, which is consistent with the actual production activities. Through the analysis of the monitoring point data, it can be seen that under the natural ventilation condition, the average simulated temperatures of  The actual measured temperature is higher than the simulated temperature, which may be caused by the thermal effect of the sensor itself. It can be seen from Figure 5, there is a certain gap between the CFD simulation temperature value and the measured temperature value, but the variation trend is basically the same. Therefore, CFD greenhouse simulation technology can be used for the study of greenhouse temperature control system. In this paper, we define the temperature setting value at the height of 0.5 m, 1 m and 4 m in the greenhouse from 8:00 a.m. to 12:00 a.m. on 31 June 2020, as 24.35 • C, 24.52 • C, 24.7 • C respectively, denoted as T set = [24.35 • C, 24.52 • C, 24.7 • C]. In equation (16), we set the parameters is the identity matrix, and μ = 0.0005. In Equation (19), we set τ 1 = 0.7 and τ 2 = 0.3. At the initial trigger point, the CFD simulated indoor temperature at the height of 0.5 m, 1 m and 4 m are respectively 25.57 • C, 26.0 • C and 26.61 • C. At this moment, u = [u 1 , u 2 , u 3 ] = [13.5, 13.5, 1] denote respectively as the degree of opening of the skylight and door. The CFD simulation results of temperature which satisfies the eventtriggered condition are transmitted to the controller for processing.
After MOPSO optimization, we can get the change diagram of temperature deviation index, energy consumption index and overall index during iteration. The changes of temperature deviation indicator and energy consumption indicator are shown in Figure 6(a) and the overall indicator changes are expressed in Figure 6(b). It can be seen from Figure 6(a), as the temperature deviation index decreases gradually, the energy consumption index increases continuously. There are a negative correlation between the temperature control indicator J 1 and the energy consumption indicator J 2 and this is a conflict. Observe Figure 6(b), during the iteration, the overall index fluctuates constantly. When approaching 100 iterations, the overall index gradually stabilizes at a low level. At this   point, the overall index is 0.229, the energy consumption index is 0.183, and the temperature deviation index is 0.251.
In the control process, the temperature change curve is shown in Figure 7. The control quantity obtained is u = [u 1 , u 2 , u 3 ] = [21.5, 19.6, 1.56] and the corresponding temperature at 0.5 m, 1 m and 4 m are 24.63 • C, 24.75 • C and 24.96 • C respectively which is close to our set values of stratified temperature. According to the simulation results, it is apparent that the control scheme given in this paper can effectively regulate the greenhouse internal temperature and meet the control requirements.

Conclusion
This paper is devoted to studying the event-triggered control mechanism of greenhouse temperature based on CFD simulation. In order to improve the temperature uniformity within the greenhouse, CFD technology is used to simulate the greenhouse temperature field, and the event-triggered mechanism is adopted in the CFD simulation output-controller channel. When the eventtriggered condition is met, the temperature field data is transmitted to the control centre. Considering the conflict between control accuracy and energy consumption in the control process, MOPSO algorithm is used to design the controller. Finally, the simulation results show that the controlled indoor temperature is very close to our set temperature and the scheme can control the greenhouse environment effectively.
Further research topics include the extension of our results to many environmental factors in greenhouse such as CO 2 concentration, air humidity and so on. Also, this study did not introduce specific crops and did not consider the problem of heat exchange between crop growth and indoor environment. In the following research direction, we can introduce specific crops and consider the transpiration effect of crop growth. Furthermore, we can track the crop growth requirements and realize the online feedback of the crop growthenvironment model.

Disclosure statement
No potential conflict of interest was reported by the authors.

Funding
This article is funded by the National Natural Science Foundation of P.R. China [grant number 31671571] .