New Reply

Advection equation and Crank-Nicolson

 
Share Thread Thread Tools
May14-11, 06:26 AM   #1
 

Advection equation and Crank-Nicolson


Hi, I want to numerically model the advection equation using the Crank-Nicolson scheme. Yes, I know that it is highly oscillatory but that is the point of the exercise as I want to highlight this. The problem I'm having is how do I apply the BC for grid point N in the scheme. The advection equation only needs one boundary condition at point 0 in the domain, but becuase of the centred space disretisation the scheme requires an artificial boundary condition at the other end. The basic equation is

[tex]\-\frac{\sigma}{4}f_{i-1}^{n+1}+f_{i}^{n+1}+\frac{\sigma}{4}f_{i+1}^{n+1}=\frac{\sigma}{4}f_{i-1}^{n}+f_{i}^{n}-\frac{\sigma}{4}f_{i+1}^{n}[/tex]

So say I want the value at N+1 to be the same as N, that requires

[tex]\left.\frac{\partial f}{\partial x}\right|_{N}=\frac{f_{N+1}^{n}-f_{N-1}^{n}}{2\triangle x}=0[/tex]

and hence

[tex]f_{N+1}=f_{N-1}[/tex]

So if we sub that into the main scheme we get

[tex] f_{N}^{n+1}=f_{N}^{n}[/tex]

So according to this the final grid point always remains at the initial condictions, which is clearly wrong. Does anyone know what is wrong with my assumptions?

Thanks for any info.
 
PhysOrg.com
PhysOrg
science news on PhysOrg.com

>> Front-row seats to climate change
>> Attacking MRSA with metals from antibacterial clays
>> New formula invented for microscope viewing, substitutes for federally controlled drug
May14-11, 12:49 PM   #2
 
Lots of ways, some better/easier than others.

You can try making your domain a cell too large at every boundary where you need to enforce a BC at the cell edge, then interpolate.

You can also make the domain periodic, but then you get periodic solutions (which may or may not be acceptable).
 
May15-11, 05:46 AM   #3
 
Quote by olivermsun View Post
Lots of ways, some better/easier than others.

You can try making your domain a cell too large at every boundary where you need to enforce a BC at the cell edge, then interpolate.

You can also make the domain periodic, but then you get periodic solutions (which may or may not be acceptable).
I'm not quite sure how you implement the method you suggested. If you extend your domain, aren't you still going to have the same problem except with a larger domain? The solution still has to be in the form of a tridiagonal matrix.

Unfortunately I can't use a periodic domain as I want to see the solution at the final time compared with the initial time.
 
New Reply
Thread Tools


Similar Threads for: Advection equation and Crank-Nicolson
Thread Forum Replies
Crank-Nicolson vs Heun's method Differential Equations 4
Crank-Nicolson method for a parabolic differential equation Introductory Physics Homework 8
Consistency of Crank Nicolson method Calculus & Beyond Homework 0
Crank-Nicolson method (Matlab) Math & Science Software 0
Parallelizing Crank-Nicolson method Differential Equations 3