Introduction

Stone cultural relics have special historical, artistic, and cultural values and are extremely valuable human cultural heritage1. However, some large stone buildings and stone statues, such as the Pyramid of Khufu in Egypt, the Yungang Grottoes in China, the Easter Island Sculptures, and the Hammurabi Tablet, have been exposed to the open environment throughout the year and have suffered from physical weathering and biochemical corrosion for a long time2, resulting in cracking and falling off of the rock surface, affecting the durability of the rock, and destroying the aesthetic, historical, and artistic value of cultural relics3. Therefore, the preventive conservation of stone cultural relics has become a research hotspot in the field of cultural relics protection research. In research on the preventive protection of stone cultural relics, obtaining real-time and complex spatiotemporal distribution information of multiple parameters during their occurrence and development, revealing the mechanism and laws of rock diseases, is the key to achieving preventive protection.

Temperature and pH are major parameters that cause diseases in stone cultural relics4,5. When rock organisms, such as lichen, fungi, bacteria, and moss, adhere to the surface of the stone, they metabolize to produce small molecular organic acids (such as oxalic acid) and generate heat, resulting in changes in the pH and temperature at the interface between the stone and microorganisms, which in turn corrode the cultural relics (dissolution of minerals), causing deformation of the cultural relics structure6. Therefore, in situ acquisition of temperature, pH, and micro-strain spatio-temporal information of stone artifacts is the key to revealing the mechanism and law of acid corrosion disease generation in stone artifacts. Currently, online detection technologies for stone cultural relics mainly include LiDAR7,8,9, infrared thermography10,11,12,13, optical coherence tomography14,15,16, ultrasonic17,18,19 and laser Raman spectroscopy20,21,22,23,24, etc. LiDAR is mainly used for the early diagnosis and detection of outdoor murals and monuments and can realize large-scale in situ quantitative analysis of cultural relics. Infrared thermography is primarily used to detect damage to ancient buildings and enables a quick and complete thermal scan of building surfaces to assess the extent of separation or degradation of buildings owing to aging or moisture. Optical coherence tomography is mainly used to detect internal damage in large areas of sculptures and historical buildings and can realize in situ real-time measurements of monuments to determine the type and amount of damage. Ultrasound is mainly used to detect structural damage to sculptures and architectural relics and can visualize cultural relic damage by emitting ultrasonic pulses. Laser Raman spectroscopy can be used with high sensitivity and resolution to monitor changes in the material composition of stone cultural relics during the disease process. Although these technologies have been applied to the noninvasive detection of cultural relics, such as murals and stone sculptures25, and have obtained information about the type of surface erosion, degree of material degradation, and internal structural damage of stone cultural relics, they have the following disadvantages. (1) They have expensive and bulky instruments, complicated data processing, and single measurement parameters; (2) they can only analyze the status of cultural relics at a certain moment and cannot achieve continuous long-term detection; and (3) they have difficulty obtaining information on changes in temperature, pH, and micro-strain in different spaces during the disease process of cultural relics.

Fiber Bragg grating (FBG) sensors, which have the advantages of fast response speed, high resolution, strong anti-interference ability, long transmission distance, small size, and can realize quasi-distributed measurement, can be used to monitor the temperature, pH, and micro-strain26,27,28. However, FBG sensors have not yet been used to obtain information on temperature, pH, micro-strain, and quasi-distributed changes of stone artifacts in the course of acid-rotting diseases. Therefore, based on existing FBG sensors, it is important to study the principles and methods of in situ real-time detection of temperature, pH, and micro-strain changes during the acid decay process of stone cultural relics and to obtain their distribution information in different spaces of the stone.

In this study, sandstone cultural relic samples were prepared, and a simulation system device for the acid corrosion of stone cultural relics was designed to detect the acid corrosion disease process of the stones in situ in real time under different spatial temperatures, pH values, and micro-strain changes. We established the temperature, pH, and micro-strain FBG detection principle, as well as the method for the sandstone sample acid corrosion disease process. We further fabricated FBG sensors, FBG sensor arrays, and their detection system. Changes in the temperature, pH, strain, and distribution during the corrosion process of sandstone samples with different concentrations of oxalic acid solutions were studied using the sensing system. The morphology, porosity, and composition of the sandstone samples before and after acid rotation were characterized using optical microscopy, field-emission scanning electron microscopy(FSEM), X-ray diffraction(XRD), X-ray Photoelectron Spectroscopy(XPS), and Mercury intrusion porosimetry(MIP).

Results and discussion

Characterization of sandstone samples after disease action

To study the corrosion characteristics of the sandstone samples with different concentrations of oxalic acid, the sandstone samples were continuously corroded with ultrapure water and oxalic acid solutions with concentrations of 0.1 mol L−1 (pH=1.3), 0.5 mol L−1 (pH=1.0), and 1 mol L−1 (pH = 0.7) for 7 days. Figure 1 illustrates the morphology of the sandstone samples before and after the corrosion.

