CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   Main CFD Forum (https://www.cfd-online.com/Forums/main/)
-   -   Solving for linear sloshing phenomenon (https://www.cfd-online.com/Forums/main/152519-solving-linear-sloshing-phenomenon.html)

sachinsiitkgp May 2, 2015 16:18

Solving for linear sloshing phenomenon
 
Hey guys,
So here is the doubt. I have written a code for surface tracking of a potential flow in a rectangular container (2-d). I was using no-penetration boundary conditions on the side walls and bottom wall, and unsteady bernoulli equation as the boundary condition on the surface. I used the kinematic boundary condition of the surface to advect the interface once the velocities are know. So since i was solving it assuming a potential flow, i am basically solving a laplace equation with appropriate boundary and initial conditions as required. To get the solution of the velocity potential i am using jacobi iterations and for some reason my solution is blowing up. I have cross checked the mathematical model and the implementation in the code a hundred times, but cant seem to fixate on the problem. So can anyone here give some suggestions on how to debug my code? maybe through experience one might have idea about common errors made by newbies. Maybe some common pitfalls while solving a time-marched equation using jaboci iteration?
Thanks a lot.

shahrooz.omd May 3, 2015 07:12

Quote:

Originally Posted by sachinsiitkgp (Post 544756)
Hey guys,
So here is the doubt. I have written a code for surface tracking of a potential flow in a rectangular container (2-d). I was using no-penetration boundary conditions on the side walls and bottom wall, and unsteady bernoulli equation as the boundary condition on the surface. I used the kinematic boundary condition of the surface to advect the interface once the velocities are know. So since i was solving it assuming a potential flow, i am basically solving a laplace equation with appropriate boundary and initial conditions as required. To get the solution of the velocity potential i am using jacobi iterations and for some reason my solution is blowing up. I have cross checked the mathematical model and the implementation in the code a hundred times, but cant seem to fixate on the problem. So can anyone here give some suggestions on how to debug my code? maybe through experience one might have idea about common errors made by newbies. Maybe some common pitfalls while solving a time-marched equation using jaboci iteration?
Thanks a lot.

best practice is to write your program in separate subroutines(if you are using Fortran) then try to validate each subroutine and find which part is faulty. another good practice in fortran debugging is using checkmate technology from silverfrost company which is free to use for personal use, it helps to find errors in your program not algorithm.


All times are GMT -4. The time now is 02:03.