Skip to content
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

Implementing a CutCellBottom immersed boundary #3123

Open
4 tasks
siddharthabishnu opened this issue May 31, 2023 · 8 comments · May be fixed by #3146
Open
4 tasks

Implementing a CutCellBottom immersed boundary #3123

siddharthabishnu opened this issue May 31, 2023 · 8 comments · May be fixed by #3146
Assignees
Labels
immersed boundaries ⛰️ Less Ocean, more anigans numerics 🧮 So things don't blow up and boil the lobsters alive

Comments

@siddharthabishnu
Copy link
Contributor

siddharthabishnu commented May 31, 2023

Cut cells use piecewise linear representations of bathymetry (as opposed to full or partial cells which use piecewise constant ones).

Here’s a tentative work plan for implementing cut cells:

  1. Develop the following test cases:

    (a) Tracer advection with no momentum on a seamount (Adcroft or Schär configuration);
    (b) Internal wave or overflow with momentum;

    Run these test cases for full and partial cells. As suggested by @jm-c, compare a simulation using low vertical resolution (~10 vertical layers) and partial cells with one using high vertical resolution (~500 vertical layers) and full cells at the same horizontal resolution (to verify the effectiveness of partial cells). To ensure that a stratified ocean remains at rest, implement the technique in Lin for partial cells.

  2. Implement two-dimensional cut cells in the y-z plane:

    (a) Implement CutCellBottom in ImmersedBoundary module similar to PartialCellBottom;
    (b) Implement a special compute_w_from_continuity for CutCellBottom.

    compute_w_from_continuity!(velocities, arch, grid) =
    launch!(arch, grid, :xy, _compute_w_from_continuity!, velocities, grid)

    (c) Implement the "algorithm" for partial cells to compute the hydrostatic pressure for CutCellBottom.

  3. Extend the cut cell implementation to 3D and consider improving the pressure gradient calculation.

References

Advection on Cut-Cell Grids for an Idealized Mountain of Constant Slope
A finite-volume integration method for computing pressure gradient force in general vertical coordinates
A fourth-order Cartesian grid embedded boundary method for Poisson's equation
A New Terrain-Following Vertical Coordinate Formulation for Atmospheric Prediction Models
Comparison of Terrain-Following and Cut-Cell Grids Using a Nonhydrostatic Model
Large-eddy simulations with ClimateMachine v0.2.0: a new open-source code for atmospheric simulations on GPUs and CPUs
Medium range forecasts using cut-cells: a sensitivity study
On methods for solving the oceanic equations of motion in generalized vertical coordinates
Representation of topography by porous barriers and objective interpolation of topographic data
Representation of Topography by Shaved Cells in a Height Coordinate Ocean Model
Rescaled height coordinates for accurate representation of free-surface flows in ocean circulation models
Sliding or stumbling on the staircase: numerics of ocean circulation along piecewise-constant coastlines

Tasks

@glwagner glwagner changed the title Implementing Shaved Cells in Oceananigans Implementing a CutCellBottom immersed boundary May 31, 2023
@navidcy navidcy added numerics 🧮 So things don't blow up and boil the lobsters alive immersed boundaries ⛰️ Less Ocean, more anigans labels Jun 1, 2023
@glwagner
Copy link
Member

glwagner commented Jun 2, 2023

This validation test essentially implements the tracer advection test:

https://github.com/CliMA/Oceananigans.jl/blob/main/validation/immersed_boundaries/tracer_advection_over_bump.jl

but we should take care to make sure the boundary conditions are correct.

@glwagner
Copy link
Member

glwagner commented Jun 14, 2023

@siddharthabishnu @simone-silvestri can you document the progress we discussed yesterday on this issue?

@glwagner
Copy link
Member

Also, if there has been work do you think we can open a draft PR to track the progress?

@glwagner
Copy link
Member

(Possibly a PR that updates the tracer advection case is all we need for now to complete the first task. I don't think the tracer advection case works on main currently.)

@siddharthabishnu siddharthabishnu linked a pull request Jun 14, 2023 that will close this issue
@siddharthabishnu
Copy link
Contributor Author

siddharthabishnu commented Jun 14, 2023

@glwagner I have opened a PR with the branch sb/cut-cells-experiment, on which I have been working on implementing the cut cells. To summarize the progress:

  • The two-dimensional tracer advection test case over a Gaussian bump is run successfully using the low resolution from the Adcroft paper and a relatively higher resolution. Both partial cells and full cells are used. Time evolution of the passive tracer concentration is visualized.

  • CutCellBottom is implemented in the ImmersedBoundary module similar to PartialCellBottom, and the tracer advection test case is repeated with cut cells. No noticeable difference in the results is detected so far (with the simulation using partial cells).

So, tasks 1 (a) and 2 (b) have been completed so far. Tasks 2(b) and 2(c) are being worked on right now, after completion of which tasks 1 (b) and 3 will be initiated.

@glwagner
Copy link
Member

Nice! Do you have an image that illustrates the problems at low resolution, ie a plot that reproduces the Adcroft result?

@siddharthabishnu
Copy link
Contributor Author

Nice! Do you have an image that illustrates the problems at low resolution, ie a plot that reproduces the Adcroft result?

Yes. Here they are. I improved the visualization on the latest commit and pushed it right now. The types of immersed boundary and plot are included in the filenames. The discrete version of the topography (i.e. the Gaussian bump for this test case) is detectable only for the heatmaps.

tracer_advection_over_bump_grid_fitted_bottom_filled_contour_plot.mp4
tracer_advection_over_bump_grid_fitted_bottom_heat_map.mp4
tracer_advection_over_bump_partial_cell_bottom_filled_contour_plot.mp4
tracer_advection_over_bump_partial_cell_bottom_heat_map.mp4

@glwagner
Copy link
Member

This paper describes a "cell merging" technique that can help reduce problems with very small cells: https://journals.ametsoc.org/view/journals/mwre/138/10/2010mwr3252.1.xml?tab_body=abstract-display

There are also some citations in there about an alternative method that they call the "thin wall" method.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
immersed boundaries ⛰️ Less Ocean, more anigans numerics 🧮 So things don't blow up and boil the lobsters alive
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants