pyclaw icon indicating copy to clipboard operation
pyclaw copied to clipboard

User Boundary Condition Should Accept `dt` as an Argument

Open mandli opened this issue 10 years ago • 5 comments

The Fortran versions of Clawpack accept dt as an argument to the boundary conditions which is useful for certain types of boundary conditions (paddle BCs in my case). We can simply add this to the calling signature but this will again break backwards compatibility.

mandli avatar Feb 11 '15 15:02 mandli

Can you explain (for me) why a boundary condition could depend on dt? On the surface, that seems like just the kind of thing the abstraction should prohibit. I'd like to understand.

ketch avatar Feb 11 '15 15:02 ketch

In the case I ran into an approximation of a time derivative is needed to calculate an incoming wave form while allowing an outgoing wave at the same time (not exactly a paddle but still in a idealized wave-tank). Randy wrote up a short IPython notebook at http://nbviewer.ipython.org/url/faculty.washington.edu/rjl/notebooks/Wavetank_BC.ipynb which describes what we were trying to do.

mandli avatar Feb 11 '15 16:02 mandli

Thanks. I guess this would only ever be needed in the Classic solvers, and never in a method-of-lines-solver, right?

But it's probably best to keep the same BC API across all solvers.

ketch avatar Feb 12 '15 08:02 ketch

Thinking about this some more and looking at what I've done in other problems where an incoming wave is specified, I'm not sure what I suggested in that notebook is correct -- the ghost cell value should perhaps be based on spatial derivatives not temporal derivatives. I will think about this further.

Also, I just noticed that dt is an input argument in the classic code bc2.f, but is not an argument for the bc2amr.f subroutine in amrclaw. So apparently we've never needed it in past applications of the AMR code.

Before adding it to PyClaw, let's think further about whether we should instead delete it from classic.

rjleveque avatar Feb 12 '15 17:02 rjleveque

I was under the impression that there might be BCs that may be dependent on time derivatives, for instance maybe a system that contains reactions would require the approximation of a time derivative. On the other hand I cannot say that I have ever needed this before the above application.

mandli avatar Feb 12 '15 20:02 mandli