.. _Auto_Meshing_Internal_Flow: Automated Meshing for Internal Flow ==================================== This tutorial shows how to create a mesh for internal flow using the :ref:`automated meshing` process. Geometry --------- As shown in :numref:`sphere_in_wind_tunnel_geometry`, the geometry is a wind tunnel enclosing a sphere that is supported by four cylindrical struts. The `corresponding CSM file `_ is provided, so the readers can easily reconstruct the geometry on their local machines. Several details are worth emphasizing in the CSM file: 1. For internal flow, a single solid body representing the fluid must be provided to the automated meshing process. To do this, once the wind tunnel (box) and the sphere with struts are constructed, the next step is to :code:`subtract` the sphere and struts from the wind tunnel. 2. :numref:`sphere_in_wind_tunnel_geometry` shows the :code:`faceName` and :code:`groupName` attributes on the faces of the wind tunnel. In general faces with the same :code:`faceName` will be treated as the same surface patch for assigning surface (maxEdgeLength) and volume (firstLayerThickness) mesh attributes. Conversely, the user can set different surface and volume mesh attributes for faces with a different :code:`faceName`. Faces with the same :code:`groupName` will be considered as the same boundary when exporting the CGNS file. .. _sphere_in_wind_tunnel_geometry: .. figure:: Figures/geometry.svg :align: center Sphere in wind tunnel, geometry with face attributes. :code:`sideNegY` is hidden to show the interior of the wind tunnel. Surface Mesh ------------- The surfaceMesh.json is provided as follows: .. literalinclude:: Files/surfaceMesh.json :language: JSON Noteworthy details in this surfaceMesh.json: 1. The global :code:`maxEdgeLength` governs the mesh size on all faces. 2. In subsection :code:`faces`, users can define local :code:`maxEdgeLength` for the sphere and struts, overwriting the global :code:`maxEdgeLength`. Volume Mesh ------------ The volumeMesh.json is provided as follows: .. literalinclude:: Files/volumeMesh.json :language: JSON Regarding the volumeMesh.json above, please note that: 1. :code:`farfield` is set as :code:`user-defined`, indicating that the user already provided the "farfield" geometry, which is the wind tunnel box in this example. 2. In the :code:`faces` subsection, the keys should match the attribute :code:`faceName` in the CSM file. - By default, all :code:`faces` are treated as :code:`aniso` and the global :code:`firstLayerThickness` is applied. - The :code:`floor` is set as :code:`aniso`, so the local :code:`firstLayerThickness` 1e-5 overwrites the global value of 1e-6. The first layer thicknesses provided here are just for illustration. The users need to adjust these values according to the target :math:`y^+` in their simulations. - The :code:`ceiling` is set as :code:`none`, hence the anisotropic layers won't be grown from the ceiling. Meanwhile, the surface mesh on the ceiling remains unaltered when generating the volume mesh. - The faces adjacent to the floor :code:`adjacent2floor` are set as :code:`projectAnisoSpacing`. The surface mesh on those faces is updated when populating the volume mesh. As shown in :numref:`sphere_in_wind_tunnel_mesh`, the "spacing" of anisotropic layers grown from the floor are "projected" onto the faces adjacent to the floor. .. _sphere_in_wind_tunnel_mesh: .. figure:: Figures/mesh.png :width: 75% :align: center Sphere in wind tunnel, populated volume mesh.