On Sep 9, 2014, at 10:00 AM, John Assael <[email protected]> wrote:

> I believe the problem is that all my variables are cell variables. However, I 
> read in the FAQ that diffusion terms have to be FaceVariables.

Coefficients to DiffusionTerms can be supplied as a CellVariable, but they will 
be linearly interpolated to a FaceVariable. This can be a source of discrepancy 
against other methods and/or expectations.

> And then I go to the areas I have defined and set the values. Here is an 
> example of two of them.
> 
>     x, y = mesh.cellCenters
> 
>     meshW = (x ** 2 + y ** 2 <= properties['r'] ** 2)
>     Q.setValue(properties['Q'], where= meshW)
>     T.setValue(properties['T'], where= meshW)
>     D.setValue(properties['D'], where= meshW)
> 
> However, when I do that I get an error for the face variable for every single 
> one I try to change.

You cannot assign the values of a FaceVariable T using cellCenter locations. 
You need to use faceCenter locations:

>>> X, Y = mesh.faceCenters

>>> T.setValue(properties['T'], where=X**2 + Y**2 <= properties['r']**2)


> Would sweeps instead of solve help me solve the problem?

Sweeps are to address non-linearity in your equations. T is not a function of 
dT, so non-linearity is not your problem.


_______________________________________________
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