Introduction

Porosity is an imperative intrinsic property of sedimentary rocks. The fact that porous rocks are the reservoirs of energy fuels like oil and gas and life fuel groundwater makes the quantification of pore spaces critical in exploration strategies. The dominant factor determining the exploitable capacity of conventional energy reserves is porosity (Liang et al. 2015). Pore heterogeneity of clastic sandstone reservoirs, controlled by grain size and grain sorting, determines the volumes, flow rates, and hydrocarbons’ recovery. A porous medium’s microstructure has significant implications for macroscopic multiphase flow properties (Oren et al. 1998; Dong and Blunt 2009; Mousavi and Bryant 2012). Porosity being easy to measure as compared to permeability, many attempts have been made to establish relations between them in the field of flow through porous media (Wang et al. 2019; Singh 2019; Saki et al. 2020). However, there is a lack in the universality of these relations and, in turn, in permeability prediction as microstructure heterogeneity is not well demonstrated in the distribution of the porosity values (Bryant et al. 1993; Narváez and Toledo 2012). Though the rock–fluid multiphase system is treated as a continuum, pore heterogeneity at scales more minor than rock cores controls the flow with field-scale manifestations (Blunt 2001; Jackson et al. 2020). Therefore, analysis, estimation, and prediction of porosity at spatial scales have wide applications in the research domain of environmental engineering, hydrology, hydraulic fracturing, and hydrocarbon exploration and production (Hosseini et al. 2019; Ahmad et al. 2020; Liang et al. 2021). Depositional processes such as sorting and grain alignment, diagenetic processes such as compaction and cementation, and deformational processes like micro-cracking and pressure solution are responsible for the primary and secondary porosity in sedimentary rocks (Benson et al. 2005).

Determination of porosity is problematic because it is usually hard to quantify realistically (Denny 2002; Weltje and Alberts 2011). The porosity of sedimentary deposits gets considerably modified due to burial and other diagenetic processes (Worden et al. 1997). Textural maturity of clastic sedimentary rocks manifests the framework grain geometry, grain shape, and grain sorting. The depositional environment’s ability to modify the shape and sorting of grains decides the extent of porosity variation (Yan et al. 2018; Yiming et al. 2019). Diagenetic processes cause rearrangement of grains and ductile grain deformation along with a change in the packing density of grains. The combined effects of primary diagenetic processes produce stable grain packing arrangements in sedimentary rocks at burial depths. During these diagenetic processes, fine grains try to occupy the inter-granular pore spaces formed by the framework grains’ packing arrangements. The concept of packing density derives from the ability of grains to occupy the gross inter-granular pore space. Consequently, packing varies from loose random to dense random packing accompanied by physical effects resulting in alterations in porosity and permeability values. With the increase in packing density, pore throat connectivity decreases. Therefore, the reconstruction of packing arrangements of grains in clastic reservoir rocks with an optimum framework model reflects the depositional environment. Such a reconstruction will help determine the range of porosity values applicable to the depositional environment aiding the geologist to populate porosity models in a conceptual static geologic model. Presently, such a porosity model is not in practice, and therefore, a variety of statistical extrapolation of the porosity values is adopted in a static reservoir model. For that reason, in this study, we attempted a model to capture the heterogeneity in porosity using grain parameters such as grain sorting, grain shape, and packing linked to the depositional environment.

The quantification of evolving porosity during burial is primarily dealt with experimental and computer simulation models, resulting in a range of empirical equations. This approach leads to the development of compaction curves and porosity–depth curves. Another approach to quantify grain rearrangements and packing during burial is to develop static and dynamic systematic theoretical packing arrangements, which can be further used to estimate the initial depositional porosity. Static models of grain packing construct a fixed grain arrangement, whereas dynamic models are designed to produce a sequence of packing arrangements. It is a known fact that pore architecture is a reflection of grain architecture, especially in clastic sedimentary rocks. Well-sorted sediments composed of non-ductile grains have approximately 40% depositional porosity. Therefore, depositional porosity is strongly dependent on grain packing arrangements and is much more affected by sorting than grain size. Even though packing configurations vary, packing density is a function of the diagenetic process and the burial depth. Our approach to the porosity model takes care of the grain characteristics at a basin level by capturing the heterogeneity in grain sorting and the grain shape.

Even though there is no direct relationship between the systematic packing of spheres and sediment arrangement in the reservoir rock, indirect correlations exist with respect to porosity and permeability. Several researchers pointed out that the analysis of systematic cases of packing of uniform spheres directly and practically relates to porosity calculation (Graton and Fraser 1935; Pandalai and Basumallick 1984; Pettijohn et al. 2012; Nabawy 2014). Often only the loosest and tightest systematic packing are considered in connection with porosity and permeability. However, Graton and Fraser (1935) established intermediate packing modes by geometrically stacking squares and the rhombic layer of uniform spheres upon one another. For uniform spheres, porosities range from 26 to 48% for the closed pack to the most open arrangement, showing correlation to the range of initial depositional porosities of sediments (Fraser 1935; Graton and Fraser 1935; Pandalai and Basumallick 1984; Pettijohn et al. 2012; Nabawy 2014; Pal et al. 2018). It is challenging to represent actual conditions with uniform grain size in a realistic medium as systematic packing models with uniform spherical grains rarely exist in nature. The theoretical concepts cannot be applied too literally to natural deposits because they are neither composed of spheres nor packed in a wholly systematic manner (Pettijohn et al. 2012). Graton and Fraser (1935) have given a detailed description of probability factors that affect a particular packing formation. The probability factors include a description of irregularities, curvature, the inclination of the starting surface, method of building the layer, method and rapidity of laying down grains, properties of transportation medium, and other influences.

