-
Notifications
You must be signed in to change notification settings - Fork 369
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
Fix the calculation of divu at inflow face in nodal projection so that it does not use tangential velocities on an inflow face #1219
Fix the calculation of divu at inflow face in nodal projection so that it does not use tangential velocities on an inflow face #1219
Conversation
…e divergence -- this first commit does only 3D with EB.
…e divergence -- this first commit does the non-EB divergence routines for 2D and 3D
interface dimension-independent -- note these aren't used since there is no tangential velocity in 1d
In IAMR (https://github.com/AMReX-Codes/IAMR/blob/master/Source/Projection.cpp#L2353), MAESTROeX (https://github.com/AMReX-Astro/MAESTROeX/blob/main/Source/MaestroNodalProj.cpp#L495), and incflo (https://github.com/AMReX-Codes/incflo/blob/main/src/projection/incflo_apply_nodal_projection.cpp#L139), we already set velocity in ghost cells to zero except for inflow boundary. I wonder if we could consolidate them. Maybe we could zero out velocities at the beginning of compRHS in AMReX_MLNodeLaplacian.cpp so that application codes and other parts of nodal solver do not need to do it. |
I think we already handle walls correctly, but the key here is that at
inflow boundaries we want to use the normal velocities but not the
tangential.
I want this to live in either the NodalProjector class or in the divu
functions since it's an easy thing to forget to add in an application
code. The tangential velocities would still be used at an inflow face
when advecting or diffusing, just not when projecting.
…On Sat, Aug 1, 2020 at 1:53 PM WeiqunZhang ***@***.***> wrote:
In IAMR (
https://github.com/AMReX-Codes/IAMR/blob/master/Source/Projection.cpp#L2353),
MAESTROeX (
https://github.com/AMReX-Astro/MAESTROeX/blob/main/Source/MaestroNodalProj.cpp#L495),
and incflo (
https://github.com/AMReX-Codes/incflo/blob/main/src/projection/incflo_apply_nodal_projection.cpp#L139),
we already set velocity in ghost cells to zero except for inflow boundary.
I wonder if we could consolidate them. Maybe we could zero out velocities
at the beginning of compRHS in AMReX_MLNodeLaplacian.cpp so that
application codes and other parts of nodal solver do not need to do it.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#1219 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ACRE6YUMTXEWSA3T2CNHWLLR6R6GFANCNFSM4PRD5GNA>
.
--
Ann Almgren
Senior Scientist; CCSE Group Lead
|
at inflow the nodal projection isn't supposed to see the tangential
velocities but the advection and diffusion are so you can't just zero ghost
cells
…On Sat, Aug 1, 2020 at 1:53 PM WeiqunZhang ***@***.***> wrote:
In IAMR (
https://github.com/AMReX-Codes/IAMR/blob/master/Source/Projection.cpp#L2353),
MAESTROeX (
https://github.com/AMReX-Astro/MAESTROeX/blob/main/Source/MaestroNodalProj.cpp#L495),
and incflo (
https://github.com/AMReX-Codes/incflo/blob/main/src/projection/incflo_apply_nodal_projection.cpp#L139),
we already set velocity in ghost cells to zero except for inflow boundary.
I wonder if we could consolidate them. Maybe we could zero out velocities
at the beginning of compRHS in AMReX_MLNodeLaplacian.cpp so that
application codes and other parts of nodal solver do not need to do it.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#1219 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ADA5MX2JCS4SYTVZIOHOIMLR6R6GJANCNFSM4PRD5GNA>
.
--
John Bell
CCSE, MS 50A-3111, LBNL
1 Cyclotron Rd., Berkeley, CA 94720
Phone: 510 486-5391 Cell: 510 604-7437
Fax: 510 486-6900
|
I understand that. The code in incflo currently looks like this
In
In the PR, mlmg avoids using tangential velocity. What I am trying to say is since we are touching the ghost cells before the solve anyway, we could set tangential velocity to zero when we are in the |
As Ann mentioned we handle wall correctly. We handle the wall by setting ghost cells to zero. Here we handle inflow tangential velocity by |
So, I guess I'm getting confused. It seems like this PR sets up the nodal projection in AMReX to avoid using tangential velocities in the projection, and Weiqun is suggesting that AMReX avoids using the tangential velocities in the projection, which sorta sounds exactly the same. Moreover, both are suggesting that user BC routines allow for inflowing tangential velocities (as is required for advection and diffusion). |
The nodal projection does currently see the tangential velocities at
inflow. Weiqun is suggesting actually zeroing the tangential inflow ghost
cell values in amrex. I am proposing leaving those unchanged but not
including them in the stencil
…Sent from my iPhone
On Aug 2, 2020, at 11:01 AM, Marc Day <notifications@github.com> wrote:
So, I guess I'm getting confused. It seems like this PR sets up the nodal
projection in AMReX to avoid using tangential velocities in the projection,
and Weiqun is suggesting that AMReX avoids using the tangential velocities
in the projection, which sorta sounds exactly the same. Moreover, both are
suggesting that user BC routines allow for inflowing tangential velocities
(as is required for advection and diffusion).
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#1219 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/ACRE6YQMOW3BRKBCVMQSFZTR6WSY5ANCNFSM4PRD5GNA>
.
|
Thank you, that helps a ton. |
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 agree that it is better to leave the terms out of the stencil than to count on them being zeroed by the caller. This looks fine to me.
The alternative was to have the NodalProjector zero them I think - but that
behavior might not be expected by the calling routine which might assume
they’re still there afterwards - which is why I prefer to not use them
rather than zero them
…Sent from my iPhone
On Aug 2, 2020, at 11:39 AM, Marc Day <notifications@github.com> wrote:
*@drummerdoc* commented on this pull request.
I agree that it is better to leave the terms out of the stencil than to
count on them being zeroed by the caller. This looks fine to me.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#1219 (review)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ACRE6YU6SVZLRBUGPEOXKQ3R6WXHZANCNFSM4PRD5GNA>
.
|
I looked more carefully at IAMR (https://github.com/AMReX-Codes/IAMR/blob/master/Source/Projection.cpp#L2353). IAMR does zero out tangential velocity at inflow face. |
So IAMR should not see any changes with this. mfix was not zeroing out
the tangential --- we didn't notice this until we started doing angled
geometries and specifying non-zero tangential inflow.
…On Sun, Aug 2, 2020 at 12:54 PM WeiqunZhang ***@***.***> wrote:
I looked more carefully at IAMR (
https://github.com/AMReX-Codes/IAMR/blob/master/Source/Projection.cpp#L2353).
IAMR does zero out tangential velocity at inflow face.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#1219 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ACRE6YRHY2OFTQL3MTAZONLR6XABBANCNFSM4PRD5GNA>
.
--
Ann Almgren
Senior Scientist; CCSE Group Lead
|
…t it does not use tangential velocities on an inflow face (AMReX-Codes#1219) ## Summary Mathematically the nodal projection should only see the normal velocity at inflow faces, but it was coded so that it would use non-zero tangential velocities at inflow in the calculation of divu. Most users never set tangential velocities to anything but zero, but if they did, this would give an incorrect divergence. ## Additional background ## Checklist The proposed changes: - [X] fix a bug or incorrect behavior in AMReX - [ ] add new capabilities to AMReX - [X] changes answers in the test suite to more than roundoff level - [X] are likely to significantly affect the results of downstream AMReX users - [ ] are described in the proposed changes to the AMReX documentation, if appropriate
Summary
Mathematically the nodal projection should only see the normal velocity at inflow faces, but it was coded so that it would use non-zero tangential velocities at inflow in the calculation of divu. Most users never set tangential velocities to anything but zero, but if they did, this would give an incorrect divergence.
Additional background
Checklist
The proposed changes: