Hello,

On Thu, Jan 29, 2009 at 4:24 PM, Daniel Wheeler
<[email protected]> wrote:
>
> On Wed, Jan 28, 2009 at 2:55 PM, Ionut Vancea <[email protected]> wrote:
>
>> Here is what I have right now:
>>
>> [..skip...]
>> faceVar = var.getArithmeticFaceValue()
>> fDerivative = .....
>>
>> from fipy.terms.implicitDiffusionTerm import ImplicitDiffusionTerm
>> from fipy.terms.transientTerm import TransientTerm
>>
>> diffTerm4 = - ImplicitDiffusionTerm(coeff = (h*h*h, -fDerivative))
>> eqch = TransientTerm() + diffTerm4
>
> No. I believe this is wrong. The equation should be
>
>   >>> diffTerm4 = - DiffusionTerm((h**3, 1))
>   >>> eqch = TransientTerm() == -DiffusionTerm((h**3, 1)) +
> (fDerivative.getFaceGrad() * h**3).getDivergence()

May I ask you why did you write in this way? I can not see in my
equation the terms you wrote here.

I also modify the equation in this way, but I received an error.

Traceback (most recent call last):
  File "mytestsimul.py", line 43, in <module>
    eqch = TransientTerm() == -DiffusionTerm((h**3, 1)) +
(fDerivative.getFaceGrad() * h**3).getDivergence()
AttributeError: 'binOp' object has no attribute 'getFaceGrad'


> Notice that I have two terms. I believe that you were conflating them
> when you wrote "ImplicitDiffusionTerm(coeff = (h*h*h, -fDerivative))".
> Even what I wrote above is not optimal, the "\phi" derivative needs to
> be run through the "f" function and then you can make that term
> implicit. As it stands it is explicit. The example in the manual
> pretty much spells this all out. How does the example in the manual
> differ from what you are trying to do? Is it in the form of f?

Basically, is not a big difference between example in manual and what
I am trying to do but I have some aditional terms in equation:

\partial_t \phi=-\nabla\{\phi^3 ......

 which I can not manage to write them correctly and  I have different
boundary conditions.

To compare the equation with the example here I included also f(\phi):

\partial_t \phi=-\nabla\{\phi^3\nabla[\triangle \phi -\partial_\phi f(\phi)]\}

where f(\phi) = \frac{b}{2\phi^2}-e^{-\phi}

Thank you,
Ionut

Reply via email to