pygetm.internal_pressure module

class pygetm.internal_pressure.Base[source]

Bases: object

Base class for calculating the internal pressure gradient in x- and y-direction.

These gradients are represented by internal-pressure-associated tendencies of layer-integrated velocity, which equal the difference between tendencies associated with the total horizontal pressure gradient DP/dx (or DP/dy) and those associated with the external pressure gradient, which follows from the horizontal gradient in free surface elevation (dz/dx or dz/dy):

idpdx = -hu/rho0 * dP/dx + hu * g * dz/dx idpdy = -hv/rho0 * dP/dy + hv * g * dz/dy

with all quantities defined at the current (tracer) time level. Note that the rightmost terms, which remove the external pressure gradient, will be subtracted again in the momentum equations to recover the impact of the total pressure gradient.

__call__(buoy: Array)[source]

Update tendencies of layer-integrated velocity due to internal pressure.

Parameters:

buoy – buoyancy (m s-2)

idpdx: Array
idpdy: Array
initialize(ugrid: Grid, vgrid: Grid)[source]
class pygetm.internal_pressure.BlumbergMellor[source]

Bases: Base

Internal pressure gradient calculated as described by Blumberg and Mellor (1987).

class pygetm.internal_pressure.Prescribed(idpdx: float = 0.0, idpdy: float = 0.0)[source]

Bases: Base

Prescribed internal pressure gradient.

To set the gradients, provide arguments idpdx and idpdy when creating an instance, or call pygetm.core.Array.set() on the idpdx and idpdy attributes of the instance after initialization.

Parameters:
  • idpdx – initial tendency of layer-integrated x-velocity (m2 s-2)

  • idpdy – initial tendency of layer-integrated y-velocity (m2 s-2)

initialize(ugrid: Grid, vgrid: Grid)[source]
class pygetm.internal_pressure.ShchepetkinMcwilliams[source]

Bases: Base

Internal pressure gradient calculated as described by Shchepetkin and McWilliams (2003).