u_error: discretization error
using PyPlot
rc("font", family="Arial", size=16.0)
fig = figure("An example", figsize=(14,6));
ax1 = fig[:add_subplot](1,2,1);
ax2 = fig[:add_subplot](1,2,2);
cs1 = ax1.contourf(xx, yy, transpose(u_e),levels=20, cmap="jet", vmin=-1, vmax=1)
ax1.set_title("Exact solution")
plt[:subplot](ax1); cs1
cs2 = ax2.contourf(xx, yy, transpose(u_n),levels=20, cmap="jet", vmin=-1, vmax=1)
ax2.set_title("Numerical solution")
plt[:subplot](ax2); cs2
fig.colorbar(cs, ax = ax1)
fig.colorbar(cs, ax = ax2)
fig.tight_layout()
fig.savefig("fst_contour.pdf") ✝ ✆
```
#### **References**


c 2019 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (http://creativecommons.org/licenses/by/4.0/).

## **An E**ffi**cient Strategy to Deliver Understanding of Both Numerical and Practical Aspects When Using Navier-Stokes Equations to Solve Fluid Mechanics Problems**

#### **Desmond Adair 1,\* and Martin Jaeger <sup>2</sup>**


Received: 7 July 2019; Accepted: 27 September 2019; Published: 1 October 2019

**Abstract:** An efficient and thorough strategy to introduce undergraduate students to a numerical approach of calculating flow is outlined. First, the basic steps, especially discretization, involved when solving Navier-Stokes equations using a finite-volume method for incompressible steady-state flow are developed with the main aim being for the students to follow through from the mathematical description of a given problem to the final solution of the governing equations in a transparent way. The well-known 'driven-cavity' problem is used as the problem for testing coding written by the students, and the Navier-Stokes equations are initially cast in the vorticity-streamfunction form. This is followed by moving on to a solution method using the primitive variables and discussion of details such as, closure of the Navier-Stokes equations using turbulence modelling, appropriate meshing within the computation domain, various boundary conditions, properties of fluids, and the important methods for determining that a convergence solution has been reached. Such a course is found to be an efficient and transparent approach for introducing students to computational fluid dynamics.

**Keywords:** computational fluid dynamics; finite-volume method; discretization; turbulence modelling; meshing

#### **1. Introduction**

Computational Fluid Dynamics (CFD) is the simulation of transport phenomena, reacting systems, heat transfer, etc., using modelling, i.e., mathematical physical problem formulation and numerical solution, which include discretization methods, solvers, numerical parameters and mesh generation. The efficient and thorough development, implementation and evaluation of a suitable curriculum, which incorporates both the theoretical and practical aspects of CFD, for undergraduate students as an extension of their knowledge in the thermo-fluids area is warranted and necessary in modern engineering programmes. Numerical methods have an advantage over analytical methods of solution in that analytical methods tend to be restrictive by commonly requiring simple geometries, unrealistic assumptions and until lately assumed linearity, whereas real engineering problems usually have quite complex geometries and highly non-linear phenomena. However, despite the advantages of numerical methods, the latter may miss some finer aspects of fluid dynamics which, from the equations of analytical methods, may be more transparent, for example the question of uniqueness of weak solutions to Navier-Stokes equations in three dimensions. Analytical methods also often task a student to consider the treatment of any nonlinear terms found in partial differential equations, hence encouraging a student's interest in this important topic.

Many areas of engineering education already use mathematical modelling as a teaching tool, for example, for diesel engine studies [1], in fluid mechanics and heat transfer [2–4] and in chemical reactions [5]. It is important when introducing a complex topic such as CFD to have educational user-friendly interfaces, usually in the form of dialogue graphical user interfaces (GUIs), and some work has already been done on this [6,7], where the general aspects of the three main processes of CFD, i.e., building the problem using a pre-processor, solving the problem, and displaying the results using a post-processor were considered. However, although the education benefits associated with integrating computer-assisted learning and simulation technology into undergraduate engineering course are great [8], and, computational fluid dynamics has revolutionized approaches to research and design, its incorporation into the teaching of undergraduate transport phenomena has still difficulties. One of these difficulties, and the one addressed in this paper, is to efficiently and thoroughly combine a sufficient understanding of the theoretical aspects of CFD with its practical use. Another is to engender a critical understanding of obtained results.

To help with an initial understanding of the process of solving Navier-Stokes and related transport equations the symbolic software, *Mathematica* [9] was employed to demonstrate the mathematical aspects of some of the basic steps involved, for example meshing, discretization, application of boundary conditions and the development of a simple solution algorithm. Two-dimensional incompressible flows were calculated for simplicity and the Navier-Stokes, at this stage of the course, were recast in an alternative form, i.e., in terms of streamfunction and vorticity. In many applications, the vorticity-streamfunction form of the Navier-Stokes equations provides a better insight into the physical mechanisms driving the flow than the "primitive variable" formulation which is in terms of the mean velocities *u*, *v* and pressure, *p*. The streamfunction and vorticity formulation is also useful for numerical work, since it avoids some problems resulting from discretization of the continuity equation.

The second part of this work outlines how to best introduce the practical aspects and emphasizes concerns which must be remembered when using CFD. Issues arise when introducing simulation into a curriculum, including learning vs. research objectives, usability vs. predetermined objectives and student demographics. A proper balance must be sought for between these competing objectives; for example, it is just as important that students are taught the systematic and practical ways of using a CFD package in a general sense, as well as achieving a specific result. There is evidence from previous studies that using simulation enhances the curriculum [4]; there is increased learning efficiency and understanding [10,11]; there is effectiveness of hands-on learning methods [12]; and, it is effective to use a combination of physical and simulation laboratories [7].

Other concerns when introducing CFD to students are, for example, when to introduce during the programme, how much to introduce and how much mathematical and thermo-fluid backgrounds are necessary [13]? When a student first commences studying CFD a lot of new knowledge and required skills descend on them from several different curriculum areas, which must be married together hence rendering a steep learning curve. If careful planning is not carried out, this curve may become overwhelming for many of the students. It is also important to ensure that the CFD GUIs are not treated as 'black boxes', without knowledge of what is going on inside the computer software. This is especially true as many commercial codes now provide the opportunity of attaching in-house coding to the main core of the software hence providing a gateway for enhanced research and code development [14]. Without knowledge of CFD fundamentals and the core coding, code development would not be possible. It is important that students maintain a 'feeling' for physical phenomena, remember the necessary assumptions made for the mathematical modelling, and, very importantly, know of the need to verify and validate the calculated results [15]. It has been observed that successful implementation of CFD often requires a re-focus of course objectives and skills taught, and a re-structuring of the course curriculum [16]. An important practical consideration is to engender into the students a healthy skepticism concerning the calculated results and a willingness to be critical of their results until validated [17].

In this paper the mathematical aspects of CFD are first introduced, with a particular emphasize on how to discretize equations. This is followed by a discussion of practical details such as closure of the Navier-Stokes equations using turbulence modelling, appropriate meshing within the computation domain, various boundary condition, properties of fluids, and the important methods for determining that a convergence solution has been reached. An overall description of the course is then given. The paper finishes with conclusions drawn and possible work needed for future development.

#### **2. Numerical Elements of Computational Fluid Dynamics (CFD) Teaching**

#### *2.1. Introduction*

In this part of the course, which lasted for four weeks, the purpose was to develop the basic steps involved in solving Navier-Stokes equations using a finite-volume approach for incompressible steady-state flow. The students can actually see the development of the mathematical description linked to a programming environment solution process, so often hidden in commercial code used for training CFD students. The students start with discretization of the governing equations, write their own coding to generate a mesh, apply boundary conditions, provide a suitable solution algorithm and to generate contour and x-y plots.

The students had already successfully completed courses on matrix algebra, vector calculus, ordinary and partial differential equations, with the latter solved using a variety of numerical methods, as well as preliminary courses on fluid mechanics and heat transfer. The students also have reasonable experience of using *Mathematica*, which is a necessary prerequisite [18]. Required reading for the course included LeVeque [19] and Ferziger and Peric [20].

In the following sections the theory taught to the students in preparation for them writing appropriate coding is summarized.

#### *2.2. Navier-Stokes Equations*

The governing equations for modelling fluid flow are the Navier-Stokes equations and the continuity equation. These laws of motion are valid for all phases including liquids, gases and solids, but there is a fundamental difference between fluids and solids in that fluids have no limit to their distortion. The analysis of fluid flow needs to take into account such distortions. The Navier-Stokes equations can be derived by the consideration of the dynamic equilibrium of a small fluid element and they state that surface and body forces are in equilibrium with inertial forces acting on the fluid element. On consideration of incompressible flow, where the density is constant, the Navier-Stokes equations for three-dimensional flow are as shown in Equations (1)–(4). Here body forces have not been included.

$$\frac{\partial u}{\partial \mathbf{x}} + \frac{\partial v}{\partial y} + \frac{\partial w}{\partial z} = 0 \tag{1}$$

$$\frac{\partial u}{\partial t} + u \frac{\partial u}{\partial \mathbf{x}} + v \frac{\partial u}{\partial y} + w \frac{\partial u}{\partial z} = -\frac{1}{\rho} \frac{\partial p}{\partial \mathbf{x}} + v \left( \frac{\partial^2 u}{\partial \mathbf{x}^2} + \frac{\partial^2 u}{\partial y^2} + \frac{\partial^2 u}{\partial z^2} \right) \tag{2}$$

$$\frac{\partial v}{\partial t} + u \frac{\partial v}{\partial \mathbf{x}} + v \frac{\partial v}{\partial y} + w \frac{\partial v}{\partial z} = -\frac{1}{\rho} \frac{\partial p}{\partial y} + v \left( \frac{\partial^2 v}{\partial \mathbf{x}^2} + \frac{\partial^2 v}{\partial y^2} + \frac{\partial^2 v}{\partial z^2} \right) \tag{3}$$

$$\frac{\partial w}{\partial t} + u \frac{\partial w}{\partial x} + v \frac{\partial w}{\partial y} + w \frac{\partial w}{\partial z} = -\frac{1}{\rho} \frac{\partial p}{\partial z} + \nu \left( \frac{\partial^2 w}{\partial x^2} + \frac{\partial^2 w}{\partial y^2} + \frac{\partial^2 w}{\partial z^2} \right) \tag{4}$$

where *u*, *v*, *w* are the velocity components in the *x*, *y*, *z* directions, ρ is the fluid density, *p* is the pressure and ν is the kinematic viscosity.

Most flows encountered in engineering problems are turbulent because it is mostly impossible to stop transition from laminar to turbulent flow, or, by intention, as turbulence may aid the engineering application. For turbulent flows however, the variation of the quantities to be calculated with time is often so rapid and with a high degree of randomness that this variation is of little engineering relevance. Hence the quantities are averaged and most often the Reynolds-averaged Navier-Stokes equations as shown in Equations (5)–(8) are used.

$$\frac{\partial \overline{u}}{\partial x} + \frac{\partial \overline{v}}{\partial y} + \frac{\partial \overline{w}}{\partial z} = 0 \tag{5}$$

$$\frac{\partial \overline{u}}{\partial t} + \overline{u}\frac{\partial \overline{u}}{\partial \mathbf{x}} + \overline{v}\frac{\partial \overline{u}}{\partial y} + \overline{w}\frac{\partial \overline{u}}{\partial z} = -\frac{1}{\rho}\frac{\partial \overline{p}}{\partial \mathbf{x}} + \frac{\partial}{\partial \mathbf{x}}\left(\nu\frac{\partial \overline{u}}{\partial \mathbf{x}} - \overline{u'u'}\right) + \frac{\partial}{\partial y}\left(\nu\frac{\partial \overline{u}}{\partial \overline{y}} - \overline{u'v'}\right) + \frac{\partial}{\partial z}\left(\nu\frac{\partial \overline{u}}{\partial z} - \overline{u'w'}\right) \tag{6}$$

$$\frac{\partial\overline{\boldsymbol{v}}}{\partial t} + \overline{\boldsymbol{u}}\frac{\partial\overline{\boldsymbol{v}}}{\partial\mathbf{x}} + \overline{\boldsymbol{v}}\frac{\partial\overline{\boldsymbol{v}}}{\partial\boldsymbol{y}} + \overline{\boldsymbol{w}}\frac{\partial\overline{\boldsymbol{v}}}{\partial\boldsymbol{z}} = -\frac{1}{\rho}\frac{\partial\overline{\boldsymbol{p}}}{\partial\boldsymbol{y}} + \frac{\partial}{\partial\mathbf{x}}\left(\nu\frac{\partial\overline{\boldsymbol{v}}}{\partial\mathbf{x}} - \overline{\boldsymbol{u}'\boldsymbol{v}'}\right) + \frac{\partial}{\partial\boldsymbol{y}}\left(\nu\frac{\partial\overline{\boldsymbol{v}}}{\partial\overline{\boldsymbol{y}}} - \overline{\boldsymbol{v}'\boldsymbol{v}'}\right) + \frac{\partial}{\partial\boldsymbol{z}}\left(\nu\frac{\partial\overline{\boldsymbol{v}}}{\partial\boldsymbol{z}} - \overline{\boldsymbol{v}'\boldsymbol{w}'}\right) \tag{7}$$

$$\frac{\partial \overline{w}}{\partial t} + \overline{u} \frac{\partial \overline{w}}{\partial x} + \overline{v} \frac{\partial \overline{w}}{\partial y} + \overline{w} \frac{\partial \overline{w}}{\partial z} = -\frac{1}{\rho} \frac{\partial \overline{p}}{\partial y} + \frac{\partial}{\partial x} \left( \nu \frac{\partial \overline{w}}{\partial x} - \overline{u'w'} \right) + \frac{\partial}{\partial y} \left( \nu \frac{\partial \overline{w}}{\partial \overline{y}} - \overline{v'w'} \right) + \frac{\partial}{\partial z} \left( \nu \frac{\partial \overline{w}}{\partial z} - \overline{w'w'} \right) \tag{8}$$

As can be observed, the instantaneous quantities are replaced by their corresponding time-averaged quantities. Extra terms appear due to the averaging process, e.g., −*uv* and these behave like stress terms, often called Reynolds stresses, which need further equations if the system of equations is to be closed. There have, over this last 60–70 years, been many suggestions as to the best way for equation closure, none of which as yet are completely satisfactory.

#### *2.3. Vorticity-Streamfunction Governing Equations*

For this work, the Navier-Stokes equations are caste into the vorticity-streamfunction form, where the streamfunction is defined as

$$\psi\_A(P) = \int\_A^P \mathbf{u} \cdot \mathbf{n} \, ds \tag{9}$$

and where the integral has to be evaluated along a curve *C* from the arbitrary but fixed point *A* to point *P*, **u** is the velocity vector, and **n** is the unit normal on the curve from *A* to *P*. The streamfunction is regarded as a function of the spatial coordinates only. Streamlines are lines that are everywhere tangential to the velocity field, and hence ψ is constant along the streamlines. Invoking the integral incompressibility constraint for an infinitesimally small triangle shows that ψ is related to the two Cartesian velocity components *u* and *v* via

$$u = \frac{\partial \psi}{\partial y}; \quad v = -\frac{\partial \psi}{\partial x} \tag{10}$$

Flows that are specified by a streamfunction automatically satisfy the continuity equation since

$$
\frac{\partial \mu}{\partial \mathbf{x}} + \frac{\partial \upsilon}{\partial y} = \frac{\partial}{\partial \mathbf{x}} \left(\frac{\partial \psi}{\partial y}\right) - \frac{\partial}{\partial y} \left(\frac{\partial \psi}{\partial \mathbf{x}}\right) = 0\tag{11}
$$

For two-dimensional flows, the vorticity vector ω = ∇ × **u** only has one non-zero component (in the *z* direction; i.e., ω = ω*ez* where

$$
\omega = \frac{\partial v}{\partial x} - \frac{\partial u}{\partial y} \tag{12}
$$

Using the definition of the velocities in terms of the streamfunction shows that

$$
\omega = \frac{\partial}{\partial \mathbf{x}} \left( -\frac{\partial \psi}{\partial \mathbf{x}} \right) - \frac{\partial}{\partial y} \left( \frac{\partial \psi}{\partial y} \right) = -\nabla^2 \psi \tag{13}
$$

The Navier-Stokes equations for incompressible steady-state flow in vorticity-streamfunction form are

$$\frac{\partial\psi}{\partial\mathbf{x}}\frac{\partial\omega}{\partial y} - \frac{\partial\psi}{\partial y}\frac{\partial\omega}{\partial\mathbf{x}} = \frac{1}{\text{Re}} \left(\frac{\partial^2\omega}{\partial x^2} + \frac{\partial^2\omega}{\partial y^2}\right) \tag{14}$$

$$
\frac{
\partial^2 \psi
}{
\partial x^2
} + \frac{
\partial^2 \psi
}{
\partial y^2
} = -\omega
\tag{15}
$$

where Re is the Reynolds number.

It should be mentioned that the above formulation is only valid in two-dimensions and some alternation is needed when three-dimensional flow is considered.

#### *2.4. Boundary Conditions*

The boundary conditions needed to solve Equations (14) and (15) for the classical computational fluid dynamics case, namely the lid-cavity flow [21], are shown on Figure 1.

**Figure 1.** Summary of boundary conditions for cavity with moving lid. (Reproduced with permission from [22]).

A rectangular box, where the lid is allowed to move in the horizontal plane from left to right, is simulated with the moving lid driving the fluid within the box. In Figure 1 the boundary conditions needed for solution are summarized in terms of vorticity and streamfunction. The streamfunction is constant at the walls, as its gradient is velocity, which is zero relative to a given wall (the no-slip condition). The vorticity boundary condition for each wall is also shown in each of the outer boxes and are derived from the streamfunction.

#### *2.5. Discretization of Transport Equations*

Before describing the discretization of the governing equations, it is important to note that for convenience Equations (14) and (15) together with the boundary conditions were non-dimensionalized using

$$\overleftarrow{\mathfrak{x}} = \frac{\mathfrak{x}}{b}; \overleftarrow{\mathfrak{y}} = \frac{\mathfrak{y}}{a}; \overleftarrow{\psi} = \frac{\psi}{Vb}; \overleftarrow{\omega} = \frac{ab}{V}; \gamma = \frac{b}{a}; \text{Re} = \frac{Vb}{\nu}$$

where *a* and *b* are the height and width of the cavity, respectively, and *V* is a reference velocity. The resultant governing equations in vorticity-streamfunction format become

$$\frac{\partial^2 \widetilde{\omega}}{\partial \widetilde{\mathbf{x}}^2} + \gamma^2 \frac{\partial^2 \widetilde{\omega}}{\partial \widetilde{y}^2} = R\gamma \Big( \frac{\partial \widetilde{\psi}}{\partial \widetilde{\overline{y}}} \frac{\partial \widetilde{\omega}}{\partial \widetilde{\overline{\mathbf{x}}}} - \frac{\partial \widetilde{\psi}}{\partial \widetilde{\overline{\mathbf{x}}}} \frac{\partial \widetilde{\omega}}{\partial \widetilde{\overline{y}}} \Big) \tag{16}$$

$$
\frac{\partial^2 \overline{\psi}}{\partial \overline{x}^2} + \gamma^2 \frac{\partial^2 \overline{\psi}}{\partial \overline{y}^2} = -\overline{\omega} \tag{17}
$$

defined in the domain 0 <sup>≤</sup> #*<sup>x</sup>* <sup>≤</sup> 1, 0 <sup>≤</sup> #*<sup>y</sup>* <sup>≤</sup> 1.

So as to include the boundary nodes of the cavity, central differencing is used to discretize Equations (16) and (17) with the number of nodes in the *x* and *y* directions set at *nx* and *ny*, respectively. The mesh is a regular Castesian grid with the nodes equally spaced at a distance *h*, as illustrated on Figure 2.

**Figure 2.** Typical Cartesian mesh used for the lid-cavity flow. (Reproduced with permission from [21]).

To discretize Equations (16) and (17) the following central-difference approximations were introduced for spatial dimensions, obtained by adding or subtracting one Taylor series from another and invoking the intermediate value theorem. As can be seen from Equation (18), the order of accuracy for both the first and second derivatives is *O h*2 .

$$\begin{cases} \frac{\partial f(\mathbf{x})}{\partial \mathbf{x}} = \frac{f(\mathbf{x} + h) - f(\mathbf{x} - h)}{2} + O(h^2) \\ \frac{\partial f(\mathbf{x})}{\partial \mathbf{x}} = \frac{f(\mathbf{x} + h) - f(\mathbf{x} - h)}{2} + O(h^2) \end{cases} \tag{18}$$

Using the approximations from Equation (18), the discretized advection-diffusion equation (Equation (16)) at the (*i*, *j*) node is

$$\begin{split} \frac{\omega\_{i+1,j} - 2\omega \imath\_{i,j} + \omega \imath\_{i-1,j}}{h^2} &+ \gamma^2 \frac{\omega \imath\_{i,j+1} - 2\omega \imath\_{i,j} + \omega \imath\_{i,j-1}}{h^2} \\ &= \text{Re}\gamma \left( \frac{\psi\_{i,j+1} - \psi\_{i,j-1}}{2 \, h} \frac{\omega \imath\_{i+1,j} - \omega \imath\_{i-1,j}}{2 \, h} - \frac{\psi\_{i+1,j} - \psi\_{i-1,j}}{2 \, h} \frac{\omega \imath\_{i,j+1} - \omega \imath\_{i,j-1}}{2 \, h} \right) \end{split} \tag{19}$$

The elliptic equation (Equation (17)) at the (*i*, *j*) node is

$$\frac{\psi\_{i+1,j} - 2\psi\_{i,j} + \psi\_{i-1,j}}{h^2} + \gamma^2 \frac{\psi\_{i,j+1} - 2\psi\_{i,j} + \psi\_{i,j-1}}{h^2} = -a(\mathbf{x}\_{i\prime}\boldsymbol{y}\_{j})\tag{20}$$

The equations are applied at the internal nodes of the Cartesian mesh; i.e., 2 ≤ *i* ≤ *nx*−<sup>1</sup> and 2 ≤ *i* ≤ *ny*−1.

#### *2.6. Solution Algorithm*

The iterative solution used here is based on Burggraf's proposal [23]. The solution method uses residual functions; i.e., if the values of ψ*i*,*<sup>j</sup>* and ω*i*,*<sup>j</sup>* are exact on the nodes spanned by the residual functions R*ij* and L*ij*, then

$$\mathcal{R}\_{ij}^{k+1} = \mathcal{L}\_{ij}^{k+1} = 0 \tag{21}$$

where

*Fluids* **2019**, *4*, 178

$$\mathcal{R}\_{ij}^{k+1} = \frac{1}{2(1+\gamma^2)} \Big(\psi\_{i+1,j}^k + \psi\_{i-1,j}^{k+1} + \gamma^2 \Big(\psi\_{i,j+1}^{k+1} + \psi\_{i,j-1}^{k+1}\Big)\Big) + h^2 \omega\_{i,j}^k - \psi\_{i,j}^k \tag{22}$$

$$\begin{array}{l} \mathcal{L}\_{ij}^{k+1} = \frac{1}{2(1+\gamma^2)} \Big( \Big( \boldsymbol{\mu}\_{i+1,j}^{k} + \boldsymbol{\mu}\_{i-1,j}^{k} + \gamma^2 \Big( \boldsymbol{\mu}\_{i,j+1}^{k} + \boldsymbol{\mu}\_{i,j-1}^{k} \Big) \Big) \\ - \frac{\text{Re}}{4} \gamma \Big( \Big( \boldsymbol{\psi}\_{i,j+1}^{k} - \boldsymbol{\psi}\_{i,j-1}^{k+1} \Big) \Big( \boldsymbol{\mu}\_{i+1,j}^{k} - \boldsymbol{\mu}\_{i-1,j}^{k+1} \Big) - \left( \boldsymbol{\psi}\_{i+1,j}^{k} - \boldsymbol{\psi}\_{i-1,j}^{k+1} \Big) \Big( \boldsymbol{\mu}\_{i,j+1}^{k} - \boldsymbol{\mu}\_{i,j-1}^{k+1} \Big) \Big) \Big) - \boldsymbol{\mu}\_{i,j}^{k} \Big) \end{array} \tag{23}$$

The following fixed-point iterative procedure, based on the Gauss-Seidel scheme (see Appendix A for a short general explanation), is then constructed

$$\begin{array}{l} \psi\_{\mathbf{i},\mathbf{j}}^{k+1} = \mathcal{F}^{\mathbf{k}}(\psi^{(k)}, \psi^{(k+1)}, \boldsymbol{\omega}^{(k)}, \boldsymbol{\omega}^{(k+1)}) \equiv \psi\_{\mathbf{i},\mathbf{j}}^{k} + p\mathbb{R}\_{\mathbf{i}\mathbf{j}}^{k} \\ \boldsymbol{\omega}\_{\mathbf{i},\mathbf{j}}^{k+1} = \mathcal{G}^{\mathbf{k}}(\psi^{(k)}, \psi^{(k+1)}, \boldsymbol{\omega}^{(k)}, \boldsymbol{\omega}^{(k+1)}) \equiv \boldsymbol{\omega}\_{\mathbf{i},\mathbf{j}}^{k} + p\mathcal{L}\_{\mathbf{i}\mathbf{j}}^{\mathbf{k}} \end{array} \tag{24}$$

where *p* is a relaxation parameter lying in the range 0 < *p* ≤ 1, and *k* + 1 and *k* refer to the respective iterations. The use of this relaxation parameter is to improve the stability of a particular computation, particularly when solving steady-state problems.

The boundary conditions now need to be determined. For the streamfunction

$$\begin{aligned} \psi\_{i,1} &= 0 \text{ for } i = 1, \dots, n\_{\text{x}\_{\text{y}}} \\\\ \psi\_{n\_{\text{x},j}} &= 0 \text{ for } j = 1, \dots, n\_{\text{y}\_{\text{y}}} \\\\ \psi\_{i,n\_{\text{y}}} &= 0 \text{ for } i = 1, \dots, n\_{\text{x}\_{\text{y}}} \\\\ \psi\_{1,j} &= 0 \text{ for } j = 1, \dots, n\_{\text{y}}. \end{aligned}$$

For vorticity, the following needs to be considered for, say, the left wall of the cavity with one node outside the computational domain.

$$
\omega\_{i,j} = \frac{1}{h^2} (\psi\_{2,j} - 2\psi\_{1,j} + \psi\_{0,j} + \gamma^2 \{\psi\_{1,j+1} - 2\psi\_{1,j} + \psi\_{1,j-1}\}) \tag{25}
$$

The value of ψ0,*<sup>j</sup>* can be accounted for by using the no-slip boundary condition on the cavity wall, i.e.,

$$v = -\frac{\partial \psi}{\partial \mathbf{x}} = 0, \text{ at } \mathbf{x} = 0 \tag{26}$$

Using central differencing, this condition can be written as

$$-\left(\frac{\partial\psi}{\partial x}\right)\_{1,j} = 0 \Rightarrow -\left(\frac{\psi\_{2,j} - \psi\_{0,j}}{2\ h}\right) = 0 \Rightarrow \psi\_{0,j} = \psi\_{2,j} \tag{27}$$

where again the order of accuracy is *O h*2 .

This finding, together with ψ1,*<sup>j</sup>* = ψ1,*j*+<sup>1</sup> = ψ1,*j*−<sup>1</sup> = 0 gives

$$
\omega\_{1,j} = -\frac{2}{h^2} (\psi\_{2,j}) \text{ for } j = 2, n\_{y-1} \tag{28}
$$

Similarly, for the other walls of the cavity the boundary conditions for vorticity can be deduced from

$$\omega(\mathbf{x}\_i, y\_i) = -\left(\frac{\psi\_{i+1,j} - 2\psi\_{i,j} + \psi\_{i-1,j}}{h^2} + \gamma^2 \frac{\psi\_{i,j+1} - 2\psi\_{i,j} + \psi\_{i,j-1}}{h^2}\right) \tag{29}$$

to give

$$\begin{aligned} \omega\_{i,1} &= -\frac{2}{h^2} \gamma^2(\psi\_{i,2}) \text{ for } i = 1, \dots, n\_x\\ \omega\_{n\_x, j} &= -\frac{2}{h^2} \gamma^2(\psi\_{n\_{x-1}, j}) \text{ for } j = 2, \dots, n\_{y-1} \\ \omega\_{i, n\_y} &= -\frac{2}{h^2} \gamma^2(\psi\_{i, n\_{y-1}} + \frac{h}{\check{\gamma}}) \text{ for } i = 1, \dots, n\_x \end{aligned} \tag{30}$$

It should be noted that the final boundary condition shown in Equation (30) is for the moving lid, and the extra term is due to the tangential velocity being non-zero.

#### **3. Practical Elements of CFD Teaching**

#### *3.1. Introduction*

For Computational Fluid Dynamics laboratories, each student had a desktop computer on which was loaded software which provides the interface as a 'three-dimensional' fully interactive environment. The interface uses the concept of 'virtual reality' and allows a student to simulate a flow, including geometry, properties, boundary conditions, closure of equations, numerics, etc, from beginning to end without having to resort to specialized codes, or code writing. The code used can be used for professional engineering consultancy, so giving students useful skills and experience which contribute to their preparation for the workplace. The virtual reality (VR) environment is designed as a general purpose CFD interface, which can handle such problems as fluid flow, heat transfer, reacting flows, or a combination of all, and consists of the VR-Editor (pre-processor), the VR-Viewer (post-processor) and the solver module which performs the actual calculations. The VR-Editor allows a student to set the overall computational domain size, define the position, size and properties of object introduced into the domain, specify the material properties which occupy the domain, specify inlet and outlet boundary conditions, specify initial conditions, select turbulence models (if necessary), specify the fineness and type of computational mesh, and set the numerics by choosing a suitable solution algorithm and which influence the speed of calculation to obtain a convergence solution. Once the student is satisfied with problem set-up in the pre-processor, calculations are made using the solver module and the progress of the calculations is clearly monitored on-screen until convergence is reached. The results of the flow simulation are then displayed on the VR-Viewer graphically or they can be analysed from the raw numerical data. The post-processing graphical capabilities are vector plots, contour plots, iso-surfaces, streamlines and x-y plots.

#### *3.2. Interface Design Features*

The Computational Fluid Dynamics laboratory is designed in a user-friendly way, the computational features are easy to access and implement. It is important to keep parameter settings at the top level, and not to use multi-levels, as much as possible, as the setting of vital parameters necessary to the success of a particular simulation may well get hidden or even forgotten about, thus frustrating the student with strange results. Also it is important to show students that CFD methodology needs to be systematic and rigorous, as the laboratory must reflect what is found in engineering practice.

The CFD interface was designed, as shown on Figure 3, so that the features systematically inform, it is vocationally sound and is easy to use.

Each simulation process reflected the situation in engineering practice with students systematically setting up the problem, solving and finally analysing the results. The students interact with the software using mouse and keyboard input with no requirement for the distraction of computer language coding so enabling them to concentrate on the CFD methodology and procedures and how close to reality their results are. An important feature of the CFD interface is that it is stand-alone, by which is meant that the problem-building, solving and post-processing are all combined in the same virtual reality environment. Also important is that all the data representing the results can be moved to the familiar Microsoft Office environment for further processing and reporting. The CFD software package operates on the Windows OS platform using PCs with relatively low computer power, and so the solvers have to

be reasonably fast because the students have limited guided time in the laboratories, and also to keep their level of interest heightened, calculated results should come back reasonably quickly. In addition to producing contour plots, vector plots, etc., the post-processor could also produce animation for transient flows.

**Figure 3.** Summary of Computational Fluid Dynamics (CFD) interface. (Reproduced with permission from [24]).

#### *3.3. Example to illustrate use of the Interface*

An example of flow through a labyrinth with heat exchange is given to illustrate the simplicity of the interface. The geometry is 2D with dimensions and the content of the computation domain is summarized on Figure 4.

**Figure 4.** Geometry and contents of a 2D computational domain with steady turbulent flow of air and heat exchange.

Initially the pre-processing virtual reality GUI is opened and the case title immediately entered. With reference to Figure 3, under 'Objects' the x-domain size is changed to 2.0 m and under 'Mesh' a Cartesian grid is chosen. Under 'Properties', the user now checks that the default properties for this case are chosen, i.e., 'Air at 20 ◦C, 1 atm', the ambient air is set at 20 ◦C, and the ambient pressure is set at 0 Pa relative to 1 atm.

Under 'Models' the 'solution for velocities and pressure' is left ON, the 'energy equation' is clicked and 'Temperature' is selected. The turbulence model selection is left as the KE variant 'KECHEN'.

Under 'Objects' each of the objects within the domain are selected, sized and positioned and where necessary given the relevant attributes. The objects introduced in order are, the H-BLOCK whose attribute is 'ALUMINIUM at 27 ◦C. the L-BLOCK whose attribute is 'ALUMINIUM and which is a HEAT SOURCE of 100 W', the WALL-E which is a plate, the WALL-W which is a plate, the IN-PLATE, the IN-BLOCK whose attribute is 'COPPER', the INLET whose attribute is velocity in the x-direction at 0.5 m/s and whose temperature is 'AMBIENT', the OUTLET which has 'PRESSURE' as its attribute.

Once the basic geometry is in place, a computational grid is automatically suggested and can be inspected by the 'MESH' toggle, which for the present case, generates a picture as shown on Figure 5. The grid can be customized to the user's wishes simply by clicking on 'Grid Mesh Setting' and adjusting the default numbers.

**Figure 5.** Grid automatically generated for labyrinth case.

In this example, 'Initialisation' and 'Sources' are taken as the defaults, and so only 'Numerics' is left to inspect and adjust. Here the number of iterations is set and the convergence tolerances are left at default. Importantly the probe used as one measure of convergence is appropriately positioned, i.e., not too close to the inlet or not placed in an anticipated region of recirculation.

The solver is now activated to perform the simulation. The progress of the calculations is displayed in relation to convergence, number of sweeps of the computation domain completed and the estimated time left to complete the simulation.

Once the solver has closed, the GUI post-processor can now be opened to view the results. Toggles are available to view 'Vectors', 'Contours', 'Streamlines', Iso-surfaces', and further toggles are available to select which calculated variable is of interest. The results can be viewed on any plane or at any angle by the use of direction and rotation buttons respectively. A typical result is shown on Figure 6 for a vector plot.

**Figure 6.** A typical vector plot.

The students are shown how to save their work, and how to transfer results suitable for reports and further analysis.

#### *3.4. Implementation of the CFD Laboratories*

The Computational Fluid Dynamics laboratories were introduced using a combination of short-lectures on back-ground theory, demonstrations, student group work and discussion, and assisted hands-on computer usage over an intensive four week period. Gradually, as time passed, the students became more confident and were able to navigate their way around the software efficiently and with assurance. The format of the demonstrations was that the instructor built simple simulations while students, watching a large overhead screen, did the same operations on their own computer. Group work was also used where perhaps a group of four students were given an exercise and asked to build a simulation. This proved a very effective and efficient way of learning. Gradually the method of delivering instruction changed over the four weeks, from demonstrations, to the use of detailed instruction sheets fully supported by faculty and teaching assistant intervention, to the distribution of descriptions of problems without instructions or hints and only the occasional help from support staff. There was never any restriction in seeking help from other students (again something which happens in engineering practice).

The main learning outcomes during this part of the course were to become familiar with the equations that govern steady and transient fluid flow and heat transport (conservation of mass, momentum, heat, species and energy) and be able to apply these equations to a range of practical problems in the areas of fluid flow, heat transfer and species transport. Seminars were given to inform students of what was expected during the CFD laboratory. It was stressed that the students should not compartmentalize theory, experiments and computational fluid dynamics but rather view them as mutually complimentary. The main bulk of these seminars was the introduction of the students to standard CFD methodology and procedures and the splitting of the CFD process into three distinct procedures, i.e., pre-processing, solving and post-processing.

During this four week section of the course, theoretical fundamental topics covered included:


This section of the course included discussions on CFD good practices and importantly the students were taught to be critical of their results and how to examine if what they got as results is what they might have expected. During the hands-on sessions, the following areas listed in Table 1 were emphasized.


calculation data.


#### **4. Discussion**

#### *4.1. Overall Course Description*

The main learning outcomes of this course are to understand how to apply the equations of transport governing conservation of mass, momentum and energy in an open and transparent way, and to be able to apply them correctly to a range of practical projects, including


The overall course last twelve weeks and was conducted during the fifth semester for students of mechanical and aerospace engineering, with 38 students taking the course. The first four weeks were used to teach the numerical aspects of computational fluid dynamics using close integration between theoretical lectures and hand-on computer laboratories, using as already described, mainly *Mathematica*, although some exercises using the versatile Python computer language were also introduced. The course during the second four weeks still had theoretical aspects within it, mainly in the form of turbulence modelling, but tended to concentrate on giving the students skills so as to solve real, though simple practical problems. The last four weeks of the course involved the students carrying out the series of projects outlined above, either individually or in small groups, which at first were supplemented with guidance and hints from the instructors on how to solve, but gradually this moved to problem description only, and it was left entirely to the student or students on how to enact a solution. In addition to set class time during these four weeks, the laboratory was open to students at any time, and discussion between the students was actively encouraged.

Assessment of students was by a series of bi-weekly quizzes and by assignment. No final examination was used.

#### *4.2. Use of Mathematica*

Based on the governing equations and boundary conditions established in Section 2, the students had to individually write coding using the symbolic software, *Mathematica* [9], to solve the problem of a lid-cavity flow [21]. The students had to write coding which set-up the required geometry, the mesh parameters and initial and boundary conditions. Next came coding for Eqns. [14] and [15], i.e., for <sup>R</sup>*k*+<sup>1</sup> *ij* and <sup>L</sup>*k*+<sup>1</sup> *ij* followed by coding for the iterative algorithm.

The mesh size for this problem and grid spacing had to be defined, and initially ω and ψ were set to zero for all nodes, except the top wall, where the vorticity is non-zero. The Reynolds number was set to 100, the relaxation parameter, *p* to 1 and the aspect ratio γ to 1. The students also had to set an appropriate residual value *e* and carefully nest the loops used to execute the iterative algorithm. At every iteration step *k*, if the maximum value of the absolute value of L[*i*, *j*] is less than *e*, then the calculations are halted. The iterative loops were wrapped with the Mathematica function Timing to give an estimate of the time taken to do the calculations.

Following completion of the calculations, students had to then write coding to display contour and vector plots of their results. An example of a contour plot obtained for the streamfunction is given on Figure 7.

Extraction of the centerline velocities was also instructive for the students in that first, students were given more experience of viewing velocity profiles, and second there are ample calculations and measurements of the lid-cavity flow for comparison with their results [25–27]. The centerline velocities *u* (in the *x* direction) and *v* (in the *y* direction) were derived from the streamfunction values using the equations

$$u\_{i,j} = \frac{\partial \psi}{\partial y} = \frac{\psi\_{i,j+1} - \psi\_{i,j-1}}{2\mathfrak{h}} \quad j = 2, \dots, n\_y \tag{31}$$

**Figure 7.** Contour plot of streamfunction for lid-cavity problem. (Reproduced with permission from [22]).

The velocity distributions for *u* and *v* in Figure 8 are drawn along the vertical and horizontal centerlines, respectively.

**Figure 8.** Calculated centerline velocity results compared with those of Refs. [25] and [27]. (Reproduced with permission from [21]).

Importantly, the students were made aware that the profiles they calculated must be compared, preferably with experimental measurements, to test the validity of their calculations. As can be seen from Figure 8, the calculations for the horizontal centerline velocities compare very favourably with those reported by [25,27] for Re = 100. Finally, the students were asked to produce coding which displayed the formation of the streamfunction contour plot with time.

#### *4.3. Computational Fluid Dynamics methodology*

In the second third of the course, the students moved on to the skills involved when using CFD in a professional consultancy capacity, while still learning necessary underpinning theory. The idea of fluid mechanics theory, experimental work and the current CFD skills and knowledge being acquired as complementary was reinforced. CFD now has well established methodology coupled with good practice and procedures, and it was emphasized that following these carefully would produce results much more efficiently and with a better degree of confidence. The students were taught how to use CFD judicially and appropriately, and to check their work against experimentation where possible. The idea of breaking the CFD process into three distinct tasks was again reinforced, i.e., using the pre-processor to build the problem, using the solver to obtain a converged solution and the use of the post-processor to obtain informative results. The numerical process of discretization was especially reinforced, as was how to activate the acquired conservation equations, geometrical aspects, fluid and solid properties, activation of sources, especially the gravity or body force, numerical details, which included initialization, the iterative process and how to use under-relaxation when necessary. Setting of the boundary conditions correctly was taught as was how to close the conservation equations by using an appropriate turbulence model [28,29]. When results were achieved it was extremely important that students could interpret what they had got in light of, say, geometric considerations, and also to be open-minded and critical.

During the demonstrations on how to use the GUI interface it was felt important that students could have 'hand-on' experience rather than just watching. Several simple three-dimensional flows were used as exemplars to give an over-arching view of the CFD process and the virtual reality environment which facilitates the VR-Editor (pre-processor), the VR-Viewer (post-processor) and the solver module which performs the calculations was introduced.

It was demonstrated how the VR-Editor is used to set the size of the computational domain, define the position, size and properties of objects introduced into the domain, specify the materials which occupy the domain, specify inlet(s) and outlet(s) and other boundary conditions, specify chosen initial conditions, select a turbulence model (when appropriate), specify the fineness of the computational grid and set parameters which define convergence and also influence the speed of convergence of the solution procedure. Viewing movement controls were also discussed which zoom, rotate, and allow for vertical and horizontal translations. It was emphasized how to systematically create a new environment for a particular simulation and finally set an appropriate number for the maximum number of iterations, set the position of the monitor for convergence. Finally, the students were encouraged to review the computational domain, especially in regard to position and attributes of the objects and the refinement of the grid close to solid surfaces, which at this stage of the demonstration would not be appropriate.

The convergence to a solution was monitored in two ways. First a point in the computation domain was chosen and values of the variables updated after each successive sweep. Once the values became constant it was assumed a converged solution was obtained. This was backed up by calculating the 'global errors' or changes between successive sweeps through the computation domain for each variable and when these errors were deemed sufficiently small, convergence was declared.

Once a converged solution was obtained, the simulation results were viewed by way of the post-processor facilities which displayed vector plots, contour plots, iso-surfaces, streamlines and x-y plots. The students were encouraged to find the optimum way of presenting their results and were also instructed on how to print the results. Very importantly, they were taught to always save and catalogue all input and output files.

#### *4.4. Individual and Group Projects*

For the last four weeks of the course the students were given a series of assignments which got progressively more difficult. The projects were wide ranging and covered important topics, such as the use of orthogonal grids, fine-grid embedding, cut-cell techniques, further exploration of turbulence models and how appropriate they are, the volume of fluid technique and two-phase flows (solid/gas and liquid/gas). Several projects covered how to import complicated geometries, built using a computer-aided drawing (CAD) package. In addition to problems involving purely fluid flow, projects were included which expanded to flow combined with heat transfer, the modelling of species

transport and gaseous combustion. Use was made of the non-premixed combustion model where a natural gas combustion problem was set and solved using the non-premixed combustion model for the reaction chemistry. A project was also included which modelled an evaporating liquid spray where several discrete-phase models, including wall surface reactions were included.

During this part of the course the teaching model used emphasized active and collaborative learning in addition to students and instructors discovering and constructing knowledge and techniques together. Outside of assignments set for grading, the students were encouraged to collaborate and cooperate as much as they though appropriate.

#### *4.5. Online Questionnaire*

An anonymous online survey was conducted before students who had taken the course were given their final grades for the course to help with its formative evaluation. The fifteen questions/statements listed in Table 2 were used during the survey, with each student requested to mark as they thought appropriate, on a five-point Likert scale, whether they: strongly agree, agree, neutral, disagree, strongly disagree with the question/statement. There was also a column to mark if they had no opinion, and a space to make short comments for qualitative feedback.


Generally, student feedback surveys have a very low response rate [30,31]. However the response rate here was relatively high (77%) and overall the results of the survey showed a positive attitude of the students towards the course. The numerical responses to the survey are shown on Figure 9 and indicate that students felt they had benefited from their exposure to this CFD course. In additional comments made by the students the view was expressed that the amount of material introduce was about right, although some felt that some of the exercises were unnecessarily long. Students did not seem to worry about the concept of streamfunction being used but some did express concern about their understanding of vorticity in a physical sense. The students were generally appreciative that they could easily visualize flow using contour and vector plots and generally agreed that the combination of basic theory combined with computer coding gave them more confidence and understanding. Student showed some enthusiasm about learning more about CFD and in particular how they could incorporate CFD into projects from other subjects and capstone projects.

It was noted that the students liked the hands-on and self-discover approach, although at times some frustration was also noted, and they were fairly neutral on working in groups as opposed to working on their own. In fact it was very noticeable that students took pride in performing the simulations by themselves with a real sense of achievement ensuing.

**Figure 9.** Chart showing survey results (N = 29).

Several points should also be made: the traditional view of CFD is that it has a steep learning gradient, but it has been shown here that with proper interfaces and a limited depth of flow difficulty that this gradient can be brought to an acceptable level. Also, it should be pointed out that for the practical software used no mention of code development was made to the students, as the learning outcome was to become proficient in the use of the existing coding. This would need to be remedied by a later course which involves ways of interacting with the existing, quite complicated core coding.

Evaluation of the course will continue in the future and hence be developed according to results. Only student views have been collected up to now but it is intended to take into account both student and instructor views in the future. It is felt more attention to how interest is aroused in general concerning the use of CFD is needed in future surveys as is the promotion of the use of CFD as a research tool during say capstone projects and post-graduate work. There will also be an attempt to elicit feedback from students who are at the 'beyond-completion' stage of the course.

#### **5. Conclusions**

In this paper the approach to delivering understanding of the numerical and practical aspects of the use of Navier-Stokes equations to solve fluid mechanics problems is outlined. For the numerical understanding, a well-defined sequence of steps needed to solve the Navier-Stokes equation cast in vorticity-streamfunction form was outlined. The sequence was integrated with the software package *Mathematica* at appropriate stages to take care of tedious computations, and hence allowed the students to concentrate on the overall details of the solution process. In addition, it is now important generally to integrate computer technology so as to complete and compliment lectures and theory. This has the advantages of helping with the computations, aiding presentation for reports and the ability to continue with further analysis as well as motivation for the students. Incorporating Mathematica also takes away the 'black-box' approach so often encountered by students with full CFD commercial codes, which give no real understanding of the numerical mathematics involved.

In addition to teaching the students some of the numerical aspects of CFD, this course also allowed for an introduction to the type of CFD carried out in professional offices, and taught additional topics like turbulence modelling, the idea of obtaining a grid independent solution and how critical it is to validate results obtained by the CFD approach. One of the main reasons for the inclusion of the second part of this course was to give the students practical skills and it was found that the simplified interface design does provide students with hands-on experience, gained through an interactive and user-friendly environment, and encourages student self-learning. It was noted from a survey that students liked getting hands-on experience and the self-discovery approach, although at times some frustration was noted when setting a problem up.

**Author Contributions:** Conceptual, D.A. and M.J.; methodology and software D.A.; validation and analysis, D.A. and M.J.; original draft preparation, D.A.; review and editing, M.J.

**Funding:** This research received no external funding.

**Conflicts of Interest:** The authors declare no conflict of interest.

#### **Appendix A**

In general, when solving for the nodal quantities, this is in effect solving a system of *n* linear equations, where *n* is the total number of nodes in the system. The system of equations can easily be described by

$$A\mathbf{x} = \mathbf{b} \tag{A1}$$

where *A* is a *n* × *n* matrix of coefficients, **x** is a vector of *n* unknown values, and **b** is a vector of *n* constants. Rather than inverting the matrix *A* directly, the Gauss-Seidel method can be used to solve the equations iteratively, which is especially desirable for large systems. In general the Gauss-Seidel method employs forward substitution and is given by

$$\mathbf{x}\_{i}^{k+1} = \frac{1}{a\_{ii}} \left( b\_i - \sum\_{j=1}^{i-1} a\_{ij} \mathbf{x}\_{j}^{k+1} - \sum\_{j=i+1}^{n} a\_{ij} \mathbf{x}\_{j}^{k} \right) \tag{A2}$$

for *i* = 1, 2, ... , *n*. The iterations are performed until the difference of the quantity value, often called the residual error (*E*), between iterations reaches a specified tolerance.

#### **References**


© 2019 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (http://creativecommons.org/licenses/by/4.0/).

## *Article* **Fluids in Music: The Mathematics of Pan's Flutes**

#### **Bogdan G. Nita 1,\* and Sajan Ramanathan <sup>2</sup>**


Received: 15 July 2019; Accepted: 30 September 2019; Published: 10 October 2019

**Abstract:** We discuss the mathematics behind the Pan's flute. We analyze how the sound is created, the relationship between the notes that the pipes produce, their frequencies and the length of the pipes. We find an equation which models the curve that appears at the bottom of any Pan's flute due to the different pipe lengths.

**Keywords:** Pan's flute; music; sound frequencies; wind instruments

#### **1. Introduction**

Fluids impact our everyday lives at any moment, from the air we breathe, to the blood circulating in our bodies, to the rivers and oceans that we swim in and drink from. Most of the examples concerning moving fluids are extremely complex with behavior governed by complicated equations involving many parameters. Applications of fluid mechanics are extremely varied and this translates in a plethora of methods and approaches to teach the subject. In this paper, we focus on the relation between fluids and musical instruments and present a somewhat atypical way to introduce fluids to undergraduate students.

Fluids, and in particular flowing air, are indispensable in the creation of sound in wind instruments and human voicing. The interaction between flowing air and different structures, e.g., inside of a tube, a reed or human vocal folds, produces air vibrations which are perceived as sounds by the human ear. The study of these interactions are useful to understanding and perfecting musical instruments or to identifying and curing vocal disorders. In this paper, we look at the geometry of Pan's flutes and the relation between fluid dynamics and equal temperament scales brought together by this musical instrument.

Pan flutes are wind instruments consisting of multiple pipes which are gradually decreasing in length (see Figure 1). The pipes are typically made from bamboo, maple or other wood varieties. Other materials include plastic, metal or ivory. The tubes are stopped at one end, and are tuned to correct pitch by placing small pieces of rubber inside. Very often, the pipes are positioned to form a curved surface to allow quick and easy access to all pipes. The instrument featured in Figure 1 is a maple tenor Pan's flute tuned in the key of G-major. The longest pipe measures about 29 cm and produces the lowest sound of the instrument, D4. Table 1 shows the notes produced by each pipe and corresponding frequencies measured by any physical tuner or a tuner app.

**Table 1.** The notes and their corresponding frequencies (rounded to the nearest integer) produced by the Pan's flute.


**Figure 1.** An 18-pipe Pan's flute tuned in G-major and a bar graph representing the lengths of individual pipes in cm. The red bars show the root notes (in this case G's), the gray bars show the location of whole tone intervals, and the blue bars show the location of semitone intervals.

The goal of this research is to determine the relation between the length of the pipes and the notes played by each pipe, therefore providing a functional formula for the curve created at the top of the instrument in Figure 1. We will do this in two steps: first, determine a relation between the frequency and the length (function *f* in Figure 2) and then a relation between the notes and corresponding frequencies (function *L* in Figure 2). The composition between the two functions should provide the desired relationship.

**Figure 2.** The relation between the notes played by a Pan's flute, their corresponding frequency, and the length of pipes as a composition of functions.

The benefits of this apparent simple problem are twofold. First, one can learn about several math-physics areas and methods starting with fluid dynamics, wave equation, partial differential equations and continuing with elements of algebra in particular frequency ratios, and logarithmic and exponential functions. Second, the application of mathematics to a seemingly unrelated field like music (and art in general) is extremely exciting, novel and attractive to students who otherwise would not consider working on a mathematical research problem.

In this paper, we assume all pipes are ideal, i.e., the wavelength of the sound produced is proportional to the length of the tube. This is equivalent to assuming a zero diameter for the pipes of the Pan's flute, which is an acceptable approximation for the current research. In reality, the diameter of the pipes plays a role in the pitch produced by the musical instrument: a pipe with a non-zero diameter appears to be acoustically longer than its physical length. When designing musical instruments consisting of large diameter pipes (organ, boom-whacker, etc.), an end-correction of the pipes needs to be applied. For an in-depth discussion of this effect, see [1].

#### **2. The Relationship between the Frequency and the Length of a Pipe**

Sound in pipes is produced by vibrating air pressure due to the air interaction with the walls of the pipe. The partial differential equation that models this physics is the wave equation for the acoustic pressure. The equation can be developed from the linearized one-dimensional continuity equation, the linearized one-dimensional force equation, and the equation of state (see for example [2]), and takes the form

$$\frac{\partial^2 p}{\partial x^2} = \frac{1}{c^2} \frac{\partial^2 p}{\partial t^2},\tag{1}$$

where *p*(*x*, *t*) is the air pressure due to air moving inside of the pipe, *x* is the coordinate along the pipe, *t* is time, and *c* ≈ 340 m/s is the speed of sound in air. The boundary conditions associated with this differential equation are based on the physics of the problem: at the open end, the moving air has nothing to push against and therefore the pressure is zero; at the closed end, the air piles up and increases the pressure to a maximum value. Therefore, for a Pan's flute pipe of length *L*, open at *x* = *L* and closed at the *x* = 0, the boundary conditions are

$$p(L, t) = 0,\tag{2}$$

$$p\_{\mathcal{X}}(0, t) = 0.$$

It is worth mentioning that for other wind instruments, such as the flute, clarinet, etc., the partial differential equation given in Equation (1) is the same while the boundary conditions in Equation (2) change to reflect different constructions. The solutions of the boundary value problem described by Equations (1) and (2) are linear combinations of the normal modes [3]

$$p\_{\rm n}(\mathbf{x},t) = \cos\left(\frac{2n-1}{2}\pi\frac{\mathbf{x}}{L}\right)\left(b\_{\rm n}\cos\left(\frac{2n-1}{2L}\pi ct\right) + c\_{\rm n}\sin\left(\frac{2n-1}{2L}\pi ct\right)\right),\tag{3}$$

where *n* = 1, 2, 3 ... and *bn* and *cn* are constants. It is easy to see now that the frequency of the *nth* mode is

$$f\_n = \frac{(2n-1)c}{4L}.\tag{4}$$

These frequencies have a simple explanation related to musical instruments. Notes played on conventional instruments (wind, string, etc.) produce one main frequency, the fundamental, and a series of lower amplitude frequencies, partials, which are integer multiples of the fundamental frequency. For example, when blowing air into the largest pipe of the Pan's flute in Figure 1, you will only hear the fundamental frequency of *f*<sup>1</sup> (the note D4) even though an infinite series of partials, having frequencies 3 *f*1, 5 *f*1, etc., are produced.

The 1st mode, the fundamental, is described by the frequency

$$f\_1 = \frac{340}{4L},$$

which is our first desired equation relating the frequency of the musical note produced by a pipe and the length of that pipe. For example, the longest pipe in our instrument produces a frequency of approximately 294 Hz, which means that its length is approximately

$$L = \frac{340}{4 \times 294} = 0.29 \text{ m},\tag{6}$$

which agrees with the measurements in Figure 1.

#### **3. The Relationship between the Musical Notes and the Frequencies**

It was long postulated that different notes whose frequency ratios are expressible as ratios of small integers are consonant (for a more in depth discussion see [4]). For example, *f*<sup>1</sup> and 2 *f*<sup>1</sup> attain the ratio of the smallest possible integers, namely 2:1, the interval (the distance between them) being designated as an octave. Another example of a consonant interval is the perfect fifth, which is represented by two notes whose frequencies achieve a 3:2 ratio. Based on this condition of consonance, it was natural

to build scales using the most consonant intervals possible, namely the octave and the perfect fifth. This produced the Pythagorean scale (see Table 2).

**Table 2.** One octave of the Pythagorean scale of G major.


The scale in Table 2 is obtained by choosing an octave (say G4–G5), then adding to the fist note (G4) a perfect fifth interval, thus obtaining the second note (D5). Adding another perfect fifth interval to D5, we obtain a frequency ratio of 9:4 (with respect to G4) that is outside of our octave. Reducing this interval by an octave (by dividing this frequency ratio by 2), we obtain a ratio of 9:8, which is our third note in the scale (A4). We continue the process until we discover all the notes in the scale (for more details, refer to [4]). In this system, adding/subtracting intervals amounts to multiplying/dividing frequency ratios, which is why it is commonly referred to as a logarithmic scale. One important observation is that the Pythagorean scale is based on the assumption that going up 12 fifths and coming down 7 octaves will return you exactly to the same starting note, or, in other words, that

$$2^{19} \approx 3^{12}.\tag{7}$$

While these numbers are close, they are not exactly equal, which gives rise to certain problems in the Pythagorean scale. Among the issues are other musical intervals, like the third, which are perceived as dissonant in this scale. Other scales were later developed to alleviate some of these problems—for example, just intonation, meantone and the equal temperament scale.

The equal temperament scale makes all the semitones equally distant (see Table 3). It is designed to 'fix' all the problems associated with other scales by distributing the dissonance occurring in different intervals throughout the entire scale. This implies that, while classical intervals like the perfect fifth or the third are no longer going to have frequency ratios represented by small integer ratios, they are going to sound the same (relatively consonant) in any key and any pitch.

**Table 3.** One octave of the equal temperaments scale of G major.


All the modern musical instruments, our Pan's flute included, are tuned in the equal temperament scale. In this scale, the frequency *f* of any note can be obtained from the frequency *f*<sup>1</sup> of any reference note (we chose D4 as our reference note as it corresponds to the note produced by the first pipe of the Pan's flute) from the formula

$$f = 2^{\frac{k}{2}} f\_{1,1} \tag{8}$$

where *x* represents the number of semitones that separates the note with the frequency *f* from the first note: *x* = 0 represents the first note, D4, *x* = 2 represents the second note, E4, *x* = 4 represents the third note, F#4, *x* = 5 represents the fourth note, G4, and so on. Note that *x* does not cover all the positive integer values since the scale contains only the main notes in the G-major scale and does not include the sharps. This is consistent with the construction of the Pan's flute that we use in this paper. Because of this, when plotting the lengths of the pipes as a function of *x*, we will need to adjust for these apparent irregular values taken by the variable *x*.

#### **4. Putting It All Together**

Combining Equations (5) and (8), we find

$$L = \frac{340}{4 \times 2^{\frac{\pi}{12}} \times f\_1} \tag{9}$$

which is the desired relation between the length of a pipe and the note played by that pipe. Plotting this curve on the same coordinate system with the model of the musical instrument, we obtain Figure 3, which shows a perfect match with our initial model of the Pan's flute.

**Figure 3.** The curve in Equation (9) superimposed on the model of the Pan's flute. The semitones, represented in blue, were adjusted to indicate the correct musical intervals.

#### **5. Conclusions**

In this paper, we discuss a mathematical model of Pan's flutes. The interaction of mathematics and music makes it an interesting application for undergraduate students as they find refuge from the mathematical rigor into the flexibility and creativity of arts. The study of wind instruments provides a rich environment for teaching fluid mechanics and other areas of applied mathematics in a fun and relaxed way.

**Author Contributions:** This work was performed while S.R. was an undergraduate student at Montclair State University. B.G.N. and S.R. read and approved the final manuscript.

**Funding:** This research received no external funding.

**Conflicts of Interest:** The authors declare no conflict of interest.

#### **References**


c 2019 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (http://creativecommons.org/licenses/by/4.0/).

## *Article* **Bottle Emptying: A Fluid Mechanics and Measurements Exercise for Engineering Undergraduate Students**

#### **Hans C. Mayer**

Department of Mechanical Engineering, California Polytechnic State University, San Luis Obispo, CA 93407, USA; hmayer@calpoly.edu

Received: 12 September 2019; Accepted: 30 September 2019; Published: 11 October 2019

**Abstract:** A comprehensive exercise, suitable for an undergraduate engineering audience studying fluid mechanics, is presented, in which participants were tasked with emptying a bottle. That simple request yielded data collected by students and the author for *N* = 454 commercially available bottles, spanning nearly four orders of magnitude for volume *V*, and representing the largest experimental dataset available in the literature. Fundamental statistics are used to describe the emptying time, *Te*, for any single bottle. Dimensional analysis is used to transform the raw data to yield a predictive trend, and a method of least-squares regression analysis is performed to find an empirical correlation relating dimensionless time *Te g*/*d* and dimensionless volume *V*/*d*3. We find that volume, *V*, and neck diameter, *d*, can be used to estimate the emptying time for any bottle, although the data suggests that the shape of the neck plays a role. Furthermore, two basic analytical models found in the literature compare favorably to our data and empirical correlation when recast using our dimensionless groups. The documented exercise provides students with the opportunity to use basic engineering statistics and to see the utility of dimensional analysis.

**Keywords:** multiphase flow; slugging; flooding; bottle; bubbles

#### **1. Introduction**

#### *1.1. A Familiar Scene*

The scene depicted in Figure 1a is a familiar one. Here, we see a sequence of still images, captured during the emptying of an inverted bottle, that show the complex behavior of water leaving and air entering through the single opening at the neck. When we observe such an emptying event in its entirety, we cannot help but marvel at what unfolds—in particular, the violent motion within the bottle as rising bubbles reach the surface and the oscillatory flow at the outlet, all of which is accompanied by a series of "glugs" until at last the bottle has been evacuated. We do our best to illustrate this behavior in the superposition of sequenced images in Figure 1b, which from start to finish takes ∼10 s. The images of Figure 1c present a strikingly different scene. Here, we have removed the bottom of the bottle, and we now find the flow to be orderly and predictable, without the competition between fluid phases at the neck. This emptying process takes only ∼2 s, Figure 1d showing the superposition of images and progression of the surface. Thus, if we ask, "what is the emptying time for a bottle?" The answer is readily accessible for the vessel of Figure 1c,d, but can be a daunting task for that of Figure 1a,b, in particular for an undergraduate engineering student at the start of their study of fluid mechanics.

**Figure 1.** Photographs of water emptying from a bottle (wine bottle: 750 mL volume and 20 mm diameter opening at neck). (**a**) A sequence of images from the emptying event (1.67 s apart). A slug of air can be seen to exist in the neck and the bulk of the liquid is populated with bubbles both large and small. Superposition of sequential images during a typical emptying event is shown in panel (**b**). When the bottom of the bottle is removed, making it an open-top container when inverted, the scene in panel (**c**) is strikingly different (0.23 s between images). The air–water interface within the bottle is flat, its position more readily predictable (**d**), and has a uniform jet of liquid issues from the opening in the neck rather than a behavior. All images were recorded at 60 fps using a Nikon D3400.

#### *1.2. Literature Review*

The complexity of bottle emptying, as exemplified in Figure 1, must have casually intrigued scientists and laypersons for a very long time, but a review of the literature only shows a handful of papers dedicated to the scientific study of the subject, and these were published primarily over the last three decades. Although Davies & Taylor [1] and Zukoski [2] investigated the drainage of tubes via the passage of long bubbles, Whalley [3,4] was the first to investigate the emptying times of real bottles, i.e., commercially available bottles characterized by a neck with a diameter smaller than that of the body. His studies were concerned with the overall emptying time of these vessels, which ranged in size and shape, and he recognized that the total time was governed by the nature of the flow at the outlet—in particular, he identified the closely related phenomena of flooding and slugging and their relation to this flow. The occurrence of flooding, a type of concurrent flow of gas and liquid phases within a tube, can be predicted using a semiempirical relation attributed to Wallis [5] that incorporates a Wallis flooding "constant" *C* (see Section 2.5). For an air–water system, this results in values of *C* ∼ O(1). The values of *C* calculated from the experiments of Whalley, using a small number of bottles, yielded consistent results strengthening the idea that bottle emptying is a flooding process. Furthermore, Whalley recognized that emptying is also similar to slugging: another regime of two-phase flow in which large slugs of gas form in tubes. If thought of in this context, the emptying process can be modeled as liquid flowing out of the bottle and around a stationary slug of air (cf. Figure 1b, looking

closely at the bottleneck). Whalley's experiments also demonstrated that emptying time, and thus *C*, can be influenced by water temperature, neck length (artificially created using tube inserts), and angle of inclination. He further considered differences between bottle emptying and filling, the later process was accomplished by submerging an upright empty bottle below the free surface of water in a large tank. Tehrani [6] also measured the emptying time for a very limited number of bottles and found, similar to the results of Whalley, that increases in water temperature significantly influence emptying time.

More rigorous experiments concerning the emptying of bottles were undertaken by Schmidt and Kubie [7], but to carefully investigate the details of emptying, they performed controlled experiments with "ideal" bottles, i.e., various sizes of plastic tubes of constant cross section with centrally located outlets that provided short necks (with either sharp or filleted/profiled entrances). These authors recognized the cyclical nature of the emptying process, but were concerned primarily with gross behavior of the air–water interface within the body of the bottles and not the physics of the process on the single-cycle scale. In particular, their key findings showed that during emptying the velocity of the air–water interface (within the bottle) is nearly constant with respect to the level in the bottle, implying that height does not play a role in the total emptying time beyond increasing the volume of the container; that the velocity changes with the shape of the outlet (increasing velocity with more rounded entrances); and that the average liquid discharge velocity increase weakly with both bottle diameter and neck diameter. These key results were echoed in the findings of Kordestani and Kubie [8] and Tang and Kubie [9], who also used "ideal" bottles. Unlike Schmidt and Kubie, Kordestani and Kubie presented many of the results of their experiments in the form of the Wallis flooding constant *C* and found favorable comparison to the results of Whalley (cf. Section 2.5), noting that *C* increases with a smoother outlet profile (increasing *C* indicating a faster emptying time). Their experiments with liquids emptying from bottles into a liquid environment demonstrated that the nature of the emptying process is the same but slower than the gas–liquid case. Changes in *C* for air–water systems due to the inclination of the outlet was investigated by Tang & Kubie [9].

Clanet & Searby [10], without reference to the multiple works of Whalley [3,4] or Kubie [7–9], thoroughly investigated the emptying of ideal bottles both theoretically and experimentally, considering both the long timescale associated with complete emptying and the short timescale responsible for the familiar "glug-glug". The basic construction of their bottles was the same as that of Kubie et al., i.e., long tubes with centrally-located outlets; however, Clanet and Searby used thin plates with sharp edges for their outlets rather than the thicker plates of Kubie. Not surprisingly, owing to the similarity in apparatus, their experiments revealed the same quasi-constant velocity of the air–water interface within the tube and noted that this velocity decreased with reduction in outlet diameter. These authors also developed a simple analytical model to predict the emptying time for these bottles which we will make use of later. Considerable detail is provided by Clanet & Searby regarding the physical origin of the oscillations (in mass flow rate and pressure) characterizing the short timescale glug-glug, but those results are not directly relevant to the new work presented here. Most recently, computational fluid dynamics (CFD) has been shown by Geiger et al. [11] to accurately simulate the bottle emptying process, including the transient behavior of the complex two-phase flow and the overall emptying time. A CFD analysis of bottle emptying has also been published by Mer et al. [12], along with experiments to quantify transient and oscillatory behavior associated with the variety of two-phase flow phenomenon encountered during emptying [13]. These experimental results are expected to help validate future CFD studies.

#### *1.3. Motivation—Establishing a Curricular Thread*

Inspiration for the elements of this paper originated from a homework problem buried within S. Middleman's "Introduction to Fluid Dynamics" [14], which begins "a classroom demonstration on the time to drain water from a set of initially filled inverted bottles yielded the following results..." and is concluded with a set of six data points (bottle volume and emptying time) extracted from

the work of P.B. Whalley [4]. Expanding on this example, we have developed a complete exercise that provides the opportunity for a class of students to consider a complex, but commonplace, fluid flow phenomenon from the standpoint of dimensional analysis; collect and analyze data using basic engineering statistics; combine data to form a large set; plot the data; and extract a predictive trend using basic regression techniques. Such an exercise, presented as a complete unit, forms what might be considered a curricular thread, stitching together various aspects of a variety of science and engineering courses, in particular an undergraduate fluid mechanics course. However, as the emphasis of the exercise is not a detailed investigation of the fluid dynamics of a multiphase flow, the exercise described here is accessible to a broad audience and would be of value beyond a fluid mechanics course. Furthermore, because of the nature of the experiments, there is no need for expensive laboratory equipment or an elaborate demonstration apparatus—a plethora of bottles in a wide variety of shapes and sizes are readily available. In addition, the instructions for data collection are simple, and as such give the project a feel of a public study [15]. This particular fluid mechanics example has the added advantage that the data can be compared directly to a select number of sparse datasets. If an instructor is so inclined, there also exists the opportunity to encourage students to research the open literature for the two models provided for comparison. In doing so, they will find evidence of the rich and complex phenomena that accompany an event that might previously have been considered mundane. In what follows, we present this complete exercise and results from data collected by students and the author, over many academic quarters and years, who were asked a simple but intriguing question: "What is the emptying time for a bottle?"

#### *1.4. Outline*

The work presented here is divided conveniently into several main parts. In Section 2.1, we introduce the protocol for data collection. In Section 2.2, an analysis of the basic statistics associated with the data obtained from a few single bottles is presented. A complete picture of the emptying time data for the entire collection of bottles is contained in Section 2.3 as well as a summary of the measurement uncertainties from experiments. A review of the dimensional analysis used to obtain relevant dimensionless groups is presented ending with a graphical summary of that analysis. In Section 2.4, we focus on regression analysis of the dimensionless data to obtain a predictive trend for bottle emptying. Finally, in Section 2.5, we compare our data and the results from the regression analysis to the limited bottle emptying data available in the literature. We also provide comparisons of simple models published in the literature to our extensive dataset and find reasonable agreement.

The primary audience for this paper are instructors and students in an undergraduate engineering fluid mechanics course; however, the data by itself would be useful in an engineering statistics/measurements course. The paper is structured so that different portions can be used to direct exercises in those topics. For example, Sections 2.2 and 2.4 can be considered as standalone projects for an engineering statistics class, whereas Sections 2.3 and 2.5 are suited for a dimensional analysis example or homework problem in a fluid mechanics lecture. Alternatively, all aspects (Sections 2.2–2.5) together form a complete investigation and represent a project that when applied at the appropriate level leverages content from a variety of engineering courses.

#### **2. Results and Discussion**

What follows is a suggested presentation of the data and analysis for use as a student exercise and/or guided discussion. It is intended for an undergraduate engineering audience. Familiarity with basic statistics and fluid mechanics are helpful; however, sufficient details, guidance, and references have been provided for the reader. All quantitative analysis can be completed using a basic computer spreadsheet program, e.g., Excel-<sup>R</sup> , or programmed in MATLAB-<sup>R</sup> , and do not require any statistics-specific software. All experiments can be completed using simple tools and instruments (e.g., a stopwatch, ruler, graduated cylinder, scale, etc.). Components of the complete exercise presented here

were implemented in various forms during sophomore or junior level classes at California Polytechnic State University San Luis Obispo, the University of California at Santa Barbara, and Rutgers University.

#### *2.1. Data Collection Protocol*

Regardless of the format of the exercise (e.g., an extended statistics-only exercise, a fluid mechanics dimensional analysis problem, or both), students were provided with a basic data sheet and a short handout explaining the overall goal—to gain insight into emptying of single outlet vessels via collective experiments using commercially available bottles. Each student was tasked with finding a bottle or single-outlet container for their experiment (from here on the term "bottle" will be used exclusively to denote any single-outlet container used for experiments). Certain limitations applied: ordinary soda/beer bottles were discouraged to promote a wide variety of shapes and sizes (no restriction was placed on the shape), and it was suggested that the bottles be rigid (e.g., glass or hard plastic) to reduce, or avoid altogether, flexing of the sidewalls during emptying. Because the interest is in single-outlet containers, students were encouraged to use any single-outlet vessel. Thus, many of the "bottles" collected for use were not intended for drinking or even holding liquids. Example include bottles for cooking sauces and oils, jars, soap/shampoo bottles, vases, etc.

Once a bottle was found, students were asked to measure the internal neck diameter, *d*, and report the nominal value and the measurement uncertainty (further details are provided in Section 2.3 where relevant). Measurements of internal bottle volume *V* were performed gravimetrically or volumetrically as permitted by availability of equipment. Students were instructed to fill the bottle completely for these internal volume measurements, as all emptying experiments would use filled bottles. Gravimetric measurements were performed using digital balances, and volumetric measurements were obtained using graduated cylinders, measuring cups, or syringes. In all cases, a nominal value and measurement uncertainty for the bottle volume was obtained. Later versions of student instructions asked for measurements of overall bottle height, *H*, and maximum diameter, *D*, along with a reporting of the measurement uncertainties. The later inclusions of bottle height and maximum diameter mean that there are more measurements of emptying time that correspond to values of *d* and *V* than those that correspond to *d*, *V*, *H*, and *D*. In these later iterations, students were also asked to submit photographs of bottles to confirm shapes and reported dimensions.

A simple data collection protocol was followed. To start, the bottle was completely filled (up to the outlet of the neck) with room temperature tap water, assuring approximate consistency in liquid viscosity and surface tension. Next, the bottle opening was blocked with a hand or card to prevent outflow and then the bottle was inverted and oriented vertically. Inversion was followed by a short delay to minimize swirl during emptying. It is known that emptying time for bottles will vary with the orientation angle as well as swirl [4]. The protocols students were asked to follow attempt to reduce the effect of both variables from the experimental results. Finally, the students let the bottle empty while recording the overall emptying time *Te*. This process was repeated for *n* = 3, 5, 10, or 25 trials depending on the theme of the exercise and/or difficulty in handling filled bottles (this is especially true for very large bottles, i.e., of several gallons, where *n* = 3–5 was considered reasonable).

Not surprisingly, the students participating in these exercises were able to find a diverse range of bottle shapes and sizes. Several hundred students, distributed over multiple academic quarters, have contributed to the bottle emptying data presented here, along with many bottles and containers tested by the author. The result is that for the present study we have data from *N* = 454 bottles (The entire *N* = 454 collection of bottle information, including the dimensions (*d*, *D*, *H*, and *V*), shape designation, and emptying times, are available in Table S1 in the Supplementary Materials section). Efforts have been made to reduce to an insignificant number duplicate bottles from this dataset. This was accomplished by either a direct visual examination of the bottle (to assess shape, brand, etc.) or a review of a photograph provided by the student. This dataset is larger than any other reported in the literature [3,4,6] and represents a vast range of shapes and sizes. In particular, bottle volume spans 10 *V* 27, 000 mL, with emptying times ranging from less than a second to nearly four minutes.

#### *2.2. Exercise 1—Single Bottle Experiments (Statistics Focus)*

This section provides an overview of statistics generated from multiple measurements of emptying time using a single variable, e.g., descriptive statistics and basic inferential statistics based on the emptying time considered as a normally distributed variable. Several graphical means of describing the data are also presented. A complete listing of equations used to generate the reported statistics is found in Appendices A and B. We start here, before proceeding to the results, using dimensional analysis, as this could be treated as a standalone exercise in basic statistics.

#### 2.2.1. Single Bottle Statistics—Descriptive

The data and analysis from experiments performed by the author is now provided, in which a single bottle was emptied 100 times. When students were asked to perform similar experiments for the purpose of single bottle statistics, the number of trials was reduced to 10–25 in the interest of limiting experimentation time outside of class. However, larger number of trials are preferable from the standpoint of obtaining statistically significant results. Here, the measurand of interest is the emptying time, *Te*. As demonstrated in what follows, data collected from a single bottle can be used to introduce and/or reinforce the key elements of descriptive statistics, graphical presentation of data, and basic inferential statistics for a single variable. Later, we show how these findings are used to estimate overall emptying time uncertainty.

Before considering in detail the data collected during the course of experiments, it is worthwhile to generate a sequential plot to ensure that the emptying time does not itself change with time/order, i.e., to ensure that time is not a lurking variable [16] in the analysis that follows (although it is not anticipated, based on the physics of bottle emptying, that the emptying time will vary with the order of collection). Pedagogically, this is an instance in which, prior to generating the plot, students can reflect on what they expect to see from a sequential plot of the data and explain their expectations. Figure 2a depicts the sequential plot of bottle emptying time for 100 trials performed with the same bottle (cf. Figure 7a for a diagram of the bottle). The data appears as expected, possessing a time-invariant central tendency and spread, quantified later, with the scatter in the data likely caused by subtle differences in the initial conditions of the experiment, for example, differences in filled volume, initial fluid motion within the bottle, and geometry of the air–water interface at the bottle opening. Reaction time likely plays a role as well. We can therefore proceed with further analysis and turn our attention to descriptive statistics and graphical presentations of those results.

At this point, we make no assumption regarding the distribution of the data, nor do we make any inference from the data. Rather, we are interested in providing concise summary measures of the data at hand [16]. The summary measures of interest will describe the central tendency of the data, the spread—or variability—about the central tendency, and the shape of the data. More specifically, these measures will be the sample mean , median, sample standard deviation, five-number summary, and the skewness and kurtosis. We can also graphically present the data to highlight these metrics.

The mean (A1) is easily calculated using a spreadsheet, and for the data shown in Figure 2a, the mean value is *Te* = 6.61 s. The median—the middle value in the ordered set of data—is *T*˜ *<sup>e</sup>* = 6.63 s. A difference of only 0.3% exists between the two measures of the central tendency. There are many ways to characterize the spread, or variability, of the data about the measure of the central tendency. We will begin by generating a "five-number summary" after the data has been ordered from minimum to maximum (*j* will be the index for the ordered dataset). Once ordered, we can easily obtain the range *Te*,max − *Te*,min, and the interquartile range, i.e., *IQR* = *Q*<sup>3</sup> − *Q*1, where *Q* is used to denote a quartile. The complete five-number summary is presented in Table 1.

**Figure 2.** (**a**) Sequential plot of emptying time recorded from 100 trials using a single bottle (Brer Rabbit Molasses, 375 mL, and *d* = 18.3 mm; cf. Figure 7a). Emptying time was measured using a digital stopwatch with 0.01 s resolution. No apparent trend over time (i.e., trial number *i*) is suggested by the plot. The sample mean (*Te* = 6.61 s) is shown as the solid horizontal line, and the sample standard deviation (*s* = 0.38 s) is indicated symmetrically about the mean by the dashed lines. Counting of the data points reveals that 71% are located within *Te* ± *s*. A box-and-whisker plot is located at the right edge. The extent of the box is reflective of the interquartile range and the line within the box indicates the value of the median (*T*˜ *e* = 6.63 s). (**b**) Frequency distribution created from the single bottle data (*n* = 100). For the distribution shown, the bin number is *k* = 10 and Δ*Te* = 0.20 s. Superimposed on the histogram is a normal distribution generated using *x* and *s*, in place of *μ* and *σ* within Equation (A8), and it is evident that there is agreement.


The five-number summary can be depicted graphically in the form of the box-and-whisker plot [16]. This type of plot is provided on the right edge of Figure 2a. The shape of the box-and-whisker plot reinforces the notion that the distribution of emptying times measured for a single bottle is nearly symmetric. Aside from the five-number summary, we can calculate a single value to characterize the spread, namely, the sample standard deviation *s* (A2), which for the data has a value of *s* = 0.38 s. The standard deviation can be considered as a kind of "average" distance the data sits, as a whole, from the central tendency. The extent of the standard deviation about the sample mean, i.e., *Te* + *s* and *Te* − *s*, is also shown in Figure 2a, and we find that 71 out of 100 data points, i.e., 71%, fall within this region.

The symmetry and peakedness of the measurand distribution, both measures of the shape, can each be expressed by a single value—the skewness *Sk* (A3) and kurtosis *Ku* (A4), respectively. We find, for the data in Figure 2a, the value of the skewness to be *Sk* = −0.34 and the kurtosis *Ku* = 3.03. Skewness can take on both positive and negative values. Positive skewness implies a distribution shape

that is shifted to the right, or, more specifically, the mean value exceeds the mode. Negative skewness indicates the reverse–the value of the mode exceeds the mean. For a symmetric distribution, *Sk* = 0, i.e., the mean value is equal to the mode value [17]. To interpret the value of the skewness obtained from our data, let us consider the following rules of thumb [18]; highly skewed, |*Sk*| > 1; moderately skewed, 1 > |*Sk*| > 0.5; approximately symmetric, 0.5 > |*Sk*|. Using this interpretation with a value of *Sk* = −0.34, we can conclude that the distribution is approximately symmetric. The kurtosis calculated from a set of data is often compared against the value for a known distribution, the normal distribution being a frequent comparator. For a normal distribution, *Ku* = 3, with values of *Ku* < 3 representative of a flatter distribution, and values of *Ku* > 3 for more peaked distributions [17]. Therefore, the calculated value for the kurtosis (*Ku* = 3.03) is reasonably close to that of a normal distribution. It should not be surprising then that we found 71% of the data to fall within *Te* ± *s*, as 68% of data will fall within *μ* ± *σ* for a normal distribution (and for *n* = 100 we expect that *x* → *μ* and *s* → *σ*; in other words, the sample is approaching a population).

The quantitative measures of the central tendency, spread, and shape can also be graphically presented, as we have seen with the sequential plot and box-and-whisker plot. However, a frequency distribution (i.e., histogram) more clearly illustrates the mode and shape, and it is worth developing one here. Later, we will use this histogram from our experimentally determined data to support the selection of a standard probability density function, so as to further interpret the data.

For the student, it is important to recognize the bin number (or number of classes), *k*, should be selected to adequately convey the nature of the distribution of data. Little can be learned from a histogram with too many or too few bins [16]. Although the development of a histogram can be highly subjective—the selection of bin number and boundaries is at the discretion of the student—there are a few rules of thumb to consider: (1) in general [19], the bin number should be some value between 5–20; (2) for *<sup>n</sup>* <sup>&</sup>gt; 40, consider using *<sup>k</sup>* <sup>=</sup> 1.87(*<sup>n</sup>* <sup>−</sup> <sup>1</sup>)0.4 <sup>+</sup> 1 as a starting estimate [20]; and (3) for large enough *<sup>n</sup>*, try *<sup>k</sup>* <sup>∼</sup> <sup>√</sup>*<sup>n</sup>* as an initial estimate [21]. Regardless of method, one should take care to consider the resolution with which the measurand was obtained, as this can influence the frequency of values contained in bins as the value of *k* gets large with increasing *n*, i.e., bin sizes smaller than the resolution of the measuring instrument can lead to artificially empty bins.

For *n* = 100, the rules of thumb suggest that *k* = 10 or 13 will be reasonable. Using the value of the range (cf. Table 1), this yields bins with widths of 0.20 and 0.15 s. The data from Figure 2a was binned using *k* = 10, and the frequency *F* of occurrences in each bin was tabulated. The result is shown in Figure 2b, and the distribution demonstrates that the data is unimodal and approximately symmetric (consistent with the calculated value of *Sk* and the box-and-whisker plot shape).

#### 2.2.2. Single Bottle Statistics—Inference

In the previous section, we did not utilize a standard distribution to interpret the data; we simply described the data quantitatively and graphically. However, the purpose of obtaining a sample set of emptying times is to ultimately develop an estimate of the "true" emptying time for any particular bottle in the complete set of *N* = 454, i.e., an estimate of the population mean including a statistical uncertainty (which will be combined with a measurement uncertainty). This will be used in later portions of this work when the results of different bottles are used collectively.

The evidence presented thus far suggests that the emptying times are, or can be modeled as being, normally distributed. Specifically, the skewness *Sk* = −0.34 (near zero) implies the distribution is approximately symmetric, and the kurtosis *Ku* = 3.03 suggests the distribution is near-normal; the number of data points contained within *Te* ± *s* and the frequency distribution of Figure 2b hint at the characteristic Gaussian shape. If the assumption that emptying times are normally distributed is valid, then with the data from a sample, we can estimate the population mean using *Te*,*<sup>μ</sup>* = *Te* ± (*tνs*) / √*n* , where the *μ* subscript implies a population parameter and the degrees of freedom is expressed as *ν* = *n* − 1. The Student-*t* variable *t<sup>ν</sup>* is tabulated and is a function of the degrees of freedom and

percent confidence specified [21]. The sample mean and sample standard deviation have already been calculated; to utilize this estimate we must clearly demonstrate normalcy in the data.

To supplement the evidence, we can strengthen the visual assessment of normalcy in two ways. The first involves superimposing atop the data from Figure 2b a continuous curve representing a normal frequency distribution. We can generate such a curve by starting with the probability density function for a normally distributed variable (see Appendix B). Recalling that the probability density *p* can be related to the relative frequency *f* and therefore the frequency *F* for a finite sample, we can create the normal distribution *F*(*Te*). Added to the frequency distribution in Figure 2b is the continuous curve representing a normal distribution. A visual inspection of Figure 2b shows that the frequency distribution for the data is consistent with the shape of a normal distribution.

A second graphical method to evaluate the normalcy of data is the normal probability plot. This is a plot of the standard normal variable, *z*, versus the measurand, i.e., *Te*. Each value of *z* is obtained by assigning every ordered data point an equal cumulative probability and then calculating the corresponding value of *z* based on the cumulative probability, assuming that the data is normally distributed. Specific details for developing the plot can be found in standard statistics textbooks [16,21]. The purpose of the normal probability plot is that if the data is approximately normal, the plot of *z* vs. *Te* will be linear according to the definition of the standard normal variable, i.e., *z* = (*Te* − *μ*)/*σ*. Therefore, rather than relying on a comparison of curved shapes as in Figure 2b, we can visually inspect how the data falls against a straight line. A normal probability plot for the bottle emptying data is given in Figure 3a along with a straight line to guide eye. This graphical assessment of normalcy is reasonable if there at least 20 data points [16], as is the case here (*n* = 100), and under conditions when students are asked to perform 25 measurements (e.g., if the instructor is intending to emphasize the statistics aspect of this exercise). The majority of the points in Figure 3a fall along the straight line and would pass a "fat pencil test", with only a few points at the upper and lower tails showing deviation. Little weight is placed on the extreme points if they fail to fall along the straight line [21].

**Figure 3.** (**a**) A normal probability plot and (**b**) a cumulative relative frequency plot of the bottle emptying time data. The normal probability plot, *z* vs. *Te*, shows a linear relationship between the two variables, with the exception of a few data points contained in each of the tails. Typically, little emphasis is placed on the agreement of data in the tails [21]. This linear trend is indicative of data that can be considered normally distributed for the purposes of inference.

Lastly, a final quantitative justification for treating the bottle emptying time as being normally distributed can be had by determining whether or not the empirical distribution when compared to a normal distribution passes the Kolmogorov–Smirnov test, cf. Appendix B and Equation (A9). This involves comparing the maximum deviation between the empirical cumulative frequency and the cumulative frequency for a continuous normal distribution. For the *n* = 100 points, the maximum deviation was found to be *dKS* = 0.043, which is below the critical value of *dα*(*n*) = 0.136 for a level of confidence of *α* = 0.05. This indicates that the normal distribution passes the Kolmogorov–Smirnov test. A visual comparison of the empirical cumulative frequency and the theoretical normal cumulative frequency can be found in Figure 3b.

In summary, the collective evidence presented in this section suggests that bottle emptying times can be reasonably modeled as normally distributed, for the sake of estimating the population mean for emptying time. Thus, using Equation (A5), we can determine that the emptying time for this particular bottle, accounting for the statistical uncertainty is *Te*,*<sup>μ</sup>* = 6.61 ± 0.08 s (with 95 % confidence).

#### 2.2.3. Single Bottle Statistics—Additional Examples

Given the many academic quarters that the author has used this exercise, there have been numerous instances in which the same type of bottle has been used by students for data collection. Although these redundant sets of data are not included in the sections that follow (where we attempt to use unique bottles for each data point), here they present the opportunity to show that a similar presentation of single bottle statistics (descriptive and inferential) can be had, without subjecting one experimenter to the tedious task of emptying a bottle 100 times. Examples of data collected by multiple students using the same type of bottles is shown in Figure 4. Within Figure 4a we see sequential plots and box-and-whisker plots for three different bottles (milk, tea, and soda). Figure 4b shows the corresponding histograms and normal distributions. Again, the data suggests that bottle emptying time can be reasonably modeled as normally distributed. Perhaps the only distinct feature of Figure 4a as compared to Figure 2a are instances of localized increases in the magnitude of the data spread and abrupt changes in the value of the central tendency (e.g., *i* = 60–70 "tea" data and *i* = 70–80 "soda" data). It is thought that these instances are due to differences in student interpretation of when a bottle has fully emptied.

Another permutation of the single-bottle experiment is to provide students with the same type of bottle and to group the emptying time data that is collected. In this case, given the size of a class, a significant number of data points for a single bottle can be obtained in a short period of time. An example of the data that results is shown in Figure 5, where 75 students were provided with wine bottles of the same style and size. Each student was asked to contribute *n* = 10 values of bottle emptying time, yielding a total of *n* = 750. The data arranged in sequential order is provided in Figure 5a. Here, again we see the instances of abrupt changes in the magnitude of the central tendency for each student data cluster (e.g., *i* = 200–210), which can be attributed to differences in student interpretation of the end of an emptying experiment. Given a large enough set of emptying times, the tendency is for the data to appear as though all values were collected from a single experimenter; this is especially true if the data is randomized. To see this, compare the sequential plots for the sequential and randomized data in Figure 5a. The histogram for this data is shown in Figure 5b where a subtle skewness is observed, when compared to the normal distribution, favoring a longer emptying time by a small fraction of students.

**Figure 4.** Emptying time data for several common bottles used by students. (**a**) Sequential plots and box-and-whisker plots suggest that emptying time is normally distributed, even when data is collected by many students instead of a single experimenter. Each student collected *n* = 10 values of emptying time. (**b**) Histograms and normal distributions also support the normalcy of the data. The inset shows the shape of the milk, tea, and soda bottles (arranged from left-to-right).

**Figure 5.** Emptying time data for wine bottles issued to 75 students. The unused wine bottles were procured in cases to ensure consistency in size and shape (*V* = 750 mL and *d* = 18.4 mm). (**a**) Sequential plots with box-and-whisker diagrams. The student sequential data (top, open circles) is ordered so that each group of 10 values belongs to a single student. When the sequential data is randomized (bottom, closed circles), it appears as though it were collected from a single individual. (**b**) The histogram suggests some skewness which is likely due to several students interpreting a longer emptying time.

#### *2.3. Exercise 2—Interpreting the Body of Results (Multiple Bottles and Dimensional Analysis Focus)*

#### 2.3.1. Quantifying Experimental Uncertainty

Up to this point, we have considered the results from a few experiments performed using single bottles, and considered only statistical variations associated with the emptying time. However, there are other uncertainties in the measured quantities (e.g., emptying time, bottle volume, neck diameter, etc.)—we must at least account for the measurement uncertainties or resolution uncertainties connected to the bottle emptying experiments. Thus, before presenting the results from all student experiments, let us discuss the uncertainties associated with the individual measurements and combine those, when appropriate, with the statistical uncertainties developed in the previous section.

With regard to emptying time *Te*, we have already considered the statistical uncertainty associated with multiple measurements; this is simply the confidence interval, ± *tνs*/ <sup>√</sup>*n*. Recall that students were asked to perform *n* = 3, 5, 10, or 25 trials and could use the results from these experiments to calculate the statistical uncertainty associated with the emptying time (using 95% confidence). There still exists the resolution uncertainty of the timers employed by the students. As these were typically cell phone app stopwatches, with stated resolutions of 0.01 or even 0.001 s, the resolution uncertainty, treated as one-half the instrument resolution [20], is negligible compared to the statistical uncertainty. However, due to manual timing of each trial, it would be more appropriate to consider errors due to human reaction time, as the dominant factor in the emptying time measurement error, not simply the resolution uncertainty. Although this can be the subject of further experimental study by students engaged in this exercise, a value of 0.25 s can be used to account for the total uncertainty in the reaction to the beginning and end of emptying (and, inherently, the perception of the emptying event, which is subject to interpretation). This value is typical of the range of human reaction time errors associated with stopwatch timing [22]. The reaction time was summed in quadrature with the timer resolution uncertainty and the statistical uncertainty to obtain an overall uncertainty in emptying time *uTe* . The average value for this uncertainty for nearly all bottles tested was found to be 9.3%, although there are a number of instances (42 of 454 bottles) for which the uncertainty represents a significant fraction of the time, i.e., greater than 25%, due to fast emptying times (e.g., emptying times on the order of 1 s).

For bottle volume, students were provided access to either a graduated cylinder or a digital scale to make volumetric or gravimetric measurements. In general, using these techniques, the resolution uncertainty can be quite small. However, this can under predict the actual variation in filled volume that can occur during testing with the repeated inversion and waiting required by the procedure (which can lead to leaks). Because of this, it was decided to assign a reasonable uncertainty for bottle volume. Those bottles with *V* ≤ 50 mL were assigned an uncertainty of 1 mL, whereas those with *V* > 50 mL were assigned an uncertainty of 5 mL. Many students reported using household measuring cups to determine volume, and the author even used bathroom and mechanical scales for certain large-volume bottles. Typically, these instances yielded values of uncertainty larger than those assigned. In all instances where the reported uncertainty exceeded the conservative values assigned based on volume, the larger uncertainty was used. For all of the bottles tested, the average uncertainty in bottle volume is 2.1%.

Similarly, the uncertainties in the measurements of neck diameter, *ud*; maximum diameter, *uD*; and height, *uh*, were low (averages of 1.4%, 0.6%, and 0.4%, respectively), owing to the tools used by the students (e.g., ruler or caliper) in comparison to the size of the nominal values. All of the uncertainties discussed are summarized in Table 2 and are represented by error bars in the dimensional plots that follow. Having sorted out the uncertainties associated with the student measurements, we are now at a point where we can present the collection of bottle emptying data in dimensional form from all bottles, of various shapes and sizes, collected by students and the author.


**Table 2.** Measurement and statistical uncertainties for dimensional bottle emptying data.

#### 2.3.2. Bottle Emptying—Dimensional Results

From our most basic understanding of fluid mechanics, we expect that the emptying time for a bottle will increase with volume. This is essentially what is suggested by the data presented in Figure 6a, in which the average emptying time, *Te*, is plotted versus bottle volume, *V*. The error bars include measurement and statistical uncertainties as previously discussed. Despite our expectation regarding the relationship between emptying time and volume it is apparent that, without taking into account other geometric properties of the bottle, no useful predictive trend yielding a reasonably accurate estimate of emptying time can be extracted from such a dataset. There is simply too much scatter in the data as plotted. In fact there can exist more than an order of magnitude variation in emptying time for any fixed volume (e.g., see variation in *Te* for *<sup>V</sup>* <sup>∼</sup> <sup>10</sup><sup>3</sup> mL). The lack of availability of very large commercially available bottles limits the data to the region *<sup>V</sup>* <sup>3</sup> <sup>×</sup> 104 mL.

Similarly, the lack of predictive power is also apparent in the plot of emptying time, *Te*, versus neck diameter, *d*, cf. Figure 6b. Again, our intuition leads us to believe that emptying time should decrease with increase in neck diameter; however, the overall picture in Figure 6b is not satisfactory for our purposes. Perhaps the only piece of information we can glean is that the majority of bottles have neck diameters in the neighborhood of *d* ∼ 20 mm, which is not altogether surprising if we recognize that most of the bottles collected by students for these experiments are made for direct human consumption or convenient pouring. Finally, the remaining geometric measurements of maximum diameter, *D*, and height, *H*, are also not useful, by themselves, at establishing a predictive trend for emptying time, as shown in Figure 6c,d.

Recalling the motivation for this study, Figure 6 rules out the usefulness of the dimensional data to obtain a predictive relation for bottle emptying time (if one does exist). The figures clearly demonstrate that an assumption that the emptying time correlates with only one geometric variable is of no particular use. More than one dimension may be necessary. This conclusion leads us naturally to a discussion of dimensional analysis.

#### 2.3.3. Dimensionless Groups Using Buckingham-Pi

Many undergraduate engineering students are first exposed to dimensional analysis in a fluid mechanics course, where the subdiscipline is considered in the context of experimental design and the arrangement of data to yield useful phenomenological relationships [23]. However, during this introduction, there is often a limited chance to see first-hand the power of dimensional analysis through application, i.e., the design of an experiment and the reduction of data. More often students complete typical textbook problems, the end result of which is the determination of dimensionless groups only. Without an applied experience, the main concepts and steps can be confusing, e.g., selection of repeating parameters in the use of the Buckingham-Pi theorem—a step described as requiring the "application of engineering judgment" and "experience" for a successful outcome [24], qualities that students are only beginning to develop.

**Figure 6.** Emptying time versus the measured geometric dimensions for all bottles tested (*N* = 454). (**a**) Bottle emptying time generally increases with volume, but no predictive trend is apparent. The thirteen data points marked with gray triangles are the results from emptying small bottles with 70% isopropyl alcohol instead of water. The single black triangle denotes a data point for a bottle that has an internal decorative feature that can disrupt the flow. This was the only bottle tested with such a feature. (**b**) Neck diameter, *d*, alone is also not a good predictor of bottle emptying time; We observe that most bottles/containers collected by students tend to cluster around *d*∼20 mm, most likely a result of their intended use (liquids for direct consumption). It is also apparent that neck diameters are well in excess of the capillary length, *<sup>γ</sup>*/(*ρg*)∼2.7 mm. A number of small bottles tested by the author (gray triangles) have neck diameters less than the stable cut-off length associated with the Rayleigh–Taylor instability for a circular interface [25,26], i.e., *dRT*∼3.7*<sup>γ</sup>*/(*ρg*)∼10 mm (dashed vertical line). For these cases, the emptying using water is essentially infinite, and so measurements have been made using 70% isopropyl alcohol to create the condition *d* > *dRT* by reducing the interfacial tension *γ*. This can be used to prompt added discussion among students during a presentation of the data. Note that three bottles with *d* < *dRT* were reported by students using water. It is suspected by the author that this was possible given nonideal neck conditions (e.g., a chip in one instance and a ground glass surface in another) or subtle off-vertical orientations that can readily occur during experiments; (**c**) maximum diameter *D* and (**d**) bottle height *H* do not, alone, provide a useful correlating variable for emptying time.

Given the lack of predictive trend apparent in the dimensional plots of Figure 6, the present goal is now to find relevant dimensionless groups that characterize the bottle emptying process–specifically the long timescale that characterizes complete emptying and not the short timescale associated with the familiar "glug-glug" [10], of which the latter phenomenon tends to dominate our casual observations. To be relevant for a discussion in an undergraduate fluid mechanics setting, the procedure for the Buckingham-Pi theorem as outlined in a typical fluid mechanics textbook is followed [24].

We can anticipate that for a liquid-filled bottle emptying into the atmosphere at room temperature and pressure, the emptying time *Te* will be a function of many variables. For example, we might consider,

$$T\_{\varepsilon} = \phi\_1(\rho, \mu, \gamma, \lg, H, D, d, S), \tag{1}$$

where *ρ*, *μ*, and *γ* are the relevant liquid properties (water density, viscosity, and liquid–air surface tension, respectively) and *g* is the gravitational acceleration. The geometry of the bottle is represented by an overall height and major diameter, *H* and *D*; the neck diameter, *d*; and a shape factor, which we designate *S* (cf. Figure 7). This term accounts for the complexity of the true bottle shape, including in particular the shape, length, and taper of the neck, and we will consider *S* as being dimensionless. In past studies on bottle emptying not involving the dimensional analysis approach taken here, the various shapes of the bottle used were presented diagrammatically with no effort made to quantify the details of the shape [3,4]. Or, conversely, specific experimental apparatuses were fabricated to provide well characterized containers for study. In the latter case, the exit condition (essentially an orifice plate, not a bottleneck) was described by a discharge coefficient [7]. Here, the sheer number of bottles (*N* = 454) prevents us from presenting a comprehensive diagram detailing each individual bottle shape (which can vary dramatically), and lack of control over shape by the use of commercially available bottles prohibits the specification of a known discharge coefficient and, therefore, the lumping of these qualities into *S*. Furthermore, given the myriad variations of real bottles and containers, we can expect that isolating separate trends based on characteristic bottle length and diameter will be too difficult for the present study. So, although we recognize it is a gross simplification, we will replace *H* and *D* with the total bottle volume *V*. This reduces the total number of variables in (1) from 9 to 8. The variables considered in (1) do not constitute an exhaustive list, and in the classroom setting it would be useful for an instructor to ask students to consider all other possible variables (including, but not limited to angle of inclination, amount of initial rotation/swirl, and surface roughness, all of which could be tested as additions to the work published in this study).

Continuing with the Buckingham-Pi methodology, after selecting three repeating parameters—*ρ*, *g*, and *d*—that characterize the fluid, flow field, and geometry for the emptying phenomenon (as well as capturing all primary dimensions in the set of variables), respectively, we see that there will be five dimensionless groups. Thus,

$$T\_{\varepsilon} \sqrt{\frac{\mathcal{S}}{d}} = \phi\_2 \left( \frac{\mu}{\rho \sqrt{g d^3}}, \frac{d}{\sqrt{\gamma/(\rho g)}}, \frac{\Psi}{d^3}, S \right), \tag{2}$$

which do not present themselves as the typical dimensionless numbers encountered by undergraduates (e.g., Reynolds number, *Re*). Here, it should be mentioned that *γ*/(*ρg*) is also referred to as the capillary length, *l*c, and represents a length scale below which capillary forces (i.e., interfacial tension forces) become significant. For the present study, we are only interested in emptying bottles containing water into air at room temperature, and we will utilize bottles with neck diameters sufficient to rule out capillary effects (cf. Figure 6 caption). Therefore, the dimensionless group *d*/*l*<sup>c</sup> will play no role. The inverse of the group *μ*/(*ρ gd*3) is analogous to a Reynolds number (where *gd* is a characteristic velocity). For all of the bottle emptying experiments, the value of (*ρ gd*3)/*μ* exceeds 2000, and most (423 of 454) have values in excess of 5000. Thus, we can anticipate insignificant variations in experiments caused by this dimensionless parameter as nearly all flows will be turbulent. As a result, we neglect the independent dimensionless groups listed in (2) containing the fluid properties. Further, neglecting for now the shape factor *S* (which we will return to later), the dimensional analysis suggests that we should present the data in the following form,

$$T\_{\mathcal{E}} \sqrt{\frac{\mathcal{S}}{d}} = \phi\_{\mathcal{S}} \left( \frac{\mathcal{U}}{d^{\mathcal{S}}} \right) ,\tag{3}$$

to look for a relationship between emptying time and bottle geometry. Whether or not we have picked the most relevant repeating parameters, or if we have over simplified our analysis, remains to be seen when we try to plot the data in dimensionless form.

**Figure 7.** A visual description of bottle geometry relevant to the analysis of bottle emptying. (**a**) Dimensions associated with bottles used for emptying experiments: *d*, neck diameter (internal); *D*, major diameter; *H*, overall bottle height; and *V*, internal volume. It was used by the author for 100 measurements of emptying time (cf. Figure 2). (**b**) A bottleneck qualitatively classified as "smooth" due to the gradual evolution from *D* to *d*. This in sharp contrast to (**c**), which shows a bottleneck classified as "square", as a result of the abrupt change from *D* to *d*. The bottle shown in (**a**) would be considered as something "other" than smooth or square.

#### 2.3.4. Data Presented in Dimensionless Form

We can now plot the data in dimensionless form, and we do so according to the dimensionless groups presented in Equation (3). The result is shown in Figure 8. Error bars for dimensionless time and volume have been calculated by propagation of the uncertainties from each of the variables forming the dimensionless groups. Inspection of the figure shows it is clear that we arrived at relevant dimensionless groups in Section 2.3.3, based on the collapse of nearly all of the data points about, what appears to be, a single dominant trend—far different from the dimensional results in Figure 6. However, if we look at the data more closely, we can also see what looks like a difference in bottle emptying time based on the shape *S*. Earlier we had ignored the influence of the shape factor *S*, and the wide variety of shapes makes detailed classification based on such a factor difficult. However, for now, we can broadly classify the bottles as having a "smooth" neck (e.g., a wine bottle with a gradual taper from the average diameter to the neck), a "square" neck (i.e., minimal taper), or "other" if the bottle fails to be easily classified into the former groups. Examples of these classifications are shown in Figure 7, and we make no effort here to rigorously classify the shapes as it is beyond the scope of this work. The inset of Figure 8 indicates that many of the bottles with a more smooth neck appear to empty faster than square neck bottles of similar dimensionless volume. Further analysis of the data based

on a more rigorous classification of shape may provide a better prediction of bottle emptying time. Yet, for the purposes of this exercise, when the data is viewed as a whole it does suggest a general trend that is sufficient for engineering estimates of emptying time.

**Figure 8.** Data from bottle emptying experiments presented in dimensionless form according to the groups given in Equation (3). It is apparent that the data as a whole, despite variations in bottle shape and size, tend to collapse onto a single trend. However, greater scrutiny of the data, apparent in the inset (note the linear axes and reduced range and the symbol change— for square and for smooth), shows what appears to be a difference in dimensionless emptying times based on bottle shape *S*. Smooth neck bottles empty faster than square necks. The solid lines in the inset are meant to guide the eye.

From the dimensionless data of Figure 8, it appears that a trend has emerged that allows us to make quantitative predictions for bottle emptying time as a function of volume and neck diameter. Our focus now shifts to determining an appropriate correlation using standard curve fitting techniques.

#### *2.4. Exercise 3—Developing an Empirical Correlation (Regression Analysis)*

The goal of the analysis in this section is to obtain a curve fit for the data presented in Figure 8, i.e., to elucidate the relationship between *Te g*/*d* and *V*/*d*3, so that we can determine with sufficient accuracy the emptying time for any future bottle or single outlet container. A curve fit for the data will be determined using a method of least-squares analysis and we have provided details and equations in Appendix C.

#### 2.4.1. Regression Analysis

In general, we can utilize the known physics of a phenomenon to guide the appropriate choice of a model for curve fitting of data. However, in the case of bottle emptying, where the fluid dynamics appear complex, we are left to wonder what is the appropriate choice for a curve fit. The method of least-squares, which is what we will eventually use, can only be applied after the order of the polynomial curve fit has been decided, and it is unacceptable to arbitrarily choose the order. What then are we left with? In this instance, let us consider the span of the data for both coordinates.

For both *Te g*/*d* and *V*/*d*3, the data extends over several orders of magnitude, so a log–log format is the best choice for plotting the data. Inspection of the data, as shown in Figure 8, plotted on the log–log axis and appearing linear suggests that indeed a power–law curve fit between the dimensionless groups may be appropriate [20]. Thus, regression analysis will be used to find the best-fit coefficient *A* and the exponent *B* for a power–law function of the form *Te g*/*d* = *A* - *V*/*d*<sup>3</sup> *B* . Only the data for small values of dimensionless volume, i.e., *V*/*d*<sup>3</sup> 3 hint at a deviation from linearity. This change in behavior is likely based on a change in the fundamental shape of the bottles at these scales. For these values of *V*/*d*<sup>3</sup> the bottles are really jars, mugs, or cups, instead of a bottle with what we think of as a neck, e.g., with *d* < *D*. These vessels, when emptying, do not "glug". Rather, drainage proceeds as a single bubble of air rises into vessel along one side and liquid drops from the other. This is also in contrast to the emptying of a long narrow tube [1,2].

The power–law curve fit can be obtained using a method of least-squares approach for a linear regression, e.g., *y* = *a*<sup>0</sup> + *a*1*x*, after a standard linear transformation has been performed. In other words, to make use of the equations for the regression coefficients *a*<sup>0</sup> and *a*<sup>1</sup> in the standard first-order curve fit (familiar to most students in a first course on statistics), we must first transform our variables such that *Te <sup>g</sup>*/*<sup>d</sup>* <sup>→</sup> *<sup>y</sup>* and *<sup>V</sup>*/*d*<sup>3</sup> <sup>→</sup> *<sup>x</sup>*. For a power law, this is accomplished using natural logarithms. Thus,

$$
\overline{T}\_c \sqrt{\mathbf{g}/d} = A \left( \mathbf{\dot{\varphi}}/d^3 \right)^B \to \mathbf{y} = a\mathbf{o}\_0 + a\_1 \mathbf{x} \tag{4}
$$

with *y* = ln[*Te g*/*d*], *x* = ln[*V*/*d*3], and *a*<sup>0</sup> = ln*A* and *a*<sup>1</sup> = *B*. What remains is to solve for the regression coefficients [16] *a*<sup>0</sup> (Equation (A10)) and *a*<sup>1</sup> (Equation (A11)), and then transform back to find *A* and *B*. This analysis yields the following power–law curve fit to all of the data,

$$T\_{\epsilon} \sqrt{\frac{\mathcal{S}}{d}} = (3.8 \pm 0.4) \left( \frac{\Psi}{d^3} \right)^{(0.90 \pm 0.02)} \text{ .} \tag{5}$$

which is plotted in Figure 9a, along with uncertainty bands (based on 95% confidence) qualitatively demonstrating how well the regression equation (solid line) predicts the mean of the data (inner set of dashed lines) and the uncertainty that the regression equation can predict any single value (outer dashed line). Not surprisingly, given the appearance of the dimensionless data in Figure 8, the power law correlation fits the data over the nearly four orders of magnitude spanned by *V*/*d*3.

The variation of individual data points about the curve fit line is presented in Figure 9b. Here, the variation is expressed as a normalized residual *r*, defined as the difference between the experimental and curve fit values of *Te g*/*d*, normalized by the curve fit value. The purpose of normalizing the residuals is to account for the difference between experimental values, and curve fit values inherently increasing in magnitude with increase in dimensionless volume. What we find from a review of these figures is that the normalized residuals are scattered somewhat symmetrically about zero, without any apparent trend that would indicate a more appropriate curve fit model exists. More specifically, the values of *r* appear to be distributed normally about zero when a histogram is generated over the entire range of *V*/*d*3. The average value is calculated to be *r* = 5% with an average absolute value of |*r*| = 25%.

**Figure 9.** (**a**) Data from bottle emptying experiments presented in dimensionless form according to the groups given in Equation (3) along with the power–law curve fit of Equation (5) (solid line). Added to these plots are confidence intervals for the curve fit (95% confidence). The inner set of dashed lines, almost indistinguishable from the solid line, indicates the confidence that the curve fit can estimate the mean value of the population, whereas the outer set of dashed lines denotes the confidence that the curve fit can predict any individual value of the ordinate. Arrows highlight bottles that deviate significantly from the power–law fit. The bottle with the internal feature (black triangle) was not used in the curve fit analysis but is shown to indicate the effect of the internal feature on the emptying time. (**b**) Discrepancy between experimental data and power–law curve fit (Equation (5)) expressed as a normalized residual, *r* (% units). (Top) The scatter of *r* about zero for the entire range of the dimensionless volume shows no apparent trend, but a few data points show considerable deviation from the curve fit (i.e., *r* exceeds 100%). (Bottom) Values of *r* appear to be symmetrically, almost normally, distributed about a value near zero.

#### 2.4.2. Trend Deviations

The data points with the most significant values of *r*, e.g., ∼ 200 %, are at the extreme ends of the *<sup>V</sup>*/*d*<sup>3</sup> range. These are highlighted by the arrows in Figure 9a at *<sup>V</sup>*/*d*<sup>3</sup> <sup>∼</sup> 1 and /*d*<sup>3</sup> <sup>∼</sup> <sup>10</sup>3. Note that these single-outlet vessels are the furthest, in shape/style, from what we might think of as a typical "bottle". As shown in Figure 10a, the data point at *<sup>V</sup>*/*d*<sup>3</sup> <sup>∼</sup> 1 corresponds to a pint glass, where *<sup>d</sup>* <sup>≈</sup> *<sup>D</sup>* without a true neck. The data points clustered near *<sup>V</sup>*/*d*<sup>3</sup> <sup>∼</sup> 103 are for reusable tumblers with a thin lid and rounded orifice intended for a straw (cf. Figure 10b). Although for this container *d* << *D*, the shape is still far from a traditional bottle since, like a pint glass, there is also no true neck.

Every bottle in the dataset (*N* = 454) used to generate Equation (5) shared the characteristic that the internal space of the vessel was empty and that there were no obstructions within the neck. A single bottle provided by a student, highlighted by the arrow in Figure 9a at *<sup>V</sup>*/*d*3∼40, contained an internal decorative feature as well as a bridge of glass material that spanned the neck at its base. Both of these features can be seen in Figure 10c. Because of these features, the data collected from experiments in this bottle was not used in the analysis to obtain a curve fit (and does not constitute one of the *N* = 454 data points). However, it has been included in nearly all of the dimensional and dimensionless plots, with the exception of Figure 9b, to show the effects of the features on the emptying time. A comparison of the dimensionless emptying time for this bottle to that predicted by Equation (5) yields a value of *r* = 450%. Looking back at the sequence of images in Figure 1, it is easy to imagine how disruptive the internal decorative feature would be on the inflow of air and

outflow of water near the bottleneck. In addition, it is estimated that the bridge of glass within the neck reduces the flow passage area by nearly 1/3–1/2 the area calculated using the neck diameter. Both explanations are likely responsible for causing the large value of *r* for this particular bottle. The neck diameter for this bottle was measured as *d* = 26.55 mm, along with a volume of *V* = 814 mL, giving the value of *<sup>V</sup>*/*d*3<sup>∼</sup> 40 reported. If we estimate that the flow passage area of the neck is restricted by 1/3, we arrive at an equivalent neck diameter of *<sup>d</sup>* <sup>=</sup> 21.7 mm, a value of *<sup>V</sup>*/*d*3∼80, and *<sup>r</sup>* <sup>=</sup> 218%. With a flow passage area restricted by 1/2, an equivalent neck diameter of *d* = 18.8 mm results, yielding *<sup>V</sup>*/*d*3∼120 and *<sup>r</sup>* <sup>=</sup> 118%. Although these are estimates, we can anticipate that with *<sup>r</sup>* 120%, the discrepancy is due not only to the obstruction of the neck but the internal decorative feature as well.

**Figure 10.** Images of three "bottles" that yield significant values of *r* when compared to the power–law curve fit of the dimensionless data (indicated with arrows in Figure 9a). (**a**) Typical pint glass with *<sup>V</sup>*/*d*<sup>3</sup> <sup>∼</sup> 1. (**b**) Reusable plastic tumbler (*V*/*d*<sup>3</sup> <sup>∼</sup> <sup>10</sup>3) with a small hole in the lid intended for a straw. (**c**) A bottle with an large and obstructive internal decorative feature (left) along with a glass bridge across the flow passage at the base of the neck (right—imaged from side of bottle looking up at the base of the neck).

#### *2.5. Exercise 4—Comparison of Empirical Correlation to Available Results*

#### 2.5.1. A Substantial Data Set

We now depart from the statistics and dimensional analysis content for a review of the sparse datasets and simple analytical models available in the literature, which we will compare to our experimental findings presented in Figures 8 and 9. This section, although not necessary for an exercise in either engineering statistics or dimensional analysis, does provide some physical insight into the emptying of a single-outlet vessel and reinforces the selection of a power–law curve fit to best describe the data. The choice to present this content to the student group or to let them research on their own would depend on the academic level of the fluid mechanics course. Note, here, the dramatic difference between datasets in the literature and the substantial set of new data in the present work. Figure 11a shows this difference. Here, we can see the range of both *V* and *d* spanned by the *N* = 454 bottles from the present work, as compared to the data extracted from the works of Whalley [3,4] (16 bottles), Tehrani et al. [6] (four bottles), and Geiger et al. [11] (two bottles simulated using CFD).

#### 2.5.2. Published Results and Models

Whalley [3,4] investigated the emptying time of bottles via simple experiments and related the outflow to the phenomenon of "flooding" in tubes—a well-researched subject in the field of multiphase flows. He presented his experimental results in dimensional form (i.e., emptying time) and also calculated a Wallis flooding "constant", *C*, using

$$\mathcal{C} = \frac{\left(\rho\_G^{1/4} + \rho\_L^{1/4}\right)}{\left[\left(\rho\_L - \rho\_G\right)\gcd\right]^{1/4}} \left(\frac{4\varPsi}{\pi d^2 T\_\varepsilon}\right)^{\frac{1}{2}},\tag{6}$$

where *ρ<sup>G</sup>* and *ρ<sup>L</sup>* are the densities of air and water, respectively. This semiempirical relationship has its basis in a correlation for flooding that utilizes dimensionless superficial gas and liquid velocities, and is consistent with the simple picture that during the entire course of emptying, a stationary air slug exists in the bottleneck with a continuous outflow of water around the slug [3,4] (i.e., slugging). The velocity of liquid outflow is equivalent, by continuity, to the rising velocity of the gas slug (as given by Davies and Taylor [1]). To visualize this, consider the fourth image in Figure 1a with the slug in the bottleneck and envision that this picture of the flow persists over the entire course of emptying as hinted at by the overlay of images shown in Figure 1b. Both sets of data from Whalley's experiments, specifically the 11-bottle set from his earlier work [3] and the 5-bottle set from his later work [4], show a range of calculated values for *C* from 0.76 to 1.02 with an average value of *C* = 0.91. Kordestani and Kubie [8], who also expressed their results for ideal bottles in terms of *C*, found a similar range of values spanning approximately 0.8 to 1.15. Using the values for *ρ<sup>G</sup>* and *ρ<sup>L</sup>* of air and water at room temperature, the average value of *C* from Whalley's works, and rearranging Equation (6) to reflect the dimensionless groups obtained from our analysis in Section 2.3.3, reveals the following,

$$T\_{\rm c,W} \sqrt{\frac{\mathcal{g}}{d}} = 2.2 \left( \frac{\omega}{d^3} \right)^1. \tag{7}$$

The W subscript in *T*e,W is intended to distinguish this Whalley result from others. Given the variation in values of *C*, the coefficient in Equation (7) has a range of 1.7 to 3.1 with the exponent of *V*/*d*<sup>3</sup> unaffected by changes in *C*. Although the coefficient differs by a little less than a factor of 2 from that of Equation (5), the overall trend is similar to that exhibited by our data as demonstrated by the dashed line in Figure 11b (Equation (7) plotted). Quantitative comparison of our data with the result of Whalley, using our previously defined normalized variable, yields *r* = 30% and |*r*| = 36%. We can also see in Figure 11b how well our data overlaps and extends the limited set of data from Whalley [3,4].

Clanet & Searby [10] analyzed the emptying of "ideal" vertically-oriented bottles (i.e., bottles with constant diameter and very short sharp-edged openings manufactured specifically for laboratory experiments). Their model of the long timescale, the overall emptying time *Te*–not the timescale associated with passage of individual slugs of air through the opening, is based on similar physics to that of Whalley, but not described from the standpoint of accepted two-phase flow correlations. Rather, these authors build their simple model from the required balance between the incoming air at the opening and the downward motion of the air–water interface in the bottle. They use the rise speed of a long bubble in an infinite medium (again, from Davies and Taylor [1]) to characterize the incoming airflow, and make the assumption that the length of the incoming bubble is equivalent to the opening diameter (recall that their "ideal" bottles have no true neck length—therefore the diameter of the opening serves as a relevant scale for the length of the incoming bubbles). Clanet & Searby present their model for the long timescale as *Te*/*Te*,0 = (*D*/*d*) 5/2. In their model, *Te*,0 3.0*L*/ *gD* is the emptying time of an unrestricted cylinder of length *L* and diameter *D*. This model yields the following estimate for the emptying time (using *V* = (*π*/4)*D*2*L* and after rearrangement to be consistent with present form),

$$T\_{\rm e,CS} \sqrt{\frac{\xi}{d}} = 3.8 \left( \frac{\Psi}{d^3} \right)^1. \tag{8}$$

We also plotted this trend in Figure 11b for visual comparison, and, quantitatively, we find that *<sup>r</sup>* <sup>=</sup> <sup>−</sup>26% and <sup>|</sup>*r*<sup>|</sup> <sup>=</sup> 34%. Equation (8) has the same scaling for *<sup>V</sup>*/*d*<sup>3</sup> as the result of Whalley, and is similar to the results of the present study, although there is incomplete agreement with the power–law exponent. The exponent associated with *V*/*d*<sup>3</sup> from both Whalley and Clanet & Searby does not fall within the error of the experimentally determined exponent in the present work and differs by 10%.

The remaining data found in the literature that pertain to emptying of real bottles is found in the CFD analysis of Geiger et al. [11] and the experiments of Tehrani et al. [6], and this too is found to compare favorably with the new data presented here. A final inspection of Figure 11b shows that nearly all of the plotted data points tend to fall between the predictions of Whalley and Clanet & Searby, and that the power–law fit to our experimental data spans the two models over the range investigated.

**Figure 11.** (**a**) Dimensions of the bottles from experiments of students (present work) plotted with limited datasets found in the literature, specifically those of Whalley [3,4], Tehrani et al. [6], and Geiger et al. [11]. The dataset collected by students is nearly twenty times larger than the collective data of the literature and contains bottles that span approximately 0.25–10× the volumes previously tested. The range of bottle diameters tested are also much larger, and smaller, than those previously explored. (**b**) Data from bottle emptying experiments of students plotted with limited datasets found in the literature, specifically those of Whalley [3,4], Tehrani et al. [6], and Geiger et al. [11]. The trend line from our data, Equation (5), is shown (thick solid line), as is the model of Clanet and Searby, Equation (8) (thin solid line) and that of Whalley, Equation (7) (dashed line).

#### 2.5.3. Revisiting Regression Analysis

As a final note, given the exponent associated with *V*/*d*<sup>3</sup> in the models of Whalley and Clanet and Searby, perhaps it is worth revisiting our regression analysis, now that we have some knowledge of the physics at hand (recall from Section 2.4.1 that we typically rely on the physics to guide our choice of curve fit function). What the models of Whalley and Clanet and Searby suggest is that we could also seek a curve fit of the form *Te g*/*d* = *A* - *V*/*d*<sup>3</sup> 1 , where the exponent has been set to 1. This is analogous to finding a linear curve fit with zero intercept, i.e., *<sup>y</sup>* = *<sup>a</sup>*1∗*<sup>x</sup>* (note that this is not the same *a*<sup>1</sup> as defined by Equation (A11); therefore, we must use Equation (A12)). If we perform such an analysis, we arrive at the following fit to our data,

$$T\_c \sqrt{\frac{g}{d}} = (3.7 \pm 0.2) \left(\frac{\mu}{d^3}\right)^1. \tag{9}$$

This is nearly identical and, given the uncertainty range, it is equivalent to the model of Clanet and Searby (Equation (8)). The nominal value of the coefficient differs by nearly a factor of two compared to the equation of Whalley (Equation (7)). A summary of all of the empirical models and analytical models from the literature is provided in Table 3.

**Table 3.** Summary of the regression models developed in this work and the simple analytical models obtained from the literature. All models have the form of a power–law function, with *A* as the coefficient and *B* the exponent.


#### *2.6. Very Large Bottles—Does the Trend End?*

A goal of the present study was to experiment with only commercially and readily available bottles so that no special equipment or experimental apparatus is necessary (an example of this equipment would be the "ideal" bottles used in the literature). This goal was achieved, and any class that is asked to perform this exercise will likely find a similar range of bottle shapes and sizes yielding consistent results. Ignoring the data corresponding to very small values of *V*/*d*3, the trend in the dimensionless data of Figure 8 appears to hold for the entire range of *V*/*d*3, and it has always piqued the interest of the author to ask if there is an upper limit to the applicability of this trend. However, addressing this question requires going beyond commercially available bottles, and building bottles to suit the needs of the experiment. There are only two ways to achieve ever larger values of *V*/*d*3: (1) reduce the neck diameter *d* of a bottle and (2) increase the volume *V*of a bottle. As we have seen, there is a limit to the reduction in the neck diameter governed by capillary effects and the Rayleigh–Taylor instability, which will prevent emptying. Therefore, the only practical way of achieving very large values of *V*/*d*<sup>3</sup> is to use large volumes.

To explore bottle emptying for large values of *<sup>V</sup>*/*d*3, i.e., *<sup>V</sup>*/*d*<sup>3</sup> <sup>5</sup> <sup>×</sup> 103 (which is approximately the limit for the commercially available bottles found by students and the author), the author resorted to the fabrication of bottles using both a 15-gallon and a 55 gallon plastic drum (these are nominal volumes—the measured volumes were found to be 64,500 mL and 225,000 mL representing an increase in volume of 2.4×-8.3× compared to the largest bottle in the *N* = 454 set). These drums, shown in Figure 12a, were outfitted with interchangeable 3D printed necks with measurements of *d* = 12.5, 25, and 37.5 mm. The necks were fitted to the drums using machine screws and sealed with gaskets. These inverted bottles were secured in a vertical orientation on an elevated stand. Garbage cans directly below the bottles were used to collect and recycle the water during the experiments. Each bottle was filled by means of a centrifugal pump using the bung hole (which was sealed with the threaded and gasketed bung).

The emptying times for these bottles ranged from approximately 110–1500 s (15 gallons) to 400–6100 s (55 gallons), with the emptying time decreasing with increasing *d*. The combination of bottle volume and neck diameters result in values of *V*/*d*<sup>3</sup> spanning from nearly 10<sup>3</sup> to 105—almost two orders of magnitude larger than the commercially available bottle set. Despite the dramatic increase in dimensionless bottle volume, and to the delight of the student audience that this is presented to, the trend persists and the agreement between Equation (5) is qualitatively on display in Figure 12b. Quantitatively, for the 15-gallon bottles, |*r*| = 17%, and for the 55-gallon bottles, |*r*| = 21%. Both values of |*r*| are within the value of 25 % reported earlier for the *N* = 454 dataset. It is left to another group of experimentalists, perhaps a motivated student group, to continue to push the limits of *V*/*d*3.

**Figure 12.** Very large bottles that can significantly extend the values of *V*/*d*<sup>3</sup> from the *N* = 454 dataset are not readily available. (**a**) The author resorted to manufacturing bottles using commercially available plastic drums (15-gallon and 55-gallon) and 3D printed necks (see inset image) to achieve over an order of magnitude increase in *V*/*d*3. A wine bottle is shown in the image for scale. (**b**) The results of these large bottle emptying experiments are consistent with the data and curve fit presented.

#### **3. Conclusions**

We have presented an exercise suitable for an undergraduate engineering statistics class, as well as a course in which the basics of dimensional analysis are presented—the ideal venue being an introductory fluid mechanics course. The exercise involves a large dataset that can be gathered safely and easily by students, without resorting to expensive laboratory equipment or complex procedures. Basic descriptive and inferential statistics are suitable to describe the data. The every day phenomenon under investigation is rather complex and, to an undergraduate student first encountering fluid mechanics, it may not appear to be accessible by normal analytic means. Results presented here clearly demonstrate the power of dimensional analysis in reducing the data to yield a predictive trend and the results agree well with the limited set of data available and simple models developed in the literature. The variations of this particular exercise are myriad, and many of the experiments could still be performed with basic equipment. For example, an instructor could task the students with confirming the variation in emptying time with water temperature [3,4,6], or variations associated with inclination [3,4,9]. Students could be directed to establish the relevance of another dimensionless group by experimenting with differences in liquid viscosity (or ratios of density or viscosity). Filling time, rather than emptying time, could also be explored. Greater detail as to the role shape plays can be elucidated, and, given the appearance of *g* within the dimensionless emptying time, perhaps bottles could be emptied with the aid of centrifugal forces. There is no doubt that students could be tasked with, and would be eager about, finding a modification to this exercise that is worthy of study. These and other variations can be accomplished in the spirit of the work presented here and we encourage others to explore similar activities for the benefit of engineering students at their respective universities.

**Supplementary Materials:** The following are available online at www.mdpi.com/xxx/s1.

**Author Contributions:** H.C.M. is responsible for all aspects of this article except for portions of the raw data contributed by students.

**Funding:** This research received no external funding.

**Acknowledgments:** The author would like to thank the numerous students at Cal Poly SLO, UCSB, and Rutgers University from 2007 to 2019 who helped gather data during their undergraduate statistics/measurements and fluid mechanics courses. Without their help over the last decade, the dataset would not have been as large or as interesting. The author would also like to acknowledge Professors G. Thorncroft, P. Lemieux, J. Maddren (Cal Poly SLO), S. Pennathur (UCSB), R. Krechetnikov (U. Alberta), and S. Shojaei-Zadeh (Rutgers) for providing useful feedback on earlier drafts of the manuscripts.

**Conflicts of Interest:** The author declares no conflict of interest.

#### **Appendix A. Descriptive Statistics**

Equations for the basic statistics used throughout the paper are presented here for the interested reader. In what follows in this section, emphasizing descriptive statistics, we will use the typical variable notation *x* to denote our measured quantity under investigation (whereas in the body of the paper we used *Te*).

The most commonly used measure of the central tendency is the arithmetic mean (i.e., the mean) and is defined as

$$\overline{\mathbf{x}} = \frac{1}{n} \sum\_{i=1}^{n} x\_{i\prime} \tag{A1}$$

where *n* is the size of the sample and *i* denotes the number in the sequential dataset.

The sample standard deviation *s* is a single measure characterizing the spread of the data about the central tendency. For a sample of size *n*, it can be calculated using

$$s = \sqrt{\frac{1}{n-1} \sum\_{i=1}^{n} (x\_i - \overline{x})^2}. \tag{A2}$$

The standard deviation can be considered as a kind of "average" distance the data sits, as a whole, from the central tendency.

Although we can visualize the shape of the data by developing a frequency distribution, we can also quantify the symmetry and peakedness of the distribution by calculating the skewness *Sk* and kurtosis *Ku*, respectively. We use the following definitions for calculations of each measure,

$$Sk = \frac{1}{(n-1)s^3} \sum\_{i=1}^{n} (x\_i - \overline{x})^3,\tag{A3}$$

and

$$K\mu = \frac{1}{(n-1)s^4} \sum\_{i=1}^{n} (x\_i - \overline{x})^4. \tag{A4}$$

#### **Appendix B. The Student-***T* **and Gaussian (Normal) Distributions**

Here, we present equations related to inferential statistics and standard distributions used throughout the paper, in particular to estimate the statistical uncertainty associated with multiple measurements of bottle emptying time. Again, we use *x* in lieu of *Te*.

For a sample (implying finite size) of *xi* of size *n* whose parent population is normally distributed, we can estimate the population mean *μ* using the Student's *t* variable. This estimate is given as

$$
\mu = \overline{\mathfrak{x}} \pm \frac{t\_{\rm V} s}{\sqrt{n}},\tag{A5}
$$

where *t<sup>ν</sup>* is tabulated for various levels of confidence. Often the term ±(*tνs*) <sup>√</sup>*<sup>n</sup>* is referred to as the "confidence interval".

The probability density function for a normally distributed variable,

$$p(\mathbf{x}) = \frac{1}{\sigma\sqrt{2\pi}}e^{-\left(\mathbf{x}-\boldsymbol{\mu}\right)^2/2\sigma^2}.\tag{A6}$$

is familiar to many students in science and engineering disciplines. As a refresher, the probability density *p*(*x*) is related to the probability that *x* will lie between values *a* and *b*, i.e., *P*(*a* < *x* < *b*) via

$$P(a < x < b) = \int\_{a}^{b} p(x) dx. \tag{A7}$$

Additionally, for small values of Δ*x*, we can write that *P*(*x* < *X* < *x* + Δ*x*) = *p*(*x*)Δ*x*. We are interested in relating this back to the finite data that we have to work with, specifically so as to visually compare to the frequency distribution in Figure 2b. Thus, we must use *P* = *F*/*n*, which then allows us to write that *F*(*x*) = *np*(*x*)Δ*x*. Using this finding and Equation (A6) we can create a continuous curve *F*(*x*) that can be superimposed onto a frequency distribution, i.e.,

$$F(\mathbf{x}) = n \left( \frac{1}{\sigma \sqrt{2\pi}} e^{-\left(\mathbf{x} - \boldsymbol{\mu}\right)^2 / 2\sigma^2} \right) \Delta \mathbf{x}. \tag{A8}$$

Alternatively we can transform the frequency data for *x* into the corresponding probability density. The probability density for each bin, *l*, in the frequency distribution (where *l* = 1...*k*) can be calculated using our definition of the probability density *pl* = *fl*/Δ*x*, where *fl* = *Fl*/*n* is the relative frequency. One advantage to this approach is that bar charts of probability density, rather than frequency *F*, demonstrate that probability density values are nearly independent of bin width and will approach limiting values i.e., a limiting distribution, as *n* → ∞ and Δ*x* → 0.

To quantitatively assess whether a normal distribution adequately fits the data, we used the Kolmogorov–Smirnov test [27]. In this test, we first compute the maximum of the deviation, *dKS*, between the empirical cumulative relative frequency, *c f* , to theoretical value from a standard distribution. For our case this is the normal distribution, but this test is not restricted to this distribution only. The maximum of the deviation just described can be expressed as

$$d\_{KS} = \max\_{1 \le j \le n} \left| cf(x\_j) - cf\_n(x\_j) \right| \, \prime \tag{A9}$$

where *c f*(*xj*) is the cumulative relative frequency (i.e., bounded by 0 and 1) based on the theoretical distribution for a population, and *c fn*(*xj*) = *j*/*n* is the empirical cumulative relative frequency. Here, the index *j* denotes the ordered dataset. We then compare the value of the maximum deviation *dKS* to the critical value *dα*(*n*) based on the sample size, *n*, and the level of significance *α* (critical values are tabulated [27]). If *dKS* < *dα*(*n*), the theoretical distribution passes the test. If *dKS* > *dα*(*n*), the discrepancy between the empirical cumulative frequency distribution and the theoretical distribution is considered significant and the theoretical distribution fails to represent the data.

#### **Appendix C. Regression Analysis**

For the necessary material related to regression analysis, which is needed to find the empirical correlation describing the entire set of our bottle emptying data, we transition from the statistics of a single variable *x* to the relationship between two variables *y*(*x*). In what follows, the notion that we use here now reflects *<sup>x</sup>* <sup>→</sup> *<sup>V</sup>*/*d*<sup>3</sup> and *<sup>y</sup>* <sup>→</sup> *Te g*/*d*.

The method of least squares can be used to find the best-fit polynomial function of the form *y* = *a*<sup>0</sup> + *a*1*x* + *a*2*x*<sup>2</sup> + ... + *amx<sup>m</sup>* through a set of *n* data points (*xi*, *yi*) once the order of the polynomial, *m*, has been selected. For a linear regression of the form *y* = *a*<sup>0</sup> + *a*1*x*, the method is straightforward and reduces to solving for the regression coefficients [16] *a*<sup>0</sup> and *a*1, which minimizes the deviation between the curve fit equation and the data points. Here, we provide the definitions for *a*<sup>0</sup> and *a*1:

$$a\_0 = \frac{\sum x\_i \sum x\_i y\_i - \sum x\_i^2 \sum y\_i}{\left(\sum x\_i\right)^2 - n\sum x\_i^2} \quad \text{and} \tag{A10}$$

$$a\_1 = \frac{\sum x\_i \sum y\_i - n \sum x\_i y\_i}{\left(\sum x\_i\right)^2 - n \sum x\_i^2}. \tag{A11}$$

The summation symbols have been simplified but all apply from *i* = 1 ... *n*. Although a program (e.g., Excel-<sup>R</sup> or MATLAB-<sup>R</sup> ) can be used to automatically solve for these coefficients (and this may be the appropriate route to consider if the emphasis of the student project is dimensional analysis and fluid mechanics); a basic spreadsheet can be used to compute the necessary summations.

For the case where the linear regression we seek has the form *<sup>y</sup>* = *<sup>a</sup>*1∗*x*, where *<sup>a</sup>*1<sup>∗</sup> = *<sup>a</sup>*1, the single regression coefficient can be solved for using

$$a\_1 = \frac{\sum x\_i y\_i}{\sum x\_i^2}.\tag{A12}$$

#### **References**


c 2019 by the author. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (http://creativecommons.org/licenses/by/4.0/).

## *Essay* **Teaching and Learning Pressure and Fluids**

#### **Petros Kariotoglou 1,\* and Dimitris Psillos <sup>2</sup>**


Received: 8 October 2019; Accepted: 22 November 2019; Published: 25 November 2019

**Abstract:** This essay is a synthesis of more than twenty years of research, already published, on teaching and learning fluids and pressure. We examine teaching fluids globally, i.e., the content to be taught and its transformations, students' alternative conceptions and their remediation, the sequence of educational activities, being right for students' understanding, as well as tasks for evaluating their conceptual evolution. Our samples are junior high school students and primary school student-teachers. This long-term study combines research and development concerning teaching and learning fluids and has evolved through iteratively based design application and reflective feedback related to empirical data. The results of our research include several publications.

**Keywords:** teaching and learning fluids; teaching and learning pressure; alternative conceptions; teaching learning sequences; conceptual change; constructivism

#### **1. Introduction**

In the present paper, we describe and discuss a synthesis of several investigations we conducted concerning the teaching and learning of the conceptually demanding topic of fluids. Our aim was to enhance the conceptual evolution of junior high school students and primary school student teachers in the field of science through a proposed Teaching–Learning Sequence (TLS). Our incentive for organizing such a long-term research study was due to a number of factors, namely, the inclusion of fluids in the Greek curriculum as well as in that of several other countries, the variety of everyday phenomena related to fluids, and students' alternative conceptions identified in studies prior to our own [1]. The theoretical framework which our study is based on regarding the teaching and learning of science is individual and emphasizes the importance of learners' prior conceptions and reasoning in facilitating or preventing their understanding of new scientific concepts and models, as well as their active participation in the construction of new knowledge [2–4]. Moreover, it is argued that models that have been accepted by the scientific community may potentially undergo transformations based on research evidence, in order to become knowledge to be taught comprehensibly to target populations [5,6].

In this context, the present synthesis focuses on: the research results on students' domain-specific conceptions and reasoning in the field of fluids; content analysis of the relevant scientific models; the reconstructed research-based scientific model to be taught. In addition, the interactions between the model to be taught and students' conceptions and reasoning led to the development of a pioneering Teaching Learning Sequence (TLS) in fluids, with selected effective tasks. Moreover, we also present selected research results concerning students' and primary school teachers' conceptual evolutions in their various applications of the TLS. At the outset of this paper, we would like to clarify that, despite the presentations essentially having a linear/sequential format, during the numerous studies, there were cycles of research and development concerning students' understanding and iterative development of instructional interventions [7].

#### **2. Students' Domain-Specific Conceptions and Reasoning in the Field of Fluids**

Since fluids are included in several curricula worldwide, a number of researchers, as early as the 1980s, have examined students' conceptions related to liquids or gases prior to or after instruction, mainly in compulsory education. Briefly, a considerable number of students, before and after instruction, consider water 'pressure' to be a 'force' or a 'weight' [8], they think that 'pressure' has a preferred downwards direction, increases with depth [1,9] and that the value of 'pressure' increases with the total volume of liquid. Furthermore, other students ignore the incompressibility of liquids or consider them not to have a constant volume.

An essential aspect of these difficulties is students' confusion about pressure and force, an issue that has only slightly, but not explicitly, been approached by researchers. In the present study, we believe that students' conceptions in this domain should be examined systematically in terms of how they relate and/or differentiate the concepts of force and pressure [10]. We, thus, set out to further investigate the vector and scalar features of students' conceptions with regard to liquids in equilibrium using paper and pencil tasks, as well as semi-structured interviews. In order to corroborate the findings, the data were triangulated. For instance, we asked students (13–14 year-olds) before and after instruction, to compare the values of pressure at the same depth in two vessels containing water, for several different situations, e.g., at two different points of the water, at the backs of two divers, in small vessels, in a well, and in the sea, etc. In addition to the descriptive results, we articulated a number of mental models that are possibly used by the students in this domain, named "packed crowd model", "pressing force model" and "liquidness model", as has extensively been presented elsewhere [11].

Briefly, students who adopted the "packed crowd model" consider the density of the water to be variable. This means that the density in the narrow vessel is greater than in the wide one, thus, making the pressure greater in the former than in the latter. These students regard pressure as having no direction, it is considered or calculated on a surface. Students, who adopted the "pressing force" model, consider pressure in the wider vessel to be greater than in the narrower one, as a result of the larger amount of water. They also regard pressure as having a direction, depending on the amount of liquid, is considered or calculated on a surface, divided or shared, and it is expressed as "accepts/exerts pressure".

Students, who adopted the "liquidness model", consider the value of pressure at the same depth of a wide and a narrow vessel to be equal, and the pressure to be the property of the liquid, they calculate it on a point and express it as "has/exists pressure".

The "liquidness model" is relatively close to the scientific one, whereas the "packed crowd" one is primitive. The frequency of evidence in each model varies according to the period of teaching before the test. Usually, after the relevant instruction, approximately 40% of students understand the "pressing force model", 30% the "liquidness model", and 15% the "packed crowd model" [11]. The same models were identified among primary school student-teachers [12], though their wording was richer than that of the junior high school students.

The above-mentioned results show the major difficulties that students face when it comes to understanding this important concept, being a prerequisite for describing and interpreting fluids-related phenomena.

#### **3. Scientific Content: Representations and Transformation**

In the context of constructivism, clarification of the gap between students' prior knowledge and the representations of scientific knowledge is of great importance, for elaborating teaching, adapted to students' ideas and reasoning [13]. Taking such a theoretical perspective, we carried out a content analysis of six well-known textbooks on introductory physics, looking at how the concept of pressure is introduced and treated (for more details: [13]). The six textbooks refer to general physics in different countries at three levels, i.e., junior and senior high school and tertiary education. Briefly, the findings of this investigation show that all of the textbooks introduce pressure via the known formula:

$$\mathbf{P} = \mathbf{F}/\mathbf{S}.\tag{1}$$

(**P** is Pressure, **F** is pressing Force, and **S** is Surface)-half of them also present it through liquids, while the other half through solids. All of the books, with the exception of one, attribute characteristics of a vector to pressure, which is a scalar quantity, and use the expressions "exerted or accepted pressure". Finally, the calculation of pressure on a surface, accompanied with arrows reinforcing the characteristics of a vector to pressure, appears in all of the six books.

Of course, the textbooks also use elements that attribute features of a scalar quantity to pressure. Such an approach is explicitly followed in four of the six books. It is mainly linked with the equation:

$$\mathbf{P} = \mathbf{d} \times \mathbf{g} \times \mathbf{h},\tag{2}$$

where **P** is Pressure, **d** is density, **g** is gravitational acceleration, and **h** is the depth of the liquid. However, in only two of the six books do the authors use the expressions ". . . it has pressure..." or ". . . there is pressure. . . ", which imply that pressure is a scalar quantity. The content analysis showed that the concept of pressure is articulated and utilized in the textbooks in two distinct ways: as a vector and as a scalar quantity. This leads us to conclude that textbooks often include implicit transformations of the accepted scientific model. The main transformation is the attribution of vector characteristics to pressure, which is close to students' dominant conception of the "pressing force model". It would be interesting to investigate the reasons that guided the authors of the textbooks to adopt such transformations for the concept of pressure.

Students who study introductory physics as part of their secondary compulsory education are required to understand the concept of pressure as it is a prerequisite for their conceptual development in the field of fluid mechanics. From the previous description of pressure models in liquids, it is evident that the most significant conceptual obstacle is the non-differentiation of pressure from the resultant pressing force. Therefore, the students who adopted this model could not conceive the meaning of pressure as a scalar magnitude, in comparison to the resultant pressing force, which is a vector. Considered at a point of liquid, the former is expressed as "has or exist pressure", while the latter as "accepted or exerted force".

In order to help students comprehend the differentiation between pressure and force in liquids, we have proposed a didactic transformation or educational reconstruction [5,14,15]. Specifically, we propose the introduction of pressure as a primary concept, measured directly, qualitatively and experimentally, rather than introducing it as a derivative magnitude from force with the Equation (1) [13,16,17]. Through this approach, we expect that the concept of pressure will be more comprehensible to students and will subsequently be differentiated from force, which appears to be the dominant concept in students' minds.

For an integrative approach concerning the teaching of fluids, further didactical transformations, although perhaps not as radical as the introduction of pressure as a primary concept, need to be made. One of these is the unification of liquids and gases in the category of fluids. This is because pressure has a unifying meaning in fluids, i.e., a scalar quantity, which differs from that of solids, where it is considered as stress, i.e., a vector quantity. In this way, we avoid using examples such as the pin of a pin on the board, or the destruction of a wooden floor with a stiletto heel, which are commonly presented in textbooks.

Another conceptual obstacle is the understanding of liquids as non-compressible, meaning that the density of a liquid does not change when it is contained in vessels of a different size, which is essential scientific knowledge. This obstacle may be overcome much more easily than the ones above, with the following experiment: a syringe filled with water is presented to the students, when force

is exerted on the plunger, no compression of the liquid is observed This, along with the appropriate discussion, can make students understand that liquids are a practical, incompressible substance.

#### **4. An Innovative Teaching–Learning Sequence for the Teaching of Fluid Related Phenomena**

A contemporary, widespread strategy for developing innovative teaching approaches based on actively engaging students to change their domain specific ideas using several methods and techniques strategies, such as Predict–Observe–Explain physical phenomena, cognitive conflict, and the use of analogies are Teaching–Learning Sequences (TLS) [18,19]. TLSs are medium-scale (5–15 teaching hours) curriculum packages. According to Psillos and Kariotoglou, "A TLS is often both a research process and a product, which includes research-based structured teaching-learning activities. Frequently, a TLS develops iteratively out of several implementations, in accordance with a cyclical evolutionary process based on research data, which results in its being improved, with empirically validated expected students' outcomes from the planned activities" [18,20]. Several researchers agree with this outline of a TLS [20,21]. In addition, researchers have argued that grand pedagogical theories are too general in their proposals and that models or frameworks are necessary to design, apply, and evaluate a TLS [21]—one which is most used is "The Model of Educational Reconstruction" [12]. Following this model, we have identified the learning objectives, clarified students' domain-specific alternative conceptions, carried out a content analysis of textbooks, conceived an appropriate didactic transformation mentioned in the previous sections, as well as developed teaching strategies and activities, which are selectively presented further below. While the proposed TLS for junior high and primary school teachers is in accordance with accepted scientific models in that it focuses on the force–pressure relationship, its structure is based on a sound educational reconstruction of the treatment of these two concepts. Due to time restrictions, the TLS does not include pressure transmission, or the sinking and floating of solids immersed in fluids, although it does set the conceptual basis for studying such principles and phenomena later.

#### *4.1. Basic Teaching–Learning Objectives*

#### 4.1.1. Differentiating Pressure from Pressing Force

The main innovative conceptual objective of the TLS is the differentiation of two overlapping concepts, i.e., pressure with the resultant force which is a hard task, demanding thorough instructional design. For this reason, we propose a didactic transposition/transformation for the introduction of pressure as a primary concept to students. Our instructional design is based on the constructivist approach of teaching and learning, and, in particular, creating cognitive conflicts between students' predictions and the observation of experimental evidence [4]. More specifically, the suggested experiments are: (1) the comparison/measurement of pressure at two points, at the same depth, in a narrow and in a wide vessel, and (2) the comparison of the forces required to detach two different surface sucks (Figure 1).

**Question/Experiment 1:** Compare/measure the pressures at the bottom of the two vessels a and b

**Question/Experiment 2:** Compare the forces required to detach the two sucks

**Figure 1.** The two tasks/experiments that stimulate cognitive conflict in students [22].

We wish to note that this simple experiment of the comparison/measurement of pressure on the surface of two different vessels is usually not presented in textbooks. We consider this experiment as a significant intervention because it not only elicits students' alternative conceptions (see pressure models), but also helps them to differentiate force from pressure.

#### 4.1.2. Comprehending the Compressibility of Liquids

Another innovative objective in the proposed TLS is to assist students to go beyond their conception of the compressibility of liquids, as some seem to think that, when water is transferred from a wider vessel into a narrower one, it becomes denser, i.e., its density increases. This conceptual obstacle may be overcome much more easily than the others mentioned above with the following experiment: the teacher shows students a syringe filled with water, then when force is exerted on the plunger, students observe that this does not result in compression of the water. Such an experimental result followed by the appropriate discussion can lead students to deduce that liquids are a practical, incompressible substance.

#### 4.1.3. Classifying Both Liquids and Gases as Fluids

A third innovative objective is that of unifying liquids and gases into the category of fluids. Here, we aim to associate pressure (as a scalar quantity) with fluids, in contrast to solids, which are better described through stress, i.e., the force distributed on a surface (a vector quantity). As in several approaches, fluids are used explicitly and not implicitly as a unifying category of liquids and gases, the use of which may foster cognitive economy in students. This objective is attained by excluding all examples/phenomena or experiments where pressure is introduced via solids, for example, an object's impression in the sand or the pin on a wall.

#### 4.1.4. Establishing the Relationship between Pressure and Pressing Force

The TLS also includes more common learning objectives, such as the dependence of hydrostatic pressure on depth: Equation (2). This rule is explained with the relevant experiment and measurements, at the same time, highlighting the experimental methodology, such as the distinction and control of variables.

#### 4.1.5. Enhancing the Dependence of Hydrostatic Pressure on Depth

By the end of the sequence, pressure is related to the resultant pressing force with the following equation, where **F** is the Force, **P** is the Pressure, and **S** is the Surface:

$$
\mathbf{F} = \mathbf{P} \times \mathbf{S}.\tag{3}
$$

We state that this formula relates the two magnitudes as a linear relation, whereas, in the classical curricula, the formula used is that of Equation (1) in order to introduce pressure as a derivative magnitude via force, which is considered to be a primary concept.

#### *4.2. Selected Features of the Structure and Teaching of the TLS*

Using all the above-mentioned elements, we have developed the TLS, which consists of three units each lasting about two teaching hours. A major feature of the TLS is the active involvement of students in the experiments, which were intentionally selected to comprise tasks consisting of liquids or gases but not solids, which are commonly included in standard as well as in some constructivist curricula. Teaching is based on experimentation, group work, and teacher-led discussions. Qualitative and semi-quantitative experiments are conducted, which allow students to focus on different aspects of the conceptual model, providing them with concrete references in order to grasp the meaning, as well as discover the connection between their observations and their deductions. Quantitative experiments are used for students' conceptual growth and familiarization with the design of scientific investigations, while the effective constructivist teaching strategy Predict, Observe, Explain (POE) is applied in the activities [23]. The experimental activity begins by students predicting what they believe will happen in the two tasks described above. Should they follow the pressure–force model, it means that they identify pressure with force, and thus they would predict that the pressure and the force in the wider vessel is greater than that of the narrower one. A detailed discussion between the teacher and students, as well as among the students themselves, will reveal the inconsistency of their reasoning. The actual case is that the pressure in the two vessels is equal, while the force required to detach the two sucks is not, leading to the existence of two different sizes: pressure (P) and pressing force (F).

In the first unit of the TLS, the aim is to familiarize students with the phenomena being studied and for them to understand that liquids and gases are fluids. To this end, the teacher performs relevant experiments and takes measurements, while the students do some experiments in small groups. The findings are discussed firstly among the group members and then, with the teacher's coordination, before the whole class. The aim of the second unit is the following: students reinforce the concept of pressure and become familiar with the experimental methodology, focusing on the distinction and control of the variables in the Equation (2), (basic hydrostatic law) [24]. Lastly, in the third unit, students are expected to differentiate pressure from the pressing force by engaging in the process described in Section 4.1.1. In brief, the same procedure is followed as that described above, while the next step is to facilitate students to relate pressure with force and introduce the Equation (3). The content and activities of the TLS are summarized in Table 1.


**Table 1.** Objectives, structure content and activities of TLS, for teaching fluids and pressure, in junior high school (retrieved with permission from [12], www.tandfonline.com).

#### **5. Enhancing Students' Understanding of Fluids: Selected Results**

The TLS was developed iteratively and tested on two target samples with some modifications. The first sample consisted of 58 students (13–14 year-olds) from the second year of Junior High School (a.k.a. Gymnasium), which in Greece constitutes one of the compulsory education tiers. The second sample comprises primary school student-teachers studying in the Department of Primary Education, at the Aristotle University of Thessaloniki, Greece. As in numerous other countries, we think that 13–14 year old students, as well as primary school student teachers in Greece have difficulty understanding science. The main presumption for this in terms of the student teachers is that they enter their university studies through studying the Theoretical Orientation in the last two years of senior High school (a.k.a. Lyceum), which comprises arts and humanities subjects, rather than the Applied Orientation, comprising math and science subjects. Furthermore, their tertiary studies to become "one-teacher-to-teach-all subjects" offer a limited number of science courses [25,26]. The data

analysis of applying the TLS on the two sample groups gave satisfactory results [12,27]. In the present paper, due to space constraints, we present only the findings of the TLS intervention on second year junior high school students.

#### *5.1. Qualitative Results*

An effective method to facilitate the way pressure is perceived, which is a weak concept, is to have students experimentally validate pressure dependence on depth in a fluid, as well as introducing to them the fundamental law of hydrostatics. By participating in the taking of measurements, students are encouraged to apply their ideas, which is essential for their conceptual evolution. The data analysis of the recorded discussion of students and their teacher during instruction strongly suggests that such activities helped students to consolidate their initial ideas as regards the change of the magnitude of pressure in water with depth. Additionally, taking measurements of pressure enhanced students' notion of the existence of pressure. We believe that taking measurements greatly enhances students' assurance in the validity of the relationship between pressure and depth in different types of fluid. Obviously, the procedure requires further elaboration, because students realize that they need to have two measurements to be able to confirm a relationship; however, they do not seem to realize the need to have more than two in order to enable mathematical treatment. Thus, at this stage, the teacher coordinates the relevant discussion about the experimental measurements and subsequently shows the relationship between pressure and density via Equation (2).

#### Distinction between Pressure and Pressing Force

Considering questions 1 and 2 after teaching, most of the students answered them correctly (see Figure 1, [22]). As regards question 1, they responded that pressure is the same because the water heights are the same, as explained in the instruction. They also agreed that it is more difficult to detach the larger sucks than the smaller ones because of their difference in size (question 2). There were some students, however, who insisted on their initial conceptions in accordance with the "pressure–force model". Following their teacher's prompts in order to find a way out of such an impasse, the students proposed to measure the pressure in the two vessels. This shows that they deem experimental measuring as a suitable procedure as a way of checking their own ideas.

It is important to note that students who used the pressure–force model came up against an important discrepancy. By claiming that the pressures in question 1 are equal, and noting that the forces required for question 2 are unequal, in order for these students do be consistent, they would have to have responded that the pressures and forces in both questions are either equal or smaller regarding the smaller area. This discrepancy is not directly perceptible to the students, which is why it is crucial at this stage that the teacher makes it easy for students to understand the discrepancy in their responses. When this contradiction becomes obvious to the students, it leads to disputing their initial ideas. The discussion between students and teacher gradually and slowly leads them to dispel the confusion regarding the two conceptions.

#### *5.2. Quantitative Results*

The results of the posttest (just after the instruction) and the post-posttest (eight months later) for both the experimental and control groups are presented in Table 2. Table 2 also includes the percentage of correct answers, as well as the corresponding confidence intervals, to the questions that are required the prediction and interpretation of phenomena involving the concept of pressure. Below are the results for questions 3, 4, 5, 6, and 7 (see Figure 2). These questions are related to pressure comparisons in various situations and are part of a larger questionnaire used in our fluid research study.

**Figure 2.** The five tasks of the quantitative questionnaire [22].

Table 2 shows the percentages of students, who answered the five questions correctly, as well as the confidence intervals corresponding to the significance level a = 0.05. The 58 students in the experimental group answered all five questions correctly after the teaching instruction, in a range of 60.5% to 83%, whereas the corresponding percentages for the control group were 20% to 54%. For all of the questions, the difference between the experimental and control groups is statistically significant at the level a = 0.05. The findings for the post-posttest show that the percentages of correct answers for the experimental group remained at a similar high level, with only a few regressions eight months after teaching, whereas, for the control group, these percentages decreased significantly regarding four of the five questions (with the exception of Q 4).


**Table 2.** Quantitative results [22].

#### **6. Conclusions**

In this paper, we present and analyze a research and development strategy for the teaching and learning of fluids, with an emphasis on the concept of pressure. Our strategy, a result of our research, development, and teaching, was iteratively evolved over a period of twenty years and was applied iteratively and successfully on two target groups: second year junior high school students and primary school student-teachers. The combination of qualitative and quantitative results strongly indicates that our Teaching and Learning Sequence had a significant level of success. The students recognized that pressure is a non-additive magnitude in various contexts and situations, simple or complex. They also learned that pressure has no direction, which is characteristic of pressing force but not of pressure. Moreover, students were able to discriminate between the concepts of pressure and pressing force.

We consider that our strategy is successful on account of the following: firstly, the systematic study, analysis, and understanding of students' reasoning, secondly, the transformation of the content to be taught in order for students to overcome difficulties, and, thirdly, the adoption of a Teaching–Learning Sequence as a research and development framework, which leads to a comprehensive approach of teaching and learning scientific knowledge [18–21]. Moreover, we suggest that the presented Teaching Learning Sequence, as an example of effective good teaching practice, can help physics teachers to elaborate on their teaching and inspire innovative treatment of the topic of fluids and pressure in science curricula for junior high school physics. Finally, the proposed research strategy and educational materials are experimentally validated resources appropriate for teaching in methodology courses addressed to under- and post-graduate primary education teachers.

**Author Contributions:** The authors contributed equally to the preparation and writing of present paper.

**Funding:** This research received no external funding.

**Conflicts of Interest:** The authors declare no conflicts of interest.

#### **References**


© 2019 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (http://creativecommons.org/licenses/by/4.0/).

## *Article* **Forty Years' Experience in Teaching Fluid Mechanics at Strasbourg University**

#### **Daniel G. F. Huilier**

ICUBE laboratory-CNRS, Faculty of Physics & Engineering, Strasbourg University, 67084 Strasbourg, France; huilier@unistra.fr; Tel.: +33-637597063

Received: 8 November 2019; Accepted: 27 November 2019; Published: 29 November 2019

**Abstract:** A summary of the personal investment in teaching fluid mechanics over 40 years in a French university is presented. Learning and Teaching Science and Engineering has never been easy, and in recent years it has become a crucial challenge for curriculum developers and teaching staff to offer attractive courses and optimized assessments. One objective is to ensure that students acquire competitive skills in higher science education that enable them to compete in the employment market, as the mechanical field is a privileged sector in industry. During the last decade, classical learning and teaching methods have been coupled with hands-on practice for future schoolteachers in a specific course on subjects including fluid mechanics. The hands-on/minds-on/hearts-on approach has demonstrated its effectiveness in training primary school teachers, and fluids are certainly a nice source of motivation for pupils in science learning. In mechanical engineering, for undergraduate and graduate students, the development of teaching material and the learning and teaching experience covers up to 40 years, mostly on fluid dynamics and related topics. Two periods are identified, those prior to and after the Bologna Process. Most recently, teaching instruction has focused on the Fluid Mechanics Concept Inventory (FMCI). This inventory has been recently introduced in France, with some modifications, and remedial tools have been developed and are proposed to students to remove misconceptions and misunderstandings of key concepts in fluid mechanics. The FMCI has yet to be tested in French higher education institutions, as are the innovative teaching methods that are emerging in fluid mechanics.

**Keywords:** fluid mechanics; science teaching; hands-on/minds-on/hearts-on; inquiry-based problem; science learning; educational activities; FMCI; Strasbourg University

#### **1. Introduction**

The present paper summarizes a 40 year learning and teaching experience in a French university, with the occasional assistance of foreign professors on sabbatical and on-the-job learning that took place in the mid-1970s. Teaching fluid mechanics—connected to mathematics, computer science, and numerical methods—is summarized for undergraduate and graduate students in mechanical engineering. However, over the last 15 years, learning how fluids behave based on hands-on methods was also shown to be a challenge for future school professors [1]. Details on this specific teaching activity will be developed in Section 2. Critical aspects related to drastic changes in the curricula, often a consequence of the Bologna Process [2,3], are also highlighted in fluid mechanics engineering. The development of computer science, the internet, and innovative pedagogical methods in learning and teaching science (SoTL, [4]) will bring to light that novel methods are needed to persuade students to pursue the subject of fluids in their studies in higher science education, as well as to improve young people's interest in science studies and attract them to fluid mechanical engineering and related professions. A recent proposal, presently tested on a remediation program, to fill in the gaps and deficits in fluid mechanics will also be developed; this is inspired by the Fluid Mechanics Concept

Inquiry (FMCI) test initiated by Martin, Mitchell, and Newell [5,6]. The first part of this paper is devoted to the teacher training that started in 2007, a rather unusual investment for an academic scientist specialized in physics and fluid mechanics. The experience of teaching fluid mechanics in an engineering faculty, at undergraduate and graduate levels, is described in the second part, which is subdivided into Sections 3 and 4, teaching prior to and after the implementation of the Bologna Process. This part concerns the main activity of the author's career. Section 5 focuses on the tools being developed to improve teaching and learning fluid mechanics in regard to overcoming students' misconceptions with help of the FMCI, remediation tools, and the acquired experience in educational sciences. A short review of recent innovative teaching and learning methods applied to fluids completes the paper, with the goal of encouraging collaboration with young colleagues.

#### **2. Teaching and Learning Fluids with Future Schoolteachers**

Undergraduate students willing to become primary schoolteachers in France must complete a Master's in Education Science and succeed in a competitive exam. One option suited to students in biology, life science, chemistry, engineering or physics is to follow a course entitled "Experimenting and Understanding Physical Sciences", which was founded 15 years ago. It is based on the hands-on/minds-on method coupled with constructivism, science learning, inquiry-based problems, hypothetico-deductive (HD) reasoning, methods of observation, initial representation, verification by experimentation, and feedback. The group asserts that a change in school science teaching pedagogy from mainly deductive to inquiry-based methods will provide the means to increase interest in science. Indeed, the "learning by doing method", in which the teacher accompanies the pupil and leads him to discover science for him/herself, stimulates the child's observation skills, imagination, and reasoning capacity [7]. The course unit consists of four lectures, mainly via an introduction to Education Science and different scientific investigation approaches (hands-on, inquiry-based, problem-based, inductive, deductive, and HD processes). The course is further organized into five practical sessions in physics and chemistry (among one in Newtonian and fluid mechanics); The required education level of scientific knowledge being the third year of the Batchelor's Degree. The students learn to apply the HD and hands-on during these sessions, last they learn to create lesson cards for elementary classrooms at home. Preference is given to educational science as proposed by Marguerite Altet, Jean-Pierre Astolfi, Philippe Meirieu, Philippe Perrenoud, and Michel Serres.

Hands-on [1] was introduced in France by Georges Charpak (Nobel prize, 1992) after visiting schools in Chicago, where he met Leon Lederman (Nobel prize, 1988) and Karen Worth, the daughter of physicist Victor Weisskopf. Karen Worth is an important figure in the development of inquiry-based and hands-on learning in schools. They also worked with Jerry Pine at Caltech, who successfully developed a K–12 systemic reform of science learning and inquiry-based science teaching with the hands-on experimentation model. Jerry Pine pioneered this model by offering experimental kits to his students [8].

#### *2.1. Hypothetico-Deductive (H-D) Method in Sciences*

The hypothetico-deductive (H-D) method, broadly used in science research, is classically a seven-step process (according to Popper [9–11] and further contributions [12,13]):


In our case, we slightly modified the different steps of the scientific investigation method, associating theory with experimentation (Figure 1). For a given problem (experiment to be carried out, evocation/display of a phenomenon, of a technical object, scientific question) related to an available theoretical structure (model, concept, knowledge), we present the following items:


**Figure 1.** Schematic of the scientific method.

#### *2.2. Practical Work and Projects in Fluid Mechanics*

In fluid mechanics, the students, except for the last item on lesson cards, must provide a quality work at a Bachelor's degree, and they:

➢ Have two weeks to update their knowledge in fluids (Newton's laws, free fall bodies in a void, fall in air or water/oil, the Archimedes' principle, the Bernoulli law of perfect fluids) and investigate the concepts of viscosity and drag force (Reynolds number, Stokes' law, terminal fall velocity), writing all in a science notebook.

	- Galileo's experiments of falling objects, using sport balls in air from different heights up to 20 m (to observe differences in terminal velocities for different spheres (diameters, density));
	- Making a classic Cartesian diver (understanding pressure, Archimedean buoyancy);
	- Building a parachute with fabric and string/building a wind turbine;
	- Observing the settling of sand grains in water;
	- Observing bubbles rising in oil or water, or the fall of a golf ball in water (viscosity calculation);
	- Galileo's experiment with rolling balls down an inclined plane (the calculation of gravity);
	- The levitation of a ping pong ball (Coanda effect, Bernoulli equation);
	- The measurement of the density of objects (cork, lead sinkers) based on the Archimedes' principle.

Aside from the available materials, students can use computer and web resources, textbooks and lecture notes, scientific articles, exercises, and educational videos, which are made available on a personal website [14], to prepare their practical work and experiments during their practical session. The course is intended to develop skills in fluid mechanics as well as in science education. The benefits of the course include:


#### 2.2.1. Example of an Experiment: Free Fall of Bodies

The present example is dedicated to the laws governing falling bodies in a vacuum, gas, or liquid. Students have to imagine experiments such that highlight the different forces acting on a falling body (gravitational force, buoyancy, drag/air or liquid resistance). Several text extracts such as passages from the Principia, popular and scholarly articles, and some handouts on Newtonian mechanics help them to recall Newton's laws of motion. In a vacuum—as on the moon, in the absence of an atmosphere—all objects fall at the same rate, as astronaut Dave Scott demonstrated by dropping a hammer and a feather in the Apollo mission XV in 1971. This experiment, shown in NASA or Youtube videos [15], can help students to understand Newton's second law of motion in a vacuum.

Without any other force besides gravitation, and air resistance being neglected, in Earth's atmosphere, spheres dropped at zero speed, have a velocity *V* and impact time *T*, as given in Table 1. Although simplified, Table 1 yields an order of magnitude of *T* and highlights the difficulties in making observations with only a chronometer and a measuring tape for small values of *T*. Furthermore,

students would be interested and excited to experience the simultaneous fall of different spheres from the third or fourth floor of a university building, just like the Galileo's hypothetical Leaning Tower of Pisa experiment.


**Table 1.** Time and velocity reached in free fall from different heights.

A rain droplet has a fall velocity of about 10 m/s [16]. Students have to investigate the reasons behind this value and become familiar with the concept of air resistance inducing a drag force that increases with velocity, as well as the concept of terminal velocity of bodies falling in fluids. Supplementary papers or textbook chapters are made available to students on drag, sport ball ballistics, and the famous Reynolds number as well [17–20]. Many spheres of different sizes and material composition (golf balls, tennis balls, table tennis balls, baseballs, whiffle balls; plastic, rubber, glass, or metal balls; hollow balls) are available to students to experience the dynamics of falling bodies (Figure 2). As potential distractors, other objects are usually added to the panel (a badminton shuttlecock, a crumpled sheet of paper, hollow balls with many holes, etc.).

**Figure 2.** Set of sport balls and other spheres.

For most spheres and sport balls, released from less than 5 m in air, gravity is the only force acting on them. Some distractors do not really behave differently. However, by releasing spheres from at least 15 m outside a building, students begin to notice a difference. They nevertheless have some doubt about the nature of the other forces acting on the spheres, Archimedes' buoyancy or drag forces due. revealing misconceptions of surface forces, pressure, viscosity, and viscous effects. Complementary experiments in water, 'does it sink or float', the levitation of a ping pong ball with a hair dryer, are essential to deepen the students' understanding of the different observed phenomena. It is the teacher's role as mediator and facilitator to provide explanations and clarifications on the

nature of these other forces. Once Newton's second law of motion is well written, calculations can be then made to determine atmospheric or hydrodynamic drag force, the coefficient of drag for the object, the instantaneous or terminal velocity of the object.

The bouncing of balls on different surfaces (ceramics, natural stone, concrete, parquet or laminate, sand, etc.) can also be analyzed, and the effect of various drop heights on the bounce height of a ball can be studied [21–23].

#### 2.2.2. Example of an Experiment: Viscosity Calculation

Small air bubbles released from the bottom of a vertical tube of water or oil reach their terminal velocity in a quite short distance. By measuring the time elapsed from a given height, the terminal velocity can be easily calculated; supposing the viscosity of water or oil is unknown Newton's second law of motion states that the equilibrium of the external forces on a bubble (weight, buoyancy, and drag) enables the estimation of the viscosity. The only cautions are that bubbles remain spherical, which is a good approximation for diameters less than 0.5 mm. Furthermore, Stokes' law (at small Reynolds number (Re)) is justified. For larger bubbles, other drag coefficient laws such as that of Schiller–Naumann [24] can be applied, though trial-and-error or iterative calculations are needed to obtain the viscosity. By solving Newton's law, the terminal velocity *U* is given by

$$
\Delta U = \sqrt{\frac{4}{3}g \frac{D}{C\_D(\text{Re})} \left(\frac{\rho\_p}{\rho\_f} - 1\right)}\tag{1}
$$

where *D* is the sphere diameter, ρ*<sup>f</sup>* and ρ*<sup>p</sup>* are the fluid and sphere bulk density (volume weight), and *CD* is the drag coefficient as function of the Reynolds number Re. The derived equation for *U* is nevertheless implicit since the drag coefficient *CD* is itself a function of *U*.

Starting with the equation of the motion of a sphere under gravity, the buoyancy and drag of a fluid at rest can be determined as

$$
\rho\_p \pi \frac{D^3}{6} \frac{du\_P}{dt} = \pi \frac{D^3}{6} (\rho\_p - \rho\_f) \text{g} - \pi \frac{D^2}{8} \rho\_f \mathbb{C}\_D(\text{Re}) \left| u\_p \right| u\_P \tag{2}
$$

At equilibrium, it is

$$
\pi \frac{D^3}{6} (\rho\_p - \rho\_f) g = \pi \frac{D^2}{8} \rho\_f \mathbb{C}\_D(\text{Re}) \, | \, \text{l}I \, | \, \text{l}I \, \text{l} \, \text{} \tag{3}
$$

In the case of Stokes' drag, *CD* = 24/Re, the drag force is reduced to *F* = 3πμ*DU*, the terminal velocity is given by *<sup>U</sup>* <sup>=</sup> *gD*<sup>2</sup> <sup>18</sup><sup>μ</sup> (ρ*<sup>p</sup>* <sup>−</sup> <sup>ρ</sup>*f*), and the dynamic viscosity is <sup>μ</sup> <sup>=</sup> *gD*<sup>2</sup> <sup>18</sup>*<sup>U</sup>* (ρ*<sup>p</sup>* − ρ*f*). The Stokes' relaxation time is <sup>τ</sup>*<sup>P</sup>* <sup>=</sup> <sup>ρ</sup>*PD*<sup>2</sup> <sup>18</sup><sup>μ</sup> , after which a falling sphere reaches 63% of its maximal velocity. Other possible experiments could be the measurement of the viscosity of milk [25] or water—for this experiment, it is best to choose a small sphere with a bulk density close to that of the fluid. The sedimentation/settling of sand grains in water can be an attractive activity too, wherein the settling velocity measurements and water viscosity allows the calculation of the diameter of the sand grains, for instance.

#### 2.2.3. Some Scientific Questions Treated in a Preparation Sheet

A preparation sheet is school lesson plan, created by the teacher, involving the learning objectives of the lesson, step-by-step experiments and activities for the pupils, and details of the materials to be used and possibly what should be written in child's notebook. It may involve a formative assessment. It must be in concordance with the curricula fixed by the French Ministry of National Education. When well written, it can allow a colleague to step in and lead the planned lesson in the event of absence or disease.

Preparing a sheet on a subject related to fluid mechanics for an elementary classroom is a difficult task. It is very time-consuming, requires imagination and skill, and requires inexpensive materials for experiments to be conducted by several groups of three to four children. These preparation sheets are intended for primary classrooms. The concepts and vocabulary must be popularized and adapted to the age of the children to be taught, which represents a real challenge for novice teachers. The teacher's role as facilitator is important for this task and time consuming for both parties, learner, and mediator. Here the learning cycle, play (heart-on learning), explore (hands-on Learning), and discuss (minds-on) is crucial.

Aside from their well-known textbook in physical hydrodynamics [26], Etienne Guyon et al. published a popularizing science book on fluids (unfortunately only available in French) entitled *What Fluids Tell Us* [27]. This textbook contains a vast selection of real-world, engaging examples of fluid mechanics, such as the falling of snowflakes and bubbles in a champagne glass, which are invaluable for novice teachers when writing their lesson plans. Another French textbook, now available in English, illustrates the wonder of fluids through "drops, bubbles, pearls, and waves" [28].

#### **3. Teaching Fluid Mechanics from 1976 to 2002**

From early period (1976) to the Bologna Process, teaching fluid mechanics to undergraduate and graduate students was quite well established. The library resources were reduced to some lecture notes and to a few fundamental books. For undergraduate students, most of the topics were covered in French books or in a few available English books (from Curle-Davies, Shapiro, Anderson, White, etc.). For graduates, classical books (such those of Batchelor, Hinze, Schlichting [29–32] or Lumley, Monin-Yaglom, Chandrasekhar, etc.) and the *Journal of Fluid Mechanics*, as well as the scientific papers of G.I. Taylor and microfilm issues, provided support for the teaching of fluid mechanics and turbulence. A large allocated volume of teaching hours and well-equipped laboratory experiments using pressure–velocity measurement techniques (Pitot, hot-wire, and even laser anemometry) favored extensive learning in fluids.

The advent of microcomputers fostered computational fluid dynamics, and the internet brought about the creation of effective websites. Besides a myriad of new textbooks, very serious scientific websites delivering much material on homework, courses, handouts, and exercises with corrections could be used for the content of a curriculum on fluid mechanics. Furthermore, enough teaching time was still allocated to enable in-depth training in many fields (statics of fluids, kinematics, dynamics, ideal fluids, viscous flows, internal and external flows, incompressible or compressible, turbulence, two-phase flows). The curriculum was coupled with numerical methods, applied mathematics, and computer science. The onset of turbulence, chaos, non-linear phenomena, and hydrodynamic instabilities appeared around 1990 and these courses, although a challenge for university professors, found a broad audience among students. It should be noted that undergraduate students had a solid background and skills in mathematics and physics, and master students were able to easily assess/handle partial differential equations (Navier-Stokes equations). Moreover, neither laminar/turbulent boundary layer theories (Blasius, Falkner-Skan, von Karman equation, Polhausen, or Twaites methods), plane or round jets, self-similarity approaches, nor turbulence models (k-ε, RANS, etc.) posed major problems to most of these students. Learning to apply finite difference or finite volume techniques as well as remeshing and studying stability problems of numerical schemes also found enthusiastic participation.

#### **4. Teaching and Learning Fluids after the Bologna Process**

The Bologna Process [2,3] is an intergovernmental higher education reform and cooperation process, launched in 1998 (Sorbonne declaration)–1999 (Bologna declaration). Its principal purpose is to promote the quality and recognition of the higher education systems in 48 European countries and to implement a common degree level system for undergraduates (Bachelor's degree) and graduates (Master's and Doctoral degrees), based on the so-called European Credits Transfer and Accumulation System (ECTS). In addition, it aims to facilitate student and teacher mobility, increase the recognition of academic degrees and qualifications, and increase employability, enhancing the attractiveness of in higher education in Europe. A number of European organizations (UNESCO, Council of Europe, ENQA, EUA, etc.) are also involved in this reform. The European Higher Education Area (EHEA) was launched in 2010 at the ministerial summit in Budapest, Vienna.

Several studies and recent reports based on TIMSS (Trends in Mathematics and Science Study) have shown that in France, the educational achievements of 15-year-olds and the share of high school students that go on to university are now below the EU average. They are lacking mathematics and science abilities. Since the Bologna process started twenty years ago, the French government and the Ministry of National Education modified several times all the curricula in primary and secondary schools, reducing the training hours allocated to science, engineering, and mathematics. Very recently the "Baccalauréat", the French secondary school diploma/ high-school degree (A-levels in UK) curricula again. Furthermore, the best high school pupils often opt for non-scientific disciplines and young people turn their backs on science. The progressive changes in European higher education led all French universities and some engineering schools to reconsider the programs and curricula on a national level and to revisit the contents and objectives of undergraduate and graduate programs, especially in STEM (Science, Technology, Engineering, and Mathematics). As a consequence, Bachelor of Science programs were affected and modified, and changes are still underway, at least in the French universities. These are some real causative factors for the observed changes in student ability in science and technology.

The progressive changes in European higher education led all French universities and engineering schools to reconsider the programs and curricula on a national level and to revisit the contents and objectives of undergraduate and graduate programs. Furthermore, even Bachelor of Science programs were affected and modified, and changes are still underway. Shortcomings in mathematics are known to be an essential hindrance to young people's interest and success in science and technology. In physics and engineering, at several universities, including Strasbourg, mechanical engineering really suffered from the curricula changes. Fluid mechanics felt to an optional course in undergraduate studies, with a reduced volume of teaching hours. Even main courses such as "Mathematical Methods for Physicists" had to be revisited. Almost every year, teachers like me had to scale down our ambitions in terms of the contents of our courses in linear algebra, analysis, computer science, and applied mathematics, as well as gradually adapt the learning and teaching level to meet students' lower competencies in scientific knowledge, especially in basic mathematics. Under these unforeseen circumstances, teaching methods, skill evaluation, and curricula content must be continuously adjusted.

#### *4.1. Case of Undergraduate Students*

The curricula contents for undergraduate students have been progressively reduced to statics of fluids, simple viscous flows, flows in pipes and open channels, and flows around immersed bodies. For instance, the solution of Stokes' creeping flow field around a sphere at a very small Reynolds number is no longer calculated mathematically. The first and second Stokes' problems (flow over a suddenly accelerated plate, flow above an oscillating infinite plate) and unsteady Couette flow between parallel plates are no longer addressed analytically, due to insufficient abilities in mathematics. Misconceptions about the ideal gas law, fluid statics, Bernoulli's equation, and Archimedes' principle are frequently observed in undergraduate students. Confusion between relative density or specific gravity (in hydraulics 1 for water) and volume weight or density (1000 kg/m3 for water), as well as between kinematic and dynamic viscosity, is not uncommon. More worrying is that students are unable to write down the volume of a sphere *V* = 4π*R*3/3 or the surface of a disk *S* = π*R*<sup>2</sup> without the support of an internet connection or a smartphone. Archimedes' buoyancy force is seldom understood, and students think that the buoyancy force increases with depth in water, as is the case with static pressure.

It is the author's opinion that no correlation directly exists between these observations and the Bologna Process, but that they coincide with the generation of 'digital natives' or the 'millennial generation' and indicate that these students approach and structure their studies and everyday life in a new way. Reducing the volume of teaching hours and setting the fluid mechanics course as optional did not made things any better in several French universities. The latter change is, however, linked with the reform process. Moreover, reduced financial support has affected the maintenance of experimental equipment and computer equipment.

#### *4.2. Case of Graduate Students: A Revealing Illustration*

The following short example is one among others that are intended to demonstrate what could be learned by master students only 10 years ago. Many master and PhD students have been working with the author in multiphase flows and particle-laden turbulent flows, on Lagrangian modeling or turbulent dispersion. In Section 2.2.2, the equation of motion of a sphere in a fluid at rest was simplified, including the gravitational, drag, and buoyancy forces. This concept is generally well understood by undergraduate students, even in education sciences:

$$\frac{\pi}{6} \mathbf{D}\_p^3 \rho\_p \frac{dV}{dt} = \frac{\pi D\_p^3}{6} (\rho\_p - \rho\_f) \mathbf{g} + \frac{1}{2} \mathbf{C}\_d \frac{\pi D\_p^2}{4} \rho\_f V^2 \tag{4}$$

However, in most cases, the equation is much more complicated and referred to as the Basset–Boussinesq–Oseen (BBO) equation. Thus, the trajectory *X*(*t*) of a spherical particle of density ρ*p*, viscosity ν*<sup>f</sup>* , and diameter *Dp*, located at *X* at time *t*, and moving with velocity vector *V*(*t*) in a fluid of density ρ*<sup>f</sup>* with the fictitious velocity at the center of the particle *U*(*t*), is obtained by solving the set of equations

$$\begin{aligned} \frac{\pi}{6} D\_p^3 (\rho\_p + \mathbb{C}\_4 \rho\_f) \frac{d\mathcal{V}}{dt} &= -\frac{1}{6} \mathbb{C}\_d \frac{\pi D\_p^2}{4} \rho\_f |V - \mathbb{U}| (V - \mathbb{U}) + \frac{\pi D\_p^3}{6} \rho\_f \frac{\text{D}\mathcal{U}}{\text{D}\mathcal{V}}\\ + \mathbb{C}\_d \frac{\pi D\_p^3}{6} \rho\_f \frac{\text{d}\mathcal{U}}{\text{d}t} + \frac{\pi D\_p^3}{6} (\rho\_p - \rho\_f) g - \mathbb{C}\_h \frac{D\_p^2}{4} \rho\_f (\pi \nu\_f)^{\frac{1}{2}} \int\_0^{\frac{d}{d\tau}} (V - \mathbb{U}) \frac{d\tau}{\sqrt{t - \tau}}\\ \frac{d\mathcal{X}(t)}{dt} = V(t) \text{with} \frac{d}{dt} = (\frac{\partial}{\partial t} + V\_j \frac{\partial}{\partial \mathbf{x}\_j}) \text{and} \frac{D}{Dt} = (\frac{\partial}{\partial t} + \mathbb{U}\_j \frac{\partial}{\partial \mathbf{x}\_j}) \end{aligned} \tag{5}$$

where *Cd* is the drag coefficient, *Ca* the added mass coefficient, *Ch* the Basset history term coefficient, and the particle Reynolds number is based on the particle–fluid slip velocity |*V* − *U*|. Master's and even PhD students in mechanical engineering now have real difficulty in understanding and handling this type of equation, not to mention solving it numerically. Adding a Magnus force (and torque equation) is even more complicated for them.

Working with Generation Y, another term designating the digital natives, has some positive returns on learning and teaching in general. Teachers have to change their pedagogical methods, switching from self-centered teaching to a student-centered learning environment. They have to question their own teaching techniques and find strategies to stimulate the students' interests. Insofar as the author had the possibility to get involved in education sciences over the past 10 years, it made sense to him to join the teaching and learning committee of the French Mechanics Association in order to foster education in fluid mechanics.

#### **5. Fluid Mechanics Remediation Test**

The French Mechanics Association, regrouping many academic university members as well as industrial companies, has a committee (GTT-AUM) working on the subject of learning and teaching mechanics at university. One of their aims is to develop tests for students that enable them to summarize their knowledge in different fields (Newton's laws, solid statics, fluid mechanics, etc.). A further the idea is to propose simple tools of remediation to students and university instructors, consisting of course refreshers to go over basic concepts, exercises, videos, and simple experiments. In the past six years, the commission has investigated concept inventories (CI) that have been well implemented in North America. The lack of interest in science and technology, as well as in mathematics, among young people profoundly affects the mechanical engineering sector. Instructors are aware of the need to revitalize traditional education and rethink pedagogical strategies.

#### *5.1. Conceptual vs. Procedural Knowledge, Misconceptions*

Conceptual knowledge, as defined by Rittle-Johnson and Wagner-Alibali [33], is an "explicit and implicit understanding of the principles that govern a domain and of the interrelations between pieces of knowledge in a domain". Other complementary definitions exist [34–36]. In contrast, procedural knowledge is defined as "action sequences for solving problems" [37]. Conceptual knowledge plays a key role in solving engineering problems. Learning science is not a rote memorization of figures, facts, laws, equations, and experimental or computational procedures. Teachers have to develop learning strategies and apply innovative pedagogies to guide students to acquire knowledge, add knowledge of new concepts, fill gaps, and avoid misconceptions [38–40].

#### *5.2. Concept Inventories (CI)*

Concept inventories are designed to be efficient tools in physics and engineering education and have been developed to identify key student misconceptions. They "are research-based assessment instruments that probe students' understanding of particular physics concepts" [41]. They use multiple-choice questions (MCQs) on the topic of one or a set of concepts. They have multiple-choice answers including distractor answers (incorrect choices) that ideally match misconceptions [42]. Moreover, they are resources for teaching evolution [43]. They are used as pre-tests to assess students' prior knowledge and as post-tests at the end of courses to estimate the changes in students' conceptual understanding. They originated in physics education research (PER) and became popular as efficient tools in engineering education for capturing conceptual understanding. They are rather carefully designed, multiple-choice instruments that require students to select the correct answer for a particular problem among distractors based on known student misconceptions.

In the 1980s, Halloun and Hestenes [44,45] developed a "multiple-choice mechanics diagnostic test" to assess students' concepts about motion. They later developed a force concept inventory (CI) and a basic mechanical test (BMT) based on Newton's laws. The FCI, a test of conceptual understanding of the three Newton's laws in mechanics, was further improved [46] and is now widely used as a reference, a so-called 'gold standard' conceptual inventory in the physical sciences. It consists of 30 MCQs with five answer choices (including distractors) for each question and is effective in testing students' understanding of the mechanical concepts of force, motion, velocity, and acceleration of Newton's three laws. It has been administered to thousands of physics students worldwide and is a strong indicator of misconceptions. In addition to the famous force concept inventory (FCI), the Foundation Coalition (FC), funded by the National Science Foundation (NSF), has introduced a variety of assessments for specific discipline domains within engineering and created resources and development projects for partner campuses. The development of CIs is one objective [47]. Members of the Foundation Coalition have introduced a variety of assessments for domains within engineering, including electronic circuits, signals and systems, fluid mechanics, acoustics, waves, computer engineering, electromagnetics, dynamics, civil engineering, heat transfer, thermodynamics, and material science.

#### *5.3. The American Fluid Mechanics Concept Inventory (FMCI)*

Among the many tests developed for engineering and physics education in the United States [48–55], one is devoted to fluid mechanics [5,6]. Initiated by a cooperative effort between Jay Martin and John Mitchell at the University of Wisconsin-Madison and Ty Newell at the University of Illinois, Champaign-Urbana in 2001, it led to a final version in 2006 with the aim of promoting student understanding of fluid mechanics, as taught in mechanical engineering in the United States. The purpose of these inventories is to check whether fundamental concepts are understood by students, without any calculations. The results of the FMCI test are intended to modify and improve the way fluid mechanics courses are taught.

Like the FCI, it consists of 30 MCQs including graphics with five answer choices for each question, and it tests student understanding of disparate concepts in fluid mechanics, with no numerical calculation being necessary. Watson et al. [56] recently proposed to modify the FMCI test for civil engineers. They started by regrouping the main concepts for each question. Table 2 summarizes the different concepts. Many distracters in the test items embody commonsense beliefs about the nature of force and its effect on motion.

**Table 2.** Concepts tested on the existing American Fluid Mechanics Concept Inventory (FMCI) [56].


To get an idea of the FMCI, a specific example of a multiple-choice question (question 1 of the FMCI) is given by Martin et al. [6] for a compressible flow in a pipe of constant section, with the downstream density being half of the upstream density. Answers concern the relationship between the up- and downstream velocities. Distractor answers state that the velocity would be smaller too, and both factor 2 and 4 are proposed. Wrong answers are typical for mass flux misinterpretations.

Another example developed in [57] refers to the flow of liquids in a contraction; a common misconception claims that the greater the velocity is, the greater the pressure will be. Several studies indicate that, for students, either liquids are compressible or pressure is a force and force is linked to velocity and not to acceleration, a typical misconception in the FCI. Here, Bernoulli's equation was clearly not understood.

Based on the last draft of the FMCI (version 3.4) from John Mitchell in 2016, a French version was written with small modifications and issued in January 2019. The previous concept table was modified (Table 3) and the questions were classified into four groups:


The present classification was optimized according to the French curricula in in higher education institutions. Remediation tools (complementary lecture notes and numerous exercises with solutions) were recently implemented on a Moodle platform. The French and English FMCI will be tested in several French university classrooms this autumn and winter. Following this, the results will have to be processed.


**Table 3.** Concepts revisited for the French FMCI test (version VF1-2019).

The FMCI will certainly be revisited after expertise and results processing, as well as the collection of instructor and student feedback. Several versions could emerge due to the numerous concepts in fluid mechanics; they will have to fit the level (undergraduate or graduate) and the scientific engineering field (mechanical, civil, chemical engineering, hydrodynamics, aerodynamics). Currently, no question concerns open-channel flows, supersonic flows, instabilities, or turbulence. Only one question refers to pipe flows.

#### **6. Work in Progress in Learning and Teaching Fluid Mechanics**

A personal objective of the author, in collaboration with a young colleague, is to split the FMCI and provide several new versions of the FMCI—an ambitious project. For undergraduates, the versions would concern statics and ideal flows, then viscous flows, last compressible flows, and aerodynamics. For graduates, the versions would address turbulence, multiphase flows (according to textbooks like that of Clayton Crowe from Washington State University), and last numerical methods in fluids. In our Faculty of Physics and Engineering, for the 2019/2020 autumn/winter semester, undergraduate students will be FMCI-tested twice, at the beginning and at the end of the fluid mechanics course. Furthermore, a specific multiple-choice question test of 15 questions on statics and ideal fluid flow will be created for formative assessment. At the same time, MCQs will be created for our Master's students concerning numerical methods in fluid flow (CFD—Computation Fluid Dynamics). Last, students will be required to anonymously complete a teaching evaluation form, specific to the course, in addition to the standard assessment proposed by the faculty. These measures will hopefully help our professional development.

As a potential tutor of the young colleague for the coming year, the author has the will to implement a student-centered teaching, also referred to as learner-centered teaching. The idea is to take inspiration from flipped classrooms, as well as active and cooperative learning strategies. To reinforce these beliefs, a summary of more general own opinions and presently explored topics related to the recent literature is given here. It concerns education sciences applied to engineering and fluid mechanics, and more generally to science, technology, engineering, and mathematics (STEM).

In college learning, the replacement of true experiments by virtual experiments and numerical simulations was certainly a wrong choice for many university engineering science programs. True experimental work based on the use of experimental equipment, and measurement techniques are an invaluable step to really understand the physics and mechanisms of causal processes and predict phenomena. Establishing cause and effect relations is a key principle in a scientific approach. In fluid mechanics, experimental investigations have always fostered theoretical studies, modelling and more recently complex numerical simulations. Relevant examples are experiments conducted in the space station science NASA programs in microgravity on microfluidics, Maragoni effects among others. Unfortunately, experimental equipment and maintenance are expensive, much more than a computer room and software dedicated to numerical simulations, and must also be equipped with computers for data processing.

New assessment tools, skill assessments, and concept inventories certainly have to be reviewed and optimized. Thus, the use of student interviews can help the development of so-called FASI-type teaching instruments (FASI—Formative Assessment of Instruction) and to measure student learning, expert-like thinking, and the effectiveness of instruction [58], rather than only employing a summative assessment of student learning. It is also necessary to understand what we are assessing, by using newly developed tools such as concept inventories, three-dimensional learning (3DL), and 3DLAPs (3D learning assessment protocols) [58,59].

Even the physics of ideal fluids has revealed misconceptions, and difficulties encountered by students in classical hydrodynamics (Bernoulli's equation) have been reported in detail [57]. This paper corroborates several misconceptions on pressure and velocity in ideal fluids and naive interpretations of Bernoulli's equation, and includes a valuable (though incomplete) bibliography.

In fluid mechanics, literature on teaching, formative assessment, remedial instruction, and tools are expanding much more than excepted. It has been reported that concepts from pressure and fluid statics [57,60–65], to Archimedes' principle [66], to Bernoulli's law often lead to misunderstandings [67–72]. To combat such misconceptions, various studies have developed approaches such as CFD instrumentation, e-learning, experimental hands-on implementation, interview analyses, student engagement, and interactive learning techniques, among others [73–80]. New instructional methods have been developed in the past 10 years based on active pedagogy [81], problem-based approaches [82], real-world problems, and flipping classes [83–86]. Societal changes and students' needs and demands request both a richer and more efficient learning environment, necessitating adjustments in teaching. In France, serious research on educational sciences, related to learning and teaching in Universities, started late after 2008, in the field of fluid mechanics and more generally in mechanics.

Educational research and physics education research (PER) must offer guidance on how students should think and learn, and on how we can develop true assessments and coherent curricula in physics and fluid mechanics in order to promote the emergence of innovative teaching techniques and to incite interest in science from audiences of all ages (from childhood to higher education). Several handbooks have been published recently on science learning and teaching research [87–90]; on evidence-based e-learning design [91]; on cognition and metacognition in science, technology, engineering, and mathematics (STEM) [89]; and on hands-on methods to improve education at the elementary, secondary, and collegiate levels [91]. There is no doubt that promoting science interest in primary and secondary education will give the necessary impetus to enhancing student contribution and participatory learning. Science laboratory exercises are fundamental. Over the past 20 years, collaborative, cooperative, peer-instruction/learning/teaching, problem-based, project-based learning and teaching have been promoted. These concepts can be seen as extensions of hands-on and inquiry-based activities, aligning well with other teaching methods such as ICT (Information and Communication Technology)-supporting approaches. Moreover, self-, peer-, and group-assessments are being explored to enhance the quality of teaching and learning in higher education. Fluid mechanics, a rather complex science that is necessarily connected to other engineering fields such as thermal science and chemical and computer engineering, is perfectly suited to reinvigorate and foster students' curiosity and knowledge if such methods are further developed.

#### **7. Conclusions**

Personal investment in teaching fluid mechanics over 40 years in France has brought satisfaction in different areas. In mechanical engineering, undergraduate and graduate activities have been performed, with enthusiasm, prior to and following the Bologna Process (a reform which sometimes altered the traditional way of teaching and learning) combined with changes in the everyday social life of students. At the same time, more recently, during a period of more than 10 years, a hands-on approach to education was implemented with success for undergraduates wishing to become schoolteachers. The opportunity of learning and teaching this specific method to a younger generation—and the desire to transfer experimental sciences in pupils' classrooms—greatly contributed to the knowledge acquisition of educational sciences and changing teaching methodologies. This also contributed to a desire to develop and implement recently developed tools, derived from the Fluid Mechanics Concept Inventory, which hopefully will help to remove students' misconceptions and misunderstanding of the key concepts in fluid mechanics in some French universities. For the coming years, the challenge will be to apply innovative teaching methods to fluid mechanics, based on a learner-centered teaching approach, in order to foster students' motivation to learn about fluid engineering at Strasbourg University. Furthermore, the proposed teaching evaluations will also hopefully foster the professional development of university teaching staff.

**Funding:** This research received no external funding.

**Acknowledgments:** The author expresses his thanks to John Mitchell at the University of Wisconsin-Madison for allowing the use of FMCI in French higher education institutions. The present paper is dedicated to Henri Burnage (1935–2018), from Strasbourg University and to Emeritus Barry Bernstein (1930–2014), from the Illinois Institute of Technology.

**Conflicts of Interest:** The author declare no conflict of interest.

#### **References**


© 2019 by the author. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (http://creativecommons.org/licenses/by/4.0/).

## *Article* **Using Legitimation Code Theory to Conceptualize Learning Opportunities in Fluid Mechanics**

**Robert W. M. Pott 1,\* and Karin Wol**ff **<sup>2</sup>**


Received: 29 September 2019; Accepted: 3 December 2019; Published: 6 December 2019

**Abstract:** With widespread industry feedback on engineering graduates' lack of technical skills and research demonstrating that higher education does not effectively facilitate the development of open-ended problem-solving competencies, many educators are attempting to implement measures that address these concerns. In order to properly formulate sensible interventions that result in meaningful improvements in student outcomes, useful educational measurement and analysis approaches are needed. Legitimation Code Theory (LCT) has rapidly emerged as an effective, theoretically informed 'toolkit' offering a suite of dimensions through which to observe, analyze, interpret, and design teaching and learning practices. LCT Semantics has been used to help engineering educators unpack both levels of engineering knowledge abstraction and the complexity of engineering terms, while LCT Specialization focuses on knowledge practices (using the epistemic plane) and enables a visualization and differentiation between kinds of phenomena and the fixed versus open-ended methods with which to approach a particular phenomenon. Drawing on a range of initiatives to enable an improved practical grasp of fluid mechanics concepts, this paper presents a description and graphic LCT analysis of student learning that has been designed to anchor the 'purist' principles underpinning applied fluid mechanics concepts (such as in piping and pump network design) by way of concerted 'doctrinal' practices, and the exposure to more open-ended practical situations involving peer learning/group work, allowing educators to visualize the code clash between the curriculum and the world of work.

**Keywords:** fluid mechanics; Legitimation Code Theory; undergraduate teaching

#### **1. Introduction**

Science and engineering education battles with a number of disjunctures in purpose, epistemology, and implementation. Many courses (for instance, fluid mechanics) have a significant focus on theoretical 'content'—teaching the material with an approach often called scientific realism [1]. Others present and examine material in a way that is more applied (either practically or in calculation exercises linked to examples), but which can descend into 'cookbook exercises' of dubious educational benefit [2]. The approaches used are for the most part manifestations of educators attempting to 'face both ways' [3]: toward both the theoretical knowledge base and increasingly complex application contexts, requiring working practical or pragmatic knowledge. Thus, one sees more theory and more practice being introduced into an already full curriculum and occasionally a shift in one direction or the other, which is sometimes to the detriment of the students' epistemic access [4] or value in the workplace. Courses can no longer focus only on tools (for instance, manipulating the mathematics of Navier–Stokes equations or calculating pump efficiency); they also need to focus on problems (system design, application to poverty alleviation or unemployment, development of new technologies or application of old to new systems, and so forth) in socioeconomic contexts, as indicated by the holistic International Engineering

Alliance competency profiles [5]. Then, the tools would be used only to the limit of their relevance for analyzing such problems, and not for their own sake: tools are only as useful as the problems they can solve.

As these debates illustrate, knowledge-building practices are neither homogeneous nor royal roads to cumulative knowledge building [6]: stronger epistemic relations (i.e., a strong focus on disciplinary science knowledge) do not by themselves guarantee intellectual progress. Cumulative knowledge building requires both a diversity of ideas and a shared means of navigating among these—in other words, multiple repertoires and an expanding collective reservoir [7]. To have these tools to hand, as a rephrasing of 'practical reasoning' [8], is to have access to the tool that solves the problem, while also having a deep and conscious understanding of the scientific and epistemic underpinnings: the 'know why' that is essential for 21st century complexity [9].

The educational literature, and in-practice educators themselves, have examined and trialed a number of methodologies and approaches that may address (part(s) of) this concern, including approaches such as problem-based learning e.g., [10], project-based learning e.g., [11], or flipped classrooms e.g., [12]. Many of these show real improvements in student knowledge and skill development. However, one shortcoming in many of these studies is the chronocentricity inherent in their set-up and evaluation. The efficacy of the program is commonly assessed within the same subject/module period. Progressivist pedagogical initiatives may appear successful within the timeframe of the actual course, but perhaps the true measure of transformative epistemic access is its continued usefulness to students and the manifestation of successful epistemic access and integration. Very often this is only evident after graduation, or in later academic years. Few academics have the benefit of a (un)planned longitudinal view, but where it is found, this view can be insightful. A second shortcoming is that active learning approaches—while intuitively appropriate in professional education designed to bridge the theory–practice divide—have not necessarily been adequately problematized from the perspective of forms of knowledge and associated practices. That is to say, our tools for analyzing how and why these interventions work is often limited to a 'show and tell'—analytical tools would enhance this discussion.

The discussion below firstly draws on collaborative work across the authors' department, its undergraduate program, academic staff access to initiatives, and their effects by way of observation, practice-sharing, and discussion, to give insight into gaps that persist in undergraduate skills and knowledge, even post 'educational initiatives', in a longer term view. Further, and most principally, the emerging field of Legitimation Code Theory (LCT) facilitates understanding of the nature and implications of these initiatives. LCT gives insight into what the connection between theory and practice is, as experienced by students and manifested throughout their undergraduate careers. LCT provides the tools for the investigation, analysis, and interpretation of 'knowledge practices' [13].

This paper aims to accomplish two objectives: it firstly draws on the experience and observation of interventions carried out in a second-year fluid mechanics module, as it plays out specifically in the final Capstone research project, to draw insight into fluid mechanics teaching more generally. Secondly, and potentially more usefully, the paper conceptualizes an extended approach to using LCT dimensions to visualize teaching strategies intended to facilitate improved learning outcomes, illustrated using examples from fluid mechanics, with the intent of giving educators an additional tool for analyzing their practices and curricula, and potentially bridging gaps between the curriculum and the world of work.

#### **2. Theoretical Framework in Context**

Legitimation Code Theory has emerged in the sociology of education as a powerful and illustrative 'toolkit' to analyze the organising principles of knowledge practices, their associated meaning-making systems, and the nature of knower dispositions [13]. For readers new to LCT, there are several excellent and accessible texts introducing these ideas, such as for instance [13–15]. The key to LCT is the idea of making visible *what* or *who* legitimates practices, and *how* they do so, so as to enable epistemic and social access to knowledge practices. Educators who understand the forms of and relationship between knowledge, knowing, and knowers are better equipped to address teaching, learning, and assessment challenges, particularly in increasingly diverse and complex 21st century educational contexts. In this paper, we suggest that LCT offers a practical set of tools through which engineering educators can interrogate forms of knowledge and knowing.

Over the past decade, as challenges in the recruitment, retention, and successful graduation of Science, Technology, Engineering and Mathematics (STEM) students became a global concern, education researchers began to use the LCT dimensions of Semantics and Specialization to interrogate existing practices. Hence, we find researchers looking at the gaps between school and the first-year biology curriculum [16], unpacking conceptual difficulties in physics teaching [17], interrogating difficult chemistry concepts [18], examining the link between theory and practice in fluid mechanics [19], and analyzing engineering problem solving [20]. Most of this initial research used the dimension of Semantics to differentiate between strengths of context-dependency (semantic gravity) and/or of complexity (semantic density). In the research site in question, the 'semantic wave'—common currency for theory–practice linking strategies that can lead to cumulative knowledge building [13]—has been used to conceptualize the *semantic range* between abstract, context-independent concepts and specific context-dependent examples. By explicitly unpacking the different levels in a particular disciplinary semantic range, a number of engineering educators have been able to structure their teaching across a particular course or sequence of courses in such a manner as to build a *semantic wave* intended to enable cumulative learning. Table 1 illustrates the use of Semantics in a number of engineering case studies:


**Table 1.** Modification of existing semantic range examples based on [21].

Although the semantic range in the given examples enables a view of particular higher-order concepts and general formulae, as we move down the range, the potential representations, models, and physical contexts actually begin to proliferate. In order to design a richer cumulative learning experience that addresses the need to encourage more open-ended problem solving, engineering educators in the research context have added a second LCT dimension to their repertoire, one that enables the simultaneous view of multiple possible contexts. The LCT Specialization dimension offers insights into forms of knowledge (epistemic relations) and kinds of knowers (social relations). Researchers in the Faculty have used the latter, for example, to analyze how engineering educators 'build' kinds of 'knowers' [22]—in other words, how the field interprets and applies the development of engineering expertise. For the purpose of this paper, we will now focus on the epistemic plane, which enables a view of the relationship between phenomena and their approaches—the so-called *what* and *how* of knowledge practices.

The epistemic plane (shown in Figure 1) differentiates between strengths of ontic relations (the identity of a phenomenon) and discursive relations (procedures for approaching a phenomenon). Represented as a Cartesian plane, the epistemic plane reveals four quadrants with which to differentiate between practices requiring different *insights* or knowledge-practice codes:


**Figure 1.** The epistemic plane, from [13], showing the four quadrants determined by relative strength of ontic and discursive relations. Reproduced with permission [13].

There is no right or wrong insight or quadrant. Each insight—as with problem-solving tools—is merely a means to an end. Recent industrial research using the epistemic plane has indicated that successful engineering practitioners navigate the plane in a nonlinear, iterative fashion drawing on different insights as the different contexts demand [23]. In other words, successful engineers practice 'code shifting' (the movement between the quadrants) [13], and the question is whether or not higher education is in fact facilitating adequate code-shifting practices during coursework, simulating what is needed in engineering practice.

#### **3. Research Context**

This discussion is situated within the experiences of a four-year chemical engineering degree program at a research-intensive traditional university in South Africa. The program is aligned to the International Engineering Alliance standards and accredited by the Engineering Council of South Africa, which is a signatory of the Washington accord. The fluid mechanics course is in the second year, second semester, and aims to instruct students in the fundamentals of fluid mechanics, for application in chemical engineering specifically. The course deals both with conceptual, abstract topics such as the Navier–Stokes equations, and how to manipulate and use them, as well as more practical calculations and topics, for example, pressure drop calculations, design and calculations around piping networks and pump sizing. While there are context and societally-specific aspects within this program, research conducted with these cohorts is likely to be broadly applicable to other global institutions and engineering programs.

The department in which this course is situated runs a number of educator development programs and initiatives, which are facilitated through the Faculty of Engineering. Several of the lecturers are active contributors to the educational literature, and a common sociological tool (in LCT) is shared as a language of analysis by these researchers. Further, as in most departments, a healthy vibrant discussion of educational practices, experiences, shortcomings, and effects is both apparent and encouraged. This continuing space for co-discussion has allowed for a more longitudinally oriented focus to educational initiatives—initiatives are put in place (for instance, in second-year fluid mechanics), but are not only evaluated in that course; these cohorts of students are followed until (and after) final year, and insights into their continued development can be garnered from these discussions.

Feedback from engineering-related industries suggests that graduates consistently have difficulties 'applying theory' [24] and adapting to technical workplace requirements (manpower.com, 2015). This supports the well-reported science–engineering disjuncture [25], which has led to such poor retention rates on engineering programs. Despite the holistic intention of the IEA engineering graduate competency profiles [5], the engineering curricula at research-intensive institutions are predominantly framed by the now 150-year-old science-based tradition [26]. In other words, the core curriculum is interpreted as requiring *purist insight*: well-known and established phenomena with standardized approaches. Large class sizes, a lack of adequate human and technical resources, and undergraduates not adequately prepared for the transition into tertiary levels of study have meant that traditional, assessment-driven pedagogies requiring doctrinal insight remain the status quo, with a great deal of work focusing on computational application.

Higher education practices limited to the right-hand side of the epistemic plane are in stark contrast to the insights that the industry demands of graduates, such as curiosity, agility, and collaboration [27]. These attributes are seldom explicitly taught or encouraged, particularly in the research context in question. The global endeavor to address Sustainable Development Goals requires engineers who are flexible and adaptable, and who are able to engage with stakeholders in multiple, complex sociotechnical contexts. Problem-solving or critical-thinking engineering professionals are those who are able to code shift: to draw on fundamental principles (*purist insight*) and apply standardized methodologies (*doctrinal insight*) in multiple contexts that require situational and knower insights.

In response to student feedback (including observations of student frustrations at being restricted to purist and doctrinal insights), a number of educators in the department have begun to include code-shifting strategies in their classrooms. A collaborative initiative to develop unit conversion and estimation competencies among first-year Chemical Engineering students has seen the establishment of an online question bank explicitly designed using the epistemic plane to encourage students to code-shift between what a unit represents (*purist insight*), how it is converted (*doctrinal insight*) and locally, contextualized estimation challenges (*situational* and *knower insights*) [28]. Another study with final-year students sought to introduce students to a range of contextual examples of core principles and procedures as applied in various mining and metallurgy industries [21]. The same authors went on to examine the third and fourth-year curriculum using the epistemic plane (Figure 2) and found the majority of courses foreground *purist* and *doctrinal insights* [29]. Here, we have amended their figure to include a plotting of fluid mechanics in comparison to other, later-year courses.

**Figure 2.** Modified from [29], plot of course content and approach on the epistemic plane for several third and fourth year chemical engineering courses, as well as second-year fluid mechanics. Reproduced with permission [29].

#### **4. Analysis of Fluids Mechanics Using the Epistemic Plane**

The major focus of this article is to introduce fluids educators, and engineering educators more generally, to the sociological tool of Legitimation Code Theory, through a demonstration of its usefulness in analysing course activities in fluid mechanics. Let us use an analogy here, for context: say you were to perform a catalysis experiment. In order to measure the extent of reaction, you would take samples and have these analyzed, perhaps on a gas chromatograph or using some other analysis method. What we propose here is that LCT is that analysis method—the tool by which we measure whether our experimentis working.

To achieve a demonstration of LCT's use as an analysis method, the fluid mechanics course will here be broken down into activities—lectures, tutorials, assessments, practicals, assignments, and discussion—and each of these will be analyzed using the lens of LCT, specifically the epistemic plane. A comparison against the transversal of the epistemic plane in industrial application will be presented as a foil to illustrate the gap between the course and its intended site of application.

#### *4.1. Lectures*

For the most part, lectures are dialectic discussions of high-level concepts that are occasionally brought down to the level of example or calculation. As such, they sit firmly in the *purist insight quadrant* (Figure 3)—the things being discussed are well defined and the methodology employed to solve the same are well defined and constrained. There may be occasional threads pulled from the situational insight quadrant (for instance, the lecturer may ask, "How could we decide on the pump requirements for a particular reactor configuration?"; the ontic relations are stronger, as in 'well defined' (the system), but the approach may be many-fold). There is generally little discussion that could be considered in the *Knower insight quadrant*—the type of person performing the calculations is not foregrounded.

**Figure 3.** Epistemic plane detailing ontic and discursive movement within fluid mechanics lectures.

Educators will recognize that attending lectures is not sufficient for excellent learning—perhaps stemming from the relatively stationary situation within the *purist insight quadrant* (although there is clearly more to it than presentation without context). Dale [30] espoused the use of multiple media and then solid application to lead to a solid knowledge base, and perhaps a similar argument could be made here. For this reason, it is common to follow lectures with a weekly tutorial.

#### *4.2. Tutorials*

Tutorials are a space in which students are given a number of problems and questions to work through, while the lecturer and student assistants (usually post-graduate students) roam the room to answer questions. From the students' perspective, this for the most part sits within the *doctrinal insight quadrant*—there is much "recognize and reproduce", with students seeking cues from previously done examples. However, with appropriate question setting, some motion toward the *purist insight quadrant* can be achieved. This occurs when the students do not simply recognize the 'shape' of the question and impose an algorithmic approach to problem solving, but rather recognize the underlying principles and their relevance to each question.

A recurring issue during undergraduate engineering education is students' adopting a superficial learning route to problem solving through 'pattern recognition' [31,32]. Students can hide behind recognizing the pattern of the algorithm, rather than grappling with (and therefore undergoing 'cumulative learning' [6]) fundamentals. Superficial learning methods can give rise to 'correct answers' but shallow understanding. Within the epistemic plane (Figure 4), this represents a narrow transversal between the *doctrinal* and *purist insight quadrants*. Then, what is perhaps needed is some motion toward the situational insights—where students are required to pull on the range of tools they have learned, select one, and apply it to a defined problem.

**Figure 4.** Epistemic plane detailing ontic and discursive movement within fluid mechanics tutorials.

#### *4.3. Practicals*

One method to pull students both toward a more situational insight as well as strengthen the semantic gravity of concepts (see [19]) is through the use of practicals. In an ideal situation, students would be presented with an open-ended task or experiment (*situational insight*), in which they would then need to employ the theory (*purist insight*) and calculation ability (*doctrinal insight*) to solve. Thus, they would be traversing a significant portion of the epistemic plane (depicted in Figure 5) and potentially improving their knowledge through the exercise. Further, if there is group work involved, then there may be some development of 'soft skills', which require *knower insight.*

**Figure 5.** Epistemic plane detailing ontic and discursive movement within fluid mechanics practicals under good conditions.

However, as is discussed in [19,33,34], practicals can often become much less active than envisioned in the above figure. Students frequently do little preparation for practicals (i.e., they do not perform the tour through the *purist insight* quadrant). They will frequently arrive and follow the practical experimental procedure with little or no understanding or insight. This is possible in many practicals due to large class numbers using limited equipment under significant time constraints. In this case, the experience of the students is either a *doctrinal insight* one (where calculations are performed almost by rote), or even devolving into *no insight*, where little learning is taking place, as illustrated in Figure 6.

**Figure 6.** Epistemic plane detailing ontic and discursive movement within fluid mechanics practicals under poor conditions.

An understanding of this shift from a useful exercise to a wasted effort could allow educators to put in place mechanisms stimulating the sorts of desirable activities that lead to real cumulative learning while discouraging the wasted effort of poor learning. For instance, putting in place a pre-practical test to determine whether a student has engaged with the theoretical content that would allow them to understand the practical they are about to do may prevent a weakly epistemically underpinned afternoon in the laboratory.

#### *4.4. Assignment*

An assignment is another area where an open-ended, significantly situational problem can be posed, allowing the students to spend time exploring the various possible routes to solutions (a *situational insight*), and once a methodology is arrived at, solving the problem using *purist* and *doctrinal insights*. An example of such an assignment could be to design a piping network and select an appropriate pump for a molasses plant (see the supplementary information for the full assignment). In this case, the problem is an open one, although it is partially bounded by the requirement for piping and pump selection. There are a number of approaches that students could take to solve this (fairly well-defined) problem (*situational insight*). In order to solve it well, they will need to pull on explicitly covered material (calculate frictional pressure losses, use pump characteristic curves to choose an appropriate pump), thus pulling them through *purist* and *doctrinal insight quadrants*, as they conceive of the correct approach and perform the appropriate calculations through a route such as that illustrated in Figure 7.

However, there are other concepts that they need to consider in the assignment that are not explicitly part of the fluids curriculum; these include questions such as, "Will the fluid corrode the piping material? Is there a seasonal variation in flow rates? Is the effect of temperature significant, and if it is, how do we mitigate against this? Is the pump I have chosen very expensive or not available?" These questions pull the student deeper into the *situational insight quadrant*, and as shall be discussed below, deeper into the realm of where real-life engineering problem solving often lies.

**Figure 7.** Epistemic plane detailing ontic and discursive movement within a fluid mechanics assignment.

At this point, the reader might be tempted to say that since a full tour of the epistemic plane has taken place through the sum of the course, then we might assume that cumulative learning has taken place. Of course, the answer is more complex than this, since students can successfully complete all required tasks and pass the course with comparatively little long-term learning having taken place (as evidenced in later years where students are unable to make reasonable judgments about pump and piping networks, for instance, in their final-year design module). However, it appears that through a more intentional pursuit of epistemic touring through course structure, student knowledge retention, interest, and focus is improved [19,28,29].

#### *4.5. Application in the World of Work*

Having examined some of the significant contact portions of a fluid mechanics course, how does this compare with the real-world application of fluid mechanics in, for instance, a design house? A significant portion of what employers consider important requires *knower insight*: teamwork, communication, ethics, and other 'soft skills'. The problems presented to working engineers are firmly within the situational insight quadrant; questions such as, "We have wastewater that needs treating; what should we do?" Clearly, there are multiple routes to a solution here, even though the problem in question is a specific one. In order to solve it, design engineers pull on detailed knowledge of specific methodologies, and test their applicability and suitability (*purist insight*). These separate portions of the job are bridged in technical communication, and product design specifically focused on the customers' requirements.

It is clear from Figure 8 that a significant portion of what is needed in industry is focused on the left-hand side of this plane, while teaching and learning in lectures and tutorials (the primary modes of learning) are almost entirely on the right. This code clash [13] may be one of the reasons for industry's (and recent graduates') complaints that graduates are not sufficiently prepared for the world of work [35,36]. However, it cannot be the case that educators address all of these concepts in every course. It is the role of the overall curriculum to ensure that sufficient opportunities are created across a program to allow for scaffolded code-shifting. Visualizing the existing dominant codes and clashes or mismatches is a necessary first step. It provides an opportunity for designing progressive pedagogies and interventions that bridge these gaps and improve the potential for substantive cumulative learning.

**Figure 8.** Epistemic plane detailing ontic and discursive movement within the world of work.

#### **5. Conclusions**

This paper has set out to illustrate the application of a theoretically informed approach to analyzing an engineering curriculum and pedagogic practices. Focusing on the student learning experience in fluid mechanics at a traditional research-intensive university, the Legitimation Code Theory dimension of Specialization (Epistemic Relations) has been used to demonstrate possible code-shifting strategies that can facilitate the cumulative knowledge building necessary for engineering graduates in complex 21st-century contexts. The analysis was driven by experiences in teaching fluid mechanics and follow-up discussions with colleagues and students regarding knowledge and skill retention beyond the course in question through the degree and post-graduation. The benefit of LCT beyond the course context is its illustrative power in allowing the conceptualization and graphing of educationally lived experience versus intended or needed experience. This may allow educators to consider a priori the potential effects and impact of proposed interventions in progressive pedagogy.

**Author Contributions:** The authors conceived of and wrote this article together. Conceptualization, R.W.M.P. and K.W.; Investigation, R.W.M.P. and K.W.; Methodology, K.W.; Writing—original draft, R.W.M.P. and K.W.; Writing—review and editing, R.W.M.P.

**Funding:** This research was funded by the Stellenbosch University Fund for Innovation and Research into Learning and Teaching.

**Acknowledgments:** The authors would like to thank Goosen for his significant contribution to fluids education and conceptualization at Stellenbosch.

**Conflicts of Interest:** The authors declare no conflicts of interest.

#### **References**


© 2019 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (http://creativecommons.org/licenses/by/4.0/).

## *Article* **Computing E**ff**ective Permeability of Porous Media with FEM and Micro-CT: An Educational Approach**

#### **Rafael S. Vianna 1,2,\*, Alexsander M. Cunha 1, Rodrigo B. V. Azeredo 3, Ricardo Leiderman <sup>2</sup> and Andre Pereira 2,\***


Received: 21 December 2019; Accepted: 20 January 2020; Published: 24 January 2020

**Abstract:** Permeability is a parameter that measures the resistance that fluid faces when flowing through a porous medium. Usually, this parameter is determined in routine laboratory tests by applying Darcy's law. Those tests can be complex and time-demanding, and they do not offer a deep understanding of the material internal microstructure. Currently, with the development of new computational technologies, it is possible to simulate fluid flow experiments in computational labs. Determining permeability with this strategy implies solving a homogenization problem, where the determination of the macro parameter relies on the simulation of a fluid flowing through channels created by connected pores present in the material's internal microstructure. This is a powerful example of the application of fluid mechanics to solve important industrial problems (e.g., material characterization), in which the students can learn basic concepts of fluid flow while practicing the implementation of computer simulations. In addition, it gives the students a concrete opportunity to work with a problem that associates two different scales. In this work, we present an educational code to compute absolute permeability of heterogeneous materials. The program simulates a Stokes flow in the porous media modeled with periodic boundary conditions using finite elements. Lastly, the permeability of a real sample of sandstone, modeled by microcomputed tomography (micro-CT), is obtained.

**Keywords:** fluid mechanics; permeability; finite element method; homogenization; microstructure; micro-CT

#### **1. Introduction**

Permeability is an important macro parameter usually used to characterize porous media. This parameter is a measure of the resistance that fluid faces when flowing through a porous medium. Therefore, this parameter plays an essential role in a great variety of fields, such as soil mechanics, oil prospection, petrophysics, material characterization, etc. The permeability is usually determined in routine laboratory tests by simply applying Darcy's law. However, laboratory tests can be complex, expensive, time-demanding, and sometimes destructive, and they do not offer a deep understanding of the internal microstructure of the material.

Computer simulations are increasingly applied as an alternative to laboratory tests due to their capability to overcome many difficulties presented in physical testing. Some of the advantages of numerical simulations are their non-destructive characteristic, low cost, ease of performing repeatable analyses, and possibility to perform analyses that cannot (or are very difficult to) be performed in experimental tests. In addition, it is also possible to run simulations on both synthetic and realistic models. Although synthetic models are simpler to be generated, they may introduce inaccuracies in the simulation due to the fact that they are an approximation of reality. Therefore, more accurate results are expected to be obtained with realistic models, which may be generated by means of imaging technologies on several scales (e.g., microcomputed tomography (micro-CT)). Considering those advantages, computational simulations based on numerical methods are an attractive alternative to assess the permeability of porous materials, since this methodology can consider the material internal structure through realistic virtual models.

The work of Andreassen and Andreasen [1], Aarnes et al. [2], Sheng and Zhi [3], Akanji and Mattha [4], and Yang et al. [5] are some examples that illustrate the use of the finite element method (FEM), finite volume method, and lattice Boltzmann method to determine permeability through computational homogenization.

The development of computational codes to determine permeability of porous materials has several peculiarities. Finding documents in the literature that address the subtlety in programming this problem is not an easy task. In addition, most of the codes found in the literature have in common the fact that they usually focus on computational efficiency. This often leads to a lack of important steps for the understanding of the reader, who possibly does not have extensive experience with all the subjects involved in the process of permeability determination. Although the work of Andreassen and Andreasen [1] may be partially included in this context, it presents one of the most relevant educational descriptions of the problem. They described a compact educational program, which adopts a set of interesting strategies, developed in MatLab. For these reasons, the work of Andreassen and Andreasen [1] was used as a starting point and basic reference for the developments described in our paper.

The main objective of this paper is to present the step-by-step development and implementation of an educational program to determine the effective absolute permeability of porous materials based on the concepts of numerical homogenization. The program aims to determine the mean velocity field value in a single-phase fluid flowing through the connected pores of a given material. This flow is assumed to be governed by the Stokes equation, which is solved with FEM. The program also covers the implementation of periodic boundary conditions, in which the basic assumption is that the numerical model is a representative volume of a non-contoured (statistically homogeneous) medium. By didactic choice, the program was developed for two-dimensional (2D) cases, facilitating the understanding of students, but the extension for three-dimensional (3D) cases is almost straightforward. After program validation, the permeability of a real sandstone sample, modeled by microcomputed tomography, is performed. This paper is suggested as a use case in lectures and trainings for senior undergraduate and graduate students. Since it covers the application of fluid mechanics, numerical methods, and multiscale problems from both theoretical and practical perspectives, it can be a powerful tool when teaching subjects such as fluid dynamics, finite elements, petrophysics, and other classes.

#### **2. E**ff**ective Permeability through Numerical Homogenization**

The determination of permeability through material microstructure analysis is a multiscale problem. The determination of this macro parameter depends on the determination of the velocity field, which is a function of the material's microstructure. This means that, to solve the permeability problem of a medium, it is necessary to solve the governing equations of the microscale. The connection between micro and macroscales must be done through homogenization techniques.

Computational homogenization techniques seek to determine relationships between the micro and the macrostructure of the material, which consist of the determination of the effective properties of representative elementary volumes (REV) by considering characteristics and properties of microscopic elements. For determining the effective permeability of a porous medium, a known pressure gradient or body force is applied to the material REV. Under this condition, a velocity field is induced in the

domain. The homogenized effective property of the material **¯ K** is defined as the relationship between the applied pressure gradient ∇*p*<sup>Ω</sup> or body force vector **b**Ω, the fluid viscosity μ, and the average velocities **u**<sup>Ω</sup> at the macroscale, known as Darcy's law (Ω denotes representative volume).

$$
\langle \mathbf{u} \rangle\_{\Omega} = \frac{1}{\mu} \overline{\mathbf{K}} (\langle \nabla p \rangle\_{\Omega} - \langle \mathbf{b} \rangle\_{\Omega}),
\tag{1}
$$

where **u**<sup>Ω</sup> = {*u*1, *u*2} *T* Ω is the average velocity vector resulted from the microscopic scale, i.e.,

$$
\langle \mathbf{u} \rangle\_{\Omega} = \frac{1}{\Omega} \int\_{\Omega} \mathbf{u} \, d\Omega. \tag{2}
$$

Darcy's law, given by Equation (1), states that the total velocity (units of displacement by time, e.g., m/s) is equal to the product of the medium permeability (m2), the pressure gradient (unit of pressure per length, e.g., Pa/m), and the inverse of the fluid viscosity (Pa·s).

Considering a two-dimensional problem, the matrix **¯ K** is obtained by two analyses, in which either a unit pressure gradient or a unit body force per direction is applied. The mean velocity vector determined in each analysis is equivalent to that column of matrix

**¯ K** related to the respective direction of the pressure gradient (or body force) applied in each case. To determine the velocity field in the problem domain, the governing equations of the problem must be solved through numerical methods, as described in the next section.

#### **3. Computational Fluid Dynamics with Finite Element Method (FEM)**

The continuity equation and the Navier-Stokes equation are the equations that govern the fluid flow problem for most cases of transport in porous medias. As the scale of the problem to be modeled reduces (e.g., nano scales), it is important to be aware that some effects may emerge in the system (e.g., capillarity, chemical interaction). However, this work focuses on viscous fluids at a scale of micrometers; therefore, it can be considered that there is no other effect than those that the Navier-Stokes equation is capable of contemplating. As this work aims to evaluate low-speed incompressible viscous flows only, the convective effects may be neglected (due to low Reynold's number) and, therefore, the Navier-Stokes equation is reduced to the Stokes equation. Although this simplifies the problem, for the great majority of practical applications, these differential equations that govern the problem still have no analytical solution; thus, numerical methods such as the finite element method (FEM) are employed as an essential tool to obtain reliable and approximate solutions.

The FEM proposes to approximate the problem solution by a finite set of elements connected by a finite number of points (commonly called nodes). The collection of finite elements that represents the continuous space is commonly called the discretized domain. Unlike the continuous domain, in the discretized domain, the variables are calculated only in the nodes of the finite elements. The continuous domain of the problem is represented by interpolation functions, called shape functions, which interpolate the calculated variables at the element nodes.

One of the FEM basic requirements is to transform the differential form (strong form) of the governing equations of the problem into integral equations (weak form). This process can be done by applying the weighted residual method, which allows the exact solution of the problem to be approximated by one with null residuals if integrated in the domain of interest. Therefore, the boundary value problem of the continuous medium can be solved by the mean values of a defined range.

The governing equations of the incompressible Stokes flow problem arise from conservation of linear momentum and conservation of mass, which are expressed, in a closed domain Ω, by Equations (3) and (4), respectively.

$$-\mu \nabla^2 \mathbf{u} + \nabla p = \mathbf{b},\tag{3}$$

$$
\nabla \cdot \mathbf{u} = 0,\tag{4}
$$

where μ is the viscosity, **u** = {*u*1, *u*2} *<sup>T</sup>* is the velocity vector, *<sup>p</sup>* represents the pressure, and **<sup>b</sup>** <sup>=</sup> {*b*1, *<sup>b</sup>*2} *T* represents the body force. Note that Equation (4) represents the mass continuity equation simplified to incompressible flows, i.e., the density is assumed to be constant (independent of space and time) and the conservation of mass is simplified to the equation of conservation of volume. That assumption is possible because the permeability of porous media is mostly determined in steady-state flow, in which the compressibility effect can be ignored (Akanji and Mattha [4]).

The solution of a Stokes flow problem requires the specification of boundary conditions in addition to Equations (3) and (4). As mentioned before, there are basically two ways to compute the average velocity field in order to determine the permeability. It is either by applying a known pressure gradient as boundary conditions or by simply applying known body forces in the domain. The latter approach was chosen because applying domain quantities (such as body forces) instead of applying boundary conditions is the simplest and the most natural choice when using a domain-based discretization procedure such as the FEM to compute the velocity fields.

By applying the weighted residual method, the governing equations are multiplied by continuous and differentiable weight functions ψ. The sum of residues generated by the approximation is considered null within a defined range, resulting in

$$
\int\_{\Omega} \Psi^T \left( -\mu \nabla^2 \mathbf{u} + \nabla p - \mathbf{b} \right) d\Omega = 0,\tag{5}
$$

$$
\int\_{\Omega} \psi(\nabla \cdot \mathbf{u}) \, d\Omega = 0. \tag{6}
$$

Using the divergence theorem in the first term of the integral in Equation (5) in combination with the compact support of ψ, i.e., the vanishing boundary integrals, yields

$$\int\_{\Omega} \mu (\nabla \boldsymbol{\Psi} : \nabla \mathbf{u}) d\Omega - \int\_{\Omega} \nabla \boldsymbol{\Psi}^T p \, d\Omega - \int\_{\Omega} \boldsymbol{\Psi}^T \mathbf{b} \, d\Omega = 0. \tag{7}$$

Different weight functions can be used in the weighted residual method. One of the most common strategies is to assign to the weight functions the interpolation functions of the nodal values, i.e., the shape functions. This method is known as the Galerkin method. The matrix of shape functions is called **N**. In classical formulations of the FEM, there arises a matrix whose elements contain derivatives of the shape functions, known as the **B** matrix. These matrices establish the following relationships:

$$\mathbf{u = N^{\mu}u},\tag{8}$$

$$\mathbf{p} = \mathbf{N}^p \mathbf{\bar{p}}.\tag{9}$$

$$\mathbf{B} = \mathbf{L}\mathbf{N},\tag{10}$$

where the values **¯ <sup>u</sup>** and **¯ p** represent the nodal values of **u** and *p*, respectively, and **L** is the matrix of the differential operators.

According to Reddy [4], in order to make an analogy with the virtual powers principle, the weight function vector ψ presented in Equation (5) can be understood as virtual velocities taken by **u**; therefore, <sup>ψ</sup> <sup>=</sup> **<sup>N</sup>***<sup>u</sup>* **¯** ψ *u* . The weight function ψ presented in Equation (6) is associated with the volume change of the fluid element; thus, it should be understood as a virtual hydrostatic pressure that causes this volume variation. That way, we define <sup>ψ</sup> <sup>=</sup> **<sup>N</sup>***<sup>p</sup>* **¯** ψ *p* .

Applying Equations (8)–(10) and the chosen weight functions to Equations (6) and (7), the weak form of the governing equations can be represented as functions of matrices **B** and **N**. Equations (7) and (6) should be respectively rewritten, in the element domain, as follows:

$$\left(\dot{\boldsymbol{\Psi}}^{u}\right)^{T}\left(\int\_{\Omega} (\mathbf{B}^{u})^{T}\mu \mathbf{B}^{u} d\Omega \,\dot{\mathbf{u}} - \int\_{\Omega} (\mathbf{B}^{u})^{T}\mathbf{N}^{p} d\Omega \,\dot{\mathbf{P}} - \int\_{\Omega} (\mathbf{N}^{u})^{T}\mathbf{b} \,d\Omega\right) = 0,\tag{11}$$

$$\left(\stackrel{\!\!\! }{\Psi}^{p}\right)^{T}\int\_{\Omega}(\mathbf{N}^{p})^{T}\mathbf{B}^{\mu}d\Omega\stackrel{\!\!\!\/}{\mathbf{u}}=0.\tag{12}$$

As the nodal weight values are arbitrary, the terms in the parentheses of Equations (11) and (12) should vanish, resulting in

$$\int\_{\Omega} \left(\mathbf{B}^{u}\right)^{T} \mu \mathbf{B}^{u} d\Omega \,\mathbf{\bar{u}} - \int\_{\Omega} \left(\mathbf{B}^{u}\right)^{T} \mathbf{N}^{p} d\Omega \,\mathbf{\bar{p}} = \int\_{\Omega} \left(\mathbf{N}^{u}\right)^{T} \mathbf{b} \,d\Omega,\tag{13}$$

$$\int\_{\Omega} (\mathbf{N}^p)^T \mathbf{B}^\mu \, d\Omega \, \bar{\mathbf{u}} = 0. \tag{14}$$

The terms on the right-hand side of the conservation of momentum equations are the result of the effect of the body forces in each element, called **f**.

Finally, solving the partial differential Equations (3) and (4) with the application of FEM is simplified to solve the following system of linear algebraic equations:

$$
\begin{bmatrix}
\mathbf{K} & \mathbf{G} \\
\mathbf{D} & 0
\end{bmatrix}
\begin{Bmatrix}
\mathbf{\bar{u}} \\
\mathbf{\bar{p}}
\end{Bmatrix} = \begin{Bmatrix}
\mathbf{f} \\
0
\end{Bmatrix},
\tag{15}
$$

where **K** is the viscosity matrix,

$$\mathbf{K} = \int\_{\Omega} \left(\mathbf{B}^{u}\right)^{T} \mu \mathbf{B}^{u} \, d\Omega\_{\prime} \tag{16}$$

**G** is the gradient matrix,

$$\mathbf{G} = -\int\_{\Omega} (\mathbf{B}^u)^T \mathbf{N}^p \, d\Omega,\tag{17}$$

and **D** is the velocity divergent matrix and is equal to the transpose of **G** matrix,

$$\mathbf{D} = -\int\_{\Omega} (\mathbf{N}^p)^T \mathbf{B}^u \, d\Omega. \tag{18}$$

The above model is known as mixed formulation. By mixed formulation, it explains that both pressure and velocity are unknown variables. Considering that, usually, fluid dynamic problems have boundary conditions in terms of both velocity and pressure, it becomes the most intuitive formulation to be used. However, the coupling of velocity and pressure variables brings new difficulties to the resolution of the system of algebraic equations.

According to Reddy [6], one way to interpret the coupling between velocity and pressure is to understand the continuity equation as a constraint of incompressibility to momentum conservation equations. Due to the fact that the incompressibility constraint does not depend on pressure variables, constructing a finite element model becomes complicated. The direct solution of the system cannot be performed since the coefficient matrix that multiplies the variable vector has a sub-matrix with a diagonal of null coefficients, which makes the coefficient matrix singular and non-inversible. Thus, it is necessary to use other strategies to solve the equation system.

Another common difficulty of mixed formulation is the choice of shape functions. The relationship between the second derivative of the velocity field and the first derivative of the pressure field stated in the Stokes equation shows that the velocity field must have a greater degree than the pressure field. The use of equal-order approximation functions for both pressure and velocity fields generates instability. This instability can be explained by the solvability analysis of the equation system. The solvability of a linear system is explained by several authors as the guarantee of the inf-sup condition, also known as the LBB condition, thanks to the works of Ladyzhenskaya [7], Babuska [8], and Brezzi [9]. According to

Elman et al., the inf-sup condition is a sufficient condition for the unique solvability of linear systems of equations in the form of Equation (15). Satisfying the inf-sup condition for Equation (15) will guarantee a unique pressure in a closed domain flow.

The use of approximation functions of the same order does not guarantee the inf-sup condition. Therefore, it does not ensure a unique solution for the problem, and the generated results may be non-reliable Hence, finding a system with unique solution requires the use of other methods to approximate the velocity and pressure fields.

Other approximation methods that are recommended for mixed formulation are found in the literature. Elman et al. [10] and Bathe [11] cited the following approximations as satisfactory for the inf-sup condition: Q2-Q1 approximation (bi-quadratic approximation for velocity and bi-linear approximation for pressure), also known as the Taylor-Hood method, Q2-P1 approximation (bi-quadratic approximation for velocity and linear approximation for pressure in each element without guaranteeing continuity), and Q2-P0 approximation (bi-quadratic approximation for velocity and constant for pressure in each element).

However, using same-order shape functions to interpolate pressure and velocity fields has several advantages from a computational perspective. In order to use same-order shape functions for velocity and pressure fields, and to eliminate instability, stabilization techniques can be adopted. Stabilization techniques have the basic idea of relaxing the restriction of incompressibility, ensuring the inf-sup condition. Many authors proposed different methodologies that proved to be very efficient in stabilizing different approximation models.

One of the simplest discretization methodologies is the use of bi-linear form functions for the velocity and pressure domains. This type of approximation is known as Q1-Q1 approximation. The Q1-Q1 approximation, in addition to being easy to implement, produces lower computational cost for solving the system of equations. For this reason, many authors seek to use stabilization techniques to make use of this type of discretization. As an example, we can cite the works of Andreassen and Andreasen [1], Yang et al. [5], Karim et al. [12], Braack and Schieweck [13], Codina and Blasco [14], and Becker and Hansbo [15].

To construct a stable computational model of Q1-Q1 discretization, this work follows the same stabilization adopted by Andreassen and Andreasen [1]. According to Andreassen and Andreasen [1], the stabilization of the Q1-Q1 model can be obtained by adding a new term with a stabilization coefficient in the continuity equation. The weak form of the continuity equation with the stabilization term is defined by

$$\int\_{\Omega} \left(\mathbf{N}^p\right)^T \mathbf{B}^\mu d\Omega \mathbf{\hat{u}} - \int\_{\Omega} \tau (\mathbf{N}^p)^T \mathbf{N}^p d\Omega \mathbf{\hat{p}} = 0,\tag{19}$$

where τ is the pressure stabilization parameter, defined as τ = *h*2/12 for quadrilateral elements, where *h* is the size of the largest diagonal of the finite element.

The integral with the pressure stabilization term results in a matrix that must be added to the equation system of Equation (15), resulting in

$$
\begin{bmatrix}
\mathbf{K} & \mathbf{G} \\
\mathbf{G}^T & \mathbf{P}
\end{bmatrix}
\begin{pmatrix}
\mathbf{\bar{u}} \\
\mathbf{\bar{p}} \\
\mathbf{P}
\end{pmatrix} = \begin{Bmatrix}
\mathbf{f} \\
0 \\
\end{Bmatrix},
\tag{20}
$$

where **P** represents the pressure stabilization matrix.

$$\mathbf{P} = \int\_{\Omega} \pi (\mathbf{N}^p)^T \mathbf{N}^p \, d\Omega. \tag{21}$$

The introduction of the new term in the continuity equation causes the coefficient matrix to become positively defined. It allows the system to be solved in the direct form.

#### **4. Implementation of Boundary Conditions**

As the volume to be analyzed increases, the property measured for that volume approaches the material's effective property. When the increasing analyzed volume reaches the effective property of the material, the volume can be considered representative. Using periodic boundary conditions, the convergence of the volume's effective properties to the REV's effective properties happens much faster (with smaller volumes). This type of boundary condition simulates the volume of interest within a periodic region, which means that the volume of interest repeats in all directions, as shown in Figure 1. Thus, it is possible to obtain homogeneous and periodic results by modeling smaller volumes, thereby reducing computational effort. The computational implementation of periodic boundary conditions can be performed by assigning the same degrees of freedom to correspondent nodes at the opposite boundaries. As a consequence, the opposite boundaries will have the same behavior, i.e., the velocities and pressure values will be the same at the opposite boundary nodes, enforcing that the volume of interest is indeed a periodic medium.

**Figure 1.** Representation of a periodic medium in an image representing the medium's representative elementary volume (REV).

The simulation of flows in a porous medium poses challenges to the problem modeling. The porous media modeling performed in this work is based on fluid modeling only. Ignoring solid elements represented in the image requires imposing the following condition to the solid-fluid interface: the degrees of freedom in the solid-fluid node interface relative to the velocity components are null.

#### **5. Octave**/**Matlab Implementation**

The code proposed in this paper is designed to receive as input an image (in special micro-CT images) of the problem to be modeled. It means that a pixel-based finite element mesh would be a natural choice of modeling strategy. In this approach, each pixel corresponds to a bi-linear finite element. The benefit of this strategy is that it results in a structured regular mesh (all the elements are squares of the same size) and, therefore, in an extremely low computational cost to generate the mesh. Taking full advantage of the fact that all elements in the mesh are of the same size, we compute the element matrices only once, working solely in the "element domain".

It is important to mention that obtaining accurate values of permeability of real samples through computational simulations relies on contemplating the narrowest constrictions in the porous medium. Covering the material's fine-scale features requires, firstly, images with high resolutions. The resolution

has to be high enough to give good representation of the features in the image. On the other hand, the accuracy of the simulation also relies on modeling the image's fine features appropriately. It means that narrowest constrictions such as pore throats and cavities represented by few pixels must be modeled with a finer mesh. Therefore, convergence tests are necessary to compute permeability, taking into account the influence of image's fine-scale features.

The code described in this section is published in Zenodo, an open-source repository. The complete code is available at the following URL: https://doi.org/10.5281/zenodo.3612168.

#### *5.1. Input and Initialization*

The developed program performs simulation of Stokes flow in binary images. As initial data, the user should enter a binary image (line 03 of the code) representing the REV (as in Figure 1) and the dimensions (lines 11 and 12 of the code) of that image (model) (see Listing 1).


The MatLab function "repelem" (code line 06) is used to refine the mesh by a factor n, dividing each image pixel in a group of n × n square finite elements. This is an important procedure to perform convergence tests.

Note that, in the initialization step, the matrix image is transformed into a vector that indicates the nature of each element in the mesh (whether it is solid or fluid).

It is convenient that input data (lines 01 to 13) be stored in their own file, thus decoupling the main program (which calculates the permeability) from the data inputs (model: image and dimensions). This way, we can save the data of several different problems. Therefore, the main program is defined in its own function, which is presented from line 14 of the code.

To determine permeability, we call the function "compute\_permeability", which takes as parameters the dimensions of the model and the information of each element whether it is solid or fluid (Listing 2):


It is also necessary to create a matrix containing the element connectivity, which indicates the nodal incidences of each finite element. The connectivity matrix is assembled so that the image is inserted in a periodic medium. For achieving that, the nodes of the opposite edges are numbered the same. Figure 2 illustrates how the image nodes are numbered using periodic boundary conditions.

**Figure 2.** Steps for numbering mesh nodes considering periodic boundary conditions: (**a**) firstly, we number nodes except for those on the bottom and right edges; (**b**) next, we copy the node numbers from the top edge to the bottom edge; (**c**) finally, we copy the node numbers from the left edge to the right edge.

To implement this strategy of mesh node numbering (see lines 21 to 24) and generation of a connectivity matrix (see lines 25 to 29), which considers periodic boundary conditions, Listing 3 is used.


#### *5.2. Coeficient Matrix and RHS Contribution of Each Element*

Since the program proposes performing simulations from images, and the mesh generation uses a pixel-based method, all elements are equal; thus, the viscosity, gradient, and pressure stabilization matrices can be calculated only once. This considerably reduces the simulation time. These matrices are incorporated into the main program using Listing 4.


#### The calculation of the matrices can be done using Listing 5.


The previous code, although presented in a didactic way, does not make explicitly state the required elements for the calculation of each matrix independently. However, since the shape functions used to interpolate the velocity and pressure fields are the same, the vector **f** and the matrices **k**, **g**, and **pe** can be calculated within the same function, making the algorithm more compact and elegant.

#### *5.3. Assembly of the Linear Algebraic System*

The coefficient matrix is assembled in such a way that the contribution of the degrees of freedom of each element is allocated to the corresponding degrees of freedom of the image mesh. The mapping of the elements' degrees of freedom is done using a vector that indicates the indices of the coefficient matrix, where the terms of the matrices **K**, **G**, **GT**, and **P** are allocated to each element. An intuitive and didactic way to do this assembly is using Listing 6.

```
Listing 6. Didactic implementation of assembly in the FEM.
    %% Assembling the system of linear algebraic equations with loops
    v_elemF = find(~z); % vector with fluid region elements only
    for elem = 1:size(v_elemF,1)
    e= v_elemF(elem);
    v_dofF = [m_ConnectPBC(e,1)*2-1; m_ConnectPBC(e,1)*2;
           m_ConnectPBC(e,2)*2-1; m_ConnectPBC(e,2)*2;
           m_ConnectPBC(e,3)*2-1; m_ConnectPBC(e,3)*2;
           m_ConnectPBC(e,4)*2-1; m_ConnectPBC(e,4)*2;
           2*nel+m_ConnectPBC(e,1);
           2*nel+m_ConnectPBC(e,2);
           2*nel+m_ConnectPBC(e,3);
           2*nel+m_ConnectPBC(e,4)];
    % dof 1, 2 (velocities) of each node and dof 3 (pressure) of each node
    for i=1:8
      for j=1:8 % allocates viscosity matrix
      A(v_dofF(i), v_dofF(j)) = A(v_dofF(i), v_dofF(j)) + ke(i,j);
      end
      for j=1:4 % allocates gradient matrix
       A(v_dofF(i), v_dofF(8+j)) = A(v_dofF(i), v_dofF(8+j)) + ge(i,j);
      end
    end
    for i=1:4 % allocates right-hand side matrix
       F(v_dofF(i*2-1),1) = F(v_dofF(i*2-1),1) + f(i);
       F(v_dofF(i*2),2) = F(v_dofF(i*2),2) + f(i);
      for j=1:4 % allocates pressure matrix
      A(v_dofF(8+i),v_dofF(8+j)) = A(v_dofF(8+i),v_dofF(8+j)) - pe(i,j);
       end
    end
    end
    G = A(1:nel*2,nel*2+1:nel *3);
    A(nel*2+1:nel*3,1:nel*2) = G';
```
However, despite being a more intuitive form, the use of multiple loops causes a significant increase in processing time. A more elegant and optimized approach to performing the same operation is using triplets. Thus, the previous algorithm can be replaced by Listing 7.

#### *5.4. Boundary Conditions and Linear Equation System Solution*

The implementation of zero velocity condition on the fluid-solid interface is done by reducing the coefficient matrix to solve only non-null variables. This process is performed on lines 113 through 123. The system is solved on line 123 (Listing 8).



#### *5.5. Obtaining Permeability*

After assembling the vector with a nodal variable, permeability is calculated relating the average velocities to the prescribed pressure gradient. In this step, the mean velocities of each element are calculated integrating the velocity field inside each element. The velocity field of each element is achieved using the nodal velocities, and the shape function matrix **N** is used to approximate the velocity field. This process can be performed using Listing 9.


In the above algorithm, the element average velocity is calculated in each element during the for loop. The permeability is determined using the micro and macro relationships stated in Equations (1) and (2). However, for a more elegant and efficient way, taking advantage of the already created matrix of degrees of freedom, we use Listing 10.


#### *5.6. Validation Test*

In order to validate the program presented in this work, a Stokes flow simulation was performed in the porous medium represented in Figure 3. The permeability obtained by the code demonstrated in this work, which was based on the code of Andreassen and Andreasen [1], was compared with the analytical solution proposed by Drummond and Tahir [16]. According to Drummond and Tahir [16], the permeability of the medium shown in Figure 3 can be determined using Equation (22).

$$k = r^2(-\ln(c) - 1, 476 + 2c - 1, 774c^2)/(8c),\tag{22}$$

where permeability (*k*) is a function of the grain's radius (*r*) and the volume fraction of solid (*c*).

**Figure 3.** Representation of the material's REV to be analyzed.

In Reference [14], the proposed analytical equation is valid for small values of *c*. Therefore, for program validation, the REV of the medium was modeled with unit dimensions and grains with radius equal to 0.1. For these adopted values, the corresponding *c* can be registered, and the permeability *<sup>k</sup>* <sup>=</sup> 0.0281 <sup>×</sup> <sup>10</sup>−<sup>3</sup> is obtained via the analytical solution. Figure 4 shows the results obtained through numerical modeling using the program proposed in this paper.

**Figure 4.** Convergence of permeability obtained by numerical results.

As Figure 4 shows, the convergence of the permeability of the medium displayed in Figure 3 can be obtained from mesh size 400 × 400. From this mesh size, the difference between the numerical result and analytical result is 0.71%. This means that the program gives good results and fulfills its purpose.

#### **6. Real Case Application: Permeability of Sandstone**

#### *6.1. Image Acquisition: Microcomputed Tomography*

The convergence of numerical results to experimental data has direct dependence on the fidelity of the representation of the computational model. One way to create reliable computational models is by using X-ray microcomputed tomography (micro-CT). Micro-CT is a technique used for internal three-dimensional visualization of any material on the micrometer scale. This technique consists of generating multiple radiographic projections taken from various angles to produce a 3D image of an object's internal structure. The generation of a micro-CT involves several steps: sample preparation and assembly, projection acquisition, reconstruction, image processing and segmentation, mesh generation, and computer simulations, as illustrated in Figure 5.

**Figure 5.** Workflow in digital petrophysics from sample preparation to computer simulation, covering image acquisition, reconstruction of the virtual sample, image processing, segmentation, and mesh generation.

In the micro-CT acquisition process, the sample to be digitalized is placed on a turntable inside the micro-CT scanner that rotates around its own axis while radiographies are taken. The radiographic projections are used by a reconstruction algorithm to create a 3D image of the object. The reconstruction is done by an inverse analysis that determines the level of X-ray absorption of a spatial point inside the material. This inverse analysis is made based on the different absorption levels on each radiographic projection. The result of a micro-CT is a 3D digital image of an object. A digital image is a visual representation of an object formed by small elements called voxels. Each voxel is given a specific value that is responsible for attributing it a color. Figure 6 illustrates the result of a micro-CT performed by the authors of a sandstone sample.

**Figure 6.** Microcomputed tomography from a sandstone's sample.

#### *6.2. Image Processing and Segmentation*

After scanning and reconstruction, a 3D virtual object is generated. The visualization of the material's internal microstructure can be done by cutting planes, as illustrated in Figure 6. However, for quantitative analyzes, such as porosity, permeability, and other effective properties, images must be processed. The process of image processing includes selection of region of interest (ROI), filter application for noise reduction, and image segmentation.

To determine sandstone permeability from 2D models, a slice (2D image) that was considered to be representative was chosen. After that, image filters were used. Filters are tools that reduce interference and artefacts, and that enhance certain features of images. They are based on sophisticated algorithms that facilitate the extraction of specific information from an image by modifying the image's gray histogram.

As a last step, the image was segmented. Since the image obtained by micro-CT is a grayscale image, it is important to determine which regions of the material will receive their respective properties (e.g., which voxels will be defined as solid or pores). Segmentation consists of determining the material phases according to the gray tones of the micro-CT voxels. This process can be performed by using the image histogram. By the use of the image histogram, one can define the range of gray tones that represent the pores and the range of gray tones that represent the material. There are different strategies that can be used in the image segmentation process. This process can take a lot of time, and it demands the user's experience to produce good results. After basic phase separation of the sandstone virtual sample, a tool for grain separation was used to enhance the quality of the segmentation. Using the grain separation tool allows for a richer analysis of fluid flow through the grains, which is essential for permeability determination. The grain separation tool used is based on a distance map function that determine the boundaries of the grains considering the 3D geometry of pores and grains. Since this tool is performed on 3D images, the result of the grain separation in a 2D image slice can present connections to pores (as presented in Figure 7) that seems to artificially enforce pore connection. The use of this tool was necessary to ensure that the fluid simulated in this model would be able to flow inside the material. It is possible to make a comparison between before and after image processing and segmentation of the sandstone in Figure 7. In Figure 7, blue represents the solid region and black represents the porous connected region where the fluid flows.

**Figure 7.** Two-dimensional (2D) slice of a sandstone microtomography, segmentation of the same 2D slice, and representation of the mesh in a region of 25 × 25 pixels.

Note that different users and different tools would eventually generate different segmented images. It is important to reinforce that the segmentation of the 2D slice of sandstone is used here as an example of input for the program to compute absolute permeability. Different results of segmentation of the sandstone sample can be used as input for the program as any other 2D image.

#### *6.3. Sandstone Absolute Permeability*

After validation, the program was used to measure the permeability of a sandstone sample represented by a 2D image. The two-dimensional image of the sandstone to be analyzed is exactly the same image presented in Figure 6, which has dimensions of 1 mm × 1 mm. Since the 2D image of the sandstone sample is much smaller than the sample size tested experimentally in the laboratory, periodic boundary conditions must be applied to the sandstone virtual model; thus, no change in the proposed program is necessary. Table 1 presents the obtained values for different mesh sizes (number of elements to represent the image). Figure 8 shows the sandstone permeability convergence as the finite element mesh is refined.


**Table 1.** Permeability in the *x-* and *y*-direction for each mesh size.

**Figure 8.** Convergence test of sandstone's permeability.

The permeability obtained for the 2D image of the sandstone sample analyzed with the most refined mesh was *Kxx* = 0.1019 μm2 and *Kyy* = 0.1603 μm2. This means that the sample is anisotropic with respect to permeability. The mesh size of 2400 × 2400 was limited by the random-access memory (RAM) of 32 Gb. A computer with 16 Gb RAM would allow refinement up to 1600 × 1600.

Note that the purpose of this paper was to present the methodology to compute permeability through computational tool in an educational way. The computation of permeability of the sample of sandstone here was used as an example of the application of the methodology. In order to obtain more accurate results for this sample through convergence tests with more refined meshes, we suggest the use of more powerful computers or the implementation of the presented methodology in higher-performance languages, such as C.

#### **7. Conclusions**

This paper presented an educational program capable of computing the permeability of porous materials by simulating fluid flows governed by the Stokes equation. The necessary theoretical basis for modeling the problem was explained, and the peculiarities of the FEM applied to computational fluid dynamics were discussed. Different ways for assembling the system of equations to be solved were explained, as one of the formulations capable of reducing significantly the processing time.

Because it is part of the digital petrophysical field, the program proposed here uses binary images as data input. This feature allows the permeability of real porous materials to be determined by means of micro-CT, which is capable of revealing the internal microstructure of the material through different voxels to represent both the fluid and the solid phases. In this work, the porous medium was modeled in a way such that only the fluid domain was considered. This methodology is extremely efficient for materials that have low porosities, as it allows the permeability to be obtained using less computational effort compared to solid and fluid domain modeling strategies.

The program described by the authors was validated through a simple problem that has a known analytical solution. Hereafter, the effective permeability of a sandstone sample was computed by a 2D analysis. Although the validation of the code confers credibility to the proposed computational program, the sandstone permeability value calculated in two dimensions may not be representative for a three-dimensional sandstone sample due to the three-dimensional geometric characteristics of its pores. However, the development of the 2D program presented here gives the reader the necessary knowledge to extend the program for 3D cases in a simple and intuitive way.

**Author Contributions:** Conceptualization, R.S.V. and A.M.B.P.; methodology, R.S.V., A.M.C., and A.M.B.P.; software, R.S.V., A.M.C., and A.M.B.P.; validation, R.S.V., A.M.C., and A.M.B.P.; formal analysis, R.S.V., A.M.C., R.B.V.A., R.L., and A.M.B.P.; investigation, R.S.V., A.M.C., R.L., and A.M.B.P.; writing, review, and editing, R.S.V., A.M.C., R.B.V.A., R.L., and A.M.B.P. All authors read and agreed to the published version of the manuscript.

**Funding:** This research received no external funding.

**Acknowledgments:** This research was partially supported by the CNPq (National Council for Scientific and Technological Development) Brazilian agency, grant number 404593/2016-0.

**Conflicts of Interest:** The authors declare no conflicts of interest.

#### **References**


© 2020 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (http://creativecommons.org/licenses/by/4.0/).

## *Article* **Floodopoly: Enhancing the Learning Experience of Students in Water Engineering Courses**

**Manousos Valyrakis 1,\*, Gaston Latessa 1,2, Eftychia Koursari 1,3 and Ming Cheng <sup>4</sup>**


Received: 22 December 2019; Accepted: 6 February 2020; Published: 8 February 2020

**Abstract:** This study focuses on the utilisation of lab-based activities to enhance the learning experience of engineering students studying water engineering and geosciences courses. Specifically, the use of "floodopoly" as a physical model demonstration in improving the students' understanding of the relevant processes of flooding, infrastructure scour and sediment transport, and improve retention and performance in simulation of these processes in engineering design courses, is discussed. The effectiveness of lab-based demonstration is explored using a survey assessing the weight of various factors that might influence students' performance and satisfaction. It reveals how lab-centred learning, overall course success is linked with student motivation and the students' perception of an inclusive teaching environment. It also explores the effectiveness of the implementation of student-centred and inquiry-guided teaching and various methods of assessment. The analysis and discussion are informed by students' responses to a specifically designed questionnaire, showing an improvement of the satisfaction rates compared to traditional class-based learning modules. For example, more students (85%) reported that they perceived the lab-based environment as an excellent contribution to their learning experience, while less students (about 57%) were as satisfied for a traditional class-based course delivery. Such findings can be used to improve students' learning experience by introducing physical model demonstrations, similar to those offered herein.

**Keywords:** laboratory demonstration; physical modelling; flood risk assessment; sediment transport; infrastructure scour hazards; outreach; water engineering

#### **1. Introduction**

Students have an inherent ability in learning and adapting to their continuously changing environment, and instructors have a role not only on offering knowledge to students, but also in developing their ability to learn more efficiently. One learning strategy that may be followed in doing so involves increasing students' desire to learn, by engaging students with questions before arriving to an answer, according to [1,2]. Considering that one of the essential first stages for knowledge discovery is observation, it is useful to enthusiastically engage with the students with lab demonstrations early in the course, in helping to educate the future engineers and geoscientists. Topics such as fluid mechanics and hydraulic and water engineering can highly benefit from such practices, as demonstrations of first principles on which engineering designs or physical processes are based may involve simple bench top to more elaborate flume demonstrations. For example, such phenomena may be mixing of fluids at different flow rates, as Osborne Reynolds did in his famous 1883 experiment [3].

A dynamic learning environment is in alignment with the perspective presented in a quote usually attributed to Socrates: "Education is the kindling of a flame, not the filling of a vessel". This can

be best realized if one understands the need to continuously adjust and improve their knowledge, whether it is professional knowledge and experience or soft (e.g., communication) skills, to dynamically adapt to a constantly changing techno-economical and socio-political environment. Physical model demonstrations can allow the students to practice these skills by allowing them to work collaboratively towards inquisitive critical thinking for building their knowledge more effectively. A collaborative environment, where all students freely contributed their own perspectives and are welcoming of each other's views, as well as learning by mistakes, while participating in an open discussion about the best possible methods and tools to be employed towards problem solving, offers an ideal setting. This is because this approach exposes the individual to the collective intelligence of their group and allows them to efficiently achieve a better understanding of the mechanics and processes involved in reaching a solution, thus contributing more to their own learning experience compared to just working on their own.

Physical model demonstrations can also allow for teaching to be more student-centred, fostering active learning. Developing active learning strategies can be realized by implementing a student-centred approach to teaching and using visually rich and engaging lecture presentations, informative lecture notes and tutorials. During the lecture students can be asked questions and offered empirical paradigms relevant to the discussed topic or relevant research to cultivate students' engineering intuition. Asking students questions is very important, as it will improve students' metacognition as well encourage them to take a more active role in their learning [4]. This can also be achieved with the use of more modern technologies involving field work [5] or "virtual laboratories" [6–10], taking advantage of advances in the fields of virtual reality or augmented reality, as an alternative to physical laboratories. However, these technologies are yet not highly accessible for large cohorts of students, are relatively costly and require technical knowledge in using these and developing demonstration applications. Thus, the "floodopoly" setup, as the first author's own invention, is discussed and presented in this research study, as a tool aiming at improving the learning experience of engineering students, as well as engaging pupils in STEM themed subjects.

Student-centred learning has been proved as being effective in encouraging deep approaches to learning and in making students take responsibility for their own learning [11]. Focusing on students, as individual practicing engineers will help them to self-identify and develop their own talents as well as achieve a better understanding of how their unique skill sets and personality will fit in and potentially benefit their peer group's dynamics and performance. Focusing on developing students' strengths is an inherently energizing process for them, and allows the individuals to be in the flow zone of learning (appropriately challenged and motivated), allowing them to feel nurtured into developing as well rounded professionals and future leaders in their fields.

Over the last decade the above concepts have been deployed in shaping the delivery of modules in fluid dynamics, hydraulics and water engineering [12], for diverse cohorts and educational systems, including Virginia Tech (USA) and University of Glasgow (UK), such as the Environmental Fluid Mechanics (CEE3304) and Engineering Hydraulics 3 (ENG3085), respectively. Successful teaching should encourage and develop students' ability for active learning, a belief which, according to the current teaching practice for these courses, is influenced by perspectives early presented by Greek philosophers, such as Socrates, on learning. Specifically, according to the quote usually attributed to Socrates, one "cannot teach anybody anything, but can only make them think". Highly engaging teaching for fluid dynamics-themed courses commonly employ physical model demonstrations and can be even more impactful if their delivery is student-centred, with the students actively encouraged to maintain a sustained engagement and self-motivation towards knowledge and skills development learning, with strong focus on the development of each individual's strengths (which requires a diverse way of assessment). The value of physical model or lab-based demonstrations in introducing a student to the scientific method, the observation of a system or process of interest, the formulation of a research hypothesis and the design of an appropriate framework is indispensable. This can be done by discussing with the students the methods researchers use to build a wealth of scientific information

by means of observing physical processes, encouraging them to reproduce experimental results and suggesting how to demonstrate their critical thinking. This approach helps equip students with appropriate tools to carry out research in the future as academics or gain confidence as engineering professionals, as [13] have demonstrated.

Here the use of a physical lab demonstration is presented as one of many student-inspiring demonstrations offered within our UK-wide top degree program in Civil Engineering at the University of Glasgow (ranking top three across the whole UK over the years 2017–2019, and first in 2019, according to the National Student Survey). A distinct feature of this degree is the significant amount of design-centred and practical skills development-oriented courses, many of which involve lab-based or computer demonstrations. In addition, a low staff-to-student ratio, a high entry level for the students and the fact that the University of Glasgow is a research-intensive environment contribute to building an identity as an engineering researcher or innovator; becoming a "world-changer" as the university community prides. Small-group teaching is found to help develop an active learning environment, as the instructor has a better chance for clarifying points made in lectures, helping the students gain a more comprehensive understanding and fostering discussion and communication of ideas [14]. The contained size of the class and lab-based sessions (split into small working groups of four to eight undergraduate students each) works well in helping to encourage discussion of problems and seeking peers' feedback.

Specifically, the use of a novel physical demonstration, namely "floodopoly", as part of a design class, which aims to introduce to the students the principles of flood risk modelling and assessment, is detailed herein. The course in which the "floodopoly" demonstration is introduced involves a problem-based learning environment, and it focuses on developing higher cognitive functions, for example, critical thinking, encouraging problem solving and bringing exciting and tangible lab-based research observations into the course. Such a course design, that links teaching with research, is shown as effective in extending beyond traditional student knowledge, by empowering students and advancing intellectual curiosity [15]. Further, research-based course design has been associated with deep, rather than superficial, student learning [16,17], and is believed to have the potential to improve students' satisfaction and benefit students' professional development. The results from a survey offered to the students are further discussed to demonstrate how physical demonstrations are contributing to an enhanced student learning experience.

#### **2. Physical Model Demonstration**

The main goal of the "floodopoly" physical model demonstration is to allow the students to observe the physical mechanisms of flooding, which students are assessing later through numerical modelling. This hands-on, active learning student-centred experience facilitates their grasping of key aspects of flooding and associated hazards, in urban environments.

#### *2.1. Experimental Setup*

"Floodopoly" is an interactive demonstration aiming at allowing the students to play out a number of scenarios, simulating the effects of rising hydrograph and flow unsteadiness in a physically relevant and engaging manner, towards knowledge discovery. This allows the students to have a significantly improved understanding and intuition-led critical thinking for the studied dynamical processes, before embarking on using appropriate software (such as HEC-RAS) for flood modelling and flood risk assessment, in the later part of the course.

A number of improved designs have been utilised over the many years, but there are essentially two versions of the "floodopoly" setup; (a) a versatile mobile setup (Figure 1a) and (b) a permanent one (Figure 1b). Both setups involve a fit-for-purpose model city in a sandbox, which is already built for the demonstrations as described in the following. The model city uses building blocks from Lego© along with custom paper-made or 3D-printed physical models of built infrastructure to simulate a typical built environment. Means of transport (such as vehicles, buses and trucks), elements of

the natural environment (such as trees) and built infrastructure (houses and skyscrapers), including iconic buildings, such as the Eiffel tower and Parthenon (Figure 1a), or the London Eye and Big-Ben (Figure 1b), are all scaled to fit within the sandbox model city and can be featured for enhanced dramatization during the demonstration.

The mobile "floodopoly" version (Figure 1a) has a 3D-printed topography of the model city and complex river geometry, allowing the floodplains to be covered in water impacting infrastructure in the extreme hydrologic scenarios. The water tank of the setup is made of transparent 7 mm thick acrylic panels and comprises of a tank with external dimensions of 90 cm length, 50 cm width, and 30 cm height. Blue-dyed water is circulated through the model for the demonstrations to improve the visualization of the flooding process. This water is then collected "downstream" so the experiment can be run again. The sandbox containing the 3D-printed model surface replicating the complex topography of the model city, involving a river and its floodplains, is of slightly smaller dimensions, allowing for recirculating water on its surface through an appropriately constructed inlet (aligned with the river's main channel) using a configurable pump introduced at the water tank of the setup. Focus is given on producing a visual effect on the impact of flooding, so some of the built infrastructure and monuments can be purposely placed at or near the floodplains. After the demonstration, water can be drained from a small outlet valve attached at the lower corner of the acrylic box.

The lightweight, modular arrangement (all items such as the built infrastructure and 3D-print surface topography are also lightweight and removable) and small size of this setup allows it to be easily carried to a specific location for engaging with target audiences, beyond the classroom. This versatile setup has been successfully presented to thousands of pupils and students during recruitment events (such as the School of Engineering Open days), as well as outreach events (such as Widening Participation schemes, Glasgow Science Festival, Glasgow Science Museum). It can also be shown in an open-air classroom next to the river Kelvin (within walking distance from the classroom) for the Engineering Hydraulics classes and Civil Design project, for third and fourth year engineering students.

**Figure 1.** *Cont.*

#### (**b**)

**Figure 1.** Demonstration of the "floodopoly" demonstration: (**a**) The flooded state of the mobile setup, at the "meet the experts" session (during the Glasgow Science Festival 2016, at the Glasgow Science Centre); and (**b**) the dry state of the permanent (flume-based) setup, at the Water Engineering Lab of the University of Glasgow.

The permanent design (Figure 1b) involves replicating part of the river Thames and the relevant infrastructure along it. The model city is built with Lego© inside a standard Armfield-type demonstration flume repurposed specifically for this project. The flume is substantially longer (7 m long in total) and 60 cm wide, while much bigger flow rates can be run in a recirculating fashion. Both setups have flows running through the river via the use of small pumps of controlled flow rate to simulate a rising or decreasing hydrograph. The students are encouraged to replicate an extreme flash flood scenario by pouring large volumes of water at a fast pace, aiming to demonstrate the dramatic impacts of flooding, resulting in highly-visual damage to built infrastructure, and activation of floodplains in routing the flood. The topography of the models can be sprinkled with sand of different sizes to also demonstrate scour and sediment transport processes and how increased flow or shear flow forces can result in increased rate of transfer of smaller or coarser grains, helping the students understand that coarser grains can generally withstand increased stresses, thus are more suitable for use in hydraulic protections and armouring infrastructure near water.

#### *2.2. Demonstration Protocol*

Both of the above setup versions can be used to run the "floodopoly" demonstration in an interactive manner. More complex game mechanics can be further introduced depending on the time allowed for the demonstration, thus the name is chosen to rhyme with the popular game monopoly©. The following steps are offered as an indicative guidance to the demonstrator.

Firstly, the demonstration space is introduced and any important health and safety issues are presented, along with a brief summary of the demonstration, as an interactive, hands-on experience for students to investigate the impacts of flooding, and to develop a first understanding of flood defence designs, by means of tangible observation of the involved hydraulic and geomorphic processes.

Secondly, the audience is familiarized with the different model city areas, including the historical areas (model castles and churches), energy related facilities (model coal extraction and oil and gas facilities), industrial plants (behind the model floodwalls), housing areas and residential properties, and hydraulic infrastructure including model bridges, roads/highways and locks.

Thirdly, the impacts of flooding and scouring of infrastructure are presented. Flood risks associated with floods, such as loss of life and infrastructure costs, are discussed. Emphasis is given at the fact that floods have been always happening, but because of increased urbanisation and climate change, societal catastrophic impacts due to floods have continued increasing at an alarming rate. In an inquiry-led session, the students are asked to consider which areas are more flood-prone and what makes them more susceptible to flooding.

The processes of scour [18] and sediment transport are discussed. For example, the demonstrator can introduce some additional fine and coarser sediment, across the setup, and ask the students to observe the locations and the size of sediment in relation to eroding and settlement. The students are allowed to think out loud and discuss with each other their observations, towards identifying the first principles around these physical processes in a collaborative manner. A further inquiry can be around devising ways by which such first principles can be used to design engineering against scour, eventually observing that, in the real world, engineering practitioners use coarser sediment as rip-rap. Since pier shape can also affect the scour geometry [19–21], this installation may be used to demonstrate influence of pier shape on scouring process, by placing piers with different shapes inside the fluvial model.

To further enhance the students' tangible observation-led learning of the physical processes, as well as the impact of flooding on the environment, infrastructure, people and their property, two more highly-interactive role-playing scenarios can be run:

#### 1. The Scenario of Urbanisation

Individual students from the participating audience are given the same number of 3D-printed miniature houses (similar design to what is found in the housing blocks of Monopoly©) and assume the role of citizens and engineers contributing to the development of the city's floodplains. The students are asked to take turns in placing one of their buildings on one of the many predefined plots for development on the floodplain. The demonstrator describes that during this scenario the city gets increasingly urbanised over a period of cycles, as each of the student is occupying a new plot with their building. The students are asked to contemplate and consider the first physical principles discussed earlier towards identifying which of these plots could face a greater risk of flooding. Naturally, most of the students will opt for the higher ground, and, as such, plots become less available, other principles will have to be employed, such as avoiding building next to a segment of the river with low slope, as the flow depth (for the same river geometry and flow rate) will have higher flow depth (thus a higher risk of flooding).

The mechanics of the interactive demonstration can be further gamified, but the focus here is rather on collaborative learning by means of observation. Even though the demonstration is student-centred, the demonstrator is guiding and pacing the process by inquiring, for example, about the students' expectations as the flow rate increases and asking students to identify the areas with greater risks. As the floodplains get flooded, the students get a chance to seriously reflect on their choice, as if their own property had flooded in the real world. This also stimulates their sense of responsibility as an engineer. Last, the students are offered a chance to identify direct (e.g., by placing floodwalls, embankments, channel geometry modification) or indirect protection measures (e.g., having an upstream storage scheme or changing the land use around the catchment, by planting more vegetation to slow the surface runoff before it becomes accumulated stream-flow).

#### 2. The Climate Change Scenario

In this scenario the students are asked to simulate extreme hydrologic events, due to climate change. They are given plastic cups of different sizes (thus varying the volume of water to be dropped), prefilled with blue-dyed water, and are allowed to spill it at the upstream end of the river, running already with the highest base-flow. The students can empty their cup as fast or as slow they desire, observing that the rate of volume offered to the base-flow rather than the volume alone is important in defining the change in the hydrographs. As they observe the peak of the hydrograph upstream propagate downstream, they also have a chance to observe the attenuation of the peak flow rate. This is the most visually impactful part of the demonstration, with many students enjoying the activity of flooding the landscape of the sandbox and impacting infrastructure within it. As the pressure from climate change is rapidly increasing, a whole scenario is purposely devoted to demonstrating its potentially catastrophic impacts. Given that the nature of this physical demonstration is to generate a visually-induced emotional response around the increasing frequency and magnitude of hydrologic events, it is purposefully involving a qualitative rather than a quantitative comparison.

#### **3. Results**

#### *3.1. Design Course Background and Assessment*

A range of both formative and summative assessment methods are used in the design course where the "floodopoly" demonstration is offered, which proves to be effective in improving students' learning [22]. Specifically, assessment methods range from assigning extra credit quizzes at the end of each lecture to performance assessment quizzes and assignments on a weekly or bi-weekly basis. Assigning customized exams and quizzes as well as a final project report helps them by enhancing their writing and reporting skills and improving their critical thinking capacity, allowing them to progress in more advanced topics. The use of a flexible assessment scheme for the final presentation of their output, where one has the option to prepare a video, a poster or oral presentation, allows a student to capitalize on what they perceive to be their strength and feel greater satisfaction. Based on student feedback, the offered assessment methods are suitable and the diversity of assessment methods and the opportunity to reflect and identify their own strengths is appreciated.

#### *3.2. Student Survey*

To assess the effectiveness of the "floodopoly" demonstration as a novel highly visual and tangible way for reinforcing inquiry-led learning, a purpose-designed questionnaire is offered to the students. The use of questionnaires as a data collection method is well established and has often been used for course evaluation [23]. A total of 25 out 30 students completed the questionnaire in full, after the completion of the course. Specifically, the questionnaire covers several aspects that affect student learning, performance and satisfaction, such as students' motivation, factors to effective learning (also assessed by follow-up quizzes) and methods of communication and assessment; in an effort to identify how a physical demonstration may be a more engaging and beneficial learning activity compared to other options, towards better achieving the intended learning objectives of the course within a broad context of the engineering and geosciences curriculum. The presentation of results is given in the following main themes explored below: (a) Students' motivation for attending the water engineering courses, (b) effectiveness of course environment and material offered, (c) suitability of methods of communication, (d) learning and assessment methods and (e) assessment of level of difficulty, performance and overall satisfaction.

#### 3.2.1. Students' Motivation for Attending the Water Engineering Courses

The first set of questions aims to access one of the most important aspects of learning—the level of motivation and enthusiasm for the theme studied. Motivation can affect attendance and focus during the class and can depend on the how each student perceives the course to be useful to their professional development. Student replies are visually offered by means of word clouds showing the most frequently used words by students per question (Figure 2a–d).

Regarding students' perception of their future role as civil engineers (question a1), most replies involved design and construction (building) of infrastructure, as well as problem solving applied to challenging aspects of our society, which are indeed amongst the most fundamental aspects of civil engineering (Figure 2a). Some replies are original and indicative of a high level of inspiration "civil engineer = builder of dreams", while several (at least three) other students chose to identify with known quotes of the role of the civil engineers (e.g., "Harness the power of nature for the greater good of mankind").

For the second question (a2), on what excites them most about the profession they study, answers signifying intrinsic or extrinsic motivation to different levels are observed (Figure 2b). Replies, such as "fulfilment from design to structure completion" and "the opportunity to be part of the design or construction of a landmark, or design to improve the life of people", show a high level of intrinsic satisfaction expected by the practice of this profession. From this question, several highly-motivated students can be identified due to extrinsic factors, such as "being part of a well-known project and opportunity to travel abroad" which reveals focus on external rewards (influence, esteem and travel).

Replies from the next question (a3: "What do you aspire to do in 5 to 10 years from now?") covered virtually all disciplines of civil engineering, namely, structural, water/environmental, geotechnical and transportation engineering (Figure 2c). Most students confidently reported they wish to eventually secure "chartered" status with a professional body, as can also be seen from the word cloud (Figure 2c). More students showed an interest to work in industry/consultancy, than government and NGO's.

(**a**)

(**b**)

**Figure 2.** *Cont.*

**Figure 2.** Word cloud representation of collective replies from the first part of the questionnaire assessing the students': (**a**) Role as professionals, (**b**) motivation, (**c**) career aspirations and (**d**) expectations from this course.

With regard to the students' expectations for this course (question a4), the replies were centred around both skills and knowledge to be gained (Figure 2d). The former ranged from group work, report writing and problem solving to the ability to utilise effective modern computational tools and techniques, while the latter involved extending the fundamental theoretical background with reference to practical experience and best practices from real life problems. Indicative is the following student reply, demonstrative of a need to link the taught material with the professional practice, while enriching their interest on the discipline: "Practical knowledge of water engineering and give me something I can actually use in my professional career. I hope to build on my interest and passion for the subject".

#### 3.2.2. Effectiveness of Course Environment and Material Offered

The following set of questions (b1–b3) focus on the perceptions of student's knowledge, aiming to explore the confidence of an individual in thinking about each specific question rather than assessing the true knowledge on this (for which a test/quiz type of question would be required, and which is explored in sequent questions). The specific questions (SQ1–SQ6) are representative of each of the six course objectives and thematic sections that the students were taught in class. As seen from Figure 3a, on average the students feel confident with the overall level of understanding they have acquired during the taught course (average for overall knowledge is 3.4, on a scale from 0 to 5, with 5 being excellent). The students can answer fundamental theoretical questions with more confidence (SQ2, SQ3, SQ5), while more advanced (SQ4) or abstract (SQ6) concepts, requiring critical thinking, were ranked relatively lower. It is interesting to note that while the standard deviation for the first few questions ranges from 0.7 to 0.8, it is above 1.1 for the last one (SQ6), showing that some students felt less equipped in higher cognitive skills compared to others.

**Figure 3.** Students' perception of the: (**a**) Knowledge gained during the course (assessed on a scale from 0 to 5). The students are queried in relation to their overall knowledge first and then specific questions about their disciplinary knowledge (SQ1–SQ6) and (**b**) course material and environment (ranging from neutral (left) to excellent (right)).

The next two questions concern student satisfaction with the course material, including notes posted online (e.g., Moodle) or handouts distributed in the class and the lab sessions (b2), as well as the environmental factors during these sessions including the lab-based demonstrations (b3). The feedback offered is summarized in Figure 3b. Even though it is observed that the overwhelming majority of the students who answered indicate their high level of satisfaction with both factors, the shift of the distribution to the left demonstrates clearly that the use of the lab for physical model demonstrations is even more appreciated and valued, compared to only teaching in the classroom. Specifically, about 85% of the students perceived the lab-based environment as a great or excellent contribution to their learning experience, while fewer students (about 57%) were as satisfied for a traditional class-based course delivery.

#### 3.2.3. Suitability of Methods of Communication

Following, the utility of other means of communication and updating students on course content and feedback (in addition to Moodle and e-mail) is inquired (c1–c3). It is interesting to note that many students choose such modern platforms for this goal, many accessed at least on a daily basis or more often. This view is supported by the results illustrated in Figure 4a, where the various online means students frequently use and would be willing to use for the purposes of class communication are shown. Facebook ranks second in popularity (with 16 students, half of whom prefer very frequent communication) compared to the online web pages and blogs (with 20 students). Only a few (six) of the students believe there is a need to establish a Facebook group page for such purposes (Figure 4b). On the contrary there are many who feel this is not required as " ... Moodle and email is sufficient for the class needs" or even a few who may feel even stronger and stating an opposition in subscribing to such services "due to the terms of use". Thus if an inclusive method is to be used, Moodle and email suffice for reaching out to the class. The optimal frequency to contact students varies greatly from "every other day" to "only when needed", with more than half of those who answered, believing that it is best to be contacted at least once a week (Figure 4c).

**Figure 4.** *Cont.*

**Figure 4.** Students' perception of: (**a**) The utility of a Facebook (FB) group page for the course, (**b**) the optimal contact frequency for receiving course updates and feedback, and (**c**) the overall utility of online platforms on class communication and feedback.

#### 3.2.4. Learning and Assessment Methods

Two important questions follow (d1–d2) pertaining the methods of assessment, beyond the traditional exam-based assessment that is employed for this course. Figure 5a shows the results grouped per type of assessment and percentage contribution for each (out of a total of 100%). Students are allowed to choose more than one option, with the most popular ones being lab work, home assignment and technical reporting for about 10%. This is consistent with the students' desire to learn hands on, practical skills at the lab as well as improving their problem solving and technical writing skills, respectively. Fewer preferred the presentation with slides, as unfortunately at this level they may have not gained the experience required to present with confidence, as opposed to later years. It is generally agreed that the course assessment should not be entirely exam-based. The importance of addressing the need to use a versatile scheme that includes different assessment approaches and which allows the individual to reflect on their own skills, putting emphasis on growing their own skills/talents, is also reflected below with only one individual being indifferent and most of those who replied believing it is imperative (Figure 5b).

**Figure 5.** Students' perception of the: (**a**) Usefulness of a variety of assessment methods and (**b**) importance of adopting a versatile scheme for assessment.

3.2.5. Assessment of Level of Difficulty, Performance and Satisfaction with Individual Performance

The last three questions (e1–e3) relate to the perceived difficulty for the class (a measure relevant to expected individual performance or how challenging the course is, compared to other courses offered), overall performance and degree of satisfaction with the overall grade achieved. More than two thirds of those who replied regarded the class to be generally quite more than challenging and "moderately hard", while only a third perceived it as being at an acceptable "average" level of difficulty (Figure 6a). The reported performance levels vary greatly covering the whole spectrum of grades, but with a good portion of high grades (Figure 6b). This is not unreasonable given that the exams cover material that has been seen by the students in class or tutorials, reducing the uncertainty over the questions that might be asked. Likewise, the satisfaction results (Figure 6c) demonstrate a degree of polarization with an about equal share for those who are satisfied and dissatisfied with their performance.

**Figure 6.** Demonstration of the students': (**a**) Perception of the difficulty of the course, (**b**) performance achieved overall and (**c**) own satisfaction with their individual performance at this course.

(**c**)

#### **4. Discussion**

The role of students' motivation on achieved learning outcomes can be further evaluated. The findings suggest that students' motivation could be either intrinsic or extrinsic. Students demonstrated well how they perceive their role as future professionals and they showed a great sense of duty. Examples of primarily extrinsic drive may be seen in replies to question a3, where some individuals were driven by professional status and income. Further, a good number of students (about 40%) explicitly stated their interest or specific focus in water and environmental engineering in addition to other disciplines (such as structural and geotechnical), which signifies their particular interest for this class (Figure 7). A good correlation holds for those who stated explicitly primarily intrinsic motivation, along with specific aspirations. This demonstrates that motivation is an important factor in positively influencing the learning outcomes, which echoes the argument by Baeten et al. [24].

**Figure 7.** Students' focus on particular engineering disciplines.

Indeed intrinsically motivated students will typically tend to perform better than the rest of the students, as they work harder and more independently, regardless of the learning environment. However, a student-centred environment with highly-visual physical demonstrations, as those described herein, allows for accommodating a wider range of student learning styles, having a greater potential in ensuring that all students do even better, compared to a traditional learning environment. It is the belief of the authors that the time and effort put into the search for active learning strategies is valuable, given the increase in terms of both student satisfaction and experiential learning. Driven by a deep interest for the topic, the instructor can further support the development of a student focus group, consisting of actively engaged students who are motivated in utilising more of their potential while polishing some of their lab work, technical writing, teamwork and presentation skills. The group could be meeting on a regular (e.g., bi-weekly) basis to discuss/present active student projects,

opportunities for volunteering or ongoing research in water engineering as well as promoting lab and research activities.

Kabilan et al. [25] argues for the use of Facebook to enrich the learning environment and to reach out to students more efficiently and timely. Even though it seems that some potential exists in the use of social media for effective teaching, the use of physical lab experiments is definitely more defining for promoting active learning, because students can feel present in an inclusive environment, receiving direct feedback and having the chance to interact in a focused manner. For example, if an environment is cultivated aiming at actively engaging with the students, then students will develop a deep learning approach [22,26]. By contrast, students are likely to focus on exams and performance, if the class is perceived as overly difficult with a high workload. Regarding the use of modern online technologies, such as Facebook, in alignment with students' replies, it is worth investigating the potential to assist learning, but only on a complementary basis and in addition to existing platforms currently in use (Moodle and email). Amongst the greatest advantages would be offering direct, timely and personalized course feedback. However, to facilitate learning the tool has to be fully integrated and promote the course objectives (e.g., with live links to video and other resources visible in the timeline) as the course progresses [25].

With regard to assessment methods, even though the exam retains a significant weight of the overall course grade (at least 60%), having more options for assessment rewards the students who are consistent and deep learners, rather than those who simply prepare better for the exams. There have been some who expressed disappointment over the exam being "too short" or "did well in homework but messed up with final exam". So having more assessment components can relieve concerns due to a "hard" exam. Further, having a plethora of assessment methods delivered during the course allows many students to get involved and engaged to learn early on rather than just prepare for the exam, focusing on the grade as a goal to itself. Generally, good performance correlated well with satisfaction for the course, with the exception of one individual who reported being unsatisfied, despite the high grade (A4), as they know "more about the exam than the course". Evidently the students are overall quite confident in knowing well most of the specific thematic questions, long after the class had finished, which was demonstrative of deep learning achieved, as confirmed by Lizzio et al. [26] and Baeten et al. [24].

The students need be able to clearly see that assessment is strongly linked with the intended learning outcomes of the course, and that achieving these takes "time and effort" [27]. As many new students may get easily distracted in our technological era, it is important to encourage explicit interactive sessions that promote a deep learning approach according to Nicol [27]. It is also important to emphasize that extrinsically motivated students may not find value in undertaking assessments that do not contribute towards their final grade. Thus widening the range of offered methods of assessment, by using online quizzes as part of the summative assessment, can also help by offering timely constructive feedback. Well-designed online (Moodle) quizzes offer a great way to offer automated, direct feedback that enables students to act upon improving any mistakes (e.g., by allowing multiple attempts and offering a rationale on every wrong answer), helping to motivate and engage students [27].

To this goal, the role of lab-based demonstrations is of high value in achieving active student learning and offering a supportive, interactive and inclusive environment. The use of *floodopoly* has been demonstrated here for helping reinforce learning and promote the learning objectives of a design course on assessment and modelling of flood risk [28]. The activity described herein is part of a design project, which typically does not involve exams. However, the students in this Design Project as well as in traditional modules which involve other types of assessment (lab reports, assessments and exams) typically explicitly demonstrate a significantly high satisfaction rate for the part of the module involving the physical lab component.

"Floodopoly" is highly versatile and can also be used for outreach purposes, to showcase the detrimental impacts of flooding, for both natural ecosystems and built infrastructure (see relevant posts on Twitter https://twitter.com/WaterEngLab/status/758270564561784832 and Youtube https: //youtu.be/H5oThT6QaTc). Highly interactive sessions were used, whereby the students simulate the scenarios of "urbanisation" (by placing more buildings on the floodplains) and "climate change", where more extreme flow rates have to be routed through a greater extent of the floodplains, having even more catastrophic consequences. Using such novel student-centred demonstrations, the students are given a truly unique experience and are encouraged to appreciate engineering principles and design approaches towards installing contemporary flood protections for protecting the model city from extreme hydrologic events. This demonstration can be also combined with targeted research article reading on the processes of flooding and sediment transport [29,30] to break down any access barriers in engineering innovation and promote students' confidence in understanding and eventually performing research. Students who took part in this taught module, and chose a relevant career to become hydraulic engineers or flood modelers, expressed their satisfaction and how much they have been positively impacted by the physical lab demonstrations and research-led component of the course. Indicative is the unsolicited statement of a recent graduate student, currently employed as a Graduate Engineer at a big international engineering consultancy, who described how he has been inspired to possibly pursue engineering innovation or even engineering research in the future: "I know I enjoyed the research aspect, investigating and creating something new ... ultimately I would like to continue ... ".

The demonstration has been very successful as it has been presented to thousands of students in the School's Open days, Widening Participation events, Glasgow Science Festival, Glasgow Science Museum and Engineering Hydraulics classes and Design projects, for more than eight years, while it can be also used for engaging aspiring future female engineers, actively promoting diversity in engineering (e.g., see the International Women in Engineering Day, INWED events, where the authors are also actively engaged). As an example, the Head of the Civil Engineering Discipline has been very supportive of the project and has emphasized its importance for the design courses and outreach events, alike:

"Floodopoly is a successful interactive demonstration tool depicting hydrology design projects carried out by Civil Engineers all over the world. It allows students to immediately see the impact of changes in water supply and flood direction on simulated towns and due to the fact that it is portable and adaptable, it has been used at a variety of outreach activities. It was developed by Dr Valyrakis about a decade ago, is an excellent example of research led teaching and has been utilised in a variety of Hydraulics laboratory sessions, School of Engineering Open Days and Glasgow Science Festival activities."

#### **5. Conclusions**

This study presents the use of a novel approach, namely the "floodopoly" demonstration, in facilitating the teaching of fundamental physical principles around the hydraulic processes that shape the Earth's surface and impact our society, while also informing about engineering designs for flood protection. The design of the "floodopoly" setup replicates the topography of an urbanised town, along with its rivers, and demonstrates the impacts of flooding (induced artificially using small water pumps in a recirculating demonstration flume or custom-made portable sand-box, at the Water Engineering Lab of the University of Glasgow).

A purpose-built survey is used at the end of the design course to assess the effectiveness of the environment and lab demonstrations on enhancing the learning experience of the students. The findings suggest that students with a high level of intrinsic motivation are deep learners and are also top performers in a student-centred learning environment. A supportive teaching environment with a plethora of resources and feedback made available over different platforms has the potential to improve student satisfaction and their learning experience. This can be greatly enhanced by interactive lab activities, as offered by the "floodopoly" demonstration. These results have deep implications about student learning and can be used to further improve the design and delivery of water engineering courses in the future. Depending on resources, technical support and expertise available, it is expected that the physical demonstration can become even more engaging if it is combined with modern technological advances, such as augmented reality (AR), to enhance the visual elements of flood impacts and render the activity even more interactive.

**Author Contributions:** Conceptualization, design, methodology, conduct, formal analysis, visualisation, supervision, project administration, funding acquisition and writing—original draft preparation M.V.; writing—review and editing, M.V., G.L., E.K. and M.C. All authors have read and agreed to the published version of the manuscript.

**Funding:** Funding from the University of Glasgow's, Chancellor's Fund is gratefully acknowledged in generating improved versions of "floodopoly".

**Acknowledgments:** The help of the Water Engineering Lab Technician, Tim Montgomery, in constructing the tank and sand-box for "floodopoly", is greatly acknowledged.

**Conflicts of Interest:** The authors declare no conflicts of interest.

#### **References**


© 2020 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (http://creativecommons.org/licenses/by/4.0/).

## *Article* **Suite-CFD: An Array of Fluid Solvers Written in MATLAB and Python**

#### **Nicholas A. Battista**

Department of Mathematics and Statistics, The College of New Jersey, 2000 Pennington Road, Ewing Township, NJ 08628, USA; battistn@tcnj.edu; Tel.: +1-609-771-2445

Received: 1 October 2019; Accepted: 19 February 2020; Published: 25 February 2020

**Abstract:** Computational Fluid Dynamics (CFD) models are being rapidly integrated into applications across all sciences and engineering. CFD harnesses the power of computers to solve the equations of fluid dynamics, which otherwise cannot be solved analytically except for very particular cases. Numerical solutions can be interpreted through traditional quantitative techniques as well as visually through qualitative snapshots of the flow data. As pictures are worth a thousand words, in many cases such visualizations are invaluable for understanding the fluid system. Unfortunately, vast mathematical knowledge is required to develop one's own CFD software and commercial software options are expensive and thereby may be inaccessible to many potential practitioners. To that extent, CFD materials specifically designed for undergraduate education are limited. Here we provide an open-source repository, which contains numerous popular fluid solvers in 2*D* (projection, spectral, and Lattice Boltzmann), with full implementations in both MATLAB and Python3. All output data is saved in the .*vtk* format, which can be visualized (and analyzed) with open-source visualization tools, such as VisIt or ParaView. Beyond the code, we also provide teaching resources, such as tutorials, flow snapshots, measurements, videos, and slides to streamline use of the software.

**Keywords:** fluid dynamics education; applied mathematics education; computational fluid dynamics; fluids visualization; open-source CFD; projection method; spectral fluid solver; Lattice Boltzmann Method; cavity flow; circular flow; interacting vortices; flow past cylinder; flow past porous cylinder; MATLAB; Python

#### **1. Introduction**

Computational Fluid Dynamics (CFD) models are being applied to problems across all sciences and engineering. From designing more aerodynamic sportswear and vehicles, to understanding animal locomotion, to personalized medicine, to disease transmission, and to predicting hurricanes and atmospheric phenomena, it is difficult to find situations where greater knowledge of the underlying fluid dynamics isn't desired or valuable. Due to its immense importance, many scientists have dedicated their careers to the field, whether they study particular fluid phenomena or develop tools, either experimental or numerical, for other scientists and engineers to use. Possibly because of how vital understanding fluid dynamics is to human flourishing, proving existence, uniqueness, and the possible breakdown of solutions to the system of non-linear partial differential equations that govern fluid dynamics is one of the *Millennium Problems*, to which the Clay Institute offers a 1 million dollar prize for solving [1]. On the other hand, CFD allows us to solve these equations, the Navier-Stokes equations, which are the equations that detail the conversation of momentum and mass for a fluid. For an incompressible, viscous fluid, they can be written as follows,

$$\rho \left[ \frac{\partial \mathbf{u}}{\partial t}(\mathbf{x}, t) + \left( \mathbf{u}(\mathbf{x}, t) \cdot \nabla \right) \mathbf{u}(\mathbf{x}, t) \right] = -\nabla p(\mathbf{x}, t) + \mu \Delta \mathbf{u}(\mathbf{x}, t) \tag{1}$$

$$\nabla \cdot \mathbf{u}(\mathbf{x}, t) = 0 \tag{2}$$

where **u**(**x**, *t*) and *p*(**x**, *t*) are the fluid's velocity and pressure, respectively. The physical properties of the fluid are given by *ρ* and *μ*, its density and dynamic viscosity, respectively. The independent variables are the time, *t*, and spatial position, **x**. Here all variables that pertain to the fluid, e.g., **u** and *p*, are written in an Eulerian framework on a fixed Cartesian mesh, **x**. Think of a fixed Cartesian mesh as a rectangular grid to which over the course of the simulation physical quantities, like velocity, pressure, etc., are measured at specific lattice points. In an Eulerian framework, specific blobs of fluid are not tracked over time, as though they are billiard balls, but rather, we focus on measuring quantities of interest at specific locations in space, located on a fixed grid. Note that Equations (1) and (2) provide the conservation of momentum and mass, respectively.

Many techniques have been developed to solve the above system of equations, such as projection methods [2–6], spectral methods [7–9], and Lattice Boltzmann methods [10–12]; however, they are typically left out of undergraduate curricula due to the mathematical background required for implementation, while they are commonly found in graduate curricula [13]. Moreover, it is not only mathematical knowledge that is a barrier; CFD requires expertise in at least four knowledge domains [14]: flow physics, numerical methods, computer programming, and validation, either experimental or theoretical. Thankfully, this has not stopped academics from developing and researching methods to integrate CFD into undergraduate courses [13–21]. Some have offered best practices guides and advice for future CFD undergraduate courses [13,21]. Stern et al. [13] has suggested for beginners to focus on the overall CFD process and flow visualizations, in order to solidify their fundamental understanding of fluid physics. Appropriate flow visualizations also help students validate and verify their simulations through careful inspection [21].

As computer literacy is rapidly becoming more of a central focus in undergraduate curricula, CFD could be a natural outlet where students may not only implement and test algorithms, but also practice proper data analysis and data visualization, while building computational experience. Much of the fluid dynamics software that has been used in previous courses is either foreign to students or only commercially available [14,17,19,20]. Commercial software has been recommended by the American Physical Society and American Association of Physics Teachers as a tool to help students prepare for 21st century careers by exposing them to a greater range of experiences and opportunities [22,23]. Unfortunately due to expensive software licenses, some schools, particularly smaller institutions, may not be able to afford such software, especially if they would only be used intermittently to complement the existing course material.

Recently, popular programming languages selected for many undergraduate curricula in science, mathematics, and engineering have been either MATLAB or Python [24–28]. MATLAB [29] and Python [30] are both interpreted languages, making it easier (and more attractive) for students to begin programming [31]. Moreover if students have already been exposed to these programming languages, giving them a platform to refine their skills in these languages while at the same strengthening their intuition in fluid dynamics may prove beneficial.

For this reason, many scientists, engineers, and mathematicians who are passionate about education have begun developing CFD software intended for educational purposes written in these languages [32–36]. Such open source software packages can be integrated into courses in a well-streamlined fashion, with tutorials, activities, exercises, and notes provided, and may even blur the line between classroom activities and contemporary research [32,35–37]. In particular L.A. Barba and G. Forsyth [33] have developed a guide for students to numerically solve the Navier-Stokes equations in 12 scaffolding steps and L.A. Barba and O. Mesnard [34] have developed a similar scaffolding lesson structure for students to study classical aerodynamics using potential flow models. Both are written in Python using Jupyter Notebooks [38]. Pawar and San [39] developed modules for teaching advanced undergraduate and graduate students how to develop their own fluid solvers in the Julia programming language [40].

Rather than develop a collection of modules that teach how to implement particular CFD numerical schemes, we offer the scientific community a variety of popular fluid solvers that solve traditional problems in fluid dynamics, with two independent but equal implementations written in MATLAB and Python. The emphasis is not placed on students having to develop or implement numerical schemes, but to allow them the opportunity to get an accelerated start in CFD, and run, tweak, and analyze simulations of traditionally studied problems in fluids courses, as well as explore data visualization and how to present data that is appropriate for fluid physics interpretation. All of this can be done while testing their own hypotheses in familiar programming environments. In the remainder of this manuscript, we will give a high-level overview of the CFD schemes currently implemented in the software (Section 2), guided tutorials on how to run, visualize, and analyze simulations (Section 3), and provide numerous examples to which students may elect to study or modify as well (Section 4).

Furthermore, we provide an in-depth mathematical description of each numerical scheme in Appendix B. The open-source software repository can be accessed at https://github.com/nickabattista/ Holy\_Grail. Any simulation data produced from the software can be visualized and analyzed in open-source software, such as VisIt [41], maintained by Lawrence Livermore National Laboratory, or ParaView [42], developed by Kitware, Inc., Los Alamos National Laboratory, and Sandia National Labs. We also provide teaching resources, such as slides, figures, and movies in the Supplementary Materials.

#### **2. Brief Overview of the Three Fluid Solvers**

In this section we will give a brief overview of the three fluid solvers currently implemented in the software—a projection method, a spectral (FFT) method, and the Lattice-Boltzmann method. Our goal is to provide students a high-level overview of the methods and how they compare to one another. Further details regarding their mathematical foundations and implementations are given in Appendix B.

#### *2.1. Projection Method*

The projection method was first introduced by Chorin in 1967 [2] and independently by Temam in 1968 [4], to solve the viscous, incompressible Navier-Stokes equations. Projection methods are finite difference based numerical schemes [43], in which the fluid equations are solved in an Eulerian framework, i.e., the computational grid is static and fluid dynamics variables, like velocity, pressure, etc., are measured at particular locations on the grid over time during a simulation. Projection methods have been extensively used throughout the fluid dynamics community for decades, in numerous applications across many fields, while being continually improved for efficiency and accuracy [5,44–46].

In a nutshell, this method decouples the velocity and pressure fields, using operator splitting and a Helmholtz-Hodge decomposition. This makes it possible to explicitly solve Equations (1) and (2) in a few steps [2] while also increasing computational efficiency. Please see Appendix B.1 for further mathematical details.

Furthermore, projection methods allow one to define explicit boundary conditions (BCs) for velocity on edges of the computational domain, whether they are *Dirichlet, Neumann,* or *Robin* boundary conditions [5,47]. In our software, we allow users to impose tangential velocity boundary conditions along the edges of the rectangular domain, while the normal direction boundary conditions for velocity are explicitly set to zero. The choice to set normal BCs to zero was made in order to simplify the code by ensuring that volume conservation would be automatically satisfied, i.e., situations will not arise in which a specified amount of fluid is being pumped into the domain while a different amount is leaving the domain per unit time.

Having defined the fluid velocity as **u** = (*u*, *v*), one can set the boundary conditions for *u* on the top and bottom of the domain (*v* = 0 along these edges) or *v* on the left and right sides (*u* = 0 along these edges). See Figure 1 for an illustration. Later in Section 4, we will showcase two different traditional problems in fluid dynamics with a projection method:

1. Cavity Flow

2. Circular Flow in a Square Domain

The examples are different due to the changes in boundary conditions that the user can impose, see Figure 1. In Figure 1 we illustrate the boundary conditions for each example: cavity flow (a) and circular flow (b). This figure also illustrates that the domain could be constructed to be either rectangular or square and that the boundary conditions do not have to be uniform among all sides, nor across the domain.

**Figure 1.** Boundary conditions are depicted pertaining to (**a**) cavity flow and (**b**) circular flow for the projection methods examples.

We will also compare different fluid scales in both examples, using the Reynolds Number, *Re*. The Reynolds Number is given by

$$Re = \frac{\rho LV}{\mu} \,\prime \tag{3}$$

where *ρ* and *μ* are the fluid's density and dynamic viscosity, respectively, while *L* and *V* are a characteristic length- and velocity-scale of the system. In essence, *Re* is a ratio of inertial forces to viscous forces in a system. If *Re* >> 1, inertia dominates, if *Re* << 1, viscous forces dominate, and if *Re* = 1, the inertia and viscous forces are balanced. An example of high *Re* flow would be the flow around a marble quickly falling through air. An example of low *Re* flow would be the fluid flow around a marble slowly falling through honey.

#### *2.2. Spectral Method (FFT)*

Spectral methods are a different class of differential equation solvers. They are well-known for achieving highly accurate solutions, i.e., spectral accuracy [48–50]. Spectral accuracy occurs when error decreases exponentially with a small change in grid resolution, e.g., there is a linear relationship between the logarithm of error and grid resolution, i.e.,

$$\log(error) \sim N\_\prime$$

where *N* is the number of grid points. These methods approximate solutions using orthogonal expansions, such as Fourier Series or other orthogonal basis of functions, like Chebyshev Polynomials or Legendre Polynomials. In contrast to finite difference based schemes, like the projection method, where solutions are approximated at specific locations in space, in spectral methods a particular orthogonal series expansion is chosen and the earnest is on finding the coefficients of the expansion.

Here we chose to use the basis of Discrete Fourier Transform (DFT). The DFT can be used to express functions that are not periodic, unlike Fourier Series expansions, which are used to represent periodic functions. Moreover, we used the Fast Fourier Transform (FFT), which yields the same numerical values as a DFT, but is considerable more computationally efficient, i.e., fast.

Thus, we implemented a FFT based spectral scheme to solve the viscous, incompressible Navier-Stokes equations in 2*D*. We also chose to solve these equations in their vorticity formulation (see Appendix B.2 for mathematical details). The vorticity formulation will lead to a few numerical benefits.

In a nutshell, this will recast our problem into solving for the vorticity, *ω* = *ω*ˆ *k*, and the streamfunction, *ψ*. Velocity can be defined in terms of the curl of the streamfunction, i.e., a vector potential, see below

$$
\mathbf{u} = \nabla \times \psi \hat{\mathbf{k}}.\tag{4}
$$

Hence this allows us to find the velocity field, **u** = (*u*, *v*), once we find *ψ*, e.g.,

$$u = \frac{\partial \psi}{\partial y} \quad \text{and} \quad v = -\frac{\partial \psi}{\partial x}.$$

Moreover, the incompressibility condition (Equation (2)) will be automatically satisfied since **u** is defined to be the curl of a scalar, and the divergence of the curl of a vector is always identically zero.

Furthermore, working in the vorticity formulation requires us to only solve a Poisson equation for the streamfunction in terms of the vorticity, *ω*, i.e.,

$$
\Delta \psi = -\omega.\tag{5}
$$

Notice that Equation (5) is a linear equation. Moreover, upon taking the FFT of the Equation (5), the computation is transformed into frequency (Fourier) space, which offers two advantages—increased speed and accuracy.

In practice, we will solve for the streamfunction at the next time-step based on the previously computed vorticity and then update the vorticity using information from the newly updated streamfunction. We chose to use a Crank-Nicholson time-stepping scheme [51] to update the vorticity to the next time-step. The Crank-Nicholson scheme is well-known for being unconditionally-stable for diffusion problems and as well as for being 2nd order accurate in time and space, as an implicit method [52]. These accuracy and stability properties make the Crank-Nicholson an ideal candidate for numerically solving such equations.

Although using a FFT (spectral method) preserves high accuracy of the spatial information at a particular time-step, numerical error still unfortunately creeps in due to the time-stepping nature of solving an evolution equation for the fluid's momentum (see Equation (A15) in Appendix B.2). That is, evolving the system forward in time is where the brunt of the error takes place, rather than the spatial discretization.

In contrary to the projection method, this FFT-based approach allows us to explore periodic boundary conditions. For example, if fluid flow is moving vertically-upwards through the top of the computational domain, it will re-enter moving vertically-upwards through the bottom of the domain. This has advantages and disadvantages. Some advantages are that explicit boundary conditions do not need to be satisfied nor enforced, which aids in computational speed-up. However, to that extent, one disadvantage is that this makes it more difficult to enforce particular boundary conditions when desired. FFT-based fluid solvers have been used in the fluid-structure interaction community, in particular within immersed boundary methods [32,37,53], when one wants to study the interactions of an object and the fluid to which it's immersed. As the focus is on the object and fluid interactions, it is typically modeled away from the domain boundaries in the middle of the computational domain to avoid boundary artifacts. For a mathematically detailed description of this FFT-based spectral method see Appendix B.2.

For this particular FFT-based fluid solver for the vorticity-formulation of the viscous, incompressible Navier-Stokes equations, we will highlight the following examples:


Contrary to the examples shown for the projection method in Section 2.1, these examples are not differentiated by different boundary conditions, but rather different initial vorticity configurations in the computational domain. Figure 2 gives the initial vorticity configurations for the two cases considered: side-by-side vorticity region interactions (left) and an initial vorticity field that defined by a velocity vector field (right). In Figure 2a, counterclockwise (*CCW*) and clockwise (*CW*) correspond to regions of uniform vorticity, where vorticity initialized as a positive or negative constant for *CCW* and *CW*, respectively. In all other regions of the computational domain, the vorticity is either initialized to zero (Figure 2a). Although not shown, one could also initialize simulations on a rectangular grid. In Figure 2b, the initial vorticity is defined by computing the vorticity from a simulation's velocity vector field. The velocity vector field was taken from a time-point in a *Pulsing\_Heart* simulation [36] in the open-source *IB2d* software [32,37]. In this example, we illustrate that if a snapshot of the velocity field is known, it is possible to evolve the fluid dynamics forward using this spectral (FFT) method, even though it is based on the vorticity formulation of the Navier-Stokes equations.

**Figure 2.** Illustrations of the boundary conditions and vorticity initialization for the cases of (**a**) interacting vorticity regions and (**b**) an initial vorticity field defined from a velocity vector field.

#### *2.3. Lattice Boltzmann Method*

The Lattice Boltzmann method (LBM) does not explicitly (or implicitly) solve the incompressible, Navier-Stokes equations, rather it uses discrete Boltzmann equations to model the flow of a fluid [11]. In a nutshell, the LBM tracks fictitious particles of fluid flow, thinking of the problem more as a transport equation, e.g.,

$$\frac{\partial f}{\partial t} + \mathbf{u} \cdot \nabla f = \Omega,\tag{6}$$

where *f*(**x**, *t*) is the particle distribution function, i.e., a probability density, **u** is the fluid particle's velocity, and Ω is what is called the collision operator. However, rather than these particles moving in a Lagrangian framework, the Lattice Boltzmann method simplifies this assumption and restricts the particles to the nodes on a lattice.

In traditional CFD methods, one typically discretizes the fluid equations in an Eulerian framework, as in a projection or spectral method. When you are free of such restriction, as in the LBM, it allows one to more readily deal with complex boundaries, model porous structures and multi-phase flow, as well as incorporate microscopic interactions, while also allowing for massive parallelization of the algorithm, leading to increased computational efficiency [12,54–56].

The LBM involves *collision* and *streaming* steps, where fictional fluid particles consecutively propagate (and collide) over a discretized lattice, and the fluid density is evolved forward. There are multiple ways to handle boundary conditions in the LBM. One such way is to use *bounce-back boundary conditions*, which are executed by masking points in the domain via boolean expressions, thus defining regions where the fluid can and cannot flow [55]. In short, the propagating (streaming) directions are simply reversed when they hit a boundary node, see Figure A3 in Appendix B.3. The bounce-back conditions can be used to enforce the necessary and physical *no-slip* boundary conditions for fluid flow as well as defining solid objects in the interior of the grid (for an example see Figure 33). For a detailed mathematical description of the LBM see Appendix B.3.

To highlight the LBM fluid solver, we showcase the following examples:


#### **3. How to Run the Simulations, Visualize, and Analyze**

In this section we will give instructions on how to run, visualize, and analyze the simulations produced in this software. We will explain how to change parameters below as well. In particular, we will provide both overviews of what is possible to visualize and analyze as well as a guided walk-through of the steps required, designated by *Guide* in their title. We broke this section into the following subsections:


#### *3.1. Running a Simulation*

Here we will briefly describe how to run each fluid solver's corresponding simulations. To illustrate the software structure and how to run the simulations, we will use the MATLAB (https://www.mathworks.com/products/matlab.html) [29] version. Note that the Python implementation is consistent in its structure as well as naming conventions.

#### **To run the simulation, one would need to do the following**:

	- Projection\_Method: for the projection method solver and its examples
	- FFT\_NS\_Solver: for the spectral (FFT) method solver and its examples
	- Lets\_Do\_LBM: for the Lattice Boltzmann method solver and its examples

and go into the MATLAB subfolder. (If you wanted to run an example in Python, you would change directories until you are in the complementary Python subfolder.)

	- Projection\_Method.m main script for the projection method
	- FFT\_NS\_Solver.m main script for the spectral (FFT) solver
	- lets\_do\_LBM.m main script for the Lattice Boltzmann solver

Each of these scripts contains all the functions and modules necessary to run each example. The file print\_vtk\_files.m produces the .*vtk* data files during each simulation. The user should not have to change this file, unless they do not wish to save some of the data for storage reasons. If this is the case, this can be accomplished by commenting out the lines corresponding to whichever data is not to be saved.


#### **Digging deeper into each fluid solver script**:

	- Projection Method: *please\_Give\_Me\_BCs* (choice)
	- Spectral (FFT) Solver: *please\_Give\_Initial\_Vorticity\_State* (choice, NX, NY)
	- Lattice Boltzmann Solver: *give\_Me\_Problem\_Geometry* (choice, Nx, Ny, percentPorosity)

**Figure 3.** Options for practitioners to change the grid resolution and size, fluid properties (density, viscosity), and other solver attributes within the software for the (**a**) Projection method, (**b**) Fast Fourier Transform (FFT)-based spectral solver, and (**c**) Lattice Boltzmann solver. The possible choices for built-in examples are also listed for each.

#### *3.2. Visualizing the Data in VisIt*

In this section we will briefly describe how produce visualizations, such as those Section 4. We will briefly detail the steps to visualize the data using the open-source software VisIt (https://visit.llnl.gov) [41]. Note that each simulation produces data in the .*vtk* format and so one could alternatively use the open-source software ParaView [42] for visualization purposes as well. Later, in Section 3.3 we will guide a user through running an example (the spectral (FFT) method's bubble3 example) followed by a step-by-step guide to visualizing its corresponding data in Section 3.4. We used VisIt version 2.13.3.

#### **To visualize the data, one would need to do the following**:


**Table 1.** Data stored to .*vtk* format and its corresponding storage name.


	- (a) Click Open
	- (b) Go to the vtk\_data data folder that the simulation produced
	- (c) Click on the grouping of Bounds, click OK
	- (d) In VisIt, click on Add then Mesh→mesh. (e) Then click Draw
	- (f) You can elect to change the color of boundary or size by double clicking on the Mesh in the VisIt database listing window.
	- (a) Click Open
	- (b) Go to the vtk\_data data folder that the simulation produced
	- (c) Click on the grouping of u, click OK
	- (d) In VisIt, click on Add then Vector→u
	- (e) Then click Draw. An error message might pop up during at time-step zero (first data point) if velocity is identically zero
	- (f) You can elect to change the color, size, scaling, and number of velocity vectors by double-clicking on *u* in the VisIt database listing window
	- (g) To add streamlines of the velocity field, first make sure that your *Active Source* is set to *u* (see Figure 4a), then click Add→Pseudocolor→operators→IntegralCurve→u (see Figure 4b). Note you have the option to put numerous seed points for streamlines to stem in the domain. Here we have chosen to use a line of points, sampled it at 4 evenly spaced locations within that line, and specified particular integration tolerances, and a maximum number of steps (see Figure 4c). Click Draw. You can also adjust the streamline aesthetics to how you desire, e.g., color, thickness, etc.


**Figure 4.** VisIt graphical user interfaces (GUI) interface showing steps to illustrate velocity streamlines, e.g., (**a**) active source must be set on velocity field, (**b**) sequence to plot streamlines, and (**c**) streamline seeding location(s), accuracy tolerances, and solver-type.

	- (a) Click Open
	- (b) Go to the vtk\_data data folder that the simulation produced
	- (c) Click on the grouping of the desired Eulerian scalar data, for example, Omega (for Vorticity), click OK
	- (d) In VisIt, click on Add then Pseudocolor→Omega.
	- (e) Then click Draw
	- (f) You can elect to change the colormap and/or colormap scaling by double clicking on Omega in the VisIt database listing window. The following table (Table 2) details the specific colormap used for each scalar variable in the manuscript,

**Table 2.** Colormaps used for each scalar variable for visualization.


(g) To visualize the finite-time Lyapunov exponent (FTLE), your *Active Source* in Visit (see Figure 5a) must be on the velocity vectors, *u*. Then click Add→Pseudocolor→ operators→LCS→u (see Figure 5b). We used the attributes in Figure 5c for computing the FTLE. In particular, we limited the maximum advection time to 0.05 and maximum number of steps to 10. Once those are changed, click Draw.


**Figure 5.** VisIt GUI interface showing steps to illustrate finite-time Lyapunov exponents (FTLE), e.g., (**a**) active source must be set on velocity field, (**b**) sequence to plot FTLE (e.g., Lagrangian Coherent Structures, LCS), and (**c**) attributes for plotting, e.g., accuracy tolerances, solver-type, etc.

(h) To add contours of the desired scalar variable, first make sure that your *Active Source* (see Figure 5a) is set to the correct variable, then click Add→Contour→<desired variable name>. Note that you have the option to scale the contours separate from the colormap of the variable itself. Moreover, for FTLE your active source must be *u* and you can modify how FTLE are computed, e.g., Figure 5c; however, we used consistent values for both FTLE computations.

#### *3.3. Guide: Running the Spectral (FFT) Method's 'bubble3' Example*

In this guided walk-through, we wish to illustrate how to run a simulation and change its parameters while also observing what information is being printed to the screen. We will use the Spectral (FFT) Method's *bubble3* example and run two different examples where each uses a different fluid kinematic viscosity, *ν*.

To run the simulation(s), do the following:

1. First we must make sure that we are inside of MATLAB the corresponding directory for the MATLAB version of the spectral-based solver. To do this click through: Holy\_Grail→FFT\_NS\_Solver→MATLAB, see Figure 6. Note that I have downloaded (or cloned) the software into my Documents folder.

**Figure 6.** MATLAB GUI interface showing the path to the current directory folder for the MATLAB FFT-Based Spectral Solver as well as what files are contained within it.

2. To run this simulation, type FFT\_NS\_Solver into MATLAB's command window and click enter. See Figure 7 for what should print to the command window shortly thereafter. Note that the *bubble3* example is the default built-in example upon downloading the software (see Figure 3b).

Upon starting the simulation, information regarding the simulation solver and simulation is printed to the screen. Moreover, the current\_time within the simulation gets printed to the screen at the time-points in which the data is stored. The data is stored in the *vtk\_data* folder, which is made upon starting the simulation.

**Figure 7.** Showing the output on the screen when this example begins running. Note that the *vtk\_data* folder is produced, in which stores the simulation data at predetermined time-points.


Note that if you chose to change the grid resolution and domain size, make sure that the resolution in *x* and *y* are equal, i.e., *dx* = *Lx*/*Nx* = *Ly*/*Ny* = *dy*. Moreover if you increase the resolution (increase *Nx*, *Ny*) the simulations will take longer to run and the resulting data will require more storage.

**Figure 8.** Changing the kinematic viscosity, *ν*, to a different value.


Here we will guide the user through visualizing the bubble3 simulation data from Section 3.3. In particular we will visualize the magnitude of velocity data. Note that other Eulerian scalar data, like vorticity, the *x*- or *y*-component of velocity, etc., may be visualized analogously, as we are following the protocol from the previous section on data visualization, Section 3.2's *Visualizing the Eulerian scalar data*. To visualize the fluid's velocity vector field, please follow Section 3.2's steps for *To Visualize Velocity Vectors*.

To visualize the uMag data, do the following:

1. First we must open the desired magnitude of velocity data. Recall that the fluid's magnitude of velocity data was saved under the name *uMag*. Click open in the VisIt toolbar and in the dialog box that pops up, locate the desired data directory, here it is *Simulation\_Data\_1* from earlier, and select the uMag group. Figure 9 is provided as a visual aid for these steps.


**Figure 9.** Opening specific simulation data to visualize in VisIt.

2. Although we have opened the data, nothing will appear visualized, yet. However, now uMag is the *Active Source* in the window, see Figure 10. We must now tell VisIt how to visualize the data. We will visualize magnitude of velocity as a background colormap, as it is a scalar quantity. To do this click 'Add' and then select Pseudocolor from the menu that appears, followed by uMag, i.e., Add→Pseudocolor→uMag.

**Figure 10.** Opening specific simulation data to visualize in VisIt.

3. To finally visualize the data, click Draw. Window 1 will then show the fluid's magnitude of velocity data at time-point 0, i.e., the initial magnitude of velocity, see Figure 11.

**Figure 11.** 'Drawing' the data in VisIt. The data shown in Window 1 here corresponds to time-point 0, as given from the *time slider* value.

4. Furthermore, we note that certain choices of colormaps are better for both conveying the data, but also for people who are colorblind. Generally, the default colormap, which was used in Figure 11, is a bad choice, as it is impossible for people who are red-green colorblind to interpret the field [57]. Thus, we will change the colormap to another, e.g., the RdYlBu (red-yellow-blue) colormap, by double-clicking on the uMag.\*.vtk database:Pseudocolor uMag in the database list and appropriately selecting the desired colormap. Other properties may also be changed in this box, such as the colormap's scaling.

Also, you can visualize the magnitude of velocity at the different time-points that were saved during the simulation by moving the time-slider. Figure 12 shows the data at time-point 30. Moreover, the colormap and its properties may be modified by double-clicking on uMag.\*.vtk database:Pseudocolor uMag in the database list.

**Figure 12.** Changing the time-point to the 30th time-point stored.

5. Note that the time in the simulation does not generally correspond to the time-point stored. For example, in this case the simulation modeled 30 s of time and 60 total data time-points were stored. Thus, data was saved every 0.5 s of simulation time. Furthermore, you could repeat Steps 1–4 for data in *Simulation\_2\_Data* from the second simulation you ran. Instead of comparing the 30th time-point's data, we will compare the 60th, i.e., the last time-point. Repeating this entire process for the other simulation's data yields the comparison as shown in Figure 13, below.

**Figure 13.** Comparing the data between both simulations' last time-point (60th time-point stored). Note that a direct qualitative comparison is not possible because the scaling of each colormap is different.

However, we cannot qualitatively compare the magnitude of velocity between each of these simulations as they are in Figure 13. Each simulation's colormap has a different scale. In order to compare, we must make both scales equivalent.

6. To change the scale, double-click on each of the databases. This will bring up a dialog window (as described earlier) where you can change the scaling, e.g., minimum and maximum, as well as the colormap itself. Change the minimum and maximum values to 0.0 and 0.2, respectively. Figure 14 illustrates where to change the minimum and maximum for the colormap's scale. Once those values are changed, click Apply. Note that you must do this for both of the databases individually.


**Figure 14.** Changing the magnitude of velocity's colormap scaling.

7. After changing the scale, the comparison is significantly different than when first visualized, see Figure 15.

**Figure 15.** Comparing each simulation's magnitude of velocity data at the 60th time-point. The scaling of each colormap is identical which leads to straight-forward direct qualitative comparison.

Furthermore, we also provide visualizations of other time-points and/or scalar data in Appendix C.

*3.5. Guide: Analyzing the Spectral (FFT) Method's 'bubble3' Data*

To analyze the data in VisIt, we will provide a walk-through of the steps that necessary to measure a fluid quantity (particular variable) across a line of interest within the computational domain using the Spectral (FFT) Method's bubble3 example from Section 3.3. We will assume that you have visualized the data for the *magnitude of velocity* that corresponds to both of the simulations. In this tutorial we will compare the magnitude of velocity for both simulations across a vertical line through the center of the computational domain at the last time-point stored, i.e., the 60th time-point. See Figure 16 for an idea of where the measurement will take place.

To analyze the uMag data, do the following:

1. Make sure that *Active source* is the uMag data corresponding to the data from *Simulation\_1\_Data* in VisIt, see Figure 16.

Once the *Active Source* has been appropriately selected, in the command bar, in the VisIt menu go to Controls→Query (see Figure 16).

**Figure 16.** To analyze data in VisIt, the *active source* and *active time slider* must be set to specific data that is desired to be analyzed, e.g., here it is the magnitude of velocity, uMag, for the *Simulation\_1\_Data*.

2. Next select Lineout under *Queries* and then under *Variables* select Scalars and then uMag, i.e., Variables→Scalars→uMag, see Figure 17.

**Figure 17.** Within the *Query* dialog box, select (**a**) the chosen data to measure, e.g., here it is uMag, and (**b**) the Lineout option to measure the data across a line within the domain that is defined by a starting and ending point.


**Figure 18.** Illustrating the *Active window* change to window 2 as well as a plot of the magnitude of velocity (selected data) as measured across a vertical line at the center of the domain.

**Figure 19.** Comparing the measured magnitude of velocity data between both simulations at the last time-point data saved.

#### **4. Built-in Examples (for Each Fluid Solver)**

In this section we will highlight a subset of the built-in examples that can be run immediately upon download (or git clone) of the software. These examples were selected as they are either traditional problems in fluid dynamics or problems that could naturally lead to fruitful discussion and analysis of the underlying dynamics. The examples we will discuss are:


For each of these examples, we will provide the necessary simulation details, including a brief background about problem as well as the numerical parameters that were used in each simulation. Furthermore, we will also make observations regarding each simulation's dynamics, investigate some of the data, and suggest future ideas for how students could either modify or explore each example further.

These examples are available within both the MATLAB and Python implementations in the software. Note that Section 3 described how to run, visualize, and analyze the simulations, and thus the visualizations and analysis contained here can be recreated by students and other practitioners.

#### *4.1. Cavity Flow (via Projection Method)*

In this example we will use the Projection Method in the software to run a cavity flow problem. Note that this example is contained in the Projection Method folder and may be run by selecting the 'cavity\_top' option (see line 58 in Figure 3a).

For this lid-driven cavity flow problem, the non-zero horizontal velocity on the top wall, *u* = *uT*, is set to *uT* = 4.0 m/s, while all other tangential (and normal) velocities along the boundaries are set to zero (see Figure 1a). Note that the top wall velocity is not immediately set at *uT*, but rather the flow ramps up from 0 to the preset *uT* along this wall, to avoid instantaneous acceleration artifacts. For the simulations shown below with *Re* = 4000, use the computational parameters listed in Table 3. The Reynolds Number was set by defining the characteristic length scale to be *L* = *Lx*, the horizontal length of the domain, and the characteristic velocity to be *<sup>V</sup>* <sup>=</sup> *uT*, e.g., *Re* <sup>=</sup> *<sup>ρ</sup>LxuT <sup>μ</sup>* . To change the Reynolds Number, the dynamic viscosity was varied. For *Re* = 4000, 400, 40 and 4, we used *μ* = 1, 10, 100, and 1000 kg/(m · s) , respectively. Note that for the cases with *Re* = 4 and 40, we decreased the time-step to *dt* <sup>=</sup> <sup>5</sup> <sup>×</sup> <sup>10</sup>−<sup>5</sup> s to ensure numerical stability of solutions. If we had not, errors would have been magnified every time-step of the simulation and/or the numerical solutions may have blown up. In CFD it is common that one may need to vary the time-step depending on the *Re* or other parameters of the system. Situations in which very small time-steps need to be taken to ensure numerical stability of solutions are known as *stiff equations*, for more information please see [43].


**Table 3.** Numerical parameters for the Cavity simulation for *Re* = 4000.

Upon having run the cavity model for *Re* = 4000, we visualized its corresponding simulation data using VisIt [41], as illustrated by Figure 20, which gives colormaps of vorticity, magnitude of velocity, velocity in the horizontal direction throughout the domain, and pressure, as well as depictions of the velocity field, both as a scaled and non-scaled quantity. For the scaled velocity field snapshot, the scale factor was equal to the largest magnitude of velocity across the entire computational domain. In the non-scaled plot, streamlines are also given. Streamlines show the path that a passive particle would take in the flow at a particular moment in time. The data shown here was taken at *t* = 6.0 s, when the simulation ended.

**Figure 20.** Illustration of all the simulation data produced from the projection method example of cavity flow (at *Re* = 4000). This snapshot was taken at 6.0 s, as the simulation ended.

A fully-formed vortex developed by that time near the top of the cavity, while a smaller vortex appears to be forming below (see Vorticity pane in Figure 20). Snapshots illustrating the formation of such vortices from this case of *Re* = 4000 are presented in Figure 21, which gives a colormap of vorticity and the velocity vector field. As fluid is moving along the top edge of the domain from left-to-right, the fluid nearest to the top begins moving in the same direction. Eventually fluid down in the cavity begins moving in the same direction as well, until it reaches the right boundary, where it must move downwards. It is easier for the fluid to move downward because of the faster flows moving towards the right above it, due to the boundary condition. As the fluid moves downward along the wall, fluid towards the middle of the cavity begins moving downwards as well. In tandem, with the fluid moving left-to-right along the top and top-to-bottom along the right, these fluid patterns initiate the formation of a clockwise-spinning vortex.

Now that there is a vortex spinning clockwise, it causes the fluid below the vortex (moving right-to-left) to begin moving right-to-left until it reaches the wall on the left and an analogous situation occurs to the above, except an oppositely-spinning (counter-clockwise) vortex begins to form. Recall that these vortices can both be traced back to the fluid moving along the top of the domain left-to-right. Within the region that the second vortex forms, much of the energy (velocity) has dissipated away, resulting in a smaller, less strong vortex.

We can explicitly measure the horizontal velocity descending down the cavity. This data is presented in Figure 22, which gives the horizontal velocity vs. depth in the cavity during four different snapshots in the simulation. We also measure the horizontal velocity across three different lines descending into the cavity. Near the surface of the cavity (at depth = 0 m), the velocity is equal to the boundary condition. As one descends into the cavity, there are spikes in both the positive and negative horizontal velocities. These spikes correspond to locations near the edges of the vortices, where there is faster moving fluid.

**Figure 21.** Snapshots showing the evolution of vortical flow patterns during a simulation with *Re* = 4000. The background colormap is of vorticity and the velocity vector field is also given.

Finally, one can change the *Re* by varying the dynamic viscosity, *μ* to observe how vortex formation changes within the cavity, as well as, how quickly energy gets dissipated in higher viscosity settings. Recall that if *μ* is changed to 40 or 4 the time-step, *dt*, was adjusted for as described above. Figure 23 illustrates how vortex formation changes within the cavity for different *Re* at three different snapshots during the simulations. Moreover, it gives the horizontal velocity vs. cavity depth, as measured across the middle of the cavity. Note that the *Re* = 4 and *Re* = 40 data virtually overlaps in the figure, and velocity (and system's energy) quickly dissipates to zero going further into the cavity.

**Figure 22.** Snapshots of horizontal velocity measurements, when measured down the cavity in three places for *Re* = 4000.

**Figure 23.** A comparison of vorticity, velocity field, and horizontal velocity measurements down the center of the cavity between cases of *Re* = 4, 40, 400, and 4000.

Students may elect to try the following:


#### *4.2. Circular Flow in a Square Domain (via Projection Method)*

In this example we will use the Projection Method in the software to run an example involving circular flow in a square domain. Note that this example is in the Projection Method folder and may be run by selecting the 'whirlwind' option (see line 58 in Figure 3a).

In this case, all the tangential boundary conditions along the computational domain were set to be *U* = *utop* = −*ubot* = *vlef t* = −*vright* = 1.0 m/s, see Figure 1b. As mentioned in Section 4.1 above, the tangential wall velocities are not immediately set to *U*, but rather the flow ramps up along each edge from 0 to the preset *utop*, *ubot*, *vlef t*, or *vright* along this wall, to avoid instantaneous acceleration artifacts. For the simulation shown below with *Re* = 4000, use the computational parameters listed in Table 4. Note that as *Re* = *<sup>ρ</sup>LU <sup>μ</sup>* , with *L* = *Lx* = *Ly* and *U* = 1.0 m/s, one can vary the dynamic viscosity, *μ*, to change the *Re*. If you decide to make *Re* smaller (e.g., increasing *μ*), you may also need to decrease the time-step, *dt*, significantly to ensure numerical stability, as mentioned in Section 4.1. The requirement that very small time-steps are necessary to ensure numerical stability denotes what are called *stiff equations*. For more information on stiff equations, please see [43].


**Table 4.** Numerical parameters for the whirlwind simulation for *Re* = 4000.

Having run the circular flow simulation for *Re* = 4000, we visualized its corresponding simulation data using VisIt [41], see Figure 24, which gives colormaps of vorticity, magnitude of velocity, velocity in the horizontal and vertical directions, and the finite-time Lyapunov exponent (FTLE). The FTLE can be used to find the rate of separation in the trajectories of two infinitesimally close parcels of fluid. Maxima in the FTLE have been used to determine approximations to the true Lagrangian Coherent Structures (LCSs). LCSs are used to determine distinct flow structures in the fluid [58–61] can be used to divide the fluid's complex dynamics into distinct regions to better understand transport properties of flow [62–64]. True LCSs would require knowledge of the infinite-time Lyapunov exponent (ITLE); however, the FTLE can serve as a proxy to the ITLE. In this paper, we computed the forward-time FTLE field, whose maximal ridges give approximate LCSs corresponding to regions of repelling fluid trajectories and whose low values give rise to regions of attraction [61]. Thus, the FTLE can be used to help find regions of high fluid mixing [58,59,61,65,66].

Figure 24 also provides contours for each quantity. It also includes a depiction of the fluid velocity field, as scaled by the maximum in the entire domain's magnitude of velocity, which also includes its associated streamlines. Recall that streamlines are curves that depict instantaneous tangent lines along

direction of the flow velocity. They show the direction that a neutrally-buoyant particle would travel at a particular snapshot in time. These are different than contours (also known as level-sets or isolines), which are curves where a function has a constant value. This snapshot was taken at *t* = 24.0 s, when the simulation ended.

**Figure 24.** Illustration of some of the data produced for the circular flow example, using the projection method. The data shown is from the final time-step for *Re* = 4000.

As the velocity boundary conditions continually increased, the interior of the domain began to move clockwise, in the same direction as the flow at the boundaries (see Figure 1b). The colormaps and contours in each velocity-related panel reveal that flow speeds decrease towards the interior of the domain. Moreover, as all the boundary conditions are uniform, the vertical and horizontal velocity plots are identical under a 90 degree rotation. Also, the vorticity plot illustrates that vorticity is still low by the ending of the simulation in the center of the domain, even though flow across the whole domain is rotating clockwise. The FTLE plot suggests that the majority of fluid mixing occurs near the edge of the domain, rather than the interior, as higher values of FTLE suggest nearby fluid trajectories move away from each other at higher rates. This is due to larger spatial gradients in the velocity in these regions, where flow is moving at different speeds in different directions.

We also present data comparing simulations for *Re* = 400, 1000, and 4000 (for *μ* = 2.5, 1.0, and 0.25 kg/(m · s), respectively). Figure 25 illustrates colormaps of the magnitude of velocity (with corresponding contours) at various time-points during the simulation. Every colormap uses the same scaling in the figure. Higher velocities appear to creep into the interior of the domain quicker in the lower *Re* cases. By *t* = 24 s it appears that the *Re* = 400 and 1000 cases look almost identical, the *Re* = 4000 case tells a different story - the interior of the domain is still moving considerable slower than the other two cases. This might seem counter-intuitive at first, as one might generally think that higher *Re* tends to lead to more fluid motion, especially when we are lowering viscosity to increase *Re*. However, this is due to differences in time-scales for the diffusion of momentum through the fluid. The viscous diffusion time can be thought of as the time it takes for a fluid parcel to diffuse a particular distance on average. If ˜*t* is the diffusion time, *ν* = *μ*/*ρ* is the kinematic viscosity, and ˜ *l* is the mean-squared distance, then

$$I \sim \frac{I}{\nu} \sim \frac{1}{\nu'}$$

if all of the simulation geometries are identical and only *μ* (and hence *ν*) is varied. This concept is based off viewing diffusion as a random walk process [67]. Hence for the simulations presented here the time-scales vary between

$$
\overline{\mathbf{f}}\_{Rc=400} \sim \frac{1}{2.5/1000} = 400 \,\text{s} \quad \text{and} \quad \overline{\mathbf{f}}\_{Rc=4000} \sim \frac{1}{0.25/1000} = 4000 \,\text{s}.
$$

**Figure 25.** Snapshots showing the evolution of the magnitude of velocity between cases of *Re* = 400, 1000, and 4000.

Therefore in the *Re* = 4000 case, the diffusion time-scale is 10*x* longer than that of the *Re* = 400 case, and thus the dynamics evolve much slower in the *Re* = 4000 case! Moreover, this phenomena is shown in Figure 26, which illustrates the fluid velocity field along with its associated streamlines at the same snapshots in time.

This is more apparent if we compare flow profiles within the domain. Figure 27 compares the horizontal flow profile for *Re* = 400, 1000, and 4000 across the vertical mid-line of the domain. As mentioned above the dynamics in the *Re* = 4000 case evolves about 4*x* and 10*x* slower than the *Re* = 1000 and *Re* = 400 cases, respectively. By 24.0 s, the flow profiles in the *Re* = 400 and *Re* = 1000 cases look almost identical, while the flow profile in the *Re* = 4000 resembles that of the the flow profile in the *Re* = 1000 at ∼6.4 s—approximately a factor of 4 different in time. Furthermore Figure <sup>28</sup> shows the flow profiles for all three cases of *Re* when the diffusion of momentum has reached the same depth. This occurs at different simulation times due do the variations in viscous diffusion time-scales.

**Figure 26.** Snapshots showing the velocity field's evolution between cases of *Re* = 400, 1000, and 4000. Streamlines of the velocity field are also illustrated.

**Figure 27.** Snapshots showing horizontal velocity measurements across a vertical line centered in the domain among cases for *Re* = 400, 1000, and 4000.

**Figure 28.** Snapshots showing horizontal velocity measurements across a vertical line centered in the domain among cases for *Re* = 400, 1000, and 4000 in which similar momentum diffusion depths have been reached.

Students may elect to try the following:


#### *4.3. Side-by-Side Voritices (via Spectral Method)*

In this example we will use a FFT-based fluid solver in the software to run a simulation of multiple regions of vorticity interacting with one another. Note that the first example given here can be run by going into in the *FFT\_NS\_Solver* script selecting the 'qtrs' option (see line 47 in Figure 3b). The vorticity is initialized as in Figure 2a. We will also highlight the 'half' option in this section as well.

Recall that for this solver, an initial vorticity configuration is needed. For the simulations of four interacting vorticity regions, the *CW* and *CCW* vorticity were initialized as *ω* = −1 and 1 rad/s, respectively. In other cases with only two interacting voricity regions, the strengths of each regions were varied between −1, −0.5, 0.5 and 1 rad/s, as appropriate. For the simulations shown below with either 2 or 4 interacting vorticity regions, use the computational parameters listed in Table 5.


**Table 5.** Numerical parameters for the 4 interacting vortices simulation.

Figure 29 provides the simulation data for the case with 4 interacting vorticity regions, as described above. It presents colormaps for vorticity, magnitude of velocity, horizontal velocity, vertical velocity, and the finite-time Lyapunov exponent (FTLE), which is used to determine approximations to the true Lagrangian Coherent Structures (LCS) to which can be used to distinguish fluid mixing regions [58,59,61,65,66]. Their corresponding contours are also given. Recall that contours are curves to which the value of a quantity is constant. Figure 29 also gives a snapshot of the velocity vector field. This data is from the last snapshot of the simulation at *t* = 5.0 s.

The top two and bottom two vorticity regions are initialized the same, e.g., clockwise (CW) and counterclockwise (CCW), respectively, by this point in the simulation they are beginning to lean in the direction of rotation. Moreover, it can be seen that fluid is moving quickly horizontally through the top, middle, and bottom of the domain, as illustrated by the magnitude of velocity plot. When this is compared to the horizontal velocity plot, one observes that the fluid along the top and bottom of the domain both are moving left-to-right, while fluid moving horizontally through the middle of the domain is moving right-to-left. These directions align with the direction of the spinning vortices in each of these horizontally-aligned regions—top, middle, and bottom, which can be seen in the velocity vector field depiction.

The high values of FTLE illustrate regions of higher fluid mixing, as higher FTLE suggest faster rates of separation of close fluid blobs. In Figure 29 these are the areas between the top-two and bottom-two vorticity regions. Within these regions there is intense shearing among the vertical flow velocity, see the vertical velocity plot. Red regions in the vertical velocity plot indicate fluid moving upwards while blue corresponds to downward fluid motion. Moreover, from the nature of the FFT-solver, the periodic boundary conditions, illustrate that along vertical walls of the domain on opposite sides there are regions where fluid is moving the the opposite direction. Hence the large FTLE values on the left and ride side of the top-two and bottom-two vortices. There is significantly less mixing in the top, middle, and bottom horizontal strips across the domain because fluid is generally moving unidirectionally in these regions with lower spatial gradients.

**Figure 29.** Illustrations of the simulation data produced during the case of 4 interacting vorticity regions. The data shown is from the last time-step.

One could elect to change the size or strength of a subset of these vorticity regions to simulate asymmetric vorticity interactions in this configuration. However, rather than study 4 interacting vorticity regions, we compared 2 interacting regions at a time, and varied the strength (magnitude of vorticity), size, and initial vorticity values (spinning-direction) between them, see Figure 30. Figure 30 provides comparison data of snapshots at *t* = 6.0 s in each simulation for different quantities—either vorticity with velocity vectors, magnitude of velocity with its corresponding contours, and FTLE with its corresponding contours. We use the language that a "strong" vorticity region has a |*ω*| = 1 rad/s, while a "weaker" region has a vorticity of |*ω*| = 0.5 rad/s. Each initial size of the vorticity regions had a radius of 0.15 m or 0.3 m.

In general, one can notice the following:


Students may elect to try the following:


**Figure 30.** Vorticity and velocity field (**left column**) and magnitude of velocity with its associated contours (**right column**) for cases of two vorticity regions with different sizes, strengths, and vorticity initialization.

#### *4.4. Evolution of Vorticity from an Initial Velocity Field*

In this example using a spectral (FFT) solver, we begin with a snapshot of the velocity vector field from an independent CFD simulation, see Figure 31a,b. Note that this snapshot was taken from an open-source fluid-structure interaction example of a pulsing cartoon heart [36]. We used a stored time-point's velocity field data, to which we extracted the horizontal and vertical velocity components, and then computed its associated vorticity at that particular time-step, see Figure 31c. We note that there are numerical errors in computing the vorticity, *ω*, as a centered finite difference scheme [43] was used to compute each first-order partial derivative in calculating vorticity, i.e., *ω* = *<sup>∂</sup><sup>v</sup> <sup>∂</sup><sup>x</sup>* <sup>−</sup> *<sup>∂</sup><sup>u</sup> <sup>∂</sup><sup>y</sup>* . Moreover, since this fluid solver uses periodic boundary conditions, we computed the partial derivatives at each boundary using data from the opposite side of the computational domain. Note this example may be run by selecting the 'jets' option in the *FFT\_NS\_Solver* script (see line 47 in Figure 3b).

**Figure 31.** (**a**,**b**) Unscaled and scaled velocity vector field, respectively, that was used to define the initial fluid vorticity (**c**).

After having computed the vorticity from a velocity field, the simulation could begin. This simulation used the computational parameters listed in Table 6. We further note that the velocity field had an original grid resolution of [*Nx*, *Ny*]=[512, 512], so we down-sampled it to a [256, 256] grid for the example shown here. Furthermore, as the original velocity field was computed from an independent fluid-structure simulation, we comment that there is no complex, moving boundary within the computational domain; however, at the initial point you can see the remnants of the coinciding heart structure, see Figure 31.


**Table 6.** Numerical parameters for case of evolving vorticity from an initial velocity field.

Figure 32 provides snapshots over the simulation to illustrate how the vorticity and magnitude of velocity evolve. Both Figure 32a,b illustrate the effect of periodic boundary conditions along each edge of the domain, e.g., vortices moving through the top or right side of the domain continue through the bottom or left side of the domain, respectively. Furthermore, in the snapshots provided, the overall vorticity and magnitude of velocity appears to dissipate within the domain. This is because there are no source terms (or explicit boundary conditions) providing additional flow (energy) into the system to induce more flow. Although the original velocity vector field that defined the initial vorticity of the system came from a simulation of pulsing hearts, without the heart moving and thus pushing on the fluid, the fluid will eventually stop moving and reach zero velocity due to the fluid's viscous nature. Therefore initializing the vorticity out of a time-point from another simulation's velocity field, is akin to studying the evolution of the fluid's motion from a singular impulse in the flow.

**Figure 32.** The evolution of (**a**) the fluid vorticity and (**b**) magnitude of velocity during the course of the simulation.

Students may elect to try the following:


#### *4.5. Flow Past One or More Cylinders (via Lattice Boltzmann)*

Flow past objects is one of the most heavily studied problems in aerodynamics and thus is a standard example used in many fluid dynamics courses [68–70]. While many texts only consider the problem for inviscid flows and use potential flow methods to solve for exact solutions [69,70], here we include effects of viscosity to illustrate transitions to vortical flow, and upon doing so, a subset of the possible flow separation cases. Furthermore, flow past cylinders is also still an active area of contemporary research [71–77].

We performed simulations for both a single cylinder as well as multiple cylinders. The computational geometry for a single cylinder case is given in Figure 33. Figure 33a gives the boundary conditions considered for the problem for flow past a rigid cylinder contained within a rigid channel. The walls of the channel are rigid and so bounce-back boundary conditions are used. The ends of the channel use periodic boundary conditions, e.g., what goes out the right side, comes in through the left. Note that this is the first example discussed in which uses a mix of explicit boundary conditions and periodic boundary conditions. Moreover, the cylinder itself is modeled as a rigid structure and so bounce-back conditions are used on it. Figure 33b provides visual details how the inflow is modeled in the simulation. Every iteration, the horizontal velocity at the inflow is increased by an amount of Δ*Ux* to drive fluid flow towards the right.

**Figure 33.** The geometrical setup for flow past cylinders using the Lattice Boltzmann method. (**a**) The boundary conditions specified on all sides of the domain and on the cylinder within the channel and (**b**) the inflow condition.

All simulation parameters (fluid, grid, and geometry) for both cases involving either a single cylinder or multiple rigid cylinders are given in Table 7. Note that the cases with multiple cylinders simulate flow around cylinders with larger radii, use a larger value for Δ*Ux*, and a different final number of steps and grid resolutions. Furthermore, due to these differences we are not comparing the case of one single cylinder to the case with multiple cylinders.


**Table 7.** Numerical parameters for flow past one or more cylinders using the Lattice Boltzmann Method.

The simulation data obtained at step *n* = 49, 600 is given in Figure 34. It presents colormaps (and corresponding contours) for vorticity, magnitude of velocity, horizontal velocity, vertical velocity, and the finite time Lyapunov exponent (FTLE), to which knowledge of the approximate Lagrangian

Coherent Structures (LCS) can be extracted [58,59,61,65,66]. We attribute regions with high FTLE to regions of high fluid mixing, as higher FTLE suggests that nearby fluid parcels separate at a much faster rate than those in lower FTLE regions. From the vorticity panel, significant flow separation is seen as vortices are being shed off the cylinder and flow pushes past it left-to-right. Oppositely spinning vortices are shed off cylinder one after another. Moreover, we observe that there is significantly more horizontal fluid motion than vertical within the channel. Since flow is being pushed left-to-right from the inflow condition, it would require more energy for fluid to move vertically, than to simply. . . go with the flow. Figure 35 provides snapshots of vorticity (left) and FTLE (right) during the simulation to highlight how smooth flow developed into vortical flow patterns once the horizontal velocity increased past a threshold. Such threshold appears to have occurred around simulation step ∼ 47, 000.

In particular, flow instabilities began to manifest by step 46, 000, as seen by both the vorticity and FTLE snapshots. The majority of fluid mixing occurred in large contours behind the cylinder up to this point. Once flow separation occurs, some mixing occurs in the wake in small patches, but no geometrically long regions of higher fluid mixing are present, as seen by the contours. Note that in the last two panels, for steps 49, 200 and 49, 600, large FTLE-valued regions do not correspond to locations of shed vortices, rather higher FTLE valued regions appear between oppositely spinning vortices.

**Figure 34.** Illustrations of the flow field at the end of a simulation with one cylinder in the channel, showing colormaps of vorticity, magnitude of velocity, vertical and horizontal velocity, and finite-time Lyapunov exponent.

**Figure 35.** Illustrations depicting the flow's evolution to vortex shedding using vorticity (**left column**) and finite-time Lyapunov exponent (**right column**) with their contours, respectively.

Finally we performed simulations with multiple cylinders in a channel. Each cylinder in these simulations had a radii 66% larger than the single cylinder shown above. We performed three separate simulations with different configurations of the cylinders, each based off a triangle formation. Figure 36 illustrates how flow evolved for each geometric configuration, in particular for (a) vorticity and (b) FTLE.

Vortices are observed shedding off each cylinder, possibly at an enhanced rate due to flow interactions with the other cylinders (see suggested activity below). In the symmetric configurations, e.g., the triangle-formation and vertical-line formation, flow symmetry is preserved, while in the case with only one trailing cylinder, flow asymmetries arise. FTLE plots at the last step shown (5000) illustrate different geometrical configurations not only can lead to different patterns of fluid mixing, but also enhanced mixing, even among cases with only two cylinders. The vertically-aligned cylinder case appears to elicit more downstream mixing in the wake than the case of asymmetrically placed cylinders; however, this may also be an artifact of overall geometry of the system, e.g., the size of the cylinders and the proximity of cylinders to the channel walls.


**Figure 36.** Snapshots from simulations of multiple cylinders in different configurations showing (**a**) vorticity and (**b**) finite-time Lyapunov exponents with their contours, respectively. Note that the colormaps are the same as used in Figure 35.

Students may elect to try the following:


#### *4.6. Flow Past a Porous Cylinder (via Lattice Boltzmann)*

While flow around solid objects is a popular problem in aerodynamics, flow around porous objects has only recently begun to be investigated within in the past few decades, using either high

fidelity numerical simulation or experiments [78–82]. Here, we present an example of flow past a porous cylinder using the LBM. The cylinder geometry, computational setup, and inflow/boundary conditions are identical to the single cylinder case of Section 4.5 (see Table 7). The only difference being that the cylinder geometry itself is porous.

The porosity, or void fraction (*VF*), of the cylinder was chosen to be *VF* ∈ {0%, 10%, 25%, 50%, 62.5%}. To model the void fraction, each grid cell inside the cylinder was given a random number between [0, 1] and then depending on the specific *VF*, if that grid cell's randomly assigned number was above the *VF* in decimal form, it was assigned as a solid boundary. For example, for *VF* = 25%, each grid cell with a randomly assigned number greater than 0.25 was declared a solid boundary point. Figure 37 depicts the porous cylinders considered for each *VF* case studied below.

Although, the cylinder is no longer uniformly solid, in this example we will not focus our efforts to study flow through the cylinder itself. For example, in Figure 37's *VF* = 10% case, there are holes in the interior of the cylinder domain that are not connected to the fluid region outside of the cylinder. Those void regions will not influence the flow outside of the cylinder, as they are blocked from outside fluid penetrating them. However, if you wanted to study the fluid dynamics through a porous structure, you could design a specific void network structure within the cylinder or in another desired geometry. What we will emphasize here is that the porous regions connected to the outside of the cylinder cause asymmetries to develop in the overall flow pattern at an accelerated rate as compared to the non-porous (solid) case. Such asymmetries then lead to quicker vortex shedding.

**Figure 37.** The porous cylinders considered in this section for different void fractions, *VF* = {0, 10, 25, 50, 62.5}. Note that the porous structures were initialized randomly within the cylinder, so there may not be open networks through the cylinder from one side to the other. The slight geometrical perturbations are sufficient enough to initiate quicker transitions to vortex shedding in each case of porous cylinder than the case of *VF* = 0.

Figure 38 shows the evolution of vortex shedding in cases of differing porosities (void fractions) of {0%, 10%, 25%, 50%, 62.5%}. Every case shows that more porosity leads to faster development of vortex shedding. Furthermore, even the case with *VF* = 10% has pronounced vortices being shed before the *VF* = 0% case even shows any signs of significant flow asymmetry. The increased porosity accelerates flow asymmetries to manifest, leading to vortex shedding occurring earlier on. This example highlights how small perturbations in fluid dynamics problems (here small differences in geometric structure) can lead to the system having significantly different time-scales for flow structures to develop or for a bifurcation in the resulting dynamics to emerge.

**Figure 38.** Snapshots illustrating vorticity (with its contours) among cases of differing void fractions, *VF*.

Students may elect to try the following:


#### **5. Discussion**

In this work we provide software that was developed for the specific purpose to make CFD accessible to undergraduate (and graduate) students in order to provide them an opportunity to perform traditional and contemporary CFD simulations as a valuable learning experience. To that end all the fluid solvers contained within were written in both MATLAB and Python, two languages that are commonly familiar to most science and engineering students [24–28,31]. Students also have the opportunity to modify existing examples or create their own examples within the software to test hypothesis or for stimulate further scientific curiosity. To that extent, we provided an overview of how the code is structured (Section 3) and offered interesting variations to each of the examples that we showcased in this paper (Section 4).

Not only can students run CFD simulations, they also have the chance the practice the art of scientific visualization, and use open-source software that is used by many researchers (VisIt [41] or Paraview [42]), to visualize the corresponding data. These software packages are both open-source and have easy-to-use and learn graphical user interfaces (GUIs) that streamline the visualization process. They can also be used to perform data analysis as well, which further reduces the computational learning curve for students to be able probe the data produced. We provided step-by-step guides on how to use VisIt for these tasks in Section 3.

By performing their own CFD experiments, fluid dynamics students have the opportunity to vary parameters (e.g., fluid scale (*Re*), boundary conditions, geometry, etc.) of a given system and observe the resulting dynamics. More specifically, they are able to decrypt how the dynamics may vary across parameter regimes, both qualitatively and quantitatively. This grants them the ability to challenge their own developing intuition of the resulting flow physics to further accelerate their learning. They also gain more computer experience and witness first-hand some of the advantages that complex computer simulations offer.

If students wish to go a step further and study the underlying mathematical structure of the code, we provide insightful comments everywhere possible within each fluid solver script. To complement this, we provided a detailed mathematical overviews of each fluid solver used here in Appendix B. While it is not our mission here to teach students how implement their own numerical fluid solvers, we believe this work contributes to providing a foundation for capturing the importance (and utility) of different fluid solver schemes. For each solver that was introduced for particular applications in Sections 2.1–2.3, we give a high-level overview of the method. If students wish to continue learning about numerical methods for solving the fluid equations or numerical methods for partial differential equations in greater depth, we suggest Barba and G. Forsyth's *CFD Python: the 12 steps to Navier-Stokes equations* [33], L.A. Barba and O. Mesnard's *Aero Python: classical aerodynamics of potential flow using Python* [34], both of which use Jupyter Notebooks [38], or Pawar and San's [39] modules for developing fluid solvers in the Julia programming language [40].

In this day and age, as the importance of computer literacy increases rapidly [83–86], integrating more hands-on computer-based activities into course structures will be of critical importance. However, students also seeing successful execution of code is paramount [85]. Here we provide gateway software for students to dive into the world of CFD, in familiar programming environments. While proprietary software offers immense advantages to running simulations and analyzing data, students may see a disconnect between the programming knowledge they've acquired and such polished software. We hope to provide them a unique opportunity to see fluid solvers written in familiar, non-intimidating environments that they may be able to tweak and modify comfortably. Our hope is to inspire further ownership of their learning and to stimulate more interest in (lucrative, transferable) computer programming skills.

#### **Supplementary Materials:** The following are available at http://www.mdpi.com/2311-5521/5/1/28/s1.

**Funding:** N.A.B. was funded and supported by the NSF OAC-1828163, the TCNJ Support of Scholarly Activity (SOSA) Grant, the TCNJ Department of Mathematics and Statistics, and the TCNJ School of Science.

**Acknowledgments:** The author would like to thank Laura Miller for introducing him to the joys of computational fluid dynamics. He would also like to thank Christina Battista, Robert Booth, Christina Hamlet, Alexander Hoover, Matthew Mizuhara, Arvind Santhanakrishnan, Emily Slesinger, and Lindsay Waldrop for comments and discussion. He also would like to sincerely thank the Reviewers, especially Reviewer 2, whose above and beyond effort in providing incredibly thorough, insightful, and constructive feedback led to the manuscript becoming significantly stronger.

**Conflicts of Interest:** The author declares no conflict of interest.

#### **Abbreviations**

The following abbreviations are used in this manuscript:


#### **Appendix A. Instructor Resources**

#### **Teaching Resources:**

Associated supplemental files contain movies and codes pertaining to all the simulations detailed in this paper. It encompasses the following:


#### **Appendix B. Select CFD Algorithms**

In this appendix we will discuss various numerical algorithms for studying fluid dynamics, namely a projection method [2–5], a spectral methods solver based on the Fast Fourier Transform (FFT) [7–9], and the lattice Boltzmann method [11,12]. Codes are available to test these methods at https://github.com/nickabattista/Holy\$\_\$Grail/. Their corresponding simulation data is saved in the *.vtk* format, as to allow for visualization and analysis using open-source programs, such as VisIt [41] or ParaView [42].

#### *Appendix B.1. Projection Methods*

The projection was first introduced by Chorin in 1967 [2] and independently a year later by Temam [4] to solve the incompressible, Navier-Stokes equations [2]. The key feature of this method is that it uses operator splitting and Helmholtz-Hodge decomposition to decouple the velocity and the pressure fields, making it possible to explicitly solve the incompressible, Navier-Stokes equations in only a few steps.

We will begin by introducing some notation. We denote **u***<sup>n</sup> ij* = **<sup>u</sup>***n*(*xi*, *yj*) to be the velocity field field at time-step *<sup>n</sup>* and spatial location (*xi*, *yj*), where {*xi*}*Nx <sup>i</sup>*=<sup>0</sup> and {*yj*} *Ny <sup>j</sup>*=<sup>0</sup> are the *x* and *y* values of the discretized rectangular (Eulerian) computational grid. Furthermore, **u***<sup>n</sup>* represents the velocity field at time-step *n* in its entirety, e.g., not at one specific spatial location.

In the first step, an auxiliary (intermediate) velocity field is computed by ignoring any dependencies on the pressure. This is essentially an operator split. This velocity field found will not be

divergence-free, and hence the necessary incompressible condition will not be satisfied (Equation (2)). In discretization terms, this step takes the form of

$$\frac{\mathbf{u}^\* - \mathbf{u}^n}{\Delta t} = -\left(\mathbf{u}^n \cdot \nabla\right)\mathbf{u}^n + \nu \Delta \mathbf{u}^n,\tag{A1}$$

where **u**∗ is an intermediate (auxiliary) velocity field, which is not divergence-free. The second step is known as the projection step, where the pressure gets reintroduced to give a final velocity field, **u***n*+<sup>1</sup> that satisfies the incompressibility condition (Equation (2)). This discretized step takes the following form,

$$\frac{\mathbf{u}^{n+1} - \mathbf{u}^\*}{\Delta t} = -\frac{1}{\rho} \nabla p^{n+1},\tag{A2}$$

where *pn*+<sup>1</sup> is the pressure field at the next time-step. Because it requires an updated pressure term, we must first find such a pressure. To do this we recall Helmholtz-Hodge Decomposition [87,88], which says any vector field, that is twice continuously differentiable on a bounded domain, say **v**, can be decomposed into a solenoidal part (divergence-free) and an irrotational part (curl-free), i.e.,

$$\mathbf{v} = \mathbf{v}\_{\text{sol}} + \mathbf{v}\_{\text{irr}} = \mathbf{v}\_{\text{sol}} + \nabla \phi,\tag{A3}$$

where **v***sol* is the solenoidal part and **v***irr* is the irrotational part. We note that an irrotational vector field can be written as the gradient of a scalar, e.g., **v***irr* = ∇*φ*, where *φ* is some scalar function (sometimes *φ* is referred to as a *potential*).

Note that if we take the divergence of (A3), we obtain,

$$
\nabla \cdot \mathbf{v} = \Delta \phi.\tag{A4}
$$

It is then possible to find the divergence-free part of the vector field **v** by solving the above Poisson problem in (A4). This motivates the form of the second step for a projection method given in (A2). However, to find the pressure, we take a divergence of (A2) and note that we require that **u***n*+<sup>1</sup> be divergence-free, i.e.,

$$
\nabla \cdot \mathbf{u}^{n+1} = 0.\tag{A5}
$$

Taking the divergence of (A2) and requiring the condition in (A5), we obtain the following Poisson problem for the pressure, *pn*<sup>+</sup>1, in terms of the intermediate velocity field **u**∗,

$$\frac{\Delta t}{\rho} \Delta p^{n+1} = \nabla \cdot \mathbf{u}^\*.\tag{A6}$$

Note that this equation can be solved explicitly. Hence once *pn*+<sup>1</sup> is found, we can then solve for **u***n*+<sup>1</sup> using (A2), e.g.,

$$\mathbf{u}^{n+1} = \mathbf{u}^\* - \frac{\Delta t}{\rho} \nabla p^{n+1}.\tag{A7}$$

*Appendix B.2. Spectral Methods via Fast Fourier Transform (FFT)*

For the spectral (FFT) method fluid solver we choose to work in the vorticity formulation of the viscous, incompressible Navier-Stokes equations. Here we will begin by deriving such equations from the previously written viscous, incompressible Navier-Stokes equations, i.e., Equations (1) and (2),

$$\rho \left[ \frac{\partial \mathbf{u}}{\partial t} + (\mathbf{u} \cdot \nabla) \mathbf{u} \right] = -\nabla p + \mu \Delta \mathbf{u}$$

and

$$\nabla \cdot \mathbf{u} = 0.$$

We will use a lot of identities from vector calculus. First, recall the following identity for any vector **F**,

$$(\mathbf{F} \cdot \nabla)\mathbf{F} = (\nabla \times \mathbf{F}) \times \mathbf{F} + \frac{1}{2}\nabla(\mathbf{F} \cdot \mathbf{F}).$$

Substituting the above identity into the conservation of momentum equation (Equation (1) and dividing by *ρ* gives us,

$$\frac{\partial \mathbf{u}}{\partial t} + (\nabla \times \mathbf{u}) \times \mathbf{u} + \frac{1}{2} \nabla (\mathbf{u} \cdot \mathbf{u}) = -\frac{1}{\rho} \nabla p + \nu \Delta \mathbf{u},\tag{A8}$$

where *ν* = *<sup>μ</sup> <sup>ρ</sup>* is the kinematic viscosity. Note that **u** · **u** is a scalar quantity, and thus we define it to be *<sup>U</sup>*<sup>2</sup> <sup>=</sup> **<sup>u</sup>** · **<sup>u</sup>**. Moreover, we also get to define a new quantity called the vorticity,

$$
\boldsymbol{\omega} = \nabla \times \mathbf{u}.\tag{A9}
$$

It is tempting to think of *ω* as describing the global rotation of the fluid, but this is misleading. Although many flows can be characterized by local regions of intense rotation, such as smoke rings, whirlpools, tornadoes, or even the red spot on Jupiter, some flows have no global rotation, but do have vorticity. Vorticity describes the *local* spinning of a fluid near a fixed point in space, as seen by an observer in the Eulerian framework.

Substituting the definitions of vorticity and *U*<sup>2</sup> into Equation (A8), we obtain

$$\frac{\partial \mathbf{u}}{\partial t} + \boldsymbol{\omega} \times \mathbf{u} + \frac{1}{2} \nabla(\boldsymbol{\ell} \boldsymbol{\ell}^2) = -\frac{1}{\rho} \nabla p + \nu \Delta \mathbf{u}.$$

Now taking the curl of the above equation we get an equation for the evolution of the vorticity, yields

$$\frac{\partial \boldsymbol{\omega}}{\partial t} + \nabla \times (\boldsymbol{\omega} \times \mathbf{u}) = \boldsymbol{\nu} \Delta \boldsymbol{\omega},\tag{A10}$$

since ∇ × (Δ**u**) = Δ(∇ × **u**) = Δ*ω*. Furthermore we note that the pressure terms drop out as the resulting force from pressure only acts perpendicular to the surface of a fluid blob and not parallel to it, i.e., ∇ × (∇Φ) = 0 for any scalar field Φ.

The viscous, incompressible Navier-Stokes equations can thus be written as follows,

$$\frac{\partial \boldsymbol{\omega}}{\partial t} + \nabla \times (\boldsymbol{\omega} \times \mathbf{u}) = \boldsymbol{\nu} \Delta \boldsymbol{\omega} \tag{A11}$$

$$\nabla \cdot \mathbf{u} = 0 \tag{A12}$$

Shortly we will introduce a vector potential to strive towards introducing a streamfunction, *ψ*, into our formulation, but first we will use a vector calculus identity to re-write Equation (A11) into a more traditional looking advection-diffusion equation. Using the following identity from vector calculus,

$$\nabla \times (\mathbf{A} \times \mathbf{B}) = (\nabla \cdot \mathbf{B} + \mathbf{B} \cdot \nabla)\mathbf{A} - (\nabla \cdot \mathbf{A} + \mathbf{A} \cdot \nabla)\mathbf{B},\tag{A13}$$

we can mathematically massage Equation (A11) into the following form,

$$\frac{\partial \boldsymbol{\omega}}{\partial t} + (\mathbf{u} \cdot \nabla)\boldsymbol{\omega} = (\boldsymbol{\omega} \cdot \nabla)\mathbf{u} + \nu \Delta \boldsymbol{\omega}.\tag{A14}$$

Note that the evolution equation for vorticity, Equation (A14), now looks like an advection-diffusion equation, but with an additional extra term, (*ω* · ∇)**u**. For 2*D* flows, recall that **u** = (*u*, *v*, 0) and hence *ω* = (0, 0, *ω*). Moreover, in 2*D* flows, all partial derivatives with respect to *z* are zero; hence the (*ω* · ∇)**u** term becomes zero, e.g.,

$$(\boldsymbol{\omega} \cdot \boldsymbol{\nabla})\mathbf{u} = \left(0\frac{\partial}{\partial x} + 0\frac{\partial}{\partial y} + \omega\frac{\partial}{\partial z}\right)\mathbf{u} = \omega\frac{\partial \mathbf{u}}{\partial z} = 0.1$$

Thus, in 2*D*, we have the following form of the momentum equation in terms of vorticity

$$\frac{\partial \boldsymbol{\omega}}{\partial t} + (\mathbf{u} \cdot \nabla)\boldsymbol{\omega} = \boldsymbol{\nu} \Delta \boldsymbol{\omega}.\tag{A15}$$

Note that the form of Equation (A15) suggests that if *ν* ≡ 0 and if *ω* = 0 everywhere at any moment in time, then *ω* = 0 for all future time. Moreover, since *ω* = ∇ × **u** = 0, we have irrotational flow. Thus, we would be studying an incompressible *potential flow* problem [70].

Next we introduce the streamfunction, *ψ*, as part of the vector potential for **u**,

$$
\mathbf{u} = \nabla \times \psi \hat{\mathbf{k}}.\tag{A16}
$$

Note that if the streamfunction, *ψ* = *ψ*(*x*, *y*), is known, it is possible to extract the components of the 2*D* fluid velocity field, **u** = (*u*, *v*), from it e.g.,

$$u = \frac{\partial \psi}{\partial y} \quad \text{and} \quad v = -\frac{\partial \psi}{\partial x}. \tag{A17}$$

Furthermore, taking the curl of (A16), we are able to get a Poisson problem for *ψ* in terms of *ω*,

$$
\Delta \psi = -\omega,\tag{A18}
$$

where we have used the following vector calculus identity,

$$
\nabla \times \nabla \times \mathbf{A} = \nabla(\nabla \cdot \mathbf{A}) - \nabla^2 \mathbf{A}\_\prime \tag{A19}
$$

and the fact that *∂ψ <sup>∂</sup><sup>z</sup>* = 0.

At this point, the idea is that if we are able to solve for the streamfunction, *ψ*, from the vorticity, *ω*, we can then get the fluid velocity ,**u**, and it will automatically satisfy the incompressibility condition by definition of the vector potential, i.e., Equation (A16). In essence this is the algorithm; however, within this algorithm, we will work as much as possible in the Fourier frequency space, granted to us by taking the Fast Fourier Transform (FFT). Before diving into the 4 main steps of this scheme, we will introduce some notation involving Discrete Fourier Transforms (DFT) and hence FFT. Note that the FFT yields the same results as the DFT but does so in a more computationally efficient, i.e., *fast*, manner.

• Taking the Discrete Fourier Transform (DFT) of a set of complex numbers produces another set of complex numbers. The notation F {**z**} denotes taking the Discrete Fourier Transform of a set of *<sup>N</sup>*-values, {*zn*}*N*−<sup>1</sup> *<sup>n</sup>*=<sup>0</sup> , e.g., for *<sup>k</sup>* <sup>=</sup> 0, 1, . . . , *<sup>N</sup>* <sup>−</sup> 1, we define

$$\hat{z}\_k = \mathcal{F}\left\{\mathbf{z}\right\} = \sum\_{n=0}^{N-1} z\_n \left| \mathcal{E}^{-2\pi i \frac{kv}{N}} \right.$$

• Variables with a hat, such as *z*ˆ*k*, denote variables that have been transformed into frequency space via the Discrete Fourier Transform. Moreover, the indices *k* are known as the DFT's wave-numbers.

• We can also take the Inverse Discrete Fourier Transform (IDFT) to return our quantities of interest from frequency space to real space. We denote the IDFT as

$$z\_n = \mathcal{F}^{-1}\left\{\mathbf{\hat{z}}\right\} = \frac{1}{N} \sum\_{k=0}^{N-1} \mathcal{E}\_k \, e^{-2\pi i \frac{k\pi}{N}}.$$

for all *n* = 0, 1, 2, . . . , *N* − 1.


$$K\_X = \begin{bmatrix} 0 & 1 & 2 & \cdots & N\_y - 1 \\ 0 & 1 & 2 & \cdots & N\_y - 1 \\ \vdots & \vdots & & \vdots \\ 0 & 1 & 2 & \cdots & N\_y - 1 \end{bmatrix} \quad \text{and } K\_Y = \begin{bmatrix} 0 & 0 & 0 & \cdots & 0 \\ 1 & 1 & 1 & \cdots & 1 \\ 2 & 2 & 2 & \cdots & 2 \\ \vdots & & & \vdots & & \vdots \\ N\_x - 1 & N\_x - 1 & N\_x - 1 & \cdots & N\_x - 1 \end{bmatrix}.$$

Note that each row of the matrix *KX* is a vector that we denote **k***<sup>X</sup>* with components **<sup>k</sup>***<sup>X</sup>* = (0, 1, 2, ... , *Ny* <sup>−</sup> <sup>1</sup>)*T*. Similarly each column of the matrix *KY* is a vector that we denote **k***<sup>Y</sup>* = (0, 1, 2, . . . , *Nx* − 1).

• In order to benefit from the FFT we will assume our spatial grid has a resolution of *Nx* × *Ny*, where both *Nx* and *Ny* are powers of 2 [89].

We will now dive into the the 4 main steps in this spectral (FFT) method's algorithm. They are as follows:

1. *Update the streamfunction to the current time-step, n:*

From the previous time-step's vorticity, *ωn*, we can solve the Poisson problem (Equation (A18)) for the streamfunction at the current time-step, *ψn*, i.e.,

$$
\hat{\Psi}^{\eta}\_{ij} = \frac{\hat{\omega}^{\eta}\_{ij}}{k\_{\chi\_i}^2 + k\_{Y\_j}^2},
\tag{A20}
$$

where *kXi* and *kYj* are the Fourier wave-numbers, e.g., the *i*th and *j*th components of the vectors **k***<sup>X</sup>* and **k***Y*, respectively.

2. *Obtain the components of velocity and the gradient of vorticity:*

With the newly updated *ψ*ˆ*<sup>n</sup>* as well as *ω*ˆ *<sup>n</sup>* from the previous time-step, we are able to compute the components of the velocity field at the current time-step, **u***<sup>n</sup>* = (*un*, *vn*). To do this, we take derivatives of the streamfunction and vorticity in frequency space. This then gives us the components of velocity (see Equation (A17)) and the gradient of vorticity, in frequency space respectively. We can then use the IDFT to transform these quantities back into in real space, e.g.,

$$
\mu^n = \mathcal{F}^{-1}\left\{2\pi i \,\mathrm{K}\_Y \circ \hat{\Psi}^n\right\} \tag{A21}
$$

$$
\sigma^n = \mathcal{F}^{-1}\left\{-2\pi i \,\mathrm{K}\_X \circ \hat{\Psi}^n\right\} \tag{A22}
$$

$$
\omega\_x^n = \mathcal{F}^{-1}\left\{2\pi i \,\mathrm{K}\_X \circ \hat{\omega}^n\right\} \tag{A23}
$$

$$
\omega\_y^n = \mathcal{F}^{-1}\left\{2\pi i \,\mathrm{K}\_Y \diamond \hat{w}^n\right\} \tag{A24}
$$

where the operation *A* ◦ *B* between two matrices of equal size is called the Hadamard product. The Hadamard product is element-wise multiplication, e.g., if *A* and *B* are matrices of the same size, for all components *i*, *j*, (*A* ◦ *B*)*ij* = *AijBij*.

#### 3. *Compute the advection term in frequency space from Equation (A15):*.

Once you have the velocity field (*un*, *vn*) and partial derivatives of vorticity *ω<sup>n</sup> <sup>x</sup>* <sup>=</sup> *∂ω<sup>n</sup> <sup>∂</sup><sup>x</sup>* and *<sup>ω</sup><sup>y</sup>* = *∂ω<sup>n</sup> <sup>∂</sup><sup>y</sup>* at the current time-step, it is now possible to compute the advection term from Equation (A15), i.e., **<sup>u</sup>** · ∇*ω*. We define *<sup>F</sup><sup>n</sup>* adv*ij* to be the above advection term, and hence get that

$$F^{\rm n}\_{\mathbf{ad}\mathbf{v}\_{ij}} = \boldsymbol{\mu}^{\rm n}\_{ij} \cdot \boldsymbol{\omega}^{\rm n}\_{\mathbf{x}\_{ij}} + \boldsymbol{\upsilon}^{\rm n}\_{ij} \cdot \boldsymbol{\omega}^{\rm n}\_{\mathbf{y}\_{ij}}.\tag{A25}$$

Furthermore, we can apply the DFT to Equation (A25) to transform it into frequency space, e.g.,

$$
\hat{F}\_{\mathbf{adv}\_{ij}}^{\mathbf{u}} = \mathcal{F} \left\{ F\_{\mathbf{adv}\_{ij}}^{\mathbf{u}} \right\}.\tag{A26}
$$

This will allows us to update vorticity to the (*n* + 1)*st* time-step using Equation (A15) in frequency space.

#### 4. *Update the vorticity to next time-step:*

Finally we use the Crank-Nicholson scheme to update the vorticity to the next time-step, *ω*ˆ *<sup>n</sup>*<sup>+</sup>1,

$$
\boldsymbol{\omega}\_{ij}^{n+1} = \frac{\left[1 + \frac{\nu \Delta t}{2} \left(\mathcal{K}\_{\mathcal{X}\_{ij}}^2 + \mathcal{K}\_{\mathcal{Y}\_{ij}}^2\right)\right] \boldsymbol{\omega}\_{ij}^n - \Delta t \,\hat{\boldsymbol{F}}\_{\mathbf{adv}\_{ij}}^n}{1 - \frac{\nu \Delta t}{2} \left(\mathcal{K}\_{\mathcal{X}\_{ij}}^2 + \mathcal{K}\_{\mathcal{Y}\_{ij}}^2\right)} \tag{A27}
$$

Note that this method is semi-implicit; we explicitly discretize the advection term, while we implicitly discretize the diffusion term. The Crank-Nicholson scheme is second order accurate in time and space [51], and is unconditionally stable for an array of parabolic problems of the type *wt* = *awxx* [52].

Now that the vorticity has been updated, *<sup>ω</sup><sup>n</sup>* <sup>→</sup> *<sup>ω</sup>n*<sup>+</sup>1, you can repeat this process again.

#### *Appendix B.3. Lattice Boltzmann Methods*

As mentioned in Section 2.3, the Lattice Boltzmann method (LBM) does not explicitly (or implicitly) solve the viscous, incompressible Navier-Stokes equations, rather it uses discrete Boltzmann equations to model the fluid dynamics. In a nutshell tracks fictitious particles of fluid flow, thinking of the problem more as a transport equation, e.g.,

$$\frac{\partial f}{\partial t} + \mathbf{u} \cdot \nabla f = \Omega,\tag{A28}$$

where *f*(**x**, *t*) is the particle distribution function, i.e., a probability density, **u** is the fluid particle's velocity, and Ω is what is called the collision operator. However, rather than have these particles moving in a Lagrangian framework, the Lattice Boltzmann method simplifies this assumption and restricts the particle movements to nodes of a lattice. While we will only discuss a two dimensional implementation of the LBM, three dimensional implementations follow analogously.

From the assumption restricting the fluid particles to reside on a lattice, there are only 9 possible directions that a particle could potentially stream, or pass information, along to. These directions are either horizontal (left/right) or vertical (up/down) or forward or backward along both diagonal directions, as well as, staying at rest on its current node. These directions are illustrated in Figure A1, and these streaming velocities, {**e***i*}, are called the *microscopic velocities*. The directions illustrated in Figure A1 is commonly called the *D*2*Q*9 Lattice Boltzmann Model.

**Figure A1.** Figure illustrating the possible streaming directions, {**e***i*} for the D2Q9 Lattice Boltzmann model.

Every point on the lattice has is a probability function, *f*(**x**, *t*), associated with it. Accounting for the possibility of moving in only 9 directions, we rewrite the probability function as its discretized counterpart, *fi*(**x**, *t*), where *fi* now gives the probability of streaming in a particular direction **e***i*. Using this discretization, we can define the macroscopic fluid density to be the sum of all possible *fi*, e.g.,

$$\rho(\mathbf{x},t) = \sum\_{i=0}^{8} f\_i(\mathbf{x},t). \tag{A29}$$

Similarly, we can define the *macroscopic velocity* of the fluid as an average of the microscopic velocities in each direction weighted by their associated particle distribution functions *fi* using (A29),

$$\mathbf{u}(\mathbf{x},t) = \frac{1}{\rho} \sum\_{i=0}^{8} cf\_i(\mathbf{x},t)\mathbf{e}\_{i\prime} \tag{A30}$$

where *c* = <sup>Δ</sup>*<sup>x</sup>* <sup>Δ</sup>*<sup>t</sup>* and is referred to as the lattice speed. The key elements that are left to discuss are exactly what it means to *stream* the particle distributions, *fi*, as well as what it meant by the *collision*, Ω. However, they both are encompassed within the steps in the LBM algorithm, so we will explicitly define these procedures while also describing the algorithm. The steps are detailed below:

1. The first step is to stream the particle densities to propagate in each direction. Explicitly you calculate the following intermediate particle density, *f* ∗ *i* ,

$$f\_i^\*(\mathbf{x} + c\mathbf{e}\_i \Delta t, t + \Delta t) = f\_i^n(\mathbf{x}, t), \tag{A31}$$

where *n* is the time-step and where for each direction *i*, you would in practice compute

$$\begin{aligned} f\_1^\*(\mathbf{x}\_i, y\_j) &= f\_1^n(\mathbf{x}\_{i-1}, y\_j), & f\_2^\*(\mathbf{x}\_i, y\_j) &= f\_2^n(\mathbf{x}\_i, y\_{j-1}), & f\_3^\*(\mathbf{x}\_i, y\_j) &= f\_3^n(\mathbf{x}\_{i+1}, y\_j), \\ f\_4^\*(\mathbf{x}\_i, y\_j) &= f\_4^n(\mathbf{x}\_i, y\_{j+1}), & f\_5^\*(\mathbf{x}\_i, y\_j) &= f\_5^n(\mathbf{x}\_{i-1}, y\_{j-1}), & f\_6^\*(\mathbf{x}\_i, y\_j) &= f\_6^n(\mathbf{x}\_{i+1}, y\_{j-1}) \\ f\_7^\*(\mathbf{x}\_i, y\_j) &= f\_7^n(\mathbf{x}\_{i+1}, y\_{j+1}), & f\_8^\*(\mathbf{x}\_i, y\_j) &= f\_8^n(\mathbf{x}\_{i-1}, y\_{j+1}), & f\_9^\*(\mathbf{x}\_i, y\_j) &= f\_9^n(\mathbf{x}\_i, y\_j) \end{aligned}$$

This idea of streaming is shown in Figure A2.

**Figure A2.** Figure illustrating the idea of streaming by showing color correlated particle probability functions, *fi*, before the streaming process and post-streaming, *f* ∗ *i* .

2. The second step involves finding what is referred to as the equilibrium distribution. This step is a part of the *collision* step, where you want to relax the particle density distributions towards a local equilibrium. The local equilibrium is denoted *f eq <sup>i</sup>* (**x**, *t*). First we must compute macroscopic the properties (density and velocity) from the intermediate particle distributions *f* ∗ *<sup>i</sup>* using (A29) and (A30).

Once we have these quantities, we can now define the equilibrium distributions, *f eq <sup>i</sup>* . We note that there are many equilibrium distributions one could use in practice; however, each depends on your specific model and its assumptions. The Lattice Boltzmann method implemented here uses what is called the Bhatnagar-Gross-Krook (BGK) collision mode [90]. The BGK collision model is useful for simulating single phase flows [12] and is most often the classic model to use for solving the incompressible, viscous Navier-Stokes equations, although it can also be useful for simulating compressible flows at low Mach numbers [11]. See [11] for a good review of the BGK model. The BGK model's equilibrium distribution can be written as follows

$$f\_i^{\neq \emptyset}(\mathbf{x}, t) = w\_i \rho + \rho s\_i(\mathbf{u}(\mathbf{x}, t)), \tag{A33}$$

where *wi* is a weight and *si*(**u**(**x**, *t*)) is defined as

$$s\_i(\mathbf{u}(\mathbf{x},t)) = w\_i \left[ 3\frac{\mathbf{e}\_i \cdot \mathbf{u}}{c} + \frac{9}{2} \frac{(\mathbf{e}\_i \cdot \mathbf{u})^2}{c^2} - \frac{3}{2} \frac{\mathbf{u} \cdot \mathbf{u}}{c^2} \right]. \tag{A34}$$

The corresponding weights, *wi* are given as

$$w\_i = \begin{cases} \frac{4}{5} & i = 0\\ \frac{1}{5} & i \in \{1, 2, 3, 4\} \\\ \frac{1}{5} & i \in \{5, 6, 7, 8\} \end{cases} . \tag{A35}$$

3. Finally we compute the collision step associated with the BGK model as follows

$$f\_i^{n+1} = f\_i^\* - \frac{f\_i(\mathbf{x}, t) - f\_i^{\text{eq}}(\mathbf{b} \mathbf{f})}{\pi},\tag{A36}$$

where *τ* is the relaxation parameter and intuitively is related to the viscosity of the fluid, i.e.,

$$\nu = \frac{2\tau - 1}{6} \frac{\Delta x^2}{\Delta t}. \tag{A37}$$

Before we mention how to handle boundary conditions we will briefly discuss some of the advantages of the LBM. One of the biggest advantages of LBM is its implementation lends itself toward massive GPU or CPU parallelization. Due to parallelization it can be an incredibly fast way of solving fluid problems that are coupled with equations that model heat transfer or chemical processes [91]. Moreover, the algorithm also prides itself for the ability to compute flows through complex geometries and porous structures rather easily and efficiently [55]. From the structure of the streaming step, one can easily prescribe boundary conditions and regions in the grid where fluid is not allowed to flow easily. For our considerations here we only will introduce what are referred to as *bounce-back boundary conditions* [55].

The bounce-back boundary conditions are used to enforce no-slip conditions; however, as we will show, they are not only used on the edges of the domain, but can be implemented on the interior to create complex geometries. In a nutshell the incoming streaming directions of the distribution functions are simply reversed when they hit a boundary node. This idea is depicted in Figure A3. In practice, one can simply mask these boundary points on the domain using boolean logic.

**Figure A3.** Illustration of bounce-back boundary conditions. During the pre-streaming step there are microscopic velocities set on the boundary and then they are reversed during the streaming step

#### **Appendix C. Extra Visualizations of Data from Section 3: Spectral (FFT) Method's** bubble3 **Example**

These visualizations are to complement those already presented in the guided tutorials from Section 3. We will also give a bit of background for the simulation as well. This example used the spectral (FFT-based) fluid solver in the software and models multiple regions of vorticity 'overlapping' at the beginning. Note that first example given here can be run by going into in the *FFT\_NS\_Solver* script selecting the 'bubble3' option. The vorticity is initialized as in Figure A4. Recall that counterclockwise (*CCW*) and clockwise (*CW*) correspond to regions of uniform vorticity, where vorticity initialized as a positive or negative constant for *CCW* and *CW*, respectively.

**Figure A4.** Illustrations of the boundary conditions and vorticity initialization for the cases of the bubble3 example.

In this example, three circular regions of vorticity are placed, partially on top of one another. The largest region begins with a uniform value of +0.4, followed by the smaller regions with −0.5 and +0.5, respectively. The remainder of the computational domain is initialized with a random value of vorticity between [−1, 1]. We note that initializing a random values of vorticity will generally not satisfy the incompressibility condition (Equation (2)); however, here we do it only to illustrate that the solver is able to handle initial random noise. This simulation used the computational parameters found in Table A1.


**Table A1.** Numerical parameters for case with 'overlapping' vorticity regions

Figure A5 provides the simulation data at the beginning of the simulation (a) and at the last time-step (b). It presents colormaps (and corresponding contours) for vorticity, magnitude of velocity, horizontal velocity, vertical velocity, and the finite-time Lyapunov exponent (FTLE). It also gives a snapshot of the velocity vector field. The last snapshot of the simulation was from *t* = 30.0 s.

From Figure A5, it is evident that the random vorticity values at the start of the simulation eventually interact and dissipate in the flow, as observed in the vorticity panel. Initially there appears to be a lot of noise in the background vorticity (it was initialized to be random between [−1,1]) and by the end it appears virtually averaged out. Moreover, due to the background vorticity noise at the beginning, there are a lot of tiny patches of oppositely moving fluid. This leads to an initial background of high FTLE values, which suggests there is significant fluid mixing occurring. Similarly to vorticity, by the end, the background has significantly less mixing (e.g., smaller FTLE values) overall in areas away from the interacting vortical structures, which started off as overlapping vorticity regions. The area of high mixing in the FTLE panel at the last time-step is in a region where there is a lot of oppositely moving fluid, both horizontally as well as vertically.

**Figure A5.** Simulation data from the case of overlapping vorticity regions during (**a**) the first time-step and (**b**) the final time-step.

Figure A6 provides snapshots over the simulation to illustrate how the magnitude of velocity and vorticity evolved over time. Figure A6a shows that the overlapping regions of vorticity induce the highest flows overall, as quantified by magnitude of velocity. That is, although the background was initialized to random values between [−1,1], which may include values that are higher than initial vorticity of the overlapping regions (+0.4, −0.5, and +0.5 for largest to smallest, respectively), it did not significantly contribute to bulk flow within the domain. Moreover, as suggested earlier, the initial random vorticity configuration quickly dissipates itself out, see Figure A6b.

**Figure A6.** The evolution of (**a**) the magnitude of velocity (with its contours) and (**b**) vorticity (with its contours) during the course of the simulation.

Students may elect to try the following:


#### **References**


c 2020 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (http://creativecommons.org/licenses/by/4.0/).

## *Article* **Understanding Fluid Dynamics from Langevin and Fokker–Planck Equations**

#### **Andrei Medved 1, Riley Davis <sup>2</sup> and Paula A. Vasquez 1,\***


Received: 17 February 2020; Accepted: 15 March 2020; Published: 23 March 2020

**Abstract:** The Langevin equations (LE) and the Fokker–Planck (FP) equations are widely used to describe fluid behavior based on coarse-grained approximations of microstructure evolution. In this manuscript, we describe the relation between LE and FP as related to particle motion within a fluid. The manuscript introduces undergraduate students to two LEs, their corresponding FP equations, and their solutions and physical interpretation.

**Keywords:** Langevin; Fokker–Planck; microrheology; Stokes–Einstein relation; mobility; fluctuation dissipation; Matlab GUI

#### **1. Introduction**

This review focuses on two idealized scenarios involving microscopic particles embedded in a fluid. In the first one, we consider the uncoupled motion of individual Brownian probes, while in the second one, we consider the dynamics of an ensemble of such probes. These two cases allow us to explore the relation between two well-known families of equations in fluids dynamics: the Langevin equations (LE) and Fokker–Planck (FP) equations. By no means is this meant to be a comprehensive review of either of these equations, but rather a bird's-eye view of their relationship and how they can be used to better understand fluid dynamics at the microscale. The article is written for undergraduate students and highlights different concepts from undergraduate courses in calculus and differential equations and their applications to fluid dynamics problems. In addition, whenever pertinent, the reader will be referred to more specialized publications for a more in-depth treatment of the different subjects.

To elucidate the relation between these two types of approaches, Figure 1 shows the relation between a LE and a FP description of particles moving as a result of simple Brownian motion in two dimensions. This process describes the random migration of small particles arising from their motion due to thermal energy. The term *Brownian motion* was coined after the botanist Robert Brown, who was the first to describe this phenomenon in 1828 during his investigation of the movements of fine particles, like pollen, dust, and soot, on a water surface. In 1905, Albert Einstein explained Brownian motion in terms of random thermal motions of fluid molecules bombarding the microscopic particle and causing it to undergo a random walk [1]. Nonetheless, the range of applications of Brownian motion goes beyond the study of microscopic particles and includes modeling of thermal noise, stock prices, and random perturbations in many physical, biological, and economic systems [2,3]. From an observational point of view, the Langevin equation is easier to understand than the Fokker–Planck equation. The LE approach directly uses the concept of time evolution of the random variable describing the process; in the case of Figure 1, this

corresponds to the individual particle's position. In contrast, the FP approach follows the time evolution of the underlying probability distribution. That is, instead of describing a particle position, it describes the likelihood of finding a particle at a given position.

**Figure 1.** Relation between the Langevin equations (LE) and Fokker–Planck (FP) solutions. (**A**) LE solutions give particle positions as functions of time, each point represents a particle position at some time *t*. All particles have initial position (0, 0) and follow different trajectories dictated by their respective noise history. (**B**) The distribution of particle positions can be summarized using a histogram. (**C**) FP solutions shows the probability of finding a particle at a given position as a function of time; darker color indicates a higher probability of finding a particle at that position.

In this paper, we briefly describe the basics of LE equations and investigate their relation with their corresponding FP equations. The special cases discussed in the following sections are aimed at understanding how information is represented under these two different descriptions and illustrating how one can gather data under one approach and be able to infer behavior under the other.

#### **2. Langevin Approach**

To understand the Langevin description, we start by considering a particle immersed in a fluid. The particle "feels" a force arising from the collisions with the fluid's molecules. This force consists of two parts: (a) a deterministic hydrodynamic drag, which resists motion; and (b) a fluctuating stochastic force, caused by thermal fluctuations. Newton's second law gives the evolution equation governing the dynamics of the particle as

$$\begin{array}{rcl} m\mathbf{a} &=& \sum \mathbf{F} \\ &=& \text{drag force} + \text{random force} \end{array}$$

Assuming a linear drag force (force = −drag coefficient × velocity) and a white noise, the resulting equation is known as the Langevin equation:

$$m\mathbf{a} = \begin{array}{c} m\mathbf{v} \end{array} = \begin{array}{c} -\zeta \mathbf{v} + \mathbf{f}. \tag{1}$$

White noise describes a random term that assumes no correlation on the fluctuating forces; this is captured by drawing a random number from a Gaussian distribution with mean and variance given by

$$\begin{aligned} \langle \mathbf{f}(t) \rangle &= \mathbf{0}, \\ \langle f\_i(t) f\_j(s) \rangle &= \Gamma \delta\_{ij} \delta(t - s), \end{aligned}$$

where Γ represents the variance of the distribution or strength of the noise; *i*, *j* indicate vector components; *δij* is the Kronecker delta; and *δ*(*t*) is a Dirac delta function. Note that both the Kronecker delta and Dirac delta function capture the zero-correlation of the forces both spatial, *δij* = 0 for *i* = *j*, and temporal, *δ*(*t* − *s*) = 0 for *t* = *s*. Moreover, for any interval [*a*, *b*] contained in interval [*c*, *d*], we have the following rule:

$$\int\_{a}^{b} d\tau \int\_{c}^{d} f(\tau, s) \delta(\tau - s) \, ds = \int\_{a}^{b} f(\tau, \tau) \, d\tau \tag{2}$$

Since **f** represents a stochastic term, Equation (1) is part of a broad class of differential equations known as stochastic differential equations (SDEs) [3,4].

Assuming white noise, one can solve Equation (1) formally using basic solution techniques for ordinary differential equations (ODEs). In particular, Equation (1) can be treated as a first order, non-homogeneous differential equation of the form

$$\frac{dy(t)}{dt} + p(t)y(t) = q(t)\_\prime$$

with integrating factor and solution given by

$$\nu(t) = \int p(t) \, dt,\qquad\qquad y(t) = e^{-\nu(t)} \int e^{\nu(t)} q(t) \, dt.$$

For Equation (1), *y*(*t*) = **v**, *p*(*t*) = *ζ*/*m* and *q*(*t*) = **f**, so that its formal solution is given by

$$\mathbf{v}(t) \quad = \mathbf{v}(0)e^{-\int\_{0}^{\tau} t/m} + \frac{1}{m} \int\_{0}^{t} e^{-\int\_{\tau}^{\tau} (t-\tau)/m} \mathbf{f}(\tau) \,d\tau = \mathbf{v}(0)e^{-t/\tau\_{\mathrm{B}}} + \frac{1}{m} \int\_{0}^{t} e^{-(t-\tau)/\tau\_{\mathrm{B}}} \mathbf{f}(\tau) \,d\tau. \tag{3}$$

The quantity *τ<sup>B</sup>* = *m*/*ζ* has units of time and is usually referred to as the Brownian relaxation time of the particle velocity.

Note that, in the absence of random noise, **f**(*t*) = 0, Equation (3) gives **v**(*t*) = **v**(0)*e*−*t*/*τ<sup>B</sup>* , which implies that **v** → 0 as *t* → ∞. However, according to the equipartition theorem, the velocity should satisfy

$$\lim\_{t \to \infty} \left\langle \frac{1}{2} m \upsilon^2(t) \right\rangle = \frac{d}{2} k\_B T\_{\prime\prime}$$

where the brackets < · > represent averages; *kB* is the Boltzmann's constant; *T* is the temperature; *<sup>v</sup>*2(*t*) = **<sup>v</sup>**(*t*) · **<sup>v</sup>**(*t*); and *<sup>d</sup>* represents the degrees of freedom, or dimensionality, *<sup>d</sup>* <sup>=</sup> 1, 2 or 3. The fact that the equipartition theorem states that the velocity cannot approach zero as time goes to infinity implies that the random force is necessary to obtain the correct equilibrium condition. Furthermore, the strength of the noise, Γ, should be such that equipartition theorem is satisfied.

To determine the strength of the random force, Γ, we take the average of *v*2(*t*) using Equation (3) as

$$
\begin{split}
\left<\mathbf{v}(t)\cdot\mathbf{v}(t)\right> &= \left.\mathbf{v}(0)\cdot\mathbf{v}(0)e^{-2t/\tau\_{\mathbb{B}}}+\frac{2}{m}\int\_{0}^{t}e^{-(2t-\tau)/\tau\_{\mathbb{B}}}\left[\mathbf{v}(0)\cdot\left(\mathbf{f}(t)\right)\right]d\tau+\tau\_{\mathbb{B}}\\ &\frac{1}{m^{2}}\int\_{0}^{t}\int\_{0}^{t}e^{-(2t-\tau-s)/\tau\_{\mathbb{B}}}\left\langle\mathbf{f}(\tau)\cdot\mathbf{f}(s)\right\rangle d\tau ds,\\ \left<\mathbf{v}^{2}(t)\right> &= \left.\mathbf{v}(0)\cdot\mathbf{v}(0)e^{-2t/\tau\_{\mathbb{B}}}+\frac{2}{m}\int\_{0}^{t}e^{-(2t-\tau)/\tau\_{\mathbb{B}}}\left[0\right]d\tau\\ &\qquad +\frac{d}{m^{2}}\int\_{0}^{t}\int\_{0}^{t}e^{-(2t-\tau-s)/\tau\_{\mathbb{B}}}\left[\Gamma\delta(\tau-s)\right]d\tau ds,\\ \mathbf{f} &= \left.\mathbf{v}^{2}(0)e^{-2t/\tau\_{\mathbb{B}}}+\frac{d\Gamma}{2\zeta}\left[1-e^{-2t/\tau\_{\mathbb{B}}}\right].
\end{split}
$$

In the last step of Equation (4), we used the property of the Dirac delta function given in Equation (2). Taking the limit as *t* → ∞ in Equation (4), and comparing it to the condition given by the equipartition theorem, gives

$$\begin{aligned} \lim\_{t \to \infty} \left< \frac{1}{2} m v^2(t) \right> &= \left. \frac{d}{2} k\_B T \right. & \quad \text{Equiparithmic} \\ &= \left. \frac{1}{2} m \left[ \frac{d \, \Gamma}{2 \zeta \, m} \right] = \frac{d \Gamma}{4 \zeta} \end{aligned}$$

Therefore, the strength of the noise should satisfy

$$
\Gamma = \mathcal{Z} \not\subset k\_B T. \tag{5}
$$

This relation between the strength of the fluctuations of the stochastic forces (Γ) and the dissipative term given by the drag force (*ζ*) is a special case of a more general result known as the *fluctuation–dissipation theorem* [5].

The fluctuation–dissipation theorem states that equilibrium is brought about by a dissipation force, in our case drag, between the particle and the medium, and whatever the mechanism of the dissipation, it has to be the same process that produces random, fluctuating forces on the particle. In other words, both the frictional force and the random force must be related since they have the same origin: fluid molecules "bombarding" the particle and inducing mobility.

Finally, after solving Equation (1), the particle position can be obtained as

$$\mathbf{x}(t) - \mathbf{x}(0) = \int\_0^t \mathbf{v}(\tau) \, d\tau. \tag{6}$$

For a given SDE such as Equation (1), in order to make inferences based on its solution, it is necessary to find the average over many realizations. To illustrate this, consider the 2D version of Equation (1) solved three different times using the same initial position but subject to different random noises. The resulting trajectories are shown in Figure 2.

The fact that each trajectory is very different from the others implies that we cannot infer any behavior from the system by just considering a handful of solutions. That is, just as one would not be able to determine whether a coin is fair by just a couple of tosses, to be able to infer behavior based on Equation (1) one needs to look at many realizations of particle trajectories. This can be done numerically by solving the

equation many times and then finding the average of such solutions or can be done analytically by using time-correlation functions, as discussed next.

**Figure 2.** Evolution of 2D particle position for three different solutions of Equation (1). All three trajectories start from an initial position (0, 0). In all three figures, Δ*t* = 0.001 and the simulation ran for 1000 time steps.

#### *2.1. Moments of a Stochastic Process*

In mathematical statistics, the *<sup>s</sup>th* moment of a set of stochastic observations {**X***i*}*<sup>n</sup> <sup>i</sup>*=<sup>0</sup> is defined as

$$M\_{\mathfrak{s}}\left(\mathbf{X}\right) = \frac{1}{n} \sum\_{i=1}^{n} \mathbf{X}\_{i}^{\mathfrak{s}}.$$

Note that in the present application, our variables denote displacement of the particle with respect to the zero-time position, and the different moments measure deviations of the observations from the mean of the values. Within the context of fluid dynamics and Langevin equations, we are interested in the first (*s* = 1) and second (*s* = 2) moments of the particle positions. That is, the mean value of the stochastic variable and its spread or variance with respect to the mean.

• *First moment*

For the velocity in Equation (3), taking into account that **f** = 0, the mean is given by

$$M\_1(\mathbf{v}) = \langle \mathbf{v}(t) \rangle = \mathbf{v}(0)e^{-t/\tau\_{\mathcal{B}\_{\rho}}}$$

with a long-time or equilibrium value given by

$$M\_1(\mathbf{v}) \to 0, \quad \text{as} \quad t \to \infty.$$

For the particle position,

$$\begin{aligned} M\_1(\mathbf{x}) = \langle \mathbf{x} - \mathbf{x}(0) \rangle &= \int\_0^t \langle \mathbf{v}(s) \rangle \, ds = \int\_0^t \mathbf{v}(0) e^{-s/\tau\_\mathbf{B}} \, ds, \\ &= \left. -\mathbf{v}(0) \, \tau\_\mathbf{B} e^{-s/\tau\_\mathbf{B}} \right|\_0^t \\ &= \left. \mathbf{v}(0) \, \tau\_\mathbf{B} \left[ 1 - e^{-t/\tau\_\mathbf{B}} \right] \right. \end{aligned}$$

In addition, its long-time behavior is

$$M\_1(\mathbf{x}) \to \mathbf{v}(0) \text{ } \tau\_{\mathbb{B}\_\prime} \quad \text{as} \quad t \to \infty.$$

• *Second moment*

From Equation (4), the second moment for the velocity is

$$M\_2(\mathbf{v}) = \left\langle v^2(t) \right\rangle = v^2(0) \, e^{-2t/\tau\_B} + \frac{dk\_B T}{m} \left[1 - e^{-2t/\tau\_B} \right].$$

For the particle position, we have

$$\begin{split} M\_{2}(\mathbf{x}) &= \left< |\mathbf{x}(t) - \mathbf{x}(0)|^{2} \right> \\ & \quad \left< \mathbf{x}^{2}(t) \right> \quad = \left< \left[ \int\_{0}^{t} \mathbf{v}(\tau) \, d\tau \right]^{2} \right> \\ &= \left< \int\_{0}^{t} \mathbf{v}(s) \, ds \cdot \int\_{0}^{t} \mathbf{v}(\tau) \, d\tau \right> \\ &= \int\_{0}^{t} \int\_{0}^{t} \left< \mathbf{v}(s) \cdot \mathbf{v}(\tau) \right> \, d\tau \, ds \\ &= \int\_{0}^{t} \int\_{0}^{t} \left( \mathbf{v}^{2}(0) \, e^{-\frac{i\omega t}{\hbar}} + \frac{dk\_{B}T}{m} \left[ \varepsilon \frac{e^{-\frac{|\mathbf{r} - \mathbf{r}|}{\hbar}}}{m} - \varepsilon^{-\frac{i\omega T}{\hbar}} \right] \right) \, d\tau \, ds \\ &= \left. \mathbf{v}^{2}(0) I\_{1} + \frac{dk\_{B}T}{m} I\_{2} - \frac{dk\_{B}T}{m} I\_{1} . \end{split}$$

In this derivation, we have again used Equation (2) and the properties of the Dirac-delta function. For clarity, we solve each integral separately:

$$\begin{aligned} I\_1 &= \int\_0^t \int\_0^t e^{-(s+\tau)/\tau\_B} \,d\tau \,ds &= \quad \tau\_B^2 \left(1 - e^{-t/\tau\_B}\right)^2 \\\\ I\_2 &= \int\_0^t \int\_0^t e^{-|s-\tau|/\tau\_B} \,d\tau \,ds &= \quad \, \, 2 \int\_0^t \int\_0^s e^{-|s-\tau|/\tau\_B} \,d\tau \,ds \\&= \quad \, \, 2\tau\_B \, t-2\tau\_B^2 \left(1 - e^{-t/\tau\_B}\right) .\end{aligned}$$

Substituting *I*<sup>1</sup> and *I*<sup>2</sup> into the equation for *M*2(**x**) gives

$$
\begin{split}
\left<\mathbf{x}^{2}(t)\right> &= \left[v^{2}(0) - \frac{dk\_{B}T}{m}\right] \left[\tau\_{B}^{2}\left(1 - e^{-t/\tau\_{B}}\right)^{2}\right] + \frac{dk\_{B}T}{m} \left[2\tau\_{B}t - 2\tau\_{B}^{2}\left(1 - e^{-t/\tau\_{B}}\right)\right] \\ &= \left.v^{2}(0)\tau\_{B}^{2}\left(1 - e^{-t/\tau\_{B}}\right)^{2} + \frac{dk\_{B}T}{m}\tau\_{B}^{2}\left[-\left(1 - e^{-t/\tau\_{B}}\right)^{2} + \frac{2}{\tau\_{B}}t - 2\left(1 - e^{-t/\tau\_{B}}\right)\right] \\ &= \left.v^{2}(0)\tau\_{B}^{2}\left(1 - e^{-t/\tau\_{B}}\right)^{2} + \frac{dk\_{B}T}{m}\tau\_{B}^{2}\left[\frac{2}{\tau\_{B}}t - 3 + 4e^{-t/\tau\_{B}} - e^{-2t/\tau\_{B}}\right].
\end{split}
\tag{7}
$$

The quantity *x*2(*t*) . is called a mean squared displacement (MSD) and represents the square of the mean distance a particle has traveled in a given time interval. In practice, the MSD is one of the most commonly used experimental measures to determine material properties, as discussed in the next section.

#### *2.2. Applications of the MSD*

Performing a Taylor expansion of the MSD about *t* = 0 gives

$$
\left< \mathbf{x}^2(t) \right> \approx \upsilon^2(0) \, t^2 + O(t^3) \, t
$$

that is, at short times, the MSD grows quadratically in time. Similarly, at large times, we obtain

$$
\left< \mathbf{x}^2(t) \right> \to \frac{2dk\_BT}{m} \tau\_B \ t, \qquad \text{as} \qquad t \to \infty.
$$

Using the definition of *τB*,

$$\left<\mathbf{x}^2(t)\right> \to \frac{2dk\_BT}{m}\frac{m}{\zeta}t = \frac{2dk\_BT}{\zeta}t = 2dD\,t \qquad \text{as} \qquad t \to \infty,\tag{8}$$

where we have introduced the *diffusion coefficient*, *D* = *kBT*/*ζ*.

The result in Equation (8) constitute a powerful tool in the characterization of fluids. The diffusion coefficient characterizes the mobility of particles of a given size in a given medium at a given temperature. For example, for spherical particles the drag coefficient is given by *ζ* = 6*πηa*, where *a* is the particle radius and *η* is the viscosity of the fluid. By embedding spherical particles in a fluid of unknown properties, one can estimate the viscosity of the fluid based on the particle trajectories.

Assume we had tracked the trajectories of *n* spherical particles diffusing in a Newtonian fluid, {**x***i*(*t*)}*<sup>n</sup> <sup>i</sup>*=1, where **x**(*t*) = [*xi*(*t*), ; *yi*(*t*); *zi*(*t*)]. We can calculate the 1D, 2D, and 3D MSD as follows:

$$\begin{aligned} \label{eq:SDSD-10D} \left(\Delta t\right) &= \left\langle \left[ \mathbf{x}\left(t + \Delta t\right) - \mathbf{x}(t) \right]^2 \right\rangle, \\\label{eq:SDSD-10D} \left(\Delta t\right) &= \left\langle \left[ \mathbf{x}\left(t + \Delta t\right) - \mathbf{x}(t) \right]^2 + \left[ \mathbf{y}\left(t + \Delta t\right) - \mathbf{y}(t) \right]^2 \right\rangle, \\\label{eq:SDSD-10D} \left(\Delta t\right) &= \left\langle \left[ \mathbf{x}\left(t + \Delta t\right) - \mathbf{x}(t) \right]^2 + \left[ \mathbf{y}\left(t + \Delta t\right) - \mathbf{y}(t) \right]^2 + \left[ z\left(t + \Delta t\right) - z\left(t\right) \right]^2 \right\rangle. \end{aligned}$$

Examples of these MSDs are shown in Figure 3 for different Δ*t*'s and the Matlab code used to generate them can be found in Appendix A. Note that in Appendix A we have used the zero-mass limit of the LE equation, see Section 2.4 for details of this limiting case.

**Figure 3.** Mean squared displacement (MSD) in 1D, 2D, and 3D. Each line has been fitted to a function of the form *y* = *m x*, the best fitting value for the slope *m* is shown for each line. The slope for 1D is 2*D* = 0.019, giving *D* = 0.0095, the slope for 2D gives 4*D* = 0.037 ⇒ *D* = 0.0093, and for 3D it is <sup>6</sup>*D* = 0.059 ⇒ *D* = 0.0098. As a reference, the diffusion coefficient used to generate the particle trajectories is *D* = 0.01.

Once the diffusion coefficient is found from the particle trajectories and the MSD, the fluid viscosity can be determined by

$$D = \frac{k\_B T}{\zeta} = \frac{k\_B T}{6\pi\eta a} \quad \Rightarrow \quad \eta = \frac{k\_B T}{6\pi a D}. \tag{9}$$

This type of inference can also be used with more complex fluids and/or different types of particles. For instance, the Einstein–Smoluchowski–Sutherland relation states that [6]

$$D = \mu k\_B T\_{\prime \prime}$$

where *μ* is the particle's mobility. This mobility is given by Stokes' law in terms of the particle hydrodynamic radius, *aH*,

$$
\mu = \frac{1}{c \, \pi \, \eta \, a\_H},
$$

where both the constant *c* and *aH* depend on the particle size and shape. Note that, for spherical particles, we return to the so called Stokes–Einstein relation,

$$D = \frac{k\_B T}{6\pi\eta a}\prime$$

however, the relation in Equation (9) stills holds for non-spherical particles.

In addition, complex fluids, such as viscoelastic materials, exhibit MSDs that do not depend linearly on time [7,8]. For example, the long-time MSD of some fluids obeys

$$MSD \sim t^{\alpha}.$$

This type of behavior is known as anomalous diffusion and the power law exponent, *α*, indicates the type of diffusion: for *α* < 1, it is called subdiffusion, for *α* = 1, regular diffusion, and for *α* > 1, superdiffusion [9]. Although Equation (9) no longer holds in this case, material properties can still be inferred from the MSD of these fluids as discussed in [7,8].

#### *2.3. Generalized Langevin Equations (GLE)*

The GLE, as its name implies, is a generalization of Equation (1) and it can be similarly derived from Newton's second law assuming that the forces acting over the particle are a stochastic force, a drag force, and some external conservative force [3]:

$$m\ddot{\mathbf{x}}(t) = \mathbf{F}^{\mathbb{R}} + \mathbf{F}^{D} + \mathbf{F}^{E} \dots$$

In the GLE approach, the drag coefficient is considered dynamic, so that the drag force is given by [5]

$$F^D = -\int\_0^t K\left(t-\tau\right) \dot{\mathbf{x}}\left(\tau\right) \,d\tau,$$

where *K*(*t*) is a memory kernel.

Since the external force is considered conservative, from Vector Calculus we know that this implies it arises from some potential field *V*(**x**), such that

$$\mathbf{F}^E = -\nabla V(\mathbf{x}).$$

The resulting equation of motion is

$$m\ddot{\mathbf{x}}(t) = \mathbf{f}\left(t\right) - \int\_{0}^{t} K\left(t - \tau\right) \dot{\mathbf{x}}\left(\tau\right) \,d\tau - \nabla V(\mathbf{x}).\tag{10}$$

The power of the GLE is that it is able to coarse-grain several degrees of freedom by describing: *(i)* explicitly the dynamics of variables of interests, which in this case corresponds to the position **x**(*t*) of a particle of mass *m*; and *(ii)* implicitly the remaining degrees of freedom through a memory kernel *K*(*t*), a random noise **f**(*t*), and an external potential *V*(**x**). For free diffusion, particle mobility is in response *only* to stochastic thermal forces, i.e., ∇*V* (**x**) ≡ **0**, but in more complex systems external forces also play a role, ∇*V* (**x**) = **0**.

The memory kernel, *K*(*t*), represents a retarded effect of the frictional force, and to generate the correct equilibrium statistics, the random noise has to be related to this kernel in order to obey the fluctuation–dissipation theorem:

$$
\langle f\_i(t) f\_j(s) \rangle = 2 \, k\_B T \, \delta\_{ij} \, \mathcal{K}(t - s) \, .
$$

Physically, the kernel *K*(*t*) represents the fact that the medium requires a finite time to respond to any fluctuations in the motion of the particle; this in turn affects how the medium acts back on the particle. Thus, the force that the medium exerts on the particle at a given time depends on what the particle did in the past.

For simple fluids and large Brownian particles, the medium is capable of responding infinitely quickly to changes in the particle position, i.e., it has no memory. In this case the memory kernel is a delta-function and Equation (10) reduces to the Langevin equation previously discussed [3,5]:

$$\mathcal{K}(t-\tau) \quad = \; \zeta \delta(t-\tau) \tag{11}$$

$$m\ddot{\mathbf{x}}(t) \quad = \left. \mathbf{f}\left(t\right) - \zeta \dot{\mathbf{x}}(t) \, d\tau - \nabla V(\mathbf{x}).\tag{12}$$

Another extreme is a very sluggish medium that responds slowly to changes in the particle position. In this case, one can assume *K*(*t*) ≈ *K*(0) = *K*0, so that the GLE becomes

$$\begin{split} m\ddot{\mathbf{x}}(t) &= \mathbf{f}\left(t\right) - K\_0 \int\_0^t \dot{\mathbf{x}}\left(\tau\right) d\tau - \nabla V(\mathbf{x}) \\ &= \mathbf{f}\left(t\right) - K\_0 \left(\mathbf{x}(t) - \mathbf{x}(0)\right) - \nabla V(\mathbf{x}) \\ &= \left\|\mathbf{f}\left(t\right) - \nabla \left(V(\mathbf{x}) + \frac{K\_0}{2} \left\|\mathbf{x} - \mathbf{x}(\mathbf{0})\right\|^2\right) . \end{split} \tag{13}$$

thus adding an extra harmonic term to the potential. Such a term has the effect of trapping the system of particles in certain regions of its configuration space, an effect known as dynamic caging [10].

#### *2.4. Zero-Mass Limit of the Langevin Equation*

We finish this section on Langevin-type equations with a simplification. If we assume *K*(*t*) = *ζ δ*(*t*), and that the particles are so small that their mass is negligible, we obtain the so-called zero-mass limit:

$$0 \quad = \quad \mathbf{f}(t) - \zeta \dot{\mathbf{x}}(t) - \nabla V(\mathbf{x}) .$$

This limit is also known as the *overdamped* or *inertialess limit* since it assumes that the inertial forces, *m***a**, are negligible compared to the other forces acting on the particle. Rearranging terms and recalling that *fi*(*t*) *fj*(*s*) . = 2 *ζ kBT δijδ*(*t* − *s*) gives

$$\begin{aligned} \xi \frac{d\mathbf{x}}{dt} &= \quad -\nabla V(\mathbf{x}) + \mathbf{f}(t),\\ &= \quad -\nabla V(\mathbf{x}) + \sqrt{2\,\xi\,k\_BT} \mathbf{W}(t),\\ \frac{d\mathbf{x}}{dt} &= \quad -\frac{1}{\tilde{\zeta}} \nabla V(\mathbf{x}) + \frac{1}{\tilde{\zeta}} \sqrt{2\,\xi\,k\_BT} \mathbf{W}(t),\\ &= \quad -\frac{1}{\tilde{\zeta}} \nabla V(\mathbf{x}) + \sqrt{\frac{2\,k\_BT}{\mathcal{\zeta}}} \mathbf{W}(t),\\ \frac{d\mathbf{x}}{dt} &= \quad -\frac{1}{\tilde{\zeta}} \nabla V(\mathbf{x}) + \sqrt{2\,D} \mathbf{W}(t),\end{aligned} \tag{14}$$

where **<sup>W</sup>** is a normally distributed random noise with **W** = 0 and - *Wi*(*t*)*Wj*(*s*) . = *δij δ*(*t* − *s*). For simplicity, in the following sections, we only consider the relation between equations of the form (14) and their respective Fokker–Planck equations.

#### **3. Fokker–Planck Equation**

As discussed in the previous section, when a system is described by an LE, a complete description of the macroscopic system will require the solution and averaging of *many* SDEs. An equivalent approach is to describe the system by macroscopic variables which fluctuate as a result of stochasticity, instead of describing the individual evolution of stochastic probes [11]. An excellent explanation of the different representations and their characteristics can be found in Risken's book [11], which we summarize in Figure 4.

**Figure 4.** Levels of description of a system, adapted from [11].

A Fokker–Planck (FP) equation is a partial differential equation that describes the evolution of the probability density function (PDF) of a stochastic variable. For Langevin-type equations of the form given by Equation (14), the stochastic variable is a particle's position as a function of time, **x**(*t*). The corresponding PDF is the function that gives the probability of a particle being in the position **x** at time *t* as *P*(**x**, *t*) *d***x**. The reader is referred to Appendix B for a brief introduction to PDFs.

The LE equation given by Equation (14) can be written as

$$\begin{aligned} \frac{d\mathbf{x}}{dt} &= -\frac{1}{\zeta} \nabla V(\mathbf{x}) + \sqrt{2 \, D} \, \mathbf{W}(t),\\ &= \, \ g\_1(\mathbf{x}, t) + \mathbf{g}\_2(\mathbf{x}, t) \, \mathbf{W}(t), \end{aligned}$$

and the corresponding FP is given by [11],

$$\frac{\partial P}{\partial t} = -\nabla \cdot \left[ \mathbf{g}\_1(\mathbf{x}, t) \, P(\mathbf{x}, t) \right] + \frac{1}{2} \nabla^2 \left[ \left( \mathbf{g}\_2(\mathbf{x}, t) \right)^2 \, P(\mathbf{x}, t) \right]. \tag{15}$$

Note that taking a *deterministic* perspective is equivalent to ignoring the random noise term in the LE, *<sup>g</sup>*2(**x**, *<sup>t</sup>*) = 0, which results in the absence of the diffusion term in the FP equation, <sup>∇</sup><sup>2</sup> [(·) *<sup>P</sup>*(**x**, *<sup>t</sup>*)]. This simple statement helps us identify the relation between fluctuations at the microscale and diffusion at the macroscale. That is, the observed diffusion at the macroscale is the result of fluctuations arising from the fluid's molecules bombarding the probe at the microscale.

#### *3.1. One-Dimensional Examples*

In the following examples, we assume that all initial positions of particles are located at zero, that is,

$$\begin{array}{rcl} \mathfrak{x}(0) &=& 0\\ P(\mathfrak{x},0) &=& \delta(0). \end{array}$$

• *Brownian motion without external field for small particles (m* → 0*)*

$$\frac{d\mathbf{x}}{dt}\_{\parallel} = \sqrt{2D} \mathcal{W}(t). \tag{16}$$

In this case, the corresponding FP equation is the well-known diffusion equation, which has the same mathematical form of the heat equation in the context of heat transfer under temperature gradients:

$$\begin{aligned} \frac{\partial P}{\partial t} &= -\frac{\partial}{\partial \mathbf{x}} \left[ 0 \cdot P \right] + \frac{1}{2} \frac{\partial^2}{\partial \mathbf{x}^2} \left[ \left( \sqrt{2D} \right)^2 P \right] \\ \frac{\partial P}{\partial t} &= -D \frac{\partial^2 P}{\partial \mathbf{x}^2} . \end{aligned} \tag{17}$$

We can find the general solution of this equation using similarity solutions with the transformation

$$P(\mathbf{x},t) = t^{-p} \, F(\boldsymbol{\mu}),\tag{18}$$

where *t* <sup>−</sup>*<sup>p</sup>* represents temporal decay and *μ* = *x*2/(4*Dt*) is a shape factor used to reduce the partial differential equation (PDE) to an ordinary differential equation (ODE). For details on how this particular form is obtained, the reader is referred to [12].

We can calculate the derivatives of *P*(*x*, *t*) using Equation (18) as

$$\begin{array}{rcl} \frac{\partial P}{\partial t} &=& -pt^{-p-1}F(\mu) + t^{-p}\frac{dF}{d\mu}\frac{\partial \mu}{\partial t} = -pt^{-p-1}F(\mu) - \mu \, t^{-p-1}\frac{dF}{d\mu} \\\\ \frac{\partial P}{\partial x} &=& t^{-p}\frac{dF}{d\mu}\frac{\partial \mu}{\partial x} = \frac{\ge t^{-p-1}}{2D}\frac{dF}{d\mu} \\\\ \frac{\partial^2 P}{\partial x^2} &=& \frac{t^{-p-1}}{2D}\frac{dF}{d\mu} + \frac{\ge t^{-p-1}}{2D}\frac{d^2F}{d\mu^2}\frac{\partial \mu}{\partial x} = \frac{t^{-p-1}}{2D}\frac{dF}{d\mu} + \frac{\mu \, t^{-p-1}}{D}\frac{d^2F}{d\mu^2} \end{array}$$

Substituting in Equation (17) gives

$$\begin{aligned} -pt^{-p-1}F(\mu) - \mu \, t^{-p-1} \frac{dF}{d\mu} &= \, \, D \left[ \frac{t^{-p-1}}{2D} \frac{dF}{d\mu} + \frac{\mu \, t^{-p-1}}{D} \frac{d^2F}{d\mu^2} \right] \\ \mu \frac{d}{d\mu} \left( \frac{dF}{d\mu} + F \right) + \frac{1}{2} \left( \frac{dF}{d\mu} + 2pF \right) &= \, \, 0. \end{aligned}$$

Since we have yet to define a value for *p*, we conveniently choose it to be *p* = 1/2, so that the two quantities in the parenthesis are the same. Finally, a solution for the resulting differential equation will satisfy

$$\frac{dF}{d\mu} + F = 0\_r$$

with the general solution

$$F(\mu) = \mathbb{C}\_0 \, e^{-\mu} \, \_\prime$$

which gives the solution for *P*(*x*, *t*),

$$P(\mathbf{x},t) = \mathbf{C}0^{-1/2}\exp\left(-\frac{\mathbf{x}^2}{4Dt}\right).$$

To find the value of the constant of integration *C*0, we consider the fact that

$$\int\_{-\infty}^{\infty} P(\mathbf{x}, t) \, d\mathbf{x} = 1,$$

that is, all possible realizations are included, see Appendix B.

To solve the integral, we introduce the error function erf(*y*)

$$\text{erf}(y) = \frac{2}{\sqrt{\pi t}} \int\_0^y e^{-s^2} \, ds$$

which has values erf(−∞) = −1 and erf(∞) = 1.

$$\begin{split} \int\_{-\infty}^{\infty} \mathbb{P}(\mathbf{x}, t) \, d\mathbf{x} = \int\_{-\infty}^{\infty} \mathbb{C} \mathbf{t} t^{-1/2} \exp\left(-\frac{\mathbf{x}^{2}}{4Dt}\right) \, d\mathbf{x} &= \quad \mathbb{C} \mathbf{t} t^{-1/2} \int\_{-\infty}^{\infty} \exp\left(-\frac{\mathbf{x}^{2}}{4Dt}\right) \, d\mathbf{x} \\ &= \quad \quad \quad \quad \mathbb{C}\_{0} t^{-1/2} \sqrt{\pi D \, t} \, \text{erf}\left(\frac{\mathbf{x}}{2\sqrt{D} \, t}\right) \Big|\_{-\infty}^{\infty} \\ &= \quad \quad \quad \quad \mathbb{C}\_{0} t^{-1/2} \sqrt{\pi D \, t} \, \text{( $\mathbf{2} = 2\mathbb{C}\_{0} \sqrt{\pi D}$ )} \end{split}$$

which gives

$$\mathcal{C}\_0 = \frac{1}{2\sqrt{\pi D}} = \frac{1}{\sqrt{4\pi D}}$$

Therefore, the solution of the FP equation is

$$P(\mathbf{x},t) = \frac{1}{\sqrt{4\pi Dt}} \exp\left(-\frac{\mathbf{x}^2}{4Dt}\right),\tag{19}$$

which is a one-dimensional Gaussian function centered at zero: *M*1(*x*) = 0 and with variance *M*2(*x*) = 4*Dt*.

To compare these results with those obtained in the LE section, we consider the first and second moments of *P*(*x*, *t*).

The first moment is given by

$$\begin{aligned} M\_1(\mathbf{x}) &= \int\_{-\infty}^{\infty} \mathbf{x} \, P(\mathbf{x}, t) \, d\mathbf{x} \\ &= \int\_{-\infty}^{\infty} \mathbf{x} \, \frac{1}{\sqrt{4\pi Dt}} \, \exp\left(-\frac{\mathbf{x}^2}{4Dt}\right) \, d\mathbf{x} = \frac{1}{\sqrt{4\pi Dt}} \int\_{-\infty}^{\infty} \mathbf{x} \, \exp\left(-\frac{\mathbf{x}^2}{4Dt}\right) \, d\mathbf{x} .\end{aligned}$$

We use integration by substitution (*u* = *x*2) to obtain

$$\int \mathbf{x} \cdot \exp\left(-\frac{\mathbf{x}^2}{4Dt}\right) d\mathbf{x} = \int \frac{1}{2} \exp\left(-\frac{u}{4Dt}\right) du = -2Dt \exp\left(-\frac{u}{4Dt}\right) + \mathbb{C} = -2Dt \exp\left(-\frac{\mathbf{x}^2}{4Dt}\right) + \mathbb{C}\_2$$

and

$$M\_1(\mathbf{x}) \;=\; \frac{1}{\sqrt{4\pi Dt}} \left[ -2Dt \exp\left( -\frac{\mathbf{x}^2}{4Dt} \right) \right]\_{-\infty}^{\infty} = 0.1$$

For the second moment, we have

$$\begin{split} M\_{2}(\mathbf{x}) &= \quad \int\_{-\infty}^{\infty} \mathbf{x}^{2} P(\mathbf{x}, t) \, d\mathbf{x} \\ &= \quad \int\_{-\infty}^{\infty} \mathbf{x}^{2} \frac{1}{\sqrt{4\pi Dt}} \, \exp\left(-\frac{\mathbf{x}^{2}}{4Dt}\right) \, d\mathbf{x} \\ &= \quad \frac{1}{\sqrt{4\pi Dt}} \int\_{-\infty}^{\infty} \mathbf{x}^{2} \exp\left(-\frac{\mathbf{x}^{2}}{4Dt}\right) \, d\mathbf{x} \\ &= \quad \frac{1}{\sqrt{4\pi Dt}} \left[ -2\mathbf{x} \, Dt \, \exp\left(-\frac{\mathbf{x}^{2}}{4Dt}\right) \Big|\_{-\infty}^{\infty} + \frac{(4Dt)^{3/2}\sqrt{\pi}}{4} \text{erf}\left(\frac{\mathbf{x}}{\sqrt{4Dt}}\right) \Big|\_{-\infty}^{\infty} \right] \\ &= \quad \frac{1}{\sqrt{4\pi Dt}} \left[ 0 + \frac{(4Dt)^{3/2}\sqrt{\pi}}{4} (2) \right] = \frac{1}{\sqrt{4\pi Dt}} \left[ \frac{(4Dt)^{3/2}\sqrt{\pi}}{2} \sqrt{\pi} \right] \\ &= \quad 2Dt, \end{split}$$

which is the same result we obtained in the limit *t* → ∞ for Equation (8), when the dimensionality is *d* = 1.

Solutions at different times are shown in Figure 5, together with the normalized histograms obtained from LE data. For details of the histogram normalization see Appendix B.

**Figure 5.** Probability density function (PDF) for position of particles diffusing via one-dimensional Brownian motion. Histograms correspond to LE data and solid lines corresponds to FP solutions. In this figure, *D* = 10−<sup>2</sup> μm2/s.

• *Brownian motion with external field for small particles (m* → 0*)*

A common example of an external field is a background velocity, *u*, which imposes a drift on the particles:

$$\frac{d\mathbf{x}}{dt}\_{\parallel} = \boldsymbol{\mu} + \sqrt{2D} \mathcal{W}(t). \tag{20}$$

The corresponding FP equation is the advection–diffusion equation

$$\frac{\partial P}{\partial t} = -\frac{\partial}{\partial \mathbf{x}} \left[ \boldsymbol{u} \cdot \boldsymbol{P} \right] + \frac{1}{2} \frac{\partial^2}{\partial \mathbf{x}^2} \left[ \left( \sqrt{2D} \right)^2 \boldsymbol{P} \right]$$

$$\frac{\partial P}{\partial t} = -\boldsymbol{u} \frac{\partial P}{\partial \mathbf{x}} + D \frac{\partial^2 P}{\partial \mathbf{x}^2} \tag{21}$$

The solution of this PDE is [13]

$$P(\mathbf{x},t) = \frac{1}{\sqrt{4\pi Dt}} \exp\left(-\frac{(\mathbf{x}-\boldsymbol{\mu}\,t)^2}{4Dt}\right). \tag{22}$$

A comparison between Equations (19) and (22) shows that the only difference between these two solutions is in a "shift" of *x* by *u t*. That is, the effect of drift is to move the mean of the Gaussian distribution from zero.

As before we can calculate the first and second moment of the distribution function as [13]

$$\begin{aligned} M\_1(\mathbf{x}) &= \quad \textit{ut}\_{\prime} \\ M\_2(\mathbf{x}) &= \quad \textit{u}^2 \mathbf{f}^2 + 2D\mathbf{t} .\end{aligned}$$

That is, the mean position of the particle is displaced by the background velocity over a distance *ut*. In addition, note that the MSD at long times becomes ∼ *t* <sup>2</sup> due to the additional *linear* flow in the fluid.

In the case of simple diffusion, the dispersion of the particles can be attained from the MSD or equivalently the variance of the Gaussian. In the case where drift is present, dispersion is superimposed by the background flow, for this reason a more accurate measure of the dispersion is given by the metric [13]

$$
\sigma^2 = \int\_{-\infty}^{\infty} \left(\mathbf{x} - M\_1(\mathbf{x})\right)^2 P(\mathbf{x}, t) \, d\mathbf{x} = 2Dt,
$$

which gives back the linear behavior characteristic of standard diffusive processes. Note that in this equation, *M*1(*x*) is a central moment as opposed to the general definition given at the beginning of Section 2.1. These two moments will coincide if the mean is zero.

Plots of Equation (22) are shown in Figure 6, where the solutions with drift are compared to solutions without drift.

**Figure 6.** PDF for position of particles diffusing via one-dimensional Brownian motion plus drift. Histograms correspond to generalized Langevin equations (GLE) data and solid lines corresponds to FP solutions. For comparison, FP solutions without drift are shown in dashed lines. In this figure, *D* = 10−2μm2/s, *u* = 0.2μ/s.

#### *3.2. Two-Dimensional Examples*

In this section, we present the 2D equations corresponding to four different cases and their numerical solutions.

• *No external field*

**–** Langevin equations

$$\begin{array}{rcl} \frac{dx}{dt} & = & \sqrt{2D}W\_{\mathbf{x}}(t),\\ \frac{dy}{dt} & = & \sqrt{2D}W\_{\mathbf{y}}(t). \end{array}$$

In this case, both *Wx* and *Wy* are statistically independent white noises; the subscripts are used to denote that the noise histories are for *x* and *y*.

**–** Fokker–Planck Equation

$$\frac{\partial P}{\partial t} \quad = \quad D \left[ \frac{\partial^2 P}{\partial x^2} + \frac{\partial^2 P}{\partial y^2} \right].$$

Solutions for LE and FP representations for this case of no external field are provided in Figure 7.

**Figure 7.** LE and FP solutions for two-dimensional Brownian motion without external field. For both representations, *D* = 10−<sup>2</sup> μm2/s and time is in seconds. For the LE representation, the total number of particles is 5 <sup>×</sup> <sup>10</sup>3.

Note that, in two dimensions, we obtain two LEs, but still one FP equation. In general, as the degrees of freedom of the system increase, the choice between LE and FP representations is analogous to the choice between solving many SDEs and solving a single, high-dimensional PDE.

• *Constant drift in the x-direction, V*(*x*, *y*) = *u x*

**–** Langevin equations

$$\begin{array}{rcl} \frac{dx}{dt} &=& \mathfrak{u} + \sqrt{2D}W\_{\mathfrak{x}}(t),\\ \frac{dy}{dt} &=& \sqrt{2D}W\_{\mathfrak{y}}(t). \end{array}$$

**–** Fokker–Planck Equation

$$\frac{\partial P}{\partial t} \quad = \quad -\mu \frac{\partial P}{\partial x} + D \left[ \frac{\partial^2 P}{\partial x^2} + \frac{\partial^2 P}{\partial y^2} \right] \dots$$

Solutions for LE and FP representations for this case of constant drift in the *x*-direction are provided in Figure 8.

**Figure 8.** LE and FP solutions for two-dimensional Brownian motion with constant drift. For both representations, *D* = 10−<sup>2</sup> μm2/s, *u* = 0.2 μ/s and time is in seconds. For the LE representation, the total number of particles is 5 <sup>×</sup> 103.

• *Background flow field,* **u** = **u**<sup>0</sup> + *ux*(*x*, *y*), *uy*(*x*, *y*) *T*

For any background field of the form where *u*<sup>0</sup> and *v*<sup>0</sup> are constants,

$$\mathbf{u} = \begin{bmatrix} u\_0 + u\_x(\mathbf{x}, y) \\ v\_0 + u\_y(\mathbf{x}, y) \end{bmatrix} \text{\textquotedblleft}$$

the Langevin equations are given by

$$\begin{array}{rcl} \frac{dx}{dt} &=& u\_0 + \left(\frac{\partial u\_x}{\partial x}\right)x + \left(\frac{\partial u\_x}{\partial y}\right)y + \sqrt{2D}W\_x(t),\\ \frac{dy}{dt} &=& v\_0 + \left(\frac{\partial u\_y}{\partial x}\right)x + \left(\frac{\partial u\_y}{\partial y}\right)y + \sqrt{2D}W\_y(t). \end{array}$$

This equation can be written in vector form as

$$\frac{d\mathbf{x}}{dt} = \mathbf{u}\_0 + \mathbf{x} \cdot \mathbf{x} + \sqrt{2D} \mathbf{W}\_t$$

where *κij* = *∂ui*/*∂xj* is the strain-rate tensor. The corresponding FP equation is

$$\frac{\partial P}{\partial t} \quad = \quad -\nabla \cdot [(\mathbf{u\_0} + \mathbf{x} \cdot \mathbf{x}) \ P] + D \left[ \frac{\partial^2 P}{\partial \mathbf{x}^2} + \frac{\partial^2 P}{\partial y^2} \right] \dots$$

Note that when *ux* = *uy* = 0, the equations reduce to those for constant drift, as discussed above.

**–** Example: simple shear, **u** = [*U y*, 0] *T*

$$
\begin{aligned}
\mathbf{x} &= \begin{bmatrix}
\frac{\partial u\_x}{\partial x} & \frac{\partial u\_x}{\partial y} \\
\frac{\partial u\_y}{\partial x} & \frac{\partial u\_y}{\partial y}
\end{bmatrix} = \begin{bmatrix}
0 & \mathcal{U} \\
0 & 0
\end{bmatrix}, \\\\
\mathbf{x} \cdot \mathbf{x} &= \begin{bmatrix} 0 & \mathcal{U} \\
0 & 0 \end{bmatrix} \cdot \begin{bmatrix} \mathbf{x} \\ \mathbf{y} \end{bmatrix} = \begin{bmatrix} \mathcal{U}\mathcal{Y} \\\ 0 \end{bmatrix}.
\end{aligned}
$$

$$
\nabla \cdot [(\mathbf{x} \cdot \mathbf{x})\ \mathcal{P}] = \begin{bmatrix}
\frac{\partial}{\partial x} \\
\frac{\partial}{\partial y}
\end{bmatrix} \cdot \begin{bmatrix} \mathcal{U}\mathcal{Y}\mathcal{P} \\\ 0 \end{bmatrix} = \begin{bmatrix} \mathcal{U}\mathcal{Y}\frac{\partial \mathcal{P}}{\partial x} \\\ 0 \end{bmatrix}.
$$

\* Langevin equations

$$\begin{array}{rcl} \frac{dx}{dt} &=& \mathcal{U}y + \sqrt{2D}\mathcal{W}\_{\mathcal{X}}(t),\\ \frac{dy}{dt} &=& \sqrt{2D}\mathcal{W}\_{\mathcal{Y}}(t). \end{array}$$

\* Fokker–Planck Equation

$$\frac{\partial P}{\partial t} \quad = \quad - \mathcal{U} \, y \, \frac{\partial P}{\partial \mathbf{x}} + D \left[ \frac{\partial^2 P}{\partial \mathbf{x}^2} + \frac{\partial^2 P}{\partial y^2} \right]$$

.

Solutions for LE and FP representations for this case of simple shear flow are provided in Figure 9.

**Figure 9.** LE and FP solutions for two-dimensional Brownian motion with simple shear flow. For both representations, *D* = 10−<sup>2</sup> μm2/s, *U* = 0.2 μ/s and time is in seconds. For the LE representation, the total number of particles is 5 <sup>×</sup> 103.

#### **4. Conclusions**

In this paper, we analyzed the relation between Langevin (LE) and Fokker–Planck (FP) representations of particles moving in a fluid due to Brownian motion with and without external fields. Although each description offers a different perspective of the underlying fluid dynamics, there is a direct connection between these two approaches, which were explored through simple examples in both one and two dimensions. In studying these two families of equations, we employed subjects from calculus, such as

Taylor expansions and conservative vector fields; ordinary differential equations, such as integrating factors; and partial differential equations, such as similarity solutions.

The LE representation involves stochastic differential equations (SDEs) and offers the advantage of allowing the microscopic process to be easily incorporated into the equations. One of the drawbacks of this representation is that it is necessary to have as many SDEs as degrees of freedom in the system and each SDE needs to be solved many times to reduce statistical noise.

The FP approach involves a partial differential equation (PDE) describing the evolution of the probability density function (PDF) of the stochastic variable. Unlike numerical solutions for SDEs, which are noisy, solutions for the FP are deterministic and as such can truly avoid noise. One of its drawbacks is that the dimensionality of the PDF increases with the number of degrees of freedom of the system, which leads to high algorithmic complexity, and as a result, the corresponding numerical schemes have a high computational cost.

Experimentally, LE equations can be informed by techniques that capture the movement of probes at the microscale such as passive microrheology [8]. On the other hand, FP equations can be informed by experimental techniques that capture the behavior of the ensemble of probes such as light scattering experiments [14].

**Author Contributions:** Conceptualization, A.M. and P.A.V.; methodology, A.M. and P.A.V.; software, A.M., R.D. and P.A.V.; validation, A.M., R.D. and P.A.V.; formal analysis, A.M. and P.A.V.; investigation, A.M. and P.A.V.; resources, P.A.V.; data curation, P.A.V.; writing—original draft preparation, A.M., R.D. and P.A.V.; writing—review and editing, A.M. and P.A.V.; visualization, A.M., R.D. and P.A.V.; supervision, P.A.V.; project administration, P.A.V.; funding acquisition, P.A.V. All authors have read and agreed to the published version of the manuscript.

**Funding:** This research was funded by National Science Foundation, grant number NSF-DMS 1751339 and NASA, grant number 80NSSC19K0159 P00004.

**Conflicts of Interest:** The authors declare no conflict of interest.

#### **Appendix A**

```
%% Constants
  D = 1e−2; % diffusion coefficient
  dt = 1e−3; % time step
  Np = 5e2; % number of particles
  NT = 1e3; % number of time steps
%% Generate particle positions
 x = zeros(Np,NT); y = zeros(Np,NT); z = zeros(Np,NT);
 for k=2:NT
    x(:,k) = x(:,k−1) + sqrt(2*D*dt)*randn(Np,1);
    y(:,k) = y(:,k−1) + sqrt(2*D*dt)*randn(Np,1);
    z(:,k) = z(:,k−1) + sqrt(2*D*dt)*randn(Np,1);
 end
%% Calculate MSD
  lag = round((1/3)*NT):round((2/3)*NT);
  for k=1:length(lag)
     dx = x(:,1+lag(k):end)−x(:,1:end−lag(k));
     dy = y(:,1+lag(k):end)−y(:,1:end−lag(k));
     dz = z(:,1+lag(k):end)−z(:,1:end−lag(k));
```

```
msd1(k,:) = mean(dx'.^2);
      msd2(k,:) = mean(dx'.^2+dy'.^2);
      msd3(k,:) = mean(dx'.^2+dy'.^2+dz'.^2);
   end
%% Plot MSDs
   plot(lag*dt,mean(msd1'),'linewidth',3)
   hold on
   plot(lag*dt,mean(msd2'),'−−','linewidth',3)
   plot(lag*dt,mean(msd3'),'−.','linewidth',3)
%% Recover D
      fmsd1 = fit(lag'*dt,mean(msd1')','a*x','start',1);
      fmsd2 = fit(lag'*dt,mean(msd2')','a*x','start',1);
      fmsd3 = fit(lag'*dt,mean(msd3')','a*x','start',1);
      fmsd1.a/2
      fmsd2.a/4
      fmsd3.a/6
```
#### **Appendix B**

Recall that in Figure 2, the trajectory of three different particles were plotted. Assume we are interested in determining the x-coordinate of the final position of a particle. From the figure, we would have three different answers: *x* = 0.0140, *x* = −0.0526, and *x* = 0.0081. It is clear that the fact that each plot gives a different answer is a result of the randomness of the process. This simple observation implies that the correct question is not *what is the position of the particle?* but rather *what is the most likely position of the particle?* To answer this, we collect the final position of 1000 particles and summarize them using histograms, like the ones shown in Figure A1.

To construct histograms, we divide the data into groups or 'bins' and count how many realizations fall within each bin. The next question is how to extract probabilities out of these histograms. A first attempt to calculate probabilities is to divide the number of realizations within each bin by the total number of realizations. An inspection of Figure A1 shows why this is not the correct approach; although both figures (**B**) and (**D**) correspond to the same data, the answer is different depending on the number of bins used.

In order to *transform* the histogram data into probabilities, it is necessary to eliminate the effect of the bin size. This is done by normalizing the histogram using the area of each bin, rather than the counts in each bin. This normalization is shown in Figure A2.

**Figure A1.** Histograms of particle positions for 1000 particles. (**A**) counts using 20 bins; (**B**) counts from (**A**) divided by total number of particles; (**C**) counts using 10 bins; (**D**) counts from (**C**) divided by total number of particles.

**Figure A2.** Normalized histogram of particle positions. The code used to generate these plots can be found in Appendix B.

Since the size of the bins does not affect the resulting plot, we could make the size of the bins as small as we wish, to the point of being able to trace a continuous probability density function, represented by the continuous line in Figure A2, which is unique to the data independently of the number of bins used.

Just as its name indicates, a PDF is not exactly a probability. However, just as one can find the mass of an object by multiplying its density by its volume, we can find a probability by multiplying is probability *density* (PDF) by a range. In this sense, the quantity

$$P(x,t) \, dx$$

represents the probability that a particle's position is in the range [*x*, *x* + *dx*] at time *t*.

In addition, working with the continuous form of the PDF, *P*(*x*, *t*), allows us to use integrals to find different probabilities as areas under the curve, as the example given in Figure A3, or to provide a definition of statistical moments based on PDFs:

$$M\_n(\mathbf{x}) \;= \; \int\_{-\infty}^{\infty} \mathbf{x}^n P(\mathbf{x}, t) \, d\mathbf{x}$$

**Figure A3.** Calculating probabilities using PDFs.

Note that since the area under the PDF should represent all possible realizations, we have the condition that the area under the whole curve should be equal to one:

$$\int\_{-\infty}^{\infty} P(\mathbf{x}, t) \, d\mathbf{x} = 1. \tag{A1}$$

As a final remark, note that not all PDFs are bell-shaped like a Gaussian. The only condition that remains true for all PDFs is that the area under the curve is equal to one as defined in Equation (A1). In addition, not all PDFs have to define a probability density for every location of the sample space. For a more in-depth review of different probability distribution functions, the reader is referred to [15].

```
%% Computing and Normalizing histogram
   [c,n] = hist(x(:,600),20);
   c1 = c./trapz(n,c);
%% Fitting to normal distribution
   [mu,sigma,muci,sigmaci] = normfit(x(:,600));
   Y = normpdf(linspace(−0.4,0.4,1e3),mu,sigma);
%% Plots
   bar(n,c1)
   hold on
   plot(linspace(−0.4,0.4,1e3),Y)
```
#### **References**



© 2020 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (http://creativecommons.org/licenses/by/4.0/).

MDPI St. Alban-Anlage 66 4052 Basel Switzerland Tel. +41 61 683 77 34 Fax +41 61 302 89 18 www.mdpi.com

*Fluids* Editorial Office E-mail: fluids@mdpi.com www.mdpi.com/journal/fluids

MDPI St. Alban-Anlage 66 4052 Basel Switzerland

Tel: +41 61 683 77 34 Fax: +41 61 302 89 18