On Nov 23, 2009, at 7:10 AM, S. Chris Colbert wrote:


I think I have I found the flaw in my methods. And it stems from my failure to
do a proper dimensional analysis.

You weren't helped by those examples, which neither appear to ever write down what actual equations they are solving and then say things like "Heat is uniformly generated in the bock at a rate of 20 W/m^2", when as you correctly identified, it has to be volumetric heat generation. Sure, "everybody" knows the heat flux equation, but units matter and equations matter.

Perhaps this example might make for a nice tutorial addition in the Fipy manual. I would be willing to write it up if you all are willing to accept it.

This would be a welcome example. Keep in mind that FiPy's users come from disparate fields, so spell out what equation you're solving and what all the coefficients are; certainly don't assume that everybody knows what "adiabatic" means. Also, it's more likely to get integrated quickly if it's written in the doctest style that the examples in the manual are done in.

Also, if I still have glaring holes in my logic or method, please let me know!

Nothing glaring, but I'll address some of the other questions that you brought up:




Now, since i'm only interested in steady, I figured I could just jack up the diffusivity coefficient to 1. and then I can use the step sizes you see in the
code, but I dont know how valid this is?

Increasing the time step should be OK, subject to the standard concerns about accuracy. For the steady-state solution, I think you're OK, though, as long as the problem converges at all. Since you have convection at the boundaries, I'm not sure you're free change the diffusion coefficient without altering the steady-state temperature profile.

Also, I tried modeling the problem using an ImplicitSource() term ala the doc examples but I could never get it to work. First, FaceVariable(..., rank=1);

I assume you're talking about the FAQ "How do I apply an outlet or inlet boundary condition?"? That is the right place to be looking.

the "..." is invalid python syntax, and I couldn't find in the manual what that
is supposed to represent.

That's just a placeholder for the rest of the arguments to define the FaceVariable, e.g., "mesh=mesh, value=[[0.], [1.]]". I'll see if there's a clearer way to express that, without going into detail that isn't relevant to that particular discussion.

When I let the ellipsis just equal my mesh, I seem
to be unable to set the left side of mesh to take values depending on T (to model the correct flux term). I always get numpy broadcasting complaints when
trying to set value to a non-scalar value.  Any ideas on this?

I would have to see what you tried. This works (modulo any adjustments for density and heat capacity):

    mask = mesh.getFacesBottom()

    outCoeff = (mask * [[0], [-h]]).getDivergence()
convectionOut = ImplicitSourceTerm(coeff=outCoeff) - outCoeff * Tinf


What does .getDivergence()
actually represent. i.e. what does it do, and why is it required? Is this
related to the Divergence vector operator?

Yes, u.getDivergence() is the same as $\nabla\cdot\vec{u}$

Reply via email to