0% found this document useful (0 votes)
18 views24 pages

Buildings Conduction Published

Uploaded by

ISSA OMLE
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
18 views24 pages

Buildings Conduction Published

Uploaded by

ISSA OMLE
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 24

buildings

Article
A Comparative Study of Explicit and Stable Time Integration
Schemes for Heat Conduction in an Insulated Wall
Humam Kareem Jalghaf 1,2 , Issa Omle 1,2 and Endre Kovács 2, *

1 Department of Fluid and Heat Engineering, University of Miskolc, 3515 Miskolc, Hungary;
[email protected] (H.K.J.); [email protected] (I.O.)
2 Institute of Physics and Electrical Engineering, University of Miskolc, 3515 Miskolc, Hungary
* Correspondence: [email protected] or [email protected]

Abstract: Calculating heat transfer in building components is an important and nontrivial task. Thus,
in this work, we extensively examined 13 numerical methods to solve the linear heat conduction
equation in building walls. Eight of the used methods are recently invented explicit algorithms
which are unconditionally stable. First, we performed verification tests in a 2D case by comparing
them to analytical solutions, using equidistant and non-equidistant grids. Then we tested them on
real-life applications in the case of one-layer (brick) and two-layer (brick and insulator) walls to
determine how the errors depend on the real properties of the materials, the mesh type, and the time
step size. We applied space-dependent boundary conditions on the brick side and time-dependent
boundary conditions on the insulation side. The results show that the best algorithm is usually the
original odd-even hopscotch method for uniform cases and the leapfrog-hopscotch algorithm for
non-uniform cases.

Keywords: heat conduction; thermal insulation; explicit time-integration; unconditionally stable


numerical methods

Citation: Kareem Jalghaf, H.; Omle,


I.; Kovács, E. A Comparative Study of
Explicit and Stable Time Integration 1. Introduction
Schemes for Heat Conduction in an
Energy efficiency in the built environment can make great contributions to a sus-
Insulated Wall. Buildings 2022, 12,
tainable economy. Building sectors can potentially make significant reductions in energy
824. https://doi.org/10.3390/
consumption and thus in greenhouse gas emissions compared with other sectors. Heat
buildings12060824
transfer calculations in buildings are often performed for different applications such as heat
Academic Editor: Laura Galuppi loss and heat gain through the exterior envelope (heat conduction), interior environmental
Received: 18 May 2022
analyses, and material or building element-related problems [1].
Accepted: 10 June 2022
Conduction heat transfer problems relevant to buildings include exterior wall conduc-
Published: 14 June 2022 tion, interior mass conduction, conversion from heat gain/loss to cooling and heating load,
and ground heat loss from the slab-on-grade floor and basement walls. The wall conduction
Publisher’s Note: MDPI stays neutral
transient heat transfer responds to climatic effects, such as temperature fluctuation, solar
with regard to jurisdictional claims in
radiation, air convection, and so on. One of the most effective ways to improve the building
published maps and institutional affil-
energy efficiency and consumption is to improve the thermal insulation of the building
iations.
envelope and reduce the heat loss through walls [2].
Heat conduction through solid materials is described by a partial differential equation
(PDE), the so-called heat conduction equation or simply heat-equation, which is analo-
Copyright: © 2022 by the authors. gous to the diffusion equation. Analytical solutions, even new ones [3], exist for spatially
Licensee MDPI, Basel, Switzerland. homogeneous systems and most numerical methods are developed and tested by mathe-
This article is an open access article maticians also for these simple systems. Moreover, some analytical solutions are available
distributed under the terms and for one-dimensional multilayer problems as well, for both steady-state and transient condi-
conditions of the Creative Commons tions. These solutions are frequently used for heat gain and loss calculations for exterior
Attribution (CC BY) license (https:// envelopes and heat storage in interior structures [1]. However, most of the building heat
creativecommons.org/licenses/by/ conduction problems are multi-dimensional and transient, while the material properties
4.0/).

Buildings 2022, 12, 824. https://doi.org/10.3390/buildings12060824 https://www.mdpi.com/journal/buildings


Buildings 2022, 12, 824 2 of 24

such as the density and heat conductivity can widely vary in the system [4] (p. 15). Thus,
numerical computer simulation cannot be avoided.
There are lots of numerical methods to solve the heat conduction equation, such
as several finite difference schemes (FDM) [5–7], finite element methods (FEM) [8], or
a combination of these [9]. However, they can be computationally demanding since
they require the full spatial discretization of the examined system. If the eigenvalues of
the problem have a range of several orders of magnitude due to differences in material
properties, then the problem is rather stiff and the so-called Courant–Friedrichs–Lewy
(CFL) limit can be very small. This means that almost all explicit finite difference methods
are unstable when the time step size is larger than this small threshold. This problem will
also be demonstrated in the current paper. On the other hand, implicit methods work with
the whole system matrix, thus they can be extremely slow with huge memory usage when
the number of cells is large. Still, these methods are typically used for solving these kinds
of equations, see for example [10–16].
One can observe that the trend toward increasing parallelism in high-performance
computing is reinforced, since unfortunately the CPU clock frequencies nowadays increase
much slower than a few decades ago [17,18]. That is one of the reasons why we believe
that the importance of easily parallelizable explicit and unconditionally stable methods
is going to increase, even if currently not too many scholars work with them (see [19–26]
for examples).
During the last few years, our research group developed several explicit uncondi-
tionally stable methods to calculate heat conduction in arbitrary space dimensions [27–36].
Unconditional stability here means that the temperature remains finite (i.e., errors are not
amplified without bounds) for arbitrary time step size. These new methods either belong
to the family of FDMs or are similar to them. In those of our original papers, we tested
the algorithms under general circumstances using discontinuous random parameters and
initial conditions, and we have shown that they can provide quite accurate results, and
they are much faster than the professionally optimized MATLAB ‘ode’ routines. In this
paper, we perform systematic tests in the building walls by varying some parameters of the
system and the mesh to examine how the performance of the individual methods changes
and which of them is the best choice under different circumstances. We note that no com-
parative study has been conducted until now even about the four known explicit and stable
methods examined in this paper, namely the UPFD, odd-even hopscotch, Dufort-Frankel,
and rational Runge-Kutta methods (for the definitions, see the next section).
The outline of the paper is as follows: in Section 2, we present the studied system
with the equations, then briefly restate the algorithms, first for the simplest case (one
dimensional, equidistant mesh), then for a general, arbitrary mesh as well. In Section 3,
the results of the numerical tests are presented. First, in Section 3.1, we verify our code
in a 2D case by comparing the results to analytical solutions using one equidistant and
some non-equidistant grids. In Section 3.2, we include the insulator, while in Section 3.3
we apply more sophisticated boundary conditions. Finally, in Section 4, we summarize our
conclusions, e.g., the advantages and the disadvantages of the applied methods, and then
disclose our future research plans.

2. The Studied Problem and the Methods


2.1. The Equation and Its Discretization and the Materials
The simplest form of the heat equation which describes the phenomenon of conduction
of heat in the case of homogeneous media (typically considered by mathematicians) is the
linear parabolic PDE:
∂u
= α∇2 u. (1)
∂t
In more realistic circumstances, we can use a more general form:

∂u
cρ = ∇(k∇u), (2)
∂t
∂u
cρ =∇ ( k ∇u ) , (2)
∂t
  
where
Buildings 2022, 12, 824 k = k ( r ,t ) , c = c ( r ,t ) and ρ = ρ ( r ,t ) are the heat conductivity, specific heat, 3 of 24

and mass density, respectively, while α = k / (cρ ) is the thermal diffusivity. In the pre-
sent work, we take real material
k = k r , tproperties
, c = c r , as listed inρTable
r , t 1.
→  →  → 
where t and ρ= are the heat conductivity, specific heat,
and mass density, respectively, while α = k/(cρ) is the thermal diffusivity. In the present
Table 1. The properties of the materials used.
work, we take real material properties as listed in Table 1.

(
ρ Table
kg ⋅ m −3
) (
W ⋅ m −used.
k materials
1. The properties of the
1
⋅ K −1 ) c ( J ⋅ kg −1
⋅ K −1 )
Brick 1600 0.73
ρ (kg ·m−3 ) k(W·m−1 ·K−1 ) 800 c(J·kg−1 ·K−1 )
Glass wool 200 Brick 0.03
1600 0.73 800 800
Glass wool 200 0.03 800
As one can see in Figure 1, we considered a one-layer wall consisting of brick only
and two-layer walls consisting
As one canof
seebrick and1,glass
in Figure wool insulator.
we considered a one-layer wall consisting of brick only and
two-layer walls consisting of brick and glass wool insulator.

