1 Introduction

Models to represent physical phenomena of heat and moisture transfer in porous media have been carried since the fifties, with the works of Philip and Vries (1957) and Luikov (1966). In the area of building physics, a detailed review of numerical models has been reported in Woloszyn and Rode (2008) and Mendes et al. (2016).

Since the robustness of a model relies on its accuracy to predict the physical phenomena, several studies report on the comparison of the results of the numerical model with experimental data. In James et al. (2010), gypsum boards with an initial moisture content is submitted to an adsorption phase during 24 h and then to a desorption phase during 24 h also. Several building materials have been considered for similar investigations: spruce plywood and cellulose insulation in Talukdar et al. (2007a, b), hemp concrete in Lelievre et al. (2014), calcium silicate in Belleghem et al. (2011), wood fiberboard in Perré et al. (2015). Interested readers may consult (Busser et al. 2017) for a complete review on such comparison within the context of building physics.

However, these studies highlight some discrepancies when confronting the numerical predictions with the experimental data. Particularly, results of numerical simulations underestimate the adsorption process and/or overestimate the desorption process. In other words, the experimental moisture front rushes faster than the simulation predicts. To reduce the discrepancies, some studies improved the physical model by incorporating the hysteresis of the moisture sorption material capacity as for instance in Kwiatkowski et al. (2009), Lelievre et al. (2014) and Colinart et al. (2016). In Rouchier et al. (2017) the authors estimate new material properties to reduce the discrepancies. Nevertheless, the estimated properties have no physical sense since the estimated vapor resistance was lower than one. In Olek et al. (2016) a non-Fickian moisture diffusion model was developed for wood-based materials. In these studies, it is important to note that the physical model considers only the diffusion process in the moisture transfer. Thus, these models neglect the moisture transfer by advection, which corresponds to the transport of moisture due to an air velocity occurring through the porous matrix. Within the context of transfer phenomena in soils, many models include advective phenomenon, e.g.Simunek et al. (2009), Sun et al. (2015) and Assouline and Mualem (2003).

In building materials, advection of moisture may also occur. Indeed, a difference of air pressure is observed between the inside and outside parts of a building facade and induces an air velocity through the porous materials. In the case of the above mentioned experimental studies, the air velocity is probably induced by a difference in the boundary vapor pressure. In Berger et al. (2017), the physical model was improved by considering moisture transfer by diffusion and advection. However, the coupling with heat transfer through porous material was neglected. This assumption certainly needs to be reconsidered, particularly in the context of building physics, where the temperature has daily and seasonally variations. Therefore, the first objective of this work is to improve the physical model proposed in Berger et al. (2017), by including the energy conservation equations, and analyze the effect of this improvement when comparing it to the experimental data from James et al. (2010).

When dealing with nonlinear advection–diffusion equations, it is of capital importance to obtain an accurate solution at low computational costs. An accurate and fast numerical method may be particularly advantageous when it is required to solve inverse problems or performing the sensitivity analysis, where numerous computations of the direct problem are needed. Indeed, when using the unconditionally stable implicit Euler or CrankNicolson schemes, several sub-iterations are necessary at each time step to treat the nonlinearities of the problem (Gasparin et al. 2017b). To address this issue, the second objective of this work is to explore the use of the innovative ScharfetterGummel numerical scheme for a system of coupled parabolic differential equations. This scheme was studied in Berger et al. (2017) and interesting results were shown with a very accurate solution obtained at a low computational cost. Since these results were obtained for a single nonlinear equation, it is necessary to extend them for the case of a system. The analysis will be performed by comparing the results to analytical solutions and to the one obtained using a commercial software (\({\texttt {Comsol}}^{\mathrm{TM}}\)).

Therefore, the paper, in Sect. 2, presents a mathematical model of coupled heat and moisture transfer in porous material, considering both diffusion and advection mechanisms. Then, in Sect. 3, the ScharfetterGummel numerical scheme is briefly recalled for the scalar case and validated introducing analytical solution considering nonlinear material properties. A comparison with the result of a commercial software, widely used in Building Physics community, will be realized. The properties of the numerical scheme to solve a system of coupled advection–diffusion equations are provided in Sect. 4, while Sect. 5 shows the results of the numerical model confronted with the experimental data to discuss the importance of advection in porous building materials. Section 6 addresses the final remarks.

2 Heat and Moisture Transfer in Porous Materials

The physical framework involves heat and moisture transfer in porous material. The moisture includes vapor water, denoted by index 1, and liquid water, denoted by index 2. The porous matrix of the material is indexed by 0. We assume that the temperature is much greater than the freezing point and therefore liquid solid phase change is not considered.

2.1 Moisture Transfer

The transfer of moisture in the porous matrix is driven by a convective flow \(\varvec{j}_{\mathrm {c}}~{{(\mathrm{kg}/(\mathrm{s}\,\mathrm{m}^{2}))}}\), including both diffusive \(\varvec{j}_{\mathrm {d}}\) and advective \(\varvec{j}_{\mathrm {a}}\) fluxes:

$$\begin{aligned} \varvec{j}_{\mathrm {c}}\,=\,\varvec{j}_{\mathrm {d}} \,+\,\varvec{j}_{\mathrm {a}}. \end{aligned}$$

The advection flux occurs due to the air motion through the pores. The differential equation describing liquid or vapor transport can be formulated as:

$$\begin{aligned} \frac{\partial w_{i}}{\partial t} \,=\,- \varvec{\nabla }\varvec{\cdot }\left( \varvec{j}_{\mathrm {d},i} \,+\,\varvec{j}_{\mathrm {a},i} \right) \,+\,I_{i},{\quad } i \,=\,\left\{ 1, 2 \right\} , \end{aligned}$$
(1)

where \(I_{i}\ {{(\mathrm{kg}/(\mathrm{s}\,\mathrm{m}^{3}))}}\) is the volumetric term of source (\(I_{i} \geqslant 0\)) or sink (\(I_{i} < 0\)) and \(w_{i}~{{(\mathrm{kg/m}^{3})}}\) is the volumetric concentration of substance i. On one hand, the quantity \(I_{2}\) defines the source term of liquid water occurring by condensation of vapor water into liquid. On the other hand, the quantity \(I_{1}\) defines the source term of vapor water appearing by evaporation of liquid water. Since it is assumed that water is not present in its solid phase, by definition we have:

$$\begin{aligned} I_{1} \,+\,I_{2} \,=\,0. \end{aligned}$$

Moreover, if we assume that the mass of vapor is negligible compared to the liquid one (\(w_{1} \ll w_{2})\), then the time variation of \(w_{1}\) can also be supposed to vanish:

$$\begin{aligned} \frac{\partial w_{1}}{\partial t} \approx 0. \end{aligned}$$

Thus, by applying \(i \,=\,1\) to Eq. (1), we obtain:

$$\begin{aligned} 0 \,=\,- \varvec{\nabla }\varvec{\cdot }\left( \varvec{j}_{\mathrm {d},1} \,+\,\varvec{j}_{\mathrm {a},1} \right) \,+\,I_{1}, \end{aligned}$$

which is equivalent to

$$\begin{aligned} I_{1} \,=\,\varvec{\nabla }\varvec{\cdot }\left( \varvec{j}_{\mathrm {d},1} \,+\,\varvec{j}_{\mathrm {a},1} \right) . \end{aligned}$$
(2)

The diffusive fluxes are given by:

$$\begin{aligned} \varvec{j}_{\mathrm {d},1}&\,=\,-\,k_{1} \varvec{\nabla }P_\mathrm{v}, \\ \varvec{j}_{\mathrm {d},2}&\,=\,-\,k_{2} \varvec{\nabla }P_\mathrm{c}, \end{aligned}$$

where \(k_{1}\) (s) and \(k_{2}\) (s) are the vapor and liquid permeability of the material, respectively. Both depend on the saturation degree of the material. It should be noted that the unity of the vapor permeability is in (s) since it is expressed considering the vapor pressure \(P_\mathrm{v}\) gradient (and not the vapor mass content \(w_{1}\)). In addition, the dispersion effects on the moisture transport, inducing a modification of the diffusion coefficient due to variation of the velocity in the pores (Marsily 1986), is neglected. This hypothesis will be confirmed in Sect. 5. The quantities \(P_\mathrm{v}\) and \(P_\mathrm{c}\) in (Pa) are the vapor and capillary pressure. In order to use the vapor pressure as the driving potential (Funk and Wakili 2008), we consider the physical relation, known as Kelvin’s equation, between \(P_\mathrm{v}\) and \(P_\mathrm{c}\):

$$\begin{aligned} P_\mathrm{c}&\,=\,\rho _{2} R_{v}T \ln \left( \frac{P_\mathrm{v}}{P_\mathrm{s}(T)}\right) , \\ \frac{\partial P_\mathrm{c}}{\partial P_\mathrm{v}}&\,=\,\rho _{2} \frac{R_{v}T}{P_\mathrm{v}}, \end{aligned}$$

where \(\rho _{2}~{{(\mathrm{kg}/\mathrm{m}^{3})}}\) is the liquid water density and \(R_{v}~{{(\mathrm{J}/(\mathrm{kg\,K}))}}\) is the water vapor constant. Thus, neglecting the variation of the capillary pressure with temperature, we have:

$$\begin{aligned} \frac{\partial P_\mathrm{c}}{\partial x} \,=\,\frac{\partial P_\mathrm{c}}{\partial P_\mathrm{v}} \cdot \frac{\partial P_\mathrm{v}}{\partial x} \,+\,\frac{\partial P_\mathrm{c}}{\partial T} \cdot \frac{\partial T}{\partial x} \simeq \rho _{2} \frac{R_{v}T}{P_\mathrm{v}} \cdot \frac{\partial P_\mathrm{v}}{\partial x}. \end{aligned}$$

The diffusive flux of liquid water can then be written as:

$$\begin{aligned} \varvec{j}_{\mathrm {d},2}&\,=\,-\,k_{2} \rho _{2} \frac{R_{v}T}{P_\mathrm{v}} \varvec{\nabla }P_\mathrm{v}. \end{aligned}$$

The total diffusive flux of moisture can be expressed as:

$$\begin{aligned} \varvec{j}_{\mathrm {d},m}&\,=\,\varvec{j}_{\mathrm {d},1} \,+\,\varvec{j}_{\mathrm {d},2} \,=\,-\,k_{m} \varvec{\nabla }P_\mathrm{v}, \end{aligned}$$

where \(k_{m} \mathop {{\mathop {:=}\limits ^{\,\mathrm {def}}}\,}k_{1} \,+\,k_{2} \rho _{2} \frac{R_{v}T}{P_\mathrm{v}}~{{(\mathrm{s})}}\). The advective fluxes of moisture in the capillary material are expressed as:

$$\begin{aligned}&\varvec{j}_{\mathrm {a},1} \,=\,w_{1k} \varvec{\mathsf {v}},&\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\ \varvec{j}_{\mathrm {a},2} \,=\,w_{2k} \varvec{\mathsf {v}}, \end{aligned}$$

where \(\mathsf {v}~{{(\mathrm{m/s})}}\) is the molar average velocity (Whitaker 1986a, b). It is assumed that the velocity is equal for both water and vapor phase. Parameters \(w_{1k}\) and \(w_{2k}\), in \({{(\mathrm{kg/m}^{3})}}\), are the volumetric concentration of moving vapor and liquid mass, respectively. It is assumed that the air motion has no influence on the liquid substance, \(\varvec{j}_{\mathrm {a},2} \equiv 0~{{(\mathrm{kg}/(\mathrm{s\,m}^{2}))}}\). Moreover, the quantity of vapor \(w_{1k}\) can be expressed as:

$$\begin{aligned} w_{1k} \,=\,\frac{w_{1}}{b_{1}}, \end{aligned}$$

where \(b_{1}~{{({-})}}\) is the ratio of the volume of vapor \(V_{1}~{{(\mathrm{m}^{3})}}\) to the total volume of capillaries V. Thus, we have:

$$\begin{aligned} b_{1} \mathop {{\mathop {:=}\limits ^{\,\mathrm {def}}}\,}\frac{V_{1}}{V}. \end{aligned}$$

It is also assumed that there is no variation of the capillaries volume, meaning that the shrinkage and expansion effects, due to variation of the moisture content, are neglected. Using the perfect gas law, we obtain:

$$\begin{aligned} \varvec{j}_{\mathrm {a},1} \,=\,\frac{P_\mathrm{v}}{R_{v} T} \varvec{\mathsf {v}}. \end{aligned}$$

Defining the advection coefficient \(\varvec{a}_{m} \mathop {{\mathop {:=}\limits ^{\,\mathrm {def}}}\,}\frac{\varvec{\mathsf {v}}}{R_{v} T}~{{(\mathrm{s/m})}}\), the moisture advective flow is given by:

$$\begin{aligned} \varvec{j}_{\mathrm {a},m}&\,=\,\varvec{j}_{\mathrm {a},1} \,+\,\varvec{j}_{\mathrm {a},2} \simeq \varvec{j}_{\mathrm {a},1} \,=\,\varvec{a}_{m} P_\mathrm{v}. \end{aligned}$$

We define the total moisture content as \(w_{m} \mathop {{\mathop {:=}\limits ^{\,\mathrm {def}}}\,}w_{1} \,+\,w_{2}~{{(\mathrm{kg/m}^{3})}}\). It can be related to the relative humidity using the material sorption curve \(w_{m} \,=\,f (\phi )\). It is assumed that the material sorption curve is almost invariant with the temperature (Rouchier et al. 2013). Therefore, we can write:

$$\begin{aligned} \frac{\partial w_{m}}{\partial t} \simeq \frac{\mathrm {f}^{\prime }(\phi )}{P_\mathrm{s}} \frac{\partial P_\mathrm{v}}{\partial t}, \end{aligned}$$

where \(P_\mathrm{s}{{(\mathrm{Pa})}}\) is the saturation pressure. We denote the moisture capacity \(c_{m} \mathop {{\mathop {:=}\limits ^{\,\mathrm {def}}}\,}\frac{\mathrm {f}^{\prime }(\phi )}{P_\mathrm{s}}~(\mathrm{kg}/(\mathrm{m}^{3}\,\mathrm{Pa}))\). By summing Eq. (1) for \(i \,=\,\left\{ 1,\,2 \right\} \), knowing that \(\sum _{i = 1}^2 I_{i} \,=\,0\), we obtain the differential equation of moisture transfer in porous material:

$$\begin{aligned} c_{m} \frac{\partial P_\mathrm{v}}{\partial t} \,=\,\varvec{\nabla }\varvec{\cdot }\left( k_{m} \varvec{\nabla }P_\mathrm{v}\,-\,\varvec{a}_{m} P_\mathrm{v}\right) . \end{aligned}$$

2.2 Heat Transfer

The heat transfer equation is obtained from the first law of thermodynamics. The volumetric concentration of the total enthalpy \(h_{}~{{(\mathrm{J/kg})}}\) equals the divergence of the enthalpy flux, heat conduction and heat advection, expressed as:

$$\begin{aligned} \frac{\partial }{\partial t} \left( h_{0} \rho _{0} \,+\,\sum _{i=1}^2 h_{i} w_{i} \right) \,=\,- \varvec{\nabla }\varvec{\cdot }\left( \varvec{j}_{\mathrm {q}}\,+\,\sum _{i=1}^2 h_{i} \left( \varvec{j}_{\mathrm {a},i} \,+\,\varvec{j}_{\mathrm {d},i} \right) \right) , \end{aligned}$$
(3)

where \(\rho _{0}~{{(\mathrm{kg/m}^{3})}}\) is the material dry-basis specific mass. The heat flux \(\varvec{j}_{\mathrm {q}}{{(\mathrm{W/m}^{2})}}\) is driven by the conduction and advection phenomena:

$$\begin{aligned} \varvec{j}_{\mathrm {q}}\,=\,- k_{q} \varvec{\nabla }T \,+\,\varvec{a}_{q} T , \end{aligned}$$

where \(k_{q}~{{(\mathrm{W}/(\mathrm{m\,K}))}}\) is the thermal conductivity of the material depending on the moisture content and \(\varvec{a}_{q} \mathop {{\mathop {:=}\limits ^{\,\mathrm {def}}}\,}\rho _{a} c_{a} \varvec{\mathsf {v}}~{{(\mathrm{J}/(\mathrm{K\,m}^{2}\,\mathrm{s}))}}\) is the heat advection coefficient. Parameters \(\rho _{a}~{{(\mathrm{kg/m}^{3})}}\) and \(c_{a}~{{(\mathrm{J}/(\mathrm{m}^{3}\,\mathrm{K}))}}\) are the density and specific heat capacity of the dry air, correspondingly. It should be noted that the heat capacity of the vapor phase is included in the term \(h_{1} \varvec{j}_{\mathrm {a},1}\). Assuming a constant total volume, Eq. (3) becomes:

$$\begin{aligned} \left( c_{0} \rho _{0} \,+\,\sum _{i=1}^2 c_{i} w_{i} \right) \frac{\partial T}{\partial t} \,+\,\sum _{i=1}^2 h_{i} \frac{\partial w_{i}}{\partial t}&\,=\,- \varvec{\nabla }\varvec{\cdot }\varvec{j}_{\mathrm {q}}\,-\,\sum _{i=1}^2 h_{i} \varvec{\nabla }\varvec{\cdot }\left( \varvec{j}_{\mathrm {a},i} \,+\,\varvec{j}_{\mathrm {d},i} \right) \nonumber \\&\quad \,-\,\sum _{i=1}^2 {\left( \varvec{\nabla }h_{i} \right) } \varvec{\cdot }\left( \varvec{j}_{\mathrm {a},i} \,+\,\varvec{j}_{\mathrm {d},i} \right) . \end{aligned}$$
(4)

Then, by summing Eq. (1) (\(i \leftarrow \ 1\)), multiplied by \(h_{1}\) and Eq. (1) (\(i \leftarrow 2\)), multiplied by \(h_{2}\), we get:

$$\begin{aligned} \sum _{i=1}^2 h_{i} \frac{\partial w_{i}}{\partial t} \,=\,- \sum _{i=1}^2 h_{i} \varvec{\nabla }\varvec{\cdot }\left( \varvec{j}_{\mathrm {a},i} \,+\,\varvec{j}_{\mathrm {d},i} \right) \,+\,\sum _{i=1}^2 h_{i} I_{i}. \end{aligned}$$

We denote by \(r_{12} \mathop {{\mathop {:=}\limits ^{\,\mathrm {def}}}\,}h_{1} \,-\,h_{2}\ {{(\mathrm{J/kg})}}\) the latent heat of evaporation. We also denote by \(c_{q} \mathop {{\mathop {:=}\limits ^{\,\mathrm {def}}}\,}\rho _{0} c_{0} \,+\,\sum _{i=1}^2 c_{i} w_{i}\ {{(\mathrm{J}/(\mathrm{m}^{3}\,\mathrm{K}))}}\) the total volumetric heat capacity, including the contributions of the material, the liquid water and the vapor phase. Consequently, using Eqs. (2), (4) becomes:

$$\begin{aligned} c_{q} \frac{\partial T}{\partial t}&\,=\,- \varvec{\nabla }\varvec{\cdot }\varvec{j}_{\mathrm {q}}\,-\,r_{12} \varvec{\nabla }\varvec{\cdot }\left( \varvec{j}_{\mathrm {a},1} \,+\,\varvec{j}_{\mathrm {d},1} \right) \,-\,\sum _{i=1}^2 \varvec{\nabla }\left( c_{i} T \right) \varvec{\cdot }\left( \varvec{j}_{\mathrm {a},i} \,+\,\varvec{j}_{\mathrm {d},i} \right) . \end{aligned}$$

The last term is assumed negligible (Luikov 1966). This assumption is verified in Sect. 5. Considering the expression of the fluxes, we obtain the following differential equation of heat transfer in porous material:

$$\begin{aligned} c_{q} \frac{\partial T}{\partial t}&\,=\,\varvec{\nabla }\varvec{\cdot }\left( k_{q} \varvec{\nabla }T \,-\,\varvec{a}_{q} T \right) \,+\,r_{12} \varvec{\nabla }\varvec{\cdot }\left( k_{1} \varvec{\nabla }P_\mathrm{v}\,-\,\varvec{a}_{m} P_\mathrm{v}\right) . \end{aligned}$$

For the sake of clarity, we introduce the coefficients \(\varvec{a}_{qm} \mathop {{\mathop {:=}\limits ^{\,\mathrm {def}}}\,}r_{12} \varvec{a}_{m}\ {{(\mathrm{W}\,\mathrm{s}^{2}/(\mathrm{kg\,m}))}}\) and \(k_{qm} \mathop {{\mathop {:=}\limits ^{\,\mathrm {def}}}\,}r_{12} k_{1}\ {{(\mathrm{W}/(\mathrm{m\,K}))}}\). Then, the energy governing differential equation becomes:

$$\begin{aligned} c_{q} \frac{\partial T}{\partial t}&\,=\,\varvec{\nabla }\varvec{\cdot }\left( k_{q} \varvec{\nabla }T \,-\,\varvec{a}_{q} T \right) \,+\,\varvec{\nabla }\varvec{\cdot }\left( k_{qm} \varvec{\nabla }P_\mathrm{v}\,-\,\varvec{a}_{qm} P_\mathrm{v}\right) . \end{aligned}$$

2.3 Initial and Boundary Conditions

At the interface of the material with the ambient air, the vapor flux at the interface is proportional to the vapor pressure difference between the surface and the ambient vapor pressure \(P_\mathrm{v}^{\infty } \):

$$\begin{aligned} \varvec{j}_{\mathrm {d},1} \,+\,\varvec{j}_{\mathrm {a},1} \,=\,\alpha _{m} \left( P_\mathrm{v}\,-\,P_\mathrm{v}^{\infty } \right) \cdot \varvec{n}, \end{aligned}$$
(5)

where \(\alpha _{m}\ {{(\mathrm{s/m})}}\) is the surface moisture transfer coefficient.

For the liquid phase, within building physics applications, the flux at the interface is imposed by the ambient air conditions:

$$\begin{aligned} \varvec{j}_{\mathrm {d},2} \,=\,\varvec{g}_{\infty }. \end{aligned}$$
(6)

If the bounding surface is in contact with the outside building air, then \(g_{\infty }\ {{(\mathrm{kg}/(\mathrm{s\,m}^{2}))}}\) corresponds to the liquid flux from wind driven rain (Mendes et al. 2016). If the bounding surface is in contact with the inside building air, then \(g_{\infty } \,=\,0\).

By summing Eqs. (5) and (6), we obtain the boundary condition for the moisture transfer equation:

$$\begin{aligned} \varvec{j}_{\mathrm {a},m} \,+\,\varvec{j}_{\mathrm {d},m}&\,=\,\alpha _{m} \left( P_\mathrm{v}\,-\,P_\mathrm{v}^{\infty } \right) \cdot \varvec{n} \,+\,\varvec{g}_{\infty }. \end{aligned}$$

For the heat transfer, the heat flux \(\varvec{j}_{\mathrm {q}}\ {{(\mathrm{W/m}^{2})}}\) occurring by diffusion and advection is proportional to the temperature difference between the surface and the ambient air \(T^{\infty }\):

$$\begin{aligned} \varvec{j}_{\mathrm {q}}\,=\,\alpha _{q} \left( T \,-\,T^{\infty } \right) \cdot \varvec{n}, \end{aligned}$$

where \(\alpha _{q}\) is the surface heat transfer coefficient. Using this, the total heat flux, including the transfer by diffusion, advection and latent phase change, can be written as:

$$\begin{aligned} \varvec{j}_{\mathrm {q}}\,+\,r_{12} \left( \varvec{j}_{\mathrm {d},1} \,+\,\varvec{j}_{\mathrm {a},1} \right)&\,=\,\alpha _{q} \left( T \,-\,T^{\infty } \right) \cdot \varvec{n} \\&\quad \,+\,r_{12} \alpha _{m} \left( P_\mathrm{v}\,-\,P_\mathrm{v}^{\infty } \right) \cdot \varvec{n} \,+\,r_{12} \varvec{g}_{\infty }, \end{aligned}$$

As the initial condition, the temperature and vapor pressure distributions within the material are considered to be uniform:

$$\begin{aligned} P_\mathrm{v}\,=\,P_\mathrm{v}^{i},\,\,\,\,\,\,\,\,\,\,\,\,\,\,&T \,=\,T^{i}. \end{aligned}$$

2.4 Dimensionless Representation

While performing a mathematical and numerical analysis of a given practical problem, it is of capital importance to obtain a unitless formulation of governing equations, due to a number of good reasons. First of all, it enables to determine important scaling parameters (Biot’s numbers for instance). Henceforth, solving one dimensionless problem is equivalent to solve a whole class of dimensional problems sharing the same scaling parameters. Then, dimensionless equations allow to estimate the relative magnitude of various terms, and thus, eventually to simplify the problem using asymptotic methods (Nayfeh 2000). Finally, the floating point arithmetics is designed such as the rounding errors are minimal if computer manipulates the numbers of the same magnitude (Kahan and Palmer 1979). Moreover, the floating point numbers have the highest density in the interval \((0,\,1)\) and their density decreases when we move further away from this interval. So, it is always better to manipulate numerically the quantities of the order of \(\mathcal {O}(1)\) to avoid severe round-off errors and to likely improve the conditioning of the problem in hands.

In this way, we define following dimensionless quantities for the temperature and vapor pressure fields:

$$\begin{aligned} u \,=\,\frac{P_\mathrm{v}}{P_\mathrm{v}^{\circ }}, \quad u^{\infty }\,=\,\frac{P_\mathrm{v}^{\infty }}{P_\mathrm{v}^{\circ }}, \quad v \,=\,\frac{T}{T^{\circ }}, \quad v^{\infty }\,=\,\frac{T^{\infty }}{T^{\circ }}, \end{aligned}$$

where \(P_\mathrm{v}^{\circ }\) and \(T^{\circ }\) are the reference values of the fields. The time and space domains are also scaled with characteristic values:

$$\begin{aligned} x^{\star } \,=\,\frac{x}{L}, \quad t^{\star } \,=\,\frac{t}{t^{\circ }}, \end{aligned}$$

where L is the length of the material sample. All the material thermo-physical properties are scaled considering a reference value, denoted by the super script \(^{\circ }\) for each parameter:

$$\begin{aligned}&c_{q}^{\star } \,=\,\frac{c_{q}}{c_{q}^{\circ }}, \quad a_{q}^{\star } \,=\,\frac{a_{q}}{a_{q}^{\circ }}, \quad k_{q}^{\star } \,=\,\frac{k_{q}}{k_{q}^{\circ }}, \quad c_{m}^{\star } \,=\,\frac{c_{m}}{c_{m}^{\circ }},\\&a_{m}^{\star } \,=\,\frac{a_{m}}{a_{m}^{\circ }}, \quad k_{m}^{\star } \,=\,\frac{k_{m}}{k_{m}^{\circ }}, \quad a_{qm}^{\star } \,=\,\frac{a_{qm}}{a_{qm}^{\circ }}, \quad k_{qm}^{\star } \,=\,\frac{k_{qm}}{k_{qm}^{\circ }}. \end{aligned}$$

Then, dimensionless numbers are introduced. The Fourier number characterizes the importance of the heat and mass transfer through the material:

$$\begin{aligned} \mathrm {Fo}_{q} \,=\,\frac{k_{q}^{\circ } t^{\circ }}{c_{q}^{\circ } L^{2}}, \quad \mathrm {Fo}_{m} \,=\,\frac{k_{m}^{\circ } t^{\circ }}{c_{m}^{\circ } L^{2}}. \end{aligned}$$

The Péclet number translates the importance of the advection relative to the diffusion in the total transfer:

$$\begin{aligned} \mathrm {Pe}_{q} \,=\,\frac{a_{q}^{\circ } L}{k_{q}^{\circ }}, \quad \mathrm {Pe}_{m} \,=\,\frac{a_{m}^{\circ } L}{k_{m}^{\circ }}, \quad \mathrm {Pe}_{qm} \,=\,\frac{a_{qm}^{\circ } L}{k_{qm}^{\circ }}. \end{aligned}$$

The parameter \(\gamma \) quantifies the coupling effects between moisture and heat transfer:

$$\begin{aligned} \gamma \,=\,\frac{k_{qm}^{\circ } P_\mathrm{v}^{\circ }}{k_{q}^{\circ } T^{\circ }}. \end{aligned}$$

The Biot number appears for the boundary conditions, quantifying the transfer from the ambient air to the porous material:

$$\begin{aligned} \mathrm {Bi}_{m} \,=\,\frac{\alpha _{m} \cdot L}{k_{m}}, \quad \mathrm {Bi}_{q} \,=\,\frac{\alpha _{q} \cdot L}{k_{q}}, \quad \mathrm {Bi}_{qm} \,=\,\frac{\alpha _{qm} \cdot L}{k_{qm}}. \end{aligned}$$

In one space dimension, the unitless system of partial differential equations of heat and mass transfer is therefore formulated as:

$$\begin{aligned} c_{m}^{\star } \frac{\partial u}{\partial t^{\star }}&\,=\,\mathrm {Fo}_{m} \frac{\partial }{\partial x^{\star }} \left( k_{m}^{\star } \frac{\partial u}{\partial x^{\star }} \,-\,\mathrm {Pe}_{m} a_{m}^{\star } u \right) , \\ c_{q}^{\star } \frac{\partial v}{\partial t^{\star }}&\,=\,\mathrm {Fo}_{q} \frac{\partial }{\partial x^{\star }} \left( k_{q}^{\star } \frac{\partial v}{\partial x^{\star }} \,-\,\mathrm {Pe}_{q} a_{q}^{\star } v \right) \\&\quad \,+\,\mathrm {Fo}_{q} \gamma \frac{\partial }{\partial x^{\star }} \left( k_{qm}^{\star } \frac{\partial u}{\partial x^{\star }} \,-\,\mathrm {Pe}_{qm} a_{qm}^{\star } u \right) , \end{aligned}$$

together with the boundary conditions:

$$\begin{aligned} k_{m}^{\star } \frac{\partial u}{\partial x^{\star }} \,-\,\mathrm {Pe}_{m} a_{m}^{\star } u&\,=\,\mathrm {Bi}_{m} \left( u \,-\,u^{\infty }\right) ,\\ k_{q}^{\star } \frac{\partial v}{\partial x^{\star }} \,-\,\mathrm {Pe}_{q} a_{q}^{\star } v \,+\,\gamma \left( k_{qm}^{\star } \frac{\partial u}{\partial x^{\star }} \,-\,\mathrm {Pe}_{qm} a_{qm}^{\star } u \right)&\,=\,\mathrm {Bi}_{q} \left( v \,-\,v^{\infty }\right) \,+\,\gamma \mathrm {Bi}_{qm} \left( u \,-\,u^{\infty }\right) . \end{aligned}$$

It can be noted that the dimensionless coefficients \(a^{\star }\), \(d^{\star }\) translate the nonlinearity (or the distortion) of the diffusion and advection transfer, relatively to the reference state. Using data from Abadie and Mendonça (2009), the moisture Fourier and Biot numbers for the spruce and the brick are reported in Table 1. The True Moisture Penetration Depth (TMPD) from Abadie and Mendonça (2009) and the Moisture Buffer value (MBV) from Rode et al. (2007) are also given. The brick has a higher Fourier number than spruce. Therefore, the moisture diffusion through this material is predominant, explaining why the TMPD observed in Abadie and Mendonça (2009) is more important. In addition, the Biot number is higher for the spruce. It implies that under an increase of absolute humidity, moisture will penetrate easier in the spruce than in the brick. Combined with a lower Fourier number, it explains why the MBV value is higher for the spruce (Rode et al. 2007). This analysis highlights that the dimensionless numbers, appearing in the formulation of the equations of heat and moisture transfer, enable to understand the material behavior.

Table 1 Fourier and Biot numbers

3 Numerical Methods

The material properties varies along the space coordinates (and sometimes with the time) and with moisture contents and temperature. Moreover, the boundary conditions are defined according to climate data driven boundary conditions. Therefore, the use of analytical solution is limited and numerical approaches are necessary to compute the approximate solution of the problem. It introduces a discretization of the time and space with a local difference approximation of the derivatives when using the Taylor expansion approach. The important aspects of a numerical scheme are (i) it global error and (ii) the appropriate (qualitative and quantitative) behavior of the solution to represent the physical phenomenon. The former is quantified by the accuracy of the method, related to the order of truncation when approximating the derivatives. The latter is associated with the absolute stability of the scheme. A stable scheme avoids to compute an unbounded solution. Moreover, a numerical scheme converges if and only if it is stable (LaxRichtmyer theorem). It should be remarked that even with a stable scheme, attention should be paid to the choice of the time and space discretization parameters. A stable scheme does not necessarily imply that a physically realistic solution will be computed. Some examples of such cases can be found in Gasparin et al. (2017b) and Patankar (1980). Moreover, a critical aspect of a numerical scheme is the CPU time to compute the solution of the given problem. Interested readers are invited to consult Mendes et al. (2016), Hairer et al. (1993) for more details.

For the description of the numerical schemes, let us consider for simplicity a uniform discretization of the interval. The discretization parameters are denoted with \(\Delta x\) for the space and with \(\Delta t\) for the time. The spatial cell \(\mathcal {C} \,=\,\left[ x_{j-{\textstyle {1\over 2}}}, x_{j+{\textstyle {1\over 2}}} \right] \) is represented in Fig. 2. The values of function \(u(x,\,t)\) in discrete nodes will be denoted by \(u_{j}^{n}\ \mathop {{\mathop {:=}\limits ^{\,\mathrm {def}}}\,}\ u\,(x_{j},\,t^{n})\) with \(j\ \in \ \left\{ 1,\,\ldots ,\,N\right\} \) and \(n\ =\ 0,\,1,\,2,\,\ldots , N_{t}\).

For the sake of simplicity and without losing the generality, the upper-script \(\star \) standing for dimensionless parameters, is dropped out. In addition, the numerical schemes are explained for the one-dimensional linear convection equation written in a conservative form as:

$$\begin{aligned}&\frac{\partial u}{\partial t} \,+\,\frac{\partial J}{\partial x} \,=\,0, \quad t > 0, \quad x \in \left[ 0, 1 \right] , \nonumber \\&J \,=\,au \,-\,d \frac{\partial u}{\partial x}, \end{aligned}$$
(7)

where \(u(x,\,t)\), is the field of interest, d the diffusion coefficient and a the advection coefficient, both considered to be constant. The boundary conditions are also written using a simplified notation:

$$\begin{aligned} d \frac{\partial u}{\partial x} \,-\,a u&\,=\,\mathrm {Bi} \cdot \left( u \,-\,u^{\infty }\right) , \quad x \,=\,0, \end{aligned}$$
(8a)
$$\begin{aligned} - d \frac{\partial u}{\partial x} \,+\,a u&\,=\,\mathrm {Bi} \cdot \left( u \,-\,u^{\infty }\right) , \quad x \,=\,1, \end{aligned}$$
(8b)

where \(u^{\infty }\) is the field in the ambient air surrounding the material. It should be noted that since we consider 1-dimensional transfer, \(\pm \frac{\partial u}{\partial x}\) plays the role of normal derivatives.

3.1 The ScharfetterGummel Scheme

The straightforward discretization of Eq. (7) yields the following semi-discrete difference relation:

$$\begin{aligned} \frac{\mathrm {d} u_{j}}{\mathrm {d} t} \,+\,\frac{1}{\Delta x} \left[ J_{j+\frac{1}{2}}^{n}\ -\ J_{j-\frac{1}{2}}^{n} \right] \,=\,0. \end{aligned}$$

Scharfetter and Gummel assumes that the numerical flux is constant on the dual cell \(\mathcal {C}^{\star } \,=\,\left[ x_{j}, x_{j+1} \right] \). Thus, it can be computed giving the following boundary value problem (Scharfetter and Gummel 1969; Gosse 2013; Gosse and Natalini 2017):

$$\begin{aligned} J_{j+{\textstyle {1\over 2}}}^{n}&\,=\,a u \,-\,d \frac{\partial u}{\partial x},&\forall x \in \left[ x_{j}, x_{j+1} \right] , \qquad \forall j \in \left\{ 2,\ldots ,\,N\,-\,1 \,\right\} , \end{aligned}$$
(9a)
$$\begin{aligned} u&\,=\,u_{j}^{n},&x \,=\,x_{j} , \end{aligned}$$
(9b)
$$\begin{aligned} u&\,=\,u_{j+1}^{n},&x \,=\,x_{j+1}. \end{aligned}$$
(9c)

Equation (9) is a first-order differential equation with two boundary conditions and the two unknowns u and \(J_{j+{\textstyle {1\over 2}}}^{n}\). The solution of Eq. (9) corresponds to the expression of the PoincaréSteklov operator, \(\mathcal {S}: (u_{j}^{n},u_{j+1}^{n}) \mapsto J_{j+{\textstyle {1\over 2}}}^n\) and can be written as:

$$\begin{aligned} J_{j+{\textstyle {1\over 2}}}^n \,=\,a \; \frac{\left( u_{j}^{n} \,-\,u_{j+1}^{n} \mathrm {e}^{\dfrac{a \Delta x}{d}} \right) }{1 \,-\,\mathrm {e}^{\dfrac{a \Delta x}{d}}}. \end{aligned}$$
(10)

The last equation can be rewritten also as:

$$\begin{aligned}&J_{j+{\textstyle {1\over 2}}}^n \,=\,\frac{d}{\Delta x} \left[ -\ \mathcal {B} \left( \Theta \right) u_{j+1}^{n} \,+\,\mathcal {B} \left( - \Theta \right) u_{j}^{n} \right] , \end{aligned}$$

where the Bernoulli function \(\mathcal {B} (\cdot )\) and the ratio \(\Theta \) are defined as:

$$\begin{aligned} \mathcal {B}(\Theta ) \mathop {{\mathop {:=}\limits ^{\,\mathrm {def}}}\,}\frac{\Theta }{\mathrm {e}^{\Theta } \,-\,1},&\Theta \mathop {{\mathop {:=}\limits ^{\,\mathrm {def}}}\,}\ \frac{a \Delta x}{d}. \end{aligned}$$

