## 2 Materials and Methods
### Implementation of Missing Grains: Porosity (Voids/Pores)  
As previously mentioned in the introduction, poly-crystalline structures are subject to various defects that have a detrimental impact on their material properties. One such defect is voids/pores, which manifest as material porosity. Porosity can arise from various factors, including low-quality manufacturing processes, material treatments, and environmental conditions. Detecting and characterizing porosity is of utmost importance as it significantly diminishes the mechanical properties of a material. Two possible models were available to incorporate voids into the micro-structure:  
1. Localize the missing grains, as well as completely remove them from the micro-structure and from the calculation of the BE matrices;
2. Consider the material elastic properties of the specific missing grain as very small ([PERSON]'s modulus and the Poisson ratio tended toward zero) compared with the ones of the other grains. Although the second modeling option is considerably simpler to implement compared to the first one, it lacks computational efficiency as the system matrix needs to be computed in its entirety. Consequently, there are no advantages in terms of memory allocation and computational time, which is particularly evident when dealing with many grains. Hence, to implement the first modeling option, the subsequent steps were executed in the numerical model:  
1. After the generation of the micro-structure by utilizing the VT, the locations of the absent grains (pores) were determined and designated with a unique flag to facilitate their identification;
2. The calculation of the BE matrices H and G was bypassed for the grains identified with a specific flag, and they were excluded from the population of the ultimate system of equations. This resulted in a consistent reduction in the equation system's order;
3. The boundary interfaces of the grains neighboring the absent ones (pores) were subjected to the imposition of free traction boundary conditions rather than enforcing interface continuity and equilibrium equations. From a numerical standpoint, when voids are considered, the number of rows and columns of the final system is reduced according to the following:  
\[N_{p}=N_{0}-4N_{i}, \tag{13}\]  
where the system order \(N_{0}\) represents the case when no grains have been removed, while \(N_{i}\) corresponds to the number of interface nodes associated with the missing grains. Both proposed porosity models allow for the manipulation of volume fraction, pore size, and the distribution of the porosity, thus enabling simulations of the response of real porous materials to a specified load. Once the porosity model was incorporated into the numerical model, the process of homogenization was employed to derive the material properties based on the constitutive laws and spatial distribution of micro-components within the micro-structure. Homogenization is typically associated with the concept of the Representative Volume Element (RVE). Material homogenization involves evaluating volume and ensemble averages of relevant fields across one or more realizations of the micro-structure under suitable boundary conditions. Subsequently, it then involves connecting these averaged fields using effective properties. Given a poly-crystalline micro-structure \(R(N_{g})\) consisting of \(N_{g}\) grains subjected to consistent boundary conditions--where the material is assumed to be free from micro-cracks--stress and strain volume averages were utilized to extract the apparent elastic moduli. To extract the properties at the micro-scale, averaging theorems in micro-mechanics were employed, which was followed by transferring the obtained information to the macro-scale.