<?xml-model href='http://www.tei-c.org/release/xml/tei/custom/schema/relaxng/tei_all.rng' schematypens='http://relaxng.org/ns/structure/1.0'?><TEI xmlns="http://www.tei-c.org/ns/1.0">
	<teiHeader>
		<fileDesc>
			<titleStmt><title level='a'>A physics-constrained neural network for multiphase flows</title></titleStmt>
			<publicationStmt>
				<publisher></publisher>
				<date>10/01/2022</date>
			</publicationStmt>
			<sourceDesc>
				<bibl> 
					<idno type="par_id">10419491</idno>
					<idno type="doi">10.1063/5.0111275</idno>
					<title level='j'>Physics of Fluids</title>
<idno>1070-6631</idno>
<biblScope unit="volume">34</biblScope>
<biblScope unit="issue">10</biblScope>					

					<author>Haoyang Zheng</author><author>Ziyang Huang</author><author>Guang Lin</author>
				</bibl>
			</sourceDesc>
		</fileDesc>
		<profileDesc>
			<abstract><ab><![CDATA[The present study develops a physics-constrained neural network (PCNN) to predict sequential patterns and motions of multiphase flows (MPFs), which includes strong interactions among various fluid phases. To predict the order parameters, which locate individual phases in the future time, a neural network (NN) is applied to quickly infer the dynamics of the phases by encoding observations. The multiphase consistent and conservative boundedness mapping algorithm (MCBOM) is next implemented to correct the predicted order parameters. This enforces the predicted order parameters to strictly satisfy the mass conservation, the summation of the volume fractions of the phases to be unity, the consistency of reduction, and the boundedness of the order parameters. Then, the density of the fluid mixture is updated from the corrected order parameters. Finally, the velocity in the future time is predicted by another NN with the same network structure, but the conservation of momentum is included in the loss function to shrink the parameter space. The proposed PCNN for MPFs sequentially performs (NN)-(MCBOM)-(NN), which avoids nonphysical behaviors of the order parameters, accelerates the convergence, and requires fewer data to make predictions. Numerical experiments demonstrate that the proposed PCNN is capable of predicting MPFs effectively.]]></ab></abstract>
		</profileDesc>
	</teiHeader>
	<text><body xmlns="http://www.tei-c.org/ns/1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xlink="http://www.w3.org/1999/xlink">
