BAYESIAN NETWORKS APPLIED IN A CFD MODEL OF THE CROP IN GREENHOUSE

Enrique Garcia
13 min readAug 26, 2022

Advances in computing systems and resources allow develop models to simulate the behavior of flows in greenhouses. However, the prediction of the gradient of mass and energy, in the greenhouses with the cultivation and
natural ventilation, it is difficult due to the stochastic nature of the wind and the dependency relationships between temperature, CO2 and relative humidity. There are heuristic techniques, such as Bayesian Networks, which help to understand the relationships between the variables that cannot be determined using statistical tools. The objective of the present study was to determine set temperature, CO2 concentration and relative humidity
respect to the height of the crop, in a greenhouse with natural ventilation, through Bayesian Networks applied to a Computational Fluid Dynamics model. Bayesian network allowed to determine the spaces of the greenhouse
with adverse environmental conditions for the development of the culture and the most probable climatic states, from the relationships between the variables studied.

Introduction

Computational Fluid Dynamics CFD is an application that starts from a balance of matter and energy in a control volume, allowing to obtain a numerical solution of the flowing behavior. This technique has been used to determine the climatic conditions inside the greenhouses (Sase et al., 2006; Bournet and Boulard, 2010; de la Torre-Gea et al., 2011b), where ventilation influences mainly in the gradients of temperature, relative humidity and CO2 concentration (Teitel et al., 2010) affecting the development of crops (Coelho et al., 2006).

When developing analysis using CFD simulations of the interior of greenhouses, it is important to consider that the height of the crop acts on the speed of the wind, since it exerts a mechanical stress or drag force, which in turn modifies the temperature and relative humidity (Bournet and Boulard, 2010).
The estimation of gradients of temperature, relative humidity and CO2
it is difficult in terms of probability because these variables are intrinsically related and influenced by the stochastic nature of the wind. Thus, it is necessary to combine techniques of prediction, which allow to relate the sets
of data generated by numerical approximations. Bayesian Networks (BNs) are numerical uncertainty techniques that use Bayesian inference as a heuristic method, and can help describe relationships between variables that define climate conditions (De Torre-Gea et al., 2011a). With a BN it is possible
Infer relationships between temperature, humidity relative CO2 concentration
and its interaction with the wind, from a computational fluid dynamics model.
According to Lima and Lall (2010), the relationships between climatic variables can be estimated to evaluate their trends from climatic data.
using Bayesian networks (BNs). Tae-Wong et al. (2008) proposed a stochastic model using mean annual rainfall data that represents temporal and spatial dependencies of daily rainfall occurrence. A model based on BNs and hidden Markov chains was developed by Wang et al. (2010), with the K2 algorithm of maximum likelihood, and estimated the probability rainfall with incomplete data. The goal of this work was to determine the temperature distribution temperature, CO2 concentration and relative humidity, in different heights of a tomato crop (Solanum lycopersicum) in a greenhouse with natural ventilation, through BNs applied to a CFD model.

BNs are representations of knowledge, developed in the field of artificial intelligence essential, for approximate reasoning (Correa et al., 2009). A BN is an acyclic graph whose nodes correspond to concepts or variables, and whose links define relationships or functions between variables (Kings, 2010). Variables are defined in a domain discrete or qualitative child, and the functional relationships describe causal inferences expressed in terms of
min of conditional probabilities (Equation 1).

BNs can be used to identify relationships between the previously indeterminate variables or to describe and quantify these relationships,
even with an incomplete data set. The BNs solution algorithms allow the calculation ass of the expected probability distribution of the output variables. The result of this calculation is dependent on the probability distribution of the input variables. BN can be perceived as a joint probability distribution
of a collection of discrete random variables (Gamez et al., 2011).
The prior probability P(cj) is the probability that a sample xYo
belongs to class Cj, defined without information on its characteristic values
(Equation 2).

Learning machines, in intelligence artificial, are closely related to the data mining, classiication or grouping training methods in statistics, inductive reasoning and pattern recognition. Statistical methods machine learning techniques can be applied to Bayesian statistical framework; however, the learning machine can employ a variety of classification techniques to produce other models of BN (Garrote et al., 2007). The objective of learning using a BN is to find the arrangement that best describe the observed data. The number of possible structures of direct acyclic graphs for the search is exponential to the number of variables in the domain, defined by Equation 3:

