# Heat Toolbox

## 1. Models

The model used by default with the heat toolbox is represented by this equation

$\rho C_p \frac{\partial T}{\partial t} + \nabla \cdot \boldsymbol{q}= Q, \quad \text{ in } \Omega$

with the following properties :

• $q=-k \nabla T$ is the conductive heat flux,

• $Q=0$ is heat source by default equal to 0,

• $\Omega$ the domain where the model is applied (.i.e. the materials).

For a steady-state problem, the temperature does not change with time, and the first term disappears.

### 1.1. Heat sources

The source term $Q$ in the heat equation is used to model internal heat generation and absorption with positive and negative values respectively.

For adding a heat source term in the model, a JSON key called `heat-sources` must be added and the JSON value associated can be

• a string: explicit expression of $Q$,

• a JSON object: setup one heat source,

• an array of JSON object : $Q$ is composed of several heat sources.

We also consider two ways for defined a heat source :

• from an explicit expression of the heat source

• from an expression of the heat rate $P$. In this case, $Q = P/V$, where $V$ is the volume of the material belongs to this model.

The setup of a heat source is defined from the properties listed in the next table.

Keyword Description Value Type Default Value

`type`

possible values : `heat-source`, `heat-rate`

string

`heat-source`

`expr`

expression with respect to the type used

string

The term $Q$ can be also split into $N$ terms (for example due to the multiple physics). The term $Q$ can be written as $Q=\sum_{i=1}^N Q_i$. This setup can be done by using an array of JSON objects for the `heat-sources` entry. And each JSON object corresponds to the previous description of one heat source.

``````{
"Models": {
"heat": [
{ (1)
"name": "heat1",
"materials": [
"mymatA",
"mymatB"
],
"setup": {
"heat-sources": [ (2)
{ (3)
"type": "heat-source",
"expr": "3"
},
{ (4)
"type": "heat-rate",
"expr": "2*exp(t):t"
}
]
}
},
{ (5)
"name": "heat2",
"materials": [
"mymatC"
],
"setup": {
"heat-sources": { (6)
"expr": "30"
}
}
}
]
}
}``````
 1 setup of first model called `heat1` on materials `mymatA` and `mymatB` 2 heat sources will be composed of 2 terms that we will call $Q_1$ and $Q_2$ (with $Q=Q_1+Q_2$) 3 we define $Q_1=3$ 4 we define $Q_2=2*exp(t)/V$ with $V$ the measure of materials `mymatA` and `mymatB` 5 setup of second model called `heat2` on materials `mymatC` 6 we define one heat source with $Q=30$

### 1.2. Convective heat transfert

Modeling heat transfer in fluid requires taking into account the convective effect in the heat equation. The heat equation is written as :

$\rho C_p \frac{\partial T}{\partial t} + \underbrace{\rho C_p \boldsymbol{u} \cdot \nabla T}_{\text{new term}} + \nabla \cdot \mathbf{q}= Q, \quad \text{ in } \Omega$

with $\boldsymbol{u}$ the fluid velocity.

For adding this feature to the model, a `convection` section should be added. The value can be a string corresponding to velocity expression.

``````{
"Models": {
"heat": {
"setup": {
"convection": "{-30*(y+-0.7)*(y-0.5)*(y>0.5)*(y<0.7),0}:y"
}
}
}
}``````

## 2. Materials

Table 1. Materials properties defined in the heat toolbox (symbols are given without components suffix)
Name Symbol Shape Description

thermal-conductivity

k

scalar or matrix

thermal conductivity

density

rho

scalar

density

thermal-expansion

beta

scalar

thermal expansion

specific-heat-capacity

Cp

scalar

specific heat capacity

## 3. Fields and symbols expressions

Table 2. Fields available
Name Description Shape

temperature

the temperature field

scalar

Table 3. Symbols expressions by considering `heat` as the keyword used with the toolbox
Symbol Expression Description

heat_T

$T$

evaluate the temperature

$\frac{\partial T}{\partial x}$

evaluate the first component of gradient of temperature

$\frac{\partial T}{\partial y}$

evaluate the second component of gradient of temperature

$\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_nflux

$-k \nabla T \cdot \boldsymbol{n}$

evaluate the normal flux

## 4. Boundary Conditions

### 4.1. Temperature imposed

$T = g \quad \text{ on } \Gamma$

JSON keywords : `temperature`, `temperature_imposed`

Table 4. JSON properties of boundary condition temperature imposed
Property Description Value Type Is Optional Default Value

`markers`

mesh marker where the BC is applied

`string`, `array of string`, `JSON`

yes

name given to the BC

`expr`

expression of `g`

`string`, `number`

false

``````{
"BoundaryConditions": {
"heat": { (1)
"temperature": { (2)
"bc1": { (3)
"markers": "gamma1", (4)
"expr": "293-10*(y-1)*(y+1):y" (5)
},
"bc2": { (6)
"expr": "293+0.38*t:t"
}
}
}
}
}``````
 1 the toolbox identity 2 JSON keyword for defining this kind of boundary condition 3 name given to a boundary condition of type temperature imposed 4 marker names where the boundary condition is applied 5 the expression of the temperature imposed 6 another boundary condition of type temperature imposed where the marker used will be the name (i.e. `bc2`)
 The temperature imposed can be applied on all kind of marked entities (elements,faces,edges,points)

### 4.2. Heat flux

$k \nabla T \cdot \boldsymbol{n} = g \quad \text{ on } \Gamma$

JSON keywords : `heat_flux`, `flux`

Table 5. JSON properties of boundary condition heat flux
Property Description Value Type Is Optional Default Value

`markers`

mesh marker where the BC is applied

`string`, `array of string`, `JSON`

yes

name given to the BC

`expr`

expression of `g`

`string`, `number`

false

``````{
"BoundaryConditions": {
"heat": {
"flux": {
"bc1": {
"markers": [
"MarkerNeumann_1",
"MarkerNeumann_2"
],
"expr": "34*t:t"
}
}
}
}
}``````
 The expression given to the heat flux boundary condition can depend on the unknown (i.e. any symbols depending on the temperature).

### 4.3. Convective heat flux

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

JSON keywords : `convective_heat_flux`

Table 6. JSON properties of boundary condition convective heat flux
Property Description Value Type Is Optional Default Value

`markers`

mesh marker where the BC is applied

`string`, `array of string`, `JSON`

yes

name given to the BC

`h`

expression of `h`

`string`, `number`

false

`Text`

expression of `g`

`string`, `number`

false

``````{
"BoundaryConditions": {
"heat": {
"convective_heat_flux": {
"bc1": {
"h": "16",
"Text": "287"
}
}
}
}
}``````
 The expressions given to the convective heat flux boundary condition can depend on the unknown but the automatic differentiation is not implemented here, so the jacobian will be inexact if a Newton solver is used.

## 6. Post Processing

### 6.1. Exports

Table 7. Fields allowed to be exported in the `fields` section are:
Name Description

temperature

the temperature field

velocity-convection

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.

### 6.2. Measures

#### 6.2.1. Normal-Heat-Flux

Example of a `Parameters` section
``````{
"Normal-Heat-Flux": { (1)
"bottom": { (2)
"markers": [ (3)
"bottom1",
"bottom2"
],
"direction": "inward" (4)
},
"top": { (5)
"direction": "inward"
}
}
}``````
 1 kind of measure 2 name of measure 3 surface markers where the measure is computed 4 direction : `inward` or `outward` 5 another measure applied on surface marker called top (because when markers is no present, the name is used as marker name)