Implements the constant values c1, c2, c3 and c4 needed for the logarithmic reconstruction
where tol = 0.1h^q, q = 1.4 typically.
Release Notes:
| Name | Description |
|---|---|
PDE.FiniteVolume.LDLR.c.C1
Implements the constant value c1 needed for the logarithmic reconstruction
where tol = 0.1h^q, q = 1.4 typically.
Release Notes:
| Type | Name | Default | Description |
|---|---|---|---|
| Integer | n | worldModel1.n | |
| Real | deltax | 1/n | |
| Real | q | 1.4 | |
| Real | tol | 0.1*(deltax^q) |
| Type | Name | Description |
|---|---|---|
| input RealInput | u[worldModel1.n + 1] | |
| input RealInput | u1[worldModel1.n + 1] | |
| output RealOutput | y[worldModel1.n + 1] |
block C1
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 q = 1.4;
parameter Real tol = 0.1*(deltax^q);
protected
Real u_[worldModel1.n + 1];
Real u1_[worldModel1.n + 1];
equation
for i in 1:n+1 loop
u_[i] = noEvent(if u[i] < 0 then -u[i] else u[i]);
u1_[i] = noEvent(if u1[i] < 0 then -u1[i] else u1[i]);
y[i] = (1-tol)*(1 + tol - ((2*((u_[i])^q)*((u1_[i])^q) + tol)/((u_[i])^(2*q) + (u1_[i])^(2*q) + tol)));
//y[i] = (1-tol)*(1 + tol - ((2*((sqrt(u[i]*u[i]))^q)*((sqrt(u1[i]*u1[i]))^q) + tol)/((sqrt(u[i]*u[i]))^(2*q) + (sqrt(u1[i]*u1[i]))^(2*q) + tol)));
// y[i] = (1-tol)*(1 + tol - ((2*((abs(u[i]))^q)*((abs(u1[i]))^q) + tol)/((abs(u[i]))^(2*q) + (abs(u1[i]))^(2*q) + tol)));
//y[i] = (1-tol)*(1 + tol - ((2*(noevent((abs(u[i]))^q))*(noevent((abs(u1[i]))^q)) + tol)/((noevent((abs(u[i]))^(2*q)) + noevent((abs(u1[i]))^(2*q)) + tol))));
//y[i] = (1-tol)*(1 + tol - (2*(u[i]^(1.4))*(u1[i]^(1.4)) + tol)/(u[i]^(2.8) + u1[i]^(2.8) + tol));
end for;
// equation
// for i in 1:n+1 loop
// y[i] = (1-tol)*(1 + tol - ((2*((abs(u[i]))^q)*((abs(u1[i]))^q) + tol)/((abs(u[i]))^(2*q) + (abs(u1[i]))^(2*q) + tol)));
// //y[i] = (1-tol)*(1 + tol - ((2*(noevent((abs(u[i]))^q))*(noevent((abs(u1[i]))^q)) + tol)/((noevent((abs(u[i]))^(2*q)) + noevent((abs(u1[i]))^(2*q)) + tol))));
// //y[i] = (1-tol)*(1 + tol - (2*(u[i]^(1.4))*(u1[i]^(1.4)) + tol)/(u[i]^(2.8) + u1[i]^(2.8) + tol));
// end for;
public
Modelica.Blocks.Interfaces.RealInput u[worldModel1.n + 1];
Modelica.Blocks.Interfaces.RealInput u1[worldModel1.n + 1];
Modelica.Blocks.Interfaces.RealOutput y[worldModel1.n + 1];
end C1;
PDE.FiniteVolume.LDLR.c.C2
Implements the constant value c2 needed for the logarithmic reconstruction
Release Notes:
| Type | Name | Default | Description |
|---|---|---|---|
| Integer | n | worldModel1.n |
| Type | Name | Description |
|---|---|---|
| input RealInput | u[worldModel1.n + 1] | |
| output RealOutput | y[worldModel1.n + 1] |
block C2 extends Icons.BlockIcon; outer PDE.World.worldModel worldModel1; parameter Integer n = worldModel1.n; // parameter Integer gcl = worldModel1.gcl; // parameter Integer gcr = worldModel1.gcr; equation for i in 1:n+1 loop y[i] = u[i]/(u[i]-1); end for; // for i in 1:gcl loop // y[i] = u[i]; // end for; // for i in gcl+1:gcl+n loop // y[i] = u[i]/(u[i]-1); // 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.RealOutput y[worldModel1.n + 1]; end C2;
PDE.FiniteVolume.LDLR.c.C3
Implements the constant value c3 needed for the logarithmic reconstruction
Release Notes:
| Type | Name | Default | Description |
|---|---|---|---|
| Integer | n | worldModel1.n |
| 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 C3 extends Icons.BlockIcon; outer PDE.World.worldModel worldModel1; parameter Integer n = worldModel1.n; // parameter Integer gcl = worldModel1.gcl; // parameter Integer gcr = worldModel1.gcr; equation for i in 1:n+1 loop y[i] = ((u2[i] - 1)*(u1[i]*(1 - u3[i]) - u[i]))/(u3[i] - u2[i]); end for; // for i in 1:gcl loop // y[i] = u[i]; // end for; // for i in gcl+1:gcl+n loop // y[i] = (u2[i] - 1)*(u1[i]*(1 - u3[i]) - u[i])/(u3[i] - u2[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 C3;
PDE.FiniteVolume.LDLR.c.C4
Implements the constant value c4 needed for the logarithmic reconstruction
Release Notes:
| Type | Name | Default | Description |
|---|---|---|---|
| Integer | n | worldModel1.n |
| Type | Name | Description |
|---|---|---|
| input RealInput | u[worldModel1.n + 1] | |
| input RealInput | u1[worldModel1.n + 1] | |
| output RealOutput | y[worldModel1.n + 1] |
block C4 extends Icons.BlockIcon; outer PDE.World.worldModel worldModel1; parameter Integer n = worldModel1.n; // parameter Integer gcl = worldModel1.gcl; // parameter Integer gcr = worldModel1.gcr; equation for i in 1:n+1 loop y[i] = u[i] - u1[i]; end for; // for i in 1:gcl loop // y[i] = u[i]; // end for; // for i in gcl+1:gcl+n loop // y[i] = u[i] - u1[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.RealOutput y[worldModel1.n + 1]; end C4;