Hybrid Discontinuous Galerkin User Manual

In many application context, not only do we need the primal variable (e.g. the potential or the displacement) but also the dual variable (e.g the flux or the stress).

Feel++ supports HdG methods and enables primal/dual variables solves.

1. Mixed Poisson

1.1. Models

Mixed Poisson equations are

\[\begin{align} \boldsymbol{u} + k\nabla p &= \boldsymbol{f}\\ \nabla\cdot \boldsymbol{u} &= g \end{align}\]

completed by boundary conditions and where \(k\) represents the conductivity.

Those equations can represent several problem types, such as electrostatics problems or heat transfer problems. One can choose to use field names and material properties in the model file for a particular physic by using a MixedPoissonPhyics in the constructor of the toolbox.

By default, no physic is used (MixedPoissonPhysics::None). Electric (MixedPoissonPhysics::Electric) and heat (MixedPoissonPhysics::Heat) are also available.

1.2. Materials

Table 1. Materials properties defined in the MixedPoisson toolbox with MixedPoissonPhysics::None
Name Symbol Shape Description

conductivity

cond

scalar

conductivity

Table 2. Materials properties defined in the MixedPoisson toolbox with MixedPoissonPhysics::Electric
Name Symbol Shape Description

electric-conductivity

sigma

scalar

electric conductivity

Table 3. Materials properties defined in the MixedPoisson toolbox with MixedPoissonPhysics::Heat
Name Symbol Shape Description

thermal-conductivity

k

scalar

thermal conductivity

1.3. Fields and symbols expressions

Table 4. Fields available with MixedPoissonPhysics::None
Name Description Shape

potential

the potential field

scalar

flux

the flux field

vectorial

Table 5. Symbols expressions with MixedPoissonPhysics::None
Symbol Expression Description

poisson_P

\(P\)

evaluate the potential

poisson_grad_P_0

\(\frac{\partial p}{\partial x}\)

evaluate the first component of gradient of potential

poisson_grad_P_1

\(\frac{\partial p}{\partial y}\)

evaluate the second component of gradient of potential

poisson_grad_P_2

\(\frac{\partial p}{\partial z}\)

evaluate the third component of gradient of potential

poisson_dn_P

\(\nabla p \cdot \boldsymbol{n}\)

evaluate the normal derivative of potential

poisson_F_0

\(\boldsymbol{u}_x\)

evaluate the x component of the flux

poisson_F_1

\(\boldsymbol{u}_y\)

evaluate the y component of the flux

poisson_F_2

\(\boldsymbol{u}_z\)

evaluate the z component of the flux

Table 6. Fields available with MixedPoissonPhysics::Electric
Name Description Shape

electric-potential

the electric potential field

scalar

current-density

the current density field

vectorial

Table 7. Symbols expressions with MixedPoissonPhysics::Electric
Symbol Expression Description

electric_V

\(V\)

evaluate the potential

electric_grad_V_0

\(\frac{\partial V}{\partial x}\)

evaluate the first component of gradient of electric potential

electric_grad_V_1

\(\frac{\partial V}{\partial y}\)

evaluate the second component of gradient of electric potential

electric_grad_V_2

\(\frac{\partial V}{\partial z}\)

evaluate the third component of gradient of electric potential

electric_dn_V

\(\nabla V \cdot \boldsymbol{n}\)

evaluate the normal derivative of electric potential

electric_C_0

\(\boldsymbol{j}_x\)

evaluate the x component of the current density

electric_C_1

\(\boldsymbol{j}_y\)

evaluate the y component of the current density

electric_C_2

\(\boldsymbol{j}_z\)

evaluate the z component of the current density

Table 8. Fields available with MixedPoissonPhysics::Heat
Name Description Shape

temperature

the temperature field

scalar

heat-flux

the heat flux field

vectorial

Table 9. Symbols expressions with MixedPoissonPhysics::Heat
Symbol Expression Description

heat_T

\(T\)

evaluate the temperature

heat_grad_T_0

\(\frac{\partial T}{\partial x}\)

evaluate the first component of gradient of temperature

heat_grad_T_1

\(\frac{\partial T}{\partial y}\)

evaluate the second component of gradient of temperature

heat_grad_T_2

\(\frac{\partial T}{\partial z}\)

evaluate the third component of gradient of temperature

heat_dn_T

\(\nabla T \cdot \boldsymbol{n}\)

evaluate the normal derivative of temperature

heat_F_0

