# Artificial Neural Network Moving-Boundary Model with Temperature Dependence

Requires a Wolfram Notebook System

Interact on desktop, mobile and cloud with the free Wolfram Player or other Wolfram Language products.

This Demonstration considers two artificial neural network (ANN) solutions to the moving-boundary (MB) problem that arises during the freezing of a moist-food slab, namely a bespoke model and a Wolfram Language Predictor model. Both were constructed using a synthetic dataset of time and MB position. The MB data was generated via a one-dimensional finite-difference freezing model described elsewhere. This synthetic data includes the effects of physical property and parameter ranges relevant to engineering applications. Both ANN models offer an interactive graphical tool for examining the influence exerted by temperature-dependent thermal properties of the food material and key input cooling parameters on the moving boundary. These input properties or parameters include the thermal conductivity, latent heat and heat capacity of the food material, as well as the cooling medium. You can vary the Biot number , the latent-heat number , the temperature number and the thermal-conductivity parameter .

Contributed by: Victor M. Chavarria (August 25)

Open content licensed under CC BY-NC-SA

## Details

Heat Transfer Freezing Problem

The heat conduction partial-differential equation that describes the freezing process of a one-dimensional moist-food slab is [1, 2]:

, (1)

where , the dimensionless slab temperature,

and are the initial freezing points of pure water and of the food material, respectively,

is the dimensionless MB position growing from 0 at , to 1 at , time ,

is the normalized distance going from the convective surface to the slab center,

and is the dimensionless latent-heat number (the inverse Stefan number):

.

Here is the heat of fusion of the moist-food material, is the water weight fraction in the fully thawed state, is the bound water mass per unit mass of solid, is the solids weight fraction and is the volumetric specific heat capacity of the fully frozen slab [1].

The Robin boundary condition at is given by:

, (2)

where is the convective surface-slab temperature and is the Biot number. The dimensionless cooling-medium temperature is defined as:

,

where is the dimensional medium temperature. Schwartzberg's [1] temperature-dependent thermal conductivity was invoked:

,

where is the thermal conductivity parameter given by

,

and and are the fully unfrozen- and the fully frozen-state thermal conductivities, respectively; governs the temperature response of thermal conductivity and influences the freezing process nonlinearly.

Key assumptions also include a constant material density, full release of the latent heat of fusion, and the temperature at zero time and the phase change both taking place at the initial freezing point of the material.

The effective heat capacity, accounting for the latent heat effect, is defined as:

,

where is the ratio of the temperature-dependent effective dimensional heat capacity to the fully frozen food material heat capacity [1].

At the moving interface, , where the Stefan condition applies,

. (3)

The mathematical formulation, represented by equations (1), (2) and (3), was numerically solved as described in [2]. However, in this Demonstration, we invoke the Stefan condition instead of the adiabatic geometric-center condition. To calculate the MB position, at each incremental time step and with a fixed spatial grid, the discretized equation (2) was iteratively solved until it satisfied a convergence criterion.

Artificial Neural Network (ANN)

The structure of the ANN consists of a five-input layer, followed by a NetChain with {LinearLayer[9], LinearLayer[7], Ramp[7], LinearLayer[5]} using the Tanh activation function. The input data included , , , , and , with the moving boundary position as the scalar output [3]. This data was generated according to a statistical-experimental design array. The input data was normalized deviations from the mean referenced to the standard deviation associated with each input property [4]. The data comprised approximately 2100 training and 500 validation paired points, respectively, and a 460 test set for statistical performance evaluation.

Our neural network exhibited errors when predicting the MB positions for time values very close to or equal to zero. This anomaly depends on and parameters. To correct these errors, we use the theoretical power-law time function as an approximate solution. The parameters of this function () are estimated from each ANN predicted MB profile, ensuring a seamless splicing of estimated values from to when . For those MB approaching 1* *at low , the Predictor ANN model tapered time (tapered) profile is more accurate than the bespoke model.

The neural network constructed by the Wolfram Language Predictor was also trained and validated with the same datasets as our bespoke model. The Predictor model's structure details are, however, not available to be reported.

The accuracy of our ANN model in predicting MB is supported by several metrics referenced to the input test dataset. These metrics include a Pearson correlation coefficient of 0.9975, a root-mean-square error of 0.0185, and a sum-of-squares value of 0.1598 [3]. Similarly, for the Predictor model, the corresponding metrics, in the same order, are 0.9974, 0.0153 and 0.5056. The entire MB profiles were predicted using a sample size of 110 data points.

This Demonstration plots predictions of the MB versus the dimensionless time , where

,

is the slab (half) thickness, is the thermal diffusivity of the fully frozen material and is the dimensional time. For comparison, we also present predictions based on the theoretical MB solutions given by Plank and Goodman [2] and a modified square-root-of-time solution that includes the effects of and on the MB. The sliders let you see the effects of key phase-change parameters; namely, , , and .

Although our bespoke ANN model predicts MB positions that follow the characteristic power-law time behavior (with the time exponent ), as expected, it underestimates the time at which approaches one at the slab center for values close to 0.06. The Predictor model overcomes this deviation, but the resulting MB profile exhibits a less smooth or piecewise-monotonic wavering behavior, deviating from the expected concave-downward power-law time profile. This suggests that the Predictor ANN may have overfitted the data. However, for higher values of and , both models tend to agree with each other and with the reference published MB solutions. In this regard, both models offer complementary perspectives to some extent.

References

[1] H. G. Schwartzberg, "The Prediction of Freezing and Thawing Temperatures vs. Time through the Use of Effective Heat Capacity Equations," in *Proceedings of the Joint Meeting of Commissions C1 and C2 of the International Institute of Refrigeration*, 1977 pp. 311–317.

[2] V. M. Chavarria, "Modeling the Influence of Temperature-Dependent Thermal Properties on the Freezing Front," *Journal of Food Research*, 8(6), 2019 pp. 129–146. doi:10.5539/jfr.v8n6p129.

[3] C. R. Chen, H. S. Ramaswamy and M. Marcotte, "Neural Network Applications in Heat and Mass Transfer Operations in Food Processing," *WIT Transactions on State of the Art in Science and Engineering*, 13, 2007 pp. 49–59. https://www.witpress.com/Secure/elibrary/papers/9781853129322/9781853129322002FU1.pdf.

[4] Wolfram Research, Inc. "Introduction to Neural Nets." reference.wolfram.com/language/tutorial/NeuralNetworksIntroduction.html.

## Snapshots

## Permanent Citation