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

Difficulty with basic boundary value problem with RK4 time march

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   October 25, 2018, 20:01
Post Difficulty with basic boundary value problem with RK4 time march
  #1
New Member
 
Join Date: Oct 2018
Posts: 1
Rep Power: 0
nicknaemok is on a distinguished road
Hello everyone,

I am currently studying in a class for CFD and am having a lot of difficulty with getting the code (written in Matlab) for a problem to give answers that make sense. The problem is as follows:

"Write a computer program to solve the one-dimensional linear convection equation with inflow-outflow boundary conditions and a=1 on the domain 0<=x<=1. Let u(0,t) = sin(wt) with w=10pi. Run until a periodic steady state is reached which is independent of the initial condition and plot your solution compared with the exact solution. Use 2nd-order centered differences in space with a 1st-order backward difference at the outflow boundary together with 4th-order Runge-Kutta time marching."

I have written, and attached, a code that should be able to plot the solution. However, I am getting a diverging mess of curves in the shape of a sinusoidal wave.

Is there something about the RK4 method that I am interpreting incorrectly or is there some sort of anomaly in my code?

Thanks for your help in advance.
Attached Files
File Type: txt RK4_BC.txt (2.2 KB, 9 views)
nicknaemok is offline   Reply With Quote

Reply

Tags
linear convection, runge-kutta


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
AMI speed performance danny123 OpenFOAM 21 October 24, 2020 04:13
CFD analaysis of Pelton turbine amodpanthee CFX 31 April 19, 2018 18:02
Problem with an old Simulation FrankW CFX 3 February 8, 2016 04:28
Floating point exception error lpz_michele OpenFOAM Running, Solving & CFD 53 October 19, 2015 02:50
Micro Scale Pore, icoFoam gooya_kabir OpenFOAM Running, Solving & CFD 2 November 2, 2013 13:58


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