Fig. 1: Morphology of sandstone samples.
figure 1

af are the pictures of sandstone after 7 days of disease in ultrapure water (pH = 7.0), (gl) are the pictures of sandstone after 7 days of corrosion disease in 0.1 mol L−1 oxalic acid, (mr) are the pictures of sandstone after 7 days of corrosion disease in 0.5 mol L−1 oxalic acid, and (sx) are the pictures of sandstone after 7 days of corrosion disease in 1 mol L−1 oxalic acid. Rows 1 and 3 are photographs of the interior and surface of rocks taken with an optical microscope. Rows 2 and 4 are photographs of the interior and surface of the rock taken with a scanning electron microscope. Row 5 is a photograph of a cross-section of a rock surface taken with a light microscope, and Row 6 shows the photographs taken by the camera.

After 7 days of corrosion, the color and morphology of the sandstone samples underwent significant changes. The first row of images in Fig. 1 shows that yellow and white salts were formed inside the sandstone after corrosion by oxalic acid. The main minerals inside the sandstone are quartz, feldspar, muscovite, calcite, chlorite, dolomite, etc., and the main metal elements are Si, Ca, Fe, Mg, Al, Na, and K, of which Si exists in the form of SiO2, while the yellow salts may be oxalates of Fe, and the white salts oxalates of Ca, Mg, Al, Na, and K. The second row of images in Fig. 1 shows that, after oxalic acid corrosion, the corrosion intensity of feldspar inside sandstone increased with the increase of oxalic acid concentration, and the debris on the chlorite flake shale corroded and disappeared29, resulting in more defects and pores. In particular, Fig. 1t shows that the flaky sheets of chlorite have been distorted and deformed after being corroded by a high concentration of oxalic acid.

The third row of pictures in Fig. 1 shows that oxalate precipitated and was deposited on the surface of the sandstone; as the concentration of oxalic acid increased, more oxalate precipitated on the surface of the sandstone, and salt crusts appeared on the surface of the sandstone after it was corroded by high concentrations of oxalic acid (Fig. 1u). Furthermore, the SEM images in the fourth row of Fig. 1 show that the flaky sheets of chlorite were dissolved after being corroded by oxalic acid and many oxalate crystals were deposited on the surface of the sandstone30, resulting in a decrease in the surface porosity of sandstone. Comparison of the first and third rows of images in Fig. 1 reveals that there is significantly more oxalate on the surface of the sandstone than in the interior of the sandstone surface.

The distribution of oxalates in sandstone was observed to confirm that the generated oxalates precipitated from the inside (Fig. 1, fifth row). Figure 1k shows that white oxalate precipitated and accumulated in the pore space of the sandstone surface layer to a certain thickness, but the content of yellow oxalate was less, and only a small amount of yellow oxalate was distributed in the sandstone surface layer. As the concentration of oxalic acid in the corroded sandstone samples increased, the amount of yellow oxalate precipitated in the outermost layers of the sandstone increased; however, the white oxalate precipitated more and accumulated deeper, so that a dividing line was formed between the white and yellow areas (Fig. 1q). When the concentration of oxalic acid in the corroded sandstone samples was further increased, a large amount of salt precipitated from the surface layer of the sandstone, as shown in Fig. 1w. The amount of yellow oxalate increased significantly, and a layer of dense, dark-yellow salt crust formed on the outer surface of the sandstone. Therefore, as the concentration of oxalic acid in the corroded sandstone increased, the oxalate precipitated on the surface of the sandstone also increased, the yellow oxalate content increased, and the sandstone was subjected to corrosion disease aggravation. This phenomenon can also be observed in the physical image of the sample taken by the sixth row of cameras in Fig. 1.

Characterization of material composition and porosity of sandstone samples after acid rot

To determine the information about the changes in the composition and pore structure of the samples after oxalic acid corrosion, sandstones were corroded for 7 d at room temperature using an oxalic acid solution with a concentration of 1 mol L−1, and the sandstones before and after corrosion were characterized using XRD, XPS, EDS, and MIP, as shown in Figs. 24 and Supplementary Fig. 6.

Fig. 2: Sample composition change information.
figure 2

a XRD patterns of sandstone surface samples before and after oxalic acid corrosion; (b) XPS full spectrum of sandstone surface samples before and after oxalic acid corrosion.

Fig. 3: XPS fine spectra.
figure 3

a Fe before corrosion; (b) Fe after corrosion; (c) Ca before corrosion; (d) Ca after corrosion; (e) Mg before corrosion; and (f) Mg after corrosion.

Fig. 4: Pore size distribution.
figure 4

Pore size distribution curve of sandstone samples before and after oxalic acid corrosion.

Figure 2a shows that the main constituents of the pre-erosion sandstone were quartz and plagioclase rich in sodium and calcium. However, after oxalic acid corrosion, the intensity of the diffraction peaks of both quartz and feldspar decreased, indicating that they were dissolved by oxalic acid31,32. Furthermore, the characteristic peaks of ferrous oxalate appeared in the XRD pattern of sandstone. Ferrous oxalate is a yellow powder that is insoluble in water, which is consistent with the color of oxalate shown in Fig. 1, proving that ferrous oxalate was generated when the sandstone was subjected to oxalic acid corrosion. Figure 2b shows that the sandstone contained six metallic elements, namely Mg, Na, Fe, Ca, Si, and Al, while there was a significant decrease in the peak XPS values of Na and Al after corrosion. This indicates that its content decreased after oxalic acid corrosion and dissolution reactions occurred; therefore, the salt accumulated on the rock surface was not oxalate containing Na and Al. Hence, it is hypothesized that the white oxalates may be magnesium oxalate and calcium oxalate. To further determine the composition of the oxalate, fine spectral analyses of Fe, Ca, and Mg were performed, as shown in Fig. 3.

Figure 3a, b shows the 2p state spectra of Fe before and after the corrosion of the sandstone samples. The Fe 2p spectra before corrosion showed the characteristic peaks of trivalent iron oxides, whereas the Fe 2p spectra showed distinct characteristic peaks of divalent iron33. The inclusion of iron oxide suggests that iron was present in the sample before corrosion in the form of ferric cement composed of iron oxide, which was transformed to yellow ferrous oxalate after corrosion. Figure 3c, d shows the 2p state spectra of Ca before and after corrosion. The two peaks of the Ca 2p spectrum before corrosion showed binding energies of 346.75 eV and 350.23 eV, and the Ca 2p binding energies after corrosion were 347.6 eV and 351.2 eV; this indicates a change in the form of elemental calcium from calcium carbonate and calcium oxide to calcium oxalate34, and the resulting white oxalate contained calcium oxalate. Figure 3e, f shows the 1 s state spectra of Mg before and after corrosion, with binding energies of 1308.8 ev and 1302.48 ev before, which correspond to the characteristic peaks of magnesium in various clay minerals in sandstone35, but no characteristic peaks of magnesium oxalate were detected.

The EDS characterization (Supplementary Fig. 6) provides information on the distribution of elements and their content changes in the sandstone samples before and after corrosion. The contents of Fe and Ca in the surface sandstone increased significantly compared with those before corrosion, which proves that the sandstone samples were corroded by oxalic acid and precipitated ferrous oxalate and calcium oxalate on their surfaces. Therefore, synthesizing Figs. 2 and 3, and Supplementary Fig. 6 show that the oxalates generated by sandstone subjected to oxalic acid corrosion were mainly ferrous oxalate and calcium oxalate.

Figure 4 shows that the peak value of the MIP curve of the corroded sample increased from 62.5 nm to 1595.2 nm, indicating a significant decrease in the proportion of small pores. Table 1 shows that the porosity of the corroded samples decreased from 21.78% to 16.69%, the total pore area decreased from 3.60 m² g−1 to 1.78 m² g−1; the median pore volume increased from 495.00 nm to 817.07 nm, the median pore area increased from 40.87 nm to 54.31 nm, and the average pore size increased from 120.55 nm to 178.21 nm; this suggests that the total reverse process of precipitation exceeds the forward dissolution process, with smaller pores filled with more oxalate and although larger pores increasing as the filler was consumed. Oxalic acid corrosion caused significant microscopic damage to sandstone and altered the original pore structure within the rock.

Table 1 Pore size distribution of sandstone samples before and after oxalic acid corrosion

Temperature spatial distribution characteristics of sandstone samples during oxalic acid disease process

To obtain the temperature spatial distribution characteristics during the oxalic acid corrosion process of the sandstone samples, a temperature FBG sensor array and its detection system were used to detect the process of oxalic acid corrosion of sandstones exposed to ultrapure water and oxalic acid solutions at room temperature (Fig. 5).

Fig. 5: Temperature variation characteristics of sandstone samples during corrosion by ultrapure water and oxalic acid with different concentrations.
figure 5

a ultrapure water group, (b) 0.1 mol L−1 oxalic acid group, (c) 0.5 mol L−1 oxalic acid group, and (d) 1 mol L−1 oxalic acid group.

Figure 5a shows that, during the corrosion process of the sandstone sample with ultrapure water, the temperatures in the different spaces were the same, and the change remained consistent. This is because ultrapure water can only dissolve some soluble substances in the sandstone and cannot react with the sandstone to release heat. Thus, the sandstone sample temperature did not show significant changes and varied only with ambient temperature. Figure 5b shows that under the corrosion of 0.1 mol L−1 oxalic acid, the temperature in different spaces remains consistent, which is attributed to the fact that the low concentration of oxalic acid does not react strongly with the sandstone. Figure 5c, d shows that the sandstone samples under 0.5 mol L−1 and 1 mol L−1 oxalic acid corrosion produce a temperature distribution along the height direction. This is because oxalic acid reacts violently with sandstone and releases heat, increasing the temperature of the sandstone sample above the ambient temperature.

