1 Introduction

Composite materials are created by combining two or more materials with different properties to fit the requirement of a particular structure for a particular purpose. They can be tailored to offer many special advantages to satisfy the need of modern industries. Examples of such advanced properties are strength/stiffness-to-weight ratio, good conductivity, and heat and sound insulation. One of the broad classes of composite materials is particulate composites with hollow spherical inclusions such as hollow polymer particles [1] and fly ash cenospheres [2]. The addition of hollow spheres to a matrix grants the composite excellent characteristics such as low density, thermal insulation, and sound absorption [3,4,5].

The structural geometry of particulate composites with hollow spherical inclusions are often described at the nanoscale or micro-scale levels depending on the average size of the spheroids [6, 7]. For many purposes, multiscale analysis is useful for mechanical and thermal expansion analysis [8,9,10]. In such analysis, a representative volume element is often modelled at the lower length scale in which it qualifies to represent the composite as whole in the upper scale [11, 12]. Generating an RVE that accurately represents the random distribution of inclusions while maintaining geometric and mesh periodicity across its domain is a challenging task. Such complex random and periodic geometries require robust and sophisticated code that automates the process of generating random inclusions, controlling periodicity in terms of geometry and mesh, and applying periodic boundary conditions (PBC). A precisely representative element must be subjected to appropriate boundary conditions where the element is constrained to deform as a part of the upper scale not as a standalone element. Periodic boundary conditions can set up the finite element model to deform accordingly rather than the simplest set up of kinematic uniform boundary conditions (KUBC) [13]. Nevertheless, unlike KUBC nodal PBC requires precise periodic discretisation and periodic geometry.

Satisfying those conditions is convoluted as commercial FE software are not equipped with periodic discretisation solutions. Arguably, KUBC would effortlessly yield a similar approximation to PBC [14]. However, PBC is more precise and converges better and precision is often necessary and costly. While approximate periodic boundary conditions (BC) can be readily extended to non-periodic geometries and meshes by constraining parallel faces rather than nodes, the most advanced and accurate BC approach is demonstrated to be full nodal periodic BC. This approach ensures faster convergence to numerical solutions, especially for the smallest Representative Volume Element (RVE) sizes [13].

Several authors have introduced frameworks for modelling 3D RVEs with solid spheroids [15, 16], non-hollow ellipsoids [17, 18], RVEs with unidirectional fibres [19, 20], and woven composites [21,22,23]. Unlike the aforementioned inclusion types, hollow spheres can be appropriately described as shell elements rather than solid elements. Yet, the literature on microstructure modelling of particulate composite with hollow spherical inclusion is scarce or rather limited. The unique and challenging part of such RVEs is that the matrix and inclusion parts are meshed differently (solid and shells), which complicates maintaining periodic geometry.

Many recent publications were dedicated into merely the random packing of particles to achieve high volume fracture (45–60%), while others focused on generating periodic meshes to prepare the RVE for the application of PBC [41] introduced a novel algorithm for hard spheres packing based on the concept of molecular dynamics (MD) and the law of elastic collision using a time driven simulation. The MD algorithm can achieve up to 45–60% [29, 41,42,43] volume fraction for a low computational cost. In the original algorithm, particles were assigned null radii, a random position, and velocity vector. These particles were set in motion, and their radii increased incrementally over time. Whenever two spheres collided, their position and velocity were updated accordingly. The process continued until either a desired volume fraction or jamming limit was reached. In the current study, a new procedure is introduced that combines both RSA and MD methods to increase flexibility and overcome the limitations of each method.

2.3 Procedure of random spheres packing (main program)

