CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > General Forums > Main CFD Forum

1D Burgers euqation with 4th Runge Kutta

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   August 4, 2011, 04:57
Question 1D Burgers euqation with 4th Runge Kutta
  #1
Member
 
Dokeun, Hwang
Join Date: Apr 2010
Location: Korea, Republic of
Posts: 98
Rep Power: 16
dokeun is on a distinguished road
Hello

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

u^{n+1}_{i} = u^{n}_{i} - \Delta t \left( \frac{\partial E}{\partial x}\right)^{n}

hear, E_{i} = \frac{1}{2} {u_{i}}^2


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


\frac{\partial E}{\partial x} = \frac{E_{i+1} - E_{i-1}}{2 \Delta x}


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 {u^{n+1}_{i}} 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.
dokeun is offline   Reply With Quote

Old   August 5, 2011, 04:18
Default
  #2
Senior Member
 
cfdnewbie
Join Date: Mar 2010
Posts: 557
Rep Power: 20
cfdnewbie is on a distinguished road
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....
cfdnewbie is offline   Reply With Quote

Old   August 8, 2011, 03:45
Default
  #3
Member
 
Dokeun, Hwang
Join Date: Apr 2010
Location: Korea, Republic of
Posts: 98
Rep Power: 16
dokeun is on a distinguished road
Dear cfdnewbie

Thank you for your reply.

Would please review my spreading out of the equations.

u^{(1)}_{i} = u^{n}_{i}

u^{(2)}_{i} = u^{n}_{i} - \frac{1}{2}\Delta t \left( \frac{\partial E}{\partial x}\right)^{(1)}_{i}

u^{(3)}_{i} = u^{n}_{i} - \frac{1}{2}\Delta t \left( \frac{\partial E}{\partial x} \right)^{(2)}_{i}

u^{(4)}_{i} = u^{n}_{i} - \frac{1}{2}\Delta t \left( \frac{\partial E}{\partial x}\right)^{(3)}_{i}

u^{n+1}_{i} = u^{n}_{i} - \Delta t \left[ 
\frac{1}{6} \left( \frac{\partial E}{\partial x} \right)^{(1)} 
+ 
\frac{1}{3} \left( \frac{\partial E}{\partial x} \right)^{(2)} 
+ 
\frac{1}{3} \left( \frac{\partial E}{\partial x} \right)^{(3)} 
+ 
\frac{1}{6} \left( \frac{\partial E}{\partial x} \right)^{(4)} 
\right]

Becasue \frac{\partial E}{\partial x} is defined as \frac{E_{i+1} - E_{i}}{2 \Delta x} = \frac {u^{2}_{i+1} - u^{2}_{i-1}}{4 \Delta x} , u^{(2)}_{i} refers u^{n}_{i+1},u^{n}_{i-1}.

And, in turn, u^{(3)}_{i} refers u^{(2)}_{i+1},u^{(2)}_{i-1}.

Here, u^{(2)}_{i+1} comes from u^{n}_{i+2},u^{n}_{i} and u^{(2)}_{i-1} is derived from u^{n}_{i},u^{n}_{i-2}.

As a result, to get u^{(3)}_{i}, I need the values of u^{(n)} at i+2~i-2.

As the same manner, u^{(4)}_{i} requires the value of u^{(n)} 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 is offline   Reply With Quote

Old   August 8, 2011, 07:34
Default
  #4
Member
 
Dokeun, Hwang
Join Date: Apr 2010
Location: Korea, Republic of
Posts: 98
Rep Power: 16
dokeun is on a distinguished road
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)
dokeun is offline   Reply With Quote

Reply

Tags
burgers equation, runge kutta

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Runge Kutta 4th Order Source Code sugu Main CFD Forum 4 October 26, 2012 04:15
Using Runge kutta 4th order scheme in FSI using CFX vmlxb6 CFX 0 April 26, 2011 15:55
Runge Kutta Optimization vasanth Main CFD Forum 6 December 2, 2005 14:07
2N Storage runge kutta Vasanth Main CFD Forum 3 August 2, 2005 11:44
Diagonally Dominate Runge Kutta Method Anthony Iannetti Main CFD Forum 0 January 23, 2001 22:27


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