On Wed, Jul 9, 2008 at 6:45 PM, Tony S Yu <[EMAIL PROTECTED]> wrote:
>
> This is probably a bad idea, but I want to set a boundary condition on an
> interior cell. Alternatively, I would just have a rectangular mesh with some
> of the nodes masked off (kind of like a step on one of the rectangle's
> sides). The problem with changing the mesh in this manner is that this
> boundary condition needs to move in time.
As you may have noticed the boundary condition objects do not work on
internal faces. However this does not seem to be your issue. You
should be able to set the value of a cell internally, either by
continually resetting the value or by having a source in the equation.
Looking at the script below, the value is reset and then the equation
is solved. There us no reason that the value should still be zero
after solve(). Resetting at every sweep or time step has its
limitations, bu the values are decreasing as you would expect.
In general, if one has an internal moving boundary condition, it is
probably best to use a secondary variable that defines the position of
the interface and then make any internal boundary conditions dependent
on this variable. This is basically what happens in phase field and
level set problems.
> My first thought was to force a cell to a given value by repeatedly
> resetting its value inside the solution loop. But, since the diffusion terms
> use the face values (not cell values) in the solution, I'm not getting the
> value back. The next (bad) idea I had was to set the face values, but I
> didn't see a way of doing this.
>
> Is there a way of setting a boundary condition on an interior cell?
The best way is to have an implicit source term that fixes the value.
Try something like this.
large_value = CellVariable(mesh=mesh, value=1e+10 * ((x == 1.5) &
(y == 0.5)))
eq = TransientTerm() == ImplicitDiffusionTerm(coeff=D) -
ImplicitSourceTerm(large_value) + c_sink * large_value
Cheers
--
Daniel Wheeler