Method and apparatus for predicting flow behavior of high expansion fire-fighting foam
Patent Information
- Application Number
- CN202610869799.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-06-16
- Publication Date
- 2026-09-01
AI Technical Summary
这致使实体试验成本高昂、周期冗长,且数据点稀疏,可能不满足现代消防系统精细化、多方案比选的优化设计需求,无法为系统优化提供全面数据支撑
[0033]基于上述技术方案,通过提供一种兼顾泡沫宏观流动规律、介观结构特性的智能预测方法,实现对复杂空间内高倍数泡沫流动行为与结构衰变特性的精准描述,完成对泡沫流动覆盖能力、结构稳定性能的核心指标联合定量预测,解决现有技术中经验公式不精准、实体试验成本高、传统数值模拟宏介观特性脱节的技术痛点,为封闭半封闭复杂空间高倍数泡沫消防系统的全维度精细化设计、性能化验证与参数优化提供科学、可靠的技术支撑。
Smart Images

Figure CN122674584A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of data processing technology, and in particular to a method and device for predicting the flow behavior of high-expansion fire-fighting foam. Background Technology
[0002] Currently, relevant regulations clearly require that fire protection systems must pass performance verification to ensure their effectiveness in fire prevention and control. In particular, they have put forward refined design requirements for the fire extinguishing adaptability of enclosed or semi-enclosed spaces, which has directly promoted the urgent need for precision fire protection technology in related fields.
[0003] With the acceleration of urbanization and the rapid development of industry and shipping, the annual growth rate of enclosed or semi-enclosed spaces such as urban underground utility tunnels, cross-river and cross-sea tunnels, large ship cargo holds, and enclosed factory buildings has reached over 8%. These spaces are generally characterized by irregular structures, limited ventilation, and dense internal obstructions (such as pipes, equipment supports, and cable bundles). Once a fire occurs, it can easily cause mass casualties and huge property losses. Therefore, it places stringent requirements on the precise prevention and control, rapid response, and efficient coverage capabilities of fire protection systems.
[0004] High-expansion fire-fighting foam, as the core extinguishing medium in such complex scenarios, has become the preferred technical solution for fire prevention and control in enclosed and semi-enclosed spaces due to its core advantages of high expansion ratio, fast horizontal spreading rate, low water consumption, and dual extinguishing effects of physical asphyxiation and cooling. Its extinguishing efficiency depends on key flow characteristics such as the foam's spreading path, coverage uniformity, and space-filling time within the target space. These characteristics are strongly influenced by multiple factors: the interaction between foam parameters such as expansion ratio, gas-liquid ratio, bubble size distribution, and generation rate, and environmental parameters such as spatial geometry, obstacle density, ventilation speed and direction, and ambient temperature, resulting in significant nonlinearity and scale dependence in foam flow. Macroscopic spreading behavior relies on the overall equivalent hydrodynamic properties of the foam, while mesoscopic structural dynamics such as bubble aggregation, rupture, and liquid film loss directly alter key parameters such as the foam's equivalent density and viscosity, thus affecting the stability and efficiency of macroscopic flow, forming a tight coupling relationship between "mesoscopic structure and macroscopic flow."
[0005] However, current design and performance evaluation methods for high-expansion foam fire suppression systems are insufficient to meet the mandatory requirements of relevant standards, mainly due to four core technical bottlenecks:
[0006] 1. Empirical formulas have significant limitations. Traditional designs often use industry-based empirical formulas derived from simple rectangular space (such as formulas for estimating foam filling time). These formulas do not take into account the unique characteristics of complex spaces, such as irregular shapes, obstructions, and local ventilation vortices. This results in a deviation rate of over 20% between the design and actual fire extinguishing requirements. In some scenarios, there is even a risk that the foam cannot cover the core area of the fire source, leading to fire extinguishing failure.
[0007] 2. High Cost and Narrow Coverage of Physical Testing. While physical testing can reflect real-world flow conditions to some extent, it has significant limitations. First, a single test can cost hundreds of thousands of yuan, with a typical cycle of one month. Second, each test can only verify the effect of a specific spatial structure under a specific combination of foam parameters, while in real-world scenarios, there are extremely numerous combinations of variables such as ventilation conditions, foam parameters, and obstacle layouts, easily reaching hundreds. This results in high costs and lengthy cycles for physical testing, and sparse data points, which may not meet the needs of modern fire protection systems for refined, multi-scheme comparison and optimization design, and cannot provide comprehensive data support for system optimization.
[0008] 3. Insufficient Adaptability of Traditional Numerical Simulations. Existing simulation methods struggle to balance accuracy and engineering applicability. Firstly, one type is based on single-phase flow models, simplifying foam as a homogeneous continuous medium and completely ignoring the impact of mesoscopic bubble structure changes on flow. This leads to significant deviations between simulation results and actual flow, making it unsuitable for guiding engineering design. Another type focuses on mesoscopic models that concentrate on the microscopic motion of bubbles. This requires tracking the trajectory of each individual bubble, resulting in extremely high computational demands. For complex spaces of 1000m³ or larger, a single simulation can take at least several weeks, and it's difficult to output key performance indicators for macroscopic expansion, leading to poor engineering practicality and failing to meet the refined design requirements of complex space fire protection systems. Furthermore, existing numerical simulation models do not consider the breakage rate of high-expansion foam throughout the entire flow cycle, neglecting the impact of factors such as foam accumulation under its own weight and mechanical shearing during flow on foam flow characteristics in deep enclosed spaces. This fails to meet the refined design and mandatory performance verification requirements of special engineering scenarios such as ship fire protection and underground space fire control.
[0009] 4. Existing intelligent prediction models lack creativity and adaptability. While existing research employs neural networks or other methods to predict foam flow parameters, these are mostly simple applications of general algorithms. They fail to address the specific pain points of this field, such as "extremely high sample acquisition costs, easy overfitting with small sample training, and mandatory high reliability in engineering," resulting in low integration, insufficient fitting accuracy, poor generalization ability, and a disconnect from the physical laws of foam flow. Furthermore, existing intelligent models do not incorporate foam breakage rate into their input feature system, making it impossible to utilize the large amount of breakage rate experimental data accumulated in engineering. This necessitates repeated full-process simulations, leading to long design cycles and high costs. Moreover, they cannot simultaneously quantify the flow coverage capacity and long-term structural stability of foam, resulting in prediction results that cannot provide comprehensive quantitative support for the design of fire protection systems in complex scenarios. Therefore, their prediction results cannot meet the performance verification requirements of relevant mandatory standards and cannot be directly used for refined design in fire protection engineering. Summary of the Invention
[0010] This application proposes a method and device for predicting the flow behavior of high-expansion fire-fighting foam, which can solve one of the problems existing in the background art.
[0011] To achieve the above objectives, this application adopts the following technical solution:
[0012] Firstly, a method for predicting the flow behavior of high-expansion firefighting foam is provided, including:
[0013] Obtain the intrinsic parameters of high-expansion fire-fighting foam and the operational parameters of the space protected by the foam;
[0014] Furthermore, using the parameters of the high-expansion fire-fighting foam itself and the operating parameters as inputs, and based on the constructed macro-mesoscale equivalent model, the trained prediction model is used to process and obtain the prediction results of the flow behavior of the high-expansion fire-fighting foam. The macro-mesoscale equivalent model includes: the constitutive equation and the fluid dynamic control equation of the high-expansion fire-fighting foam. The equivalent dynamic viscosity is used as the core input parameter of both the constitutive relation and the fluid dynamic control equation. A mesoscopic structure correction coefficient is introduced into the equivalent dynamic viscosity.
[0015] In one possible design approach of the first aspect, the constitutive equation is:
[0016] Where τ is the shear stress and τ0 is the foam yield stress. The equivalent dynamic viscosity of high-expansion fire-fighting foam, Where n is the shear rate and n is the rheological index.
[0017] The fluid dynamics governing equations include a continuity equation and a momentum equation, wherein the continuity equation is:
[0018] in, For high-expansion foam density, t is the flow time. The macroscopic flow velocity vector of the foam. The Hamiltonian operator is a universal standard differential operator in computational fluid dynamics, possessing the dual properties of differential and vector operations.
[0019] The momentum equation is:
[0020] Where p is the flow pressure. It is the gravitational acceleration vector. The dynamic viscosity of the base liquid at 20°C. The value is the equivalent dynamic viscosity, C is the viscosity correction factor, and N is the foaming ratio. For mesoscopic structure correction coefficients, The volume fraction of the liquid phase in the initial state of foam formation. This represents the real-time liquid phase volume fraction during the foam flow process.
[0021] In one possible design approach of the first aspect, the macro-metascale dual-scale equivalent model further includes: a total process cumulative loss rate model, wherein the total process cumulative loss rate model is:
[0022] in, Let be the cumulative loss rate of the bubble from its formation to time t. The instantaneous cumulative mechanical wear rate throughout the entire process. Let be the coupling loss rate constant during the foam coverage phase, and t be the duration of action of the foam after it has completely covered the cabin. For pipeline delivery jetting loss rate, The vertical drop damage rate. For horizontal flow loss rate, V0 is the foam accumulation loss rate, and V0 is the initial volume of foam generated. t Let t be the effective foam volume that maintains the complete gas-liquid structure. Standard atmospheric pressure The initial temperature is room temperature. Let g be the real-time temperature of the foam, h be the acceleration due to gravity, h be the height of the foam buildup, k0 be the basic breakage rate constant, and k be the foam accumulation rate constant. t k is the thermodynamic decay correction factor. c This is a correction factor for chemical pollution.
[0023] In one possible design of the first aspect, the training data for the prediction model includes: parameters of the high-expansion fire-fighting foam itself, operating parameters of the protective space provided by the training foam, and the filling time of the training foam space. The parameters of the high-expansion fire-fighting foam itself include: the cumulative loss rate throughout the entire process.
[0024] In one possible design approach of the first aspect, the training foam space filling time, the training foam coverage efficiency, and the cumulative loss rate of the training foam throughout the entire process are obtained by simulation using the finite volume method based on a turbulence model.
[0025] In one possible design approach of the first aspect, the training foam coverage efficiency is obtained as follows:
[0026] in, For foam coverage efficiency, S cov S is the area or volume of the target fireproof area that is effectively covered by foam to maintain its intact gas-liquid structure after being damaged within the protective space. total The total area or volume of the protected space that needs to be covered by fire protection.
[0027] In one possible design of the first aspect, the prediction model employs a backpropagation neural network optimized by a genetic algorithm, the backpropagation neural network comprising a cascaded input layer, a hidden layer, and an output layer, wherein the activation function of the hidden layer is a hyperbolic tangent sigmoid transfer function, and the activation function of the output layer is a linear transfer function.
[0028] In one possible design of the first aspect, during training, the prediction model encodes all its weights and biases into real-number parameter encoding strings in a four-level structure: input layer-hidden layer weights, hidden layer biases, hidden layer-output layer weights, and output layer biases. In the genetic algorithm, chromosomes correspond to these real-number parameter encoding strings, genes correspond to encoding string segments, gene recombination corresponds to encoding string segment crossover updates, and mutation operations correspond to encoding string value fine-tuning operations. The optimization process of the genetic algorithm includes:
[0029] Based on the fitness function, a roulette wheel selection method is used to determine the selection probability according to the ratio of the individual fitness to the total fitness of the parameter combination set. This selects parent parameter combinations with the same size as the initial parameter combination set, and prioritizes retaining excellent code string segments that are suitable for predicting foam flow characteristics. Then, real-valued single-point crossover is performed on the parent parameter combinations with an adaptive crossover probability, and random perturbation code string numerical fine-tuning is performed on the code string segments with an adaptive code string numerical fine-tuning probability to generate a new generation of parameter combination sets. This process is repeated iteratively until convergence, and the individual with the highest fitness in the parameter combination set is output as the global optimal solution.
[0030] In one possible design of the first aspect, the parameters of the high-expansion fire-fighting foam itself include: foaming ratio and foam generation rate of the foam generator, and the operating parameters include: ventilation velocity and total volume of the protected space.
[0031] In a second aspect, an electronic device is provided, comprising: a processor and a memory coupled to the processor, the memory for storing a computer program; the processor for executing the computer program stored in the memory to cause the electronic device to perform the method for predicting the flow behavior of high-expansion fire-fighting foam as described in any possible implementation of the first aspect.
[0032] Beneficial effects:
[0033] Based on the above technical solutions, an intelligent prediction method that takes into account both the macroscopic flow law and mesoscopic structural characteristics of foam is provided. This method enables an accurate description of the flow behavior and structural decay characteristics of high-expansion foam in complex spaces, and completes the joint quantitative prediction of core indicators such as foam flow coverage capacity and structural stability. This solves the technical pain points of existing technologies, such as inaccurate empirical formulas, high cost of physical experiments, and the disconnect between macroscopic and mesoscopic characteristics in traditional numerical simulations. It provides scientific and reliable technical support for the full-dimensional refined design, performance verification, and parameter optimization of high-expansion foam fire protection systems in closed and semi-closed complex spaces. Attached Figure Description
[0034] To more clearly illustrate the technical solutions in the embodiments of this application, the drawings used in the description of the embodiments or related technologies will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0035] Figure 1 This is a flowchart of the method for predicting the flow behavior and loss rate of high-expansion fire-fighting foam based on a macro-meta-scale equivalent model provided in the embodiments of this application;
[0036] Figure 2This is a schematic diagram of the BP neural network hierarchical segmented encoding mapping provided in the embodiments of this application. Detailed Implementation
[0037] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.
[0038] It should be noted that although functional modules are divided in the device schematic diagram and the logical order is shown in the flowchart, in some cases, the steps shown or described may be performed in a different order than the module division in the device or the order in the flowchart. The terms "first," "second," etc., in the specification and the above-mentioned figures are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence.
[0039] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs. The terminology used herein is for the purpose of describing embodiments of this application only and is not intended to limit this application.
[0040] To address the shortcomings of existing technologies for simulating and predicting the flow behavior of high-expansion fire-fighting foam, such as heavy reliance on empirical formulas, significant limitations of physical experiments, disconnect between macroscopic and mesoscopic characteristics in traditional numerical simulations, and the inability of intelligent prediction models to achieve joint quantitative prediction of flow behavior and loss rate, leading to low design accuracy, high optimization difficulty, and poor adaptability to extreme scenarios in foam fire-fighting systems in complex spaces, this embodiment provides a method for predicting the flow behavior of high-expansion fire-fighting foam based on a macro-mesoscopic dual-scale equivalent model and loss rate input. This method enables the simulation and quantitative prediction of the flow coverage capacity and structural stability of high-expansion fire-fighting foam in complex spaces, providing scientific numerical computational support for the design, performance evaluation, and parameter optimization of high-expansion foam fire-fighting systems. It also has significant guiding significance for fire prevention and control in complex spaces in the fields of fire engineering and public safety. Based on the above, a method for simulating and predicting the flow behavior of high-expansion fire-fighting foam based on a macro-mesoscopic dual-scale equivalent model is provided, such as... Figure 1 As shown, it includes:
[0041] Step 1: Construction of a macro-mesoscopic dual-scale equivalent model. Based on the foaming ratio, liquid volume fraction, generation rate, bubble structure characteristics, and other intrinsic parameters of high-expansion firefighting foam, as well as actual generation conditions, equivalent physical models of the foam are established at both the macroscopic and mesoscopic scales. The macroscopic model is used to calculate core fluid dynamic parameters such as equivalent density and equivalent viscosity of the foam. The mesoscopic model uses mesoscopic structure correction coefficients to achieve real-time characterization of dynamic changes in bubble structure. The foaming ratio is used to determine the gas-liquid two-phase ratio of the foam, providing the basic input for macroscopic equivalent property calculations. The liquid volume fraction is used for real-time updates of the mesoscopic structure correction coefficients, and the bubble structure characteristics are used to achieve the coupling correlation between macroscopic and mesoscopic flow characteristics. All parameters are embedded into the equivalent physical model in a quantitative form, realizing a quantitative correlation between the foam's intrinsic properties and flow behavior, completing the coupling connection between the macroscopic and mesoscopic models, and achieving a unified description of the macroscopic flow laws and mesoscopic structural characteristics of the foam. Meanwhile, in response to the loss effect during the flow of high-expansion foam in deep enclosed spaces, a cumulative loss rate model for the entire process is constructed to quantify the effective fire extinguishing volume decay law during the entire foam cycle, and together with the foam flow behavior, complete the full-dimensional characterization of foam fire extinguishing efficiency.
[0042] Step 2: Geometric Modeling and Parameter Setting of the Protected Space. For enclosed or semi-enclosed complex spaces such as tunnels, ship cargo holds, and underground engineering projects, a three-dimensional spatial geometric model of the target protected object is constructed. Based on engineering design parameters, equipment specifications, and relevant regulations and standards, the location, quantity, and generation rate of the foam generator, the location and wind speed of the ventilation openings, and the distribution of obstacles within the space, as well as the vertical depth of the protected space, are precisely set. These parameters will serve as the input boundary conditions for the flow simulation in Step 3 and as the core input variables for the prediction model in Step 5, achieving a closed-loop parameter transfer from geometric modeling to performance prediction.
[0043] Step 3: Simulation of high-expansion fire-fighting foam flow behavior. Based on the macro-mesoscale equivalent model in Step 1 and the three-dimensional spatial geometric model in Step 2, numerical fluid dynamics methods are used to simulate the flow processes of foam spreading, accumulating, and filling within the protected space. The simulation results are used to obtain training data to train the prediction model.
[0044] Step 4: Based on the above data results, conduct post-processing and feature quantification to extract key flow characteristic parameters such as foam space-filling time and coverage efficiency. This provides basic data support for the subsequent construction of intelligent prediction models.
[0045] Step 5: Construct a rapid prediction model for the flow behavior of high-expansion fire-fighting foam. Based on the flow characteristic parameters and multi-factor coupling influence laws extracted in Step 4, a genetic algorithm-optimized backpropagation neural network (GA-BP) intelligent prediction model is constructed to achieve second-level accurate quantitative prediction of the flow effect of high-expansion fire-fighting foam under different protective space structures and different working conditions.
[0046] Furthermore, in the method provided in this embodiment, step 1 further includes:
[0047] The formula for calculating the equivalent density of foam at a macroscopic scale is: = +(1-
[0048] The equivalent density of high-expansion foam, in kg / m³. 3 ; This represents the volume fraction of the foam gas phase. For high-expansion foams with an expansion ratio N of 200~1000, = The corresponding value range is 0.995 to 0.999; The air density under standard operating conditions is taken as 1.29 kg / m³. The density of the water-based foam base liquid is taken as 998 kg / m3.
[0049] The formula for calculating the equivalent dynamic viscosity of foam at a macroscopic scale is:
[0050] In the formula: The equivalent dynamic viscosity of high-expansion foam is expressed in Pa·s. The dynamic viscosity of the base liquid at 20℃ is taken as 1.004×10−3 Pa∙s; C is the viscosity correction factor, which is taken as 1.0-1.5 for water-based high-expansion foam; N is the foaming ratio. This is the mesoscopic structure correction factor. The formula for calculating the mesoscopic structure correction factor is:
[0051] The volume fraction of the liquid phase in the initial state of foam formation. =1 / N; The real-time liquid volume fraction during the foam flow process is calculated from the real-time foam density of the macroscopic flow field. The calculation formula is as follows: p is the structure sensitivity index, a rheological parameter that quantifies the influence of changes in the mesoscopic structure of foam on macroscopic viscosity. Its value is directly related to the foaming ratio: for medium to high expansion foams with K=200~500 times, p is 1.2~2.0, and for N=500~1000 times, p is 1.5~2.0.
[0052] Furthermore, in step 1, the constitutive equation for high-expansion foam adopts the experimentally verified Herschel-Buckley model, expressed as:
[0053] In the formula: τ is the shear stress, in Pa; τ0 is the foam yield stress, which is 5~15 Pa for high-expansion foam; Shear rate, in seconds (s). -1 n is the rheological index, which is taken as 0.2~0.6 for high-expansion foam. The foam flows only when the shear stress τ>τ0, which conforms to the actual flow characteristics of high-expansion foam.
[0054] The macro-mesoscopic dual-scale equivalent physical model in this embodiment employs a combination of a two-phase medium equivalent model and a rheological constitutive model. The two-phase medium equivalent model is a classical fluid dynamics model that equates the foam gas-liquid two-phase system to a homogeneous continuous fluid, calculating overall equivalent properties based on volume proportions. The macroscopic equivalent density, equivalent viscosity, and mesoscopic structure correction coefficient constitute the foam property equivalent model, while the Herschel-Buckley constitutive equation characterizes the rheodynamics of the foam. Together, they form a complete macro-mesoscopic coupled equivalent foam flow system. This model is derived theoretically and embedded in the Fluent software for solving by customizing property and constitutive relationships, enabling numerical calculations of high-expansion foam flow behavior.
[0055] Furthermore, the cumulative loss rate model throughout the entire process in step 1 is used to quantify the effective extinguishing volume decay law caused by bubble structure damage and liquid film loss during the entire cycle of high-expansion foam transportation, flow, accumulation, and coverage. It is a core engineering indicator for evaluating the long-term extinguishing stability of foam and, together with foam flow behavior, constitutes the two core evaluation dimensions of high-expansion foam extinguishing efficiency, as detailed below:
[0056] The cumulative loss rate of high-expansion foam refers to the proportion of the effective volume of foam that has decreased at a certain point in time to the initial volume generated. The expression is:
[0057] This represents the cumulative loss rate of the foam from its formation to time t. It is dimensionless and ranges from 0 to 1. The larger the value, the more severe the decay of the effective volume of the foam. The instantaneous cumulative mechanical loss rate for the entire process corresponds to the one-time structural damage during the foam conveying, vertical drop, and horizontal flow stages. It is dimensionless and ranges from 0 to 1. is the coupling loss rate constant during the foam covering stage, which characterizes the foam loss rate under the coupled action of multiple thermal and chemical factors during the foam covering stage. The larger the value, the faster the loss. t is the duration of action of the foam after it has completely covered the cabin, in seconds. exp() is the natural exponential function, which characterizes the first-order exponential decay law of the foam volume and conforms to the rupture dynamics of high-exponential foam structures.
[0058] Among them, the instantaneous cumulative mechanical depreciation rate throughout the entire process The expression is as follows:
[0059] The definitions and quantification methods for the loss rates of each item are as follows:
[0060] 1) Pipeline transport jetting loss rate Mechanical shear loss of foam within fire extinguishing pipes and nozzles is primarily influenced by pipe velocity, length, number of bends, and nozzle type. The loss rate during pipe delivery and spraying is obtained by constructing a foam delivery test platform. By controlling parameters such as foam expansion ratio, delivery velocity, pipe length, and number of bends, and measuring the change in effective foam volume before and after spraying, the mechanical loss rate under the corresponding operating conditions can be calculated. Alternatively, this information can be obtained from an industry engineering experience database.
[0061] 2) Vertical drop damage rate The breakage of foam during a 20m vertical drop due to collisions and interception with obstacles is primarily influenced by the drop height, the number of obstacles, and the density of obstacle stacking. The vertical drop breakage rate is obtained through high-level release tests. By controlling the foam drop height, obstacle stacking density, and the number of obstacles, the effective volume ratio of the foam maintaining an intact gas-liquid structure after drop is calculated, and the vertical drop breakage rate can be determined. Alternatively, it can be determined through scaled-down model tests or engineering analogies.
[0062] 3) Horizontal flow loss rate The horizontal diffusion of foam through the array of new energy vehicles during its horizontal diffusion at the bottom of the tank results in shear loss due to the flow. The core influencing factors are the horizontal diffusion distance, vehicle clearance, and obstacle porosity. The horizontal flow loss rate is obtained through obstacle flow tests. By controlling the obstacle clearance ratio, obstacle porosity, and horizontal diffusion distance, the change in effective coverage volume after foam flow is measured, and the horizontal flow loss rate is calculated.
[0063] 4) Foam buildup and breakage The instantaneous compression loss rate caused by the collapse of the foam due to its own weight. Its expression is as follows;
[0064] V0 is the initial volume of the foam. t Let t be the effective foam volume that maintains the complete gas-liquid structure. The pressure is standard atmosphere, taken as 101325 Pa. g is the acceleration due to gravity, taken as 9.8 m / s², and h is the height of the foam accumulation, in meters. The equivalent density of the foam mentioned above. The initial temperature is room temperature. The real-time temperature of the foam is expressed in Kelvin (K).
[0065] Coupling loss rate constant during the foam coverage phase The expression:
[0066] The basic breakage rate constant k0 is the inherent breakage rate of foam under normal temperature, no external load, and clean environment. It is determined by the foam formulation and expansion ratio and is the core indicator of the foam's own stability.
[0067] Thermodynamic decay correction factor k t The amplification factor of the high-temperature thermal environment of a fire on the rate of damage; the larger the value, the stronger the aggravating effect of the thermal environment on the damage.
[0068] Chemical pollution correction factor k c : The amplification factor of pollutants in lithium battery fires on the rate of damage. The larger the value, the stronger the aggravating effect of chemical pollution on the damage.
[0069] Furthermore, in the method provided in this embodiment, step 2 further includes: the operating condition parameters are divided into three categories and standardized and stored as simulation input files, specifically including:
[0070] 1. Foam parameters: expansion ratio, foaming agent type, foam generation rate, foam generator installation location and number;
[0071] 2. Environmental and boundary parameters: Ventilation outlet location, ventilation velocity and direction, wall roughness, ambient temperature, and ambient pressure;
[0072] 3. Protective space parameters: spatial geometry, obstacle distribution and size, and preset location of fire source.
[0073] The three-dimensional geometric model of the protective space is constructed using a conventional engineering modeling approach that combines parametric modeling with structural simplification and equivalence. The modeling software used is ANSYS SpaceClaim / DesignModeler, which is seamlessly compatible with Fluent simulation. For complex spaces such as tunnels and cabins, the basic layout of the main structure and obstacles is preserved, and non-critical details are simplified to form a standardized geometric model that can be directly used for mesh generation and numerical calculation.
[0074] Furthermore, in the method provided in this embodiment, step 3 also includes the fluid dynamics control equations corrected by the macro-mesoscale dual-scale model, including the continuity equation and the momentum equation, expressed as:
[0075] Continuity equation:
[0076] Momentum equation:
[0077] In the formula: t is the flow time, in seconds; u is the macroscopic flow velocity vector of the foam, in m / s; p is the flow field pressure, in Pa; g is the gravitational acceleration vector, taken as 9.81 m / s². High-expansion foam density, unit: kg / m³ 3 , It is the equivalent dynamic viscosity, and the unit is N∙s / m2.
[0078] The correction effect of the above-mentioned fluid dynamics governing equations modified by the macro-meta-scale model is specifically reflected in the equivalent dynamic viscosity μ in step 1. eq This paper proposes a method to achieve coupled correction of macroscopic and mesoscopic properties of foam by introducing a mesoscopic structure correction coefficient. This overcomes the shortcomings of traditional single-phase flow models that ignore bubble structure evolution, thereby improving simulation accuracy and physical realism. Specifically, the equivalent viscosity calculation formula provides macroscopic-mesoscopic coupled viscous property parameters for the governing equations, while the Herschel-Buckley constitutive equation characterizes the foam shear rheological behavior. Equivalent viscosity also serves as a core input parameter for both the constitutive relation and the fluid dynamics governing equations. These three elements form a hierarchical coupling relationship of property calculation, rheological characterization, and flow solution, jointly achieving accurate numerical solutions for the flow behavior of high-expansion foams.
[0079] The numerical simulation method for fluid dynamics employs the finite volume method commonly used in engineering. The standard k-ε turbulence model is selected, a fluid dynamics model included in the Fluent software. By solving the transport equations for turbulent kinetic energy and turbulent dissipation rate, the governing equations of fluid dynamics are solved in a turbulent closed loop. This accurately describes the turbulent diffusion and flow disturbance characteristics of foam during its spread in complex spaces, ensuring the computational stability and engineering accuracy of the numerical simulation of high-expansion foam flow. Boundary conditions are set as follows: the foam generator uses a mass flow rate inlet, the vents use a pressure outlet, and the tunnel and chamber walls use non-slip wall boundaries.
[0080] For step 4, the formula for calculating the foam coverage efficiency is as follows:
[0081] In the formula: Foam coverage efficiency, expressed in %; S cov The area or volume of the target fireproof area effectively covered by foam that maintains its intact gas-liquid structure after being damaged within the protected space, measured in m². 2 or m 3 S total The total area or volume of the protected space that requires fireproofing, expressed in meters (m). 2 or m 3 .
[0082] In step 4, the space filling time and other parameters are macroscopic characteristic evaluation parameters of foam flow. They do not require separate theoretical calculation formulas and are directly extracted through numerical simulation post-processing. The filling time is determined by the arrival of the foam front at the specified position, and the accumulation height is obtained based on the statistical distribution of the gas-liquid interface.
[0083] Furthermore, in step 5, the input feature variables and output prediction index of the prediction model are:
[0084] 1. Input layer feature variables: a total of 7 items, namely foaming ratio K, foam generator generation rate Q, ventilation velocity v, effective longitudinal length of the protective space L, net cross-sectional area of the protective space A, vertical depth of the protective space H, and overall process loss rate. All input parameters are derived from the macro-mesoscale dual-scale equivalent model in step 1 and the standard operating condition settings in step 2, and are the core controlling factors determining the flow behavior and extinguishing efficiency of high-expansion foam. Specifically, the effective longitudinal length L of the protected space is the total longitudinal length of the protected area to be covered by the foam extinguishing system, in meters; the net cross-sectional area A of the protected space is the net flow area of the cross-section of the protected space, in square meters. 2The vertical depth H of the protective space represents the maximum vertical height of the foam accumulation and is a core dimensional parameter affecting the foam's self-weight collapse and vertical drop damage; its unit is meters (m). Together, these two parameters determine the total volume of the protective space. The total loss rate over the entire process is a pre-calculated value under specific operating conditions and can be obtained through the total loss rate model described in step 1.
[0085] 2. Output layer prediction metrics: There are two metrics in total, namely, the time it takes for the bubble space to fill. Foam final coverage efficiency Foam space-filling time characterizes the rapid response capability of foam, reflecting the efficiency of the fire extinguishing system in quickly sealing the protected space. Foam final coverage efficiency characterizes the completeness of foam coverage throughout the protected space, reflecting the fire extinguishing effectiveness of the foam coverage within the protected area. These two indicators together constitute the core evaluation criteria for high-expansion foam fire extinguishing efficiency. All output indicators are derived from the flow characteristic parameter extraction results in step 4.
[0086] Based on the parameter combinations set in steps 1 and 2, and through flow simulation in step 3 and characteristic parameter extraction in step 4, at least 100 sets of input-output sample pairs are obtained, forming the initial training sample set. The training sample set is randomly divided into a training set, a validation set, and a test set in a ratio of 7:2:1. The training set is used for weight learning of the BP neural network, the validation set is used for network structure optimization and early stopping control, and the test set is used to evaluate the model's generalization ability and prediction accuracy.
[0087] In step 5, the BP neural network adopts a 7-12-2 three-layer feedforward topology, specifically configured as follows:
[0088] 1. Input layer: The number of neurons in the input layer There are 7 input feature variables; all input data are processed using the min-max standardization method to the [0,1] interval to eliminate the dimensional differences of different parameters. The standardization formula is:
[0089] In the formula: For standardized data, This is the original data. , These are the maximum and minimum values of the corresponding parameters in the training sample set, respectively.
[0090] 2. Hidden Layer: A single hidden layer design is used, with the number of neurons set to 12. This number is based on an empirical formula. Determined (where the number of neurons in the input layer is...) Number of neurons in the output layer 2. Empirical constants The value is set to 7-10, ensuring the network can fully learn the nonlinear coupling relationships between input features while avoiding overfitting due to excessive network complexity. The hidden layer activation function adopts the hyperbolic tangent sigmoid transfer function (tansig), with the expression:
[0091] Independent variable in the formula The weighted sum of inputs to a hidden layer neuron is represented by the linear weighted sum of the outputs of all neurons in the previous layer and the connection weights of that neuron, plus a bias term. The mathematical expression is: ,in For the next level The output of each neuron For connection weights, This is a bias term.
[0092] 3. Output layer: Number of neurons in the output layer Corresponding to two core forecasting indicators (full time) With coverage efficiency The activation function uses a purelin function, expressed as follows:
[0093] This allows the output values to be unrestricted by amplitude, thus adapting to the needs of regression prediction.
[0094] 4. Network Training: The training algorithm adopts the commonly used Levenberg-Marquardt optimization algorithm, and the maximum number of training iterations is set to N. max The training target error is set to E. tol Among them, N max This represents the maximum number of iterations required for training the neural network; a common engineering value range is 500 to 2000. tol The target error tolerance for stopping training is generally taken as 1×10⁻⁶ in engineering applications. −4 ~1×10 −2 .
[0095] Furthermore, addressing the core pain points of the general model—namely, the susceptibility to spurious fitting, severe overfitting, insufficient generalization ability, and susceptibility to local optima when merging BP neural networks and genetic algorithms with small samples—this embodiment makes exclusive customized improvements to the entire model process to achieve a deep integration of the two and better prediction results. The genetic algorithm optimization process is as follows:
[0096] 1. Hierarchical segmented encoding and initialization of rheological prior parameter combination set
[0097] like Figure 2As shown, to address the shortcomings of general models such as indiscriminate one-dimensional random encoding and completely random initialization leading to invalid search, spurious fitting, and disconnect between genetic optimization and BP network topology in small samples, this embodiment, for the fixed topology structure of 712-3, encodes all weights and biases of the BP neural network into real-valued parameter encoding strings in a four-layer structure: "input layer - hidden layer weights, hidden layer biases, hidden layer - output layer weights, output layer biases". For ease of understanding by those skilled in the art, this paper provides a unified correspondence between native genetic algorithm terminology and custom engineering terminology: "chromosome" in genetic algorithms corresponds to the real-valued parameter encoding string in this paper, "gene" corresponds to the encoding string segment in this paper, "gene recombination" corresponds to the cross-update of the encoding string segment in this paper, and "mutation operation" corresponds to the numerical fine-tuning operation of the encoding string in this paper. Each encoding string segment corresponds to a fixed-level weight or threshold, ensuring that the physical meaning is not lost during the cross-update process of the encoding string segment, and avoiding invalid encoding and cross-updates. Based on statistical analysis of high-magnification foam rheological properties and their physical dimensions, to prevent gradient saturation in the early stages of neural network training and to match the data normalization range, the initialization interval for the input layer-hidden layer weights is limited to [-1, 1]; the hidden layer bias interval is set to [-0.1, 0.1]. This interval is used only for fine-tuning the activation threshold, which can prevent gradient saturation without affecting the weight fitting features. Simultaneously, to match the reasonable engineering numerical range of foam filling time and coverage efficiency, suppress excessive amplification of features by the output layer, and ensure stability in the early stages of training, the initialization interval for the hidden layer-output layer weights is limited to [-0.5, 0.5]. Since the output foam filling time and coverage efficiency are both non-negative engineering physical quantities, their normalized range is 0 to 1. Therefore, the output layer bias interval is set to [0, 1]. This interval, from initialization, confines the output within a reasonable physical range, avoiding invalid output and spurious fitting, and matches the weight interval of the hidden layer-output layer, ensuring stability in the early stages of training. The parameter combination set, corresponding to the population in a genetic algorithm, refers to the set of multiple sets of weights and bias parameters of the BP neural network to be optimized, with a size of N. pop The general range for this value in engineering is 20~50. The maximum number of optimization iterations is set to G. max The general range for engineering values is 40 to 60.
[0098] The core principle behind the hierarchical segmented coding described above, which ensures that the physical meaning is not lost during the cross-up process of coded segments, lies in:
[0099] The weights at different levels of the BP neural network have clearly defined functional divisions. The input layer-hidden layer weights are used to calculate the foaming ratio N, the foam generator's generation rate Q, the ventilation velocity v, the effective longitudinal length L of the protected space, the net cross-sectional area A of the protected space, the vertical depth H of the protected space, and the overall process loss rate. These seven input parameters undergo feature extraction and nonlinear transformation to complete the internal learning of the foam flow pattern. The hidden layer-output layer weights are used to map the internal features learned by the network to two core prediction results: foam filling time and coverage efficiency. The mechanisms and functional objectives of the two types of weights are independent of each other, so different weight initialization intervals need to be set to improve the stability and convergence accuracy of network training. Previous general models used indiscriminate one-dimensional random encoding, mixing weights and thresholds of all levels. Cross-level encoding segment cross-updates would completely disrupt the functional division of different levels, causing the offspring encoding string segments to lose clear physical meaning and generate a large number of invalid solutions. In contrast, the hierarchical segmented encoding in this embodiment strictly divides the encoding string segments according to the network functional boundaries. Encoding string segment cross-crossing only occurs within the same level segment, ensuring that the network function corresponding to each encoding string segment is fully preserved during the cross-update process. This avoids invalid encoding segment cross-updates from the source of encoding, greatly improving the optimization efficiency and effectiveness under small sample conditions.
[0100] 2. Training-Validation: Construction of the Double-Constraint Weighted Fitness Function
[0101] To address the shortcomings of general models that use only the mean squared error of a single training set as the fitness function, leading to severe overfitting with small sample sizes, a disconnect between the genetic optimization objective and the generalization ability requirements of the BP network, and an inability to meet the high reliability requirements of fire protection engineering, this embodiment constructs a dual-constraint weighted fitness function based on both "training set fitting accuracy" and "validation set generalization ability." A higher fitness value indicates better individual performance. The function expression is as follows:
[0102] In the formula: For the training set weights, To verify the set weights, To prevent extremely small constants with a denominator of zero; The mean squared error of the training set. To verify the set mean square error, the calculation formula is as follows:
[0103] in This represents the number of samples in the corresponding dataset. The true value obtained from the numerical simulation in step 3. This represents the corresponding predicted value of the neural network. A fixed validation set is used to calculate this value in each generation of fitness evaluation. The validation set is not used in the training of the BP network; it is only used to evaluate the generalization ability of individuals.
[0104] in, For the training set weights, To verify the set weights, satisfying ,and In one specific embodiment of this example, taking... This value strikes a good balance between fitting accuracy and generalization ability.
[0105] This fitness function constrains both the fitting accuracy and generalization ability of the model from the root, avoiding the overfitting problem of "high training accuracy and low testing accuracy" in general models, ensuring the predictive stability of the model under unknown working conditions, and meeting the requirements of zero failure risk and high reliability in fire protection engineering.
[0106] 3. Adaptive genetic iteration operation
[0107] To address the shortcomings of the general GA-BP model, such as slow convergence, premature convergence, and disconnect between the optimization rhythm and the BP network training process due to its fixed crossover probability and numerical fine-tuning probability of the encoding string, which cannot adapt to the strong nonlinear coupling characteristics of multiple factors in high-expansion foam flow, this embodiment designs a crossover encoding string numerical fine-tuning probability rule that adaptively adjusts with the number of optimization iterations:
[0108] 1) Crossover probability P c As the number of optimization iterations increases, the crossover probability decreases linearly from 0.8 to 0.6. In the early stage of optimization iteration, a high crossover probability is used to ensure that the code string segments are fully updated and to fully capture the nonlinear coupling relationship between multiple factors. In the later stage of optimization iteration, a low crossover probability is used to protect the excellent code string segments adapted to the prediction of foam flow characteristics from being destroyed.
[0109] 2) Probability of fine-tuning the encoded string value P m As the number of optimization iterations increases linearly from 0.005 to 0.02, a low probability of fine-tuning the numerical values of the encoding string is used in the early stage of optimization iteration to ensure the stability of the convergence direction of the parameter combination set; a high probability of fine-tuning the numerical values of the encoding string is used in the later stage of optimization iteration to avoid the parameter combination set from getting trapped in local optima and to ensure the global optimization effect.
[0110] 4. Genetic Iteration Process
[0111] Based on the aforementioned dual-constraint fitness function, the selection probability is determined by the ratio of individual fitness to the total fitness of the parameter combination set using the roulette wheel method. This selects parent parameter combinations with the same size as the initial parameter combination set, prioritizing the retention of superior coding string segments that are suitable for predicting foam flow characteristics (including space filling time, coverage efficiency, etc.). Then, real-valued single-point crossover is performed on the parent parameter combinations using the aforementioned adaptive crossover probability, and random perturbation coding string numerical fine-tuning is performed on the coding string segments using the aforementioned adaptive coding string numerical fine-tuning probability to generate a new generation of parameter combination sets. The iterative process of "fitness calculation - roulette wheel selection - crossover - coding string numerical fine-tuning" is repeated until the preset maximum number of optimization iterations is reached, and the individual with the highest fitness in the parameter combination set is output as the global optimal solution.
[0112] 4.1 Roulette wheel selection based on dual-constraint fitness function
[0113] The weighted fitness function with dual constraints of "training set fitting accuracy + validation set generalization ability" constructed in this embodiment For calculation purposes, a roulette wheel selection method is used to determine the selection probability based on the ratio of individual fitness to the total fitness of the parameter combination set, thus selecting parent parameter combinations with the same size as the initial parameter combination set. Priority is given to retaining parameters such as foaming ratio, foam generation rate, ventilation velocity, effective longitudinal length of the protective space, net cross-sectional area of the protective space, vertical depth of the protective space, and overall process loss rate. These seven core control parameters of foam flow are highly sensitive to excellent encoded string segments.
[0114] The probability P of selecting the i-th individual in the parameter combination set select (i) is:
[0115] In the formula: F(i) is the double-constraint fitness value of the i-th individual, N pop The size of the parameter combination set.
[0116] Acquiring experimental data in the fire protection field is costly and scarce, making overfitting a key bottleneck affecting model performance. Traditional methods easily identify overfitting phenomena characterized by "high training accuracy but low testing accuracy," failing to meet the high reliability requirements of fire protection engineering and unable to ensure the model's predictive reliability in new scenarios. To address this issue, this method prioritizes retaining individuals that perform stably on both the training and validation sets, avoiding overfitting from the selection stage and thus ensuring the model's stable learning ability regarding the multi-parameter coupling laws of foam flow.
[0117] 4.2 Real-number single-point intersection based on adaptive rules
[0118] Real-valued single-point crossover is performed on the selected parent parameter combinations using the aforementioned adaptive crossover probability to generate child parameter combinations. A higher crossover probability is used in the early stages of the optimization iteration to enhance the diversity of the parameter combination set and avoid premature convergence; the crossover probability is reduced in the later stages of the optimization iteration to protect the excellent code string segment structure and accelerate convergence. Crossover operations are strictly limited to code string segments at the same level, with a focus on protecting parameters related to foaming ratio, foam generation rate, ventilation velocity, effective longitudinal length of the protective space, net cross-sectional area of the protective space, vertical depth of the protective space, and overall process loss rate. The input layer weight encoding string fragments are not destroyed, ensuring the stable transmission of the mapping relationship of the main control features of foam flow.
[0119] (1) Formula for calculating adaptive crossover probability
[0120] Crossover probability Following the number of iterations for finding the best from linearly decreasing to :
[0121] In the formula: The current number of optimization iterations ( ), This represents the maximum number of optimization iterations.
[0122] (2) Specific operations of single-point intersection of real numbers
[0123] For real-number encoded strings with hierarchical segmentation, single-point interleaving is performed only within segments of the same level. Interleaving position. The selected segments are randomly chosen in a uniform distribution within the encoding length range of the encoding string, and must be located inside a certain level of encoding string segment (not a segment boundary).
[0124] Let parent parameter combinations A and B represent two sets of weight codes learned under different foam flow conditions, where each code segment corresponds to the foam expansion ratio, foam generation rate, ventilation velocity, effective longitudinal length of the protected space, net cross-sectional area of the protected space, vertical depth of the protected space, and overall loss rate. Feature extraction weights. Randomly select intersection positions. Place both in position Subsequent coded string segments at the same level are swapped to generate child parameter combinations. and :
[0125] In the formula: This indicates that the encoded string is from the 1st position to the 2nd position. A bit-encoded string fragment, Indicates from the first A segment of the encoded string from the end to the beginning.
[0126] Regarding the crossover probability, traditional genetic iterative methods use a fixed crossover probability (e.g., throughout the entire process). This approach cannot meet the optimization requirements of multi-factor, strongly nonlinear coupling in predicting the flow behavior of high-expansion foams. This embodiment adaptively and linearly decreases the crossover probability based on the number of optimization iterations. The core reason is that in the early stages of optimization iteration, a high crossover probability needs to be maintained to promote sufficient cross-update of the encoded string segments, thereby effectively capturing the complex coupling relationships between parameters such as foam expansion ratio, ventilation speed, and spatial structure. In the later stages of optimization iteration, the crossover probability needs to be reduced to protect the already optimized excellent encoded string segment structure from being destroyed and to avoid optimization divergence.
[0127] 4.3 Numerical Fine-tuning of Random Perturbation Coded Strings Based on Adaptive Rules
[0128] The aforementioned adaptive coding string numerical fine-tuning probability is used to perform random perturbation mutations on the coding string segments of the new generation of parameter combination sets to maintain the diversity of the parameter combination sets. In the later stages of the optimization iteration, the coding string numerical fine-tuning probability is increased to introduce new coding string segment patterns and avoid the parameter combination sets from getting trapped in local optima. This applies to the corresponding foaming ratio, foam generation rate, ventilation velocity, effective longitudinal length of the protective space, net cross-sectional area of the protective space, vertical depth of the protective space, and overall process loss rate. The connection weights of the input nodes are fine-tuned using a gentler encoding string to avoid disrupting the learned core physical relationships of the bubble flow.
[0129] (1) Formula for calculating the numerical fine-tuning probability of the adaptive coding string
[0130] Encoded string numerical fine-tuning probability Following the number of iterations for finding the best from linearly increasing to :
[0131] In the formula: The current number of optimization iterations ( ), This represents the maximum number of optimization iterations.
[0132] (2) Specific operations for fine-tuning the numerical values of the random perturbation code string
[0133] For each bit segment of the encoded string, with probability Perform numerical fine-tuning of the encoded string: If the encoded string segment is located in the hidden layer weight segment, a new value is randomly generated within the interval [−1, 1]. If it is located in the output layer weight segment, a new value is randomly generated within the interval [−0.5, 0.5]. The numerical fine-tuning interval for the bias encoded string segment is consistent with the corresponding layer weight, and the operation formula is as follows:
[0134] In the formula: x ij x is the value of the encoded string fragment before mutation. ij ′ represents the value of the encoded string segment after numerical fine-tuning; r1~U(−1,1) and r3~U(−0.5,0.5) are uniformly distributed random numbers, and r2~U(0,1) are random numbers used to determine whether the encoded string has been numerically fine-tuned.
[0135] For the fine-tuning of the encoded string values, traditional genetic iterative methods typically use a fixed probability P for fine-tuning the encoded string values. m (e.g., P throughout) mThe strategy of using a randomized, unconstrained interval for adjusting the numerical value of the encoded string (=0.01) and the network initialization strategy is difficult to balance with early convergence stability and later global search capability in highly nonlinear solution space optimization such as high-multiple bubble flow behavior prediction. Furthermore, the unconstrained interval can easily disrupt the structure of already found effective solutions. This embodiment proposes an adaptively linearly increasing probability of numerical adjustment of the encoded string with the number of optimization iterations, and introduces hierarchical segmentation constraints on the numerical adjustment interval. The necessity and innovation of this design are reflected in: using a lower numerical adjustment probability in the early stages of optimization iteration to ensure that the parameter combination set converges in a reasonable direction, avoiding random walks in the invalid solution space; and effectively escaping local optima in the later stages of optimization iteration by increasing the mutation probability, overcoming the premature convergence defect of traditional methods. Simultaneously, the hierarchically segmented numerical adjustment interval of the encoded string is consistent with the network initialization strategy, ensuring that the adjusted encoded string segments always remain within the effective solution space, thereby improving the efficiency of optimization iteration and the quality of the final solution while maintaining the diversity of the parameter combination set.
[0136] 4.4 Iteration Termination and Output of Global Optimal Solution
[0137] Repeat the iterative process of "fitness calculation - roulette wheel selection - adaptive crossover - adaptive encoding string numerical fine-tuning" until the preset maximum number of optimization iterations G is reached. max After the iteration terminates, the individual with the highest fitness in the output parameter combination set is further validated under extreme foam flow conditions (maximum foaming ratio, maximum foam generation rate, maximum ventilation velocity, longest effective longitudinal length of the protective space, maximum net cross-sectional area of the protective space, vertical depth of the protective space, and overall process loss rate). The prediction error under the condition is reduced to ensure the reliability of the boundary conditions. Then, the result is decoded into the global optimal initial weights and thresholds of the BP neural network according to the hierarchical segmentation coding rule.
[0138] Furthermore, the core verification metrics and calculation formulas for the model's prediction accuracy are as follows:
[0139] 1. Mean Absolute Percentage Error (MAPE) is used to quantify the relative error level of the model's prediction results. The smaller the value, the higher the prediction accuracy. The calculation formula is:
[0140] In the formula: n is the number of samples in the test set; The true value of the foam space filling time or coverage efficiency obtained from numerical simulation; This represents the corresponding predicted value from the neural network model.
[0141] 2. Coefficient of determination (R²) 2This value is used to characterize the fit between the model's predicted values and the simulated actual values. The closer the value is to 1, the stronger the model's ability to fit the nonlinear behavior of high-expansion foam flow. The calculation formula is:
[0142] In the formula: n is the number of samples in the test set. The true value obtained from numerical simulation. These are the model's predicted values. This is the arithmetic mean of all the true values in the test set.
[0143] To ensure the model's predictions of key indicators for high-expansion foam flow are sufficiently reliable and to meet the requirements of precision in practical engineering, the coefficient of determination is limited. ≥0.98, Mean Absolute Percentage Error (MAPE) ≤5%.
[0144] If the model validation does not meet the accuracy requirements, the process can be switched to the working condition parameter setting stage through parameter updates, supplementing simulation samples with different parameter gradients, expanding the coverage of the training set, and improving the model's generalization ability. Alternatively, the process can be switched back to the model building stage through model structure feedback correction, adjusting the physical property parameter range of the equivalent model, the correction coefficient of the loss rate model, or optimizing the structure of the neural network and the parameters of the genetic algorithm to improve the computational accuracy from the fundamental level.
[0145] Compared with the prior art, this embodiment has the following significant effects:
[0146] (1) A macro-mesoscale equivalent model of "dynamic correction of macro-continuous medium and meso-structure" was constructed. The viscosity model was optimized based on the foundational experimental conclusions of foam rheology in China. This solved the core problem of "disconnect between macro and meso-scale characteristics" in traditional numerical simulation. Through real-time dynamic correction of meso-scale parameters, the deviation between simulation results and physical experiments was shortened, and the accuracy of simulation of high-expansion foam flow behavior in complex spaces was greatly improved, meeting the performance verification requirements of the "General Specification for Fire Protection Facilities" (GB 55036-2023).
[0147] (2) The parameter transfer and technical connection of the whole process are clearly defined. From model construction, geometric modeling, numerical simulation, characteristic analysis to rapid prediction, a complete technical closed loop is formed. Those skilled in the art can directly refer to this step to implement it, which has strong engineering operability.
[0148] (3) The core engineering evaluation indicators of foam flow were quantified, and calculation methods for coverage efficiency and full-time key parameters were established. This solved the problem that traditional empirical formulas are only applicable to simple regular spaces and have a deviation rate of over 20%, providing a feasible quantitative basis for the refined design of foam fire protection systems in complex spaces.
[0149] (4) A customized and improved GA-BP intelligent prediction model for high-expansion foam flow scenarios was constructed. Addressing the specific pain points of high sample acquisition costs, overfitting in small samples, and stringent engineering reliability requirements in this field, the model's input feature system, encoding initialization strategy, fitness function, and genetic operation rules were customized and improved across the entire process. This solved the technical defects of the general model, such as poor compatibility between BP and genetic algorithms, spurious fitting in small samples, insufficient generalization ability, and susceptibility to local optima. Deep integration and synergistic optimization of the two were achieved. The GA-BP intelligent prediction model can achieve second-level accurate prediction of foam flow effects under different working conditions, with a test set prediction accuracy ≥98%. It improves generalization ability by more than 20% compared to the general model, reduces the convergence generation by 40%, and eliminates the need for repeated high-cost physical experiments and time-consuming full-scale numerical simulations. This shortens the fire protection system design cycle by more than 70% and reduces testing costs by more than 60%, completely solving the industry problems of high physical testing costs and narrow working condition coverage.
[0150] (5) The GA-BP intelligent prediction model covers all scenario feature parameters such as foaming ratio, ventilation conditions, effective longitudinal length of the protected space, and net cross-sectional area of the protected space. It can be adapted to different types of complex protected spaces such as tunnels, ship cargo holds, underground integrated pipe corridors, and enclosed factories. It has strong generalization ability and is applicable to a wide range of scenarios. It provides a universal quantitative prediction and optimization tool for the design of high-expansion foam fire protection systems for various enclosed or semi-enclosed spaces.
[0151] (6) A flow behavior prediction method using the cumulative loss rate of the entire foam process as the core input parameter has been realized, and a complete quantitative logic chain of "loss rate-flow characteristics" has been established. It can directly use existing loss rate test data in engineering to quickly predict the foam flow effect without repeating full-process numerical simulation, effectively solving the industry pain point that existing technologies cannot utilize existing loss rate data and the cost of repeated simulation is high. This provides a reliable quantitative tool for the full-dimensional and refined design of high-expansion foam fire protection systems in closed and semi-closed complex spaces, and is suitable for the design needs of extreme engineering scenarios such as deep cargo holds of ships and ultra-long tunnels.
[0152] In summary, this embodiment provides a numerical simulation and intelligent prediction method that can take into account the macroscopic flow law, mesoscopic structural characteristics, and full-cycle depreciation effect of foam. It enables an accurate description of the flow behavior and structural decay characteristics of high-expansion foam in complex spaces, and completes the quantitative prediction of core indicators such as foam flow coverage capacity and structural stability performance. It solves the pain points of existing technologies, such as inaccurate empirical formulas, high cost of physical experiments, disconnect between macroscopic and mesoscopic characteristics in traditional numerical simulation, and failure of intelligent prediction models to consider depreciation effects. It provides scientific and reliable technical support for the comprehensive and refined design, performance verification, and parameter optimization of high-expansion foam fire protection systems in closed and semi-closed complex spaces.
[0153] This application also provides an electronic device, including: a processor, and a memory coupled to the processor, the memory being used to store a computer program; the processor being used to execute the computer program stored in the memory, so that the electronic device performs the method as described in any of the above embodiments.
[0154] Electronic devices can be computing devices such as desktop computers, laptops, handheld computers, and cloud servers. These electronic devices may include, but are not limited to, processors and memory.
[0155] The processor can be a Central Processing Unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor can be a microprocessor or any conventional processor. The processor is the control center of the electronic device, connecting various parts of the device via various interfaces and lines.
[0156] The memory can be used to store the computer program, and the processor implements various functions of the electronic device by running or executing the computer program stored in the memory and calling the data stored in the memory.
[0157] The memory may primarily include a program storage area and a data storage area. The program storage area may store the operating system, applications required for at least one function, etc.; the data storage area may store data created based on the use of the mobile phone, etc. In addition, the memory may include high-speed random access memory, and may also include non-volatile memory, such as hard disk, memory, plug-in hard disk, smart media card (SMC), secure digital (SD) card, flash card, at least one disk storage device, flash memory device, or other volatile solid-state storage device.
[0158] This application also provides a storage medium, which is a computer-readable storage medium. The computer program is stored in the computer-readable storage medium, and when executed by a processor, the computer program can implement the steps of the various method embodiments described above. The computer program includes computer program code, which can be in the form of source code, object code, executable file, or some intermediate form. The computer-readable medium can include: any entity or device capable of carrying the computer program code, a recording medium, a USB flash drive, a portable hard drive, a magnetic disk, an optical disk, a computer memory, a read-only memory (ROM), a random access memory (RAM), an electrical carrier signal, a telecommunication signal, and a software distribution medium, etc.
[0159] This application also provides a computer program product, including: a computer program or instructions that, when the computer program or instructions are run on a computer, cause the computer to perform any of the above possible implementations of the method.
[0160] The above description is the preferred embodiment of this application. It should be noted that for those skilled in the art, several improvements and modifications can be made without departing from the principle of this application, and these improvements and modifications are also considered to be within the scope of protection of this application.
Claims
1. A method for predicting the flow behavior of high-expansion firefighting foam, characterized in that, include: Obtain the intrinsic parameters of high-expansion fire-fighting foam and the operational parameters of the space protected by the foam; Furthermore, using the parameters of the high-expansion fire-fighting foam itself and the operating parameters as inputs, and based on the constructed macro-mesoscale equivalent model, the trained prediction model is used to process and obtain the prediction results of the flow behavior of the high-expansion fire-fighting foam. The macro-mesoscale equivalent model includes: the constitutive equation and the fluid dynamic control equation of the high-expansion fire-fighting foam. The equivalent dynamic viscosity is used as the core input parameter of both the constitutive relation and the fluid dynamic control equation. A mesoscopic structure correction coefficient is introduced into the equivalent dynamic viscosity.
2. The method for predicting the flow behavior of high-expansion firefighting foam as described in claim 1, characterized in that, The constitutive equation is: Where τ is the shear stress and τ0 is the foam yield stress. The equivalent dynamic viscosity of high-expansion fire-fighting foam, Where n is the shear rate and n is the rheological index. The fluid dynamics governing equations include a continuity equation and a momentum equation, wherein the continuity equation is: in, For high-expansion foam density, t is the flow time. The macroscopic flow velocity vector of the foam. For Hamiltonian operators; The momentum equation is: Where p is the flow pressure. It is the gravitational acceleration vector. Where C is the dynamic viscosity of the base liquid at 20℃, C is the viscosity correction factor, and N is the foaming ratio. For mesoscopic structure correction coefficients, The volume fraction of the liquid phase in the initial state of foam formation. This represents the real-time liquid phase volume fraction during the foam flow process.
3. The method for predicting the flow behavior of high-expansion firefighting foam as described in claim 1, characterized in that, The macro-metascale dual-scale equivalent model further includes: a total process cumulative loss rate model, which is as follows: in, Let be the cumulative loss rate of the bubble from its formation to time t. The instantaneous cumulative mechanical wear rate throughout the entire process. Let be the coupling loss rate constant during the foam coverage phase, and t be the duration of action of the foam after it has completely covered the cabin. For pipeline delivery jetting loss rate, The vertical drop damage rate. For horizontal flow loss rate, V0 is the foam accumulation loss rate, and V0 is the initial volume of foam generated. t Let t be the effective foam volume that maintains the complete gas-liquid structure. Standard atmospheric pressure The initial temperature is room temperature. Let g be the real-time temperature of the foam, h be the acceleration due to gravity, h be the height of the foam buildup, k0 be the basic breakage rate constant, and k be the foam accumulation rate constant. t k is the thermodynamic decay correction factor. c This is a correction factor for chemical pollution.
4. The method for predicting the flow behavior of high-expansion firefighting foam as described in claim 1, characterized in that, The training data for the prediction model includes: the parameters of the high-expansion fire-fighting foam itself, the working parameters of the protective space provided by the training foam, and the time it takes for the training foam space to fill. The parameters of the high-expansion fire-fighting foam itself include: the cumulative loss rate throughout the entire process.
5. The method for predicting the flow behavior of high-expansion firefighting foam as described in claim 4, characterized in that, The training foam space filling time, training foam coverage efficiency, and cumulative loss rate of training foam throughout the entire process were obtained through simulation using the finite volume method based on a turbulence model.
6. The method for predicting the flow behavior of high-expansion firefighting foam as described in claim 5, characterized in that, The training foam coverage efficiency was obtained as follows: in, For foam coverage efficiency, S cov S is the area or volume of the target fireproof area that is effectively covered by foam to maintain its intact gas-liquid structure after being damaged within the protective space. total The total area or volume of the protected space that needs to be covered by fire protection.
7. The method for predicting the flow behavior of high-expansion firefighting foam as described in claim 1, characterized in that, The prediction model employs a backpropagation neural network optimized by a genetic algorithm. The backpropagation neural network comprises a cascaded input layer, a hidden layer, and an output layer. The activation function of the hidden layer is a hyperbolic tangent sigmoid transfer function, and the activation function of the output layer is a linear transfer function.
8. The method for predicting the flow behavior of high-expansion firefighting foam as described in claim 7, characterized in that, During training, the prediction model encodes all its weights and biases into real-valued parameter encoding strings in a four-layer structure: input layer-hidden layer weights, hidden layer biases, hidden layer-output layer weights, and output layer biases. In the genetic algorithm, chromosomes correspond to these real-valued parameter encoding strings, genes to encoding string segments, gene recombination to encoding string segment crossover updates, mutation operations to encoding string value fine-tuning operations, and the population to the parameter combination set, which refers to the set of multiple sets of BP neural network weights and biases to be optimized. The optimization process of the genetic algorithm includes: Based on the fitness function, a roulette wheel selection method is used to determine the selection probability according to the ratio of the individual fitness to the total fitness of the parameter combination set. This selects parent parameter combinations with the same size as the initial parameter combination set, and prioritizes retaining excellent code string segments that are suitable for predicting foam flow characteristics. Then, real-valued single-point crossover is performed on the parent parameter combinations with an adaptive crossover probability, and random perturbation code string numerical fine-tuning is performed on the code string segments with an adaptive code string numerical fine-tuning probability to generate a new generation of parameter combination sets. This process is repeated iteratively until convergence, and the individual with the highest fitness in the parameter combination set is output as the global optimal solution.
9. The method for predicting the flow behavior of high-expansion firefighting foam as described in claim 1, characterized in that, The parameters of the high-expansion fire-fighting foam include: foaming ratio, foam generation rate of the foam generator, and cumulative loss rate throughout the process. The operating parameters include: ventilation velocity and total volume of the protected space.
10. An electronic device, characterized in that, The electronic device includes: a processor, and a memory coupled to the processor. The memory is used to store computer programs; The processor is configured to execute the computer program stored in the memory, such that the electronic device performs the prediction method for the flow behavior of high-expansion fire-fighting foam as described in any one of claims 1-9.