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
Support for two term FV gradient expansion with triangle mesh #16822
Comments
Yea I don't think there's much I can do about this. I worked this out by hand for the tri test case in the postprocessors directory, and the matrix is just straight up singular. I could resolve it by projecting dCb onto the surface normal vector ... that would guarantee to remove the singularity. Essentially then you are just extrapolating the boundary face value with the part of the gradient that is in the face normal direction |
This patch allows me to run the postprocessor tri test case with two term boundary expansion. If you think this is a satisfactory enough solution, then I will submit a PR
|
I like that, but I want to know more Does that break all the other tests? Do you think it's the same scenario for the extrapolation with tetrahedra? Is it only when two of the three faces are extrapolated? Or already with a single extrapolated face? I can't see anything in Moukalled about a special treatment for those meshes. Can you think of another reference that might have that? |
🤣
About to find out
It requires multiple extrapolated faces and it requires that for at least one of the extrapolated faces that (dCf * n) n != dCf
Moukalled doesn't seem to go into detail on a lot of the finer points. For instance skew corrections get half a page and there is no mention of solving for a gradient with Green-Gauss when you have extrapolated boundary faces. This article goes into quite a bit of detail on gradient computation but seems to imply that Green-Gauss is second order at internal faces and first order at boundary faces ... which is only true if you're assuming you're going to use the internal cell value as the boundary face value. |
Or perhaps they're referring to the accuracy of the gradient itself? In that case I'd be shocked if Green-Gauss yields a second-order gradient. Usually if an error norm for the solution is order N, then a similar error norm for the gradient is order N - 1. |
This fixes idaholab#16822 although perhaps not 100% satisfactorily. This solution will maintain the second order solution accuracy if we are on an orthgonal grid but likely will not on a non-orthogonal grid since we are only using the gradient in the surface normal direction to to help extrapolate the boundary face value
This fixes idaholab#16822 although perhaps not 100% satisfactorily. This solution will maintain the second order solution accuracy if we are on an orthgonal grid but likely will not on a non-orthogonal grid since we are only using the gradient in the surface normal direction to to help extrapolate the boundary face value
This fixes idaholab#16822 although perhaps not 100% satisfactorily. If a user knows they only have cells with a maximum of one extrapolated boundary face or if they know that if the cell has multiple extrapolated boundary faces that it is orthogonal (e.g. dCf is parallel to Sf), then they can safely set `two_term_boundary_expansion = true` in their input. But in the interest of allowing more things to just work out of the box (like any old tri or tet mesh), I think it makes sense to make the one term expansion the default. I prefer doing this over something like projecting dCf onto the surface normal because this would cost a user accuracy in the case where they have intelligently designed their mesh such that there is only a maximum of one extrapolated boundary face per cell (gmsh meshes for example avoid this).
I ended up deciding to go the route of just using one-term boundary expansion by default for INSFV. You can see my explanation in #17716. If we keep the current title of this issue, then I don't think #17716 closes it, but if we amend the title to "cannot run INSFV with many triangle/tet meshes" then #17716 can be considered a fix. Up to you |
I think it's the right fix for us but if we keep it open it may avoid some confusion later on |
This fixes idaholab#16822 although perhaps not 100% satisfactorily. If a user knows they only have cells with a maximum of one extrapolated boundary face or if they know that if the cell has multiple extrapolated boundary faces that it is orthogonal (e.g. dCf is parallel to Sf), then they can safely set `two_term_boundary_expansion = true` in their input. But in the interest of allowing more things to just work out of the box (like any old tri or tet mesh), I think it makes sense to make the one term expansion the default. I prefer doing this over something like projecting dCf onto the surface normal because this would cost a user accuracy in the case where they have intelligently designed their mesh such that there is only a maximum of one extrapolated boundary face per cell (gmsh meshes for example avoid this).
This fixes idaholab#16822 although perhaps not 100% satisfactorily. If a user knows they only have cells with a maximum of one extrapolated boundary face or if they know that if the cell has multiple extrapolated boundary faces that it is orthogonal (e.g. dCf is parallel to Sf), then they can safely set `two_term_boundary_expansion = true` in their input. But in the interest of allowing more things to just work out of the box (like any old tri or tet mesh), I think it makes sense to make the one term expansion the default. I prefer doing this over something like projecting dCf onto the surface normal because this would cost a user accuracy in the case where they have intelligently designed their mesh such that there is only a maximum of one extrapolated boundary face per cell (gmsh meshes for example avoid this).
This requires implementing try-catch blocks where we first try gradient computation with the two term boundary expansion and then if we get a singular system when performing the LU decomposition, then we switch to a one term boundary expansion just for the currently failing element Refs idaholab#16822
…efault times for (P)INSFV, refs idaholab#16822
Bug Description
In INSFV simulations:
When using triangle mesh with a mesh cell in a corner, which has both a wall and a flow boundary condition, the matrix (the one solved to obtain the face gradients, the centroid gradient and the face values of velocity) is reported as singular and the simulation diverges.
In general FV simulations, it's likely the issue will appear with future ZeroNormalGradient boundary conditions
Steps to Reproduce
Any mesh with a triangle cell that covers an entire corner.
It's likely though unconfirmed that splitting the corner with two mesh cells is sufficient to remove the problem.Indeed if the corner is split as is done automatically by gmsh (see below) then there is no issue. The diverging channel tests in INSFV use the below mesh with two term boundary expansion.It's likely though unconfirmed the issue can also be obtained on quad meshes with different combinations of boundary conditions (3 boundaries for a cell for example).It has been confirmed that if three faces of a (orthogonal) quad are on a boundary, then singularity occursImpact
This forces the use of quad meshes in INSFV simulations.
The text was updated successfully, but these errors were encountered: