# .OpenHPL.Functions.KP07.KPmethod

## Information

This is a well-balanced second order scheme, which is a Reimann problem solver free scheme (central scheme) while at the same time it takes the advantage of the upwind scheme by utilizing the local, one side speed of propagation (given by the eigenvalues of the Jacobian matrix) during the calculation of the flux at the cell interfaces.

#### Method description

The central-upwind numerical scheme is presented for one dimensional case.

The semi-discrete (time dependent ODEs) central-upwind scheme can be then written in the following from:

Here, in this function, the right hand side of the previous equation for the solution of KP07 scheme is calculated and returns as a output.

The central upwind numerical fluxes at the cell interfaces are given by:

For calculating the numerical fluxes Hi±½(t) and the values of Ui±½ are needed. These can be calculated as the end points of a piecewise linearly reconstructed function:

The slope si of the reconstructed function in each cell is computed using a limiter function to obtain a non-oscillatory nature of the reconstruction. The KP07 scheme utilizes the generalized minmod limiter as:

The ghost cells that are needed for thiese calculations can be defined in the following way:

Also the one-sided local speed of propagations can be estimated as the largest and the smallest eigen values of the Jacobian of the system as:

##### Parameters/variables description

This function needs the following input variables:

• vector: `U[2N,1]`
• number of segments: `N`
• step change of length: `Δx`
• parameter: `θ`
• matrix: `F(U±i±½)[2N,4]`
• vector: `S(U)[2N,1]`
• matrix of eigenvalues: `λ1,2(U±i±½)[N,4];`
• vector B which is additional for defining ghost cells and can be used for, e.g., an open channel (state `z=h+B`). In this case the input state vector `U` should include `h`, but the piecewise linear reconstruction of states will be done with `z`
• information about boundary conditions, as a matrix [2,2] of booleans true/false - depend on, which variable should be used
• matrix with values for boundary conditions [2,2]

In order to calculate matrix `F` and eigenvalues, it is possible to take out of the function the piecewise linear reconstruction of states matrix `U±i±½`. This matrix consists of following vectors ```U±i±½ = [U-i+½ U+i+½ U-i-½ U+i-½]```.

Examples of using this scheme are presented in KP07.TestKPpde.

Generated at 2024-06-18T18:16:02Z by OpenModelicaOpenModelica 1.22.4 using GenerateDoc.mos