End-User Software for Efficient Sensor Placement in Jacketed Wine Tanks

In food processing, temperature is a key parameter affecting product quality and energy consumption. The efficiency of temperature control depends on the data provided by sensors installed in the production device. In the wine industry, temperature sensor placement inside the tanks is usually predetermined by the tank manufacturers. Winemakers rely on these measurements and configure their temperature control accordingly, not knowing whether the monitored values really represent the wine’s bulk temperature. To address this problem, we developed an end-user software which 1. allows winemakers or tank manufacturers to identify optimal sensor locations for customizable tank geometries and 2. allows for comparisons between actual and optimal sensor placements. The analysis is based on numerical simulations of a user-defined cooling scenario. Case studies involving two different tanks showed good agreement between experimental data and simulations. Implemented based on the scientific Linux operating system gmlinux, the application solely relies on open-source software that is available free of charge.


Introduction
Temperature is an important factor in various processing steps during wine making [1].Prior to fermentation, for example, a speed-up of must clarification by particle sedimentation can be achieved by appropriate tank cooling.During fermentation, temperature control allows the winemaker to define the aromatic profile of the wine and to prevent stuck or sluggish fermentations [2][3][4][5][6].Other process steps involving temperature control are cold stabilization, malolactic fermentation or storage (aging) [1,[7][8][9][10].During active fermentation, a homogeneous temperature in the tank is achieved by efficient bubble mixing, while in processes where mixing is driven entirely by natural convection, temperature gradients in the tank are more likely [11][12][13][14][15][16].
To monitor wine temperatures, tanks are usually equipped with a single temperature sensor which is beneficial not only in terms of costs, but also regarding issues of hygienic design and clean-in-place installations.Usually, tank manufacturers do not reveal any details of their strategies and considerations behind the placement of that single sensor.
According to one manufacturer, for tanks with diameters in the range of 0.82 m to 3.6 m, winemaker's may choose from a few different positions along the tank wall in combination with one or two different distances from the wall.
Cooling applications for wine tanks include various types of double jackets as well as plates or coils that can be immersed into the wine as required.Typically, modern tanks are equipped with a pillow plate double jacket and can be ordered fully insulated [1,17].For these tank types, it is a common practice to keep some distance between the sensor and the tank wall where sensor values might be biased by the double-jacket cooling.
Effective temperature control is important for wine quality, e.g., by hindering evaporative losses or degradation of aromatic compounds triggered by inappropriate temperatures during storage or aging, but it is also important in terms of overall energy costs since ill-positioned sensors indicating too high bulk temperatures may obviously lead to unnecessarily high cooling loads.In fact, heating and cooling applications have been identified as the main contributors to the energy costs of industrial winerys [8,[18][19][20][21][22].
Recent studies on sensors in winemaking focus on developing smart monitoring systems in the fields of wireless sensor networks and Internet of Things (IoT) not covering the topic where temperature probes should be located [23][24][25][26][27][28].Hence, this study aims on addressing the question on efficient sensor placement in winemaking for the first time.
Considering the broad range of available tank geometries and possible sensor positions, any experiment-based optimal sensor placement is obviously inefficient and infeasible.Hence, a procedure based on numerical simulations and computational fluid dynamics (CFD) is suggested in this study.The approach was implemented into an end-user software which offers practitioners a tool for the analysis of their specific configurations.It is limited to scenarios where the tank is filled with a liquid phase only, as scenarios with a large amount of particular matter, e.g., red wine mash, would need a different modeling approach.

Mathematical Model
To identify suitable temperature sensor locations inside wine fermentation tanks, the software computes simulations of cooling scenarios.Before and after fermentation, the flow is assumed to be driven by natural convection only.Density variations caused by typical wine cooling conditions are assumed small, s.t. the Boussinesq approximation can be used [1,29].Under these assumptions, numerical simulations can be performed using the buoyantBoussinesqPimpleFoam solver of the open-source C++-CFD-toolbox OpenFOAM R [30].The underlying model describes single phase flow of an incompressible fluid where density variations are only accounted for in the buoyancy term following the Boussinesq approach.
The graphical user interface is based on Shiny.It is divided into two main panels.On the left panel, data input is realized using sliders thematically distributed over four tabs, Tank, Cooling, Wine and Simulation.More details on the content of these tabs are given in Section 2.3.The right panel is used for the output of responsive graphics and texts such as tank geometry sketches or information on the expected cooling rate.A progress bar is shown when the analysis is ran in the background.In case of invalid input, data warning messages are displayed.A screenshot of the user interface is shown in Figure 1.

Input panel
Responsive output panel

Case Definition
The case setup in the software environment is organized in three steps requiring user input.In the first step, geometry data of the tank, dimensions of the cooling jacket and a fill level must be supplied.This includes tank diameter d T (m), total tank height h T (m), cone angle ϕ ( • ), liquid volume V (m 3 ), sediment fraction f Sed (m 3 m −3 ), cooling jacket distance from tank height h 0,J (m) and jacket height h J (m).In the second step, temperature conditions and cooling power of the scenario are defined.Here, the initial liquid temperature T 0,l ( • C) and the cooling power Qc (W) are required.In the case of non-insulated tanks, the heat flow rate from ambient air to the liquid, Qa (W), can also be set.To support user input, the expected cooling rate is calculated on the fly by Equation ( 5) and printed out in the right panel.
Thermo-physical properties of the liquid can be modified as required.Default values refer to a typical white wine after fermentation and are given in Table 1.
Table 1.Required thermo-physical properties of the liquid and their default values.

Variable
Value In the last step, model parameters relating to the optimal sensor placement procedure are defined.This includes simulation time t sim (s), e.g., the length of a cooling cycle, the measurement interval of the temperature sensor ∆t sens (s), the accepted temperature tolerance ∆T sens , e.g., the sensor's measurement tolerance, and the minimum percentage of valid measurements q (%).The simulation setup also allows for a choice of grid cell size ∆x (mm) which can be used for a trade-off between level of uncertainty and computational costs.If required, input data from previous analyses can be read from a file.Further details on the use of the input parameters and on the simulation setup are provided in the following sections.

Geometry and Mesh Generation
The software visualizes the geometrical parameters provided by the user as a 2D-sketch of the tank including fill level and sediment volume.This is useful for a fine-tuning of geometrical parameters until they match real life situations such as truncated cone bottoms.Although the current implementation supports cylindro-conical tanks only, it can also be used to approximate dished bottoms as explained in Section 2.7. Figure 2 shows the default geometrical input data and the corresponding output sketch.
The software encompasses a fully automated mesh generation procedure (Figure 3) solely based on the geometrical input parameters and the grid cell size set by the user.Using a Python script, these data are used to generate a CAD-Model in Salome.This is realized using a rotational geometry approach referring to the outline of the fluid region of the tank as well as on information on cooling jacket position.The resulting STL-surfaces already represent the boundary patches used for the simulation setup as explained in Section 2.5.Finally, the snappyHexMesh utility of OpenFOAM R is used to built a hexahedral-dominant mesh, starting with an underlying blockMesh that uses the previously defined grid cell size ∆x.

Boundary Conditions
The computational mesh is divided into three groups of boundary patches referred to as walls, cooling and insulated (Figure 3).The walls patches represent all tank surfaces in contact with liquid and ambiance where the specified heat flow is applied.This excludes the tank bottom where sediment is assumed to insulate the fluid from ambiance, and the liquid surface where insulation caused by the air in the tank's headspace is assumed.These regions are treated as a part of the insulated patch where a zero gradient Neumann-type boundary conditions is applied for temperature.The cooling patch corresponds to the jacketed tank surface.To express rates of heat flow ( Q) from the cooling jacket or from ambient air, Neumann-type boundary condition are applied.Boundary face values are evaluated using where T x (K) is the current cell center temperature and ∆ fx (m) is the face-to-cell distance.
The local reference temperature gradient ∇T lref is calculated from the rate of heat flow Q as follows: where A P and α eff describe the boundary patch area (m 2 ) and the effective thermal diffusivity (m 2 s −1 ).Effective thermal diffusivity is calculated according to which simplifies to since ν t = 0 is assumed.A no-slip Dirichlet-type boundary conditions is applied for the velocity on all patches.Pressure is handled by OpenFOAM R 's fixedFluxPressure boundary condition, which acts similar to a zero gradient Neumann-type boundary condition including adjustments for body forces like gravity [42].

Identification of Sensor Locations
The sensor location algorithm identifies locations where a temperature sensor would most likely report the current liquid's bulk temperature T (K), ideally at all times.To guide the algorithm, the user is allowed to choose a threshold for acceptable temperature deviations, a measurement interval and a percentage of valid measurements; this can e.g., be used to better represent practical situations or the requirements discussed in Section 2.3.Based on the input data for these three constraints, most reliable temperature sensor locations are determined as follows.Each grid cell center is used as a potential sensor location.The user-defined measurement interval t sens and overall simulation duration t sim define the total number of sensor evaluations.To evaluate the sensor in a particular grid cell center, the deviation of the cell's temperature from the bulk mean temperature is determined and compared to the user-defined temperature threshold ∆T sens .The overall percentage of valid measurements is calculated for every cell according to with the Heaviside step function defined as: All grid cells exceeding the user-defined threshold value q that defines the desired minimum percentage of valid measurements are classified as reliable sensor locations.An automated 3D ParaView visualization procedure is used to display the recommended sensor location cells along with a sketch of the tank geometry.

Case Studies
A proof of concept study was performed to evaluate the effectiveness and robustness of the sensor location algorithm.Two independent experiments were carried out to compare the software's simulation results with measured temperature profiles referring to wine tank cooling.Please note that the validity of the numerical solver buoyantBoussinesqPimpleFoam has already been proven elsewhere [43,44].Insulated wine tanks equipped with a pillow plate cooling jacket were filled with an appropriate amount of tap water.After a 24 h resting period, initial bulk temperature was determined.Then, coolant was pumped through the cooling jacket for 1 h while monitoring the liquid's temperature at six different locations.At the end of this cooling cycle, the tank's content was homogenized using a mechanical mixer which resulted in a homogeneous, final bulk temperature.The difference between initial and final bulk temperatures was used to compute the cooling power required in the computer simulation of the experiment.
This experiment was carried out twice using two different-sized dished bottom wine tanks, both fully insulated and equipped with pillow plate cooling jackets.Both tanks were placed on load cells to measure the tanks' contents.The smaller tank had a diameter of d T,S = 0.6 m and was filled with 300 kg of water, the larger tank (d T,L = 1.4 m) was filled with 5420 kg.Temperature measurements were realized through thermowells on three different heights and two different depths using external probe temperature sensors (TSN-EXT44, AREXX Engineering, Zwolle, NL).With an accuracy of ±0.5 • C to ±1 • C on an operating temperature range from −30 • C to 80 • C, these sensors are similar to standard built-in wine tank sensors.The two sensors depths, measured as distances from the tank wall, for the small and the large tank were 5.5 cm/13 cm and 21 cm/34 cm, respectively.Details on the different measurement heights and tank dimensions are given in Figure 4.In the following, the six sensor locations are referred to as T-N, T-F, C-N, C-F, B-N and B-F, where T, C and B define the heights (top, center, bottom) and wall distance is expressed as N and F (near, far).We measured an initial bulk temperature (T 0,l ) of 13.4 • C for the large, 18.2 • C for the small tank.Final bulk temperatures were 12.92 • C in the large tank (∆T = 0.48 • C), and 16.88 • C in the small tank (∆T = 1.32 • C).This includes a correction for the rate of heat flow introduced by the mechanical mixer (TS-V17 movable mixer, 0.75 kW, 1400 rpm-Theo & Klaus Schneider GmbH & Co KG, Bretzenheim, Germany) of 405 W. Hence, for the large tank the applied cooling power ( Qc ) was calculated to be −3045 with c P = 4180 J kg −1 K −1 and t c = 3600 s.In the experiment with the small tank, the cooling power was −460 W.These experiments were then simulated in the software environment using the input data shown in Table 2.The values for kinematic viscosity, thermal expansion and thermal conductivity were taken from literature and set to ν = 1.5 × 10 −6 m 2 s −1 , β = 207 × 10 −6 K −1 and κ = 0.56 W m −1 K −1 [45,46].In addition to the standard software procedure, the simulation data was probed at the experimental sensor positions to gather temperature progressions curves similar to the experimental setup.To account for temperature variations in rotationally symmetric positions, radial mean temperatures were computed from the simulation results for each sensor position.

Case Studies
In the case studies, experimental temperature curves obtained at six different locations during a cooling cycle of 1 h were compared with simulation results.Initially, sensor data were calibrated to match initial bulk temperature.An exception was made for the B-N sensor in the large tank since its data showed inconsistencies during the first minutes.Its initial value was adjusted to represent a more physical temperature development.
In the large tank, only the lower region represented by sensors B-F and B-N was affected during 1 h of cooling (Figure 5), which can be explained by the fact that the cooling jacket was deeply immersed below the water surface (1.41 m).Minor differences in the temperature curves reported by B-F and B-B are within the range of sensor data fluctuations and thus insignificant.All remaining sensors including those located slightly above the cooling jacket (C-F, C-N) did not measure any cooling effect.
These results could be reproduced in simulations based on the end-user software and parameter settings described above.Two different grid resolutions, ∆x = 30 mm and 20 mm, were used and gave similar results.A small cooling effect was detected in the simulations at sensor positions C-F and C-N, starting after approx.30 min.Since this effect was smaller than the sensors tolerance limit, it was not observed in the experiments.We also noted that the temperature drop was more pronounced in the coarser grid case which indicates artificial numerical diffusion effects [29].As Figure 5 shows, none of the large tank sensor locations under investigation was suitable to monitor the liquid's bulk temperature based on a ±0.1 • C tolerance level.In the second case study with the smaller tank, the cooling jacket was located approximately 8 cm below the liquid surface.Similar to the large tank results, the sensors above the cooling jacket (T-F and T-N) did not detect a temperature drop during 1 h of cooling (Figure 6).All four sensors below the cooling jacket reported a steady temperature decrease while slightly lower temperatures were found closer to the tank bottom (sensors B-F and B-N).This corresponds to a typical natural convection flow pattern where cold fluid with higher density accumulates at the bottom.For the smaller tank, experimental data were compared with simulations on three different grid resolutions ∆x: 30 mm, 20 mm and 10 mm.A good coincidence between simulations and experiments was found for all grid resolutions (Figure 6).Refining the grid resulted in a slightly larger temperature difference between the two lower sensor levels C-F/N and B-F/N without affecting the general cooling pattern.C)   The simulation results indicated that sensor positions C-F and C-N seemed preferable to monitor average bulk temperature.This will be further investigated in the following section where the consequences of different settings of the accepted percentage of valid measurements (q) and the temperature tolerance (∆T sens ) will be compared.
To assess grid sensitivity, the root-mean-square deviation (RMSD) between experiment and simulation was computed for all six sensor locations according to for t ∈ {1, 2, 3, . . ., 60 min}.Figure 7 confirms the generally good coincidence between simulations and measurements that was already evident from Figures 5 and 6.While the mean RMSD in the large tank decreased with a finer grid resolution, it remained almost constant in the small tank, which, on the other hand, showed a decrease in its standard deviation as the grid was refined.This indicates a systematic difference between simulations and experiments related with fluctuations of the experimental sensor data.For example, in the temperature measurements of T-F and T-N in Figure 6, a fluctuation between 18.2 • C and 18.3 • C was present during the entire cooling cycle.Also, it must be noted that the higher RMSD accuracy for the large tank scenario is clearly related to the fact that significant cooling effects showed up at only two of the six sensors compared to four of six positions in the small tank experiment.As explained, this is a consequence of the differences in the relative positions between cooling jacket and sensors.Again, this underlines the importance to consider the individual conditions in a winery when deciding on temperature sensor locations.
large -Δ = 20 mm large -Δ = 30 mm small -Δ = 10 mm small -Δ = 20 mm small -Δ = 30 mm Root-mean-square deviation (RMSD) of liquid temperature between measurement and simulation for each sensor location and all case studies (large/small tank on different grid resolutions (∆x)).Box-plots represent across sensor location RMSD data for each study.

Sensor Location Scenarios
Finally, we analyze the software's suggestions on suitable sensor locations for the two case studies.In the large tank scenario-with the cooling jacket located deeply below the water surface-the software identifies a region of suitable sensor locations that lies slightly below the upper edge of the cooling jacket (Figure 8), based onsensor parameters ∆T sens = 0.1 • C and q = 75 %.On the finer grid, the region of suitable sensor locations is set a little lower compared to the coarser grid.Also, the finer grid suggests that a location in the central region of the tank might be less suitable compared to a location closer, but not too close, to the tank wall.From the coarser grid, on the other hand, no recommendations can be derived regarding the depth of suitable sensor locations, apart from the fact that the first few centimeters away from the cooling jacket are excluded.This corresponds to common practice where a minimum distance from the cooling jacket is always kept to avoid undesired measurement biases.Generally, it must be noted that in the large tank scenario the location of the cooling jacket is far from ideal w.r.t.temperature homogeneity.As experiments and the simulation in the previous section have shown, this configuration led to a distinct temperature stratification inside the tank which means that the use of mechanical mixers would be advisable.Less stratification was found in the small tank case study where the cooling jacket was located just slightly below the liquid surface.In this scenario, the differences between the regions of suitable sensor locations suggested by the software for each of the three grid resolutions were more pronounced, based on threshold parameters ∆T sens = 0.1 • C and q = 75 % (Figure 9a-c).The results for the coarsest grid (Figure 9a, ∆x = 30 mm) only excluded small portions at the bottom and top ot the tank from the suggested region of suitable sensor locations.The finer grids (∆x = 10 mm and 20 mm) identified the region of suitable sensor locations with more precision in a smaller volume, corresponding to about 1/3 to 2/3 of the liquids fill level.The larger size of the region of suitable sensor locations in comparison to the large tank scenario can be explained by the more homogeneous temperature distribution in the small tank.As discussed before, the grid refinements led to a more distinct temperature gradient between the two lower sensor levels which shrinks the size of the region of suitable sensor locations on the two finer grids relative to the coarsest grid.
By adjusting the threshold for the percentage of valid measurements to q = 95.83% (115/120 measurements) in the coarsest grid case, it was possible to shrink the region to a similar volume that was found in the simulations with the finer grid.This adjustment can be done in the post-processing step in ParaView, and hence the end-user can analyze effects of more strict thresholds after the simulation step to obtain smaller and more informative regions of suitable sensor locations.While results similar to the more computationally expensive fine grid simulations could be obtained on the coarse grid in this particular case, the end-user should be aware of the danger that the loss in accuracy on coarser grids may lead to unphysical results in other cases.The case studies suggest grid resolutions in a range between 10 mm to 30 mm for small to medium sized wine tanks as a reasonable compromise between computational costs and accuracy.∆T sens = 0.1 • C and q = 75%).(d) Effect of changing the percentage of valid measurements q to 95.83% for ∆x = 30 mm.

Computational Costs
Table 3 shows the computational costs for the case study simulations referring to an affordable standard workstation.As can be seen, computational times range between minutes to less than a day (1207 min), which means that it is feasible to perform the simulations with the software on standard end-user equipment, especially when choosing coarser grid resolutions.As it was shown, coarser grid simulations may already lead to a sufficiently good agreement with experimental data, while undesired effects of numerical diffusion can be reduced by lowering the threshold values.To avoid a too high loss in accuracy on coarser grids, a grid sensitivity study is recommended for tank sizes beyond the scope of this study, which can be easily realized in the end-user software by performing iterated simulations with several ∆x values.a System: 2× Intel R Xeon R CPU E5-2660 v3 @ 2.60GHz-64GB RAM.

Summary of Results
A summary of our main results is given in Table 4.

Case studies
-Successful validation of CFD simulations against experimental temperature progression in 300 L and 5420 L jacketed wine tanks.
-Pre-installed sensor locations not well suited to monitor bulk mean temperature.

Sensor locations
-Efficient sensor location depends on fill level and cooling jacket position.
-More variability in height than in depth (distance to wall) Computational costs -Computational times of less than one day already lead to sufficient results.

Conclusions
An end-user software was developed that identifies optimized sensor locations for liquid bulk temperature measurement.Based on a few input parameters, different scenarios can be analyzed and optimized, or the suitability of pre-installed sensors can be evaluated.As it was shown, ideal temperature sensor locations in wine tanks depend strongly on the fill level relative to the location of the cooling device.Since the optimized sensor positions in our case studies showed a higher variability in height compared to depth (i.e.wall distance), an enhanced mobility of the sensors in height direction would be a useful enhancement for the wine industry.In this way, effective adaptive cooling strategies could be implemented based on the software that would be sensitive to variable conditions between the years, such as yield differences.The software could be used to compute optimal sensor height from live data, with subsequent adjustments of the physical sensors that would improve process control and efficiency.Based on a parameter study across a broad range of possible scenarios, the results could be formulated in terms of more general, phenomenological mathematical approaches such as Pareto models that would allow for a faster prediction of unevaluated scenarios [47,48].This data base could also be used for a faster identification of a range of cooling scenarios that are appropriate for pre-installed, non-movable sensors.
Funding: This research was funded by the German Federal Ministry of Education and Research (BMBF, Germany)-grant number 05M13RNA-as a part of the joint project "Robust energy optimization of fermentation processes for the production of biogas and wine (ROENOBIO)".

Conflicts of Interest:
The authors declare no conflict of interest.

Abbreviations
The following abbreviations are used in this manuscript:

Figure 1 .
Figure 1.Screenshot of the graphical user interface.Dashed boxes indicate the input (left) and the responsive information panel (right).

Figure 3 .
Figure 3. Five steps (a-e) of the fully automated mesh generation workflow.

Figure 4 .
Figure 4. Dimensions, cooling jacket configuration and sensor locations of the (a) large and (b) small case study tank.To compare sizes the large tank and left version of the small tank are drawn on the same scale.

Figure 5 .
Figure 5.Comparison of experimental cooling data in the large tank with simulations, referring to six different sensor locations inside the tank and grid cell sizes of 30 mm (a) and 20 mm (b).

Figure 6 .
Figure 6.Comparison of the experimental cooling process in the small tank with simulation data on three different grid resolutions (∆x), 30 mm (a); 20 mm (b) and 10 mm (c), referring to six different sensor locations inside the tank.

Figure 7 .
Figure7.Root-mean-square deviation (RMSD) of liquid temperature between measurement and simulation for each sensor location and all case studies (large/small tank on different grid resolutions (∆x)).Box-plots represent across sensor location RMSD data for each study.
c p specific heat capacity (J kg −1 K −1 ) d T tank diameter (m) f Sed sediment fraction (m 3 m −3 ) g gravitational acceleration (m s −2 ) g b Boussinesq gravity (m s −2 ) h J jacket height (m) h 0,J cooling jacket distance from tank height (m) h T tank height (m) p pressure (Pa) Pr Prandtl number (-) Pr t turbulent Prandtl number (-)

Table 2 .
Case studies: software input data for the small and large tank geometry.

Table 3 .
Computational costs depending on grid size in the small and large tank scenarios.

Table 4 .
Summary of results.