Figure 5c, d also shows that the highest temperature occurs at a sandstone height of 3 cm (with a maximum temperature difference of 2.93 °C), followed by heights of 4.5 cm, 1.5 cm, and 6 cm. The reason for this phenomenon is that the oxalic acid was immersed in the sandstone from the top, whereas the bottom of the sandstone was immersed in the oxalic acid solution (Fig. 6). Therefore, the transport of oxalic acid in sandstone is influenced by both gravity and pore suction. Sandstone pore suction includes capillary pressure and electrostatic forces (electrostatic mechanisms such as osmosis). Under the action of the two forces, a gas-liquid interface pressure difference is generated in the pores, causing the gas-liquid interface to bend; so, the liquid will be transported to a location with low water content36. According to experimental observations, when the bottom of the sandstone is immersed in the oxalic acid solution, and the top is not dripped with the oxalic acid solution, the maximum water absorption height of the sandstone sample was approximately 3 cm within one day when the sandstone was immersed in the 1 mol L−1 oxalic acid solution at a liquid level of 8 mm. Thus, the water content in the middle of the sample was lower than that at the top and bottom of the sample, and the oxalic acid solution was transported upward from the bottom of the sandstone via pore suction. In addition, after adding an oxalic acid solution to the top of the sandstone, the liquid was transported downwards under the influence of gravity, and ultimately the liquid was transported to a height of 3 cm. The soluble substances in the sandstone were dissolved during the liquid transport process. However, oxalic acid reacts slowly with the clastic interstitials in the pores, and some small clastic flows with the liquid and is transported to the sandstone at a height of 3 cm, resulting in a more intense chemical reaction in this area, releasing more heat, and creating the region with the lowest water content, worst thermal conductivity, and heat dissipation. Therefore, the highest temperature was observed at the height of 3 cm.

Fig. 6: Detection system.
figure 6

Schematic diagram of the detection system.

Spatial distribution characteristics of pH inside sandstone samples during oxalic acid disease process

To obtain information on the change in the pH value in different spaces of sandstone during the oxalic acid corrosion of sandstone samples, an FBG pH sensor array and its detection system were used to detect the pH value in sandstone during the process of corrosion by ultrapure water and oxalic acid solutions at room temperature (Fig. 7).

Fig. 7: Characterization of internal pH changes in sandstone samples corroded byultrapure water and oxalic acid of different concentrations.
figure 7

a ultrapure water group, (b) 0.1 mol L−1 oxalic acid group, (c) 0.5 mol L−1 oxalic acid group, and (d) 1 mol L−1 oxalic acid group.

Figure 7a shows that the pH values of different spaces in the rock fluctuate between 6.8–7.2 during the process of ultrapure water dissolution of sandstone samples, indicating that although a small amount of soluble salts are dissolved in the sandstone, they have little impact on the internal pH value of the rock. Figure 7b shows that under 0.1 mol L−1 oxalic acid corrosion, the internal pH of the rock fluctuates in the range of 1.3–1.8, which is due to the fact that a part of the oxalic acid is reacted to produce oxalate under the corrosion, and the localized pH inside the rock is increased. However, the total consumption of oxalic acid was lower, and the pH fluctuation range was smaller. Figure 7c shows that under 0.5 mol L−1 oxalic acid corrosion, the internal pH of the rock fluctuates in the range of 1-1.5, and the internal pH of the rock at 3 mm and 4.5 mm rises slowly with the increase in the time of the corrosion lesion. Because a stronger chemical reaction occurred in the middle of the sandstone and a large amount of salt accumulated, the accumulation of salt caused the pH value in the area to continue increasing to the original level.

Figure 7d shows that the pH values in the different spaces inside the rock fluctuated significantly during the corrosion of the sandstone samples by 1 mol L−1 oxalic acid. The internal pH of the rock at 3 cm continued to increase with increasing corrosion time, reaching a maximum of 3.0. The pH inside the rock at 4.5 cm also showed a large oscillation and continued to rise during the last two days of the disease, reaching a maximum of 2.1. The reasons for this phenomenon are as follows: First, the higher the concentration of oxalic acid, the more complete the reaction with various substances in the sandstone, the faster the reaction rate, and the more salt is produced. Second, owing to the dual effects of gravity and sandstone pore suction on the transport of oxalic acid in sandstone, the sandstone area with a height of 3 cm accumulated the highest content of ore particles and debris, which underwent a strong chemical reaction with oxalic acid, leading to significant consumption of oxalic acid and the formation of salts, leading to an increase in the pH value.

Spatial distribution characteristics of micro-strain in sandstone samples during oxalic acid disease process

To obtain the spatial distribution characteristics of the micro-strain during the oxalic acid corrosion disease process of sandstones, different spatial micro-strain changes in sandstones subjected to ultrapure water and oxalic acid solution corrosion were detected at room temperature, as shown in Fig. 8.

Fig. 8: Characteristics of micro-strain changes in the sample body during corrosion of sandstone samples subjected to ultrapure water and different concentrations of oxalic acid.
figure 8

a ultrapure water group, (b) 0.1 mol L−1 oxalic acid group, (c) 0.5 mol L−1 oxalic acid group, and (d) 1 mol L−1 oxalic acid group.

Figure 8a shows that the micro-strain of the sandstone sample is very small during Ultrapure water disease, and the maximum strain generated is 5 με, which indicates that the expansion of the sandstone sample caused by water erosion is small. Figure 8b–d shows that under oxalic acid corrosion, the sandstone sample experienced significant expansion, and with an increase in the oxalic acid concentration, the strain generated by the sandstone sample gradually increased. When the concentration of oxalic acid is 0.1 mol L−1, 0.5 mol L−1, and 1 mol L−1, the maximum strains of the samples reached 137, 230, and 287 με, respectively; this is because the higher the concentration of oxalic acid, the stronger the reaction with the sandstone, the more salt precipitates, and the greater the expansion of the sandstone.

Figure 8b–d shows that oxalic acid corrosion lesions caused a height difference in the strain of the sandstone samples, generating the greatest strain at a height of 3 cm, followed by 4.5 cm and 6 cm, with the least strain produced at 1.5 cm. The reason for this phenomenon is the same as in Sections Temperature Detection and pH Detection, the flow of liquid inside the sandstone causes a more intense chemical reaction in the middle of the sandstone, and more salt accumulates. The precipitation and accumulation of salt lead to greater expansion of the sandstone body; thus, the maximum strain was generated at a height of 3 cm.

In addition, Fig. 8b–d also shows that under the oxalic acid corrosion disease, the sandstone sample exhibits a phenomenon of “detumescence.” The strain at a height of 1.5 cm in the three sample groups decreased continuously after reaching its maximum value. The strains at the heights of 4.5 cm and 6 cm of the samples corroded by 0.5 mol L−1 oxalic acid, and the strains at the height of 4.5 cm of the samples corroded by 1 mol L−1 oxalic acid also decreased. The reasons for this phenomenon are as follows. (1) The double reaction of oxalate crystallization and dissolution occurs inside and on the surface of the rock. In the early stage of rock suffering from oxalate disease, the rate of oxalate formation and the crystallization rate are higher than its dissolution rate, resulting in rock expansion. The wavelength shift of the FBG sensor increases when the rate of oxalate dissolution is higher than the rate of oxalate and crystallization, resulting in rock shrinkage, and the wavelength shift of the FBG decreases. (2) Under the effect of the sandstone pore capillary force, the liquid at the bottom of the sandstone is continuously transported upward, and the oxalate is transported to the middle of the sandstone; thus, the oxalate content in the space at the bottom of the sandstone is reduced, and the expansion of the sandstone is weakened, thereby reducing the stress generated by the FBG stress sensor Bragg center wavelength drift decreases.

In this work, to detect in situ real-time information on spatial temperature, pH, and micro-strain changes during the process of acid corrosion of stone cultural relics, a detection system for temperature, pH, and micro-strain quasi-distribution information during the process of oxalic acid corrosion of sandstone cultural relics was built based on FBG temperature-pH-strain sensors. A matrix model for measuring the temperature-pH-stress using FBG sensors was established. The temperature, pH, strain, and distribution changes of cultural relics during the corrosion of sandstone samples with different concentrations of oxalic acid solutions were experimentally studied. The ontology characteristics of the sandstone samples before and after the occurrence of oxalic acid corrosion were characterized by combining optical microscopy, SEM, XRD, XPS, and MIP. Experimental studies have highlighted that oxalic acid causes severe corrosion damage to sandstone by generating ferrous oxalate and calcium oxalate. The generated oxalate continuously precipitates from the inside of the rock to the outside, thereby changing the material composition and pore structure of the rock. Simultaneously, the process of oxalic acid corrosion of rocks leads to changes in the space temperature, pH value, and micro-strain of rocks. The higher the concentration of oxalic acid, the more severe the sandstone corrosion. Under the effect of sandstone pore suction and gravity, the oxalic acid solution had the most intense corrosion reaction at a height of 3 cm of the sandstone samples, resulting in an internal temperature difference of 2.9 °C, an internal pH change of 2.0, and a surface micro-strain of 287 με.

The results of this study provide important support for revealing the mechanism of acid corrosion in cultural stone relics. The developed fiber-optic sensor system can be used for in situ real-time sensing of different spatial temperatures, pH, and micro-strain changes in the occurrence and development of acid corrosion disease in rocks by oxalic acid. Furthermore, the results of the research on the preventive protection of stone cultural relics and their fiber optic sensors and the promotion of the application of the research are of great significance.

Methods

Experimental materials

Polyvinyl alcohol (PVA, MW 89,000-98,000, 99 + % alcoholysis), polyacrylic acid (PAA, Mv=450,000), HCl, NaOH, H2SO4, anhydrous ethanol, NaCl, K2HPO4, KH2PO4, and graphene oxide solution (1 mg mL−1) were analytically pure and purchased from Aladdin of China. Epoxy glue and UV glue were purchased from Osborn. The inner and outer diameters of the PTFE tubes were 1 mm and 1.6 mm, respectively. FBG was purchased from Zhejiang Xince Communication Co., Ltd., China; the fiber coating layer is acrylic ester, the 3 dB bandwidth is 0.24 nm, the fiber cladding diameter is 125 μm, the fiber core diameter is 10 μm, and the length of the grating area is 10 mm.

Sandstone artifact sample preparation

The sandstone samples simulating stone artifacts were purchased from Shandong Yuze Stone Industry Co., China. The main components were quartz and feldspar. The cylindrical sandstone samples were 50 mm in diameter and 75 mm high. To detect the internal temperature and pH changes of sandstone at different heights, holes with a diameter of 2 mm were drilled at 15 mm interval heights in the sandstone for installing temperature and FBG pH sensors. Before the corrosion experiments, the sandstones were placed in a vacuum drying oven at 100 °C for 24 h.

FBG pH sensor preparation

To realize pH detection by FBG, PVA/PAA acid-base sensitive sols were prepared as follows. First, PVA and PAA were dissolved in deionized water, and each of them was slowly stirred at 95 °C for 5 h and 3 h, respectively, then 8 wt% PVA solution and 3 wt% PAA solution were obtained. After cooling at room temperature, the two solutions were mixed according to the proportion of 7:3 by weight, subsequently stirred at 60 °C for 1 h, and then the PVA/PAA hydrogel solution was obtained. Second, the FBG was pretreated: (1) the acrylate coating layer on the FBG grating area was removed with H2SO4, then the FBGs were rinsed sequentially using anhydrous ethanol and deionized water, and finally dried at room temperature; (2) to enhance the adhesion strength of the pH-sensitive hydrogel to the fiber surface, the Bragg grating area was immersed in a 1 mol L−1 NaOH solution for 30 min to roughen the surface, and the roughened optical fiber was cleaned with ultrapure water and dried with nitrogen; (3) to enhance the bonding strength between the roughened optical fiber was placed into a polytetrafluoroethylene (PTFE) mold with grooves, and graphene oxide solution was injected into the grooves, which was dried in a vacuum oven at 60 °C for 3 h to obtain the hydrophilic group-rich graphene oxide-coated FBG. Finally, for the preparation of the PVA/PAA-coated FBG: (1) to coat a uniform pH-sensitive film on the surface of graphene oxide-coated FBG, D-shaped PTFE tubes for fixing optical fibers were prepared (a cylindrical polytetrafluoroethylene pipe with an inner diameter of 1 mm, an outer diameter of 1.6 mm, and a length of 30 mm was cut in half by a stainless steel knife); (2) The D-shaped PTFE tubes and optical fibers were fixed on the precision lifting platform and precision displacement platform, respectively; (3) the height of the lifting platform was adjusted so that the Bragg grating area of the FBG was located in the center of the PTFE tube; (4) the UV glue was injected into both ends of the D-shaped PTFE tube (The injection of the UV glue has a dual function: firstly, the ends of PTFE tubes are sealed to facilitate the storage of solution; secondly, the UV glue will be fixed in the two ends of the FBG so as to enhance the sensitivity of the sensor); (5) the D-shaped tube was filled with the PVA/PAA mixed solution, and after the PVA/PAA mixed solution was dried at room temperature, it is crosslinked in a vacuum oven at 130 °C for 30 min, and dried PVA/PAA will be coated on the surface of FBG. The PVA/PAA-coated FBG was an FBG pH sensor, and the structure of the sensor and composition of the pH-sensitive membrane are shown in Supplementary Figure 4.

FBG temperature sensors

In this study, bare FBG uncoated with pH-sensitive materials were directly used as temperature sensors to measure the temperature of rocks during acid corrosion and eliminate the negative effect of temperature on the pH and micro-strain measurement process.

FBG micro-strain sensors

To measure the stress changes in rock samples during acid corrosion, a bare FBG uncoated with a pH-sensitive material was also used as a stress sensor. The FBG stress sensors differed from the FBG temperature sensors because the sensors were mounted differently on the sandstone samples, as discussed in the detection system section.

Principle of temperature and strain detection in rock samples

