The data
file contains information on the problem approximated with the code SFEMaNS. These informations are stocked in a derived data type called inputs. For example, the kinetic Reynolds number is saved in inputs%Re. It is possible to add variable, not already included in SFEMaNS, with the file read_user_data.f90
. Such new variables are stocked in the derived data type called user. We refer to the section Fortran file read_user_data.f90 for more information. The information read by the code SFEMaNS can be splitted in the following groups.

General settings (mesh, number of Fourier modes, equations approximated, etc.).

Setting for the NavierStokes equations.

Setting for the level set equation.

Setting for the temperature equation.

Setting for the Maxwell equations.

Setting for eigenvalue problems with Arpack.

Setting for the outputs computations.

Setting to force Fourier components of the velocity field and the magnetic field to zero.
The following described the datas associated to each of the above groups. In particular, we show how to set these datas and specify if it is required to set them. Indeed, some variables have default value while other need to be set in the data for any problem considered. We note that many examples of data
files are described in the sections Examples with manufactured solutions and Examples on physical problems.
Remarks:

The set of each data is done in the line under its associated key line. These key lines always start with "===".

The datas associated to an equation are not required if this equation is not solved.
General settings

The format of the mesh (formatted or unformatted) is set as follows.
===Is mesh file formatted (true/false)?

The directory and the name of the mesh file is set as follows.
===Directory and name of mesh file

It is possible to point out that the mesh is symmetric with the following option.
===Is the mesh symmetric (true/false)?
This parameter is set to false by default.

The number of processors in the meridian section has to be set.
===Number of processors in meridian section
The finite element meridian section is then splitted in as many subsections.

The number of processors in the Fourier space has to be set.
===Number of processors in Fourier space

The number of Fourier modes used to approximate the problem is set as follows.
===Number of Fourier modes
Remark: the number of Fourier mode is a multiple of the number of processors in Fourier space. For instance if one use two processors in Fourier space and approximate four Fourier modes, each processor in Fourier space is approximating the equations for two Fourier modes. The total number of processors used is equal to the number of precessors in meridian section times the number of processors in Fourier space.

It is possible to select a given list of Fourier mode as follows.
===Select Fourier modes? (true/false)
This parameter is set to false by default.

If the above parameter is true, the list of Fourier modes approximated has to be given.
===List of Fourier modes (if select_mode=.TRUE.)

Four type of problems can be considered: nst (hydrodynamic), mxw (magnetic), mhd (magnetohydrodynamic) and fhd (ferrohydrodynamic). The problem type is set as follows.
===Problem type: (nst, mxw, mhd, fhd)
The answer is either 'nst', 'mxw' , 'mhd' or 'fhd'.

The user has to specify if a restart is done on the velocity field.
===Restart on velocity (true/false)

It is also possible to do a restart with data of the magnetic field or the temperature.
===Restart on magnetic field (true/false)
===Restart on temperature (true/false)
These parameters are set to false by default.

It is possible to use the metis partition of a previous computation.
===Do we read metis partition? (true/false)
This parameter is set to false by default. If a restart is done, set this parameter to true. Indeed, the metis partition contains the information on the splitting of the finite element section in subsections.

The number of time step and the number of time iterations is set as follows.
===Time step and number of time iterations
Remark: when doing a restart, the name of the restart files used should not display information on the time iteration they had been generated. It means the part _I001 (_I002, etc.) should be removed of their name. See below
for more information on the generation of the restart files.
Setting for periodic problem (optional)

The number of pairs of boundaries with periodic condition is set as follows. This parameter is set to zero by default.

If pieces of periodic boundary are present, the label of the boundaries and the vector that lead to the first boundary to the second one are given after the following line.
===Indices of
periodic boundaries and corresponding vectors
We note that the code needs as much as lines as the number of pairs of boundaries with periodic condition.
Setting for the NavierStokes equations
We refer to the section Hydrodynamic setting for details on the weak formulation of the NavierStokes equations.
General settings
To approximate solutions of the NavierStokes equations, set the following parameters.

The dependent variable is either the velocity field or the momentum.
===Solve NavierStokes with u (true) or m (false)?
It is set to true by default. We note that the momentum has to be used for multiphase flow problem.

Number of subdomains where the NavierStokes equations are approximated.
===Number of subdomains in NavierStokes mesh

List of the above subdomains.
===List of subdomains for NavierStokes mesh

Number of boundary pieces with Dirichlet condition.
===How many
boundary pieces
for full Dirichlet BCs on velocity?

