CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM Running, Solving & CFD (http://www.cfd-online.com/Forums/openfoam-solving/)
-   -   2D shallow water equations (http://www.cfd-online.com/Forums/openfoam-solving/59871-2d-shallow-water-equations.html)

dealexander November 7, 2005 19:44

Has anyone written any code fo
 
Has anyone written any code for the 2D shallow water equations? I have a dam-failure problem I would like to simulate using a finite volume technique. I've never used OpenFOAM, but it looks like if might be fun. Any advice

regards

David E. Alexander M.Sc. P.Eng
3-Sigma Consulting Inc.
david@3sigma.ca
www.3sigma.ca

liuzhw November 8, 2005 21:01

I have just finished the code
 
I have just finished the code for the 2D shallow water equations. but it is tested only by a simple uniform channel flow. To following the rule of dimensionSet, I have the whole water depth as non-Uint. It is a little unsatisfied.
If you need, I will share it with you.

taufik April 18, 2006 03:35

I hope this thread is still on
 
I hope this thread is still on. I am also in the initial phase of developing solver for shallow water. Would appreciate if you could share the code to me as well.

liuzhw January 3, 2007 02:16

Hello! I have developed a dep
 
Hello!
I have developed a depth-averaged shallow water equation model based on Foam.
It is a two dimensional problem and the top and bottom suface is spesified as
emptyFvPatch.

however, the velocity along the z direction, U.z(), will sometime increase to a large magnitude in the computation. it is not what I expected.

now, I have to limte U.z() to zero after iteratation each time step.

any advices for this problem are grateful!

best regard!

liuzhw January 3, 2007 02:20

Hello! I have developed a dep
 
Hello!
I have developed a depth-averaged shallow water equation model based on Foam.
It is a two dimensional problem and the top and bottom suface is spesified as
emptyFvPatch.

however, the velocity along the z direction, U.z(), will sometime increase to a large magnitude in the computation. it is not what I expected.

now, I have to limte U.z() to zero after iteratation each time step.

any advices for this problem are grateful!

best regard!

liu January 3, 2007 16:33

For shallow water equation, yo
 
For shallow water equation, you need to solve h (water depth), u and v (velocity in x and y direction). Do you solve them together or seperately? Or is it coupled?

For the current version of Foam, I don't think it is easy to solve shallow water equations.

Another thing is you need to implement Godunov schemes and flux routines.

Good luck!

liuzhw January 3, 2007 20:51

Yes, I solve h with the water
 
Yes, I solve h with the water surface equation modified from continuity equation. the governing equations are solved with the PISO iterating method just like the turbForm solvers in Foam.

Now it runs well except the problem of the increasing magnitude of U.z(). although the problem does not affect the result, it is not nice.

Thanks

liuzhw January 3, 2007 21:33

Next, I plan to develop a thre
 
Next, I plan to develop a three dimensinal model for shallow water equations using sigma coordinate along the verticle direction. since the mesh of each layer is same, there are two mesh system to be chosen. one is 2D mesh and the other is a true 3D mesh.

for 2D mesh, the code will be simple but with a complicated data structure of velocity, the data structure like List<volvectorfield> will be used. more ever, it is not easy to expand a real 3D model

for 3D mesh, it will like a solver of most of foam. but the solution to water surface needs 2D mesh, which is a problem to be overcome.

any advices for this problem are grateful!

best regard!

hahuhe April 8, 2009 01:55

Quote:

Originally Posted by liuzhw (Post 196074)
Yes, I solve h with the water surface equation modified from continuity equation. the governing equations are solved with the PISO iterating method just like the turbForm solvers in Foam.

Now it runs well except the problem of the increasing magnitude of U.z(). although the problem does not affect the result, it is not nice.

Thanks

it happens a lot to shallow water equation. especially when there are two waves from opposite direction. such as the incoming wave colliding with the reflected wave. the model is unable to handle the turbulence from that process. instead of adding and solving the turbulence term, i found that simple numerical filter such as Hansen (1962) really help. you can find the explanation in Kowalik's book (Numerical modeling of Ocean Dynamics vol.5)


All times are GMT -4. The time now is 20:36.