The K2 algorithm constitutes the most representative method among the “search and result”. The algorithm begins by assigning each
parentless variable. Then it adds gradually the parents (padres) to the current variable that increases its score on the resulting structure. When any addition of a single mother cannot increase the account, stop adding parents to the variable. If we consider a known value of any of the variables, the search space falls under this constraint is less than the space of the entire structure. If the order of the variables is unknown, you can search the possible orderings (Hruschka et al., 2007).

MATERIALS AND METHODS
Characterization of the flow of air and variables of
condition

In the Ie3 experimental greenhouse of the University
Autonomous City of Querétaro, Amazcala campus,
Sampling was carried out between August 21 and 25, 2011, to determine the initial conditions of the CFD model and between April 15 and 22, 2012, to validate the CFD model. The Gothic greenhouse It has 432 m 2 , it is divided into two naves, each one of 9×24 m, with a gutter height of 4.20 m and 6.70 m to the ridge (2.50 m from ridge), without only side zenith windows of the roll-up type, of 3×9 m to the front and back face and 3×16 m to the sides (Figure 1). Its orientation was north-south, just like the ridges of the crop. It was grown alone num lycopersicum with a density of 2.5 plants m 2, width of the ridges of the crop of 60 cm, height 2 m rail and 1 m corridor between ridges.
Data included temperature, relative humidity, CO2and wind speed.
Measurements were made at 1 and 3 m height on to the ground, every 4 min, with a sensor type LM335 to temperature and relative humidity and with a sensor model FYA600CO2H CO2. The wind speed and direction were measured every 2 sec with omnidirectional anemometers, with interval between 0 and 20 m s 1 and precision of 0.03 m s1 .

Fig 1. Experimental greenhouse Ie3 dimensions

Methodology for the development of the CFD model.
The methodology to develop the CFD model was proposed by Rico-García (2008), in three stages:

Fig 2. CFD Model
  1. Discretization of the continuous flow: the variables of field approached an inite number of values ​​at points called nodes.
    2) Discretization of the equations of motion depending on the values ​​of the nodes.
    3) Solution of the system of algebraic equations and
    getting the values ​​of the variables in all the nodes.

The development and numerical simulation of the model
The CFD was made with the ANSYS FLUENT software
V.14 and included the temperature, relative humidity and
CO2 concentration (Figure 2 and Table 1).

  1. Analysis of the CFD model using BNs
    The analysis of the relationships between the variables is
    performed with the ELVIRA software (version 0.162) in the
    three stages suggested by Garrote (2007):
  2. 1) Pre-processing: it was carried out by imputation algorithm “by averages” to complete the partial data series. This algorithm replaced missing o unknown values averaged, for others, massively discretized them into ten intervals with similar frequency.
    2) Processing: it was carried out in accordance proposed by Wang et al. (2006), to determine the better Bayesian network structure, with the K2 algoritm, i. e. maximum number of algorithm K2, maximum number of parent nodes equal to 3 and no restrictions.
    3) Post-processing: an analysis was performed to obtain the topological structure of the network, which represented the causal dependencies between variables. After getting the learning network parametrically, the probabilities were calculated in the variables that showed a relationship or dependency.
    From the CFD model a sample of 33,610 registers in a transverse plane, at a distance of 8.8 m from the main door (1/3 of the winter length), with data on temperature, CO2 concentration, relative humidity, height and location of the tive with respect to the width of the greenhouse; fraud they developed a BN, discretizing the data in 10 intervals for each variable, between 26 °C and 37 °C, 200 and 400 mg CO2 m3, 10% and 90% humidity relative, 0 and 18 m width of the greenhouse and 0.2 and 2.00 m of crop height.

RESULTS AND DISCUSSION
Relative humidity and concentration values of CO2 obtained with the sensors decreased with the increase in temperature and there were teeth in the crop space, above it and between the ridges. The gradients were larger in the culture due to the effect of wind stagnation (Table 2). These results coincided with those obtained by Teitel et al. (2010), so they were used to set up the CFD model.
The validation of the CFD model consisted of verifying the accuracy of the results obtained and performed using a different data set of the measurements obtained to define the conditions initial and boundary definitions of the developed model. It was applied a test of significance, through analysis of linear regression, of the relations between humidity and CO2 respect to temperature, under conditions similar climatic conditions (Figure 3).

