Indeed, if I cancel the kine_c or if only have kine_c, it works. 
However, the coupled case just does not work. Could you please explain 
how to split kine_c into a pair of 2nd-order equations? I do not get it. 
Thank you.

On 12/12/14 19:52, Guyer, Jonathan E. Dr. wrote:
> I don't know for sure, but I see that you have a 4th-order diffusion term in 
> kine_c.
>
> Nth-order diffusion and coupled don't play nicely together. Probably, 
> Nth-order diffusion terms should just go away, now that we support coupled 
> equations.
>
> If you split kine_c into a pair of 2nd-order equations, that may resolve this 
> issue.
>
>
> On Dec 12, 2014, at 11:10 AM, Ronghai Wu <[email protected]> wrote:
>
>> Hi Fipy developers and users,
>>
>> I have the following coupled equations:
>>
>> -------------------------------------------------------------------------------------------------------------------------------------------------------------------
>> kine_eta1 =
>>        fp.TransientTerm(var=eta1, coeff=1.) == fp.DiffusionTerm(var=eta1,
>>        coeff=1.) \
>>
>>   + fp.ImplicitSourceTerm(var=eta1,
>>        coeff=(eta1**2 + 5.*(10.-c))) \
>>
>>   - 5.*eta2*eta3
>> kine_eta2 = fp.TransientTerm(var=eta2,
>>        coeff=1.) == fp.DiffusionTerm(var=eta2, coeff=1.) \
>>
>>   + fp.ImplicitSourceTerm(var=eta2,
>>        coeff=(eta2**2 + 5.*(10.-c))) \
>>
>>   - 5.*eta1*eta3
>> kine_eta3 = fp.TransientTerm(var=eta3,
>>        coeff=1.) == fp.DiffusionTerm(var=eta3, coeff=1.) \
>>
>>   + fp.ImplicitSourceTerm(var=eta3,
>>        coeff=(eta3**2 + 5.*(10.-c))) \
>>
>>   - 5.*eta1*eta2
>> kine_c = fp.TransientTerm(var=c, coeff=1.) ==
>>        fp.DiffusionTerm( var=c, coeff=( 1., 1. ) ) \
>>
>>   + fp.DiffusionTerm( var=c, coeff=8. )
>> eq = kine_eta1 & kine_eta2 & kine_eta3
>>        & kine_c
>>
>> eq.sweep(dt=1.e-2)
>> -------------------------------------------------------------------------------------------------------------------------------------------------------------------
>>
>> When I run it, I get the error massage which I do not understand. I am 
>> wondering what this error implies exactly and how to fix it?
>>
>> ---------------------------------------------------------------------------------------------------------------------------------------------------------------------
>>>>> eq.sweep(dt=1.e-2)
>> Traceback (most recent call last):
>>    File "<stdin>", line 1, in <module>
>>    File "/usr/lib/python2.7/dist-packages/fipy/terms/term.py", line 236, in 
>> sweep
>>      solver = self._prepareLinearSystem(var=var, solver=solver, 
>> boundaryConditions=boundaryConditions, dt=dt)
>>    File "/usr/lib/python2.7/dist-packages/fipy/terms/term.py", line 170, in 
>> _prepareLinearSystem
>>      buildExplicitIfOther=self._buildExplcitIfOther)
>>    File "/usr/lib/python2.7/dist-packages/fipy/terms/coupledBinaryTerm.py", 
>> line 122, in _buildAndAddMatrices
>>      buildExplicitIfOther=buildExplicitIfOther)
>>    File "/usr/lib/python2.7/dist-packages/fipy/terms/binaryTerm.py", line 
>> 68, in _buildAndAddMatrices
>>      buildExplicitIfOther=buildExplicitIfOther)
>>    File "/usr/lib/python2.7/dist-packages/fipy/terms/binaryTerm.py", line 
>> 68, in _buildAndAddMatrices
>>      buildExplicitIfOther=buildExplicitIfOther)
>>    File "/usr/lib/python2.7/dist-packages/fipy/terms/binaryTerm.py", line 
>> 68, in _buildAndAddMatrices
>>      buildExplicitIfOther=buildExplicitIfOther)
>>    File "/usr/lib/python2.7/dist-packages/fipy/terms/unaryTerm.py", line 99, 
>> in _buildAndAddMatrices
>>      diffusionGeomCoeff=diffusionGeomCoeff)
>>    File 
>> "/usr/lib/python2.7/dist-packages/fipy/terms/abstractDiffusionTerm.py", line 
>> 318, in _buildMatrix
>>      var, L, b = self.__higherOrderbuildMatrix(var, SparseMatrix, 
>> boundaryConditions=boundaryConditions, dt=dt, 
>> transientGeomCoeff=transientGeomCoeff, diffusionGeomCoeff=diffusionGeomCoeff)
>>    File 
>> "/usr/lib/python2.7/dist-packages/fipy/terms/abstractDiffusionTerm.py", line 
>> 407, in __higherOrderbuildMatrix
>>      b = L * lowerOrderb + b
>>    File "/usr/lib/python2.7/dist-packages/fipy/matrices/pysparseMatrix.py", 
>> line 327, in __mul__
>>      return _PysparseMatrixFromShape.__mul__(self, other)
>>    File "/usr/lib/python2.7/dist-packages/fipy/matrices/pysparseMatrix.py", 
>> line 169, in __mul__
>>      raise TypeError
>> TypeError
>> ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
>>
>> Thanks
>> Ronghai
>> _______________________________________________
>> 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 ]

-- 
------------------------------------------
Ronghai Wu

Institute of Materials Simulation (WW8)
Department of Materials Science and Engineering
University of Erlangen-Nürnberg
Dr.-Mack-Str. 77, 90762 Fürth, Germany

Tel. +49 (0)911 65078-65064

_______________________________________________
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