A method and device for dimension reduction modeling of ammonia synthesis reaction-heat transfer coupled process
By embedding the reaction rate mechanism expression into a fully connected neural network and combining it with a physical constraint loss function, the high-dimensional problem of solving the coupling process of ammonia synthesis reaction and heat transfer in the green electricity-to-hydrogen ammonia synthesis system was solved, achieving fast and precise optimization scheduling and efficient model prediction.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- TIANJIN UNIV
- Filing Date
- 2026-03-04
- Publication Date
- 2026-06-05
AI Technical Summary
Existing technologies are insufficient for rapid and precise optimization and scheduling in green electricity-to-hydrogen ammonia synthesis systems. The ammonia synthesis reaction-heat transfer coupled process has high model dimensionality and large solution volume, and existing models cannot simultaneously meet the requirements of physical consistency and computational efficiency in complex coupled systems.
The mechanism expression of the reaction rate is explicitly embedded using a fully connected neural network, and the monotonically increasing trend of ammonia concentration and temperature is constrained by a trend-type penalty. A unified physical constraint loss function is constructed by combining mass conservation, energy conservation and boundary conditions, which reduces the solution dimensionality and improves training stability.
This approach reduces the dimensionality of the solution while maintaining mechanistic consistency, improves training stability and prediction accuracy, enhances the model's speed and generalization ability, and resolves the contradiction between physical consistency and computational efficiency in complex coupled systems.
Smart Images

