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

Turbine solver still isn't right #37

Closed
jwallwork23 opened this issue Jan 9, 2025 · 2 comments · Fixed by #38
Closed

Turbine solver still isn't right #37

jwallwork23 opened this issue Jan 9, 2025 · 2 comments · Fixed by #38
Assignees
Labels
bug Something isn't working

Comments

@jwallwork23
Copy link
Member

jwallwork23 commented Jan 9, 2025

While #36 re-enables the turbines in the turbine example, there's still something not right because the optimisation progress is non-monotonic and the control turbine area occasionally goes to zero.

          Looks straightforward. Just one comment: when I tried to run `make test` the optimization failed on the 6th iteration with a `control_turbine` area of 0. From the .vtu files, it appears to be approaching the boundary of the domain.

Originally posted by @acse-ej321 in #36 (review)

@jwallwork23 jwallwork23 self-assigned this Jan 9, 2025
@jwallwork23 jwallwork23 added the bug Something isn't working label Jan 9, 2025
@jwallwork23 jwallwork23 moved this from In Progress to Ready for review in Mesh Adaptation development board Jan 9, 2025
@jwallwork23 jwallwork23 moved this from Ready for review to Reviewed with actions in Mesh Adaptation development board Jan 10, 2025
@stephankramer
Copy link
Collaborator

Finding the same here as @acse-ej321 - also many similar failures at other low resolutions. I suspect this is just caused by being completely under-resolved: at n=2 (as in the test) the mesh resolution dx=50 whereas the turbine diameter is D=16! In my experience you need at least dx=D/4 to get sensible and robust optimisation results for position even using a quadrature degree of 10. It might be that previously the "automatic" quadrature degree gave a much higher degree - i.e. something's changed in Firedrake's automatic estimate - so that you could get away with some coarser resolution. Currently it seems firedrake produces a quadrature of only degree=8 for the bump(x1, y1)*dx integral.

@jwallwork23
Copy link
Member Author

jwallwork23 commented Jan 13, 2025

Finding the same here as @acse-ej321 - also many similar failures at other low resolutions. I suspect this is just caused by being completely under-resolved: at n=2 (as in the test) the mesh resolution dx=50 whereas the turbine diameter is D=16! In my experience you need at least dx=D/4 to get sensible and robust optimisation results for position even using a quadrature degree of 10. It might be that previously the "automatic" quadrature degree gave a much higher degree - i.e. something's changed in Firedrake's automatic estimate - so that you could get away with some coarser resolution. Currently it seems firedrake produces a quadrature of only degree=8 for the bump(x1, y1)*dx integral.

Good points, thanks @stephankramer. As mentioned on thetisproject/thetis#382, I've figured out how to set this example up with discrete turbines, so I'll rework the implementation here in the coming days.

jwallwork23 added a commit that referenced this issue Jan 15, 2025
Closes #37.

While #36 re-enables
the turbines in the turbine example, there's still something not right
because the optimisation progress is non-monotonic and the control
turbine area occasionally goes to zero.

I added a Taylor test and found that the gradient of the QoI wasn't
being computed correctly with the existing setup. I tracked the problem
down to the `turbine_density` expression, which includes several terms.
By projecting this expression into $\mathbb{P}1_{DG}$ space, the Taylor
test passed.

In addition, this PR overhauls the plotting functionality.
@github-project-automation github-project-automation bot moved this from Reviewed with actions to Done in Mesh Adaptation development board Jan 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Development

Successfully merging a pull request may close this issue.

2 participants