# A Physical Approach to Simulate the Corrosion of Ceramic-Coated Magnesium Implants
## 2 Materials and Methods
### Numerical Model Development  
The corrosion process in magnesium alloys can be summarized as two stages; the first short-term stage is the reaction-controlled period governed by the total chemical reaction in Equation (2). At this stage, corrosion products of magnesium hydroxide form on the surface and provide partial protection against the corrosive environment. Following this stage, the rate of the transport of the ions through the corrosion surface becomes slower than the rate of the corrosion product formation. Hence, the corrosion becomes transport controlled afterwards [18], see Figure 5.  
\[\text{Mg }+2\text{H}_{2}\text{O }\rightarrow\text{ Mg(OH)}_{2}+\text{ H}_{2} \tag{2}\]  
Following the model by [PERSON] et al. [12], [PERSON]'s law of diffusion was also used to describe the uniform corrosion in HP-Mg in this model. The diffusivity coefficient was considered constant and isotropic, leading to Equation (3). The thickness of the developed corrosion products was assumed constant, and the kinetics of the electrochemical reaction were neglected. The volume of the solid magnesium was assumed constant and the concentration inside the volume was allowed to decrease following the diffusion. Initial values in the solid and fluid domain were equivalent to the pure magnesium density of 1732 \(\text{Kg/m}^{3}\) and the magnesium concentration in the blood plasma of 0.03 \(\text{Kg/m}^{3}\)[21]. Dirichlet-type boundary conditions were imposed on the solid-fluid interface equivalent to the saturation limit of the magnesium ions in the environment, calibrated in this study,  
Figure 4: Samples mounting setup for the immersion test. Figure 5: A schematic of the corrosion process, the battery represents the voltage driving the chemical reaction that deliberate the magnesium ions, the resistance represents the transport variable resistance against the flow of the ions. At the early stage, the reaction voltage dominates, but as the corrosion products form, the resistance controls the flow of the ions under constant voltage. and on the fluid outer boundary equivalent to the magnesium concentration in the blood plasma of 0.03 Kg/m\({}^{3}\). A schematic of the model domains and the boundary conditions is shown in Figure 6. The equation was solved using the finite element method included in Ansys APDL, with the magnesium ions concentration as the scalar field variable. The numerical mass loss data was calculated according to Equation (4). \[\frac{\partial c_{Mg}}{\partial t}=D_{Mg}\,\
abla^{2}c_{Mg} \tag{3}\]  
\[ML=\frac{V_{0}(\rho_{0}-\rho_{t})}{A_{0}} \tag{4}\]  
where \(V_{0}\) is the sample volume, \(\rho_{0}\) is the initial density of the pure magnesium, \(\rho_{t}\) is the temporal density which was calculated by the element area-weighted average of the magnesium concentration in the 2D model or by the volume-weighted average of a 3D model, and \(A_{0}\) is the exposed surface area of the implant. From the uniform corrosion nature and the controlled symmetric exposure in the immersion test, the model could be reduced to a 2D axisymmetric model, Figure 7a, to reduce the element count and improve the mesh resolution at the corrosion surface. The mesh was built using rectangular elements with 8 nodes. The solution was found to converge at the minimum element size of 10 \(\upmu\)m at the high concentration gradient region of the sample boundary. The m-SBF domain dimensions were chosen to replicate the solution volume to surface ratio in the immersion test. Following the calibration of the bare HP-Mg model for C\({}_{sat}\) and \(D_{Mg}\), the impact of the coating layer was modeled using a fine layer of 10 \(\upmu\)m thickness surrounding the sample region having a reduced diffusivity coefficient, Figure 7b. The concept was previously used in the model by [PERSON] et al. [14] for modeling the porous corrosion product's impact on  
Figure 6: The physical model schematic function in one specie of the magnesium ions.