Figure CN122154203A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of industrial process modeling and optimization control technology, specifically relating to a dimensionality reduction modeling method for the ammonia synthesis reaction-heat transfer coupled process. Background Technology
[0002] With the advancement of carbon neutrality goals and energy transition, the production of hydrogen from green electricity to ammonia (P2A) has become an important pathway connecting the power system and chemical processes. In actual operation, renewable energy output fluctuates, while ammonia synthesis units typically require near-steady-state operation. This contradiction exacerbates the need for rapid and precise optimization scheduling. The ammonia synthesis reaction-heat transfer process is described by multiple sets of nonlinear partial differential equations. While the mechanistic model has high accuracy, solving it requires fine time steps and spatial discretization, resulting in high computational cost and slow convergence, making it difficult to use for multi-scenario or real-time optimization. To improve efficiency, existing studies often equate the ammonia synthesis unit to a steady-state energy conversion unit or use data-driven surrogate models such as RSM and ANN, which only characterize the power-yield relationship, lacking sufficient physical constraints and cross-condition generalization ability. The recent PINN method introduces the residuals of the governing equations into the loss function, which can to some extent balance mechanism and data, but it has not fully utilized the monotonic trends of temperature and concentration along the bed and structural mechanistic information such as reaction rate, making it difficult to simultaneously meet the requirements of physical consistency and computational efficiency in complex coupled systems. Summary of the Invention
[0003] The purpose of this invention is to overcome the shortcomings of existing technologies and address the problems of high dimensionality, large solution complexity, and difficulty in meeting the real-time requirements of optimization scheduling for green electricity-to-hydrogen ammonia synthesis systems in the ammonia synthesis reaction-heat transfer coupling model. This invention provides a dimensionality reduction modeling method and apparatus for the ammonia synthesis reaction-heat transfer coupling process. This method explicitly embeds structural mechanism formulas such as reaction rate into a neural network framework and applies penalty constraints to the monotonically increasing trend of ammonia concentration and temperature along the bed axis. Simultaneously, it constructs a unified physical constraint loss function by combining mass conservation, energy conservation, and boundary conditions, thereby reducing the solution dimensionality and improving training stability while maintaining mechanism consistency.
[0004] The objective of this invention is achieved through the following technical solution: A dimensionality reduction modeling method for the coupled reaction-heat transfer process of ammonia synthesis includes: S1. Using time coordinate t and axial spatial coordinate z as input, a forward-propagating fully connected neural network is constructed to predict the ammonia mass fraction and gas temperature at any time and space point in the reactor. S2. During the forward propagation of the fully connected neural network, the mechanism expression of the ammonia synthesis reaction rate is explicitly embedded as a structural prior, so that the fully connected neural network can directly call the mechanism expression of the reaction rate when making predictions. S3. Based on the output of a fully connected neural network, the spatiotemporal derivatives of the mass fraction of ammonia with gas temperature are calculated by automatic differentiation, and the following physical constraint loss terms are constructed: trend penalty term loss, mass conservation PDE residual loss, energy conservation PDE residual loss, and boundary residual loss. The trend-based penalty term loss is used to constrain the monotonically increasing trend of ammonia mass fraction and temperature along the bed axis, and the penalty is only applied when the spatial derivative is negative. S4. The physical constraint loss terms in step S3 are weighted according to preset weights to form a total loss function, and the network parameters are optimized through backpropagation to achieve dimensionality reduction and rapid prediction of the reaction-heat transfer coupled partial differential equation.
[0005] Furthermore, the reaction formula for ammonia synthesis is as follows: ; Partial differential equations are used to describe the changes in two parameters: ammonia mass fraction and temperature. ; ; In the formula, This represents the mass fraction of ammonia, where T is the temperature. For the reaction rate, Let be the specific heat capacity of the gas. The specific heat capacity of the catalyst. The heat of reaction, The dispersion coefficient is... The propagation speed of the temperature wave; The kinetic equation for the ammonia synthesis reaction is expressed as: ; ; ; In the formula, As a corrective factor, , The packing density of the catalyst, , , These are the partial pressures of hydrogen, nitrogen, and ammonia, respectively, expressed in bar. The gas constant is... This represents the 1.5th power of the hydrogen partial pressure; this fractional series originates from the microscopic reaction mechanism of ammonia on the surface of the iron catalyst and reflects the nonlinear contribution weight of hydrogen concentration to the forward and reverse reaction rates. and These are the rate factors for the forward and reverse reactions, respectively; the partial pressures of the gas inside the reactor are expressed as follows: ; ; In the formula, The molar flow rate of nitrogen at the inlet of each bed reactor. The molar flow rate of nitrogen at a certain location inside the reactor. , , These are the partial pressures of nitrogen, ammonia, and hydrogen, respectively. In an ammonia synthesis system, the corresponding control residual is defined as: ; and These represent the residual terms of the mass conservation and energy conservation equations, respectively. By embedding the mechanism expression of the reaction rate into the network forward propagation process, this analytical form can be directly called during residual calculation.
[0006] Furthermore, the trend-based penalty loss is expressed as a ReLU penalty applied to the negative part of the spatial derivative, i.e., only when... (c) / x<0 or (T) / A positive penalty is applied when x < 0.
[0007] Furthermore, a hard constraint is applied to the concentration equation at the inlet to ensure that the inlet boundary conditions are strictly satisfied, while a Neumann adiabatic boundary constraint, i.e., a boundary residual constraint where the outlet heat flux is zero, is applied to the temperature equation at the outlet.
[0008] Furthermore, under constant inlet conditions, the steady-state profile within the reactor satisfies: ; A trend-based penalty loss is introduced, defined as follows: ; In the formula, This indicates the number of sampling points within the catalyst bed used for training. Represents the first in the spacetime domain i The coordinates of the collocation points A penalty term is generated only when the derivative is negative to eliminate inverse variations in the output of a fully connected neural network that do not conform to monotonicity; mass-conserving PDE residual loss. Energy conservation PDE residual loss They are respectively ; ; In the formula, and These represent the residual terms of the mass conservation equation and the energy conservation equation, respectively. The entrance uses a known temperature The outlet is set in Neumann form based on the adiabatic boundary conditions, that is: ; The corresponding boundary residual loss is defined as: ; In the formula, This represents the number of sampling points at the export boundary; Total loss function for: ; w1-w4 are the weights of each loss term. During training, the weights are adaptively or manually adjusted to balance physical consistency and fitting accuracy.
[0009] This invention also provides a dimensionality reduction modeling device for the ammonia synthesis reaction-heat transfer coupling process, comprising: The forward prediction unit is used to construct a forward-propagating fully connected neural network with time coordinate t and axial spatial coordinate z as inputs, which is used to predict the ammonia mass fraction and gas temperature at any time and space point in the reactor. The structural prior unit is used to explicitly embed the mechanism expression of the ammonia synthesis reaction rate as a structural prior during the forward propagation of the fully connected neural network, so that the fully connected neural network can directly call the mechanism expression of the reaction rate during prediction. The loss unit is used to calculate the spatiotemporal derivatives of ammonia mass fraction and gas temperature by automatic differentiation based on the output of a fully connected neural network, and constructs the following physical constraint loss terms: trend penalty term loss, mass conservation PDE residual loss, energy conservation PDE residual loss, and boundary residual loss. The trend penalty term loss is used to constrain the monotonically increasing trend of ammonia mass fraction and temperature along the bed axis, and only generates a penalty when the spatial derivative is negative. The optimization calculation unit is used to weight each physical constraint loss term in step S3 according to a preset weight to form a total loss function, and optimize the network parameters through backpropagation to achieve dimensionality reduction solution and rapid prediction of the reaction-heat transfer coupled partial differential equation.
[0010] The present invention also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the steps of the dimensionality reduction modeling method for the ammonia synthesis reaction-heat transfer coupling process.
[0011] The present invention also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the dimensionality reduction modeling method for the ammonia synthesis reaction-heat transfer coupling process.
[0012] Compared with the prior art, the beneficial effects of the technical solution of the present invention are: 1. The mechanistic expression of the reaction rate is explicitly embedded in the forward propagation of the network. The reaction rate formula is a known physical relationship, which is directly used as an external computational module in residual calculation. The network only needs to fit the temperature / concentration distribution, thereby reducing model complexity and improving sample efficiency and generalization ability. This avoids the network repeatedly learning known physical structures, reduces the parameter learning burden, and improves physical consistency and training efficiency; it achieves faster training convergence, lower loss, and smaller physical residuals. In a specific embodiment, TS-PINN achieves higher R-values in concentration and temperature prediction. 2 Indicators such as MAPE are significantly better than RSM / ANN / standard PINN.
[0013] 2. A trend-based penalty term (T-PINN) is added to the loss function to explicitly constrain the monotonically increasing trend of ammonia concentration and temperature along the bed axis (based on ReLU penalty using spatial derivatives). Monotonicity is verifiable prior information naturally generated by energy conservation and exothermic reactions. Adding it as a regularization term suppresses solutions that do not conform to the trend, reduces local oscillations, and makes the predictions more physically reasonable in spatial distribution. This achieves the goals of suppressing gradient oscillations, accelerating convergence, improving the stability and interpretability of predictions across the entire spatial domain, and reducing errors on the test set. It also addresses issues such as the potential for physically unreasonable local solutions (derivative signs contradicting physical trends) in unobserved regions by standard PINN, and the possible anomalies in predictions under low-data conditions.
[0014] 3. The total loss function also includes mass-conserving PDE residuals, energy-conserving PDE residuals, and boundary residuals. Directly constraining the PDE residuals during training can guide the network to satisfy the conservation equations across the entire domain, obtaining a continuous approximation close to the physical reality without the need for fine-grid solutions. This allows for the acquisition of low-dimensional, continuous model approximations while ensuring physical consistency, facilitating rapid invocation in scheduling optimization.
[0015] 4. A hard constraint is applied to the concentration at the inlet, while a residual constraint of the Neumann adiabatic boundary condition is applied to the temperature at the outlet. The hard constraint at the inlet ensures the uniqueness of the solution to the concentration equation; the Neumann temperature condition at the outlet is consistent with the physics of heat conduction, avoiding the imposition of unrealistic outlet temperature constraints. The boundary region prediction is more stable and has stronger physical consistency, which is beneficial to the correctness and reliability of the global solution.
[0016] 5. The aforementioned trend prior, structural prior, and boundary residual are synergistically integrated into the TS-PINN overall framework model and trained with limited data support. The combined use of these two approaches creates stronger physical induction within the loss space, reducing the parameter exploration space and improving model robustness. The final model outperforms the model using only a single prior or the standard PINN in terms of convergence speed, steady-state accuracy, and cross-condition generalization. Attached Figure Description
[0017] Figure 1 This is a schematic diagram of the overall structure of the new energy hydrogen production and ammonia synthesis system in a specific embodiment of the present invention.
[0018] Figure 2 This is a schematic diagram of the TS-PINN model structure proposed in a specific embodiment of the present invention.
[0019] Figure 3 This is a scatter plot comparing the predicted concentration and temperature values of different models with the reference values in the embodiments of the present invention.
[0020] Figure 4 These are the convergence curves of the training loss of the standard PINN, T-PINN, S-PINN, and TS-PINN models in the embodiments of this invention. Detailed Implementation
[0021] The present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments. It should be understood that the specific embodiments described herein are only for explaining the present invention and are not intended to limit the present invention.
[0022] Example 1 This embodiment provides a dimensionality reduction modeling method for the ammonia synthesis reaction-heat transfer coupling process, and finally constructs a physical constraint neural network dimensionality reduction model TS-PINN (Trend-StructurePhysics-Informed Neural Network) that integrates trend priors and structural mechanism constraints.
[0023] The overall structure of the new energy hydrogen production and ammonia synthesis system is as follows: Figure 1 As shown, this pathway uses renewable energy as input, and through the processes of hydrogen production by water electrolysis and nitrogen production by air separation, it provides hydrogen and nitrogen feedstock to the ammonia synthesis reactor, thereby realizing the conversion of electrical energy into chemical energy.
[0024] The physical model of the ammonia synthesis reactor consists of three bed models. Each bed can be described by mass and energy balance equations, as well as reaction kinetic equations. The following assumptions were made to solve the bed models: (1) Only axial flow exists within the reactor; (2) The temperature, pressure and composition of the gas are uniformly distributed across the cross-section; (3) The gas temperature is equal to the catalyst temperature.
[0025] The reaction equation for ammonia synthesis is as follows: (1); Since the ammonia concentration and temperature change both with time and along the reactor axis, the following partial differential equations are used to describe the changes in these two parameters: (2); (3); In the formula, This indicates the mass fraction of ammonia. For the reaction rate, Let be the specific heat capacity of the gas. The specific heat capacity of the catalyst. The heat of reaction, The dispersion coefficient is... This represents the propagation speed of the temperature wave.
[0026] The ammonia synthesis reaction is a reversible exothermic reaction, and its reaction kinetic equation can be expressed as: (4); (5); (6); In the formula, For the corrective factor ( ), The packing density of the catalyst, , , These are the partial pressures of hydrogen, nitrogen, and ammonia, respectively, expressed in bar. The gas constant is... This represents the 1.5th power of the hydrogen partial pressure. This fractional series originates from the microscopic reaction mechanism of ammonia on the surface of the iron catalyst and reflects the nonlinear contribution weight of hydrogen concentration to the forward and reverse reaction rates. and These are the rate factors for the forward and reverse reactions, respectively. The partial pressure of the gas inside the reactor can be expressed as follows: (7); (8); (9); In the formula, The molar flow rate of nitrogen at the inlet of each bed reactor. This represents the molar flow rate of nitrogen at a specific location inside the reactor.
[0027] First, in the reaction-heat transfer process of the ammonia synthesis reactor, as the reaction progresses within the bed, reactants are continuously converted into products and release heat, causing the mass fraction of ammonia to decrease. With temperature Along the axial direction Stable increasing trend. This characteristic reflects the physical consistency and energy conservation of the system, and can be regarded as a verifiable trend-based prior knowledge. The standard PINN method lacks explicit constraints on this derivative sign information, and therefore may produce local solutions that contradict the physical trend in unobserved regions. This embodiment adds a spatial monotonicity penalty term to the loss function to strengthen the model's learning constraint on the axial increasing trend of variables, thereby ensuring that the prediction results maintain physical rationality in spatial distribution.
[0028] Under constant inlet conditions, the steady-state profile within the reactor satisfies: (10); To reflect the spatial monotonicity constraint during model training, a trend-based penalty term is introduced into the loss function, defined as follows: (11); In the formula, This indicates the number of sampling points within the catalyst bed used for training. Represents the coordinates of the i-th collocation point in the space-time domain. A penalty term is generated only when the derivative is negative, to eliminate inverse variations in the model output that do not conform to monotonic laws. This constraint is concise and has good numerical stability, and can be applied across the entire domain, ensuring that the model output follows physical constraints while maintaining an increasing trend consistent with physical laws along the spatial direction.
[0029] Secondly, in the reaction-heat transfer process of the ammonia synthesis reactor, the governing equations are not only determined by the partial derivative relationships, but also contain a large number of structural constraints reflecting the physical mechanisms. These structural forms have often been established by thermodynamic and kinetic theories and have clear mathematical expressions, such as equations (2) and (3).
[0030] To enhance the network's mechanistic representation capabilities, this embodiment introduces structural constraints (S-PINN), which embeds the mechanistic representation of the reaction rate into the forward propagation of the fully connected neural network, thereby reducing the parameter learning burden and improving the physical consistency of the model. In the ammonia synthesis system, the corresponding control residual is defined as: (12); In the formula, The rate term is determined by the reaction kinetics model, as shown in equation (4). Therefore, by embedding the mechanistic expression of the reaction rate into the network forward propagation process, this analytical form can be directly called during residual calculation, thus constructing the PDE residual loss function under structural constraints: (13); (14); In the formula, and These represent the residual terms of the mass conservation and energy conservation equations, respectively. Compared to the standard PINN, this form explicitly utilizes the mechanism of reaction rates when calculating residuals, avoiding repeated learning of known physical structures by the network, thereby improving the efficiency and physical consistency of model training.
[0031] Finally, based on the aforementioned trend-based and structural constraints, the network prediction results also need to be constrained by the system's boundary conditions. In the ammonia reactor reaction-heat transfer coupled system studied in this embodiment, the spatial derivatives of the concentration equation and the temperature equation have different orders, thus leading to differences in the boundary condition settings. The concentration equation is a first-order convection equation, requiring boundary constraints only at the inlet; while the temperature equation contains diffusion terms. This belongs to the form of a second-order space equation, and boundary conditions need to be provided at the entrance and exit respectively.
[0032] The concentration equation is shown in equation (2). When Initial value information is transmitted unidirectionally along the reactor axis, and the solution can be uniquely determined by the inlet and initial conditions. Forcibly applying boundary conditions at the outlet can lead to numerical over-constraint. Therefore, this embodiment employs hard constraints at the inlet to ensure... The goal is to precisely meet the requirements without imposing restrictions on exports.
[0033] The temperature equation, as shown in equation (3), includes a diffusion term, indicating that heat can be conducted spatially. This means the temperature distribution is influenced not only by the inlet conditions but also by the boundary fluxes. If only the inlet temperature is given, the solution to the equation will not be unique; a boundary condition needs to be provided at each end of the space. A known temperature is used at the inlet. The outlet is set in Neumann form according to the adiabatic boundary conditions, that is: (15); The corresponding boundary residual is defined as: (16); In the formula, This represents the number of collocation points sampled at the outlet boundary. This boundary residual term is used to ensure that the temperature distribution at the outlet satisfies the heat transfer equilibrium condition, thereby improving the physical consistency of the model in the spatial boundary region.
[0034] In summary, we have obtained the following results: Figure 2 The overall structure of the TS-PINN proposed in this embodiment is shown.
[0035] The model uses time and axial spatial coordinates Using this as input, a fully connected neural network is used to predict the ammonia concentration and temperature at any spatiotemporal point within the reactor. During forward propagation, the network explicitly embeds the mechanistic expression of the reaction rate. This is used as a structural prior (S-PINN). Subsequently, based on the network model output, its spatiotemporal derivative is calculated using automatic differentiation (AD), and three types of physical constraint loss functions are constructed: (1) Trend-based loss ), through ReLU form and Apply monotonicity constraints to ensure that the model predictions conform to the monotonically increasing law of physical quantities within the reactor in the spatial direction; (2) PDE residual loss These correspond to the mass-conserving PDE residual loss and the energy-conserving PDE residual loss, respectively, and are used to constrain the dynamic evolution of concentration and temperature. (3) Boundary residual loss This ensures that the temperature at the reactor outlet meets the Neumann condition, improving the physical consistency of the model at the spatial boundary.
[0036] Combining the above physical constraints and prior information, the total loss function is established as follows: (17); Furthermore, by optimizing the network parameters through backpropagation, an efficient solution to the reaction-heat transfer coupled partial differential equations can be achieved.
[0037] Based on the total loss function shown in Equation (17), in order to further improve the physical consistency of the solution results and enhance the numerical stability of the training process, this embodiment makes the following supplementary explanations on the constraint application method, trend penalty weight selection, and stabilization / regularization strategy.
[0038] (1) Application of hard constraints: Most physical constraints are implemented in the form of soft constraints through the loss term in equation (17); however, for the inlet boundary conditions, in order to avoid the propagation of boundary errors into the domain and improve the definiteness of the solution, this embodiment preferably adopts the hard constraint method of "structural embedding", which directly writes the boundary conditions into the network output expression. (Using ammonia mass fraction) For example, based on the spatial coordinate normalization interval used in this embodiment... The network output is constructed as follows: (18); in, Given the ammonia mass fraction at the inlet. This is the raw output of the neural network. Since z=0 at the entry point, regardless of changes in the network parameters, we always have... This ensures that the mathematical structure strictly satisfies the entry boundary conditions. Temperature The entrance Dirichlet boundary is also constructed in the same way: For Neumann boundary conditions such as adiabatic outlet temperature, then through equation (17) Calculate the derivative residuals at the boundary sampling points and apply soft constraints.
[0039] (2) Selection of the weight of the trend penalty term: trend penalty term The weights are used to suppress non-physical oscillations in the solution and guide it to satisfy the axial physical trend. The value of needs to balance the correctness of the trend and the accuracy of the PDE solution: when If the value is too small, the trend constraint effect is insufficient, and local reverse changes may occur; when If the gradient is too large, it may cause excessive smoothing and weaken the local gradient characteristics caused by reaction-heat transfer coupling. This embodiment uses a method of "gradient magnitude balancing + small-range search" to determine the gradient magnitude. First, statistics are collected during the initial training phase. and , , The magnitude will Initialization is performed to ensure that the contributions of each element to the training update are of the same order of magnitude; subsequently, fine-tuning is performed on the validation set based on the criterion of "a significant decrease in the proportion of trend deviations and no significant rebound in PDE residuals." The preferred range is [0.1, 1]. , Generally, a baseline order of magnitude (such as 1.0) is used. To ensure the validity of the solution and prevent solution drift, a relatively high weight can be used.
[0040] (3) Numerical stabilization and regularization measures: In order to reduce the impact of different dimensions / scales on training and improve the stability of the automatic differential calculation of the second derivative residual, the following measures are adopted in this embodiment: ① Input normalization: normalize the time... t With space z Mapping to the dimensionless interval [0,1] weakens the impact of different dimensions and scales on gradient propagation, reducing the risk of gradient vanishing or gradient explosion during training; at the same time, it keeps the network input within the effective response range of the activation function, thereby improving the convergence characteristics of the initial training.
[0041] ② Smooth activation function: The hidden layers of the main network use high-order differentiable activation functions such as the hyperbolic tangent function (Tanh) to ensure the second-order spatial derivative term in the residual of the energy conservation equation ( It exhibits good continuity and differentiability within the automatic differentiation framework, thereby ensuring that the gradient can be stably backpropagated.
[0042] ③ Weight decay: To suppress excessive increase in network parameters and reduce the risk of overfitting, an L2 regularization term is introduced into the optimizer. The preferred weight decay coefficient is 10. -5 This measure, by penalizing the square norm of network weights, limits model complexity, thereby improving the numerical stability of the training process and the generalization ability under unobserved conditions.
[0043] Preferably, to verify the effectiveness and reproducibility of the TS-PINN method proposed in this invention, this embodiment constructs a computational model based on the deep learning framework PyTorch. The specific network architecture, hyperparameter settings, and training strategy are as follows: 1. Network structure configuration: The model adopts a fully connected neural network architecture.
[0044] Input and Output: The input layer contains 2 neurons, corresponding to the normalized time coordinates. t Axial spatial coordinates z (Normalized to the [0, 1] interval); the output layer contains 2 neurons, corresponding to the predicted ammonia mass fraction and gas temperature.
[0045] Hidden layers: There are 8 hidden layers, each containing 64 neurons.
[0046] Activation function: Except for the output layer, all hidden layers use the hyperbolic tangent function (Tanh) as the activation function. The Tanh function is infinitely differentiable, which guarantees the second spatial derivative in the reaction-heat transfer equation (…). Efficient computation and gradient backpropagation.
[0047] Initialization: The network weights are initialized using the Xavier uniform distribution.
[0048] 2. Optimizer and Training Strategy To balance convergence speed and solution accuracy, a two-stage optimization strategy is adopted during the training process: Phase 1 (Coarse Training): Using the Adam optimizer, the initial learning rate is set to 1×10⁻⁶. -3 This stage involves 10,000 iterations, primarily aimed at rapidly searching for the global minimum region in the solution space.
[0049] The second stage (fine-tuning): Switch to the L-BFGS optimizer, set the maximum number of iterations to 5,000, and enable the Strong Wolfe line search strategy. This stage utilizes second-derivative information for fine-tuning, which significantly reduces physical residuals and ensures that strict mass and energy conservation constraints are met.
[0050] 3. Collocation sampling and loss weights Number of points: Selected within the spatiotemporal domain N f = 2000 collocation points are used to calculate the PDE residuals; sampling is performed at the exit boundary. N out = 200 points are used to calculate the Neumann boundary residuals for temperature.
[0051] Loss weighting: Total loss function In this context, the weights of each part are set as follows: (Trend penalty weight): 0.1~1 (as a regularization term to guide physical trends); , (Mass and energy conservation weights): 1.0 (baseline weights); (Boundary residual weight): 2.0 (Assigns a higher weight to force anchoring of boundary conditions and prevent solution drift).
[0052] 4. Training Hardware Environment In this embodiment, model training and validation are performed on a personal computer.
[0053] The hardware configuration is as follows: Intel(R) Core(TM) i7-14700F processor (2.10 GHz); NVIDIA GeForce RTX 4060 graphics card (8 GB VRAM); 16.0 GB of memory (approximately 5600 MT / s); approximately 954 GB of storage space; and a 64-bit operating system based on an x64 processor.
[0054] The software environment consisted of: PyTorch 2.5.1 deep learning framework; CUDA version 11.8, supporting GPU acceleration (cuda available=True); and cuDNN version 90100. Under this environment, the model converged within an acceptable timeframe.
[0055] Example 2 This embodiment verifies and supplements the TS-PINN model obtained by the dimensionality reduction modeling method for the ammonia synthesis reaction-heat transfer coupling process, using specific applications and data, as follows: To verify the performance of the constructed TS-PINN model, this embodiment compares it with standard response surface methodology (RSM) and artificial neural networks (ANN). Experimental data are derived from steady-state process simulations on the Aspen HYSYS platform. First, based on the system parameters of the ammonia synthesis reactor (see Table 1), a TS-PINN model incorporating a reaction-heat transfer coupling mechanism is constructed, and key conditions such as reaction kinetics, heat transfer coefficients, and physical property parameters are set in the model. Subsequently, multiple sets of perturbation inputs are applied to operating variables such as feed flow rate and reaction temperature within the feasible operating range. The steady-state output results under each operating condition, including ammonia concentration distribution and gas temperature distribution, are calculated using the Aspen HYSYS solver. This process generates a total of 2000 sets of sample data, with the first 1200 sets used for model training and the last 800 sets used for model testing and performance verification.
[0056] Table 1 Figure 3 The comparison of prediction results of three models, RSM, ANN and TS-PINN, in the ammonia synthesis reaction-heat transfer system is presented, where (a)–(c) are ammonia concentration distributions and (d)–(f) are gas temperature distributions.
[0057] Table 2 quantitatively compares the prediction errors of the RSM, ANN, and TS-PINN models. The left graph corresponds to the ammonia concentration prediction results, and the right graph corresponds to the gas temperature prediction results. Both radar charts are drawn based on test set data, and the mean square error (MSE), root mean square error (RMSE), mean absolute error (MAE), mean absolute percentage error (MAPE), and coefficient of determination (R²) are selected. 2 Typical indicators such as these are used to comprehensively evaluate the overall accuracy and stability of the model.
[0058] Table 2 Overall, as the modeling approach shifts from empirical fitting to physical constraint-driven methods, the model prediction accuracy significantly improves. TS-PINN demonstrates the best consistency and stability in predicting both types of variables. The prediction results for ammonia concentration and reactant gas temperature show significant differences in performance among different models when characterizing complex nonlinear reaction systems. RSM models generally suffer from underfitting, and the test set coefficient of determination (R²) for concentration and temperature predictions is low. 2The MSE and RMSE were only 0.7614 and 0.6655 respectively, with the MSE and RMSE at the highest levels, and the MAPE at 7.30% and 1.70% respectively, indicating that the model could not accurately reflect the nonlinear characteristics of the reaction-heat transfer coupling. The overall accuracy of the ANN model was significantly improved compared to RSM, with the RSE for concentration and temperature predictions being significantly higher. 2 The MSE and RMSE were increased to 0.8965 and 0.8790 respectively, and the MAPE decreased by about 50%, while the MSE and RMSE decreased to 3.40% and 0.90% respectively. However, systematic deviations still exist in the medium concentration and local temperature regions.
[0059] In comparison, the TS-PINN model outperformed all other models, achieving coefficients of determination of 0.9804 and 0.9687 for concentration and temperature predictions, respectively. The predicted points were almost entirely distributed near the diagonal, demonstrating a high degree of consistency with experimental values. Its mean absolute percentage error (MAPE) was 1.51% for concentration prediction and 0.47% for temperature prediction, representing reductions of 79.3% and 72.1% compared to RSM, and 55.4% and 47.4% compared to ANN, respectively. Overall, TS-PINN effectively integrates physical constraints and data characteristics, achieving high-precision and strong generalization prediction performance in complex reaction-heat transfer coupled systems, showcasing significant model advantages.
[0060] Figure 4 The convergence curves of the loss functions of four models—standard PINN, T-PINN, S-PINN, and TS-PINN—are shown during the training process. It can be seen that the loss of all three models gradually decreases with increasing iterations, but their convergence rates and stability differ significantly.
[0061] The standard PINN model exhibits slow convergence and significant fluctuations in its loss curve, reflecting limited training stability and efficiency under complex reaction-heat transfer coupling equations. T-PINN, by introducing an axial monotonic trend constraint into the loss function, aligns the network optimization direction with the physical evolution, effectively suppressing gradient oscillations and accelerating the convergence process. S-PINN explicitly embeds the mechanistic expression of the reaction rate during the forward propagation stage, avoiding repeated learning of known physical relationships and significantly improving the model's training efficiency and numerical stability. The TS-PINN model, integrating both types of prior information, achieves rapid descent in the early iteration stages and maintains the lowest loss and most stable convergence trend in the later stages, demonstrating the synergistic advantages of trend and structural constraints and providing an optimal balance between physical consistency and computational efficiency.
[0062] Example 3 Based on the same inventive concept, this application also provides a dimensionality reduction modeling device for the ammonia synthesis reaction-heat transfer coupling process, which can be used to implement the method described in the above embodiments, as shown in the following embodiments. Since the principle of the dimensionality reduction modeling device for the ammonia synthesis reaction-heat transfer coupling process is similar to that of the dimensionality reduction modeling method for the ammonia synthesis reaction-heat transfer coupling process, the implementation of this device can refer to the aforementioned method implementation, and repeated details will not be elaborated further. As used below, the terms "unit" or "module" can refer to a combination of software and / or hardware that performs a predetermined function. Although the system described in the following embodiments is preferably implemented in software, hardware implementation, or a combination of software and hardware, is also possible and contemplated.
[0063] The embodiments of the present invention provide a specific implementation of a modeling apparatus capable of implementing a dimensionality reduction modeling method for ammonia synthesis reaction-heat transfer coupled processes, specifically including the following: The forward prediction unit is used to construct a forward-propagating fully connected neural network with time coordinate t and axial spatial coordinate z as inputs, which is used to predict the ammonia mass fraction and gas temperature at any time and space point in the reactor. The structural prior unit is used to explicitly embed the mechanism expression of the ammonia synthesis reaction rate as a structural prior during the forward propagation of the fully connected neural network, so that the fully connected neural network can directly call the mechanism expression of the reaction rate during prediction. The loss unit is used to calculate the spatiotemporal derivatives of ammonia mass fraction and gas temperature by automatic differentiation based on the output of a fully connected neural network, and constructs the following physical constraint loss terms: trend penalty term loss, mass conservation PDE residual loss, energy conservation PDE residual loss, and boundary residual loss. The trend penalty term loss is used to constrain the monotonically increasing trend of ammonia mass fraction and temperature along the bed axis, and only generates a penalty when the spatial derivative is negative. The optimization calculation unit is used to weight each physical constraint loss term according to a preset weight to form a total loss function, and optimize the network parameters through backpropagation to achieve dimensionality reduction solution and rapid prediction of the reaction-heat transfer coupled partial differential equation.
[0064] Preferably, embodiments of this application also provide a specific implementation of an electronic device capable of implementing all steps in the dimensionality reduction modeling method for the ammonia synthesis reaction-heat transfer coupling process described in the above embodiments. The electronic device specifically includes the following: Processor, memory, communications interface, and bus; The processor, memory, and communication interface communicate with each other via a bus; the communication interface is used to realize information transmission between server-side devices, metering devices, and user-side devices.
[0065] The processor is used to call the computer program in memory. When the processor executes the computer program, it implements all the steps in the dimensionality reduction modeling method for the ammonia synthesis reaction-heat transfer coupling process in the above embodiments.
[0066] Embodiments of this application also provide a computer-readable storage medium capable of implementing all steps of the dimensionality reduction modeling method for the ammonia synthesis reaction-heat transfer coupling process described in the above embodiments. The computer-readable storage medium stores a computer program that, when executed by a processor, implements all steps of the dimensionality reduction modeling method for the ammonia synthesis reaction-heat transfer coupling process described in the above embodiments.
[0067] The various embodiments in this specification are described in a progressive manner. Similar or identical parts between embodiments can be referred to interchangeably. Each embodiment focuses on its differences from other embodiments. In particular, hardware + program embodiments are relatively simple in description because they are fundamentally similar to method embodiments; relevant parts can be referred to the descriptions in the method embodiments.
[0068] While this application provides method operation steps as shown in the embodiments or flowcharts, more or fewer operation steps may be included based on conventional or non-inventive labor. The order of steps listed in the embodiments is merely one possible execution order among many and does not represent the only execution order. In actual device or client product execution, the method can be executed in the order shown in the embodiments or drawings or in parallel (e.g., in a parallel processor or multi-threaded processing environment).
[0069] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0070] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0071] This invention is not limited to the embodiments described above. The above description of specific embodiments is intended to illustrate and explain the technical solutions of this invention. The specific embodiments described above are merely illustrative and not restrictive. Without departing from the spirit and scope of the claims, those skilled in the art can make many specific modifications based on the teachings of this invention, and these modifications all fall within the scope of protection of this invention.
Claims
1. A dimensionality reduction modeling method for ammonia synthesis reaction-heat transfer coupled processes, characterized in that, include: S1. Using time coordinate t and axial spatial coordinate z as input, a forward-propagating fully connected neural network is constructed to predict the ammonia mass fraction and gas temperature at any time and space point in the reactor. S2. During the forward propagation of the fully connected neural network, the mechanism expression of the ammonia synthesis reaction rate is explicitly embedded as a structural prior, so that the fully connected neural network can directly call the mechanism expression of the reaction rate when making predictions. S3. Based on the output of a fully connected neural network, the spatiotemporal derivatives of the mass fraction of ammonia with gas temperature are calculated by automatic differentiation, and the following physical constraint loss terms are constructed: trend penalty term loss, mass conservation PDE residual loss, energy conservation PDE residual loss, and boundary residual loss. The trend-based penalty term loss is used to constrain the monotonically increasing trend of ammonia mass fraction and temperature along the bed axis, and the penalty is only applied when the spatial derivative is negative. S4. The physical constraint loss terms in step S3 are weighted according to preset weights to form a total loss function, and the network parameters are optimized through backpropagation to achieve dimensionality reduction and rapid prediction of the reaction-heat transfer coupled partial differential equation.
2. The dimensionality reduction modeling method for the coupled reaction-heat transfer process of ammonia synthesis according to claim 1, characterized in that, The reaction equation for ammonia synthesis is as follows: ; Partial differential equations are used to describe the changes in two parameters: ammonia mass fraction and temperature. ; ; In the formula, This represents the mass fraction of ammonia, where T is the temperature. For the reaction rate, Let be the specific heat capacity of the gas. The specific heat capacity of the catalyst. The heat of reaction, The dispersion coefficient is... The propagation speed of the temperature wave; The kinetic equation for the ammonia synthesis reaction is expressed as: ; ; ; In the formula, As a corrective factor, , The packing density of the catalyst, , , These are the partial pressures of hydrogen, nitrogen, and ammonia, respectively, expressed in bar. The gas constant is... This represents the 1.5th power of the hydrogen partial pressure; this fractional series originates from the microscopic reaction mechanism of ammonia on the surface of the iron catalyst and reflects the nonlinear contribution weight of hydrogen concentration to the forward and reverse reaction rates. and These are the rate factors for the forward and reverse reactions, respectively; the partial pressures of the gas inside the reactor are expressed as follows: ; ; In the formula, The molar flow rate of nitrogen at the inlet of each bed reactor. The molar flow rate of nitrogen at a certain location inside the reactor. , , These are the partial pressures of nitrogen, ammonia, and hydrogen, respectively. In an ammonia synthesis system, the corresponding control residual is defined as: ; and These represent the residual terms of the mass conservation and energy conservation equations, respectively. By embedding the mechanism expression of the reaction rate into the network forward propagation process, this analytical form can be directly called during residual calculation.
3. The dimensionality reduction modeling method for the coupled reaction-heat transfer process of ammonia synthesis according to claim 1, characterized in that, The trend-based penalty loss is expressed as a ReLU penalty applied to the negative part of the spatial derivative, i.e., only when... (c) / x<0 or (T) / A positive penalty is applied when x < 0.
4. The dimensionality reduction modeling method for the coupled reaction-heat transfer process of ammonia synthesis according to claim 1, characterized in that, The concentration equation employs a hard constraint at the inlet to ensure that the inlet boundary conditions are strictly satisfied, while the temperature equation employs a Neumann adiabatic boundary at the outlet, i.e., a boundary residual constraint where the outlet heat flux is zero.
5. The dimensionality reduction modeling method for the ammonia synthesis reaction-heat transfer coupling process according to claim 2, characterized in that, Under constant inlet conditions, the steady-state profile within the reactor satisfies: ; A trend-based penalty loss is introduced, defined as follows: ; In the formula, This indicates the number of sampling points within the catalyst bed used for training. Represents the coordinates of the i-th collocation point in the space-time domain. A penalty term is generated only when the derivative is negative to eliminate inverse variations in the output of a fully connected neural network that do not conform to monotonicity; mass-conserving PDE residual loss. Energy conservation PDE residual loss They are respectively ; ; In the formula, and These represent the residual terms of the mass conservation equation and the energy conservation equation, respectively. The entrance uses a known temperature The outlet is set in Neumann form based on the adiabatic boundary conditions, that is: ; The corresponding boundary residual loss is defined as: ; In the formula, This represents the number of sampling points at the export boundary; Total loss function for: ; w1-w4 are the weights of each loss term. During training, the weights are adaptively or manually adjusted to balance physical consistency and fitting accuracy.
6. A dimension-reduction modeling device for ammonia synthesis reaction-heat transfer coupled process, characterized in that, include: The forward prediction unit is used to construct a forward-propagating fully connected neural network with time coordinate t and axial spatial coordinate z as inputs, which is used to predict the ammonia mass fraction and gas temperature at any time and space point in the reactor. The structural prior unit is used to explicitly embed the mechanism expression of the ammonia synthesis reaction rate as a structural prior during the forward propagation of the fully connected neural network, so that the fully connected neural network can directly call the mechanism expression of the reaction rate during prediction. The loss unit is used to calculate the spatiotemporal derivatives of the mass fraction of ammonia with respect to gas temperature by automatic differentiation based on the output of a fully connected neural network, and to construct the following physical constraint loss terms: trend penalty term loss, mass conservation PDE residual loss, energy conservation PDE residual loss, and boundary residual loss. The trend-based penalty term loss is used to constrain the monotonically increasing trend of ammonia mass fraction and temperature along the bed axis, and the penalty is only applied when the spatial derivative is negative. The optimization calculation unit is used to weight each physical constraint loss term in step S3 according to a preset weight to form a total loss function, and optimize the network parameters through backpropagation to achieve dimensionality reduction solution and rapid prediction of the reaction-heat transfer coupled partial differential equation.
7. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the steps of the dimensionality reduction modeling method for the ammonia synthesis reaction-heat transfer coupling process as described in any one of claims 1 to 5.
8. A computer-readable storage medium having a computer program stored thereon, characterized in that, When executed by a processor, the computer program implements the steps of the dimensionality reduction modeling method for the ammonia synthesis reaction-heat transfer coupled process as described in any one of claims 1 to 5.