Filling face-centred boundary data #3561
-
Hey AMReX team, I am trying to write up a steady state Navier Stokes solver using AMReX. I am trying to implement something similar to SIMPLE scheme but with AMR support. I understand that cell centered boundary conditions can be filled with PhysBCFunct<GpuBndryFuncFab> which fills the values at the ghost nodes around the domain. How can I fill physical boundary data on face centered data (advection velocity) ? Any suggestions would be much appreciated! Kind regards, |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
BCs are a bit nuanced in this context. A user loads Dirichlet physical boundary conditions to be applied ON THE FACES, but puts that data into a cell-centered container, primarily due to coding convenience. That is, if I want to set velocity at inflow, I will put the values into a cell-centered grow cell, but the code internally will apply that at the face. That said, much of this implementation is in code that some might consider user code (such as incflo, for example, or PeleLMeX, or IAMR). The library itself is typically considered to be the data structures, parallel communication stuff, looping constructs and IO. It's a bit gray and fuzzy. I mention this because you are actually writing one of these applications as your own solver. Depending on which pieces you pull in to your application, some of the data centering decisions might be made by you in your stencil codes. If you use the AMReX-Hydro routines for advection and the MLMG stuff for diffusion operators for example however, you'll be able to see where those decision have been made for you. (e.g., applyBC in the linear operators for diffusion). Let me know if this need more explanation. Lots to unpack here. |
Beta Was this translation helpful? Give feedback.
for the MLMG framework, there are some "expert" settings that set where (in normal distance from the bounding face) the BC is to be applied. A lot of that is done automatically behind the scenes but can be over-ridden for specific applications. Things have moved around in the code a little since I worked in that area, but it may be worth digging through the examples a little to find where this is done (used to be called bcloc, and was a scalar for each orientation). So, the Dirichlet values were passed in the cell-centered container, and bcloc was used to decide where the value was to be applied. It may be that the defaults do exactly what you want, but it's good to be sure.