Optimizing the drying parameters of a fixed bed with reversing ventilation for peanut using computer simulation

To obtain the optimal operation parameters of fixed-bed reversing ventilation drying of peanuts, a set of partial differential equations indicating the heat and mass transfer relationships between the peanut pods and air during drying was proposed. Then, a series of discretized models were established for simulation, and the time consumed, unevenness, and energy consumption for batch drying were calculated. The results showed that reversing ventilation and segmented drying was helpful to these issues for high drying ability. The optimal operation parameters were determined by uniform design experimentation of mathematical simulation. The result showed that when the moisture content (wet basis) was above 22%, a ventilation velocity of 0.46 m/s was optimal; when the moisture content was between 8% and 22%, a ventilation velocity of 0.20 m/s was optimal. Using the optimal parameters, the computer simulating result was compared with the experimental results. The correlation coefficients between the simulating and the experimental values for the temperature and moisture content were all above 0.98 and the quality of dried peanuts was close to that of natural sun-dried ones, which indicates that the optimization results of the drying parameters are highly reliable.


Introduction 
Peanut is the dominant high-quality oil-bearing crop and an important food protein resource in China. For the past decade, China has been the largest peanut producer and has the second-largest planting area [1] . Influenced by agricultural policy, population mobility, and land transfer, the mechanized harvesting of peanuts has increased over years; consequently, harvesting is synchronized, and fresh peanut pods can be quickly amassed and large amounts of peanuts wait for drying [2] . This rapid expansion means that the drying facilities and labor available in rural areas have not satisfied the demand for drying [2,3] . On overcast and rainy days, mildew and rot of the crop usually occur, and aflatoxin contamination is a relatively serious concern [4,5] . Economic and practical peanut-drying methods are required. Some developed countries with large-scale peanut planting, such as the United States, have developed mature peanut drying technology and equipment [6][7][8] . Peanut drying is usually divided into two stages: first, vines are dried in the field after digging; second, centralized drying is needed after pickup harvesting [9][10][11][12] . The entire drying process is intrinsically combined with digging, picking, storage, and processing. When the dryer is loading, the moisture content of peanuts (with their shells) is generally approximate to 20%. During the drying process, the hot air generated by burning liquefied petroleum passes through the material bed from the bottom to the top [13,14] . Based on the material bed thickness and initial moisture content, ventilation volumes are regulated to the recommended values [7] . Although the above-mentioned two-stage process has been widely used in the USA and Australia, in rural China, little time is allowed for the crop to be dried before the next crop is planted. To increase farm productivity, the drying of fresh peanut pods is a priority [3,15] . However, owing to the large moisture content reduction required, the drying effect of the above-mentioned method used in the USA is poor. In addition, high energy and equipment price has made the peanut drying expensive and promoting fresh peanut drying difficult in rural China. Generally, peanut farmers use the fixed-bed dryers as supplementary or emergency means of drying [2] . However, uneven drying is a problem. To improve the uniformity of fixed-bed drying, the fixed-bed reversing ventilation drying technique for peanuts has been proposed. However, heat waste during the middle and later stages of drying is a serious issue. It is assumed for batch drying that the more uniform the drying is, the more the air volume should be provided and the more energy is consumed.
Numerical simulation has been widely used to describe the drying process and develop production guidelines for peanuts and other crops. Parti and Young [16] established a peanut bulk drying model (PEADRY8), which was compared with the experimental results for Virginia-type peanuts. The model took the peanut pod as two separate components with moisture movement in both liquid and vapor forms. Chai and Young [17] studied the effects of airflow rate on drying times and costs of conventional and recirculating peanut drying facilities using numerical simulation. Yang et al. [18] studied the simulation of peanut drying in a trailer-type dryer with different thin-layer drying models and equilibrium moisture contents. The result showed that the Henderson-Pabis model using the Hummeida K-value and modified Oswin EMC models provided the best fit with the experimental data, although errors of temperature prediction existed in the middle layer. Yan et al. [19] performed numerical simulation on a barrel-shaped fixed bed and examined the drying time, energy consumption, productivity, and uniformity under different structures and ventilation parameters. Baker et al. [10] proposed a drying rate control method (DRC1) for dryer heat control, which was tested and compared with humidistat control and conventional control methods using a bulk simulation model and laboratory curing tests. Based on this foundation, Butts et al. [13] improved the DRC1 and proposed the DRC2 control method. Similar studies with grains, wheat, and maize have also been conducted [20][21][22][23][24] .
With reference to reversing ventilation drying, Ruiz-Lopez et al. [25] developed a mathematical model to simulate the fixed-bed drying of carrots with and without periodic reversals in the airflow direction, and they found good agreement between the experimental and predicted data.
Khatchatourian et al. [26] simulated the performance of cross-flow grain dryers with the direction of airflow reversed with the grain flowing from top to bottom.
Yan et al. [27] performed numerical simulation of fixed-bed wheat drying with periodic reversing ventilation, and the optimal ventilation temperature and air velocity were determined with the energy consumption cost as the index. Jia et al. [28] experimentally investigated a fixed-bed drying method that features with swing temperature and alternating airflow for wheat drying and drew similar conclusions. Albini et al. [29] evaluated barley drying in a fixed-bed dryer by either reversing the airflow every 10 min or with no reversal. The results showed that drying with an airflow reversal provided better homogeneity; however, conventional drying led to improved energy performance.
Yan et al. [2] proposed a small-scale reversing ventilation dryer for peanuts. Experiments with the dryer showed that periodic reversing ventilation could effectively improve drying uniformity, especially for high-moisture peanuts with a moisture content of over 40%. From the above research, numerical simulation and periodic reversing airflow appear to be suitable methods for improving drying uniformity and optimizing the drying process.
Thus, in this study, numerical analysis was used to calculate the time consumption, moisture content difference, and thermal energy consumption of batch peanut drying. The optimal drying parameters were determined using the synthetic weighted mark method to provide production guidance for peanut drying.

