1 Introduction

Foamed concrete [1, 2], also known as aerated or cellular concrete [3, 4] or cement-based foam [5], is basically the blend of a cement-based mix and a preformed foam. It is a light-weight material with an oven-density of 800 kg/m\(^3\) or less [4] and an air volume fraction higher than 20% [6, 7] or 25% [1]. Typically, foamed concretes do not contain large aggregates [1, 2]; indeed, ultra lightweight foamed concretes only contains cement, water and foam [1]. So, more than concretes, they are mortars or pastes [1, 2]. Having clarified this point, let us keep the denomination “foamed concrete” given its wider use.

Foamed concretes are used in a wide range of construction applications, including void filling, bridge abutments and arch infills, road sub-bases, soil stabilization, fire protection for structural steel, grouting tunnel walls, thermal and acoustic insulation, floor and roof screeds, among others [6].

Within the project “Integrated porous cementitious nanocomposites in non-residential building envelopes for green active/passive energy storage” (NRG-STORAGE) [8], we are mainly interested in the use of foamed concrete in building envelopes to replace expanded (EPS) and extruded (XPS) polystyrenes. The NRG-STORAGE project proposes to include phase-change materials in the base mix of concrete foams, giving rise to the so-called NRG-foams [9, 10]. Besides the advantages of regular foamed concrete compared to either XPS or EPS in terms of toxicity, flammability and CO\(_2\) footprint [11], the NRG-foams offer thermal energy storage (TES) capacity. The envelopes made of NRG-foams will therefore take advantage of the dynamic synergy between thermal insulation and TES, becoming “energy dynamic building envelopes” [12].

The TES of a foamed concrete is easily determined by using the mixture law [13] as the volumetric average of the TES of its constituents, as done by Fang [14] to compute the volumetric heat capacity of composites with coated particles.

As to the thermal insulation of a wall, it is inversely proportional to the thermal conductivity of the material it is made of. The thermal conductivity of a porous material depends not only on the thermal conductivities and volume fractions of the constituents but also on the geometry, size and distribution of pores [5, 15].

Regarding the shape of the pores in foamed concretes, experiments show a vast majority of spherical pores [5, 16]. The lack of sphericity of the remainder pores has been attributed to a mishandling in the processing of tomography images [5], or to merge or overlap of pores in highly porous materials [16, 17]. So, pores in foamed concrete are usually modeled as spheres [18, 19], as it will be assumed in the current work.

The pore size distribution is described by a histogram giving the frequency of appearance of pores considering their sizes, which can be determined for foamed concretes by applying X-ray computerized tomography coupled to image processing [5, 17, 19]. Frequently, the pore size distribution in foamed concretes is approximated by a log-normal probabilistic distribution [20] so it can be described by an analytical function having only two parameters, either the diameters D(50) (median diameter) and D(90) corresponding to the 50% and the 90% of the cumulative frequency [5, 17, 18] or the mean and the standard deviation of the logarithm of the pore sizes [19, 20], adjustable from experimentally determined histograms. In seek of high fidelity, we avoid any simplification of the pore size distribution by taking into account the histogram itself. By this way, we aim to provide benchmarks for the approximations of the pore size distribution, although this is beyond the scope of the current work.

Once the variables it depends on are known, the thermal conductivity can be determined using analytical formulas or numerical methods. Analytical formulas imply higher simplifications, ignoring the pore size distribution. The most popular analytical formulas, those proposed by Maxwell [13] and Bruggeman [21], only take into account the shape and the volume fraction of pores. Further, as they were derived for dispersed pores, they are valid for low porosities. More sophisticated formulas can account for the packing structure of pores [22, 23] but they have also a threshold in porosity that is as most 74%, lower than the porosity of the lighter foamed concretes.

Regarding the use of numerical methods for computing the effective thermal conductivity of foamed concretes, the first step is the generation of a discretized representative volume element (RVE). Some numerical models applied to foamed concretes are aimed at validating analytical formulas, like the finite element model used by Miled and Liman [24], which assumes a body-centered cubic arrangement of pores, is valid for porosities not higher than 68%, and gives results that are close to Maxwell formula. But the main advantage of numerical over analytical methods lies in the ability to account for the pore size distribution. Wei et al [19] proposed a methodology for the automatic generation of the RVE of foamed concretes, which consists in adding pores with random diameters and randomly located centers into a sample, in an iterative process that stops when the desired porosity is attained. Although it starts from a complete pore size distribution from which the mean and the standard deviation of the pore size are determined, the Wei et al’s RVE generator choose the diameters of the pores randomly but within the standard deviation of the mean pore size, so, in reality, it produces a narrow pore size distribution. And it suffers from another mayor issue: it generates two-dimensional RVEs. In a 2D RVE, a circular inclusion does not represent a sphere but a circular cylinder, giving a different thermal conductivity for the same volume fraction [21,22,23]. Not surprisingly, Wei et al’s predictions are in good agreement with experimental data only for porosities not higher than 35%, a range where analytical solutions for cylindrical and spherical inclusions [23] are not as different as for intermediate porosities; unfortunately, most of the foamed concretes have porosities above 35%.

For cement-based composites other than foamed concretes, Keskin et at. [25] developed a 2D mesh generator of elliptical inclusions to study the effect of the shape of inclusions on the diffusion of chloride in hardened mortar, a phenomenon mathematically analogous to heat diffusion. Caggiano et al. [26] presented a 2D generator of aggregates modeled as perturbed polygons to study the shape effect on moisture diffusion; in this work, the concrete is porous but the porosity is low, so it is modeled as an effective medium, i.e. without distinguishing the pores.

More sophisticated mesh generators for cement-based composites take into account the 3D nature of the inclusions and their distribution. Xu and Chen [27] proposed a generator of dodecahedral inclusions to study the effect of the size distribution and the shape of inclusions on the specific surface area and the mean free spacing. Liu et al. [28] developed a generator of ellipsoidal and polyhedral inclusions to study the diffusivity of mortar.

Devoted to composites with inclusions in general, the automatic generators proposed by Bailakanavar et al [29] and Schneider et al. [30] can produce 3D RVEs for composites with spherical inclusions with a given size distribution.

These 3D mesh generators [27,28,29,30], which also account for the size distribution, look promising for modeling the RVE of foamed concretes. However, they preclude the overlap of inclusions, which is valid for solid inclusions but not for pores. Consequently, the so-generated RVEs cannot contain inclusions in high volume fractions (say, above 45% [29]), excluding most of the foamed concretes.

To overcome the limitations of the existing RVE generators, we develop NRGene (so-named after NRG-STORAGE), an automatic generator of fully 3D RVEs for composites with a given size distribution of spherical air inclusions. NRGene creates randomly located spheres inside a voxelized cube, in sizes and quantities dictated by a given histogram. The randomness of pores location enables overlap, which can be controlled to avoid it being excessive. The sets of equally sized pores are included simultaneously, from the biggest to the smallest ones, in an iterative process where the volume of the RVE is systematically adjusted until attaining a given porosity. NRGene can be also set to build periodic RVEs by completing the pores that were partially embedded at the first step. Although forcing periodicity is not worth the effort regarding its effect on thermal conductivity [31], we will show that it usually reduces the number of iterations for the attainment of the desired porosity, turning the RVE generation computationally faster.

Once the discretized RVE is generated, numerical methods are called to determine the corresponding thermal conductivity. The voxelized RVE produced by NRGene is indeed a structured mesh of cubic-shaped elements (voxels) or equally separated points or nodes, and is straightforwardly suited for the most popular numerical methods (finite differences, finite volumes, and finite elements) as well as for the thermal resistor analogy applied by Wei et al [19] to foamed concretes. Here, based on our expertise –and consequent availability of computational codes–, we use the finite element method (FEM). Then, recourse is made to FEM-based homogenization [32] to determine the effective thermal conductivity as a symmetric second-order tensor. Since the determination of such tensor implies to consider temperature gradients in three normal directions, this “tensorial” approach is up to three times more expensive than the common practice of determining a scalar thermal conductivity for only one gradient [19, 24], which is absolutely valid for composites like foamed concretes that are expected to be isotropic when the base mix is isotropic, as usual. However, there are several reasons behind our choice of the tensorial approach. First, we can check isotropy instead of assuming it, having in this way a measure of the goodness (“representativeness”) of the RVE of a material that is expected to be isotropic. Second, by defining a scalar isotropic conductivity as the mean of the diagonal elements of the tensorial conductivity, the dispersion of results is considerably reduced compared to the case where only one scalar conductivity is determined. Thanks to this, despite the randomness in mesh generation, the confidence in results obtained at the first run sensibly increases. Third, we think of it as a digital twin of foamed concretes not only for thermal but also for mechanical applications. In this sense, the current FEM-based homogenization strategy for the determination of the thermal conductivity can be easily extended for the computation of the effective elastic properties [32]. Fourth, this digital twin is more concerned at high fidelity than computational cost, aiming to replace experiments –and hence the previous fabrication of the material– for the definition of benchmarks for simplified, computationally cheaper, models.

