Drew -

Apologies for the delayed reply. 

There are a couple of issues here:

 `-convectionCoeff/k*(var.faceValue-T_infinity)` describes a FiPy FaceVariable.

 `[-convectionCoeff/k*(var.faceValue-T_infinity)]` is a single element Python 
list that contains a FiPy FaceVariable. 

 Multiplying that list by other elements has rather unpredictable results.

In short, get rid of the square brackets. We do our best to treat Python lists 
like FiPy vector fields, but there's only so much we can do. A list that holds 
a numpy array is not a vector field.


Beyond that, what you've described looks like a Robin boundary condition to me. 
Our best recommendation for Robin conditions is covered at:

  
https://github.com/usnistgov/fipy/blob/develop/documentation/USAGE.rst#applying-robin-boundary-conditions

Please don't hesitate to ask for more clarification if this doesn't get you 
where you need.

- Jon



> On Nov 16, 2018, at 11:55 PM, Drew Davidson <davidson...@gmail.com> wrote:
> 
>  Hello,
> 
> I am stuck in how to correctly apply a simple convection boundary condition 
> in FiPy, in the context of simple transient heat conduction in 2D.
> 
> Is this correct:
> var.faceGrad.constrain([-convectionCoeff/k*(var.faceValue-T_infinity)]*mesh.faceNormals,where=surfaceFaces)
> 
> I have a 2D mesh generated in gmsh. The convection boundary condition is 
> applied to a curved boundary.
> 
> The code and results are found at:
> https://github.com/cashTangoTangoCash/Convection2DFiPyExample01/tree/master
> 
> The project appears to have a heap of files, but It’s a really just a simple 
> 2D problem with a comparison to an analytical solution. The basic script is 
> ConvectionTestProblem2D_01.py. Report20181116.pdf shows current results, 
> which are clearly wrong.
> 
> Am I correctly applying the convection boundary condition in terms of the 
> FiPy syntax/language for this 2D problem with a gmsh mesh and a curved 
> boundary?
> 
> Thanks
> _______________________________________________
> fipy mailing list
> fipy@nist.gov
> http://www.ctcms.nist.gov/fipy
>  [ NIST internal ONLY: https://email.nist.gov/mailman/listinfo/fipy ]


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

Reply via email to