Principle of reversing ventilation drying
Reversing ventilation drying is based on regular changes in airflow direction in the air medium being dried to ensure that the moisture content of different material layers in the vertical direction is approximately equal after drying. At the beginning of drying, hot air enters the lower air chamber, passes through the material layers being dried upward, enters the upper air chamber, and finally discharges exhausts from the drying chamber into the atmosphere (Figure 1). After a while, when an obvious moisture content gradient in the material bed is formed, the ventilation direction changes. Air enters the upper air chamber first, passes through the material layers downward, enters the lower air chamber, and finally discharges exhausts into the atmosphere. After drying for a period, when the original gradient has been eliminated and a new gradient is formed, the ventilation direction is reversed again. This process is repeated until the average moisture content reaches 8% wet basis to end the drying. Peanut pods are generally composed of kernels and shells. The moisture content of fresh peanuts after harvesting is often high (approximately 40% wet basis or more). When harvesting, the kernels are close to the inner walls of their shells; however, as the moisture content of the pods gradually decreases during drying, the gap between the shells and the kernels gradually increases, hindering inward heat transfer and the outward mass transfer of water. Additionally, the red coating that occurs on the seed and white membranes on the inner wall of the shells hinder the outward migration of moisture. Therefore, the heat and mass transfer of peanut pods are complex; thus, it is difficult to construct a drying model based on the characteristics of each component. In most of the recent studies, peanut pods are regarded as cylindrical entities, and the classic semi-empirical thin-layer drying equations are generally fitted to the experimental data [18,30] .
In this study, based on previous studies on peanut thin-layer drying [30] , and simulating fixed-bed drying using partial differential equations (PDEs), the following assumptions of the heat and mass transfer were made to simplify the calculations: the temperature gradient inside a single peanut pod was neglected, heat conduction between peanut pods was neglected, dryer wall was insulated, and its heat capacity was ignored; a sufficiently short time interval was considered, and the specific heats of wet air and peanut pods were regarded as constant [21,27,31] .
According to the basic theory, heat and mass transfer between peanut pods and air in the material bed can be described by a series of PDEs for balancing air mass, air heat, peanut pod heat, and peanut pod mass. Based on the assumptions stated above, they are shown as Equations (1)-(4), which are widely used in the drying of granular agricultural products [8,27,31] . Equation (4) is the thin-layer drying equation for peanut pods, which was obtained in previous studies [30] . In these studies, several semi-empirical thin-layer drying models were compared with peanut pod thin-drying experimental data by regression analysis, and the results showed that the diffusion-approximation model was the most suitable for thin-drying peanut pods using hot air. where, a ≤1 m/s. and x is the depth of the bed from the bottom, m; t is the drying time, h; M is the moisture content (dry basis) of peanuts, kg/kg; θ is the temperature of peanuts, °C; H is the absolute humidity of the medium air, kg/kg; T is the temperature of the air medium, °C; V a is the medium air velocity, m/s; ρ pb is the bulk density of peanut bed, kg/m 3 ; ρ a is the density of dry air, kg/m 3 ; ε is the porosity of peanut bed; c a is the specific heat of dry air, J/(kg°C); c v is the specific heat of water vapor, J/(kg°C); c w is the specific heat of liquid water, J/(kg°C); c pb is the specific heat of bulk peanuts, J/(kg°C); h T is the heat transfer coefficient, W/(m 2°C ); h ga is the gasification heat of the water in peanuts, J/kg; a, b, and k are the drying constants; M e is the equilibrium moisture content of peanut pods, kg/kg; a s is the specific surface area of peanuts, m 2 .

