1 Introduction

Computational methods have become a common practice in engineering design. Despite this notably widespread utilization, complex models, which require more computational power than is available, will probably ever exist, even with the strong increase of processors speed. Computational fluid dynamics (CFD) usually requires millions of degrees of freedom to obtain an accurate answer, which, as a result, restricts the technique for selected cases, also meaning it cannot be used in optimization studies or even for analyzes that require several evaluations in different situations. In this context, the Reduced Order Model (ROM) can play a crucial role, allowing a drastic reduction of the computational effort to evaluate new scenarios based on a selected group of pre-evaluated conditions. The ROM consists of the construction of a simpler model that can describe a complex one with the required accuracy. Mathematically speaking, this implies reducing the number of variables to be solved, and consequently the computational demands as well. Such reduced models may be based either on physical simplifications or on “black-box” models in which the relation between input and output data is established (e.g. neural networks). The ROM proposed herein relies on a sophisticated fashion of the physical simplification, based on a flow modal analysis. The development of this framework starts with the flow modes being found through proper orthogonal decomposition (POD) [1] extracted from a selected group of Full Order Model (FOM) solutions. After that, the Navier–Stokes equations are projected on the most energetic modes, resulting on an ordinary differential equation for the modes temporal coefficients as a substitute for the original partial differential equations system [13]. In general, the number of modes required to represent a significant amount of the energy for many fluid flows is dramatically lower than the number of degrees of freedom (mesh nodes) in a CFD analysis. This results on a system of equations that can be solved with reasonable accuracy and orders of magnitude faster than a full order model. The construction of such model still requires significant computational effort during an offline stage for snapshots collection.

The principle of the method is rather simple, but there are serious consequences in leaving the less energetic modes behind. Despite their lower energy, they often have an important role in terms of energy dissipation and this may cause the ROM model to become unstable, requiring stabilization strategies [47] that, in the case of fluid flows, would often act like turbulence closure modes [8]. As for strong nonlinear problems, another important aspect to be considered is that the internal products from the projections operations must be frequently updated, which entails significant computational costs and reduces the ROM gain with respect to the FOM [12]. Several techniques have been developed to overcome this limitation, such as DEIM [9] (Discrete Empirical Interpolation Method), DBPIM [10] (Discrete Best Point Interpolation Method), MPE [11] (Missing Point Estimation), GNAT [12] (Gauss–Newton Approximated Tensor quantities) and some combinations between these methods [13].

The utilization of ROM with different strategies has been already investigated for several classes of flow problems. The method is rather popular for aerodynamics [1416], including aeroelasticity [17] and rigid body motion [18] problems. Considering the potential development of much faster fluid flow simulations, the flow control applications are also a common drive for ROM development [1921]. Some basic flows were also investigated using ROM such as the flow around a 2D squared [22] or circular [23] cylinder, the flow in lid-driven cavities [23, 24] and around a 3D circular cylinder [25]. More specific applications such as shallow water flows can also be found in the literature [26].

This paper illustrates the application of the classical Galerkin-ROM technique combined with POD, and presents, firstly, the snapshot matrix structure adopted for POD, then the Galerkin projection and its application in three examples of increasing complexity: beginning with the linear heat equation in a one-dimensional domain, then the one-dimensional Burgers’ equation and, finally, the incompressible Navier–Stokes equation in a two-dimensional domain for a backward-facing step flow. The last example is analyzed for different Reynolds numbers and the influence of the snapshots choice on the ROM’s numerical errors. The remainder of the paper is organized as follows. The second section of this paper reviews the main POD ideas and includes an image compression example. Section 3 presents the Galerkin-ROM construction and examples and the last section offers a summary of main conclusions.

2 Proper orthogonal decomposition (POD)

Proper orthogonal decomposition [1] is essentially a linear procedure that takes a given collection of input data and creates an orthogonal basis constituted by functions estimated as the solutions of an integral eigenvalue problem called a Fredholm equation. By definition, these eigenfunctions are characteristic of the most probable realizations of the input data, being also possible to show that they are optimal in terms of the energy representation within the data [27]. With the primary purpose of investigating the so-called Coherent Structures, Lumley introduced the POD method for turbulence in 1967 [28]. The POD can be considered as a natural idea to replace the usual Fourier decomposition in nonhomogeneous directions [1]. The POD method was independently presented for different purposes by several scientists, in particular by Kosambi [29], Loève [30], Karhunen [31], Pougashev [32] and Obukhov [33]. For this reason, the technique is known by a wide variety of names such as Karhunen-Loève decomposition or expansion, Principal Component Analysis [34] and Hotelling Analysis [35]. With respect to the field of application, POD was used not only for fluid flow, but also for several applications such as random variables, image processing, signal analysis and data compression. More recently, certain strategies, such as PGD [36] (proper general decomposition), aimed at enabling faster mode extraction have been developed, but this paper will focus on the classical POD. Even without the generation of a POD-based ROM, the information obtained by POD may be helpful to investigate some fluid flows [37].