Figure 1. (A) One-layer wall, (B) and (C) wall with insulator.
Figure 1. (A) One-layer wall, (B) and (C) wall with insulator.
In case of Equation (1) in one dimension, we apply the most standard central differ-
ence formula
In case of Equation (1) in one dimension, we apply the most standard central differ-
u( xi+1 )−u( xi ) u( x )−u( x )
ence formula ∂2 ∆x + i−1∆x i ui−1 − 2ui + ui+1
u ( xi ) ≈ = ,
∂x2 ∆x ∆x2
u ( xi +1 ) − u ( xi ) u ( xi -1 ) − u ( xi )
+
∂ 2which is secondΔorder x in ∆x. Let Δus x now presentui -1 −the + ui +1
2ui discretization of Equation (2) based on
2
u ( xi ) ≈ = 2
,
∂xthe usual discretizationΔof x Equation (1). One canΔxfind more details about this procedure
in Chapter 5 of book [37] for the case of underground reservoirs. Let us suppose that α, k,
which is second order
c, andin Δx .quantities
ρ, the Let us now presentthethe
describing discretization
properties of Equation
of materials, (2) based
are functions of the space
(and time)of
on the usual discretization variables
Equationinstead of being
(1). One canconstants.
find moreExamine
detailsaabout
one-dimensional, equidistant
this procedure
in Chapter 5 of book [37] for the case of underground reservoirs. Let us suppose that α,difference
grid and discretize the second-order space derivatives by the standard central k,
formula, where k is a function of x and cannot be simply merged with c and ρ. Thus,
c, and ρ, the quantities describing the properties of materials, are functions of the space
we have
(and time) variables instead of being constants. Examine a one-dimensional, equidistant
grid and discretize the ∆x u(space
1 second-order xi + ∆xderivatives
) − u ( xi ) by the∆x u( xi − ∆x
standard central
) − u(difference
     
∂u xi )
c ( xi ) ρ ( xi ) = k xi + + k xi − .
∂t xi ∆x 2 ∆x 2 ∆x
Buildings 2022, 12, 824 4 of 24

We change now from node to cell variables, thus ui , ρi , and ci will be the (average)
temperature, density, and specific heat of cell i, respectively, while k i,i+1 will be the heat
conductivity between cell i and its (right) neighbor. The previous equation will have
the form
− ui − ui
 
dui 1 u u
= k i,i+1 i+1 + k i−1,i i−1 .
dt ci ρi ∆x ∆x ∆x
We turn to a non-equidistant grid with non-uniform cross section, which is still one-
dimensional. If the length and the (average) cross section of the cell is denoted by ∆xi
and Ai , we can write the distance between the center of the cell i and its neighbor j as
dij = ∆xi + ∆x j /2. The area of the interface between the two neighboring cells can be


approximated as Ai,i±1 ≈ Ai ≈ Ai±1 . Now one can write, more generally than in the
previous equation, that

u i +1 − u i u i −1 − u i
 
dui 1
= Ai,i+1 k i,i+1 + Ai,i−1 k i,i−1 .
dt ci ρi ∆xi Ai di,i+1 di,i−1

The volume and the heat capacity of the cell can be calculated as Vi = Ai ∆xi and
Ci = ci ρi Vi , respectively, while the thermal resistance between these neighboring cells can
be estimated as Rij ≈ dij /k ij Aij . If one uses these new quantities, the following expression
for the time derivative of each cell-variable is obtained:
dui u − u i u i +1 − u i
= i −1 + .
dt Ri −1, i Ci Ri +1, i Ci

This can be straightforwardly generalized further, thus the spatially discretized form
of Equation (2) with an arbitrary number of neighbors can be written as follows:

dui u j − ui
dt
= ∑ Ri,j Ci
. (3)
j 6 =i

This system of an ordinary differential equation can be used in the case of arbitrary
(e.g., unstructured) grids consisting of cells of various shapes and properties. Of course,
this kind of discretization can modify the spatial accuracy, but we will see during the
verification that the error due to this space discretization is still small.

2.2. Mesh Construction


We considered a piece of wall with volume 1 m × 1 m × 1 m. However, no physical
quantities are changing in the y-direction (perpendicular to the surface of Figures 1 and 2),
thus that dimension is irrelevant. It means we deal only with a cross-section, which is a two-
dimensional problem from the mathematical point of view and thus we can use ∆yi = 1.
So, we constructed several meshes of size 1 m2 , which means ( x, z) ∈ [0, 1] × [0, 1]. The
shape of the cells is square in the equidistant mesh and rectangular in the non-equidistant
meshes. The heat capacity of the cells can be given as Ci = ci ρi ∆xi ∆zi , while the thermal
resistance in the x-direction has the approximate formula Rxi ≈ k∆x i
, where Axi is the
i Axi
surface element perpendicular to x. Since now it can be given as Axi = ∆yi ∆zi = ∆zi , the
horizontal and vertical resistances can be given in case of a homogeneous material and
uniform mesh as
∆xi ∆zi
Rxi ≈ and Rzi ≈ ,
k i ∆zi k i ∆xi
respectively. If the material properties or the sizes of the two neighboring cells are different,
we can write for the resistance between cells i and i + 1 that
∆xi ∆xi+1
Rxi ≈ + ,
2k i ∆zi 2k i+1 ∆zi+1
and uniform mesh as
Δx i Δz i
Rx i ≈ and Rz i ≈ ,
k i Δz i k i Δx i
respectively. If the material properties or the sizes of the two neighboring cells are
Buildings 2022, 12, 824 5 of 24
different, we can write for the resistance between cells i and i + 1 that
Δxi Δxi+1
Rxi ≈ + ,
2kiΔzi 2ki+1Δzi+1
and if the cell j is below the cell i, we have
and if the cell j is below the cell i, we have
∆x Δx ∆x
Δxjj
Rzi ≈Rzi ≈ i i++
2k i ∆z 2kj ∆z
2kiiΔzi 2k j Δzjj
for vertical
for the the vertical resistance.
resistance.

Figure
Figure2.2.(A)
(A)Abrupt
Abrupt change.
change. (B) Gradual
Gradualchange
changeininthe
thex xdirection.
direction.

WeWeapply
apply anan equidistant
equidistant gridgridand andsomesomenon-equidistant
non-equidistant grids
gridsto to
discretize
discretizethethespace
space
variables in both the one layer and the multilayer cases. The
variables in both the one layer and the multilayer cases. The cell number along axis cell number along axis x isx is
settotoNNxx==100.
set 100.Similarly,
Similarly, the
the cell
cell number
numberalong alongaxis axisz zis isNzN=z =100, except
100, exceptin in
Section
Section3.3 3.3
where Nx = Nz = 80. Thus, we have a grid with a total cell number N = Nx Nz = 10,000
where N x = N z = 80 . Thus, we have a grid with a total cell number N = N x N z = 10000
(and N = 6400 in Section 3.3). We have to note that the temperature in the middle of the
(and N =considered
cell was 6400 in Section 3.3). We have
the temperature of theto cell.
note However,
that the temperature
we are going into
theusemiddle
Dirichletof the
cell was considered the temperature of the cell. However, we
boundary conditions to reproduce an analytical solution, therefore the boundary of the are going to use Dirichlet
boundary
system shouldconditions
be in theto middle
reproduceof theancells
analytical
belonging solution, thereforeThis
to the boundary. the issue
boundary of the
is solved
system shouldthe
by increasing be in the
size ofmiddle
the cells,ofso
the
incells belonging
the case to the boundary.
of an equidistant grid andThisNx = issue
Nz = is solved
100,
by have ∆x =the
weincreasing ∆zsize of theinstead
= 0.0101 cells, soof in the
just case of an equidistant grid and N x = N z = 100
0.01.
, we haveWe also
Δx wanted
= Δ z = 0 .to consider
0101 instead wide
of cells on the left side of the wall and small ones on
just 0.01.
the right
We also wanted to consider wide cells this
side of the wall. We implemented in two
on the left different
side of the ways.
wallInandcase of abrupt
small ones on
used an equidistant coarse mesh ∆x =
the right side of the wall. We implemented this in two different ways. In case and
change, we 0.0105 at the left 50% of the cells, an
of abrupt
equidistant fine mesh ∆x = 0.0097 at the right side.
change, we used an equidistant coarse mesh Δ x = 0 .0105 at the left 50% of the cells, and
For a gradual change, the width of the cells were decreased as a geometric series as
an equidistant fine mesh Δ x = 0 .0097 at the right side.
follows. For r 6= 1, the sum of the first n + 1 terms of a geometric series, up to and including
For a gradual change, the width of the cells were decreased as a geometric series as
the rn term, is
follows. For r ≠ 1 , the sum of the first n + 1 terms ofna geometric  series, up to and including
1 − r n +1

