Corrosion-resistant systems of formate packer fluid for G3/N80/TP110SS pipes at high temperature, high pressure and high H2S/CO2 ratios

A series of corrosion problems caused by high-temperature, high-pressure and high-acid gas environments has been an issue in oil and gas production for a long time. During the development of a high-acid gas field, the petroleum pipe is subjected to many aspects of corrosion, and the corrosion mechanism is complicated by the condition of the coexistence of H2S/CO2. Based on the study of the corrosion problem associated with the formate packer fluid in Southwest China, three kinds of steels were studied for corrosion prevention in the alloy G3/N80 steel/TP110SS steel. The study shows that the corrosion rate of the formate packer fluid is low, but corrosion is severe in environments characterized by high temperatures, high pressures and high-acid gas contents. Based on the consideration of cost and the difficulty of realization, an anti-corrosion system was constructed based on the existing packer fluid, mainly through the introduction of a variety of anti-corrosion additives. Through the selection of various additives and corrosion experiments, a corrosion protection system of formate packer fluid was developed. Corrosion tests show that the corrosion rate of the system must be less than 0.076 mm yr−1 to achieve the purpose of corrosion protection. The formate packer fluid with corrosion protection can meet the needs of the current application.


PX, 0000-0002-7747-2423
A series of corrosion problems caused by high-temperature, high-pressure and high-acid gas environments has been an issue in oil and gas production for a long time. During the development of a high-acid gas field, the petroleum pipe is subjected to many aspects of corrosion, and the corrosion mechanism is complicated by the condition of the coexistence of H 2 S/CO 2 . Based on the study of the corrosion problem associated with the formate packer fluid in Southwest China, three kinds of steels were studied for corrosion prevention in the alloy G3/N80 steel/TP110SS steel. The study shows that the corrosion rate of the formate packer fluid is low, but corrosion is severe in environments characterized by high temperatures, high pressures and high-acid gas contents. Based on the consideration of cost and the difficulty of realization, an anti-corrosion system was constructed based on the existing packer fluid, mainly through the introduction of a variety of anti-corrosion additives. Through the selection of various additives and corrosion experiments, a corrosion protection system of formate packer fluid was developed. Corrosion tests show that the corrosion rate of the system must be less than 0.076 mm yr −1 to achieve the purpose of corrosion protection. The formate packer fluid with corrosion protection can meet the needs of the current application.
2018 The Authors. Published by the Royal Society under the terms of the Creative Commons Attribution License http://creativecommons.org/licenses/by/4.0/, which permits unrestricted use, provided the original author and source are credited.

Introduction
Currently, high acid gases such as in Puguang and Yuanba in northeastern Sichuan are undergoing largescale development (table 1). Such gas fields are characterized by high temperature, high pressure, high CO 2 content and high H 2 S content [1,2]. Under the conditions of high temperature, high pressure, high CO 2 and high H 2 S, the gas field corrosion environment is bad. Tubing, casing and downhole tools are vulnerable to the acid medium corrosion, especially CO 2 and H 2 S corrosion. Packer fluid is an effective measure to reduce corrosion [3,4]. Packer fluid, which has various properties, such as reducing the pressure difference between the tubing and annulus, preventing packer leakage, reducing oil and gas pressure supported by a casing head or packer, controlling the tubing and casing corrosion, and preventing fouling, is filled between the tubing and casing [5,6]. Conventional packer fluid mainly includes oil-based and water-based fluids. Compared to the problems of the high cost and serious pollution of oil-based packer fluid, a clean brine system has serious corrosion problems, but formate packer fluid has the characteristics of a non-solid and low corrosion itself. Its density falls within a wide adjustment range. The formate fluid does not generate sediment and has low formation damage [7][8][9][10]. The non-corrosive characteristics of formate itself further illustrate the degree of corrosion associated with formate packer fluid.
Although the corrosion associated with formate packer fluid is relatively small, in an environment at high temperature, high pressure and high acid gas, the bad sealing of packer fluid will lead to a large number of unfavourable factors, resulting in high amounts of acid gas entering the packer fluid. CO 2 and H 2 S reduce the pH value of the packer fluid, resulting in many problems such as an increasing degree of corrosion and formate decomposition [11,12]. CO 2 or H 2 S corrosion is affected by the gas partial pressure, temperature, water salinity, Cl − content, pH value, etc. The influence of these factors causes the difficulty of protection from CO 2 or H 2 S corrosion to be relatively large. The corrosion mechanism under the condition of CO 2 and H 2 S coexistence is more complex [13][14][15].
According to the current problems of the corrosion of tubing and casing, in most cases, the solution is the main pipe replacement with a pipe that shows good anti-corrosion performance, which solves the corrosion problem to a large extent but also simplifies later work. However, the application of an anticorrosion pipe column will greatly increase the engineering cost [16][17][18]. Based on the current treatment methods in the petroleum industry, adjusting the corrosion resistance of the corrosion medium is the main solution to this problem, and this solution can efficiently and simply solve the corrosion problem.
The evaluation and optimization of formate packer fluid was mainly based on the corrosion characteristics of the base fluid of the existing formate packer fluid under the condition of high temperature, high pressure and high acid gas to analyse the corrosion mechanism and optimization mechanism. Based on these mechanisms, this study introduces a corresponding adjusted treatment, evaluates the corrosion effect under different conditions, and constructs a formate packer fluid system that can meet the user requirements under the conditions of high temperature, high pressure, high CO 2 and high H 2 S content. The base fluid comprises water + 0.2-0.5 wt% XC + 0.2-0.5 wt% PAC-HV + 0.2-0.5 wt% PAC-LV + 3-5 wt% KWJ + NaCOOH + KCOOH + others. The base performance of a base fluid with 1.30 g cm −3 is shown as an example in table 2.

