This package contains tetha block that computes theta values at each cell interface.
Release Notes:
| Name | Description |
|---|---|
PDE.FiniteVolume.FluxLimiter.Teta.teta
Takes the alpha matrix and the j-th eigenvalue lambdaj as input and computes
at each interface (i = 1,...,n+1). All other matrix entries (row # j) are set to zero. The resulting output is the matrix teta.
Release Notes:
| Type | Name | Default | Description |
|---|---|---|---|
| Integer | n | worldModel1.n | |
| Integer | gcl | worldModel1.gcl | |
| Integer | gcr | worldModel1.gcr | |
| Integer | p | 1 |
| Type | Name | Description |
|---|---|---|
| input RealInput | u1 | |
| input RealInput | u[worldModel1.m, worldModel1.n + worldModel1.gcl + worldModel1.gcr - 1] | |
| output RealOutput | y[worldModel1.m, worldModel1.n + 1] |
block teta
extends Icons.BlockIcon;
outer PDE.World.worldModel worldModel1;
parameter Integer n = worldModel1.n;
parameter Integer gcl = worldModel1.gcl;
parameter Integer gcr = worldModel1.gcr;
parameter Integer p = 1;
Modelica.Blocks.Interfaces.RealInput u1;
equation
// for i in 1:gcl loop
// y[i] = u[i];
// end for;
if u1 > 0 then
for j in 1:n+1 loop
if u[p, j+1] == 0 then
y[p, j] = 0.0;
else
y[p, j] = u[p, j]/u[p, j+1];
end if;
end for;
elseif u1 < 0 then
for j in 1:n+1 loop
if u[p, j+1] == 0 then
y[p, j] = 0.0;
else
y[p, j] = u[p, j+2]/u[p, j+1];
end if;
end for;
else
for j in 1:n+1 loop
y[p, j] = 0.0;
end for;
end if;
// if u1 > 0 then
// for j in 1:n+1 loop
// y[p, j] = u[p, j]/u[p, j+1];
// end for;
// elseif u1 < 0 then
// for j in 1:n+1 loop
// y[p, j] = u[p, j+2]/u[p, j+1];
// end for;
// else
// for j in 1:n+1 loop
// y[p, j] = 0.0;
// end for;
// end if;
// for i in 1+gcl:gcl+n+1 loop
// if u1 > 0 then
// y[i-gcl] = (u[i-1] - u[i-2])/(u[i] - u[i-1]);
// else
// y[i-gcl] = (u[i+1] - u[i])/(u[i] - u[i-1]);
// end if;
// 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.m,worldModel1.n +
worldModel1.gcl + worldModel1.gcr - 1];
Modelica.Blocks.Interfaces.RealOutput y[worldModel1.m,worldModel1.n
+ 1];
end teta;