Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stokes convergence in 3D needs lots of oversampling, is generally wonky #45

Open
inducer opened this issue Dec 13, 2020 · 8 comments
Open

Comments

@inducer
Copy link
Owner

inducer commented Dec 13, 2020

Cf. some initial discussion in #32.

cc @alexfikl

@alexfikl
Copy link
Collaborator

I think this is probably what I was seeing in #11 too. I haven't seen any effect of the target-specific machinery since, so it seems it was just an instance of playing around with too many parameters at once.

I would recommend closing that in favor of this as a tracking issue.

@inducer
Copy link
Owner Author

inducer commented Dec 13, 2020

Thanks for keeping track of it. I've closed that for now.

@inducer
Copy link
Owner Author

inducer commented Aug 5, 2021

Looking at the density picture (x4 refinement) from #32 (comment):
image

I suspect the geometry derivatives (normal etc.) are insufficiently accurate.

@alexfikl
Copy link
Collaborator

alexfikl commented Aug 5, 2021

Screenshot_20210805_144118

I looked at the normal errors on the same mesh and it seems like they sort of match the density errors. A few details on what's in that picture:

  • It shows a pointwise absolute error of norm(normal - ref_normal),
  • The reference normal is just set to be ref_normal = discr.nodes(),
  • The nodes and normal are computed on the STAGE2 discretization (same as STAGE1 here, since no refinment on the sphere).

Some caveats:

  • the normals the oversampled grid would see are further interpolated from these to the quadrature grid on QUAD_STAGE2,
  • the visualizer interpolates everything to the warp and blend nodes.

@inducer
Copy link
Owner Author

inducer commented Aug 5, 2021

the normals the oversampled grid would see are further interpolated from these to the quadrature grid on QUAD_STAGE2,

When computing the oversampled grid, we could (at least for this test) provide it with better geometry information.

@alexfikl
Copy link
Collaborator

alexfikl commented Aug 8, 2021

When computing the oversampled grid, we could (at least for this test) provide it with better geometry information.

I monkeypatched the normal to just return sym.nodes() for this case and nothing seemed to change for the density or convergence when using 4x oversampling. The same first-order derivatives of the geometry would also go into sym.area_element, but those aren't easy to replace with some analytical solution.

It might actually be something silly: all those tests run with target_order = qbx_order = 3. Is that enough? I tried playing with Isuru's biharmonic formulation, where they definitely need to be bumped or the whole thing is zero (?) order, which gave me the idea to bump them here too.

Bumping them to target_order = qbx_order = 5 for the 3D Stokes test on main with 4x oversampling seems to convergence nicely. By nicely, I mean the errors / orders below and GMRES converges in about 50 iterations.

h Error EOC
1.9563203824807052 3.97299328989e-05
0.9890619241109898 5.45385907448e-06 2.91
0.4957765565866792 7.78907947435e-07 2.81

Still not quite sure where the convergence order is coming from, but this looks more reasonable. Definitely looks like a geometry issue though.

@inducer
Copy link
Owner Author

inducer commented Aug 17, 2021

Possibly related:

if (self.geometry.mesh_name == "sphere"
and self.expr.zero_op_name == "green_grad"):
raise ValueError("does not achieve sufficient precision")

@alexfikl
Copy link
Collaborator

alexfikl commented Aug 17, 2021

Possibly related:

if (self.geometry.mesh_name == "sphere"
and self.expr.zero_op_name == "green_grad"):
raise ValueError("does not achieve sufficient precision")

The test in main uses target_order = 8, qbx_order = 3 and 4x oversampling and that seems bottom out after 1 refinement. I tried it with target_order = 6 and 6x oversampling and that gives

h Error EOC
1.3237889819949702 0.0002554245418541837
0.661894490997484 3.9780381944340415e-05 2.682
0.330947245086626 7.748737043060394e-06 2.360
0.16547362254331185 1.3523711138538341e-05 -0.80345

Second order is the expected order here for qbx_order = 3, so this doesn't look bad. It just doesn't seem to get anywhere near machine precision.

EDIT: also tried 8x oversampling with the same parameters and got

h Error EOC
1.3237889819949702 0.0002586697575710298
0.661894490997484 3.823936909806702e-05 2.757
0.330947245086626 5.4438018000646515e-06 2.812
0.16547362254331185 7.198661899077141e-07 2.918

So yeah, this also seems to be in the same boat of needing huge amounts of oversampling to get anywhere.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants