This package contains Poisson equation solved with the Method of Lines.
Release Notes:
| Name | Description |
|---|---|
| PoissonEquation | |
The poisson problem
is a time independent problem. In order to be handled from the integrator block, this problem is transformed into a time dependent problem
with initial condition
The solution of the time dependent problem approaches with time the solution of the time independent problem.
The analytical solution of this problem is implemented in PAN block.
Release Notes:
model PoissonEquation
inner World.worldModel worldModel1(n=20);
Integrator.UniversalIntegrator Poisson(
vb=2,
ve=worldModel1.n - 1,
icb=2,
ice=worldModel1.n - 1,
bcl=1,
bcr=1);
SpaceDerivative.Derivatives.u_xx u_xx;
Modelica.Blocks.Math.Add add[worldModel1.n](k1=+1, k2=+1);
Modelica.Blocks.Sources.RealExpression BCL;
Modelica.Blocks.Sources.RealExpression BCR;
PIC pIC;
PAN pAN;
Modelica.Blocks.Sources.Constant const[worldModel1.n](k=1:worldModel1.
n);
Modelica.Blocks.Sources.IntegerExpression one[worldModel1.n](y=1);
Modelica.Blocks.Math.Add add1[worldModel1.n](k2=-1);
Modelica.Blocks.Math.Product product[worldModel1.n];
Modelica.Blocks.Sources.RealExpression pi[worldModel1.n](y=3.14);
Modelica.Blocks.Math.Division division[worldModel1.n];
Modelica.Blocks.Sources.RealExpression deltax[worldModel1.n](y=
worldModel1.n - 1);
Modelica.Blocks.Math.Sin sin[worldModel1.n];
equation
connect(Poisson.y, u_xx.u);
connect(u_xx.y, add.u1);
connect(add.y, Poisson.u);
connect(BCR.y, Poisson.u3);
connect(pIC.y, Poisson.u1);
connect(const.y, add1.u1);
connect(one.y, add1.u2);
connect(add1.y, product.u1);
connect(pi.y, product.u2);
connect(product.y, division.u1);
connect(deltax.y, division.u2);
connect(division.y, sin.u);
connect(sin.y, add.u2);
connect(BCL.y, Poisson.u2);
end PoissonEquation;
PDE.MOL.Examples.Poisson.PIC
Implements the initial condition for the time dependent poisson equation
Release Notes:
| Type | Name | Default | Description |
|---|---|---|---|
| Integer | n | worldModel1.n |
| Type | Name | Description |
|---|---|---|
| output RealOutput | y[worldModel1.n] |
block PIC
extends Icons.BlockIcon;
outer PDE.World.worldModel worldModel1;
parameter Integer n = worldModel1.n;
equation
for i in 1:n loop
y[i] = sin(3*3.14*((i-1)/n));
end for;
public
Modelica.Blocks.Interfaces.RealOutput y[worldModel1.n];
end PIC;
PDE.MOL.Examples.Poisson.PAN
Implements the analytical solution of the poisson equation
Release Notes:
| Type | Name | Default | Description |
|---|---|---|---|
| Integer | n | worldModel1.n |
| Type | Name | Description |
|---|---|---|
| output RealOutput | y[worldModel1.n] |
block PAN
extends Icons.BlockIcon4;
outer PDE.World.worldModel worldModel1;
parameter Integer n = worldModel1.n;
equation
for i in 1:n loop
y[i] = (1/(3.14)^2)*sin(3.14*((i-1)/n));
end for;
public
Modelica.Blocks.Interfaces.RealOutput y[worldModel1.n];
end PAN;