Linear regression showed that the concentration of CO2 and relative humidity in the CFD model are similar to the measured data set, with 5% difference in the ordinate to the origin in the equation relative humidity, and 39 mg m(-3) in the equation CO2 concentration. The slopes of the equations in both cases indicate that the approximation by CFD model is acceptable, CO2 distributions, relative humidity and temperature were heterogeneous, since the camels millions formed a barrier that prevented free luxury of the wind, which increased the turbulence (Table 3, Figure 4). This agrees with the results obtained held by Majdoubi et al. (2009). Temperature maximum was detected in the part of the culture closest to cane to the ground This is the result of the effect of solar radiation and air stagnation due to the same culture by itself, meanwhile it causes low CO2 concentrations and a high level of moist.

BN for CFD model analysis

Table 3. CO2 Average values for CO2, relative moist and temperature simulated using CFD at different heights in the culture

A BN was obtained with the ELVIRA software (Figure 5) applying the K2 algorithm to the set of data calculated with the CFD model, and showed the dependencies between the variables studied, height of the crop and its location in the greenhouse. The width of the greenhouse is the node that most influenced the variables that define the climate inside the greenhouse, because it establishes the speed and direction of the wind.
The height of the crop inversely affected the concentration of CO2, since in the CFD model the equations in Table 2 were considered in the geometry
of Figure 2A to simulate the effects of cultivation in photosynthesis. Relative humidity was influenced by wind and turbulence, and was related inversely with temperature. The relationship between the temperature and length of the greenhouse indicated the effect of solar radiation on the roof of the greenhouse. Temperature was the most susceptible variable, since it presented a greater number of dependencies that were mostly related with the dimensions of the greenhouse. Becausen no other studies on models of BNs applied to indoor climatic conditions greenhouses, no comparisons were made.
From 33,610 records obtained from the model the CFD, the temperature values ​​were determined, CO2 concentration
and relative humidity at different three heights of the crop, and from their inferences calculated their probabilities of occurrence using the ELVIRA software (Tables 4 and 5).
The differences between tables 3 and 4 are due to that in the first average values ​​were considered in the entire interior of the greenhouse, while for the second set, the values ​​were calculated from from the BN (Figure 5), applied to a sample of the greenhouse.
The management of the values: Height of the crop, length and width of the greenhouse allowed identifying that the part of the crop closest to the ground require more ventilation for their development,

since it is where a stagnation of the air. Likewise, the width values ​​allowed define that the wind is not able to dissipate the high temperatures at the right end of the greenhouse.
CO2 concentration inside the greenhouse is less than that of the outside environment, due to both the process of photosynthesis and heating. A possible solution to this problem is increasing air inlets through windows zenithal, which allow the central part to be ventilated, increasing CO2 levels
and decreasing the temperature.
The high relative humidity can present problems to the crop in the part close to the ground, which can be corrected by increasing the height of the base of the crop by pruning its lower branches, in this way the wind will be able to circulate avoiding stagnation.
The results shown in Table 5 established the states of most probable occurrence, with based on the relationships of the variables studied, in
where the highest probabilities are defined by probability distributions with less variability according to Gámez et al. (2011), so the CO2 concentration and the relative humidity constituted the variables with less dispersion. On the other hand, the length of the greenhouse presented the same test probability for all crop heights, since it was referred to the same value of Table 4 (8.8 m), which defined the transversal line from which they were taken
the records of the CFD model.
Inversely proportional relationships are observed between the concentration of CO2 and the height of the culture, as shown in Figure 6, which agrees with the work reported by Teitel (2010).

CONCLUSIONS
A CFD model makes it possible to determine the relationships between temperature, relative humidity and CO2 concentration with respect to the wind and height of the crop by means of a BN. The width of the greenhouse is the variable with the greatest effect on the climate, then define the interior ventilation. The temperature is the most inluenced by the other variables, so can be modified in several ways. The calculation of the inference in the BN allows to establish the state most likely of the variables studied and determines the greenhouse spaces that present critical conditions for the development of the crop. These conditions occur close to the ground and in the center of the greenhouse, and include temperatures and high relative humidity. It is necessary to increase the ventilation through roof windows and increased measure the distance between the soil and the crop by pruning.

