In this section, we would like to show you how to run the ESPRESO solver for problems of heat transfer in 2D. In the following, you can find how to set ESPRESO Configuration File and run ESPRESO in sequential or parallel mode. Benchmarks cover wide range of options for solution problems from linear steady-state to nonlinear transient problems.

List of benchmarks:

*[Simple Wall 01](#simple-wall-01): Linear steady-state, Dirichlet BC.

*[Simple Wall 02](#simple-wall-02): Linear steady-state, Dirichlet BC as a function.

*[Simple Wall 03](#simple-wall-03): Linear steady-state, linear convection.

*[Simple Wall 04](#simple-wall-04): Nonlinear steady-state, Symmetric variant of Newton-Raphson, nonlinear material model, nonlinear external forced convection, setting for modification of Newton method - Full Newton-Raphson, non-symmetric problem and sub-stepping definition.

*[Simple Wall 05](#simple-wall-05): Linear transient (time dependent), monitoring results.

*[Simple Wall 13](#simple-wall-13): Linear steady-state solver with translation motions (nonzero advection therm), non-symmetric linear solver, consistent stabilization

*[Simple Wall 14](#simple-wall-14): Linear transient solver with translation motions (nonzero advection therm), non-symmetric linear solver, consistent stabilization

*[Simple Wall 15](#simple-wall-15): Nonlinear steady state solver with adaptive precision in Newton Raphson method, translation motions (nonzero advection therm), non-symmetric linear solver, consistent and inconsistent stabilization

---

## Simple Wall 01

### Model definition

This benchmark show how to solve simple linear steady-state heat transfer problem with one material model and simple Dirichlet boundary condition

!!!example "Numerical model definition:"

* 2D square $a = 1\ [m]$

* Constant thickness $1\ [m]$ set to all elements

* Material – Aluminum alloy, Isotropic material model, Thermal conductivity $\lambda= 154\ [W\cdot m^{-1}\cdot K^{-1}]$, set to all elements

* Uniform initial temperature $293.15\ [K]$

* Constant temperature - set to region **LEFT**, $Temperature = 320\ [K]$

* Constant temperature - set to region **RIGHT**, $Temperature = 380\ [K]$

Computational mesh for this simple wall example is generated by internal ESPRESO mesh generator which is designed for fast parallel benchmarking of the physical solvers. This was specified by GENERATOR input parameter (line 3). Simple wall is created in GENERATOR object (lines 6-39). We specify there grid shape and then, we set length of the 2D grid. For boundary condition definition, we have to specify NODES component (LEFT, RIGHT, line 16-19). Element type is set to quadratic square (line 21). Then we have to specify number of clusters, domains, and elements in each directions which serve to domain decomposition definition as is depicted on figure bellow.

Six input arguments has meaning of discretization parameters and are defined in ecf file as a input arguments [ARG0-5]. First two arguments are number of clusters in X and Y direction (in this example set to 1, that mean 1x1 clusters per body), next two arguments are number of domains in X and Y direction (in this example set to 1, that mean 1x1 domains per cluster) and last two arguments are number of elements per domain edge in X and Y direction (set to 50, that mean 50x50 elements per domain). Option -c define path to ESPRESO ecf file.

:rocket: **How to run ESPRESO without MPI, but with OpenMP parallelization:**

In this example we show how to set example with 2 FETI domains per square edge (2x2 domains per 1x1 clusters) with $50^2$ elements per domain.

We have to set environment variable for OpenMP parallelization. In this example we are able to set number of threads to 4, because we have four domains (OpenMP parallelization in ESPRESO is over domains and MPI parallelization is over clusters)

```bash

$ set threading.default <nthreads>

```

:rocket: **How to run ESPRESO with MPI, but without OpenMP parallelization:**

Now we show how to run example with 2 FETI clusters per square edge (2x2 clusters with 1x1 domains) with $50^2$ elements per domain (uniform decomposition)

After solution is done, we can find result database files in the folder which we specify in the OUTPUT object. In this example, we set EnSight file format as the output database. Results are store in new folder :open_file_folder:*results/< DATE >/< name_of_ECF_file >* which is located in root folder of the ESPRESO unless otherwise stated.

EnSight case Gold file format is possible open not only in EnSight, but in commonly used open source postProcessing tools like [ParaView](https://www.paraview.org/) or [VisIt](https://wci.llnl.gov/simulation/computer-codes/visit) also.

---

## Simple Wall 02

### Model definition

This benchmark show how to set Dirichlet boundary condition and thickness as a function of spatial coordinates. Model is the same as in previous example - linear steady-state heat transfer.

!!! info "Note"

ESPRESO solver use mathematical expression toolkit library [ExprTk](http://partow.net/programming/exprtk/) for parsering and evaluation mathematical expression. Thanks to that, lot of boundary condition, material parameters or geometrical definition can by set as a function dependent variables. User can also specify depended variables as a tabular data.

!!! example "Numerical model definition:"

* 2D square $a = 1\ [m]$

* Thickness as a function $f(x,y)=1+x$, set to all elements

* Material – Aluminum alloy, Isotropic material model, Thermal conductivity $\lambda= 154\ [W\cdot m^{-1}\cdot K^{-1}]$, set to all elements

* Uniform initial temperature $293.15\ [K]$

* Constant temperature - set to region **LEFT**, $Temperature = 320+10\times Y\ [K]$

* Constant temperature - set to region **RIGHT**, $Temperature = 380\ [K]$

In the following block you can find how ESPRESO Configuration File looks like for this example. Example is almost the same like previous one and function definition of the temperature definition and thickness setting are highlighted in the code list.

The following figures were created in EnSight using ESPRESO results. These results are contained in the :open_file_folder:*results/< DATE >/squareSimpleWall_temperature_02/*.

In the following block you can find how ESPRESO Configuration File looks like for this example. Convection boundary condition definition is highlighted. User specify heat transfer coefficient as a function of temperature or spatial coordinates and ambient temperature.

The following figure (temperature distribution) was created in EnSight using ESPRESO results. These results are contained in the :open_file_folder:*results/< DATE >/squareSimpleWall_temperature_03/*. On the right side of the square is new boundary temperature defined by convection set 305.29 [K].

This benchmark show how to solve nonlinear steady-state heat transfer problem with nonlinear temperature dependent material model and nonlinear external forced convection at boundary.

!!! example "Numerical model definition:"

* 2D square $a = 1\ [m]$

* Constant thickness $1\ [m]$, set to all elements

* Material – nonlinear temperature dependent, Isotropic material model, Thermal conductivity $\lambda= 2+10\times (TEMPERATURE/20)^2\ [W\cdot m^{-1}\cdot K^{-1}]$, set to all elements

* Uniform initial temperature $293.15\ [K]$

* Constant temperature - set to region **LEFT**, $Temperature = 280\ [K]$

* nonlinear external forced convection - set to region **RIGHT**, heat transfer coefficient based on Nusselt number

* type of external convection: EXTERNAL_FORCED

* Ambient temperature: $Temperature = 360\ [K]$

* Length: $1\ [m]$

* Fluid velocity: $10\ [m/s]$

* Fluid type: water

* Constant temperature - set to region **TOP**, $Temperature = 800\ [K]$

Nonlinear convection is based on Nusselt number as a function of Prandtl nad Reynolds numbers. Material parameters of fluid medium are evaluated at average of surface and ambient temperature $(T_{surf}+T_{amb})/2$. Heat transfer coefficient is evaluated as follows:

where material data $\rho,\mu,c_{p},k$ are set as a piecewise polynomial curves.

ESPRESO contain lot of nonlinear convection types for example external natural convection on vertical wall, inclined wall, horizontal cylinder, between horizontal plates and on sphere, internal natural convection between parallel plates or in circular tube, external forced convection plates and internal forced convection in tube. User can also specify his own variant of nonlinear convection by temperature dependent heat transfer coefficient table or function.

### Configuration definition

Nonlinear behavior of the ESPRESO solver is allowed by the MODE NONLINEAR option in load step settings definition (line 74). Next step will be definition of the nonlinear solver options which are set in NONLINEAR_SOLVER object (line 77-91), were we have to set convergence parameters, substepping behavior, line search and type of Newton Raphson solver. TANGENT_MATRIX_CORRECTION option is used for switching between symmetric and full Newton Raphson method. If TANGENT_MATRIX_CORRECTION is set to true, linear solver must be set to non-symmetric version.

The following figures were created in EnSight using ESPRESO results. These results are contained in the :open_file_folder:*results/< DATE >/squareSimpleWall_temperature_04/*.

On the next graph is depicted residuals convergence history of Newton Raphson iterations, red line shows temperature residual and green line shows heat residual history.

<center>

<iclass="fa fa-signal fa-lg"></i>**Newton Raphson Convergence History - symmetrized variant** |

ESPRESO allows to user set Full Newton-Raphson method for solving nonlinear problems. This functionality is enabled by setting TANGENT_MATRIX_CORRECTION option to true in nonlinear solver definition. For full Newton method, non-symmetric solver of the linearized system of the algebraic equations is needed. In the following block you can find setting of non-symmetric iterative solver, in this example solver is set to GMRES. Matrix regularization in the FETI solver must be set to algebraic variant.

!!! config "ECF Configuration file >> Full Newton-Raphson setting"

Residual convergence history of the Full Newton Raphson method is depicted on the graph bellow. Notice that problem converged in three Newton iterations only, instead of five iterations in previous symmetrized variant of the Newton method.

<center>

<iclass="fa fa-signal fa-lg"></i>**Newton Raphson Convergence History - Full non-symmetric** |

For the highly nonlinear problems, sub-stepping method for gradually increased loading can be perform. Sub-stepping is turn on by setting STEPPING option to TRUE. Next, user have to set number of the substeps. These settings is highlighted in the following block.

!!! config "ECF Configuration file >> Full Newton-Raphson with sub-stepping"

Transient solver in the ESPRESO solver is allowed by the TYPE TRANSIENT option in load step settings definition (line 73). User have to specify duration time of the current load step (line 72). Then behavior of the transient solver is set in TRANSIENT_SOLVER object. User specify there type of time discretization scheme and size of the time step.

In the OUTPUT object, setting of the variables monitoring on the specific region with specific output statistic is shown. If user define some monitoring options in configuration file, solver store define statistical data to text file *ecf_file_name.emr* which is located in results folder.

The following video (temperature distribution) was created in EnSight using ESPRESO results. These result is contained in the :open_file_folder:*results/< DATE >/squareSimpleWall_temperature_05/*.

<center>

<iclass="fa fa-film fa-lg"></i>**Temperature distribution over time** |

This example contain also monitoring of temperature statistic on the **RIGHT** region. Average and minimal temperature value over time are depicted in the following graph. Monitoring data is sorted in the text file with CSV format *< NAME of ecf >.emr*

This benchmark show how to set multiple load steps - combination of the steady state solver as a first load step and following transient solver as a second load step.

!!! example "Numerical model definition:"

* 2D square $a = 1\ [m]$,

* Constant thickness $1\ [m]$, set to all elements,

* Material – Isotropic material model, set to all elements

For the definition of the multiple load steps number of load steps have to be define (line 46). Then object *LOAD_STEP_SETTINGS* contain *n* object which has name of the load step (line 73, 100). Load step definition contain boundary condition definition, transient and nonlinear solver settings and settings of the linear solver.

The following figures shown temperature distribution in the square at the end of the load step 1 and 2. These result is contained in the :open_file_folder:*results/< DATE >/squareSimpleWall_temperature_06/*.

**Temperature Distribution - Loas Step 1** |**Temperature Distribution - end of Load Step 2** |

For the definition of the multiple load steps number of load steps have to be define (line 47). Then object *LOAD_STEP_SETTINGS* contain *n* object which has name of the load step (line 73, 105, 137). Load step definition contain boundary condition definition, transient and nonlinear solver settings and settings of the linear solver.

The following figures shown temperature distribution in the square at the end of the load step 1, 2 and 3. These result is contained in the :open_file_folder:*results/< DATE >/squareSimpleWall_temperature_07/*.

**Temperature - end of Load Step 1** |**Temperature - end of Load Step 2** | **Temperature - end of Load Step 3** |

This benchmark show how to set multiple material models to different element regions. FIn this example ESPRESO mesh generator is used for creating element regions in the form of the cheeseboard.

In this example we specify two element regions **WHITE** and **BLACK** in the ESPRESO mesh generator. Now is possible tt set on the element regions specific material models as is shown in the line 72, 73 in the configuration file bellow.

The following figures were created in EnSight using ESPRESO results. These results are contained in the :open_file_folder:*results/< DATE >/squareSimpleWall_temperature_08/*.

For larger jumps in the material coefficients and using FETI domain decomposition method, solution with different conjugate projection is needed, or user can try to specify number of restarts in the full orthogonal conjugate gradient method for decrease number of iterations of the CG method. User can specify number of restarts and number of iteration when restart is performed. {== (These method can rapidly decrease number of iteration for very large coefficient jumps without any time consuming preconditioner like GenEO is, but settings of this parameter is based on heuristic approach and is for experimental use only) ==}

For example in the graph bellow is depicted comparison of the standard CG method with heuristic restarted approach for material jump **KXX in MAT_02 set to 1E9** and solver settings as is depicted in previous code list.

In the ESPRESO is possible to define 4 material models for thermal conductivity, Isotropic, Diagonal, Symmetric ans Anisotropic. User can specify every single value in thermal conductivity tensor. For thermal conductivity tensor is possible define different coordinate system (Cartesian, Cylindrical and Spherical) where global conductivity tensor is then define by

where $\mathbf{T}$ is transformation matrix containing direction cosines between local and global coordinate systems and $\mathbf{k}$ is conductivity matrix in local coordinate system.

### Configuration definition

In this example we specify two element regions **WHITE** and **BLACK** in the ESPRESO mesh generator. Now is possible to set on the element regions specific material models as is shown in the line 72, 73 in the configuration file bellow.

The following figures were created in EnSight using ESPRESO results. These results are contained in the :open_file_folder:*results/< DATE >/squareSimpleWall_temperature_09/*.

Automatic time stepping method is based on response eigenvalue which is used in the computation of the time step length. The response eigenvalue is defined as:

Automatic time stepping method is enabled if **ALLOWED** option is set to **TRUE** in **TRANSIENT_SOLVER** object. User the specify minimal and maximal time step length, oscillation limit (default value 0.5) and Increase/Decrease factor (default value 3).

At the following graph is depicted changing of the time step length during the calculation. Time step length is automatically changed by the decrease/increase factor.