Nektar++
Direct solver (coupled approach)

Here, we will explain how to use the incompressible Navier-Stokes solver of Nektar++ using the direct solver. Its source code is located at Nektar++/solvers/IncNavierStokesSolver/EquationSystems. We will start by showing the formulation and demonstrating how to run a first example with the incompressible Navier-Stokes solver and briefly explain the options of the solver specified in the input file. After these introductory explanations, we will present some numerical results in order to demonstrate the capabilities and the accuracy of the solver.

# Formulation

We consider the weak form of the Stokes problem for the velocity field and the pressure field :

where , and are appropriate spaces for the velocity and the pressure system to satisfy the inf-sup condition. Using a matrix notation the discrete system may be written as:

where the components of and are , and and the components and are and . The indices and refer to the degrees of freedom on the elemental boundary and interior, respectively. In constructing the system we have lumped the contributions form each component of the velocity field into matrices and . However we note that for a Newtonian fluid the contribution from each field is decoupled. Since the inetrior degrees of freedom of the velocity field do not overlap, the matrix is block diagonal and to take advantage of this structure we can statically condense out the matrix to obtain the system:

To extend the aboce Stokes solver to an unsteady Navier-Stokes solver we first introduce the unsteady term, , into the Stokes problem. This has the principal effect of modifying the weak Laplacian operator into a weak Helmholts operator where depends on the time integration scheme. The second modification requires the explicit discretisation of the non-linear terms in a similar manner to the splitting scheme and this term is then introduced as the forcing term .

# Running a first example

The folder Nektar++/regressionTests/Solvers/IncNavierStokesSolver/InputFiles contains several *.xml files. These are input files for the Navier-Stokes solver specifying the geometry (i.e. the mesh and the spectal/hp expansion), the parameters and boundary conditions. Further details on the structure of the input file can be found in pageXML.

Now, lets try to run one of them with the coupled solver.

• Copy the input file, Test_ChanFlow_LinNS_m8.xml to the directory where the solver is compiled, e.g. Nektar++/solvers/IncNavierStokesSolver/build/IncNavierStokesSolver.
• Run the code by typing
./IncNavierStokesSolver Test_ChanFlow_LinNS_m8.xml

The solution should now have been written to the file Test_ChanFlow_LinNS_m8.fld. This file is formatted in the Nektar++ output format. To visualise the solution, we can convert the fld-file into TecPlot, Gmsh or Tecplot file formats using the Post-processing tools in Nektar++/utilities/builds/PostProcessing/. Here, we will demonstrate how to convert the fld-file into TecPlot-file format.

We convert the fld-file into Tecplot-file format by typing

../../../utilities/builds/PostProcessing/FldToTecplot Test_ChanFlow_LinNS_m8.xml Test_ChanFlow_LinNS_m8.fld

It will create Test_ChanFlow_LinNS_m8.dat which can be loaed in TecPlot.

Channel Flow (u-velocity component)

# Input Options

A detailed descriptions of the input file for Nektar++ can be found in pageXML. For what concern the incompressible Navier-Stokes solver a typical set is:

<SOLVERINFO>
<I PROPERTY="SolverType" VALUE="CoupledLinearisedNS"/>
<I PROPERTY="Projection" VALUE="Galerkin"/>
<I PROPERTY="TimeIntegrationMethod" VALUE="IMEXOrder1"/>
</SOLVERINFO>
<PARAMETERS>
<P> TimeStep = 0.001 <P>
<P> NumSteps = 100 <P>
<P> IO_CheckSteps = 10 <P>
<P> IO_InfoSteps = 10 <P>
<P> Kinvis = 1.0 <P>
</PARAMETERS>

Futher options can be specified in the input file, as for the Steady Oseen Flow:

<SOLVERINFO>
<I PROPERTY="SolverType" VALUE="CoupledLinearisedNS"/>
<I PROPERTY="Projection" VALUE="Galerkin"/>
</SOLVERINFO>
<PARAMETERS>
<P> Kinvis = 0.025 </P>
<P> LAMBDA = 0.9637405441957 </P>
</PARAMETERS>
<E VAR="u" VALUE="(1-exp(-LAMBDA*x)*cos(2*PI*y))" />
<E VAR="v" VALUE="(-LAMBDA/(2*PI))*exp(-LAMBDA*x)*sin(2*PI*y)" />
</FUNCTION>