The mixing of grain sizes following a unimodal and multimodal grain size distribution makes it a complex three-dimensional problem in natural rocks. Therefore, an intermediate model that can address the complex problems most simply to an acceptable extent is required to bridge the gap between the basic packing models and recent advanced multi-scale approaches. Numerous studies on binary mixing porosity models are available due to their simple assumptions (Diyokeugwu and Glover 2018; Glover and Luo 2020). However, few pieces of literature are available on models incorporating the mixing of grain sizes with multimodal size distribution. This study reconstructs three-dimensional packing models that give a realistic description of granular mixtures forming complex pore space controlled by grain size, grain shape, and grain packing observed in actual porous media.

The reconstruction of packing arrangements requires parameters such as grain geometry, grain shape, and grain sorting. Most of the discussions on packing models are limited to the spherical shape of framework grain. Theoretical predictors and analytical models have given less attention to the effect of grain shape on porosity due to its complex nature. The textural maturity of sediments, which ranges from immature to supermature stage, gives the sediment grains different shapes. The degree of elongation, a shape anisotropy parameter, can be used to capture the complexity caused by textural maturity (Nabawy 2014; Liang et al. 2015). Sorting also plays a vital role as one of the textural attributes in deciding porosity (Yusuf and Padmanabhan 2019). For unimodal sandstones, grain size distribution generally follows a ‘lognormal law’. Several processes and varying transport conditions reflect the grain size distribution of sand and sandstones in the log-probability curves. Traditional methods like sieve analysis and sedimentation analysis, and computer analysis of digital images have proved that clastic sediments are mixtures of total populations of lognormal sizes. Thus, a lognormal model is a standard model for random grain sizes. Such statistical models are used to estimate 3D grain size distributions from 2D distributions (Kong et al. 2005). These relationships are applied to estimate the packing densities of the collection of grains of various sizes. It has already been proven that the maximum packing density (volume fraction of spheres) is approximately 0.64 in the random close-packed (RCP) limit for hard spheres (Yerazunis et al. 1962; Rutgers 1962; Cargill 1970; Finney 1970). A concept of maximum random jammed packing state has been evolved in this decade and is applied to fragile matter (Cates et al. 1998; Liu and Nagel 1998). Several studies have proven that packing density higher than 0.64 can be achieved for ellipsoidal grains with the maximum random jammed packing state, which may approach 0.74 (Donev et al. 2004; Man et al. 2005). The additional angular degree of freedom of the ellipsoidal grains plays an essential role in achieving this randomly jammed packing (Donev et al. 2004; Man et al. 2005). However, a jammed system of hard spheres can generate packing fractions from 0.52 to 0.74 (Kansal et al. 2002; Jiao et al. 2011). In the present study, we used the concept of maximum random jammed packing to derive the appropriate packing density for spherical and elongated grains.

Several techniques are capable of estimating the necessary parameters required to develop a framework of packing. Heterogeneity at the micro-scale is demonstrated in grain size and shapes as a part of the microstructural characterisation of rocks. Heterogeneity in size and shape is especially valid for rocks from deep-seated sedimentary basins. As a result, realistic numerical data on porosity at a sub-micron resolution are obtained from imaging methods using microscopic techniques ranging from light microscopy, scanning electron microscopy to transmission electron microscopy. In conventional reservoirs, predictive capabilities of digital image analysis techniques have opened new avenues for mapping features such as grain shape, size orientation, variation in mineral phase distribution, and textural attributes (Jianjun et al. 2011; Vergés et al. 2011; Bodien and Tipper 2013; Buckman et al. 2017; Korte et al. 2017; Ma et al. 2017). With the advent of new techniques in image analysis and processing, especially for images from field emission scanning electron microscopy (FESEM), it is possible to characterise grain size and pore size distribution at a micro-scale (Worden et al. 1997; Milliken and Curtis 2016; Pal et al. 2018; Garia et al. 2019).

Recently, high-end costly X-ray micro-computed tomography has enabled the reconstruction of 3D pore structure in the form of representative elementary volume from images that otherwise is difficult to model (Hou et al. 2021a). Micro-computed tomography scan-based 3D porosity models can derive complex porosities associated with natural carbonate fractures or solution-based secondary porosity (Peng et al. 2012; Nie et al. 2019; Hou et al. 2021b). Also, artificial intelligence is a powerful tool to predict complex reservoir properties (Konate et al. 2015; Alreshedan and Kantzas 2016). It uses advanced convolutional neural networks and conventional image segmentation techniques, which are becoming popular in digital rock analysis (Soleimani et al. 2020; Niu et al. 2020; Durrani et al. 2020; Wang et al. 2021). However, pore heterogeneity cannot be fully captured using such methods as they do not analyse grain interdependency and are not cost-effective, and the sampling interval is limited.

