Shallow Water DAE - Index may be greater than 1 ?

2 views (last 30 days)
Sa_math
Sa_math on 19 Nov 2019
Commented: Sa_math on 1 Dec 2019
Dear all,
I am trying to solve a DAE for the 1D nonlinear shallow water (SW) system of equations
where are the velocity and height field respectively.
The intial conditions are given by and in the spatial domain
. The boundary conditions are and .
The solution of this dam-break problem will produce a left-going rarefaction wave and a right-propagating shock wave.
In order to better capture the shock wave I want to solve simultaneously the SW system with a moving mesh PDE of equation , where ξ is a uniform computational mesh in [0,1] and is a density function.
By rewriting as function of I obtain the following DAE system of index 1
Now, I have discretized the system in space by finite difference method with the moving mesh in the space domain and fixed mesh in the computational domain for
I have in total a system of equations of this form
where and .
I am trying to use the MATLAB ode solver ode23t/ode15s for the system with a singular diagonal Mass matrix ( 0-th in the last N entries). Initially, the physical mesh is supposed to be uniform and v is consistent with the algebraic constraint.
After running the script I obtain the following error :
Error using daeic12 (line 76)
This DAE appears to be of index greater than 1.
Do you have idea why MATLAB does not recognize the system as index 1 ? Is it then more reasonable to write the system without the auxiliary variable v and changing the entries of the mass matrix (no longer diagonal) ?
I have also tried to solve the problem with an implicit solver ode15i by discarding the auxiliary variable v but I get the same error message when I call the decic operator for computing consistent initial conditions.
Thank you for your help.
  6 Comments
Bill Greene
Bill Greene on 25 Nov 2019
Links to downloadable copies of the references for ode15s are at the bottom of the documentation page: ode15s.
If you post your updated m-code, I can run that and perhaps comment further.
If you describe your mesh-moving function in more detail, I might be able to say more about your approach.
I don't think that simply switching to a FVM or FEM will, by itself, improve the behavior of the solution. Looking at your FDM equations, it looks like you are using a central difference approximation to the spatial deriviatives. This is known to create spurious oscillations unless you have a very fine mesh. If you use a backward difference approximation instead (known as "upwind" in the literature) you will eliminate the oscillations but at a cost of excessive smoothing of the solution.
Sa_math
Sa_math on 1 Dec 2019
Thank you for the reference, Bill. You can find the updated code in attachment.
I am using the moving mesh PDE because I want to reduce the mesh size in proximity of the shock front and consequently the error by linear interpolation. This is realized by the arc-length monitor function in the definition of the PDE. The user-specified parameter τ tweaks the level of adaptability of the physical mesh to the SW system: The smaller τ, the faster the mesh will adapt to the solution.
The upwind scheme does not produce better results than the centered finite difference scheme. I just notice that at the first time step the velocity field starts increasing on the left boundary of the domain and it propagates rightwards before resetting again to 0. I should expect instead that the velocity field starts raising at the center of my domain, where the dam breaks. The same behaviour is obtained for ode15i, so I suppose that there might be instabilities due to the FDM and a FVM might resolve the problem.
Any further help is highly appreciated. Thanks.

Sign in to comment.

Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!