We highlight this last point by proposing a simplified model that allows to decrease the time taken to determine the effective thermal conductivity from several hours –even more than a day– to a few seconds, opening the door to everyday engineering and industrial applications. This simplified model is nothing but the current high fidelity digital twin called with a truncated pore size histogram as input. In this case, the simplification is not only motivated by the need of reducing the computational cost but justified by the fact that the omission of the smaller pores up to a small enough volume does not affect the thermal conductivity, as we will demonstrate.

2 Automatic mesh generation

This section introduces NRGene, an automatic generator of discretized RVEs specially addressed to foamed concretes. NRGene models the representative volume element (RVE) of a foamed concrete as a cube with the cement paste as the solid matrix and the pores as spherical air inclusions. This RVE is fully characterized by the porosity p and the pore histogram \(H=\{D_1,n_1,D_2,n_2,\dots ,D_Q,n_Q\}\), where \(n_q\) is the number of pores with diameter \(D_q\), with \(D_q<D_{q+1}\).

To accommodate such porosity and histogram, the volume \(V_\text {\tiny {RVE}}\) of the RVE must not be greater than

$$\begin{aligned} V_\text {\tiny {RVE}}^\text {max}=\frac{V_\text {por}^\text {max}}{p}, \end{aligned}$$
(1)

where \({V_\text {por}^\text {max}}\) is the maximum volume of pores, that obtained by assuming zero overlap between pores, given by

$$\begin{aligned} V_\text {por}^\text {max}=\sum _{q=1}^Q V_q^\text {max}, \end{aligned}$$
(2)

being \(V_q^\text {max}\) the volume of all the pores with diameter \(D_q\) assuming zero overlap, i.e., \(n_q\) times the volume of a sphere with such diameter:

$$\begin{aligned} V_q^\text {max}=n_q\frac{\pi }{6}D_q^3. \end{aligned}$$
(3)

For numerical modeling, let the RVE be represented by a uniform mesh of \(N_\text {\tiny {RVE}}\) brick finite elements \(\Omega ^{(1)},\Omega ^{(2)},\dots \), each \(\Omega ^{(e)}\) being a cube (or voxel). To properly account for the smallest pores (those with diameter \(D_1\)), the maximum size of \({V_\text {por}^\text {max}}\) is adopted as

$$\begin{aligned} h_\text {max}=\frac{D_1}{n_\text {ref}}, \end{aligned}$$
(4)

where \(n_\text {ref}\) is a mesh refinement parameter that should not be smaller than unity.

The actual size of the RVE for the given porosity and histogram will be adjusted iteratively, starting from an initial guess \(V_\text {\tiny {RVE}}=V_\text {\tiny {RVE}}^{(0)}\), for instance \(V_\text {\tiny {RVE}}^{(0)}=V_\text {\tiny {RVE}}^\text {max}\).

To make the voxel size not greater than \(h_\text {max}\), the RVE is divided into \(N_\text {\tiny {RVE}}=n_\text {vox}^3\) voxels, being

$$\begin{aligned} n_\text {vox}={{\,\textrm{ceil}\,}}{\left( \frac{L_\text {\tiny {RVE}}}{h_\text {max}}\right) } \end{aligned}$$
(5)

the number of voxels along each side of the RVE, \(L_\text {\tiny {RVE}}=\root 3 \of {V_\text {\tiny {RVE}}}\) the RVE side, and \({{\,\textrm{ceil}\,}}(x)\) the smallest integer greater than or equal to x. So, the actual voxel size is

$$\begin{aligned} h_\text {vox}=\frac{L_\text {\tiny {RVE}}}{n_\text {vox}}\le h_\text {max}. \end{aligned}$$
(6)

Let \({\mathcal {S}}\) be the subset of solid voxels. To initialize the pore inclusion process, \({\mathcal {S}}\) is assumed to contain all the \(N_\text {\tiny {RVE}}\) voxels of the RVE. Then, \({\mathcal {S}}\) is reduced in successive steps \(q=Q,Q-1,Q-2,\dots ,1\). At the step q, all the voxels belonging to pores with diameter \(D_q\) are removed from \({\mathcal {S}}\).

The first step \(q=Q\), that of removing the voxels of the \(n_Q\) biggest pores, starts by randomly choosing a set \({\mathcal {C}}_Q\) of \(n_Q\) voxels \(\Omega ^{(c)}\in {\mathcal {S}}\), whose centers \({{\bar{{\textbf{x}}}}}(\Omega ^{(c)})\) are adopted as the pore centers. The set of voxels belonging to the pores with diameter \(D_Q\) is defined as

$$\begin{aligned} {\mathcal {P}}_Q=\{\Omega ^{(e)}\in {\mathcal {S}}\text { such that } \Vert {{\bar{{\textbf{x}}}}}(\Omega ^{(e)})-{{\bar{{\textbf{x}}}}}(\Omega ^{(c)})\Vert \le D_Q/2 \text { for all }\Omega ^{(c)}\in {\mathcal {C}}_Q\}. \end{aligned}$$
(7)

Once \({\mathcal {P}}_Q\) is determined, it is removed from \({\mathcal {S}}\):

$$\begin{aligned} {\mathcal {S}}\leftarrow {\mathcal {S}}\backslash {\mathcal {P}}_Q \end{aligned}$$
(8)

In the next step \(q=Q-1\), the just described algorithm for the inclusion of the \(n_Q\) pores with diameter \(D_q\) is repeated for the \(n_{Q-1}\) pores with diameter \(D_{Q-1}\), and so on until the last step \(q=1\) for including all the \(n_1\) pores with diameter \(D_1\) (the smallest ones). After these Q pore inclusion steps, the porosity of the RVE is

$$\begin{aligned} p^{(1)}=1-\frac{\dim ({\mathcal {S}})}{N_\text {\tiny {RVE}}}, \end{aligned}$$

where \(\dim ({\mathcal {S}})\) is the number of elements of the set \({\mathcal {S}}\), i.e., the number of solid voxels. If \(V_\text {\tiny {RVE}}^{(0)}=V_\text {\tiny {RVE}}^\text {max}\) was the initial guess, \(p^{(1)}\) is usually considerably smaller than the targeted porosity p because of the pore volume loss due to overlap or partial embedment. Then, we proceed to the following iteration \(i=2,3,\dots \), updating the RVE volume as

$$\begin{aligned} V_\text {\tiny {RVE}}\leftarrow V_\text {\tiny {RVE}}\frac{p^{(i)}}{p},\qquad i=1,2,\dots \end{aligned}$$

This RVE updating process is repeated until the iteration \(i=i_\text {conv}\) for which \(|p^{(i)}-p|\le \varepsilon _\text {por}\), being \(\varepsilon _\text {por}\) a predefined tolerance; we call \(p_\text {conv}=p^{(i_\text {conv})}\) the converged porosity.

As result, we obtain the set \({\mathcal {S}}\) of solid voxels among the \(N_\text {\tiny {RVE}}\) voxels that make up the RVE.

NRGene was coded in Matlab®. Actually, the idea of including all the pores with a same size simultaneously was motivated by the high performance of the Matlab function rangesearch [33], capable of determining all the points within a given radius around several centers at once. This function uses the k-dimensional tree [34] for organizing the data in order to speed up the search of neighboring points. Just one call to rangesearch suffices to determine the whole set \({\mathcal {P}}_Q\) of pores with diameter \(D_Q\) (see Eq. (7)), which is much more faster than including pores one by one, as done by Wei et al [19].

The whole NRGene algorithm is summarized in Appendix I.

2.1 Periodicity

To force the periodicity of the RVE, the set \({\mathcal {P}}_Q\) must be supplemented with the lacking portions of the partially embedded pores. Let \({\mathcal {C}}_{Q v}\subset {\mathcal {C}}_Q\) be the set of centers of those partially embedded pores with diameter \(D_Q\) having \({\textbf{x}}_v\) (\(v=1,2,\dots ,8\)) as the closest RVE vertex. To account for periodicity, the set \({\mathcal {P}}_{Q v}\) of voxels of the pores with centers in \({\mathcal {C}}_{Q v}\) is augmented as follows:

$$\begin{aligned} {\mathcal {P}}_{Q v}\leftarrow {\mathcal {P}}_{Q v 1}\cup {\mathcal {P}}_{Q v 2}\cup \dots \cup {\mathcal {P}}_{Q v 8}, \end{aligned}$$
(9)

with

$$\begin{aligned}{} & {} {\mathcal {P}}_{Q v w}=\left\{ \Omega ^{(e)}\in {\mathcal {S}}\text { such that } \left\| {{\bar{{\textbf{x}}}}}(\Omega ^{(e)})\right. \right. \nonumber \\{} & {} \quad \left. \left. -\left[ {\textbf{x}}_w+\left( {{\bar{{\textbf{x}}}}}(\Omega ^{(c)})-{\textbf{x}}_v\right) \right] \right\| \le D_Q/2 \text { for all }\Omega ^{(c)}\in {\mathcal {C}}_{Q v}\right\} . \end{aligned}$$
(10)

Note that \({\mathcal {P}}_{Q v v}\) is equal to the original \({\mathcal {P}}_{Q v}\), while \({\mathcal {P}}_{Q v w}\) with \(w\ne v\) defines the lacking portion closest to the RVE vertex \({\textbf{x}}_w\).

