-
Notifications
You must be signed in to change notification settings - Fork 36
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
Extend VoronoiFVM to incorporate FEM-computed velocity fields provided by ExtendableFEM #129
Extend VoronoiFVM to incorporate FEM-computed velocity fields provided by ExtendableFEM #129
Conversation
…to run tests for fem coupling
Thanks for the PR! |
Codecov ReportAttention: Patch coverage is
❗ Your organization needs to install the Codecov GitHub app to enable full functionality. Additional details and impacted files@@ Coverage Diff @@
## master #129 +/- ##
==========================================
+ Coverage 85.33% 85.84% +0.50%
==========================================
Files 24 26 +2
Lines 2803 3045 +242
==========================================
+ Hits 2392 2614 +222
- Misses 411 431 +20 ☔ View full report in Codecov by Sentry. |
The current test in Example240 basically tests the if the interpolation from a FE space gives the same result as the interpolation of the analytical function. However this is no useful example to clone for users (which is their main purpose; Yes, I know, some of mine are not that good either...) Therefore I propose the following:
|
What are the |
Also please add docstrings to all newly introduced methods. I would care about putting them into the Documenter build. |
Zero allocations in hot loops, grid[BFaceNormals] uses allocations.
The new internal function Are we missing any possible side effects of this change? |
The internal methods are now the last ones and documented as 'internal'
@j-fu All new methods are now documented. The original "internal" |
93676c8
to
043e2fc
Compare
Things are still not quite done. Here's a short list of issues that need work or resolving:
Oh, and note to @chmerdon: if we had a |
Ok, this is done now.
How about the maximum principle ? An the we also should cross-check the VoronoiFVM divergence caclulation
ok
This should go to the internal API section, see https://j-fu.github.io/VoronoiFVM.jl/stable/internal/
I already created this test in my local copy. It will be available once I merge with your work, so you can delete this.
Nice! |
There is no HDIVBDM3, yet, but there is HDIVRTk(2,3)... will also have a look at the example next week. |
Concerning the testcase that does not work with usefem = true and Cylindrical2D... I think the velocity from the fem computation is the reconstruction of rv in that case, while the velocity for usefem = false or Cartesian2D is just v, right? Currently, it seems the FEM computes the divergence of (rv), which should be zero and is indeed zero, so only the divergence from the FVM is wrong. My guess is that the edgevelocities are probably computed incorrectly due to the wrong handling of the rv input. |
My guess is that this axisymmetric switch is not passed properly through from the edgevelocities function to the segment integration. Moreover, I think we should also provide the option to give the v instead of r*v also in the FEM case. |
You're correct, we forgot to handle to pass the I'll push a cleaned up version with some more changes applied later. |
I studied this function in order to understand the divergence problem and can say that it looks fine :) |
Done. |
I fixed the aforementioned error with the divergence calculation, incorporated the option to explicitly specify whether to perform an interpolation onto a reconstruction space, and cleaned up and restructured everything a bit to generate a neater doc output. The only two things that seem to remain open in my view are thus:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for fixes and cleanup. I left some nitpicking comments in the code :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added comment as suggested.
Co-authored-by: Daniel Runge <[email protected]>
Co-authored-by: Patrick Jaap <[email protected]>
…ronoiFVM.jl into feature/extendablefembaseext
We (@pjaap, @chmerdon and me) would like for
VoronoiFVM.jl
to admit FEM solutions as velocity fields in solving convection-diffusion systems.For that purpose, we propose an extension
VoronoiFVMExtendableFEMBaseExt
which extends the capabilities ofedgevelocities
andbfacevelocities
. They now provide the integrals of the velocity fields along Voronoi cell edges as computed byExtendableFEMBase
.We also incorporated an example script which tests the fidelity of this extension and demonstrates the use case of working with two different grids: a flowgrid on which the velocity has been computed by
ExtendableFEM.jl
and a chemgrid onto which this velocity is interpolated to provide the input for the convection-diffusion system solved byVoronoiFVM.jl
.Mind that we still need the last pull request for
ExtendableFEMBase.jl
to go through so we can adjust the[compats]
forVoronoiFVM.jl
accordingly.