modelKPmethod

Extends from Icons.Method (Methods/functions icon).

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.

Parameters

TypeNameDefaultDescription
IntegerNNumber of segments

Components

TypeNameDefaultDescription
Real[2*N]UState vector
RealdxLength step
Realtheta1.3Parameter for slope limiter
Real[2*N]S_Source term vector S
Real[2*N,4]F_Vector F
Real[N,4]lam1Matrix of eigenvalues '+'
Real[N,4]lam2Matrix of eigenvalues '-'
Real[N + 4]Bzeros(N + 4)Additional for open channel
Real[2,2]boundaryValues for boundary conditions
Boolean[2,2]boundaryConBoundary conditions consideration
Real[2*N]diff_eqRight hand side for KP solution
Real[8,N]U_Matrix with boundary state values. Can be extracted
KPfunctions.PieceWiseUpieceWiseUUse function for defining the piece wise linear reconstruction of vector U
KPfunctions.SpeedPropagationApipespeedAUse function for defining the one-side local speeds propagation
KPfunctions.FluxesHfluxesHUse function for defining the central upwind numerical fluxes