On May 15, 2007, at 12:15 AM, Elizabeth Tseng wrote:
Hi,
I have a 1D-diffusion, in which at r = 0, the flux for the
variable phi is 0. And at r = R, the flux for phi is
C * (P - phi(R)) = D \frac{\partial phi}{\partial r}
where C and D are constants, P is a term that is dependent on time,
and phi(R) is the value of phi at r = R.
I have no problem calculating P, as I have a time variable, and at
each time step, I calculate P accordingly.
I set up the boundary condition for phi as (at each time step):
X = (C/D)*(P-phi.value[len(phi.value)-1])
Hi Elizabeth,
The last line should be
X = (C/D)*(P-phi.getFaceValue())
That should work. Slicing a variable doesn't return a variable.
Wherever possible try to think of a way to express the
syntax without slicing. In this case, X becomes a face variable and
the FixedFlux boundary condition knows what to
do with it.
Cheers
BCs = (FixedFlux(faces=mesh.getFacesRight(),value= X), \
FixedFlux(faces=mesh.getFacesLeft(),value=0.))
The resulting values for phi is several magnitudes lower than it
should be. Is this because I did not delineate phi(R) correctly?
Should it be a separate variable...but how?
Elizabeth
--
Daniel Wheeler