Rippled scales in a geothermal facility in the Bavarian Molasse Basin: a key to understand the calcite scaling process

Mineral precipitates, scales, are wide-spread in geothermal facilities and hamper technical and economic efficiency. Scales reported from earlier studies in the Bavarian Molasse Basin consisted mostly of calcite, appeared rather homogeneous, grew flat and perpendicular to the surface, and showed little or no internal macrostructure apart from small gradients in crystal size and chemical composition. In this study, we investigated extraordinary calcite scales collected from the inlet chamber of a heat exchanger. These scales showed current ripples and a sequence of coarse and dense layers. By an extensive investigation of the ripples, the hydrochemistry, and by the application of existing empirical equations, the formation of the ripple scales could be reconstructed: Due to degassing of CO2\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$${\text {CO}}_{2}$$\end{document} in the geothermal pump calcite scales precipitated on the pipes of the ground-level facilities. During maintenance works, these scales were partially dissolved, and remobilized as individual mobile grains. These particles subsequently settled again, and solidified as ripple scales in the horizontal pipes at surface level. For this ripple forming process, flow had to be small, because otherwise the ripples would have been altered or washed away. After deposition of the ripple structure, a dense new calcite layer precipitated on top of the ripples, and stabilized it due to transitory supersaturation. This sequence of ripples and a dense calcite cover layer is repeated two times. Finally, during start-up of regular plant operation, the whole composite scale was remobilized and got washed into the inlet chamber of a heat exchanger. The investigation presented here indicates that this type of calcite scale only forms in geothermal facilities in the Bavarian Molasse Basin if certain flow and hydrochemical conditions are present during the maintenance procedure.

