# Heat Air Moisture Modeling

## 1. Geometry

Here is an example of the geometry for the heat air moisture modeling. Figure 1. Geometry of Heat Air Moisture Modeling

In the following we will use those notations :

• $\Omega_r$ is the domain of the room

• $\Omega_w$ is the wall domain

• $\Gamma_{i}$ is the broder between the room and the wall

• $\Gamma_{e}$ is the border between the wall and the exterior

## 2. Heat transfer modeling

### 2.1. Equations

Here are the equation of heat transfert in the wall (equation $\ref{hw}$) and in the room (equation $\ref{hr}$), get from the benchmark BESTEST.

\begin{align} \left(\rho_m c_m \right)_{\mathrm{eff}} \frac{\partial T_w}{\partial t}+\nabla \cdot\left(-k \nabla T_w - L_{\mathrm{v}} \delta_{\mathrm{p}} \nabla\left(\phi_w p_{\mathrm{sat}}\right)\right) &= 0 \tag{H_w}\label{hw}\\ \rho_a c_a \frac{\partial T_r}{\partial t} - h_i \cdot A_w \cdot \left( T_w - T_r \right) - \eta \cdot \rho_a c_a \cdot V_a \cdot \left( T_e - T_r \right) &= H \tag{H_r}\label{hr} \end{align}

With :

• $T_w$ / $T_r$ / $T_e$ [K] is the wall / room / exterior temperature.

• $w_w$ / $w_r$ / $w_e$ [K] is the wall / room / exterior absolute humidity.

• $\phi_w$ / $\phi_r$ / $\phi_e$ [K] is the wall / room / exterior relative humidity.

• $T_e$ [K] is the exterior temperature.

• $\phi_w$ [$-$] is the rom relative humidity- $\rho_m$ [$\mathrm{kg} / \mathrm{m}^3$] is the material density.

• $c_m$ [$\mathrm{J} / \left(\mathrm{kg} . \mathrm{K} \right)$] is the material thermal mass capacity.

• $k$ [$\mathrm{W} \cdot \mathrm{m}^{-1} \cdot \mathrm{K}^{-1}$] is the thermal conductivity.

• $\rho_a$ [$\mathrm{kg} / \mathrm{m}^3$] is the air density.

• $c_a$ [$\mathrm{J} / \left(\mathrm{kg} \cdot \mathrm{K} \right)$] is the air heat capacity.

• $V_a$ [$\mathrm{m}^3$] is the room volume.

• $\eta$ [$\mathrm{h}^{-1}$] is the ventilation rate.

• $h_i$ (resp. $h_e$) [$\mathrm{W}/ \left(m^2 \cdot K\right)$] is the inside (resp. outside) convective heat transfer coefficient.

• $A_w$ [$\mathrm{m}^2$] is the total area of the walls.

• $\xi$ [$\mathrm{kg} / \mathrm{m}^{3}$] is the moisture storage capacity.

• $L_\mathrm{v}$ [$\text{J}\,\text{kg}^{-1}$] is the latent heat of evaporation.

• $\delta_{\mathrm{p}}$ [s] is the vapor permeability.

• $p_{\text {sat }}$ [$\mathrm{Pa}$] is the vapor saturation pressure.

• $D_{\mathrm{w}}$ [$\mathrm{m}^{2} / \mathrm{s}$] is the moisture diffusivity.

• $H$ [$\text{W}$] is the heating power.

The boundary conditions at the border $\Gamma_{i}$ between the wall and the room are :

$- k\nabla T_w=h_i(T_r-T_{w_{s,i}}) + h_m \cdot L_\mathrm{v} \left( w_r - w_w \right)$

At the border $\Gamma_{e}$ between the wall and the exterior the conditions are :

$- k\nabla T_w=h_e(T_e-T_{w_{s,e}}) + h_m \cdot L_\mathrm{v} \left( w_e - w_w \right)$

### 2.2. Variational problem

The solve this problem, we use a product of spaces

• $X_h$ corresponding to the wall

• $W_h$ corresponding to the room : as we consider the temperature as a constant on the room, we take in Feel++ the space `Pch<0>`. This space corresponds to the piecewise-continous functions which are constant on each element of the mesh : there are therefore constant on all the domain. So, the space Pch<0> is equivalent to $\RR$.