Materials of corrosive pipes
Based on the material selection requirements of tubing and casing in the Puguang acid gas field, three kinds of pipes of alloy G3, N80 steel and TP110SS steel are widely used in drilling engineering. Therefore, the study selects these three types of pipes to carry out the experiments, and the components are shown in table 3.

Corrosion experiment
The corrosion detection methods are carried out by mechanical methods, including surface inspection, the hanging piece method, etc. Surface inspection uses digital cameras to record the appearance of samples, the changing conditions of the environment and the status of the corrosion products. The hanging piece method involves fixing the sample holder in a high-temperature and high-pressure reactor, observing the surface and measuring the weight loss after a certain period of the operation of the corrosion process. The hanging piece method and surface inspection were used to measure the corrosion rate for CO 2 /H 2 S under the conditions of different types of steel and different packer fluids. The method for calculating the corrosion rate was formula (2.1).
The experiment followed the China national standard 'GB 10124-88 metals materials -Uniform corrosion -Methods of laboratory immersion testing' and the China petroleum industry standard 'SY/T 5329-2012 reservoir water quality index and analysis method'.

Bactericidal efficiency
To test bactericidal efficiency with different concentrations of bactericide on the bacterial colony, an experiment was carried out that used the basic fluid of formate packer fluid for suspending bacteria, using the percentage that represented sterilization (BE) and formula (2.5).

Deoxidization rate
To test the deoxidization efficiency with different concentrations of deoxidizer, a test was carried out that used the basic fluid of the formate packer fluid as a test object, and the oxygen content tester was used to perform the test, using a percentage representing the deoxidization rate (DR) and formula (2.6).

H 2 S
H 2 S corrosion is caused by the invasion of H 2 S in the formation if the packer has poor sealing or even damage; it may also be produced by the decomposition of a sulfur agent in the formulation of packer fluid under the annulus condition of high temperature and high pressure, such as the decomposition of sulfur-containing corrosion inhibitors [19,20]. H 2 S corrosion used to be called acid corrosion in the oil and gas industry. The H 2 S gas itself usually has no corrosive effect and produces the corrosion of tubing and casing only when H 2 S and water exist simultaneously. In the annulus of the tubing and the casing, the gas containing H 2 S is invaded by the packer fluid into the water-based packer fluid. H 2 S turns into wet H 2 S and then causes corrosion. After the H 2 S is dissolved in the packer fluid solution, the dissolved H 2 S is ionized rapidly, and the dissociation reaction is shown below [21]. and H + is a strong depolarizing agent that takes electrons from the surface of the tubing and casing and then restores itself to become hydrogen atoms. This process is called the cathodic reaction. When the main components of the tubing and casing steel lose electrons, the steel becomes Fe 2+ . Fe 2+ and S 2can react to form FeS, and this process is called the anode reaction. The above electrochemical reactions are often expressed as follows: Fe → Fe 2+ + 2e (anodic reaction) , (anodic product) and Fe + H 2 S → FeS + H 2 (total electrochemical reaction).
These reactions produce large amounts of hydrogen atoms and provide the material conditions for hydrogen embrittlement. The large amounts of H 2 S (aq) and HS − in the packer fluid can inhibit the reaction of hydrogen atoms (H) to produce hydrogen molecules (H 2 ). When excess hydrogen is contained, a certain hydrogen pressure is formed, causing the hydrogen to penetrate and enrich the defects in the steel [21]. The deposition of the anode product FeS on the surface of the tubing and casing steel can form a denser passivation film to prevent further corrosion. Then, in the environment of coexisting CO 2 , O 2 and Cl − , the passivation film is vulnerable to damage and cannot prevent further corrosion.

