{'fraction_non_alphanumeric': 0.022368474179351557, 'fraction_numerical': 0.00775225097912545, 'mean_word_length': 5.352398050782252, 'pattern_counts': {'":': 0, '<': 0, '<?xml version=': 0, '>': 1, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Electrofacies in Reservoir Characterization

Electrofacies are numerical combinations of petrophysical log responses that reflect specific physical and compositional characteristics of a rock interval; they are determined by multivariate procedures that include principal components analysis, cluster analysis, and discriminant analysis. As a demonstration, electrofacies were used to characterize the Amal Formation, the clastic reservoir interval in a giant oil field in Sirte Basin, Libya. Five electrofacies distinguish categories of Amal reservoir rocks, reflecting differences in grain size and intergranular cement. Electrofacies analysis guided the distribution of properties throughout the reservoir model, in spite of the difficulty of characterizing stratigraphic relationships by conventional means.


Introduction
The primary responsibility for reservoir modeling is in the hands of petroleum engineers, but the most successful reservoir modeling projects have included quantitative input from geologists and geophysicists. However, geologists with the necessary mathematical and computer skills are scarce, so there has been a tendency to rely instead on commercial software that runs factory-set defaults to perform geological and petrophysical modeling, even though statistical software can readily be adapted to perform many of the operations that are useful for geological reservoir modeling. These include statistical analyses of properties derived from well logs, cores and downhole measurements and investigations to determine the best geostatistical parameters for static modeling, evaluating relative effectiveness of seismic attributes, and estimating reservoir fluid properties such as hydraulic flow units. As an example, we will consider the calculation and use of electrofacies in the characterization of a giant clastic reservoir, the Amal field of Libya.

The Amal Field of Libya
The first commercial discoveries of oil in the Sirte Basin of Libya were made in 1958, and in 1959 the first giant field in Libya was found in the Sirte Basin. Five more giant fields were discovered in the same year, including the Amal field discussed here. By the end of the 1960s, the Sirte Basin was established as one of the premier oil provinces of the world (Hallett 2002).
Most reservoirs in the major fields of the Sirte Basin have been in production for 50 years or more and are now nearing depletion. In an effort to extend the lives of fields, the Libyan National Oil Company (NOC) has authorized numerous reservoir studies in the hope that they will disclose previously untapped reserves or suggest improved production strategies. Fortunately, seismic, well, and production information is available for many fields, which permits detailed modeling of reservoirs and the investigation of production alternatives.
The Amal field is located on a wedge-shaped tilted fault block called the Rakb High, one of a series of elongated, subparallel horsts and grabens in the eastern part of the Sirte Basin. The primary reservoir interval is the Amal Formation, a typical transgressive clastic sediment composed of weathered material derived from the underlying basement. Most of the formation is a "tight, hard, quartzose, irregularly feldspathic sandstone" (Roberts 1970). Radiometric studies date the Amal Formation as Cambro-Ordovician to Permian, although a few Triassic fossils have been recovered from lacustrine shales within the formation. Elsewhere in Libya similar transgressive basal sandstones overlying the Hercynian unconformity are called the "Nubian Sandstone" and assigned a Lower Cretaceous age (El-Hawat et al. 1996). The Amal clastics were deposited in continental environments, with some small irregular intervals of possibly lacustrine and shallow marine origin. Thin volcanic sills and flows of Permian age also occur sporadically in the formation, as do local unconformities. The Amal is present everywhere on the Rakb High except at the south end of the uplift where it has been removed by erosion.

Electrofacies Analysis
"Electrofacies" are unique combinations of petrophysical log responses that reflect specific physical and compositional characteristics of a rock interval cut by a borehole. The term "electrofacies" was coined by Serra and Abbot (1980), who considered electrofacies to be proxies for lithofacies. An important advantage of electrofacies over alternative types of facies classifications of rocks in the subsurface is that electrofacies can be defined solely on the basis of well log responses, without reliance on cores, cuttings or outcrops. Although electrofacies are empirical, they are also objective; no subjective interpretations of sediment genesis or inferences about depositional environments are required.
There is no specific procedure for defining electrofacies. The general requirements are that they be determined from a consistent set of petrophysical log measurements; that the similarities between down-hole intervals are expressed quantitatively from the log responses; that the intervals are consistently divided into subsets that have similar responses; and that the distinctions between subsets are expressed as mathematical functions. Because of the enormous amount of data contained in the log suites from a collection of wells, it is necessary that electrofacies be determined by computer (Kiaei et al. 2015). This introduces the practical requirement that electrofacies be defined by a programmable algorithm.
Many procedures for determining electrofacies have been proposed in the literature (Berteig et al. 1985;Busch et al. 1987;Delfiner et al. 1987;Tetzlaff et al. 1989;Anxionnaz et al. 1990;Hernandez-Martinez et al. 2013;Euzen and Power 2014) and most commercial software packages for subsurface modeling have electrofacies functions. Unfortunately, details about how these functions perform are seldom revealed, and the procedures operate as "black boxes." (Exceptions are the description of Schlumberger's FACIOLOG procedure given by Wolff and Pelissier-Combescure 1982, and the software provided by Lee et al. 2002). Almost all commercial implementations consist of a combination of principal components analysis, cluster analysis, and discriminant analysis. These underlying methodologies can be duplicated using a multivariate statistical package, which has the advantages of flexibility and transparency, although perhaps less convenient for routine electrofacies calculations. Dubois et al. (2007) provide a comparison of alternative statistical methodologies for electrofacies analyses. Perez et al. (2005) have demonstrated that electrofacies are superior to other types of reservoir characterizations such as lithofacies or hydraulic flow units (HFU).
The general definition of "facies" is "the aspect, appearance, and characteristics of a rock unit, usually reflecting the conditions of its origin; especially as differentiating the unit from adjacent or associated units" (Neuendorf et al. 2005). The definition continues to more specialized varieties of facies, noting that "sedimentary facies" consist of a restricted part of a lithostratigraphic body with a unique lithology or fossil content, or a certain environment or mode of origin such as "red-bed facies." A "petrographic facies" is a body of rock of a distinctive lithology, while a "biofacies" contains a unique assemblage of fossil organisms. "Environmental facies" consist of a body of rock formed in a specific environmental setting, such as a "fluvial facies" or a "near-shore facies." The term "facies" may also refer to rocks defined on a paleogeographic or paleotectonic basis, such as a "geosynclinal facies" or a "continental margin facies." Note that all of these definitions require either information that can only be obtained from direct observation of the rocks themselves (lithologies, fossils), or subjective interpretations about the origins or depositional environments in which the rocks were formed. In contrast, electrofacies are based solely on the "…aspect, appearance, and characteristics…" of petrophysical logs, and not of the rocks which the logs represent. The basic assumption in electrofacies interpretation is that a unique combination of log properties represents a rock that exhibits a unique combination of physical properties-in other words, the rock is unique in terms of its composition and fluid content.

Choice of Log Traces for Electrofacies Calculation
Ideally, there will be a large suite of logs available for calculating electrofacies and the tool responses to be used can be chosen based on resolution and response to properties of primary interest. In practice, especially in areas where drilling and logging has taken place over many years, finding a common set of logs that is available in all (or most) wells severely limits the choice. In the electrofacies study discussed here, only the DT, GR and ILD logs were common to all wells in the field. However, by removing a small number of wells from consideration, the suite of logs could be expanded to include the SN and SP logs.

Standardization of Log Traces
It is essential that the log measurements used in electrofacies calculations be consistent throughout the stratigraphic section in the well being analyzed, and from one well to another. This can be done in a variety of ways. Some commercial programs such as Schlumberger's Petrel do this by converting the data into principal component scores and then computing electrofacies from scores rather than from the log data itself. Although principal components were calculated here for display purposes, we prefer to compute electrofacies directly from the original log variables after appropriate transformations.
Log standardization consists of subtracting the mean log response over an interval of interest from every log reading in the interval and dividing the remainder by the standard deviation of the response in the interval. This converts the reading into dimensionless units of standard deviation, most of which will range in value from -3 to +3 (Davis 2002). Each log trace is standardized independently of all other log traces in a well, and the traces in each well are standardized independently of all other wells. This (1) removes any effects caused by differences in measurement units (ohm-meters, millivolts, microseconds/ft, etc.). It also insures (2) that all logs used in the analysis equally influence the classification of the electrofacies because all the logs have the same average value (their means are all 0.0) and their spreads in values are approximately the same (their standard deviations are all equal to 1.0). Furthermore, (3) any differences between wells caused by different hole conditions or different logging parameters are removed. In petrophysical terms, standardization of the log tracks for individual wells can be regarded as an ultimate form of well log normalization.
We can regard the transformed well log data as consisting of a matrix or flat file whose columns contain the standardized well log traces and whose rows are measured depths or elevations in specific wells. Further computations are done treating the row vectors as individual multivariate "objects" to be classified.

Estimating the Number of Distinct Electrofacies
Because electrofacies are defined empirically, the number of different electrofacies is somewhat arbitrary. The number of useful electrofacies is partly dependent on the number of log properties used in their calculation and the joint nature of the statistical distributions of the log measurements. It also reflects the purpose of electrofacies classification and the manner in which the final classification will be evaluated and used. A simple distinction between reservoir and non-reservoir rock may be made with an electrofacies classification of only two classes, while a study for environmental interpretation may require a dozen or more classes.
Because there is a limited number of well logs that measure different physical properties in the example used here, we anticipate that an effective electrofacies interpretation will not involve many facies classes. Determining the appropriate number requires trial-and-error, starting with many classes and reducing the number to eliminate trivial categories that include only a few rare observations, or to combine ill-defined classes that have very similar properties. The same trial-and-error process can be used to evaluate alternative procedures such as different clustering algorithms. Figure 11.1 is a cross-plot of the first and second principal components of log responses from the Amal Formation. The scatter diagram represents 12,535 well log observations classified into seven electrofacies; each electrofacies category is indicated by a color (1 = red; 2 = green; 3 = blue; 4 = orange; 5 = light blue; 6 = purple; 7 = yellow). Categories 3 and 4 are relatively small and consist of scattered observations located on the periphery of the main cloud of observations; a classification with fewer categories might be better. The classification procedure was repeated with six categories, then with five, and finally with only four. Five electrofacies seemed to be an optimal compromise in which the facies are general enough to include significant thicknesses of intervals, but not so detailed that they defy interpretation (Fig. 11.2). The distribution of observations among the five classes is shown in a principal component scatter plot in Fig. 11.3.

Assigning Well Log Intervals to Electrofacies
There are two basic approaches to the assignment of log intervals to electrofacies, referred to generally as supervised and unsupervised classification. The first requires prior definition of the facies categories, which is usually done by identifying unique lithologies in cores. The log traces for the corresponding intervals are then used as a training set for discriminant analysis or another classification procedure that yields equations used to discriminate between the facies in uncored intervals. Although this approach has the advantage that interpreting the "meaning" of the electrofacies categories is obvious, it has a severe disadvantage in that cores or other training materials are required. An example of a supervised electrofacies classification is given by Barthelmy (2000), who classified 360,000 feet of log from the Smackover Formation in 364 North American wells, using 47,000 feet of core as training material. In the Amal field, very few cores have been taken and not all the rock types in the Amal Formation have been sampled in a representative manner.
If adequate training materials are not available, the analyst must resort to unsupervised classification. This involves subdividing the set of log measurements into subsets that are as unique as possible in their log characteristics, and as distinct as possible from other subsets. There are many procedures that attempt to achieve this objective-their effectiveness depends on the statistical distributions of the petrophysical logs that are used.
The classification procedure used in this study is k-means clustering, which assigns each observation (a row vector in the data set) to the "nearest" cluster based on the multidimensional distance between the observation and the cluster centroid. The multivariate Euclidian distance, d ij , between an observation and a cluster centroid is where z ip is the standardized response of log track p at a well depth i and Zj p is the average response of log p in cluster j. There are q different standardized log traces per observation. The k-means method first selects a set of k points called cluster seeds as a first guess at the means of the clusters. Each observation is assigned to the nearest seed to form a set of temporary clusters. The seeds are then replaced by the cluster means, the points are reassigned, and the process continues until no further changes occur in the clusters. The k-means approach is a special case of a general approach called the EM algorithm (Dempster et al. 1977), where E stands for Expectation (the cluster means in this implementation) and the M stands for maximization, which is the assignment of observations to the closest clusters in this implementation. The algorithm will produce maximum likelihood estimates of the probability that a log reading belongs to a specific electrofacies. The procedure is widely used in computer vision and portfolio management, in addition to electrofacies classification. Fifty-one iterations were required by the k-means algorithm to converge on a stable five-cluster configuration of the 12,535 log responses used here.

Converting the Electrofacies Classification into a Prediction Function
Although the k-means clustering algorithm can successfully classify a collection of log responses into an arbitrary number of electrofacies, it does not produce a posterior classifier. That is, it does not create a classification rule or mathematical function that can be used to assign additional log readings to the electrofacies categories it has found. An additional step is necessary. Canonical discriminant analysis can be used to find a set of linear functions that will separate all possible pairs of electrofacies clusters-in effect, dividing up multivariate space so only one electrofacies occupies each partitioned cell. The computations involve dividing the variance-covariance matrix of the five log properties into components that represent the variation of each observation around the grand mean, the variation of each observation around its electrofacies group mean, and the variation of the electrofacies means around the grand mean. Computational details are given in Davis (2002). Mulhern et al. (1986) discuss the application of discriminant functions to electrofacies determination. In discriminant analysis, the distance from a log reading to the multivariate mean of the i-th electrofacies group is the Mahalanobis distance, D 2 , and is computed as where S is the covariance matrix. The distance is divided into a portion, dist[0], that does not vary across groups and a portion that is the Mahalanobis distance of an observation from the centroid of the i-th electrofacies, dist[i]: Assuming that each group follows a multivariate normal distribution, the posterior probability that a well log interval belongs to the ith electrofacies is The distances from every log observation to each electrofacies centroid is first calculated, then turned into probabilities. Each observation is then assigned to the electrofacies to which its probability of membership is the highest. Observations from other wells can also be assigned electrofacies by entering their standardized measurements into the distance and probability equations.
The assignment of individual well log observations to electrofacies by canonical discriminant analysis is not perfect, primarily because of overlapping of the original clusters. This can be evaluated by comparing the original electrofacies assignments from clustering to the results of discrimination. Figure 11.4 shows the first two principal components for 12,535 log readings in the Amal Formation in 15 wells. The points have been color-coded according to the maximum probability assignment of electrofacies by the canonical discriminant function. Compare this illustration to the original electrofacies assignments in Fig. 11.3. Contingency analysis shows that the overall correct classification rate is approximately 89%. Correct classification rates for individual electrofacies groups ranges from a low of 93.1% to a high of 97.9%.
However, the primary motivation for introducing a discrimination step in electrofacies analysis is to create numerical expressions that can be used to classify intervals in wells that were not included in the original clustering. This may be necessary if it is not possible to cluster all observations (that is, all depth intervals of interest in all wells) because of computer or software limitations. (A large oil field may include millions of log measurements, so such limitations may significantly constrain an electrofacies study.) Fortunately, in the Amal study it was possible to perform cluster analyses using all of the data of interest, so a discrimination step could be avoided. This not only simplifies the procedure, but also results in a slight but significant improvement in electrofacies classification.

What Do Amal Electrofacies Mean?
An empirical interpretation of Amal electrofacies has been made by comparing the electrofacies classifications to core descriptions for a set of wells in which extensive sets of cores were taken. The interpretations are necessarily somewhat ambiguous because of the circumstance mentioned in the preceding paragraph, and because the core descriptions were written by different geologists who may have emphasized different aspects of the rock or who used different definitions of their descriptive terms. The following lithologic descriptions represent an amalgam of the written words assigned to numerous intervals in different wells where the Amal has been given the same electrofacies classification. The lithologic distinction between Amal

Lithologic Description of Amal Electrofacies
Electrofacies 1 = Quartz sandstone with abundant kaolinite cement, traces of chlorite, mica and/or feldspar, very fine to medium grain size, subangular, medium to well sorted. Electrofacies 2 = Quartz sandstone with kaolinite cement, common biotite, very thin bedded and/or crossbedded, silt to fine grain size, subangular, medium sorted. Electrofacies 3 = Quartz conglomerate with kaolinite and/or anhydrite cement, very fine to very coarse grain size with large (>1 inch) rounded quartz pebbles, round to subround grains, unsorted. Also, quartz sandstone with silica cement, common biotite and/or hematite, silt to coarse grained, alternating sorted and unsorted layers, round to subround, no visible porosity, hard. Electrofacies 4 = Quartz sandstone with minor kaolinite cement, traces of chlorite, mica and/or feldspar, silt to medium grain size, subangular to subround, medium sorted. Electrofacies 5 = Igneous rock, weathered, microcrystalline to acicular, with muscovite mica and/or feldspar phenocrysts.
The lithologies corresponding to Amal electrofacies perhaps can best be understood in terms of two-way variation (Fig. 11.5). Along one axis, the electrofacies represent differences in grain size and sorting; along the other axis the electrofacies reflect the nature of the intergranular cement in the sandstone, which tends to be either kaolinite (occasionally calcite or anhydrite) or silica. Kaolinite probably has resulted from the decay of feldspar grains in what was originally an arkosic sandstone. Silica cement probably is the result of pressure solution of quartz grains and redeposition.

Conclusions
Electrofacies have proved to be a useful procedure for identifying and distinguishing intervals with similar petrophysical log responses and approximately equivalent lithologies within a formation that is nearly homogeneous in composition and devoid of biostratigraphic indicators or marker beds. Because the Amal Formation was mostly deposited in a terrestrial environment, facies change rapidly both laterally and vertically and conventional lithostratigraphic correlations cannot be made. Electrofacies analysis provides a framework for modeling that can guide the distribution of reservoir properties throughout the model, in spite of the difficulty of characterizing stratigraphic relationships by conventional means. This is one example of the type of contributions that can be made to reservoir modeling by geoscientists using a quantitative approach. Fig. 11.5 Amal electrofacies classes as a function of grain size from coarse to fine, and nature of matrix or cement, either clay (kaolinite) or quartz (silica) Open Access This chapter is licensed under the terms of the Creative Commons Attribution 4.0 International License (http://creativecommons.org/licenses/by/4.0/), which permits use, sharing, adaptation, distribution and reproduction in any medium or format, as long as you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons license and indicate if changes were made.
The images or other third party material in this chapter are included in the chapter's Creative Commons license, unless indicated otherwise in a credit line to the material. If material is not included in the chapter's Creative Commons license and your intended use is not permitted by statutory regulation or exceeds the permitted use, you will need to obtain permission directly from the copyright holder.