- Index
- » Usage and Applications
- » OpenModelica Usage and Applications
- » finites differences
Page Start Prev 1 Next End
finites differences
finites differences
May-20-14 14:25:09
Hello
I'm trying to simulate a simple finites differences scheme applied to the shallow water equation in 1 dimension(x) , where the discretization is only applied to the spatial coordinate x then I let modelica solving the whole system by using it's solvers.
the problem is that the program is runing indefinitly and it doesn't even show an error message, which bring me to close OMEdit and restart it again.
So can someone please tell me what could be the cause of this kind of problem.
here is the code :
Code:
model SVDF
/********Différences finies****************/
import Modelica.SIunits;
//nombre de pas(section)
parameter Integer n = 32;
//Longueur du canal
parameter SIunits.Length L = 32000;
constant Real g = 9.81;
//vitesse
SIunits.Velocity V[n + 1](start = fill(0, n + 1));
//aire d'une section
SIunits.Area S[n + 1](start = fill(20, n + 1));
protected
//longueur d'une section
parameter SIunits.Length dx = 32000 / n;
equation
for i in 1:n loop
V[i + 1] * S[i + 1] - V[i] * S[i] + dx * der(S[i]) = 0;
dx * der(V[i] * S[i]) + V[i + 1] ^ 2 * S[i + 1] - V[i] ^ 2 * S[i] + 0.05 * g * (S[i + 1] ^ 2 - S[i] ^ 2) = 0;
end for;
//CL
S[n + 1] = 20;
V[1] = 0;
end SVDF;
Thank you very much for your answers.
Page Start Prev 1 Next End
- Index
- » Usage and Applications
- » OpenModelica Usage and Applications
- » finites differences
There are 0 guests and 0 other users also viewing this topic