AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |
Back to Blog
Gmsh structured 2d mesh2/20/2024 My mesh is OK except for a strange criss crossing in the structured part. I went through the tutorials and tried to implement a structured mesh within an unstructured one just like you have. This post helped me a lot since I never heard about gmsh before. Transfinite Line = 10 Using Progression 0.1 Gmsh project created on Tue Nov 4 19:03:02 2014 Can you point out what change I must do to get the O gird as yours (A completely O gird is my requirement without any triangle elements!) I have been unsuccessful so far.Īttaching my. I took help of t6.geo tutorial of Gmsh documentation. I have been trying to obtain a O grid around a cyclindrical configuration quite similar to yours. The generated mesh can be visualized in Python with pyvista.Thanks for the blog post. generate_mesh ( dim = 2, algorithm = 6 ) # Convert cell sets to material cell_data = field_data = # Export the mesh for post-processing mesh. add_physical (, "BOUND" ) # Remove duplicate entities geo. add_polygon ( bound_bot_pts, mesh_size = lc ) # Define materials geo. add_polygon ( bound_top_pts, mesh_size = lc ) bound_bot = geo. As you can see in the figure below, the 2D mesh is alternated the way I want it to be: However, when I mesh it in 3D, the elements get converted to diagonal elements, as you can see in the figure below. add_polygon ( bound_right_pts, mesh_size = lc ) bound_top = geo. add_polygon ( basaq_right_pts, mesh_size = 2.0 * lc ) bound_right = geo. add_polygon ( uppaq_right_pts, mesh_size = 2.0 * lc ) basaq_right = geo. add_polygon ( capro_bot_right_pts, mesh_size = 0.75 * lc ) uppaq_right = geo. add_polygon ( capro_top_right_pts, mesh_size = 0.75 * lc ) capro_bot_right = geo. add_polygon ( cenaq_right_pts, mesh_size = 0.75 * lc ) capro_top_right = geo. add_polygon ( basaq_left_pts, mesh_size = 2.0 * lc ) cenaq_right = geo. add_polygon ( uppaq_left_pts, mesh_size = 2.0 * lc ) basaq_left = geo. add_polygon ( capro_bot_left_pts, mesh_size = 0.2 * lc ) uppaq_left = geo. add_polygon ( capro_top_left_pts, mesh_size = 0.2 * lc ) capro_bot_left = geo. add_polygon ( cenaq_left_pts, mesh_size = 0.1 * lc ) capro_top_left = geo. add_polygon ( fault_pts, mesh_size = 0.1 * lc ) cenaq_left = geo. Geometry () as geo : # Define polygons fault = geo. This is because Gmsh keeps the first node defined in the geometry in case it detects duplicated nodes. Note that layers are defined such that their characteristic lengths are increasing. To refine the mesh in the injection zone, the characteristic length of each layer entity is increased the farther we get from the injection point. Once all the points have been created, we can now generate the geometry, assign rock types/materials as Gmsh physical properties, and generate the mesh. Similarly to the fault entity, boundary entities are segmented to ensure conformity of the final mesh.īound_right_pts =, ,, ,, ,, , ] bound_top_pts =, ,, ,, ,, ,, ] bound_bot_pts =, ,, ,, ,, ,, ] Thus, physical boundary elements must be defined at the top, right and bottom sides of the model. In this sample problem, a no-flow boundary condition is imposed on the left side of the model (default in TOUGH), and Dirichlet boundary conditions are imposed elsewhere. Likewise, we also define the aquifer located at the right side of the fault.Ĭenaq_right_pts =, ,, , ] capro_top_right_pts =, ,, , ] capro_bot_right_pts =, ,, , ] uppaq_right_pts =, ,, , ] basaq_right_pts =, ,, , ]
0 Comments
Read More
Leave a Reply. |