CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   Main CFD Forum (https://www.cfd-online.com/Forums/main/)
-   -   Advice on the numerical solution of the 1D Navier-Stokes equations (https://www.cfd-online.com/Forums/main/171224-advice-numerical-solution-1d-navier-stokes-equations.html)

Deiniol May 4, 2016 15:30

Advice on the numerical solution of the 1D Navier-Stokes equations
 
Hi all, the last few days I have been reading up on numerical methods, I was hoping to write a MATLAB code to solve the 1D Navier-Stokes equations for a uniform rectangular channel of depth h and width b:

\frac{\partial\hat{u}}{\partial t}-\hat{u}\frac{\partial\hat{u}}{\partial x}=-g\frac{\partial\eta}{\partial x}-\frac{1}{h+\eta}c_f\hat{u}|\hat{u}|

(momentum) and:

\frac{\partial\eta}{\partial t}+h\frac{\partial\hat{u}}{\partial x}+\frac{\partial(\eta\hat{u})}{\partial x} = 0

(continuity). where \hat{u} is the cross-sectionally averaged flow velocity and \eta is the water surface elevation. The only forcing I am interested in is that of the tide.

I would appreciate any pointers on how two go about solving these equations, from what I have read so far I am thinking of using the finite difference method, on a staggered grid, but with the coupling and the non-linear terms I am finding it tough going. If anyone would be able to point me in the right direction for any code or worked examples for analogous cases I would be very grateful, or even a good book with worked examples and code (MATLAB/FORTRAN/python) for CFD in general would be helpful.

Thanks in advance and I hope this is the correct forum for this post.

FMDenaro May 4, 2016 15:44

Quote:

Originally Posted by Deiniol (Post 598679)
Hi all, the last few days I have been reading up on numerical methods, I was hoping to write a MATLAB code to solve the 1D Navier-Stokes equations for a uniform rectangular channel of depth h and width b:

\frac{\partial\hat{u}}{\partial t}-\hat{u}\frac{\partial\hat{u}}{\partial x}=-g\frac{\partial\eta}{\partial x}-\frac{1}{h+\eta}c_f\hat{u}|\hat{u}|

(momentum) and:

\frac{\partial\eta}{\partial t}+h\frac{\partial\hat{u}}{\partial x}+\frac{\partial(\eta\hat{u})}{\partial x} = 0

(continuity). where \hat{u} is the cross-sectionally averaged flow velocity and \eta is the water surface elevation. The only forcing I am interested in is that of the tide.

I would appreciate any pointers on how two go about solving these equations, from what I have read so far I am thinking of using the finite difference method, on a staggered grid, but with the coupling and the non-linear terms I am finding it tough going. If anyone would be able to point me in the right direction for any code or worked examples for analogous cases I would be very grateful, or even a good book with worked examples and code (MATLAB/FORTRAN/python) for CFD in general would be helpful.

Thanks in advance and I hope this is the correct forum for this post.


You are not solving the NS equations.... however, for your problem you can see the book of Leveque and the problems here
http://www.clawpack.org/galleries.html


All times are GMT -4. The time now is 11:52.