Discretization of PDEs in the model
For the convenience of calculation, the material bed was considered as composing of several horizontal thin layers, with each thin layer regarded as a node. The drying time was divided into several equal parts based on the drying time sequence, and each part was regarded as a node. For upward ventilating, the simulation started from the bottom of the fixed bed. For downward ventilating, the simulation started from the top to the bottom of the fixed bed. The moisture contents and temperatures of the nodes for the material layers and the medium air passing through the material layers at different position were calculated. The calculation results were used as the input for the next node, and then the variables at the next node were calculated. This process continued until the average moisture content of peanuts in the total material bed reached the storage requirement [32] .
The material bed was divided into several units along the thickness direction, where each unit was Δx m, x =i· Δx (i is the number of thickness units), and the total thickness was m· Δx. The drying time was also divided into several sections, and each section was Δt h, t = j· Δt (j is the number of time units). The simulation was terminated when the average moisture content of the material bed reached the terminating (required) moisture content. Based on the sequence of hot air passing through the divided layer (for upward ventilation, the i th layer peanut was dried first, and the (i+1) th layer was dried later; In the case of downward ventilation, the (i+1) th layer peanut was dried first, and the i th layer peanut was dried later.), the PDEs in the model were discretized for the two ventilation conditions using the finite difference method. After simplification and arrangement, the following equations are obtained: For upward ventilation: For downward ventilation:

Initial and boundary conditions
It was assumed that, before drying, the initial moisture content of peanuts is M 0 (dry basis), and the initial temperature of peanuts is θ 0 . The temperature of the input air for drying is T in , and the absolute humidity of the input air is H in . Thus, the initial conditions are: where, m is the maximum node number of the bed thickness. The boundary conditions with upward ventilation are: where, t ex is the interval time of each airflow direction reversal, and

Equivalent drying time
For drying simulation, the material bed was divided into several thin layers along the thickness direction. The heat of the medium air was absorbed, and the air was cooled by the front layer materials before passing through the inner layer materials, which belonged to the variable temperature drying category. When calculating the moisture content, the drying time cannot be directly substituted into Equation (8) or (12). The equivalent drying time must be solved which corresponded to the layer material moisture content of the previous time node under the current drying temperature and air velocity [19] .
The optimization function "fminsearch" of Matlab 2019a (MathWorks, Natick, Massachusetts, USA) was used to solve the equivalent drying time. Specific methods were as follows: set function F = |M(t eq ) -M i,j |, where, t eq is the equivalent drying time, h; M i,j has been solved in the previous loop; M(t eq ) is the solution after substituting t eq into Equation (8) or (12). When the function F reaches its minimum value (approaching 0), the value of t eq is the equivalent drying time corresponding to the i th layer moisture content M i at time t = j·Δt.

Other auxiliary equations and physical parameters
The simulation accuracy of drying mainly depends on the values of the coefficients and parameters of the model, such as the convective heat transfer coefficient, vaporization heat, and equilibrium moisture content.
Detailed studies of these parameters have been conducted using experiments and empirical or semi-empirical equations.
Bitra et al. [33] summarized the bulk density of peanut pods under different moisture contents and obtained the following empirical equation: where, M db is the dry basis moisture content of peanut pods, kg/kg. Setting M db = 0, the bulk density of dry peanuts is 216.06 kg/m 3 . Wright and Porterfield [34] studied the relationship between the specific heat and moisture content of bulk peanuts and obtained a semi-empirical equation: Setting M db = 0, the specific heat of dry bulk peanuts is 1.686 kJ/(kg°C ). Yan et al. [19] simplified the calculation equation of the convective heat transfer coefficient between the peanut pods and the medium air and obtained the semi-empirical equation: where, ρ A is the density of the medium air, kg/m 3 ; μ A is the average velocity of the medium air, m/s. Correa et al. [35] studied the heat of water vaporization in peanut pods and provided the following equation: Chen [36] studied the equilibrium moisture content (dry basis) of peanuts under various temperature and humidity conditions and obtained a semi-empirical equation for the equilibrium moisture content of peanut pods: where, RH is the relative humidity of the air, %.
Other physical parameters of the air used in the simulation are listed in Table 1, and the data were from Mujumdar [8] .

