Determining the drilling mud window by integration of geostatistics, intelligent, and conditional programming models in an oilfield of SW Iran

Accurate knowledge of pore and fracture pressures is essential for drilling wells safely with the desired mud weight (MW). Overpressure occurs when the pore pressure is higher than the normal hydrostatic pressure. There is a challenge regarding the pressure studies domain in an oilfield in SW Iran, where lack of geo-mechanical data limits exact mud window calculation. Also, the reservoir generally consists of carbonate rocks and contains no shale interbeds, so mechanical stratigraphy based on Gamma ray could not be applied. This study is to provide safe drilling considering MW to prevent the flow or loss in the vicinity of the new wells in the studied field. In this research, the formation pressures and mud window models are determined by combining geostatistical, intelligent, and conditional programming models and compared with real data. The conditional programming was also used to correct small out-of-range data. The highest correlation between the final effective pressure and velocity cube was observed in lower Fahliyan Formation with 0.86 and Ilam with 0.71.The modeled MW difference ranged between 2.5 and 30 PCF. Also, the maximum modeled MW is 150 PCF in the upper Fahliyan Formation. Heavy mud of more than 130 PCF is suggested for drilling the Khalij member and continues to the end of stratigraphy column. Best observed correlation comparing the drilled and modeled MW, especially achieved in the Fahliyan reservoir Formation with more than 100 PCF and the Ilam Formation with 80–100 PCF. Finally, 3D formation pressures are presented and recommended for further safe drillings.


