# A Multi-Level Approach for Simulation of Storage and Respiration of Produce
## 2 Digital Characterization of Produce Shape  
Digital representations of tomatoes and avocadoes are introduced in this section. The assumption of spherical fruits has been often used in the literature; for example, for apples [3; 4] and oranges [25]. Semi-symmetrical fruits have also been mathematically described using Fourier series approximations of the boundaries. This family of approaches was utilized for tomatoes [26], apples and pears [27]. While these approaches are mathematically accurate, they provide a high degree of complexity and they were not utilized for simulations where the numbers of produce were large because of the difficulty of CFD discretization. Strawberries have been represented as well [5] using profile blending techniques for different cross sections, but they were very few in numbers per individual stacks, making the CFD discretization process tolerable. In the present work, a procedure has been developed that uses profile blending with a discrete element technique to provide a produce shape that is representative of the produce, and that can be used with the YADE discrete modelling tool [12] to produce REVs with many pieces for CFD discretization and simulation. The procedure for shape generation is based on the following steps:  
1. Photographs of the fruit of interest were acquired for different random shapes. From these photographs, the outer edges were extracted as a series of points using graph digitization (see Figure 1 showing extracted points from tomatoes and avocadoes). 2. Each profile was scaled uniformly such that the centerline height of each fruit was a reference length of 1 and then divided along the centerline (the axis connecting the stalk and stamen) to produce two half profiles. 3. Each half profile was fitted to an appropriate spline curve using the Scipy function splprep in the python module Scipy.interpolate [28] to obtain a suitable smooth representation of the half profile, as shown in Figure 1. The spline representations were stored to be used to generate 3D geometric models. Each fruit template was generated as follows:  
1. A random permutation of four half-profiles was selected from the set of half profiles produced in the above procedure. This was achieved by shuffling the elements of the array of assigned profile indices in the python script so that a number of unique shapes for tomatoes and avocadoes is created by selecting a different set of half-profiles each time a sample of produce is made. Four half profiles were needed to produce realistic shapes for each commodity considered. 2. A macro was used to sketch the selected spline profiles in SolidworksTM [29]; the sketches were spaced evenly around a common axis, which contained the centerline of each sketch. 3. The profile sketches were revolved about the common axis and blended together using the loft feature. The resulting digital representations of the fruits are smooth so that CFD meshing is carried out with acceptable quality. The smoothness of the surface was achieved while still exhibiting the asymmetry characteristic of real fruits, as shown in Figure 2. Each unique shape of produce was also statistically varied in size, as elaborated later, to produce a larger set of unique shapes and sizes of produce. 4. A surface mesh for each fruit template was generated using the ANSYS meshing tool [30], in preparation for modelling the interaction of the piece of fruit with other fruits. The above process was repeated to generate several fruit templates such that a \"bank\" of variable shapes was available from which to construct a REV. As noted in the Introduction, an appropriate REV for large quantities of stacked produce is simply a crate (or box) of the specific produce in question, since a large storage volume is simply made up of several packed crates. This is where there is a departure from the modelling of packed particles or sand, since these are generally considered as vast regions without any other sub-arrangements like boxes.