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: docs/Models/linear-shallow-water-model.md
+21-8Lines changed: 21 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -36,15 +36,15 @@ where $g$ is acceleration due to gravity and $H$ is uniform resting fluid depth.
36
36
$$
37
37
\vec{q} =
38
38
\begin{pmatrix}
39
-
-fv \\
40
-
fu \\
39
+
-fv - C_d u\\
40
+
fu - C_d v\\
41
41
0
42
42
\end{pmatrix}
43
43
$$
44
44
45
-
where $f$ is the coriolis parameter.
45
+
where $f$ is the coriolis parameter and $C_d$ is the linear drag coefficient.
46
46
47
-
To track stability of the Euler equation, the total entropy function is
47
+
To track stability of the shallow water equations, the total entropy function is taken to be the total (kinetic plus potential) energy
48
48
49
49
$$
50
50
e = \frac{1}{2} \int_V H u^2 + H v^2 + g \eta^2 \hspace{1mm} dV
@@ -57,7 +57,7 @@ The 2D Linear Shallow Water model is implemented as a type extension of the `DGM
57
57
The `LinearShallowWater2D` class has a generic method (`SetCoriolis`) that can be used for defining the coriolis parameter at each location in the model domain. The `SetCoriolis` method can be used for either setting an $f$ or $beta$ plane.
58
58
59
59
#### Setting up an f-plane
60
-
Assuming you've created interpolant ,mesh, geometry objects, and model objects you can define a constant value for the coriolis parameter using the following
60
+
Assuming you've created interpolant, mesh, geometry objects, and model objects you can define a constant value for the coriolis parameter using the following
Assuming you've created interpolant ,mesh, geometry objects, and model objects you can define the coriolis so that it varies with the `y` coordinate in the geometry using
71
+
Assuming you've created interpolant, mesh, geometry objects, and model objects you can define the coriolis so that it varies with the `y` coordinate in the geometry using
Perhaps you find that f-plane and beta-plane scenarios are just too boring, or their not an appropriate model for what you're considering. In this case, you can easily set the `fCori%interior` attribute of the `LinearShallowWater2D` class directly
83
+
Perhaps you find that f-plane and beta-plane scenarios are just too boring, or they're not an appropriate model for what you're considering. In this case, you can easily set the `fCori%interior` attribute of the `LinearShallowWater2D` class directly
Assuming you've created interpolant, mesh, geometry objects, and model objects you can define a constant value for the linear drag coefficient by setting the constant parameter `Cd`, e.g.
133
+
134
+
```fortran
135
+
type(LinearShallowWater2D) :: modelobj
136
+
real(prec), parameter :: fCd = 0.25
137
+
...
138
+
139
+
modelobj % Cd = Cd ! Set the drag coefficient
140
+
141
+
```
131
142
### Riemann Solver
132
143
The `LinearShallowWater2D` class is defined using the advective form.
133
144
The Riemann solver for the hyperbolic part of the shallow water equations is the local Lax-Friedrichs upwind Riemann solver
*[`examples/LinearShallowWater2D.f90`](https://github.com/FluidNumerics/SELF/blob/main/examples/LinearShallowWater2D.f90) - Implements the 2D shallow water equations with no normal flow boundary conditions
226
+
*[Gravity waves in closed square domain](../Tutorials/LinearShallowWater/ReflectingWave.md)
227
+
*[Kelvin waves in a closed circular rotating domain (f-plane)](../Tutorials/LinearShallowWater/KelvinWaves.md)
228
+
*[Planetary Rossby waves in an open square domain (beta-plane)](../Tutorials/LinearShallowWater/PlanetaryRossbyWave.md)
This experiment is designed to demonstrate the preferred direction of phase propagation exhibited by Kelvin Waves. We use a circular domain in a rotating reference frame with a no-normal-flow boundary condition and an initial disturbance in the free-surface height placed on the domain boundary. The free surface height disturbance adjusts into geostrophic balance and in the process radiates gravity waves and a Kelvin wave. This demonstration uses a constant negative value for the coriolis parameter which results in a Kelvin wave that propagates in a clockwise direction, with the domain boundary to the left of the propagation direction.
3
+
4
+
## Configuration
5
+
6
+
### Equations
7
+
8
+
The equations solved are the linear shallow water equations, given by
9
+
$$
10
+
u_t - fv = -g \eta_x - C_d u
11
+
$$
12
+
$$
13
+
v_t + fu = -g \eta_y - C_d v
14
+
$$
15
+
$$
16
+
\eta_t + (Hu)_x + (Hv)_y = 0
17
+
$$
18
+
19
+
where $\vec{u} = u \hat{x} + v \hat{y}$ is the barotropic velocity, $g$ is the acceleration of gravity, $C_d$ is the linear drag coefficient, $H$ is a uniform resting fluid depth, and $\eta$ is the deviation of the fluid free surface relative to the resting fluid.
20
+
21
+
An $f$-plane, in geophysical fluid dynamics, is an approximation that represents the vertical component of the coriolis force using a fixed coriolis frequency. The presence of a constant, non-zero coriolis frequency permits inertial oscillations and Kelvin waves.
22
+
23
+
For this simulation, we use the following parameters
24
+
25
+
* $g = 1 m s^{-2}$
26
+
* $f_0 = 10 s^{-1}$
27
+
* $\beta = 0 m^{-1} s^{-1}$
28
+
* $H = 1 m$
29
+
* $C_d = 0.25 s^{-1}$
30
+
31
+
### Domain Discretization
32
+
In this problem, the domain is a circle of radius 1m. The model domain meshed using [HOHQMesh](https://github.com/trixi-framework/HOHQMesh) and processed with [HOPr](https://github.com/hopr-framework/hopr). Within each element, the solution is approximated as a Lagrange interpolating polynomial of degree 7, using the Legendre-Gauss quadrature points as interpolating knots. To exchange momentum and mass fluxes between neighboring elements, we use a local upwind (Lax-Friedrich's) Riemann solver.
33
+
34
+
The physical parameters result in a gravity wave speed of $c= 1 m s^{-1}$. For this mesh, the elements are roughly isotropic with a length scale of about $\Delta x_e \approx 0.2 m$; with a polynomial degree of 7, the smallest resolvable length scale is roughly $\Delta x = \frac{0.2 m}{7^2} \approx 0.004 m$ .
35
+
36
+
For time integration, we use Williamson's low storage third order Runge Kutta and we choose a time step size of $\Delta t = 0.0025 s$ so that the CFL number associated with the gravity wave speed is $C_g = \frac{c \Delta t}{\Delta x} \approx 0.61 < 1$.
37
+
38
+
### Initial Condition and evolution of the model
39
+
The initial condition is defined by setting the free surface height to a Gaussian, centered at $(x_c,y_c) = (1,0)$, with a half width of 10 cm and a height of 1 mm.
This initial condition is initially out of balance, which causes an erruption of unbalanced flows, including gravity waves, inertia gravity waves, and Kelvin waves. The Kelvin waves are the result of the unbalanced flow up against the no-normal flow wall. Since the coriolis parameter is positive in this demonstration, the Kelvin waves propagate with the boundary (the "coast") on its right. For this circular domain, the Kelvin waves propagate in a counter-clockwise directtion.
<figcaption> Free surface height (<code>eta</code>) shortly after the initial condition. Here, we see a train of gravity waves propagating into the domain and a single peak Kelvin wave traveling along the boundary in a counter-clockwise direction. The initial disturbance is now adjusted into geostrophic balance.
49
+
</figcaption>
50
+
</figure>
51
+
52
+
The release of energy into the unbalanced flows allows the initial disturbance to come into geostrophic balance. As a result, in the vicinity of the initial disturbance, we see a stationary high pressure signal that remains in geostrophic balance.
53
+
54
+
55
+
56
+
57
+
## Running this example
58
+
59
+
To run this example, simply execute
60
+
61
+
```shell
62
+
# Set WORKSPACE to the path to the SELF source code
This will run the simulation from $t=0$ to $t=1.0$ and write model output at intervals of $Δ t_{io} = 0.05$. Model output can be visualized using `pyself` in python
68
+
From the SELF source code directory
69
+
70
+
```shell
71
+
# Assuming you are in the SELF source code directory
72
+
pip install . --upgrade
73
+
```
74
+
You can use the `examples/shallow_water_plot.py` script to plot the model output and generate movie of the free surface height.
The initial velocity field is calculated by using the pressure gradient force and using geostrophic balance; in SELF, this is handled by the `LinearShallowWater % DiagnoseGeostrophicVelocity` type bound procedure after setting the initial free surface height.
Copy file name to clipboardExpand all lines: docs/Tutorials/LinearShallowWater/ReflectingWave.md
+15-17Lines changed: 15 additions & 17 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,4 +1,4 @@
1
-
# Linear Shallow Water No Normal Flow Tutorial
1
+
# Reflecting Wave
2
2
3
3
This tutorial will walk you through using an example program that uses the `LinearShallowWater2D` class to run a simulation with the linear shallow water equations in 2-D. This example is configured using the built in structured mesh generator with no normal flow boundary conditions on all domain boundaries.
4
4
@@ -82,15 +82,18 @@ $$
82
82
83
83
The model is integrated forward in time using $3^{rd}$ order Runge-Kutta with a time step of $\Delta t = 0.5 s$.
Free surface height (<code>eta</code>) at time <code>t=1</code>.
93
-
</p>
94
97
95
98
## How we implement this
96
99
You can find the example file for this demo in the `examples/linear_shallow_water2d_nonormalflow.f90` file. This file uses the `LinearShallowWater2D` module from `src/SELF_LinearShallowWater2D_t.f90`.
@@ -243,14 +246,9 @@ Running this program should output twenty `shallow-water.00XX.tec` in the build
To run this example, you must first [install SELF](../../GettingStarted/install.md) . We assume that SELF is installed in path referenced by the `SELF_ROOT` environment variable.
0 commit comments