The Bragg wavelength of the FBG exhibits a linear relationship with the effective refractive index (neff) and the grating period (Λ) of the fiber37:

$${\lambda }_{B}=2{n}_{eff}\varLambda$$
(1)

Temperature changes will cause λB to drift due to fiber thermo-optic effect and thermal expansion. An accurate temperature measurement can be realized when the FBG is in a state of free elongation (unaffected by external stress). However, optical fibers have a photoelastic effect, and strain can drift the λB. Therefore, when the FBG is subjected to external stresses, the FBG is jointly sensitive to strain and temperature, and the drift of the Bragg center wavelength (∆λB) is defined as37:

$$\varDelta {\lambda }_{B}={\lambda }_{B}[(1-{P}_{\varepsilon }){\varepsilon }_{f}+(\alpha +{\rm{\zeta }})\varDelta T]$$
(2)

where Pε is the effective elastic-optical coefficient of the fiber, εf is the stress applied to the fiber, α is the thermal expansion coefficient of the fiber material, ζ is the thermo-optic coefficient, and ∆T is the temperature variation.

When the FBG is wrapped around the surface of the sandstone sample and the sandstone sample expands, the fiber is subjected to radial stresses perpendicular to the fiber at all locations, and thus the fiber is stretched, resulting in axial strain, Λ increases, and the wavelength of the center of reflection of the FBG is correspondingly red-shifted. Therefore, adding another FBG that is not affected by sandstone expansion (strain) as a temperature compensation unit can achieve accurate detection of the micro-strain generated by sandstone expansion after corrosion.

Principle of pH detection in rock samples

FBG pH sensors rely on polyvinyl alcohol(PVA)/polyacrylic acid(PAA) pH-sensitive hydrogels. The PVA/PAA pH-sensitive hydrogel is a water-mediated polymer with a three-dimensional network structure that responds to ambient hydrogen ion concentrations, resulting in dissolution-contraction changes. The FBG can respond to axial stress; therefore, a pH-sensitive hydrogel (PVA/PAA membranes) can be coated on the FBG (Supplementary Figure 1) to detect pH change information.

The change in hydrogel volume caused by pH changes is controlled by three parameters: the restoring force provided by the polymer chains, the chemical affinity between the solid and fluid portions of the hydrogel, and the mobility of hydrogen ions38. The combination of the three parameters can be described in terms of osmotic pressure. When the balance of the internal and external osmotic pressure of the hydrogel changes, the volume of the hydrogel changes39. In less acidic media (pH>5), the concentration of hydrogen ions decreases, and the reaction forms a transition of the carboxylic acid group to the acetic acid group, which generates a negative charge, that is, repulsion in the polymer chain, and the hydrogel increases in volume. In more acidic media (pH<4), an increase in the concentration of hydrogen ions balances the reaction to form a shift from acetate to carboxylic acid groups, which reduces and neutralizes the negative charge in the polymer chain, leading to a decrease in the hydrogel volume40.

$${[-{\rm{COOH}}]}_{n}\leftrightarrow {[{-{\rm{COO}}}^{-}]}_{n}$$
(3)

The reaction involved in this change is reversible, and the change in pH only changes the equilibrium point of the reaction and, thus, the hydrogel volume. The rate of volume change depends on the mobility of the hydrogen ions.

To achieve accurate pH measurements using FBG pH sensors, a temperature-compensated fiber was used to compensate for the fiber optic pH sensor temperature interference signal. It is first assumed that k(1-Pε)ε and (α + ζ)∆T are the pH sensitivity coefficient (KH) and the temperature sensitivity coefficient (KT,1), respectively. At different pH values, the relationship between the absolute Bragg wavelength (λB,H) of the FBG pH sensor and the initial λB, ∆T, and pH change (∆H) can be expressed as41:

$${\lambda }_{B,H}={K}_{H}\varDelta H+{K}_{T,1}\varDelta T+{\lambda }_{B,1}$$
(4)

For a temperature-compensated FBG, which is not affected by pH changes, the absolute Bragg wavelength (λB, T) is only affected by the temperature and can be expressed as:

$${\lambda }_{B,T}={K}_{T,2}\varDelta T+{\lambda }_{T,0}$$
(5)

where KT,2 and λT,0 are the temperature sensitivity coefficient and initial center wavelength of the FBG temperature-compensation unit, respectively. From Eqs. (4) and (5), the following matrix was obtained:

$$\Big[\begin{array}{c}{\lambda }_{B,H}\\ {\lambda }_{B,T}\end{array}\Big]=\Big[\begin{array}{cc}{K}_{H} & {K}_{T,1}\\ 0 & {K}_{T,2}\end{array}\Big]\Big[\begin{array}{c}\varDelta H\\ \varDelta T\end{array}\Big]+\Big[\begin{array}{c}{\lambda }_{B,1}\\ {\lambda }_{T,0}\end{array}\Big]$$
(6)

The sensor sensitivity coefficients KH, KT,1 and KT,2 can be determined experimentally, and information on the pH change can be obtained by the inverse operation of the matrix:

$$\Big[\begin{array}{c}\varDelta H\\ \varDelta T\end{array}\Big]={\Big[\begin{array}{cc}{K}_{H} & {K}_{T,1}\\ 0 & {K}_{T,2}\end{array}\Big]}^{-1}\Big[\begin{array}{c}{\lambda }_{B,H}\\ {\lambda }_{B,T}\end{array}\Big]$$
(7)

Equation (7) indicates that coupling the temperature-compensated FBG sensor to the FBG pH sensor eliminates the effect of temperature on the measurement results of the FBG pH sensor.

Principles of temperature, pH, and micro-strain detection in rock samples

In situ real-time detection of the temperature, pH, and micro-strain change information of rock samples can be realized using FBG temperature, pH, and micro-strain sensors. (4) with Eq. (7) and establishing the following matrix relational equations:

$$\Bigg[\begin{array}{c}\varDelta H\\ \varDelta \varepsilon \\ \varDelta T\end{array}\Bigg]={\Bigg[\begin{array}{ccc}{K}_{H} & 0 & {K}_{T,1}\\ 0 & {K}_{\varepsilon } & {K}_{T,2}\\ 0 & 0 & {K}_{T,3}\end{array}\Bigg]}^{-1}\Bigg[\begin{array}{c}{\lambda }_{B,H}\\ {\lambda }_{B,\varepsilon }\\ {\lambda }_{B,T}\end{array}\Bigg]$$
(8)

From the calibration experiments (Supplementary Figs. 13), the pH sensitivity coefficient of the pH sensor in this paper is 33.64 pm/pH, and the temperature sensitivity coefficient is 9.61 pm°C−1; the micro-strain sensitivity coefficient of the micro-strain sensor is 1.23 pm με−1, and the temperature sensitivity coefficient is 9.61 pm°C−1; the temperature sensitivity coefficient of the temperature sensor is 9.62 pm °C−1. By substituting these coefficients into Eq. (8), the temperature, pH, and micro-strain detection matrices were obtained:

$$\left[\begin{array}{c}\varDelta H\\ \varDelta \varepsilon \\ \varDelta T\end{array}\right]={\left[\begin{array}{ccc}33.64 & 0 & 9.61\\ 0 & 1.23 & 9.61\\ 0 & 0 & 9.62\end{array}\right]}^{-1}\left[\begin{array}{c}{\lambda }_{B,H}\\ {\lambda }_{B,\varepsilon }\\ {\lambda }_{B,T}\end{array}\right]$$
(9)

Detection system

The detection system mainly consisted of four groups of FBG sensors (each group consisted of one FBG temperature sensor, pH sensor, and micro-strain sensor), a fiber grating demodulator (SM125-500, Micron Optics Inc.) with a light source bandwidth of 1510–1590 nm, wavelength resolution of 1 pm, and sampling time interval of 0.5 s), peristaltic pump, container, oxalic acid solution, and other components. In each group of FBG sensors, the pH and temperature sensors were placed in the reserved holes of the sandstone samples, and the strain sensors were wrapped around the surface of the sandstone samples (the fiber joint was fixed with nylon ties, and a UV shadowless adhesive was applied to the joint to ensure that the fiber joint did not slip). The vertical spacing between each group of sensors was 15 mm, and the height of the lowest sensor from the bottom of the rock was 15 mm.

During the experiment, the sandstone samples were placed in an acrylic reaction container (oxalic acid solution at a depth of 8 mm). A peristaltic pump was used to drop the configured oxalic acid solution on top of the sandstone samples; the oxalic acid solution was recycled, and the flow rate of the peristaltic pump was controlled at 5–10 mL min−1. The wavelength drift information of all FBG sensors was demodulated using a fiber grating demodulator, and the wavelength information was analyzed using Eq. (9) to obtain information on the temperature, pH, and stress changes in the rock samples during acid corrosion.

Methods of analysis

The surface morphologies of the samples were characterized using a camera (D5200, Nikon, Japan), an optical microscope (BK6000, Otto Optic), and a FESEM (ZEISS SIGMA HD) equipped with an EDS system. Using XRD and XPS to study the change information of the sample material composition. XRD analysis was carried out using a RIGAKU Smartlab ray diffractometer with Cu radiation, a tube pressure of 40 kV, a tube flow of 100 mA, and a scan speed of 2 °/min. XPS analysis was carried out on a Thermo Fisher Nexsa-type photoelectron spectrometer in the U.S.A., with Mo-targeted Kα radiation, and the binding energy of the samples was calculated as the carbon peak C 1 s (284.6 eV) internal standard for charge correction. The pore size distributions of the sandstone samples were analyzed using MIP (Mike AutoPore IV 9600).