2.1 Description of the POD derivation

As described in several references [1] [38] [23] and herein reproduced, the POD can be interpreted as a procedure for extracting spatial basis functions from data that are dependent on both time and space. Consider a set of discrete snapshots of a transient function fluctuation \({\mathbf{u}}({\mathbf{x}},t)\), where x are the spatial coordinates and t is time, represented by \({\mathbf{u}}({\mathbf{x}},t_{i} )\) for i = 1,…, M. The observations are assumed to form a linear, finite-dimensional Hilbert space L 2 in a spatial domain D. The basis functions (or modes) \(\left\{ {{\varvec{\uppsi}}_{k} \left( {\mathbf{x}} \right)} \right\}\) are computed such that the reconstruction,

$${\mathbf{u}}({\mathbf{x}},t_{i} ) = \sum\limits_{k = 1}^{M} {\alpha_{k} \left( {t_{i} } \right)} \,{\varvec{\uppsi}}_{k} \left( {\mathbf{x}} \right),\,\,\,\,\,\,i = 1\,,\, \ldots \,,\,\,M;$$
(2.1)

where

$${\mathbf{U}}({\mathbf{x}},t_{i} ) = \overline{{\mathbf{U}}} + {\mathbf{u}}({\mathbf{x}},t_{i} )$$
(2.2)

is optimum in the sense that the average least-square truncation error,

$$\varepsilon_{m} = \overline{{\left\| {\,{\mathbf{u}}({\mathbf{x}},t_{i} ) - \sum\limits_{k = 1}^{m} {\alpha_{k} \left( {t_{i} } \right)} \,{\varvec{\uppsi}}_{k} \left( {\mathbf{x}} \right)\,} \right\|^{2} }}$$
(2.3)

is a minimum for any given number m ≤ M. Herein \(\left\| {\, \cdot \,} \right\|\) denotes the L 2—norm given by \(\left\| f \right\| = \left\langle {f,f} \right\rangle^{{{1 \mathord{\left/ {\vphantom {1 2}} \right. \kern-0pt} 2}}}\), where \(\left\langle {\,\,,\,\,} \right\rangle\) denotes the Euclidean inner product and \(\overline{f} = \sum\nolimits_{j = 1}^{M} {{{f\left( {x,t_{j} } \right)} \mathord{\left/ {\vphantom {{f\left( {x,t_{j} } \right)} M}} \right. \kern-0pt} M}}\) is the ensemble average. This optimization problem is equivalent to the eigenvalue problem [1]

$$\int\limits_{D} {\overline{{{\mathbf{u}}\left( {\mathbf{x}} \right){\mathbf{u}}^{ * } \left( {\mathbf{y}} \right)}} \,{\varvec{\uppsi}}\left( {\mathbf{y}} \right)d{\mathbf{y}} = \lambda \,} {\varvec{\uppsi}}\left( {\mathbf{x}} \right)$$
(2.4)

which is a homogeneous Fredholm integral equation of the second kind. Then, the optimal basis functions can be calculated as the eigenfunctions of the previous equation kernel. In the finite dimensional case the modes \(\left\{ {{\varvec{\uppsi}}_{k} \left( {\mathbf{x}} \right)} \right\}\) and their eigenvalues \(\lambda_{i} = \sigma_{i}^{2}\) can be computed from the singular value decomposition (SVD) or eigenvalue decomposition (EVD) [39] from the snapshots matrix

