You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: Project2/README.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,7 +8,7 @@ Although most natural flows are time-varying, and have complicated spatial struc
8
8
Kelvin-Helmholtz billows developing in a cloud layer over Mount Shasta, California. Photo copyright 1999, Beverly Shannon.
9
9
10
10
## Introduction
11
-
Here, we will examine the basic stability properties of a stratified shear flow, and will then use Diablo to examine the nonlinear evolution of the unstable state.
11
+
Here, we will examine the basic stability properties of a stratified shear flow, and will then use Oceananigans to examine the nonlinear evolution of the unstable state.
12
12
13
13
Start by considering a stratified shear flow of the form:
14
14
@@ -55,6 +55,6 @@ Finally, try making a plot of the gradient Richardson number as a function of de
55
55
In a stratified flows, kinetic energy can be converted to potential energy by mixing the stable density profile, raising the center of mass of the fluid. Some kinetic energy is also lost to viscous dissipation. The mixing efficiency, $\Lambda$,of great interest in the stratified turbulence literature, is the ratio of the kinetic energy used to mix the density profile to the loss to viscous dissipation. Set up and run a simulation of K-H instability using Oceananigans, and let the flow evolve long enough so that it settles back into a non-turbulent state (you may need to decrease the resolution for this, and you might also want to increase the size of the domain in $z$ to minimise boundary effects). Calculate the kinetic and potential energy at the start and end of the simulation, and the change over the simulation, $\Delta KE$ and $\Delta PE$. Calculate the flux coefficient $\Gamma \equiv B/\epsilon \simeq \Delta PE/(-\Delta KE-\Delta PE)$, where $B$ is the buoyancy flux, and $\epsilon$ is the kinetic energy dissipation. Then, use the flux coefficient to estimate the mixing efficiency, $\eta$, using the relation $\Gamma=\eta/(1-\eta)$. Many parameterizations for mixing in the ocean and atmosphere use a constant mixing efficiency with a value close to $\eta \simeq 0.2$. How does your result compare? Using time series of the kinetic and potential energy, can you estimate the instantaneous mixing efficiency as a function of time?
56
56
57
57
## Holmboe instability
58
-
When the profiles of shear and stratification are not identical, a second type of instability called 'Holmboe instability' can develop. Specifically, this instability develops when the width of the shear layer is larger than the width of the stratified layer. Holboe instability is characterized by disturbances that propagate relative to the mean flow, while the billows associated with Kelvin-Helmholtz instability remain nearly stationary. Repeat the process used to analyze K-H instability (starting from the linear stability analysis), but use a buoyancy profile where the width of the tanh is a factor of four smaller than for the velocity. Can you identify Holmboe instability based on the stability analysis? Once you find a set of parameters where Holmboe instability grows faster than K-H, try simulating it in Oceananigans. Note that you may need to increase the Reynolds number or Prandtl number in this simulation to prevent the density interface from smearing out too broadly before the simulation begins.
58
+
When the profiles of shear and stratification are not identical, a second type of instability called 'Holmboe instability' can develop. Specifically, this instability develops when the width of the shear layer is larger than the width of the stratified layer. Holboe instability is characterized by disturbances that propagate relative to the mean flow, while the billows associated with Kelvin-Helmholtz instability remain nearly stationary. Repeat the process used to analyze K-H instability (starting from the linear stability analysis), but use a buoyancy profile where the width of the tanh used to create the initial buoyancy profile is smaller than for the velocity. The parameters listed in Table 1 from [Salehipour et al.](./papers/Salehipour.pdf) should provide a good starting point. Can you identify Holmboe instability based on the stability analysis? Once you find a set of parameters where Holmboe instability grows faster than K-H, try simulating it in Oceananigans. Note that you may need to increase the Reynolds number or Prandtl number in this simulation to prevent the density interface from smearing out too broadly before the simulation begins.
Copy file name to clipboardExpand all lines: Project3/README.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -42,8 +42,8 @@ To gain further insight, add code to `rossbywave.jl` to calculate and save the a
42
42
Try adding a non-zero zonal (east/west) mean flow to your initial conditions (in other words add a function $g(y)$ to $u_i$.) How does this modify the phase speed of the waves? Explore various configurations for the mean flow and the wave perturbations. For example, what happens if the wave perturbations are isolated to a region with zero or non-zero mean flow? How do the waves interact with the mean flow and how does this vary with the amplitude of the waves and the mean flow?
43
43
44
44
### Rossby graveyard
45
-
[Zhai et al.](papers/Zhai.pdf) proposed that a significant amount of energy is dissipated when nonlinear Rossby waves and westward propagating eddies 'break' at western boundaries. Change the topology of the grid to `bounded` in the x-direction, and apply either free-slip (the default) or no-slip boundary conditions (perhaps try both). Examine what happens when the Rossby waves encounter the boundary on the western side of the domain. How do the results change when you vary the amplitude of the initial velocity perturbation?
45
+
[Zhai et al.](./papers/Zhai.pdf) proposed that a significant amount of energy is dissipated when nonlinear Rossby waves and westward propagating eddies 'break' at western boundaries. Change the topology of the grid to `bounded` in the x-direction. What happens when the Rossby waves encounter the boundary on the western side of the domain? How do the results change when you vary the amplitude of the initial velocity perturbation?
46
46
47
47
### Zonal jets
48
-
When the amplitude of the initial perturbation is large, the resulting flow will be highly nonlinear. In 2D (or quasi-geostrophic) turbulence, energy is transferred on average to large scales. On a $\beta$-plane, this eventually manifests in the spontaneous formation of zonal jets, e.g. east/west flow that is also coherent in the east/west direction. This was discussed in a classic paper by [Rhines](papers/Rhines75.pdf) who proposed that the jets form with a horizontal lengthscale set by $(U/\beta)^{1/2}$. This process is thought to be important in forming the zonal jets (and banded cloud patterns) on Jupiter and the other gas giants. Explore the formation and dynamics of zonal jets by varying the parameters in `rossbywaves.jl`. For a velocity perturbation with a fixed amplitude, how does the number of jets that form depend on $\beta$? Are the jets stationary, or do they meander?
48
+
When the amplitude of the initial perturbation is large, the resulting flow will be highly nonlinear. In 2D (or quasi-geostrophic) turbulence, energy is transferred on average to large scales. On a $\beta$-plane, this eventually manifests in the spontaneous formation of zonal jets, e.g. east/west flow that is also coherent in the east/west direction. This was discussed in a classic paper by [Rhines](./papers/Rhines75.pdf) who proposed that the jets form with a horizontal lengthscale set by $(U/\beta)^{1/2}$. This process is thought to be important in forming the zonal jets (and banded cloud patterns) on Jupiter and the other gas giants. Explore the formation and dynamics of zonal jets by varying the parameters in `rossbywaves.jl`. For a velocity perturbation with a fixed amplitude, how does the number of jets that form depend on $\beta$? Are the jets stationary, or do they meander?
Copy file name to clipboardExpand all lines: Project4/README.md
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,9 +8,9 @@ This is illustrated in the figure below which shows two quasi true-color satelli
8
8
9
9
Fluid dynamics has a very strong influence on phytoplankton (and hence the global carbon cycle). Sunlight needed for photosynthesis illuminates a relatively thin layer of the upper ocean. When phytoplankton are advected into the dark ocean interior for extended periods of time, they will become dormant or die. Different populations of phytoplankton, the nutrients that they rely on, and their predators are co-mingled and mixed by ocean currents.
10
10
11
-
This project will use [OceanBioME.jl](https://github.com/OceanBioME/OceanBioME.jl)) (Ocean Biogeochemical Modelling Environment), a Julia package developed in the DAMTP Ocean Dynamics group at Cambridge to provide biogeochemical models for Oceananigans. OceanBioME has powerful features including state-of-the-art biogeochemical models, models for the air-sea gas exchange, sediment models, and biologically-active particles. Here, we will use OceanBioME to provide a model of the predator-prey dynamics of a population of phytoplankton and zooplankton. We will then use Oceananigans to explore how advection and diffusion modifies the intrinsic ecosystem dynamics.
11
+
This project will use [OceanBioME.jl](https://github.com/OceanBioME/OceanBioME.jl) (Ocean Biogeochemical Modelling Environment), a Julia package developed in the DAMTP Ocean Dynamics group at Cambridge to provide biogeochemical models for Oceananigans. OceanBioME has powerful features including state-of-the-art biogeochemical models, models for the air-sea gas exchange, sediment models, and biologically-active particles. Here, we will use OceanBioME to provide a model of the predator-prey dynamics of a population of phytoplankton and zooplankton. We will then use Oceananigans to explore how advection and diffusion modifies the intrinsic ecosystem dynamics.
12
12
13
-
Before you can use the code for this project, you will need to install OceanBioME. To do this, from the Julia REPL (command prompt), type `]`, followed by `add OceanBiome`. Once the package installs, return to the command prompt using the `delete` key.
13
+
OceanBioME is included in the FDSE project environment, so if you type `activate .` and `instantiate` in the Julia package manager starting from the FDSE folder, you will already have it installed. If you have installed the packages manually, you will need to install OceanBioME using the package manager. From the Julia REPL (command prompt), type `]`, followed by `add OceanBiome`. Once the package installs, return to the command prompt using the `delete` key.
14
14
15
15
# 0-dimensional 'box' model
16
16
Although OceanBioME is primarily intended to be coupled with Oceananigans, it can be used on its own to integrate the equations describing the dynamics of the ocean ecosystem. This is useful for developing an understanding of the intrinsic ecosystem dynamics, before adding the complications of fluid dynamics, and for debugging new models.
@@ -43,7 +43,7 @@ Consider the timescales involved in this system associated with advection, diffu
43
43
# Suggested further investigations
44
44
45
45
## Buoyant / sinking phytoplankton
46
-
Often phytoplankton cells are slightly more or less dense than the surrounding seawater, causing them to slowly sink or rise in the absence of vertical currents. There is a parameter in `PZ.jl` called `sinking_velocity` which causes the phytoplankton to rise or sink with a prescribed vertical velocity relative to the surrounding water (note that positive values of the parameter correspond to rising motion and negative values correspond to sinking motion). Try changing this parameter and explore the consequences on the predator-prey system. You can explore the effect of this change both in `PZ_column.jl` and`PZ_cavity.jl`. Note that you might need to reduce the size of the timestep to prevent numerical instabilities.
46
+
Often phytoplankton cells are slightly more or less dense than the surrounding seawater, causing them to slowly sink or rise in the absence of vertical currents. There is a parameter in `PZ.jl` called `sinking_velocity` which causes the phytoplankton to rise or sink with a prescribed vertical velocity relative to the surrounding water (note that positive values of the parameter correspond to rising motion and negative values correspond to sinking motion). Try changing this parameter and explore the consequences on the predator-prey system with`PZ_cavity.jl`. Note that you might need to reduce the size of the timestep to prevent numerical instabilities.
47
47
48
48
Note that in order to conserve total phytoplankton in our domain, it necessary to define the sinking velocity so that it goes to zero at the top and bottom boundaries. To do this, we can use a function field so that the sinking velocity will be a function of space. For example:
Julia is a modern programming language which is as easy to use as python or Matlab, but provides the speed of languages like Fortran and C.
12
12
13
+
There are two ways of working with the projects in this repository: you can either install the required software on your own computer, or run the code in a browser using GitHub Codespaces. If you want to spend time going through the projects and tinker with the code, then we recommend downloding on your own computer. The projects have been designed to run quickly even on slow laptops.
14
+
15
+
<details>
16
+
<summary>Instructions to run FDSE projects on GitHub Codespaces</summary>
17
+
18
+
The instructions below describe how to run the projects using [GitHub codespaces](https://github.com/features/codespaces), which is useful if you don't have Julia installed and want to have a quick look at the projects, or have problems installing Julia.
19
+
20
+
To run this way:
21
+
1. Fork this repository by clicking the "Fork" button above
22
+
2. In your fork click the "<> Code" button, move to the "Codespaces" tab, then "Creat codespaces on main"
23
+
<imgwidth="421"alt="Screenshot 2023-09-06 at 15 24 55"src="https://github.com/jagoosw/FDSE/assets/26657828/cd90bd7e-33d8-4b02-849f-ed11b8de1a6e">
24
+
25
+
3. This will open a codespace which may take a while to setup
26
+
4. Once everything has been setup open the command palette by clicking "View > Command Palette", then select "Julia: Start REPL"
27
+
5. Once this is open type `]` to open the package manager, type `instantiate` and return, this will install the required packages and may take a while
28
+
6. Once this is done you can run the project files by opening them in the editor and clicking the run arrow in the top right corner.
29
+
30
+
You can run codespaces for 60 hours a month with a normal GitHub account, or if you are a student you can [upgrade to GitHub Pro for free](https://education.github.com/pack) which will give you 180 hours a month.
31
+
</details>
32
+
33
+
<details>
34
+
<summary>Instructions to install and run on your own computer</summary>
35
+
13
36
Julia comes with a REPL (which stands for read-evaluate-print-loop) which provides a command-line interface much like python or Matlab. While it is possible to use this on its own, we suggest using a code development platform which provides a single tool to edit and run the scripts and display plots. In particular, we recommend Visual Studio Code which is an excellent tool and free to use.
14
37
15
38
For the recommended installation, follow these steps:
@@ -27,28 +50,13 @@ For the recommended installation, follow these steps:
27
50
14. Find and install the Julia Language Support extension in VS code
28
51
15. Find and install the GitHub Pull Requests and Issues extension in VS code
29
52
30
-
For the next steps, see the README file inside the Project 1 folder.
31
-
32
-
<details>
33
-
<summary>Alternative setup instructions in GitHub Codespaces</summary>
34
-
35
-
An alternative way to run these projects is in [GitHub codespaces](https://github.com/features/codespaces) which is useful if you have problems installing Julia etc.
36
-
37
-
To run this way:
38
-
1. Fork this repository by clicking the "Fork" button above
39
-
2. In your fork click the "<> Code" button, move to the "Codespaces" tab, then "Creat codespaces on main"
40
-
<imgwidth="421"alt="Screenshot 2023-09-06 at 15 24 55"src="https://github.com/jagoosw/FDSE/assets/26657828/cd90bd7e-33d8-4b02-849f-ed11b8de1a6e">
41
-
42
-
3. This will open a codespace which may take a while to setup
43
-
4. Once everything has been setup open the command palette by clicking "View > Command Palette", then select "Julia: Start REPL"
44
-
5. Once this is open type `]` to open the package manager, type `instantiate` and return, this will install the required packages and may take a while
45
-
6. Once this is done you can run the project files by opening them in the editor and clicking the run arrow in the top right corner.
46
-
47
-
You can run codespaces for 60 hours a month with a normal GitHub account, or if you are a student you can [upgrade to GitHub Pro for free](https://education.github.com/pack) which will give you 180 hours a month.
48
53
</details>
49
54
55
+
For the next steps, see the README file inside the Project 1 folder.
0 commit comments