What is a Toolbox

Feel++ comes with toolboxes. What are they ?

Definition: A Feel++ Toolbox

For a given set of partial differential equations for a given physics (e.g. computational fluid dynamics) or set of physics (e.g. fluid structure interaction), a Feel++ toolbox provides:

  • the configuration the set of equations through one or several (.json) files and (.cfg) files

  • one or more solution strategies to solve the set of equations

Using the JSON and CFG, it is possible to configure and run models by defining the relevant physical quantities—such as material properties, loads, constraints, sources, and fluxes.

1. JSON files

The Model JSON (.json) files allow to configure a set of partial differential equations, more precisely they define:

1.1. Names and Type of Model

A model JSON file starts by giving names (long and short) as well as the type of model which will be used by the toolbox. The latter allows to configure the set of equations associated the toolbox physics.

"Name": "Turek-Hron cfd2", (1)
"ShortName":"cfd2", (2)
"Models": (3)
{
   "equations":"Navier-Stokes" (4)
}
1 Name of the example, usually printed on-screen and in log files during simulations
2 Short name of the example, it is used to create directories to store the results of the simulation of the model
3 Section Models defined by the toolbox to define the main configuration of a toolbox and in particular the set of equations to be solved
4 toolbox specific option to define set of equations to be solved, read the toolbox manual to learn about the possible options.

1.2. Parameters

This section of the Model JSON file defines the parameters that may enter expressions used in the subsequent sections.

Example of a Parameters section
"Parameters": (1)
    {
        "ubar":"1.0" (2)
    }
1 name of the section
2 defines a new parameter ubar and its associated value

1.3. Materials

This section of the Model JSON file defines material properties linking the Physical Entities in the mesh data structures to these properties.

Example of Materials section
"Materials":
    {
        "Fluid": (1)
        {
            "rho":"1.0e3", (2)
            "mu":"1.0" (3)
        }
    }
1 gives the name of the physical entity (here Physical Surface) associated to the Material.
2 density \(\rho\) is called rho and is given in SI units
3 viscosity \(\mu\) is called mu and is given in SI units

1.4. BoundaryConditions

This section of the Model JSON file defines the boundary conditions.

Example of a BoundaryConditions section
"BoundaryConditions":
    {
        "velocity":  (1)
        {
            "Dirichlet": (2)
            {
                "inlet": (3)
                {
                    "expr":"{ 1.5*ubar*(4./0.1681)*y*(0.41-y),0}:ubar:y" (4)
                },
                "wall1": (5)
                {
                    "expr":"{0,0}" (6)
                },
                "wall2": (7)
                {
                    "expr":"{0,0}" (8)
                }
            }
        },
        "fluid": (9)
        {
            "outlet": (10)
            {
                "outlet": (11)
                {
                    "expr":"0" (12)
                }
            }
        }
    }
1 the field name of the toolbox to which the boundary condition is associated
2 the type of boundary condition to apply, here Dirichlet
3 the physical entity (associated to the mesh) to which the condition is applied
4 the mathematical expression associated to the condition, note that the parameter ubar is used
5 another physical entity to which Dirichlet conditions are applied
6 the associated expression to the entity
7 another physical entity to which Dirichlet conditions are applied
8 the associated expression to the entity
9 the variable toolbox to which the condition is applied, here fluid which corresponds to velocity and pressure \((\mathbf{u},p)\)
10 the type of boundary condition applied, here outlet or outflow boundary condition
11 the hysical entity to which outflow condition is applied
12 the expression associated to the outflow condition, note that it is scalar and corresponds in this case to the condition \(\sigma(\mathbf{u},p) \normal = 0 \normal\)

1.5. PostProcessing

This section allows to define the output fields and quantities to be computed and saved for e.g. visualization.

"PostProcess": (1)
    {
        "Exports": (2)
        {
            "fields":["velocity","pressure","pid"] (3)
        },
        "Measures": (4)
        {
            "Forces":"wall2", (5)
            "Points": (6)
            {
                "pointA": (7)
                {
                    "coord":"{0.6,0.2,0}", (8)
                    "fields":"pressure" (9)
                },
                "pointB": (10)
                {
                    "coord":"{0.15,0.2,0}", (11)
                    "fields":"pressure" (12)
                }
            }
        }
    }
1 the name of the section
2 the Exports identifies the toolbox fields that have to be exported for visualisation
3 the list of fields to be exported
4 the Measures section identifies outputs of interest such as
5 Forces applied to a surface given by the physical entity wall2
6 Points values of fields
7 name of the point
8 coordinates of the point
9 fields to be computed at the point coordinate
10 name of the point
11 coordinates of the point
12 fields to be computed at the point coordinate

Here is a biele example from the Toolbox examples.

2. CFG files

The Model CFG (.cfg) files allow to pass command line options to Feel++ applications. In particular, it allows to

  • setup the mesh

  • define the solution strategy and configure the linear/non-linear algebraic solvers.