CO 2
When CO 2 is dissolved in packer fluid, it has a strong corrosive effect on steel in the process of operation, and the total acidity is higher than that of hydrochloric acid at the same pH value. The most typical characteristics of CO 2 corrosion are shown as local pitting corrosion, outline corrosion and large area pitting corrosion. Large area pitting corrosion reflects the most severe corrosion. The corrosion perforation rate is very high. The corrosion rate reaches up to 3-7 and up to 20 mm yr −1 under anaerobic conditions, making the tube life fall fast. The corrosion process of CO 2 is as follows: when the CO 2 meets the water-based packer fluid, a certain amount of CO 2 will be dissolved in water to form a solution of a certain CO 2 concentration. The solubility of CO 2 in water will depend on the temperature and CO 2 partial pressure. The CO 2 dissolved in water reacts with water to form carbonic acid [22]: The first hydrolysis of carbonic acid: H 2 CO 3 → H + + HCO 3 − . The second hydrolysis of carbonic acid: The reaction of H 2 CO 3 and Fe in the solution contributes to the corrosion of Fe: Fe → Fe 2+ + 2e (anode reaction), and Fe + H 2 CO 3 → FeCO 3 + H 2 (total electrochemical reaction).
The second step of the hydrolysis is very weak. The solutions mainly exist as H + and HCO 3− . Most of the substances in the reaction products are Fe (HCO 3 ) 2 . Fe (HCO 3 ) 2 is not stable in the high-temperature stratum, and it is easy to break down to form: CO 2 corrosion is a typical local corrosion, with carbonate or film generated by corrosion forming corrosion with a strong autocatalytic effect between different regions. CO 2 partial corrosion is the result of corrosion galvanic action [23].

Corrosion mechanism with the coexistence of CO 2 and H 2 S
Most of the gas fields are characterized by high temperature, high pressure, high CO 2 and high H 2 S, and most corrosion problems and their respective mechanisms have been solved using problem-solving methods. However, the actual situation of the underground gas in the gas fields is the coexistence of CO 2 and H 2 S. These coexistence conditions cause serious corrosion problems. The study of the corrosion mechanism and the protection methods with the coexistence of CO 2 and H 2 S must be vigorously carried out [24].
At present, the study of corrosion problems under the condition of the coexistence of CO 2 and H 2 S is both less and more dispersed, as no systematic and comprehensive in-depth study has been performed. However, domestic and foreign scholars have also done some fruitful work in some respects, and a series of research results has been obtained. The results of corrosion experiments on N80 steel by Zhenquan Bai et al. [25] and others [26][27][28] have shown that the effect of H 2 S is similar to the above results. When P CO 2 /P H 2 S = 888 > 200, the presence of H 2 S helped slow the corrosion. The surface of N80 steel has a thick and uniform product film, with high adhesion and low corrosion tendency of steel. In the case of P CO 2 /P H 2 S = 7 < 200, the steel surface product film is mainly composed of FeS, and the film has good density and high adhesion. Therefore, the uniform corrosion rate of N80 steel is significantly reduced.

Evaluation of the effect of organic salt on the corrosion rate
Previous studies have shown that organic salts are much less corrosive to tubing and casing steels than inorganic salts because the product from an organic salt ionization has a neutralizing effect with H 2 S and CO 2 in the medium. The organic salt also inhibits the corrosion of H 2 S and CO 2 . At the same time, sulfatereducing bacteria and other biological bacteria have also inhibited growth. Figure 1 is the experimental result of the corrosion rate of an N80 steel sheet with different concentrations of organic salt. Figure 1 shows that the anti-corrosion capacity of formate is limited. Under the influence of long-term acidic medium, to solve the problem of anti-corrosion of casing and other pipes in long-term acidic medium, in addition to using corrosion-resistant materials, adding chemical inhibitors such as corrosion inhibitors into the sealing fluid is a necessary and low-cost method.

Evaluation of corrosion effect in high H 2 S/CO 2 -containing environment
The well annulus of a high-acid gas reservoir is located in an environment characterized by the coexistence of high temperature, high pressure, high H 2 S and high CO 2 . In addition, the corrosion   inhibitor has an antiseptic effect on packer fluid. The sulfur-removal agent plays an important role in controlling H 2 S corrosion. To achieve long-term protection, the synergistic action of the sulfur-removal agent and an inhibitor is needed. The experimental conditions for simulating the actual corrosive environment are shown in table 4. Alloy G3/N80 steel/TP110SS steel was used as the experimental material. The experiment was carried out in a high-temperature and high-pressure corrosion test kettle. Three parallel samples were used for each material [29][30][31].
The corrosion rates of the three materials are shown in table 5; these were obtained when there was no inhibitor or sulfur-removal agent in the packer liquid. The corrosion rate of alloy G3 is very low, which is lower than the industry standard of 0.076 mm yr −1 (China Petroleum and Natural Gas Industry Standard SY/T 5329-2012 Water quality standard and practice for analysis of oilfield injecting waters in clastic reservoirs), so it can be used safely without adding anti-corrosion ingredients. However, the corrosion rates of N80 and TP110SS are, respectively, 0.6642 and 0.6675 mm yr −1 , which are much higher than the corrosion rate under the conditions of atmospheric pressure and without adding H 2 S and CO 2 . These experiments show that the degree of corrosion is more serious in the oilfield environment. Based on the  NACE standard, the degree of corrosion is serious, and it is necessary to carry out the anti-corrosion of the pipes to work safely. As figures 2 and 3 show, the corrosion of alloy G3 is very minor, the colour is very shallow, and the colour of the metal can still be seen. The surface of N80 steel and TP110SS steel was completely covered with corrosion product film black, which showed relatively serious corrosion. Corrosion products are found in the removal of firmly attached corrosion products mainly because of the high temperature caused by the crystallization product. This reaction has also been reported in other studies [32,33].
Based on the experimental conditions, we can conclude that H 2 S corrosion should be the main cause for the corrosion of steel in the experimental environment. From the analysis of the H 2 S corrosion mechanism, no matter what form of H 2 S is involved in the corrosion reaction, the adsorption on the    steel surface is the basis, and the main factor affecting the adsorption quantity is the content of H 2 S and the number of active points on the steel surface. In this study, three kinds of samples are adopted. Owing to the large amounts of nickel contained in G3, its corrosion resistance is very high. Previous studies have shown that G3 is a good H 2 S corrosion resistance material. G3 has a low corrosion rate in the H 2 S environment, but the price is more expensive. G3 is generally used only in conditions of a very bad environment. TP110SS is a high sulfur-resistant steel that mainly reflects the ability to resist H 2 S stress corrosion cracking (SCC). However, at high temperatures, SCC has less sensitivity. The main corrosion is weight loss corrosion, and its corrosion rate is larger. The corrosion rate of N80 steel in this environment is similar to that of TP110SS. Therefore, N80 steel can be considered when selecting material, as was also reported in the design of the Puguang Gas Field. N80 steel and corrosion inhibitor could be an anti-corrosion option to put into production. Figure 4 shows the surface morphology of the three materials after removing the corrosion products. Pitting corrosion does not occur in the short term.
Before the experiment, the packer fluid was milky white, and the pH value was 8. After the corrosion test, the solution became black (as shown in figure 5), and the pH value changed to 6. The black substance is the corrosion product dissolved in the protective liquid. Because of the high content of H 2 S, the corrosion should be dominated by H 2 S corrosion, and the product is Fe x S y . Because H 2 S and CO 2 are dissolved in water, the hydrolysis is acidic, which can neutralize the alkaline packer fluid and decrease the pH value, thus exacerbating the corrosion. of the three kinds of tubes in the packer fluid. Corrosion control by chemical method is the most effective and economical method. Based on the evaluation of the corrosion effect of formate packer fluid under the conventional environment and the high H 2 S/CO 2 environment, in the case of highly acidic gas, the formate packer fluid system still exhibits serious corrosion. Highly acidic gas corrosion under high-temperature and high-pressure conditions needs to be optimized to meet the requirements of the corrosion performance of packer fluid in oilfield applications.
To solve the corrosion problems in an environment of high temperature, high pressure and highly acidic gas, there are two main methods: replacing the corrosion-resistant steel and improving the anticorrosion performance of the packer fluid system. In the current environment of the overall downturn in the oil industry, reducing costs is the first problem to be solved. Corrosion-resistant steel will greatly increase the cost of drilling and completion engineering. Corrosion-resistant steel is not completely anti-corrosive, and its anti-corrosion capability needs further tracking and optimization. Improving the corrosion resistance of the packer fluid system is a method that can be easily realized and can also rapidly improve the corrosion resistance. Improving the corrosion resistance of the packer fluid system can reduce the corrosion rate of steel at a lower cost.
Based on the above reasons, the corrosion resistance of the oil casing pipe is reduced by adopting the method of constructing the anti-corrosion performance of the sealing liquid system. The anti-corrosion behaviour of the improved packer fluid is mainly aimed at the characteristics of the steel and the source of corrosion. The main strata studied are characterized by high temperature and high pressure, as well as gas with high H 2 S/CO 2 content. Therefore, this research focuses on the corrosion prevention of three kinds of steel, alloy G3, N80 steel and TP110SS steel, which are mainly used to reduce the corrosion caused by high levels of H 2 S/CO 2 gas under the conditions of high temperature, high pressure and high H 2 S/CO 2 content.
From the existing treatment methods, the existing anti-corrosion system based on the existing blocking liquid system can meet the needs of the field and meet the cost requirements. The construction of a corrosion protection system is mainly achieved by the introduction of anti-corrosion additives, including a sulfur-removal agent, corrosion inhibitor, bactericide, deoxidizer, etc.

