This package contains the LF block for the computation of fluxes at the cell boundaries.
Release Notes:
| Name | Description |
|---|---|
PDE.FiniteVolume.Fluxes.LaxFriedrichFlux.LF
Implements the Lax-Friedrichs flux
By using this flux, the average update rule becomes:
Release Notes:
| Type | Name | Default | Description |
|---|---|---|---|
| Integer | n | worldModel1.n | |
| Real | alpha | 0.0 |
| Type | Name | Description |
|---|---|---|
| input RealInput | u[worldModel1.n + 1] | |
| input RealInput | u1[worldModel1.n + 1] | |
| input RealInput | u2[worldModel1.n + 1] | |
| input RealInput | u3[worldModel1.n + 1] | |
| output RealOutput | y[worldModel1.n + 1] |
block LF 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 alpha = 0.0; equation // for i in 1:gcl loop // y[i] = u[i]; // end for; for i in 1:n+1 loop y[i] = 0.5*(u[i] + u1[i]) - 0.5*alpha*(u2[i] - u3[i]); end for; // for i in gcl+n+1:gcl+n+gcr loop // y[i] = u[i]; // end for; public Modelica.Blocks.Interfaces.RealInput u[worldModel1.n + 1]; Modelica.Blocks.Interfaces.RealInput u1[worldModel1.n + 1]; Modelica.Blocks.Interfaces.RealInput u2[worldModel1.n + 1]; Modelica.Blocks.Interfaces.RealInput u3[worldModel1.n + 1]; Modelica.Blocks.Interfaces.RealOutput y[worldModel1.n + 1]; end LF;