$$S = \left[ {\begin{array}{*{20}c} {{\mathbf{u}}({\mathbf{x}},t_{1} )} \\ {{\mathbf{u}}({\mathbf{x}},t_{2} )} \\ \vdots \\ {{\mathbf{u}}({\mathbf{x}},t_{M} )} \\ \end{array} } \right] = \left[ {\begin{array}{*{20}c} {u\left( {{\mathbf{x}}_{1} ,t_{1} } \right)} & {v\left( {{\mathbf{x}}_{1} ,t_{1} } \right)} & {u\left( {{\mathbf{x}}_{2} ,t_{1} } \right)} & {v\left( {{\mathbf{x}}_{2} ,t_{1} } \right)} \\ {u\left( {{\mathbf{x}}_{1} ,t_{2} } \right)} & {v\left( {{\mathbf{x}}_{1} ,t_{2} } \right)} & {u\left( {{\mathbf{x}}_{2} ,t_{2} } \right)} & {v\left( {{\mathbf{x}}_{2} ,t_{2} } \right)} \\ \vdots & \vdots & \vdots & \vdots \\ {u\left( {{\mathbf{x}}_{1} ,t_{M} } \right)} & {v\left( {{\mathbf{x}}_{1} ,t_{M} } \right)} & {u\left( {{\mathbf{x}}_{2} ,t_{M} } \right)} & {v\left( {{\mathbf{x}}_{2} ,t_{M} } \right)} \\ \end{array} \,\,\,\,\begin{array}{*{20}c} \cdots & {u\left( {{\mathbf{x}}_{N} ,t_{1} } \right)} & {v\left( {{\mathbf{x}}_{N} ,t_{1} } \right)} \\ \cdots & {u\left( {{\mathbf{x}}_{N} ,t_{2} } \right)} & {v\left( {{\mathbf{x}}_{N} ,t_{2} } \right)} \\ \ddots & \vdots & \vdots \\ \cdots & {u\left( {{\mathbf{x}}_{N} ,t_{M} } \right)} & {v\left( {{\mathbf{x}}_{N} ,t_{M} } \right)} \\ \end{array} } \right]$$
(2.5)

using three alternatives, depending on the spatial resolution (number of nodes N) and the temporal resolution (number of snapshots M) [40]:

  • $${\text{SVD for}}\;S \in {\mathbf{R}}^{NxM} :\;S\phi_{i} = \sigma_{i} \,\psi_{i}$$
    (2.6)
  • $${\text{EVD for}}\;S\,S^{T} \in {\mathbf{R}}^{NxN} :\;SS^{T} \psi_{i} = \lambda_{i} \,\psi_{i} \; {\text{if }}N \ll \, M$$
    (2.7)
  • $${\text{EVD for}}\;S^{T} S \in {\mathbf{R}}^{MxM} :\;S^{T} S\phi_{i} = \lambda_{i} \,\phi_{i} {\text \, \rm {and}} \, \;\psi_{i} = \sigma_{i}^{ - 1} S\phi_{i} \;{\text \, \rm {if }} \, M \, \ll \, N$$
    (2.8)

The last option is especially suitable for CFD data, where the spatial resolution is usually much higher than the temporal resolution, leading to a low cost eigenvalue problem when compared to the CFD nonlinear solver. However, the method is not restricted to simulation data and may be used for experimental measurements as well, including images from an experiment [41]. This approach is also known as Method of Snapshots [4244]. In order to quantify the number of modes necessary to represent the information stored in a dataset, it is worth defining the relative information content (RIC) by

$${\text{RIC}}\left( m \right) = \frac{{\sum\limits_{i = 1}^{m} {\sigma_{i} } }}{{\sum\limits_{i = 1}^{M} {\sigma_{i} } }}$$
(2.9)

When the snapshots consist of fluid flow velocities, it is possible to show that the RIC has a direct relationship with the fluid kinetic energy [1].

2.2 Example of image processing by SVD

The use of SVD for image processing is an example commonly explored in ROM presentations. Consider an image stored in the RGB format, where each pixel has values of Red, Green and Blue scales, which are going to be the data to be reduced. The RGB data will be treated like three velocity components u, v and w. Appling the SVD to the image data (through a Matlab® routine), it is possible to evaluate the singular values σ i and the RIC. The results are shown in Fig. 1, where it is possible to identify the decay of the singular values together with the accumulated information stored depending on the number of modes considered.

Fig. 1
figure 1

Singular values (σ) and relative information content (RIC) for an image

The information extracted from the SVD can then be used to build a representation of the same image with reduced data, as presented in Fig. 2. The figure shows the representation of 50, 75 and 99 % of RIC, which requires 3, 15 and 255 modes respectively. This analysis encourages the investigation of fluid flows in order to verify whether these can be represented by a reduced amount of data, as described in the next section. After that, the governing equations can be solved only for the dominant modes.

Fig. 2
figure 2

Representation of a little beautiful girl image with reduced set of data

3 Reduced order model (ROM)

The POD has the ability to reveal the most relevant modes taking into account a group of FOM solutions and a desired level of information (energy) representation. In order to derive a ROM with this information, different strategies may be used [16]. The Galerkin projection is a common approach [1] and can be carried out either directly on the discretized system, which has to be solved by the numerical scheme, or the model can be reduced through a projection of the original equations to be solved on the selected modes. In the first case, it is necessary to have access to the matrices from the numerical scheme and to develop criteria to update the ROM for nonlinear problems. For the purposes of the present research, the second one was chosen, since the ROM can be derived independently of the snapshots source, which can even come from commercial CFD codes.

