# Theory¶

## Computational Approach¶

The spatial discretization is based on the spectral element method (SEM) [Patera1984], which is a high-order weighted residual technique similar to the finite element method. In the SEM, the solution and data are represented in terms of \(N\) th-order tensor-product polynomials within each of \(E\) deformable hexahedral (brick) elements. Typical discretizations involve \(E\)=100–10,000 elements of order \(N\)=8–16 (corresponding to 512–4096 points per element). Vectorization and cache efficiency derive from the local lexicographical ordering within each macro-element and from the fact that the action of discrete operators, which nominally have \(O(EN^6)\) nonzeros, can be evaluated in only \(O(EN^4)\) work and \(O(EN^3)\) storage through the use of tensor-product-sum factorization [Orszag1980]. The SEM exhibits very little numerical dispersion and dissipation, which can be important, for example, in stability calculations, for long time integrations, and for high Reynolds number flows. We refer to [Denville2002] for more details.

Nek5000 solves the unsteady incompressible two-dimensional, axisymmetric, or three-dimensional Stokes or Navier-Stokes equations with forced or natural convection heat transfer in both stationary (fixed) or time-dependent geometry. It also solves the compressible Navier-Stokes in the Low Mach regime, the magnetohydrodynamic equation (MHD). The solution variables are the fluid velocity \(\mathbf u=(u_{x},u_{y},u_{z})\), the pressure \(p\), the temperature \(T\). All of the above field variables are functions of space \({\bf x}=(x,y,z)\) and time \(t\) in domains \(\Omega_f\) and/or \(\Omega_s\) defined in Fig. 17. Additionally Nek5000 can handle conjugate heat transfer problems.

## Energy Equation¶

In addition to the fluid flow, Nek5000 computes automatically the energy equation

## Non-Dimensional Energy / Passive Scalar Equation¶

A similar non-dimensionalization as for the flow equations using the non-dimensional variables \(\mathbf x^*\ = \frac{\mathbf x}{L}\), \(\mathbf u^*\ = \frac{u}{U}\), \(t^*\ = \frac{t}{L/U}\), \(T=\frac{T^*-T_0}{\delta T}\) leads to

where \(Pe=LU/\alpha\), with \(\alpha=k/\rho c_p\).

## Passive Scalars¶

We can additionally solve a convection-diffusion equation for each passive scalar \(\phi_i\), \(i = 1,2,\ldots\) in \(\Omega_f \cup \Omega_s\)

The terminology and restrictions of the temperature equations are retained for the passive scalars, so that it is the responsibility of the user to convert the notation of the passive scalar parameters to their thermal analogues. For example, in the context of mass transfer, the user should recognize that the values specified for temperature and heat flux will represent concentration and mass flux, respectively. Any combination of these equation characteristics is permissible with the following restrictions. First, the equation must be set to unsteady if it is time-dependent or if there is any type of advection. For these cases, the steady-state (if it exists) is found as stable evolution of the initial-value-problem. Secondly, the stress formulation must be selected if the geometry is time-dependent. In addition, stress formulation must be employed if there are traction boundary conditions applied on any fluid boundary, or if any mixed velocity/traction boundaries, such as symmetry and outflow/n, are not aligned with either one of the Cartesian \(x,y\) or \(z\) axes. Other capabilities of Nek5000 are the linearized Navier-Stokes for flow stability, magnetohydrodynamic flows etc.

## Unsteady Stokes¶

In the case of flows dominated by viscous effects Nek5000 can solve the reduced Stokes equations

where \(\boldsymbol\tau=\mu[\nabla \mathbf u+\nabla \mathbf u^{T}]\) and

Also here we can distinguish between the stress and non-stress formulation according to whether the viscosity is variable or not. The non-dimensional form of these equations can be obtained using the viscous scaling of the pressure.

## Steady Stokes¶

If there is no time-dependence, then Nek5000 can further reduce to

where \(\boldsymbol\tau=\mu[\nabla \mathbf u+\nabla {\mathbf u}^{T}]\) and

## Linearized Equations¶

In addition to the basic evolution equations described above, Nek5000 provides support for the
evolution of small perturbations about a base state by solving the *linearized equations*

for multiple perturbation fields \(i=1,2,\dots\) subject to different initial conditions and (typically) homogeneous boundary conditions.

These solutions can be evolved concurrently with the base fields \((\mathbf u,p,T)\). There is also support for computing perturbation solutions to the Boussinesq equations for natural convection. Calculations such as these can be used to estimate Lyapunov exponents of chaotic flows, etc.

## Steady Conduction¶

The energy equation (6) in which the advection term \(\mathbf u \cdot \nabla T\) and the transient term \(\partial T/\partial t\) are zero. In essence this represents a Poisson equation.

## Incompressible MHD Equations¶