List of the boundary pieces with Dirichlet condition.
===List of
boundary pieces
for full Dirichlet BCs on velocity

Number of boundary pieces with homogeneous Neumann condition.
===How many
boundary pieces
for homogeneous normal velocity?

List of the boundary pieces with homogeneous Neumann condition.
===List of
boundary pieces
for homogeneous normal velocity

Penalty coefficient for enforcing homogeneous Neumann boundary velocity. It is set to one by default.

Kinetic Reynolds number \(\Re\).

Penalty coefficient \(c_\text{div}\), see the section Approximation of the NavierStokes equations.
===Coefficient for penalty of divergence in NS?
It is set to zero by default. It can not be used with the momentum as dependent variable.
Precession
SFEMaNS can consider precession set up in the precession frame when the rotation axis is the vertical axis \(\textbf{e}_z\). The method consists of adding the term \( 2 \epsilon \textbf{e}_p \times \bu\) in the left handside of the NavierStokes equations. The parameter \(\epsilon\) is the precession rate. The vector \(\textbf{e}_p\) is equal to \(\sin(\alpha\pi)\cos(\theta) \textbf{e}_r \sin(\alpha\pi)\sin(\theta)\textbf{e}_\theta+\cos(\alpha\pi)\textbf{e}_z\) with \(\alpha\) the angle of precession, i.e. the angle between the vertical axis and the precession axis. To use this feature, set the following parameters.

Is the precession term computed?
===Is there a precession term (true/false)?
It is set to false by default.

Precession rate \(\epsilon\).

Precession angle \(\alpha\) in degree.
===Precession angle over pi
Non axisymmetric solid obstacle
SFEMaNS can consider non axisymmetric geometry via the use of a penalty method, see the section Extension to non axisymmetric geometry for more details. To use this feature, set the following parameters.

Is the penalty method used?
===Use penalty in NS domain (true/false)?
It is set to false by default. If set to true, the penalty function \(\chi\) is defined in the subroutine penal_in_real_space
of the file condlim.f90
.

Does the solid has a nonzero velocity?
===Use nonzero velocity in solids (true/false)?
It is set to false by default. If set to true, the velocity \(\bu_\text{obs}\) is defined in the subroutine imposed_velocity_by_penalty
of the file condlim.f90
.

Should the code compute the following quantity \( \displaystyle \frac{2}{\pi}\int_{\Omega_{c,f}} \frac{(1\chi)(\bu\bu_\text{obs}) \cdot \textbf{e}_z}{\tau} \) with \(\tau\) being the time step.
===Compute z momentum (true/false)?
It is set to false by default. The output is written in the file fort.12
each inputs%freq_en time iterations with inputs%freq_en the frequency to write energy outputs (defined later).
LES stabilization with entropy viscosity
We refer to the section Entropy viscosity for under resolved computation for a description of this method. To use this stabilization method, set the following parameters.

Is the entropy viscosity (LES) used? It is set to false by default.

Coefficient \(c_\text{e}\).
===Coefficient multiplying residual

Optional coefficient \(c_1\).
===Coefficient for explicit LES
It is set to zero by default.
Multiphase computations
We refer to the section Extension to multiphase flow problem for more details on this set up.
To use this feature, set the following parameters.

Do we use a second order in time algorithm (BDF2)?
===Do we solve momentum with bdf2 (true/false)?
It is set to false by default. Theoretical results about the algorithm's stability are only known for BDF1.

Is the momentum equation stabilized with the entropy viscosity?
===Use LES in momentum? (true/false)
It is set to true by default.
Informations for the NavierStokes equations solvers
Velocity solver
Set the following information on the solver for the velocity field.

Maximum of iterations.
===Maximum number of iterations for velocity solver

Relative tolerance.
===Relative tolerance for velocity solver

Absolute tolerance.
===Absolute tolerance for velocity solver

Type of solver.
===Solver type for velocity (FGMRES, CG, ...)
It is possible to set it to GMRES (Generalized Minimal Residual method), FGMRES (Flexible Generalized Minimal Residual method) and CG (Conjugate Gradient method).

Type of preconditionner.
===Preconditionner type for velocity solver (HYPRE, JACOBI, MUMPS...)
Pressure solver
Set the following information on the solver for the pressure.

Maximum of iterations.
===Maximum number of iterations for pressure solver

Relative tolerance.
===Relative tolerance for pressure solver

Absolute tolerance.
===Absolute tolerance for pressure solver

Type of solver.
===Solver type for pressure (FGMRES, CG, ...)
It is possible to set it to GMRES (Generalized Minimal Residual method), FGMRES (Flexible Generalized Minimal Residual method) and CG (Conjugate Gradient method).