Sulfur-removal agent
In this study, the sulfur-removal agent is the H 2 S removal agent. At present, sulfur-removal agents in oil and gas fields can be divided into oxidation type and precipitation type agents [34]. An oxidative sulfur-removal agent oxidizes S 2− into elemental S or a higher value material of SO 4 2− , thus acting as a sulfur-removal agent. The representative sulfur-removal agent has ClO 2 , H 2 O 2 , K 2 Cr 2 O 7 and Ca(ClO 2 ) 2 . Precipitation-type sulfur-removal agents generate an insoluble precipitate through the precipitation reaction of S 2− combined with other elements. The commonly used precipitation-type sulfur-removal agent has basic zinc carbonate and basic cupric carbonate. The chemical formula of basic zinc carbonate is Zn 2 (OH) 2 CO 3 , and this material has long been used to remove sulfur in water-based drilling fluid and completion fluid.
When the solution pH value is between 9 and 11, basic zinc carbonate is undissolved. The sulfurremoval effect is poor. Only when the pH value is higher than 11 is good solubility observed. Because of its solubility limitations, coupled with the fact that Zn 2+ is a heavy metal ion, we do not select Zn 2+ as a sulfur-removal agent [35].
Based on these data, combined with the actual situation of the Puguang gas field, four kinds of commonly used sulfur-removal agents were evaluated in the laboratory. The four kinds of sulfur-removal agent were HYS-9, sponge iron, zinc carbonate and copper carbonate. HYS-9 is a liquid, and the others are solid. The experiment was carried out by using the normal temperature and atmospheric pressure sulfur-removal tester. In the experiment, the total amount of the four kinds of desulfurizer was 3%, and the sulfur-removal ability was determined by measuring the concentration of H 2 S in the outlet. The experimental data are shown in figure 6. Figure 6 shows that HYS-9 has the advantages of fast removal of sulfur and high sulfur-removal efficiency. During the compatibility experiment with HYS-9 and the base fluid of packer fluid, no insoluble matter was produced. According to the experimental results, combined with the actual situation, the sulfur-removal agent of HYS-9 was determined as the research system, and the dosage is 1-5 wt%.

Corrosion inhibitor
During the optimization of the packer fluid, the protective effects of five kinds of corrosion inhibitors, CS, C4, C2, C15 and 7019, were investigated. The inhibitor composition is shown in table 6. Figure 7 shows the corrosion rate of N80 steel with the change in the corrosion inhibitor concentration at room temperature [36]. By comparing the experimental results, all of the corrosion inhibition efficiencies increased with increasing concentration. CS has the best inhibition effect. When a concentration of 5-6 wt% is reached, the corrosion rate changes slowly, and this is the best inhibiting effect. To further verify the corrosion inhibition effect of the corrosion inhibitor CS, TP110SS steel was used as the experimental material to study its effect, and the amount of CS addition was 5%. The results show that the corrosion rate of TP110SS steel is controlled below 0.001 mm yr −1 , which shows that the inhibitor CS has a good corrosion inhibition effect on different materials.
At room temperature, 3 wt% corrosion inhibitor CS was added to the base fluid with a density of 1.27 g cm −3 , TP110SS steel was placed in solution for 5 months, and its long-term protective performance was measured. The calculated results show that the corrosion rate of the TP110SS steel sheet is 9.5 × 10 −5 /g m −2 h −1 , but the corrosion rate of TP110SS steel sheet is 5.6 × 10 −3 /g m −2 h −1 without adding the corrosion inhibitor, which shows that the corrosion rate of TP110SS steel is obviously controlled. At the same time, we can observe from figure 8 that pitting corrosion occurs when no inhibitor is added, and pitting pits are not found after adding CS. The above phenomena show that CS has good corrosion inhibition.