Magnetohydrodynamics is based on the idea that magnetic fields can induce currents in a moving conductive fluid, which in turn creates forces on the fluid and changing the magnetic field itself. The set of equations which describe MHD are a combination of the Navier-Stokes equations of fluid dynamics and Maxwell’s equations of electromagnetism. These differential equations have to be solved simultaneously, and Nek5000 has an implementation for the incompressible MHD.

Consider a fluid of velocity \(\mathbf u\) subject to a magnetic field \(\mathbf B\) then the incompressible MHD equations are

where \(\rho\) is the density \(\mu\) the viscosity, \(\eta\) resistivity, and pressure \(p\).

The total magnetic field can be split into two parts: \(\mathbf{B} = \mathbf{B_0} + \mathbf{b}\) (mean + fluctuations). The above equations become in terms of Elsässer variables (\(\mathbf{z}^{\pm} = \mathbf{u} \pm \mathbf{b}\))

where \(\nu_\pm = \nu \pm \eta\).

The important non-dimensional parameters for MHD are \(Re = U L /\nu\) and the magnetic Re \(Re_M = U L /\eta\).

## Arbitrary Lagrangian-Eulerian (ALE)¶

We consider unsteady incompressible flow in a domain with moving boundaries:

Here, \(NL\) represents the quadratic nonlinearities from the convective term.

Our free-surface hydrodynamic formulation is based upon the arbitrary Lagrangian-Eulerian (ALE) formulation described in [Ho1989]. Here, the domain \(\Omega(t)\) is also an unknown. As with the velocity, the geometry \(\mathbf x\) is represented by high-order polynomials. For viscous free-surface flows, the rapid convergence of the high-order surface approximation to the physically smooth solution minimizes surface-tension-induced stresses arising from non-physical cusps at the element interfaces, where only \(C^0\) continuity is enforced. The geometric deformation is specified by a mesh velocity \(\mathbf w := \dot{\mathbf x}\) that is essentially arbitrary, provided that \(\mathbf w\) satisfies the kinematic condition \(\mathbf w \cdot \hat{\mathbf n}|^{}_{\Gamma} = \mathbf u \cdot \hat{\mathbf n}|^{}_{\Gamma}\), where \(\hat{\mathbf n}\) is the unit normal at the free surface \(\Gamma(x,y,t)\). The ALE formulation provides a very accurate description of the free surface and is appropriate in situations where wave-breaking does not occur.

To highlight the key aspects of the ALE formulation, we introduce the weighted residual formulation
of Eq. (16): *Find* \((\mathbf u,p) \in X^N \times Y^N\) *such that:*

for all test functions \((\mathbf v,q) \in X^N \times Y^N\). Here \((X^N,Y^N)\) are the compatible velocity-pressure approximation spaces introduced in [Maday1989], \((.,.)\) denotes the inner-product \((\mathbf f,\mathbf g) := \int_{\Omega(t)} \mathbf f \cdot \mathbf g \,dV\), and \(\mathbf S\) is the stress tensor \(S_{ij}^{} := \frac{1}{2}( \frac{\partial u_i}{\partial x_j} + \frac{\partial u_j}{\partial x_i} )\). For simplicity, we have neglected the surface tension term. A new term in Eq. (17) is the trilinear form involving the mesh velocity

which derives from the Reynolds transport theorem when the time derivative is moved outside the bilinear form \((\mathbf v,\mathbf u_t^{})\). The advantage of Eq. (17) is that it greatly simplifies the time differencing and avoids grid-to-grid interpolation as the domain evolves in time. With the time derivative outside of the integral, each bilinear or trilinear form involves functions at a specific time, \(t^{n-q}\), integrated over \(\Omega(t^{n-q})\). For example, with a second-order backward-difference/extrapolation scheme, the discrete form of Eq. (17) is

Here, \(L^n(\mathbf u)\) accounts for all *linear* terms in Eq. (17), including the
pressure and divergence-free constraint, which are evaluated implicitly (i.e., at time level
\(t^n\), on \(\Omega(t^n)\)), and \(\widetilde{N\!L}^{n-q}\) accounts for all
*nonlinear* terms, including the mesh motion term (18), at time-level \(t^{n-q}\).
The superscript on the inner-products \((.,.)^{n-q}\) indicates integration over
\(\Omega(t^{n-q})\). The overall time advancement is as follows. The mesh position
\(\mathbf x^n \in \Omega(t^n)\) is computed explicitly using \(\mathbf w^{n-1}\) and
\(\mathbf w^{n-2}\); the new mass, stiffness, and gradient operators involving integrals and
derivatives on \(\Omega(t^n)\) are computed; the extrapolated right-hand-side terms are
evaluated; and the implicit linear system is solved for \(\mathbf u^n\). Note that it is only
the *operators* that are updated, not the *matrices*. Matrices are never formed in Nek5000
and because of this, the overhead for the moving domain formulation is very low.