3.1 Galerkin projection of the Navier–Stokes equations

First, by describing the Galerkin projection of the viscous incompressible Navier–Stokes equations, which may be written in their non-dimensional form as

$$\frac{{\partial {\mathbf{U}}}}{\partial t}\mathcal{ + }{\mathbf{U}} \cdot \nabla {\mathbf{U}}\mathcal{ = - }\nabla P + \frac{1}{Re}\nabla^{2} {\mathbf{U}}$$
(3.1)
$$\nabla \cdot {\mathbf{U}} = 0$$
(3.2)

with an initial condition

$${\mathbf{U}}\left( {{\mathbf{x}},0} \right) = {\mathbf{U}}_{0} \left( {\mathbf{x}} \right)$$
(3.3)

and assuming a homogeneous boundary condition

$${\mathbf{U}}\left( {{\mathbf{x}}_{B} ,t} \right) = 0$$
(3.4)

in the above equations, U is the velocity, P the dynamic pressure and Re the Reynolds number. This system of equations may be numerically solved by a Galerkin projection on classical basis functions, which results on traditional numerical methods such as the Finite Element Method. Another possible choice is to use as basis functions the more energetic modes obtained by POD [20], leading to

$$\left\langle {\frac{{\partial {\mathbf{U}}}}{\partial t} + {\mathbf{U}} \cdot \nabla {\mathbf{U}},{\varvec{\uppsi}}_{i} } \right\rangle + \frac{1}{Re}\left\langle {\nabla {\mathbf{U}},\nabla {\varvec{\uppsi}}_{i} } \right\rangle = 0$$
(3.5)

where the pressure gradient term vanishes and, in this particular case of homogeneous boundary conditions, the boundary term also vanishes. Some references indicate that there are advantages in considering the pressure term explicitly for some flow problems [49, 50], but this particular aspect has not been taken into consideration.

Considering the POD modes, the variable U may be written as

$${\mathbf{U}}\left( {{\mathbf{x}},t} \right) = \overline{{\mathbf{U}}} \left( {\mathbf{x}} \right) + {\mathbf{u}}({\mathbf{x}},t)\,\, = \,\,\overline{{\mathbf{U}}} \left( {\mathbf{x}} \right) + \sum\limits_{i = 1}^{m} {\alpha_{i} \left( t \right){\varvec{\uppsi}}_{i} } \left( {\mathbf{x}} \right)$$
(3.6)

The substitution of this equation on the projected Navier–Stokes equations results on the following nonlinear evolution equation for the temporal coefficients

$$\frac{{{\text{d}}{\varvec{\upalpha}}}}{{{\text{d}}t}} = A{\varvec{\upalpha}} + {\varvec{\upalpha}}^{T} N{\varvec{\upalpha}} + e\; {\text \, \rm {with}}\;{\varvec{\upalpha}}\left( 0 \right) = {\varvec{\upalpha}}_{0}$$
(3.7)

where

$$\;A_{ij} = - \left\langle {{\varvec{\uppsi}}_{j} \cdot \nabla \overline{{\mathbf{U}}} \,,\,{\varvec{\uppsi}}_{i} } \right\rangle - \left\langle {\overline{{\mathbf{U}}} \cdot \nabla {\varvec{\uppsi}}_{j} \,,\,{\varvec{\uppsi}}_{i} } \right\rangle - \frac{1}{Re}\left\langle {\nabla {\varvec{\uppsi}}_{j} ,\nabla {\varvec{\uppsi}}_{i} } \right\rangle ,i, \, j \, = \, 1, \ldots ,M$$
(3.8)
$$N_{ijk} = - \left\langle {{\varvec{\uppsi}}_{j} \cdot \nabla {\varvec{\uppsi}}_{k} \,,\,{\varvec{\uppsi}}_{i} } \right\rangle ,i, \, j, \, k \, = \, 1, \ldots ,M$$
(3.9)
$$e_{i} = - \left\langle {\overline{{\mathbf{U}}} \cdot \nabla \overline{{\mathbf{U}}} \,,\,{\varvec{\uppsi}}_{i} } \right\rangle - \frac{1}{Re}\left\langle {\nabla \overline{{\mathbf{U}}} ,\nabla {\varvec{\uppsi}}_{i} } \right\rangle ,i \, = \, 1, \ldots , \, M$$
(3.10)
$$\alpha_{0i} = \left\langle {{\mathbf{U}}_{0} - \overline{{\mathbf{U}}} ,{\varvec{\uppsi}}_{i} } \right\rangle , \, i \, = \, 1, \ldots , \, M$$
(3.11)