Bactericide
The growth, metabolism and propagation of microorganisms in oilfield systems can lead to the corrosion and damage of drilling equipment and other metal materials and the blockage of pipelines [37,38]. As the chemical treatment method is economical, convenient and quick in effect, the chemical treatment has been used as the main treatment method in the actual operation of oilfield production. Bactericides are the most economical and effective way to control bacteria. Bactericides contain substances that can destroy cell enzymes or matrix exchange systems and use their interactions with bacteria to kill or inhibit bacteria. The bactericidal effects of commonly used bactericides and some synthetic bactericides were evaluated and are shown in table 7.
According to the experimental results of table 7, the bactericide has the same bactericidal effects at concentrations of 20 mg l −1 and 30 mg l −1 . When the concentration of the bactericide is 40 mg l −1 , CS-30 and ZYJ have almost 100% bactericidal effect. When the bacterial concentration is higher, the bactericidal effect of ZYJ is also good. The results of further analyses of the properties of bactericides are shown in table 8.
According to table 8, the experimental results show that the synthesized bactericide has a high bactericidal rate, good compatibility with organic salts and inhibitors, and no delamination or precipitation in the experiment. Through the evaluation of the above bactericides, ZYJ was identified as a disinfectant for packer fluid.

Deoxidizer
In high-salinity water, corrosion is proportional to the amount of dissolved oxygen in the water. The casing may be perforated by corrosion, resulting in a decrease in casing strength. Therefore, it is necessary to strictly control the dissolved oxygen content in the packer fluid. The main methods adopted at present are physical deoxidization and chemical deoxidization. According to laboratory analysis, the synthetic ZYC is used as the deoxidizer of the packer fluid, and the concentration of the deoxidizer is related to the deoxidization rate, as shown in table 9. Table 9 shows that when the concentration of the deoxidizer ZYC reaches 2.0 wt%, ZYC has a high deoxygenation rate of 90.4%, and the experiment determined that the amount of deoxidizer      6. Evaluation of corrosion effect in high-temperature, high-pressure and high-H 2 S/CO 2 environment 6.1. Influence of the sulfur-removal agent

N-isopropyl
From the previous study, we can see that the corrosion inhibitor CS has the best effect when the concentration is 5-6 wt%. The high-temperature and high-pressure environment is more severe. Therefore, the concentration of 6 wt% was chosen to investigate the influence of the sulfur-removal agent on the anti-corrosion effect. The experimental conditions were the same as those without corrosion inhibitors and sulfur-removal agents. A total of 6 wt% of the inhibitor CS was added to the base fluid of the packer fluid, and 1.5 wt%, 3.0 wt% and 4.5 wt% of the sulfur-removal agent were added. The experimental conditions are shown in table 4. The experimental results are shown in figures 9-11. For alloy G3, the corrosion rate is very low, but the corrosion inhibitor and sulfur-removal agent can reduce the corrosion rate. The absolute value changes little, and the corrosion rate is much lower than the standard of 0.076 mm yr −1 . However, the corrosion rates of N80 steel and TP110SS steel sharply decreased with the increase in the concentration of sulfur-removal agent. When the added amount of the sulfur-removal agent was 4.5 wt%, the corrosion rate was less than 0.076 mm yr −1 . The corrosion was inhibited to a small extent. Compared with no added inhibitor and sulfur-removal agent, the corrosion inhibition efficiency was 91.68% and 89.77%, respectively.
As shown in figure 12, the corrosion rate decreases rapidly when the sulfur-removal agent concentration is low. As the amount of the sulfur-removal agent increased, the decrease in the corrosion rate gradually slowed down. We can predict that the effect of sulfur removal will be increased more slowly by increasing the content of the sulfur-removal agent. The optimum additional amount of the sulfur-removal agent is 4.5 wt%.
The corrosion morphology of the tube is shown in figure 13 with the addition of the sulfur-removal agent. For alloy G3, the metal lustre is preserved, and the degree of corrosion is mild. Compared with the corrosion status of steels without adding the sulfur-removal agent and corrosion inhibitor, the corrosion products of TP110SS steel and N80 steel are thinner and more dense after adding the sulfur-removal agent and corrosion inhibitor, and the colour becomes lighter. We can also preliminarily judge that the corrosion rate of the pipe decreases with the increase in the concentration of sulfur-removal agent. After removing the corrosion products, the appearance is shown in figure 14. There is no pitting on the surface of the pipe.
The comparison of the packer fluid properties before and after the corrosion test is shown in table 10. The colour and smell show that the solution is black and has a strong H 2 S smell when no sulfur-removal agent is added. A great change has been made compared to the status without corrosion, which indicated that H 2 S has caused the severe corrosion of the steels. When the sulfur-removal agent is added, the colour becomes milky. With an increase in the content (as shown in figure 15), compared with the corrosion before the test, the effect of removing sulfur becomes better and better, and the corrosion rate of the pipe is also restrained.
Before adding the sulfur-removal agent, the pH value of the solution is 9. After adding the sulfur-removal agent, the pH value of the solution increases to 10, mainly because the sulfurremoval agent is alkaline. After corrosion, the pH value of the solution changes to 7 because of the reaction between the H 2 S dissolved in the solution and the sulfur-removal agent. Meanwhile, dissolved CO 2 also lowers the pH value. For general acid corrosion, the pH value is 4-5, and under this formula, the pH value is neutral, and the corrosion is suppressed to a great extent. Therefore, the corrosion rate is much lower than that of formation water containing H 2 S in the literature.
The main function of the sulfur-removal agent is to reduce the effective concentration of hydrogen sulphide so that the chance of the hydrogen sulphide contacting the pipe surface decreases and the corrosion rate is reduced. According to the corrosion mechanism, a decrease in the corrosion rate is realized because the cathode and anode of the corrosion reaction are inhibited, the adsorption capacity of the anode hydrogen sulphide is reduced, and the cathode hydrogen ion cannot participate in the reaction, so the resistance to corrosion is greatly increased.