This research aims to develop a porosity model that incorporates depositional heterogeneity at a micro-scale by utilising grain parameters such as grain sorting, grain shape, and packing that are linked to the depositional environment. The study reconstructs three-dimensional packing models that give a realistic description of granular mixtures forming complex pore space controlled by grain framework and other related grain parameters derived from FESEM images of sandstone reservoir rock samples at a micro-scale. The method comprises theoretical packing models of cubic, orthorhombic, and rhombohedral patterns, with discrete grain particles of spherical and elongated grains. We attempted a static unit cell model of spherical and elongated grains by sequential addition of grains to an initial configuration using packing density. We used packing density as a representative for varying diagenetic processes and the burial depth. Our study aims not to derive a packing density of the medium; instead, the study applies a packing density to a unit cell model to reach the porosity of the medium at the time of deposition. In this manner, we tried to replicate a static scenario of mixing grains during the deposition in natural porous media. In this study, we focused only on the changes in the porosity parameter with respect to hydrocarbon recovery applications. Finally, we compared the porosity obtained using the packing models to conventional porosity derived from helium porosimeter. Such a comparison predicts the most favourable packing arrangement, directly indicating the textural maturity and indirectly the depositional environment. The study illustrates the effect of grain shape and grain size distribution in terms of the degree of elongation and the degree of sorting, respectively, on porosity.

Previous work: packing data

Experimental packing models

Most experimental packing models are constructed by pouring many spheres (ranging from 1000 to 20,000) of various densities and sizes into containers of different shapes. A shaking or tapping process followed until they arranged themselves in a disorderly fashion with no apparent symmetries and until no further reduction in volume was observed (Rutgers 1962; Scott 1960; Yerazunis et al. 1962; Cargill 1970; Finney 1970; Weltje and Alberts 2011). Different packing measures are based on the spatial density and arrangement aspects (Pandalai and Basumallick 1984). Packing density is a measure of packing that denotes the capability of a particular set of grains to utilise available pore space in packing. Thus, it is close to the petrophysical property termed porosity. Researchers conducted various experiments to find out the random packing density of spheres, which is given in Table 1. The maximum packing density (volume fraction of spheres) is approximately 0.64 in the random close-packed (RCP) limit for hard spheres (Cargill 1970; Finney 1970; Rutgers 1962; Yerazunis et al. 1962). However, packing density’s influential factors are particle shape and method of packing (Brouwers 2006). Packing density higher than 0.64 can be achieved by using a collection of particles with various sizes that form grain size distribution. For small values of standard deviations (0 < σ < 0.7) of grain size distributions, packing densities generally increase with decreasing standard deviation. However, only one parameter is insufficient to conclude packing densities of a given configuration, as grain size distribution tends to deviate from lognormal law (Dexter and Tanner 1972; Desmond and Weeks 2014). In such cases, an approximation for random close packing density of hard spheres is ideal. A theoretical prediction of hard spheres’ packing density was made based on mapping onto a 1D problem. Simulation results show a range of packing density (0.64–0.74) for lognormal 2.2 regular packing models of uniformly sized spheres distribution (Farr and Groot 2009).

Table 1 Reported random packing densities of densely packed spheres in the literature

Regular packing models of uniformly-sized spheres

Graton and Fraser (1935) have defined systematic and straightforward ways for geometrical arrangements of uniform spheres. Layers and rows together build regular cubic, orthorhombic, and rhombohedral types of packing. The basic unit of any packing model is a row that consists of contacting uniform spheres with their centre along a straight line, spaced at a distance of 2R (R is the radius of the sphere). These rows, arranged in the same place, parallel to each other and connecting each other, form a layer. The arrangement of particular rhombic layers with intermediate intersection angles between rows is easier, but the most common is from the limiting forms. These limiting forms are the square layer with a 90° angle and the triangular or simple rhombic layer with an angle of 60° (Haughey and Beveridge 1969). The three stable ways in which two square or two rhombic layers may be stacked relative to each other are cubic, orthorhombic, and rhombohedral types of packing models, as shown in Fig. 1. Two square layers stacked exactly above one another form cubic assembly. When spheres in one layer offset horizontally to those of the first layer by a distance of R along the direction of one of the sets of rows, it results in orthorhombic packing. For the rhombohedral packing model, spheres in the second layer horizontally offset to those of the first layer, in a direction bisecting the angle between the two sets of rows and by a distance of R √2 (Graton and Fraser 1935). So, each of the second layer spheres is placed in the hole formed by the first layer’s contacting spheres.

Fig. 1
figure 1

Representative illustration of unit cell geometry for different packing models with spherical grains: a cubic, b orthorhombic, c rhombohedral (where R is the radius of spherical grain)

Each independent kind of packing is associated with a characteristic geometry of void. A unit void is a void that is entrapped in the unit cell of a packing, its smallest portion representing a complete manner of packing. The eight pieces of spheres (each piece is one-eighth part of a sphere) together build up a complete unit cell so that if these pieces of spheres are appropriately rearranged, they would exactly form one complete sphere. Thus, a complete unit cell always contains a volume equivalent to the volume of exactly one sphere; the remainder of the cell volume is a unit void (Graton and Fraser 1935). The unit cells for cubic, orthorhombic, and rhombohedral packing models of spherical grains are shown in Fig. 1a, 1b, 1c, respectively. Thus, for each packing model of spherical grains like cubic, orthorhombic, and rhombohedral, there is a given characteristic porosity value of 47.64%, 39.54%, and 25.95% associated with a unit void. These unit cell porosity values are constant regardless of the size of the unit sphere. This well-established concept is the basis to conceptualise the unit cell for uniform elongated grains.

Similar geometric arrangements can be replicated for different geometric shapes. Nabawy (2014) demonstrated geometric arrangements for uniform elongated grains using cubic and rhombohedral packing models but could not develop a unit cell model. We attempted theoretical unit cell models for elongated grains of uniform size for varying degrees of elongation and established theoretical porosity values in the present study. Figure 2 shows a representative illustration of the packing models of elongated grains. The shape anisotropy expressed by grain elongation was calculated using Eq. (1):

$${\text{Degree of Elongation }}\left( E \right){\text{ = Length of the grain }}/{\text{ Diameter of the grain}}$$
(1)
Fig. 2
figure 2

Representative illustration of unit cell geometry for different packing models with elongated grains: a cubic, b orthorhombic, c rhombohedral

Materials and methods

Model description: conceptual packing models for porosity estimation

The range of porosity values of natural sedimentary deposits results from the grain size distributions, a variety of natural grain shapes, and the depositional environment, all of which affect the packing configurations. The porosity of sedimentary rocks is greatly influenced by grain packing, framework grains, and textural maturity, which varies depending on the depositional environment (Prakoso et al. 2018; Hossain et al. 2021). The majority of sandstones are composed of mixtures of dominant framework components. Feldspar, quartz, and rock fragments such as chert are the most typical framework constituents. The amount of matrix and the degree of roundness and sorting of framework grains determine the textural maturity of sandstones. Sandstones in their immature stage have a lot of clay, poorly sorted and poorly rounded framework grains, whereas supermature sandstones have little or no clay, well-sorted and well-rounded framework grains.

Framework grains can take on a variety of shapes depending on their depositional history. Form and roundness are two aspects of framework grain shape that are positively related, as shown in Fig. 3 (Boggs 2014). A well-rounded grain can have high or low sphericity, whereas a highly spherical (equant) grain can be well or poorly rounded. Some grains from a specific depositional environment have the shape of a sphere, whereas grains from other settings can have an elongated or rod-like shape. For instance, glacial deposits are texturally immature due to various shapes and sizes of framework grains, leading to relatively low porosity. In contrast, a texturally matured fluvial delta environment is favourable with high porosity as a function of well-sorted, rounded, and mature framework grains (Graton and Fraser 1935; Pettijohn et al. 2012; Henares et al. 2020). As a result, porosity is strongly influenced by the shape and size of framework grains governing the grain arrangement in different depositional environments. Hence, most natural sedimentary deposits involve packing configurations with random assemblies and contain a size distribution of particles that are likely non-spherical. The simplest and smallest representation of the pore space can be represented by the unit cell of framework grains. The effect of packing on porosity can be illustrated by observing the changes in porosity that occur when particles are rearranged from loose (cubic) packing to tightest (rhombohedral) packing. Thus, the present study deals with the cubic, orthorhombic, and rhombohedral packing models of discrete grain particles of different shapes comprised of uniform spherical and uniform elongated grains to estimate porosity. Graton and Fraser (1935) have explored and illustrated a unit cell for cubic, orthorhombic, and rhombohedral packing models of uniform spherical grains. This study has developed unit cells for similar geometric arrangements of uniform elongated grains, as shown in Fig. 2. All the grains in the unit cell model are ellipsoids with a fixed aspect ratio, and they form a regular pattern over each horizontal plane.

Fig. 3
figure 3

Schematic representation of the framework grain shape

The unit cells of cubic, orthorhombic, and rhombohedral packing models are the simplest representation of inter-granular pore space of any porous medium. Here, we built idealised unit cells of spherical and elongated framework grains for porous sedimentary rocks. Thus, the effect of grain shape in terms of the degree of elongation on different packing models was analysed. The complete unit cell framework is a six-sided parallelepiped for each unit cell model, as shown in Figs. 1 and 2. For a unit cell framework of spherical grains, each edge has a length of 2R, where R is the grain radius. Therefore, the theoretical volumes of parallelepiped for cubic, orthorhombic, and rhombohedral unit cells of uniform spheres are 8R3, 6.93R3, and 5.66R3. For unit cell parallelepiped of elongated grains, eight edges have a length of 2R, while the remaining four edges have a length elongation factor times the grain’s diameter. Thus, elongated grains’ anisotropy is a governing factor to estimate unit cell volume, which decides the porosity. Porosity calculation for a unit cell is straightforward as the void volume is the remainder of the deduction of one-grain volume from the total parallelepiped volume. Accordingly, the theoretical model-based porosity values were calculated for all different packing models for the targeted degree of elongations. Table 2 summarises the mathematical formulas derived from each packing model to calculate the corresponding porosity values.

