Articles | Volume 31, issue 4
https://doi.org/10.5194/npg-31-559-2024
https://doi.org/10.5194/npg-31-559-2024
Research article
 | 
05 Dec 2024
Research article |  | 05 Dec 2024

Dynamically optimal models of atmospheric motion

Alexander G. Voronovich
Abstract

A derivation of discrete dynamical equations for the dry atmosphere in the absence of dissipative processes based on the least action (i.e. Hamilton's) principle is presented. This approach can be considered the finite-element method applied to the calculation and minimization of the action. The algorithm possesses the following characteristic features:

  1. For a given set of grid points and a given forward operator (i.e. the mode of interpolation), through the minimization of action, the algorithm ensures maximal closeness (in a broad sense) of the evolution of the discrete system to the motion of the continuous atmosphere (a dynamically optimal algorithm).

  2. The grid points can be irregularly spaced, allowing for variable spatial resolution.

  3. The spatial resolution can be adjusted locally while executing calculations.

  4. By using a set of tetrahedra as finite elements the algorithm ensures a better representation of the topography (piecewise linear rather than staircase).

The algorithm automatically calculates the evolution of passive tracers by following the trajectories of the fluid particles, which ensures that all tracer properties required a priori are satisfied. For testing purposes, the algorithm is realized in 2D, and a numerical example representing a convection event is presented.

1 Introduction

The models simulating atmospheric dynamics are often built by replacing spatial and temporal derivatives in the continuous equations of motion (like conservation of momentum or mass) by corresponding finite-difference approximations. In finite-volume versions, the discrete approximations of spatial derivatives are also used for calculation of fluxes. There are numerous ways to proceed based on experience accumulated amongst different disciplines. The approaches that start from the continuous equations of motion and are pursued along these lines essentially ignore, however, the fact that the governing equations representing atmospheric dynamics themselves follow from the least action, or Hamilton's, principle (Eckart, 1960; Salmon, 1983) (LAP for brevity), and it is reasonable to take advantage of this fact. LAP states that the action, which is a time integral of the difference between the total kinetic and potential energy (i.e. the Lagrangian) of the system, is minimal for the actual evolution of a mechanical system. Application of LAP leads to the Euler–Lagrange equations of motion, which include the second-order derivatives of the state variables in time. By using the Liouville transformation, these equations can be cast into the Hamiltonian equations, which, being resolved with respect to the first-order time derivatives, are thus better amenable to both analytical and numerical solutions (Salmon, 1988).

To build a computer model of atmospheric motion, one has to pass from a continuous to a discrete system. There are at least two ways to achieve this within the Lagrangian/Hamiltonian approach. The first one is to replace a continuous Hamiltonian or Lagrangian by a discrete analogue (Salmon, 1983). If the Hamiltonian equations are formulated in non-canonical coordinates (e.g. Rolstone and Bruce, 1995), one also has to approximate the Poisson bracket (Eldred et al., 2019; Salmon, 2004). By maintaining corresponding symmetries, one also tries to ensure that the conservation laws of the original equations are inherited by the discretized ones as well (Salmon, 2004). An important advantage of the Hamiltonian and Lagrangian descriptions is that different approximations (like quasi-hydrostatic) can be done within this approach by modifying the corresponding Hamiltonian or Lagrangian (Shutts, 1989; Salmon and Smith, 1994; Rolstone and Bruce, 1995).

The second way is after selection of a discrete set of parameters (i.e. the finite number of degrees of freedom) to approximate an action of the continuous atmosphere. To do this, one has also to choose an observation (or forward) operator, i.e. a mode of interpolation allowing the state of the atmosphere to be unambiguously calculated at any spatial point based on the set of discrete parameters. Using this operator, one calculates approximately the action density of the continuous atmosphere in terms of the discrete parameters; integrates it over the space; and, by minimizing the result, obtains ordinary differential equations (ODEs) governing their evolution. Such an approach seems to be more consistent than approximating a Hamiltonian or Lagrangian. From this standpoint replacement of the continuous Hamiltonian/Lagrangian by a discrete analogue can be considered to be a piecewise-constant spatial approximation of the corresponding density. One can, however, use more accurate approximations; in this work, in particular, a piecewise-linear approximation is applied instead. In this case, the fields of atmospheric variables become piecewise continuous. One can refer to such atmospheric models as “dynamically optimal”, since for a given set of discrete parameters and a given mode of interpolation, the governing ODEs follow unambiguously, ensuring minimal action and thus the best approximation (from the standpoint of action minimization) of the dynamics of a continuous atmosphere. Such an approach is essentially a combination of the finite-element method and LAP.

The approach based on approximation of continuous action was considered recently in Gawlik and Gay-Balmaz (2021). In this work, however, an action of the compressible atmosphere was calculated in non-canonical coordinates, which leads to a minimization of action under certain constraints on variations. This interesting technique differs significantly from the approach pursued in this paper where the action is calculated in the canonical coordinates and there are no restrictions on the coordinates/momenta variations.

We are considering in this work the approximation of the action in a spatial domain by assuming only continuous dependence on time. However, one can discretize the calculation of action, not only in the spatial domain but in the time domain as well. Corresponding discrete time-evolution schemes are called variational integrators (Mardsen and West, 2001; Lew et al., 2003). Such an approach allows us to also use different time steps in different areas (asynchronous variational integrators), an option which should be of interest to the development of dynamical cores for weather and climate prediction models.

2 The action for a continuous atmosphere

This section describes mostly standard transformations (see, for example, Eckart,1960; Salmon,1988; Shutts,1989; Salmon and Smith, 1994) that precede the transition from continuous to discrete forms for the governing equations. Here, we will consider the case of a dry, rotating atmosphere, which is a base of a dynamical core. We begin with the following Eulerian equations that represent the adiabatic motion of dry air in the absence of losses:

(1) t v + ( v ) v + ϕ + 2 Ω × v + P ρ = 0 , t ρ + ( ρ v ) = 0 , t s + ( v ) s = 0 .

Here, the usual notation is used, with s being entropy per unit mass, ϕ the geopotential and Ω an angular velocity vector. The pressure P=P(α,s) is considered to be a function of the specific volume α=1/ρ and entropy (to distinguish pressure from a conjugated momentum p to be introduced later, we denote pressure with a capital letter). In the Lagrangian coordinates, these equations reduce to a single equation

(2) t 2 ξ + ϕ + 2 Ω × t ξ + P ρ = 0 ,

where ξ=ξ(t,a) is the displacement of a fluid particle from its original location at a. The entropy, which for a given fluid particle is conserved, is determined by its initial spatial distribution s0:

s=s0(a).

The density ρ in Eq. (2) follows from mass conservation and is given by the equation

(3) ρ ( t , a ) = ρ 0 ( a ) ( r ) ( a ) - 1 = ρ 0 ( a ) ( a + ξ ) ( a ) - 1 = ρ 0 ( a ) 1 + ( ξ ) ( a ) - 1 ,

where r=a+ξ is the Cartesian coordinate of a fluid particle, | | denotes the determinant of the corresponding matrix and ρ0(a) is the spatial distribution of density at t=0. Equation (2) represents Newton's second law. Note that the gradients in this equation are taken with respect to the Cartesian r rather than a coordinates.

The action A in the general case is defined as follows:

(4) A = t 0 t 1 L ( q i , q ˙ i ) d t ,

where qi is a set of arbitrary parameters characterizing the system state, and q˙i denotes their time derivatives. The index i can be either discrete or continuous. The “star” index in L is introduced to distinguish the total Lagrangian L from its (spatial) density L=dL/da, where da means an element of volume with respect to a coordinates. The least action principle

(5) δ A = 0

results in the following (Euler–Lagrange) evolution equations:

(6) d d t L q ˙ i - L q i = 0 .

We now demonstrate that Eq. (2) follows from LAP (Eq. 5) for

L(ξ,tξ)=L(ξ,tξ,a)da,

with the Lagrangian density L defined as follows:

(7) L ( ξ , t ξ , a ) = ρ 0 ( a ) { 1 2 ( t ξ ) 2 - E ( α , s 0 ( a ) ) - g ( n ξ ) - Ω ( t ξ × ξ ) } .

In Eq. (7), E(α,s) is the internal energy of the dry air per unit mass, n is a unit vector directed upwards along the gradient of geopotential and g is its magnitude.

Let us calculate variation of the total energy with respect to ξ, taking into account that according to the basic thermodynamic identity Tds=dE+Pdα, one has P=-(E/α)s:

δρ0(a)E(α,s0(a))da=ρ0Eαδαda=-ρ0Pδ1ρ0(a)rada=-Pi,j=13Cijajδξida=-(Nδξ)PdΣ+i,j=13PajCijδξida.

Here, Cij is the cofactor of the (i,j)th entry of matrix r/a (i.e. the determinant of this matrix with the ith row and jth column deleted multiplied by (-1)i+j). Integration by parts (i.e. use of the Gauss theorem) leads to appearance of the first (surface) term, with N being a unit outward normal to the boundary of the medium Σ. It is easy to make sure that jCij/aj=0; for this reason, the derivatives of Cij in the equation above are absent. Considering that the matrix of cofactors transposed is proportional to the inverse matrix, one has

Cij=rara-1ji=raajri.

Taking into account that according to Eq. (3), |r/a|=ρ0/ρ, one finds

j=13PajCij=ρ0ρj=13Pajajri=ρ0ρPri,

where now P in the last equation above is considered to be a function of r rather than a. As a result, we obtain

(8) δ ρ 0 ( a ) E ( α , s 0 ( a ) ) d a = - ( N δ ξ ) P d Σ + ρ 0 ρ P r δ ξ d a .

Now, calculating the variation of the action Eqs. (4) and (7) and integrating terms proportional to tδξ by parts with respect to time yields

(9) δ A = - d t d a ρ 0 ( a ) ( t 2 ξ + g n + 2 Ω × t ξ + 1 ρ P r ) δ ξ + ( N δ ξ ) P d Σ d t .

We can see that the requirement δA=0 in Eq. (9) for internal points in fact coincides with Eq. (2). The internal energy of dry air E=CVT in terms of the variables (α,s) is given by

(10) E ( α , s ) = p 00 α 00 γ γ - 1 α 1 - γ e s / C V ,

where p00 and α00 are reference values of pressure and specific volume, and γ=CP/CV is, as usual, the ratio of specific heats.

To derive a set of numerically accessible dynamical equations that adequately describe the evolution of the continuous atmosphere requires one additional standard step. One difficulty is that the left-hand side (LHS) of Eq. (6) in the discrete case will generally contain a mix of second derivatives of the discrete coordinates q¨i with different indices, and as they are not being resolved with respect to q¨i, the resulting equations are ill-suited for numerical solution. This issue can be resolved by representing Eq. (6) in the Hamiltonian form. Namely, we introduce the momenta pi according to the relation

(11) p i = L q ˙ i

and express q˙i from these equations as functions of q and p. From this point forward, the variable p will stand for conjugated momentum. We introduce the Hamiltonian H(q,p) instead of the Lagrangian L(q,q˙) according to the equation

(12) H ( q , p ) = i q ˙ i p i - L ( q , q ˙ ) ,

where all q˙i values have been expressed as functions of q and p, as noted above. It is not difficult to show using Eqs. (11) and (12) that the following (Hamiltonian) equations hold:

(13) q ˙ i = H p i , p ˙ i = - H q i .

These expressions follow by applying LAP (Eq. 5) to

(14) A = t 0 t 1 i q ˙ i p i - H ( q , p ) d t

and varying the variables qi and pi independently. In what follows, we will only be using LAP in this form.

Substituting Eq. (7) into Eq. (11), we obtain

(15) p ( t , a ) = L ( ξ , t ξ , a ) ( t ξ ) = ρ 0 ( a ) ( t ξ + Ω × ξ ) .

Expressing tξ in terms of p and ξ and substituting the result into Eq. (12) after simple transformations for the density of the Hamiltonian yields

(16) H ( ξ , p ; a ) = ( p - ρ 0 ( a ) Ω × ξ ) 2 2 ρ 0 ( a ) + ρ 0 ( a ) E ( α , s 0 ( a ) ) + g ρ 0 ( a ) ( n ξ ) .

The Hamiltonian equations (Eq. 13) read

tξ=δHδp=p-ρ0(a)Ω×ξρ0(a)tp=-δHδξ=(p-ρ0(a)Ω×ξ)×Ω-gρ0(a)n-ρ0(a)ρPr.

By differentiating the first of these equations with respect to time and inserting tp from the result using the second equation, we make sure that the result coincides in fact with Eq. (2).

Finally, the expression in Eq. (14) for the action for the continuous atmosphere reduces to

(17) A = t 0 t 1 d t d a { p t ξ - ( p - ρ 0 [ Ω , ξ ] ) 2 2 ρ 0 ( a ) - ρ 0 ( a ) E ( α , s 0 ( a ) ) - g ρ 0 ( a ) ( n ξ ) } .
3 The action for a discrete atmospheric model

We now need to select a set of discrete parameters that represent a continuous atmosphere and a way of interpolating these parameters to an arbitrary spatial point. The model that will be used here is as follows. We split the region of interest into a set of unstructured connected tetrahedra that share vertices, edges and faces. We select values for the displacements ξ and momenta p, as well as the density ρ0 and specific entropy s0, at the vertices, which define a set of discrete parameters that represent the continuous atmosphere. To calculate corresponding parameters at an arbitrary point within each tetrahedron, we will be using linear interpolation. We note that four values of a parameter at the four vertices of a tetrahedron completely determine its linear interpolation within the tetrahedron. The piecewise-linear interpolation ensures a globally continuous representation of the corresponding fields throughout the region. Derivatives along the faces of tetrahedra are also continuous; however, derivatives across the faces experience jumps, which for a sufficiently dense set of tetrahedra are negligible. Let us also note that such interpolation ensures calculation of the action to the accuracy of the square of the ratio of a linear size of the tetrahedra to a spatial scale of variations of atmospheric parameters.

We can now approximate the action A by Ã, where

(18) A A ̃ = T A T ,

where the index T stands for an individual tetrahedron, and the summation aggregates the contribution from all tetrahedra. The action AT is calculated according to Eq. (17), where the integral is over the volume occupied by the Tth tetrahedron.

Let us consider the first term ptξ in Eq. (17). The following relation can be shown to hold true for two linear functions of coordinates u(a) and v(a) defined within a tetrahedron by linear approximations based on their values ui, vi and i=1,2,3,4 at the vertices of the tetrahedron:

(19) T u ( a ) v ( a ) d a = | V T | 4 ( i = 1 4 u i v i - 1 2 i , j = 1 4 ( u i - u j ) ( v i - v j ) ) .

Here |VT| is the tetrahedron's volume. The same equation also holds in the 2D case, with the 1/4 factor replaced by 1/3 and summations proceeding from 1 to 3. For smooth fields, the differences in the second term in the right-hand side (RHS) of Eq. (19) will be proportional to the ratio of the linear size of the tetrahedron to the characteristic scale of the parameter's variation, and the magnitude of the entire second term will be proportional to the square of this ratio and can generally be neglected when compared to the first term in Eq. (19). We then find

(20) T p t ξ d a | V T | 4 i = 1 4 p i t ξ i .

Here and below, vector symbols (bold italic) indicate 3D vectors, and indices correspond to vertices. Dots between vectors denote scalar products with respect to 3D vector coordinates, correspondingly. We note, however, that the neglected term in Eq. (19) can be retained by replacing (to a first approximation) the differences tξi-tξj in Eq. (19) by H/pi-H/pj. This will result in the following modification to the Hamiltonian density in Eq. (16) within the corresponding tetrahedron:

H(ξ,p;a)H(ξ,p;a)-18i,j=14(pi-pj)Hpi-Hpi.

The transition from a continuous to discrete description of the mechanical system based on the approximation of action, which is pursued here, differs from the more customary approximation of a continuous Hamiltonian by a discrete analogue (Salmon, 1983).

Using Eq. (20) we can represent the action as

(21) A ̃ = t 0 t 1 d t T | V T | ( 1 4 n ( T ) p n ( T ) t ξ n ( T ) - H ̃ T ( ξ n ( T ) , p n ( T ) ) ) ,

where

(22) H ̃ T ( ξ n ( T ) , p n ( T ) ) = 1 | V T | T H ( ξ , p ; a ) d a

is the Hamiltonian in Eq. (16) integrated over the Tth tetrahedron and normalized by its volume. H̃T is a function of shifts and momenta at the vertices of the tetrahedron ξn(T) and pn(T), where n(T) stands for indices of the set of four vertices of the Tth tetrahedron. In Eq. (21), we now replace the summation over tetrahedra with a summation over vertices and represent it in the following form:

(23) A ̃ = t 0 t 1 d t k ( v k p k t ξ k - τ T ( k ) | V τ | H ̃ τ ( ξ n ( τ ) , p n ( τ ) ) ) .

Here, T(k) represents indices of the tetrahedra that contain the vertex with index k, and the summation within the outward parentheses in Eq. (23) aggregates the contribution over all such tetrahedra. The parameter vk is a quarter of the sum of their volumes:

(24) v k = 1 4 τ T ( k ) | V τ | .

Equation (23) describes an approximation of the action for a continuous atmosphere in terms of a finite set of discrete parameters. We can now write the equation for the evolution of these parameters by minimizing Ã in Eq. (23) as

(25) t ξ k = 1 v k τ T ( k ) | V τ | p k H ̃ τ ( ξ n ( τ ) , p n ( τ ) ) , t p k = - 1 v k τ T ( k ) | V τ | ξ k H ̃ τ ( ξ n ( τ ) , p n ( τ ) ) .

Note that the action in Eq. (23) can be cast precisely into the form in Eq. (14) by rescaling coordinates and momenta, thus making the corresponding system explicitly Hamiltonian, although this step is not needed here. Since the approximate action is invariant with respect to shifts in time, the approximate energy is conserved. Similarly, if the exact action is invariant with respect to geometrical transformations like shifts in space or rotations, the approximate action will inherit this property along with corresponding conservation laws. In this case conservation will be exact; however, the conserved values will be calculated approximately.

Equation (25) can be solved numerically using a suitable integration scheme (e.g. Runge–Kutta). There are also time-integration schemes that conserve energy exactly (namely symplectic (Eldred et al., 2019) and variational (Mardsen and West, 2001; Lew et al., 2003)).

3.1 Lagrangian reassignment

To be able to repeat the time step, we have to reassign values of momenta pk at corresponding vertices, whose locations ak are fixed in space. The familiar procedure of the Lagrangian reassignment (a.k.a. semi-Lagrangian advection, Lagrangian remapping, etc.) is detailed in this subsection in conjunction with the linear interpolation employed in this work. We emphasize that ξk and pk in Eq. (25) are Lagrangian coordinates, and pkt) is the momentum of a fluid particle which at tt is located at a point rk=ak+ξk(Δt) and not at ak. For this reason, we have to first determine which particle moved to ak at tt and then calculate its momentum using the forward operator (i.e. linear interpolation). This value will be an initial condition for pk in Eq. (25) for the next time step. The initial values of entropy and passive tracers will also correspond to the fluid particle that moved to ak. These should be reassigned as well. The initial values of shifts are always ξk=0. By making these reassignments, we are essentially returning to the Eulerian description of fluid motion.

To determine the initial location of a fluid particle that arrived at a point R at a time tt, we proceed as follows. The position of an arbitrary point within a tetrahedron can be expressed as follows:

(26) r = a 4 + ( a 1 - a 4 ) τ 1 + ( a 2 - a 1 ) τ 2 + ( a 3 - a 2 ) τ 3 ,

where ai denotes the Cartesian coordinates of the ith vertex of the tetrahedron, and the fourth vertex was arbitrarily selected in Eq. (26) as a base point. For the point r to be within the tetrahedron, the scalar dimensionless parameters τi (which have nothing to do with τ in Eqs. (24) and (25)) should satisfy

(27) 1 > τ 1 > τ 2 > τ 3 > 0 .

Due to the assumption of a linear dependence of the shifts ξ on the Cartesian coordinates within a tetrahedron, the fluid particle located at r at t=0 at the end of a time step at tt will experience a shift given by an expression similar to Eq. (26), that is

(28) ξ = ξ 4 + ( ξ 1 - ξ 4 ) τ 1 + ( ξ 2 - ξ 1 ) τ 2 + ( ξ 3 - ξ 2 ) τ 3 ,

where ξi, i=1,,4 are shifts of fluid particles located at corresponding vertices at t=0; these shifts are known as a result of numerical integration of Eq. (25). The requirement of the fluid particle to translate from a point r to a point R is given by

