4. Tips and best practice#
4.1. On the initial mesh#
Regardless of any desire to perform mesh adaptation, we recommend checking the initial mesh with the MACR_INFO_MAIL [bib4] command. This command makes it possible to carry out the following checks at low cost:
check the correspondence of the mesh with the initial geometry (in mass, dimension, area and volume);
list GROUP_MA and GROUP_NO, for a good modeling of boundary conditions;
diagnose possible problems (symmetrization or connectedness, draft elements, poor consideration of boundary conditions, interpenetration of meshes);
evaluate the quality of the mesh by the following criterion q (evaluated mesh by mesh):
for triangles: \(q=\mathrm{\alpha }\times \frac{h}{r}\), where h is the length of the longest side, r is the radius of the inscribed circle and has a normalization coefficient such that q is equal to 1 for an equilateral triangle,
for quadrangles: \(q=\alpha \times \frac{h\times k}{S}\), where h is the maximum length of the sides and diagonals, k the root mean square of the side lengths, S the minimum of the areas of the four internal triangles and has a normalization coefficient such that q is equal to 1 for a square,
for tetrahedra: \(q=\alpha \times \frac{h}{r}\), where h is the length of the longest side, r is the radius of the inscribed sphere and has a normalization coefficient such that q is 1 for an equilateral tetrahedron,
for hexahedra: \(q=\alpha \times (\text{qualité du pire des 24 tétraèdres inscrits})\), where a is a normalization coefficient such that q is 1 for a cube.
Advice: An empirical criterion can be proposed: for example, at least 50% of the meshes with a quality < 1.5, at least 90% of the meshes with a quality < 2.0, no steps with a quality above 10.
4.2. On HOMARD#
After dividing the meshes, the mesh groups are updated; on the other hand, the node groups are left unchanged. It is necessary to impose boundary conditions on groups of cells and not groups of nodes; it is therefore necessary to proscribe (but it is a rule of common sense) the direct use of mesh numbers or nodes during assignments in order to prefer the concept of group of elements.
We recall that the adaptation by HOMARD accepts all types of elements, of degree 1 or 2, in a conformal mesh in related or non-related areas, of the same dimension or not except pyramids and pentahedra (for uniform refinement). On the other hand, for mesh analysis, HOMARD manages pentahedra.
4.3. On the adaptation strategy#
The « thermo-mechanical operators/MACR_ADAP_MAIL option “RAFFINEMENT_UNIFORME” » sequence (i.e. without error indicator) makes it possible to converge a mesh cleanly, automatically and easily. However, you must be careful with the number of degrees of freedom generated! This is an easy, fast and robust solution, but quickly extremely expensive (rather to be reserved for evaluating if there are major discretization errors or for small studies).
The « thermo-mechanical operators/MACR_ADAP_MAIL option “RAFFINEMENT” » sequence (i.e. with a field controlling the adaptation) makes it possible to converge the mesh in the most optimal way possible (taking into account the tools available). This method requires more effort than the previous one but the number of degrees of freedom generated is proportionally much lower.
The « thermo-mechanical operators/MACR_ADAP_MAIL » sequence can be performed effectively in a Python loop (« for » loop), possibly with an output test (« while » loop).
The quality of the meshes is minimally affected by the refinement/de-refinement process. Given the choices made in HOMARD®, it can even improve in 3D!
MACR_ADAP_MAIL does not have a regularization process; so a bad initial mesh will probably produce a bad adapted mesh!
Linear elements are not recommended in mechanics. Rather, the best practice is: P1 lumped in thermal (PLAN_DIAG, AXIS_DIAG,, 3D_ DIAG) and P2 (possibly under-integrated) in mechanics, [bib14].
The choice of the type of finite elements takes precedence over the quality of the meshes on which the elements are based (see example of the beam below).
4.4. On classical error indicators#
Choice of the mechanical error indicator: the user has the choice between \(\mathrm{ZZ1}\) (first version of the Zhu-Zienkiewicz indicator), \(\mathrm{ZZ2}\) (second version of the Zhu-Zienkiewicz indicator), and the residual indicator. The first two have a fairly small field of application (linear 2D for \(\mathrm{ZZ1}\) and \(\mathrm{ZZ2}\), a single type of finite element in the whole mesh for \(\mathrm{ZZ2}\)): for « standard » use, the residual indicator will be preferred.
The type of indicator and how it is normalized can have an impact on the appropriate mesh. For example, in mechanics, \({e}_{{E}_{\text{REL}}}=\text{100}\times \frac{{e}_{E}}{\sqrt{{e}_{E}^{2}+{\parallel {\sigma }_{h}\parallel }_{E}^{2}}}\). This way of normalizing can be dangerous: if there are areas where the constraint standard is low, the error will be around 100% in this zone; if there are areas where the constraint standard is very high (singularities for example), the error will be low in this zone. This is obviously not the desired result. It is therefore best to use the absolute indicator, unless you know exactly what you are doing.
For residue-type indicators, it is also possible to « juggle » the components of the thermal indicator and boundary conditions, « fictional » or not, to guide the construction of a refined or unrefined mesh by zones.
In case of the presence of singularities, it is advisable to select the number of elements on which the refinement is based on a fraction of elements to be refined “CRIT_RAFF_PE” (and not by the quantum of elements presenting an error greater than a fraction of the total error “CRIT_RAFF_REL”). Indeed, in the case of a singularity, using “CRIT_RAFF_REL”, after one or two iterations of adaptation, only the elements affecting the singularity will be refined. By using “CRIT_RAFF_PE”, other areas can continue to be refined. Finally, the criterion “CRIT_RAFF_ABS” (choice by fixed error barrier) should be reserved for cases where the user is very familiar with the problem under consideration.
As a « simple post-treatment » of the thermo-mechanical problem, the indicator unfortunately cannot provide a more reliable diagnosis in areas where the resolution of the initial problem is not possible. It is therefore preferable to start an adaptation process, with a mesh that is already a bit refined « by hand ».
In thermo-mechanics, different mesh adaptation strategies are available to the user:
adapt the mesh according to a thermal criterion only,
adapt the mesh according to a mechanical criterion only,
adapt jointly or separately (i.e. with one or two adaptation loops); in other words, link or couple the first two strategies.
Good practice during such a thermo-mechanical calculation leads to the use of two meshes and to the interpolation of the thermal field \({P}_{1}\) onto the mechanical mesh \({P}_{2}\) (via the operator PROJ_CHAMP). If you want to work with only one mesh, you can decline one of the strategies via option MAJ_CHAM of MACR_ADAP_MAIL. This makes it possible, while adapting the mesh according to a criterion, to update the complementary field on the new adapted mesh.
In thermal, to perform a mesh adaptation based on the ERTH_ELEM indicator during a transition, do not forget to start the calculation of the next time step with the old EVOL_THER updated on the new mesh.