I'm trying to solve Stokes equation in the following domain
The border of the inner half circle where I define a certain boundary condition different from zero and where I am interested in obtaining a smooth solution for the pressure. To obtain a smooth result I need to use a fairly small grid on the centre of the domain an my plan was to use position-dependent grid to speed up the computation.
While checking different functions to use for the MeshRefinementFunction
I found the following:
<< NDSolve`FEM`
Table[
z0 = 0;
r2 =
RegionIntersection[
RegionDifference[
Cuboid[{-L, -L}, {L, L}],
RegionUnion[Disk[{0, -z0}, 1], Disk[{0, z0}, 1]]],
Disk[{0, 0}, L]];
mesh =
ToElementMesh[r2,
MeshRefinementFunction ->
Function[{vertices, area},
area > 0.00125 (1 + Norm[Abs[Mean[vertices]] - {0, 0}])^2]];
Show[mesh["Wireframe"], PlotRange -> {{0, 2}, {-1, 1}}],
{L, 10., 20, 5}]
See how the resolution of the inner circle is lost. Something similar happened here
However, if I define the MaxCellMeasure
the problem disappears
mesh = ToElementMesh[ r2, "MaxCellMeasure" -> .005]
The problem seems to be the ratio between system size and grid resolution since the same happens in the first case if I decrease the refinement constant for a given system size.
Using MaxBoundaryCellMeasure
is not a solution btw, since it introduces other problems of its own. Using such a small grid uniformly makes the computation very time consuming and I don't really need such resolution on the outer half circle.
So, is this is a bug? Is there an easy way to avoid this?