# Numerics

### From ASAM-Wiki

** Grid structure **

- A cartesian or λ-φ-
*z*grid is used. - The orography and other obstacles (buildings) are cut out.
- This technique can be loosely described as
*cut cell*or*shaved cell*or*partial step*approaches. - The cut grid information is stored by the partial face and volume areas of each grid cell.
- This information is used for the spatial discretization.
- For the λ-φ-
*z*grid also the shape deformation is within these area information. - To parallelize the code the grid is decomposed in blocks.
- Blocks can have different resolution.

** Spacial discretization **

- Staggered/collocated arrangement of momentum components. (Staggered components are the main ones. Collocated components are used only as intermediate values.)
- The collocated (cell centered) momentum components are obtained by shifting the face values in both directions, and .
- Equations are discretized in the cell centers.
- Most of the discretization is performed with the face and cell area information.

Discretization of the continuity equation

and the advective part of any other equation

- .

The face values are determined by higher order interpolation.

** Temporal discretization **

The spatial discretized system is abbreviated as and integrated in time by a Rosenbrock-Method, which is a higher order linear implicit integration method. The following method is proposed by Lanser et al . and is of order 3.

with . Another
representation of the method

Error estimation by difference of two approximations of different
order.

The described Rosenbrock method allows a simplified solution of the linear systems without loosing the order. If the Jacobian matrix is decomposed in two parts the matrix can be replaced by . A further simplification can be reached by omitting some parts of the Jacobian or replacement of the derivatives by the same derivatives of a simplified operator: . A typical example is the replacement of higher order interpolation formula by simple constant upwind value. The Jacobian: has the following block structure

where 0 indicate, that this block is not included in the Jacobian. The derivative with respect to is only taken for the Buoyancy term in the vertical momentum equation.

The matrix is decomposed as

The first part is called the transport/source part because it contains the advection, diffusion and other source terms like Coriolis, curvature, Buoyancy, latent heat, and so on. The second matrix is called the pressure part. Both systems are solved by preconditioned CG--like methods. The first linear system

is preconditioned from the right with the matrix

and from the left with the matrix

- .

The matrix stands for advection/diffusion, its elements are coupled between grid cells and is the "same" for each component. The matrix assembles the source terms, here the coupling is between different components in each grid cell. The new matrix

can be written in the form

- .

Therefore only the LU-decomposition of the matrix

has to be stored and not the matrix itself. The matrix is inverted approximately by a fixed number of Gauss-Seidel iterations.

The coefficient matrix of the second equation has the form

where , , , and are diagonal matrices. Elimination of the momentum part gives a Helmholtz equation for the increment of the potential temperature. This equation is solved by a CG-method with multigrid as a preconditioner.