Type of preconditionner.
===Preconditionner type for pressure solver (HYPRE, JACOBI, MUMPS...)
Mass matrix solver
Set the following information on the solver for the mass matrix.

Maximum of iterations.
===Maximum number of iterations for mass matrix solver

Relative tolerance.
===Relative tolerance for mass matrix solver

Absolute tolerance.
===Absolute tolerance for mass matrix solver

Type of solver.
===Solver type for mass matrix (FGMRES, CG, ...)
It is possible to set it to GMRES (Generalized Minimal Residual method), FGMRES (Flexible Generalized Minimal Residual method) and CG (Conjugate Gradient method).

Type of preconditionner.
===Preconditionner type for mass matrix solver (HYPRE, JACOBI, MUMPS...)
Setting for the level set equations (multiphase problem)
We refer to the section Extension to multiphase flow problem for a description of such set ups.
General settings
To consider multiphase flow problems, set the following parameters.

Is a level set used? It is set to false by default. The following information are only read if it is set to true.

What is the number of fluids? As the level set functions represent interfaces between fluids, this number is equal to the number of level set plus one.

Define a multiplier that multiplies the minimum mesh size. The result is saved in inputs%h_min_distance. It can be used to initialize the level set.
===multiplier for h_min for level set

Coefficient \(c_\text{comp}\in[0,1]\).
===Compression factor for level set
A typical value is one.

Densities of the different fluids.
===Density of fluid 0, fluid 1, ...

Dynamical viscosities of the different fluids.
===Dynamic viscosity of fluid 0, fluid 1, ...

If needed, set the electrical conductivity of the different fluids.
===Conductivity of fluid 0, fluid 1, ...

Is there surface tension effect?
===Is there a surface tension?
The default value is false.

Coefficients of surface tension of each level set. These parameters are the inverse of the Weber number.
===Coefficients of surface tension for level set 0, level set 1, ...

Is a mass correction applied?
===Do we apply mass correction? (true/false)
It is set to true by default.

Number of boundary pieces with Dirichlet condition.
===How many
boundary pieces
for Dirichlet BCs on level set?

List of the boundary pieces with Dirichlet boundaries conditions.
===List of
boundary pieces
for Dirichlet BCs on level set

What function of reconstruction \(F\) is used?
===How are the variables reconstructed from the level set function? (lin, reg)
If \(F\) is the identity set it to 'lin', set it to 'reg' otherwise.

Coefficient \(c_\text{reg}\) for reg reconstruction.
===Value of the regularization coefficient in (0,0.5]
If used, it is generally set to \(0.5\).

When reconstructing the fluid properties with the function \(F\), do we use \(F(\tilde{\phi})\) with \(\tilde{\phi}=\min(1,\max(0,\phi))\)?
===Do we kill level set overshoot? (true/false)
This parameter is set to false by default. It allows to ensure that the density does not present overshoot.
Information for the level set equation solver
Set the following information on the solver for the level set equation.

Maximum of iterations.
===Maximum number of iterations for level set solver

Relative tolerance.
===Relative tolerance for level set solver

Absolute tolerance.
===Absolute tolerance for level set solver

Type of solver.
===Solver type for level set (FGMRES, CG, ...)
It is possible to set it to GMRES (Generalized Minimal Residual method), FGMRES (Flexible Generalized Minimal Residual method) and CG (Conjugate Gradient method).

Type of preconditionner.
===Preconditionner type for level set solver (HYPRE, JACOBI, MUMPS...)
Setting for the temperature equation
We refer to the section Heat equation's weak formulation for details on the weak formulation of the heat equation.
General settings
To consider thermal effect, set the following parameters.

Is there thermal effect?
===Is there a temperature field?
The default value is false. The following information are only read if it is set to true.

The number of subdomains where the heat equation is solved.
===Number of subdomains in temperature mesh

The list of the subdomains where the heat equation is solved.
===List of subdomains for temperature mesh

The volumetric heat capacity \(C\) in each domains.
===Volumetric heat capacity (1:nb_dom_temp)

The thermal conductivity \(\lambda\) in each domains.
===Thermal conductivity (1:nb_dom_temp)

It is possible to approximate the heat equation with the diffusivity coefficient \(\kappa=\frac{\lambda}{C}\).
===Diffusivity coefficient for temperature (1:nb_dom_temp)
In that case, the equations solved is \(\partial_t T + \DIV(T\bu)\DIV(\kappa\GRAD T)=0\).