RSA is restricted to a 30% volume fraction, while the original MD-based algorithm is limited to equal sized spheres. Herein, a novel procedure is proposed to pack up to 50% volume fraction of different spheres based on the user input of mean radii and variance \({s}^{2}\) along with the side lengths of the RVE \([{L}_{x}, {L}_{y}, {L}_{z}]\). The concept is to start with the RSA and carry on with the MD-based algorithm. The RSA will generate spheres up to 10% volume fraction. The sizes of the generated spheres are initially scaled down to account for the increase from 5% to the desired volume fraction \({V}_{f}\). The mean of the down scaled radii \({\mu }_{ri}\) can be derived from the desired mean radii \({\mu }_{r}\) using Eq. (1).

$${\mu }_{ri}=\sqrt[3]{\frac{ {0.05({\mu }_{r})}^{3}}{{V}_{f}}}$$
(1)

Appendix 1 features a flowchart depicting the procedure for random sphere packing. The execution of this process is guided by Algorithms 1 to h, as outlined in Appendix 2. Additionally, Appendix 3 encompasses the mathematical formulation of the equations utilized in the procedure. Algorithm 1 handles the sphere packing program and calls Algorithms 2 to 6. Algorithm 2 generates a set of down-scaled spheres with the specified statistical input. The output of this step, \(\left[{r}_{i}, {R}_{i}\right],\) where \({r}_{i}\) and \({R}_{i}\) represent, respectively, the radius of the sphere and its vector position, will be used as an input on the second stage along with the true volume fraction and the side lengths of the RVE. The MD-based algorithm will start by initializing time to zero and assigning a random velocity vector \({v}_{i}\) to each sphere. Algorithm 3 identifies the first binary collision between spheres \([i,j,{t}_{cmin}]\), based on the positions \({r}_{i}\), velocities \({v}_{i}\), and radii growth rate \({a}_{i}\). Meanwhile, Algorithm 4 identifies the first collision with the RVE domain \([i,k,{t}_{smin}]\). Subsequently, the first collision event (binary collision or with RVE domain) is detected where:

$${\Delta t}^{n} = min ({t}_{s}, {t}_{c})$$
(2)

The position vectors and radii are then updated based on dt with the following equation:

$${r}_{i}^{n+1}= {r}_{i}^{n}+{v}_{i}^{n}{\Delta t}^{n}$$
(3)
$${R}_{i}^{n+1}= {R}_{i}^{n}+{a}_{i}{\Delta t}^{n}$$
(4)

Next, if the binary collision takes place first \((dt={t}_{smin})\) the velocity vectors of the collided spheres are updated using Algorithm 5, otherwise if a sphere collided with the RVE domain first, periodic images are created via Algorithm 6. Finally, the true volume fraction of the current step \({V}_{n}\) is calculated, and the loop ends when the desired \({V}_{f}\) is achieved \(({V}_{n}\ge {V}_{f})\).

Figure 2 presents three generated RVEs with different volume fraction of 30, 40, and 50%. A computer equipped with Intel i9 12900k 5.2 GHz processor and 96 GB RAM could generate 50% volume fraction and 62 spheres in less than four minutes. The generation time is significantly influenced by the number of particles, irrespective of the RVE or particle sizes. For instance, a high-volume fraction and smaller particle size would lead to a larger number of particles and, consequently, incur a higher computational cost.

Fig. 2
figure 2

RVEs of particulate composites of periodic and randomly distributed different sized hollow spheres: a \(V_f = 30\%\), b \(V_f = 40\%\), and c \(V_f = 50\%\)

2.4 Random sequential adsorption

Algorithm 2 describes the random sequential adsorption (RSA). It starts with generating random coordinate within the RVE and random radius based on \({\mu }_{ri}\) and \({s}^{2}\). The algorithm uses Eqs. (5) and (6) to identify the overlap** between the adsorption attempts of sphere “i” and every previously adsorbed sphere “j”,

$${d}_{min}=\left({R}_{i}+{R}_{j}\right)$$
(5)
$$d=\sqrt{{\left({x}_{i}-{x}_{j}\right)}^{2}+{\left({y}_{i}-{z}_{j}\right)}^{2}+{\left({z}_{i}-{z}_{j}\right)}^{2}}$$
(6)

