--- abstract: 'We propose a new physics guided machine learning (PGML) paradigm that leverages the variational multiscale (VMS) framework and available data to dramatically increase the accuracy of reduced order models (ROMs) at a modest computational cost. The hierarchical structure of the ROM basis and the VMS framework enable a natural separation of the resolved and unresolved ROM spatial scales. Modern PGML algorithms are used to construct novel models for the interaction among the resolved and unresolved ROM scales. Specifically, the new framework builds ROM operators that are closest to the true interaction terms in the VMS framework. Finally, machine learning is used to reduce the projection error and further increase the ROM accuracy. Our numerical experiments for a two-dimensional vorticity transport problem show that the novel PGML-VMS-ROM paradigm maintains the low computational cost of current ROMs, while significantly increasing the ROM accuracy.' author: - | Shady E. Ahmed\ School of Mechanical & Aerospace Engineering,\ Oklahoma State University,\ Stillwater, OK 74078, USA.\ `wesley45@example.com` Omer San\ School of Mechanical & Aerospace Engineering,\ Oklahoma State University,\ Stillwater, OK 74078, USA.\ `wesley45@example.com` Adil Rasheed\ Department of Engineering Cybernetics,\ Norwegian University of Science and Technology,\ N-7465, Trondheim, Norway.\ Department of Mathematics and Cybernetics,\ SINTEF Digital,\ 7034 Trondheim, Norway.\ `wesley45@example.com` Traian Iliescu\ Department of Mathematics,\ Virginia Tech,\ Blacksburg, VA 24061, USA.\ `wesley45@example.com` Alessandro Veneziani\ Department of Mathematics,\ Department of Computer Science,\ Emory University,\ Atlanta, GA 30322, USA.\ `wesley45@example.com` bibliography: - 'manuscript.bib' title: Physics Guided Machine Learning for Variational Multiscale Reduced Order Modeling --- Introduction {#sec:intro} ============ The behavior of physical systems can be generally described by physical principles (e.g., conservation of mass, momentum, and energy) together with constitutive laws. The resulting models are often mathematically formulated as partial differential equations (PDEs) (e.g., the Navier-Stokes equations). Solving them allows prediction and analysis of the system's dynamics. The applicability of analytic methods for solving PDEs is usually limited to simple cases with special geometry and under severe assumptions. In practice, numerical approaches (e.g., finite difference, finite volume, spectral, and finite element methods) are utilized to discretize the governing equations and approximate the values of the unknowns corresponding to a given grid. For turbulent flows, we need to deal with an exceedingly large number of degrees of freedom due to the existence of a wide range of spatio-temporal scales to be resolved. Although such models, called here *full order models* (FOMs), are capable of providing very accurate results, they can be computationally demanding. Therefore, FOMs become impractical for applications that require multiple forward evaluations with varying inputs (e.g., flow control @noack2011reduced [@ito1998reduced; @ravindran2000reduced], optimization @lang2009reduced [@zahr2015progressive; @degroote2010interpolation; @amsallem2015design; @benner2014model; @bui2007goal; @peherstorfer2018survey], and digital twinning @rasheed2020digital [@kapteyn2021probabilistic; @hartmann2018model; @tao2018digital; @haag2018digital; @boschert2016digital]) or studies requiring several simulations like computational-aided clinical trials @VICECONTI2021120. *Reduced order models (ROMs)* are defined as computationally light surrogates that can mimic the behavior of FOMs with sufficient accuracy @lucia2004reduced [@rowley2017model; @taira2017modal; @taira2020modal; @ahmed2021closures]. Projection-based ROMs have gained significant popularity in the past few decades due to the increased amounts of collected data (either from actual experiments or numerical simulations) as well as the development of system identification tools @carlberg2017galerkin [@swischuk2019projection]. Of particular interest, the combination of proper orthogonal decomposition (POD) and Galerkin projection has been a powerful driver for ROM progress. The process comprises an *offline* stage and an *online* stage. The offline stage starts with the collection of data corresponding to system realizations (called *snapshots*) at different time instants and/or parameter values. With these data sets, POD provides a hierarchy of basis functions (or modes) that capture the maximum amount of the underlying system's energy (defined by the data variance). The offline stage is concluded by performing a Galerkin projection of the FOM operators onto the subspace spanned by a truncated set of POD modes to obtain a system of ordinary differential equations (ODEs) representing the Galerkin ROM (GROM). Although this offline stage can be extremely expensive, the resulting GROM can be utilized during the online deployment phase to efficiently predict the system's behavior at parameter values and/or time instants different from those in the data preparation process. The GROM framework has been successful in many applications (e.g., @iollo2000stability [@akhtar2009stability; @sachs2010pod; @noack2003hierarchy; @bertagna2014model; @yang2017efficient; @hijazi2020data; @girfoglio2021pod; @ahmed2021closures]), especially those dominated by diffusion mechanisms or periodic dynamics. Those are often referred to as systems with a solution manifold that is characterized by a small Kolmogorov $n$-width @ahmed2020breaking [@peherstorfer2022breaking]. In the POD context, this means that the dynamics can be accurately represented by a few modes. However, for convection-dominated flows with strong nonlinearity, the Kolmogorov $n$-width is often large with a slow decay, which hinders the linear reducibility of the underlying system. The repercussions of a Galerkin truncation and projection are two-fold. First, the span of the retained POD basis functions does not necessarily provide an accurate representation of the solution and it gives rise to the *projection error* @singler2014new [@amsallem2016pebl; @ahmed2020long]. Second, the interactions between the truncated and the retained modes can be significant. These interactions are ignored in the Galerkin projection step, and consequently the GROM cannot in general capture the dynamics of the resolved modes accurately. This introduces a *closure error* @wang2012proper [@sapsis2013blending; @san2014proper; @san2015stabilized; @san2018extreme; @xie2018data; @pan2018data; @rahman2019dynamic; @imtiaz2020nonlinear; @ahmed2020reduced; @gupta2021neural]. Several efforts have been devoted to address the closure problem. A recent survey covering a plethora of physics-based and data-driven ROM closure methodologies can be found in @ahmed2021closures. The closure problem has been historically related to the stabilization of the ROM solution, drawing roots from large eddy simulation (LES) studies, where the truncated small scales are thought of having diffusive effects on the larger scales. Therefore, eddy viscosity-based frameworks have been often used in the ROM literature @holmes2012turbulence. Nonetheless, it was found that introducing eddy viscosity to *all* resolved scales can actually unnecessarily contaminate the dynamics of the *largest* scales. To mitigate this problem, the *variational multiscale (VMS)* method, which was proposed by Hughes' group @hughes1998variational [@hughes2000large; @hughes2001large] in the finite element setting (see, e.g., @codina2018variational [@john2016finite] for a survey), was utilized to add eddy viscosity dissipation to only a portion of the ROM resolved scales in @iliescu2013variational [@iliescu2014variational; @wang2012proper]. A data-driven version of VMS (DD-VMS) has been recently proposed in @mou2021data, where the effects of the truncated modes onto the GROM dynamics are not restricted to be diffusive. In the present study, we transform the DD-VMS @mou2021data [@koc2021verifiability] and provide an alternative modular framework by utilizing machine learning (ML) capabilities. We stress that this is a fundamental change in which the standard DD-VMS regression is replaced by ML in order to better account for closure effects. Therefore, the proposed neural network approach is essentially different from the regression based DD-VMS @mou2021data. In particular, the DD-VMS ansatz of a quadratic polynomial closure model is relieved by utilizing the deep neural network (DNN) functionality with memory embedding. We also leverage the long short-term memory (LSTM) variant of recurrent neural networks (RNNs) to approximate scale-aware closures. In essence, the use of LSTM encompasses a non-Markovian closure, supported by the Mori-Zwanzig formalism @mori1965transport [@zwanzig1980problems; @chorin2000optimal; @chorin2002optimal; @chorin2009stochastic]. Moreover, we adopt the physics guided machine learning (PGML) framework introduced in @pawar2021physics [@pawar2021model; @pawar2021multi] to reduce the uncertainty of the output results. In particular, we exploit concatenation layers informed by the VMS-ROM arguments to enrich the neural network architecture and constrain the learning algorithm to the manifold of physically-consistent solutions. Finally, for problems with a large Kolmogorov $n$-width, we utilize the nonlinear POD (NLPOD) methodology @ahmed2021nonlinear to reduce the projection error without affecting the computational efficiency, by learning the correlations among the small unresolved scales to provide much fewer latent space variables. We also perform a numerical investigation of the proposed strategies (ML-VMS-ROM, PGML-VMS-ROM, and NLPOD-VMS-ROM), with a particular focus on the locality of scale interactions, which is a cornerstone of the VMS framework. The rest of the paper is organized as follows: We briefly describe the reduced order modeling methodology by the nexus of POD and Galerkin projection in \[sec:rom\]. The relevant background information and notations for the VMS approach are given in \[sec:vms\]. The use of the PGML methodology to provide reliable predictions is explained in \[sec:pgml\], while the NLPOD approach is discussed in \[sec:nlpod\]. The proposed NLPOD-PGML-VMS framework is tested for the parametric unsteady vortex-merger problem, which exemplifies convection-dominated flow systems. Results and discussions are presented in \[sec:res\], followed by the concluding remarks in \[sec:conc\]. Reduced Order Modeling {#sec:rom} ====================== A Newtonian incompressible fluid flow in a domain $\Omega \subset \mathbb{R}^d$, where $d$ defines the spatial dimension (i.e., $d\in\{2,3\})$, can be described by the Navier-Stokes equations (NSE). In order to eliminate the pressure term, we consider the NSE in the vorticity-vector potential formulation. In particular, we consider the 2D case where the vector potential is reduced to the streamfunction as follows: $$\begin{aligned} \partial_t\omega - \nu \Delta \omega + ({\boldsymbol{u}}\cdot \nabla)\omega &= 0, \qquad \text{in} \ \Omega \times [0,T], \\ \Delta \psi + \omega &= 0, \qquad \text{in} \ \Omega \times [0,T], \end{aligned} \label{eq:NSE}$$ where $\omega({\boldsymbol{x}},t)$ and $\psi({\boldsymbol{x}},t)$ denote the vorticity and streamfunction fields, respectively, for ${\boldsymbol{x}}\in \Omega$ and $t \in [0, T]$, while $\nu$ stands for the kinematic viscosity (diffusion coefficient). In dimensionless form, $\nu$ represents the reciprocal of the Reynolds number, ${\text{Re}}$. The velocity vector field ${\boldsymbol{u}}({\boldsymbol{x}},t)$ is related to the streamfunction as follows: $${\boldsymbol{u}}= \nabla ^{\perp} \psi, \quad \nabla ^{\perp} = [\partial_y, -\partial_x]^T. \label{eqn:u-psi}$$ By using Eq. , Eq. \[eq:NSE\] can be further rewritten as follows: $$\begin{aligned} \partial_t\omega - \nu \Delta \omega + J(\omega,\psi) &= 0, \qquad \text{in} \ \Omega \times [0,T], \end{aligned} \label{eq:NSEv}$$ where $J(\cdot,\cdot)$ denotes the Jacobian operator, which is defined as follows: $$J(\omega,\psi) = \dfrac{\partial \omega}{\partial x} \dfrac{\partial \psi}{\partial y} - \dfrac{\partial \omega}{\partial y} \dfrac{\partial \psi}{\partial x}.$$ The vorticity transport equation (Eq. \[eq:NSEv\]) is equipped with an initial condition and boundary conditions on $\Gamma:= \partial \Omega$. For convenience and simplicity of presentation, we shall assume the following conditions: $$\begin{aligned} IC:& \ \omega({\boldsymbol{x}}, 0) = \omega_0({\boldsymbol{x}}), & \text{in} \ \Omega, \\ BC \ \mathrm{(non-slip)}:& \ \psi({\boldsymbol{x}},t) = 0, \quad \dfrac{\partial \psi}{\partial \boldsymbol{n}} = 0, & \text{in} \ \Gamma \times [0,T]. \end{aligned} \label{eq:ic_bc}$$ In the remainder of this section, we describe the construction of the projection-based ROM of the vorticity transport equation. This includes the use of POD to approximate the solution (\[sec:pod\]), followed by the Galerkin method, where the FOM operators in Eq. \[eq:NSE\] are projected onto the POD subspace to define the sought GROM (\[sec:gp\]). Proper orthogonal decomposition {#sec:pod} ------------------------------- We consider a collection of system realizations defined by an ensemble of vorticity fields $\{\omega({\boldsymbol{x}},t_0),\allowbreak \omega({\boldsymbol{x}},t_1),\dots, \allowbreak \omega({\boldsymbol{x}},t_{M-1})\}$. These are often called *snapshots* and come from either experimental measurements or numerical simulations of Eq. \[eq:NSE\] or Eq. \[eq:NSEv\] using any of the standard discretization schemes (e.g., finite element, finite difference or finite volume methods). Without loss of generality, we assume that these snapshots are sampled at equidistant $M$ $(>1)$ time instants with $t_m = m\Delta t$, where $m=0,1,\dots, M-1$ and $\Delta t = \dfrac{T}{M-1}$. We note that, in general, these snapshots can correspond to different types of parameters (e.g., operating conditions, physical properties, and geometry). In POD, we seek a low-dimensional basis $\{\phi_1,\phi_2,\dots,\phi_R\}$ that optimally approximates the space spanned by the snapshots in the following sense @holmes2012turbulence: $$\begin{aligned} &\min \ \Bigg\langle \bigg\| \omega(\cdot,\cdot) - \sum_{k=1}^{R} \big(\omega(\cdot,\cdot),\phi_k(\cdot)\big) \phi_k(\cdot) \bigg\|^2 \Bigg\rangle, \\ &\text{subject to} \qquad \quad \| \phi \| = 1, \qquad \big(\phi_i(\cdot),\phi_j(\cdot)\big) = \delta_{ij} , \end{aligned} \label{eq:opt}$$ where $\langle \cdot \rangle$ denotes an average operation with respect to the parametrization, $(\cdot,\cdot)$ is an inner product, and $\| \cdot \|$ is the corresponding norm. For example, an ensemble average based on temporal snapshots can be defined as follows: $$\langle \omega \rangle = \dfrac{1}{M} \sum_{m=0}^{M-1} \omega(\cdot,t_m).$$ The snapshots represent the approximation of the quantity of interest on a specific grid. For example, a realization of the vorticity field at a given time can be arranged in a column vector $\boldsymbol{\omega} \in \mathbb{R}^N$, where $N$ is the number of grid points. It can be shown that solving the optimization problem \[eq:opt\] amounts to solving the following eigenvalue problem @volkwein2013proper: $$\mathbf{D} \Phi = \Phi \Lambda, \label{eq:eig_sp}$$ where the entries of the diagonal matrix $\Lambda$ and the columns of $\Phi$ represent the eigenpairs of the spatial autocorrelation matrix $\mathbf{D} \in \mathbb{R}^{N\times N}$ with entries defined as $$\big[\mathbf{D}\big]_{ij} = \bigg\langle \boldsymbol{\omega}({\boldsymbol{x}}_i,\cdot) \boldsymbol{\omega}({\boldsymbol{x}}_j,\cdot) \bigg\rangle,$$ where $\boldsymbol{\omega}({\boldsymbol{x}}_i,\cdot)$ is the $i$-th entry of $\boldsymbol{\omega}$. For fluid flow problems, the length of the vector $\boldsymbol{\omega}$ is often large, which makes the eigenvalue problem in Eq. \[eq:eig\_sp\] computationally challenging. Sirovich @sirovich1987turbulence1 [@sirovich1987turbulence2; @sirovich1987turbulence3] proposed a numerical procedure, known as the *method of snapshots*, to reduce the computational cost of solving Eq. \[eq:eig\_sp\]. This approach is efficient, especially when the number of collected snapshots $M$ is much smaller than the number of degrees of freedom (i.e., $M\ll N$), as it reduces the $N\times N$ eigenvalue problem in Eq. \[eq:eig\_sp\] to an $M\times M$ problem. The spatial autocorrelation matrix $\mathbf{D} \in \mathbb{R}^{N\times N}$ is replaced by the temporal snapshot correlation matrix $\mathbf{K} \in \mathbb{R}^{M\times M}$ with entries defined as follows: $$\big[\mathbf{K}\big]_{ij} = \dfrac{1}{M} \bigg(\omega(\cdot,t_i), \omega(\cdot,t_j) \bigg) .$$ The following eigenvalue problem is thus considered: $$\mathbf{K} \mathbf{v}_k = \lambda_k \mathbf{v}_k, \label{eq:eig_tmp}$$ where $\mathbf{v}_k$ is the $k^{\text{th}}$ eigenvector of $\mathbf{K}$ and $\lambda_k$ is the associated eigenvalue. To obtain the hierarchy of the POD basis, the eigenpairs are sorted in a descending order by their eigenvalues (i.e., $\lambda_1 \ge \lambda_2 \dots \ge \lambda_M \ge 0$). Finally, the POD basis functions can be computed as a linear superposition of the collected snapshots as follows @volkwein2013proper: $$\phi_k(\cdot) = \dfrac{1}{\sqrt{\lambda_k}} \sum_{m=0}^{M-1} [\mathbf{v}_k]_m \omega(\cdot,t_m), \label{eq:pod_basis}$$ where $[\mathbf{v}_k]_m$ denotes the $m^{\text{th}}$ component of $\mathbf{v}_k$. It can be verified that the basis functions in Eq. \[eq:pod\_basis\] are orthonormal (i.e., $(\phi_i(\cdot),\phi_j(\cdot))=\delta_{ij}$), where $\delta_{ij}$ is the Kronecker delta. The POD eigenvalues define the contribution of each mode toward the total variance in the given snapshots. A metric that evaluates the quality of a given set of retained modes in representing the system is the relative information content (RIC) @ahmed2021closures, defined as follows: $$\text{RIC}(k) = \dfrac{\sum_{l=1}^{k}\lambda_l}{\sum_{l=1}^{M}\lambda_l}, \label{eq:ric}$$ where $k$ is the POD index at which modal truncation takes place. We emphasize that the same approach can be applied considering parameters other than time. In this case, the temporal correlation matrix is substituted by a generalized parameter correlation matrix. Galerkin projection {#sec:gp} ------------------- The GROM starts by the Galerkin truncation step, making use of the optimality criterion in Eq. \[eq:opt\] as follows: $$\omega({\boldsymbol{x}},t_m) \approx \omega_R({\boldsymbol{x}},t_m) = \sum_{k=1}^R a_k(t_m) \phi_k({\boldsymbol{x}}), \label{eq:upod}$$ where $\{a_k\}_{k=1}^{R}$ are the time-varying modal coefficients (weights), known as *generalized coordinates*. The optimal values of these coefficients are defined by the true projection of the FOM trajectory onto the corresponding POD basis function as follows: $$a_k(t_m) = \big(\omega(\cdot,t_m),\phi_k(\cdot)\big). \label{eq:truepod}$$ Next, the vorticity field $\omega$ in Eq. \[eq:NSEv\] is replaced by its approximation $\omega_R$ from Eq. \[eq:upod\]. After this, the Galerkin projection step comes into play, by defining the POD test subspace ${\boldsymbol{X}}_R$ as follows: $${\boldsymbol{X}}_R := \text{span}\{\phi_1, \phi_2, \dots, \phi_R \}.$$ Finally, Eq. \[eq:NSEv\] with $\omega$ replaced by $\omega_R$ is projected onto the POD space ${\boldsymbol{X}}_R$. This yields the GROM of the vorticity transport equation: Find $\omega_R \in {\boldsymbol{X}}_R$ such that: $$\begin{aligned} (\partial_t\omega,\phi) - \nu (\Delta \omega, \phi) + \big(J(\omega,\psi), \phi \big) &= 0, \qquad \forall \phi \in {\boldsymbol{X}}_R.\\ \end{aligned} \label{eq:GNSE}$$ Equation \[eq:GNSE\] can be written in a tensorial form as follows: $$\dot{{\boldsymbol{a}}} = A{\boldsymbol{a}}+ {\boldsymbol{a}}^\top B {\boldsymbol{a}}, \label{eq:Gtens}$$ where ${\boldsymbol{a}}(t) \in \mathbb{R}^R$ is the vector of unknown coefficients $\{a_k\}_{k=1}^{R}$, while $A \in \mathbb{R}^{R\times R}$ and $B \in \mathbb{R}^{R\times R\times R}$ are the matrix and tensor corresponding to the linear and nonlinear terms, respectively. The Galerkin truncation step restricts the approximation of the vorticity field to live in a low-rank subspace ${\boldsymbol{X}}_R$ ($R \ll N$), which might not capture all the relevant flow structures. Therefore, a projection error is introduced. Furthermore, the Galerkin projection step enforces the dynamics of the ROM to be defined using only the scales supported by ${\boldsymbol{X}}_R$. Nonetheless, due to the coupling between different modes, the unresolved scales (i.e., the scales modeled by $\{\phi_k\}_{k\geq R+1}$) influence the dynamics of the resolved scales (i.e., the scales modeled by $\{\phi_k\}_{k\leq R}$). By neglecting these mutual interactions, the GROM becomes incapable of accurately describing the dynamics of the retained modes, which is usually referred to as the *closure* problem @ahmed2021closures. ![Representation of the repercussions of modal truncation onto the ROM solution. The solid black curve denotes the FOM trajectory, assuming that the full rank expansion is defined by $a_1$, $a_2$, and $a_3$. The solid blue curve defines the projection of the FOM trajectory onto a two-dimensional subspace. The vertical dashed blue lines refer to the . Note that evaluating $a_1$ and $a_2$ still requires the knowledge of the FOM trajectory (i.e.,$a_1$, $a_2$, and $a_3$) at every point. In practice, we only have information regarding the resolved variables (i.e., $a_1$ and $a_2$), so the contribution of $a_3$ towards the dynamics of $a_1$ and $a_2$ is neglected. This yields a , denoted by the dashed red lines.<span data-label="fig:error"></span>](projection.pdf){width="80.00000%"} The projection error and closure error are illustrated in \[fig:error\], for a toy system whose full-rank approximation can be represented with 3 modes as follows: $$\omega(x,t) = a_1(t) \phi_1(x) + a_2(t) \phi_2(x) + a_3(t) \phi_3(x). \label{eq:toy1}$$ Assuming that the FOM is written in the following form: $$\dot{\omega} = F(\omega), \label{eq:udottoy}$$ then the dynamics of $\{a_k\}_{k=1}^{3}$ can be described as $\dot{a}_k = (F(\omega),\phi_k)$. Thus, the FOM trajectory can be written as follows: $$\begin{aligned} \begin{bmatrix} \dot{a}_1\\ \dot{a}_2\\ \dot{a}_3 \end{bmatrix} = \begin{bmatrix} f_1(a_1,a_2,a_3)\\f_2(a_1,a_2,a_3)\\f_3(a_1,a_2,a_3) \end{bmatrix}. \end{aligned} \label{eq:toy2}$$ In other words, evolving $\{a_k\}_{k=1}^{3}$ using Eq. \[eq:toy2\] and reconstructing $\omega$ with Eq. \[eq:toy1\] recovers the FOM field (equivalent to solving Eq. \[eq:udottoy\] using standard discretization schemes). For the sake of demonstration, we suppose that we retain only 2 modes in the ROM approximation. This corresponds to removing the third row in Eq. \[eq:toy2\] as follows: $$\begin{aligned} \begin{bmatrix} \dot{a}_1\\ \dot{a}_2 \end{bmatrix} = \begin{bmatrix} f_1(a_1,a_2,a_3)\\f_2(a_1,a_2,a_3) \end{bmatrix}. \end{aligned} \label{eq:toy3}$$ Approximating $\omega$ with just two modes results in losing the flow structures that are contained in the truncated mode (the vertical direction in \[fig:error\]), which yields the projection error. Furthermore, we note that $f_1$ and $f_2$ are usually functions of $a_1$, $a_2$, and $a_3$ for systems with strong nonlinearity and coupling between different modes. However, during ROM deployment, we do not usually have information regarding the unresolved dynamics ($a_3$ in this example). Thus, in GROM, the effects of the truncated scales onto the resolved scales are assumed to be negligible, as follows: $$\begin{aligned} \begin{bmatrix} \dot{a}_1\\ \dot{a}_2 \end{bmatrix} = \begin{bmatrix} f_1(a_1,a_2,0)\\f_2(a_1,a_2,0) \end{bmatrix}. \end{aligned} \label{eq:toy4}$$ We denote the reference trajectory described by Eq. \[eq:toy3\] as the true projection, which is related to Eq. \[eq:truepod\]. This defines the best low-rank approximation that can be obtained for a given number of modes, assuming we have access to the whole set of FOM scales. The difference between the GROM trajectory (corresponding to solving Eq. \[eq:toy4\]) and the true projection trajectory represents the closure error. In the present study, we address both the closure error and the projection error. First, to tackle the closure problem, we leverage the VMS framework outlined in \[sec:vms\] to develop the PGML methodology in \[sec:pgml\]. Then, we utilize the NLPOD approach in \[sec:nlpod\] to reduce the projection error by learning a compressed latent space that encapsulates some of the truncated flow structures. Variational Multiscale Method {#sec:vms} ============================= The variational multiscale (VMS) methods are general numerical discretizations that significantly increase the accuracy of classical Galerkin approximations in under-resolved simulations, e.g., on coarse meshes or when not enough basis functions are available. The VMS framework, which was proposed by Hughes and coworkers @hughes1998variational [@hughes2000large; @hughes2001large], has made a profound impact in many areas of computational mechanics (see, e.g., @codina2018variational [@john2016finite] for a survey). To illustrate the standard VMS methodology, we consider a general nonlinear partial differential equation $$\dot{\omega} = {F}(\omega), \label{eq:udot}$$ whose weak (variational) form is $$(\dot{\omega},\phi) = ({F}(\omega),\phi), \quad \forall \phi \in {\boldsymbol{X}},$$ where ${F}$ is a general nonlinear function and ${\boldsymbol{X}}$ is an appropriate test space. To build the VMS framework, we start with a sequence of hierarchical spaces of increasing resolutions: ${\boldsymbol{X}}_1$, ${\boldsymbol{X}}_1 \oplus {\boldsymbol{X}}_2$, ${\boldsymbol{X}}_1 \oplus {\boldsymbol{X}}_2 \oplus {\boldsymbol{X}}_3$, $\dots$. Next, we project system \[eq:udot\] onto each of the spaces ${\boldsymbol{X}}_1$, ${\boldsymbol{X}}_2$, ${\boldsymbol{X}}_3$, $\dots$, which yields a separate equation for each space. From a computational efficiency point of view, the goal is to solve for the $\omega$ component that lives in the coarsest space (i.e., ${\boldsymbol{X}}_1$), since this yields the lowest-dimensional system: $$(\dot{\omega},\phi) = ({F}(\omega),\phi), \quad \forall \phi \in {\boldsymbol{X}}_1. \label{eq:ux1}$$ However, system \[eq:ux1\] is *not* closed since its right-hand side involves $\omega$ components that do not belong to ${\boldsymbol{X}}_1$ (i.e., $\omega_2 \in {\boldsymbol{X}}_2$, $\omega_3 \in {\boldsymbol{X}}_3$, $\dots$): $$({F}(\omega),\phi) = ({F}(\omega_1,\omega_2,\omega_3,\dots),\phi), \quad \forall \phi \in {\boldsymbol{X}}_1. \label{eq:rhsx1}$$ Thus, the VMS closure problem needs to be solved. That is, Eq. \[eq:rhsx1\] needs to be replaced with an equation that involves only terms that belong to ${\boldsymbol{X}}_1$. In general, the VMS system in Eq. \[eq:ux1\] equipped with an appropriate closure model (i.e., a model with components in ${\boldsymbol{X}}_1$ that captures the interaction between $\omega_1$ and the scales in ${\boldsymbol{X}}_2, {\boldsymbol{X}}_3, \ldots$) yields an accurate approximation of the ${\boldsymbol{X}}_1$ component of $\omega$. The POD procedure in \[sec:pod\] yields a hierarchy of orthogonal basis functions, sorted by their contribution to the total energy. Therefore, it provides a natural fit to the VMS framework. Next, we illustrate the adoption of VMS in GROM settings to define a multi-level VMS ROM. In particular, we detail the two-scale and the three-scale VMS ROMs, while further extensions become straightforward. Two-scale VMS ROM {#sec:vms2} ----------------- The two-scale VMS (VMS-2) ROM utilizes two orthogonal spaces, ${\boldsymbol{X}}_1$ and ${\boldsymbol{X}}_2$, defined as follows: $$\begin{aligned} {\boldsymbol{X}}_1 &:= \text{span}\{\phi_1, \phi_2, \dots, \phi_R \}, \\ {\boldsymbol{X}}_2 &:= \text{span}\{\phi_{R+1}, \phi_{R+2}, \dots, \phi_N \}, \end{aligned}$$ where ${\boldsymbol{X}}_1$ represents the span of the resolved ROM scales and ${\boldsymbol{X}}_2$ is the span of the unresolved scales. Thus, $\omega$ can be written as follows: $$\omega = \sum_{k=1}^R a_k \phi_k + \sum_{k=R+1}^N a_k \phi_k = \underbrace{\omega_R}_{\text{resolved}} + \underbrace{\omega'}_{\text{unresolved}}, \label{eq:udecom2}$$ where $\omega_R \in {\boldsymbol{X}}_1$ is the resolved ROM component of $\omega$, while $\omega' \in {\boldsymbol{X}}_2$ is the unresolved component. Using this decomposition, Eq. \[eq:ux1\] can be rewritten as follows: $$\big(\dot{\omega}_R,\phi_k\big) = \big({F}(\omega_R),\phi_k\big) + \underbrace{ \bigg[\big({F}(\omega),\phi_k\big) - \big({F}(\omega_R),\phi_k\big) \bigg] }_{\text{VMS-2 closure term}}, \ \forall k \in \{1,\dots,R\}. \label{eq:vms2}$$ The bracketed term in Eq. \[eq:vms2\] is the VMS-2 closure term, which models the interaction between the ROM modes and the discarded modes. Since the unresolved component of $\omega$, $\omega'$, is not available during online deployment stage, it is not possible to exactly compute the closure term in practical settings. Instead, the closure term can be approximated using a generic function ${G}(\omega_R)$ as follows: $$\big( {G}(\omega_R), \phi_k) \approx \big({F}(\omega),\phi_k\big) - \big({F}(\omega_R),\phi_k\big),$$ and the VMS-2 ROM can be written as $$\big(\dot{\omega}_R,\phi_k\big) = \big({F}(\omega_R),\phi_k\big) + \big( {G}(\omega_R), \phi_k). \label{eq:vms22}$$ The form and parameters of ${G}$ will be defined in \[sec:pgml\]. Three-scale VMS ROM {#sec:vms3} ------------------- The *locality of modal interactions* is a cornerstone of the VMS framework. It states that neighboring modes have more mutual interactions than those who are far apart in the energy spectrum. For this reason, it is natural to distinguish between neighboring and far modes when closure modeling is performed. To this end, the flexibility of the hierarchical structure of the ROM space is leveraged to perform a three-scale decomposition of $\omega$, leading to a three-scale VMS (VMS-3) ROM, which aims at increasing the VMS-2 ROM accuracy. To construct the VMS-3 ROM, we first build three orthogonal spaces, ${\boldsymbol{X}}_1$, ${\boldsymbol{X}}_2$, and ${\boldsymbol{X}}_3$, as follows: $$\begin{aligned} {\boldsymbol{X}}_1 &:= \text{span}\{\phi_1, \phi_2, \dots, \phi_r \}, \\ {\boldsymbol{X}}_2 &:= \text{span}\{\phi_{r+1}, \phi_{r+2}, \dots, \phi_R \},\\ {\boldsymbol{X}}_3 &:= \text{span}\{\phi_{R+1}, \phi_{R+2}, \dots, \phi_N \}. \end{aligned}$$ Compared to the decomposition into resolved and unresolved scales in \[sec:vms2\], ${\boldsymbol{X}}_1$ now represents the *large resolved* ROM scales, ${\boldsymbol{X}}_2$ represents the *small resolved* ROM scales, while ${\boldsymbol{X}}_3$ denotes the unresolved ROM scales. With these definitions, $\omega$ can be written as follows: $$\begin{aligned} \omega &= \sum_{k=1}^r a_k \phi_k + \sum_{k=r+1}^R a_k \phi_k + \sum_{k=R+1}^N a_k \phi_k \\ &= \underbrace{\omega_L}_{\text{large resolved}} + \underbrace{\omega_S}_{\text{small resolved}} + \underbrace{\omega'}_{\text{unresolved}}. \end{aligned}$$ This is similar to Eq. \[eq:udecom2\] with $\omega_R = \omega_L + \omega_S$. To construct the VMS-3 ROM, we project system \[eq:udot\] onto each of the spaces ${\boldsymbol{X}}_1$ and ${\boldsymbol{X}}_2$, as follows: $$\begin{aligned} \big(\dot{\omega}_L,\phi_k\big) = \big({F}(\omega_L+\omega_S),\phi_k\big) + \bigg[\big({F}(\omega),\phi_k\big) - \big({F}(\omega_L+\omega_S),\phi_k\big) \bigg], \ k = 1,\ldots,r, \label{eq:vms31} \\ \big(\dot{\omega}_S,\phi_k\big) = \big({F}(\omega_L+\omega_S),\phi_k\big) + \bigg[\big({F}(\omega),\phi_k\big) - \big({F}(\omega_L+\omega_S),\phi_k\big) \bigg], \ k = r+1,\ldots,R. \label{eq:vms32} \end{aligned}$$ Although the two bracketed terms in Eq. \[eq:vms31\] and Eq. \[eq:vms32\] defining the VMS-3 closure terms look similar, they have different roles. The first term models basically the interaction between the large and the small resolved modes, because the interaction large-unresolved is assumed to be negligible (according to the VMS principle of locality of modal interactions). The second term models the interaction between the small resolved and the unresolved ROM modes. This allows great flexibility in choosing the structure of the different VMS ROM closure terms. This concept is investigated numerically in \[sec:res\]. Physics Guided Machine Learning {#sec:pgml} =============================== In this section, the VMS-2 and VMS-3 closure terms defined in \[sec:vms\] are approximated using only the information in the resolved scales. Specifically, we utilize a purely data-driven approach to compute the parameters of the closure models. However, instead of relying on heuristics or ad-hoc arguments to define the specific structure of the closure model (as in the standard DD-VMS @mou2021data), we exploit the capabilities of deep neural network (DNN) in approximating arbitrary functions. In particular, we use the long short-term memory (LSTM) variant of recurrent neural networks (RNNs), which has shown substantial success in data-driven modeling of time series @gers2002applying [@siami2019performance; @hua2019deep]. We emphasize that, to mitigate well-known drawbacks of data-driven modeling (e.g., sensitivity to noise in input data), the VMS ROM framework utilizes data to model only the VMS ROM closure operators, but all the other ROM operators are built by using classical Galerkin projection. Thus, our VMS ROM framework incorporates "data-driven closure," rather than "data-driven modeling" for the resolved scales. ML-VMS ROM ---------- The VMS-2 ROM in Eq. \[eq:vms22\] can be rewritten as follows: $$\dot{{\boldsymbol{a}}} = {\boldsymbol{f}}({\boldsymbol{a}}) + {\boldsymbol{c}}({\boldsymbol{a}}), \label{eqn:ml-vms-2-1}$$ where ${\boldsymbol{a}}= [a_1, a_2, \dots, a_R]^T \in \mathbb{R}^R$ is the vector of coefficients for resolved POD modes, ${\boldsymbol{f}}({\boldsymbol{a}}) = [\big({F}(\omega_R),\phi_1\big), \big({F}(\omega_R),\phi_2\big), \dots, \big({F}(\omega_R),\phi_R\big)]$ represents the Galerkin projection of the FOM operators onto the POD subspace, and ${\boldsymbol{c}}({\boldsymbol{a}}) = [c_1, c_2, \dots, c_R]^R\in \mathbb{R}^R$ is the vector of the closure (correction) terms, i.e., $c_k = ({G}(\omega_R),\phi_k)$. In the present study, we use DNN to represent the closure model, i.e., ${\boldsymbol{c}}(\cdot) \approx \pi_{\theta}({\boldsymbol{a}})$, where $\theta$ denotes the parameterization of the LSTM. The general functional form of the DNN models used for temporal forecasting can be written as follows: $$\begin{aligned} {\mathbf{h}}^{(n)} &= f_h^h({\boldsymbol{a}}^{(n)}, {\mathbf{h}}^{(n-1)}), \\ {\boldsymbol{c}}^{(n)} &= f_h^o({\mathbf{h}}^{(n)}), \end{aligned} \label{eq:dnn}$$ where ${\boldsymbol{a}}^{(n)} :={\boldsymbol{a}}(t_n) \in \mathbb{R}^R$ is the vector of modal coefficients at time $t_n$ and ${\boldsymbol{c}}^{(n)} \in \mathbb{R}^R$ is the corresponding closure term, defining the input and output of the DNN, respectively. In Eq. \[eq:dnn\], ${\mathbf{h}}\in \mathbb{R}^H$ represents the hidden-state of the neural network, $f_h^h$ and $f_h^o$ the hidden-to-hidden and hidden-to-output mappings, respectively, and $H$ the dimension of the hidden state. The Mori-Zwanzig formulation @stinis2015renormalized [@zwanzig2001nonequilibrium; @gouasmi2017priori; @pan2018data; @wang2020recurrent] shows that non-Markovian terms are required to account for the effects of the unresolved scales onto the resolved scales. Thus, the closure operators are modeled as functions of the time history of the resolved scales. We emphasize that employing a non-Markovian closure model is a key feature of the proposed PGML-VMS-ROM that is in stark contrast with the DD-VMS in @mou2021data [@koc2021verifiability], which considers only the Markovian effects. For memory embedding, we let ${\boldsymbol{c}}$ be a function of the short time history of the resolved POD coefficients, i.e., ${\boldsymbol{c}}^{(n)}(\cdot) \approx \pi_{\theta}({\boldsymbol{a}}^{(n)},{\boldsymbol{a}}^{(n-1)},\dots, {\boldsymbol{a}}^{(n-\tau)}) = \pi_{\theta}({\boldsymbol{a}}^{(n):(n-\tau)})$, where $\tau$ defines the length of the time history of ${\boldsymbol{a}}$ that is required for estimating the closure term. The LSTM allows modeling non-Markovian processes while mitigating the issue with vanishing (or exploding) gradient by employing gating mechanisms. In particular, the hidden-to-hidden mapping $f_h^h$ is defined using the following equations: $$\begin{aligned} {\mathbf{g}}_f^{(n)} &= \sigma_{f}({\mathbf{W}}_f[{\mathbf{h}}^{(n-1)},{\boldsymbol{a}}^{(n)}] + {\mathbf{b}}_f), \\ {\mathbf{g}}_i^{(n)} &= \sigma_{i}({\mathbf{W}}_i[{\mathbf{h}}^{(n-1)},{\boldsymbol{a}}^{(n)}] + {\mathbf{b}}_i), \\ \tilde{{\mathbf{s}}}^{(n)} &= \tanh{({\mathbf{W}}_s[{\mathbf{h}}^{(n-1)},{\boldsymbol{a}}^{(n)}] + {\mathbf{b}}_s)}, \\ {\mathbf{s}}^{(n)} &= {\mathbf{g}}_f^{(n)} \odot {\mathbf{s}}^{(n-1)} + {\mathbf{g}}_i^{(n)} \odot \tilde{{\mathbf{s}}}^{(n)}, \\ {\mathbf{g}}_o^{(n)} &= \sigma_{o}({\mathbf{W}}_o[{\mathbf{h}}^{(n-1)},{\boldsymbol{a}}^{(n)}] + {\mathbf{b}}_o), \\ {\mathbf{h}}^{(n)} &= {\mathbf{g}}_o^{(n)} \odot \tanh{({\mathbf{s}}^{(n)})}, \end{aligned} \label{eqn:ml-vms-2-2}$$ where ${\mathbf{g}}_f, {\mathbf{g}}_i, {\mathbf{g}}_o \in \mathbb{R}^H$ are the forget gate, input gate, and output gate, respectively, with the corresponding ${\mathbf{W}}_f, {\mathbf{W}}_i, {\mathbf{W}}_o \in \mathbb{R}^{H \times (H+R)}$ weight matrices, and ${\mathbf{b}}_f, {\mathbf{b}}_i, {\mathbf{b}}_o \in \mathbb{R}^{H}$ bias vectors. ${\mathbf{s}}\in \mathbb{R}^H$ is the cell state with a weight matrix ${\mathbf{W}}_s \in \mathbb{R}^{H \times (H+R)}$ and bias vector ${\mathbf{b}}_s \in \mathbb{R}^H$. Finally, $\sigma$ is the sigmoid activation function, and $\odot$ denotes the element-wise multiplication. We stack $l$ LSTM layers to define the hidden states, followed by a fully connected layer with a linear activation function to represent the hidden-to-output mapping. Thus, the ML-VMS-2 closure model can be written as $$\begin{aligned} {\boldsymbol{c}}^{(n)} \approx \mathcal{L} (\cdot) \circ {\mathbf{h}}_l^{(n)}(\cdot) \circ {\mathbf{h}}_{l-1}^{(n):(n-\tau)}(\cdot) \circ \dots \circ {\mathbf{h}}_1^{(n):(n-\tau)}(\cdot) \circ \mathcal{I} ({\boldsymbol{a}}^{(n):(n-\tau)}),\\ \end{aligned} \label{eqn:ml-vms-2-3}$$ where $\mathcal{L} (\cdot)$ represents the output layer with linear activation, and $\mathcal{I} (\cdot)$ denotes the input layer. Note that each of the internal LSTM layers ($i=1,2,\dots, l-1$) produces a sequence of hidden states ${\mathbf{h}}_i^{(n):(n-\tau)}$, while the the $l^{th}$ layer passes only the hidden state at the final time ${\mathbf{h}}_l^{(n)}$ to the output layer. To summarize, Eqs. , , , and yield the ML-VMS-2 ROM. In order to make use of the locality of modal interactions, the VMS-3 ROM is written as$$\begin{bmatrix} \dot{{\boldsymbol{a}}_L} \\ \dot{{\boldsymbol{a}}_S} \end{bmatrix} = {\boldsymbol{f}}({\boldsymbol{a}}) + \begin{bmatrix} {\boldsymbol{c}}_L({\boldsymbol{a}}) \\ {\boldsymbol{c}}_S({\boldsymbol{a}}) \end{bmatrix},$$ where two separate terms are dedicated to model the closure for the resolved large scales and resolved small scales. For the ML-VMS-3, the closure terms are defined as follows: $$\begin{aligned} {\boldsymbol{c}}^{(n)}_{L} &\approx \pi_{L,\theta}({\boldsymbol{a}}^{(n):(n-\tau)}) \\ & \approx \mathcal{L}_{_L} (\cdot) \circ {\mathbf{h}}_{l_L}^{(n)}(\cdot) \circ {\mathbf{h}}_{l-1_L}^{(n):(n-\tau)}(\cdot) \circ \dots \circ {\mathbf{h}}_{1_L}^{(n):(n-\tau)}(\cdot) \circ \mathcal{I} ({\boldsymbol{a}}^{(n):(n-\tau)}),\\ {\boldsymbol{c}}^{(n)}_{S} &\approx \pi_{S,\theta}({\boldsymbol{a}}^{(n):(n-\tau)}) \\ & \approx \mathcal{L}_{_S} (\cdot) \circ {\mathbf{h}}_{l_S}^{(n)}(\cdot) \circ {\mathbf{h}}_{l-1_S}^{(n):(n-\tau)}(\cdot) \circ \dots \circ {\mathbf{h}}_{1_S}^{(n):(n-\tau)}(\cdot) \circ \mathcal{I} ({\boldsymbol{a}}^{(n):(n-\tau)}). \end{aligned}$$ We note that we have more flexibility in ML-VMS-3 than in ML-VMS-2. Hence, it is possible to make richer descriptions of the interactions between large resolved, small resolved, and unresolved scales. PGML-VMS ROM ------------ Critical aspects that should be considered during the adoption of ML based approach include their reliability, robustness, and trustworthiness. Previous studies @pawar2021physics [@pawar2021model; @pawar2021multi] have reported high levels of uncertainty in the predictions of vanilla-type ML methods, especially for sparse data and incomplete governing equations regimes. In order to mitigate this issue, we utilize the physics-guided machine learning (PGML) paradigm to incorporate known physical arguments and constraints into the learning process. In particular, we exploit a modular approach to modify the neural network architectures through layer concatenation to inject physical information at different points in the latent space of the given DNN. This adaptation augments the performance during both the training and the deployment phases, and results in significant reduction in the uncertainty levels of the model prediction, as we demonstrate in \[sec:res\]. In the PGML framework, the features extracted from the physics-based model are embedded into the generic $i^{th}$ intermediate hidden layer along with the latent variables. In order to build the PGML-VMS framework, we consider the Galerkin projection of the governing equations onto different POD modes to define the physics-based features (since they are derived from physical principles). Thus, the PGML-VMS-2 closure model can be written as $$\begin{aligned} {\boldsymbol{c}}^{(n)} \approx \mathcal{L} (\cdot) \circ {\mathbf{h}}_l^{(n)}(\cdot) &\circ \dots \circ \mathcal{C}\bigg({\mathbf{h}}_i^{(n):(n-\tau)}(\cdot), {\boldsymbol{f}}^{(n):(n-\tau)} \bigg) \circ {\mathbf{h}}_{i-1}^{(n):(n-\tau)}(\cdot) \circ \dots \circ {\mathbf{h}}_1^{(n):(n-\tau)}(\cdot) \circ \mathcal{I} ({\boldsymbol{a}}^{(n):(n-\tau)}), \end{aligned} \label{eq:pgml2}$$ where $\mathcal{C}(\cdot,\cdot)$ represents the concatenation operation, and ${\boldsymbol{f}}^{(n):(n-\tau)}$ is the time history of projecting the FOM operators onto the truncated POD subspace. We highlight that there is no significant computational load for the calculation of ${\boldsymbol{f}}:= A{\boldsymbol{a}}+ {\boldsymbol{a}}^\top B {\boldsymbol{a}}$, since $A$ and $B$ are already precomputed. A schematic illustration of the PGML adaptation of the standard LSTM architecture is depicted in \[fig:pgml\]. In this figure, 3 LSTM layers are used (i.e., $l=3$), followed by a dense layer to provide the mapping from hidden state to the closure terms. The physics-based features are injected into the LSTM latent space after two hidden layers. One of the main advantages of the novel PGML framework in \[fig:pgml\] is its modularity and simplicity. For example, based on the level of fidelity and our confidence in the injected features, we can promptly change the layer at which we embed them. ![Illustration of the PGML methodology with concatenated LSTM layers. In this figure, a time history of $2$ time steps is used while physics-based features (yellow circles in the figure) are injected into the LSTM latent space after the second hidden layer ($i=2$).<span data-label="fig:pgml"></span>](lstm_pgml.pdf){width="90.00000%"} Finally, the PGML-VMS-3 closure models can be written as $$\begin{aligned} {\boldsymbol{c}}^{(n)}_L \approx \mathcal{L}_{_L} (\cdot) \circ {\mathbf{h}}_{l_L}^{(n)}(\cdot) &\circ \dots \circ \mathcal{C}\bigg({\mathbf{h}}_{i_L}^{(n):(n-\tau)}(\cdot), {\boldsymbol{f}}_{_L}^{(n):(n-\tau)} \bigg) \circ {\mathbf{h}}_{i-1_L}^{(n):(n-\tau)}(\cdot) \circ \dots \circ {\mathbf{h}}_{1_L}^{(n):(n-\tau)}(\cdot) \circ \mathcal{I} ({\boldsymbol{a}}^{(n):(n-\tau)}),\\ {\boldsymbol{c}}^{(n)}_S \approx \mathcal{L}_{_S} (\cdot) \circ {\mathbf{h}}_{l_S}^{(n)}(\cdot) &\circ \dots \circ \mathcal{C}\bigg({\mathbf{h}}_{i_S}^{(n):(n-\tau)}(\cdot), {\boldsymbol{f}}_{_S}^{(n):(n-\tau)} \bigg) \circ {\mathbf{h}}_{i-1_S}^{(n):(n-\tau)}(\cdot) \circ \dots \circ {\mathbf{h}}_{1_S}^{(n):(n-\tau)}(\cdot) \circ \mathcal{I} ({\boldsymbol{a}}^{(n):(n-\tau)}). \end{aligned} \label{eq:pgml3}$$ Note that in Eq. \[eq:pgml3\], we enjoy higher flexibility in choosing the physics-based features injected for each of the large and small scale closure models. For instance, in the present study, we benefit from the locality of modal interactions by embedding the Galerkin propagator of only a few relevant neighboring modes (i.e., ${\boldsymbol{f}}_{_L}$ and ${\boldsymbol{f}}_{_S}$ in \[eq:pgml3\]), rather than including all of them in the LSTM learning (i.e., ${\boldsymbol{f}}$ in \[eq:pgml2\]). Nonlinear POD {#sec:nlpod} ============= In \[sec:vms\] and \[sec:pgml\], we addressed the closure problem. That is, we aimed at correcting the ROM equations for the dynamics of the resolved scales including the effects of the unresolved scales onto the dynamics of the resolved scales. However, the reconstructed flow fields were approximated within the span of the retained modes, as shown in Eq. \[eq:upod\]. Nonetheless, for turbulent flows the important flow structures generally span a large number of modes. Thus, truncating the solution beyond a small number of modes results in a large projection error. In other words, the component $\omega' = \sum_{k=R+1}^{N} a_k \phi_k$ that cannot be approximated by the resolved POD basis becomes significant. In this section, we adapt the nonlinear POD (NLPOD) framework, introduced in @ahmed2021nonlinear, to model the unresolved part of the field. \[fig:framework\] presents a schematic representation of the PGML-VMS-3 model for the large and small resolved scales combined with NLPOD for enhanced field reconstruction. Note that, although both the PGML-VMS-3 and the NLPOD aim at increasing the ROM accuracy, they target different error sources: the PGML-VMS-3 aims at mitigating the closure error, whereas the NLPOD aims at alleviating the projection error. The NLPOD methodology is based on combining POD with autoencoder (AE) techniques from ML to learn a latent representation of the POD expansion. It leverages the predefined hierarchy of POD basis functions, which satisfy the conservation laws and physical constraints, together with the capabilities of DNN to reveal the nonlinear correlations between the modes. Rather than using the NLPOD for the compression of the total set of POD coefficients, we constrain it to learn a few latent variables, which represent only the unresolved scales. To construct the NLPOD, we first define ${\boldsymbol{b}}= \{a_k\}_{k=R+1}^{K}$ corresponding to an almost full-rank POD expansion, where $K\le N$ can be defined using the RIC spectrum (e.g., $\text{RIC}(K) \ge 99.99\%$). The goal is to learn ${\boldsymbol{z}}= \{z_k\}_{k=1}^{q}$, where $q \ll K$ denotes the dimension of the AE latent space. The AE starts with an encoding process that involves applying a series of nonlinear mappings onto the input data to shrink the dimensionality down to a bottleneck layer representing the low rank or latent space embedding. An inverse mapping from the latent space variables to the same input is performed by another set of nonlinear mappings, defining the decoding part. For the NLPOD, the encoder and decoder can be represented as follows: $$\begin{aligned} \text{Encoder} \ \eta&: {\boldsymbol{b}}\in \mathbb{R}^{K-R} \mapsto {\boldsymbol{z}}\in \mathbb{R}^{q}, \qquad \text{Decoder} \ \zeta&: {\boldsymbol{z}}\in \mathbb{R}^{q} \mapsto {\boldsymbol{b}}\in \mathbb{R}^{K-R} , \end{aligned}$$ and they are trained jointly to minimize the following objective function: $$\mathcal{J} = \sum_{n=1}^{N_{train}}\| {\boldsymbol{b}}^{(n)} - (\eta \circ \zeta)({\boldsymbol{b}}^{(n)}) \|,$$ where $N_{train}$ is the number of training samples. In order to temporally propagate ${\boldsymbol{z}}$, we can use any of the regression tools, including sparse regression, Gaussian process regression, Seq2seq algorithms, temporal fusion transformers, and auto-regression methods. In the present study, we use LSTM architectures that are similar to the ones used in \[sec:pgml\] to learn the one time-step mapping from ${\boldsymbol{z}}^{(n)}$ to ${\boldsymbol{z}}^{(n+1)}$, as follows: $$\begin{aligned} {\boldsymbol{z}}^{(n+1)} \approx \mathcal{L} (\cdot) \circ {\mathbf{h}}_l^{(n)}(\cdot) \circ {\mathbf{h}}_{l-1}^{(n):(n-\tau)}(\cdot) \circ \dots \circ {\mathbf{h}}_1^{(n):(n-\tau)}(\cdot) \circ \mathcal{I} ({\boldsymbol{z}}^{(n):(n-\tau)}). \end{aligned}$$ Note that the number of layers, $l$, and the length of time history, $\tau$, are not necessarily equal to those in \[sec:pgml\]. Moreover, the LSTM and AE can be trained either jointly or separately. In the present study, we train them separately for the sake of simplicity and to facilitate the NLPOD combination with other time series prediction tools. ![Schematic representation of the PGML-VMS-3 model for the large and small resolved scales, combined with NLPOD for enhanced field reconstruction. We note that PGML-VMS-3 is built upon a GROM for the first $R$ modes and mitigates the closure error (i.e., the effect of the truncated scales onto the resolved scales). In a complementary fashion, NLPOD implements an equation-free model for the truncated scales to reduce the projection error (i.e., the effect of the truncated scales onto the flow field reconstruction).<span data-label="fig:framework"></span>](framework2.pdf){width="100.00000%"} Results and Discussion {#sec:res} ====================== In this section, we perform a numerical investigation of the proposed PGML-VMS-ROM methodologies (with and without the NLPOD extension) using the two dimensional (2D) vortex merger problem @san2013coarse, governed by the following vorticity transport equation: $$\partial_t \omega + J(\omega,\psi) = \dfrac{1}{\text{Re}} \Delta \omega, \qquad \text{in} \ \Omega \times [0,T].$$ We consider a spatial domain of dimensions $(2\pi \times 2\pi)$ with periodic boundary conditions. The flow is initialized with a pair of co-rotating Gaussian vortices with equal strengths centered at $(x_1,y_1) = ( 5\pi/4,\pi)$ and $(x_2,y_2) = ( 3\pi/4,\pi)$ as follows: $$\omega(x,y,0) = \exp\left( -\rho \left[ (x-x_1)^2 + (y-y_1)^2 \right] \right) + \exp{\left( -\rho \left[ (x-x_2)^2 + (y-y_2)^2 \right] \right)}, \label{eq:init}$$ where $\rho$ is a parameter that controls the mutual interactions between the two vortical motions, set at $\rho = \pi$ in the present study. For the FOM simulations, we consider a regular Cartesian grid resolution of $256\times256$ (i.e., $\Delta x = \Delta y = 2\pi/256$), with a time-step of $0.001$. Vorticity snapshots are collected every 100 time-steps for $t\in [0,30]$, totalling 300 snapshots. The evolution of the vortex merger problem at selected values of the Reynolds number is depicted in \[fig:fom\], which illustrates the convective and interactive mechanisms affecting the transport and development of the two vortices. ![Samples of temporal snapshots of the vorticity field for the vortex merger problem at different values of Reynolds number.<span data-label="fig:fom"></span>](FOM.pdf){width="80.00000%"} In terms of POD analysis, we use $R=6$ to define the total number of resolved scales. For the three-scale VMS investigation, we split the resolved modes into 2 resolved large scales (i.e., $r=2$) and 4 resolved small scales. For the NLPOD study, we find that $K=20$ corresponds to near full-rank approximation of the flow field at all values of the Reynolds number. This is illustrated by the plot of the RIC values as a function of the number of POD modes at $\text{Re}=3000$ in \[fig:ric\]. Following a systematic approach, in \[sec:6.1\], we first present our computational results for ML-VMS-2 and PGML-VMS-2 to quantitatively demonstrate the benefit of incorporating the physics guided machine learning approach. We then present the results for PGML-VMS-3 to highlight the flexibility and accuracy gain of the three-scale approach. Finally, in \[sec:6.2\], we reveal the additional role of the NLPOD approach by illustrating the performance of the PGML-VMS-3+NLPOD approach. ![RIC values as a function of the modal truncation for the vortex merger problem at $\text{Re} = 3000$.<span data-label="fig:ric"></span>](ric.pdf){width="61.00000%"} Multi-level VMS closure for resolved scales {#sec:6.1} ------------------------------------------- We store data corresponding to $\text{Re} \in \{500,750,1000,\dots,3000\}$ (in increments of 250), but we use only the data collected at $\text{Re} \in \{500,750,1000\}$ for neural network training, while the remaining data is reserved for testing purposes. First, we explore the combination of multi-level variational multiscale methods with machine learning. \[fig:ml2\] displays the results of applying the ML-VMS-2 framework to model the closure term at $\text{Re}=3000$. In particular, we run a group of 10 LSTMs with different initializations of the neural network weights and utilize the deep ensemble method to quantify the uncertainty in the predictions. On the average, the ML-VMS-2 method provides accurate results compared to the GROM results. However, the uncertainty levels, described by the standard deviation in the ensemble predictions, are high. This is especially evident at the late time instants as the uncertainty propagates and grows with time. ![The time evolution of the first 6 modes of the vortex merger problem with the two-level VMS using ML closure, compared to the true projection and GROM (without closure) predictions. The solid line represents the mean values ($\mu$) from an ensemble of 10 different LSTM neural networks trained with different weight initalizations, while the shaded area defines the uncertainty bounds using standard deviation ($\sigma$) values. For better visualization, the shaded band is plotted with $\mu \pm 5\sigma$.<span data-label="fig:ml2"></span>](ML2_Modal_coefficients_Re_3000.pdf){width="83.00000%"} In order to increase the closure model robustness and reduce the uncertainty levels, we apply the PGML to inject physics-based features, as detailed in \[sec:pgml\]. \[fig:pgml2\] shows the evolution of the first 6 POD modal coefficients using the PGML-VMS-2. We can observe a significant reduction in the uncertainty levels as depicted by the shaded area, compared to the ML-VMS-2. It is also clear that the GROM yields inaccurate predictions. Moreover, we can observe that the deviations of the GROM trajectory from the true projections are larger for the latest resolved modes. In fact, this observation also applies to the ML-VMS-2 and PGML-VMS-2, which provide better results for the first two or three modes than the remaining ones. ![The time evolution of the first 6 modes of the vortex merger problem with the two-level VMS using PGML closure, compared to the true projection and GROM (without closure) predictions. The solid line represents the mean values ($\mu$) from an ensemble of 10 different LSTM neural networks trained with different weight initalizations, while the shaded area defines the uncertainty bounds using standard deviation ($\sigma$) values. For better visualization, the shaded band is plotted with $\mu \pm 5\sigma$.<span data-label="fig:pgml2"></span>](PGML2_Modal_coefficients_Re_3000.pdf){width="83.00000%"} In \[fig:rhs\], we plot the ROM propagator $\dot{{\boldsymbol{a}}}$ computed by the Galerkin method (i.e., with truncation, with no access to the unresolved scales, and without correction) against the true propagator (assuming access to all the flow scales). We find that the GROM equations can adequately describe the dynamics of the first modes, but fail to do so for the last ones. This can be explained by locality of information transfer, which is one of the main concepts used in the VMS development. Such locality indicates that the neighboring modes exhibit larger mutual interactions than the modes which are far apart. Thus, describing the dynamics of the leading modes requires more information from the first few scales than from the remaining scales. In other words, the resolved scales become almost sufficient to define the propagator of the leading modes. On the other hand, the last modes are adjacent to the unresolved scales.Thus, the mode truncation considerably affects the dynamics of the last modes. ![Comparison between the ROM propagator computed by Galerkin projection (with truncation, i.e., $\dot{a_k} = ( -J(\omega_R,\psi_R) + \nabla^2 \omega_R , \phi_k$), against the true (FOM projection) propagator (i.e., $\dot{a_k} = ( -J(\omega,\psi) + \nabla^2 \omega , \phi_k$) at $\text{Re} = 3000$, and $R=6$. We notice that the Galerkin projection accurately captures the dynamics of the first modes, but a discrepancy appears at the latest modes, which motivates the use of multi-level VMS closure.<span data-label="fig:rhs"></span>](RHS_Re_3000.pdf){width="83.00000%"} In order to improve the quality of the closure model, we leverage the locality of modal interactions and apply the three-level VMS closure to correct the ROM dynamics. In particular, we split the resolved scales into two parts: the first 2 modes represent the largest resolved scales, while the remaining 4 modes represent the small resolved scales. The ML-VMS-3 predictions of the temporal dynamics for the first 6 modes are shown in \[fig:ml3\]. Compared to \[fig:ml2\], the ML-VMS-3 provides more accurate results than the ML-VMS-2, even in terms of uncertainty levels. ![The time evolution of the first 6 modes of the vortex merger problem with the three-level VMS using ML closure, compared to the true projection and GROM (without closure) predictions. The solid line represents the mean values ($\mu$) from an ensemble of 10 different LSTM neural networks trained with different weight initalizations, while the shaded area defines the uncertainty bounds using standard deviation ($\sigma$) values. For better visualization, the shaded band is plotted with $\mu \pm 5\sigma$.<span data-label="fig:ml3"></span>](ML3_Modal_coefficients_Re_3000.pdf){width="83.00000%"} Finally, the PGML-VMS-3 results are shown in \[fig:pgml3\], where we can see improved results across all the resolved scales with very low levels of uncertainty. The mean squared error (MSE) between the true projection values of the resolved scales and the prediction of the ROM with and without various closure models is shown in \[fig:mse\]. We can see that the VMS closure provides at least one order of magnitude better predictions than the baseline GROM. Moreover, the PGML-VMS is superior to the ML-VMS, especially for Reynolds number values that are not included in the LSTM training. This can be attributed to the fact that PGML employs physics-based features derived from the governing equations, resulting in improved extrapolatory capabilities of the overall model. Finally, the three-level variant of VMS is providing more accurate ROMs than VMS-2, making use of the locality of information transfer to build more localized closure models. ![The time evolution of the first 6 modes of the vortex merger problem with the three-level VMS using PGML closure, compared to the true projection and GROM (without closure) predictions. The solid line represents the mean values ($\mu$) from an ensemble of 10 different LSTM neural networks trained with different weight initalizations, while the shaded area defines the uncertainty bounds using standard deviation ($\sigma$) values. For better visualization, the shaded band is plotted with $\mu \pm 5\sigma$.<span data-label="fig:pgml3"></span>](PGML3_Modal_coefficients_Re_3000.pdf){width="83.00000%"} ![Mean squared error (MSE) between the true values of modal coefficients and the predictions of GROM, ML-VMS-2, ML-VMS-3, PGML-VMS-2, and PGML-VMS-3.<span data-label="fig:mse"></span>](mse.pdf){width="75.00000%"} NLPOD for unresolved scales {#sec:6.2} --------------------------- The reconstructed vorticity fields from GROM, true projection, and PGML-VMS-3 at final time (i.e., $t=30$) at $\text{Re}=3000$ are visualized in \[fig:field\]. We can see that the GROM field is significantly inaccurate. In contrast, the PGML-VMS-3 is very close to the true projection field. This suggests that the PGML-VMS-3 is successful in providing accurate closure terms in such a way that the resulting ROM trajectory converges to the best linear approximation with 6 modes. Nonetheless, compared to the FOM solution, it is clear that 6 POD modes are not enough to capture all the relevant flow structures, especially at large values of the Reynolds number. On the other hand, building a projection-based ROM with increased number of modes will result in an undesired higher computational burden. In order to cure this limitation, we apply the NLPOD methodology from \[sec:nlpod\] to learn a latent space representation of important unresolved scales. We find that the value $K=20$ corresponds to $\text{RIC}\ge 99.99\%$, so we consider ${\boldsymbol{b}}= \{a_k\}_{k=7}^{20} \in \mathbb{R}^{14}$ in the NLPOD extension. We use the NLPOD to learn a two-dimensional compression of the resolved scales, i.e., ${\boldsymbol{z}}= \{z_k\}_{k=1}^{2}\in \mathbb{R}^{2}$. \[fig:nlpod\] displays the reconstructed vorticity fields at the final time from the true projection of the FOM field onto the first 6 and the first 20 POD modes. We notice that the FOM flow scales can be adequately captured by the subspace spanned by the first 20 POD modes. Furthermore, the plots clearly show that the combination of PGML-VMS-3 for the first 6 modes and NLPOD for the subsequent 14 modes (i.e., a total of 20 modes) provides improved field reconstruction. We highlight that the computational overhead of the online deployment of the PGML-VMS closure and NLPOD is negligible compared to solving the projection-based ROM with 6 modes. ![Comparison between the FOM vorticity field at the final time (i.e., $t=30$) and the reconstruction from true projection (i.e., optimal reconstruction), GROM, and PGML-VMS-3. Note that the PGML-VMS-3 field is very similar to the true projection field, which implies that the closure error is minimized. However, there are clear differences between the FOM and PGML-VMS-3 results, which suggest a significant projection error in the PGML-VMS-3 model. <span data-label="fig:field"></span>](Reconstruction_Re=3000.pdf){width="75.00000%"} ![Comparison between the FOM vorticity field at final time (i.e., $t=30$) and the reconstruction from true projection (i.e., optimal reconstruction) at two different values of modal truncation, as well as the predictions of the PGML-VMS-3 for the dynamics of the first 6 modes, augmented with NLPOD for the following 14 modes (i.e., a total of $K=20$ modes) to reduce the projection error.<span data-label="fig:nlpod"></span>](Reconstruction_NLPOD_Re=3000.pdf){width="75.00000%"} The CPU times for different portions of the FOM and ROMs are listed in \[table:CPU\]. For the ROMs, we can see that the majority of the time is spent to train the neural networks during the offline stage. We note that this time can be significantly reduced by considering parallel training algorithms that make use of distributed hardware facilities. We also notice that the three-level VMS framework takes about twice the time taken by the two-level VMS due to the use of two distinct neural networks,
{'source': 'arXiv_out/2205'}