Therefore, taking into account a group of snapshots, the fields \(\overline{{\mathbf{U}}} ,\,\,\nabla \overline{{\mathbf{U}}} ,\,\,{\varvec{\uppsi}}_{i} \,\, \rm and\,\,\nabla {\varvec{\uppsi}}_{i}\) must be determined to enable the ROM formation [20].

3.2 ROM for the linear 1-D heat transfer

Owing to its simplicity, the one-dimensional linear heat equation is an appropriate simpler starting point to apply a ROM methodology [1] [11]. For this example, the variable U and the coefficient v will be scalars and their transport equation for a domain in the interval x = [0 1] may be written as

$$\frac{\partial U}{\partial t} + v\frac{\partial U}{\partial x} = \frac{1}{Pe}\frac{{\partial^{2} U}}{{\partial x^{2} }}$$
(3.12)
$$U\left( {x,0} \right) = U_{0} \left( x \right),\;\frac{\partial U}{\partial x}\left( {0,t} \right) = 0\, {\text \, \rm {and}} \, \;\,\frac{\partial U}{\partial x}\left( {1,t} \right) = 0$$

where Pe represents the Peclet number. In this case the resulting temporal evolution of the POD modes coefficients are

$$\frac{{{\text{d}}{\varvec{\upalpha}}}}{{{\text{d}}t}} = A{\varvec{\upalpha}} + e\, {\text \, \, \rm{with}} \, {\varvec{\upalpha}}\left( 0 \right) = {\varvec{\upalpha}}_{0}$$
(3.13)

where

$$A_{ij} = - v\left\langle {\frac{{\partial \psi_{j} }}{\partial x}\,,\,\psi_{i} } \right\rangle - \frac{1}{Pe}\left\langle {\frac{{\partial \psi_{j} }}{\partial x},\frac{{\partial \psi_{i} }}{\partial x}} \right\rangle , \, i, \, j \, = \, 1, \ldots ,M$$
(3.14)
$$e_{i} = - v\left\langle {\overline{U} ,\,\psi_{i} } \right\rangle - \frac{1}{Pe}\left\langle {\overline{U} ,\frac{{\partial \psi_{i} }}{\partial x}} \right\rangle , \quad i \, = \, 1, \ldots , \, M$$
(3.15)
$$\alpha_{0i} = \left\langle {U_{0} - \overline{U} ,\psi_{i} } \right\rangle , \quad i \, = \, 1, \ldots , \, M$$
(3.16)

The FOM results were obtained by the implementation of a Finite Volume Method with the transport equation written for the boundary elements [46] and regular spacing between grid points. The numerical model parameters adopted are presented in Table 1. The Peclet number will be varied depending on the analysis.

Table 1 Parameters for the linear heat transfer analysis

The evolution of the U-profile for those conditions and Pe = 1 is presented in Fig. 3. Taking a snapshot for each individual time step, the POD modes and the RIC are calculated and presented in Fig. 4. It is possible to verify that only five modes are already enough to practically capture all the system information.

Fig. 3
figure 3

Snapshots from the heat conduction equation

Fig. 4
figure 4

RIC and modes from the snapshots

Once creating the ROM based on the five most relevant modes found, a very useful check is to reproduce the system behavior for the same case as the one used to build the ROM basis. Figure 5 illustrates the comparison between FOM and ROM, showing an excellent agreement, as expected. Together with the U-profile, the Root Mean Square (RMS) error for each time step is also presented. The same analysis was repeated for Pe = 10 leading to similar conclusions, as can be seen in Fig. 6.

Fig. 5
figure 5

FOM × ROM comparison with 5 modes and RMS error for each time step with Pe = 1. (The basis was built by Pe = 1 snapshot)

Fig. 6
figure 6

FOM × ROM comparison with 5 modes and RMS error for each time step with Pe = 10. (The basis was built by Pe = 10 snapshots)

Using the snapshots from Pe = 1 and Pe = 10 runs, a ROM with 12 modes was tested for an intermediate Pe value, which is not originally in the snapshots. The results for this case are presented in Fig. 7, showing again a good agreement. The RMS error for this case does not decrease monotonically as the results for the cases contained in the snapshots, however the error is stabilized and reaches an acceptable range.

Fig. 7
figure 7

FOM × ROM comparison with 12 modes and RMS error for each time step with Pe = 5. (The basis was built by Pe = 1 and Pe = 10 snapshots)

The finite volume FOM as well as the Galerkin ROM were both implemented in Matlab® and for the cases presented in this section the ROM was approximately 50 times faster than the FOM.

3.3 ROM for the nonlinear 1-D Burgers’ equation

