Method and modeling device for modeling chemical reaction flow problems
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-07-14
- Publication Date
- 2026-08-11
AI Technical Summary
[0004]本申请提供一种化学反应流动问题的建模方法及建模装置,以解决相关技术中,化学反应体系兼具强刚性与多尺度特征,主组分与自由基/微量组分的浓度、梯度量级悬殊,统一残差与固定损失易使局部高残差主导优化,难以兼顾全域守恒与局部反应特征;不同物理约束梯度幅值各异,固定权重诱发梯度失衡,造成模型训练不稳、场重构与参数反演精度偏低,方案通用性较差等问题
[0020] This application embodiment can utilize the extracted coordinate information of the chemical reaction flow problem, output the state field using a neural network, and then determine the residuals of the control equations and the observation data, thereby determining the first and second loss functions of the neural network. This leads to the training strategy and training loss function of the neural network, which is then trained until preset training conditions are met. The trained neural network then outputs the distribution of field variables, the distribution of physical constraint residuals, the model parameter estimation results, and the model evaluation results for the chemical reaction flow problem. By fitting the chemical reaction flow state field with a neural network, splitting the two types of loss functions and training them in stages, the accuracy of field variable fitting can be ensured by utilizing observation data, while also adhering to physical laws through the constraints of the control equations. This simultaneously achieves the solution of the flow field distribution, residual analysis, and parameter inversion, improving the reliability and completeness of the solution. This addresses several issues in related technologies, including the fact that chemical reaction systems possess both strong rigidity and multi-scale characteristics; the concentrations and gradient magnitudes of the main components and free radicals/trace components differ significantly; the use of unified residuals and fixed losses can easily lead to local high residuals dominating optimization, making it difficult to balance global conservation with local reaction characteristics; different physical constraints result in varying gradient magnitudes, and fixed weights induce gradient imbalances, leading to unstable model training, low accuracy in field reconstruction and parameter inversion, and poor versatility of the proposed solutions.
Smart Images

Figure CN122551932A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of machine learning technology, and in particular to a modeling method and apparatus for chemical reaction flow problems. Background Technology
[0002] In related technologies, chemical reaction flow couples multiple physical processes such as chemical reaction, heat transfer, mass transfer, diffusion and momentum transport. The reaction rate is characterized by the Arrhenius equation and the law of mass action. The physical information neural network constructs a loss function by fusing observation data, control equations and boundary conditions, and realizes flow field reconstruction and parameter inversion for specific examples such as zero-dimensional self-ignition and one-dimensional laminar flame.
[0003] However, in related technologies, chemical reaction systems have both strong rigidity and multi-scale characteristics. The concentrations and gradient magnitudes of the main components and free radicals / trace components are vastly different. Unifying the residuals and fixing the loss can easily lead to local high residuals dominating the optimization, making it difficult to take into account both global conservation and local reaction characteristics. Different physical constraints have different gradient magnitudes, and fixed weights induce gradient imbalance, resulting in unstable model training, low accuracy of field reconstruction and parameter inversion, and poor versatility of the scheme, which urgently needs improvement. Summary of the Invention
[0004] This application provides a modeling method and apparatus for chemical reaction flow problems to address issues in related technologies, such as the strong rigidity and multi-scale characteristics of chemical reaction systems, the significant differences in concentration and gradient magnitude between the main component and free radical / trace components, the tendency for unified residuals and fixed losses to lead to local high residuals dominating optimization, making it difficult to balance global conservation with local reaction characteristics, the varying gradient magnitudes of different physical constraints, and the gradient imbalance induced by fixed weights, resulting in unstable model training, low accuracy of field reconstruction and parameter inversion, and poor versatility of the proposed solution.
[0005] The first aspect of this application provides a modeling method for chemical reaction flow problems, comprising the following steps: extracting coordinate information of the chemical reaction flow problem and inputting the coordinate information into a pre-constructed neural network to output a state field, wherein the neural network is constructed by a differentiable function approximator; determining the control equation residuals and observation data residuals based on the state field, and determining a first loss function and a second loss function of the neural network based on the control equation residuals and the observation data residuals, wherein the first loss function is constructed from the observation data residuals and the second loss function is constructed from the control equation residuals; determining a training strategy and a training loss function of the neural network based on the first loss function and the second loss function, and training the neural network according to the training strategy and the training loss function until preset training conditions are met to obtain a trained neural network, and outputting the field variable distribution, physical constraint residual distribution, model parameter estimation results, and model evaluation results of the chemical reaction flow problem based on the trained neural network.
[0006] Optionally, in one embodiment of this application, determining the governing equation residuals and observation data residuals based on the state field includes: determining the physical semantics of the chemical reaction flow problem; based on the physical semantics, dividing the variables in the state field into a first set of component variables and a second set of component variables, wherein the spatiotemporal gradient of the second set of component variables is greater than the spatiotemporal gradient of the first set of component variables; dividing the first set of component variables into a first governing equation residual and a first observation data residual, and dividing the second set of component variables into a second governing equation residual and a second observation data residual; obtaining the governing equation residuals based on the first and second governing equation residuals, and obtaining the observation data residuals based on the first and second observation data residuals.
[0007] Optionally, in one embodiment of this application, determining the first loss function and the second loss function of the neural network based on the control equation residuals and the observation data residuals includes: determining a first transformation strategy applicable to the first control equation residuals and the first observation data residuals based on the first set of component variables; determining a second transformation strategy applicable to the second control equation residuals and the second observation data residuals based on the second set of component variables; determining the first loss function based on the first observation data residuals under the first transformation strategy and the second observation data residuals under the second transformation strategy; and determining the second loss function based on the first control equation residuals under the first transformation strategy and the second control equation residuals under the second transformation strategy.
[0008] Optionally, in one embodiment of this application, training the neural network according to the training strategy and the training loss function includes: determining the training stage of the neural network based on the training strategy; selecting the training loss function from the first loss function and the second loss function based on the training stage; and training the neural network based on the training loss function.
[0009] Optionally, in one embodiment of this application, training the neural network according to the training strategy and the training loss function includes: calculating the gradient information of each loss term in the training loss function with respect to the shared network parameters; determining the weight coefficients corresponding to each loss term based on the gradient information; and training the neural network based on the weight coefficients, the training strategy, and the training loss function.
[0010] Optionally, in one embodiment of this application, before inputting the coordinate information into a pre-constructed neural network, the method further includes: if the coordinate information does not meet the preset coordinate conditions, generating a processing instruction for the coordinate information based on the preset coordinate conditions, and processing the coordinate information according to the processing instruction to obtain processed coordinate information that meets the preset coordinate conditions.
[0011] A second aspect of this application provides a modeling apparatus for chemical reaction flow problems, comprising: a first output module for extracting coordinate information of the chemical reaction flow problem and inputting the coordinate information into a pre-constructed neural network to output a state field, wherein the neural network is constructed by a differentiable function approximator; a determination module for determining the control equation residuals and observation data residuals based on the state field, and determining a first loss function and a second loss function of the neural network based on the control equation residuals and the observation data residuals, wherein the first loss function is constructed from the observation data residuals and the second loss function is constructed from the control equation residuals; and a second output module for determining a training strategy and a training loss function of the neural network based on the first loss function and the second loss function, training the neural network according to the training strategy and the training loss function until preset training conditions are met to obtain a trained neural network, and outputting the field variable distribution, physical constraint residual distribution, model parameter estimation results, and model evaluation results of the chemical reaction flow problem based on the trained neural network.
[0012] Optionally, in one embodiment of this application, the determining module includes: a first determining unit, configured to determine the physical semantics of the chemical reaction flow problem; a first partitioning unit, configured to partition the variables in the state field into a first component variable group and a second component variable group based on the physical semantics, wherein the spatiotemporal gradient of the second component variable group is greater than the spatiotemporal gradient of the first component variable group; a second partitioning unit, configured to partition the first component variable group into a first governing equation residual and a first observation data residual, and the second component variable group into a second governing equation residual and a second observation data residual; and a generating unit, configured to obtain the governing equation residual based on the first governing equation residual and the second governing equation residual, and obtain the observation data residual based on the first observation data residual and the second observation data residual.
[0013] Optionally, in one embodiment of this application, the determining module includes: a second determining unit, configured to determine a first transformation strategy applicable to the residuals of the first governing equation and the residuals of the first observation data based on the first set of component variables; a third determining unit, configured to determine a second transformation strategy applicable to the residuals of the second governing equation and the residuals of the second observation data based on the second set of component variables; a fourth determining unit, configured to determine a first loss function based on the first observation data residuals under the first transformation strategy and the second observation data residuals under the second transformation strategy; and a fifth determining unit, configured to determine a second loss function based on the first governing equation residuals under the first transformation strategy and the second governing equation residuals under the second transformation strategy.
[0014] Optionally, in one embodiment of this application, the second output module includes: a sixth determining unit, configured to determine the training stage of the neural network based on the training strategy; a selecting unit, configured to select the training loss function from the first loss function and the second loss function based on the training stage; and a first training unit, configured to train the neural network based on the training loss function.
[0015] Optionally, in one embodiment of this application, the second output module includes: a calculation unit, configured to calculate the gradient information of each loss term in the training loss function with respect to the shared network parameters; a seventh determination unit, configured to determine the weight coefficients corresponding to each loss term based on the gradient information; and a second training unit, configured to train the neural network based on the weight coefficients, the training strategy, and the training loss function.
[0016] Optionally, in one embodiment of this application, it further includes: a processing module, configured to, before inputting the coordinate information into a pre-constructed neural network, if the coordinate information does not meet the preset coordinate conditions, generate a processing instruction for the coordinate information based on the preset coordinate conditions, and process the coordinate information according to the processing instruction to obtain processed coordinate information that meets the preset coordinate conditions.
[0017] A third aspect of this application 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 program to implement a modeling method for chemical reaction flow problems as described in the above embodiments.
[0018] A fourth aspect of this application provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the above-described modeling method for chemical reaction flow problems.
[0019] A fifth aspect of this application provides a computer program product, including a computer program that, when executed, implements the modeling method for the chemical reaction flow problem described above.
[0020] This application embodiment can utilize the extracted coordinate information of the chemical reaction flow problem, output the state field using a neural network, and then determine the residuals of the control equations and the observation data, thereby determining the first and second loss functions of the neural network. This leads to the training strategy and training loss function of the neural network, which is then trained until preset training conditions are met. The trained neural network then outputs the distribution of field variables, the distribution of physical constraint residuals, the model parameter estimation results, and the model evaluation results for the chemical reaction flow problem. By fitting the chemical reaction flow state field with a neural network, splitting the two types of loss functions and training them in stages, the accuracy of field variable fitting can be ensured by utilizing observation data, while also adhering to physical laws through the constraints of the control equations. This simultaneously achieves the solution of the flow field distribution, residual analysis, and parameter inversion, improving the reliability and completeness of the solution. This addresses several issues in related technologies, including the fact that chemical reaction systems possess both strong rigidity and multi-scale characteristics; the concentrations and gradient magnitudes of the main components and free radicals / trace components differ significantly; the use of unified residuals and fixed losses can easily lead to local high residuals dominating optimization, making it difficult to balance global conservation with local reaction characteristics; different physical constraints result in varying gradient magnitudes, and fixed weights induce gradient imbalances, leading to unstable model training, low accuracy in field reconstruction and parameter inversion, and poor versatility of the proposed solutions.
[0021] Additional aspects and advantages of this application will be set forth in part in the description which follows, and in part will be obvious from the description, or may be learned by practice of this application. Attached Figure Description
[0022] The above and / or additional aspects and advantages of this application will become apparent and readily understood from the following description of the embodiments taken in conjunction with the accompanying drawings, wherein: Figure 1 This is a flowchart of a modeling method for chemical reaction flow problems provided according to an embodiment of this application; Figure 2 This is a general flowchart of a modeling method for chemical reaction flow problems according to an embodiment of this application; Figure 3 This is a schematic diagram of the training history of activation energy inference values under a linear transformation residual strategy according to an embodiment of this application; Figure 4 This is a schematic diagram of the training history of activation energy inference values under a composite residual strategy according to an embodiment of this application; Figure 5 This is a schematic diagram of the training history of pressure gradient inference values under a composite residual strategy according to an embodiment of this application; Figure 6 This is a schematic diagram of the training history of pressure gradient feature value inversion under a fixed loss weight strategy according to an embodiment of this application; Figure 7 This is a schematic diagram of the training history of pressure gradient feature value inversion under an adaptive loss weight strategy according to an embodiment of this application; Figure 8 This is a schematic diagram of the training history of the inversion value of the pressure gradient feature value under a fixed loss weight strategy according to another embodiment of this application; Figure 9 This is a schematic diagram of the training history of pressure gradient feature value inversion under an adaptive loss weight strategy according to another embodiment of this application; Figure 10 This is a block diagram of a modeling apparatus for chemical reaction flow problems provided according to an embodiment of this application; Figure 11 This is a schematic diagram of the structure of an electronic device provided according to an embodiment of this application. Detailed Implementation
[0023] The embodiments of this application are described in detail below. Examples of these embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals denote the same or similar elements or elements having the same or similar functions throughout. The embodiments described below with reference to the accompanying drawings are exemplary and intended to explain this application, and should not be construed as limiting this application.
[0024] The following describes a modeling method and apparatus for chemical reaction flow problems according to embodiments of this application, with reference to the accompanying drawings. Addressing the issues mentioned in the background art, such as the strong rigidity and multi-scale characteristics of chemical reaction systems, the significant differences in concentration and gradient magnitude between the main component and free radical / trace components, the tendency for unified residuals and fixed losses to lead to local high residuals dominating optimization, making it difficult to balance global conservation with local reaction characteristics; and the varying gradient magnitudes of different physical constraints, with fixed weights inducing gradient imbalances, resulting in unstable model training, low accuracy in field reconstruction and parameter inversion, and poor versatility of the proposed solutions, this application provides a modeling method for chemical reaction flow problems. In this method, based on the extracted coordinate information of the chemical reaction flow problem, a neural network outputs the state field, thereby determining the residuals of the governing equations and the observed data. Based on the residuals, the first and second loss functions of the neural network are determined, leading to the training strategy and training loss function. The neural network is trained until the preset training conditions are met, resulting in a trained neural network that outputs the distribution of field variables, the distribution of physical constraint residuals, the model parameter estimation results, and the model evaluation results for the chemical reaction flow problem. By fitting the chemical reaction flow state field with the neural network, splitting the two types of loss functions and training them in stages, the accuracy of field variable fitting can be ensured by utilizing observational data, while also adhering to physical laws through the constraints of the control equations. Simultaneously, the flow field distribution solution, residual analysis, and parameter inversion are achieved, improving the reliability and completeness of the solution. This solves the problems in related technologies, such as the chemical reaction system having both strong rigidity and multi-scale characteristics, significant differences in the concentration and gradient magnitudes of the main component and free radical / trace components, the tendency for unified residuals and fixed losses to lead to local high residuals dominating optimization, making it difficult to balance global conservation with local reaction characteristics; and the varying gradient magnitudes of different physical constraints, with fixed weights inducing gradient imbalance, resulting in unstable model training, low accuracy in field reconstruction and parameter inversion, and poor versatility of the solution.
[0025] Specifically, Figure 1 This is a flowchart of a modeling method for chemical reaction flow problems provided according to an embodiment of this application.
[0026] like Figure 1 As shown, the modeling method for this chemical reaction flow problem includes the following steps: In step S101, coordinate information of the chemical reaction flow problem is extracted and input into a pre-constructed neural network to output the state field. The neural network is constructed by a differentiable function approximator.
[0027] It is understood that, in the embodiments of this application, the differentiable function approximator may include, but is not limited to, multilayer perceptrons, residual networks, Fourier feature networks, or neural operators, etc., and this application does not impose specific limitations; while the state field may include, but is not limited to, velocity fields, temperature fields, and mass fraction fields of each component, etc., and this application does not impose specific limitations.
[0028] In some embodiments, the present application can extract coordinate information of chemical reaction flow problems, such as time coordinates, spatial coordinates or spatiotemporal coordinates, and input the coordinate information into a pre-established neural network so as to use the neural network to output the corresponding state field.
[0029] Among them, neural networks can treat the chemical reaction flow problem as a complex, differentiable "function". That is, neural networks are regarded as a function approximator for the chemical reaction flow problem, and are a carrier connecting the governing equations, reaction mechanisms, observation data and variables to be inferred.
[0030] For example, the neural network in this embodiment takes a multilayer perceptron as an example. The number of hidden layers in the multilayer perceptron can be set to 4-8 layers, the number of neurons in each layer can be set to 64-256, and the activation function can be... This application does not impose specific limitations on the combination of the two.
[0031] Furthermore, in the embodiments of this application, for different chemical reaction flow problems, only one coordinate system may be used, or both may be used together. Therefore, the time coordinate system can be... and spatial coordinates First, normalization is performed to obtain the normalized time coordinates. and normalized spatial coordinates The normalized time coordinates and normalized spatial coordinates are used as inputs to the multilayer perceptron. The multilayer perceptron outputs intermediate variables such as temperature, velocity, radial expansion rate of the flow field, pressure, or mass fraction of each component to obtain the corresponding state field.
[0032] It should be noted that, since the input to the neural network in this embodiment is normalized coordinates, the predicted value of the intermediate variable output by the neural network is not the actual physical quantity. Therefore, physical decoding needs to be performed on the predicted value of the intermediate variable to restore the actual physical quantity. For example, bounded mapping is used for bounded variables such as temperature; non-negative normalized mapping is used for component mass fraction; and scale reduction or physical boundary mapping is used for other variables such as velocity and pressure. This suppresses the generation of non-physical solutions at the network structure level and reduces the invalid solution space required by the loss function.
[0033] The physical decoding process of temperature can be understood as limiting the temperature within a preset physical range. The preset physical range can be set by those skilled in the art according to the actual situation, and this application does not impose any specific restrictions.
[0034] Furthermore, in the embodiments of this application, the physical decoding process of temperature can be, but is not limited to, represented as: , in, This represents the temperature output by the neural network. This indicates the temperature after physical decoding.
[0035] The physical decoding process of speed can be represented, but is not limited to, as: , in, This represents the velocity in a certain direction of the neural network output. This represents the velocity in a certain direction after physical decoding.
[0036] The physical decoding process of the radial expansion coefficient of the flow field can be, but is not limited to, expressed as: , in, This represents the radial scaling factor of the flow field output by the neural network. This represents the radial stretching ratio of the flow field after physical decoding.
[0037] The physical decoding process of the mass fraction of each component can be understood as applying a non-negative mapping to the mass fraction of the components (such as...). After activating the function (this application does not impose specific restrictions), normalization is performed to ensure that the mass fractions of each component are non-negative and their sum is 1.
[0038] Furthermore, embodiments of this application use... Taking the activation function as an example, the physical decoding process of the mass fraction of each component can be represented, but is not limited to, as follows: , in, The first term represents the output of the neural network. Mass fraction of the components Represents the 1st physical decoding result The mass fraction of each component.
[0039] For example, in combination Figure 2 As shown, embodiments of this application can be expressed using a time coordinate system. and spatial coordinates The input is normalized to obtain the normalized time coordinates. and normalized spatial coordinates The normalized time and space coordinates are then input into a multilayer perceptron, which outputs predicted values for intermediate variables such as temperature, velocity, radial expansion coefficient of the flow field, and component mass fraction. , , and Then, through physical decoding, the predicted values are mapped to real physical quantities that satisfy basic physical constraints, such as... , , , This leads to the corresponding state field.
[0040] Optionally, in one embodiment of this application, before inputting the coordinate information into the pre-built neural network, the method further includes: if the coordinate information does not meet the preset coordinate conditions, generating a processing instruction for the coordinate information based on the preset coordinate conditions, and processing the coordinate information according to the processing instruction to obtain processed coordinate information that meets the preset coordinate conditions.
[0041] In some embodiments, before inputting coordinate information into the neural network, this application can first detect whether the coordinate information meets preset coordinate conditions. If not, a processing instruction for the coordinate information is generated based on the preset coordinate conditions, and the coordinate information is processed according to the processing instruction until processed coordinate information that meets the preset coordinate conditions is obtained. The preset coordinate conditions can be set by those skilled in the art according to actual conditions, and this application does not impose specific limitations.
[0042] For example, embodiments of this application can be implemented when the coordinate information is not within a preset numerical range, such as... , Normalization is performed; if the coordinate information does not meet the preset sorting conditions, such as sorting by time, correction processing is performed; if the coordinate information does not meet the preset data format conditions, correction processing is performed according to the target format. This application does not impose specific restrictions.
[0043] In step S102, the residuals of the control equations and the residuals of the observation data are determined according to the state field, and the first loss function and the second loss function of the neural network are determined based on the residuals of the control equations and the residuals of the observation data. The first loss function is constructed from the residuals of the observation data, and the second loss function is constructed from the residuals of the control equations.
[0044] It is understood that in the embodiments of this application, the residual represents the deviation, and the loss represents the training target after squaring, summing, or weighting the deviation. Further, in the embodiments of this application, the governing equation is a collective term for the continuity equation, momentum conservation equation, energy conservation equation, and component transport equation. The residual of the governing equation is used to measure whether the output of the neural network satisfies the conservation of mass, momentum, energy, and component transport. Therefore, the residual of the governing equation may include, but is not limited to, the residual of the continuity equation. Residuals of the Momentum Conservation Equation Energy conservation equation residuals and component transport equation residuals Observation data residuals are used to measure whether the results of the neural network output are consistent with the measured observation data, and may include, but are not limited to, velocity observation residuals. Observation residuals of radial scaling factor of flow field Temperature observation residual wait.
[0045] In some embodiments, the residuals of the governing equations in this application can be calculated by substituting the state field into the governing equations and reaction source terms, and the residuals of the observed data can be obtained by comparing the state field with the measured observed data. Specifically, this application can transform the chemical reaction flow problem into a governing equation including a continuity equation, a momentum conservation equation, an energy conservation equation, and a component transport equation by performing a modeling step; analyze the chemical reaction mechanism of the chemical reaction flow problem and complete parameter calculations by performing a mechanistic analysis step, generating differentiable reaction source terms; and define the observed data such as temperature, velocity, pressure, and component mass fraction by performing a data definition step based on numerical simulation, experimental diagnosis, or engineering measurement results.
[0046] The modeling steps can be understood as transforming a specific chemical reaction flow problem into subsequently computable, differentiable, and trainable governing equations in this application's embodiments. Depending on the physical dimensions of the chemical reaction flow problem under study and the modeling objective, different governing equations are selected, such as energy conservation equations and component transport equations related to the reaction source term, as well as continuity equations, momentum conservation equations, and component transport equations in the reaction flow scenario. This application does not impose specific limitations. Specifically, the continuity equation describes mass conservation, meaning that fluid does not arise or disappear out of thin air within the computational domain; the momentum conservation equation describes the balance between velocity, pressure, or pressure gradient, and viscous transport; the component transport equation describes the changes in each chemical component under the combined effects of convection, diffusion, and chemical reaction generation / consumption; and the energy conservation equation describes the changes in temperature or enthalpy under the influence of heat conduction, diffusion transport, and reaction exothermics. For example, in zero-dimensional self-ignition, the unified mathematical description can be written as ordinary differential equations of temperature and mass fraction of each component with respect to time, the core of which is the energy conservation equation and the component transport equation; in one-dimensional counter-diffusion flame, the unified mathematical description can be written as the continuity equation, momentum conservation equation, energy conservation equation and component transport equation along spatial coordinates.
[0047] The mechanism analysis steps can be understood as follows: the embodiments of this application can transform the chemical reaction portion in a specific chemical reaction flow problem into reaction source terms in the governing equation. The generation and consumption rates in the component transport equation and the heat release in the energy conservation equation are both determined by the reaction mechanism. The more detailed the reaction mechanism, the more components, intermediates, free radicals, and elementary reactions it includes, and the more significant the rigidity and multi-scale characteristics of the reaction source terms are usually. For example, the embodiments of this application first read or construct a component list, elementary reaction formulas, thermodynamic parameters, transport parameters, and reaction rate expressions. Then, based on the law of mass action, Arrhenius relation, and thermodynamic closure relation, the net generation rate, heat release rate, specific heat capacity, enthalpy, diffusion coefficient, etc., of each component are calculated. Finally, the reaction source terms are constructed into a differentiable computational graph, which can be coupled with the temperature, component mass fraction, and other state variables output by the neural network.
[0048] The data definition step can be understood as follows: in the embodiments of this application, the known information and unknown targets in the chemical reaction flow problem are used to determine the measured observation data, including temperature, component mass fraction, velocity, pressure or other measurable variables, as well as the set of variables to be inferred in the control equation, through high-precision numerical solutions, experimental diagnosis or engineering measurement.
[0049] For example, in combination Figure 2 As shown, embodiments of this application can obtain the actual physical quantity after physical decoding of intermediate variables, such as... , , , After automatic differentiation, the residuals are input into the governing equations to form the governing equation residuals. These residuals are then compared with the measured observation data to form the observation data residuals. For problems involving unknown reaction kinetic parameters, the parameters to be inferred can be used as trainable variables along with the neural network parameters in the optimization process.
[0050] Furthermore, in some embodiments, the embodiments of this application can construct a first loss function through the residuals of the observed data and a second loss function through the residuals of the control equations, thereby determining the training loss function of the neural network.
[0051] Optionally, in one embodiment of this application, determining the residuals of the governing equations and the residuals of the observed data based on the state field includes: determining the physical semantics of the chemical reaction flow problem; based on the physical semantics, dividing the variables in the state field into a first set of variables and a second set of variables, wherein the spatiotemporal gradient of the second set of variables is greater than that of the first set of variables; dividing the first set of variables into the residuals of the first governing equation and the residuals of the first observed data, and dividing the second set of variables into the residuals of the second governing equation and the residuals of the second observed data; obtaining the residuals of the governing equations based on the residuals of the first and second governing equations, and obtaining the residuals of the observed data based on the residuals of the first and second observed data.
[0052] It is understood that, in the embodiments of this application, physical semantics can be understood as the physical role, scale characteristics, and training sensitivity of variables in chemical reaction flow.
[0053] Furthermore, in this embodiment, the variables in the state field can be divided into a first group of variables and a second group of variables based on the physical semantics of the chemical reaction flow problem. The first group of variables can be understood as the principal component group, and the second group of variables can be understood as the free radical / trace component group. It should be noted that the grouping rules can be adjusted according to the reaction system and the object of observation, and this application does not impose specific limitations.
[0054] The principal component variable set can be understood as the variables that determine the overall flow, thermodynamic state, and element conservation. These variables may include, but are not limited to, temperature, velocity, pressure, fuel, oxidant, main products, solvent, or inert components. Furthermore, the residuals corresponding to the principal component variable set may include, but are not limited to, the residuals of the first observation data, such as the residuals of the observed data of the principal component variables, and the residuals of the first governing equation, such as the residuals of the corresponding continuity equation and momentum conservation equation.
[0055] The free radical / trace component variable set can be understood as variables with low concentration, rapid changes, and high sensitivity to reaction pathway or parameter inversion. It may include, but is not limited to, free radicals, low-concentration intermediate components, catalytically active intermediates, peak variables in local thin reaction zones, etc. Furthermore, the residual set corresponding to the free radical / trace component variable set may include, but is not limited to, the residuals of the second observation data, such as the residuals of the observation data of the free radical / trace component variables, and the residuals of the second governing equation, such as the residuals of the corresponding component transport equation, etc.
[0056] Furthermore, in the principal component variable group, the principal components and temperature determine the overall flow and heat release trend, and the changes are relatively smooth. In the free radical / trace component variable group, the concentrations of free radicals and trace intermediate components are low, the peak values are narrow, and the gradients are large, which easily leads to locally high residuals during training. Therefore, the principal component variable group and the free radical / trace component variable group cannot use the same residual processing method. That is, the control residuals and observation residuals corresponding to the principal component variable group, the control residuals and observation residuals corresponding to the free radical variable group, and the control residuals and observation residuals corresponding to the trace component variable group are not specifically limited in this application. For example, the component transport equation residuals This may include, but is not limited to, the principal component residuals of the component transport equations. Component transport equations and free radical residuals and component transport equations and trace component residuals ; Observational data residuals may include, but are not limited to, the observational residuals of principal component mass fractions. Observational residuals of free radical component mass fraction and residuals of trace component mass fraction observation This application does not impose specific restrictions, etc.
[0057] In some embodiments, the physical semantics of the chemical reaction flow problem can be determined first, and then the variables in the state field can be divided into a first group of variables and a second group of variables based on the physical semantics and scale differences. The residuals of the first governing equation and the first observation data corresponding to the first group of variables, and the residuals of the second governing equation and the second observation data corresponding to the second group of variables can be determined respectively. Then, the residuals of the governing equation are obtained based on the residuals of the first and second governing equations, and the residuals of the observation data are obtained based on the residuals of the first and second observation data.
[0058] Optionally, in one embodiment of this application, determining a first loss function and a second loss function of the neural network based on the control equation residuals and the observation data residuals includes: determining a first transformation strategy applicable to the first control equation residuals and the first observation data residuals based on a first set of variables; determining a second transformation strategy applicable to the second control equation residuals and the second observation data residuals based on a second set of variables; determining a first loss function based on the first observation data residuals under the first transformation strategy and the second observation data residuals under the second transformation strategy; and determining a second loss function based on the first control equation residuals under the first transformation strategy and the second control equation residuals under the second transformation strategy.
[0059] It is understood that, in the embodiments of this application, the variables and residuals of the governing equations in the chemical reaction flow problem can be divided into principal component variable groups and free radical / trace component variable groups. The first transformation strategy for the residuals of the principal component variable groups is a linear transformation, and the second transformation strategy for the residuals of the free radical / trace component variable groups is a composite transformation combining linear transformation and inverse hyperbolic sine compression. This aims to reduce the dominance of the total gradient by the local peak residuals of sensitive components, preserve the global trend of the principal component variables, and improve the stability of the multi-scale state field reconstruction.
[0060] Furthermore, in the embodiments of this application, the first loss function can be understood as the observation data loss, and the second loss function can be understood as the control equation loss; this application does not impose any specific limitations.
[0061] In some embodiments, this application can formulate a first transformation strategy applicable to the residuals of the first governing equation and the residuals of the first observation data based on a first set of variables, and formulate a second transformation strategy applicable to the residuals of the second governing equation and the residuals of the second observation data based on a second set of variables. Then, a first loss function is constructed based on the residuals of the first observation data under the first transformation strategy and the residuals of the second observation data under the second transformation strategy, and a second loss function is constructed based on the residuals of the first governing equation under the first transformation strategy and the residuals of the second governing equation under the second transformation strategy.
[0062] Specifically, the embodiments of this application perform linear transformation on the residuals of the control equations and the residuals of the observed data corresponding to the principal component variable groups. In addition to linear transformation, an additional transformation is required for the residuals of the governing equations and observation data corresponding to the free radical / trace component variable groups. ,in, For the original residual, and For the new residual after transformation, and The coefficients are given by humans.
[0063] Furthermore, in this embodiment, the transformed residuals are used to construct a loss term using MSE (Mean Squared Error). For any transformed residual sequence... The expression for its MSE can be, but is not limited to, as follows: , in, This represents the residual after processing by the first transformation strategy or the second transformation strategy, where the residual corresponding to the first transformation strategy is denoted as... The residual corresponding to the second transformation strategy is denoted as .
[0064] For the residuals of the observed data, let the first... The observed variable at the th observation variable in the th ... The original residuals at each observation point are The residual after processing by the first transformation strategy is denoted as The residual after processing by the second transformation strategy is denoted as Then the uniform residual entering the loss function is: , in, This represents the set of residual terms of the observed data after applying the first transformation strategy. This represents the set of observation data residuals using the second transformation strategy.
[0065] No. The loss term for each observed variable is: , The expression for the first loss function can be, but is not limited to, expressed as: , For the residuals of the governing equations, let the first... The governing equation is in the... The original residuals at each configuration point are: The residual after processing by the first transformation strategy is denoted as The residual after processing by the second transformation strategy is denoted as Then the uniform residual entering the loss function is: , in, This represents the set of residual terms in the control equations using the first transformation strategy. This represents the set of residual terms of the control equations using the second transformation strategy.
[0066] No. The loss term for each governing equation is: , The expression for the second loss function can be, but is not limited to, expressed as: , Furthermore, embodiments of this application can establish a joint loss function for the neural network based on the first loss function and the second loss function. The joint loss function is composed of a weighted average of multiple loss terms with physical meaning, and its expression can be, but is not limited to, as follows: , in, For the joint loss function, Due to the loss of observation data, To control the loss of the equation; and It is the set of residual terms from the observed data and residual terms from the governing equations. Represents the network output of a neural network, such as , , , , This represents the unknown parameters to be inferred in the control equations. The optimizer will adjust the parameters based on the total loss. and Update and The weights of the observation data loss term and the control equation loss term are respectively represented by... To be updated, among which, For smoothing coefficients, , for The first loss term pair of Gradient norm, This is the average of the gradient norms of all loss terms.
[0067] For example, in embodiments of this application, when the chemical reaction flow problem is a zero-dimensional self-ignition problem, the energy conservation equation is satisfied. With component transport equations The joint loss function consists of the loss term from the governing equation and the loss term from the observed data. Its expression can be, but is not limited to, as follows: ,in, To control the loss of the equation, weights are set. , Weights are assigned to account for the loss of observation data. .
[0068] Furthermore, in some embodiments, when the chemical reaction flow problem is a one-dimensional steady-state counter-diffusion flame combustion system with a hydrogen mechanism, the one-dimensional steady-state laminar counter-diffusion flame model satisfies the continuity equation. Momentum conservation equation Energy conservation equation and component transport equations The joint loss function consists of the loss term from the governing equation and the loss term from the observed data. Its expression can be, but is not limited to, as follows: ,in, To control the loss of the equation, weights are set. , Weights are assigned to account for the loss of observation data. .
[0069] In step S103, based on the first loss function and the second loss function, the training strategy and training loss function of the neural network are determined, and the neural network is trained according to the training strategy and training loss function until the preset training conditions are met, thereby obtaining the trained neural network. Based on the trained neural network, the field variable distribution, physical constraint residual distribution, model parameter estimation results, and model evaluation results of the chemical reaction flow problem are output.
[0070] In some embodiments, the present application can determine the training strategy and training loss function of the neural network based on a first loss function and a second loss function, and train the neural network according to the training strategy and training loss function until preset training conditions are met, thereby obtaining a trained neural network. Based on the trained neural network, the field variable distribution, physical constraint residual distribution, model parameter estimation results, and model evaluation results of the chemical reaction flow problem are output. The preset training conditions can be set by those skilled in the art according to actual conditions, and the present application does not impose specific limitations.
[0071] The training strategy can be understood as a two-stage training strategy employing data pre-training and physical joint training. The specific strategy can be set by those skilled in the art according to actual circumstances, and this application does not impose specific limitations. The first stage uses observational data for pre-training, training the network parameters using only observational data loss, allowing the network to first learn the main trends of the state field such as temperature, velocity, and component mass fraction, and avoiding being dominated by the residuals of the strong rigid control equations in the early stages of training. The second stage is physical joint training, which uses control equation loss and observational data loss based on the results of the first stage, and jointly optimizes the parameters to be inferred and the network parameters.
[0072] Furthermore, in this embodiment, the neural network can be trained using a two-stage training strategy of data pre-training and physical joint training based on the first loss function and the second loss function until the preset training conditions are met, thereby obtaining the trained neural network. Based on the trained neural network, the continuous state field, the residual distribution of the control equation, the estimated value of the parameter to be inferred, the error assessment, and the robustness diagnosis result are output. If the observed data is noisy, the free radical / trace component variable error and the robustness boundary judgment are output simultaneously.
[0073] For example, in embodiments of this application, when the chemical reaction flow problem is a zero-dimensional self-ignition problem, a detailed hydrogen reaction mechanism containing 9 components and 21 elementary reactions can be selected as an example mechanism. The components include hydrogen, oxygen, water, nitrogen, and free radicals such as hydrogen radicals, oxygen radicals, hydroxyl radicals, peroxyhydroxyl radicals, and hydrogen peroxide, as well as intermediate components. Additionally, The parameters were set as trainable physical parameters, with temperature, hydrogen, oxygen, water, and nitrogen classified as principal component variables; and hydrogen radicals, oxygen radicals, hydroxyl radicals, peroxyhydroxyl radicals, and hydrogen peroxide classified as free radical / trace component variables. The residuals of the principal component variable observation data and the residuals of the governing equations underwent only linear transformation. The residuals of the observed data of free radical / trace component variables and the residuals of the corresponding component transport equations are linearly transformed and then transformed again. . Figure 3 It demonstrates that only a linear transformation is applied to the residuals of all variables. Activation energy under strategy Inference value training history; Figure 4 The activation energy is shown by grouping variables and employing a composite residual transformation strategy. Inference value training history, coefficient settings for cases in the figure Compared with the linear transformation residual strategy alone, the composite residual strategy reduces the maximum absolute error of activation energy inversion from 78.24% to less than 0.85%, significantly reduces the oscillation amplitude of the training curve, and significantly accelerates the convergence speed.
[0074] Furthermore, in some embodiments, when the chemical reaction flow problem is a one-dimensional steady-state counter-diffusion flame combustion system with a hydrogen mechanism, the embodiments of this application classify velocity, temperature, fuel, oxidant, major products, and inert components into the principal component variable group; free radicals and low-concentration intermediate components are classified into the free radical / trace component variable group, and the residual transformation is as shown above. Figure 5 This demonstrates the pressure gradient after grouping variables and employing a composite residual transformation strategy. Inference value training history, coefficient settings for cases in the figure .
[0075] Optionally, in one embodiment of this application, training a neural network according to a training strategy and a training loss function includes: determining a training stage of the neural network based on the training strategy; selecting a training loss function from a first loss function and a second loss function based on the training stage; and training the neural network based on the training loss function.
[0076] It is understood that, in the embodiments of this application, the training phase may include, but is not limited to, a data pre-training phase and a physical joint training phase. The training loss function in the data pre-training phase is the observation data loss, and the training loss function in the physical joint training phase is the control equation loss and the observation data loss; this application does not impose specific limitations.
[0077] In some embodiments, the present application embodiments may first determine the training stage through a training strategy, thereby selecting a training loss function for the neural network from a first loss function and a second loss function, and training the neural network through the training loss function.
[0078] For example, this application adopts a two-stage training strategy of data pre-training and physical joint training. In the first stage, only the network parameters are optimized, and the training only uses observation data loss. The purpose is to allow the network to learn the overall change law of the state field based on the measured data, and to prevent the rigid physical residuals from interfering with convergence during the initial training. The Adam optimizer is selected for optimization, with an initial learning rate of 0.001. Every thousand training iterations, the learning rate is decayed to the original 0.95, and the total training is 20,000 steps. In the second stage, the network parameters and the parameters to be inverted are optimized simultaneously. The loss is composed of observation data loss and control equation loss. Under the premise of ensuring the data fitting effect, the calculation result is made to conform to the physical equation, so as to realize the inversion of unknown parameters. The optimizer, learning rate and decay rule are consistent with the previous stage, and the training continues for another 20,000 steps. At the same time, the composite residual adaptive weight configuration is enabled to balance the weight ratio of the two types of loss. The training process is shown in Table 1. Table 1 is a schematic table of the training process of the neural network according to an embodiment of this application.
[0079] Table 1
[0080] Optionally, in one embodiment of this application, training a neural network according to a training strategy and a training loss function includes: calculating the gradient information of each loss term in the training loss function with respect to shared network parameters; determining the weight coefficients corresponding to each loss term based on the gradient information; and training the neural network based on the weight coefficients, the training strategy, and the training loss function.
[0081] Those skilled in the art will understand that, in the neural network training process, the embodiments of this application can first calculate the gradient information of each loss term in the training loss function with respect to the shared network parameters, and then determine the weight coefficients corresponding to each loss term based on the gradient information, thereby completing the training of the neural network.
[0082] For example, this application proposes an adaptive loss balancing method based on gradient norm. Since the optimizer prioritizes responding to loss terms with large gradients, to avoid shifts in training network updates due to differences in dimensions or orders of magnitude between loss terms, the weights are dynamically updated based on the gradient norm of each loss term with respect to the shared network parameters, combined with data pre-training and physical joint training. This balances the gradient contributions of the observed data residuals and the control equation residuals, improving the stability and generalization ability of the inverse problem solution. Specifically, this is achieved by calculating the gradient norm of each loss term with respect to the shared network parameters. Let the target weight be the same as Inversely proportional or approximately inversely proportional, and using The method of smoothing the update assigns smaller weights to loss terms with larger gradients and larger weights to loss terms with smaller gradients. For the first The first update The weights of each loss term; For smoothing coefficients, The larger the value, the smoother the weight update process and the higher the training stability, but the slower the response rate to gradient imbalance. The smaller the value, the more sensitive the weight is to changes in the residual, but it is more likely to cause fluctuations in the training process.
[0083] The working principle of the modeling method for chemical reaction flow problems proposed in this application will be introduced below with reference to several embodiments.
[0084] in, Figure 2 This is a general flowchart of a modeling method for chemical reaction flow problems provided according to an embodiment of this application.
[0085] like Figure 2 As shown, embodiments of this application may use only one coordinate system or both for different chemical reaction flow problems. Therefore, the time coordinate system can be used... and spatial coordinates First, normalization is performed to obtain the normalized time coordinates. and normalized spatial coordinates The normalized time and space coordinates are used as inputs to the multilayer perceptron, and the multilayer perceptron output is used to... , , , Similarly, the output may differ depending on the problem. Since the coordinates input to the neural network are normalized coordinates, the neural network's predicted output is not the actual physical quantity. Therefore, physical decoding is performed to restore the predicted value to the actual physical quantity. , , , .
[0086] Subsequently, differentiation is performed using automatic differentiation. Automatic differentiation essentially treats the neural network as a complex, differentiable function, and then directly applies the chain rule to accurately calculate the partial derivatives of all network outputs with respect to the input coordinates. This transforms the differential equation constraints into gradient signals that the neural network can learn. The green boxes in the figure represent the 0th derivative (without differentiation), 1st derivative, 2nd derivative, and physical parameters in the governing equations formed by the derivatives of the output variables with respect to the coordinates.
[0087] The sections on governing equation conditions and observation conditions demonstrate how the residuals and losses of the neural network are calculated. The residuals represent the bias, and the loss represents the training objective after squaring, summing, or weighting the bias. The governing equation residuals are used to measure whether the neural network's predictions satisfy the laws of conservation of mass, momentum, energy, and component transport; the observation data residuals are used to measure whether the neural network's predictions are consistent with experimental or numerical observations.
[0088] For chemical reaction flow problems, governing equations are used to represent them mathematically. The governing equations are a collective term for the continuity equation, momentum conservation equation, energy conservation equation, and component transport equation; therefore, the corresponding residuals are written as the continuity equation residuals. Residuals of the Momentum Conservation Equation Energy conservation equation residuals and component transport equation residuals It should be noted that, in the embodiments of this application, different components are further divided into principal component variables and free radical / trace component variables. Therefore, They were also written as , and Substituting the derivative obtained after automatic differentiation into the governing equation, when the predicted value does not satisfy the governing equation, the equation calculation yields a non-zero residual. In addition to the governing equation residual, there is also the observation data residual obtained by directly comparing the predicted value with the actual observed data. .
[0089] Furthermore, in this embodiment, all residuals are subjected to a single linear transformation. The residuals corresponding to the free radical / trace component variables require an additional transformation. The loss function is calculated using the new residuals via MSE.
[0090] Furthermore, the embodiments of this application complete the joint loss function. The neural network is constructed and trained using a two-stage training strategy of data pre-training and physical joint training, as shown in Table 1. Furthermore, embodiments of this application also propose using adaptive loss balancing based on gradient norm.
[0091] Example 2: Inversion of reaction kinetic parameters in zero-dimensional self-ignition.
[0092] This application uses a hydrogen combustion system with a detailed mechanism as an example, and selects activation energy as the target inference parameter. The purpose is to verify the ability of physical semantic grouping and composite residual transformation to stably reconstruct local high-gradient free radicals and low-concentration intermediate components, and to verify that the stable state field can support subsequent kinetic parameter inference, so as to illustrate the application of this application in a strong rigid reaction kinetic system.
[0093] (1) Setting of target reaction system and parameters to be inverted.
[0094] In this embodiment, a detailed hydrogen reaction mechanism comprising nine components and 21 elementary reactions is selected as an example mechanism. The components include hydrogen, oxygen, water, nitrogen, and free radicals such as hydrogen radicals, oxygen radicals, hydroxyl radicals, peroxyhydroxyl radicals, and hydrogen peroxide, as well as intermediate components. Additionally, Set as trainable physics parameters.
[0095] (2) Construction of loss function.
[0096] The zero-dimensional self-ignition problem satisfies the energy conservation equation With component transport equations At this point, the joint loss function can be, but is not limited to, expressed as: .
[0097] (3) Data preparation.
[0098] In this embodiment, 20, 40, 60, 80 or 100 observation points are extracted from the high-precision solution results as sparse observation data, and the data is uniformly sampled on the time coordinate.
[0099] (4) Variable grouping and composite residual transformation.
[0100] In this embodiment, temperature, hydrogen, oxygen, water, and nitrogen are classified as principal component variables; hydrogen free radicals, oxygen free radicals, hydroxyl free radicals, peroxyhydroxyl free radicals, and hydrogen peroxide are classified as free radical / trace component variables. The residuals of the principal component variable observation data and the residuals of the governing equations are subjected to only linear transformation. The residuals of the observed data of free radical / trace component variables and the residuals of the corresponding component transport equations are linearly transformed and then transformed again. The verification results are as follows: Figure 3 and Figure 4 As shown.
[0101] Example 3: Multiphysics reconstruction and flow parameter evaluation in one-dimensional reactive flow.
[0102] This application uses a one-dimensional steady-state counter-diffusion flame combustion system based on a hydrogen mechanism as an example, and selects the pressure gradient eigenvalue as the target inference parameter. This study verifies the improvement of state reconstruction accuracy and parameter inversion stability under sparse observation conditions by adaptive loss weights, and illustrates the application of this application in a one-dimensional reactive flow system containing coupling of convection, diffusion and chemical reaction.
[0103] (1) Setting of target reaction system and parameters to be inverted.
[0104] The detailed hydrogen mechanism in this embodiment is consistent with that in Embodiment 2, including 9 components and 21 elementary reactions.
[0105] Furthermore, in this embodiment of the application, the pressure gradient eigenvalue is used as an application evaluation index for a one-dimensional similar transformation flow field to characterize the network's ability to reconstruct the coupling relationship between flow constraints and state field.
[0106] (2) Construction of loss function.
[0107] Among them, the one-dimensional steady-state laminar counter-diffusion flame model satisfies the continuity equation. Momentum conservation equation Energy conservation equation and component transport equations The joint loss function is constructed in the same manner as in Example 2.
[0108] (3) Data preparation.
[0109] 20, 30, 40, 50 and 60 observation points were selected from the high-precision solution results and sampled uniformly in spatial coordinates to ensure good coverage of the spatial domain and enhance the effectiveness of the area near the flame surface.
[0110] (4) Variable grouping and composite residual transformation.
[0111] In this embodiment, velocity, temperature, fuel, oxidant, major products, and inert components are classified into the principal component variable group; free radicals and low-concentration intermediate components are classified into the free radical / trace component variable group. The residual transformation is the same as in Example 2. The verification results are as follows: Figure 5 As shown.
[0112] (5) Adaptive loss weights.
[0113] This application's embodiments introduce adaptive loss weights based on the gradient norm on top of fixed loss weights. For each loss term... Determine the initial weights for each loss term, and calculate the gradient norm of the model with respect to the shared network parameters every 1000 training steps. The target weights are obtained according to the gradient equalization criterion and then processed using a smoothing coefficient. renew. Figure 6 This demonstrates the stress gradient eigenvalues under a fixed loss weight strategy. Inversion values are used to train the history, at which point the control equation loses weights. Observational data loss weights ; Figure 7 This demonstrates the stress gradient eigenvalues under an adaptive loss weighting strategy. Inverted values are trained on history, at which point the weights are determined according to the function. Smooth update, the example in the figure sets the smoothness coefficient. .
[0114] Under fixed weights, the high residuals of the chemical reaction source terms near the flame front continuously dominate the overall gradient direction, suppressing the effective gradient contributions of the continuity equation, momentum conservation equation, and energy conservation equation. Adaptive weights dynamically adjust the weights based on the gradient norm of each loss term on the parameters of the last layer of the model, weakening the dominance effect of high residuals in local reactions and making the gradient contributions among different parameters tend to be balanced.
[0115] Example 4: Robustness verification under noisy observation conditions.
[0116] This application's embodiments illustrate the application boundaries under more complex chemical mechanisms and noisy observational data. Taking a one-dimensional steady-state counter-diffusion flame combustion system based on a hydrogen mechanism under noisy conditions as an example, the target inference parameter is selected as the pressure gradient eigenvalue. Its purpose is to test the robustness of the core method of this invention under engineering conditions.
[0117] (1) Setting of target reaction system and parameters to be inverted.
[0118] This application uses a one-dimensional laminar counter-diffusion flame under noisy conditions as an example, where the target inference parameter is the pressure gradient eigenvalue. Apart from the noise superimposed on the observation data, the variable grouping and the settings of the parameters to be inverted are consistent with those in Example 3.
[0119] (2) Construction of loss function.
[0120] The control equations and loss functions in this embodiment are consistent with those in Embodiment 3.
[0121] (3) Data preparation.
[0122] In this embodiment, 40 and 50 observation points are extracted from the high-precision solution results as sparse observation data and sampled in spatial coordinates.
[0123] In this embodiment of the application, a relative Gaussian perturbation is superimposed on the observation data as noise: ,in, For the first The standard reference solution for each observation point For the first Noisy observations at each observation point For noise intensity, Let be a random variable that follows a standard normal distribution. Noise intensity. The values are 0%, 1%, 2%, 3%, and 4%, respectively. When using space flame data, half of the observation points can be used for uniform coverage of the entire area, while the other half can be placed in areas with large temperature gradients or critical free radical gradients to enhance the constraint of the flame surface or rapid reaction zone.
[0124] (4) Training history of eigenvalue inversion values.
[0125] Figure 8 This demonstrates the stress gradient eigenvalues under a fixed loss weight strategy. Inversion values are used to train the history, at which point the control equation loses weights. Observational data loss weights ; Figure 9 This demonstrates the stress gradient eigenvalues under an adaptive loss weighting strategy. Inverted values are trained on history, at which point the weights are determined according to the function. Smooth update, the example in the figure sets the smoothness coefficient. .
[0126] A comparison between adaptive and fixed weight strategies reveals the dependence of weight strategies on noise intensity. Adaptive weight strategies outperform fixed weight strategies within 2% of noise intensity, while fixed weight strategies are recommended for noise levels of 3% and above.
[0127] Example 5: Implementation Results and Judgment Methods.
[0128] This application's embodiments output a continuous temperature field, velocity field, component mass fraction field, residual distribution of governing equations, estimated values of parameters to be inferred, relative error, free radical / trace component error, and noise robustness assessment results. If the free radical / trace component error increases first, it can be determined that the model is approaching the robustness boundary.
[0129] For a detailed hydrogen combustion system, under noise-free sparse observation conditions, a composite residual transformation strategy was employed to maintain high-precision reconstruction of temperature and principal components, significantly improving the peak recovery capability of free radicals / trace components; the activation energy of the target elementary reaction could stably converge to near the reference value. (The reference activation energy is used as a reference value.) Taking J / kmol as an example, approximately can be obtained under the composite residual strategy. The relative error of the inversion value in J / kmol can be controlled within 1%.
[0130] In noisy environments, when the noise intensity is at a low to medium level, such as no more than about 3%, the composite residual transformation strategy and adaptive loss weight strategy can maintain the stability of principal component variable reconstruction and activation energy inversion. As the noise increases further, free radicals / trace components typically exhibit error degradation before temperature and principal components; therefore, they can be used as sensitive indicators of the model's robustness boundary. The verification results are shown in Table 2. Table 2 is a comparison table of verification results provided according to an embodiment of this application.
[0131] Table 2
[0132] Furthermore, key parameters can be substituted in the embodiments of this application, as shown in Table 3. Table 3 is a schematic table of key parameters and alternative solutions provided according to one embodiment of this application.
[0133] Table 3
[0134] As shown in Table 3, the residual compression function for free radical / trace component variables is not limited to... It can be replaced by an equivalent function that satisfies monotonicity, odd symmetry, or large residual compression characteristics; strength coefficient The value can be adjusted based on observation sparsity, variable magnitude range, free radical peak width, and noise level; in some implementations, it can be taken from 0.1 to 10.0 or a wider range; adaptive weighting smoothing coefficient. The value can be adjusted according to training stability; in some implementations, it can be 0.91 to 0.99; the parameter to be inferred is not limited to any single physical quantity, but can be reaction kinetic parameters, transport parameters, boundary condition parameters, inlet perturbation, flow closure parameters, diffusion coefficient correction terms, or other implicit physical parameters; the source of observation data is not limited to numerical reference solutions, but can be PLIF (Planar Laser-Induced Fluorescence), PIV (Particle Image Velocimetry), spectral inversion, thermocouples, pressure sensors, mass spectrometry, infrared measurements, or other experimental diagnostic data, and this application does not impose specific limitations.
[0135] According to the modeling method for chemical reaction flow problems proposed in this application, the state field output by a neural network can be used based on the extracted coordinate information of the chemical reaction flow problem to determine the residuals of the control equations and the residuals of the observation data. This allows for the determination of the first and second loss functions of the neural network, thereby obtaining the training strategy and training loss function for the neural network. The neural network is trained until the preset training conditions are met, resulting in a trained neural network. This network then outputs the distribution of field variables, the distribution of physical constraint residuals, the model parameter estimation results, and the model evaluation results for the chemical reaction flow problem. By fitting the state field of the chemical reaction flow with a neural network, splitting the two types of loss functions and training them in stages, the accuracy of field variable fitting can be ensured by using observation data, and the physical laws can be conformed to by constraining the control equations. This simultaneously realizes the solution of the flow field distribution, residual analysis, and parameter inversion, improving the reliability of the solution and the completeness of the results. This addresses several issues in related technologies, including the fact that chemical reaction systems possess both strong rigidity and multi-scale characteristics; the concentrations and gradient magnitudes of the main components and free radicals / trace components differ significantly; the use of unified residuals and fixed losses can easily lead to local high residuals dominating optimization, making it difficult to balance global conservation with local reaction characteristics; different physical constraints result in varying gradient magnitudes, and fixed weights induce gradient imbalances, leading to unstable model training, low accuracy in field reconstruction and parameter inversion, and poor versatility of the proposed solutions.
[0136] Next, a modeling apparatus for chemical reaction flow problems according to embodiments of this application is described with reference to the accompanying drawings.
[0137] Figure 10 This is a block diagram of a modeling apparatus for chemical reaction flow problems provided according to an embodiment of this application.
[0138] like Figure 10 As shown, the modeling device 10 for the chemical reaction flow problem includes: a first output module 100, a determination module 200, and a second output module 300.
[0139] The first output module 100 is used to extract coordinate information of the chemical reaction flow problem and input the coordinate information into a pre-constructed neural network to output the state field. The neural network is constructed by a differentiable function approximator.
[0140] The determination module 200 is used to determine the residuals of the control equations and the residuals of the observation data based on the state field, and to determine the first loss function and the second loss function of the neural network based on the residuals of the control equations and the residuals of the observation data. The first loss function is constructed from the residuals of the observation data, and the second loss function is constructed from the residuals of the control equations.
[0141] The second output module 300 is used to determine the training strategy and training loss function of the neural network based on the first loss function and the second loss function, and to train the neural network according to the training strategy and training loss function until the preset training conditions are met, thereby obtaining the trained neural network. Based on the trained neural network, it outputs the field variable distribution, physical constraint residual distribution, model parameter estimation results, and model evaluation results of the chemical reaction flow problem.
[0142] Optionally, in one embodiment of this application, the determining module 200 includes: a first determining unit, a first dividing unit, a second dividing unit, and a generating unit.
[0143] The first determining unit is used to determine the physical semantics of the chemical reaction flow problem.
[0144] The partitioning unit is used to divide the variables in the state field into a first group of variables and a second group of variables based on physical semantics, wherein the spatiotemporal gradient of the second group of variables is greater than that of the first group of variables.
[0145] The second partitioning unit is used to divide the first set of variable groups into the residuals of the first governing equation and the residuals of the first observation data, and the second set of variable groups into the residuals of the second governing equation and the residuals of the second observation data.
[0146] The generation unit is used to obtain the control equation residuals based on the first control equation residuals and the second control equation residuals, and to obtain the observation data residuals based on the first observation data residuals and the second observation data residuals.
[0147] Optionally, in one embodiment of this application, the determining module 200 includes: a second determining unit, a third determining unit, a fourth determining unit, and a fifth determining unit.
[0148] The second determining unit is used to determine a first transformation strategy applicable to the residuals of the first governing equation and the residuals of the first observation data, based on the first set of variables.
[0149] The third determining unit is used to determine a second transformation strategy applicable to the residuals of the second governing equation and the residuals of the second observation data, based on the second set of component variables.
[0150] The fourth determining unit is used to determine the first loss function based on the first observation data residual under the first transformation strategy and the second observation data residual under the second transformation strategy.
[0151] The fifth determining unit is used to determine the second loss function based on the residuals of the first control equation under the first transformation strategy and the residuals of the second control equation under the second transformation strategy.
[0152] Optionally, in one embodiment of this application, the second output module 300 includes: a sixth determining unit, a selection unit, and a first training unit.
[0153] The sixth determining unit is used to determine the training stage of the neural network based on the training strategy.
[0154] The selection unit is used to select a training loss function from a first loss function and a second loss function based on the training phase.
[0155] The first training unit is used to train the neural network based on the training loss function.
[0156] Optionally, in one embodiment of this application, the second output module 300 includes: a calculation unit, a seventh determination unit, and a second training unit.
[0157] The computation unit is used to calculate the gradient information of each loss term in the training loss function with respect to the shared network parameters.
[0158] The seventh determining unit is used to determine the weight coefficients corresponding to each loss term based on gradient information.
[0159] The second training unit is used to train the neural network based on the weight coefficients, training strategy, and training loss function.
[0160] Optionally, in one embodiment of this application, a processing module is also included.
[0161] The processing module is used to generate a processing instruction for the coordinate information based on the preset coordinate conditions before inputting the coordinate information into the pre-built neural network. If the coordinate information does not meet the preset coordinate conditions, the module processes the coordinate information according to the processing instruction to obtain the processed coordinate information that meets the preset coordinate conditions.
[0162] It should be noted that the explanation of the aforementioned modeling method embodiment for chemical reaction flow problems also applies to the modeling apparatus for chemical reaction flow problems in this embodiment, and will not be repeated here.
[0163] The modeling apparatus for chemical reaction flow problems proposed in this application can, based on the extracted coordinate information of the chemical reaction flow problem, utilize the output state field of a neural network to determine the residuals of the control equations and the residuals of the observation data, thereby determining the first and second loss functions of the neural network, and thus obtaining the training strategy and training loss function of the neural network to train the neural network until the preset training conditions are met, resulting in a trained neural network. This network then outputs the distribution of field variables, the distribution of physical constraint residuals, the model parameter estimation results, and the model evaluation results for the chemical reaction flow problem. By fitting the state field of the chemical reaction flow using a neural network, splitting the two types of loss functions and training them in stages, the accuracy of field variable fitting can be ensured by utilizing observation data, while also conforming to physical laws through the constraints of the control equations. Simultaneously, the flow field distribution solution, residual analysis, and parameter inversion are achieved, improving the reliability and completeness of the solution. This addresses several issues in related technologies, including the fact that chemical reaction systems possess both strong rigidity and multi-scale characteristics; the concentrations and gradient magnitudes of the main components and free radicals / trace components differ significantly; the use of unified residuals and fixed losses can easily lead to local high residuals dominating optimization, making it difficult to balance global conservation with local reaction characteristics; different physical constraints result in varying gradient magnitudes, and fixed weights induce gradient imbalances, leading to unstable model training, low accuracy in field reconstruction and parameter inversion, and poor versatility of the proposed solutions.
[0164] Figure 11 This is a schematic diagram of the structure of an electronic device provided according to an embodiment of this application. The electronic device may include: The memory 1101, the processor 1102, and the computer program stored on the memory 1101 and executable on the processor 1102.
[0165] When the processor 1102 executes the program, it implements the modeling method for chemical reaction flow problems provided in the above embodiments.
[0166] Furthermore, electronic devices also include: Communication interface 1103 is used for communication between memory 1101 and processor 1102.
[0167] The memory 1101 is used to store computer programs that can run on the processor 1102.
[0168] The memory 1101 may include high-speed RAM memory, and may also include non-volatile memory, such as at least one disk storage.
[0169] If the memory 1101, processor 1102, and communication interface 1103 are implemented independently, then the communication interface 1103, memory 1101, and processor 1102 can be interconnected via a bus to complete communication between them. The bus can be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus, etc. The bus can be divided into address bus, data bus, control bus, etc. For ease of representation, Figure 11 The bus is represented by a single thick line, but this does not mean that there is only one bus or one type of bus.
[0170] Optionally, in a specific implementation, if the memory 1101, processor 1102, and communication interface 1103 are integrated on a single chip, then the memory 1101, processor 1102, and communication interface 1103 can communicate with each other through an internal interface.
[0171] The processor 1102 may be a central processing unit (CPU), an application specific integrated circuit (ASIC), or one or more integrated circuits configured to implement the embodiments of this application.
[0172] This application also provides a computer-readable storage medium storing a computer program thereon, which, when executed by a processor, implements the above-described modeling method for chemical reaction flow problems.
[0173] This application also provides a computer program product, including a computer program that, when executed, implements the above-described modeling method for chemical reaction flow problems.
[0174] In the description of this specification, the references to terms such as "one embodiment," "some embodiments," "example," "specific example," or "some examples," etc., indicate that a specific feature, structure, material, or characteristic described in connection with that embodiment or example is included in at least one embodiment or example of this application. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples. Moreover, without contradiction, those skilled in the art can combine and integrate the different embodiments or examples described in this specification, as well as the features of different embodiments or examples.
[0175] Furthermore, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include at least one of that feature. In the description of this application, "N" means at least two, such as two, three, etc., unless otherwise explicitly specified.
[0176] Any process or method described in the flowchart or otherwise herein can be understood as representing a module, segment, or portion of code comprising one or N executable instructions for implementing custom logic functions or processes, and the scope of the preferred embodiments of this application includes additional implementations in which functions may be performed not in the order shown or discussed, including substantially simultaneously or in reverse order depending on the functions involved, as should be understood by those skilled in the art to which embodiments of this application pertain.
[0177] The logic and / or steps represented in the flowchart or otherwise described herein, for example, can be considered as a sequenced list of executable instructions for implementing logical functions, and can be embodied in any computer-readable medium for use by, or in conjunction with, an instruction execution system, apparatus, or device (such as a computer-based system, a processor-included system, or other system that can fetch and execute instructions from, an instruction execution system, apparatus, or device). For the purposes of this specification, "computer-readable medium" can be any means that can contain, store, communicate, propagate, or transmit programs for use by, or in conjunction with, an instruction execution system, apparatus, or device. More specific examples (a non-exhaustive list) of computer-readable media include: an electrical connection having one or more wires (electronic device), a portable computer disk drive (magnetic device), random access memory (RAM), read-only memory (ROM), erasable and editable read-only memory (EPROM or flash memory), fiber optic devices, and portable optical disc read-only memory (CDROM). In addition, computer-readable media can even be paper or other suitable media on which programs can be printed, because programs can be obtained electronically by optically scanning paper or other media, followed by editing, interpreting or otherwise processing as necessary, and then stored in computer memory.
[0178] It should be understood that the various parts of this application can be implemented using hardware, software, firmware, or a combination thereof. In the above embodiments, the N steps or methods can be implemented using software or firmware stored in memory and executed by a suitable instruction execution system. If implemented in hardware, as in another embodiment, it can be implemented using any one or more of the following techniques known in the art: discrete logic circuits having logic gates for implementing logical functions on data signals, application-specific integrated circuits (ASICs) having suitable combinational logic gates, programmable gate arrays (PGAs), field-programmable gate arrays (FPGAs), etc.
[0179] Those skilled in the art will understand that all or part of the steps of the methods in the above embodiments can be implemented by a program instructing related hardware. The program can be stored in a computer-readable storage medium, and when executed, the program includes one or a combination of the steps of the method embodiments.
[0180] Furthermore, the functional units in the various embodiments of this application can be integrated into a processing module, or each unit can exist physically separately, or two or more units can be integrated into a module. The integrated module can be implemented in hardware or as a software functional module. If the integrated module is implemented as a software functional module and sold or used as an independent product, it can also be stored in a computer-readable storage medium.
[0181] The storage medium mentioned above can be a read-only memory, a disk, or an optical disk, etc. Although embodiments of this application have been shown and described above, it is understood that the above embodiments are exemplary and should not be construed as limiting this application. Those skilled in the art can make changes, modifications, substitutions, and variations to the above embodiments within the scope of this application.
Claims
1. A modeling method for chemical reaction flow problems, characterized in that, Includes the following steps: Coordinate information of a chemical reaction flow problem is extracted and input into a pre-constructed neural network to output a state field, wherein the neural network is constructed by a differentiable function approximator; The control equation residuals and observation data residuals are determined based on the state field. Based on the control equation residuals and the observation data residuals, a first loss function and a second loss function of the neural network are determined. The first loss function is constructed from the observation data residuals, and the second loss function is constructed from the control equation residuals. Based on the first loss function and the second loss function, the training strategy and training loss function of the neural network are determined, and the neural network is trained according to the training strategy and the training loss function until the preset training conditions are met, thereby obtaining the trained neural network. Based on the trained neural network, the field variable distribution, physical constraint residual distribution, model parameter estimation results, and model evaluation results of the chemical reaction flow problem are output.
2. The method according to claim 1, characterized in that, The step of determining the residuals of the governing equations and the residuals of the observed data based on the state field includes: Determine the physical semantics of the chemical reaction flow problem; Based on the physical semantics, the variables in the state field are divided into a first group of variables and a second group of variables, wherein the spatiotemporal gradient of the second group of variables is greater than that of the first group of variables. The first set of variable components is divided into the residuals of the first governing equation and the residuals of the first observation data, and the second set of variable components is divided into the residuals of the second governing equation and the residuals of the second observation data. Based on the residuals of the first and second control equations, the residuals of the control equations are obtained, and based on the residuals of the first and second observation data, the residuals of the observation data are obtained.
3. The method according to claim 2, characterized in that, The step of determining the first loss function and the second loss function of the neural network based on the residuals of the control equations and the residuals of the observed data includes: Based on the first set of component variables, a first transformation strategy applicable to the residuals of the first control equation and the residuals of the first observation data is determined. Based on the second set of component variables, a second transformation strategy applicable to the residuals of the second control equation and the residuals of the second observation data is determined; The first loss function is determined based on the first observation data residual under the first transformation strategy and the second observation data residual under the second transformation strategy. The second loss function is determined based on the residuals of the first control equation under the first transformation strategy and the residuals of the second control equation under the second transformation strategy.
4. The method according to claim 1, characterized in that, Training the neural network according to the training strategy and the training loss function includes: Based on the training strategy, the training phase of the neural network is determined; Based on the training phase, the training loss function is selected from the first loss function and the second loss function; The neural network is trained based on the training loss function.
5. The method according to claim 1, characterized in that, Training the neural network according to the training strategy and the training loss function includes: Calculate the gradient information of each loss term in the training loss function with respect to the shared network parameters; Based on the gradient information, determine the weight coefficients corresponding to each loss term; The neural network is trained based on the weight coefficients, the training strategy, and the training loss function.
6. The method according to claim 1, characterized in that, Before inputting the coordinate information into the pre-built neural network, the following steps are also included: If the coordinate information does not meet the preset coordinate conditions, a processing instruction for the coordinate information is generated based on the preset coordinate conditions, and the coordinate information is processed according to the processing instruction to obtain processed coordinate information that meets the preset coordinate conditions.
7. A modeling apparatus for chemical reaction flow problems, characterized in that, include: The first output module is used to extract coordinate information of the chemical reaction flow problem and input the coordinate information into a pre-constructed neural network to output the state field, wherein the neural network is constructed by a differentiable function approximator; The determination module is used to determine the control equation residuals and observation data residuals based on the state field, and to determine the first loss function and the second loss function of the neural network based on the control equation residuals and the observation data residuals, wherein the first loss function is constructed from the observation data residuals and the second loss function is constructed from the control equation residuals; The second output module is used to determine the training strategy and training loss function of the neural network based on the first loss function and the second loss function, and to train the neural network according to the training strategy and the training loss function until the preset training conditions are met, thereby obtaining the trained neural network. Based on the trained neural network, the module outputs the field variable distribution, physical constraint residual distribution, model parameter estimation results, and model evaluation results of the chemical reaction flow problem.
8. An electronic device, characterized in that, include: A memory, a processor, and a computer program stored in the memory and executable on the processor, the processor executing the program to implement the modeling method for chemical reaction flow problems as described in any one of claims 1-6.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that, The program is executed by the processor to implement the modeling method for chemical reaction flow problems as described in any one of claims 1-6.
10. A computer program product, characterized in that, Includes a computer program, which, when executed, is used to implement the modeling method for chemical reaction flow problems as described in any one of claims 1-6.