Table 2 Formulas developed to estimate porosity values of theoretical unit cells of different packing models

However, the theoretical concepts cannot be applied literally to sedimentary deposits because they are neither composed of exact geometrical shapes nor are they packed in a wholly systematic manner. Consequently, the most convenient method for such a situation is developing a model with an aggregate mixture of different sizes and shapes of grains within a specific framework or boundaries to estimate porosity, as shown in Fig. 4. We propose a method for estimating porosity for a collection of grain sizes present in a representative sample based on a conceptualised unit cell framework. The frequently occurring grain diameter in the representative sample was used to form a unit cell framework in spherical grains. For the unit cell framework with elongated grains, the maximum degree of elongation applied to the frequently occurring grain diameter was used as a length of the unit cell framework. Now that we have the unit cell dimensions and void space volume, the focus is on the packing density to calculate the pore space available for filler grains. The packing density varies with the standard deviation for particle sizes with the lognormal distribution. It can range from 0.64 to 0.74. Then, we tried to replicate a static scenario of mixing grains during the deposition by sequential addition of filler grains to the unit cell model. Thus, the effect of grain sorting on the inter-granular porosity was determined. We followed a sequential addition of different grains sizes to the available void space in both unit cell packing models resulting in the desirable packing configuration. The thumb rule is heavier grains occupying the pore space first, according to the law of sedimentation. Our packing models are the outcome of consecutive grain depositions in a gravitational field. So, we analysed images of sandstone core plugs from basins of various parts of northeast India to derive the porosity values based on the described methodology.

Fig. 4
figure 4

Conceptualised unit cell framework of cubic packing models with a spherical and b elongated grains for porosity estimation

Realistic case study on sandstone rock samples

A practical application of conceptual models is possible only when a realistic grain size distribution is achieved. We estimated porosity based on image analysis with packing models developed in this study for five sandstone core plugs from northeast India basins (Assam-Arakan Basin, Disang Mizoram, and Arunachal Pradesh) belonging to Tertiary–Quaternary age. A flow chart of the methodology adopted for the inter-granular porosity estimation of sandstone rock samples is presented in Fig. 5. This section explains the methodology for digital image analysis of field emission scanning electron microscopy (FESEM) images of rock samples with developed MATLAB code.

Fig. 5
figure 5

Flow chart of the methodology adopted for the porosity estimation

A rock sample’s heterogeneity inducing differential physical properties can be realistically depicted at a micro-scale using a scanning electron microscope (SEM). SEM uses secondary electrons and backscattered electrons for imaging samples. This method is faster and less expensive than other conventional methods. This microscope’s ideal resolution is 0.5 nm, which can typically reach up to 5 nm with 30 kV with conducting material, whereas it can reach up to 50 nm with non-conducting material such as rock (Hugget and Shaw 1997). Secondary electrons disclose morphology and topography on the sample surface, while backscattered electrons illustrate contrasts in composition in multiphase samples (Pal et al. 2018). The fixed magnification ratio and the optimum number of images at a sample’s concerned location are the key points to elucidate grain and pore structure at a micro-scale (Deng et al. 2016). Sample preparation is a crucial part as a smooth flat surface is required for precise imaging. Before the analysis, the sample surface should be dried to avoid X-ray absorption and coated with gold to avoid charging (Korte et al. 2017). Image acquired by FESEM is a rich source of information for variability in porosity, mineral distribution, and grain shape parameters. The digital images of sandstone rock samples acquired from FESEM (Make: Zeiss and Model: Sigma) backscattered electron imaging with an accelerating voltage of 5.00 kV are shown in Fig. 6. Huge uncertainty in porosity from the micro- to macro-level can be captured by processing backscattered electron images. The magnification of a FESEM image, its scale, and the representative area of a sample all differ depending on different rock types. The parameters characterising image analysis procedures may differ based on the image’s quality and scale and the features to be recovered from the figure.

Fig. 6
figure 6

FESEM-BSE image of sandstone rock samples: a SS_A, b SS_D, c SS_B, d SS_K, e SS_O

FESEM images can be analysed using various image analysis platforms such as ImageJ or MATLAB (Pal et al. 2018). ImageJ enables one to estimate porosity based on thresholding, which includes connected and isolated pore spaces. In such a case, plotting grain size distribution becomes tedious as one has to measure all grain sizes manually. Here, the whole study has been done using MATLAB coding to provide an alternative for the much-used ImageJ. The development of MATLAB code focuses on plotting the grain size distribution instead of pore size distribution because this study aims to acquire a set of grain sizes to sequentially add and observe the effect of grain sorting on inter-granular porosity.

Filtering