Evaluation indices 2.3.1 Time consumption
The time consumed was the time of drying until the average moisture content of the peanut material bed reached its termination moisture content. The moisture content difference was obtained based on the simulation results, which could be calculated by subtracting the minimum moisture content from the maximum moisture content of the material layers at a specified drying time.
M un = max(M(x,t c ))min(M(x,t c )) (22) where, M un is the moisture content difference, and t c is the specified time during drying.

Energy consumption per unit mass
Practically, energy is mainly consumed in batch drying as heat, since the energy consumed by the fans supplying fresh air is small and can be ignored [37] . The energy consumption of batch drying can be obtained by: where, T am is the ambient temperature, °C; E co is the energy consumption, J; and S is the loading area, m 2 . The energy consumption per unit mass of dried peanuts can be obtained from the quotient of the energy consumption of batch drying and the final mass of materials at the end of drying.
where, E pum is the energy consumption per unit mass of dried peanuts, J/kg; and m final is the mass of dried peanuts, kg. The mass of the material at the end of drying can be obtained using Equation (25): where, h is the height of the material bed, m; and ρ bf is the bulk density of the dried peanuts, kg/m 3 .

Synthetic index
To obtain the optimal drying operation parameters, the synthetic weighted mark method [38,39] was used to transform multiple performance indices into a single index, which was used for optimization analysis.
(1) Determining the weight of each index The drying time, moisture content difference, and energy consumption per unit mass of dried materials are important indices for evaluating drying performance.
The moisture content difference is an index used to evaluate the quality of the drying operation. The drying time and energy consumption are indices used to reflect the drying cost. Therefore, the weights W 1 , W 2 , and W 3 of the time consumed, moisture content difference, and energy consumption per unit mass of the material were set to 0.25, 0.5, and 0.25, respectively, based on experience.
(2) Unifying the change trends of each index To ensure that the greater the value of the synthetic weighted mark, the better the drying, the "smaller the better" of indices should be converted into the "larger the better" and the sign of indices should be adjusted accordingly. Therefore, the time consumed, moisture content difference, and dry material per unit mass were all negative.  (26) where, for step J, Y 1,J is the simulated index value of the time consumed, Y 2,J is the simulated index value of the moisture content difference, and Y 3,J is the simulated index value of the energy consumption per unit mass of the material.
(3) Unifying the order of magnitude and dimension of each index To eliminate the influence of the order of magnitude and dimension of each index (the magnitude and dimension of Y * 1,J was "h"; the magnitude and dimension of Y * 2,J was "%"; and the magnitude and dimension of Y * 3,J was "×10 6 J/kg") on its weighted mark value and make the weighted mark value of each index comparable, it was necessary to unify the order of magnitude and dimension of each index. The no-magnitude and dimensionless marks of each index were obtained from Equation (27) where, Y ** I,J is the score of the I th index of J th simulation results, Y * I,J is the I th index value of the J th simulation results after unifying the trends, Y * I,max is the maximum value of the I th index after unifying the trends and Y * I,min is the minimum value of the I th index after unifying the trends.

J
The synthetic weighted mark is the sum of the weighted marks of each index and is obtained from Equation (28) where, for step J, Y * J is the comprehensive weighted score of the simulation results, and W I is the weight of index I.