The Burgers’ equation represents some features of the Navier–Stokes equation, mainly a similar nonlinearity that is analogous to the advection terms. The equation may be written as follows

$$\frac{\partial U}{\partial t} + U\frac{\partial U}{\partial x} = \frac{1}{Pe}\frac{{\partial^{2} U}}{{\partial x^{2} }}$$
(3.17)

and it will be solved in a domain in the interval x = [0 1] and for the following boundary and initial conditions,

$$U\left( {x,0} \right) = 0,\;U\left( {0,t} \right) = 1\;{\text \, \rm {and}} \, \, \;U\left( {1,t} \right) = 0.$$

In this case the resulting temporal evolution of the POD modes coefficients are

$$\frac{{d{\varvec{\upalpha}}}}{dt} = A{\varvec{\upalpha}} + {\varvec{\upalpha}}^{T} N{\varvec{\upalpha}} + e\; {\text \, \rm {with}} \, \;{\varvec{\upalpha}}\left( 0 \right) = {\varvec{\upalpha}}_{0}$$
(3.18)

where

$$A_{ij} = - \left\langle {\psi_{j} \frac{{\partial \overline{U} }}{\partial x}\,,\,\psi_{i} } \right\rangle - \left\langle {\overline{U} \frac{{\partial \psi_{j} }}{\partial x}\,,\,\psi_{i} } \right\rangle - \frac{1}{Pe}\left\langle {\frac{{\partial \psi_{j} }}{\partial x},\frac{{\partial \psi_{i} }}{\partial x}} \right\rangle \;, \, i, \, j \, = \, 1, \ldots , \, M$$
(3.19)
$$N_{ijk} = - \left\langle {\psi_{j} \frac{{\partial \psi_{l} }}{\partial x}\,,\,\psi_{i} } \right\rangle , \, i, \, j, \, k \, = \, 1, \ldots , \, M$$
(3.20)
$$e_{i} = - \left\langle {\overline{U} \frac{{\partial \overline{U} }}{\partial x}\,,\,\psi_{i} } \right\rangle - \frac{1}{Pe}\left\langle {\frac{{\partial \overline{U} }}{\partial x},\frac{{\partial \psi_{i} }}{\partial x}} \right\rangle , \, i \, = \, 1, \ldots , \, M$$
(3.21)
$$\alpha_{0i} = \left\langle {U_{0} - \overline{U} ,\psi_{i} } \right\rangle , \, i \, = \, 1, \ldots , \, M$$
(3.22)

With respect to the FOM for this equation, once more the Finite Volume Method was employed using a central difference scheme for advective and diffusive terms, since the tests will be done only for moderate mesh Peclet numbers [46]. The results were generated with the parameters presented in Table 2. The POD modes and RIC found using a Pe = 10 are presented in Fig. 8. In this case, it was decided to use seven modes to build the ROM. Once more the ROM was tested against the same conditions used to generate the basis. The results are shown in Fig. 9. In order to cover a range of Reynolds numbers, the ROM for Pe = 1 was also built and verified against the FOM results, as presented in Fig. 10.

Table 2 Parameters for the Burgers’ equation analysis
Fig. 8
figure 8

RIC and modes from the snapshots for Pe = 1

Fig. 9
figure 9

FOM × ROM comparison with 7 modes and RMS error for each time step with Pe = 10. The basis was built by Pe = 10 snapshots

Fig. 10
figure 10

FOM × ROM comparison with 7 modes and RMS error for each time step with Pe = 1. The basis was built by Pe = 1 snapshot

In order to test the predictive capability of the generated ROM, an intermediate condition (Pe = 5) is tested using the previous results to build the ROM. The results for the intermediate condition in Fig. 11 demonstrate that the ROM for the intermediate condition has a good match with the reference FOM solution. Once again the Finite Volume FOM as well as the Galerkin ROM were both implemented in Matlab® and, for the cases presented in this section, the ROM was approximately 80 times faster than the FOM.

Fig. 11
figure 11

FOM × ROM comparison with 7 modes and RMS error for each time step with Pe = 5. The basis was built by Pe = 1 and Pe = 10 snapshots

3.4 ROM for a 2-D backward-facing step flow

The encouraging results obtained with one-dimensional linear and nonlinear equations have formed a solid basis regarding the implementation details of a Galerkin ROM, which now will be applied to the full two-dimensional Navier–Stokes equations, as presented in Sect. 3.1 and repeated here, for the sake of completeness.

$$\frac{{\partial {\mathbf{U}}}}{\partial t}\mathcal{ + }{\mathbf{U}} \cdot \nabla {\mathbf{U}}\mathcal{ = - }\nabla P + \frac{1}{Re}\nabla^{2} {\mathbf{U}}$$
(3.23)
$$\nabla \cdot {\mathbf{U}} = 0$$
(3.24)

