Compare ImmersedBoundary
with tilted geometry
#3529
Replies: 25 comments 71 replies
-
I think so! Is this with Should we convert this to a discussion? |
Beta Was this translation helpful? Give feedback.
-
I agree with @glwagner that it's concerning at least for your current configuration. My guess is that with bottom drag and a more turbulent simulation that might not be a huge problem. But as it stands it's definitely affecting the dynamics. (Btw, I say that because I've run a fair amount of turbulent simulations with immersed boundaries at this point and I've never seen this being an issue in my simulations. But they are always turbulent.)
@glwagner reading the code here it seems that it's a @francispoulin Like Greg mentioned, shaved cells would be ideal here, but since we don't have that yet, I'd suggest trying out the |
Beta Was this translation helpful? Give feedback.
-
We've seen issues noise in the vertical velocity along immersed boundaries in other configurations too. I've seen at least one result in which the noise is substantially mitigated by using the PCG solver, which avoids the approximations of the "naive" FFT solver. Unfortunately, we don't yet have a performant PCG-based solver cc @simone-silvestri @xkykai . I think it's interesting and also convenient that the noise is mitigated in turbulent cases or by the inclusion of bottom drag. |
Beta Was this translation helpful? Give feedback.
-
This is an interesting discussion! (Thus, I think we should convert this into a "Discussion".) |
Beta Was this translation helpful? Give feedback.
-
Good suggestion @glwagner (and second by @navidcy) and I now know how to convert issues to discussions! I'll try and plan things better in the future. As has been said, I am using I agree with @tomchor that when you add bottom drag, this will likely kill the spurious vertical velocities that are generated, but I hope we can simulate this without the drag. I will try and give an update soon after I relearn how partial cells work. Cheers! |
Beta Was this translation helpful? Give feedback.
-
I am trying to run I updated it on this branch but am including the error message below. Any suggestions on how we can fix this?
|
Beta Was this translation helpful? Give feedback.
-
In x, y, z = node(i, j, k+1, underlying_grid, c, c, f) to z = node(i, j, k+1, underlying_grid, c, c, f) From a quick look I had, |
Beta Was this translation helpful? Give feedback.
-
Thanks @navidcy for finding the fix and fixing it! (edited) Sorry that I said things were running before. I had mistakenly copied your version of my script, which was using Since the problem seems to be subtracting a tuple and a real I replaced |
Beta Was this translation helpful? Give feedback.
-
Thanks to @navidcy I was able to get the parital cell method working. Below are the new results. First, this is a plot of the final velocity and buoyancy fields. Unfortunately, it's much messier at the bottom, when compared with The simulation shows that the vertical velocities on the bottom seem to pulsate, unlike the previous case where they were localized. Different but not sure if this is any better. linear_bathymetry_PartialCell_take1.mp4I remember that last year, when talking to @glwagner , the partial cell method was created but not validated. Maybe there is still something that needs to be fixed? I'd be happy to work on this with someone if there was interest in improving it. |
Beta Was this translation helpful? Give feedback.
-
PR #3530 is related |
Beta Was this translation helpful? Give feedback.
-
@glwagner The fact that we don't get strong spikes of vertical velocities in the case of a tilted gravity suggests to me that these spikes are not physical. But it would be nice to have a more convincing argument. I modified It is easy to add a constant velocity in the orthogonal direction here but I think we want a simpler test. Any suggestions? |
Beta Was this translation helpful? Give feedback.
-
In my opinion, the vertical velocity spikes are physical, most likely the effect of the steps and the boundary conditions. Or at least they would be physical if a flow would move parallel to a steppy bathymetry like that subject to those boundary conditions. |
Beta Was this translation helpful? Give feedback.
-
Below are plots of the vertical velocity in the simulations of the I will now look at the partial cell method but thoughts would be greatly appreciated?
linear_bathymetry_take1.mp4 |
Beta Was this translation helpful? Give feedback.
-
Below are some results for the The irregularity of the buoyancy contours near the bottom are a cause for concern.
|
Beta Was this translation helpful? Give feedback.
-
Following up, I was looking back at some of my MITgcm analysis comparing the rotated and non-rotated configurations and I have never seen spikes in vertical velocity this large. The caveat is that my simulations were all much lower aspect ratios and therefore run in hydrostatic mode with Here is a notebook comparing simulations with sinusoidal hills (in x) on top of either a flat bottom or a tilted-geometry bottom, both using MITgcm's partial cell implementation. The figure at the bottom is the main result (left untilted vs. right tilted; both periodic in x and y): A minor caveat is that these simulations were 3D, but at this point in the spinup have not yet become turbulent and are essentially uniform in y. And here is a notebook comparing the flat-bottom case (analagous to your experiments, except the tilted one is periodic in x while the untilted one is bounded in x): The noise in the vertical velocity you see here in the untilted case is due to how the noise I added to the initial temperature field impacts hydrostatic pressure, not the numerical adjustment near bottom cells. |
Beta Was this translation helpful? Give feedback.
-
I did some simulations with The good news is that he horizontal velocity looks smooth and do go to zero by the bottom. The not so good news is that the spurious vertical velocities persist. Things that I tried that didn't do much are the following:
Next, I might try adding some damping like @tomchor has done in the tilted gravity example to see what effect that has. |
Beta Was this translation helpful? Give feedback.
-
I have done some thinking and I maintain that those "spikes" are completely consistent with the discretized equations and a consequence of (1) the vertical grid (2) the bathymetric representation. In this setup, the flow is pushed uphill (against a buoyancy gradient but that is not the point). It's only logical that the flow has to rise somewhere. The absence of a positive vertical velocity somewhere would be unphysical, not the presence of it. In my opinion, we should expect it to happen when the flow hits a vertical surface, and this is exactly what you see in your simulation. Think about climbing stairs - you don't step up on flat ground, but when there's a step in front of you. I suspect we do not see those vertical velocities in @hdrake's setup due to a couple of reasons (or the combination of those) that can mask this feature of a steppy bathymetry: It is possible to "reduce" or even "get rid" of these spikes if you play with one (or both) of the above. higher_vertical_to_horizontal.mp4This does not mean that increasing horizontal viscosity or increasing the slope are a "solution" to this problem. I think we should acknowledge that a steppy bathymetry leads to a solution that necessarily has a "discontinuity" in the vertical velocity. But this example should be a further motivation to implement cut cells. |
Beta Was this translation helpful? Give feedback.
-
Again, thanks everyone for joining in this discussion! Below i have plots of I am convinced the spikes are physical in the Also, a silly question, if the MITgcm does shaved cells, can't we just translate that process into julia? A naive question but I am happy to give tihs a try with someone if people think this is doable and someone else wants to join in the fun. |
Beta Was this translation helpful? Give feedback.
-
#3123 is related; I don't think anyone is actively working on it atm |
Beta Was this translation helpful? Give feedback.
-
An ultra simple illustration (with MITgcm and partial cell and bottom friction), top is with usual viscosity and below is when I increase vertical viscosity just above bottom cell when the bottom cell thickness decreases. |
Beta Was this translation helpful? Give feedback.
-
I am looking at I see that the grid stores the function to evaluate the bathymetry but what do I use to find the actual height used in the simulations? I know there is something called |
Beta Was this translation helpful? Give feedback.
-
This is the function that discriminates between immersed cells and fluid cells: The dz is either full or "partial" based on these functions: |
Beta Was this translation helpful? Give feedback.
-
One thing that I have learned is that when I set
in the partial cell method I don't recover the same thing as in the grid fitted bottom. Next step is to figure out why. |
Beta Was this translation helpful? Give feedback.
-
Sorry for the plots before. Here are the same plots but with a balanced colorbar, the same for each. Physically, this is initialized with a constant geostrophic velocity going along isobars into the page. I agree something is odd here. |
Beta Was this translation helpful? Give feedback.
-
This is a plot that compares the linear topography function I am using, along with what is used in both the [The script can be found here.] Maybe the next step is to look to see how the fluxes are computed in |
Beta Was this translation helpful? Give feedback.
-
To better understand Wenegrat and Thomas, JPO 2020 (WT2020) I modifed the following examples:
Internal tide by a seamount and
Tilted bottom boundary layer example ,
to study the dynamics of constant flow over a linearly slowing bottom. Note that I tried to pick the parameters as close to one of the cases in WT2020, however I did make some modifications.
100
as it's easier to resolve the boundary layer that develops.The examples were very easy to modify, which shows that people have done a great job in making them friendly, as promised. Thanks everyone for that! You can find my examples on branch
fjp/Test_ImmersedBoundaryMethod
.The first code, what I call take1, uses the immersed boundary method.
Thet second code, what I call take2 used the tilted geometry approach.
Below I will share some results that people might find interest, maybe @tomchor in particular?
The first plot shows at heatmap of the velocity profile and a contour plot of the isopycnals for the case of an immersed boundary (take1). We see the isopycnals incrop (reach the bathymetry) at a 90 degree angle, which is consistent with what is said in the paper. It seems odd that slip boundary conditions yields a flow that gets faster over the topography, but that is not a problem.
The second plot shows at heatmap of the velocity profile and a contour plot of the isopycnals for the case of a tilted geometry (take2). This case generates a boundary layer at the top as well, but it's less well resolved because I am using a stretched grid at the bottom. Not a problem, just an observation. This also shows the speed up over the topography, so it must be physical.
There is good qualitative agreement between these two and I'm happy with the results.
Next you will find animations for the two cases where we show
v, w b
, in that order. First, for the immersed boundary. What's note worthy is that there are relatively strong vertical velocities that occur over the immersed boundary.linear_bathymetry_slip_take1.mp4
This is the same simulation but for the case of a tilted geometry, and we don't see the same spikes, equally spaced based on the immersed boundary.
linear_bathymetry_slip_take2.mp4
Is the vertical velocity generated over the piecewise constant topogrpahy something that is of a concern? When I increased the resolution I believe I saw the vertical velocity generated increased as well.
Any other thoughts about this comparison?
If people want to see the results with no slip boundary conditions, just let me know and I'm happy to share those too.
Beta Was this translation helpful? Give feedback.
All reactions