If \(d>{d}_{min}\) is the case with every previously adsorbed sphere, the new sphere is accepted. Otherwise, a new spatial position is sought. In this step, only internal spheres are packed. Intersection spheres with matrix domains and their periodic images are to be created within the MD-based algorithm.

2.5 Detection of first binary collision

Algorithm 3 summarizes the steps of detecting the first binary collision. The collision time between each pair of spheres \((i \& j)\) can be computed with Eqs. (7)–(9):

$$\Vert \Delta {r}^{n}-{\Delta v}^{n}t\Vert =\left[{(R}_{i}^{n}+{R}_{j}^{n})+(2at)\right]$$
(7)
$$\Vert {\Delta r}^{n}\Vert ={r}_{i}^{n}-{r}_{j}^{n}$$
(8)
$$\Vert {\Delta v}^{n}\Vert ={v}_{i}^{n}-{v}_{j}^{n}$$
(9)

which can be solved with:

$$\alpha {t}^{2}+2\beta t+\gamma =0$$
(10)
$$\alpha ={\Vert {\Delta v}^{n}\Vert }^{2}-{(2a)}^{2}$$
(11)
$$\beta =\Delta {r}^{n}.\Delta {v}^{n}-{(R}_{i}^{n}+{R}_{j}^{n})(2a)$$
(12)
$$\gamma ={\Vert {\Delta r}^{n}\Vert }^{2}-{{(R}_{i}^{n}+{R}_{j}^{n})}^{2}$$
(13)

A collision would occur if \(\alpha\) or \(\beta\) are negative values and if \({\beta }^{2}-\alpha \gamma\) is a positive value, the \({t}_{cij}\) is calculated via Eq. (13). Otherwise, no collision would happen (e.g. \({t}_{cij}=\infty\))

$${t}_{cij}=\frac{1}{\mathrm{\alpha }}\left[-\beta -\sqrt{{\beta }^{2}-\mathrm{\alpha \gamma }}\right]$$
(14)

The minimum collision time \({t}_{c}={\text{min}}({t}_{cij})\) is when the first binary collision occurs between two spheres \(i\) and \(j\).

2.6 Detection of first collision between a sphere and the matrix domain.

Algorithm 4 presents the calculation steps of the collision time between each non-intersecting sphere and the matrix domain. Equation (14) are used to calculate the collision time with the master and image faces:

$$t_{si} = \left\{ {\begin{array}{*{20}l} {\frac{{\left[ {R_i^n - r_i^n } \right]}}{{\left[ {v_i^k - a_i } \right]}}} \hfill & {{\text{spheres}}\;{\text{collision}}\;{\text{with}}\;{\text{master}}\;{\text{faces}}} \hfill \\ {\frac{{\left[ {L - R_i^n - r_i^n } \right]}}{{\left[ {v_i^k + a_i } \right]}}} \hfill & {{\text{spheres}}\;{\text{collision}}\;{\text{with}}\;{\text{image}}\;{\text{faces}}} \hfill \\ \end{array} } \right.$$
(15)

2.7 Post binary-collision velocity update

The first two spheres that collided from Algorithm 3 and their periodic images (if they exist) need to be updated. Algorithm 5 details the steps for calculating the new velocities by obtaining the unit vector:

$$u=({r}_{i}^{n+1}-{r}_{j}^{n+1})/\Vert {r}_{i}^{n+1}-{r}_{j}^{n+1}\Vert$$
(16)

Decomposing the component of the velocity vector:

$$\Vert {v}_{z}^{n}=\left({v}_{z}^{n}.n\right)u$$
(17)
$$\perp {v}_{z}^{n}={v}_{z}^{n}-\Vert {v}_{z}^{n} {\text{where}} z=\{i,j\}$$
(18)

Calculate the new velocity vector of the collided spheres \((i {\text{and}} j)\):

$${v}_{i}^{n+1}=\left[\Vert {v}_{j}^{n}+({2a}_{i})u\right]+ {\perp v}_{i}^{n}$$
(19)
$${v}_{j}^{n+1}=\left[\Vert {v}_{i}^{n}-({2a}_{i})u\right]+ {\perp v}_{j}^{n}$$
(20)

And finally, an identical velocity vector is assigned for every periodic image of the collided spheres \(i\) or \(j\).

2.8 Creation of periodic images of spheres

To maintain periodicity across the matrix domain, intersecting spheres with matrix domain should have periodic images via Algorithm 6. For example, if a sphere intersects with the matrix corners (C0) where:

$$({r}_{x}-R) \le 0 {\text{and}} ({r}_{y}-R) \le 0 {\text{and}} ({r}_{z}-R) \le 0$$
(21)

Then, 7 periodic images of this sphere should be created with the following coordinates:

$${r}_{2}=[{r}_{x}+{L}_{x} , {r}_{y} , {r}_{z}]$$
(22)
$${r}_{3} =[{r}_{x}, {r}_{y}+{L}_{y}, {r}_{z}]$$
(23)
$${r}_{4}=[{r}_{x}, {r}_{y}, {r}_{z}+{L}_{z}]$$
(24)
$${r}_{5}=[{r}_{x}+{L}_{x}, {r}_{y} + {L}_{y},{r}_{z}]$$
(25)
$${r}_{6}=[{r}_{x}, {r}_{y}+ {L}_{y}, {r}_{z}+{L}_{z}]$$
(26)
$${r}_{7}=[{r}_{x}+{L}_{x}, {r}_{y}, {r}_{z}+{L}_{z}]$$
(27)
$${r}_{8}=[{r}_{x}+{L}_{x}, {r}_{y}+{L}_{y}, {r}_{z}+{L}_{z}]$$
(28)

If a sphere intersects with the other seven corners, periodic images are also formed. In the case of an intersection with an edge, three periodic images will intersect with the other three parallel edges. Lastly, if the sphere intersects with a face, only one periodic image will be created to intersect with the other parallel face.

3 Generation of periodic geometry

The objective of creating a periodic arrangement of spherical inclusions that intersect with the RVE domain is to produce a periodic geometry and a mesh that enables the implementation of periodic boundary conditions. These boundary conditions entail imposing identical deformation on each opposing pair of nodes when subjected to a particular stress state [44]. To achieve this, it is necessary to ensure that the mesh at the borders of the RVE is periodic, as demonstrated in Fig. 3. The subsequent section will delve into boundary conditions in greater detail, while also presenting a new technique for generating periodic geometry and meshes using the scripting interface of the ABAQUS CAE commercial finite element software.

Fig. 3
figure 3

Illustration of a particulate composite specimen and an RVE with periodic geometry and mesh

The output of the RSA algorithm, discussed in the previous section, is a 2-dimensional array that contains the details of the spherical inclusions. Those details are the coordinates and diameter of each sphere as follows:

$$c= \left[\begin{array}{ccccc}i& {x}_{i}& {y}_{i}& {z}_{i}& {r}_{i}\\ i+1& {x}_{i+1}& {y}_{i+1}& {z}_{i+1}& {r}_{i+1}\\ \dots & \dots & \dots & \dots & \dots \\ n& {x}_{n}& {y}_{n}& {z}_{n}& {r}_{n}\end{array}\right]$$
(29)

Creating the geometry of each particle separately using the user interface would not be practical for the RVE of a particulate composite, as it typically contains numerous particles. Instead, an automated script can be utilised, which employs a loop to automatically generate the geometry of all the spheres, as outlined in Algorithm 7Gen_PGeom”. The spheroids are produced as shell parts, and intersecting spheroids with the RVE borders are trimmed by a dummy/temporary larger object. Consequently, the geometry of three RVE master faces \({F}_{x0}, {F}_{y0}, {F}_{z0}\) is created as shell elements, and the overlap** area between the master faces and the inclusions is trimmed, as depicted in Fig. 4. It should be noted that all parts are generated as shell elements at this stage but will be converted to 3D solid elements in subsequent stages. This innovative and efficient approach is currently being proposed to generate a periodic mesh across the faces and edges of the RVE with precision.

Fig. 4
figure 4

Algorithm 7 is utilized for the generation of a master faces and b intersecting hollow spheroids

4 Generation of periodic meshes

Creating a periodic mesh across the RVE is a more complex process than generating periodic geometry. While geometric periodicity is maintained across the RVE domain, the discretisation within the RVE is neither periodic nor symmetrical. Currently, most commercial finite element software packages are unable to automatically produce a periodic mesh from periodic geometry. Some authors have proposed solutions that involve applying periodic boundary conditions with a non-periodic mesh. For instance, Omairey [25] developed a plug-in tool in ABAQUS CAE that automatically applies periodic boundary conditions. In their algorithm, opposite nodes with the closest planar coordinates are constrained together, but only if the specified mesh map** accuracy is satisfied. However, this may not be an optimal solution, particularly in instances where poor mesh map** results in node pairs that cannot be captured within an acceptable map** accuracy limit. The optimal solution is to create an exact periodic mesh across the faces and edges of the RVE domain. However, this is not a straightforward process as composite microstructures are typically complex. The intersection of a spheroid (or other inclusion) with a plane would result in a complex geometry that cannot be easily meshed. Commercial software packages can only mesh such objects by utilizing unstructured meshing techniques, which do not require pre-established mesh patterns. Although these techniques are the most flexible, they provide the least control as the pattern is unpredictable. In addition, software such as NETGEN [45] that is not specifically designed for finite element analysis can generate periodic meshes from geometry. Their innovative algorithm generates high-quality triangle/tetrahedron meshes (for 2D and 3D geometry) based on skewness and aspect ratio in four subsequent computational steps: spatial points, edges, face, and volume mesh generation. Although effective, transferring geometric information between non-FE software and common commercial FE software is usually not straightforward and can be restricted or limited.

Some publications are solely dedicated to generating periodic meshes of RVEs [46]. However, their procedures can be unnecessarily lengthy and tailored for their specific matrix-inclusion form. In some cases, the inclusion needs to be meshed as a shell with a thickness to resemble hollow particles, while the matrix must be meshed with solid elements. Consequently, both the matrix and inclusion cannot be modelled as a single part, as they are meshed differently and assigned different material properties.

In the present work, a simple yet effective procedure is proposed to generate a high-quality mesh for periodic geometries. The proposed method exploits the ABAQUS CAE scripting interface to assemble and translate existing 2D elements from a single geometry to create a periodic replica of faces and edges. Although the procedure is introduced with the application of a matrix with hollow and spherical inclusion, the concept can be applied to all types of periodic geometries.

Carrying out from the last step of the earlier section, all the shell parts, the inclusions, and three master faces \({F}_{x0}, {F}_{y0}, {F}_{z0}\), were merged and meshed with triangular elements as shown in Fig. 5a. The meshing process involved equitably seeding the edges to ensure the nodes on opposite edges were restrained. Merging and meshing these elements as a single entity guarantees precise nodal coordinates between the inclusion elements, master, and image faces. Subsequently, the focus shifts to mirroring individual discrete elements instead of geometric parts. To accomplish this, Algorithm 8 was devised to categorise the elements by their position and create corresponding periodic images. The algorithm extracts the mesh connectivity data and arranges them into a 2D array, then translates each element based on its location to the positive direction using the translation vector in Eqs. (29)–(33). Algorithm 8Gen_Pmesh” generates a mesh connectivity array of triangular elements that resembles a periodic RVE mesh as shown in Fig. 5b. Next, a built-in function within ABAQUS CAE is utilized to convert a triangular mesh to linear or quadratic tetrahedron elements as shown in Fig. 5c.

Fig. 5
figure 5

Graphical illustration of the framework of precisely creating periodic tetrahedron mesh

This tool converts fully enclosed linear triangular shell elements into a solid mesh of tetrahedral elements using a bottom-up technique. The built-in function ensures the generation of a high-quality mesh, particularly concerning the aspect ratio. The aspect ratio, denoting the ratio between the longest edge and the shortest normal dropped from a vertex to the opposite face (normalized with respect to a perfect tetrahedral), defines a good quality mesh within the range of 1 to 10. Achieving this quality requires careful consideration, ensuring that the minimum distance between spheres and the domain is significantly larger than the mesh size.

The process of modelling the periodic matrix geometry and mesh is now complete, but the inclusions still need to be generated. Different options can be considered for the inclusions, such as using hollow spheres as shell components, solid spheres, or voids to mimic porous materials. Furthermore, appropriate contact properties between the matrix and inclusions must be established. The computational time for generating an extra-fine periodic mesh, comprising 714,750 tetrahedral elements for an RVE with a size of 2 microns, where the mesh size is 2% of its side length, is less than 17 min.

$$Node\; array= \left[\begin{array}{cccc}{p}_{i}& {x}_{i}& {y}_{i}& {z}_{i}\\ {p}_{i+1}& {x}_{i+1}& {y}_{i+1}& {z}_{i+1}\\ \dots & \dots & \dots & \dots \\ {p}_{n}& {x}_{n}& {y}_{n}& {z}_{n}\end{array}\right]$$
(30)
$$Elements\; array= \left[\begin{array}{cccc}{e}_{i}& {p}_{ia}& {p}_{ib}& {p}_{ic}\\ {e}_{i+1}& {p}_{i+1a}& {p}_{i+1b}& {p}_{i+1c}\\ \dots & \dots & \dots & \dots \\ {p}_{n}& {p}_{na}& {p}_{nb}& {p}_{nc}\end{array}\right]$$
(31)
$${V}_{x}={[{L}_{x},\mathrm{0,0}]}^{{\text{T}}}$$
(32)
$${V}_{y}={[0,{L}_{y},0]}^{{\text{T}}}$$
(33)
$${V}_{x}={[\mathrm{0,0},{L}_{z}]}^{{\text{T}}}$$
(34)

5 Periodic boundary conditions

After the modelling of the RVE geometry is completed, it needs to undergo virtual testing to obtain its macroscopic mechanical properties. The boundary conditions that govern the physical mechanisms of material deformation are a set of constraints that must be established. It is necessary to impose appropriate boundary conditions to the RVE to generate the solution of this homogenization technique \((E, G,\upsilon )\). Different boundary conditions could result in different solutions [13]. Choosing the appropriate boundary conditions is critical to ensure the accuracy of the results and maintain the RVE's representativeness. Two major types of boundary conditions are usually imposed to obtain the elastic properties: kinematic uniform boundary conditions (KUBCs) and periodic boundary conditions.

Kinematic uniform boundary conditions (KUBCs) are applied by imposing uniform displacements at the boundaries of the RVE. This type of BCs is widely used in micromechanics. Owing to its simplicity and its ease of application, several authors have used this type of BCs to find the effective properties of composite materials [47,48,49]. Nonetheless, the KUBC approach treats the RVE as a single unit cell, disregarding the fact that it is a constituent of a larger body on a higher scale. Therefore, the KUBC approach may not be entirely representative at the macroscopic level. According to ** and testing. Furthermore, the study conducted an effective mesh convergence study through "Gen_PRVE" using different mesh resolutions of 10%, 7.5%, 5%, 4%, and 3% to evaluate the convergence of the solution with finer meshes. Size sensitivity analysis of RVE was performed via "Gen_PRVE" to determine the minimum size of the periodic RVE required to represent the upper scale. Finally, an experimental validation is conducted for the elastic homogenization generated by Gen_PRVE, demonstrating an acceptable margin of error of less than 3%.