Introduction
Having correct understanding of the pore pressure of the formation is essential not only for the safe and economical drilling of wells but also for assessing exploration risk factors such as formation migration fluid and sediment integrity. Usually, before drilling, an initial estimate of the pore pressure from the surface seismic data is made by seismic velocities. Using seismic data is the only method to predict the pore pressure in the pre-drilling stage. It estimates the pore pressure based on the effect of wave velocity on pressure changes (Baouche et al. 2020;Sen and Ganguli 2019).
Seismic data, well logs, and drilling information are required information for determining the pore pressure gradient in a field. In case of a lack of necessary information in a part of the field after screening the available data and preparing the database, the necessary well logs are prepared using estimating models (Abdelaal et al. 2022;Haris et al. 2017;Jindal and Biswal 2016;Radwan et al. 2020;Radwan 2021). Sonic logs can be a good indicator of the internal pressure of the ground, i.e., increasing the sound passing time in the zones is a function of changing the porosity or increasing the pore pressure gradient, so that areas with abnormal pore pressure could be identified. Consequently, reduce drilling risk and related costs in these areas are achieved. In addition to pressure, other factors such as lithology also affect the speed of seismic waves; therefore, the use of available geological information and well logs can essentially prevent errors in estimating the pressure of the formation, especially in carbonate formations (Ganguli and Sen 2020;Ganguli et al. 2016Ganguli et al. , 2018Kianoush et al. 2022;Radwan 2021).
According to the effective pressure information at wells (MDT/RFT/DST) and the overburden pressure cube created in the previous section, the effective stress at points of these wells can be calculated. For drilling exploration in the petroleum industry, fracture pressure is the pressure required to fracture the formation and to cause mud losses from a wellbore into the induced fractures. Fracture gradient is obtained by dividing the true vertical depth into the fracture pressure. The fracture gradient is the upper bound of the mud weight; therefore, the fracture gradient is an important parameter for mud weight design in both stages of drilling planning and operations. If the downhole mud weight is higher than the formation fracture gradient, then the wellbore will have tensile failures (i.e., the formation will be fractured), causing losses of drilling mud or even lost circulation (total losses of the mud). Therefore, fracture gradient prediction is directly related to drilling safety. The concept and calculation of fracture gradient probably first came from the minimum injection pressure proposed by Hubbert and Willis (1957). They assumed that the minimum injection pressure to hold open and extend a fracture is equal to the minimum stress. Later on, many empirical and theoretical equations and applications for fracture gradient prediction were presented (Aadnoy and Larsen 1989;Althaus 1975;Anderson et al. 1973;Breckels and van Eekelen 1982;Constant and Bourgoyne 1988;Daines 1982;Eaton 1969;Fredrich et al. 2007;Haimson and Fairhurst 1967;Keaney et al. 2010;Matthews and Kelly 1967;Oriji and Ogbonna 2012;Pilkington 1978;Saadatnia et al. 2022;Wessling et al. 2009;Zhang 2011;Zhang et al. 2022).
In this study, some commonly used methods are described in the following sections. It is known that there is a lower limit of mud weight (MW) below which compressive failure occurs and an upper limit beyond which tensile failure occurs. The range between the lower and the upper limit is defined as the MW window (Abdideh and Fathabadi 2013;Aslannezhad et al. 2016;Liguo et al. 2020;Radwan 2020;Yin et al. 2022). The intervals of tensile and shear rock failure are required to determine the safe MW window and the best drilling trajectory. The pressure of the drilling mud will cause a tensile failure in the wellbore, and drilling mud will be lost in the formation of the MW applied higher than the safe mud window. Shear failure or breakout will occur while this weight is applied lower than the safe mud window (Baouche et al. 2022;Darvishpour et al. 2019;Le and Rasouli 2012;Zhang 2013Zhang , 2019Zhang et al. 2022;Zoback et al. 2003). If geomechanical parameters are unavailable, the equivalent MW is calculated using a confidence interval called a safety margin of about ± 200 pounds per square inch (PSI).
In computer science, conditionals are programming language commands for handling decisions. Specifically, conditionals perform different computations or actions depending on whether a programmer-defined Boolean condition evaluates to true or false. The decision is always achieved in control flow by selectively altering the control flow based on some condition (Vessey and Weber 1984). Conditional statements allow us to change how our program behaves based on the input it receives, the contents of variables, or 1 3 other factors. The most common and useful conditional for us to use in bash is the "if" statement (Andress and Linn 2016). The "if-then-else" construct is common across many programming languages. Here, using Petrel (2016) software, conditional programming has been widely used, such as combining logs in different parts of a field, adding and subtracting cubes, and extracting out-of-range data from generated cubes by undefined codding.
Sequential Gaussian simulation (SGS) is typical in geostatistical simulations, and in many simulators, it has responded to porosity, permeability, and other regional variables. In this method, the simulated value at each point is obtained using the probability distribution function calculated from the raw data and the previous simulation data in the nearest neighbors of the desired point. The first principle in all Gaussian methods is the normality of the raw data; otherwise, they must become the standard (Hosseini et al. 2019;Kelkar and Perez 2002;Lantuéjoul 2001;. In the co-kriging method, the evaluation is performed using the correlation between the desired regional variable and the auxiliary variable in places with a shortage of samples. If the correlation between the two variables is greater than 0.5, the estimation error is significantly reduced by this method (Armstrong et al. 2011;Bohling 2007).
Intelligent methods such as Artificial Neural Networks (ANN) can simulate the ability to receive signals and appropriate responses from the biological neural network and are used in countless fields, including the oil industry are the methods with low cost and high accuracy. ANN is widely used in safe mud windows estimation. After designing and training neural networks and estimating logs or cubes in each zone, the generalization of the networks and the convergence between the actual and estimated values in each zone should be investigated and analyzed. In recent years, ANN has been used to predict the formation gradient and compare their performance. The study showed that ANN provides a sufficient approximation of the fracture gradient as a function of depth, overburden pressure gradient, and Poisson's ratio, but the values of the fracture gradient (Sadiq and Nashawi 2000). Hu et al. (2013) proposed a new feed-forward back propagation artificial neural network (FFBP-ANN) structure to determine pore pressure. It could partially remove the input data from the non-shale formation to show the lithological effect (Hu et al. 2013;Sadiq and Nashawi 2000). Khatibi and Aghajanpour (2020) introduced ANN approaches for shear sonic log prediction, comparing with the empirical Greenberg-Castagna method. Gowida et al. (2022) introduced a new approach to develop a new ANN data-driven model to estimate the safe mud weight range in no time and without additional cost. Beheshtian et al. (2022) developed a novel ANN method to predict Safe mud window from ten well-log input combined with machine learning algorithm hybridized with optimizers.
In the cited previous research, there were all the required data for mud window calculations, and it mainly focused on predicting mud windows in limited reservoir formations. Since this study required the mud window in multi-reservoir formations, we faced some limitations. Deficiency of geomechanical properties of core samples and leak-off test data to estimate and validate breakouts, breakdown, and formation fracture gradients were the first constrain. Furthermore, the mechanical stratigraphy method could not be involved since the dominant lithology of the target reservoir formation is Limestone and does not include shale content. However, gamma-ray logs were available and used for ANN layers.
Considering the vast areal content of the Azadegan oil field (740 Km 2 ) and generated acoustic impedance cube obtained from seismic inversion (AI), the combination of geostatistical methods of sequential Gaussian simulation (SGS) and co-kriging is used for the first time to construct the final models of the formation pressure cube in the entire studied area. Also, utilizing conditional programming (e.g., sequential and nested conditional expressions) to combine logs and cubes in a single model while removing out-ofrange values is a novel approach in this study.
Another innovation in this article was implemented to compensate for the data shortage and extent of the research area. First, validating the minimum and maximum mud weight cubes based on the graphic well logs derived from daily drilling reports and inspecting the mud weight alteration leading to losses and flows in each formation and depth have been examined. Secondly, out-of-range values are revised separately by combinatorial conditional programming. Consequently, for data validation, without employing the core and leak-off test data, the upper and lower limits of the mud window have been obtained as an accurate and reliable source (Appendix A).

Geological model based on seismic interpretation
The Azadegan oilfield is located in the transition zone between the Arabian plate and the Zagros basin (Fig. 1). The Zagros orogeny has changed the shape and fracture of the subsurface layers due to the presence of shale and marl in the Cenozoic formations and the reduction in tectonic stress which have a sealing role in restraining the migration and vertical loss of oil (Du et al. 2016;Mehrkhani et al. 2019). The seismic profile across Azadegan high shows a steep fault system in the Jurassic and underlying sedimentary rocks (Abdollahie Fard et al. 2006;Morgan 1999). Mechanical stratigraphy can provide valuable knowledge for evaluating and predicting the distribution of structural fractures and in situ stress by the core analysis. In terms of geological interpretation, the commonly used sequence stratigraphy analysis includes a lithofacies analysis. The most application of sequence stratigraphy is in shale formations using gamma Ray log because it measures naturally occurring gamma radiation from shales (Lee et al. 2018;Liu et al. 2022;Woo et al. 2022).
Study area includes the South Azadegan Field, which out of 42 available wells, 23 wells have the most selected information. 17 wells located in the central, western, and southern parts have effective pressure test (DST) data and MDT logs in the Ilam to Fahliyan reservoir Formation intervals.

Construction of the structural geological model
The studied field formations are modeled based on the interpretation of time-domain seismic horizons data and correlated with drilling geological information. Depth-domain seismic horizons have been constructed  Fard et al. 2006) 1 3 as separate surfaces from the Aghajari to the Gotnia Formations. Due to the lack of complex fault systems in the area, the geological model has been built with a simple network ( Fig. 3 and Table 1).

