Aspect ratio of adapted mesh

Hi all, I have a question regarding the quality of my adapted mesh. The model I am solving has three unknowns (u1, u2 and phi), two of which (u1 and u2) exhibit boundary layers along two of the boundaries. At each timestep, my mesh is adapted to all three solutions. Below are some plots at a late timestep when the solution has settled into a steady-state. First we have u1:

I have zoomed into the boundary layer so that the structure is clearer. Next we have u2 and phi:

Phi behaves such that it varies linearly along the horizontal axis and varies only slightly along y (variation along y probably not visible when zoomed out). u2 behaves in almost exactly the same way as u1, except u2 increases towards the boundaries, while u1 decreases (hence why I have not included zoomed versions of u2). Finally, I show the mesh after it has adapted to u1, u2 and phi:

It is clear that the aspect ratio of the mesh is quite poor i.e. near the boundaries where the boundary layers exist, they are very elongated along the vertical axis and squashed along the horizontal axis. Clearly this is due to the fact that the solutions (u1 and u2) to which the mesh is adapted vary rapidly along x and not very much along y. My question is: is such an aspect ratio acceptable? Will the solution be negatively affected by my mesh being this way? If it is not acceptable, how can I fix it? I have already tried using the command ‘thetamax’ but it did not have any effect upon the adaptation (maybe I was using it incorrectly).

Many thanks in advance!

thetamax is the wrong command for what you want to control here (that controls how adaptation handles “curved” borders). Try setting anisomax = 1.0 to limit anisotropy.

Hi Chris, I’ll give this a try soon, thanks! I’ll let you know what happens. I should note that my mesh adaptation command currently looks like this: dom4 = adaptmesh(dom4, u1, u2, phi, err=Erradapt, nbvx=500000,hmin=1e-10, hmax=0.001, ratio=4, anisomax = 1.0). The Erradapt is halfed at each adaptation.

Hi Chris, a problem with setting anisomax=1 is that the number of vertices increases quite dramatically, so I’m not certain that this is a viable solution. Do you know if there’s a way to fix the number of vertices along a particular boundary? Or is there a way to set a minimum value for the number of vertices along a boundary?

Yes, that is expected. If you want to properly resolve small features, it will take a fine mesh. hmin and hmax control this, try experimenting with larger values.

Okay, I shall experiment thoroughly.