Simulation and parameter setting
Matlab 2019a software was used to simulate the reversing ventilation drying process of a peanut bed. Based on the equations in sections 2.2 and 2.3, the simulation program was compiled to calculate t eq , M i,j , θ i,j , H i,j , T i,j , t co , E pum , and M un . A flowchart of the simulation program is shown in Figure 2.
Based on the applicability of the thin-layer drying equation [30] , the thickness of the thin-layer unit Δx = 0.03 m and the time unit Δt = 0.1 h. Based on the long-term storage conditions used for peanuts [32] , the moisture content of peanut pods should be generally lower than 8% (wet basis). Therefore, the termination moisture content for the simulation calculation was set to 8%.
Based on previous studies on fixed-bed peanut drying, the input temperature of medium air should not exceed 38°C [13,19] ; otherwise, it will affect the quality of peanuts. Therefore, the input temperature of the medium air was set to 38°C. For high-moisture peanut pods, a large thickness of the material bed can easily cause mildew and uneven drying. Based on the studies performed by Cundiff and Baker [7] , the recommended thickness of the peanut bed for the traditional fixed-bed drying method ranges from 0.9 to 1.8 m when the moisture content of the wet basis ranges from 20% to 40%. Owing to the effects of enhancing drying uniformity for airflow reversal in fixed-bed drying, the depth of the peanut bed was set to 1 m. To simplify the calculation, the average ambient temperature was set to 25°C, humidity during the harvesting period was set to 50%, and moisture content of peanuts in the main production area was set to 40% wet basis. The equipment is comprised of a drying box, heat pump, fan, ventilation devices, air uniform mechanism, and control system. The temperature of hot air entering the drying box could be adjusted to provide a constant temperature under an ambient temperature up to 20°C, with an accuracy of ±1°C. The maximum ventilation capacity was approximately 24 000 m 3 /h, and the fan motor speed was adjusted by the frequency converter, with an accuracy of ±0.1 Hz. The material-loading area of the drying chamber was 12 m 2 (6 m×2 m), maximum loading thickness was 1 m, the distance between the loading punching plate and the floor of the bottom air chamber was 450 mm, and minimum distance between the top of the material layer and the cover was 450 mm. Peanuts were harvested in Zhengyang County, Henan Province, China, with an average moisture content of 40.8% (wet basis) before drying. The average temperature and relative humidity of ambient air were 24.1°C and 43.9%, respectively. The input temperature of the drying air was set to 38°C, and the average air velocity was regulated by a frequency converter based on the experimental requirements.

Validation of simulation results
Peanut pods are characterized by large particle size and poor fluidity; therefore, it is difficult to extract samples from the material bed with a plug-in sampler to measure the moisture content of the upper, middle, and lower layers of the material bed. Therefore, a sampling cylinder was developed. The sampling cylinder was a thin-walled cylindrical container with dense holes at the bottom and wall (hole diameter, 5 mm; perforating ratio, 35.4%). The drying air entered and exited the container free from the bottom and sidewalls. The diameter of the sampling cylinder was 50 mm, and its height was 1000 mm.
To understand the changes in moisture content and temperature in the upper, middle, and lower sections during drying, the volume of peanuts was divided into 27 (3×9) test units in the horizontal direction ( Figure 4).

Figure 4 Schematic of testing area distribution
When loading materials, three sampling cylinders were placed vertically at the center of each test unit, and the bottom of the samplers was in contact with the porous bearing plate. As the experiment continued, at 15 h, 30 h, and at the end of drying, one sampling cylinder was removed from each test unit, and the materials in the sampling cylinders were divided into three sections: upper, middle, and lower section. The moisture contents of the 81 (3×27) testing points were then measured using the oven method [40] . The moisture contents from the same height of the layer materials were taken as a group, and the moisture contents of the upper-, middle-, and lower-layer materials were calculated by averaging each group.
Temperature sensors were placed at the center of each test unit at the height of 165 mm, 500 mm, and 835 mm from the bearing plate in the vertical direction. The number of temperature sensors was 81 (3×27). The sensors of the same height of each test unit were also taken as a group, and the average value of each group was taken as the temperature value of the material in that layer.
The correlation coefficient was used to demonstrate the statistical index of the relationship between simulating and experimental values.  (29) where, r is the correlation coefficient; Pre U is the U th simulation prediction value; Pr e is the mean of the predicted value; Exp U is the U th experimental value; and Exp is the mean of the experimental value.

Quality tests of dried peanuts
When the drying process was completed, the dried peanuts were discharged from their relevant ports and transported to a designated area by the conveyor. In the process of peanut discharge, a sample of peanuts was taken every 5 min. Five samples were collected, and each sample had a mass of no less than 200 g. For every peanut sample, aflatoxin content was determined based on ISO Standard 16050 [41] , the acid value was determined based on ISO Standard 660 [42] , and the peroxide value was determined based on ISO Standard 3960 [43] . In addition, three naturally dried peanut samples (total weight of samples was approximately 3 kg, and the exposure time was approximately 5 d) were selected as a control group, and the aflatoxin content, acid value, and peroxide value of those samples were determined by the same method. The flavor test was performed based on the ISO Standard 6658 [44] .