the r term, is a + ar + ar + ar + . . . . . . + ar = ∑ ar = a
n 2 3 n k
k =0
1−r

We used r = 0.98, n = Nx − 1, and a = 0.0234. This means that on the left side
∆x1 = 0.0234 and it is gradually decreased to ∆x Nx = 0.9899 · ∆x1 = 0.00317. The same
abrupt and gradual change can be implemented in the z-direction.
In the multilayer case, the left 50% of the cells were always brick and the right 50%
were insulator. It implies that, if the mesh is equidistant, the volume of the brick and the
insulator is the same as in Figure 1C. However, if we have abrupt or gradual change in the
x-direction, the thickness of the insulator is smaller, similar to the case in Figure 1B.
Buildings 2022, 12, 824 6 of 24

We always use equidistant temporal discretization with time step size ∆t, and uin
denotes the temperature of cell i at time moment n∆t.

2.3. The Initial and the Boundary Conditions


We applied different initial and boundary conditions for both the one layer and the
multilayer cases as follows:
I. Sinusoidal initial condition with zero Dirichlet boundary condition.
The initial condition is the product of two sine functions:

u( x, z, t = 0) = sin(πx ) sin(πz). (4)

The simplest zero Dirichlet boundary conditions are used:

u( x = 0, z, t) = u( x = 1, z, t) = u( x, z = 0, t) = u( x, z = 1, t) = 0. (5)

Anyone can easily check that the analytical solution to this problem is
2
u( x, z, t) = sin(πx ) sin(πy)e−2π t , (6)

valid only in homogeneous material, i.e., in a one-layer wall.


II. Linear initial condition with combined boundary conditions.
The initial condition is a linear function of the z variable:

u( x, z, t = 0) = 30 − 15z.

Neumann boundary condition at the top and bottom of the wall, meaning thermal
isolation:
uz ( x, z = 0, t) = uz ( x, z = 1, t) = 0.
Space-dependent temperature at the left boundary:

u( x = 0, z, t) = 30 − 15z.

Time-dependent temperature at the right boundary:

u( x = 1, z, t) = u( x = 1, z = 0, t = 0) · eλt ,

where λ = 0.00004. Since the final time was 10,000, it means that the temperature at the
right boundary is gradually increased from 30 ◦ C to 44.75 ◦ C.
We note that in case II we chose such complicated boundary conditions to demonstrate
that the methods perform well even in these cases.

2.4. The Applied Numerical Methods


In this section, we give essential information about the algorithms. We first present
their formula for the simplest case (one dimensional, equidistant mesh, Equation (1)),
then immediately for a general, arbitrary mesh as well. The simplest form is useful for
comparison purposes, since numerical schemes are given in this form in most textbooks on
numerical methods. The more general forms are necessary because we use only them in
this work.
α∆t
We introduce the usual mesh-ratio r = ∆x 2 for the 1D equidistant mesh, e.g., for
Equation (1). On the other hand, for the case of the general mesh, we introduce the
following notations
1 unj
ri = ∆t ∑ and Ai = ∆t ∑ . (7)
CR
j6=i i ij
CR
j6=i i ij
Buildings 2022, 12, 824 7 of 24

The first quantity is the generalization of r (defined above), while the second one
reflects the state and the effect of the neighbors of cell i as well.
1. The constant neighbor (CNe) method [28,38] for Equation (1) is:

uin−1 + uin+1  
uin+1 = uin · e−2r + 1 − e−2r
2
While for general grids it is:

Ai
uin+1 = uin · e−ri + 1 − e −ri

ri

To proceed, let us recall that the following general time discretization

uin+1 − uin α h n n n
 
n +1 n +1 n +1
i
= θ u i −1 − 2u + u + ( 1 − θ ) u − 2u + u ,
∆t ∆x2 i i +1 i −1 i i +1

implies the so-called theta method:


h  i
uin+1 = uin + r θ uin−1 − 2uin + uin+1 + (1 − θ ) uin−+11 − 2uin+1 + uin++11 ,

(8)

where θ ∈ [0, 1]. For θ = 0, 12 , and 1 one has the (standard) implicit Euler, the Crank–
Nicolson, and the explicit Euler (FTCS) schemes, respectively [39]. If θ < 1, the theta
method is implicit. It can be modified to be explicit by taking the neighbors into account at
the old time level, where their values are already calculated. Thus, one can insert uin±1 into
the theta-scheme (8) instead of uin±+11 to obtain

uin+1 = uin − 2rθuin − 2r (1 − θ )uin+1 + r uin−1 + uin+1 .




With this modification, the final formula is completely explicit:


 
(1 − 2rθ )uin + r uin−+11 + uin++11
uin+1 = . (9)
1 + 2r (1 − θ )

2. The UPFD method is the theta-method (9) for θ = 0. In the case of Equation (1), it
reads as follows:

uin + r uin−1 + uin+1



uin+1 = , (10)
1 + 2r
and the general form for Equation (2) or (3) is:

uin + Ai
uin+1 = . (11)
1 + 2ri

3. If we would like to apply an odd-even hopscotch method, we need a bipartite grid,


where all the nearest neighbors of the odd cells are even and vice versa. In the original
odd-even hopscotch (OOEH) method [40], the standard explicit Euler formula was
applied in the first stage and the implicit Euler formula was applied in the second
stage, as is shown in Figure 3. The special and the general formulas are the following:

Explicit Euler : uin+1 = (1 − 2r )uin + r uin−1 + uin+1 and uin+1 = (1 − ri )uin + Ai .




 
uin + r uin−+11 + uin++11 uin + Anew
Implicit Euler : uin+1 = and uin+1 = i
,
1 + 2r 1 + ri
1+

Buildings 2022, 12, 824 where Ainew is calculated in the same way a 8 of 24

temperatures, which make the implicit formu


where Anew
i is calculated in the same way as Ai in (7), but using the new values of the
temperatures, which make the implicit formula effectively explicit.

Figure 3. Space-time structure of the hopscotch (OOEH) method.

Figure 3.see,Space-time
As we will structure
this is a powerful explicit method, but of the
in stiff cases,hopscotch
its error can be (O
extremely large [32].
4. The reversed odd-even hopscotch method (ROEH) applies the formulas of the OOEH

As we will see, this is a powerful explic


method in the opposite order. However, since the new values of the neighbors are not
known when first-stage calculations begin, the implicit formula can be applied only
with a trick, which is that of the UPFD method, see Formulas (10) and (11). Obtaining
extremely large [32].
the code of this method is easy, since one only needs to change the order of the two
formulas in the code of the original OOEH. We showed that this method produces

4.
5. The reversed odd-even hopscotch metho
much smaller errors in the case of very stiff systems than the OOEH method [32].
The next method is the two-stage linear-neighbor (LNe or LNe2) method [38]. It is
pred

validmethod in time
thestep.opposite
Using them we can order. Howeve
based on the CNe method, which is used as a predictor to calculate new u ivalues
at the end of the actual calculate slopes.

not known s =
i
r 
∆t 2
uwhen
pred
+u
i −1 −first-stage
pred
u
i +1 −un
i −1

n
i +1 calculation
only with a trick, which is that
and then the corrector values for the two-stage LNe method:
of the UP
n n −2r
u +u ∆t 1−e2
  
taining
un +1
i = u e the
n −2r
i +
2code of this
i −1 i +1
1−e −2r
+s
2r method
1− i
2r
. is easy,
the two formulas in the code of the or
produces much smaller errors in the case
[32].
Buildings 2022, 12, 824 9 of 24

For the general case,


pred
uj
Anew
i = ∆t ∑ , (12)
j 6 =i
Ci Rij

with which we can make the corrector step as follows:

Anew − Ai 1 − e −ri Anew − Ai


 
uin+1 = uin e−ri + Ai − i
+ i . (13)
ri ri ri

6. The values given in Equation (13) can be used to recalculate Anewi again, which makes
sense to repeat (13) to obtain new results. In this case, we have three stages altogether,
thus the method is called the LNe3 method [38]. This algorithm is still second order,
but more accurate than LNe2.
7. The CpC algorithm [35] generally starts with a fractional time step with length p∆t,
but here we take p = 12 , because this version usually has better accuracy than for other
values of p. So, in the first stage, we calculate new predictor values of the variables
with the CNe formula, but with a ∆t1 = ∆t/2 time step:

pred uin−1 + uin+1 pred A  


= uin · e−r + 1 − e−r and ui = uin e−ri /2 + i 1 − e−ri /2 .

ui
2 ri

In the second stage, we can use (12) with ∆t1 and take a full-time step size corrector
step using the CNe formula again. Thus, the final values at the end of the time step are
pred pred
−2r
u i −1 + u i +1   Anew
uin+1 uin 1 − e−2r and uin+1 = uin · e−ri + i 1 − e −ri

= ·e +
2 ri

8. Heun’s method, also called explicit trapezoidal rule, may be the most common second-
order RK scheme [41]. It starts with an explicit Euler stage as a predictor:
pred pred
= (1 − 2r )uin + r uin−1 + uin+1 and ui = (1 − ri )uin + Ai ,

ui
then, using the average of the obtained and the old values a corrector-step follows:
pred pred

pred
 un + ui−1 + uin+1 + ui+1
uin+1 = uin − r uin + ui + r i −1
2
and
pred
uin + ui Ai + Anew
uin+1 = uin − ri + i
.
2 2
9. In the case of the pseudo-implicit (PI) method, we took Algorithm 5 from [36] in
the case of the pure heat equation with parameter setting λ = 1, which gives the
following two-stage algorithm for the special case:

uin + 2r uin−1 + uin+1



pred
Stage 1 : ui =
1+r
 
pred pred
(1 − r )uin + r ui−1 + ui+1
Stage 2 : uin+1 =
1+r
For a general grid, we have
uin + Ai ∆t unj
2 ∑
pred
Stage 1 : ui = , where Ai =
1 + ri CR
j6=i i ij
Buildings 2022, 12, 824 10 of 24

pred
(1 − ri )uin + Anew uj
Stage 2 : uin+1 = i
, where Anew
i = ∆t ∑ .
1 + ri CR
j6=i i ij

10. The Dufort–Frankel (DF) algorithm can be obtained from the so-called leapfrog explicit
scheme by a modification [42] (p. 313). It is a known explicit unconditionally stable
scheme that has the formula in the special and general case:

(1 − 2r )uin−1 + 2r uin−1 + uin+1 (1 − ri )uin−1 + 2Ai



uin+1 = and uin+1 = .
1 + 2r 1 + ri

As one can see, it is a one-stage but two-step method (the formula contains uin−1 ),
which is not self-starter, so another method must be applied to start the method by the
calculation u1i . For this purpose, we apply the UPFD formula twice (with halved time
step size).
11. Rational Runge-Kutta methods are a family of nonlinear methods, which means that
the new uin+1 values are not the linear combinations of the old uin values. We chose a
two-stage version [43] defined as follows. The first stage is a full step by the explicit
Euler (FTCS) to obtain the predicted value:

gi1 = r uin−1 − 2uin + uin+1 and gi1 = −ruin + Ai



pred
ui = uin + gi1
Then, the increment of a repeated Euler-step is calculated, using the predictor values
obtained above:
 
pred pred pred pred
gi2 = r ui−1 − 2ui + ui+1 and gi2 = −ri ui + Anew
i

If we introduce the scalar products, which are common for the cells, they need to be
calculated only once in a time step, thus we can write
  N   N   N
→1 →1 →1 →2 →2 →2
p1 = g ,g = ∑ gi1 gi1 , p12 = g ,g = ∑ gi1 gi2 , p2 = g ,g = ∑ gi2 gi2 ,
i =1 i =1 i =1

we then obtain the final expression for the new variables:

2p1 gi1 − 2p12 gi1 + p1 gi2


uin+1 = uin + .
4p1 − 4p12 + p2

12. In the shifted-hopscotch (SH) method [33], we have a repeating block consisting of
five stages, which corresponds to two half and three full-time steps, which altogether
span two time steps for odd as well as even cells, as one can see in Figure 4A. The
calculation starts with a half-sized time step for the odd cells which is symbolized
by a light blue box with the number 1 in the figure. Then, a full-time step for the
even, the odd, and the even cells follows again. Finally, a half-size time step for the
odd cells closes the calculation of the values. In our original work [33] we used the θ
Formula (9)
 
µ µ+ 21 µ+ 12
(1 − 2rθ )ui + r ui−1 + ui+1
µ +1
ui = , (14)
1 + 2r (1 − θ )
and (in the general case),
µ
µ +1 (1 − r i θ ) u i + A i
ui = . (15)
1 + r i (1 − θ )
OR PEER REVIEW 11 o
Buildings 2022, 12, 824 11 of 24

Figure 4. (A) The shifted-hopscotch structure. (B) The leapfrog-hopscotch structure.


Figure 4. (A) The shifted-hopscotch structure. (B) The leapfrog-hopscotch structure.
In this paper, we use only the combination already proven to be the best (S4 in [33]),
which means θ = 0 is used at the first, θ = 1 at the fifth, and θ = 12 in all other stages. The
In this paper, we
upper usecontaining
index only the combination
µ means already
that always the proven
latest available toare
values beused
thewhen
bestthe
(S4
in [3
which means θ = 0 is used at the first, θ = 1 at the fifth, and θ =
new values of u are calculated, regardless of the size of the time step. 1in all other sta
2
13. Finally, in the leapfrog-hopscotch (LH) method [34] we have a structure consisting of
The upper index containing
two half andµ means
several thatsteps.
full time always the latest
The calculation available
starts values
again by taking are used w
a half-sized
time step for the odd nodes using the initial values, then, for the even and odd nodes,
the new values of u are calculated, regardless of the size of the time step.
full-time steps are taken strictly alternately until the end of the last timestep (orange
13. Finally, in the box leapfrog-hopscotch
in Figure 4B), which should(LH)bemethod
halved for [34] we have
odd nodes to reacha the
structure
same finalconsis
time point as the even nodes. In this paper, we used only the best already proven
of two half and several full time steps. The calculation starts again by taking a h
combination of formulas (L2 in [34]), which means that θ = 0 and θ = 21 are applied
sized time stepinfor the odd
Formulas nodes
(14) and (15) atusing
the first the initial
and at values,
all other time steps,then, for the even and
respectively.
nodes, full-time Thesteps
CNe and are
thetaken strictlyarealternately
UPFD methods first order whileuntil themethods
all other end ofarethe last time
second
order in time step size. All the methods used, except, of course, Heun’s method, are uncon-
(orange box in Figure 4B), which should be halved for odd nodes to reach the sa
ditionally stable for the linear heat conduction equation, i.e., the previously mentioned CFL
final time point
limit is as
not the even
relevant nodes.
for them. Inhowever,
This, this paper,
does notwemeanused only
they are theaccurate.
always best already
Actu- pro
combination of formulas (L2 in [34]), which means that θ = 0 and θ = 1 are
ally, the price of unconditional stability is conditional consistency, which means that spatial
mesh refinement with a constant time step size yields worsening accuracy (in contrast 2
to worsening stability properties as in mainstream methods), which is examined analyti-
plied in formulas (14) and (15) at the first and at all other time steps, respectively
cally and numerically in our previous papers [44] and [35], respectively. In Section 3.2 we
The CNe and the UPFD
will show examplesmethods are first order
when the conditionally whilemethod
stable Heun’s all other methods
is significantly moreare sec
accurate for small time step sizes than our methods. We emphasize again that very few
order in time step size.
explicit All the
methods methods used,
are unconditionally stable,except, of course,
e.g., no explicit Heun’s
Runge-Kutta methodmethod,
can be are
conditionally stable for
A-stable the
[45] (p. linear
60). heat conduction equation, i.e., the previously mentio
CFL limit is not relevant for them. This, however, does not mean they are always accur
Actually, the price of unconditional stability is conditional consistency, which means
spatial mesh refinement with a constant time step size yields worsening accuracy (in c
trast to worsening stability properties as in mainstream methods), which is examined
alytically and numerically in our previous papers [44] and [35], respectively. In Sec
Buildings 2022, 12, 824 12 of 24

3. Results
We define the (global) error as the largest absolute difference between the reference
temperature uref
i and the temperature ui
num obtained by the studied numerical method at

tfin = 10,000(s), which is the end of the examined time interval:

MaxError = max uref num


i ( tfin ) − ui (tfin ) . (16)
1≤ i ≤ N

The reference solution is either the analytical solution (6) of the PDE or a numerical
solution obtained by applying Heun’s method with an extremely small time step size
∆t = 0.002. We have chosen Heun’s method for reference because this is the most widely
tested algorithm among the examined methods.
If the grid is not uniform, it makes sense to calculate the so-called energy error:

Error( Energy) = ∑ Cj uref num


j ( tfin ) − u j (tfin ) , (17)
1≤ j ≤ N

where C is the heat capacity defined in Sections 2.1 and 2.2. This tells us how much energy
in the system is not in the proper cell.
For a given problem, spatial mesh, and method, the error is a function of the time step
size. We start with a very large time step size ∆t, calculate the error and then decrease
∆t by a factor of two until reaching small error values to comprehensively investigate the
behavior of the methods.
For the simulations where running times are measured, we used a desktop computer
with an Intel Core i7-11700 CPU and 64 GB RAM with the MATLAB R2020b software.

3.1. Verification Using the Analytical Solution


We simulated a one-layer brick wall (see Figure 1A). As it is written in point I above,
we applied sinusoidal initial temperature distribution (4) and zero Dirichlet boundary
condition (5) using the analytical solution (6) at tfin = 10,000(s). We made the simulations
in all the possible six cases, which are the following:
(a) Equidistant mesh.
(b) Abrupt change in the x-direction, equidistant mesh in the z-direction.
(c) Abrupt change in both x and z directions.
(d) Gradual changing in x-direction, equidistant mesh in z-direction.
(e) Gradual changing in both x and z directions.
(f) Abrupt change in x-direction, gradual changing in z-direction.
The obtained results are very similar for all the cases and the residual error (the error
for very small time step sizes due to space discretization) is below 10−4 . This means
that the codes for equidistant and non-equidistant meshes are successfully verified. In
Figures 5 and 6, the errors as a function of the time step sizes are presented in log-log
diagrams for cases (a) and (f), respectively. One can see that the UPFD and the CNe
methods are first order while the others are second order in the time step size, as is
expected. Note that the hopscotch algorithms, especially the original OOEH, are more
accurate than the other algorithms. The Heun’s method is quite accurate once we are below
the CFL limit, but above this limit it produces no meaningful results. In Figures 7 and 8,
the errors as a function of the running times are presented for the same cases. To reduce
the effect of the fluctuations in running time measurements, we averaged out the running
times of five different runs. As we expected, the differences of the running times for a fixed
time step size are mostly caused by the different number of stages, e.g., the LNe3 method
consists of three stages and therefore its curve is shifted slightly to the right relative to all
other methods in Figures 7 and 8.
Buildings 2022, 12, x FOR PEER REVIEW 13 of

Buildings
Buildings2022,
2022,12,
12,x824
FOR PEER REVIEW 13 of1324of 24

Figure 5.The
5.
Figure 5. Themaximum
The maximum
maximum errors
errors
errors aas
asas a function
a function
function of of of
thethethe time
time
time step
step ∆t size
step
size
size for Δ13
Δ tthefor
t the
for13
the 13methods
examined
examined
examined in metho
methods
in
thethe case
case
case of an
anequidistant
ofequidistant
of an equidistantmesh.
mesh. mesh.

Figure 6. The maximum errors as a function of the time step size Δ t for the abrupt change in the
x-direction and gradual change in the z-direction.
Figure 6.6.The
Figure Themaximum
maximum errors
errorsas aasfunction of the
a function oftime
the time step∆tsize
step size Δ t abrupt
for the change
for the in change
abrupt the in th
x-direction and gradual change in the z-direction.
x-direction and gradual change in the z-direction.
Buildings 2022,
Buildings 2022, 12,
12, xx FOR
FOR PEER
PEER REVIEW
REVIEW 14 of
14 of 24
24
Buildings 2022, 12, 824 14 of 24

Figure 7.
Figure 7. The
7. The maximum
The maximumerrors
maximum errorsasas
errors asa aafunction
function
function of
ofof the
the running
running
the time
time
running for
forfor
time the
thethe 13 examined
examined
13 examined
13 methods
methods in the
in the
methods in the
case of
case of an
of an equidistant
an equidistantmesh.
equidistant mesh.
mesh.

Figure 8.
Figure 8. The maximum
8. The
The maximum errors
maximum errors
errors asas aaa function
as function of
function of the
of therunning
the runningtime
running timefor
time forthe
for theabrupt
the abruptchange
abrupt changeinin
change inthe
the x-
the x-
direction
x-directionand
andgradual
gradualchange
change in
in the z-direction.
z-direction.
direction and gradual change in the z-direction.
3.2. Brick Wall with Insulation, Dirichlet Boundary Conditions
3.2. Brick
3.2. Brick Wall
Wall with
with Insulation,
Insulation, Dirichlet
Dirichlet Boundary
Boundary Conditions
Conditions
We applied the sinusoidal initial and Dirichlet boundary condition of the point I for
We applied
We applied the
the sinusoidal
sinusoidal initial
initial and
and Dirichlet
Dirichlet boundary
boundary condition
condition of the
the point
point II for
for
the multilayer wall with tfin = 10,000. As it was mentioned above, the referenceof solution was
the
the multilayer
multilayer
provided wall with
wall
by Heun’s with ttfin
method. =The
fin = 10,000.
10,000. As
errorsAs itplotted
it
are was mentioned
was mentioned above,and
above,
for equidistant thenon-equidistant
the reference solution
reference solution
was
was provided
meshprovided by Heun’s
in Figuresby9 Heun’s
and 10. Wemethod.
method. The errors
The errors
also plotted are plotted for
are temperatures
the final equidistant
plotted for equidistant and non-equidis-
andhorizontal
in the middle non-equidis-
tant mesh
tant mesh inin Figures
Figures 99 and
and 10.10. WeWe also
also plotted
plotted the
the final
final temperatures
temperatures in in the
the middle
middle hori-
hori-
zontal line of the wall for the reference solution and also for the LH method with quite aa
zontal line of the wall for the reference solution and also for the LH method with quite
Buildings
Buildings 2022,
2022, 12,
12, xx FOR
FOR PEER
PEER REVIEW
REVIEW 15
15 of
of 24
24
Buildings 2022, 12, 824 15 of 24

large
large time step size in Figure
Figure 11. One
One can now visualize the effect of
of the insulator (slower
line oftime stepfor
the wall size
theinreference 11.
solution can
and now visualize
also for the LH the effect
method with the insulator
quite (slower
a large time
decrease
decrease of the temperature) and also see that the LH method is accurate for this large
step size inofFigure
the temperature)
11. One can now and visualize
also see the
thateffect
the LH method
of the is accurate
insulator for thisof
(slower decrease large
time
time step
step size.
size.
the temperature) and also see that the LH method is accurate for this large time step size.

Figure
Figure 9. The
Figure 9. maximum
Themaximum errors
errorsasas
maximumerrors asa afunction
a functionofof
function the
the
of time
time
the step
step
time size
size
step size ΔΔttequidistant
∆t for for
for equidistant
mesh.mesh.
equidistant mesh.

10. The LL∞


The ∞ errors
Figure 10. The
Figure
Figure 10. errors as
as aa function
function of
of the
the time
time step size ∆t
step size Δtinincase
caseofofabrupt
abruptchange
changeininthe
the x-
∞ errors as a function of the time step size Δt in case of abrupt change in the x-
x-direction
direction and gradual change in the z-direction.
direction and
and gradual
gradual change
change inin the
the z-direction.
z-direction.
Buildings 2022, 12, x FOR PEER REVIEW
Buildings 2022, 12, 824 16 of 24

Figure 11. The temperature as a function of the cell index in the x direction at the middle row (z ≈ 0.5)
Figure 11. The temperature as a function of the cell index in the x direction at the mid
in the case of the reference solution (Ref) and the leapfrog-hopscotch (LH) method for ∆t = 400 in
(z ≈case
the )
0.5of the
inone-layer
the casewall
of the reference
and the insulatedsolution
wall using (Ref) and the grid.
an equidistant leapfrog-hopscotch (LH) met
Δ t = 400 in the case of the one-layer wall and the insulated wall using an equidistant grid
One can see that now there are no residual errors. The reason for this is that the
reference solution uses the same space discretization as the examined methods, thus this
errorOne can see
disappears that
when thenow thereofare
difference theno residual
solutions errors. The
is calculated as in reason
Equationfor this is that
(16).
erence We solution uses
observed that theapply
if we samethe space
insulatordiscretization as themesh
or go from equidistant examined methods, th
to increasingly
non-equidistant meshes (both increase the stiffness), the OOEH method
error disappears when the difference of the solutions is calculated as in Equation ( loses its advantage
and the LH method will be the most accurate among the unconditionally stable methods.
We observed that if we apply the insulator or go from equidistant mesh to i
On the other hand, for very small time step sizes, Heun’s method is extremely accurate.
ingly non-equidistant
However, meshesis(both
this extent of accuracy increase
redundant the stiffness),
in building energeticstheand OOEH
in mostmethod
other loses
vantage and the LHActually,
fields of engineering. methodthis will be of
is one thethemost accurate
definitions among“The
of stiffness: the step
unconditionally
size is
methods. Onstability
dictated by the the other hand,rather
requirements for very small
than the time
accuracy step sizes,
requirements” Heun’s
[46]. method
We stress again is ext
that this quoted sentence holds for the mainstream explicit methods,
accurate. However, this extent of accuracy is redundant in building energetics but it is not valid for and i
the unconditionally stable methods, as one can see in the figures.
other fields of engineering. Actually, this is one of the definitions of stiffness: “The s
is3.3.
dictated
Realisticby thewith
Case stability requirements
Nontrivial rather than the accuracy requirements” [46]. We
Boundary Conditions
againInthat this quoted
this subsection, sentence
the initial holds
condition is a for the
linear mainstream
function explicit
of space, while methods, but i
the boundary
conditions are complicated as it is written in point II. The Neumann
valid for the unconditionally stable methods, as one can see in the figures. boundary conditions
for upper and lower boundaries are implemented by setting the appropriate resistances to
infinity, implying that the matrix elements describing heat transfer through the boundary
3.3. Realistic Case with Nontrivial Boundary Conditions
vanish. First, we perform the simulation for the one-layer wall for two different grids
In thisand
(equidistant subsection, the initial
gradual change in bothcondition
directions),isand
a linear function
only then of space,wall.
for the insulated while the
In Figure 12, we present the maximum errors for a one-layer wall
ary conditions are complicated as it is written in point II. The Neumann boundarywith the equidistant
mesh, while the temperature distribution contour is shown in Figure 13. For the non-
tions for upper and lower boundaries are implemented by setting the appropr
equidistant mesh, the maximum errors and the energy-errors are presented in
sistances
Figures 14 toandinfinity, implying
15, respectively. Thethat the matrix
maximum and theelements describing
energy error heatvery
curves behave transfer th
the boundary
similarly, the most vanish. First,
significant we perform
change is that nowthethesimulation for the one-layer
SH method performs wall for t
better in terms
of energy than the DF and the OOEH methods.
ferent grids (equidistant and gradual change in both directions), and only then
insulated wall.
In Figure 12, we present the maximum errors for a one-layer wall with the equi
mesh, while the temperature distribution contour is shown in Figure 13. For the no
distant mesh, the maximum errors and the energy-errors are presented in Figures
15, respectively. The maximum and the energy error curves behave very simila
most significant change is that now the SH method performs better in terms of
than the DF and the OOEH methods.
Buildings 2022, 12, x FOR PEER REVIEW

Buildings 2022, 12, x FOR PEER REVIEW 17


Buildings 2022, 12, 824 17 of 24

Figure 12. The L∞ errors as a function of the time step size Δt for the equidistant mesh.
Figure 12. The L∞ errors as a function of the time step size ∆t for the equidistant mesh.
Figure 12. The L∞ errors as a function of the time step size Δt for the equidistant mesh.

Figure 13. The temperature distribution contour for the equidistant mesh at the final time.
Figure 13. The
Figure 13. Thetemperature
temperaturedistribution
distributioncontour
contour
forfor
thethe equidistant
equidistant mesh
mesh at the
at the finalfinal time.
time.
Buildings 2022, 12, x FOR PEER REVIEW

Buildings 2022, 12, x FOR PEER REVIEW 18 o


Buildings 2022, 12, 824 18 of 24

Figure 14. The L∞ errors as a function of the time step size Δ t for the non-equidistan
Figure 14.
Figure TheL∞L∞
14. The errors as a as
errors function of the of
a function time step
the ∆t for
sizestep
time Δt for the non-equidistant
the non-equidistant
size mesh. mesh

Figure 15. The energy errors defined in (17) as a function of the time step size Δt for the n
15. The
Figure 15.
Figure Theenergy errors
energy defined
errors in (17) as
defined in a(17)
function
as aoffunction
the time step ∆t forstep
size time
of the size Δt fo
the non-
equidistant mesh.
equidistant mesh.
equidistant mesh.
Let usnow
Let us nowshow
showthethe results
results formulti-layer
for the the multi-layer case.
case. The The maximum
maximum errors anderrors
the and
final
final temperature
temperature
Let us now contours
contours
showare theare presented
presented
results infor in
theFigures
Figures 16 and 16 and
17 in
multi-layer 17 in of
thecase.
case thethe
The case of the equidist
equidistant
maximum erro
mesh. For
mesh. For the
the non-equidistant
non-equidistant mesh,mesh, thethemaximum
maximum andandenergy errorserrors
energy are shown
are in
shown ineF
final temperature contours are presented in Figures 16 and 17 in the case of the
Figures
ures 18For18 and
andthe 19, while the right-side
19, non-equidistant
while the right-side temperature
temperature profile at medium
profile at height
medium can be
height seen
canare
be show
seen
mesh. mesh, the maximum and energy errors
Figure
ures 1820.
andFrom the figures
19, while it is evident
the right-side that the LHprofile
temperature method at can
mediumeasily height
cope with
can t
complicated heat-conduction problem as well. One can also observe that the heat from
Figure 20. From the figures it is evident that the LH method can easily cope
outer side of the insulator penetrates more slowly into the wall in the case of the insula
complicated heat-conduction problem as well. One can also observe that the hea
wall.
Buildings 2022, 12, 824 19 of 24
Buildings 2022, 12, x FOR PEER REVIEW 19 o

in Figure 20. From the figures it is evident that the LH method can easily cope with this
complicated
Buildings 2022, 12, x FOR PEER REVIEW heat-conduction problem as well. One can also observe that the heat from
19 of 24
the outer side of the insulator penetrates more slowly into the wall in the case of the
insulated wall.

Figure 16.The
Figure16.
Figure 16. The
The maximum
maximum
maximum errors
errors
errors as a function
asaafunction
as functionofofthe of
thetimethe
time time
step
step size ∆t
sizestep size
Δt for
forthe Δequidistant
t for themesh
theequidistant equidistant
meshfor
fora mesh
aa wall
wallwith
wall with
with insulation.
insulation.
insulation.

Figure 17. The temperature distribution contour for equidistant mesh in the case of a wall with
insulation.
Figure 17. The temperature distribution contour for equidistant mesh in the case of a wall
Figure 17. The temperature distribution contour for equidistant mesh in the case of a wall w
with insulation.
insulation.
Buildings 2022, 12, x FOR PEER REVIEW 20 of 24
Buildings 2022, 12, x FOR PEER REVIEW 20 of 24
Buildings 2022, 12, 824 20 of 24

Figure 18. Themaximum


maximum errors
as aas a function
of theof thestep
time
sizestep the Δ
size
∆t for t for the non-equidistant
Figure 18.The
Figure 18.
mesh for a
The maximum
wall with
errors
errors
insulation.
function
as a function time
of the time step size Δt for the non-equidistan
non-equidistant mesh
for a wall with insulation.
mesh for a wall with insulation.

Figure 19. The energy errors as a function of the time step size ∆t for the non-equidistant mesh for a
Figure 19. The energy errors as a function of the time step size Δ t for the non-equidistant mesh
Figure
wall 19.
with The energy errors as a function of the time step size Δ t for the non-equidistant mesh
insulation.
for a wall with insulation.
for a wall with insulation.
Buildings 2022, 12, x FOR PEER REVIEW 21 o
Buildings 2022, 12, 824 21 of 24

Figure 20. The temperature as a function of the cell index in the x direction at the middle row (z ≈ 0.5)
Figure 20. The temperature as a function of the cell index in the x direction at the middle
in the case of the reference solution (Ref) and the leapfrog-hopscotch (LH) method for ∆t = 400 in
(thez ≈case
0.5of) the
in one-layer
the case wall
of the reference solution (Ref) and the leapfrog-hopscotch (LH) method
and the insulated wall using an equidistant grid.
Δ t = 400 in the case of the one-layer wall and the insulated wall using an equidistant grid.
4. Discussion, Summary, and Future Plans
We numerically
4. Discussion, studied and
Summary, transient heatPlans
Future conduction in a two-dimensional wall with
and without insulation. For this purpose, we applied eight recently invented and four old
Weand
explicit numerically studied
stable algorithms and transient heat Heun
the well-known conduction
method.in a two-dimensional wall w
and without insulation.
For verification, For this
an analytical purpose,
solution of thewe applied
heat equationeight recently
was used with invented and four
one equidis-
tant and five non-equidistant grids but in the case of
explicit and stable algorithms and the well-known Heun method.homogeneous material properties
(one layer, brick only). Then,
For verification, we examined
an analytical the insulated
solution of the wall
heatusing the same
equation wasequidistant
used with one e
and non-equidistant grids. The boundary condition depended on space on the brick side
distant and five non-equidistant grids but in the case of homogeneous material proper
of the wall and changes in time on the insulator side of the wall. All of the methods used
(one layer, brick
are confirmed to beonly). Then, but
convergent, we their
examined the insulated
performance is not thewall
sameusing the same
and depends onequidis
and non-equidistant
the circumstances. grids. The boundary condition depended on space on the brick
of theThewall and changes
advantages in time on the
and disadvantages insulator
of the methodsside of following:
are the the wall. All of the methods u
are
1. confirmed to be
The CNe and theconvergent,
UPFD are firstbut their
order, performance
thus is notall
not very accurate, the same
other and depends
methods are on
second order. Nevertheless, the RRK behaves as a first-order method for large and
circumstances.
medium
The time step and
advantages sizes.disadvantages of the methods are the following:
2. In the case of uniform (non-stiff) problems, the OOEH method is the most accurate
1. The CNeand
for large and the UPFD
medium are first
time step sizes.order, thus
However, not veryincreases,
if stiffness accurate, all produce
it can other methods
second order. Nevertheless, the RRK behaves as a first-order
larger errors for large time step sizes. On the other hand, the LH always produces method for large
acceptabletime
medium errors, and,sizes.
step usually, it is the most accurate for stiff systems.
3.
2. Heun’s method is
In the case of uniform only conditionally
(non-stiff)stable and was
problems, thedivergent
OOEH for most of
method isthe
thetime
most accu
step sizes used, while all other methods are unconditionally stable.
for large and medium time step sizes. However, if stiffness increases, it can prod
4. The CNe, the UPFD, the LNe2 and LNe3, and the CpC are positivity preserving for
larger errors
arbitrary for size,
time step largealltime
othersstep
are sizes. On the itother
not. However, implieshand, themedium
that for LH alwaysand produ
acceptable
small time steperrors,
sizes and, usually,
they are it accurate.
the least is the most accurate for stiff systems.
3.
5. Heun’s method
The hopscotch is only
methods conditionally
(OOEH, ROEH, SH, stable andneed
and LH) wasadivergent for most
special bipartite grid.of the t
However,
step sizesthey
used,do while
not require storing
all other another are
methods copyunconditionally
of the array for thestable.
temperature,
4. even temporarily, so they have minimal memory requirements.
The CNe, the UPFD, the LNe2 and LNe3, and the CpC are positivity Other methods require
preserving
the storage at least one extra array with the same number of elements as the array
arbitrary time step size, all others are not. However, it implies that for medium
variable for the temperature.
small time step sizes they are the least accurate.
5. The hopscotch methods (OOEH, ROEH, SH, and LH) need a special bipartite g
However, they do not require storing another copy of the array for the temperat
even temporarily, so they have minimal memory requirements. Other methods
Buildings 2022, 12, 824 22 of 24

6. The level of generalizability of the methods is different. For example, the RRK and
Heun’s methods are in principle completely general, so they can handle any modi-
fication of the original heat-equation. The UPFD and the pseudo-implicit methods
can handle convection and reaction terms quite well, while some other methods have
been adapted until now only to the cases of constant source terms and/or Fisher-type
reaction terms besides the diffusion term. We note that the LH method has been
successfully applied to the Kardar-Parisi-Zhang equation [47] as well.
7. The CNe, UPFD, OOEH, ROEH, DF, SH, and LH methods require only one calculation
of the new temperature values of any cells in any given time step, so they are the
fastest. The LNe2, CpC, Heun, PI, and RRK methods require two calculations while
the LNe3 needs three calculations per cell per time step, thus it is roughly three times
slower than, for example, the CNe method.
8. DF is a two-step method; it needs to be started by another method.
To conclude, we can suggest using the OOEH or maybe the LH method in the case
of homogeneous material properties and an equidistant grid, while in other cases the LH
and maybe the SH and the DF algorithms can be proposed. All of them give quite accurate
results with orders of magnitude larger time step size, thus they are much faster than the
standard explicit methods stricken by instability. However, if unconditional positivity is
crucial, the LNe3 method should be used to simulate heat conduction.
In the immediate future, we are going to adapt the most successful methods (especially
the LH and the OOEH) to cases where there is heat transfer by convection and radiation
as well. We plan to compare the results and the running times of our methods and that
of appropriate commercial software, e.g., ANSYS Fluent. In the next step, we would like
to examine nonlinear heat conduction, i.e., when the coefficients themselves depend on
the temperature, and validate the results via real physical experiments. Then, we will
be ready to apply the methods to real-life engineering problems, most importantly smart
walls envelope, the use of phase change material (PCM), or study thermal bridges in
buildings to increase energy efficiency. We will also work on the parallelization of the new
algorithms, which we think can be done fairly straightforwardly due to the explicit nature
of the algorithms.

Author Contributions: Conceptualization, methodology, supervision, and resources, E.K.; software,


validation, investigation, and visualization, H.K.J. and I.O.; writing—original draft preparation, E.K.
and I.O.; writing—review and editing, H.K.J. and E.K. All authors have read and agreed to the
published version of the manuscript.
Funding: The research was supported by the EU and the Hungarian State, co-financed by the ERDF
in the framework of the GINOP-2.3.4-15-2016-00004 project.
Institutional Review Board Statement: Not applicable.
Informed Consent Statement: Not applicable.
Data Availability Statement: Data available on request.
Conflicts of Interest: The authors declare no conflict of interest.

References
1. Kusuda, T. Fundamentals of building heat transfer. J. Res. Natl. Bur. Stand. 1977, 82, 97. [CrossRef] [PubMed]
2. Li, T.; Xia, J.; Chin, C.S.; Song, P. Investigation of the Thermal Performance of Lightweight Assembled Exterior Wall Panel
(LAEWP) with Stud Connections. Buildings 2022, 12, 473. [CrossRef]
3. Barna, I.F.; Mátyás, L. General Self-Similar Solutions of Diffusion Equation and Related Constructions. Rom. J. Phys. 2022, 67, 101.
4. Lienhard, J.H., IV; Lienhard, J.H., V. A Heat Transfer Textbook, 4th ed.; Phlogiston Press: Cambridge, MA, USA, 2017;
ISBN 9780971383524.
5. Savović, S.; Djordjevich, A. Numerical solution of diffusion equation describing the flow of radon through concrete. Appl. Radiat.
Isot. 2008, 66, 552–555. Available online: https://www.sciencedirect.com/science/article/pii/S0969804307002874 (accessed on 13
June 2022). [CrossRef]
Buildings 2022, 12, 824 23 of 24

6. Suárez-Carreño, F.; Rosales-Romero, L. Convergency and stability of explicit and implicit schemes in the simulation of the heat
equation. Appl. Sci. 2021, 11, 4468. [CrossRef]
7. Haq, S.; Ali, I. Approximate solution of two-dimensional Sobolev equation using a mixed Lucas and Fibonacci polynomials.
Eng. Comput. 2021. Available online: https://link.springer.com/article/10.1007/s00366-021-01327-5 (accessed on 13 June 2022).
[CrossRef]
8. Lima, S.A.; Kamrujjaman, M.; Islam, M.S. Numerical solution of convection-diffusion-reaction equations by a finite element
method with error correlation. AIP Adv. 2021, 11, 085225. [CrossRef]
9. Ivanovic, M.; Svicevic, M.; Savovic, S. Numerical solution of Stefan problem with variable space grid method based on mixed
finite element/ finite difference approach. Int. J. Numer. Methods Heat Fluid Flow 2017, 27, 2682–2695. [CrossRef]
10. Zhang, J.; Zhao, C. Sharp error estimate of BDF2 scheme with variable time steps for molecular beam expitaxial models without
slop selection. J. Math. 2021, 41, 1–19.
11. Amoah-Mensah, J.; Boateng, F.O.; Bonsu, K. Numerical solution to parabolic PDE using implicit finite difference approach. Math.
Theory Model. 2016, 6, 74–84.
12. Mbroh, N.A.; Munyakazi, J.B. A robust numerical scheme for singularly perturbed parabolic reaction-diffusion problems via the
method of lines. Int. J. Comput. Math. 2021, 2021, 1–25. [CrossRef]
13. Aminikhah, H.; Alavi, J. An efficient B-spline difference method for solving system of nonlinear parabolic PDEs. SeMA J. 2018,
75, 335–348. [CrossRef]
14. Ali, I.; Haq, S.; Nisar, K.S.; Arifeen, S.U. Numerical study of 1D and 2D advection-diffusion-reaction equations using Lucas and
Fibonacci polynomials. Arab. J. Math. 2021, 10, 513–526. [CrossRef]
15. Singh, M.K.; Rajput, S.; Singh, R.K. Study of 2D contaminant transport with depth varying input source in a groundwater
reservoir. Water Sci. Technol. Water Supply 2021, 21, 1464–1480. [CrossRef]
16. Haq, S.; Hussain, M.; Ghafoor, A. A computational study of variable coefficients fractional advection–diffusion–reaction equations
via implicit meshless spectral algorithm. Eng. Comput. 2020, 36, 1243–1263. Available online: https://link.springer.com/article/
10.1007/s00366-019-00760-x (accessed on 13 June 2022). [CrossRef]
17. Reguly, I.Z.; Mudalige, G.R. Productivity, performance, and portability for computational fluid dynamics applications. Comput.
Fluids 2020, 199, 104425. [CrossRef]
18. Gagliardi, F.; Moreto, M.; Olivieri, M.; Valero, M. The international race towards Exascale in Europe. CCF Trans. High Perform.
Comput. 2019, 1, 3–13. [CrossRef]
19. Appadu, A.R. Performance of UPFD scheme under some different regimes of advection, diffusion and reaction. Int. J. Numer.
Methods Heat Fluid Flow 2017, 27, 1412–1429. [CrossRef]
20. Karahan, H. Unconditional stable explicit finite difference technique for the advection-diffusion equation using spreadsheets.
Adv. Eng. Softw. 2007, 38, 80–86. [CrossRef]
21. Sanjaya, F.; Mungkasi, S. A simple but accurate explicit finite difference method for the advection-diffusion equation. J. Phys.
Conf. Ser. 2017, 909, 1–5. [CrossRef]
22. Pourghanbar, S.; Manafian, J.; Ranjbar, M.; Aliyeva, A.; Gasimov, Y.S. An efficient alternating direction explicit method for solving
a nonlinear partial differential Equation. Math. Probl. Eng. 2020, 2020, 1–12. [CrossRef]
23. Harley, C. Hopscotch method: The numerical solution of the Frank-Kamenetskii partial differential equation. Appl. Math. Comput.
2010, 217, 4065–4075. [CrossRef]
24. Al-Bayati, A.Y.; Manaa, S.A.; Al-Rozbayani, A.M. Comparison of Finite Difference Solution Methods for Reaction Diffusion
System in Two Dimensions. AL-Rafidain J. Comput. Sci. Math. 2011, 8, 21–36. [CrossRef]
25. Nwaigwe, C. An Unconditionally Stable Scheme for Two-Dimensional Convection-Diffusion-Reaction Equations. 2022. Available
online: https://www.researchgate.net/publication/357606287_An_Unconditionally_Stable_Scheme_for_Two-Dimensional_
Convection-Diffusion-Reaction_Equations (accessed on 13 June 2022).
26. Savović, S.; Drljača, B.; Djordjevich, A. A comparative study of two different finite difference methods for solving advection–
diffusion reaction equation for modeling exponential traveling wave in heat and mass transfer processes. Ric. Mat. 2021, 70, 2.
[CrossRef]
27. Kovács, E.; Gilicz, A. New stable method to solve heat conduction problems in extremely large systems. Des. Mach. Struct. 2018,
8, 30–38.
28. Kovács, E. New Stable, Explicit, First Order Method to Solve the Heat Conduction Equation. J. Comput. Appl. Mech. 2020, 15,
3–13. Available online: http://www.mech.uni-miskolc.hu/jcam/author_card.php?author_id=375 (accessed on 13 June 2022).
[CrossRef]
29. Issa, O. New explicit algorithm based on the asymmetric hopscotch structure to solve the heat conduction equation. Multidiszcip.
Tudományok 2021, 11, 233–244.
30. Saleh, M.; Nagy, Á.; Kovács, E. Part 1: Construction and investigation of new numerical algorithms for the heat equation.
Multidiszcip. Tudományok 2020, 10, 323–338. [CrossRef]
31. Saleh, M.; Nagy, Á.; Kovács, E. Part 2: Construction and investigation of new numerical algorithms for the heat equation.
Multidiszcip. Tudományok 2020, 10, 339–348. [CrossRef]
32. Saleh, M.; Nagy, Á.; Kovács, E. Part 3: Construction and investigation of new numerical algorithms for the heat equation.
Multidiszcip. Tudományok 2020, 10, 349–360. [CrossRef]
Buildings 2022, 12, 824 24 of 24

33. Nagy, Á.; Saleh, M.; Omle, I.; Kareem, H.; Kovács, E. New stable, explicit, shifted-hopscotch algorithms for the heat equation.
Math. Comput. Appl. 2021, 26, 61. Available online: https://www.mdpi.com/2297-8747/26/3/61/htm (accessed on 13 June 2022).
[CrossRef]
34. Nagy, Á.; Omle, I.; Kareem, H.; Kovács, E.; Barna, I.F.; Bognar, G. Stable, Explicit, Leapfrog-Hopscotch Algorithms for the
Diffusion Equation. Computation 2021, 9, 92. [CrossRef]
35. Kovács, E.; Nagy, Á.; Saleh, M. A set of new stable, explicit, second order schemes for the non-stationary heat conduction equation.
Mathematics 2021, 9, 2284. Available online: https://www.mdpi.com/2227-7390/9/18/2284 (accessed on 3 November 2021).
[CrossRef]
36. Jalghaf, H.K.; Kovács, E.; Majár, J.; Nagy, Á.; Askar, A.H. Explicit stable finite difference methods for diffusion-reaction type
equations. Mathematics 2021, 9, 3308. [CrossRef]
37. Munka, M.; Pápay, J. 4D Numerical Modeling of Petroleum Reservoir Recovery; Akadémiai Kiadó: Budapest, Hungary, 2001;
ISBN 9630578433.
38. Kovács, E. A class of new stable, explicit methods to solve the non-stationary heat equation. Numer. Methods Partial Differ. Equ.
2020, 37, 2469–2489. [CrossRef]
39. Holmes, M.H. Introduction to Numerical Methods in Differential Equations; Springer: New York, NY, USA, 2007; ISBN 9780387308913.
40. Gourlay, A.R.; McGuire, G.R. General Hopscotch Algorithm for the Numerical Solution of Partial Differential Equations. IMA J.
Appl. Math. 1971, 7, 216–227. [CrossRef]
41. Heun’s Method—Wikipedia. Available online: https://en.wikipedia.org/wiki/Heun%27s_method (accessed on 30 July 2021).
42. Hirsch, C. Numerical Computation of Internal and External Flows, Volume 1: Fundamentals of Numerical Discretization; Wiley: Hoboken,
NJ, USA, 1988.
43. Sottas, G. Rational Runge-Kutta methods are not suitable for stiff systems of ODEs. J. Comput. Appl. Math. 1984, 10, 169–174.
[CrossRef]
44. Kovács, E.; Nagy, Á.; Saleh, M. A New Stable, Explicit, Third-Order Method for Diffusion-Type Problems. Adv. Theory Simul.
2022, 5, 2100600. [CrossRef]
45. Iserles, A. A First Course in the Numerical Analysis of Differential Equations; Cambridge University Press: Cambridge, UK, 2009;
ISBN 9788490225370.
46. Bastani, M.; Salkuyeh, D.K. A highly accurate method to solve Fisher’s equation. Pramana-J. Phys. 2012, 78, 335–346. [CrossRef]
47. Sayfidinov, O.; Bognár, G.; Kovács, E. Solution of the 1D KPZ Equation by Explicit Methods. Symmetry 2022, 14, 699. [CrossRef]

You might also like