This package contains integrator block that implements Finite Volume Methods with Roe´s flux.
Release Notes:
| Name | Description |
|---|---|
PDE.FiniteVolume.Fluxes.Roe.IntegratorRoe.Integrator
The Flux Limiter Integrator takes as input the fluctuation matrices A+ and A-, initial condition matrix IC and two boundary condition matrices gcl and gcr.
As output it computes the cell averages at the next time step by using the formula
where
are the sum of all right-going waves, respectively left-going waves, from the interfaces xi-1/2.
Release Notes:
| Type | Name | Default | Description |
|---|---|---|---|
| Integer | n | worldModel1.n | |
| Integer | m | worldModel1.m | |
| Real | delta_x | 1/n | |
| Integer | index | 1 | |
| Unknowns | |||
| Integer | vb | gcl + 1 | The left most unknown |
| Integer | ve | gcl + worldModel1.n | The right most unknown |
| Initial Condition | |||
| Integer | icb | gcl + 1 | Begin of the initial condition |
| Integer | ice | gcl + worldModel1.n | End of the initial condition |
| Boundary Conditions | |||
| Integer | bcl | 1 | Boundary condition at the left (0: no; 1: yes) |
| Integer | bcr | 1 | Boundary condition at the right (0: no; 1: yes) |
| Integer | gcl | 2 | Number of ghost cells at the left |
| Integer | gcr | 2 | Number of ghost cells at the right |
| Type | Name | Description |
|---|---|---|
| input RealInput | u[worldModel1.m, worldModel1.n + 1] | |
| input RealInput | u1[worldModel1.m, worldModel1.n] | |
| output RealOutput | y[worldModel1.m, worldModel1.n + worldModel1.gcl + worldModel1.gcr] | |
| input RealInput | u2[worldModel1.m, worldModel1.gcl] | |
| input RealInput | u3[worldModel1.m, worldModel1.gcr] | |
| input RealInput | u4[worldModel1.m, worldModel1.n + 1] |
block Integrator
extends Icons.BlockIcon1;
outer PDE.World.worldModel worldModel1;
parameter Integer n = worldModel1.n;
parameter Integer m = worldModel1.m;
parameter Integer vb = gcl+1 "|Unknowns| The left most unknown";
parameter Integer ve = gcl + worldModel1.n "|Unknowns| The right most unknown";
parameter Integer icb = gcl+1
"|Initial Condition| Begin of the initial condition";
parameter Integer ice = gcl + worldModel1.n
"|Initial Condition| End of the initial condition";
parameter Integer bcl = 1
"|Boundary Conditions| Boundary condition at the left (0: no; 1: yes)";
parameter Integer bcr = 1
"|Boundary Conditions| Boundary condition at the right (0: no; 1: yes)";
parameter Integer gcl = 2
"|Boundary Conditions| Number of ghost cells at the left";
parameter Integer gcr = 2
"|Boundary Conditions| Number of ghost cells at the right";
parameter Real delta_x = 1/n;
//parameter Real deltat = 0.00001;
parameter Integer index = 1;
Real q[m, n + gcl + gcr];
Modelica.Blocks.Interfaces.RealInput u[worldModel1.m,worldModel1.n +
1];
Modelica.Blocks.Interfaces.RealInput u1[worldModel1.m,worldModel1.n];
Modelica.Blocks.Interfaces.RealOutput y[worldModel1.m,worldModel1.n
+ worldModel1.gcl + worldModel1.gcr];
Modelica.Blocks.Interfaces.RealInput u2[worldModel1.m,worldModel1.gcl];
Modelica.Blocks.Interfaces.RealInput u3[worldModel1.m,worldModel1.gcr];
Modelica.Blocks.Interfaces.RealInput u4[worldModel1.m,worldModel1.n
+ 1];
equation
y = q;
for i in 1:m loop
for j in 1:gcl loop
q[i, j]= u2[i, j];
end for;
end for;
for i in 1:m loop
if bcl == 1 then
q[i, gcl+1] = q[i, gcl];
end if;
end for;
for i in 1:m loop
for j in 1:gcr loop
q[i, gcl+n+j] = u3[i, j];
end for;
end for;
for i in 1:m loop
if bcr == 1 then
q[i, gcl+n] = q[i, gcl+n+1];
end if;
end for;
for j in vb:ve loop
for i in 1:m loop
der(q[i, j]) = -(1/delta_x)*(u[i, j-gcl] + u4[i, j-gcl+1]);
end for;
end for;
// for j in 1:m loop
// for i in vb:ve loop
// der(q[j, i]) = -(1/delta_x)*(u[j, i-gcl] + u4[j, i-gcl+1]);
// end for;
// end for;
// when sample(0, deltat) then
// for j in 1:m loop
// for i in vb:ve loop
// q[j, i] = pre(q[j, i]) -(deltat/delta_x)*(pre(u[j, i-gcl]) + pre(u4[j, i-gcl+1]));
// //der(q[j, i]) = -(1/delta_x)*(u[j, i-gcl] + u4[j, i-gcl+1]);
// end for;
// end for;
// end when;
initial equation
for j in 1:m loop
for i in icb:ice loop
q[j, i] = u1[j, i-gcl];
end for;
end for;
end Integrator;