r+ξ=R.

Substituting into this equation Eqs. (26) and (28), we obtain the following vector linear equation with respect to the parameters τi :

(29) i = 1 3 ( a i - a 4 + ξ i - ξ 4 ) τ i = R - a 4 - ξ 4 .

The fluid particle can in principle arrive at the kth vertex from any tetrahedron from the set T(k); however, the condition in Eq. (27) selects the appropriate tetrahedron.

The existence and uniqueness (non-degeneracy) of solutions to Eq. (29) may be explained as follows. Let us consider the trajectories of fluid particles. The fluid particle that at t=0 was located at the vertex with coordinates ai at a later moment of time t will be located at a point ri(t)=ai+ξi(t). Points ri form vertices of a shifted tetrahedron onto which the initial tetrahedron is mapped. Note that shifts ξ of the fluid particles inside a tetrahedron are assumed to be linear functions of the shifts of the fluid particles located at the vertices of the tetrahedron: this is our basic (linear) approximation of the forward operator (see the first paragraph of Sect. 3). Thus, the initial tetrahedron with the vertices at the points ai linearly (more precisely, affinely) mapped onto a shifted tetrahedron with vertices at ri; the transformation is linear regardless of the trajectories of the fluid particles, which started from the vertices ai being linear or curved. In particular, faces and edges of the initial tetrahedron are mapped onto corresponding faces and edges of the shifted tetrahedron. Since shifts of the internal points of the tetrahedron are linear functions of coordinates, the Jacobian of the linear transformation of the initial tetrahedron within it is constant (the constants for different tetrahedrons are, of course, also different, and they depend on time t). Thus, piecewise linearity of the forward operator ensures that the mapping of the whole initial volume onto the shifted volume is also piecewise linear, and the mapping is one to one provided that neither tetrahedron in the course of evolution degenerates (i.e. tetrahedra volumes never become zero). The latter is achieved by adopting a Courant-limited time step based on the fastest wave mode that the equations admit (here, the sound speed), which also ensures that time integration errors remain small. Non-degeneracy of the initial tetrahedrons can be checked easily, since trajectories of the fluid particles at the vertices are calculated in the course of numerical integration.

