Fix direction-dependent BC#164
Conversation
|
see the code change and my comments on the linked PR and issue. I'm going to do some more investigating to see if there is a better fix, because I have my doubts. But this definitely shows a bug in the current implementation. |
|
The problem becomes clear when you look here: dhi is calculated using domain, which is passed in, which only considers the level = 0 indices. Then dhi is checked against the indices at each level (not just level = 0). As a result, the masks are calculated at the wrong cells. Then, the correct_outflow step takes place and uses the same domain-based check, having the potential to change velocity values in the middle of the domain (on lev > 0). |
|
Nice work! |
| @@ -59,6 +63,8 @@ void set_inout_masks( | |||
| for (MFIter mfi(*vel_mf, TilingIfNotGPU()); mfi.isValid(); ++mfi) { | |||
|
|
|||
| Box box = mfi.tilebox(); | |||
There was a problem hiding this comment.
Ideally, I wouldn't use a level_mask array, I would just check if this box is covered by finer cells and skip it entirely. However, I don't know if that is possible, and I'm familiar with makeFineMask from the AMR-Wind context, so that's what I used.
No description provided.