This package contains the Upwind block for the computation of fluxes at the cell boundaries.
Release Notes:
| Name | Description |
|---|---|
PDE.FiniteVolume.Fluxes.UpwindFlux.Upwind
Implements the upwind flux: Fi-1/2 = uQi-1 if u > 0 and Fi-1/2 = uQi otherwise.
By using this flux the average update rule becomes
if u > 0, and
otherwise.
Release Notes:
| Type | Name | Default | Description |
|---|---|---|---|
| Integer | n | worldModel1.n | |
| Integer | gcl | worldModel1.gcl | |
| Integer | gcr | worldModel1.gcr |
| Type | Name | Description |
|---|---|---|
| input RealInput | u[worldModel1.n + worldModel1.gcr + worldModel1.gcr] | |
| output RealOutput | y[worldModel1.n + 1] | |
| input RealInput | u1 |
block Upwind
extends Icons.BlockIcon5;
outer PDE.World.worldModel worldModel1;
parameter Integer n = worldModel1.n;
parameter Integer gcl = worldModel1.gcl;
parameter Integer gcr = worldModel1.gcr;
equation
if u1 > 0 then
for i in 1:n+1 loop
y[i] = u1*u[gcl+i-1];
end for;
else
for i in 1:n+1 loop
y[i] = u1*u[gcl+i];
end for;
end if;
public
Modelica.Blocks.Interfaces.RealInput u[worldModel1.n + worldModel1.gcr
+ worldModel1.gcr];
Modelica.Blocks.Interfaces.RealOutput y[worldModel1.n + 1];
Modelica.Blocks.Interfaces.RealInput u1;
end Upwind;