The value of any parameter within a tetrahedron at the end of a time step is given by an expression quite similar to Eq. (28). For example, the momentum at a time tt at a vertex with Cartesian coordinate R is given by

(30) p = p 4 + ( p 1 - p 4 ) τ 1 + ( p 2 - p 1 ) τ 2 + ( p 3 - p 2 ) τ 3 ,

where pi=pit) denotes the momenta which are also known as a result of numerical integration of Eq. (25). The parameters τi in Eq. (30) follow from the solution of Eq. (29). The resulting p in Eq. (30) is the momentum, which has to be reassigned to corresponding vertex as an initial condition for the next time step. The specific entropy at the vertices should also be redefined according to Eq. (30), where now the values of s0 at t=0 should be substituted for pi (since the entropy of the fluid particle is conserved). All other passive tracers should be similarly redefined. The value of the density ρ0 at the kth vertex should be redefined using Eq. (3) with respect to the same tetrahedron and the same fluid particles that were used for recalculating the momentum and entropy (i.e. with the same τi following from Eq. 29).

3.2 Local Hamiltonian calculation

We consider now the calculation of the Hamiltonian H̃, which forms the basis of the numerical model. We note that Eq. (25) describes the evolution of the model parameters and includes the derivatives of H̃. For simplicity, here, we assign the indices n=1,2,3,4 to the vertices of a tetrahedron. We now recast the integration over a in Eq. (2) into an integration over the dimensionless parameters τ1,2,3 according to Eq. (26). The functions ξ(a), p(a), ρ0(a) and s0(a) are calculated according to the selected forward operator, i.e. by linear approximation, quite similar to Eqs. (28) and (30):