Noise removal filters remove the arbitrariness in the images to a great extent. Filters are classified according to their purposes, such as the Canny or Sobel filter for edge detection and the Gaussian or median filter for smoothing (Coady et al. 2019). The Gaussian filtering method has been successfully utilised to remove blur from an image (Babaud et al. 1986). Hence, in this study, image processing begins with applying a Gaussian filter to improve image properties and remove noise before extracting large objects and bridging any small gaps in lines and curves. The original image (a) and the filtered image (b) for a representative sandstone sample (SS_K) are shown in Fig. 7.

Fig. 7
figure 7

Sandstone rock sample SS_K: a original image, b filtered image (Sigma = 2)

Image segmentation by thresholding

Image segmentation is an important step in image analysis, where images are segmented based on the greyscale values of pixels. A threshold value is assigned in such a way that each pixel in the image is classified as object or background. The threshold value defines the cut-off greyscale values that differentiate grains and pores and aids in measuring grains or features in an image (Mohammadi et al. 2020). The FESEM images acquired are 2D raster images of the sample surface. A threshold value to differentiate pores from the rock grains was estimated using a nonparametric unsupervised automatic threshold selection method known as Otsu’s threshold method. Otsu thresholding is used to convert a greyscale image into a binary image. For example, if we consider an image with L grey levels is dichotomised into two classes by a threshold k with a probability of class occurrence as w(k) and class variance as σ2, then according to Otsu 1979, the optimal threshold k* is given by

$$\sigma_{B}^{2} (k^{*} ) = \max (1 \le k < L)\sigma_{B}^{2} (k)$$
(2)

where σB2 is the between-class variance based on the first-order statistics (class means). The threshold which maximises σB2 is the optimal threshold k*.

The Otsu threshold method iterates all the possible threshold values to calculate a measure of spread for the pixel levels on each side of the threshold. The sum of foreground and background spread around the threshold should be minimum to find the optimum threshold value. Therefore, Otsu’s threshold method is valid for greyscale images of any rock type acquired under uniform illumination. The original image (a) and the image after thresholding (b) for a representative sandstone sample (SS_K) are presented in Fig. 8.

Fig. 8
figure 8

Sandstone rock sample SS_K: a original image, b image after thresholding

Morphological opening 

The main objective here is to generate a set of different available grain sizes to get a realistic approach to grains’ packing behaviour. After image filtering and thresholding, it was difficult to identify individual grains from the image, as exemplified in Fig. 8. Therefore, we developed a new method to segregate the individual grains from the obtained digital images of porous rock microstructure.

Here, a morphological opening process was carried out to remove unnecessary objects from an image while preserving larger objects’ shape and size in the image. The steps involved in the process of morphological opening to characterise the porous media are illustrated with an example image in Fig. 9. Grains are depicted by white colour, whereas pore space is represented by black colour. The visible grains whose diameter can be extracted are focused on generating a set of grains. The FESEM image of a representative sandstone sample (SS_K) after processing for morphological opening with circular structuring element of radius ten and grain labelling is shown in Fig. 10.

Fig. 9
figure 9

Illustration of the workflow of morphological opening in image analysis

Fig. 10
figure 10

Image derived after morphological opening process for rock sample SS_K

The theory for mathematical morphology has widely been established based on set theory. A structuring element (SE) possessing characteristic information such as shape, size, and orientation transforms the image to a modified image by one of the four basic morphological operators, viz. dilation, erosion, opening, and closing. In the morphological opening, the structuring element will vary based on the information to be extracted from the image. The structuring element is a matrix consisting of 0’s and 1’s that can have any arbitrary shape and size. Erosion is defined as

$$P\Theta Q = \left\{ {x|Q_{x} \subset P} \right\}$$
(3)

Dilation is defined as

$$P \oplus Q = \left\{ {x|Q_{{\text{x}}}^{{\text{r}}} \cap P \ne \emptyset } \right\}$$
(4)

Q is the structuring element, P is the image to be processed, Qx is the translation of Q with respect to a vector x, and Qr is the reflection of Q (Matrecano 2012). The opening operation is defined as an erosion followed by dilation and is given by

$$P \circ Q = (P\Theta Q) \oplus Q$$
(5)

Conceptual model vs real data

The heterogeneity in porosity, especially inter-granular porosity at the micro-scale, is affected by the grain size distribution. The conventional sieve analysis or hydrometer test cannot plot grain size distribution for grains smaller than 0.5 µm. Thus, digital image analysis aims to plot micro-scale variation in grain sizes. The developed conceptual model has a unit cell framework of spherical and elongated grains, further filled by smaller grains to reflect the mixing effect on the inter-granular porosity. To study this effect on realistic data for different packing models through data derived from the digitally analysed FESEM image, we processed and analysed FESEM-BSE images of all the samples. The grain diameters’ distribution derived from image analysis of each sandstone rock sample is shown in Fig. 11, represented by a violin plot overlapped on the box-and-whisker and a scatter plot. The surface area of each labelled grain was measured with the developed MATLAB code. The diameter of grains was evaluated by assuming all the grains were spherical. Also, the maximum length between the farthest pixels of objects was determined to obtain the elongation degree of framework grains in the sample. The shape anisotropy expressed by grain elongation E was estimated using Eq. (1). The grain diameter and the elongation measurements depend on the image’s scale and the small representative area chosen to acquire the sample image. The diameter used to construct the dimensions of the unit cell framework is defined here as limiting diameter. The limiting diameter of a framework composing a packing model depends on multiple factors like the FESEM-BSE image’s magnification, the image’s scale, and the small representative area of a sample focused on the image. Thus, limiting diameter is the major assumption in this approach to determine porosity. The packing density that can be achieved based on the standard deviation of grain size distribution is termed here as a limiting packing density. The diameters constituting the percentage of particles retaining limiting packing density are smaller than the limiting diameter. The total number of grains in a single SEM image is not constant at a given magnification. As a result, the limiting diameter selection significantly impacts the proportion of grains that keep the limiting packing density. Hence, analysis on repetitive small samples is required to obtain an overall description of reservoir porosity. Assessing the statistical parameters associated with the grain size distribution, especially the mean and the standard deviation, is necessary to know the packing density associated with a collection of grain sizes (Dexter and Tanner 1972; Farr and Groot 2009; Desmond and Weeks 2014). The statistical analysis of grain size distributions shows that all the sandstone samples follow a lognormal distribution, as shown in Fig. 12.