\(\boldsymbol{u}_x\)

evaluate the x component of the heat flux

heat_F_1

\(\boldsymbol{u}_y\)

evaluate the y component of the heat flux

heat_F_2

\(\boldsymbol{u}_z\)

evaluate the z component of the heat flux

1.4. Boundary Conditions

1.4.1. Dirichlet

On the potential/electric-potential/temperature:

\[P = g \quad \text{ on } \Gamma\]

1.4.2. Neumann

On the potential/electric-potential/temperature:

\[-k \nabla P \cdot \boldsymbol{n} = g \quad \text{ on } \Gamma\]

1.4.3. Robin

On the potential/electric-potential/temperature:

\[-k \nabla P \cdot \boldsymbol{n} = h \left( T - g \right) \quad \text{ on } \Gamma\]

1.4.4. Integral

On the flux/current-density/heat-flux:

\[\int_\Gamma \boldsymbol{u}\cdot\boldsymbol{n} = g \quad \text{ on } \Gamma\\ |\Gamma|p - \int_\Gamma p = 0 \quad \text{ on } \Gamma\]

1.5. Initial Conditions

1.6. PostProcessing

1.6.1. Exports

Table 10. Fields allowed to be exported in the fields section with MixedPoissonPhysics::None are:
Name Description

potential

the potential field

flux

the flux field

pid

the mesh partitioning

all

all fields available

Table 11. Fields allowed to be exported in the fields section with MixedPoissonPhysics::Electric are:
Name Description

electric-potential

the electric potential field

current-density

the current density flux

pid

the mesh partitioning

all

all fields available

Table 12. Fields allowed to be exported in the fields section with MixedPoissonPhysics::Heat are:
Name Description

temperature

the temperature field

heat-flux

the heat flux field

pid

the mesh partitioning

all

all fields available

All materials properties given in the section Materials can be also exported by specifying the name in the fields entry.

2. Coupled Mixed Poisson

2.1. Models

The equations of the model are:

\[\begin{align} \boldsymbol{u} + k\nabla p &= \boldsymbol{f}\\ \frac{1}{M}\frac{\partial p}{\partial t} + \nabla\cdot \boldsymbol{u} &= g \end{align}\]

coupled with a system of ODE:

\[\begin{align} \frac{\partial \boldsymbol{y}}{\partial t} + \underline{\underline{A}}(\boldsymbol{y},t)\boldsymbol{y} = s(\boldsymbol{y},t) + b(\boldsymbol{y},t) \end{align}\]

where \(\Pi_1\in \boldsymbol{y}\) and the boundary condition:

\[\int_\Gamma \boldsymbol{u}\cdot\boldsymbol{n} = \frac{P_I - \Pi_1}{R_b} \quad \text{ on } \Gamma\\ |\Gamma|p - \int_\Gamma p = 0 \quad \text{ on } \Gamma\]

with \(P_I = p_{|\Gamma}\).

Most of the configuration is the same as for the Mixed Poisson toolbox, except for the boundary condition where the coupling happens.

2.2. Boundary Conditions

2.2.1. Coupling

On the flux/current-density/heat-flux:

Example of a Coupling boundary condition
"Coupling":
{
    "buffer":
    {
        "markers":"top", (1)
        "capacitor": "Cbuffer.C", (2)
        "resistor": "Rbuffer.R", (3)
        "circuit": "$cfgdir/test3d0d_linear/test3d0d_linear.fmu", (4)
        "buffer": "Pi_1.phi" (5)
    }
}
1 marker for \(\Gamma\)
2 name of the variable in the FMU for \(C_b\)
3 name of the variable in the FMU for \(R_b\)
4 path of the FMU
5 name of the variable in the FMU for \(\Pi_1\)

3. Mixed Elasticity

3.1. Notations and units

Notation

Quantity

\(\mathcal A\)

compliance operator

\(\lambda\)

first Lamé parameter

\(\mu\)

second Lamé parameter

\(\rho\)

mass density

3.2. Equations

Mixed Elasticity equations are

\[\newcommand{\uv}{\underline{\underline{\mathbf v}}} \newcommand{\usigma}{\underline{\underline{\boldsymbol\sigma}}} \newcommand{\ueps}{\underline{\underline{\boldsymbol\varepsilon}}} \newcommand{\uw}{\underline{\mathbf w}} \newcommand{\un}{\underline{\mathbf n}} \newcommand{\uu}{\underline{\mathbf u}} \newcommand{\uzero}{\underline{\mathbf 0}} \newcommand{\ug}{\underline{\mathbf g}} \newcommand{\umu}{\underline{\boldsymbol\mu}} \newcommand{\ux}{\underline{\mathbf x}} \begin{align} \mathcal A\usigma - \ueps(\uu) &= \uzero & &\text{in }\Omega\times (0,T)\subset\mathbb R^n\times\mathbb{R} \\ \rho \dfrac{\partial^2 \uu}{\partial t^2} &= \nabla\cdot\usigma + \underline{\mathbf F}_{ext} & &\text{in }\Omega\times (0,T) \\ \usigma\;\un &= \underline{\mathbf g}_N & &\text{on }\Gamma_N \\ \uu &= \underline{\mathbf g}_D & &\text{on }\Gamma_D \\ \int_{\Gamma_I} \usigma \; \un &= \underline{\mathbf{F}}_{target} & & \text{on } \Gamma_I \\ \uu(x,t) &= \uu(t) & & \text{on } \Gamma_I \end{align}\]

The compliance operator is defined as follow:

\begin{equation} \mathcal A\uv = c_1 \uv + c_2 \text{trace}(\uv) \underline{\underline{\mathbf{I}}} \end{equation}

where

\begin{align} & c_1 = \dfrac{1}{2\mu} & c_2 = \dfrac{-\lambda}{2\mu \left( 3\lambda + 2\mu \right)} \end{align}

3.3. MixedElasticity Toolbox

The model is described in a json file which path is given by the option mixedelasticity.model_json. The construction of this file is detailed in the following sections.

3.3.1. Models

The models are not considered for now.

Model section
"Model": "HDG"

3.3.2. Materials

In this part we define the two Lamé parameters \(\lambda\) and \(\mu\) and the mass density \(\rho\). It is always necessary to define also the material we work on.

Material section
"Materials":
{
    "<marker>":
    {
        "name": "copper",
	"rho":"1",
        "lambda":"1",
	"mu":"1"
    }
}

3.3.3. Boundary Conditions

All boundary conditions are described in the same way

Listing : boundary conditions in json
"BoundaryConditions":
{
    "<field>":
    {
        "<bc_type>":
        {
            "<marker>":
            {
                "<option1>":"<value1>",
                "<option2>":"<value2>",
                // ...
            }
        }
    }
}

Different types of boundary condition are available.

Dirichlet condition
\[\uu = \ug_D\]

Field

Type

Option

Value

displacement

Dirichlet

expr

\(\ug_D\)

Neumann condition
\[\usigma\;\un = \ug_N\]

Field

Type

Option

Value

stress

Neumann

expr

\(\ug_DN\)

Integral boundary condition
\[\int_{\Gamma_I} \usigma \; \un = \underline{\mathbf{F}}_{target}\]

Field

Type

Option

Value

stress

Integral

expr

\(\underline{\mathbf{F}}_{target}\)

3.3.4. Source Term

The source term \(\underline{\mathbf{F}}_{ext}\) is treated as a boundary condition.

Field

Type

Option

Value

stress

SourceTerm

expr

\(\underline{\mathbf{F}}_{ext}\)

3.3.5. Post Process

Two fields can be exported, the displacement \(\uu\) and the stress \(\usigma\).

Post Process section
"PostProcess":
{
    "Fields":["displacement","stress"]
}

Moreover it is possible to apply a scaling after the computation and then export the scaled field, in particular we define in the material section the scale factor for the elements with a specific marker.

Material section
"Materials":
{
    "<marker>":
    {
	"scale_displacement":"1",
	"scale_stress":"1"
    }
}
Post Process section
"PostProcess":
{
    "Fields":["displacement","stress","scaled_displacement","scaled_stress"]
}

3.4. Create applications

In order to solve linear elasticity problem, an application should contain at least

Minimal Elasticity case
typedef FeelModels::MixedElasticity<FEELPP_DIM,FEELPP_ORDER> me_type;
auto ME = me_type::New("mixedelasticity");
ME->init();
ME->solve();
ME->exportResults();

The assembling for the constant part is inside the initialization, while the assembling of the non-constant part (e.g. the right hand side) is in the solve method.

3.5. Run simulations

Programme available to run simulations:

mpirun -np 4 feelpp_toolbox_mixed-elasticity-model_3DP{<polynomial_order>}_G{<geometric_order>}`

with =0,1,2,3,4 and =1,2 .