Results and discussion
3.1 Numerical simulation 3.1.1 Peanut temperature and moisture content during drying The temperature and moisture content (wet basis) of the peanuts were simulated with an air velocity of 0.3 m/s, material bed depth of 1 m, and airflow direction switching time of 3 h ( Figure 5). Owing to the ventilation sequence of the material layers changed with air direction reversing each time, the temperatures of the peanut layer at different heights gradually increased in a wave-like shape with the increase in drying time. With the accumulation of heat transferred from hot air to peanut layers and the reduction in temperature difference between the material layers and hot air, the fluctuation amplitudes gradually decreased as the temperature approached the air input temperature. Because the bottom and top materials were either the first or the last to contact hot air, the temperature fluctuation amplitudes of the bottom and top materials were the greatest. By contrast, the temperature fluctuation amplitudes of the middle layers were small, because in the layers near the middle position of the material bed, the ventilation sequence changed mildly as the hot air direction changed. This was similar to other results for airflow direction reversing ventilation drying for carrots [25] and wheat [28] .
In the initial stage of drying (0-3 h), air passed through the material layer from the bottom to the top. As the air passed through a critical position in the fixed bed, the relative humidity was high sufficiently so that the moisture absorption balance was achieved between the air and the layer material. Thus, the moisture in the remaining material layers could not be absorbed. When the ventilation direction was changed for the first time, the upper material layers contacted hot air for the first time. The rate of moisture decreased in the top layer material accelerated, whereas the moisture content of the bottom layer changed mildly. The moisture difference of the whole bed thus decreased rapidly, and this process was repeated until the average moisture content reached 8% wet basis. Compared with traditional fixed-bed drying [21,22,25,31] , the periodic change in the airflow direction effectively reduced the drying unevenness in the ventilation direction [25,27,29] , which reduced the moisture content difference by 70%-85%.  The average (volume-averaged) temperatures and moisture contents of the entire bed at different ventilation velocities were simulated when the air input temperature was 38°C, depth of the material bed was 1 m, and airflow direction switching time was 3 h ( Figure 6). The average temperature of the entire bed generally increased after the start of the drying process. It rose rapidly at the start of the drying process and then gradually slowed down until it approached the air input temperature. During this process, the average temperature dropped suddenly; however, it rose rapidly during every other period of reversal. Thus, the heat was quickly withdrawn from the dryer through the air, resulting in a rapid decrease in the temperature of the entire bed. Then the injection of the "new" air led to a rapid increase and recovery of the average temperature of the entire bed [2,26] . The lower the air velocity, the greater the drop in the average temperature.
Correspondingly, the change in average moisture content can be roughly divided into two stages. First, the decreasing rate of the average moisture content was almost the same, and the difference of the moisture content of the bed material increased and then decreased rapidly. Here, the moisture in the peanut hulls rapidly evaporated from the bed under air heating. Second, the rate of decrease of the average moisture content gradually decreased. As the ventilation direction changes with time, the changes in moisture content difference showed a wave-like pattern with a gradual decrease in amplitude. In addition, the lower the air velocity, the greater the difference of the moisture content. Here, the outward migration and evaporation of moisture of the peanut kernels played a dominant role. a. Average temperature b. Average moisture content c. Moisture content difference Figure 6 Simulation results of the overall drying process with different ventilation velocities. The ambient air temperature was 25°C and humidity was 50%; material bed depth was 1 m, hot air input temperature was 38°C, and airflow reversing time was 3 h 3.1.3 Effects of air velocities and air direction switching time on drying indices Time consumption, thermal energy consumptions and moisture content difference were calculated by the drying simulations when the air input temperature was 38°C, the depth of the material bed was 1 m, air velocity was 0.2 m/s, 0.3 m/s, 0.4 m/s, and 0.5 m/s, and air direction switching time was 1 h, 2 h, 3 h, 4 h, and 5 h (Figure 7).
With the increase of air velocity, the time consumption and moisture content difference decreased, and the thermal energy consumed per unit mass increased significantly. From 0.2 to 0.3 m/s, the moisture content difference decreased; however, the decrease of moisture content difference was relatively small when air velocity changed from 0.3 to 0.4 m/s and from 0.4 to 0.5 m/s. When the air direction switching time was 3 h, the moisture content differences corresponding to air velocities of 0.3, 0.4, and 0.5 m/s were close.
a. Time consumption b. Moisture content difference c. Thermal energy consumption Note: The ambient air temperature was 25°C, humidity was 50%, material bed depth was 1 m, and hot air input temperature was 38°C.

