## 3 Meshing Strategies for Curvilinear Meshes Aligned with the Preferential Directions of the Problem
### Contour Level Initial Selection  
The procedure starts by selecting the number of contour levels, i.e., the number of \(\lambda\) and \(\sigma\) lines, which will populate the simulation domain. The Mesh Generator then uses one of various algorithms in order to generate correctly spaced isolines in the mesh (picking specific contour level values). These algorithms allow the user to explore the best meshing methodology for the particular problem at hand. There are several algorithms or spacing methods in the literature, the ones used in the present work and their main characteristics are described below:  
* _Smoothing_: The values for \(\lambda\) and \(\sigma\) are sorted and smoothed using a local regression method which applies weighted least squares and 2 nd degree polynomial models. In this way a correlation between the magnetic coordinate value and the amount of instances it appears in the domain is obtained. Then, the contours levels selected by the user are evenly distributed over the correlation. This procedure is aimed toward obtaining contour level values with a good spatial distribution, regardless of the local rate of variation of the magnetic coordinate, as shown in Figure 7.
* _Logarithmic_: It obtains logarithmically spaced values for the magnetic coordinate between the maximum and minimum values resulting from the integration. This procedure biases the selection of contour levels toward smaller values (associated with regions of lower magnetic field intensity), avoiding incorrect spacing around high magnetic field intensity regions. * _Exponential-stretching_: This method was proposed by [PERSON] et al., [23] as a way to deal with magnetic field topologies containing singular regions and/or high ratios of maximum to minimum field strength. For either of the magnetic coordinates (characterized here as \(\psi\)), the number of contour levels, \(n_{\psi}\), are obtained from: \[\left\{ \begin{array}{l}\psi_{q}=\psi_{min}\frac{\exp\left(\frac{q_{0}-q}{q_{ 0}-1}\pi_{q}\right)-1}{\exp\left(\pi_{q}\right)-1}\text{ for }q<q_{0}\\ \psi_{q}=\psi_{max}\frac{\exp\left(\frac{q-q_{0}}{q_{0}-q_{0}}\pi_{q}\right)- 1}{\exp\left(\pi_{q}\right)-1}\text{ for }q>q_{0}\end{array} \right.\] (12) where \(q_{0}\) is defined as: \[q_{0}=\int\left(n_{\psi}\frac{\psi_{min}}{\psi_{max}-\psi_{min}}\right)\text { and }\psi(q_{0})=0.\] (13) Equation (12) implies obtaining the contour levels by exponentially stretching from 0 to the maximum positive and negative values of each magnetic coordinate. The parameter \(\alpha_{\psi}\) is the stretching parameter, and is specified as an input. * _Expanded-exponential-stretching_: It is based on the previous method but with an expanded functionality to account for the possibility of having multiple singular points: The algorithm searches the simulation domain for local minima of the magnetic field intensity and identifies the magnetic coordinates, \(\lambda\) and \(\sigma\) that define them. It then allows for specific control of the stretching method around these points, including adding fractional levels for fine tuning of the mesh elements and incorporating the contour lines crossing the singular points, as may be seen in Figure 8. The incorporation of these lines contributes to the avoiding undesired large elements in the singular region. This method has been developed during the present work. Examples of the meshing algorithms for a typical Hall Effect Thruster magnetic field are shown in Figure 9. The Expanded-exponential-stretching is found to be consistently more robust in achieving meshes where the isolines are evenly distributed through the domain for the different magnetic topologies put to trial. Figure 8 shows a mesh with a singular point produced using the Expanded-exponential-stretching method. This mesh is typical of some magnetic topologies of modern Hall Effect Thrusters, which try to control better the flow in the upstream region of the thruster channel. Figure 8 shows that this method allows the user a good level of control around the singular point region.