DOI: 10.3303/CET2188074 Paper Received: 28 May 2021; Revised: 22 July 2021; Accepted: 9 October 2021 Please cite this article as: Li M.J., Su Z., He C., Zhang B., Chen Q., 2021, Physics-Informed Neural Network for Unreacted-Core Shrinking Model of Coal Gasification, Chemical Engineering Transactions, 88, 445-450 DOI:10.3303/CET2188074 CHEMICAL ENGINEERING TRANSACTIONS VOL. 88, 2021 A publication of The Italian Association of Chemical Engineering Online at www.cetjournal.it Guest Editors: Petar S. Varbanov, Yee Van Fan, Jiří J. Klemeš Copyright © 2021, AIDIC Servizi S.r.l. ISBN 978-88-95608-86-0; ISSN 2283-9216 Physics-Informed Neural Network for Unreacted-Core Shrinking Model of Coal Gasification Ming Jian Lia, Zengrong Sub, Chang Heb,*, Bingjian Zhangb, Qinglin Chenb a School of Chemical Engineering and Technology, Sun Yat-Sen University, Zhuhai, China b School of Materials Science and Engineering, Sun Yat-Sen University, Guangzhou, China hechang6@mail.sysu.edu.cn Physics-informed neural network (PINN) has achieved success in many science and engineering disciplines by encoding physical laws into the loss functions of the neural network. Compared with traditional numerical method, PINN transformed the problem of solving differential equations into the optimization of loss functions by automatic differentiation. In this work, PINN is apply to solve the coal gasification chemical kinetic problems of gas-solid reactions in the form of the unreacted-core shrinking model with governing ordinary differential equations (ODEs). The results show that the prediction performance of the developed PINN is comparable with that of the widely-used Runge-Kutta method, and thus it opens the possibility for the application of deep learning to the modelling of complex chemical kinetics systems. 1. Introduction With the explosive growth of computing resources, deep learning has yielded transformative results across many scientific and engineering fields, such as computer visions, natural language processing, etc. However, the high cost of obtaining data and the scarcity of data have brought great challenges to the simulation and optimization of machine learning. In fact, sparse data often have a certain degree of coupling (e.g., the flow field data distribution in fluid mechanics needs to satisfy both the law of conservation of mass and the law of conservation of momentum), but this part of the priori hidden knowledge is not used in the traditional neural network, resulting in a waste of information resources. Raissi et al. (2019) first proposed Physics-Informed Neural Network (PINN), which can encode the differential equation as well as initial conditions and boundary conditions as constraints into the loss function of the neural network. One advantage of PINN is that we can take the derivatives of a neural network by applying the chain rule for differentiating compositions of functions using automatic differentiation. The training result of PINN can not only approximate the observed data but also satisfy the physics imposed by the partial differential equations and boundary/initial conditions. PINN can not only solve the forward problem but also conveniently be applied for addressing the reverse problem by the discovery of unknown parameters in the differential equation with minimum change of the code for the forward problems. To date, PINN has been widely used in the fields of fluid mechanics, heat transfer, etc. For example, Sun et al. (2020) provided a PINN approach for surrogate modelling of fluid flows without labelled data, in which the Navier–Stokes equations were incorporated into the loss function of the neural network and the results agreed well with the first-principle numerical simulations. Lu et al. (2021) presented the applications of PINN to two 2-D steady-state heat transfer problems by using soft boundary and hard boundary. The comparison results indicated that the prediction ability of PINN based on the hard boundary is superior to the rival. To improve the robustness and convergence of PINN, several PINN variants have been proposed. For example, Meng et al. (2020) developed a parareal physics-informed neural network (PPINN), which can decompose a long-time problem into many independent short-time problems supervised by an inexpensive/fast coarse-grained solver. Compared to the original PINN, PPINN achieved a significant speed- up for long-time integration of PDEs, and can provide reasonable predictions of the solution, hence aiding the PPINN solution to converge in infinite iterations. Kharazmi et al. (2021) formulated a general framework for hp- variational physics-informed neural networks (hp-VPINNs) based on the nonlinear approximation of shallow 445 and deep neural networks. The result showed that hp-VPINN can work more efficiently with rough solutions/input data such as singularities, steep solutions, and sharp changes. With the advancement of PINN, some machine learning libraries are also developed to make PINN more friendly to academia and researchers. Some of those are DeepXDE, SciANN, NeuroDiffEq, etc. Most of these libraries are written in Python and based on deep learning frameworks such as TensorFlow or Pytorch, and some are written in Julia. There is no doubt that these libraries played a crucial role in advancing the neural network solvers, but they are all limited to simple 1D or 2D domains with signal forward governing differential equations, and struggle to solve real-world applications that involve complex 3D geometries and multi-physics systems. Recently, NVIDIA presented an AI-driven multi-physics simulation framework, namely SimNet, to accelerate simulations across a wide range of disciplines in science and engineering, which has demonstrated the advantages of solving multi-physics systems compared to the original PINN. Environmental issues related to coal conversion have attracted increasing social attention due to high energy consumption and CO2 emissions, thus and more stringent policies have been formulated around this aspect. (Wang et al., 2020). Coal gasification is one of the effective ways of clean and efficient utilization of coal energy, which would bring historic opportunities to the sustainable development of the traditional coal chemical industry. This study is the first attempt to use the physics-constrained deep learning approach to model the highly coupled complex reaction kinetics for coal gasification system. The kinetics of char-gas reactions involved in the coal gasification are modelled as the unreacted-core shrinking model. The differential equations are encoded into the loss functions of the neural network and the predicted results are compared with the widely-used Runge-Kutta method. 2. Unreacted-Core Shrinking Model of Coal Gasification 2.1 Unreacted-Core Shrinking Model The overall reaction proceeding for the solid-gas reactions can be described as follows (Wesenauer et al., 2020): (1) gaseous reactants diffuses through the gas film to the surface of the reaction particles; (2) gaseous reactants diffuse through the ash layer surrounding the unreacted core; (3) gas and solid reactants take reaction at the reaction site; (4) gaseous reaction products diffuse from the reaction site to the particle surface; (5) gaseous products diffuse from the particle surface to the surrounding bulk flow. The interplay of diffusive and kinetic limitations in solid-gas reactions has been extensively investigated, especially the diffusion in coal particles during combustion. Two main types can be used to describe the solid-gas reactions in coal gasification, namely volumetric reaction and surface reaction. In volumetric reactions, gaseous components can quickly diffuse into the particles and reaction takes place throughout the interior of the particle. In surface reactions, gaseous reactants do not penetrate the particle but are confined at the surface of the shrinking core of the unreacted solid. Generally, the surface reactions occur when the chemical reaction is relatively very fast and thus the diffusion is the key step that restricts the overall reaction rate. In this study, the char-gas reactions (see reactions (1-4)) can be considered as surface reactions since the high operating temperature (>1,000 ºC) significantly promotes the reaction rate. The unreacted shrinking core model is used to model these reactions due to its simple mathematical formulation and explicit expression of an overall solid-gas reaction rate. As shown in Figure 1, gaseous reactants in coal gasification (O2, H2O, CO2, and H2) diffuse through the gas film and ash layer surrounding the unreacted core of char and react with char on the surface of the unreacted core. As the reaction progresses, the carbon particles gradually shrink inward (rcore decrease) and the ash layer thickens. (1) (2) (3) (4) In reaction (1), Ф is a mechanism factor that depends on the diameter of the coal particle (dp) and can be estimated by the following relations (Wen and Chaung,1979) in Table 1, where Z is the ratio of CO to CO2 concentration and T is temperature, K. In this paper, coal particle size is of the order of 1 cm. 446 Table 1: Expressions of Ф for Different Sizes of Coal Particle Figure 1: Schematic diagram of the unreacted-core shrinking model. Table 2: Parameters for Kinetics of Reactions (1-4) (Wen and Chaung,1979) Reactions kfilm ks Pi-Pi* 1 PO2 2 3 PCO2 4 The effects of gas film diffusion, surface reaction, and ash layer diffusion are considered in the unreacted-core shrinking model. The overall rate is expressed as Eq(5) and the involved parameters such as kfilm, ks and Pi - Pi* are listed in Table 2, where T is temperature, K. (5) where kfilm is the gas film diffusion constant, g/cm2·atm·s; ks is the surface reaction constant, g/cm2·atm·s; kash =kfilm*εn is the ash film diffusion constant, g/cm2·atm·s, here ε is the voidage in the ash layer (which are set as ε=0.75 and n=2.5 in this model); Y=rcore/rparticle, here rcore and rparticle are the radii of unreacted core and feed coal particle in cm; Pi-Pi* is the effective partial pressure of i-component taking account of the reverse reactions, atm. 2.2 ODEs system Based on the above-mentioned unreacted-core shrinking model, the char-gas reaction system can be modelled using the following ordinary differential equations (ODEs). In this model, the temperature was fixed at 2000K for simplicity. (6) (7) dp (cm) Ф Comment <0.005 0.005-0.1 >0.1 1.0 447 where yi is the i-component concentration, kmol/m3; 𝑡 is time, s, while the final time is denoted as tf; vi is the stoichiometric coefficient of i-component, dimensionless; Ri is the rate of a reaction involving i-component, kmol/m3s; yi0 is the initial concentration of i-component, kmol/m3. The initial conditions of the ODEs are 𝑦1(0) = 2 kmol/m3, 𝑦2(0) = 0 kmol/m3, 𝑦3(0) = 0.5 kmol/m3, 𝑦4(0) = 1 kmol/m3, 𝑦5(0) = 1.5 kmol/m3, 𝑦6(0) = 0.01 kmol/m3, where 𝑦1~𝑦6 denote the concentrations of O2, CO, CO2, H2O, H2, CH4. The ODE system described by Eq(6) with the initial conditions specified by Eq(7) can be numerically solved using an ODE integrator such as the Runge-Kutta method, which is used as a benchmark to comparing with PINN predicted values. 3. Physics-Informed Neural Network According to the proposed ODEs system, a physics-informed neural network framework is built, we use the feedforward neural network (FNN) as the architecture of NN, which is sufficient for most of the ODE problems. The architecture of L-layer PINN can be expressed as follows: (8) (9) (10) where is the input of NN; is the output of layer l neurons and Nl is the number of neurons in layer l; is the weight matrix from layer l-1 to layer l; is the bias vector from layer l-1 to layer l; is the output of the last layer, which is used to approximate the true solution of ODEs; σ() is the nonlinear activation function of each neuron, herein, commonly used activation functions include hyperbolic tangent (tanh) and the rectified linear unit (ReLU), etc. Figure 2: Schematic of a PINN for solving the ODEs system for coal gasification. To measure the discrepancy between the neural network and the constraints, we consider the loss function defined as the weighted summation of the L2 norm of residuals for the ODEs and initial conditions, the loss functions of PINN are expressed as Eq(11) ~ (13). (11) where (12) (13) Where and are the weights of the residual of initial conditions and equations. 448 To avoid the nonconvergence to the loss functions and improve training efficiency, the initial conditions are hardcoded to the NN as Eq(14). So, the LossIC are all equal to 0 and only Lossres needed to be minimized. (14) The schematic of PINN for solving the ODEs system of char-gas reaction in the gasifier is shown in Figure 2 and the PINN algorithm is shown in Table 3. Table 3: PINN algorithm for solving ODEs of Coal gasification. PINN algorithm for solving ODEs of Coal gasification Step 1 Define the PINN architecture. Step 2 Specify the training sets according to the ODEs and the corresponding initial conditions. Step 3 Define the loss function by summing the weighted L2 norm of both the ODEs and initial condition residuals. Step 4 Train the neural network to find the optimal hyperparameters (w, b) by minimizing the loss function using gradient-based optimizers such as Adam and L-BFGS. 4. Results and Discussion In this study, it is considered that the FNN has 3 hidden layers and 64 nodes per hidden layer, with the activation function of tanh. The hyperparameters of this FNN are optimized via Adam, with a learning rate of 0.001 and training rounds of 5000. Besides, the time interval t∈[0,10s] is used as the training domain, while the remaining time interval t∈[10, 25s] is used to evaluate the generation performance of the trained PINN. The calculation results are shown in Figure 3a, where the solid and dotted lines represent the results obtained from the Runge-Kutta method and PINN. As shown, the predicted production rates of all gaseous species by PINN are consistent with those by the Runge-Kutta method in the training domain t∈[0,10s]. As the time exceeded 10 s, although some PINN predicted production rates (i.e., O2 and CO) slightly deviate from the results predicted by the Runge-Kutta method, the relative errors are all less than 10 %. Figure 3b shows the loss function in the training process. After 5000 epochs train, the loss function calculated by Eq(11) drops to less than 1×10-6. Figure 3: (a) Solutions of the ODEs using the Runge-Kutta method and PINN method (b)The record of the loss functions of PINN for the ODEs The sensitivities of PINN to the numbers of neurons and layers of the model have been briefly presented in Table 4. The train epochs are all fixed at 5,000. It is found that the loss of PINN is sensitive to the size (neurons × layers) of the NN, and a deeper neural network relatively has better performance, by comparing the cases of 64 × 2 with 64× 4 and 128 × 1 with 128 × 2. In all, the PINN architecture with 4 layers and 64 nodes per layer performs outperforms the other cases. Note that the operating temperature has a significant effect on the results of production rates in the gasification reaction system. Herein, CO and H2 are selected as the species for sensitivity analysis to investigate the influence of temperature on the predictive ability of PINN. It is seen from Figure 4 that the production rates of CO and H2 vary significantly with the increase in temperature, while PINN still has always maintained a high predictive accuracy in the training domain. 449 Table 4: The Loss of PINN with different NN sizes. neurons × layers Loss 64×2 3.72×10-7 64×3 2.80×10-7 64×4 2.73×10-7 128×1 3.47×10-6 128×2 5.36×10-7 Figure 4: The variation trend of production rates of (a) CO and (b) H2 at different temperatures. 5. Conclusions In this paper, the performance of the PINN for coal gasification kinetic systems in the form of the unreacted- core shrinking model was investigated. The results showed PINN performed well in predicting the production rates of gaseous species as compared with the reference results obtained by the Runge-Kutta method. The performance of PINN was sensitive to the size of the NN, and a deeper neural network had a lower loss. The developed PINN provided an alternative solution to the traditional numerical methods for constructing high- fidelity surrogate model of coal gasification system without simulation data. However, it should be noted that gasification is essentially a multi-physics system that is highly coupled with the temperature. It is still a challenging problem to address the two-way coupled multi-physics simulation by constructing the most appropriate loss function in the architecture of PINN. Acknowledgments Financial support from the National Natural Science Foundation of China (51776228) is acknowledged. References Kharazmi E., Zhang Z., Karniadakis G.E., 2021, hp-VPINNs: Variational physics-informed neural networks with domain decomposition. Computer Methods in Applied Mechanics and Engineering, 374, 113547. Lu Z., Qu J., Liu H., He C., Zhang B., Chen Q., 2021, Surrogate modeling for physical fields of heat transfer processes based on physics-informed neural network, CIESC Journal, 72, 1496-1503. Meng X., Li Z., Zhang D., Karniadakis G.E., 2020, PPINN: Parareal physics-informed neural network for time- dependent PDEs. Computer Methods in Applied Mechanics and Engineering, 370, 113250. Raissi M., Perdikaris P., Karniadakis G.E., 2019, Physics-informed neural networks: A deep learning framework for solving forward and inverse problems involving nonlinear partial differential equations, Journal of Computational Physics, 378, 686-707. Sun L., Gao H., Pan S., Wang J., 2020, Surrogate modeling for fluid flows based on physics-constrained deep learning without simulation data, Computer Methods in Applied Mechanics and Engineering, 361, 112732. Wang X., Klemes J.J., Varbanov P.S., 2021, Water-energy-carbon Network Critical Transmissions: Case Study of China, Chemical Engineering Transactions, 86, 439-444. Wen C.Y., Chaung T.Z., 1979, Entrainment coal gasification modeling, Industrial & Engineering Chemistry Process Design & Development, 18, 684-695. Wesenauer F., Jordan C., Pichler M., Frei A., Azam M., Jahromy S.S., Harasek M., Winter F., 2020, An Unreacted Shrinking Core Model Serves for Predicting Combustion Rates of Organic Additives in Clay Bricks. Energy & Fuels, 34, 16679-16692. 450