Figure 7 Drying indices at different air velocities and air direction switching times
In addition, when the air velocity remained constant, the air direction switching time had little effect on the time consumption and thermal energy consumed per unit mass; however, it had a certain influence on the moisture content difference.
An appropriate air direction switching time was conducive to reducing the moisture content difference. At an air velocity of 0.2 m/s, the moisture content difference reached its minimum value when the air direction switching time was 4 h; at an air velocity of 0.3 m/s, the moisture content reached its minimum value when the air direction switching time was 3 h; at an air ventilation velocity of 0.4 m/s, the moisture content difference reached its minimum value when the air direction switching time was 2 h; and at an air velocity of 0.5 m/s, the moisture content difference reached its minimum value when the air direction switching time was 1 h. The larger the air velocity, the smaller the best air direction switching time. Combining time consumption, moisture content difference, and thermal energy consumed per unit mass, when the ventilation direction switching time was 3 h, the comprehensive operation performance was better under different air velocities.

Stage division of segmented drying
Based on Figure 6, high temperature occurred at the later stage of the drying process, thus maintaining the initial ventilation velocity might cause a huge waste of energy. When the average temperature is taken as the ordinate and the average moisture content as the abscissa, a curve of temperature variation with moisture content was obtained (Figure 8).
When the average moisture content was greater than 22%, the average temperature fluctuated significantly with the average moisture content. This stage occurred mainly during the rapid heating at the beginning of the drying process. During the following stage, the temperature of the material bed changed steadily with decreasing average moisture content, and the temperature drop amplitude caused by changing the ventilation direction decreased gradually.
Therefore, to reduce energy consumption and improve heat utilization and uniformity of batch drying, investigating segmented drying is considered indispensable. The moisture content above 22% (wet basis) was taken as the first stage. Meanwhile, the remaining drying stages were further subdivided based on the variations of the average temperature. Thus, moisture content of 14%-22% was taken as the second stage, and a moisture content of 8%-14% was taken as the third stage.
Note: The ambient air temperature was 25°C and humidity was 50%; material bed depth was 1 m, hot air input temperature was 38°C, and airflow reversing time was 3 h. Four groups of ventilation velocities were then selected to calculate the time consumption, moisture content difference, and the thermal energy consumed per unit mass ( Table 2). The results showed that segmented drying could effectively reduce the drying time and energy consumption and improve the drying uniformity.

Uniform experimental design and simulation results
To obtain the optimal ventilation parameter combination of segmented drying, referring to previous research experience, the ventilation velocity of the three drying stages was set between 0.2 and 0.5 m/s. A U 13 * (13 4 ) uniform design table was used to perform a 3-factor 13-level uniform design series of simulations with the indicators of the time consumption, moisture content difference, and thermal energy consumed per unit mass [45] . Based on this, a synthetic weighted mark was calculated. The mathematical simulation parameters and results are presented in Table 3. Using the simulation results, a stepwise regression analysis was performed. Non-significant items were eliminated, and the regression model of the synthetic weighted mark with velocities for three-stage drying was obtained (Equation (30)). The model quality evaluation indices, including coefficient of determination (R 2 ), root mean squared error (RMSE), F value, and Sig. values are presented in Table 4. The Sig. value for each significant item in the regression equation is shown in Table 5 where, Y * is the synthetic weighted mark; X 1 is the velocity of the first drying stage; X 2 is the velocity of the second drying stage, and X 3 is the velocity of the third drying stage.   Table 5, the order of the influence of each significant item on the synthetic weighted mark was X 2 X 3 >X 1 >X 1 2 >X 3 . Thus, the velocities in the three drying stages had a significant impact on the synthetic weighted mark, and the interaction of velocities in the second and third drying stages was significant.