Figure 1a gives a 2D schema of the completion of a partially embedded pore whose center \({{\bar{{\textbf{x}}}}}\) has \({\textbf{x}}_4\) as the closest RVE vertex, so \(v=4\). The initial domain of this pore is the region \({\mathcal {P}}_{Q4}\equiv {\mathcal {P}}_{Q44}\). To force the RVE periodicity, \({\mathcal {P}}_{Q44}\) is supplemented by the regions \({\mathcal {P}}_{Q4w}\) (\(w\ne 4\)). Each \({\mathcal {P}}_{Q4w}\) is the intersection of a sphere centered at \({\textbf{x}}_w+{\textbf{v}}\) (with \({\textbf{v}}={{\bar{{\textbf{x}}}}}-{\textbf{x}}_4\)) with the RVE, which may be empty as it is the case for \(w=2\).

Fig. 1
figure 1

Treatment of fully and partially embedded pores: a Completion of partially embedded pores to force the periodicity of the RVE. b Pore volume losses due to partial embedment and overlapping

Finally, once determined \({\mathcal {P}}_{Q v},{\mathcal {P}}_{Q2},\dots ,{\mathcal {P}}_{Q8}\), they are added to \({\mathcal {P}}_Q\):

$$\begin{aligned} {\mathcal {P}}_Q\leftarrow {\mathcal {P}}_Q\cup {\mathcal {P}}_{Q1}\cup {\mathcal {P}}_{Q2}\cup \dots \cup {\mathcal {P}}_{Q8}, \end{aligned}$$
(11)

to be then removed from the set \({\mathcal {S}}\) of solid voxels.

After removing the so-fulfilled \({\mathcal {P}}_Q\) from \({\mathcal {S}}\), the process is repeated for \({\mathcal {P}}_{Q-1}\), and so on until \({\mathcal {P}}_{1}\) (the set of voxels of the smallest pores).

2.2 Control of the pore volume loss

Equation (3) for \(q=Q\) gives the volume \(V_Q^\text {max}\) of the set of \(n_Q\) spherical pores with diameter \(D_Q\) when they are fully embedded in the RVE and not overlapped. This is before discretization, i.e., when the pores are not yet voxelized. After discretization, a fully embedded pore with diameter \(D_Q\) centered at the voxel \(\Omega ^{(c)}\) is represented by the voxelized sphere made of the m voxels whose centers are not farther than \(D_Q/2\) from \({{\bar{{\textbf{x}}}}}(\Omega ^{(c)})\), whose volume is \(m h_\text {vox}^3=m V_\text {\tiny {RVE}}/N_\text {\tiny {RVE}}\). So, once discretized, the maximum volume of the set of \(n_Q\) pores with diameter \(D_Q\) is actually \(V_Q^\text {max}=n_\text {Q}mh_\text {vox}^3=n_\text {Q}m V_\text {\tiny {RVE}}/N_\text {\tiny {RVE}}\). The difference between this latter \(V_Q^\text {max}\) and that given by (3) can be usually neglected.

Due to partial embedment (only in the case that periodicity is not forced) and overlap (in all cases), the actual volume of the set of \(n_Q\) pores with diameter \(D_Q\) is

$$\begin{aligned} V_Q=v_\text {vox}\dim ({\mathcal {P}}_Q). \end{aligned}$$
(12)

Then, we define the volume loss ratio for the pores with diameter \(D_Q\) as

$$\begin{aligned} \theta _Q=\frac{V_Q^\text {max}-V_Q}{V_Q^\text {max}}. \end{aligned}$$
(13)

Finally, to control the volume loss of the pores with diameter \(D_Q\), we prescribe the following constraint:

$$\begin{aligned} \theta _Q\le \varepsilon _\text {\tiny {PVL}}, \end{aligned}$$
(14)

being \(\varepsilon _\text {\tiny {PVL}}\) a predefined threshold. If this constraint is violated for the just determined \({\mathcal {P}}_Q\), the set \({\mathcal {S}}\) of solid voxels is not updated but a new set \({\mathcal {C}}_Q\) of random centers is chosen from \({\mathcal {S}}\), giving raise to a new set \({\mathcal {P}}_Q\) of air voxels. However, given the randomness of the center choice, to satisfy this constraint can either be impossible or take too many iterations. Then, we make a deal between constraint satisfaction and computational cost by repeating the center choice no more than \(n_\text {\tiny {PVL}}\) times. If the constraint could not be satisfied after \(n_\text {\tiny {PVL}}\) tries, the set \({\mathcal {P}}_Q\) for which \(V_Q^\text {max}-V_Q\) is minimum is kept to update \({\mathcal {S}}\).

The pore volume can be lost either by overlap or partial embedment of pores, as schematized in Fig. 1b; when periodicity is forced, the volume lost by the partially embedded pores is recovered, so all the pore volume loss is due to overlap.

The volume loss control, just described for the biggest pores, is repeated for the pores with diameter \(D_{Q-1}\), and so on. At the end, a global pore volume loss ratio is defined as

$$\begin{aligned} \theta _\text {\tiny {PVL}}=\frac{\sum _{q=1}^Q\left( V_q^\text {max}-V_q\right) }{V_\text {por}^\text {max}}. \end{aligned}$$
(15)

2.3 Application

Let us consider one of the foamed concretes studied by Batool [5, 17, 35]; we label it as Ref-400, with Ref pointing out that its solid phase is made of the Batool’s reference mix, and 400 referring to its cast density in kg/m\(^3\). The Ref-400 foamed concrete was prepared by adding a pre-formed foam generated by a synthetic foaming agent to a slurry made of high early (HE) type Portland cement with 0.69 water-to-cement ratio. The microstructure of this material, shown in Fig. 2a, is characterized by the porosity \(p=78.1\%\) and the pore size histogram shown in Fig. 2b.

Fig. 2
figure 2

Image obtained using a scanning electron microscope (reprinted from [5] with permission from Elsevier) and pore size histogram for the Ref-400 foamed concrete

The pore size distribution is frequently described by the frequency \(f_q\) –instead of the number \(n_q\)– of pores with diameter \(D_q\). To determine \(n_q\), let us first prescribe the number \(n_\text {min}\) of rarest pores in the RVE. These are the pores having the lowest frequency \(f_\text {min}=\min (f_1,f_2,\dots ,f_Q)\). Once \(n_\text {min}\) is adopted, the number of pores with diameter \(D_q\) is given by

$$\begin{aligned} n_q={{\,\textrm{round}\,}}\left( \frac{f_q}{f_\text {min}}n_\text {min}\right) , \end{aligned}$$
(16)

where \({{\,\textrm{round}\,}}(x)\) is the integer nearest to x.

Note that \(n_\text {min}\) allows to control the size of the sample and, hence, its representativeness. The bigger the sample, the more representative it is but also the more expensive its generation is. The minimum \(n_\text {min}\) for which the sample is an admissible RVE should be used.

2.4 Effect of periodicity and pore volume loss control

Let us generate meshes for the Ref-400 foamed concrete under different periodicity (PER) and pore volume loss (PVL) settings. All the results to be presented henceforth were obtained using a personal computer with an Intel® Core i9-10900K CPU and 128 GB RAM.

Other than the PER/PVL settings, we adopt (from now on): porosity tolerance \(\varepsilon _\text {por}=0.5\%\), initial guess \(V_\text {\tiny {RVE}}^{(0)}=V_\text {\tiny {RVE}}^\text {max}\), maximum number of tries for PVL control \(n_\text {\tiny {PVL}}=10\), and PVL threshold \(\varepsilon _\text {\tiny {PVL}}=10\%\) (for PVL=1) or \(\varepsilon _\text {\tiny {PVL}}=\infty \) (for PVL=0).

Further, in a first approach, the least computationally demanding case is considered, that with the coarsest mesh (\(n_\text {ref}=1\)) and the smallest sample (\(n_\text {min}=1\)).

Fig. 3
figure 3

Effect of forced/unforced periodicity (PER=1/0) and controlled/uncontrolled pore volume loss (PVL=1/0) on the automatic mesh generation of the representative volume element (RVE) for the foamed concrete Ref-400 with cast density 400 kg/m\(^3\) and (targeted) porosity \(p=78.1\%\), assuming the smallest sample (\(n_\text {min}=1\)) and no mesh refinement (\(n_\text {ref}=1\)): a Exemplary meshes (for visualization purposes, the cement phase is transparent, and pores are colored according to their size). bg Mean, minimum and maximum attained porosity \(p_\text {conv}\), number \(N_\text {\tiny {RVE}}\) of voxels in the mesh, pore volume loss ratio \(\theta _\text {\tiny {PVL}}\), meshing time per iteration \(t_\text {mesh}/i_\text {conv}\), number of iterations \(i_\text {conv}\) to attain \(p_\text {conv}\) and computational time \(t_\text {mesh}\) for meshing