Influence of corrosion inhibitor
The results of the sulfur-removal agent show that when the inhibitor content is certain, and the sulfurremoval agent content is 4.5 wt%, the effect is the best. Therefore, in this section, the content of the sulfurremoval agent is fixed at 4.5 wt%. To analyse the effect of changes in the corrosion inhibitor content on the corrosion rate and the experimental conditions and effects of the sulfur-removal agent, the sulfurremoval agent amount in the packer fluid is 4.5 wt% and the inhibitor concentrations are 2, 4 and 6 wt%.
The experimental conditions are shown in table 4, and the results are shown in figures 16-18. The experimental results show that the corrosion rate of alloy G3 is still far below the standard of 0.076 mm yr −1 . The corrosion rates of N80 steel and TP110SS steel decrease significantly with the increase in the corrosion inhibitor concentration, and when the amount of sulfur-removal agent is 6 wt%, the corrosion rate is less than 0.076 mm yr −1 , and the corrosion is suppressed to a very small extent. Compared with the addition of corrosion inhibitor and sulfur-removal agent, the corrosion inhibition efficiencies were 91.68% and 89.77%, respectively. However, if the inhibitor concentration is not enough, N80 steel and TP110SS steel still maintain high corrosion rates, even if the addition of 4 wt% of corrosion inhibitors is far from sufficient. As shown in figure 19, when the inhibitor concentration was low, the corrosion rate decreased rapidly. Therefore, the addition of corrosion inhibitors should be more accurate than the sulfur-removal agent in the application. The results of single agent optimization of corrosion inhibitor showed that when the dosage of CS reached 5-6 wt%, the corrosion rate changed slowly, and the corrosion rate was less than 0.01 mm yr −1 , which is the main basis for the selection of the corrosive dosage. The addition of corrosion inhibitors has reached 6%, from economic and formula maintenance, and it is also necessary to control the amount of additive at the same time. However, the evaluation result of the influence of corrosion inhibitor showed that the corrosion rate of alloy G3/N80 steel/TP110SS steel is less than the China petroleum industrial standard of 0.076 mm yr −1 with the packer fluid to which was added 4.5 wt% of sulfur-removal agent and 6.0 wt% corrosion inhibitor. The dosage of corrosion inhibitor has met the corrosion protection requirements of tubing and casing, which do not need to continue to improve the dosage. As a result, the optimum additional amount of the inhibitor is 6 wt%. The main component of the inhibitor CS is imidazoline, which is an adsorption inhibitor; the imidazoline changes the activation energy barrier of the electrode reaction mechanism by adsorption. This catalytic effect can be applied either to the negative or anodic reactions, or to the cathodic and anodic    reactions at the same time, and the change in the activation energy barrier can be increased (negative catalysis). The ring structure of imidazoline contains N atoms, which is the adsorption group, and it is easy to interact with the iron outer nuclear 3D orbit, resulting in stable adsorption. With the increase in the corrosion inhibitor concentration, the adsorption capacity increases. When the inhibitor content is large, the adsorption will tend to reach saturation; then, increasing the amount of corrosion inhibitor will not reduce the corrosion rate.  sulphide to reduce the adsorption capacity of hydrogen sulphide and thus to reduce the corrosion rate. Therefore, corrosion inhibitors and sulfur-removal agents must be used in coordination to achieve better corrosion resistance.
After adding different amounts of inhibitor, the corrosion appearance of the pipe is shown in figures 20 and 21. Alloy G3 shows a metallic lustre with slight corrosion. The corrosion products of N80 steel and TP110SS steel are thinner, more compact and lighter in colour than the corrosion products without the addition of sulfur-removal agent and corrosion inhibitor. The morphology indicates that the corrosion rate of the pipe decreases with the increase in the concentration of the corrosion inhibitor. When the amount of inhibitor is 2 wt%, there is a compact surface corrosion product and surface floating layer product on the surface of TP110SS and N80. When the inhibitor content increases, the surface floating layer disappears, and the surface colour changes to grey after corrosion. The morphology after removing the corrosion product is shown in figure 22. Similarly, there is no pitting on the surface of the pipe. As CS is an adsorption inhibitor, pitting corrosion will, in general, not occur.
The comparison of packer fluid properties before and after the corrosion test is shown in table 11. The colour and the smell show that the solution is black and has a strong H 2 S smell when no corrosion       inhibitor is added, showing a greatly changed solution compared with no corrosion, indicating that H 2 S has produced severe corrosion on steel. When the corrosion inhibitor is added, the colour becomes milky with an increase in the content (as shown in figure 23). Compared with corrosion before the test, the effect of anti-corrosion is better and better, and the corrosion rate of the pipe is also restrained, similar to the phenomenon observed when adding sulfur-removal agents. Likewise, after adding corrosion inhibitors and sulfur-removal agents, the pH value of the solution becomes 7-7.5, and the corrosion rate decreases.

