That's right. The first row holds x values and the second row holds y values. 

For a Grid2D, yes, the numbering is as you say. In general, because FiPy is 
designed around unstructured meshes, I would not try to figure out what index 
in the array corresponds to what physical location. Use parametric calculations 
based on mesh.cellCenters (or mesh.x and mesh.y) or mesh.faceCenters or based 
on some other field value. All of the examples I pointed out do exactly that.

Given a choice, you should define your convection coefficient as a 
FaceVariable. FiPy will interpolate for you from a CellVariable, but better to 
control the interpolation/calculation yourself, if you can.

- Jon

On Oct 7, 2015, at 5:53 PM, Sy-Dar Liou <[email protected]> wrote:

> Hi Johnathan,
> 
> Thanks for your help.
> I tested the example with a 2x2 mesh. It seems to work, here is what I tried
> convCoeff =CellVariable(mesh = mesh, rank=1)
> convCoeff.value=([0.,0.,0.,0.],[0.,0.,0.,0])
> I just want to check, the first bracket is the velocities in the x direction, 
> and the second bracket is the velocities in the y direction?
> And is the grid numbering like 3 4    
>                                1 2
> , from bottom row to top row, left to right column, when I call the viewer?
> Sorry for these simple questions, I just started using fipy
> Thanks
> Kevin
> 
> On Wed, Oct 7, 2015 at 1:56 PM, Guyer, Jonathan E. Dr. 
> <[email protected]> wrote:
> Please see:
> 
> examples/phase/binary.py
> examples/phase/polyxtalCoupled.py
> examples/phase/quaternary.py
> examples/reactiveWetting/liquidVapor2D.py
> 
> for some examples of spatially varying convection velocity fields.
> 
> On Oct 6, 2015, at 6:54 PM, Kevin Lin <[email protected]> wrote:
> 
> > Hi all,
> >
> > I am trying to use fipy to solve a 2D convection-diffusion problem for a
> > oxygen gas transport in a stirred-tank reactor.
> >
> > I have a 2D- velocity field that varies in space for the liquid, but I am
> > having trouble to input this convcoeff into the convectionTerm function.
> > It seems to only accept a constant vector, say [10,10].
> >
> > I have made a simple 2D mesh for this convection-diffusion problem with
> > constant convection coefficient by looking at the 2-D diffusion examples
> > from fipy. I hope someone can help me resolve this issue.
> >
> > Thank you
> >
> > Best Regards
> > Kevin Lin
> >
> > _______________________________________________
> > fipy mailing list
> > [email protected]
> > http://www.ctcms.nist.gov/fipy
> >  [ NIST internal ONLY: https://email.nist.gov/mailman/listinfo/fipy ]
> 
> 
> _______________________________________________
> fipy mailing list
> [email protected]
> http://www.ctcms.nist.gov/fipy
>   [ NIST internal ONLY: https://email.nist.gov/mailman/listinfo/fipy ]
> 
> _______________________________________________
> fipy mailing list
> [email protected]
> http://www.ctcms.nist.gov/fipy
>  [ NIST internal ONLY: https://email.nist.gov/mailman/listinfo/fipy ]


_______________________________________________
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