The advantage of using a BN to analyze a CFD model is to include the uncertainty by computation of inferences and quantification of degree dependence or independence between the variables studied.

References

Bournet, P. E., and T. Boulard. 2010. Efect of ventilator coniguration on the distributed climate of greenhouses: A review of experimental and CFD
studies. Comput. Electron. Agr. 74: 195–217.

Coelho, M., F. Baptista, F. Cruz, V., and J. L. Garcia. 2006. Comparison Of Four Natural Ventilation Systems In A Mediterranean Greenhouse.
Acta Horticulturae 719: 157–171.

Correa M., C. Bielza, J. Paimes-Teixeira, and J. R. Alique. 2009. Comparison of Bayesian networks and artificial neural networks for quality detection in a machining process. Expert Syst. Appl. 36: 7270–7279.

De la Torre-Gea, G., G. M. Soto-Zarazúa, R. Guevara-González, and E. Rico-García. 2011a. Bayesian Networks for deining relationships among
climate factors. Int. J. Phys. Sci. 6: 4412–4418.

De la Torre-Gea, G., G. M. Soto-Zarazúa, I. López-Crúz, I. Torres-Pacheco, and E. Rico-García. 2011b. Computational fluid dynamics in greenhouses: A review. Afr. J. Biotechnol. 10: 17651-17662.

Gámez, J. A., J. L. Mateo, and J. M. Puerta. 2011. Learning Bayesian networks by hill climbing: efficient methods based on progressive restriction of the neighborhood. Data Min. Knowl. Disc. 22:106–148.

Garrote, L., M. Molina, and L. Mediero. 2007. Probabilistic Forecasts Using Bayesian Networks Calibrated with Deterministic Rainfall-Run of Models. In Vasiliev et al. (eds.), Extreme Hydrological Events: New Concepts for Security, Springer, pp. 173–183.

Hruschka, E., E. Hruschka, and N. F. F. Ebecken. 2007. Bayesian networks for imputation in classification Problems. J. Intell. Inform. Syst. 29:
231–252.

Majdoubi, H., T. Boulard, H. Fatnassi, and L. Bouirden. 2009. Airlow and microclimate patterns in a one-hectare canary type greenhouse: an experimental and CFD assisted study. Agr. Forest Meteorol. 149: 1050–1062.

Reyes, P. 2010. Bayesian networks for setting genetic algorithm parameters used in problems of geometric constraint satisfaction. Intell. Artif. 45: 5–8.

Rico-García, E., I. López-Cruz, G. Herrera, G. M. Soto-Zarazúa, and M. R. Castañeda. 2008. Efect of the Temperature on Greenhouse Natural Ventilation under Hot Conditions: Computational Fluid Dynamics Simulations. J. Appl. Sci. 8: 4543–4551.

Sase, S. 2006. Air movement and climate uniformity in ventilated greenhouses. Acta Horticulturar
719: 313–324.

Teitel, M., M. Atias, and M. Barak. 2010. Gradients of temperature, humidity and CO2 along a fanventilated greenhouse. Biosyst. Eng. 106: 166–174.

Tae-Wong, K., A. Hosung, C. H. Gunhui, and Y. Chulsang. 2008. Stochastic multi-site generation of daily rainfall occurrence in south Florida. Stoch. Environ. Res. Risk Assess. 22: 705–717.

Wang, H. R., Y. LeTian, X. XinYi, F. QiLei, J. Yan, L. Qiong, and T. Qi. 2010. Bayesian networks precipitation model based on hidden Markov analysis and its application. Sci. China Technol. Sci. 53: 539–547.

Wang, S., X. Li, and H. Tang. 2006. Learning Bayesian Networks Structure with Continous Variables. In Li et al. (eds). Lecture Notes in Computer Science, Heidelberg: Springer-Verlang, pp. 448-
456.

--

--

Enrique Garcia

Master´s degree in Linguistics & Master´s degree in Engineering by Western Michigan University. ANUP Georgian College, Ontario.