## Grid Creation & Boundary Conditions

## Grid

In order to create a numerical simulation, we first need to define discrete grid within the space where we want to compute the wanted values.

Within the created grid each discrete cell (i,j) is assigned a position (x,y). From this grid we can derive a subdivision of the area of interest into single discrete cells. Each cell thereby is seen as having constant values.

With number of steps in i and j-direction `I`

and `J`

and step widths: `\Delta i = \frac{1}{I - 1}`

and `\Delta j = \frac{1}{J - 1}`

## Cell Types

There are two types of cells: "Inner Cells" and "Boundary Cells"

### Inner Cells

Inner cells are of unknown state and have to be computed.

### Boundary Cells

Boundary cells are defined by given dependancies that link the regarded subspace to other outer conditions. Therefore values of boundary cells can be computed outside of the numerical solving algorithms.

#### Dependancies

There are two types of boundary dependancies: "Dirichlet" and "Neumann" conditions.

##### Dirichlet Conditions

Dirichlet conditions are defined by a known state of the regarde scalars value. Thus they define cells outside of the solved grid for which the scalar values can be directly computed.

##### Neumann Conditions

Sometimes the states of the boundary cells can not directly be computed, but we can conceive restrictions about their derivatives. These restrictions are known as Neumann conditions and can be visualized as dependancies of the boundary cells outer edges. When using Neumann conditions all cells' scalar values have to be computed, though the equations for the boundary and inner cells differ.