Effect of H 2 S content
Since the concentration of downhole H 2 S is variable, the effect of H 2 S content on the corrosion process is investigated by doubling the amount of H 2 S. The experimental conditions are the same as before. The 4.5 wt% of sulfur-removal agent and 6 wt% of corrosion inhibitor are added, and the experimental data for corrosion are shown in table 12. Table 12 shows the corrosion rate of steel is still low with the increase in the H 2 S content, which shows that the packer fluid can be used over a wide range, which is easy to control when used in the field. Figures 24 and 25 show the surface morphology of the sample after corrosion at the H 2 S content of 2000 ppm. The corrosion is very slight, which is similar to that of the H 2 S content of 1000 ppm. Figure 26 shows that this is similar to the H 2 S content of 1000 ppm.    Judging from the above phenomena, we can conclude that when the H 2 S content is doubled, the packer fluid formula is still effective; that is to say, the formula has wide adaptability. The annulus flow of packer fluid will disperse the sulfur-removal agent more evenly. The appropriate velocity will promote the adsorption of corrosion inhibitor and could make a better inhibition effect. Sulfur-removal agent and corrosion inhibitor dosage can be reduced slightly.

Packer fluid after corrosion optimization
The corrosion of alloy G3, TP110SS steel and N80 steel in the base fluid of packer fluid of 1.30 g cm −3 density was studied by simulating high temperature and high pressure in an environment containing CO 2 and H 2 S. The results show that the corrosion rates of TP110SS steel and N80 steel are 0.6668 and 0.6639 mm yr −1 , respectively, indicating that the corrosion of packer fluid that is filled with CO 2 and H 2 S is large. Protective measures must be taken, namely, the addition of sulfur and corrosion inhibitor. Adding sulfur-removal agent, corrosion inhibitor, deoxidizer and bactericide is one of the most effective, easy to implement and relatively low-cost measures.
The corrosion of three kinds of steel alloy G3, TP110SS steel and N80 steel in the packer fluid was evaluated after increasing the amount of H 2 S. The results showed that after doubling the H 2 S, the formate packer fluid formula still had good corrosion resistance.
Taking the optimized packer fluid density of 1.30 g cm −3 as an example, the rheological properties are shown in table 13.
The data comparison between the two groups of tables 2 and 13 shows that the apparent viscosity and plastic viscosity of packer fluid increase slightly after the addition of sulfur-removal agent, corrosion inhibitor and bactericide, but this change does not affect the use of packer fluid, indicating that the optimized packer fluid meets the design and application requirements in terms of rheological properties.

Conclusion
(1) High acid gas has serious corrosion effects on the tubing and casing of different steels, and it is necessary to optimize the corrosion of the sealing fluid. (2) H 2 S/CO 2 /O 2 can both aggravate pipe corrosion, but under the condition of the coexistence of CO 2 /H 2 S, the corrosion mechanism is more complicated, and the corrosive effect should be considered emphatically. (3) In response to the corresponding corrosion problems, anti-corrosion additives such as sulfurremoval agent, corrosion inhibitor, bactericide and deoxidizer were introduced, which effectively reduced the corrosion of the packer fluid system to the tubing string. (4) Under the condition of high temperature, high pressure and high acidity, the effects of different additives and acid gas addition were studied. The results show that the corrosion resistance rate of the sealing liquid is below 0.076 mm yr −1 after the addition of anti-corrosion additives, which meets the requirement of pipe corrosion protection.
Data accessibility. Our data are deposited at Dryad: https://doi.org/10.5061/dryad.p1mf340 [39]. Authors' contributions. P.X. conceived and designed the experiments; P.X., Z.T. and Z.W. performed the experiments and analysed the results of the experiments; and P.X. wrote the paper. All authors gave final approval for publication.
Competing interests. The authors declare no competing interests.