On May 21, 2012, at 9:11 PM, Yun Tao wrote:

> 1. When I called mesh._getCellDistances() of a 2D mesh (nx=ny=3, dx=dy=1), 
> the values in the array are non-uniform:
>  
> mesh._getCellDistances()
> Out[124]: 
> array([ 0.5,  0.5,  0.5,  1. ,  1. ,  1. ,  1. ,  1. ,  1. ,  0.5,  0.5,
>         0.5,  0.5,  1. ,  1. ,  0.5,  0.5,  1. ,  1. ,  0.5,  0.5,  1. ,
>         1. ,  0.5])
>  
> This seems odd given how I imaged the grid to be, as a square divided equally 
> into 9 parts since if the latter's true, wouldn't the distances all be equal 
> to 1?

The distances for the boundary cells are defined from the cell center to the 
boundary face center, because their is no adjacent cell outside the boundary.

> 2. My version of the code is attached here. Though modifying either the 
> advection or the diffusion coefficients doesn't seem to affect the plot. Is 
> that because I'm not using a specific vector viewer?

Your diffusion and convection coefficients are constants, so the Peclet vectors 
will all be the same (modulo the boundary values). Because of auto-scaling, the 
vector display generally won't change. Manually controlling the scale is 
cumbersome, but can be done by either setting the scale= parameter on 
construction of the MatplotlibViewer(), or by setting the value of 
viewer._quiver.scale and calling viewer.plot() after the fact.


If you did something like

  X, Y = mesh.faceCenters
  X = FaceVariable(mesh=mesh, value=X)
  epsilon = 0.01 + 0.01 * (X - 1.5)**2

then you would see some spatial variation in the Peclet number.



_______________________________________________
fipy mailing list
[email protected]
http://www.ctcms.nist.gov/fipy
  [ NIST internal ONLY: https://email.nist.gov/mailman/listinfo/fipy ]

Reply via email to