Compressional wave velocity modeling
Compressional velocity cube as the initial data has been modeled using geostatistical approaches such as SGS and co-kriging with the same coordinates and inverse distance weighted (IDW) method by determining the relationships between inverted acoustic impedance cube from seismic data, as a trend and scaled-up sonic logs in 23 available wells (Fig. 4).

Overburden pressure cube
Overburden pressure cube is the pressure caused by the overburden weight of the rock matrix and the fluids in the pore space of the overlying rock column. It is also known as geostatic pressure. For estimating the pore pressure with velocity data, the relationship between effective stress and velocity in sediments under normal pressure has been proposed by Bowers (Eq. (1)): where V 0 is the velocity of unconsolidated fluid-saturated sediments. A and B describe the variation in velocity with increasing effective stress (σ) and can be derived from offset well data (Bowers 1995(Bowers , 2002. The overburden pressure cube is calculated by integrating the average density value (from the surface to the desired depth). In Gardner's method,  Fard et al. 2006) first, the logarithmic diagram of the completed cubes of the density logs is plotted relative to the compression velocity logs (Gardner et al. 1974), and the logarithmic relation obtained becomes the exponential Eq. (2).
Logarithmic relation of density cube graphs to compression velocity of South Azadegan Field generated from  1 3 the checkshots data and vertical seismic profiling (VSP) is shown in Fig. 5. In another method, the mean density is obtained through the Amoco experimental relation based on depth in meters. (Eq. (3)).
Due to the high correlation coefficient between the Gardner relation and the Amoco relation of 92.4%, the use of the density cube obtained from the Gardner relation coefficients is approved due to its higher accuracy.
To calculate the overburden pressure, given that the product of density (grams per cubic centimeter) in gravity acceleration (9.81 m per second squared) at depth (meters) is obtained in kilopascals, to calculate the pressure in PSI requires a conversion factor of 145.038/1000; thus, the relationship is as follows (Eq. (4)):

Effective pressure cube
The effective pressure cube (also known as differential pressure) governs the compaction process in sedimentary rocks. Geopressuring implies that the rock has low effective stress and a higher porosity than would be expected when the rock was normally compacted; it results in a lower rock velocity (Dutta et al. 2021). Pressure test data of the studied field generally start from Sarvak and continue to Gotnia Formation, but data in the upper formations are minimal (Fig. 6). By considering obtained data from these 23 wells, the initial modeling of the effective pressure was done using three methods: Bowers using velocity cube (co-kriged with AI), SGS (co-kriging with Vp), and IDW method.

Bowers method
In this method, the exponential relationship of the initial MDT effective pressure data with the final velocity cube (made by the SGS method and co-kriged with AI) for different formations is analyzed separately ( Fig. 7 and Table 2). Then, the effective pressure log for each of the wells was calculated and produced separately using conditional programming in Petrel (2016) software. An example is presented in Eq. (5). .537257), U)))))))))