the submersible pump, its motor, the production pipes, and ground-level components, such as heat exchangers (Wanner et al. 2017, Herbrich 2017, Boch et al. 2017.
In previous studies in the Bavarian Molasse Basin scales had a more or less even surface and the scales were interpreted to form during normal operation of the facility (Wanner et al. 2017, Herbrich 2017, Boch et al. 2017. The scale samples were analyzed by a variety of chemical and mineralogical methods (SEM/EDX, XRD, acid digestion, polarizing microscopy) (Wanner et al. 2017, Herbrich 2017, Boch et al. 2017. The morphology of the scales, however, received little attention, mainly because the observed scales grew evenly on the pipes. The scales presented in this study show a distinct ripple pattern, which was not reported anywhere else (Fig. 1). The macroscopic structure was used to gain insight into the formation process and to develop countermeasures against this type of mineral precipitations. The geothermal facility investigated in this study is located in the Bavarian Molasse Basin, and exploits Upper Jurassic sedimentary rocks, also known as Malm aquifer. This formation, especially in its dolomitic karstified facies and its massive reef facies hosts high permeabilities and offers favorable conditions for geothermal use (Bauer et al. 2014). The formation is situated at a depth of 2000 m north of Munich and up to 5000 m in the South. Flow rates reach up to 150 L/s and temperatures up to 150 • C (Agemar et al. 2014;Bauer et al. 2014).
The formation of scalings is controlled by the hydrochemical conditions. Therefore, we give a brief overview of the conditions in the target reservoirs. Within the Bavarian Molasse Basin, six hydrogeochemical provinces can be distinguished (Birner et al. 2011). Following this classification, the Munich area belongs to the central part of the Molasse Basin and shows a Na-Ca-HCO 3 -Cl-type or Na-HCO 3 -Cl-type water chemistry after the classification of Furtak and Langguth (1965). South of Munich, the influx of waters with higher mineral content from the overburden increases (Mayrhofer 2013). In the central Molasse Basin, Fig. 1 Ripple scale sample collected from the inlet of the heat exchanger. The sample has a calcite composition. Some oil contained in the thermal water is incorporated in the scale causing the black color. The shape of the ripples with a luv and lee side points to current flow ripples the Malm aquifer has high gas contents up to 2 L gas per L water. The gas is mainly composed of CH 4 , CO 2 , and N 2 . H 2 S concentrations in the gas phase can reach up to 5 vol %.
Under reservoir conditions, due to the long residence time the water is in chemical and thermal equilibrium with the surrounding rock (Wanner et al. 2017). Here, the key equilibrium is the carbonate equilibrium, and the driving factors are temperature and pressure. During the production of the thermal water, the equilibrium is easily disrupted. Local increase of the temperature and degassing of CO 2 cause oversaturation with respect to carbonates (Wanner et al. 2017). On the other side, the cooled water injected into the reservoir shows a benign behavior with respect to scales due to the reduced temperature.
In contrast to any other scale samples reported from geothermal sites in the Bavarian Molasse (Wanner et al. 2017, Herbrich 2017, Boch et al. 2017, the scales in the groundlevel facilities of the investigated geothermal power plant showed a distinct morphology ( Fig. 1) with ripple structures usually known from river beds or sea shores. In general, ripples are formed when either wave action (wave or orbital ripples) or current flow (current ripples) over morphological perturbations of the bedform lead to abnormalities in local flow conditions, such as vortices (Ha and Chough 2003). This results in local areas of increased and decreased shear velocity where sediments are eroded from or re-deposited onto the bedform, respectively. An example of flow regimes along with erosion and deposition mechanisms near ripple structures is shown in Fig. 2.
Geometric indices can be used to determine whether ripples were formed by waves or currents (Tanner 1967). The ripple symmetry index (RSI) is the ratio of stoss length to lee length. A RSI < 2.5 is indicative of wave ripples, whereas RSI > 3.0 is pointing to current ripples (Allaby 2008). The boundary conditions at which the scales under investigation have been formed are ruling out oscillation ripples (wave ripples).
The formation of ripples is governed by particle diameter, velocity, fluid viscosity, and relative density of the sediment to the fluid. Although ripples are not static but in constant motion, the shape of the ripples, that is the periodicity of the ripples (wavelength), the height of the ripple crests, and the RSI, to name a few reaches an equilibrium state. The ripple-forming parameters have different effects: While experiments have shown that the equilibrium morphology of current ripples depends on the particle grain size and their immersed density (Kraemer and Winter 2016), the time to reach a stable ripple pattern depends on fluid density and fluid velocity (Baas et al. 2019).
Many studies have attempted to derive empirical relationships for transient and steadystate ripple morphology (ripple height, η max (m), ripple length, max (m)) based on median particle diameter ( d 50 ) (Yalin 1985;Flemming 1988;Baas 1994;Coleman et al. 2003;Soulsby et al. 2012) (Eqs. 1-5). Median particle sizes used in these studies range from 0.045 mm to 0.87 mm, the particles were either glass spheres or sand, and experiments were often implemented in an open-channel rectangular flume.
(1) max (Yalin) =1000 · d 50 (2) η max (Flemming) =0.0677 · 1000 · d 50 The range of flow velocities that result in ripple formation for a given particle size has also been studied (Soulsby et al. 2012). The minimum flow velocity is given by the shear forces which have to exceed the force required to erode the sediment bed. At flow velocities lower than the minimum the sediment grains simply stay put. There is also a maximum flow velocity for ripples, again depending on the grain size. Above this velocity the particles are washed out and ripples are destroyed, and the bedform exhibits sheet flow behavior. If ripples have been formed at suitable flow velocities, and the velocity later drops below the minimum threshold, the ripple structure in the bedform is conserved (Soulsby et al. 2012). Flow velocities resulting in ripples can also be read-off from several bedform phase diagrams which confine the boundary conditions for ripples and other bedforms (Southard and Boguchwal 1990;Berg and Gelder 2009;Baas et al. 2016). For instance, the diagram of Southard and Boguchwal (1990) (Fig. 3) shows the bed sediment size against flow velocity for flow depths between 0.25 and 0.4 m. At these conditions, as they occur in natural systems, and with pure non-cohesive sediment, ripples can form at velocities of roughly 0.1 -0.9 m/s, depending on sediment particle size.
For mixtures of cohesive and non-cohesive sediments, the equilibrium morphology of current ripples appears to follow the same empirical relationships that were found for non-cohesive sediments, but the time required to reach the equilibrium morphology is longer (Baas et al. 2019;Schieber and Southard 2009;Schieber et al. Fig. 2 Schematic drawing of ripples with indication of ripple length, height and key formation processes modified after Ha and Chough (2003) 2013). When cohesive sediments form ripples, the particles flocculate, which enables them to migrate as bedload creating ripples. Floccules composed of silt and clay are typically in the range of 100 -200 µm (Yawar and Schieber 2017), sometimes several 100 µm (Schieber et al. 2007). To our knowledge the shortest ripples reported in literature can be found in Baas et al. (2019) who observed wavelengths down to 77 µm . These ripples consisted of a mixture of cohesive sand and 13 % mud fraction. Flow velocities leading to the formation of mixed cohesive and non-cohesive ripples are in the range of 0.1 -0.7 m/s, but typically lower than velocities needed for pure noncohesive sediments (Baas et al. 2019;Schieber et al. 2007;Yawar and Schieber 2017). If the cohesive portion exceeds about 30 %, no ripples form and a flat bed remains (Baas et al. 2016). Baas et al. (2016) published a review on the available equations for the prediction of ripples. Baas found that Soulsby et al. (2012) created the most comprehensive predictor for current generated and combined-flow bedforms capable of predicting ripple geometry and ripple-forming velocity. Therefore, we are applying these equations (Soulsby et al. 2012) for the calculations in this paper. Equations 4 and 5 predict the maximum ripple height, η max (m), and maximum ripple length, max (m), for a given mean diameter d 50 (m) and dimensionless relative particle density s, which is described by the dimensionless parameter D * defined in Eq. 6:  Southard and Boguchwal (1990). Indication of the equivalent temperature is needed due to the effect of temperature on fluid viscosity and density. The diagram shows that current ripples are likely to occur at mean flow velocities between roughly 0.1 and 0.9 m/s and at a sediment size of roughly 0.1-0.8 mm where g is the gravitational constant ( m/s 2 ), s = ρ p /ρ f is the dimensionless ratio of particle density ( ρ p ) to fluid density ( ρ f ), and ν (m 2 /s) is the kinematic viscosity of the fluid. Flow regimes favoring ripple formation can be determined by comparing the nondimensional Shields number θ c (Eq. 7) to the critical Shields number θ cr (Eq. 10) and the washout Shields number θ ′ wo (Eq. 11) (Soulsby et al. 2012): θ c < θ cr no bedform movement, θ cr < θ c < θ ′ wo ripple formation, θ ′ wo < θ c ripples are washed out, resulting in either washed-out ripple or sheet bed morphology: where Ū (m/s) is the average cross-sectional flow velocity in the pipe, C D is the nondimensional drag coefficient due to the particles (Eq. 8), h (m) is the water depth (for a full pipe this is the pipe diameter), and z 0 (m) is the grain-related bed-roughness length (Eq. 9).
Combining Eqs. 7, 8, and 9, and solving for Ū , one arrives at an expression for average fluid velocity as a function of the Shields number (Eq. 12). Plugging values for θ cr and θ ′ wo into Eq. 12 gives the lower and upper average fluid velocities, respectively, at which ripples would form for a given d 50 and s.
For the characterization of the flow in the geothermal pipes investigated in this paper, Reynolds numbers can be used. Transition from laminar flow to turbulent flow occurs at Reynolds numbers of 2300 (below laminar) to 2900 (above fully turbulent) (Rotta 1956;Schade 1989;Avila et al. 2011;Freimann 2014). The Reynolds numbers in the investigated facility (see Table 1) are on the order of Re = 10 6 and well in the fully turbulent flow regime.
In this study, we investigate whether the framework of ripple formation provides access to the yet unknown flow conditions which led to scale formation in the surfacelevel pipes of the geothermal facility. A camera rover inspection of the pipes conducted shortly after the sampling date showed only scales at the bottom part of the horizontal or slightly slanted pipes indicating deposition. We assume that the shape of the scales will allow to differentiate between regular operation (110 L/s, respectively, 1.2 -2.2 m/s, depending on the pipe diameter) and maintenance operation (0-8 L/s, respectively, 0-0.08 m/s). We also have to assume at least one step to cement the particles which make up the scales and form a solid matrix. When this cementation took place is of great interest to the operators to prevent the formation and further displacement of this type of calcite scales in geothermal facilities in the Bavarian Molasse Basin.

Site description and operation
The site under investigation produces geothermal water from the carbonate reservoir in the sediments of the Upper Jurassic in the Bavarian Molasse Basin south of Munich. The temperature at the well head is 139 • C and the typical flow rate is 110 L/s. During production the pressure decreases from about 300 bar to 12 bar ground-level pressure. Table 1 gives the dimensions, flow velocities, and Reynolds numbers for the major pipes in the facility. The pipes are entirely filled with water so that water depth of the horizontal pipes (DN 300 and DN 350) equals pipe diameter. Reynolds numbers were calculated for a pressure of 12 bar and temperatures of 139 • C and 20 • C.
The calculated Reynolds numbers are on the order of 1 · 10 6 for full production in front of the heat exchanger. During maintenance, the Reynolds numbers are still in the 1 · 10 4 range. The numbers indicate turbulent flow in all pipes, and at all flow conditions.
In order to prevent detached scales from the production pipes, rock fragments from the reservoir, and left-over cuttings from the drilling of the well to enter the production plant, particle filters with a cutoff of 50 µm are installed close to the well head. Two automatic filters are operating in parallel. Any larger particles detected behind the filters have likely precipitated in the surface-level installations or grew from smaller particles.
Samples were collected after a series of interruptions of the geothermal energy production (see Table 7) in Oct. 2015. One of the automatic particle filters was in service during the majority of this period. There were two maintenance cycles to mechanically remove scales from the inside of the heat exchanger (Aug 20, Sep 3). Here, the electric submersible pump (ESP) was kept running, bypassing the heat exchanger. All other incidents came with a shutdown of the ESP, hence the flow velocity in the facility was zero. Unexpectedly, right after the yearly maintenance, huge amounts of scales blocked the heat exchanger, and caused another interruption (Oct 1).

Cleaning of ground-level facilities
The procedure for the chemical cleaning of the ground-level pipes comprised the following steps: First, the ESP was shut-off, and the ground-level facilities were disconnected from the production and injection pipes. Second, the geothermal water in the surfacelevel pipes was displaced by tap water. Then, 70 % methanesulfonic acid and a surfactant solution with a pH around 7 were gradually added to the tap water in the pipes until the concentration of the acid in the fluid reached the desired 5 % at a dilution ratio of about 1:17, and a pH of 0 -1. The surfactant was needed to emulsify oil, which is contained in the geothermal water, and to improve interaction of scales and acid. The cleaning solution was continuously pumped through the facility at a flow rate of 4 -8 L/s for approximately 8 h. The solution was then allowed to sit quietly overnight. The following day, the same solution was again continuously pumped through the facilities for 8 h of flow and allowed to sit overnight. Starting the next day the acid was drained from the facilities into a neutralization tank. The ground-level pipes were filled with tap water before normal production was restarted. The pressure during the entire cleaning operation was held at 1.2 bar to 3 bar by a nitrogen gas pressure system. In total, 1,800 L of concentrated acid along with 2,000 L surfactant solution were consumed during the acidification.

Collection and analyses of water and gas samples
Water and gas samples were taken at regular intervals before and after the cleaning procedure, and showed little variance (i.e. ± 4 % TDS Herbrich 2017). The samples presented here were taken after the incident and after full operation resumed. Samples were taken at a sampling port between well head and the automatic filter. An on-site cooling device was used to bring the temperature to 54 • C to be able to handle the samples safely. Temperature, pH-value, electric conductivity, and redox potential were measured on-site with portable electrodes and sensors (InLab Expert Go-ISM, InLab 738-ISM, InLab Redox ORP, Mettler Toledo, Germany). Alkalinity and acidity were analyzed by mass analysis on-site with 0.1 M HCl (Carl Roth), 0.1 M NaOH (Carl Roth), and using colorimetric indicators phenolphthalein (Merck) and cooper (Sigma Aldrich). Anion ( F − , Cl − , Br − , SO 2− 4 ) concentrations were quantified by IC (Dionex, IC25). Total sulfide in water was precipitated on-site with 10 mL zinc acetate (2 %). The concentration of the precipitated zinc sulfide was measured with the methylene blue colorimetric method (Deutsches Institut für Normung, 1995) using a spectrophotometer (Double Beam Shimadzu). Na + and K + were quantified using a flame photometer (Eppendorf ELEX 6361), calcium was determined by titration with EDTA. The other concentrations of the other cations were determined by AAS (PerkinElmer, 3300).
The concentration of dissolved gases in the thermal water loading was quantified using an on-site degassing unit as described by Baumann (2016). The unit was composed of a 9−L plastic tank with two connectors in the lower third of the tank serving as inlet and outlet of the thermal water. A third connector at the top of the tank was used to transfer the accumulated gas into a gas cylinder (1 L gas). At the beginning the sampling tank was filled completely with thermal water with the outlets for water and gas open. After a constant flow of water was established and measured, the gas outlet was closed. The gas which then accumulated inside the container was measured as a function of time using an imprinted scale. The gas composition was later analyzed by GC-MS (Shimadzu GCMS-QP2010 Ultra, Kyoto, Japan) with helium as carrier gas.

Sampling, preparation, and analysis of scales
The scale samples (20 samples in total) were taken from the inlet chamber of the heat exchanger on October 1, 2015. The facility was in full operation for 6 days before shut down and opening of the heat exchanger. A total of 46, 700 m 3 of thermal water had passed through the heat exchanger after the last chemical maintenance.
In order to assess the mineralogical composition and the structure of the scales by optical transmission microscopy, the samples were rinsed with n-hexane (Chemsolute, min. 99 %). Then, thin sections of an approximate thickness of 30 µm were cut parallel to the flow direction and perpendicular to the ripple crests. The sections were embedded in a polyurethane resin (Araldite ® ). For better visualization of the pores, a blue dye (Struers, Bluedye Farbstoff für Imprägniermittel DE-L831203) was added to the resin. The samples were then visually examined with an optical transmission microscope.
To prepare the samples for scanning electron microscopy with energy-dispersive X-ray spectroscopy (SEM/EDX), the scale fragments were also rinsed with n-hexane (Chemsolute, min. 99 %) about five times to remove any oil. The samples were then rinsed with water once or twice and dried in a desiccator for a few days to remove residual moisture. After sputtering a gold layer onto the samples the samples were visualized with a SEM (Tescan Vega, 3 LM, Software: Vega TC, Kohoutovice, Czech Republic) and measured with EDX (EDX Oxford Instruments, x-act, Software: Aztex, Austin TX 78744, USA). The SEM/EDX images were processed with ImageJ (Schindelin et al. 2012;Rueden et al. 2017) in order to measure the pore-and crystal-size distribution. The porosity and pore size distribution of scale samples were measured using micro computer tomography (micro-CT) (v|tome|x s 240, General Electrics) by C. Schulbert for a typical sample cube with 0.5 × 0.5 × 0.5 cm 3 at the University of Erlangen. The scan was run at 80 kV, 100 µA and a distance between object and focal point of 34 mm. Data reconstruction and processing was done with the GE-software datos, Version 2.3. and the software VGSTUDIO MAX 3.0 (VolumeGraphics) (GmbH 2019).

Hydrogeochemical modeling
In this study we also wanted to test our hypothesis that the observed ripple scale did not form by simple precipitation during normal operation, but by deposition of preexisting particles, which we assume due to the ripple morphology. For this test, a hydrogeochemical model for normal operation was set up with PhreeqC, v.3.4 (Parkhurst and Appelo 2013) following the procedure of Baumann (2016). The model accounts for the difference in ambient conditions between the sampling location and the geothermal reservoir, and uses the database phreeqc.dat.
The first step to simulate the water and gas composition throughout the facility was a back-calculation of the samples taken at surface level to reservoir conditions. Next, the pressure and temperature were adjusted according to the defined simulation points. For each simulation point the model calculated the bubble pressure which is the pressure at which gas bubbles begin to form in the geothermal water (gas phase > 0.1 mL/L ) and the theoretical mass of precipitates. Here, the mass was given as the amount of calcite, that can precipitate to reach thermodynamic equilibrium (SI = 0). This simplification was justified by the mineralogical assessment of the scales which consist primarily of calcite.

Quantification of ripple features
The ripple geometries were measured by sliding caliper measurements. The measured parameters were ripple length, ripple height, and sample thickness.

Hydrochemical conditions
A representative analysis of the geothermal water is given in Table 2. Following the classification of Furtak and Langguth (1965), the water is a Na-HCO 3 -Cl-type with a TDS of 656 mg/L. With a (Na+K-Cl)/HCO 3 ratio of 0.84 the water is strongly influenced by cation exchange. The Ca/Mg ratio of 4.5 of the water indicates a limestone reservoir matrix (Langmuir 1971). The water contains 86 mL/L gas (at standard conditions, Table 3), which is composed of methane (46.3 %), nitrogen (35.9 %), carbon dioxide (16.0 %), ethane (1.0 %) and hydrogen sulfide (0.3 %). At reservoir conditions (298 bar, 140.2 • C ) this equals 2.1 mmol/L methane, 1.4 mmol/L nitrogen, 3.1 mmol/L carbon dioxide, 0.04 mmol/L ethane and 0.17 mmol/L hydrogen sulfide. Carbon dioxide is in carbonate equilibrium and is stripped from the solution if other gases form gas bubbles.
The calculated saturation index for calcite along the geothermal cycle is given in Table 4. With an age of the thermal water exceeding 10,000 years we can safely assume equilibrium conditions in the reservoir. At the pump intake, the SI increases to 0.24 due to decompression, slightly decreasing to 0.19 at the outlet of the pump due to pressure build-up in the pump, and rising back again to 0.24 at the well head, again due to decompression (Table 4). The pressure dependence of calcite equilibrium constants was validated by Hörbrand et al. (2018).
As soon as the temperature decreases inside the heat exchanger, the SI turns to undersaturation ( SI = −1.00 at 60 • C ). This leads to a benign behavior of the geothermal water with respect to the precipitation of calcite, and no calcite scales are expected between the heat exchanger and the well head of the injection pipe. Figure 1 shows a representative scale from 20 evaluated samples. The measured curvature of the samples resulting from the cylindric shape of the pipe is d ≥ 290mm for all samples. This rules out any smaller pipes, and indicates that the scales must have formed in the ground-level facilities, with pipe diameters between 316 and 348 mm (Table 1). At this point, we can safely rule out the production pipes ( 255mm ) as a source for the remobilized scales.  The ripples crests are oriented along the inner perimeter of the pipes, that is perpendicular to the flow in the pipes. This rules out accumulation of material which slides down the inner pipe walls at no flow conditions. The median of the measured ripple length is 9.7 mm (25 %-quartile (Q1): 9.0 mm, 75 %-quartile (Q3): 10.9 mm; N = 31). The median of the measured ripple height is 1.2 mm (Q1: 1.1 mm, Q3: 2.0 mm; N = 31).

Description of scales
The ripple morphology shows gently sloping stoss sides and steep lee sides (Figs. 1  and 4). This indicates that the ripples were formed in unidirectional current (current ripples). Also, the Ripple Symmetry Index (RSI) of the ripples is 2.9 (Q1: 2.5, Q3: 3.5) which indicates current ripples. This makes sense, because the facility is operating either in a unidirectional flow regime or no flow at all. Oscillation, like in wave ripples, does not occur even though some of the ripples show a RSI < 2.5 which is at the transition to orbital waves.
The median bulk density of the ripple scales calculated from the geometry and weight of the ripples is 1.3 g/cm 3 (Q1: 1.2 g/cm 3 , Q3: 1.4 g/cm 3 ). Since the ripples consist of calcite ( 2.7 g/cm 3 ), this indicates a large porosity in the scale fragments.
More information is revealed by the thin sections of the ripple scales (Fig. 4). The scale samples have a median total thickness of 5.0 mm (Q1: 4.5 mm, Q3: 5.0 mm), and are all composed of four layers. The initial layer ( A 1 , 2 mm thickness) consists of a fine grained calcite matrix with many pores which appear round or even circular. During preparation of the samples oil came out of these pores. A dense layer made of calcite with large crystals ( B 1 , 400 µm thickness) covers layer A 1 . It shows only very few pores which are again filled with oil. Layers A 2 (2 mm thickness) and B 2 ( 400 µm thickness) repeat layers A 1 and B 1 but are phase-shifted against the underlying layer.
The ripple structure is created in layers A 1 and A 2 , respectively. The calcite layers B cover the ripple structures of the layers A with a constant thickness and like that stabilize the ripple structures.
Scanning electron micrographs (Figs. 5,6) show large pores in the A layers surrounded by small calcite crystals, and small pores but large calcite crystals in the B layers. The SEM/EDX analysis showed that the porous matrix of the A layers and the crystalline layers B have the same elemental composition that points to a magnesium-rich calcite (Table 5). A few small ( < 20 µm ) pyrrhotite (FeS) and pyrite crystals ( FeS 2 ) were found in the samples, particularly in the A layers.
XRD analysis indicated magnesium calcite as dominant crystalline phase (48 at. %) followed by calcite (35 at. %). Interestingly, kutnohorite CaMn(CO 3 ) 2 was detected with 17 at. %. The absence of kutnohorite in SEM/EDX might be due to a limited field-of-view or due to magnesium substitution of the manganese ions.
For the crystal and pore size distribution, 100 -180 measurements for each layer of the scales were conducted on the thin sections using ImageJ (Schindelin et al. 2012;   The crystal size was determined by averaging the longest two visible crystal edges, and the pore size was determined by averaging the longest axis and its perpendicular axis. The results revealed that the pore sizes and crystal sizes differ between the A and B layers. The crystals of the A layers are significantly smaller (median: 22 µm , Q1: 18 µm , Q3: 28 µm ) compared to the crystals of the B layers (median: 80 µm , Q1: 59 µm , Q3: 144 µm ). Here, some crystals grew distinctly larger (up to 500 µm ) resulting a strong skewness of the distribution.
The anisotropy of the crystals was calculated based on the evaluation of the transmission micrographs, and is expressed as ratio of the shortest crystal edge to the longest crystal edge. With a median ratio of 0.8 (Q1: 0.7, Q3: 0.9) in the A layers and a median ratio of 0.7 (Q1: 0.6, Q3: 0.9) in the B layers the crystals show a similar, more or less isometric, only slightly prismatic crystal habit indicating spatially unconfined growth.
The pores in the A layers from 180 measurements (median: 92 µm , Q1: 71 µm , Q3: 117 µm ) are significantly larger compared to the pores in the B layers (median: 57 µm , Q1: 46 µm , Q3: 68 µm ). The largest pores in the A layers ( 250 µm ) are twice as large as the largest pores in the B layers. The micro-CT data indicate a median pore size of 50 -60 µm in all layers.
Evaluation of the transmission micrographs (e.g. Fig. 7), allows a quantitative assessment of the porosity. The average area covered by matrix elements is 55 % leaving a pore space of 45 %. The 3-D micro-CT measurements yield a porosity for the A layers of 42 -53 %, which is in good agreement with the 2-D measurements with TM. The porosity given for the B layers is 0-20 %. Here, no measurements were possible with the transmission micrographs.
The anisotropy of the pores expressed as the ratio of short and long axis of the ellipsoid shows a slight median anisotropy of 0.8 (Q1: 0.7, Q3: 0.9) for all layers. All pores look more or less round. Pores like this are known from fluid inclusions. Some degree of anisotropy can be attributed to static pressure, droplets coalescing and later growth of crystals into the pore space. The anisotropy is confirmed by the micro-CT measurements.

Mass balance for accumulated scales
In order to understand the scaling process, the growth rates of the scales are important. The mass of the ripple scales will provide some evidence about the time frame in which the scales built up. The mass of scale present in the ground-level pipe can be calculated for each scale layer from the observed scale thickness and the known geometries of the pipes according to Eqs. 13 and 14: where m is the mass of scale, ρ calcite is the density of calcite ( 2.71 gcm −3 ), is the porosity with an average value of 45 % taken from the TM and micro-CT analysis and V is volume of scale given by where x is the observed median scale thickness (5.0 mm, Q1 = 4.5 mm, Q3 = 5.0 mm), d is the ground-level pipe diameter (350 mm), and l is the pipe length between automatic filter and heat exchanger ( 50 ± 5 m ). This is the section where all the scale fragments, which were later washed into the heat exchanger, originally formed, as proven by the scaling curvatures (see Section: Description of the scales). The factor of 1/3 accounts for the observation that only the lower third of the pipe showed scales as reported from a camera rover inspection of the pipes done shortly after the sampling date. Applying Eqs. 13 and 14 with a grain density of 2.71 ± 0.05 g/cm 3 and a porosity of 0.45 ± 5 in the A layers, and neglecting the minor porosity in the compact B layers, the mass of mineral scale attached to the pipe between the filter and the heat exchanger at the sampling date was roughly 154 ± 22 kg with the highest uncertainties resulting from porosity and scaled area.
Furthermore, in case of a stillstand of the facility, the geothermal water volume of 4.8 m 3 sitting in the ground-level facility could only precipitate 0.3 % of layer B 1 , and is so excluding the possibility, that layer B formed during a short stillstand of the geothermal production.
If we assume full thermodynamic equilibrium, the minimum volume of water required to precipitate the observed scales can be calculated. The analyses of the scales shows that the main component is calcite. With a molarity of calcium β of 0.416 mmol/L, and a SI of 0.24 the calcite scale potential, derived from the PhreeqC model during normal operation in front of the heat exchanger at 139.0 • C and 12 bar is 0.130 mmol/L. If that total scale potential precipitated, a minimum volume of 1.2 · 10 4 m 3 of geothermal water would be required to create the observed mass of scale of 154 kg on the substrate surface of 18.3 m 2 . With the flow rate of 110 L/s during full operation, the time until this water volume is produced is about 30 hours. The time until layer B is formed would be about 4 hours.
In reality, however, scale formation is limited by the kinetics of calcite precipitation and also controlled by the effective mineral surface. The average calcite scale rate at the well head for this specific site is 2.7 · µmol/(m 2 · s ) as reported by Herbrich (2017). This rate is also in line with other sites (Wanner et al. 2017). From this real scale rate and from the production rate, it can be calculated that it would take 361 days during normal operation to create the observed 154 kg of calcite scale in the pipes, and the cementation of layer B 1 would take 46 days. The conclusion of the mass calculation is that the observed ripple scales cannot have formed by new precipitation during regular operation within the 6 days since the last cleaning.

Solid particle deposition versus in situ precipitation
In this study the particles which built the ripples originally precipitated by heterogeneous crystallization of calcite on the walls of the horizontal ground-level pipes. Earlier rover inspections have proven this scale growth on the pipe walls. This scale formed over the time of one year, between the last ground-level cleaning, and the scale sample collection in October 2015. Precipitation was caused by degassing of CO 2 in the pump which increases the pH and leads to supersaturation with respect to calcite as described in earlier studies (Wanner et al. 2017, Herbrich 2017, Boch et al. 2017. Evidence for degassing during operation was given by a glass window at the well head, in which tiny gas bubbles could be observed in the thermal water. It is known from various natural environments that ripples are the result of solid particle deposition (Ha and Chough 2003;Kraemer and Winter 2016;Schieber et al. 2007;Soulsby et al. 2012;Tanner 1967;Yalin 1985). Therefore, the ripple shape itself which is visible in the A layers of the scale directly implies that solid particle deposition of preexisting particles was the driving process for the formation of these scale layers. In spite of that, it cannot be excluded that some minor additional in situ precipitation occurred during the settling of the particles. Furthermore, individual grains can easily be manually detached from the A layers of the scale samples. This strongly suggests that the A layers consist of weakly connected particles which settled down in a slow current, and did not precipitate in situ. Additionally, the oil inclusions trapped in the A layers indicate a fast deposition process. As shown in the mass balance section it is not possible that scale of that thickness (2 mm A layers) precipitated fast enough in situ during the 6 days of regular operation since the last cleaning. Secondly, it is also unlikely that scale of that thickness precipitated during the maintenance works (2 -3 days) since this would require very high supersaturation with respect to calcite. Maintenance includes cleaning with organic acid which makes long lasting supersaturation unlikely. Considering all arguments together, the hypothesis that the rippled A layers formed from preexisting particles is much more evident than in situ crystallization. This process is not yet described in literature for geothermal facilities, and is not accessible with current models.
In contrast to the A layers, the B layers of the ripple scales are only 400 µm thick, have a dense structure, and cover the A layers evenly with constant thickness which means without superimposing another ripple structure on top of the A layers. These relatively thin B layers can already be created within a relatively short period of transient supersaturation. Such short supersaturation can be reached at the end of the maintenance works, during flushing of the pipes with communal water of higher pH. This suggests that the B layers were actually formed by in situ precipitation during the maintenance works, in opposition to the A layers.

Ripple formation-calculations
The key to the understanding of the formation of the observed scalings is the presence of ripple structures. The establishment of current ripples requires sedimented but mobile particles and fluid flow. Sedimentation requires that the density of the mobile particles is significantly higher than the density of water or the particles will float or stay in suspension. By the use of empirical equations, we reconstructed the conditions at which the ripples formed.
With Eqs. 4 and 5, we calculated the theoretical ripple geometries with the observed features and fluid properties. For the latter, temperature-dependent changes of the viscosity have most impact. From the comparison to the measured ripple geometry, we could then derive the flow velocities in the system at which the ripples could have formed.
In our system, regression equations 4 and 5 are valid for calcite particles ( ̺ = 2710 kg/m 3 ) with a diameter between approx. 20 and 220 µm at 139 • C (operation temperature) and between 50 and 630 µm at 20 • C (maintenance temperature). Particles with lower particle density cause a shift to higher particle sizes.
For an initial assessment 4 different scenarios for the ripple formation were defined (Table 8): Scenario 1 is standard operation at full production rate based on the observed calcite particle diameter ( d 50 = 22 µm ), scenario 2 is like scenario 1 but assumes flocculation/agglomeration to larger calcite particles ( d 50 = 150 µm ). Scenario 3 is representative for the cleaning step with water and acid at a lower pumping rate assuming solid particle deposition of the observed calcite particle size ( d 50 = 22 µm ). Values for D * are 0.6 ± 0.2 for scenario 3, therefore, ripple height and length could not be calculated for this scenario. Scenario 4 assumes solid particle deposition of calcite-coated oil droplets ( d 50 = 92 µm ), also during maintenance. This scenario was introduced because the SEM images showed a thin layer of calcite surrounding each pore (Fig. 7). The process which could have created these coated oil droplets is known from literature as Pickering emulsion (Huang et al. 2019), where oil droplets serve as crystallization nuclei, onto which calcite precipitates. Then, the coated oil droplets would have become more dense and experienced deposition. Also for this scenario D * is < 1.2 and thus ripple height and length could not be calculated.
Before applying Eqs. 4 and 5, we made a quick test by the use of Stokes' law if particles could have settled down at a reasonable time in the defined scenarios 1 -4, or if the particles would have stayed in suspension. This test confirmed that in scenario 1 the sedimentation of calcite crystals from the top to the bottom of the pipe, would have taken only 3 min, so that solid particle deposition is reasonable. For larger particles (scenario 2), the sedimentation would have happened even faster. During maintenance (scenario 3) due to higher viscosity, the same sedimentation would have taken 13 min. If the ripples had been formed by calcite-coated oil droplets (scenario 4) ( ρ oil = 900 kg/m 3 , 1.5 µm calcite coating) sedimentation of these particles would have taken 19 min. The calculations for scenarios 1 -4 by Stokes' equation showed that sedimentation of the particles was fast enough to occur in all considered scenarios.
Then, we applied Eqs. 4 and 5 to test which scenario is most likely. The results of the calculated ripple height and length are presented in Table 8 (upper part). With the measured crystal sizes and composition the maximum ripple length for current ripples is around 31 mm for the operational scenario 1. Particle aggregation increases the ripple length to 83 mm (scenario 2). The ripple height in both cases is roughly 10 % of the ripple length. During maintenance (scenarios 3 and 4), the maximum ripple lengths are expected to be even longer, due to increased fluid viscosity, but equations for ripple length and height are not valid. To summarize the ripple geometries, all calculated values based on Eqs. 4 and 5 were either exceeding the measured values ( ≈ 10 mm , η ≈ 1.2 mm ) by at least a factor of 3, or out of calibration range. This indicates that the ripples were likely not formed from the individual crystals observed in layers A, or that the equations cannot be used in this setting.
Why did the calculations according to Eqs. 4 and 5 predict higher and longer ripples than we observed, or in other words which parameters would need to be changed to get the observed small ripples?
• Smaller ripples could be reached by lower viscosities (see Eqs. 4 -6). However, lower viscosities can be excluded, and so viscosity does not explain the discrepancy. Viscosities were likely even higher than assumed, due to oil contained in the water. • Furthermore, a higher density contrast leads to smaller ripple dimensions, too. However, for production scenarios 1 and 2, the density contrast was already at the upper limit, because density of non-porous calcite was assumed for the initial particles, and so this does not explain the small ripples. For maintenance scenario 4, an increase of the particle density to 1200 kg/m 3 would allow using Eqs. 4 and 5, but the resulting ripple height and length would be 19 mm, respectively, 188 mm and therefore also way too long. The small ripples are therefore not explained by an erroneous density contrast, either. • However, the fine A layers of the scale consist of mixture of cohesive and noncohesive sediments. Such mixtures are reported to have significantly smaller ripple dimensions (height and length) due to cohesive forces (Baas et al. 2019(Baas et al. , 2016. This could explain why our calculations based on experiments with pure non-cohesive material produced too large dimensions. For mixtures of cohesive and non-cohesive sediments somewhat smaller velocities for ripples formation would be expected (Baas et al. 2019;Schieber et al. 2007;Yawar and Schieber 2017).
In contrast to the sophisticated Eqs. 4 -6, the simple Eqs. 1 -3 (see Table 8, lower part) which only depend on d 50 showed relatively good agreement with the observed geometries even though they neglect other parameters. This suggests that these equations are still a good first guess if ripples are found in new settings. As a next step for the reconstruction of the ripple-forming conditions, the velocity was calculated according to Eqs. 6 -12. This gave another hint that the ripples had not formed from individual crystals observed in layer A: during full operation (scenario 1 and 2), the flow velocity in the pipes was well above the washout velocity of 0.52 m/s, and during maintenance (scenario 3) the critical velocity (0.21 m/s) for ripple formation from calcite particles was not reached (Table 8, upper part). For scenario 4, the calculated flow velocities (0.04 -0.23 m/s) matched the real flow conditions during maintenance, but since the equations for ripple length and height, which belong to the same regression of the data set, were not valid, also the velocity equations could strictly spoken not be applied for this scenario. Figures 8 and 9 show the calculated ripple forming velocities as a function of d 50 for scenarios 1 -3. The figure demonstrates the strong effect of temperature and viscosity on the shape of the curve U washout . While for 20 • C , the washout velocity U washout increases with increasing particle size (Fig. 9), the washout velocity decreases with rising particle size, for a temperature of 139 • C (Fig. 8). However, for the considered particle size ( 22 µm ) of the ripple scale, the effect is small. Moreover, Figs. 8 and 9 show, which formation velocities of the ripples would be calculated for larger particles, as for instance created by flocculation.
Since there is already a huge uncertainty for the viscosity in our system, the same applies for the calculated velocities. While oil on the surface of particles increases the viscosity, high temperatures lead to a drastic decrease in the viscosity. If the ripple scales had been formed during maintenance, low temperatures of about 20 • C would have been present. Then, viscosity would have been 4 times higher than during normal operation at 139 • C . Calculations for 20 • C seemed in general better applicable than calculations at 139 • C because the experiments with which the equations were set up were done at ambient temperatures.

Discussion of the ripple-forming scenarios
Considering all calculations and aspects, when did the ripple scales, consisting of the rippled A layers and the cemented B layers, form? Table 6 summarizes the different options that are discussed in the following: • Ripple formation (A layers) could have happened during full production (scenario 1 and 2), even if it is not predicted by the calculations, but with the viscosity being outside the calibration of Soulsby et al. (2012) ripples could possibly have formed even at the high flow velocity of 1-2 m/s. The observed small ripple dimensions can well be explained by cohesion of the silt size calcite crystals (Baas et al. 2019(Baas et al. , 2016. This scenario seems unlikely, since no one reported ripples at these flow velocities before. If, despite of that, the A layers of the ripples formed during production, the B layers would have formed during different conditions (e.g. flushing with tap water during maintenance) due to their different compact appearance.    Boundaries for ripple-forming flow velocities U based on calcite particle size d 50 (scenario 3 between dashed lines). T = 20 • C , ν = 9.81 · 10 −7 m 2 /s • The second option is that ripples (A layers) formed during maintenance (scenario 3 and 4). The calculated velocities are higher than the maintenance velocities. At maintenance velocity, calcite particles would be below the critical threshold. Calcite-coated oil droplets fit to the flow velocities, but are unlikely regarding the ripple dimensions. However, ripple formation during maintenance is supported by the evidence of the 4 layer structure of the scale which fits well to the cleaning cycle consisting of 2 pumping phases, where the A layers could have formed, each one followed by a stillstand overnight, in which the B layers could form on top and stabilize the ripples at increasing pH due to degassing of CO 2 . Alternatively, the B layers could have formed during flushing of the pipes at the end of the maintenance. Here, strong supersaturation was reached by high calcium ion concentrations in the fluid leading to calcite precipitation when the fluid was mixed to tap water with neutral pH. While this scenario assumed ripple formation (A layers) during maintenance, the formation of the B layers could also have happened after the maintenance works, i.e. during normal production. However, this seems unlikely, since B layer cementation would take 46 days during normal production. This fits neither to the 6 days since the last chemical cleaning, nor to the time span of one year lying between the yearly chemical cleanings. Furthermore, a cementation of the B layer during full production is unlikely because the B layers contain almost no oil inclusions which suggests gravity driven oil-water phase separation at quiescent conditions, not at high turbulence. • Another option for the formation of the ripple scales is the start phase of the pump.
During the start phase, according to our calculations of the flow velocity, ripple formation was possible. Particles which had not fully been removed by earlier acid treatments of the facility, could have been remobilized and have formed ripples. This requires that the pump rate was only very slowly increased, so that the particles could stabilize by new precipitation of calcite before higher flow velocities could have lead to washout. Since the pump, at the investigated time period, was usually immediately turned on to almost final pump rate, this scenario seems unlikely. • Also the shut-down phase is a potential candidate for ripple scale formation. During the shut-down phase of the pump, suspended particles could have settle down in a ceasing current creating a rippled A layer. However, this scenario seems unlikely, as well, because there are not enough particles in suspension during normal production to create a continuous layer of the observed thickness (2 mm scaling layer A layers in Fig. 4). The particle load in geothermal facilities in the Molasse Basin is only about 0.01 -1 mg/L (Wolfgramm et al. 2011), so that additional preexisting particles (scales) would have needed to be remobilized to reach that thickness. Secondly, suspended particles during full operation consist of other particles, too (Wolfgramm et al. 2011), and do not consist solely of calcite as observed in our study. Third, ripples need some time to be created (Soulsby et al. 2012). During laboratory experiments, ripple formation only started after 40 min, while before that, rolling particles did not pile up significantly (Doucette and O'Donoghue 2006). Therefore ripple formation during shut-down phase is unlikely.
To summarize, the calculated flow velocities contradict that the ripples were formed during full production and during maintenance. Additionally, the start-and shut-down phase have the calculated flow velocities, but seem also unlikely for ripple formation for several above explained reasons. This suggests that the investigated ripple scalings in geothermal facilities did actually form at conditions which are not predicted by the empirical equations. This is possible since the ripples of this study were formed in a complex multiphase system (water, gas, oil) with simultaneous precipitation, dissolution and degassing while the empirical equations are derived from controlled laboratory experiments. Major differences between the systems are that the empirical equations were derived from experiments with particles in the sand grain size while in this study particles are in the silt size. However, studies have reported ripples formed from silt and clay particles, as well. These fine grained ripples are formed by spontaneous flocculation of the particles which by that get large enough to settle down according to Stokes' law (Schieber and Southard 2009). Furthermore, the particles in this study have a rhombohedral shape, while empirical experiments mostly studied ripples composed of rounded particles. The process of ripple formation comprising entrainment of particles, transient suspension, and reattachment as described by Ha and Chough (2003) is also possible with poorly rounded particles. Well rounded rolling particles are not required for ripple formation. Furthermore, ripples can also build from clay-and silt-size particles (Baas et al. 2019(Baas et al. , 2016Schieber and Southard 2009) which are typically also not rounded but rather platy. This shows that the principles of ripple formation can be applied to the rhombohedral particles of this study, as well. However, the different particle shape may explain some derivation from the quantitative theoretical prediction. The exposed surface area and the drag resistance of rhombohedral particles in a fluid current are different to rounded particles. This interplay of drag force and drag resistance due to the particle shape may influence the produced geometries and necessary ripple-forming velocities. However, this is yet little described in literature, and should therefore be addressed in future research. In literature (Soulsby et al. 2012;Baas et al. 2016) mostly only the particle diameter D 50 is considered as critical geometric parameter, but the shape of the particle is neglected in the equations.

Conclusion
Given all differences and uncertainties, we come to the conclusion that the ripples investigated in this study formed during maintenance works at a very low flow rate (scenario 3 or 4). The silt size of the particles supports the small flow rates. Based on the evaluation, we conclude that the rippled scalings were created the following way.
The facility was shut-down for the yearly maintenance. After displacement of the thermal water by tap water, acid was added to the solution which partially dissolved and destabilized the scaling, but did not reach all parts of the scale. During the acid-circulation, small scale fragments or individual crystals or rounded grains were transported, and underwent solid particle deposition creating ripples (layer A 1 ). Later, layer B 1 precipitated on top of layer A 1 . There are two options, when and how layer B 1 formed: • The first option is that layer B 1 formed overnight, at quiescent conditions, when the acid worked leading to degassing of CO 2 and a rising pH exceeding the thermodynamical equilibrium, so that dissolution was followed by precipitation/cementation from the fluid with a very high calcium ion concentration. Like that, layer B 1 formed on top of layer A 1 and stabilized it. The procedure was repeated the next pumping day and the following night resulting in layer A 2 and B 2 . It is striking that there are 2 pump phases and 2 stillstand phases during maintenance while there are also 2 ripple layers and 2 calcite cement layers. • The second option, how layer B 1 formed, is that it formed during flushing of the pipes at the end of the cleaning procedure. The fluid in the pipes has a high calcium ion concentration due to the dissolution of calcite. When this fluid gets mixed with fresh tap water of neutral pH, strong temporary supersaturation with respect to calcite is likely. If that is, what happened, then the observed ripple scales were created during 2 maintenance events, each event forming one A layer and one B layer, since flushing is only done once at the end of each cleaning cycle. Then, layer A 1 and B 1 would have formed before and during the cleaning one year ago, and subsequently would have withstood the last cleaning cycle.
Rippled scales give insight into the hydrochemical conditions and fluid dynamics in the investigated geothermal facility, and might be a key to avoid cost-intensive shut-downs due to scales in the facility. According to our calculations based on Soulsby et al. (2012), ripple formation is neither predicted for the production phase nor for the maintenance phase because the calculated velocities lie in between. However, major differences between this study and the experimental setup, from which the equations used for the calculations, were derived, suggest that ripples were created during maintenance, in spite of that. Particle diameter and fluid viscosity are major parameters that differ between this study and the empirical predictions.
Therefore, we conclude that solid particle deposition of mobile calcite crystals at the bottom of the pipe created the rippled scalings during maintenance works. We are confident that due to a protective oil layer on an already existing scale, the acid used during the maintenance was not able to entirely dissolve the scale. However, the acid weakened and mobilized small particles from the scale which were redeposited as ripples in a weak current. Here, either pH increase overnight or a small oversaturation of the tap water at the end of the cleaning was sufficient to stabilize the ripples by precipitating a tiny layer of calcite on top.
In general, oil plays an important role in the formation of calcite scale. It can mitigate the initial phase of scale formation by making the attachment to the pipe harder, but it can also somewhat protect an existing scale from acid. Furthermore, operational shutdowns tend to create oil layers by promoting water-oil phase separation. Finally, the importance of removing the oil from the scale before and during acid treatment must be emphasized. Only when you know that all scale can be accessed by the acid and a steady pH is reached with no further acid addition the facility can be considered clean.