Fig. 11
figure 11

Grain size distribution of sandstone rock samples derived from image analysis (box-and-whisker plot). Box-and-whisker plots indicate the upper and lower quartiles and median (box); 1.5 interquartile range of upper and lower quartiles (whisker) and outliers

Fig. 12
figure 12

Statistical fitting on grain size distribution histogram of sandstone rock samples (Weibull, Lognormal, Gamma, and Exponential PDFs are shown in the graph. Standard deviation for lognormal distribution as SS_A: 0.64 µm, SS_B: 0.59 µm, SS_D: 0.75 µm, SS_K: 0.64 µm, SS_O: 0.72 µm. The figure also shows a vertical line corresponding to the mode of the grain diameters.)

The packing density was calculated based on its relation with the standard deviation of grain size distribution given by Farr and Groot (2009). The maximum limit of random packing density was kept as 0.74 (Kansal et al. 2002; Jiao et al. 2011). As the standard deviation values of samples are 0.6 or more, as shown in Fig. 12, packing density values associated with each packing model reach 0.74. Though the theoretical unit cell model is a simplified pore–grain interaction structure, the effect of mixing on the inter-granular porosity for each unit cell packing model was investigated using the packing density parameter. Thus, it considered the hydrocarbon recovery from unrecoverable or hidden dead-end micro-pores which otherwise is difficult to track using conventional methods. The randomly jammed state was obtained for a conceptualised unit cell, and the porosity values were estimated for each packing model. The detailed calculations for representative sample SS_A are given in Table S.1.

Results and discussion

Theoretical model: unit cell porosity

The key to estimate porosity from models lies in a unit cell, as the void volume is the remainder of the deduction of one-grain volume from the total parallelepiped volume. Theoretically, the uniform grain size does not affect the porosity. Thus, the porosity associated with a unit cell is constant for a specific diameter and a specific degree of elongation. This is the maximum value of porosity, which can be achieved with a particular unit cell packing model.

Theoretical models draw significant attention to the relationship between porosity and elongation degree. The degree of elongation for spherical grain is one. The porosity values associated with the cubic, orthorhombic, and rhombohedral packing models of uniform spherical grains are 47.64%, 39.54%, and 25.95%. The previous literature has already proven this (Graton and Fraser 1935; Pandalai and Basumallick 1984; Pettijohn et al. 2012; Nabawy 2014).

However, the porosity value associated with a particular unit cell of grains decreases with the increase in the degree of elongation of the unit cell’s building framework. The theoretical porosity associated with a unit cell of grains having different degrees of elongation for each packing model is shown in Table 3. There is a steep decrease in porosity for the initial increase in the elongation degree of grain for cubic and orthorhombic packing models. Nevertheless, the effect flattens with the further increase in the elongation degree, showing a negligible change in porosity values.

Table 3 Theoretical porosity values for unit cell with different packing models

The highest degree of elongation that can be achieved theoretically for the rhombohedral unit cell model is 3.34, as shown in Fig. 13. Theoretically, such a packing model results in zero porosity. Beyond that, the grain becomes so much platy and elongated; it cannot fit into a rhombohedral arrangement. According to Graton and Fraser 1935, assuming a flat surface for initial deposition, the rhombohedral packing is the prevailing tendency of the first depositional layer. It can be said that this is true only when the degree of elongation of settling grain is less than 3.34. The more immature the sediments, the lesser the probability of forming a rhombohedral packing model. Therefore, the theoretical model-based porosity values using different packing models and degree of elongation show a wide range of values ranging between 2 and 47%.

Fig. 13
figure 13

The graphical plot on the effect of degree of elongation of grains on the inter-granular porosity for different packing models (the effect flattens beyond a degree of 4)

Effect of grain shape on inter-granular porosity

Based on different packing models for spherical and elongated grains of uniform size, theoretical porosity values show a wide range of values between 2 and 47%, as reported in Table 3. We refer to the model-based porosity values derived from conceptualised grain mixing model as unit cell porosities. For a case study on sandstone rock samples, the unit cell porosities of elongated grains ranging from 3 to 13.5% are much lesser than those associated with unit cells of spherical grains ranging from 8.5 to 26% for each packing case, as shown in Fig. 14. The maximum degree of elongation for each sandstone sample is found to be ranging from 2.06 to 2.5.

