Most conventional orthopedic implants used for repairing joint and bone fractures consist of metallic biomaterials with polycrystalline microstructure that exhibit high hardness, good corrosion resistance and excellent fatigue and wear resistance. Usually, once the patient has recovered from a traumatic injury, a revision surgery is necessary in order to remove the implant from the body and avoid problems associated with osteopenia, inflammation of adjacent tissues or sarcoma. Alternatively, to avoid post-extraction of the implant, intensive efforts are being made in recent years to develop new classes of so-called “biodegradable implants”, composed of non-toxic materials that become reabsorbed by the human body after a reasonable period of time. These implants are usually based on polymeric materials. However, polymeric implants are often rather costly and exhibit relatively low mechanical strength. Sometimes organic polymers can also react with human tissues, leading to osteolysis. For these reasons, it is highly desirable to develop cost-effective biodegradable metallic alloys, with better mechanical performance than polymers.
Although biodegradation is usually associated with the breakdown of organic matter into simple chemicals through the action of microorganisms, metals can also undergo biodegradation. Although corrosion should be generally avoided in the engineering field, it is advantageous for certain applications such as biodegradable implants. Since the 18th century, when Au, Ag and Pt elements were used for the fabrication of biomaterials , a large number of alloys have been developed so far. Some of the most employed metallic biomaterials for permanent implants are austenitic steels , Co-Cr-Mo , titanium and Ti-6Al-4V alloys  due to their biocompatibility and adequate mechanical behavior. To avoid post-extraction of these materials, intensive efforts have been made in recent years to develop the so-called “biodegradable implants”. The materials of choice for biodegradable metallic implants are iron-based  and Mg-based alloys  owing to their relatively fast biodegradability. From the point of view of the mechanical performance, Mg alloys are preferred because their stiffness (i.e., Young´s modulus) is closer to that of human bone .
Since “biodegradable implants” become reabsorbed by the human body after a certain period of time, they should be composed of biocompatible alloying elements. For this reason the potential cytotoxicity of the constituent elements of an implant material has to be seriously considered at an early stage of material development. For example, elements such as Ni, Al, Cr and V are not suitable to be in contact with human tissues . Their substitution by non-toxic elements such as Zn and Ca has permitted the fabrication of biocompatible Mg-based alloys with potential use as biomaterials. However, the problem with some Mg alloys is their exceedingly high corrosion rates in physiological conditions, which makes their biodegradability to be faster than the time required to heal the bone . For this reason it is important to decrease their degradation rate, and to keep their mechanical integrity until the bone heals. Another drawback of magnesium and its alloys is that corrosion is accompanied by intense hydrogen evolution. This gas can be accumulated in pockets next to the implants or can form subcutaneous gas bubbles.
This book chapter deals with the fundamental aspects of corrosion of magnesium based alloys in bodily fluids and reviews the various techniques that can be used to tune their degradation rate. The time-dependent evolution of their mechanical properties during the biodegradation process is also outlined.
2. Basic aspects of corrosion
Corrosion is a surface phenomenon greatly influenced by different media-related factors (chemical, electrochemical and physical) in which the material is placed. The corrosion behavior of Mg in aqueous environments proceeds by an electrochemical reaction with water to yield magnesium hydroxide Mg(OH)2 and hydrogen gas :
The hydroxide anions generated through the cathodic reaction cause an increase of the pH of the solution  (eq. (2)). The formation of a magnesium hydroxide Mg(OH)2 layer onto the Mg surface can further protect the metal from ongoing corrosion provided that the electrolyte pH and/or the presence of chloride anions or other species induce breakage of the passive film. According to the potential-pH Pourbaix diagram for magnesium in pure water at 25°C (Fig. 1), a passivation region exists for pH values above 10.4  (alkaline environment) where the Mg(OH)2 layer is stable. In neutral or acid environments (pH lower than 10.4) this layer is unstable. The diagram also shows that the immunity region of the diagram is below the region of water stability. However, bodily fluids are more aggressive than pure water. Body fluids are complex saline solutions containing ingredients such as proteins, blood serum, etc . The most common fluids to carry out in-vitro tests and thereby to predict the degradation rate of magnesium and its alloys are Hank´s balanced salt solution (HBSS), phosphate buffered solution (PBS) and simulated body fluid (SBF). All of them are acellular isotonic solutions (i.e., solutions with the same salt concentration as blood and cells) to make the sample, cell or tissue stable during an experiment.
HBSS  is mainly composed of chloride, sodium, potassium, magnesium and calcium ions. However, there are varieties of ingredients which can consist of glucose, potassium chloride (KCl), potassium dihydrogen phosphate (KH2PO4), sodium dihydrogen phosphate (NaH2PO4), and sodium chloride (NaCl). Additional ingredients can include hydrated magnesium sulfate (MgSO4 7H20) and sodium bicarbonate (NaHCO3).
PBS as its name implies  is a buffer solution consisting of a mixture of a weak acid and its conjugate base or a weak base and its conjugate acid. It aims to maintain a neutral pH in order not to destroy the cell or tissue sample and to maintain the osmolarity of the cells. The main ingredients are sodium phosphate and sodium chloride (NaCl) but in some recipes potassium phosphate and potassium chloride (KCl) are added.
SBF is a solution that has an inorganic ions concentration and pH almost equal to that of human extracellular fluid (i.e., the human blood plasma). The ions concentration in SBF is: Na+ (142.0), K+ (5.0), Mg2+ (1.5), Ca2+ (2.5), Cl− (148.8), HCO3− (4.2) and PO42− (1.0) mmol/dm3 and it is buffered at pH 7.25 .
Chloride ions are thus detrimental for the corrosion resistance of passive systems. Yet, other studies point out to opposite effects. For example, chloride ions were found to improve surface stability of Mg-Y-RE alloy in artificial plasma solution . Other species can also degrade the protective passive characteristics of Mg(OH)2 layer. Baril and Pébère found that the addition of increasing concentrations of NaHCO3 to a deaerated Na2SO4 media leads to an accelerated corrosion of magnesium due to dissolution of MgO and Mg(OH)2 films . On the contrary, certain anionic species like HCO3– have beneficial effects and can be added to the electrolyte to increase the stability of the corrosion products.The presence of dissolved O2 appears not to play a major role in the corrosion of magnesium when immersed in saline solutions or fresh water .
3. Hydrogen evolution
One of the major drawbacks of Mg as biomaterial is the formation of H2 gas when it is in contact with body tissues. The evolved H2 bubbles from magnesium implants can be accumulated and form gas pockets that may lead to necrosis of the neighboring tissues and delay healing of the surgery region . However, if the H2 gas is generated slowly enough it can be transported away from the implant and can thus be tolerated by the body. According to Song  a hydrogen release rate in the human body of 0.01 ml/cm2/day can be tolerated. Dissolution of Mg and concomitant hydrogen evolution can be retarded by either purification of Mg or through appropriate alloying. Fig. 2 shows the average rate of hydrogen evolution (ml/cm2/day) for commercially pure Mg (CP-Mg) and different Mg alloys . The highest release of hydrogen stands for CP-Mg, about 26 ml/cm2/day, and decreases with the addition of certain elements. For example, it decreases to 1.502 ml/cm2/day for ZE41 alloy (4 wt. % Zn, 1 wt. % RE), to 0.280 ml/cm2/day for Mg1.0Zn (1.0 wt. % Zn), to 0.068 ml/cm2/day for AZ91 (9 wt. % Al, 1 wt. % Zn) and to 0.012 ml/cm2/day for Mg2Zn0.2Mn (2 wt. % Zn, 0.2 wt. % Mn).
By measuring the hydrogen evolution rate the corrosion rate associated with magnesium is directly obtained since the release of one mol of H2 implies the consumption of one mole of Mg according to eq. (3) . The rate of H2 gas evolution for Mg in Hank´s solution at 37°C and different pH values was studied by Ng et al.  over a period of 7 days. They reported that the hydrogen evolution rate decreases with the increase of the solution pH. However, the volume of H2 gas evolved over the time at a given pH (between 5.5 and 6.8) practically does not change. The same authors reported that the average H2 evolution rate initially drops very fast from 153.3 to 1.079 ml/cm2/day when the pH rises from 5.5 to 7.4 but it slows down at pH 8.0 (0.534 ml/cm2/day) . This was attributed to the accumulation of corrosion products that covered the sample surface, forming a progressively thicker layer with pH. Similarly, Zainal Abidin et al.  suggested that the formation of a partially protective film on Mg2Zn0.2Mn and ZE41 samples after long immersion times in Hank´s solution was responsible for the decrease of the corrosion rate and concomitant H2 evolution.
It is important to stress that magnesium shows an unusual electrochemical phenomenon known as “negative difference effect” (NDE) , which basically consists of an increase of the H2 evolution rate at more positive potentials. For most metals, hydrogen evolution decreases with an increase of the applied potential or current density .
4. Corrosion of Mg and Mg alloys
When Mg and its alloys are used as biomaterials for implant applications they can be subjected to a combination of corrosion and stress (erosion, fatigue, etc). Since galvanic and pitting corrosion are the most common corrosion types of Mg and Mg alloys, this chapter primarily focuses on them:
4.1. Galvanic corrosion
Galvanic corrosion is an electrochemical process that occurs when two metals having different electrochemical potentials are in close contact with a common electrolyte. Of these two metals, the one that is more active in the galvanic series corrodes preferentially. Fig. 3 shows the galvanic series of different alloys listed in the order of the potential they exhibit in flowing seawater . The black boxes of Fig. 3 correspond to the potentials in low-velocity or poorly aerated water. The reference potential is the Standard Calomel Electrode (SCE).
Although the composition of seawater differs slightly from that of saline body fluid and thus the corrosion potential is not expected to be exactly the same, Fig. 3 already gives a rough idea of the activity of different metals and alloys. The most positive (noble) material will be protected against corrosion at the expense of the material with more negative potential. Since the electrochemical potential of Mg and its alloys is located at the most negative side of this series (i.e., below -1.6 V), almost all the other metals in contact with it will be cathodically protected. Therefore, Mg will undergo galvanic corrosion; i.e., galvanic couples between the Mg metal or its alloy and the other metal will result in the dissolution of the former. The driving force for the galvanic corrosion depends on the difference between the potential (i.e., nobility) of both materials.
Regrettably, the corrosion of Mg alloys not only occurs when they are in close contact with other metals but also within the material itself. Mg alloys do not normally have a uniform microstructure, composition and crystalline orientation. This lack of uniformity is sufficient to promote the occurrence of galvanic couples . The galvanic effect depends on a variety of factors; the crystal orientation of the matrix phase (i.e., the continuous phase of pure Mg into which the second phase/s is/are embedded), the alloying element concentrations in the matrix phase, the type and concentration of secondary phases along grain boundaries and the type and concentration of impurity particles in the matrix phase . In the following, the main features having an influence of the corrosion rate of Mg are summarized:
Crystal orientation of the matrix phase: polycrystalline pure Mg matrix immersed in neutral 0.01 M NaCl solution is more stable and corrosion resistant when grains possess a basal orientation . This behavior can be explained considering that densely packed crystallographic planes (i.e., basal planes) normally have a higher atomic coordination and thus a lower dissolution tendency than non-compact planes . For this reason, by controlling surface texture, one can improve the corrosion resistance of the material. For example, by rolling an AZ31 alloy it is possible to orient most of the crystallographic basal planes of the grains parallel to the rolling surface and thus decrease the corrosion rate of the rolled surface .
Alloying element concentrations: the corrosion behavior of Mg phase can be tuned as a function of the concentration of elements in solid solution. Depending on the nature and distribution of these elements within the matrix phase, the occurrence of micro-galvanic cells can be either mitigated or favored. For example, an Al-containing Mg matrix phase becomes more passive as the Al content increases and consequently the corrosion rate decreases . In as-cast Mg-Al alloys, the aluminum content in solid solution can vary from 1.5 wt. % at the grain center to about 12 wt. % at the grain boundary due to segregation during solidification . Since Al has higher potential (Fig. 3) than Mg, corrosion mainly occurs at the interior of Mg grains. On the contrary, in Zr-containing Al-free Mg alloys, the central areas of the grains (which are enriched in Zr) do not corrode while the grain boundaries severely corrode.
Type and concentration of secondary phases along grain boundaries: Mg intermetallic phases are typically nobler than the Mg matrix. As a consequence, they act as micro-galvanic cathodes and the dissolution of the Mg matrix is accelerated. Yet, in some cases the intermetallic phases can stop the corrosion process. Hence, they actually play a dual role in the corrosion of Mg alloys . Namely, the presence of a finely and continuously distributed secondary phase can stop the corrosion process while the presence of small amount of discontinuous secondary phase particles will accelerate it [25,35].
Type and concentration of impurity particles within the matrix phase: the corrosion resistance of Mg alloys can be improved by limiting the concentration of critical impurities. However, not all the impurity elements have the same effect on the corrosion behavior. Some of them have little influence while others are very detrimental to the corrosion resistance. For example, Zn and Ca, which are frequently employed in the biomaterials field [6,36], have moderate accelerating effects on corrosion rates. Contrarily, Ni, Fe, Cu and Co are deleterious due to their low solid-solubility limits in Mg and their ability to act as cathodic sites . The corrosion rate also depends on the impurity concentration. Each impurity has a tolerance limit. For impurity concentrations lower than the tolerance limit, there is no significant influence on the corrosion rate, whereas above this limit the corrosion rate sharply increases (Fig. 4) . There is a rough relationship between the solubility of some elements in Mg alloys and their critical concentrations . For example, the tolerance limit of Fe in Mg corresponds to the solubility of Fe in Mg .
Amorphous versus crystalline microstructure: When a liquid is cooled below its liquidous temperature, it either crystallizes or, if crystallization is suppressed, it forms an amorphous solid. The microstructure and constituency of a material can be altered on purpose by means of rapid solidification processing at quenching rates of 105-106 K/s . The development of novel Mg alloys with higher glass-forming ability has permitted to obtain amorphous materials with lower critical cooling rates. Since amorphous materials usually exhibit better corrosion and wear resistance than their crystalline counterparts, they can be potentially used for biomedical applications. Moreover, by controlling the crystallization events from the early stages of solidification, it is possible to tune the microstructure (i.e., nature and size of crystalline phases) and, in turn, optimize the corrosion performance of the material. This issue will be deeply tackled in section 5.1.2.
The micro-galvanic corrosion is also dependent on the solution in which the alloy is immersed. In a 3 % NaCl solution, the secondary phases present in the AZ91, ZE41 and Mg2Zn0.2Mn alloys can accelerate the corrosion rate. On the contrary, they do not play an important role when these alloys are immersed in Hank´s solution . The driving force for micro-galvanic corrosion between α-Mg and the secondary phases can be alleviated with the formation of a protective surface film on ZE41 and Mg2Zn0.2Mn during long immersion times in Hank´s solution .
4.2. Pitting corrosion
It is a type of corrosion in which there is an intense localized attack on sample surface that leads to the formation of small holes in the metal. Mg alloys are prone to pitting corrosion when the passivation layer (which consists of Mg(OH)2  or a mixture of MgO and Mg(OH)2 [42,43]) breaks down locally. When this occurs, the corrosion can be initiated at these local sites that act as small anodic surface areas. As aforementioned (see section: Basic Aspects of Corrosion), this protective coating may be damaged in physiological solutions because it is sensitive to both the chloride ion concentration and the solution pH. Physiological environments also contain phosphates, carbonates and sulfates that have different effects on the degradation behavior of Mg. Sulfate ions appear to stimulate the corrosion of Mg  while phosphate ions can delay pitting corrosion. Finally, carbonate ions can favor surface passivation and inhibit chloride-induced pitting corrosion due to the precipitation of stable magnesium carbonates into the pits. The presence of ions in different concentrations may explain why corrosion in Hank´s solution is more severe than in simulated blood plasma . Nevertheless, immersion of AZ91, ZE41 and Mg2Zn0.2Mn alloys in Hank´s solution favors the formation of a more protective surface film than in 3% NaCl solution.
The large influence of the electrolyte composition on the corrosion behavior could explain why the same alloy exhibits different modes of corrosion depending on the environment. For example, a commercial AZ91 alloy immersed in 1M NaOH solution for 1 h and then re-immersed in 0.01M NaCl for 3h exhibited pitting  whereas the same alloy immersed in Minimum Essential Medium (MEM) at 37°C and 5 % CO2 exhibited general corrosion mode . Pitting can be also initiated by small surface defects such as scratches . While galvanic corrosion is caused by local change of composition, pitting appears to be mainly influenced by the formation of a partially protective film. In fact, for the AZ91, ZE41 and Mg2Zn0.2Mn alloys, which are two-phase Mg alloys, their corrosion rates in Hank´s solution are similar to that of HP-Mg despite the tendency of the second phase to accelerate the corrosion rate . The formation of a more protective and compact film on the surface of the Mg-Nd-Zn-Zr alloy than on AZ31 alloy is responsible for the slower corrosion rate on the former alloy in Hank´s solution at 37°C for 240h . After immersion, deep pits were detected on the surface of the AZ31 alloy while that of the Mg-Nd-Zn-Zr alloy remained smooth.
The corrosion rate of Mg alloys is also influenced by the flowing conditions of the physiological environment (i.e., under dynamic physiological conditions the corrosion rate would slow down compared with steady conditions). This behavior is attributed to the fact that if the Hank´s solution is flowing, the absorption of Cl- ions on the surface of the protective layer would be hindered. This phenomenon could explain the difference between in vitro and in vivo corrosion of degradable Mg alloys. For example, corrosion tests of AZ91D and LAE442 alloys in physiological solution indicate that both alloys corrode about four orders of magnitude slower in vivo than in vitro .
5. Tuning the biodegradation rate
The main limitation of Mg alloys for their use as implant materials is their exceedingly high corrosion rate in physiological conditions (i.e., pH = 7.4-7.6 and large chloride concentrations), which causes their biodegradability to be faster than the time required to heal the bone . For this reason it is important to decrease the degradation rate of Mg alloys to remain implanted in the human body for at least 12 weeks . Moreover, although the human body strives to keep a constant value of the pH, the presence of a fast corroding Mg implant can lead to local alkalinization that would unfavorably affect the pH close to the implant. Song suggested that a pH higher than 7.8 can have a poisoning effect . These drawbacks associated with an exceedingly fast degradation rate suggest the need to control the biodegradation rate of Mg alloys.
So far, two kinds of methods have been used to slow down the corrosion rates of Mg alloys:
Surface coatings or surface modification:
In a broad sense, coatings can be divided in two classes: conversion coatings and deposited coatings. Conversion coatings consist of protective layers prepared using chemical (immersion in chemical baths to form calcium phosphate-containing layers, fluoride-containing layers, etc) or electrochemical processes (passivation, anodization, etc) . Likewise, deposited coatings can be divided into metallic [53-56], organic  and inorganic [58,59]. The corrosion resistance of Mg and Mg alloys can be also improved through surface modification using various techniques such ion implantation , surface cladding and melting with laser or electron beam, , plasma surface modification , surface amorphization , etc.
By controlling the composition and the microstructure:
Although there are numerous review articles dealing with the growth of coatings  and surface modification procedures for Mg alloys , none of them deeply focuses, to the best of our knowledge, on the different means to tune the corrosion rate of these materials based on the control of their microstructure and composition. For this reason, the following section focuses on this subject.
5.1. Compositional and microstructural control:
5.1.1. Microstructural modification and thermal treatment
Microstructural control is an effective means to tune the strength and corrosion resistance of Mg alloys. More grain boundaries that act as corrosion barriers [64,65] are formed when the grain size is reduced. The microstructure can be refined using different severe plastic deformation (SPD) methods such as extrusion and equal channel angular extrusion (ECAP). Subsequent heat treatments further allow controlling the microstructure in order to tune the mechanical and corrosion performance. There are, in fact, multiple combinations of SPD and/or heat treatments to optimize the microstructure. For example, an alloy can be first heat treated and then plastically deformed or an alloy can be simply heat treated from the as-cast condition (i.e., without undergoing plastic deformation).
An example of microstructural optimization through heat treatments is the effective control of the corrosion behavior of the as-cast (F) Mg3Nd0.2Zn (wt. %) (NZ) and Mg3Nd0.2Zn0.4Zr (wt. %) (NZK) alloys through solution heat treatment (T4) and solution heat treated and artificially aged (T6) in 5 % NaCl solution. The T4 treatment is carried out at 540°C for 6 h followed by water quench at 25°C. After this solution treatment the alloys are artificially aged in an oil bath at 200°C for 16h (T6) . Immersion tests indicate that the highest corrosion rates stand for the as-cast samples: 1.353 mg/cm2/day and 0.203 mg/cm2/day for NZ and NKZ alloys, respectively. The heat treatments increase the corrosion resistance in the following order: F < T6 < T4. The lowest corrosion rates values are obtained at T4 conditions (0.266 mg/cm2/day for NZ alloy and 0.11 mg/cm2/day for NZK alloy) and only increase slightly at T6 conditions. The change in the corrosion rate after the heat treatments is ascribed to microstructural modifications. In the as-cast condition the microstructure of both alloys consist of α-Mg matrix and an eutectic Mg12Nd compound inhomogeneously distributed within the matrix. Because of the discontinuous distribution, the Mg12Nd acts as a microgalvanic cathode and, so, it accelerates the corrosion of the matrix. The authors reached this conclusion by comparing the role of Mg12Nd phase on the corrosion behavior of NZ and NZK alloys with the role of β phase (i.e., Mg17Al12) on the corrosion of AZ alloys . Song and Atrens proposed that when the β phase is discontinuously distributed within the material, the corrosion rate of AZ alloys increases (see section 5.1.3) and thus the same behavior is expected for the Mg12Nd phase. However, when the NZ and NZK alloys are subjected to T4 or T6 treatments, the Mg12Nd compound dissolves into the matrix and microgalvanic couples are no longer present. The slightly higher corrosion rates detected at T6 to T4 is attributed to the precipitation of very small Nd-rich precipitates. Consistently, the corrosion morphologies reveal that the localized attack zones are more severe in the as-cast than in the T4 condition. Also, in the T6 condition the attack is slightly more severe than in T4 condition.
For a ZE41 alloy (4 wt. % Zn, 1 wt. % RE) the corrosion behavior improves after heat treating for 5 days at 500°C . This improvement is again related to microstructural changes that occur during heat treatment. The Mg7Zn3RE phase present in the material before heating partly redissolves, which explains the increasing concentration of Zn and RE in the matrix. Similarly, the corrosion resistance of the as-cast Mg10Gd3Y0.4Zr (wt. %) alloy increases with solution treatments due to the dissolution into the α-Mg matrix of the (Gd+Y)-rich eutectic present in the as-cast condition . The improvement of the corrosion resistance greatly depends on the thermal treatment. Namely, it is highest for a T4 solution treatment (500°C for 6 h) than for any of the T6 solution treatments (oil bath at 250°C for 0.5, 16, 193 and 500 h). The reason lies in that an increasing ageing time increases the volume fraction of secondary phase that act as cathodes and thereby ultimately increases the corrosion rate.
The microstructure of alloys can be optimized if the temperature is properly controlled during the dynamic recrystallization in an extrusion process. The corrosion behavior in SBF at 37°C of Mg3Nd0.2Zn0.4Zr (wt. %) NZK alloy initially solution-treated at T4 conditions (at 540°C for 10 h and then water quenched to room temperature) is effectively modified by controlling the extrusion temperature (250°C, 350°C and 450°C) . Both immersion and electrochemical tests indicate that the corrosion rate in the extruded condition at 250°C, 350°C and 450°C is much slower than in the T4 state. Moreover, the corrosion resistance increases with the decrease of the extrusion temperature and so does the grain size.
Deformation processing can also have an effect on the redistribution of solutes within the microstructure and ultimately affect the corrosion behavior. When a ZK60 (6 wt.% Zn, 0.5 wt. % Zr) alloy is processed by an integrated extrusion combined with ECAP, it is observed that Zn-Zr and Mg-Zn intermetallics become fractured and redistributed within the microstructure. Electrochemical and immersion tests in NaCl electrolytes indicate that grain refinement and redistribution of Zr and Zn solutes improve the corrosion resistance .
The corrosion behavior also depends on microstructural effects such as twins, dislocations, etc., caused by deformation processing. For example, the corrosion resistance in 3.5 % NaCl of AZ31B magnesium alloy has been studied in the initially hard rolled condition and after heat treating at 200, 300, 400 and 500°C for 3 h in an inert atmosphere of argon and subsequent quenching in water to room temperature .
The initial average grain size of 35 μm in the as-received condition increases with the heat treating temperature to 50 μm at 200°C (HT 200), 65 μm at 300°C (HT 300), 90 μm at 400°C (HT 400) and to 250 μm at 500°C (HT 500). In the HT300 conditions, the microstructure is untwined because a high density of twins are eliminated and so the intra-granular corrosion is the least. However, in the as-received and HT200 conditions the deformation twins and thus the dislocation density is higher. This can explain the more serious corrosion of the HT200 microstructure compared with the HT300 microstructure despite the fact that the HT200 microstructure is finer and thus the physical corrosion barrier is larger. In other words, twins accelerate the corrosion. From the physical metallurgy viewpoint, in the as rolled conditions (i.e., after plastic deformation), the amount of twins is the largest but they are progressively annihilated as temperature increases. For this reason potentiodynamic polarization curves show that the corrosion rate increases as the microstructure becomes more twinned.
Not only the presence of twins but also the distribution and density of dislocations are correlated with the corrosion behavior. The AZ31 alloy plastically deformed by ECAP at 350°C with a pressing speed of 350 mm/min exhibit twins and a higher density of dislocations than after being extruded at 350°C with an extrusion ratio of 10.24 (in this case twins were not observed) . From corrosion studies in 3.5 % NaCl saturated with Mg(OH)2 at pH 10.5, the authors concluded that the corrosion rate of AZ31 alloy decreases after extrusion but it increases after ECAP, suggesting that the twins and/or presence of higher density of dislocations decisively affect the corrosion rate.
The corrosion behavior of a AZ31 Mg alloy with different grain sizes immersed in two different solutions, NaCl and phosphate-buffer solution (PBS) has been studied by other researchers. The microstructure is refined by ECAP with a first pass of 250°C and successively heat treated to 300°C and rolled . The best corrosion behavior is attained by the alloy having finest grains after long-term immersion in PBS . This behavior is related to the formation of a mixed compact protective layer of P-containing compounds together with magnesium hydroxide that promotes protection against the chloride ions. The superior corrosion behavior of the fine-grained AZ31 alloy over the coarser one is attributed to the formation of a layer of corrosion products that provides better protection against the diffusion of aggressive ions to the surface of the material .
Although these results suggest that the corrosion performance can be tuned by controlling the microstructure, other factors such as the chemical composition plays a more important role. For example, Liao et al.  observed that the fine grained AZ31B alloy exhibits a lower corrosion resistance than the AM60 alloy with coarser grains.
5.1.2. Amorphous and partly amorphous alloys
As aforementioned, the grain size can be tuned by controlling the cooling rate. For certain compositions such as AZ91 alloy  rapid cooling is an effective technique to obtain fine grain sizes. For other Mg-based compositions a sufficiently fast cooling rate can lead to the formation of glassy materials. Moreover, rapid cooling allows to extend the solubility of alloying elements in Mg alloys and to form a homogeneous single-phase structure (i.e., metallic glass) with a very different corrosion behavior than that of crystalline Mg alloys . Typically, amorphous materials possess stronger corrosion and chemical resistance than their crystalline counterparts due to the absence of grain boundaries, segregated phases, secondary particles and also due to chemical homogeneity . For this reason different Mg-based glassy materials have been studied over the years. For example, glassy Mg60+xZn35-xCa5 (0<x<7 at. %) ribbons of 50 μm in thickness can be successfully obtained by melt spinning . Immersion tests of these ribbons in SBF lead to the formation of corrosion layers that are different from those found in Zn-poor and Zn-rich alloys. For the Zn-rich alloys(above 28 at. % Zn), the Zn-rich oxygen-containing passivating layer that is formed on the surface of the ribbon is responsible for the more noble behavior of these alloys as compared to the Zn-poor alloys . Moreover, a high Zn content appears to reduce hydrogen evolution. In fact, due to the extended solubility of Zn in the amorphous structure of the Mg-Zn-Ca system, the Mg60Zn35Ca5 glass only exhibits marginal hydrogen evolution during in vitro and in vivo degradation .
Through the addition of different alloying elements to the Mg-Zn-Ca alloys family, the corrosion behavior can be tuned as well. Small Pd additions are enough to decrease the glass forming ability of glassy Mg72Zn23Ca5 alloys and to shift the corrosion potential towards more positive values . Cytotoxic tests do not show the presence of death cells, which confirm that these alloys might have potential use as implants . Cytocompatibility tests also show that metallic glass Mg66Zn30Ca4 and Mg70Zn25Ca5 samples have higher cell viability and exhibit more positive corrosion potential than that of as-rolled crystalline pure Mg .
It is well known that glassy materials can be used as precursors of crystalline phases by controlling the crystallization temperature and/or time. Since the corrosion behavior depends on the structure (i.e., amorphous vs. crystalline) of the material, the extent of crystallization can be controlled to tune the corrosion rate. For example, glassy Mg67Zn28Ca5 ribbons exhibit an increase of the corrosion resistance in simulated body fluid with the increase of annealing temperature up to a maximum and then the resistance decreases rapidly for higher temperatures. The best corrosion resistance of these ribbons is attained at 160°C, when the microstructure is constituted by a metastable crystalline Mg102.08Zn39.6 phase embedded in an amorphous matrix . This behavior was explained considering that the electrochemical activity of this phase is similar to that of its amorphous matrix. However, the newly formed phases at 225°C are more active and worsen the corrosion resistance of the alloy .
To determine the effect that alloying elements have on the corrosion resistance of rapidly solidified magnesium alloys, different binary Mg-based glassy alloys were studied by using electrochemical techniques in pH 9.2 sodium borate . These studies concluded that the corrosion rate of magnesium is decreased for larger contents of aluminium. Similarly, low concentrations of zinc and lithium decrease the corrosion rate below that of pure magnesium . These results indicate that composition has an important influence on the corrosion rate of glassy Mg alloys, as it has also been observed in crystalline alloys.
5.1.3. Influence of alloying elements on corrosion performance
As was explained on section 4.1, the corrosion rate of magnesium alloys depends on the nature and concentration of impurities. The corrosion resistance can be improved either by purifying Mg or through appropriate additions of alloying elements. Mg alloys are basically classified  in two groups: 1) those that contain Al as primary alloying element and 2) those that do not contain Al and have small amounts of Zr to refine the microstructure. Al is generally considered as a beneficial element to improve the corrosion resistance . For small contents, Al remains in solid solution, but above certain concentration β-Mg17Al12 secondary particles precipitate.
The β-phase is very stable in NaCl solutions and it is inert to corrosion due to the formation of a passive thin film on its surface. However, β-phase is also an effective cathode, which can explain the dual role of these precipitates in the corrosion of AZ alloys according to Song and Atrens . A fine and continuous distribution of β-phase is recommended to increase the corrosion resistance. For example, Lunder et al. reported that Al additions higher than 8 wt. % increase the corrosion resistance of Mg-Al alloys . An improvement of the corrosion resistance with the Al content is also found in AZ91, AZ61 and AZ31 alloys in 5 % NaCl . However, Song et al. reported an increase of the corrosion rate in NaCl in the following order AZ501 < AZ21 < AZ91 .
For the second family of alloys, small additions of Zr refine the microstructure of Mg and improve the corrosion resistance . Since Zr can easily combine with impurities, especially Fe and Ni, it can form insoluble precipitates that settle out during melting. This purification effect of Zr enhances the corrosion resistance of Mg . Depending on the composition, a minimum concentration of Zr is required to observe such effect. For example, for Zr contents from 0 to 0.42 wt. % the corrosion resistance of Mg10Gd3Y (10 wt. % Gd, 3 wt. %) deteriorates, whereas for higher Zr contents, ranging from 0.42 to 0.93 %, the corrosion resistance improves. The distinct behavior is attributed to the differences in size and distribution of the Zr-rich particles . An exceedingly larger amount of Zr can lead to precipitation of Zr within the matrix, which becomes detrimental for the corrosion performance of the alloy .
The addition of 1 wt. % of Al, Ag, In, Mn, Sn, Zn and Zr elements decrease the volume of evolved hydrogen gas, and thus decrease the corrosion rate, of Mg when immersed either in SBF or in Hank´s solution . On the contrary, the addition of 1 wt. % Y or Si have a deleterious effect on the corrosion performance.
Ca is an essential element to the body since it is a major component of human bones. For this reason, it has been used over the years to fabricate biocompatible Mg-based alloys. The concentration of Ca has, though, to be carefully controlled to avoid the precipitation of Mg2Ca particles (that takes place for Ca contents ranging from 0.8 to 5 wt. %  or from 1 to 3 wt. %  depending on the system under study). These Mg2Ca particles form micro-galvanic cells within the Mg matrix and accelerate preferentially the dissolution of the latter, worsening the corrosion resistance of the binary Mg-xCa alloy. For 1.5 wt. % Ca, a protective oxide layer of MgO and CaO is formed after heating to 500°C for 1h . The influence of Ca on the corrosion behavior not only depends on its amount but also on the composition of the Mg-based alloy to which it is added. For example, the addition of 13 wt. % Ca increases the corrosion rate of AZ91D alloy (37 wt. % Al, 0.5 wt. % Zn) . An improvement of the biocorrosion resistance is also detected when 0.2-0.4 wt. % Ca is added to a Mg-Si alloy since it refines the grain size and modifies the morphology of Mg2Si phase . The same holds when 1.6 wt. % Zn is added to Mg-Si alloy due to the modifications on the Mg2Si phase morphology derived from the addition; namely from a coarse eutectic structure to a small dot or short bar shape . Zn is an essential element to the human body and capable of decreasing the corrosion rate of pure Mg in small amounts. For example, the corrosion rate (measured in terms of volume of evolved hydrogen) of CP-Mg decreases from 26 ml/cm2/day to 0.280 ml/cm2/day with the addition of 1 wt.% Zn . The addition of 6 wt. % zinc shifts the corrosion potential toward more cathodic values and decreases the in-vitro degradation rate of high purity Mg in SBF . However, concentrations above the equilibrium solid solubility of Zn in Mg (i.e., 6.2 wt. %)  can lead to an increase of the corrosion rate in 3 % NaCl due to the formation of β-Mg7Zn3 phase in the magnesium matrix . The introduction of Mn can help to decrease the corrosion rate of Mg-Zn alloys. Ahmed et al.  reported that adding Mn to a Mg-based alloy containing 4 to 8 wt. %. Zn decreases the dissolution rate of Mg. The corrosion rate of Mg2Zn0.2Mn (2 wt. % Zn, 0.2 wt. % Mn) in Hank´s solution is also smaller than that of Mg1Zn (1 wt. % Zn) .
Other atypical alloying elements such as Y, Ce, Ti and Sc were reported to improve the corrosion performance when alloyed with Mg at a level below the solubility limit .
6. Biodegradation and mechanical integrity
The use of Mg alloys as weight-bearing implants requires that the material should have sufficient strength not only at the moment of being implanted but also when the alloy degrades over the time while remaining in contact with body fluids. It is important that implants keep their strength at least until the bone heals. For this reason different studies have been carried out to evaluate the mass loss and evolution of the strength over the implantation or immersion time .
According to Pietak et al.  the best technique to assess the degradation of Mg alloys is measuring the mechanical integrity as a function of the incubation time. Nevertheless, the measurement of the mass change  has been more frequently used. However, this procedure has several shortcomings due to the association of non-soluble degradation products that precipitate on the sample and obscure the mass loss .
The mechanical integrity can be evaluated using various mechanical tests (three-point bending, tensile tests, nanoindentation, etc). These tests can be performed under physiological conditions or in air.
From nanoindentation tests, Pellicer et al.  studied the evolution of the Young´s modulus (Er), hardness (H), and H/Er ratio (which is an indirect measure of the wear resistance) of amorphous Mg72Zn23Ca5 after different immersion times in HBSS as shown in Fig. 5. The same study was carried out on crystalline Mg70Zn23Ca5Pd2 alloy and the results were systematically compared. While the stiffness of both compositions decreases with the immersion time, hardness exhibits a more complex dependence, especially for the Mg72Zn23Ca5 alloy. Namely, an increase is observed after short-term immersion, which was mainly attributed to the fast dissolution of Mg and the concomitant enrichment in Zn (Zn is mechanically harder, so solution hardening takes place). For longer immersion times, the dissolution progresses and the alloy not only undergoes surface chemical change but the surface is also physically modified with to the formation of flaws such as pores and corrugations, which cause a decrease of hardness . The values of H/Er increase from 0.053 for the as-cast Mg72Zn23Ca5 alloy to 0.1 for Mg72Zn23Ca5 after 2h immersion in HBSS at 37°C, thus indicating that the effect of porosity on the Young’s modulus for short-immersion times is more noticeable than on hardness. These results are consistent with those observed in many other metallic alloys .
To evaluate the mechanical integrity of AZ91Ca alloy (i.e., a calcium-containing magnesium alloy) in SBF at 36.5°C, slow strain rate tensile tests at 1.2x10-7 s-1 were carried out . The AZ91Ca alloy shows lower elongation (3.5±0.2 %) and lower ultimate tensile strength (106±10 MPa) in the SBF than in air (4.6±0.3 % and 126±5 MPa, respectively). The decrease of the mechanical performance is, however, small and thus the alloy is not highly susceptible to corrosion in SBF. From electrochemical experiments it is observed that the AZ91Ca alloy exhibits improved corrosion resistance compared to the AZ91 alloy, which can be attributed to the formation of calcium phosphate on the surface of the AZ91Ca alloy. This surface film has higher stability than the film formed on AZ91 alloy for this reason not only the general corrosion resistance but also the pitting corrosion resistance improve.
Krause et al.  compared the evolution of the mechanical behavior of Mg0.8Ca (8 wt.% Ca), LAE442 (4 wt. % Li, 4 wt. % Al, 2 wt. % RE) and WE43 (4 wt. % Y, 3 wt. % RE) alloys implanted in rabbits for 3 and 6 months by three-point bending tests. All the samples exhibit biodegradation as can be deduced from the loss in volume with implantation period. The MgCa0.8 alloy degrades slowly during the first 3 months but its corrosion rate accelerates during the following 3 months. The LA442 alloy exhibits slower degradation rate than the Mg0.8Ca and WE43 alloys. The difference of degradation rate is responsible for the distinct mechanical performance of the alloys over the time. Thee-point bending test results indicate the following trend in the initial strength: LAE442 (255.67±5.69 N) > WE43 (238.05 ±21.68 N) > Mg0.8Ca (178.76±25.15 N). However, after 3 months the strength trend changes so that it decreases in the following order: WE43 (185.59±15.64 N) > LAE442 (153.21±18.45 N) > Mg0.8Ca (115.42±9.66 N). After 6 months the strength follows this sequence: LAE442 (134.68±14.68 N) > WE43 (122.23±23.65 N) > Mg0.8Ca (52.90±5.96 N). From the results of the maximal applied force it can be deduced that the LAE442 alloy degrades faster during the first 3 months and slower between 3 and 6 months. The degradation rate of Mg0.8Ca and WE43 alloys is different; it decreases in a linear manner over the time . The ductility of the alloys was also assessed from three-point bending tests by measuring the bending displacement but concluding results could not be obtained due to high scattering. The Mg0.8Ca alloy exhibits the highest loss and the LAE442 the lowest loss in volume after 6 months.
The evolution of the bending strength of Mg6Zn (6 wt. % Zn) alloy with the immersion time in physiological saline solution (0.9 % NaCl)  is similar to that of implanted LAE442 alloy . For short immersion times (i.e., 3 days) the degradation rate of Mg6Zn is very fast (0.20±0.05 mm/year) and exhibits a large weight loss but it becomes slower (0.07±0.02 mm/year) for longer immersion times (i.e., 30 days). The bending strength of the alloy decreases rapidly with an initially small weight loss but then decelerates as the percentage weight loss increases. This behavior was attributed to the formation of surface defects such as corrosion holes during degradation.
Plates of ZEK100 (1 wt. % Zn, 0.1 wt. % Zr, 0.1 wt. % RE (rare earth)) were mechanically tested in vitro after 14 (2 weeks), 28 (4 weeks) and 42 days (6 weeks) of immersion with a constant laminar flow rate in HBSS via four-point bending tests . The bending strength decreases from immersion week 2 to week 4 but increases again after 6 weeks. The lowering of the bending strength is attributed to dissolution of the plate whereas the increase at longer times can be explained by precipitation of calcium phosphates from the solution on the surface of the plate. This behavior was supposed to be caused by a decrease of the implant volume during the first 4 weeks and an increase for longer times up to 8 weeks.
The mechanical behavior of ZEK100 alloy was also tested via three-point bending after being implanted in rabbit tibiae for 3 and 6 months . The corrosion rate increases from 0.067 mm/year after 3 months to 0.154 mm/year after 6 months. The volume of the implant tends to reduce with the increase of the implantation time. This can explain why the initial maximum force of 241 N (the maximum force at breakage) decreases to 153 and 100 N after 3 and 6 months, respectively.
Figure 6 shows a comparative summary of the mechanical properties (compressive yield stress, σy,C, and Young’s modulus, E) of various families of materials that can be used as bioabsorbable implants, such as metallic alloys, biodegradable polymers and ceramics. From the correlation H ≈ C σy,C (where C is the so-called constraint factor and is normally close to 3 for crystalline metallic alloys and slightly higher for metallic glasses ) the mechanical hardness is observed to be directly proportional to σy,C.
The yield stress of Mg-Zn-Ca bulk metallic glasses is relatively large (Figure 6), thus indicating that they are one of the hardest biodegradable materials reported in the literature. Moreover, the values of Young’s modulus of glassy Mg-Zn-Ca are closer to that of cortical bone (Ebone = 3– 20 GPa) than most crystalline Mg-based alloys (they are also mechanically softer) and synthetic hydroxyapatites. Considering that the Mg70Zn23Ca5Pd2 alloy is fully crystalline, its hardness is also generally larger than that of most Mg-Zn-Ca crystalline alloys. Compared with most Fe-based biodegradable alloys, Mg-based bulk metallic glasses are generally harder. Moreover, Fe-based alloys are typically ferromagnetic at room temperature (except the antiferromagnetic FeMn), which precludes their use in nuclear resonance imaging techniques for diagnostics purposes. The Young’s modulus of Mg72Zn23Ca5 becomes closer to that of Ca-based or Sr-based biodegradable metallic glasses after long-term immersion in HBSS as well as to that of polymeric materials reinforced with glassy fibers. At the same time, the hardness of Mg72Zn23Ca5 alloy is higher than that of all these materials.
7. Summary and conclusion
Magnesium and its alloys are suitable materials for biomedical applications due to their low weight, high specific strength, stiffness close to bone and good biocompatibility. Specifically, because magnesium exhibits a fast biodegradability, it has attracted an increasing interest over the last years for its potential use as "biodegradable implants". However, the main limitation is that Mg degrades too fast and that the corrosion process is accompanied by hydrogen evolution. In these conditions, magnesium implants lose their mechanical integrity before the bone heals and hydrogen gas accumulates inside the body. To overcome these limitations different methods have been pursued to decrease the corrosion rate of magnesium to acceptable levels, including the growth of coatings (conversion and deposited coatings), surface modification treatments (ion implantation, plasma surface modification, etc) or via the control of the composition and microstructure of Mg alloys themselves.
For tuning efficiently the composition and microstructure it is first necessary to understand two of the most common types of corrosion that Mg and Mg alloys exhibit: galvanic and pitting corrosion. Galvanic corrosion develops because magnesium almost always behaves anodically in contact with other metals. Galvanic couples are usually encountered when the concentration of the alloying element surpasses their corresponding maximum solid solubility in magnesium. The alloying element then segregates during solidification or annealing and an inhomogeneous microstructure is formed. The extent of the galvanic effect depends on a number of factors such as the crystal orientation of the magnesium matrix, the type of secondary phases and impurity particles, the solution in which the alloy is immersed and the grain size. The concentration and distribution of secondary phases is also important for the corrosion behavior. A fine and continuous distribution of secondary phases typically improves the corrosion performance.
Mg alloys are susceptible to form a passivation layer of Mg(OH)2 or a mixture of Mg(OH)2 and MgO in aqueous solutions. Due to the presence of chloride ions in physiological fluids, the protective coating may be destroyed and localized attack (i.e., pitting corrosion) initiates. Physiological environments also contain carbonates, phosphates, sulfates and other ingredients that have different effects on the corrosion behavior of magnesium. Before magnesium alloys can be used as real implants it is necessary to evaluate the biodegradability and mechanical performance over the immersion (in-vitro) or implantation (in vivo) time.