(31) f ( τ i ) = f 4 + ( f 1 - f 4 ) τ 1 + ( f 2 - f 4 ) τ 2 + ( f 3 - f 4 ) τ 3 ,

where f is any parameter (vector or scalar), and fn is a value of f at the nth vertex.

According to Eq. (25) we have

(32) H ̃ T ( ξ n , p n ) = 6 0 1 d τ 1 0 τ 1 d τ 2 0 τ 2 d τ 3 H ( ξ ( τ n ) , p ( τ n ) ; τ n ) ,

where H is given by Eq. (16) and ξ(τn) and p(τn) by Eq. (31). Afterwards, the LHS of Eq. (32) becomes a function of the values of the displacements ξ and momenta p at the vertices of the tetrahedron. Note that since ξ is a linear function of coordinates a, the Jacobian in Eq. (3) is a constant independent of a, and we can write

α(τn)=Δ0(ξn)ρ0(τn),

where Δ0(ξn) is the value of the Jacobian. The internal energy in Eq. (16) can then be expressed as

(33) ρ 0 E ( α , s 0 ) = p 00 α 00 γ γ - 1 ( Δ 0 ( ξ ) ) 1 - γ ( ρ 0 ( τ n ) ) γ × exp s 0 ( τ n ) C V .

To calculate the integral in Eq. (32) related to the internal energy term, we note that variations of density within a tetrahedron are generally small and set