The application will be developed based on the same case study from the reference paper utilized for the Galerkin projection [20]. This case study consists of a Backward-Facing Step at low Reynolds numbers, a flow category that is extensively explored in the literature, either by experimental [47] or numerical [48] methods.

The fluid domain is illustrated in Fig. 12. The step height is half of the channel total height (L) and the other channel dimensions are also based on this reference length, as indicated in the same figure.

Fig. 12
figure 12

Backward-facing step domain

The flow is considered initially at rest and suddenly the fluid is injected with a laminar fully developed velocity profile at the inlet boundary, given by

$$U\left( {x = - L,\,\,{L \mathord{\left/ {\vphantom {L 2}} \right. \kern-0pt} 2} < y < L} \right) = 24\left( {y - {L \mathord{\left/ {\vphantom {L 2}} \right. \kern-0pt} 2}} \right)\left( {L - y} \right)$$
(3.25)
$$V\left( {x = - L,\,\,{L \mathord{\left/ {\vphantom {L 2}} \right. \kern-0pt} 2} < y < L} \right) = 0$$
(3.26)

The channel walls are represented with the classical solid wall condition, with zero normal and tangential velocities (U = 0 and V = 0). At the channel downstream end, the outlet condition is established with zero relative pressure. The Reynolds number is calculated based on the channel total height and the average inlet velocity

$$Re = {{2U_{\text{ave}} L} \mathord{\left/ {\vphantom {{2U_{\text{ave}} L} \nu }} \right. \kern-0pt} \nu }\;{\text \, \rm {where}}\;U_{\text{ave}} = 1\; {\text \, \rm {and}} \,\nu \;$$

is the fluid kinematic viscosity.

Considering the objective to develop ROMs with the flexibility to use different solvers results for the snapshots generation, the FOM for this case is obtained by the commercial code ANSYS CFX® [45] (Release 14.5). CFX has an Element Based Finite Volume solver [46] and the simulation was done for Reynolds numbers equal 50, 100 and 200. Using ANSYS Meshing, a regular Cartesian mesh was generated using 100 partitions in the vertical direction (y) and 250 in horizontal direction (x). The partitions were equally spaced in both directions and brought in as a result 25,000 four-node quadrilateral elements. The time integration was done with a time step size of 1/200 for 2,000 steps.

This flow originates different recirculation zones, depending on the Reynolds number [47]. In order to verify the FOM, the present results are compared against numerical and experimental results from the literature in terms of the first main recirculation zone length (see Fig. 12). The steady-state horizontal velocity contours solution (t = 10) for each Reynolds number is presented in Fig. 13, where the recirculation length can be estimated. Based on these simulations the recirculation length is presented in Fig. 14, where a good matching until Re = 500 can be seen. A gradual increase of the deviation from the numerical results and experiments for Re > 400 is expected because 3-D effects begin to play a significant role [48]. The subsequent analysis is done considering only Reynolds numbers lower than 500.

Fig. 13
figure 13

CFX simulations for different Reynolds numbers

Fig. 14
figure 14

Results from the present CFD model in comparison with results from the literature. Recirculation length versus Reynolds number

Using the FOM solutions to generate the snapshots, during the interval [0, 10], one hundred snapshots were recorded at constant time intervals. The snapshots matrix S was formed with aid of the ANSYS CFD-Post software, exporting all relevant data for the selected time steps. The correlation matrix was then formed inside a Matlab routine reading the CFD exported data. The same routine extracts the eigenvalues and eigenvectors of S T S, which enables the POD basis construction. Figure 15 presents the eigenvalues in increasing order and the respective RIC. The first 10 modes already represent 99.97 % of the flow energy. They are presented in Fig. 16 for Re = 100. As previously discussed, the eigenvalues have a direct relationship with the flow structures energy. Therefore, lower energies are associated with higher frequencies and smaller dimension structures, as can be seen for modes higher than 4 also in Fig. 16.

Fig. 15
figure 15

POD modes eigenvalues and RIC for Re = 100

Fig. 16
figure 16

First 10 POD modes presented as velocity magnitude for Re = 100

The ROM is once more formed by the Galerkin projection of the governing equations using the first 10 POD modes as basis functions. The detailed expansion of each term from the Galerkin projection is presented in Appendix A. The nonlinear ODE for the temporal coefficients \(\alpha_{i}\) is then solved through an implicit backward Euler scheme, using the same time step as the FOM (\(\Delta t = 0.005\)). With the determined temporal coefficients, the solution may be reconstructed, noting that:

$${\mathbf{U}}\left( {{\mathbf{x}},t} \right) = \,\,\overline{{\mathbf{U}}} \left( {\mathbf{x}} \right) + \sum\limits_{i = 1}^{m} {\alpha_{i} \left( t \right){\varvec{\uppsi}}_{i} } \left( {\mathbf{x}} \right)$$
(3.27)

Just like it was done for the one-dimensional examples, first, the ROM is calculated for the same Reynolds number used to form the basis. The first five modes temporal coefficients evolution is presented in Fig. 17. For this case, the FOM solution is available. Then it is possible to calculate the exact value for the temporal coefficients. This is obtained by taking the inner product with the POD modes on both sides of the previous equation, leading to

Fig. 17
figure 17

First 5 POD modes temporal coefficients for Re = 100, obtained by the ROM and reference values from the FOM

$$\alpha_{i} \left( t \right) = \left\langle {\overline{{\mathbf{U}}} \left( {\mathbf{x}} \right) - {\mathbf{U}}\left( {{\mathbf{x}},t} \right)\,,{\varvec{\uppsi}}_{i} \left( {\mathbf{x}} \right)} \right\rangle$$
(3.28)

where \({\mathbf{U}}\left( {{\mathbf{x}},t} \right)\) is obtained directly from the snapshots. The \(\alpha_{i}\) values from the FOM are also presented in Fig. 17. From the figure, some deviations in the dynamical system evolution can be noted; yet when the velocity field is recovered with the ROM, very little difference is observed. This fact is also observed in the velocity magnitude contours presented in Fig. 18, which shows in detail the region near the step. Additionally, the horizontal and vertical velocities profiles in the last time step at various channel stations are presented in Fig. 19, and the ROM results have an almost exact match with the FOM.

Fig. 18
figure 18

Comparison between FOM and ROM with 10 modes presented as velocity magnitude contours for x < 5 and Re = 100

Fig. 19
figure 19

Comparison of ROM and FOM solutions; horizontal (U) and vertical velocities (V) at various channel stations with Re = 100. The snapshots were generated with the same Reynolds number

In the range between 50 < Re < 200, the ROM with snapshots and execution at the same Reynolds numbers has small errors, as expected. Considering the same range and the objective to evaluate the predictive capacity of the ROM, the reduced system was then generated and executed with different Reynolds numbers. Table 3 summarizes the RMS error of the velocity components over the entire domain with different combinations of Reynolds numbers for the snapshots and the Reynolds number for the ROM. From those data, it is possible to confirm that when the ROM is run for a parameter within the snapshot range of parameters, the errors are smaller. This is observed for the ROM with Re = 100 with snapshots generated with Re = 50 and 200. The velocity profiles in several channel stations in the last time step compared against FOM are presented in Fig. 20. However, the ROM for Re = 500, even considering the same Reynolds for snapshots generation, has shown much larger errors, which indicates that a stabilization technique may be necessary [47] [51]. Another important conclusion from this data is that the ROM execution is between 300 and 600 times faster than the FOM.

Table 3 Summary of the errors obtained with ROMs
Fig. 20
figure 20

Comparison of ROM and FOM solutions; horizontal (U) and vertical velocities (V) at various channel stations with Re = 100. The snapshots were generated with the Reynolds number of 50 and 200

4 Conclusions

With the use of proper orthogonal decomposition (POD) and Galerkin projection, a Reduced-Order Model (ROM) procedure for fluid flow simulations is developed. The application of such procedure is illustrated with three examples of increasing complexity: the linear one-dimensional heat transfer equation, the nonlinear one-dimensional Burgers’ equation and, finally, the two-dimensional nonlinear Navier–Stokes equations, solved in a context of a backward-facing step flow.

The Full Order Model (FOM) snapshots were obtained either through the Finite Volume Method implemented in Matlab® or execution of the commercial code ANSYS CFX®. These tools have also generated the FOM reference solutions for errors verification. The ROM was also implemented with aid of Matlab® routines and it shows a very good agreement with the FOM solutions for the cases tested. The main motivation for ROM development—the execution time reduction—is evaluated and time measurements show that the ROM is between 300 and 600 times faster when compared to the FOM solutions for the two-dimensional Navier–Stokes equations. The parametric study indicates that, for the cases tested, the ROM accuracy increases for parameters inside the range used for snapshots generation.

The framework developed allows a fast creation of ROM based on transient laminar flows results. The detailed presentation of the test cases and the broad list of references may be used as a guide for practical implementation of a Galerkin-ROM. Further developments are planned to allow the expansion of such methodology to turbulent flows.