Tips and recommendations on meshing =========================================== This part treats the adequacy between the mesh used for the calculation and the quality of the solution obtained. First, we recall the problem of mesh refinement in the context of the X- FEM method. After a reminder of the definition of mesh size, a criterion to be respected on mesh sizes is given. Next, various refinement strategies are presented. The one based on the Homard software coupled with Code_Aster is detailed below. Finally, the recommended methodology for mesh refinement in the X- FEM framework is summarized. The problem of mesh refinement in the X- FEM framework ---------------------------------------------------------------- The use of the X- FEM method makes it possible to overcome certain difficulties associated with meshing. In particular, a free mesh of the healthy structure is sufficient. In the following, the hypothesis will be made that the initial healthy mesh is sufficiently fine to obtain sufficient precision on the movements and stresses for a calculation of a structure without cracks. The introduction of the crack raises 2 questions: * Is the initial mesh fine enough to represent the geometric shape of the crack? * Is the initial mesh sufficiently fine for the post-treatment of quantities characteristic of fracture mechanics (energy recovery rate and stress intensity factors)? The first question is legitimate, because the geometry of the crack is characterized by level sets, whose values are carried to the nodes of the mesh. So the fineness of the mesh affects the quality of the representation of the crack, and therefore on the shape of the crack. In the vast majority of cases, the surface of the crack is flat. This type of surface can be represented faithfully even with a relatively coarse mesh. If not (curved crack), it must be ensured that the curvature of the crack can be well represented. The quality of the representation of the crack background is also important. But the requirements in terms of correct geometric representation are negligible compared to those necessary for post-processing (see 2nd question). The second question is the most worrying. Indeed, the stresses are singular at the crack point. An adapted mesh is therefore needed to properly capture this singularity. This problem is treated with the finite element method (FEM) by using, on the one hand, quadratic elements whose middle nodes are moved to a quarter of the edges (so-called "Barsoum" elements) and, on the other hand, a radiating mesh that allows a high degree of refinement in the post-processing zone. With X- FEM, the addition of asymptotic enrichment functions is the counterpart of Barsoum elements. But that only has a very local influence. It is therefore necessary to have a relatively refined mesh in the post-treatment zone. Note also that only linear X- FEM elements are considered in this note (the quadratic X- FEM elements are currently being optimized). Obtaining a sufficiently fine mesh is the core of this chapter. The objective is to first specify what the fineness of the mesh should be in the post-treatment zone. Next, the procedure for obtaining such refinement is explained. *Note:* The case of interfaces is more problematic because on the one hand interfaces are generally curved and on the other hand unilateral contact conditions are often defined on the interfaces. However, to correctly solve the problem of contact between 2 curved surfaces, it is imperative that the surfaces be represented by finite elements of order 2. A thesis on curved interfaces represented by level sets of order 2 is in progress. However, this chapter will not deal with the case of mesh refinement for interfaces. Definition of the size of a mesh ------------------------------------ The size of a mesh (or even the diameter of a mesh) is defined as the value of the length of the largest edge of the mesh. This size can be easily calculated in Salomé's module SMESH (Control → Element Diameter 2D or 3D). .. _RefNumPara__30568_534301441: Criteria for mesh sizes ------------------------------------ The accuracy of the calculation of the energy release rate (:math:`G`) and the stress intensity factors (:math:`K`) is directly linked to the size of the elements close to the crack bottom. It is necessary to distinguish 2 lengths: * the length of the elements in the plane orthogonal to the crack bottom in 3D, i.e. the complete plane in 2D; * the length of the elements along the crack bottom (in 3D only). In the plane, we consider that the area of interest is a disk around the bottom of the crack with radius :math:`R`] and [:ref:`8 <8>`]). This refined block can also be obtained by exploiting the local size maps of the mesh algorithms (Netgen, Blsurf). The second approach (recommended) consists in creating an adequate mesh by successive refinements of an initial free mesh considered to be coarse. The refinement criterion (or error criterion) is based on the distance to the crack bottom. An example of using this approach by adapting a mesh with the Homard software is presented in [:ref:`9 <9>`]. Its implementation is now very easy, thanks to the macro command RAFF_XFEM, which creates the error field directly from the list of cracks. This error field must then be given as input to the macro command MACR_ADAP_MAIL (see an example of mesh adaptation for X- FEM with the test case sslp317a, b, c). The following paragraph details this 2nd approach. Methodology for mesh refinement with Lobster and level sets ----------------------------------------------------------------- This technique does not require geometry (CAO). It only uses the initial healthy mesh. It uses the Lobard mesh refinement software, which can be called from *Code_Aster* by the command MACR_ADAP_MAIL. Determining the number of lobster calls ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Each time Lobster is called, the stitches that will be cut will have their size divided by a factor of 2. It is therefore easy to know the number of times to call Lobster in succession. Knowing the initial size of the cells in the zone of interest :math:`{h}_{0}` and the size of the cells that we want to obtain in the end :math:`{h}_{c}` (target size), we must call Lobster at least :math:`\text{nb\_raff}` times, with :math:`\text{nb\_raff}\mathrm{\ge }\frac{\mathrm{ln}({h}_{0})\mathrm{-}\mathrm{ln}({h}_{c})}{\mathrm{ln}(2)}`. It is recommended to take :math:`\text{nb\_raff}\mathrm{=}E(n)+1`, with :math:`n\mathrm{=}\frac{\mathrm{ln}({h}_{0})\mathrm{-}\mathrm{ln}({h}_{c})}{\mathrm{ln}(2)}`. The mesh size after refinement will therefore be :math:`h\mathrm{=}\frac{{h}_{0}}{{2}^{\text{nb\_raff}}}`. Note that very often, because of integer division, the final size is not exactly the desired target size, but we know that :math:`\frac{{h}_{c}}{2}\mathrm{\le }h\mathrm{\le }{h}_{c}`. Now that the number of lobster calls has been determined, it is necessary to know for each lobster call how many meshes, and which ones, must be cut (lobster control). Lobster control (error indicator and refinement criterion) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lobster must refine only the meshes closest to the bottom of the crack. To do this, all you have to do is provide it with a field representing the distance to the bottom of the crack at each node of the mesh. The knots whose distance is the smallest make it possible to determine which meshes to be refined in priority. The question is then the following: how many stitches should you cut each time you call Lobster? We can either impose: * a percentage of meshes to be cut, * or choose to cut all the meshes whose distance from the bottom is less than a limit value (threshold). This limit value may be the value of the radius of the post-treatment zone (noted :math:`R` in § :ref:`6.3 `). Criterion with percentage of elements: the difficulty is to find the right percentages that may depend on the position of the background (length of the background). In practice, this poses a problem for propagation. Although simple, this criterion is not recommended because it results in meshes that are not very optimal in terms of number of nodes (see illustration on the sslp317a test case). Criterion with threshold: very large initial meshes can be a problem. Thus no mesh is cut initially, because no mesh is completely at a distance less than threshold :math:`R`. It is then necessary to force the algorithm to cut and use a variable threshold. The threshold for refinement level :math:`k` is then written :math:`\mathit{max}(R,\frac{{h}_{0}}{{2}^{k}})`. *Note:* Lobster only allows you to cut meshes whose value in the "error" field is greater than the threshold. It was therefore necessary to create an error field such that the cells closest to the bottom of the crack had the greatest error. For this, the error is not the distance :math:`d` to the bottom of the crack, but the opposite of the distance to the bottom, which is :math:`e\mathrm{=}\mathrm{-}d`. So condition :math:`d<\mathit{max}(R,\frac{{h}_{0}}{{2}^{k}})` becomes :math:`e\mathrm{=}\mathrm{-}d>\mathrm{-}\mathit{max}(R,\frac{{h}_{0}}{{2}^{k}})`. So the threshold to be defined in Lobster (CRIT_RAFF_ABS) is in fact equal to :math:`\mathrm{-}\mathit{max}(R,\frac{{h}_{0}}{{2}^{k}})`. You must also use the keyword USAGE_CMP = 'RELATIF' (see illustration on the sslp317b test case). On certain meshes where the cells are slightly elongated, the use of a criterion with a variable threshold as mentioned above does not work and no mesh is cut initially. A new error indicator per zone (binary indicator) has recently been implemented (RAFF_XFEM/TYPE =' ZONE '). The principle of this indicator is to have 1 value in the area to be refined (zone of interest) and 0 everywhere else. The zone of interest is in 2D a disk around the bottom of the crack and in 3d a torus around the bottom of the crack, characterized by the data of a radius :math:`R`. This indicator allows you to always refine at least one mesh, and is easier to use than the previous indicator (see [:external:ref:`U7.03.51 `]). **The use of this new indicator and the associated methodology are recommended**. It is used exclusively with an absolute value criterion in MAC_ADAP_MAIL (CRIT_RAFF_ABS set to 0.5). With this indicator, it is preferable to make a call to Lobster in addition to :math:`\text{nb\_raff}`, with DIAM_MIN set to :math:`{h}_{c}`. For an illustration of this methodology, we can refer to the test cases sslv155 [b, c], sslv110f, sslp317c. A complete summary of this methodology is given in the next paragraph. Summary of recommended mesh refinement methodology -------------------------------------------------------- The recommended methodology can be summarized by the following algorithm: * estimation of the size of the initial cells in the area of interest (it is preferable that the sizes in this area are homogeneous) → :math:`{h}_{0}` * data of the target cell size after refining the area of interest: :math:`{h}_{c}` (between :math:`a\mathrm{/}10` and :math:`a\mathrm{/}40`) * calculation of the minimum number of refinements: :math:`\text{nb\_raff}\mathrm{=}E(n)+1`, with :math:`n\mathrm{=}\frac{\mathrm{ln}({h}_{0})\mathrm{-}\mathrm{ln}({h}_{c})}{\mathrm{ln}(2)}` * calculation of the mesh size after refinement: :math:`h\mathrm{=}\frac{{h}_{0}}{{2}^{\text{nb\_raff}}}` * calculation of the radius of the area of interest: :math:`R\mathrm{=}5h` * true number of iterations of the adaptation loop: :math:`\text{nb\_iter}\mathrm{=}\text{nb\_raff}+1`. * adaptation loop - definition of the crack/interface on the current mesh - calculation of the indicator by zone (RAFF_XFEM/TYPE =' ZONE ', RAYON = :math:`R`). - Call Lobster with CRIT_RAFF_ABS = 0.5 and DIAM_MIN = :math:`{h}_{c}`. *Note:* In the case of meshes whose cell size is not uniform in the area of interest, we can use the same algorithm by noting :math:`{h}_{0}` the largest size of the cells in this area. But the :math:`h\mathrm{=}\frac{{h}_{0}}{{2}^{\text{nb\_raff}}}` formula no longer applies. So the mesh size after refinement is unknown. So we can't choose :math:`R\mathrm{=}5h` because :math:`h` is an unknown. We then choose :math:`R\mathrm{=}5{h}_{c}` although this choice is not optimal. It is then recommended after the refinement phase to determine :math:`h` "by hand", then to de-refine outside the zone of interest defined by :math:`R\mathrm{=}5h`. This being a bit tricky to implement, a macro command is under consideration.