Sequential Gaussian simulation (SGS) and co-kriging method
In this method, the initial scaled-up model of MDT pressure is made from Asmari to lower Fahliyan Formations using the SGS method combined with co-kriging (with Vp and AI cubes). The next step was completed using the neural network of the above model. Furthermore, it was validated after estimating the pore pressure cube with the primary data.

Inverse distance square weighted (IDW) method
In this method, using the initial scaled-up MDT model, the initial cube of effective pressure is made by the IDW method from the Asmari to the lower Fahliyan Formations. Furthermore, like the previous two models, the above model is completed using the ANN in the next step.

Complementary effective pressure model using neural network
In this step, information layers by the principal component analysis (PCA) were chosen for full propagation of primary effective pressure cubes by the feed-forward back propagation (FFBP-NN) method to determine the highest correlation coefficient with initial MDT data. The correlation between 0.2 and 0.3 (green values) is suitable for generating an ANN layer, and values below 0.2 (blue values) have a low correlation (Table 3). Five information layers were used to modify the model, including gamma, Vp, AI, density, and overburden pressure. Among the selected layers of gamma cubes, Vp and AI have a correlation coefficient in the acceptable range, and density and overburden pressure have also been selected due to their direct impact on other formation pressures (Table 4). Based on the general comparison of the histograms, the most similar frequency distribution in completed effective pressures is related to the SGS method in Ilam Formation with the range of 3500-4550 PSI (Fig. 8).
Also, based on the comparison of the three methods, the FFBP-ANN model based on the initial SGS with 30 iterations has the training error values of 1083.53, test error of 1083.64, and relative error of 0.536. It has the lowest error values compared to the other two methods. Therefore, the effective pressure cube modeled with the integration of SGS, co-kriged with V P and AI, and the FFBP-NN methods is more accurate than the other two methods.

