This package contains the LaxWendroffFlux block for the computation of fluxes at the cell boundaries.
Release Notes:
| Name | Description |
|---|---|
PDE.FiniteVolume.Fluxes.LaxWendroffFlux.LaxWendroff
Implements the Lax-Wendroff flux. By using this flux, the average update rule becomes:
Release Notes:
| Type | Name | Default | Description |
|---|---|---|---|
| Integer | n | worldModel1.n | |
| Integer | gcl | worldModel1.gcl | |
| Integer | gcr | worldModel1.gcr | |
| Real | deltax | 1/n | |
| Real | deltat | worldModel1.deltat |
| Type | Name | Description |
|---|---|---|
| input RealInput | u[worldModel1.n + worldModel1.gcr + worldModel1.gcr] | |
| input RealInput | u1 | |
| output RealOutput | y[worldModel1.n + 1] |
block LaxWendroff
extends Icons.BlockIcon;
outer PDE.World.worldModel worldModel1;
parameter Integer n = worldModel1.n;
parameter Integer gcl = worldModel1.gcl;
parameter Integer gcr = worldModel1.gcr;
parameter Real deltax = 1/n;
parameter Real deltat = worldModel1.deltat;
equation
for i in 1:n+1 loop
y[i] = 0.5*u1*(u[gcl+i] + u[gcl+i-1]) - 0.5*(u1^2)*(deltat/deltax)*(u[gcl+i] - u[gcl+i-1]);
end for;
public
Modelica.Blocks.Interfaces.RealInput u[worldModel1.n + worldModel1.gcr
+ worldModel1.gcr];
Modelica.Blocks.Interfaces.RealInput u1;
Modelica.Blocks.Interfaces.RealOutput y[worldModel1.n + 1];
end LaxWendroff;