(34) ( ρ 0 ( τ n ) ) γ = ρ 4 γ 1 + n = 1 3 β n τ n γ = ρ 4 γ 1 + γ n = 1 3 β n τ n + γ ( γ - 1 ) 2 n = 1 3 β n τ n 2 + ,

where the factors

(35) β n = ρ n - ρ 4 ρ 4

are also small, so that one only needs to retain the first few expansion terms in Eq. (34). One can similarly expand the exponential term in Eq. (33) into a power series. In this case calculation of the integral in Eq. (32) with respect to the internal energy term also reduces to an integration of polynomials of τ1,2,3. Alternatively, one can leave the exponential term in Eq. (33) as is since the exponent is a linear function of τ1,2,3, and integrals of products of polynomials and exponentials can be calculated analytically nearly as easily as integrals of polynomials. In the first term in the RHS of Eq. (16) (the kinetic energy), we also expand 1/ρ0(τi) according to Eq. (34), where now in place of γ we substitute 1. Then, the integrations over τ1,2,3 in this term also reduce to an integration of polynomials, and this is done analytically.

Now, we consider boundary conditions that follow from LAP. They are due to the last (surface) term in Eq. (9) and require that at the boundaries either the pressure or (N,δξ) is zero. Thus, without restrictions on the variations of shifts of the boundary points, the pressure at the boundary should be zero. Such a boundary condition can be applied reasonably to the top of the atmosphere (the issue of an absorbing layer is beyond the scope of this paper) but is unacceptable elsewhere. For such boundary points, we will assume that both the shifts ξk and momenta pk are prescribed functions of time so that δξk=0. Equations for the corresponding k are excluded from the set in Eq. (25). Note that p and ξ are related through Eq. (15), and it is sufficient to prescribe a time dependence to only one or the other. In particular, at the bottom of the atmosphere, one can use the no-slip boundary condition ξ=0. To introduce different boundary conditions, one would need to add corresponding terms to the expression for the action.

Our numerical approach proceeds as follows. We introduce an array of tendencies (i.e. the time derivatives tξk, tpk) with the total number of columns equal to the total number of vertices – one column per vertex. To calculate the RHS of the evolution equations in Eq. (25), we initiate a loop not over vertices but over tetrahedra. After calculating the derivatives H̃τ/pk and H̃τ/ξk for all four vertices of a particular tetrahedron (which results in eight vectors with a total of 24 scalar parameters), we add/subtract the result to/from the tendencies being accumulated in the corresponding columns of the tendencies array. After all the tetrahedra are accounted for, the RHS of Eq. (25) will appear automatically. To execute this procedure, we also introduce an integer array with the same number of columns, with each column containing four indices of vertices belonging to a corresponding tetrahedron.

The algorithm under consideration easily allows us to modify the set of tetrahedra during simulations. If after a time step one finds that in a particular region spatial resolution should be increased, the corresponding tetrahedra are split into two. Each split tetrahedron is flagged, and two new tetrahedra are added. This operation can be repeated as many times as necessary. Similarly, previously split tetrahedra can be recombined into larger ones by reversing the process. The evolution is then calculated with respect to the modified set of tetrahedra.

4 A numerical example

The algorithm under consideration was tested for a 2D case for simplicity. The Hamiltonian structure can be introduced into the hydrodynamics in many different ways (Salmon, 1988), and the formulation used in this section is significantly different from the one used in Sects. 2 and 3. It is important, however, that the essence of the approach that is advocated in this paper is still the same: approximation of the action using linear interpolation of canonical variables within corresponding simplexes. In the 2D case tetrahedra are replaced by triangles and volumes by corresponding areas.

The following formulation was used in this section:

(36) H = d V ρ 1 2 v 2 + g z + E ( ρ , s ) + Ψ ( s ) ,

where

(37) v = φ - λ ρ s

is velocity; ρ and s are the density and specific entropy, respectively, which play the role of coordinates; and φ and λ are conjugated momenta, which do not have a direct physical interpretation. A gauge function Ψ(s) is chosen to ensure hydrostatic equilibrium for the corresponding model of the atmosphere. The Hamiltonian (Eq. 36) was suggested in Goncharov et al. (1976), where the function Ψ(s) corresponded to the isothermal atmosphere. Here, this function was chosen for the more realistic case of an atmosphere with a constant temperature gradient:

(38) T ( z ) = T 00 1 - z H .

In this case, one sets

(39) Ψ ( s ) = - g H + ( g H - C P T 00 ) exp - s β 0 C V ,

where

β0=gHCvT00-γ.

The governing equations for the continuous case are as follows:

(40) t ρ = δ H δ φ = - ( ρ v ) , t φ = - δ H δ ρ = - v φ + v 2 2 - g z - ρ E ρ s - Ψ ( s ) , t s = δ H δ λ = - v s , t λ = - δ H δ s = - ( λ v ) - ρ T - ρ Ψ ( s ) .

Similar to the approach presented in the previous sections, we split the atmosphere into a set of triangles and linearly interpolate all four prognostic variables (ρ,s,φ,λ) within the triangles. The approximation in Eq. (20) was used for the action, where the factor of 1/4 was replaced by 1/3 and the volume by the area. The resulting discrete evolution equations are quite similar to Eq. (25) and are as follows:

(41) t ρ k = 1 σ k χ T ( k ) | Σ χ | H ̃ χ φ k , t φ k = - 1 σ k χ T ( k ) | Σ χ | H ̃ χ ρ k , t s k = 1 σ k χ T ( k ) | Σ χ | H ̃ χ λ k , t λ k = - 1 σ k χ T ( k ) | Σ χ | H ̃ χ s k ,

where now

(42) H ̃ χ ( ρ n , s n , φ n , λ n ) = 2 0 1 d τ 1 0 τ 1 d τ 2 × H ( ρ ( τ n ) , s ( τ n ) , φ ( τ n ) , λ ( τ n ) ; τ n ) .

Here, H is given by Eq. (36), and χ,T(k) corresponds to triangles instead of tetrahedra with

σk=13χT(k)|Σχ|,

where χ| represents the area of the χth triangle.

We note that the Hamiltonian in Eq. (36) can be applied to the 3D case as well. For this case, however, we only have two free parameters φ and λ to represent the velocity field in Eq. (37), and this is generally insufficient. This problem can be resolved by introducing two additional parameters into the representation for the velocity in Eq. (37):

(43) v = φ - λ ρ s + ζ μ .

The form of the Hamiltonian in Eq. (36) and the procedure for calculating the action do not change, and another pair of equations needs to be added to Eq. (40) that correspond to the conservation of ζ and μ along the trajectories of fluid particles. Still, the Hamiltonian in Eq. (16) seems to be a better option.

https://npg.copernicus.org/articles/31/559/2024/npg-31-559-2024-f01

Figure 1Snapshots of the isolines of the entropy (potential temperature) field at selected times for the numerical example described in Sect. 4 (distances along the axes are in km).

Download

For our simulation, a standard atmosphere was chosen with an effective height H= 4.5 × 104m and surface temperature T00= 288 K (see Eq. 38; in this case β0≈0.75). A section of the atmosphere with a total length of 500 km and height of 3 km was split initially into 25 layers in the horizontal and 15 layers in the vertical, which resulted in 750 triangles. To simulate a convective event, we added a term qλ to the Hamiltonian density in Eq. (36), so that the equation for entropy in Eq. (40) (the first equation in the second line) included an additional term equal to q in the RHS (a local heat source). We assumed that the heat source had a Gaussian shape, in both space and time, with characteristic scales of 100 km in the horizontal, 500 m in the vertical and 200 s in time. The source was centred at a height of 1 km. The maximal intensity of the heat source was chosen to be 0.6 W kg−1, which corresponds to a rain rate of 1 mm h−1. To simulate the effects of topography, a hill of 500 m height, stretching for 80 km in the horizontal (also of Gaussian shape) centred at 125 km, was included. Boundary conditions correspond to zero mass fluxes at the top and the bottom of the atmosphere, and the motion was assumed periodic in the horizontal direction. Our simulation lasted for 600 s, and a fourth-order Runge–Kutta method was used for integration. To check the functionality of the algorithm with respect to the splitting/recombination of the triangles, the code was forced to split them if the difference in the intensity of the heat source at the vertices exceeded a certain threshold and recombine them if the difference was less than another threshold. The time step used Δt= 0.25 s was rather small due to the fact that fast-propagating sound waves are fully accounted for (see also the comment on uniqueness of mapping after Eq. 29). It was found that mass was conserved to machine precision; conservation of energy was not checked because the numerical example included heating of the atmosphere.

The isolines of entropy (i.e. potential temperature) are plotted in a series of images as solid lines in Fig. 1 for five snapshots in time. The triangles (a bit skewed due to presence of the hill) are shown by thin lines. The split triangles are emphasized. One can see the development of convection and appearance of the irregular structure within the convective cell that is due most likely to convective instability.

5 Conclusions