Fig. 14
figure 14

A comparison plot of unit cell porosity derived for sandstone samples (with varying packing models for spherical and elongated grains with the degree of elongation SS_A: 2.26, SS_B: 2.5, SS_D: 2.06, SS_K: 2.04, and SS_O: 2.17) with conventional porosity derived using helium porosimeter

Finally, we compared the porosity values obtained using the packing models to conventional porosity values derived from helium porosimeter. Conventional laboratory methods provide the effective porosity of representative elementary rock core samples. Here, the porosities derived for sandstone rock core samples using helium porosimeter are referred as conventional porosity values. Conventional porosity values are denoted in Fig. 14. The conventional porosity values estimated for samples SS_B, SS_D, and SS_K are very close to spherical grains’ unit cell porosities. The FESEM images of these samples (Fig. 4c, b, and d) confirm the good sorting of grains. The results show that these sandstone samples reflect a high degree of textural maturity that can be attributed to their depositional environment since the optimum framework grains associated with those samples are spherical in nature. Samples SS_A and SS_O have the least conventional porosity values among the five samples, and the conventional porosity values match closely with the porosity derived for elongated framework grains. Therefore, the optimum framework grains associated with these samples are elongated. SS_A and SS_O samples can be considered as texturally immature attributed to the environment of deposition.

The reported range of porosity values for the sandstone sample from the Assam-Arakan basin is 2–30%. The present study results demonstrate that if the reservoir rock sample is well sorted but with elongated framework grains, the rock will have the lowest porosity. If the same rock sample is well sorted but with spherical matured framework grains, the rock will have the highest porosity. Even though sorting shows more effect on the porosity derived for spherical unit cell models, resulting in a range of values, the elongated unit cell models do not have a wide range of porosity values. Irrespective of the grain size and sorting, elongated unit cell packing models have nearly the same porosity values for the same type of packing in all five sandstone samples. The energy expended during sedimentation will decide the packing present in the rock sample, and therefore, a variation in packing is quite possible within the same depositional environment. The rhombohedral packing model of elongated grains has the least porosity of all the types of packing, which is evident because of the smallest unit void. Thus, heterogeneity is present at a micro-scale for all the samples, causing a wide range of porosity values. Though the actual size of grains does not influence porosity theoretically, the present study displays that practically on actual sandstone samples, the grading and sorting of sediments affect the porosity values.

Conclusions

The present study could develop a new methodology based on the applicability of a static packing model in predicting porosity and the following conclusions are derived.

  1. 1.

    The derived porosity conceptually relates to the inter-granular porosity in clastic sedimentary rocks. The predicted porosity based on grain parameters derived from FESEM image-based analysis is comparable to the conventional porosity values. The developed model reflects the mixing effect on inter-granular porosity for unimodal packing configurations.

  2. 2.

    From the theoretical packing models, it is evident that well-sorted elongated grains reduce the porosity to half with rhombohedral packing and almost 20% for cubic packing. With the increase in elongation, the porosity can reduce to a near-zero value of 2%, keeping all other parameters the same.

  3. 3.

    Porosity estimation on actual sandstone samples using digital image analysis for a given grain size distribution resulted in a range of porosity values comparable to the values reported from the sedimentary basin. Digital image analysis is the only method that visualises the inter-granular pore structure and grain parameters realistically due to its non-destructive nature. The dominant framework grain geometry, shape, and sorting can be determined from the digital FESEM images of rock samples. These parameters are used in the presented packing model in the form of degree of elongation and grain sorting. On the other hand, packing density represents the diagenetic properties of sedimentary rocks.

  4. 4.

    The nature of pore systems at a micrometre to millimetre scale gets affected by the grain sorting. The range of porosity values estimated by changing packing configuration and grain shape effects in terms of elongation degree is realistic at the basin level as the grain shape effects are a replication of sediment maturity. The porosity values reflect the textural maturity associated with depositional heterogeneity in terms of grain shape, grain sorting, and packing configurations. The reason behind the lesser porosity of immature elongated grains is explained with the help of the unit cell packing model for elongated grains. Therefore, at a bigger scale, i.e. at basin level, the effect of grain shape and grain sorting can be captured in the form of uncertainty in the estimated porosity.

  5. 5.

    The unit cell packing model is helpful in deriving pore heterogeneity within the basin of similar textural maturity resulting from a depositional environment. Large-scale variations of geological formations can be represented by spatially distributed samples from a basin. Thus, when applied to spatially distributed samples, the developed porosity model provides a set of framework grains and the inter-granular porosity values that incorporate basin-scale grain characteristics. The developed method can be utilised in distributed spatial models for porosity at basin-scale hydrocarbon resource estimation. However, the assumption made for the unit cell framework for packing models is a limitation of the methodology. Secondary processes such as deformability, compressibility, and cementation have not been considered in theoretical model construction. The future work will focus on modifying the model in order to take account of these factors.