Equation $\ref{hw}$ :

Let $v$ be a test function associated to the wall space. As done before, we linearize the problem with this approxmation :

$\frac{\partial T_w}{\partial t}\approx\frac{T_w^{n+1}-T_w^n}{\Delta t}$

The equation $\ref{hw}$ become :

$\int_{\Omega_w}\left(\rho_m^n c_m^n \right) \frac{T_w^{n+1}}{\Delta t}v + \int_{\Omega_w}\nabla \cdot\left(-k^n \nabla T_w^{n+1} - L_{\mathrm{v}}^n \delta_{\mathrm{p}}^n \nabla\left(\phi_w^{n+1} p_{\mathrm{sat}}^n\right)\right)v = \int_{\Omega_w}\left(\rho_m^n c_m^n \right)\frac{T_w^n}{\Delta t} v$

It leads to, after a partial integration :

$\begin{equation} \int_{\Omega_w}(\rho_mc_m)^n \frac{T_w^{n+1}}{\Delta t}v + \int_{\Omega_w} \left(k^n \nabla T_w^{n+1} + L_{\mathrm{v}}^n \delta_{\mathrm{p}}^n \nabla\left(\phi_w^{n+1} p_{\mathrm{sat}}^n\right)\right) \nabla v - \int_{\partial\Omega_w} \left(\left((-k^n \nabla T_w^{n+1} - L_{\mathrm{v}}^n \delta_{\mathrm{p}}^n \nabla\left(\phi_w^{n+1} p_{\mathrm{sat}}^n\right)\right)\cdot n\right)v = \int_{\Omega_w}(\rho_m c_m)^n\frac{T_w^n}{\Delta t}v \end{equation}$

Which is equivalent, after appying the boundary conditions, as $\partial\Omega_w = \Gamma_{e}\cup \Gamma_{i}$

\begin{align} \int_{\Omega_w}(\rho_mc_m)^n \frac{T_w^{n+1}}{\Delta t}v + \int_{\Omega_w} \left(k^n \nabla T_w^{n+1}\right)\nabla v + \\ \int_{\Omega_w} \left(L_{\mathrm{v}}^n \delta_{\mathrm{p}}^n \phi_w^{n+1} \nabla\left(p_{\mathrm{sat}}^n\right)\right) \nabla v + \int_{\Omega_w} \left(L_{\mathrm{v}}^n \delta_{\mathrm{p}}^n p_{\mathrm{sat}}^n \nabla\left(\phi_w^{n+1}\right)\right) \nabla v \\ - \int_{\Gamma_{i}} \left((-k^n \nabla T_w^{n+1})\cdot n\right) v - \int_{\Gamma_{e}} \left((-k^n \nabla T_w^{n+1})\cdot n\right) v \\ - \int_{\Gamma_{i}} \left(\left(L_{\mathrm{v}}^n \delta_{\mathrm{p}}^n \phi_w^{n+1} \nabla\left(p_{\mathrm{sat}}^n\right)\right)\cdot n\right)v - \int_{\Gamma_{e}} \left(\left(L_{\mathrm{v}}^n \delta_{\mathrm{p}}^n \phi_w^{n+1} \nabla\left(p_{\mathrm{sat}}^n\right)\right)\cdot n\right)v \\ - \int_{\Gamma_i} \left(\left(L_{\mathrm{v}}^n \delta_{\mathrm{p}}^n p_{\mathrm{sat}}^n \nabla\left(\phi_w^{n+1}\right)\right)\cdot n\right)v - \int_{\Gamma_e} \left(\left(L_{\mathrm{v}}^n \delta_{\mathrm{p}}^n \phi_w^{n+1} \nabla\left(p_{\mathrm{sat}}^n\right)\right)\cdot n\right)v \\ = \int_{\Omega_w}(\rho_m c_m)^n\frac{T_w^n}{\Delta t}v \end{align}
\begin{align} \int_{\Omega_w}(\rho_mc_m)^n \frac{T_w^{n+1}}{\Delta t}v + \int_{\Omega_w} \left(k^n \nabla T_w^{n+1}\right)\nabla v + \\ \int_{\Omega_w} \left(L_{\mathrm{v}}^n \delta_{\mathrm{p}}^n \phi_w^{n+1} \nabla\left(p_{\mathrm{sat}}^n\right)\right) \nabla v + \int_{\Omega_w} \left(L_{\mathrm{v}}^n \delta_{\mathrm{p}}^n p_{\mathrm{sat}}^n \nabla\left(\phi_w^{n+1}\right)\right) \nabla v \\ - \int_{\Gamma_{i}} (h_i(T_r^{n+1}-T_w^{n+1}) + h_mL_\mathrm{v}(w_r^{n+1} - w_w^{n+1})) v + \int_{\Gamma_{e}} (h_eT_w^{n+1} + h_m L_\mathrm{v} w_w^{n+1}) v \\ - \int_{\Gamma_{i}} \left(L_{\mathrm{v}}^n \delta_{\mathrm{p}}^n \phi_w^{n+1} \nabla\left(p_{\mathrm{sat}}^n\right)\right)v - \int_{\Gamma_{e}} \left(L_{\mathrm{v}}^n \delta_{\mathrm{p}}^n \phi_w^{n+1} \nabla\left(p_{\mathrm{sat}}^n\right)\right)v \\ - \int_{\Gamma_i} \left(L_{\mathrm{v}}^n \delta_{\mathrm{p}}^n p_{\mathrm{sat}}^n \nabla\left(\phi_w^{n+1}\right)\right)v - \int_{\Gamma_e} \left(L_{\mathrm{v}}^n \delta_{\mathrm{p}}^n \phi_w^{n+1} \nabla\left(p_{\mathrm{sat}}^n\right)\right)v \\ = \int_{\Omega_w}(\rho_m c_m)^n\frac{T_w^n}{\Delta t}v + \int_{\Gamma_e} \left(h_eT_e^{n+1} + h_mw_e^{n+1}\right)v \end{align} \tag{H_{w,\mathrm{disc}}}\label{hwd}

Equation $\ref{hr}$ :

We apply the same Euler scheme on $T_r$, the equation $\ref{hr}$ becomes :

$\left(\frac{\rho_ac_p}{\Delta t} + h_iA_w + \eta\rho_ac_a V_a\right)T_r^{n+1} - h_iA_wT_w^{n+1} = H^{n+1} + \frac{\rho_ac_p}{\Delta t} T_r^n + \eta\rho_a c_a V_a T_e^{n+1}$

This equation gives this variational problem :

Find $T_r^{n+1}\in\mathbb{R}$ such as $\forall u\in \RR$ :

$\int_{\Omega_r}\left(\left(\frac{\rho_ac_a}{\Delta t} + h_iA_w + \eta\rho_ac_a V_a\right)T_r^{n+1}\right)u - \int_{\Omega_r} h_iA_wT_w^{n+1} u = \int_{\Omega_r}\left(H^{n+1} + \frac{\rho_ac_a}{\Delta t} T_r^n + \eta\rho_a c_a V_a T_e^{n+1}\right) u \tag{H_{r,\mathrm{disc}}}\label{hrd}$

The variational problem is : find $T^{n+1}=(T_w^{n+1},T_r^{n+1})\in X_h\times W_h$ such as forall test functions $V=(v,u)$,

$A(T^{n+1},V) = f(V)$

with :

• $A(T^{n+1},V) = \begin{bmatrix} \begin{pmatrix} \displaystyle\int_{\Omega_w}(\rho_mc_m)^n \frac{T_w^{n+1}}{\Delta t}v + \int_{\Omega_w} \left(k^n \nabla T_w^{n+1}\right)\nabla v + \int_{\Omega_w} \left(L_{\mathrm{v}}^n \delta_{\mathrm{p}}^n \phi_w^{n+1} \nabla\left(p_{\mathrm{sat}}^n\right)\right) \nabla v + \int_{\Omega_w} \left(L_{\mathrm{v}}^n \delta_{\mathrm{p}}^n p_{\mathrm{sat}}^n \nabla\left(\phi_w^{n+1}\right)\right) \nabla v \\ - \displaystyle\int_{\Gamma_{i}} \left(-h_i T_w^{n+1} - h_mL_\mathrm{v}(w_w^{n+1})\right) v + \int_{\Gamma_{e}} \left(h_eT_w^{n+1} + h_m L_\mathrm{v} w_w^{n+1}\right) v - \int_{\Gamma_{i}} \left(\left(L_{\mathrm{v}}^n \delta_{\mathrm{p}}^n \phi_w^{n+1} \nabla\left(p_{\mathrm{sat}}^n\right)\right)\right)v \\ - \displaystyle\int_{\Gamma_{e}} \left(\left(L_{\mathrm{v}}^n \delta_{\mathrm{p}}^n \phi_w^{n+1} \nabla\left(p_{\mathrm{sat}}^n\right)\right)\right)v - \int_{\Gamma_i} \left(\left(L_{\mathrm{v}}^n \delta_{\mathrm{p}}^n p_{\mathrm{sat}}^n \nabla\left(\phi_w^{n+1}\right)\right)\right)v - \int_{\Gamma_e} \left(\left(L_{\mathrm{v}}^n \delta_{\mathrm{p}}^n \phi_w^{n+1} \nabla\left(p_{\mathrm{sat}}^n\right)\right)\right)v \end{pmatrix} & - \displaystyle\int_{\Gamma_{i}} \left(h_i T_r^{n+1} + h_mL_\mathrm{v}w_r^{n+1}\right) v \\ - \displaystyle\int_{\Omega_r} h_iA_wT_w^{n+1} u & \displaystyle\int_{\Omega_r}\left(\left(\frac{\rho_ac_a}{\Delta t} + h_iA_w + \eta\rho_ac_a V_a\right)T_r^{n+1}\right)u \end{bmatrix}$

• $f(V) = \begin{bmatrix} \displaystyle\int_{\Omega_w}(\rho_m c_m)^n\frac{T_w^n}{\Delta t}v + \int_{\Gamma_e} \left(h_eT_e^{n+1} + h_mw_e^{n+1}\right)v \\ \displaystyle\int_{\Omega_r}\left(H^{n+1} + \frac{\rho_ac_a}{\Delta t} T_r^n + \eta\rho_a c_a V_a T_e^{n+1}\right) u\end{bmatrix}$

The matrix $A$ represents the form such as the rows correspond to test functions and the columns correspond to the trial function. In our case, this like that :

 $\begin{matrix} w \text{ test} \\w \text{ trial}\end{matrix}$ $\begin{matrix} w \text{ test} \\r \text{ trial}\end{matrix}$ $\begin{matrix} r \text{ test} \\w \text{ trial}\end{matrix}$ $\begin{matrix} r \text{ test} \\r \text{ trial}\end{matrix}$

## 3. Moisture transfer modeling

Here are the equation of heat transfert in the wall (equation $\ref{mw}$) and in the room (equation $\ref{mr}$), get from the benchmark BESTEST.

### 3.1. Equations

\begin{align} \xi\frac{\partial\phi_w}{\partial t} + \nabla\cdot\left(-\xi D_\mathrm{w}\nabla\phi_w-\delta_\mathrm{p}\nabla\left(\phi_wp_\mathrm{sat}\right)\right) = 0 \tag{M_w}\label{mw} \\ V_a\frac{\partial w_r}{\partial t} = \eta V_a\left(w_e-w_r\right) + \dot{m}_\mathrm{gen} + h_mA_w\left(w_w-w_r\right) \tag{M_r}\label{mr} \end{align}

With those boundary conditions :

$\begin{cases} -\xi D_\mathrm{w}\nabla \phi_w - \delta_\mathrm{p}\nabla(\phi_wp_\mathrm{sat}) = h_{m,i}(w_r-w_w)\qquad \text{on }\Gamma_i\\ -\xi D_\mathrm{w}\nabla \phi_w - \delta_\mathrm{p}\nabla(\phi_wp_\mathrm{sat}) = h_{m,e}(w_e-w_w)\qquad \text{on }\Gamma_i \end{cases}$

### 3.2. Variational problem

Wall equation $\ref{mw}$ :

We do the same process as before to get the variational formulation, with a test function $v$ :

$\int_{\Omega_w}\xi^n\frac{\phi_w^{n+1}}{\Delta t}v + \int_{\Omega_w}\nabla\cdot\left(-\xi^n D_\mathrm{w}^n\nabla\phi_w^{n+1}-\delta_\mathrm{p}^n\nabla\left(\phi_w^{n+1} p_\mathrm{sat}^n\right)\right)v = \int_{\Omega_w}\xi^n\frac{\phi_w^n}{\Delta t}v$
$\int_{\Omega_w}\xi^n\frac{\phi_w^{n+1}}{\Delta t}v + \int_{\Omega_w}\left(\xi^n D_\mathrm{w}^n\nabla\phi_w^{n+1}+\delta_\mathrm{p}^n\nabla\left(\phi_w^{n+1} p_\mathrm{sat}^n\right)\right)\cdot\nabla v - \int_{\Gamma_i\cup\Gamma_e}\left(\left(\xi^n D_\mathrm{w}^n\nabla\phi_w^{n+1}+\delta_\mathrm{p}^n\nabla\left(\phi_w^{n+1} p_\mathrm{sat}^n\right)\right)\cdot n\right) v = \int_{\Omega_w}\xi^n\frac{\phi_w^n}{\Delta t}v$
\begin{align} \int_{\Omega_w}\xi^n\frac{\phi_w^{n+1}}{\Delta t}v + \int_{\Omega_w}\left(\xi^n D_\mathrm{w}^n\nabla\phi_w^{n+1}+\delta_\mathrm{p}^n\nabla\left(\phi_w^{n+1} p_\mathrm{sat}^n\right)\right)\cdot\nabla v \\ + \int_{\Gamma_i}(h_{m,i}\left(w_r^{n+1}-w_w^{n+1}\right) v - \int_{\Gamma_e}\left(h_{m,e}w_w\right) v\\ = \int_{\Omega_w}\xi^n\frac{\phi_w^n}{\Delta t}v - \int_{\Gamma_e} (h_{m,e}w_e)v \end{align} \tag{M_{w,\text{disc}}}

Room equation $\ref{mr}$ :

The equation $\ref{mr}$ become, for a test function $u\in\RR$ :

$\int_{\Omega_r}\left(\frac{V_a}{\Delta t} + \eta V_a + h_m A_w\right)w_r^{n+1} u - \int_{\Omega_r}h_m A_w w_w^{n+1} u = \int_{\Omega_r}\left(\eta V_a w_e^{n+1} + \dot{m}_\mathrm{gen}\right)u \tag{M_{r,\text{disc}}}\label{eq:m_disc}$

The variational formulation for the moisture problem is :

Find $\phi^{n+1}=(\phi_w^{n+1},\phi_r^{n+1})\in X_h\times W_h$ such as forall test function $V = (v,u)$ :

$B(\phi^{n+1},V) = g(V)$

with :

• $B(\phi^{n+1},V) = \begin{bmatrix} \begin{pmatrix}\displaystyle\int_{\Omega_w}\xi^n\frac{\phi_w^{n+1}}{\Delta t}v + \int_{\Omega_w}\left(\xi^n D_\mathrm{w}^n\nabla\phi_w^{n+1} + \delta_\mathrm{p}^n\nabla\left(\phi_w^{n+1} p_\mathrm{sat}^n\right)\right)\cdot\nabla v \\ - \displaystyle\int_{\Gamma_i}\left(h_{m,i} w_w^{n+1}\right) v - \int_{\Gamma_e}\left(h_{m,e}w_w\right) v \end{pmatrix} & \displaystyle\int_{\Gamma_i}\left(h_{m,i} w_r^{n+1}\right) v \\ - \displaystyle\int_{\Omega_r}h_m A_w w_w^{n+1} u & \displaystyle\int_{\Omega_r}\left(\frac{V_a}{\Delta t}+\eta V_a + h_m A_w\right)w_r^{n+1} u \end{bmatrix}$

• $g(V) = \begin{bmatrix} \displaystyle\int_{\Omega_w}\xi^n\frac{\phi_w^n}{\Delta t}v - \int_{\Gamma_e} (h_{m,e}w_e)v \\ \displaystyle\int_{\Omega_r}\left(\eta V_a w_e^{n+1} + \dot{m}_\mathrm{gen}\right)u \end{bmatrix}$

## 4. Resolution wih Feel++

To solve such a problem with Feel++, we use product spaces. Mode details can be found in the internship report.