CFD Online Discussion Forums

CFD Online Discussion Forums (
-   Main CFD Forum (
-   -   Info on method of lines approach (

charlie ryan August 9, 2007 05:19

Info on method of lines approach

Im not sure if this is the right place to post this so excuse me! I have a system of 3 non linear first order pde's, differentiated with respect to time and one spatial dimension. I am thinking of using a method of lines approach for removing the spatial differentiation, and then using a runge - kutta technique [or something similar], to solve the left over coupled ode's. But i don't understand how the difference formulas, that you have from the finite difference method, can be solved numerically using a RK method. Take an example -> u_t = u_x. Using a central difference formula, u_x looks like; u_x = (u_i+1,j - u_i-1,j)/2h

=> u_t = (u_i+1,j - u_i-1,j)/2h

Now how do i solve the above using a method from numerically solving ode's [RK method, Euler, whatever]? I'm confused about what to do when the i+1, i-1 is there - what do i do with these?

Can anyone suggest a good reference on the method of lines?

Any comments are appreciated!


opaque August 9, 2007 09:35

Re: Info on method of lines approach
Dear Charlie,

Let me repose your example, using Dirichlet (value specified) conditions

u_t = u_x

u(t, x_a) = u_a

u(t, x_b) = u_b

u(t_0, x) = u_0

The method of lines can be applied to any of the dimensions of the problems, either t or x.. Let us go with "x" again. You discretize your interval (a,b) into a finite number of nodes separated by h, and then apply the difference formulas at each node, then

u_i_t = (u_i+1,j - u_i-1,j)/2h for i = 1, 2, .. N

for i = 1 u = u_a

i = N u = u_b

You got N-2 ODE's that are coupled. You can use a RK integrator. If you ODE's are linear you can find their analytical solution in closed form.

Hope this helps,


charlie ryan August 9, 2007 11:06

Re: Info on method of lines approach
Thanks Opaque very helpful - it makes sense. I have a system of PDE's that look something like;

h_t = -hv_x - h_x T_t = (T/h - Tv/h - E)h_x - Tv_x - vT_x - hE_x v_t = -vv_x - p_x +TE/h + v_xx + (1/h)v_x*h_x p_x = h_x + hxx + E^2 + T^2 E = f(x,h,E,v,t)

I hope that is readable! So it is basically a system of PDE's (note only three involve time derivatives]. E is a function that depends on the rest of the variables, and p does not directly depend upon t. i have a set of inital conditions for the above. Now i understand how you solve one pde to get a system of ode's, but what about a system of coupled pde's looking something like above? How do you solve the pde's system, when you have multiple variables? Any help is very much appreciated,


All times are GMT -4. The time now is 00:21.