Pore pressure cube
The well test data among the 17 selected wells are discontinuous. Well test pressure log (MDT) must be estimated for the wells in the side sections to calculate the pore pressure gradient in the whole field. For this purpose, pore pressure cube is the pressure acting on the fluids in the pore space of a formation. It is equal to the hydrostatic pressure plus the over-(or under) pressure. Based on the Terzaghi et al. (1996) relationship (Eq. (6)), each of the completed effective pressure cubes is deducted from the overburden pressure cube. Furthermore, after correlating the pore pressure cubes made with the initial MDT/ DST pressure data for different formations (Table 5), the SGS model has the highest correlation coefficient, which is confirmed. Thus, data obtained from this method are considered to calculate the final pore pressure gradient.

Data validation of final pore pressure model
The effective pressure (PSI) in each formation of the final cube is compared with the Vp cube for the same formations. Finally, the Bowers relation coefficients are recalculated (Fig. 9).
Accordingly, the highest correlation coefficient between the final effective pressure cube and the velocity cube is related to the lower Fahliyan Formation with 0.86 and Ilam  with 0.71, which indicates the high accuracy of the modeled data with the original data (Table 6).

Anisotropic spatial variation in final pore pressure cube
For evaluating anisotropy variations in the final pore pressure cube, experimental variograms with the Gaussian method were created in three directions: vertical, major horizontal azimuth of zero degrees, and minor azimuth of 270 degrees. In the vertical variogram, the sill is 0.937, and in major and minor is 1. The anisotropy range for vertical variogram is 68 m and for major and minor directions is 11850 m (Tables 7, and 8, and Fig. 10).

Fracture pressure cube
Fracture pressure is the pressure required to fracture the formation and to cause mud losses from a wellbore into the induced fractures. Some current methods for fracture pressure prediction are as follows:

Hubbert and Willis' method
The concept and calculation of fracture gradient probably first came from the minimum injection pressure proposed by Hubbert and Willis (1957). They assumed that the minimum injection pressure to hold open and extend a fracture is equal to the minimum stress (Eq. (7)): where P min inj is the minimum injection pressure; σ′ h is the effective minimum stress; σ h is the minimum stress; and p is the pore pressure. Matthews and Kelly (1967) introduced a variable of the "matrix stress coefficient (k 1 )," equivalent to effective stress  where OBG is the overburden stress gradient; P p is the pore pressure gradient; and k 0 is the matrix stress or effective stress coefficient. Eaton (1969) used Poisson's ratio of the formation to calculate the fracture gradient based on the concept of the (8) FG = k 0 (OBG − P p ) + P p minimum injection pressure proposed by Hubbert and Willis (1957): where ν is Poisson's ratio, which can be obtained from the compressional and shear velocities (Vp and Vs) by Eq. (9) as a cube that is in the acceptable ranges between 0.2 and 0.1. Finally, using Eaton's Equation (1969), the formation fracture pressure is calculated according to Eq. (10).

Eaton's method
Eaton's method enables the consideration of the effect of different rocks (e.g., shale, sandstone) on fracture gradient, because the lithology effect is considered in Poisson's ratio. In fact, Eq. (10) is the equation of the minimum value of the minimum stress derived from a uniaxial strain condition (Zhang and Yin 2017;).

Daines' method
Daines (1982) superposed a horizontal tectonic stress σ t onto Eaton's equation. Expressing in the stress form, he called it as "minimum pressure within the borehole to hold open and extend an existing fracture," which can be written in Eq. (11): where σ f is the fracture pressure; σ v is the vertical stress, p is the pore pressure, and β is a constant.