The dynamical core for simulation of atmospheric motion presented in this paper can be considered to be a finite-element method combined with the least action principle. It includes features of both a Eulerian and Lagrangian description of fluid motion. The discrete set of parameters representing the atmosphere at the beginning and at the end of each time step correspond to the same set of spatial points with the associated fluid particles located at these points (i.e. a Eulerian description). The evolution within a time step, however, makes use of the Lagrangian description of fluid motion. The advantages of this approach include the following:

  1. For a given set of grid points and a given forward operator (i.e. the mode of interpolation), through a minimization of action, the algorithm ensures a maximal closeness (in a broad sense) of the evolution of the discrete system to the motion of the continuum atmosphere (i.e. a dynamically optimal algorithm).

  2. The grid of selected discrete points can be irregular, allowing for a variable resolution in space.

  3. The spatial resolution can be adjusted locally while executing calculations.

  4. The use of a set of tetrahedra as finite elements in the algorithm ensures a better (piecewise linear rather than staircase) representation of topography.

  5. The algorithm automatically calculates the evolution of passive tracers by following the trajectories of the fluid particles, which ensures that all passive tracer properties required a priori are satisfied.

For demonstration purposes, the algorithm presented here considers only the very simple case of a dry atmosphere and the evolution of an arbitrary number of passive tracers. To consider a real atmosphere, one has to add heat sources and turbulent stresses to the RHS of Eq. (25). To include heating/cooling of the atmosphere, passive tracers such as water vapour and hydrometeors need to be added to the development. Their influence can be accounted for by considering the variation of entropy of the fluid particles at each time step by including heat exchange processes at the grid vertices, or, more accurately if needed, with account of the motion of the fluid particles. At this stage, one would need information regarding brightness temperatures from corresponding radiative transfer calculations. The effects of turbulence can also be included by adding Reynolds stresses τij to the development through an additional term

i,jτijξi/aj

in action (Eq. 21) and integration over the tetrahedra, which would provide the corresponding contributions to the evolution of momenta in Eq. (25).

Future work should consider standard tests for a dynamical core and possibilities for code optimization.

Code availability

The code is available by contacting the author.

Data availability

No data sets were used in this article.

Competing interests

The author has declared that there are no competing interests.

Disclaimer

Publisher's note: Copernicus Publications remains neutral with regard to jurisdictional claims made in the text, published maps, institutional affiliations, or any other geographical representation in this paper. While Copernicus Publications makes every effort to include appropriate place names, the final responsibility lies with the authors.

Acknowledgements

The author expresses his gratitude to the NOAA Physical Sciences Laboratory for support of this work. The author is also very much indebted to Richard J. Lataitis, who carefully read the manuscript and made many valuable suggestions. The author appreciates constructive comments made by the reviewers. The author is particularly indebted to one of the reviewers, whose insights and thorough examination of details helped to significantly improve this work.

Review statement

This paper was edited by Zoltan Toth and reviewed by three anonymous referees.

References

Eckart, C.: Variational principles of hydrodynamics, Phys. Fluids, 3, 421–427, 1960. 

Eldred, C., Dubos, T., and Kritsikis, E.: A quasi-Hamiltonian discretization of the thermal shallow water equations, J. Comput. Phys., 379, 1–31, https://doi.org/10.1016/j.jcp.2018.10.038, 2019. 

Gawlik, E. S. and Gay-Balmaz, F.: A variational finite element discretization of compressible flow, Found. Comput. Math., 21, 961–1001, https://doi.org/10.1007/s10208-020-09473-w, 2021. 

Goncharov, V. P., Krasil'nikov V. A., and Pavlov, V. I.: A contribution to the theory of wave interactions in stratified media, Izv. Atmos. Ocean. Phy.+, 12, 1143–1151, 1976. 

Lew, A., Mardsen, J. E., Ortiz, M., and West, M.: An overview of variational integrators, in: Finite Element Methods: 1970's and Beyond, edited by: Franca, L. P., CIMNE, Barcelona, Spain, 2003. 

Mardsen, J. E. and West, M.: Discrete mechanics and variational integrators, Acta Numer., 357–514, 2001. 

Roulstone, I. and Bruce, S. J.: On the Hamiltonian formulation of the quasi-hydrostatic equations, Q. J. Roy. Meteor. Soc., 121, 927–936, 1995.  

Salmon, R.: Practical use of Hamilton's principle, J. Fluid Mech., 132, 431–444, 1983. 

Salmon, R.: Hamiltonian fluid mechanics, Ann. Rev. Fluid Mech., 20, 225–236, 1988. 

Salmon, R.: Poisson-bracket approach to the construction of energy- and potential-enstrophy-conserving algorithm for the shallow-water equations, J. Atmos. Sci., 61, 2016–2036, 2004. 

Salmon, R. and Smith, L. M.: Hamiltonian derivation of the nonhydrostatic pressure-coordinate model, Q. J. Roy. Meteor. Soc., 120, 1409–1413, 1994. 

Shutts, G. J.: Planetary semi-geostrophic equations derived from Hamilton's principle, J. Fluid Mech., 208, 545–573, 1989. 

Download
Short summary
A derivation of discrete dynamical equations for the dry atmosphere without dissipative processes based on the least action principle is presented. For a given set of generally irregularly spaced grid points and a given mode of interpolation, through the minimization of action, the algorithm ensures maximal closeness of the evolution of the discrete system to the motion of the continuous atmosphere. The spatial resolution can be adjusted while executing calculations.