Is it possible to impose only a left boundary condition? #351
-
I am trying to mimic work from a paper where only a left boundary condition is specified for a 1D depth grid, i.e. only a condition at the surface is specified for two particular PDEs and not at the bottom. Btw, the other three PDEs - this is about solving a set of five coupled PDEs - do have boundary conditions specified at the bottom. Is it possible to do this in py-pde? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 7 replies
-
You are correct that |
Beta Was this translation helpful? Give feedback.
-
It might not be relevant, but how can we separately define left/right boundaries for different fields in a coupled problem? I am trying to set different boundary types by saying bc_x_left = {"value" :0} for one field, but I don't know how to prevent that from being applied to both fields as I need bc_x_left to be set to derivative for my second field. |
Beta Was this translation helpful? Give feedback.
You are correct that
py-pde
always requires boundary conditions on both sides since this was most natural for the use cases for which we developed the package. However, if you use one-sided approximations in the finite-difference scheme (e.g.,forward
orbackward
derivatives), one of the boundary condition will not be used, so you can set it to an arbitrary value. It might be a good idea to use absurdly large values or evennp.nan
to ensure that the boundary condition does not spill into the simulation.