# Axis specific mesh control

**URL:** <https://prepomax.discourse.group/t/axis-specific-mesh-control/1970>\
**Category:** General Questions\
**Created:** [August 29, 2024, 12:36am UTC](https://prepomax.discourse.group/t/axis-specific-mesh-control/1970 "2024-08-29T00:36:17Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![bpatt](https://avatars.discourse-cdn.com/v4/letter/b/7bcc69/32.png) [@bpatt](https://prepomax.discourse.group/u/bpatt)\
**Post date:** [August 29, 2024, 12:36am UTC](https://prepomax.discourse.group/t/axis-specific-mesh-control/1970/1 "2024-08-29T00:36:17Z")

</div>

Hi,

Is there a way to force “thickness” element density or something like mesh control in the X/Y/Z axis separately? When I change the elements per edge that restriction is only for the edge and isn’t propagated throughout the thickness.

![image](https://global.discourse-cdn.com/free1/uploads/prepomax/original/2X/0/090d158bcc7eb1ea092b596f413b82a98c00de10.png)

These are long thin parts so if I make the mesh size to get 3-4 elements in the Z axis, the X-Y becomes a very large amount of elements at that size.

---

<div class="post-metadata">

**Author:** ![synt](https://yyz2.discourse-cdn.com/free1/user_avatar/prepomax.discourse.group/synt/32/4658_2.png) [@synt](https://prepomax.discourse.group/u/synt)\
**Post date:** [August 29, 2024, 4:52am UTC](https://prepomax.discourse.group/t/axis-specific-mesh-control/1970/2 "2024-08-29T04:52:58Z")

</div>

hi, i tried to refine at the top and bottom face but it seems not possible with current version of Netgen or Gmsh.

 ![2024-08-29 11_26_00-](https://global.discourse-cdn.com/free1/uploads/prepomax/original/2X/e/ef096692b303e1d338b4e6bcceac1cfe36257b9f.png)

 ![2024-08-29 11_27_11-](https://global.discourse-cdn.com/free1/uploads/prepomax/original/2X/5/583a32b92599ab4e1c973ad7d7abc5bbb0034133.png)

by doing manual partition can be achieved, however extrusion based and tie constraint or tied contact is more effective for models of flat plate like parts.

 ![2024-08-29 11_30_33-](https://global.discourse-cdn.com/free1/uploads/prepomax/original/2X/3/322145bea73e23fb32af2f09d231c1439bc17de3.png)

 ![2024-08-29 11_31_13-](https://global.discourse-cdn.com/free1/uploads/prepomax/original/2X/9/917fd5694b43c13c9c9f7ac99a04a8e0715d663e.png)

 ![2024-08-29 11_51_52-](https://global.discourse-cdn.com/free1/uploads/prepomax/original/2X/f/f3b10d0c775c00ff5206019a47b4eea2fbd2d237.png)

---

<div class="post-metadata">

**Author:** ![FEAnalyst](https://yyz2.discourse-cdn.com/free1/user_avatar/prepomax.discourse.group/feanalyst/32/688_2.png) [@FEAnalyst](https://prepomax.discourse.group/u/FEAnalyst)\
**Post date:** [August 29, 2024, 7:00am UTC](https://prepomax.discourse.group/t/axis-specific-mesh-control/1970/3 "2024-08-29T07:00:26Z")

</div>

If your parts are simple enough, it’s better to mesh them with hexahedral elements. Then it’s much easier to control the number of elements in the thickness direction (especially if you create such a mesh by extrusion - there you can specify the number of elements in that direction explicitly). Hexahedral meshes are recommended whenever possible.

---

<div class="post-metadata">

**Author:** ![bpatt](https://avatars.discourse-cdn.com/v4/letter/b/7bcc69/32.png) [@bpatt](https://prepomax.discourse.group/u/bpatt)\
**Post date:** [August 29, 2024, 3:50pm UTC](https://prepomax.discourse.group/t/axis-specific-mesh-control/1970/4 "2024-08-29T15:50:36Z")

</div>

I have no frame of reference for what a simple part is. To me it seems simple compare to other things I want to try but likely isn’t compared to some.

 ![image](https://global.discourse-cdn.com/free1/uploads/prepomax/original/2X/d/d34003f8f6656ed50088be839cc1e91db00723a4.jpeg)

How does one force the type of element shape? Is this a different type of mesh setup?

---

<div class="post-metadata">

**Author:** ![synt](https://yyz2.discourse-cdn.com/free1/user_avatar/prepomax.discourse.group/synt/32/4658_2.png) [@synt](https://prepomax.discourse.group/u/synt)\
**Post date:** [August 29, 2024, 4:20pm UTC](https://prepomax.discourse.group/t/axis-specific-mesh-control/1970/5 "2024-08-29T16:20:27Z")

</div>

mesh setup can be similar,

 ![2024-08-29 23_12_37-](https://global.discourse-cdn.com/free1/uploads/prepomax/original/2X/b/bba5073e4a9778a336eee534f47bff4d2fcf74f5.png)

 ![2024-08-29 23_13_15-Edit Mesh Setup Item_ Meshing_Parameters-1](https://global.discourse-cdn.com/free1/uploads/prepomax/original/2X/6/6636efcd9e09a00cb15828e98d579f26f23b520d.png)

 ![2024-08-29 23_13_37-](https://global.discourse-cdn.com/free1/uploads/prepomax/original/2X/0/06595edbd07f9e893b0cfc274287fe3cf47c80a5.png)

 ![2024-08-29 23_14_06-Edit Mesh Setup Item_ Extrude_Mesh-1](https://global.discourse-cdn.com/free1/uploads/prepomax/original/2X/6/64281a8a71ce7c1fbb5a0da86cc4230acb493304.png)

 ![2024-08-29 23_14_28-](https://global.discourse-cdn.com/free1/uploads/prepomax/original/2X/5/5f4b28ce40c40cc25fc6e0340b65a9fe44715213.png)

 ![2024-08-29 23_14_42-Edit Mesh Setup Item_ Tetrahedral_Gmsh-1](https://global.discourse-cdn.com/free1/uploads/prepomax/original/2X/7/7c2b9ecb4deff81a2cd48318034b9b49ee809e56.png)

each part is separated, i.e no compound assigned then connect them with tie constraint or tied contact.

 ![2024-08-29 23_15_15-](https://global.discourse-cdn.com/free1/uploads/prepomax/original/2X/3/3a31b0bfb2452335bac5f5f9fdaa193dc33cd4cf.png)

---

<div class="post-metadata">

**Author:** ![FEAnalyst](https://yyz2.discourse-cdn.com/free1/user_avatar/prepomax.discourse.group/feanalyst/32/688_2.png) [@FEAnalyst](https://prepomax.discourse.group/u/FEAnalyst)\
**Post date:** [August 29, 2024, 4:30pm UTC](https://prepomax.discourse.group/t/axis-specific-mesh-control/1970/6 "2024-08-29T16:30:27Z")

</div>

Simple in terms of being able to apply hexahedral meshing that has certain rules: [Summary of Gmsh hex meshing rules](https://prepomax.discourse.group/t/summary-of-gmsh-hex-meshing-rules/1223)

Basically, if it can be created by simple extrusion or revolution or broken into segments with 5 or 6 faces having 3 or 4 edges each then it can be meshed with hexahedrons. Of course, you can use mixed meshes too.

---

<div class="post-metadata">

**Author:** ![synt](https://yyz2.discourse-cdn.com/free1/user_avatar/prepomax.discourse.group/synt/32/4658_2.png) [@synt](https://prepomax.discourse.group/u/synt)\
**Post date:** [August 29, 2024, 4:46pm UTC](https://prepomax.discourse.group/t/axis-specific-mesh-control/1970/7 "2024-08-29T16:46:31Z")

</div>

alternate methods without partition, but it’s not work in compound part.

 ![2024-08-29 23_33_38-](https://global.discourse-cdn.com/free1/uploads/prepomax/original/2X/5/58c86a02631c2cee7e0295c3ff26c6d6041363f1.png)

 ![2024-08-29 23_34_05-](https://global.discourse-cdn.com/free1/uploads/prepomax/original/2X/e/e9a6886c073f9e03e6ca3961591086872d55b47f.png)

added another examples,

 ![2024-08-29 23_56_26-](https://global.discourse-cdn.com/free1/uploads/prepomax/original/2X/b/b27f8ae337669942b9ce83c4a5848ad303fa2974.png)

 ![2024-08-31 23_28_04-](https://global.discourse-cdn.com/free1/uploads/prepomax/original/2X/8/8cf7425e16b1d0a56eb47319674db807ab1559c4.png)

---

<div class="post-metadata">

**Author:** ![bpatt](https://avatars.discourse-cdn.com/v4/letter/b/7bcc69/32.png) [@bpatt](https://prepomax.discourse.group/u/bpatt)\
**Post date:** [August 29, 2024, 8:34pm UTC](https://prepomax.discourse.group/t/axis-specific-mesh-control/1970/8 "2024-08-29T20:34:26Z")

</div>

If I do a extrude mesh, I get some odd results. Initial temp is 25C with back surface constrained to 25C with input heat flux on top surface. Don’t understand why there would be a lower than constrained temperature at those nodes?

 ![image](https://global.discourse-cdn.com/free1/uploads/prepomax/original/2X/7/7db3640c6dc1dd933db4a3020f8fc47d4e3a6d9d.jpeg)

 ![image](https://global.discourse-cdn.com/free1/uploads/prepomax/original/2X/6/6edf4b917882386f2d55cf59c995448cfd3a85c8.png)

it improves with an increased mesh density though.

 ![image](https://global.discourse-cdn.com/free1/uploads/prepomax/original/2X/0/00c1a98b54026d8002c9e4170a9d06e69dab86c9.jpeg)

 ![image](https://global.discourse-cdn.com/free1/uploads/prepomax/original/2X/7/74867b657074185a55a16b0661f0dc50ac3f0acd.jpeg)

---

<div class="post-metadata">

**Author:** ![FEAnalyst](https://yyz2.discourse-cdn.com/free1/user_avatar/prepomax.discourse.group/feanalyst/32/688_2.png) [@FEAnalyst](https://prepomax.discourse.group/u/FEAnalyst)\
**Post date:** [August 29, 2024, 8:41pm UTC](https://prepomax.discourse.group/t/axis-specific-mesh-control/1970/9 "2024-08-29T20:41:47Z")

</div>

Enable recombination if you are using Extruded Mesh to create hexahedrons instead of wedges. This will create a better mesh.

---

<div class="post-metadata">

**Author:** ![synt](https://yyz2.discourse-cdn.com/free1/user_avatar/prepomax.discourse.group/synt/32/4658_2.png) [@synt](https://prepomax.discourse.group/u/synt)\
**Post date:** [September 2, 2024, 10:05pm UTC](https://prepomax.discourse.group/t/axis-specific-mesh-control/1970/10 "2024-09-02T22:05:32Z")

</div>

i checked again and i can be wrong, refinement at edge in thickness direction did not generate layer uniformly. Currently, only by manual partitioin or extrusion method is possible.

 ![2024-09-03 05_01_13-](https://global.discourse-cdn.com/free1/uploads/prepomax/original/2X/8/838fced76fe1a4cf3599f26dccf249d78c0724e5.png)

---

<div class="post-metadata">

**Author:** ![Matej](https://avatars.discourse-cdn.com/v4/letter/m/a698b9/32.png) [@Matej](https://prepomax.discourse.group/u/Matej)\
**Post date:** [September 8, 2024, 5:48pm UTC](https://prepomax.discourse.group/t/axis-specific-mesh-control/1970/11 "2024-09-08T17:48:25Z")

</div>

I think I remember there is an option to propagate element size inwards. I turned it off to create meshes where the element size can change internally. I can check if I can make this parameter available to the user.