The behavior of the Bernoulli function is illustrated in Fig. 1. It can be noted that we have the following limiting behavior:

$$\begin{aligned}&\lim _{\Theta \rightarrow 0} \mathcal {B}(\Theta ) \,=\,1 , \quad \lim _{\Theta \rightarrow \infty } \mathcal {B}(\Theta ) \,=\,0, \end{aligned}$$
(11a)
$$\begin{aligned}&\lim _{\Theta \rightarrow 0} \mathcal {B}(-\Theta ) \,=\,1, \quad \lim _{\Theta \rightarrow \ \infty } \mathcal {B}(-\Theta ) \,=\,+ \infty . \end{aligned}$$
(11b)
Fig. 1
figure 1

Plot of the Bernoulli function

For the nodes at the boundary surface, \(j \in \left\{ 1,\,N\right\} \), the flux \(J_{{\textstyle {1\over 2}}}\) is the solution of

$$\begin{aligned}&J_{{\textstyle {1\over 2}}}^{n} \,=\,a u \,-\,d \frac{\partial u}{\partial x}, \quad \forall x \in \left[ 0, x_{1}^{n} \right] , \\&d \frac{\partial u}{\partial x} \,-\,a u \,=\,\mathrm {Bi} \cdot \left( u \,-\,u^{\infty }\right) , \quad x \,=\,0,\\&u \,=\,u_{1}^{n}, \quad x \,=\,x_{1}^{n}. \end{aligned}$$

and \(J_{N + {\textstyle {1\over 2}}} \):

$$\begin{aligned}&J_{N + {\textstyle {1\over 2}}}^{n} \,=\,a u \,-\,d \frac{\partial u}{\partial x}, \quad \forall x \in \left[ x_{N}^{n}, 1 \right] , \\&u \,=\,u_{N}^{n}, \quad x \,=\,x_{N}^{n}, \\&- d \frac{\partial u}{\partial x} \,+\,a u \,=\,\mathrm {Bi} \cdot \left( u \,-\,u^{\infty }\right) , \quad x \,=\,1. \end{aligned}$$

Solving these two systems, we get:

$$\begin{aligned} J_{{\textstyle {1\over 2}}}^{n} \,=\,\frac{a \mathrm {Bi} \left( u^{\infty }\mathrm {e}^{\Theta } \,-\,u_{1}^{n} \right) }{\left( \mathrm {Bi} \left( \mathrm {e}^{\Theta } \,-\,1\,\right) \,+\,a \mathrm {e}^{\Theta } \right) }, \quad J_{N + {\textstyle {1\over 2}}}^{n} \,=\,\frac{a \mathrm {Bi} \left( u^{\infty }\,-\,u_{N}^{n} \mathrm {e}^{\Theta } \right) }{\left( \mathrm {Bi} \left( 1 \,-\,\mathrm {e}^{\Theta } \,\right) \,-\,a \right) }. \end{aligned}$$

We define \(\lambda \mathop {{\mathop {:=}\limits ^{\,\mathrm {def}}}\,}\dfrac{d \Delta t}{\Delta x^{2}}\). When using the Euler explicit approach to approximate the time derivative from Eq. (7), the ScharfetterGummel scheme finally yields to:

$$\begin{aligned} u_{1}^{n+1}&\,=\,u_{1}^{n} \,+\,\frac{\Delta t}{\Delta x} J_{{\textstyle {1\over 2}}}^{n} \,-\,\lambda \left[ -\ \mathcal {B} \left( \Theta \right) u_{2}^{n} \,+\,\mathcal {B} \left( - \Theta \right) u_{1}^{n} \right] \\ u_{j}^{n+1}&\,=\,u_{j}^{n} \,+\,\lambda \left[ \mathcal {B} \left( \Theta \right) u_{j+1}^{n} \,-\,\left( \mathcal {B} \left( - \Theta \right) \,+\,\mathcal {B} \left( \Theta \right) \right) u_{j}^{n} \,+\,\mathcal {B} \left( - \Theta \right) u_{j-1}^{n} \right] , \\&\quad \forall j \in \left\{ 2,\ldots ,\,N \,-\,1 \,\right\} , \\ u_{N}^{n+1}&\,=\,u_{N}^{n} \,+\,\lambda \left[ -\ \mathcal {B} \left( \Theta \right) u_{N}^{n} \,+\,\mathcal {B} \left( - \Theta \right) u_{N-1}^{n} \right] \,-\,\frac{\Delta t}{\Delta x} J_{N + {\textstyle {1\over 2}}}^{n}. \end{aligned}$$

The stencil of the scheme is illustrated in Fig. 2. The scheme is first-order accurate in time and space \(\mathcal {O}(\Delta x\,+\,\Delta t)\). It should be noted that the flux is approximated to the order \(\mathcal {O}(\Delta x)\) as well (Gartland 1993). This is a remarkable property of the scheme since a derivation usually provokes the loss of one order in accuracy.

Fig. 2
figure 2

Stencil of the ScharfetterGummel numerical scheme

3.2 Specific Features of the Scheme

The important feature of the ScharfetterGummel numerical scheme is well balanced as well as asymptotically preservedFootnote 1. Using the definition of parameter \(\Theta \mathop {{\mathop {:=}\limits ^{\,\mathrm {def}}}\,}\frac{a \Delta x}{d}\), when the advection coefficient is much greater than the diffusion one, \(a \gg d\), we have \(\Theta \rightarrow \ \infty \). Inversely, when the advection coefficient is smaller than the diffusion one, \(a \ll d\), we obtain \(\Theta \rightarrow 0\). Thus, considering the results from Eq. (11), the limiting behavior of the numerical fluxes is correct independently from grid parameters:

$$\begin{aligned} \lim _{a \rightarrow 0} J_{j+{\textstyle {1\over 2}}}^{n} \,=\,- \frac{u_{j+1}^{n} \,-\,u_{j}^{n}}{\Delta x}, \quad \lim _{d \ \rightarrow 0} J_{j+{\textstyle {1\over 2}}}^{n} \,=\,{\left\{ \begin{array}{ll} u_{j}^{n}, &{} \quad a \leqslant 0, \\ u_{j+1}^{n}, &{} \quad a > 0. \end{array}\right. } \end{aligned}$$

Furthermore, the computation of \(J_{j+{\textstyle {1\over 2}}}^{n}\) is exact and it gives an excellent approximation of the physical phenomena. The only hypothesis was done when assuming \(J_{j+{\textstyle {1\over 2}}}^{n}\) constant in the dual cell \(\left[ x_{j}, x_{j+1}\right] \). In addition, when the steady state is reached, the solution computed with the scheme becomes exact (Jerome 1991). Interested readers may consult Patankar (1980), Gosse (2013) and Gosse and Natalini (2017) as recent works on the ScharfetterGummel scheme. The approximation of the dispersion relation by the scheme is discussed in “Appendix A”. In particular, it reveals that the phase velocity is second-order accurate.

The numerical scheme has other advantages that may be more interesting when applying to physical case studies. First, an explicit form of the solution is obtained. Therefore, no sub-iterations are required to treat the nonlinearities of the problem as it is the case when using CrankNicolson approach for instance. This feature may reduce significantly the CPU time of the algorithm (Berger et al. 2017; Gasparin et al. 2017b, a). When using a fully implicit approach, as for instance in Simunek et al. (2009), a special iterative approach (e.g. the Picard one) is required to treat the nonlinearities at each time iteration. Other comments on the advantages of the ScharfetterGummel scheme compared to the CrankNicolson approach are discussed in Duffy (2004).

It is true that when using explicit approaches, the so-called CourantFriedrichsLewy (CFL) stability condition must be respected. For a classical Euler explicit approach, it is a strong restriction since it implies a fine spatial grid. However, in the linear case, the CFL condition of the ScharfetterGummel scheme is given by (Gosse 2016):

$$\begin{aligned} \Delta ta \tanh \left( \dfrac{a \Delta x}{2 d} \right) ^{-1} \leqslant \ \Delta x. \end{aligned}$$

It can be noted that, if the spatial grid is refined, the Taylor expansion of the hyperbolic tangent gives:

$$\begin{aligned} \dfrac{a \Delta x}{2 d} \rightarrow 0, \quad \tanh \left( \dfrac{a \Delta x}{2 d} \right) ^{-1} \,=\,\frac{2 d}{a \Delta x} \,+\,\frac{a \Delta x}{6 d} \,+\,\mathcal {O}(\Delta x^{3}). \end{aligned}$$

Thus, the CFL condition starts to become quadratic \(\Delta t\leqslant \ C_{1} \cdot \Delta x^2\). It brings us to the standard CFL condition of the explicit Euler approach. Nevertheless, if the spatial grid is large, \(\tanh \left( \dfrac{a \Delta x}{2 d} \right) \,=\,\mathcal {O}(1)\) and the CFL condition is improved to \(\Delta t\leqslant C_{2} \cdot \Delta x\). The values of \(\Delta x\) have to be in a closed interval, depending on the material properties. It is not necessary to use a fine spatial grid for this approach.

Moreover, a useful point is that, considering Eq. (9), the exact interpolation of solution u(x) can be computed:

$$\begin{aligned} u^{n}(x) \,=\,\frac{1}{a} J_{j+\frac{1}{2}}^n \,+\,\frac{\left( u_{j}^{n} \,-\,u_{j+1}^{n} \right) }{1 \,-\,\mathrm {e}^{\Theta }}\; \mathrm {exp} \left( \frac{a}{d} \left( x \,-\,x_{j} \right) \right) , \quad x \in \left[ x_{j}, x_{j+1} \right] . \end{aligned}$$
(12)

Therefore, when using a large spatial grid, one can compute the exact expression of u(x) on the point of interest using Eq. (10). When using the classical methods, an interpolation (e.g. linear or cubic) is required. If the solution is steady, Eq. (12) provides the exact solution of the problem.

In terms of implementation, it has been highlighted in Berger et al. (2017) that the ScharfetterGummel approach is particularly efficient, in terms of reduction of the CPU cost, when using an adaptive time stepping. In Sect. 3.1, the scheme was presented using an Euler explicit approach for the sake of simplicity. In further sections, the algorithm is implemented using the Matlab™ function ode113, based on the AdamsBashforthMoulton approach (Shampine and Reichelt 1997). It is possible to use a RungeKutta scheme (function ode45 for instance). However, this approach requires intermediate computations between two time iterations. The AdamsBashforthMoulton scheme computes directly \(u^{n+1}\) as function of the computations at the previous time steps. It is less expensive in terms of computational cost, and it was therefore used in the next case studies. The advantages of the ScharfetterGummel numerical scheme are synthesized in Table 2.

Table 2 Synthesis of the ScharfetterGummel numerical scheme advantages

3.3 Extension to Nonlinear Cases

When the coefficients a and d of Eq. (7) are nonlinear, i.e.dependent on u, we apply the approximation of frozen coefficients on the interval. Hence, the coefficients a and d are constant on the dual cell \(\left[ x_{j}, x_{j+1} \right] \). The flux at the interface is computed using the boundary value problem given in Eq. (9), and the solution yields to:

$$\begin{aligned}&J_{j+{\textstyle {1\over 2}}}^{n} \,=\,\frac{d_{j+{\textstyle {1\over 2}}}^{n}}{\Delta x} \left[ -\ \mathcal {B} \left( \Theta _{j+{\textstyle {1\over 2}}}^{n} \right) u_{j+1}^{n} \,+\,\mathcal {B} \left( - \Theta _{j+{\textstyle {1\over 2}}}^{n} \right) u_{j}^{n} \right] , \end{aligned}$$
(13)

where the coefficients are computed according to:

$$\begin{aligned}&\Theta _{j+{\textstyle {1\over 2}}}^{n} \,=\,\frac{a_{j+{\textstyle {1\over 2}}}^{n}}{d_{j+{\textstyle {1\over 2}}}^{n}} \Delta x,&a_{j+{\textstyle {1\over 2}}}^{n} \,=\,a \left( u_{j+{\textstyle {1\over 2}}}^{n} \right) , \\&d_{j+{\textstyle {1\over 2}}}^{n} \,=\,d \left( u_{j+{\textstyle {1\over 2}}}^{n} \right) ,&u_{j+{\textstyle {1\over 2}}}^{n} \,=\,\frac{1}{2} \left( u_{j}^{n} \,+\,u_{j+1}^{n} \right) . \end{aligned}$$

When dealing with nonlinearities, we reiterate that the ScharfetterGummel scheme does not require any sub-iterations at each time iteration \(t^{n}\), since it is explicit. Indeed, the scheme is written in an explicit way, enabling to compute directly the coefficients a and d. On the other hand, the CFL condition of the scheme has to be respected, which is given by (Gosse 2016):

$$\begin{aligned} \Delta t\max _{j} \left[ a_{j+{\textstyle {1\over 2}}} \tanh \left( \dfrac{a_{j+{\textstyle {1\over 2}}} \Delta x}{2 d_{j+{\textstyle {1\over 2}}}} \right) ^{-1} \right] \leqslant \ \Delta x. \end{aligned}$$

3.4 Comparison of the Numerical Solution

To compare and validate the scheme implementation, the error between the solution \(u^{\mathrm {num}}\,(x,t)\), obtained by the numerical method, and a reference solution \(u^{\mathrm {ref}} (x, t)\), is computed as a function of x by the following discrete \(\ell _{2}\) formulation:

$$\begin{aligned} \varepsilon _{2} (x)\&\mathop {{\mathop {:=}\limits ^{\,\mathrm {def}}}\,}\sqrt{\frac{1}{N_{t}} \sum _{j = 1}^{N_{t}} \left( u_{j}^{\mathrm {num}} (x, t) \,-\,u_{j}^{\mathrm {ref}} (x, t) \right) ^{2}}, \end{aligned}$$

where \(N_{t}\) is the number of temporal steps. The global uniform error \(\varepsilon _{\infty }\) is given by the maximum value of \(\varepsilon _{2} (x)\):

$$\begin{aligned} \varepsilon _{\infty }\&\mathop {{\mathop {:=}\limits ^{\,\mathrm {def}}}\,}\sup _{x \in \left[ 0, L \right] } \varepsilon _{2} (x). \end{aligned}$$

As detailed in further sections, the reference solution \(u^{\mathrm {ref}} (x, t)\) can be given by an analytical solution in exceptional cases, by a numerical pseudo-spectral solution obtained with the Matlab™ open source toolbox Chebfun (Driscoll et al. 2014) or even by experimental data. The pseudo-spectral solution employs the function pde23t of Chebfun to compute a numerical solution of a partial derivative equation based on the Chebyshev polynomials representation.

3.5 Numerical Validation

In this section, the validation of the numerical scheme for a single advective–diffusive equation is proposed. For this purpose, Eq. (7) is written in the form:

$$\begin{aligned}&\frac{\partial u}{\partial t} \,+\,\frac{\partial J}{\partial x} \,=\,0, \quad t > 0, \quad x \in \Omega _{x}, \end{aligned}$$
(14a)
$$\begin{aligned}&J \,=\,a(u) u \,-\,d(u) \frac{\partial u}{\partial x}, \end{aligned}$$
(14b)
$$\begin{aligned}&a(u) \,=\,a_{0} \,+\,a_{1} u \,+\,a_{2} u^{2}, \end{aligned}$$
(14c)
$$\begin{aligned}&d(u) \,=\,d_{0} \,+\,d_{1} u \,+\,d_{2} u^{2}. \end{aligned}$$
(14d)

The functions for diffusion and advection coefficients have been exclusively used for the validation of the numerical algorithm and the analysis of the accuracy of the ScharfetterGummel numerical solution. They may not be appropriate for material coefficients experimentally determined. The boundary conditions and the numerical values are specified for each of the three cases. The first two compare the numerical solution with an analytical one. As illustrated in Fig. 3a, they consider a material with an initial profile \(u(x,\,0)\) in the material. A Dirichlet conditions is imposed at the boundaries of the material. For the last case, the reference is the Chebfun pseudo-spectral solution. As illustrated in Fig. 3b, a uniform initial condition is considered in the material with time variable boundary conditions in the ambient air surrounding the material.

Fig. 3
figure 3

Illustration of the case studies 1 and 2 (a) and of the case 3 (b)

3.5.1 Case 1

First, we set \(a_{0} \,=\,d_{0} \,=\,d_{2} \,=\,0\). In this case, an analytical solution to Eq. (14) can be obtained by direct substitution:

$$\begin{aligned} u(x,\,t) \,=\,- \frac{1}{2} A \tanh \left( k \,\left( x \,+\,x_{0} \,-\,c \,t \right) \right) \,-\,\frac{1}{2} \frac{a_{1}}{a_{2}}, \end{aligned}$$

where

$$\begin{aligned}&m \mathop {{\mathop {:=}\limits ^{\,\mathrm {def}}}\,}2 \frac{d_{1}}{a_{2}} C_{1}, \quad k \mathop {{\mathop {:=}\limits ^{\,\mathrm {def}}}\,}\frac{a_{2}}{2 d_{1}} A, \quad c \mathop {{\mathop {:=}\limits ^{\,\mathrm {def}}}\,}- \frac{1}{4 a_{2}} \left( a_{1}^{2} \,-\,a_{2}^{2} A^{2} \right) , \end{aligned}$$

and \(C_{1}\) is an arbitrary constants and \(x_{0}\) defines the initial position of the front.

The asymptotic values of \(u(x,\,t = 0)\) provide the Dirichlet type boundary conditions that will be used to compute the numerical solution:

$$\begin{aligned} \lim _{x \rightarrow + \,\infty } u(x,\,0) \,=\,u^{\infty , R}&\,=\,- \frac{1}{2 a_{2}} \left( a_{2} A \,+\,a_{1} \right) ,\\ \lim _{x \rightarrow - \infty } u(x,\,0) \,=\,u^{\infty , L}&\,=\,\frac{1}{2 a_{2}} \left( a_{2} A \,-\,a_{1} \right) . \end{aligned}$$

For the numerical application, we take into account the following values:

$$\begin{aligned}&x_{0} \,=\,0, \quad C_{1} \,=\,1, \quad a_{1} \,=\,-1.4, \quad a_{2} \,=\,0.2, \quad d_{1} \,=\,0.5. \end{aligned}$$

And as consequences, we have:

$$\begin{aligned} u^{\infty , R} \,=\,1, \quad u^{\infty , L} \,=\,6. \end{aligned}$$

The domains are defined as \(x \in \left[ -10, 10 \right] \) and \(t \in \left[ 0, 5 \right] \). The numerical solution is computed using the ScharfetterGummel scheme, with following spatial discretization \(\Delta x\,=\,0.01\) and an adaptive time step \(\Delta t\) using Matlab™ function ode113 (Shampine and Reichelt 1997) with an absolute and relative tolerances set to \(10^{-5}\).

Figure 4a, b give the variation of the field as a function of time and space. A very good agreement can be noticed among the ScharfetterGummel, Chebfun pseudo-spectral and analytical solutions. As shown in Fig. 4c, the \(\ell _{2}\) error is lower than \(\mathcal {O}(10^{-2})\), which is consistent with the scheme accuracy \(\mathcal {O}(\Delta x)\).

Fig. 4
figure 4

Variation of the field u as a function of x (a) and t (b). \(\ell _{2}\) error as a function of x (c)

3.5.2 Case 2

We set as null the coefficients \(a_{2} \,=\,d_{1} \,=\,d_{2} \,=\,0\). For these conditions, by direct substitution in Eq. (14), one can check that an analytical solution can be expressed:

$$\begin{aligned} u(x,\,t) \,=\,- \frac{1}{2} A \tanh \left( k \,\left( x \,+\,x_{0} \,-\,c \,t \right) \right) \,-\,\frac{1}{2 C_{1} a_{1}} \left( C_{1} a_{0} \,+\,C_{2} \right) , \end{aligned}$$

where

$$\begin{aligned} A \mathop {{\mathop {:=}\limits ^{\,\mathrm {def}}}\,}2 \frac{d_{0}}{a_{1}} C_{1}, \quad k \mathop {{\mathop {:=}\limits ^{\,\mathrm {def}}}\,}C_{1}, \quad c \mathop {{\mathop {:=}\limits ^{\,\mathrm {def}}}\,}- \frac{C_{2}}{C_{1}}, \end{aligned}$$

where \(C_{1}\) and \(C_{2}\) are arbitrary constants and \(x_{0}\) is the initial position of the front.

The asymptotic values of \(u(x,\,t = 0)\) give the Dirichlet type boundary conditions that will be used to compute the numerical solution:

$$\begin{aligned} \lim _{x \rightarrow +\,\infty } u(x,\,0) \,=\,u^{\infty , R}&\,=\,\frac{1}{2 a_{1} C_{1}} \left( - 2 C_{1}^{2} d_{0} - C_{1} a_{0} \,-\,C_{2} \right) ,\\ \lim _{x \rightarrow - \infty } u(x,\,0) \,=\,u^{\infty , L}&\,=\,\frac{1}{2 a_{1} C_{1}} \left( 2 C_{1}^{2} d_{0} - C_{1} a_{0} \,-\,C_{2} \right) . \end{aligned}$$

The following values are used for numerical applications:

$$\begin{aligned} C_{1} \,=\,0, \quad C_{2} \,=\,1, \quad C_{3} \,=\,-2, \quad a_{0} \,=\,0.1, \quad a_{1} \,=\,0.3, \quad d_{0} \,=\,0.2. \end{aligned}$$

And therefore,

$$\begin{aligned} u^{\infty , R} \,=\,2.5,\,\,\,\,\,\,\, u^{\infty , L} \,=\,3.83. \end{aligned}$$

The time domain is defined as \(t \in \left[ 0, 3 \right] \). For the numerical solution, the space domain needs to be defined. Since, \(\forall t \in \left[ 0, 3 \right] \), \(\left| u(-\,10,\,t) \,-\,u^{\infty , L} \right| \leqslant 3 \,\times \,10^{-9}\) and \(\left| u(10,\,t) \,-\,u^{\infty , R} \right| \leqslant 3 \,\times \,10^{-9}\), the space domain is set as \(x \in \left[ -10, 10 \right] \). As for the previous case, the solution is computed using the ScharfetterGummel scheme, with a spatial discretization \(\Delta x\,=\,10^{-2}\) and an adaptive time step \(\Delta t\) with tolerances set to \(10^{-5}\).

Results are shown in Fig. 5a–c. An accurate agreement is observed between the three solutions to represent the physical phenomena. The \(\ell _{2}\) error is of the order \(\mathcal {O}(10^{-3})\), highlighting high accuracy of the solution computed with the ScharfetterGummel scheme.

Fig. 5
figure 5

Variation of the field u as a function of x (a) and t (b). \(\ell _{2}\) error \(\varepsilon \) as a function of x (c)

Remark on the analytical solution

Other analytical solutions can be derived. By direct substitution in Eq. (14), one can check that, for the particular case \(a_{1} \,=\,d_{0} \,=\,d_{2} \,=\,0\), we have:

$$\begin{aligned} u(x,\,t) \,=\,- \frac{1}{2} A \tanh \left( k \,\left( x \,+\,x_{0} \,-\,c \,t \right) \right) , \end{aligned}$$

where

$$\begin{aligned}&A \mathop {{\mathop {:=}\limits ^{\,\mathrm {def}}}\,}2 \frac{d_{1}}{a_{2}} C_{1},&k \mathop {{\mathop {:=}\limits ^{\,\mathrm {def}}}\,}\frac{1}{2} \frac{a_{2}}{d_{1}} A,\,\,\,\,&c \mathop {{\mathop {:=}\limits ^{\,\mathrm {def}}}\,}- \frac{4}{a_{2} A^{2} \,+\,4\,a_{0}}, \end{aligned}$$

and \(C_{1}\) is arbitrary real constants. The asymptotic values are:

$$\begin{aligned} \lim _{x \rightarrow \infty } u(x,\,t) \,=\,u^{\infty , R}&\,=\,- \frac{1}{2} \,A,\\ \lim _{x \rightarrow - \infty } u(x,\,t) \,=\,u^{\infty , L}&\,=\,\frac{1}{2} \,A. \end{aligned}$$

However, due to the functions \(\tanh \,(k\,x)\), the last solution u takes positive and negative values in the interval \(x \in \mathbb {R}\). It can be noted that \(u^{\infty , R} < 0\) and \(u^{\infty , L} > 0\), for \(A > 0\) (or vice versa). It implies positive and negative values for the diffusion coefficients d, that has no physical meaning. For this reason, this analytical solution was not used for comparison with the numerical one. However, it can be used to validate the solvers.

In the particular case \(a_{0} \,=\,a_{2} \,=\,d_{0} \,=\,d_{2} \,=\,0\), another two analytical solutions can be derived:

$$\begin{aligned} u_{1}(x,\,t) \,=\,4 d_{1} C_{2} \left[ a_{1}^{2} \left( \tanh \left( C_{2} t \,-\,\frac{a_{1}}{2 d_{1}} x \,+\,C_{1} \right) \,+\,1 \right) \right] ^{-1}, \\ u_{2}(x,\,t) \,=\,4 d_{1} C_{2} \left[ a_{1}^{2} \left( \tanh \left( C_{2} t \,+\,\frac{a_{1}}{2 d_{1}} x \,+\,C_{1} \right) \,-\,1 \right) \right] ^{-1}, \end{aligned}$$

and \(C_{1}\) and \(C_{2}\) are arbitrary constants. It can be pointed that the asymptotic values are:

$$\begin{aligned}&\lim _{x \rightarrow +\,\infty } u_{1}(x,\,t) \,=\,u_{1}^{\infty , R} \,=\,- \infty , \quad \lim _{x \rightarrow +\,\infty } u_{2}(x,\,t) \,=\,u_{2}^{\infty , R} \,=\,\infty , \\&\lim _{x \rightarrow - \infty } u_{1}(x,\,t) \,=\,u_{1}^{\infty , L} \,=\,2 \frac{d_{1}}{a_{1}^{2}} C_{2}, \quad \lim _{x \rightarrow - \infty } u_{2}(x,\,t) \,=\,u_{2}^{\infty , L} \,=\,- 2 \frac{d_{1}}{a_{1}^{2}} C_{2}. \end{aligned}$$

One asymptotic value of both analytical solutions tends to infinity, having no physical meaning. This solution can be used for validation purpose only on a finite domain.

3.5.3 Case 3

The previous comparison cases considered only Dirichlet boundary conditions. Here, a nonlinear case of transfer with Robin boundary conditions is investigated. The time and space domains are defined as \(x \in \left[ 0, 1 \right] \) and \(t \in \left[ 0, 6 \right] \), respectively. The material properties are fixed to:

$$\begin{aligned} a_{0} \,=\,0.5, \quad a_{1} \,=\,0.3, \quad a_{2} \,=\,0, \quad d_{0} \,=\,0.9, \quad d_{1} \,=\,0.1, \quad d_{2} \,=\,0. \end{aligned}$$
Fig. 6
figure 6

Variation of the field u as a function of x (a) and t (b). \(\ell _{2}\) error \(\varepsilon \) as a function of x (c). Time variation of the residual \(R \,(t)\) of the conservation law Eq. (15)

The initial condition is set to \(u(x,\,t\,=\,0) \,=\,0\). Moreover, in accordance with Eq. (8), we have:

$$\begin{aligned}&\text {At} \quad x \,=\,1{:} \quad \mathrm {Bi}^{R} \,=\,1.3, \quad u^{\infty , R} (t) \,=\,1.9 \sin \left( 2 \pi \frac{t}{6} \right) ^{2}. \\&\text {At} \quad x \,=\,0{:} \quad \mathrm {Bi}^{L} \,=\,0.5, \quad u^{\infty , L} (t) \,=\,0.3 \left( 1 \,-\,\cos \left( \pi t \right) \right) ^{2}. \end{aligned}$$

The ScharfetterGummel numerical solution is computed for a spatial discretization \(\Delta x\,=\,10^{-2}\) and an adaptive time step with all tolerances set to \(10^{-5}\). Moreover, in order to confirm the analysis of the studied scheme accuracy, the commercial software \({\texttt {Comsol}}^{\mathrm{TM}}\) is used to compute the solution (Comsol multiphysics user’s guide 2012). It is based on a finite-element approach with a backward implicit time discretization. The same spatial mesh \(\Delta x\,=\,10^{-2}\) is used. As no analytical solution was found, the reference solution is the one computed with the Chebfun package. Figure 6a, b show that the physical phenomena are perfectly represented by the ScharfetterGummel numerical solution. The field u follows the variation of the boundary conditions. Once again, a very good agreement is observed between the \({\texttt {Comsol}}^{\mathrm{TM}}\), the ScharfetterGummel and the Chebfun solutions. The \(\ell _{2}\) error is lower than \(\mathcal {O}(10^{-2}) \) for both \({\texttt {Comsol}}^{\mathrm{TM}}\) and ScharfetterGummel solutions. It is important to note that the evaluation of the CPU time is not accomplished since the ScharfetterGummel and \({\texttt {Comsol}}^{\mathrm{TM}}\) algorithms are developed in different languages and environments.

Another possibility to verify the accuracy of the solution is to verify the conservation law. In this particular case (\(a_{2} \,=\,d_{2} \,=\,0 \)), a non-trivial conservation law can be derived:

$$\begin{aligned} \frac{\partial }{\partial t} \left[ u \cdot \mathrm {e}^{-\,\frac{2 a_{1}}{d_{1}} \left( x \,-\,\frac{\Delta }{d_{1}} t \,\right) } \right] \,+\,\frac{\partial }{\partial x} \left[ \left( \frac{\Delta }{d_{1}} u \,-\,\left( d_{0} \,+\,d_{1} u \right) \frac{\partial u}{\partial x} \right) \cdot \mathrm {e}^{-\,\frac{2 a_{1}}{d_{1}} \left( x \,-\,\frac{\Delta }{d_{1}} t \,\right) } \right] \,=\,0, \end{aligned}$$
(15)

with \(\Delta \mathop {{\mathop {:=}\limits ^{\,\mathrm {def}}}\,}a_{0} d_{1} \,-\,2 a_{1} d_{0}\). In order to verify the accuracy of the numerical solution computed, the residual R is calculated according to:

$$\begin{aligned} R (t)&\,=\,\int _{0}^1 \left\{ \frac{\partial }{\partial t} \left[ u \cdot \mathrm {e}^{-\,\frac{2 a_{1}}{d_{1}} \left( x \,-\,\frac{\Delta }{d_{1}} t \,\right) } \right] \right. \\&\quad \left. \,+\,\frac{\partial }{\partial x} \left[ \left( \frac{\Delta }{d_{1}} u \,-\,\left( d_{0} \,+\,d_{1} u \right) \frac{\partial u}{\partial x} \right) \cdot \mathrm {e}^{-\,\frac{2 a_{1}}{d_{1}} \left( x \,-\,\frac{\Delta }{d_{1}} t \,\right) } \right] \right\} \mathrm {d}x, \end{aligned}$$

that can be rewritten in the following form:

$$\begin{aligned} R (t)&\,=\,\frac{\partial }{\partial t} \left[ \int _{0}^1 u \cdot \mathrm {e}^{-\,\frac{2 a_{1}}{d_{1}} \left( x \,-\,\frac{\Delta }{d_{1}} t \,\right) } \mathrm {d}x \right] \\&\quad \,+\,\left[ \left( \frac{\Delta }{d_{1}} u \,-\,\left( d_{0} \,+\,d_{1} u \right) \frac{\partial u}{\partial x} \right) \cdot \mathrm {e}^{-\,\frac{2 a_{1}}{d_{1}} \left( x \,-\,\frac{\Delta }{d_{1}} t \,\right) } \right] _{x \,=\,1} \\&\quad \,-\,\left[ \left( \frac{\Delta }{d_{1}} u \,-\,\left( d_{0} \,+\,d_{1} u \right) \frac{\partial u}{\partial x} \right) \cdot \mathrm {e}^{-\,\frac{2 a_{1}}{d_{1}} \left( x \,-\,\frac{\Delta }{d_{1}} t \,\right) } \right] _{x \,= 0}. \end{aligned}$$

Figure 6d shows the time variation of the residual of the conservation law. The conservation law is verified by numerical solutions indicating a satisfying accuracy of the numerical methods. Another remark concerns the symmetry point transformation. These symmetries enables to translate physical observations (as space or time translations) and can be used in further studies when exploring the equation solutions. Three symmetries have been identified:

$$\begin{aligned} 1.~\text {Space translation:}&\left. {\left\{ \begin{array}{ll} x^{\prime } \,=\,x \,+\,\epsilon _{1}&{} \\ t^{\prime } \,=\,t&{} \\ u^{\prime } \,=\,u&{} \\ \end{array}\right. } \ \right. \\ 2.~\text {Time translation:}&\left. {\left\{ \begin{array}{ll} x^{\prime } \,=\,x&{} \\ t^{\prime } \,=\,t \,+\,\epsilon _{2}&{}\\ u^{\prime } \,=\,u&{} \\ \end{array}\right. } \ \right. \\ 3.~\text {Scaling symmetry:}&\left. {\left\{ \begin{array}{ll} x^{\prime } \,=\,x \,-\,\frac{\Delta }{d_{1}} \left( 1 \,-\,\mathrm {e}^{-\,d_{1} \epsilon _{3}} \right) &{} \\ t^{\prime } \,=\,t \mathrm {e}^{- \,d_{1} \epsilon _{3}}&{} \\ u^{\prime } \,=\,u \mathrm {e}^{d_{1} \epsilon _{3}} \,-\,\frac{d_{0}}{d_{1}} \left( 1 \,-\,\mathrm {e}^{d_{1} \epsilon _{3}} \right) &{} \\ \end{array}\right. } \right. \end{aligned}$$

The symmetry can be used when exploring the equation solutions. Knowing a solution and a particular symmetry, an infinity of solution can be computed. An example has been included in the manuscript for the scaling symmetry 3. Figure 7 shows the solution u(xt) obtained using the ScharfetterGummel numerical scheme. Adopting the scaling parameter \(\epsilon _{3} \,=\,-1.5\), the solution \(u^{\prime } (x^{\prime }, t^{\prime })\) can be obtained by applying the symmetry.

Fig. 7
figure 7

Illustration of the use of the scaling symmetry to compute \(u(x^{\prime },\,t^{\prime })\) using \(u(x,\,t)\) and the scaling parameter \(\epsilon _{3} \,=\,-1.5\)

4 Numerical Method for Coupled Equations

For the sake of simplicity and without losing the generality, the numerical schemes are described for the system of two coupled linear advection–diffusion equations, written as:

$$\begin{aligned}&\frac{\partial u}{\partial t} \,+\,\frac{\partial f}{\partial x} \,=\,0, \quad t > 0, \quad x \in \left[ 0, 1 \right] , \end{aligned}$$
(16a)
$$\begin{aligned}&\frac{\partial v}{\partial t} \,+\,\frac{\partial g}{\partial x} \,=\,0, \quad t > 0, \quad x \in \left[ 0, 1 \right] , \end{aligned}$$
(16b)
$$\begin{aligned}&f \,=\,a_{11} u \,-\,d_{11} \frac{\partial u}{\partial x}, \end{aligned}$$
(16c)
$$\begin{aligned}&g \,=\,a_{22} v \,-\,d_{22} \frac{\partial v}{\partial x} \,+\,a_{21} u \,-\,d_{21} \frac{\partial u}{\partial x}, \end{aligned}$$
(16d)

where \(u(x,\,t)\) and \(v(x,\,t)\), \(x\ \in \ \Omega _{x}\), \(t\ >\ 0\), are the fields of interest, \(d_{ij}\), the diffusion coefficients and, \(a_{ij}\), the advection coefficients, both considered as constants (in this section). The frozen coefficients are used here only to generalize the results obtained for the case of a scalar linear advection–diffusion equation. At \(x \,=\,0\), the boundary conditions are:

$$\begin{aligned}&d_{11} \frac{\partial u}{\partial x} \,-\,a_{11} u \,=\,\mathrm {Bi}_{11} \cdot \left( u \,-\,u^{\infty }\right) , \end{aligned}$$
(17a)
$$\begin{aligned}&d_{22} \frac{\partial v}{\partial x} \,-\,a_{22} v \,+\,d_{21} \frac{\partial u}{\partial x} \,-\,a_{21} u \,=\,\mathrm {Bi}_{22} \cdot \left( v \,-\,v^{\infty }\right) \,+\,\mathrm {Bi}_{21} \cdot \left( u \,-\,u^{\infty }\right) , \end{aligned}$$
(17b)

and at \(x \,=\,1\):

$$\begin{aligned}&d_{11} \frac{\partial u}{\partial x} \,-\,a_{11} u \,=\,-\,\mathrm {Bi}_{11} \cdot \left( u \,-\,u^{\infty }\right) , \end{aligned}$$
(18a)
$$\begin{aligned}&d_{22} \frac{\partial v}{\partial x} \,-\,a_{22} v \,+\,d_{21} \frac{\partial u}{\partial x} \,-\,a_{21} u \,=\,-\,\mathrm {Bi}_{22} \cdot \left( v \,-\,v^{\infty }\right) \,-\,\mathrm {Bi}_{21} \cdot \left( u \,-\,u^{\infty }\right) , \end{aligned}$$
(18b)

where \(u^{\infty }(t)\) and \(v^{\infty }(t)\) are the field variables in the ambient air surrounding the material.

4.1 Extension of the ScharfetterGummel Scheme to the Case of a System

The discretization of Eqs. (16) yields to the following semi-discrete difference equations:

$$\begin{aligned} \frac{\mathrm {d} u_{j}}{\mathrm {d} t} \,+\,\frac{1}{\Delta x} \left[ f_{j+\frac{1}{2}}^{n}\ -\ f_{j-\frac{1}{2}}^{n} \right] \,=\,0, \\ \frac{\mathrm {d} v_{j}}{\mathrm {d} t} \,+\,\frac{1}{\Delta x} \left[ g_{j+\frac{1}{2}}^{n}\ -\ g_{j-\frac{1}{2}}^{n} \right] \,=\,0. \end{aligned}$$

As for the scalar case, the ScharfetterGummel scheme assumes the fluxes \(f_{j+{\textstyle {1\over 2}}}^{n}\) and \(g_{j+{\textstyle {1\over 2}}}^{n}\) to be constant on the dual cell \(\left[ x_{j}, x_{j+1}\right] \). The flux \(f_{j+{\textstyle {1\over 2}}}^{n}\) is the solution of the following boundary value problem:

$$\begin{aligned}&f_{j+{\textstyle {1\over 2}}}^{n} \,=\,a_{11} u \,-\,d_{11} \frac{\partial u}{\partial x} , \quad \forall x \in \left[ x_{j}, x_{j+1} \right] , \quad \forall j \in \left\{ 2,\ldots ,\,N\,-\,1 \,\right\} , \end{aligned}$$
(19a)
$$\begin{aligned}&u \,=\,u_{j}^{n}, \quad x \,=\,x_{j}, \end{aligned}$$
(19b)
$$\begin{aligned}&u \,=\,u_{j+1}^{n}, \quad x \,=\,x_{j+1}. \end{aligned}$$
(19c)

While \(g_{j+{\textstyle {1\over 2}}}^{n}\) is given as the solution of:

$$\begin{aligned}&g_{j+{\textstyle {1\over 2}}}^{n} \,=\,a_{22} v \,-\,d_{22} \frac{\partial v}{\partial x} \,+\,a_{21} u \,-\,d_{21} \frac{\partial u}{\partial x}, \quad \forall x \in \left[ x_{j}, x_{j+1} \right] , \quad \forall j \in \left\{ 2,\ldots ,\,N\,-\,1 \,\right\} , \end{aligned}$$
(20a)
$$\begin{aligned}&v \,=\,v_{j}^{n}, \quad x \,=\,x_{j}, \end{aligned}$$
(20b)
$$\begin{aligned}&v \,=\,v_{j+1}^{n}, \quad x \,=\,x_{j+1}. \end{aligned}$$
(20c)

We define \(\Theta _{kl} \mathop {{\mathop {:=}\limits ^{\,\mathrm {def}}}\,}\dfrac{a_{kl} \Delta x}{d_{kl}}\). Then, the computation of \(f_{j+{\textstyle {1\over 2}}}^{n}\) from Eq. (19) is straightforward:

$$\begin{aligned} f_{j+{\textstyle {1\over 2}}}^{n} \,=\,\frac{d_{11}}{\Delta x} \left[ -\ \mathcal {B} \left( \Theta _{11} \right) u_{j+1}^{n} \,+\,\mathcal {B} \left( - \Theta _{11} \right) u_{j}^{n} \right] , \end{aligned}$$

Using results from Eq. (12), the solution u(x) can also be computed exactly as well:

$$\begin{aligned} u^{n}(x) \,=\,\frac{1}{a_{11}} f_{j+\frac{1}{2}}^{n} \,+\,\frac{\left( u_{j}^{n} \,-\,u_{j+1}^{n} \right) }{1 \,-\,\mathrm {e}^{\Theta }} \mathrm {exp} \left( \dfrac{a_{11}}{d_{11}} \left( x \,-\,x_{j} \right) \right) , \quad x \in \left[ x_{j}, x_{j+1} \right] . \end{aligned}$$
(21)

For the computation of \(g_{j+\frac{1}{2}}^{n}\) from Eq. (20), the solution u(x) from Eq. (21) is used. For the sake of notation compactness, the expression of the flux \(g_{j+\frac{1}{2}}^{n}\) is provided in the Maple sheet provided as a supplementary material.

All specific features of the ScharfetterGummel scheme mentioned in Sect. 3.2 are still valid for the system of differential equations (18). The scheme is well-balanced and asymptotic preserving. An exact computation of solutions u and v can be computed in the interval \(\left[ x_{j}, x_{j+1} \right] \). The CFL condition is extended as:

$$\begin{aligned} \Delta t\max _{1 \leqslant k, l \leqslant 2} d_{kl} \max _{1 \leqslant j \leqslant N} \left[ \frac{a_{kl}}{d_{kl}} \tanh \left( \dfrac{a_{kl} \Delta x}{2 d_{kl}} \right) ^{-1} \right] \leqslant \ \Delta x. \end{aligned}$$

The treatment of nonlinear problems, where coefficients \(a_{kl}\) and \(d_{kl}\) depend on u and v, is completely analogous to Sect. 3.3 with the approach of the frozen coefficients on the dual cell. The problem of heat and mass transfer formulated in Sect. 2 corresponds to a weakly coupled system of differential equations. When considering highly coupled equations, the ScharfetterGummel approach can be applied for each equation by assuming the flux as constant and computing the latter by solving the associated boundary value problem.

4.2 Numerical Validation

To validate the numerical ScharfetterGummel scheme for a system of coupled differential equations, two cases are considered. The first one, which considers constant material properties, is used to undertake a convergence study on the discretization parameter \(\Delta x\) and \(\Delta t\). The second case, with material properties depending on the fields, will highlight the accuracy of the scheme to treat a nonlinear problem.

4.2.1 Case 1

In this case, the material properties do not depend on the fields and they are fixed to:

$$\begin{aligned}&a_{11} \,=\,0.02, \quad d_{11} \,=\,0.09, \quad a_{22} \,=\,0.03, \quad d_{22} \,=\,0.07, \quad a_{21} \,=\,0.01, \quad d_{21} \,=\,0.03. \end{aligned}$$

The initial condition is set to \(u \,=\,v \,=\,0\). For the Robin type boundary conditions, the Biot numbers are equal to:

$$\begin{aligned}&x \,=\,0 \,: \quad \mathrm {Bi}_{11} \,=\,1.5, \quad \mathrm {Bi}_{22} \,=\,0.6, \quad \mathrm {Bi}_{21} \,=\,0.2, \\&x \,=\,1 \,: \quad \mathrm {Bi}_{11} \,=\,1.3, \quad \mathrm {Bi}_{22} \,=\,1.1, \quad \mathrm {Bi}_{21} \,=\,0.8. \end{aligned}$$

In the ambient air, the fields vary according to sinusoidal variations:

$$\begin{aligned}&x \,=\,0 \,: \quad u^{\infty }(t) \,=\,0.2 \sin ^{2} \left( \pi t \right) , \quad v^{\infty }(t) \,=\,0.6 \sin ^{2} \left( \frac{2}{5} \pi t \right) , \\&x \,=\,1 \,: \quad u^{\infty }(t) \,=\,0.9 \sin ^{2} \left( \frac{2}{6} \,\pi t \right) , \quad v^{\infty }(t) \,=\,0.5 \sin ^{2} \left( \frac{2}{3} \pi t \right) . \end{aligned}$$

The simulation final time is \(t \,=\,3\). The discretization parameters used for the computation are \(\Delta x\,=\,10^{-2}\) and \(\Delta t\,=\,10^{-4}\). These parameters respect the CFL conditions: \(\Delta t\leqslant 5 \times 10^{-4}\). The variation of the fields \(u(x,\,t)\) and \(v(x,\,t)\) as a function of time and space is illustrated in Fig. 8a–d. It follows the variation of boundary conditions and physical phenomena, which are well reflected. Moreover, a very good agreement can be noticed between the solution computed with the ScharfetterGummel scheme and the reference one. For both fields, the \(\ell _{2}\) error is less than \(5 \times 10^{-3}\) as shown in Fig. 9. A convergence study has been carried out by varying \(\Delta t\) or \(\Delta x\) and fixing the other one. Figure 10b shows the variation of the error as a function of \( \Delta t\) for a fixed spatial discretization \(\Delta x\,=\,10^{-2}\). The error is invariant and equals to the absolute error of the scheme for the range of \(\Delta t\) considered. The scheme is not able to compute a solution when the CFL condition is not respected. Figure 10a gives the error \(\varepsilon _{2}\) as a function of \(\Delta x\) for a fixed \(\Delta t\,=\,10^{-4}\). It can be noted that the error \(\ell _{2}\) as a similar behavior for both fields. In addition, the ScharfetterGummel scheme is first-order accurate in space \(\mathcal {O}(\Delta x)\). For this parametric study, the computational time of the scheme has been compared for two approaches: (i) with a fixed time step \(\Delta t\,=\,10^{-4}\) and (ii) with an adaptive time step using the Matlab™ function ode113 and two tolerances set to \(10^{-5}\). As shown in Fig. 11b, using an adaptive time step enables an important reduction of the computation time when \(\Delta x\) is relatively large without losing any accuracy. Figure 11a gives the variation of the error as a function of the discretization parameter \(\Delta x\). Thanks to the time adaptive feature of the algorithm, it enables to respect the CFL condition for any value of space discretization parameter \(\Delta x\).

Fig. 8
figure 8

Variation of the fields as a function of x (a, b) and t (c, d)

Fig. 9
figure 9

\(\ell _{2}\) error as a function of x

Fig. 10
figure 10

Variation of the \(\ell _{2}\) error as a function of \(\Delta x\) (\(\Delta t\,=\,10^{-4}\)) (a) and \(\Delta t\) (\(\Delta x\,=\,10^{-2}\)) (b) using an explicit ScharfetterGummel scheme

Fig. 11
figure 11

Variation of the \(\ell _{2}\) error as a function of \(\Delta x\) using an adaptive in time ScharfetterGummel scheme (a) and variation of the CPU time as a function of \(\Delta x\) (b)

4.2.2 Case 2

The material properties are now depending on the fields u and v:

$$\begin{aligned}&a_{11} \,=\,0.02 \,+\,0.3 u \,+\,0.6 v^{2}, \quad d_{11} \,=\,0.09 \,+\,0.5 u^{2} \,+\,0.5 v, \\&a_{22} \,=\,0.03 \,+\,0.2 u \,+\,0.1 v, \quad d_{22} \,=\,0.07 \,+\,0.6 u^{2} \,+\,0.5 v^{2}, \\&a_{21} \,=\,0.01 \,+\,0.3 u \,+\,0.5 v, \quad d_{21} \,=\,0.03 \,+\,0.1 u \,+\,0.3 u^{2} \,+\,0.5 v. \end{aligned}$$

The initial condition and Biot numbers are similar to the ones from the previous case. The boundary conditions are:

$$\begin{aligned}&x \,=\,0, \quad u^{\infty }(t) \,=\,0.2 \left( 1 \,-\,\cos ^{2} \left( \pi t \right) \right) , \quad v^{\infty }(t) \,=\,0.6 \sin ^{2} \left( \pi t \right) , \\&x \,=\,1, \quad u^{\infty }(t) \,=\,0.9 \sin ^{2} \left( \frac{2}{6} \,\pi t \right) , \quad v^{\infty }(t) \,=\,0.5 \sin ^{2} \left( \frac{2}{3} \pi t \right) . \end{aligned}$$

The simulation final time is \(t \,=\,6 \) and the solution is computed with \(\Delta x\,=\,0.01\) along with an adaptive time step with both tolerances set to \(10^{-5}\). A perfect agreement between the reference and ScharfetterGummel solutions can be seen in Fig. 12a–d. The absolute error is lower than \(4 \times 10^{-3}\) as shown in Fig. 13, validating the scheme for this nonlinear case.

Fig. 12
figure 12

Variation of the fields as a function of x (a, b) and t (c, d)

Fig. 13
figure 13

\(\ell _{2}\) error for the two fields \(u(x,\,t)\) and \(v(x,\,t)\)

5 Experimental Comparison

5.1 Description of the Case Study

As the advantages of the ScharfetterGummel scheme were highlighted in previous test cases, an important step in the validation of a physical model is its capacity to represent the physical phenomena. For this, results from the numerical model are compared with experimental data from James et al. (2010), which enables to investigate both advective and diffusive effects on the moisture front. A gypsum board, of length \(L \,=\,37.5 \mathrm{mm}\) and initially conditioned at the relative humidity \(\phi \,=\,0.3\), is submitted to an adsorption–desorption cycle (30–72–30) for 48 h. The temperature is maintained almost constant during the whole test at \(T \,=\,23.5\,^\circ \mathrm{C}\). The constant surface transfer coefficient is equal to \(\alpha _{q} \,=\,3.45 \,\times \,10^{-8}~{\mathrm{W}/\mathrm{m}^{2}/\mathrm{K}}\) and \(\alpha _{m} \,=\,2.41 \,\times \,10^{-8}~{\mathrm{s/m}}\). The material properties are recalled in Fig. 14 and can be found in James et al. (2010). The sorption moisture equilibrium curve with its hysteresis characteristic is reminded and illustrated in Fig. 14b.

Fig. 14
figure 14

Moisture permeability (a) and, adsorption and desorption curves of the moisture content for the gypsum board (b) (see James et al. (2010) for more details)

The problem is solved with the ScharfetterGummel numerical scheme considering a large spatial discretization parameter \(\Delta x\,=\,0.1\), an adaptive time step and both tolerances set to \(10^{-3}\). Before analyzing carefully the numerical prediction and the experimental data, it is important to verify the hypothesis that was done in Sect. 2.2. In Eq. (4), the term \(\sum _{i=1}^2 \varvec{\nabla }\left( c_{i} T \right) \varvec{\cdot }\left( \varvec{j}_{\mathrm {a},i} \,+\,\varvec{j}_{\mathrm {d},i} \right) \) has been neglected according to the suggestion of (Luikov 1966, chapter 6). The sensitivity of this assumption is verified by evaluating the contribution of this term compared to the others:

$$\begin{aligned} \delta \,=\,\max _{t} \left| \frac{\sum _{i=1}^2 \varvec{\nabla }\left( c_{i} T \right) \varvec{\cdot }\left( \varvec{j}_{\mathrm {a},i} \,+\,\varvec{j}_{\mathrm {d},i} \right) }{\varvec{\nabla }\varvec{\cdot }\varvec{j}_{\mathrm {q}}\,+\,r_{12} \varvec{\nabla }\varvec{\cdot }\left( \varvec{j}_{\mathrm {a},1} \,+\,\varvec{j}_{\mathrm {d},1} \right) \,+\,\sum _{i=1}^2 \varvec{\nabla }\left( c_{i} T \right) \varvec{\cdot }\left( \varvec{j}_{\mathrm {a},i} \,+\,\varvec{j}_{\mathrm {d},i} \right) } \right| . \end{aligned}$$

The variation of \(\delta \) is given in Fig. 15. It can be noted that this term contributes to the sum, at most, 0.25%. This simplifying hypothesis is therefore acceptable.

Fig. 15
figure 15

Verification of the assumption made in the derivation of the equations

5.2 Results and Discussion

The purpose is now to compare the numerical predictions with the experimental data. The experimental data are given at \(x \,=\,\left\{ 12.5, 25 \right\} \mathrm{mm}\). The numerical solution is obtained at this point using the exact interpolation by Eq. (21), also provided in the Maple™ supplementary file. The experimental facility is illustrated in Fig. 16. At the top of the material, an airflow is used to impose the temperature and relative humidity conditions. Due to this imposed airflow, it is supposed that there is an non-null velocity profile within the material. A probable profile of the velocity is shown in Fig. 16. However, the physical model does not take into account the momentum equation. Thus, the velocity is supposed to be constant and equal to its spatial average taken along the material height, as a first-order approximation. For each simulation, the velocity is estimated using an interior-point algorithm by minimizing the residual with the experimental data at each measurement point. Results are reported in Table 3. Figure 17a, b illustrate the variation of the vapor pressure at measurement points for a physical model considering only diffusion mechanism and another one taking into account both diffusion and advection phenomena. First, it can be noted that the model with only diffusion underestimates the adsorption phase and overestimates the desorption phase. By considering the advection transfer in the material, there is a better agreement between the experimental data and the numerical results. Similar conclusion can be drawn for the temperature evolution, shown in Fig. 18a, b. The model with diffusion and advection slightly overestimates the temperature at \(x \,=\,25\,\mathrm{mm}\). Using the interior-point optimization algorithm only for this measurement point, a lower velocity is estimated \(\mathsf {v}\,=\,2.5 \,\times \,10^{-3}\,{\mathrm{mm/s}}\). As illustrated in Fig. 18b, the numerical results have a better agreement with the experimental measurements. This analysis illustrates that considering the mass average velocity as constant in space is a first-order approximation as discussed in Wang (2000). In addition, the velocity may also vary in time. For instance, at \(t \,=\,10\,\mathrm{h}\), the numerical model overestimates vapor pressure, which might be explained by an overestimation of velocity. It should be remarked that considering this velocity, the Péclet number is of order \(\mathcal {O}(10^{-2}_,)\) for moisture transport, validating the hypothesis neglecting the dispersion effects in the moisture transport.

Fig. 16
figure 16

Illustration experimental facility

Table 3 Residual with experimental data and estimated velocity

However, some discrepancies still remain for the model considering both diffusion and advection mechanisms, particularly for the measurement point \(x \,=\,25\,\mathrm{mm}\), for \(t \in \left[ 28, 48 \right] \). As mentioned in James et al. (2010), these discrepancies may be due to the hysteresis effect on the moisture sorption curve. Therefore, the physical model has been improved by considering the hysteresis effect on the coefficient \(c_{m}\). The first approach considers only the adsorption and desorption curves illustrated in Fig. 14b. In control literature, it is referred as the bang–bang model. The second verifies a differential equation that is solved at the same time as the coupled heat and moisture problem and that enables smoother transition between both curves. The computation of the coefficient \(c_{m}\) for both approaches can be summarized:

$$\begin{aligned}&\text {Hysteresis model 1:}&c_{m} \,=\,{\left\{ \begin{array}{ll} c_{m}^{\mathrm {ads.}}, &{} \quad \frac{\partial \phi }{\partial t} \leqslant 0, \\ c_{m}^{\mathrm {des.}}, &{} \quad \frac{\partial \phi }{\partial t} \geqslant 0 . \end{array}\right. } \\&\text {Hysteresis model 2:}&\frac{\partial c_{m}}{\partial t} \,=\,\beta \cdot \mathrm {sign} \left( \frac{\partial \phi }{\partial t} \right) \cdot \left( c_{m} \,-\,c_{m}^{\mathrm {ads.}} \right) \left( c_{m} \,-\,c_{m}^{\mathrm {des.}} \right) , \\&{\mathrm {sign} \left( X\right) \,=\,{\left\{ \begin{array}{ll} 1, &{} \quad X > 0, \\ 0, &{} \quad X \,=\,0, \\ -1, &{} \quad X < 0. \end{array}\right. }} \end{aligned}$$

where \(c_{m}^{\mathrm {ads.}}\) and \(c_{m}^{\mathrm {des.}}\) are, respectively, the adsorption and desorption curves. These curves depend on the relative humidity \(\phi \) and are experimentally determined. Analytical functions of the experimental curves provided in James et al. (2010) and James (2009) are fitted. The coefficient \(\beta \) is a numerical parameter which controls the transition velocity between the two curves.

Fig. 17
figure 17

Evolution of the vapor pressure at \(x \,=\,12\,{\mathrm{mm}}\) (a, c) and \(x \,=\,25\,\mathrm{mm}\) (b, d)

The results of the implementation of two hysteresis models are illustrated in Fig. 17c, d. The first hysteresis model is not able to reduce the discrepancies. Indeed, the approach considering only the adsorption and desorption curves is too minimalist. The second hysteresis model provides a better agreement, particularly at \(x \,=\,25\,\mathrm{mm}\). Figure 19 shows the variation of the coefficients \(c_{m}\) that have been plotted as a function of the computed relative humidity. For the model without hysteresis, the coefficient varies along only one curve. The hysteresis model 1 switches between the adsorption and desorption curves without any interpolation and without ensuring the continuity of the physical characteristic. Since, the coefficient \(c_{m}\) is proportional to the derivative \(\frac{\partial w}{\partial \phi }\), a discontinuity in the variation of the coefficient is observed at \(\phi \,=\,0.7\). Moreover, the magnitude of the coefficient \(c_{m}\) in the model 1 is higher than for the other models, which explains the higher values of the vapor pressure shown in Fig. 17c, d for \(t \in \left[ 28, 48 \right] \). Oppositely, the variation of the coefficient is continuous for the second hysteresis model, while the derivative is discontinuous. For a numerical parameter \(\beta \,=\,0.02\), the numerical results have a satisfying agreement with the experimental data. The estimated velocity equals to \(\mathsf {v}\,=\,4.2 \,\times \,10^{-3}\,{\mathrm{mm/s}}\). The hysteresis effect does not show an important impact on the temperature residual as noticed in Table 3.

Fig. 18
figure 18

Evolution of the temperature at \(x \,=\,12\,\mathrm{mm}\) (a) and \(x \,=\,25\,\mathrm{mm}\) (b)

Fig. 19
figure 19

Evolution of the moisture capacity parameter \(c_{m}\) for different hysteresis models

5.3 Local Sensitivity Analysis

To compare the relative importance of each mechanism among moisture advection, diffusion and storage, a brief and local sensitivity analysis is carried out by computing the sensitivity functions \(\Theta \):

$$\begin{aligned}&\Theta _{k_{m}} \,=\,k_{m} \frac{\partial P_\mathrm{v}}{\partial k_{m}}, \quad \Theta _{c_{m}} \,=\,c_{m} \frac{\partial P_\mathrm{v}}{\partial c_{m}}, \quad \Theta _{\mathrm {Pe}_{m}} \,=\,\mathrm {Pe}_{m} \frac{\partial P_\mathrm{v}}{\partial \mathrm {Pe}_{m}}. \end{aligned}$$

The sensitivity function evaluates, as its name clearly indicates, the local sensitivity of the numerically computed vapor pressure field with respect to a change in the parameter. A small magnitude value of \(\Theta \) indicates that large changes in the parameter yield to small changes in the field. Here, it has been computed for the first order of material properties. Figure 20a, b show the time evolution of each sensitivity function. For the diffusion and advection parameters, the sensitivity increases during the transient regimes of the simulation and then decreases as the simulation reaches the steady state. It can be noted that both mechanisms have the same order of magnitude of sensitivity. Contrarily, the sensitivity to the moisture capacity parameter \(c_{m}\) has higher variations. Moreover, the magnitude is higher for the measurement point \(x \,=\,25\,\mathrm{mm}\). It indicates that the moisture capacity has higher impact on the vapor pressure. It is related to the fact that the simulation performed with the different hysteresis models have more impact on the measurement at this point, as noticed in Fig. 17d. This local sensitivity analysis highlights the importance of each mechanism among the advection and diffusion transfer, and the moisture storage, for this material and for the range of temperatures and relative humidities used in the experiments.

Fig. 20
figure 20

Sensitivity coefficients of parameters \(k_{m}\), \(c_{m}\) and \(\mathrm {Pe}_{m}\) at \(x \,=\,12.5\,\mathrm{mm}\) (a) and \(x \,=\,25\,\mathrm{mm}\) (b)

6 Conclusion

When comparing measurements to numerical simulations of moisture transfer through porous materials, discrepancies have been reported in several works from the literature (Busser et al. 2017; Berger et al. 2017). Indeed, the numerical model is built considering only diffusion transfer through porous materials as physical phenomenon. As a result, the simulation underestimates the adsorption process or overestimates the desorption process. One possible explanation is the absence of advection transfer in the governing equations. Therefore, this paper investigated the influence of the advection and diffusion transfer in a heat and moisture coupled model.

To solve efficiently the coupled advection–diffusion differential equations, an innovative numerical scheme, the so-called ScharfetterGummel, has been considered. This scheme has been proposed in 1969, for the first time for data analysis problems, and it is still studied theoretically (with the latest theoretical results from 2016). It has the advantages of being well-balanced and asymptotically preserving. In addition, the interpolation of the solution on any spatial point is given by an exact expression. The numerical efficiency has been first analyzed for nonlinear cases of a single scalar differential equation. Its accuracy has been validated with two analytical solutions and with a reference solution computed using the Chebfun package. The extension of the scheme for a system of weakly coupled differential equations has been proposed. Consequently, the numerical scheme and its implementation has been validated with a Chebfun reference solution for both linear and nonlinear cases. A parametric study of the discretization parameters \(\Delta t\) and \(\Delta x\) has also been carried out. As expected, the ScharfetterGummel scheme has a CFL stability condition. Nevertheless, the approach is particularly interesting when using large spatial discretization and an adaptive time step to enable important computational savings without losing the accuracy of the solution.

In Sect. 5, the numerical results have been compared to experimental data from James et al. (2010). An adsorption–desorption cycle is performed for a gypsum board material. The temperature and vapor pressure profiles within the material are provided. Comparative results between a purely diffusive and the improved mathematical models have been presented. The purely diffusive model underestimates the sorption phase and overestimates the desorption phase. With the improved advective–diffusive model, there is a better agreement between the numerical results and the experimental data. The momentum equation has not been taken into account in the physical model. Thus, a constant mass average velocity within the material porous structure has been estimated. Despite the inclusion of the advection transfer mechanism provides a better agreement with the experimental data, some of discrepancies still remain, particularly at the end of the desorption cycle, which might be due to the presence of hysteresis effects in the moisture capacity of the material. Thus, the model has been improved by adding also a third differential equation on the moisture capacity, enabling to interpolate between the adsorption and desorption equilibrium curves. This hysteretic diffusive–advective model provided the best results with a residual lower than 0.04 for the vapor pressure and \(1.4 \,\times \,10^{-3}\) for the temperature.

The estimated velocity has been discussed highlighting that the velocity may decrease with space and time. A constant velocity hypothesis remains as a first-order approximation. Further research is needed to include the momentum equation in the physical model to have a better calculation of the mass average velocity and hopefully provide better results in the comparison with the experimental data.