Optimization of ventilation parameters
To solve the maximum value of the synthetic weighted mark Y * , the minimum value of the opposite Y * was explored. The boundary ranges of ventilation velocities in the three stages were considered as three-factor constraint conditions. Thus, the objective function is as follows: Y = min(-Y * (X 1 , X 2 , X 3 )) (31) with constraint conditions: The "fmincon" function of Matlab software was used to solve the above multiple linear constraint optimization equation. It was concluded that when X 1 = 0.46 m/s, X 2 = 0.2 m/s and X 3 = 0.2 m/s, the Y value was the minimum, which was -98.75. Hence, Y * was 98.75, which was superior to all combinations of velocities shown in Table 3. When X 2 = X 3 , the ventilation velocities were the same in the second and third drying stages, and the two stages could be combined into one. Thus, the entire drying process can be divided into two stages. At the start of drying, the optimal ventilation velocity was 0.46 m/s. Then, when the average moisture content dropped to 22%, the optimal ventilation velocity was 0.2 m/s.
Taking the above ventilation velocities as the input values for a reverse ventilation drying simulation of the peanut bed, the results showed that the time consumption was 44.3 h, moisture content difference was 0.51%, and thermal energy consumption per unit mass of the dried material was 2.91×10 6 J/kg.

Validation of simulation by experimental results
Based on the optimization results in Section 3.1.5, and the environmental and initial conditions of the materials during the experiment, the temperature and moisture content changes of the material bed were calculated through simulation. The material bed was divided into three layers along the thickness direction, that is, the upper, middle, and lower layers. The temperature and moisture content of each layer were calculated, and the drying time when the average moisture content of the entire bed reached 22% wet basis was also calculated. The simulation results revealed that when the average moisture content of the material bed reached 22% wet basis, drying time was 10.6 h; when the average moisture content of the material bed reached 8% wet basis, the drying time was 43.6 h. During experiments, a ventilation velocity of 0.46 m/s was used as the first stage for 0-10.6 h, and 0.2 m/s was used as the second stage for 10.6-43.6 h. The temperatures of the upper-, middle-, and lower-layer materials were recorded every 5 h. The moisture contents of the upper-, middle-, and lower-layer materials were measured after 15, 30, and 43.6 h of drying. The simulation and experimental results were compared as Figure 9. The correlation coefficients of the simulation and experimental values of temperature were 0.991, 0.989, and 0.993 for the upper, middle, and lower layers of peanut, respectively. The correlation coefficients of the simulation and experimental values of the moisture content were 0.995, 0.994, and 0.988 for the upper-, middle-, and lower-layer materials, respectively. The results, therefore, showed that the simulations of temperature and moisture content in different layers were good, and the simulation model could accurately predict the reversing ventilation drying of peanuts.

Peanut quality after drying
Owing to the periodic change in the direction of the medium air passing through the material bed during the reversing ventilation drying, no material layers remain at the outlet in wet air in the extended periods, which differs from conventional unidirectional fixed-bed ventilation drying. After the validation experiment (Section 2.5), no mildew was found in the dried peanuts. Aflatoxin was not detected in five samples after reversing ventilation drying and the three samples after natural sun drying using the method specified in ISO Standard 16050 [41] , ISO Standard 600 [42] , and ISO Standard 3960 [43] . The acid and peroxide values of the samples were determined. Taking the average value as the final value, the results are listed in Table 6. The acid and peroxide values of peanuts under reversing ventilation drying were slightly higher than those under natural sun drying (Section 2.5.3). The acid value of 0.18 mg/g was far below the maximum acceptable value of 3 mg/g, and the peroxide value of 0.011 g/(100 g) was below the maximum acceptable value of 0.08 g/(100 g) set by the standard GB 19300 [46] . These results were consistent with those of peanuts dried in the southeastern USA [13] . In addition, the flavors of dried peanuts were simply evaluated by artificial tasting based on ISO Standard 6658 [44] . The flavor of peanuts after reversing ventilation was found to be good, and no obvious rancid peanut was found. Thus, the taste of peanuts was not significantly different from that of naturally dried peanuts.

Conclusions
The unevenness and energy consumption of batch drying can be reduced by adopting reversing ventilation and segmented drying. The quality of peanuts after reversing ventilation drying was found to be close to that of natural sun drying.
The optimal comprehensive drying effect was obtained with a ventilation velocity of 0.46 m/s when the average moisture content of peanut materials was more than 22% and with a ventilation velocity of 0.20 m/s when the average moisture content was less than 22%. The correlation coefficients of the simulation and experimental results for the temperature and moisture content were above 0.98. Thus, the simulation model developed could accurately describe the reversing ventilation drying of peanuts.