CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   Main CFD Forum (https://www.cfd-online.com/Forums/main/)
-   -   1D Burgers euqation with 4th Runge Kutta (https://www.cfd-online.com/Forums/main/91228-1d-burgers-euqation-4th-runge-kutta.html)

 dokeun August 4, 2011 03:57

1D Burgers euqation with 4th Runge Kutta

Hello

Now i'm tring to apply 4 Stage Runge Kutta scheme to 1D Burgers euqation as a model equation like this.

hear,

At this point, the slop is suggested as central differencing.

The Question is..

How to handle at the point i=2,3,IM-2,IM-1?

Because 4 Stage Runge Kutta requires i-2 ~ i+2 points for next step value at i, I can't get at i=2,3,IM-2,IM-1.

I got the answer using 3 stage RK to i=3,IM-2 and 2 stage RK to i=2,IM-1. inspite of complicate euqations used. But I guess there manybe more simple way for near the boundary points.

Please let me know simple solution for this.

Thank you in advance.

 cfdnewbie August 5, 2011 03:18

maybe I'm misunderstanding you, but the classical RK schemes use stages/nodes that are INSIDE the interval you are trying to integrate....so you are integrating in time, and you need the evaluation at (say) 1/3 delta t, 1/2 delta t, 2/3 delta t and so on...
how you discretize your spatial domain is up to you, since you are using a method of lines approach....

 dokeun August 8, 2011 02:45

Dear cfdnewbie

Would please review my spreading out of the equations.

Becasue is defined as , refers .

And, in turn, refers .

Here, comes from and is derived from .

As a result, to get , I need the values of at i+2~i-2.

As the same manner, requires the value of at i-3~i+3.

I feel that something is wrong with my equations but I'm in trouble to figure out it cleary.

I attached my F90 code for fixing..(it works any way)

I appreciate that again.

 dokeun August 8, 2011 06:34

dear cfdnewbie

I understood my problem.

my original program was...

DO i=2,IM-1
u1(i) = function of u(n,i)
u2(i) = function of u(n,i)
u3(i) = function of u(n,i)
u4(i) = function of u(n,i)
END DO

but the right one should be

DO n=1,NM-1
DO i=2,IM-1
u1(i) = function of u(n,i)
END DO

DO i=2,IM-1
u2(i) = function of u1(i)
END DO

DO i=2,IM-1
u3(i) = function of u2(i)
END DO

DO i=2,IM-1
u4(i) = function of u3(i)
END DO

DO i=2,IM-1
u(n+1,i) = u(n,i) + ~~~
END DO
END DO

at first i tred to write all u1, u2, u3, u4 as functions of u(n) along just one iteration, but now there are each iteration for u1~u4, and in another iteration I calculate u(n+1)

 All times are GMT -4. The time now is 09:14.