-
Notifications
You must be signed in to change notification settings - Fork 109
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
New slip wall boundary condition for compressible Euler 2D/3D and APE #830
Conversation
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 adding this feature! Does it make sense to change the signature for BCWall type and instead do the "special" treatment for the no-slip wall? Would that be conceptually simpler/faster?
Also, is a similar change useful/necessary for the no-slip condition?
I am not sure TBH. I struggled with this a bit because the acoustic perturbation equations uses this BCWall type with the current signature. I thought about the possibility of having several versions of
It would probably be faster because it would just set the flux value at the boundary instead of spending the effort to do another, e.g., |
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.
I am not sure TBH. I struggled with this a bit because the acoustic perturbation equations uses this BCWall type with the current signature. I thought about the possibility of having several versions of
function (boundary_condition::BoundaryConditionWall)
that dispatches on the particular equation system, but I decided against it as it seemed too messy.
Then it's good that we didn't declare this one as stable. From my point of view, we should
- change the name of
BoundaryConditionWall
since it doesn't work as we would like - implement the new behavior of a corrected wall BC as done here
- re-create the old behavior for the acoustic perturbation equations (can we get it using the same signature as done here, i.e., by setting the boundary flux directly?)
I missed this earlier. I think it would be useful for no-slip. I am only speculating with how FLUXO does it, but basically we could get the advective Euler part using this new way and then you add in the diffusive parts (at least for an isothermal wall) |
Do you mean to be something more specific like
So the altered and newly named
I believe this will be straightforward. I am re-reading the reference I found for this and it looks like a similar trick can be used to avoid the additional call to a surface flux for the APE slip wall |
Out of curiosity: Is it in this case still useful to have |
Would this mean then that |
I don't know :-) I got confused by the question regarding which functionality now lives in which part of the implementation. Let me try to rephrase my point: Does the |
Codecov Report
@@ Coverage Diff @@
## main #830 +/- ##
==========================================
+ Coverage 92.84% 92.87% +0.02%
==========================================
Files 189 189
Lines 17757 17775 +18
==========================================
+ Hits 16486 16507 +21
+ Misses 1271 1268 -3
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
I will keep this type around for the time being as I prototype a new way of doing this slip wall BC. We can always streamline this once it works |
Sounds good! |
That's a good plan - let's prototype what we need ("make it work"). Then, we can see how general this is and decide how to adapt it if necessary ("make it nice"). Finally, we should check whether we broke performance ("make it fast"). |
…erical boundary flux
I put in an initial proposition of how to set the boundary surface flux directly using the pressure values and the normal vector for the 2d |
The assumption on the existence of a scalar pressure state as well as the positions of the velocity definitely makes the current approach with I don't understand the issues with the old The changes to |
The issue is that it's not doing that. Instead, it computes flux = surface_flux_function(u_inner, u_boundary, normal_direction, equations) In general, this is different from what we would like to have. That's basically the gist of what @andrewwinters5000 said above, isn't it?
|
That's completely correct, the current setup doesn't scale. What I had in mind was more a high-level interface such as # Flux-based boundary condition for use with unstructured meshes such as
# `UnstructuredMesh2D` and `P4estMesh2D`.
# Note: For unstructured meshes, we lose the concept of an "absolute direction"
# that is used for Cartesian and structured meshes.
@inline function (boundary_condition::BoundaryConditionFlux)(u_inner,
normal_direction::AbstractVector,
x, t,
surface_flux_function, equations)
return boundary_condition.boundary_flux_function(u_boundary, normal_direction, equations)
end with equation-specific implementation of |
Co-authored-by: Hendrik Ranocha <[email protected]>
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.
I've left some notes but nothing major. Overall, this LGTM. While I do not really like the "smart" reuse of wall BC functionality for the different mesh types, I also do not have a better suggestion except to maybe align the normal orientations between the structured and unstructured meshes (but that's a bigger issue by itself).
…n Roci (not sure if this new compact way would change them anyway because Roci and Mac also gave different values for the Rayleigh-Taylor test
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.
LGTM! Once tests pass & coverage is OK, this can be merged.
Okay, but I am expecting the Rayleigh-Taylor structured mesh test to fail. I still cannot work out why the CI is giving slightly different numbers than Roci or my local machine. |
Does this only happen for structured mesh RTI but not for DGMulti? Edit: just looked at CI - apparently so. |
Yes the CI only fails for the structured mesh RTI, the DGMulti version passes. Everything passes for structured/unstructured/DGmulti on my local machine. |
@andrewwinters5000 that is really odd. Would you mind trying CI (for the RTI elixir on structured meshes) using the commented out BC setup? This avoids a slip wall BC altogether. If this modified test passes, we could create an issue on the weird CI behavior for RTI under slip walls to move it out of this PR. |
I tried this swap and the new test passes locally for me. We will see what the CI says. (for now I disabled auto-merge such that we can discuss the plan going forward) |
I reduced the resolution of the |
Sounds good. Do you think that using a coarser resolution might help with the weird test value mismatch between local and CI? |
Yes. We will use far fewer time steps and floating point operations in general, which will reduce chances for floating point differences to add up. |
CI passes 🎉 |
This addresses #765 . Implements a treatment of a compressible Euler slip wall boundary condition that zeros out the normal velocity component and computes the pressure as the exact solution of a 1D Riemann problem.
NOTE: Due to the current implementation of the genericBoundaryConditionWall
this new boundary treatment returns an external boundary state that will then cancel the normal velocity contribution and use the Riemann solution pressurep_star
in a call to thesurface_flux_function
. This is slightly different compared to how FLUXO or the paper from van der Vegt does this. They avoid an additional call to the surface flux by directly setting the boundary flux to be something likeUPDATE: The new
BoundaryConditionFlux
formulation that this PR uses mimics the FLUXO strategy