Safe mud weight limits concept
Shear failure usually results in borehole collapse or breakout. Borehole breakouts are collapsed regions located on the least horizontal principal stress for vertical wells and are generally formed by compressive shear failure. Therefore, compressional failure will occur in the direction of the minimum horizontal stress because the tangential stress will reach a maximum here known as the lower limit of mud weight. In general, the borehole tensile failure is defined by the minimum principal stress (Darvishpour et al. 2019;Hoseinpour and Riahi 2022;Li and Wu 2022). Therefore, this failure becomes the upper limit of the mud weight window in safe drilling operation (Anari and Ebrahimabadi 2018;Aslannezhad et al. 2016). In Fig. 4, the concept of safe mud weight window (SMMW) is depicted. As is seen from this figure, a low MW of below the pore pressure gradient will result in a kick. If the MW is less than the breakouts, pressure gradient shear failure will occur and the rocks fall into the wellbore. On the other side, increasing the MW above the magnitude of minimum stress will lead into invasion of the mud into the formation, i.e., mud loss.
Increasing the MW further above the fracture pressure gradient causes an induced fracture to be initiated in the wellbore wall (Le and Rasouli 2012;Nazarisaram and Ebrahimabadi 2022). In this study, the aim is to determine the two mud window limits of breakouts and breakdown or fracturing gradients for exploratory wellbores, but due to don't have geomechanical data resulting from drilling cores and leak-off test (LOT), fracture pressure calculated only by the Eaton method and SMMW determined by the equivalent method using pore and fracture pressures modeling resulting seismic interpretation and well logging data.

Results and discussion
Calculating the upper and lower limits of the drilling mud window requires drilling core data and conducting laboratory studies to calculate the minimum and maximum horizontal stress as well as vertical stress to conduct geomechanical and well stability studies. The drilled core from the exploratory wells of studied Azadegan Field only included four wells A-001 to A-004 in reservoir formations in limited depths. The above-mentioned cores were sent to the Japanese TRC laboratory (2002) to calculate the shear velocity (Vs), and no other data is available. Therefore, it was not possible to calculate the parameters of shear failure and tensile failure, and an equivalent safe mud window to drilling mud using pore pressure with a confidence interval greater than + 50 PSI and fracture pressure with a confidence interval of less than − 50 PSI were used. Therefore, the proposal of this study conducts core drilling in new exploitation wells for the exact window of drilling mud using the calculation of breakout and breakdown pressures. Also, failure to conduct the leak-off test (LOT) at the beginning of drilling new hole sections in exploratory wells of the Azadegan Field due to the fear of formation failure was another challenge for calculating and calibrating the formation fracture pressure.
As the results, the maximum modeled MW is 150PCF in the upper Fahliyan Formation and mud heavier than 130 PCF starts from the Khalij member of the Gadvan Formation and continues to the bottom of the field. Comparing the drilled MW to the modeled MW changes shows a high correlation with the presented model results, especially in the Fahliyan reservoir Formation, where the MW has increased to more than 100 PCF, and the Ilam Formation, which has MW between 80 and 100 PCF. Finally, all of the mentioned methods are used to determine a synthetic well log which includes safe drilling mud weight. The results show that in the deep and ultra-deep reservoir formations, the calculated Safe MW is in good match with real data.
Considering the methodology described in Materials and Methods, by converting the above relation to exponential, the equation becomes RHOB = 10 (−0.427706) V P 0.229185 , so the Gardner relation coefficients are calculated as a = 0.38 and b = 0.23. Therefore, to calculate the average density using the average velocity cube, the check shot data and vertical seismic profiling (VSP) have been used to produce average velocity cube.
According to the results, the most changes in overburden pressure are 10,000-16,000 PSI.

Pore and fracture pressure variations
Based on comparing histograms of pressure changes, due to the small changes between the minimum and maximum values of pore pressure and fracture pressure in formations such as Kazhdumi and Gadvan at a rate of less than 200 PSI, to design a drilling mud window, safe interval values to prevent well flow and formation loss of about 50 PSI have been suggested. Based on the obtained results, the increase in pore and fracture pressures of the formation is quite noticeable with increasing depth, except for the lower Fahliyan Formation, in which, with an increasing depth, we see a pressure decrease in this formation. The maximum pore pressure of 10,000 PSI in the Gadvan Formation to the upper Fahliyan and the maximum fracture pressure of 13,000 PSI in the Lower Fahliyan Formation to Gotnia have been obtained (Table 9).

Abnormal pore pressure gradient model
According to results, the studied field generally has an abnormal pore pressure gradient from the depth of 2000 m down in the range between 0.465 and 1 PSI/ft. (Fig. 11).

Designing the mud window range of drilling fluid
Calculating the minimum and maximum mud weight in the studied field As mentioned, due to the impossibility of using breakout and breakdown pressure to calculate the upper and lower limits of the mud window, it is decided to employ pore and fracture pressure cubes with the highest possible precision. In consonance with the hydrostatic pressure concept, the lower and upper margins of the mud window will be calculated as Eqs. (12) and (13), respectively (Appendixes (18) to (20)).
It is required to explain that during several trial and error calculations, the most suitable safety margin in these cases should be regarded as ± 50 PSI. This pressure interval coincides with and confirms the losses and flows mentioned in daily drilling reports (DDR) of the Southern Azadegan Field, particularly Kazhdmi and Gadvan Formations. Notably, 0.5 PCF shifts in mud weight led to frequent losses and flows and, in some circumstances, an underground blowout in these formations. So, an equivalent safe mud window using pore pressure plus 50 PSI and fracture pressure minus 50 PSI was used as the confidence interval. By the pore pressure with a confidence interval greater than + 50 PSI and the depth in meters, the minimum mud weight (MW min ) in pounds per cubic foot (PCF) was calculated according to Eq. (12).
Considering that the minimum MW for drilling with water is 62.4 PCF, values lower than this are removed from the initial cube. To complete the minimum MW cube, the SGS method was used along with co-kriging with the V p cube. In the next step, to correct small out-of-range data, by checking the changes of the minimum MW histogram in different formations, the conditional programming of Petrel software was used. The minimum MW has been modified based on the depth changes and the initial MW range for Gachsaran to Gotnia and Aghajari surface Formations.
The maximum MW was calculated by having the fracture pressure with a confidence interval of less than -50 PSI and the depth in meters according to Eq. (13).
(12) MW min = (P pore + 50psi) × 144 Depth × 3.281 In order to construct the initial cube of maximum MW, values less than 62.4 PCF are removed from the initial cube. To complete and correct the cube of the maximum MW, the same procedure was used as the previous method. Therefore, using the SGS method and correcting the out-of-range values by 5 PCF more than the similar distances in the minimum MW cube, the maximum MW based on the fracture pressure cube resulting from Eaton's relation was calculated ( Fig. 12a and b).

Calculating the window of minimum and maximum mud weight changes
In order to calculate the mud window, the difference between the final MW cubes has been calculated. Due to the difference of more than 60 PCF and negative values in some places, the conditional programming relationship is used in Petrel software to modify the values.
According to results, the range of difference MW is between 2.5 and 30 PCF (Fig. 12c) and the maximum modeled MW is 150 PCF in the upper Fahliyan Formation. The (13) MW max = (P Fracture − 50psi) × 144 Depth × 3.281

Fig. 11
Area with higher than normal pore pressure by SGS method in the studied field 1 3 required interval for designing mud heavier than 130 PCF starts from the Khalij member and continues to the bottom of the field ( Fig. 13 and Table 10).
The graphical results of mud weight cubes resulted by validating the minimum and maximum mud weight based

Comparison of mud window model with the drilled exploratory wells
In order to validate the presented MW model, the graph of lithology, mud losses, and MW changes of some available exploratory wells has been used. A high correlation with the presented model results can be observed in comparing the drilled MW changes to the modeled MW changes, especially in the Fahliyan reservoir Formation, where the MW has increased to more than 100 PCF, and the Ilam Formation, which has MW between 80-100 PCF (Fig. 14).

Synthetic logs of formation pressures and mud weight window
The final cubes were converted into equivalent synthetics logs for all 23 studied wells by Petrel software. In these synthetics logs, the window of changes in pore pressure and fracture pressure is on the left side (bold green and crimson diagrams). Also, the window of effective and overburden pressure changes in the middle (pink and dark blue diagrams) and the mud window diagram on the right side (blue and green diagrams) are presented. The main application of the above graphs is to examine the challenges ahead to overcome the formation pressures during drilling and to provide the appropriate MW to prevent the flow or loss of the exploitation wells in the vicinity of the above wells (Fig. 15).

Conclusions and Recomendation
To conclude all the results: • Compressional velocity is successfully modeled using advanced geo-statistical approach (SGS combined with co-kriging) considering seismically inverted Acoustic Impedance as a trend to propagate sonic log through entire model boundary.  where the MW has increased to more than 100 PCF, and the Ilam Formation, which has MW between 80 and 100 PCF. • As an application of this study, equivalent synthetics formation pressures and mud window logs are presented to examine the challenges ahead to overcome the pressures of the formation during drilling and to provide the appropriate MW to prevent the flow or loss of the exploitation wells in the vicinity of the above wells.
It is suggested to use core laboratory test data in geomechanical studies of the South Azadegan Field to make better wellbore stability analysis. Also, analyzing it through the reservoir layers of the oil-bearing formations should  Synthetic logs of changes in "pore pressure and fracture pressure," "effective pressure and overburden," and changes in "minimum and maximum mud weight" in a A-001, b A-002, c A-025, and d YD-006 exploratory wells 1 3 be investigated. The SMWW design and wellbore stability analysis could be done by FLAC3D software or other numerical simulators established with drilled strata geomechanical features. The initiation of plastic conditions could be used to determine SMWW in specific layers. Finally, the effects of rock strength parameters, major stresses around the wellbore, and pore pressure on the SMWW could be investigated for new wellbores.

Appendix 1
Appendix A: Conditional programming for determination of minimum & maximum mud weight cubes See Fig. 16 Conditional programming with Petrel 2016 software to modify minimum mud weight cube (PCF), based on pore pressure cube (obtained from the neural network, sequential Gaussian simulation (SGS), and co-kriging method with Vp velocity model) for Gachsaran to Gotnia and also Aghajari surface Formations (Appendix Eqs. (14) and (15) Maximum_Mud_Density_PCF + 70, Maximum_Mud_Density_PCF) ))))))))) Conditional programming by Petrel 2016 software to modify the maximum mud weight cube (PCF) based on the fracture pressure cube of the formation (resulting from Eaton's relation) in Gachsaran to Gotnia and also Aghajari surface Formations.
The difference of the MW cubes obtained by the SGS method is also calculated to achieve better results, which has fewer negative values than the original method. So to complete the MW difference cube, if there were empty parts (U) of the cube, the result of the SGS method was used according to the conditional programming Eqs. (16) and (17).
Hydrostatic pressure is defined as the pressure created by a fluid column, and two factors affecting hydrostatic pressure are mud weight and True Vertical Depth.
Calculate hydrostatic pressure in psi by using mud weight in pound per gallon (ppg) and feet as the units of True Vertical Depth. Hydrostatic pressure equation: where Mud Weight in ppg and True Vertical Depth in ft.
So to estimate the minimum and maximum mud weight with formation pressures in hand and regarding safety margin (S.M), we can utilize the following equation: Mud weights and pressure management in complex wells, as illustrated in Appendix Fig. 16, command a greater understanding of the finer pressure measurement margin issues. It usually exists in low and high mud weight limits where lost time events can result if mud weight pressure aspects are not safely monitored and controlled (Bridges and Robinson 2020; William Abel 2019).

Faults die up in the upper Jurassic gotnia formation
See Fig. 17 Appendix Fig. 17 shows incised channels in the top Cenomanian-Turonian Sarvak Formation indicate erosion of the anticline crest in the upper Cretaceous.
(a) indicates incised valleys filled by channel-type sediments. (b) shows the channel-type reflector pattern above the Turonian strata (Abdollahie Fard et al. 2006).

Geological modeling
See Fig. 18 After defining the network range, horizontal (I) and vertical (J) axes, number of nodes, and well's layout, the 3D geological structure of the field was modeled. Then, the In-line and X-line ranges of the amplitude values were added and a seismic cube with post-stack data was created by the arithmetic seismic resampling method of Petrel (2016)