<div xmlns="http://www.tei-c.org/ns/1.0"><head>I. INTRODUCTION A. Literature review</head><p>Multiphase flows (MPFs) include motions of various phases and deformations of interfaces formed by the phases. Interactions among the phases are highly non-linear and complex. Although it is possible to predict MPFs by collecting their historical information, such as the flow rate, temperature, pressure, and positions of the phases, the mechanism is so complex that it is still difficult to build a general mathematical model to describe different kinds of MPFs or to solve those models efficiently and accurately. Predicting MPFs becomes a popular topic and many researchers have focused on it because they benefit a wide range of fields, e.g., the chemical industry, environmental protection, life sciences, and industrial process <ref type="bibr">[1]</ref><ref type="bibr">[2]</ref><ref type="bibr">[3]</ref><ref type="bibr">[4]</ref><ref type="bibr">[5]</ref><ref type="bibr">[6]</ref> .</p><p>In recent years, the development of neural network (NN) technology <ref type="bibr">7,</ref><ref type="bibr">8</ref> promotes time series modeling, which also contributes to predicting MPFs. With the use of selforganizing NNs, Mi et al. <ref type="bibr">9</ref> simulated the vertical bubbly, slug, churn, and annular flows for both the impedance of the multiphase admixture and the flow patterns. Based on the given experimental and theoretical velocity data, Valero and Bung 10 identified the characteristic shapes of the fluid phases and explored the behaviors of the air-water flow.</p><p>Rashid et al. <ref type="bibr">11</ref> developed a radial basis function NN to predict MPFs under critical conditions and discovered the relationships between the upstream pressure and gas-liquid ratio, and between the choke bin size and liquid flow rate. Serra et al. <ref type="bibr">12</ref> proposed a randomized hough transform with an NN to predict the void fraction with given image samples, and their results are consistent with the actual void fraction values in natural circulation-based systems of nuclear power plants. Xuan et al. <ref type="bibr">13</ref> proposed a data-driven NN model to predict the separation-induced transition. Lino et al. <ref type="bibr">14</ref> proposed a graph neural network to extrapolate the time evolution of the unsteady Eulerian fluid dynamics. More works on MPFs simulation with the help of NNs were summarized in Yan s <ref type="bibr">15</ref> and Karniadakis s 16 reviews.</p><p>To model MPFs, parameters inside NN will be updated until flow characteristics predicted by NN are similar to or even the same as the given samples. Some popular optimization algorithms <ref type="bibr">[17]</ref><ref type="bibr">[18]</ref><ref type="bibr">[19]</ref> can be applied to update the parameters inside NN. However, how to incorporate physical laws when optimizing the parameter space of NNs so that the predictions strictly meet physical constraints is still a problem. Consequently, NN can easily produce nonphysical results, especially when the number of samples is insufficient to train a complex NN with a large parameter space. Thus, recent studies are considering including physical constraints to improve the performance of NNs in the sense that not only available data are more effectively used, but also the burden of data acquisition is alleviated. The physical constraints can be enforced either implicitly or explicitly. For implicit constraints, penalties are added to the loss function and one obtains the so-called physics-informed neural networks (PINNs) <ref type="bibr">20</ref> . For explicit constraints, predictions from NN are modified to satisfy the physical constraints exactly <ref type="bibr">[21]</ref><ref type="bibr">[22]</ref><ref type="bibr">[23]</ref><ref type="bibr">[24]</ref> .</p><p>Physics-informed neural networks (PINNs) aim to include the physical constraints implied in the available data, by adding penalties in the loss function <ref type="bibr">20</ref> . This helps to reduce the hypothesis space of parameters, and thus requires fewer observations. Moreover, an NN model with desired physical properties is more acceptable and explainable in scientific problems because it has a better generalizable property in out-of-sample scenarios <ref type="bibr">25</ref> .</p><p>Pang et al. <ref type="bibr">26</ref> developed fractional physics-informed neural networks (fPINNs) to encode fractional-order partial differential equations (PDEs). Yang and Perdikaris <ref type="bibr">27</ref> proposed probabilistic PINNs to approximate arbitrary conditional probability densities and to generate samples similar to the one given by PDEs. Dwivedi and Srinivasan 28 considered the advantages of PINNs and extreme learning machine, and proposed Physics Informed Extreme Learning Machine (PIELM) to speed up the network training process.</p><p>Leake and Mortari <ref type="bibr">29</ref> transformed PDEs into unconstrained problems, and then solved them by training NNs. Goswami et al. <ref type="bibr">30</ref> proposed a PINN algorithm to solve brittle fracture problems and optimize its loss by decreasing the variational energy of the system. Schiassi et al. <ref type="bibr">31</ref> proposed a novel PINNs framework to satisfy DE constraints analytically but with unconstrained parameters in NNs, which was also applied to thermal creep flow <ref type="bibr">32</ref> and Poiseuille flow simulations <ref type="bibr">33</ref> . Qiu et al. <ref type="bibr">34</ref> proposed PINNs for incompressible phase field method, which can capture the dynamic behavior precisely. Many existing studies have indicated that an NN with physical constraints contributes to improving prediction accuracy <ref type="bibr">[35]</ref><ref type="bibr">[36]</ref><ref type="bibr">[37]</ref><ref type="bibr">[38]</ref><ref type="bibr">[39]</ref> , discovering PDEs and governing equations <ref type="bibr">40,</ref><ref type="bibr">41</ref> , modeling inverse problems <ref type="bibr">42,</ref><ref type="bibr">43</ref> , and solving uncertainty quantification <ref type="bibr">27,</ref><ref type="bibr">44</ref> . Some other studies also focus on considering a general deep learning framework to learn diverse continuous non-linear operators <ref type="bibr">[45]</ref><ref type="bibr">[46]</ref><ref type="bibr">[47]</ref> . Therefore, adding penalties from the physical constraints in the loss function becomes more and more acceptable and interpretable when developing NNs for physical problems.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>B. Our contribution: novelties and outline</head><p>In the present study, we proposed a PCNN to predict the temporal dynamics of MPFs.</p><p>Our method partly remedies a defect of PINNs that the physical constraints are not enforced exactly. Specifically to MPFs, the defect of PINNs may produce local voids, overfilling, mass loss, negative volume fractions, or negative density of the fluid mixture. In the present method, three physical constraints <ref type="bibr">24</ref> on the order parameters (OPs), which locate individual phases, are exactly satisfied by correcting the prediction from the NNs, instead of adding penalties to the loss function. The first constraint is called the summation constraint, which requires the summation of the volume fractions to be unity. The second one is called the conservation constraint, which requires the mass (or volume) of each phase to be conserved if there are no external inputs. The last one is called the boundedness constraint, which requires the volume fractions produced by OPs to be between zero and one. We demonstrate in the present study that the nonphysical behaviors due to failures of satisfying the three physical constraints will be propagated into the training process and gradually accumulated. As a result, large errors are introduced as time goes on. Once we obtain the prediction of OPs, we proceed to compute the density of the fluid mixture, which later becomes the input to the velocity prediction with the constraint of momentum conservation.</p><p>The structure of the proposed PCNN for MPFs is as follows. The OPs at the new time level are first predicted from the NN model with the OPs at previous time steps. The time-dependent dynamics of the OPs are encoded by a recurrent neural network and decoded predicted OPs for the next time step. The predicted OPs are then corrected by the multiphase consistent and conservative boundedness mapping (MCBOM) algorithm <ref type="bibr">24</ref> to strictly satisfy the four physical constraints mentioned, and the corrected OPs are the final prediction of the OPs at the new time level. As a result, one can update the density of the fluid mixture using the OPs at the new time level. Finally, the velocity at the new time level is predicted from the velocity at previous time levels and the density of the fluid mixture, using the NN model where the momentum conservation is included as a penalty in the loss function. Considering the momentum conservation as a penalty can shrink the model parameter space towards initial momentum with respect to the maximum likelihood estimates.</p><p>The remaining sections are structured as follows. In Section II, the problem of interest is defined. Section III introduces the proposed PCNN for MPFs. Then, in Section IV, we verify the feasibility and practicability of the proposed model through two applications.</p><p>Finally, conclusions are drawn in Section V.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>II. PROBLEM DEFINITION</head><p>In this section, we define the MPFs to be modeled, as well as their physical constraints and analyze the MPFs with time series.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>A. MPFs</head><p>In the present study, the incompressible MPFs are considered, where there are N (N 1) immiscible fluid phases. Each phase has a fixed density and viscosity, denoted by &#961; p and &#181; p , respectively, for phase p, and every two-phase has a surface tension, denoted as &#963; p,q for phases p and q. Locations of the phases are determined from the order parameters {&#966; p } N p=1 , such that &#966; p = 1 represents pure phase p while phase p is absent at &#966; p = -1. Three physical constraints need to be strictly satisfied by the order parameters. The first one is called the summation constraint, i.e.,</p><p>The summation constraint requires that the summation of the volume fractions of all the phases is one so that local voids or overfilling is not produced.</p><p>The second constraint is the mass (or volume) conservation, i.e.,</p><p>where</p><p>is the domain of interest, &#8706;&#8486; is the domain boundary, n is the unit outward normal at the domain boundary, and v is the velocity. If there is no normal velocity at the domain boundary, the integral of &#966; p (1 p N) over the domain of interest does not change. As a result, the volume and mass of each phase, i.e., &#8486; 1+&#966; p 2 d&#8486; and &#8486; &#961; p 1+&#966; p 2 d&#8486;, respectively, 1 p N, do not change with time either. The third constraint is the boundedness constraint, which requires</p><p>One can physically explain {&#966; p } N p=1 as volume fraction contrasts only when they are in [-1, 1]. This corresponds to the volume fractions</p><p>Here, the volume fraction contrast of Phase p is defined as &#966; p = C p -&#8721; N q=1,q =p C q , where {C p } N p=1 is the volume fractions of the phases.</p><p>The density of the fluid mixture is</p><p>From Eq. ( <ref type="formula">4</ref>), if &#966; p is outside [-1, 1], the density of the fluid mixture can become negative.</p><p>Then, (&#961;v) is the momentum and should be conserved if there are no external forces at the domain boundary.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>B. Time series prediction in MPFs</head><p>Time series is a sequence of data set arranged in chronological order <ref type="bibr">48,</ref><ref type="bibr">49</ref> . The time series tool is applied to predict the dynamics of MPFs, or specifically, the order parameters and flow velocities of MPFs. Given the time series of the observed order parameters {&#966; i } m i=1 and flow velocity {v i } m i=1 , the goal is to predict the unobserved data in the future, i.e., {&#966; i } n i=m+1 and {v i } n i=m+1 . Here, m and n are the numbers of the observed time steps and total (including both observed and unobserved) time steps, respectively. The subscripts i is timestamp indexes for the data. To achieve the goal, we specify two projections, where one f 1 (&#8226;) from &#966; k to &#966; k+1 , and another f 2 (&#8226;) from v k to v k+1 such that:</p><p>where</p><p>Here &#949; 1 and &#949; 2 are both bias vectors {&#949; i } t+i i</p><p>To approximation f (&#8226;), we consider neural networks f (&#8226;):</p><p>where</p><p>) are parameters to minimize the difference between ground truth and prediction. In the next section, we will elaborate the way to design our neural networks and to incorporate the physical laws inherent in MPFs.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>III. THE PROPOSED MODEL TO PREDICT THE MULTIPHASE FLOW</head><p>This section will elaborate on the proposed PCNN for multiphase flow prediction, including the NN model to predict the order parameters in Section III A, the boundedness mapping (MCBOM) from Huang et al. <ref type="bibr">24</ref> to correct the order parameters in Section III B, and the second NN model to predict the velocity in Section III C.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>A. The neural network to predict the order parameters</head><p>The following operations are applied to &#966; p (1 p N) independently, and we skip the superscript for convenience. Given a set of order parameters {&#966; i } m i=1 as the input, a NN is developed to predict the order parameters {&#966; i } n i=m+1 . The order parameters are firstly encoded by an LSTM, whose workflow is shown in Figure <ref type="figure">1(a)</ref>. LSTM is effective to solve long-term dependent problems because it introduces the forget gate f i in each LSTM cell, see Figure <ref type="figure">1(a)</ref>, to control the circulation and loss of the sequential data. For each LSTM cell, the input of an LSTM cell includes the output of its previous cell, and all LSTM cells share the same structure and parameters.</p><p>LSTM cells are then connected by the hidden states and cell states to form a complete LSTM network. In the following content, we will formulate the structure of an LSTM cell and then explain how LSTM cells connect with subsequent parts. Inside the i th LSTM cell (1 i m -1), a forget gate f i &#8712; [0, 1] is defined as a Sigmoid unit <ref type="bibr">50</ref> ,</p><p>where S(&#8226;) is the sigmoid function, h i-1 is the hidden state in the previous LSTM cell. </p><p>Here, b, U, and W are the bias, input weight, and cycle weight, respectively, and their subscript f represents the forget gate. The same format is used in Eqs.( <ref type="formula">8</ref>)- (11).</p><p>Then, an input gate I i , i.e.,</p><p>decides which information needs to be updated. To obtain the candidate value C i , a hypertangent activation function is applied,</p><p>Then, we obtain the current cell state C i , incorporating the previous cell state C i-1 , the candidate value C i in Eq. ( <ref type="formula">9</ref>), the forget gate f i in Eq. ( <ref type="formula">7</ref>), and the input gate I i in Eq. ( <ref type="formula">8</ref>),</p><p>i.e.,</p><p>The cell states can be regarded as the memory of LSTM, which connects the previous, current, and future LSTM cells. Next, we move to an output gate o i , which decides the general state of the next hidden state. Here we use the sigmoid function as the activation function and project &#966; i to the output gate o i by</p><p>where h i-1 is the previous-step hidden state. Finally, hidden state h i is computed from the current cell state C i in Eq. ( <ref type="formula">10</ref>) and the output gate o i in Eq. ( <ref type="formula">11</ref>) with</p><p>The output range for sigmoid is [0, 1], while tanh is [-1, 1]. The input gate, forget gate, and output gate use sigmoid because they control the quantities between 0 and 1, where 0 means no flow and 1 means complete flow. The estimated means of cell state C i and hidden state h i are expected to be 0, so we consider tanh function. We have completed the operations in an LSTM cell. Once the hidden state h i is computed, we send current hidden state h i to a quasi encoder-decoder model. The representation r i is defined as a projection of hidden state h i and order parameter &#966; i :</p><p>where H(&#8226;) is an affine transformation using a non-linear activation (usually this is a sigmoid function):</p><p>Here we first concatenate vectors &#966; i and h i as a new vector, transpose the new vector, multiply it by the parameter matrix A 1 , and then add the offset parameter b 1 . We will do the same affine transformation in Eq. ( <ref type="formula">16</ref>) but with different parameters. Then a commutative operation maps all the representations {r i } m-1 i=1 into a one-dimensional element R i with the following rules:</p><p>where &#8853; here is the mean operation. Then we use another affine transformation with a non-linear activation to map the elements R i into &#966; i+1 :</p><p>To update the parameters in the NN model, we defined a loss function to calculate the difference between the predicted &#966; and their observations. Given the observed order parameters &#966; i+1 and the prediction &#966; i+1 , the loss function L &#966; (&#952; 1 ) is defined as:</p><p>where N C here is the number of predicted order parameters in the domain &#8486;, and n C denotes the index of the grid cells. In practice, we minimize L &#966; (&#952; 1 ) by Adam optimizer <ref type="bibr">19</ref> (see Algorithm 1).</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>B. The multiphase consistent and conservative boundedness mapping algorithm</head><p>After predicting {&#966; p k } N p=1 (m + 1 k n) from all the previous data before timestamp k by a NN model in Section III A, there is no guarantee that {&#966; p k } N p=1 satisfy the summation constraint, the mass conservation, and the boundedness constraint, which are the physical constraints on the order parameters, as discussed in Section II. Even though errors due to violating those constraints are small in a time step, they will accumulate and become significant as the computation proceeds. The multiphase consistent and conservative boundedness mapping (MCBOM) algorithm proposed in <ref type="bibr">24</ref>  Given a set of order parameters {&#966; p } N p=1 and a set of scalars {&#934; p } N p=1 that represents total amounts of {&#966; p } N p=1 inside the domain of interest, the boundedness mapping includes three steps. The first one is the clipping step:</p><p>The second one is the re-scaling step</p><p>The last step is the conservation step</p><p>where W p,q is the weight function</p><p>and {B p } N p=1 are obtained from solving the linear system</p><p>In practice, the integral is approximated by the mid-point rule.</p><p>MCBOM corrects the prediction given by NN so that the properties of the order parameters are strictly satisfied. The resulting {&#966; p b } N p=1 has the following properties:</p><p>The cost of the MCBOM algorithm is negligible compared to the neural networks because it is an pointwise algebraic operator. The major cost of MCBOM comes from inverting an N by N symmetric and diagonal-dominant matrix, where N is the number of the phases that is usually much smaller than the parameter space of the NNs. Interested readers can refer to Huang et al. <ref type="bibr">24</ref> for more details.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>C. The neural network with physical constraints</head><p>Once the order parameters are predicted from the first NN model in Section III A and corrected by MCBOM in Section III B, the density of the mixture is computed from Eq. ( <ref type="formula">4</ref>). Thanks to satisfying the boundedness constraint of the order parameters, the density of the fluid mixture will stay in their physical interval as well, no matter how large the density ratio of the problems could be. The remaining task is to predict the velocity {v j } n j=m+1 given the observations {v i } m i=1 . This is accomplished by following the second NN model, whose structure is the same as the one in Section III A, but the input here becomes the velocity rather than the order parameters, i.e.,</p><p>Here (&#8226;) denotes the variables and parameters in the second NN model for velocity prediction.</p><p>The loss function of NN additionally considers the momentum conservation of the MPFs, which is different from the model in Section III A. The momentum of the multi-phase flow is</p><p>where M i is the total momentum of the multiphase flow at timestamp i, &#8710;&#8486; is the discrete volume. Recall that the density of the fluid mixture at timestamp i, i.e., &#961; i , is computed from Eq. ( <ref type="formula">4</ref>) once { &#966; p i } N p=1 are available. Finally, the loss function of NN for velocity prediction is</p><p>where &#955; is the Lagrange multiplier to enforce the momentum conservation. Here, &#961; i+1 and v i+1 form a physics-informed constraint and penalize a nonphysical solution. Right now, the loss function in Eq. ( <ref type="formula">26</ref>) not only includes the part to minimize the difference between the prediction and the ground truth, but also has the penalty due to violating the momentum conservation. A flowchart of the proposed PCNN in Sections III A-III C is shown in Figure <ref type="figure">2</ref>. The methods to update the NN parameters and predictions are elaborated in Algorithm 1. Including the physical constraints help to alleviate the nonphysical behaviors produced simply by using the traditional NNs, and those effects will then be shown in the next section.</p><p>1 &#61542; FC Layer FC Layer FC Layer FC Layer FC Layer Operation FC Layer LSTM &#8230;&#8230; &#8230;&#8230; &#8230;&#8230; &#8230;&#8230; LSTM LSTM Operation Operation FC Layer FC Layer FC Layer Operation &#8230;&#8230; Operation Operation 2 v FC Layer FC Layer FC Layer Algorithm 1 Update strategy using Adam optimization <ref type="bibr">19</ref> .</p><p>Require: Decay rate: &#961; &#966; and &#961; v , momentum coefficient &#945;.;</p><p>Require: Learning rate for order parameters and velocities: &#951;, &#951; .</p><p>Require: Exponential decay rates:</p><p>Require: Small constant for stabilization: . 1: Initialize time stamp: i = 1.</p><p>2: Initialize the first and second moment: s = 0, r = 0, s = 0, and r = 0. 3: while stopping criterion not met do 4:</p><p>6:</p><p>Update prediction:</p><p>Eqs.( <ref type="formula">7</ref>) -( <ref type="formula">16</ref>).</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>7:</head><p>Update loss: L &#966; (&#952; 1 ) &#8592; 1</p><p>Eq. ( <ref type="formula">17</ref>)</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>8:</head><p>Compute gradient: g &#8592; g -&#8711;L &#966; (&#952; 1 ).</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>9:</head><p>Update the first moment estimate:</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>10:</head><p>Update the second moment estimate:</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>11:</head><p>is the Hadamard product <ref type="bibr">51</ref> .</p><p>12:</p><p>Correct the first moment estimation: &#349; &#8592; s 1-&#946; 1 .</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>13:</head><p>Correct the second moment estimation: r &#8592; r 1-&#946; 2 .</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>14:</head><p>Update parameters: &#952; &#8592; &#952;&#951; &#349; &#8730; r+ .</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>15:</head><p>Modification:</p><p>Eqs.( <ref type="formula">18</ref>) -( <ref type="formula">23</ref>).</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>16:</head><p>Transformation:</p><p>Eq. ( <ref type="formula">4</ref>). 17:</p><p>18:</p><p>Update prediction:</p><p>Eq. ( <ref type="formula">24</ref>).</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>19:</head><p>Update loss:</p><p>Eq. ( <ref type="formula">26</ref>).</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>20:</head><p>Compute gradient: g &#8592; g -&#8711;L v (&#952; 2 ).</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>21: 22:</head><p>Update the first moment estimate: s &#8592; &#946; 1 &#8226; s + (1&#946; 1 )g .</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>23:</head><p>Update the second moment estimate: r &#8592; &#946; 2 &#8226; r + (1&#946; 2 )g g .</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>24:</head><p>Correct the first moment estimation: &#349; &#8592; s 1-&#946; 1 .</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>25:</head><p>Correct the second moment estimation: r &#8592; r 1-&#946; 2 .</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>26:</head><p>Update parameters: &#952; &#8592; &#952;&#951; &#349; &#8730; r + .</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>27:</head><p>Update time step: i &#8592; i + 1.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>28:</head></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>IV. EXPERIMENTS</head><p>We will elaborate on two experiments here to demonstrate the effectiveness of the proposed PCNN. The first experiment is the horizontal shear layer problem and the other one is the dam break problem. The data sets are generated from the consistent and conservative phase-field method for incompressible MPFs <ref type="bibr">23</ref> , including the bound-edness mapping algorithm <ref type="bibr">24</ref> that is also introduced in Section III B. The sequential data has been spatially discretized, and the discrete data set is summarized in Table <ref type="table">I</ref>, including the number of phases, simulation duration, number of time steps, and number of grids of the simulation. The dataset used in the present study is generated by the physical multiphase flow model in Huang et al. <ref type="bibr">24</ref> which is a set of partial differential equations (PDEs), and the numerical methods therein. On the other hand, the present method is data-driven without solving any PDEs. The given data is on a uniform grid. The issue of using a random arrangement is that the total phasic mass and momentum in the entire domain, computed from Eqs. ( <ref type="formula">22</ref>) and ( <ref type="formula">25</ref>), are probably not accurate. If the given data on a random arrangement does not have that issue, the present model will still work.</p><p>Table I: A general summary of the data set. Dataset # phases # time steps Total time Grid size Horizontal shear layer 3 160 2.0 [128 &#215; 128] Dam break 3 200 10.0 [512 &#215; 128]</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>A. Horizontal shear layer simulation</head><p>Horizontal shear flows happen under a variety of locations <ref type="bibr">52</ref> , e.g., along coastal fronts, at the edges of energetic ocean currents, in oceans, and atmospheric currents around the terrain. Studies of the horizontal shear flows and predictions of their propagation trends can be widely applied to the hemodynamic analysis <ref type="bibr">53</ref> , ocean circulation <ref type="bibr">54</ref> , etc.</p><p>In this case, the numerical domain of the problem is in a [1 &#215; 1] box with the periodic boundary condition. The domain is partitioned into 128 &#215; 128 non-overlapping, uniform cells. The time step is set to be &#8710;t = 0.0125. The density of the fluids here are: &#961; 1 = 50.0, &#961; 2 = 10.0 and &#961; 3 = 1.0. At t=0, phase 1 occupies the region of y &#8712; (y 0 , y 2 ] and keeps stationary. phase 2 is in between y 1 and y 0 , and moves to the right with a unity speed.</p><p>phase 3 is at the rest of the domain and moves to the left with a unity speed. Here we have y 0 =0.5, y 1 =0.25, and y 2 =0.75. A sinusoidal vertical velocity is applied here to model the perturbation with an amplitude of 0.05 and wavelength of 2&#960;. More details of the problem setup are available <ref type="bibr">23</ref> .</p><p>For the NNs, the encoder consists of a single feed-forward layer, recurrent layers with 64 LSTM cells, and two hidden layers with 32 neurons each. The activation function is</p><p>ReLU. The learning rate is set to be 10  Where the order parameter of a phase is 1, only the corresponding phase occupies that location. Where the order parameter of a phase is -1, the corresponding phase is absent at that location. Here, we omit the comparison between the prediction results and the ground truth, because we cannot distinguish their differences according to the plots (the plots are almost the same).</p><p>We first illustrate the necessity of implementing MCBOM in Section III B, after obtaining predictions from the first NN model in Section III A. For a clear presentation, we only show the results of the first phase (phase 1) in Figure <ref type="figure">4</ref>. For comparison, we present the results from the first NN model in Section III A, and the training loss converges, which, in our experiment, needs about 400 epochs. Figure <ref type="figure">4</ref>(a) shows the mass change of phase 1 in the entire domain versus time. The ground truths of the results are obtained from the numerical solver in Huang et al. <ref type="bibr">24</ref> . Therefore, the results we show are comparing to those with the method in Huang et al. <ref type="bibr">24</ref> . It is clear that the mass of the phase is timeindependent, after applying MCBOM, while the mass is fluctuating from the output of the NN model in Section III A. In other words, mass gain or loss appears in the neural network prediction, which violates the principle of mass conservation. This issue is successfully addressed with the help of MCBOM. ful for long time prediction. Therefore, implementing MCBOM not only exactly enforces the physical constraints for the order parameters, but also produces more accurate and reliable long-time predictions. Figs. 6(a) and 6(b) show the momentum in the X and Y directions predicted by the proposed NN in Section III C or the traditional NN model without including the momentum conservation in the cost function. The momentum predicted from the NN is almost independent of time, and its value is very close to the ground truth. On the other hand, &#215; 1] with the no-slip boundary condition. The number of grid points is [512&#215;128]. The time step is &#8710;t = 5&#215; 10 -2 . We used the same environment and equipment as in the HSL simulation, which took 5 days to train the neural network. The flows is at t = 0. More details of the problem setup are available <ref type="bibr">23</ref> .</p><p>The PCNN here is identical to the one in the Section IV A except that it has 128 LSTM cells. Part of the predictive results is shown in Figure <ref type="figure">7</ref>.   not the case without the help of MCBOM. The results given by the NN model oscillate between 0.02 and 0.04. Figs. 9 shows the prediction of the momentum in the x direction.</p><p>Results predicted by the NN model will drop from -0.01 to -0.07. On the other hand, the prediction of the proposed NN including a physics-informed penalization of momentum conservation, is much closer to the validation data. </p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>V. CONCLUSION</head><p>In the present study, a PCNN model is developed to predict MPFs. It consists of the first NN model to predict the order parameters, the MCBOM to correct the order parameters predicted by the NN model in order to exactly satisfy the mass conservation and the summation and boundedness constraints for the order parameters, and the second NN model to predict the flow velocity with a penalization of the momentum conservation using the density of the fluid mixture computed from the corrected order parameters.</p><p>We demonstrate that the prediction of the order parameters using only the NN model violates all the physical constraints. Hence, nonphysical behaviors, such as mass loss, local voids, or overfilling, are observed in our numerical experiments. After combining the NN and MCBOM, all those issues are thoroughly removed. Moreover, the accuracy and reliability of long-time predictions are improved when including the MCBOM. The momentum conservation is acceptably reproduced, although not exactly, by the proposed NN with physical constraints to predict the velocity. However, the traditional NN model fails to predict such a physical behavior.</p><p>In summary, we consider the NN model as the basic structure of the PCNN for MPFs, and enforce the physical constraints either implicitly by penalization or explicitly (or exactly) by MCBOM. The proposed PCNN model is an effective tool to predict the dynamics of the MPFs.</p></div></body>
		</text>
</TEI>