Nondimensional gravity coefficient that be used to define the action of the temperature of the velocity field.
===Nondimensional gravity coefficient
This parameter is saved in inputs%gravity_coefficient.

Number of boundary pieces with Dirichlet boundary condition.
===How many
boundary pieces
for Dirichlet BCs on temperature?

List of the boundary pieces with Dirichlet boundary condition.
===List of
boundary pieces
for Dirichlet BCs on temperature

Number of interfaces between the velocity field and the temperature field domains.
===Number of interfaces between velocity and temperature only domains (for nst applications)

List of interfaces between the velocity field and the temperature field domains.
===List of interfaces between velocity and temperature only domains (for nst applications)
Information for the temperature equation solver
Set the following information on the solver for the temperature equation.

Maximum of iterations.
===Maximum number of iterations for temperature solver

Relative tolerance.
===Relative tolerance for temperature solver

Absolute tolerance.
===Absolute tolerance for temperature solver

Type of solver.
===Solver type for temperature (FGMRES, CG, ...)
It is possible to set it to GMRES (Generalized Minimal Residual method), FGMRES (Flexible Generalized Minimal Residual method) and CG (Conjugate Gradient method).

Type of preconditionner.
===Preconditionner type for temperature solver (HYPRE, JACOBI, MUMPS...)
Setting for the Maxwell equations
We refer to the section Magnetic setting for details on the weak formulation of the Maxwell equations.
General settings
The parameters required to approximate solutions of the Maxwell equations can be splitted in two main groups.

Information on the approximation of the magnetic field in the conducting domain.

The dependent variable in the conducting region can be \(\bH\) or \(\bB\).
===Solve Maxwell with H (true) or B (false)?
It is set to false by default. When using a magnetic permeability that depends of the time and the azimuthal direction, it has to be set to false.

Number of conducting subdomains where the Maxwell equation is approximated with the magnetic field \(\bH\) or \(\bB\).
===Number of subdomains in magnetic field (H) mesh

List of the conducting subdomains.
===List of subdomains for magnetic field (H) mesh

Number of interfaces in the conducting domains.
===Number of interfaces in H mesh
These interfaces represents surfaces with jump in the magnetic permeability or surfaces where boundary conditions are applied on the velocity field or the temperature field.

List of the above interfaces.
===List of interfaces in H mesh

Number of boundary pieces with Dirichlet conditions on \(\bH\times\textbf{n}\).
===Number of Dirichlet sides for Hxn

List of the boundary pieces with Dirichlet condition.
===List of Dirichlet sides for Hxn

Is the magnetic permeability defined analytically?
===Is permeability defined analytically (true/false)?
It is set to false by default. If set to true, the magnetic permeability is defined in a function of the file condlim.f90
.

If the magnetic permeability is defined analytically, does it depends of the time and the azimuthal direction?
===Is permeability variable in
theta (
true/
false)?
It is set to false by default and the magnetic permeability is defined in the function mu_bar_in_fourier_space
of the file condlim.f90
. If set to true, this function defined the stabilization term \(\overline{\mu}\) and the magnetic permeability is defined in the function mu_in_real_space
.

Is the magnetic permeability is computed on gauss points with Gaussian quadratures?
===Use FEM Interpolation for magnetic permeability (true/false)?
It is set to true by default.

If the permeability is not defined analytically, set the magnetic permeability in each subdomains.
===Permeability in the conductive part (1:nb_dom_H)

Electrical conductivity in each subdomains.
===Conductivity in the conductive part (1:nb_dom_H)

The order of the polynomial function used to approximated the magnetic field.
===Type of finite element for magnetic field
It can be set to one or two.

Magnetic Reynolds number \(\Rm\).
===Magnetic Reynolds number

Stabilization coefficient \(\beta_1\), see the section Approximation of the Maxwell equations with H.
===Stabilization coefficient (divergence)

Stabilization coefficient \(\beta_3\), see the section Approximation of the Maxwell equations with H.
===Stabilization coefficient for Dirichlet H and/or interface H/H

Information on the approximation of the scalar potential \(\phi\) in the insulating domain.

Number of insulating subdomains where the scalar potential \(\phi\) is used to approximate the Maxwell equations.
===Number of subdomains in magnetic potential (phi) mesh
It is set to zero by default. The following information are only read if it is set to true.

List of the insulating subdomains.
===List of subdomains for magnetic potential (phi) mesh

Number of boundary pieces with Dirichlet condition.
===How many
boundary pieces
for Dirichlet BCs on phi?

