Skip to content

Blog

The shallow water equations

The governing equations in geophysical fluid dynamics can be simplified somewhat if the horizontal length and velocity scales are much larger than the vertical length and velocity scales, respectively.

They are commonly used to describe both the ocean and atmosphere, as well as estuaries, rivers and channels.

Adjustment of meteorological fields

According to Riddaway and Hortal, the set of coupled non-linear partial differential equations solved in numerical weather prediction (NWP) describe three important dynamical processses:

  1. Advection
  2. Diffusion
  3. Adjustment

The first two are familiar to the non-meteorologist more used to working with the general equations of fluid motion. The third, adustment, is described as 'how the mass and wind fields adjust to one another'.

Fredholm integral equations and the resolvent kernel

Consider the inhomogeneous Fredholm integral equation:

\[ H \psi(\mu) = \lambda \int_a^b \sigma(\mu, \mu') \psi(\mu') d\mu' + S(\mu) \]

The unknown to be solved for is \(\psi(\mu)\) where \(a \le \mu \le b\) is the independent variable, and the known function \(\sigma(\mu, \mu')\) is known as the kernel. This is an inhomogeneous equation because the known function \(S(\mu) \ne 0\).

Radiation pressure and the Stefan-Boltzmann law

In a previous post on Kirchhoff's law (1859) and black bodies , we saw that the energy density of thermal radiation is a function of temperature only. The first measurements of thermal radiation (from hot platinum wire) were made by Tyndall, and from his results Stefan concluded, in 1879, that the energy radiated went as the fourth power of the absolute temperature. This empirical relationship was later theoretically determined, for black bodies, by Boltzmann in 1884. The law that bears both their names is:

\[ R_B = \sigma T^4 \]

and \(\sigma\) is known as the Stefan-Boltzmann constant, and \(R_B\) is the emissive power, the radiant power emitted per unit area.

Thermal radiation, Kirchhoff's law, and black bodies

All matter continuously emits electromagnetic radiation as a consequence of its temperature. This radiation is called thermal radiation or heat radiation (although of course it isn't intrinsically different from electromagnetic radiation generated by any other means). Thermal radiation is what makes thermal imaging possible, and why hot embers glow, etc. From our everyday experience and from experimentation we can see that both the wavelength and intensity of radiation emitted depend in some way on the temperature of the matter.

CUDA basics part 2

Recently, I posted a basic introduction to CUDA C for programming GPUs, which showed how to do a vector addition. This illustrated some of the CUDA basic syntax, but it wasn't a complex-enough example to bring to light some of the trickier issues to do with designing algorithms carefully to minimise data movement. Here we move on to the more complicated algorithm for matrix multiplication, C = AB, where we'll see that elements of the matrices get used multiple times, so we'll want to put them in the shared memory to minimise the number of times they get retrieved from the much slower global (or device) memory. We'll also see that, because data that a thread puts into shared memory is only accessible by the other threads in the same thread block, we need to be careful how we do this.

CUDA basics part 1

Introduction

CUDA (Compute Unified Device Architecture) is an extension of C/C++, developed by NVIDIA, the GPU manufacturer, for programming their devices. (There is also a Fortran version, developed by PGI.)

The purpose of CUDA is to allow developers to program GPUs much more easily than previously, and since its inception in 2007, the use of GPUs has opened up beyond just graphics to more general, e.g. scientific, computing, which is often referred to as general-purpose GPU computing - GPGPU.