To account for the dispersion of results due to the randomness of the pore centers choice, ten meshes are generated for each PER/PVL setting. While \(V_\text {\tiny {RVE}}^{(0)}=V_\text {\tiny {RVE}}^\text {max}\) is adopted as the initial guess for the first mesh, the result of the previous run serves as initial guess for the subsequent meshes in an attempt (not always successful) to decrease the number \(i_\text {conv}\) of iterations to attain the desired porosity \(p_\text {conv}\). Examples of the so-generated meshes are shown in Fig. 3a. Figure 3b–g show the mean, the maximum and the minimum values of \(p_\text {conv}\), \(N_\text {\tiny {RVE}}\), \(\theta _\text {\tiny {PVL}}\), \(t_\text {mesh}/i_\text {conv}\), \(i_\text {conv}\) and \(t_\text {mesh}\), respectively. Being the stopping criterion, the converged porosity \(p_\text {conv}\) is always the targeted one \(p=78.1\%\) up to the adopted tolerance \(\varepsilon _\text {por}\). The number \(N_\text {\tiny {RVE}}\) of voxels in the RVE mesh varies between a minimum of \(13.0\times 10^6\) for PER=0/PVL=0 to a maximum of \(19.5\times 10^6\) for PER=1/PVL=1, increasing for PER=1 or PVL=1. The pore volume loss ratio \(\theta _\text {\tiny {PVL}}\) goes from a minimum of \(11.9\%\) for PER=1/PVL=1 to a maximum of \(41.6\%\) for PER=0/PVL=0, decreasing for PER=1 or PVL=1. Note that although PVL control succeeds to decrease \(\theta _\text {\tiny {PVL}}\), it is not enough to satisfy the constraint \(\theta _\text {\tiny {PVL}}\le 10\%\). Let us remind that this is a constraint on pore overlapping when PER=1. The currently adopted threshold \(\varepsilon _\text {\tiny {PVL}}=10\%\) is considerably lower (i.e. more restrictive) than that adopted by Wei et al [19] (\(40\%\)); in fact, all the 20 currently generated meshes for PER=1 largely satisfy the Wei et al’s pore overlapping constraint, even without PVL control. We did not find any information to define \(\varepsilon _\text {\tiny {PVL}}\) in Batool works [5, 17], source of the current data. The correct setting of \(\varepsilon _\text {\tiny {PVL}}\) increases the physical soundness of NRGene.

Regarding the meshing time \(t_\text {mesh}\), Fig. 3e shows that the simplest case (PER=0/PVL=0) is the cheapest one per iteration. To set PER=1 increases the average \(t_\text {mesh}/i_\text {conv}\) up to 2 times for the same PVL choice. On the other hand, to set PVL=1 is considerably more expensive, increasing the average \(t_\text {mesh}/i_\text {conv}\) up to 6.5 times for the same PER choice. However, although the choice PER=0/PVL=0 gives the lowest average meshing time per iteration \(t_\text {mesh}/i_\text {conv}=87.0\) sec, it frequently requires more iterations (higher \(i_\text {conv}\)), making \(t_\text {mesh}\) longer. Note that the average \(t_\text {mesh}=1301\) sec for PER=0/PVL=0 is 3.7 times larger than that for PER=1/PVL=0, the minimum one. In conclusion, even it is not the cheaper one per iteration, the choice PER=1/PVL=0 is the clear winner regarding the computational time for mesh generation. However, since PER=1/PVL=0 produces larger meshes than the cases without forced periodicity (PER=0/PVL=0 and PER=0/PVL=1), it remains to confirm if it is still the fastest setting for the whole process of determining the effective thermal conductivity when the time taken for computational homogenization is considered.

2.5 Sample representativeness

To improve the representativeness of the sample (making it really an RVE), it has to include more pores, which is controlled by the parameter \(n_\text {min}\) defining the number of rarest pores. The number \(N_\text {\tiny {RVE}}\) of voxels in the sample mesh increases almost linearly with \(n_\text {min}\). Being \(N_\text {\tiny {RVE}}\) already large for \(n_\text {min}=1\), it is apparent that \(n_\text {min}\) should be kept as small as possible to make the computation time affordable. For the expensive study of the effect of increasing \(n_\text {min}\), we adopt PER=1/PVL=0 to reduce the computational time. Then, ten meshes are generated per each \(n_\text {min}\) to account for the randomness of mesh generation. Exemplary meshes for \(n_\text {min}=2,3,4\) are shown in Fig. 4a. Figure 4b–g show the mean, the maximum and the minimum values of \(p_\text {conv}\), \(N_\text {\tiny {RVE}}\), \(\theta _\text {\tiny {PVL}}\), \(t_\text {mesh}/i_\text {conv}\), \(i_\text {conv}\) and \(t_\text {mesh}\), respectively, for \(n_\text {min}=1,2,3,4\). Once again, the stopping criterion \(|p_\text {conv}-p|\le 0.5\%\) is always satisfied. The number of voxels increases almost linearly from a mean \(N_\text {\tiny {RVE}}=18.5\times 10^6\) for the smallest sample (\(n_\text {min}=1\)) to a mean \(N_\text {\tiny {RVE}}=71.6\times 10^6\) for the biggest one (\(n_\text {min}=4\)). Regarding the PVL ratio \(\theta _\text {\tiny {PVL}}\), it slightly increases with \(n_\text {min}\) (from 16.4% to 19.0% considering the mean \(\theta _\text {\tiny {PVL}}\)).

Regarding the computational time per iteration \(t_\text {mesh}/i_\text {conv}\), it increases faster than linearly, i.e., faster than \(N_\text {\tiny {RVE}}\). This, together with the (slight) increase of \(i_\text {conv}\), contributes to an even faster growth of the total meshing time \(t_\text {mesh}\), which increases 32.6 times from \(n_\text {min}=1\) to \(n_\text {min}=4\) in average. In consequence, the generation of the meshes with \(n_\text {min}=4\) becomes excessively expensive, taking up to 6.5 h in average.

Fig. 4
figure 4

Effect of the sample size (determined by the number \(n_\text {min}\) of rarest pores) on the automatic mesh generation of the representative volume element (RVE) for the foamed concrete Ref-400 with cast density 400 kg/m\(^3\) and (targeted) porosity \(p=78.1\%\), assuming forced periodicity (PER=1), uncontrolled pore volume loss (PVL=0) and no mesh refinement (\(n_\text {ref}=1\)): a Exemplary meshes (for visualization purposes, the cement phase is transparent, and pores are colored according to their size). bg Mean, minimum and maximum attained porosity \(p_\text {conv}\), number \(N_\text {\tiny {RVE}}\) of voxels in the mesh, pore volume loss ratio \(\theta _\text {\tiny {PVL}}\), meshing time per iteration \(t_\text {mesh}/i_\text {conv}\), number of iterations \(i_\text {conv}\) to attain \(p_\text {conv}\) and computational time \(t_\text {mesh}\) for meshing

2.6 Mesh refinement

The refinement of the mesh is controlled by the parameter \(n_\text {ref}=D_1/h_\text {max}\) relating the minimum pore size \(D_1\) to the maximum voxel size \(h_\text {max}\). The effect of \(n_\text {ref}\) on the mesh size is much more critical than that of \(n_\text {min}\): while \(N_\text {\tiny {RVE}}\) is approximately proportional to \(n_\text {min}\), it is a cubic function of \(n_\text {ref}\). Once again, to reduce the computational time, we adopt PER=1/PVL=0 and \(n_\text {min}=1\). The effect of the randomness of mesh generation was studied for \(n_\text {ref}=2\) only, based on the results for ten meshes; one of these meshes is shown in Fig. 5a. Due to the huge computational time, this was unaffordable for \(n_\text {ref}=3\), for which only one mesh shown in Fig. 5b was generated; it has more than 500 millions voxels and is possibly very close to the finest mesh we can generate using our computational resources due to memory limitations.

Fig. 5
figure 5

Effect of mesh refinement on the automatic mesh generation of the representative volume element (RVE) for the foamed concrete Ref-400 with cast density 400 kg/m\(^3\) and (targeted) porosity \(p=78.1\%\), assuming forced periodicity (PER=1), uncontrolled pore volume loss (PVL=0) and smallest sample (\(n_\text {min}=1\)): ab exemplary mesh for \(n_\text {ref}=2\) and unique mesh for \(n_\text {ref}=2\) (for visualization purposes, the cement phase is transparent, and pores are colored according to their size). ch Mean, minimum and maximum attained porosity \(p_\text {conv}\), number \(N_\text {\tiny {RVE}}\) of voxels in the mesh, pore volume loss ratio \(\theta _\text {\tiny {PVL}}\), meshing time per iteration \(t_\text {mesh}/i_\text {conv}\), number of iterations \(i_\text {conv}\) to attain \(p_\text {conv}\) and computational time \(t_\text {mesh}\) for meshing

Figure 5c–h show \(p_\text {conv}\), \(N_\text {\tiny {RVE}}\), \(\theta _\text {\tiny {PVL}}\), \(t_\text {mesh}/i_\text {conv}\), \(i_\text {conv}\) and \(t_\text {mesh}\) (their unique values for \(n_\text {ref}=3\), the mean, the maximum and the minimum for \(n_\text {ref}=2\)). For \(n_\text {ref}=3\), it cannot be stated how close to the mean, the maximum or the minimum the values from one mesh are. Note that the current meshes for \(n_\text {ref}=2\) and \(n_\text {min}=1\) have about 2 times more voxels than the meshes for \(n_\text {min}=4\) and \(n_\text {ref}=1\) shown in Sect. 2.5, as expected since \(N_\text {\tiny {RVE}}\) is approximately proportional to \(n_\text {ref}^3\), on one hand, and to \(n_\text {min}\), on the other hand. Further, the pore volume loss seems to be slightly affected by pore refinement.

Regarding the computational time per iteration, it is approximately proportional to \(n_\text {ref}^3\), like \(N_\text {\tiny {RVE}}\). The number \(i_\text {conv}\) of iterations to attain \(p_\text {conv}\) increases when refining from \(n_\text {ref}=1\) and \(n_\text {ref}=2\) in mean as well as in maximum. However, it cannot be concluded that refinement deteriorates convergence based on only two values of \(n_\text {ref}\).

As to the total meshing time \(t_\text {mesh}\), a large dispersion can be observed for \(n_\text {ref}=2\), associated to the large dispersion in \(i_\text {conv}\) for this case. So, it took up to 4.3 h to generate a mesh with \(n_\text {ref}=2\), while it took 4.2 h to generate the finest mesh (maybe, by chance, the only run for \(n_\text {ref}=3\) was a fast one).

Given the huge computational time and power required by mesh refinement, it is critical to keep \(n_\text {ref}\) (much more than \(n_\text {min}\)) as small as possible.

3 Computational homogenization

In this section, we use computational homogenization to compute the effective thermal conductivity of two-phase composites, particularly, the foamed concretes with RVEs automatically generated as it was described in the previous section. To this end, the voxelized RVE is assimilated to an uniform mesh of linear hexahedral (“brick”) finite elements.

A priori, the effective thermal conductivity of a foamed concrete should account not only for the heat conduction through the solid and gas phases but also for thermal convection and radiation inside the pores [36, 37]. The influence of radiation increases with pore size, porosity and temperature, and it is usually modeled [19, 36, 37] by augmenting the conductivity of the gas inside the pore using the formula for radiation inside spherical pores derived by Loeb [38].

Regarding convection, it has always been neglected for foamed concretes [19, 36, 37] invoking the small size of the pores.

So, assuming the radiation modeled by increasing the gas thermal conductivity and neglecting the heat convection, the determination of the effective thermal conductivity in foamed concretes becomes a pure heat conduction problem. This usual approach is adopted in this section.

The (micro-scale) thermal conductivity \({\textbf{k}}_\mu \) in the RVE is an heterogeneous field whose value at a point \({\textbf{x}}\) is that of the constituent of the RVE at this point. Knowing the \({\textbf{k}}_\mu \) distribution in the RVE, we determine the effective (macro-scale) thermal conductivity \({{\bar{{\textbf{k}}}}}\) by using computational homogenization following the temperature gradient approach proposed by Yvonnet [32]. To this end, we have to solve the localization problem: given the macroscopic temperature gradient \({{\bar{{\textbf{G}}}}}\), find the temperature \(T({\textbf{x}})\) in the RVE domain \(\Omega _\text {\tiny {RVE}}\) satisfying the heat conduction Eq.

$$\begin{aligned} {{\,\textrm{div}\,}}({\textbf{k}}_\mu ({\textbf{x}}){{\,\textrm{grad}\,}}T)=0, \end{aligned}$$
(17)

and verifying

$$\begin{aligned} \langle {{\,\textrm{grad}\,}}T\rangle ={{\bar{{\textbf{G}}}}}, \end{aligned}$$
(18)

being \(\langle f\rangle =(1/V_\text {\tiny {RVE}})\int _{\Omega _\text {\tiny {RVE}}}f({\textbf{x}})\,\text {d}V\) the volume average of \(f({\textbf{x}})\) over \(\Omega _\text {\tiny {RVE}}\).

To automatically satisfy the Eq. (18), let us assume the heat Eq. (17) subject to the periodic boundary condition

$$\begin{aligned} T({\textbf{x}}_\alpha )-T({\textbf{x}}_\beta )={{\bar{{\textbf{G}}}}}\cdot ({\textbf{x}}_\alpha -{\textbf{x}}_\beta ) \end{aligned}$$
(19)

at any couple \(({\textbf{x}}_\alpha ,{\textbf{x}}_\beta )\) of opposite points in the closure \(\partial \Omega _\text {\tiny {RVE}}\) of \(\Omega _\text {\tiny {RVE}}\).

Now, we use the standard finite element method (FEM) to solve the localization problem consistent of the heat conduction Eq. (17) subject to the periodic boundary condition (19). Then, the unknown micro-scale temperature field in the RVE is approximated as

$$\begin{aligned} T({\textbf{x}})=\sum _{i=1}^{N_\text {nod}} \phi _i({\textbf{x}}) T_i, \end{aligned}$$
(20)

where \(\phi _i({\textbf{x}})\) is the shape function associated to the node \({\textbf{x}}_i\), \(i=1,2,\dots ,N_\text {nod}\), and \(T_i\) is the unknown temperature at \({\textbf{x}}_i\).

After replacing T by its FEM approximation, adopting the shape functions as weighting functions and integrating over \(\Omega _\text {\tiny {RVE}}\), the heat conduction Eq. (17) takes the form

$$\begin{aligned} {\textbf{K}}{\textbf{T}}={\textbf{0}}_{N_\text {nod}\times 1}, \end{aligned}$$
(21)

where \({\textbf{T}}\) is the \(N_\text {nod}\times 1\)-vector with components \(T_i\), \({\textbf{0}}_{i\times j}\) is the \(i\times j\)-null matrix, and \({\textbf{K}}\) is the typical FEM conductivity \(N_\text {nod}\times N_\text {nod}\)-matrix:

$$\begin{aligned} {\textbf{K}}=\int _{\Omega _\text {\tiny {RVE}}}{\textbf{B}}^T{\textbf{k}}_\mu {\textbf{B}}\,\text {d}V, \end{aligned}$$
(22)

y where \({\textbf{B}}\) is the gradient matrix (such that \({\textbf{B}}{\textbf{T}}={{\,\textrm{grad}\,}}T\)), with components \(B_{ij}=\partial {\phi _j}/{\partial x_i}\).

On the other hand, the periodic boundary conditions (19) gives raise to the linear equality constraints

$$\begin{aligned} {\textbf{P}}{\textbf{T}}={\textbf{R}}, \end{aligned}$$
(23)

where \({\textbf{P}}\) is a \(N_\text {con}\times N_\text {nod}\)-highly sparse matrix and \({\textbf{R}}\) is a \(N_\text {con}\times 1\)-vector, being \(N_\text {con}\) the number of constraints, that is the number of couples of opposite nodes in the faces of the RVE finite element mesh. If \(({\textbf{x}}_\alpha ,{\textbf{x}}_\beta )\) is the i-th couple of opposite nodes, then

$$\begin{aligned} R_i&={{\bar{{\textbf{G}}}}}\cdot ({\textbf{x}}_\alpha -{\textbf{x}}_\beta ), \end{aligned}$$
(24)
$$\begin{aligned} P_{ij}&={\left\{ \begin{array}{ll} 1&{}\text {if }j=\alpha ,\\ -1&{}\text {if }j=\beta ,\\ 0&{}\text {otherwise.} \end{array}\right. } \end{aligned}$$
(25)

Yvonnet [32] proposes to prescribe the equality constraints (23) to the FEM heat conduction Eq. (21) by using Lagrange multipliers, giving raise to the augmented linear system

$$\begin{aligned} \begin{bmatrix} {\textbf{K}}&{}{\textbf{P}}^T\\ {\textbf{P}}&{}{\textbf{0}}_{N_\text {con}\times N_\text {con}} \end{bmatrix}\begin{bmatrix} {\textbf{T}}\\ \mathbf {\Lambda }\end{bmatrix}=\begin{bmatrix} {\textbf{0}}_{N_\text {nod}\times 1}\\ {\textbf{R}}\end{bmatrix}, \end{aligned}$$
(26)

where \(\mathbf {\Lambda }\) is the \(N_\text {con}\times 1\)-vector of Lagrange multipliers.

Given the computational resources at our disposal, to use direct methods for solving the above linear system for the frequently fine meshes needed for a high-fidelity description of the RVE of foamed concretes (above five hundred millions finite elements for the finest mesh, that with \(n_\text {ref}=3\), see Sect. 2.6) is unaffordable due to memory requirements. So, in general, the use of iterative solvers is indispensable. Among them, the least memory-consuming is the conjugate gradient (CG) method [39]. Actually, it is the most effective solver in Matlab for large symmetric positive definite systems [40]. To this end, we convert the semi-definite system (26) to an equivalent but positive definite system using static condensation technique, as done by Toro et al. [41]. This is described in Appendix II.

Finally, the effective (or macroscopic) thermal conductivity tensor \({{\bar{{\textbf{k}}}}}\) in the RVE is computed as [32]

$$\begin{aligned} {{\bar{{\textbf{k}}}}} = \int _{\Omega _\text {\tiny {RVE}}}{\textbf{k}}_\mu {\textbf{B}}\, [{\textbf{T}}_1 \, {\textbf{T}}_2 \, {\textbf{T}}_3] \,\text {d}V. \end{aligned}$$
(27)

where \({\textbf{T}}={\textbf{T}}_i\), \(i=1,2,3\) is determined by solving Eq. (26) for the prescribed macroscopic gradient \({{\bar{{\textbf{G}}}}}={\textbf{e}}_i\) coincident with the canonical vector \({\textbf{e}}_i\) of a Cartesian frame aligned with the sides of the RVE.

4 Results

In this section, we show the results of computational homogenization applied to all the RVE meshes generated by NRGene for the foamed concrete labeled Ref-400. Let \({\textbf{k}}_\mu ={\textbf{k}}_\text {solid}\) in solid voxels and \({\textbf{k}}_\mu ={\textbf{k}}_\text {air}\) in air voxels. Following Cebeci [42], who reported an imperceptible effect of the foaming process on the fine pore structure of the hardened cement paste, we assume the conductivity \({\textbf{k}}_\text {solid}\) of the solid phase equal to that of the hardened cement paste, as done by Wei et al [19]. Further, since Batool’s test were performed at room temperature, the effect of radiation in the pores of foam concretes is not noticeable [36], so we neglect it. For Ref-400, we assume \(k_\text {solid}=0.458\) Wm\(^{-1}\)K\(^{-1}\) and \(k_\text {air}=0.026\) Wm\(^{-1}\)K\(^{-1}\), constant values given by Batool [5, 17]. Both conductivities are isotropic, so \({\textbf{k}}_\text {solid}=k_\text {solid}{\textbf{I}}\) and \({\textbf{k}}_\text {air}=k_\text {air}{\textbf{I}}\), where \({\textbf{I}}\) is the second-order identity tensor.

The effective thermal conductivity \({{\bar{{\textbf{k}}}}}\) is a symmetric second-order tensor, which should be approximately isotropic given the isotropy of the constituents, the sphericity of the pores and the randomness of their positions, which is strictly true in the case the sample is large enough, i.e., if the number \(n_\text {min}\) of rarest pores is large enough. To measure the lack of isotropy, we define the anisotropy ratio

$$\begin{aligned} \theta _\text {aniso}=\frac{\max ({{\bar{k}}}_{11},{{\bar{k}}}_{22},\bar{k}_{33})}{\min ({{\bar{k}}}_{11},{{\bar{k}}}_{22},{{\bar{k}}}_{33})}-1 \end{aligned}$$
(28)

Note that \(\theta _\text {aniso}\ge 0\), being \(\theta _\text {aniso}=0\) for isotropic conductivity.

Fig. 6
figure 6

Effect of the mesh generation setting on the anisotropy ratio \(\theta _\text {aniso}\) of the foam Ref-400: a Free or forced periodicity (PER=0 or 1) and free or controlled pore volume loss (PVL=0 or 1); b increasing sample size; and c increasing mesh refinement

Figure 6 shows the mean, minimum and maximum \(\theta _\text {aniso}\) for all the meshes produced by NRGene for Ref-400. Considering the smallest sample (that having only one rarest pore, i.e., \(n_\text {min}=1\)), the mean \(\theta _\text {aniso}\) varies between a minimum 5.7% for PER=1/PVL=1 to a maximum 8.6% for PER=1/PVL=0, as shown in Fig. 6a. Even for the worst case (PER=1/PVL=0), Fig. 6b shows that the mean \(\theta _\text {aniso}\) continuously decreases when the number of rarest pores increases, attaining 3.9% for \(n_\text {min}=4\). Finally, Fig. 6c shows that anisotropy is slightly affected by mesh refinement.

Since \(\theta _\text {aniso}\) is relatively small for all the meshes and decreases as the sample size increases, we conclude that the expected isotropy of the foamed concrete is properly reproduced. Then, we define the “isotropic” thermal conductivity as

$$\begin{aligned} {{\bar{k}}}_\text {iso}=\frac{{{\bar{k}}}_{11}+{{\bar{k}}}_{22}+{{\bar{k}}}_{33}}{3}, \end{aligned}$$
(29)

Figure 7 shows the mean, minimum and maximum \(\bar{k}_\text {iso}\) for all the generated meshes for the foamed concrete Ref-400. Considering all the different mesh generation settings (PER/PVL, \(n_\text {min}\), \(n_\text {ref}\)), the maximum difference in the mean \({{\bar{k}}}_\text {iso}\) is 0.0018 Wm\(^{-1}\)K\(^{-1}\). Further, \({{\bar{k}}}_\text {iso}\), either in mean, minimum or maximum, always lies in the range \(k_\text {exp}\pm \sigma \), being \(k_\text {exp}=0.076\) Wm\(^{-1}\)K\(^{-1}\) and \(\sigma =0.0045\) Wm\(^{-1}\)K\(^{-1}\) the mean and the standard deviation of the effective thermal conductivity of Ref-400 from Batool’s experiments [17].

Figure 7 also serves to highlight a crucial advantage of approximating the effective isotropic thermal conductivity as the average of the diagonal components \({{\bar{k}}}_{ii}\) instead of by only one \({{\bar{k}}}_{ii}\) as usual [19, 24]: the dispersion of results is considerably reduced. Note that \(\max |k_\text {exp}-\bar{k}_\text {iso}|<\sigma \) but \(\max |k_\text {exp}-{{\bar{k}}}_{ii}|>\sigma \) for all the cases. The low dispersion of results sensibly increases the confidence in results obtained for only one randomly generated mesh, as it is clearly apparent for \(n_\text {ref}=3\).

Fig. 7
figure 7

Effect of the mesh generation setting on the effective thermal conductivity \({{\bar{k}}}_\text {iso}=({{\bar{k}}}_{22}+\bar{k}_{22}+{{\bar{k}}}_{33})/3\) (given en Wm\(^{-1}\)K\(^{-1}\)) of the foam Ref-400: a Free or forced periodicity (PER=0 or 1) and free or controlled pore volume loss (PVL=0 or 1); b increasing sample size; and c increasing mesh refinement. Black error bars indicate the minimum and maximum of \({{\bar{k}}}_\text {iso}\), while red error bars indicate those of \({{\bar{k}}}_{11}\), \({{\bar{k}}}_{22}\) and \(\bar{k}_{33}\)

Since all the mesh generation settings (PER/PVL, \(n_\text {min}\), \(n_\text {ref}\)) produce similar results for the effective thermal conductivity, let us determine the best choice based on the computational time only, which clearly motivates the choice of the smallest sample (with \(n_\text {min}=1\) rarest pore) and the coarsest mesh (with the minimum pore diameter equal the maximum voxel size, i.e. \(n_\text {ref}=1\)). Regarding the PER/PVL setting, as shown in Sect. 2.3, PER=1/PVL=0 is the best deal regarding the meshing time \(t_\text {mesh}\).

As to the time \(t_\text {homog}\) taken by computational homogenization, Fig. 8 confirms the expected increase with \(n_\text {min}\) and \(n_\text {ref}\), up to a maximum of almost a day for the only run with \(n_\text {ref}=3\). Further, \(t_\text {homog}\) increases with the increase of the PER/PVL complexity (i.e., for PER=1 or PVL=1), as it is also expected due to the increase of \(N_\text {\tiny {RVE}}\) for PER=1 or PVL=1, as shown in Sect. 2.4. So, the simplest setting PER=0/PVL=0 is the best deal considering \(t_\text {homog}\). However, considering the total time taken for computing the effective conductivity, that is \(t_\text {mesh}+t_\text {homog}\), the best deal coincides to that for \(t_\text {mesh}\) alone: PER=1/PVL=0.

Fig. 8
figure 8

Effect of the mesh generation setting on the computational time taken by mesh generation and homogenization for the foam Ref-400: a Free or forced periodicity (PER=0 or 1) and free or controlled pore volume loss (PVL=0 or 1); b increasing sample size; and c increasing mesh refinement

5 Benchmarking for simplified models

One of the main goals of the frequently expensive high-fidelity model proposed here is to constitute a benchmark for simplified models.

Here, in order to decrease the computational time, we propose a simplified model of the foam with histogram \(H=\{D_1,n_1,\dots ,D_Q,n_Q\}\) and porosity p based on neglecting those pores with diameter \(D_q<D_{q_\text {min}}\) for a given integer parameter \(q_\text {min}=2,3,\dots ,Q-1\).

Note that this simplified model is a straightforward application of the current methodology: just consider a foam with porosity p and histogram \(H=\{D_{q_\text {min}},n_{q_\text {min}},\dots ,D_Q,n_Q\}\). Since the largest voxel size is proportional to the minimum pore diameter, this simplification has an immediate lowering effect on the number of voxels.

Figure 9a shows one of the ten automatically generated meshes for Ref-400 for increasing \(q_\text {min}=2,3,4,5\) (i.e., increasing simplification) using the settings PER=1/PVL=0, and \(n_\text {min}=n_\text {ref}=1\). It is clearly apparent the huge reduction in the number \(N_\text {\tiny {RVE}}\) of voxels, down to \(N_\text {\tiny {RVE}}=20\times 20\times 20\) for \(q_\text {min}=5\). For larger \(q_\text {min}\), the iterative mesh generation process did not converge, which can be physically explained by the impossibility of accommodating the given porosity without small enough pores.

Fig. 9
figure 9

Effect of neglecting the pores with diameter less than \(D_{q_\text {min}}\) on the automatically generated meshes for the foamed concrete Ref-400 with cast density 400 kg/m\(^3\) and (targeted) porosity \(p=78.1\%\), assuming forced periodicity (PER=1), uncontrolled pore volume loss (PVL=0), smallest sample (\(n_\text {min}=1\)), and no mesh refinement (\(n_\text {ref}=1\)): a exemplary meshes (for visualization purposes, the cement phase is transparent, and pores are colored according to their size). bc Mean, minimum and maximum effective thermal conductivity and the required computational times

Figure 9b shows the effect of \(q_\text {min}\) on the effective thermal conductivity \({{\bar{k}}}_\text {iso}\); note that maximum difference considering all \(q_\text {min}\) is very small: 4.6\(\times 10^{-4}\) Wm\(^{-1}\)K\(^{-1}\), i.e., almost ten times smaller than the standard deviation \(\sigma \) in the experimentally measured \(k_\text {exp}\) for this foam [17]. Regarding the total computational time (Fig. 9c), the advantage of this simplification is impressive: to compute \({{\bar{k}}}_\text {iso}\) for \(q_\text {min}=4\) or 5 takes around 2 s, that is about 600 times less than doing it without simplification.

Batool [5, 17] related the thermal conductivity of foamed concretes to D(50) and D(90), which are the diameters for which the cumulative number of pores reaches 50 and 90%, respectively. They found that D(50) correlates better than D(90) to the thermal conductivity of all the concrete foams they studied, including the current Ref-400. This observation let them conclude that the smaller pores have a greater influence than the bigger ones on the thermal conductivity of foamed concretes.

For the present foamed concrete Ref-400, \(D(50)=0.04\) mm and \(D(90)=0.17\) mm; so, considering the values of \(D_i\) for Ref-400 shown in Fig. 2b, \(D_2<D(50)<D_3\) and \(D_4< D(90)<D_5\). In consequence, the current simplified model neglects all the pores smaller than D(50) for \(q_\text {min}=3\) and smaller than D(90) for \(q_\text {min}=5\), giving for both cases a similar \(\bar{k}_\text {iso}\) than that computed without neglecting these small pores. This contradicts Batool’s statement on the relevance of small pores on thermal conductivity. Our results show that it is not the cumulative number of pores up to a certain diameter \(D(*)\) but their cumulative volume up to this diameter who affects the thermal conductivity.

Fig. 10
figure 10

Cumulative number and volume of pores in the foamed concrete Ref-400

Figure 10 shows the cumulative volume of all the pores with diameter below \(D_{q_\text {min}}\), given by

$$\begin{aligned} V_{q_\text {min}-1}^\text {cum}=\sum _{q=1}^{q_\text {min}-1}V_{q}=\sum _{q=1}^{q_\text {min}-1}n_q\frac{\pi }{6} D_q^3, \end{aligned}$$
(30)

in comparison to the cumulative number of pores. Regarding the pores with diameter below \(D_3=70\,\mu \)m, their number is 47.05% of the total number of pores but their volume is just 0.037% of the maximal volume of pores \(V_\text {por}^\text {max}\), which explains the low effect of neglecting pores smaller than \(D_3\) on porosity and, finally, on thermal conductivity. Since \(D_2<D(50)<D_3\), the effect of neglecting pores with diameter below D(50) is identical.

For \(q_\text {min}=5\) (the most simplified model), the pores with diameter below \(D_5=280\,\mu \)m are 89.17% of all the pores but their volume is just 2.10% of \(V_\text {por}^\text {max}\) or 1.77% of the mean volume of the RVE volume for \(q_\text {min}=5\). In this case, the contribution of the pores with diameter below \(D_5\) to total volume of pores is not negligible but there is still a low effect on the thermal conductivity. Most probably, this is due to the nature of the inputs of the current model: the histogram H is truncated but the porosity p is the original one.

So, we conclude that the relevant pores in the computation of the effective thermal conductivity are those with diameter not smaller than \(q_\text {min}\), with \(q_\text {min}\) being the maximum diameter level q to guarantee the attainment of the prescribed porosity as well as to satisfy

$$\begin{aligned} \frac{V_{q_\text {min}-1}^\text {cum}}{V_\text {por}^\text {max}}\le \varepsilon _\text {cut}, \end{aligned}$$
(31)

for a small enough \(\varepsilon _\text {cut}\), say \(\varepsilon _\text {cut}=0.1\%\).

5.1 Application to other foamed concretes

The validity of this simplified model largely extends the range of application of the current methodology from expensive high-fidelity computations for benchmarking purposes to engineering and industrial everyday problems. Now, we can apply it to a large set of foamed concretes in affordable times. Let us consider the 21 foamed concretes studied by Batool [17], one of them being the just considered Ref-400. Let us label these foamed concretes as X-\(\rho \), with X referring to the cement paste type (Ref, FA10, FA20, SF10, SF20, MK10, MK20) and \(\rho \) to the cast density in kg/m\(^3\) (400, 600, 800). The histograms and porosities of all these foamed concretes are given in Figs. 14, 15, 16 and 17 in the Appendix III. Note the wide range of porosities: from 49.1% for Ref-800 to 83.1% for SF20-400.

All the results presented in this section were obtained using the following settings: PER=1, PVL=0, \(\varepsilon _\text {por}=0.5\%\), \(n_\text {min}=1\), \(n_\text {ref}=1\), and \(\varepsilon _\text {cut}=0.1\%\).

Figure 11 allows to compare the results of the current simplified model and Batool’s experiments [17]. The magnitude \(|{{\bar{k}}}_\text {iso}-k_\text {exp}|\) of the difference between the modeled and the measured effective thermal conductivity is as small as 0.005 Wm\(^{-1}\)K\(^{-1}\) in average. Even the maximum \(|{{\bar{k}}}_\text {iso}-k_\text {exp}|\) obeys the well-known \(3\sigma \)-rule of thumb of empirical sciences [43], which states that 99.7% of the measured data in a normal distribution is within three standard deviations of the mean. Note that \(\max (|{{\bar{k}}}_\text {iso}-k_\text {exp}|)=0.0169\) Wm\(^{-1}\)K\(^{-1}\) appears for the foam FA20-800, for which the mean measured thermal conductivity is \(k_\text {exp}=0.182\) Wm\(^{-1}\)K\(^{-1}\) with a standard deviation \(\sigma =0.007\) Wm\(^{-1}\)K\(^{-1}\). On the other hands, the model-experiment fitting is almost perfect for some foams: for instance, \(|{{\bar{k}}}_\text {iso}-k_\text {exp}|<0.0004\) Wm\(^{-1}\)K\(^{-1}\) for Ref-600 and MK20-600.

Fig. 11
figure 11

Effective thermal conductivity of 21 foamed concretes: comparison between results using the simplified model and experiments [17]

5.2 Comparison to analytical formulas

Several analytical formulas for two-phase mixtures have been used to compute the effective conductivity of foams [17, 19, 24, 44,45,46,47,48,49], the most popular ones being those of Maxwell [13] and Bruggeman [21], defined for foamed concretes as

$$\begin{aligned} k_\text {\tiny {M}}&=\left( {R_\text {solid}} \frac{2R_\text {air}+R_\text {solid}+p(R_\text {air}-R_\text {solid})}{2R_\text {air}+R_\text {solid}-2p(R_\text {air}-R_\text {solid})}\right) ^{-1}, \end{aligned}$$
(32)
$$\begin{aligned} k_\text {\tiny {B}}&=\frac{1}{4}\left( 2k-k'+\sqrt{(2k-k')^2+8k_\text {air}k_\text {solid}}\right) , \end{aligned}$$
(33)

respectively, being \(R_\text {air}=1/k_\text {air}\) and \(R_\text {solid}=1/k_\text {solid}\) the thermal resistance of the air and the solid phase, \(k=pk_\text {air}+(1-p)k_\text {solid}\), and \(k'=(1-p)k_\text {air}+p k_\text {solid}\).

Maxwell published the formula (32) in 1873 to compute the electrical resistance of a medium with dispersed spherical inclusions; in 1940, Eucken [50] proposed to apply it to determine the thermal conductivity (inverse of the resistance) in such medium, reason why it is also called the Eucken formula [51] or, more frequently, the Maxwell-Eucken formula [44, 45, 48, 52]. Further, note that the Maxwell formula gives the Hashin-Shtrikman upper bound for isotropic conductivity [53].

Similarly, Bruggeman formula (33) was proposed in 1935 to compute the dielectric constant of a medium with disordered spherical aggregates; in 1952, Landauer [54] derived an identical formula for the thermal conductivity using the effective medium theory (EMT), so Eq. (33) is referred to as EMT by several authors [17, 19, 44, 45, 48, 49, 55].

Like in the current work, these formulas assume the pores to be spherical inclusions. Further, Maxwell [13] assumed that the sphere radii are small compared with the distances between spheres, which allows to neglect the interference between inclusions. To satisfy this hypothesis, p must be small, which is not the case for foamed concretes. The Bruggeman formula also neglects interference between inclusions, so it should not be applied for high p either.

For materials with high concentration of inclusions, Pal [52] recommended the Nielsen formula [23]

$$\begin{aligned} k_\text {\tiny {Nielsen}} = k_\text {solid}\frac{1+A\frac{k_\text {air}/k_\text {solid}-1}{k_\text {air}/k_\text {solid}+A}p}{1-\frac{k_\text {air}/k_\text {solid}-1}{k_\text {air}/k_\text {solid}+A}\left( 1 + \frac{1-p_\text {max}}{p_\text {max}^2}p\right) p}, \end{aligned}$$
(34)

where A is a constant associated to the shape of the inclusions (\(A=1.5\) for spheres) and \(p_\text {max}\) is the maximum packing fraction (i.e., the maximum attainable porosity in the case of foamed concretes), which depends on the type of packing, ranging from 0.524 for simple cubic packing to 0.7405 for hexagonal close (HCP) and face-centered cubic (FCC) packings.

Although not tested yet –up to our knowledge– to foamed concretes, Pal’s recommendation [52] makes the Nielsen formula appealing to this end. A priori, the assumption of a random close packing (RCP) of spheres (\(A=1.5\) and \(p_\text {max}=0.637\)) seems to be the most appropriate to represent foamed concretes among the choices offered by Nielsen [23]. In the bibliographic review supporting this work, the only reference we found concerning the way the pores are packed in foamed concretes is the work of Miled and Limam [24], who assumed –without arguments– a body-centered cubic (BCC) arrangement; this amounts to adopt \(A=1.5\) and \(p_\text {max}=0.60\) in the Nielsen formula [23].

Further, we will test the assumption of HCP or FCC-packed spheres (\(A=1.5\) and \(p_\text {max}=0.7405\)), not motivated by any observation on the arrangement of pores in foamed concretes but by the fact that it allows the highest maximum packing fraction \(p_\text {max}=0.7405\) among the options given by Nielsen [23].

Strictly speaking, although Pal [52] recommended it for high volume fractions of inclusions, the Nielsen formula is valid only for \(p\le p_\text {max}\). Note that applied to \(A=1.5\) (spherical pores) at the limit \(p=1\) (only air), the Eq. (34) gives \(k_\text {\tiny {Nielsen}}\approx 0.75\,k_\text {air}\) for \(p_\text {max}=0.637\) (RCP), \(k_\text {\tiny {Nielsen}}\approx 0.70\,k_\text {air}\) for \(p_\text {max}=0.60\) (BCC), and \(k_\text {\tiny {Nielsen}}\approx 0.85\,k_\text {air}\) for \(p_\text {max}=0.7405\) (HCP and FCC), while it should be exactly \(k_\text {air}\). Among the currently studied foamed concreted, all those with the lowest cast density (\(\rho =400\) kg/m\(^3\)) have porosities above \(76\%\), i.e., beyond the theoretical range of validity for the Nielsen formula. Indeed, Nielsen [23] reported a generally good agreement between experiments just for lower concentrations of inclusions.

Fig. 12
figure 12

Effective thermal conductivity of 21 foamed concretes: comparison between the experiments [17] and the results using the analytical formulas of Maxwell (M), Bruggeman (B), and Nielsen for random close (RCP), body-centered cubic (BCC) and hexagonal close or face centered-cubic (HCP/FCC) packed spheres

Figure 12 shows the fitting of these analytical models to experiments. Regarding the Maxwell formula, note that \(k_\text {\tiny {M}}>k_\text {exp}\) for all the foams, except for FA20-800. Since \(k_\text {\tiny {M}}\) is the upper bound of the conductivity of an isotropic porous medium for a given porosity [53], the experimental result for FA20-800 contradicts the starting hypothesis of isotropy. Note that FA20-800 is just that foam for which the current numerical model fits the experiments the worst, as shown in Fig. 11 and discussed in Sect. 5.1.

On the contrary, the Bruggeman formula and the Nielsen formulas for BCC and RCP always overestimate \(k_\text {exp}\). Meanwhile, Nielsen formula for HCP or FCC gives results that fluctuate around \(k_\text {exp}\) and sensibly outperforms the other analytical formulas in terms of closeness to Batool’s experiments.

Figure 13a merges Figs. 11 and 12 for an overview of the goodness of all the models in fitting the experiments, which is quantified in Fig. 13b by either \(|{{\bar{k}}}_\text {iso}-k_\text {exp}|\) for the proposed model or \(|k_\text {a}-k_\text {exp}|\) with a=M, B, or Nielsen-(*) for the Maxwell, Bruggeman, or Nielsen formulas for (*)=RCP, BCC and HCP/FCC, respectively.

Fig. 13
figure 13

Effective thermal conductivity of 21 foamed concretes: a Results using the current numerical model an the analytical formulas of Maxwell, Bruggeman, and Nielsen for random close (RCP), body-centered cubic (BCC) and hexagonal close or face centered-cubic (HCP/FCC) packed spheres, compared to experimental data [17]. b Mean, minimum and maximum magnitude of the difference between models and experiments. c Mean, minimum and maximum magnitude of the difference between analytical models and the current numerical model

There, it is quickly apparent from Fig. 13b that the current model sensibly outperforms the analytical models, except Nielsen-HCP/FCC, being the Bruggeman model the worst choice. The magnitude of the difference with experiments for Nielsen-HCP/FCC is slightly smaller than that for the current model in average (0.00515 Wm\(^{-1}\)K\(^{-1}\) vs. 0.00532 Wm\(^{-1}\)K\(^{-1}\)), but it is slightly higher regarding the maximum value (0.0190 Wm\(^{-1}\)K\(^{-1}\) vs. 0.0169 Wm\(^{-1}\)K\(^{-1}\)). The goodness in fitting experiments can be explained for the current numerical model by the careful representation of pore size distribution in foamed concretes, but it is unexpected for the Nielsen-HCP/FCC formula since it assumes HCP or FCC-packed (indistinctly) spherical and non-overlapped pores with a very narrow size distribution (not higher than 15 \(\mu \)m [56]), which is far from observations in foamed concretes.

In any case, the goodness of the analytical Nielsen-HCP/FCC formula does not devalue the current model, which does not need calibration to fit experiments and serves to replace them for the purpose of calibrating simplified numerical or analytical models. This is clearly apparent looking at \(|k_\text {a}-{{\bar{k}}}_\text {iso}|\), the magnitude of the difference between analytical and the currently modeled conductivities, shown in Fig. 13c. Actually, Fig. 13c let us arrive to conclusions on the goodness of the considered analytical formulas that are identical to those derived from Fig. 13b, but without the need of experimental data.

6 Conclusions

In this work, we have first introduced NRGene, an automatic generator of three-dimensional representative volume elements (RVEs) for porous materials specially addressed to foamed concretes. For a high fidelity description of the porous structure of such materials, NRGene generates the pores obeying their size distribution. This is an iterative process where all the pores defined by a given histogram of pore size distribution are randomly placed into a cubic sample, whose size is updated until attaining the desired porosity. Being the pores gaseous inclusions, unlike materials with solid inclusions, the pores overlapping is allowed but controlled to avoid it being excessive. NRGene can also force the periodicity of the RVE. Although we found no sensible difference in thermal behavior between a periodic RVE and a non-periodic one, both having equal porosity and pore size distribution, it takes usually less iterations (and is faster) to generate the periodic one.

NRGene produces a voxelized RVE that immediately serves as discretized domain of analysis for the most popular numerical methods (finite differences, finite volumes, finite elements). Then, given this discretized RVE, we use the finite-element-based computational homogenization method to determine the corresponding effective thermal conductivity tensor. Although it may seem excessively expensive to determine a tensor when the material is expected to be isotropic, this approach allows for checking the goodness of the RVE looking at its anisotropy. Further, by defining the isotropic conductivity as the average of the diagonal tensorial components, the scattering of results due to the random nature of RVE generation is sensibly reduced; consequently, the confidence on results obtained for only one RVE is sensibly increased.

The highly defined RVE may contain thousands of millions of voxels (or finite elements) making its generation and the subsequent computational homogenization extremely expensive in terms of computational time and memory requirement. This makes this hi-fi model more appropriate for benchmarking or validating simplified numerical or analytical models than for solving everyday engineering problems.

However, it has served us to validate a computationally inexpensive simplified model with is basically the hi-fi model called with a truncated pore size histogram. This amounts to neglect the set of pores of a certain size whose contribution to the total volume of pores is negligible. Since this simplified model gives an effective thermal conductivity satisfactorily close to that obtained with the hi-fi model, we conclude that it is not the number of pores of a certain size what is relevant to conductivity but their volume.

The low cost of the simplified (but still hi-fi) model has enabled the evaluation of a large set of foamed concretes, having different pastes of Portland cement (with and without admixtures) an porosities (from 49% to 83%), showing a highly satisfactory agreement with experimental data. The porosity allowed by this model is far beyond 25% that allowed by the analytical formulas of Maxwel and [13] and Bruggeman [21], the most popular ones for foamed concretes, which assumed dispersed spherical without mutual interference.

Finally, we use the simplified hi-fi model for benchmarking the Maxwell’s and Bruggeman’s formulas, as well as the Nielsen formula [23], not previously applied to foamed concretes, which additionally account for the packing structure of pores. The Nielsen formula for either HCP- or FCC-packed spheres was found to be the best to represent the analyzed foamed concretes, a conclusion than can be derived by adopting the hi-fi results as reference.

So, the door is open to use this hi-fi model as the base of analytical metamodels or digital twins of the thermal behavior of concrete foams.