List of the boundary pieces with Dirichlet condition.
===List of
boundary pieces
for Dirichlet BCs on phi

Number of interfaces between the conducting and insulating subdomains.
===Number of interfaces between H and phi

List of the interface between the conducting and insulating subdomains.
===List of interfaces between H and phi

Permeability in the insulating domain. It does not depends of the insulating subdomains.
===Permeability in vacuum

The order of the polynomial function used to approximated the scalar potential.
===Type of finite element for scalar potential
It can be set to one or two. It needs to be larger than the one used for the magnetic field.

Stabilization coefficient \(\beta_2\), see the section Approximation of the Maxwell equations with H.
===Stabilization coefficient (interface H/phi)

In addition, it is possible to use a quasistatic approximation.
===Quasistatic approximation (true) or (false)?
It is set to false by default. We refer to the section Fortran file condlim.f90 for more details on this set up.
Information for the Maxwell equations solver
Set the following information on the solver for the Maxwell equations.

Maximum of iterations.
===Maximum number of iterations for Maxwell solver

Relative tolerance.
===Relative tolerance for Maxwell solver

Absolute tolerance.
===Absolute tolerance for Maxwell solver

Type of solver.
===Solver type for Maxwell (FGMRES, CG, ...)
It is possible to set it to GMRES (Generalized Minimal Residual method), FGMRES (Flexible Generalized Minimal Residual method) and CG (Conjugate Gradient method).

Type of preconditionner.
===Preconditionner type for Maxwell solver (HYPRE, JACOBI, MUMPS...)
Setting for eigenvalue problem with Arpack
Eigenvalue problems for the Maxwell equations can be considered. The following parameters needs to be set.

Is Arpack used? It is set to false by default. The following information are only read if it is set to true.

Number of eigenvalues to compute.
===Number of eigenvalues to compute

Maximum number of Arpack iteration.
===Maximum number of Arpack iteration

Tolereance for Arpack solver.

Which eigen values are approximated (largest/smallest magnitude, real part or imaginary part).
===Which eigenvalues (''LM'', ''SM'', ''SR'', ''LR'' ''LI'', ''SI'')

Generation of visualization files for Paraview.
===Create 2D vtu files for Arpack? (true/false)
It is set to false by default.
Output settings
Information on the outputs computed are provided as follows.

Frequency to write restart files of the variables approximated. This value is saved in inputs%freq_restart. The suite files for the NavierStokes variables have the following name suite_ns_Sxxx_Iyyy.mesh_name where:

xxx is the number of the subsection of the meridian plane (000, 001, etc.) associated to the restart file.

yyy is the time iteration divided by inputs%freq_restart when the file was generated.

mesh_name is the name of the mesh.
For the temperature, respectively the magnetic field, the nst is replaced by temp, respectively by maxwell.

Frequency to write the energies or other ouputs computed in the subroutine
my_post_processing
of the file main.f90
===Frequency to write energies
This value is saved in inputs%freq_en.

Frequency to generate visualization files for Paraview.
===Frequency to create plots
This value is saved in inputs%freq_plot

Number of planes used to generate the visualization file.
===Number of planes in real space for Visualization
It is set to ten by default.

It is possible to only do postprocessing of restarts files.
===Just postprocessing without computing? (true/false)
The section The subroutine my_post_processing details how to compute these outputs. Additional information can be computed by the code in the output file. These informations are written each inputs%freq_en time iterations.

Do the code checks the numerical stability?
===Check numerical stability (true/false)
The code check that the \(\bL^2\)norm of the velocity field or the magnetic field is not larger than a hundred. This value can be changed in the file main.f90
, look for inputs%check_numerical_stability.

Compute the average computational time per iteration.
===Verbose timing? (true/false)

Compute the divergence of the velocity field and the magnetic field.
===Verbose divergence? (true/false)

For problem involving the NavierStokes equations, the CFL can be computed.
===Verbose CFL? (true/false)
Setting to force Fourier components of velocity field and magnetic field to zero
It is possible to set a list of Fourier components of all variables of the NavierStokes and Maxwell equations to zero. It is done as follows.

Are some Fourier modes set to zero?
===Should some modes be zeroed out?
The default value if false. The following information are only read if it is set to true.

Number of Fourier modes to set to zero for the NavierStokes equations approximations.
===How many NavierStokes modes to zero out?

List of above Fourier modes.
===List of NavierStokes modes to zero out?

Number of Fourier modes to set to zero for the Maxwell equations approximations.
===How Maxwell modes to zero out?

List of above Fourier modes.
===List of Maxwell modes to zero out?