Assistance with oneway wave equation
Hello folks, I know that most of you will laugh when you read this (it should be a simple finite difference problem) but could someone please help me with the following problem:
I am trying to solve the one way wave equation: phi_x + phi_t = 0 {for x, say, in 0:0.01:10} subject to the following boundary conditions: phi(x,0) = 0 phi(x,dt)= 0 {so phi for the first 2 timesteps is zero} phi(0,t) = sin(t) phi_x(xmax,t)=0 I have used the notation "_x" to denote differentiation with x etc. I have tried different finite difference schemes but my results are nonsense. My "expected" result was to see a sinusodial wave moving from left to right as time increased but depending on how I develop the finite difference scheme my results vary wildly. Most recently tried the following scheme: [p(I,N+1)p(I,N)]/dt + [p(I,N+1)p(I1,N+1)]/dx = 0 i.e. backwards time and space. My results for the above scheme were not what I expected. I have also tried a 2nd order scheme, with central differencing for x & backwards differencing for time, but again my results were nonsense (this time they were full of wiggles). To put the problem in context: I'm solving for the flow around the airfoil in an unsteady transonic flow. The wake condition gives rise to the oneway wave equation which I need to solve numerically. The above problem is a model problem I was trying before moving onto adapting my existing aerodynamic solver. The funny part is I have had no problem with the complicated transonic problem but can't manage this simple 1st order PDE!! I'd be hugely grateful to anyone who could offer help or any advice. Many thanks, F 
One more thing...
Sorry guys, I forgot to mention that I'm trying to solve the oneway wave equation on a stretched cartesian grid. The degree of stretching is relatively small but a rather large grid is required for my problem.
Thanks again, F 
Re: Assistance with oneway wave equation
Your differencing indicates you are using an implicit scheme. Is this correct?

Re: Assistance with oneway wave equation
Hi Frank,
you're not allowed to have a homogeneous Neumann boundary at xmax (due to characteristic direction). Use some sort of extrapolation there in your difference scheme instead (exact form should be dependent on scheme). /Stefan 
Re: Assistance with oneway wave equation
Don't you have too many BCs and ICs? I think a single BC, say phi(x=0,t), and a single IC, e.g., phi(x,t=0) or phi_t(x,t=0) is what you need.
In order to solve it numerically, you may start by the simplest possible schemes, e.g., centraldifference for the spatial derivative, explicit scheme for time advance and CFL condition to limit the time step. 
Re: Assistance with oneway wave equation
Thanks guys  there's some great advice on these forums :o)
I finally managed to get the equation solved (you guys were right  the problem was to do with the boundary conditions) and got some really good results. I did have a problem, however, when I moved on to solving the same problem on a stretched grid. I'm not too sure why but when I use a stretched cartesian grid all my results become nonsense  it's like some big instability is setting in. Could someone please advise? Thanks for all your help so far! F 
All times are GMT 4. The time now is 14:49. 