Thanks again for your help Daniel. Always appreciate it. I will report back
with the results.

Salo


On Tue, Jan 22, 2013 at 6:06 PM, Daniel Wheeler
<[email protected]>wrote:

> On Tue, Jan 22, 2013 at 3:22 PM, Salomon Turgman Cohen <[email protected]
> > wrote:
>
>> What I was thinking is this:
>>
>> A = Gas, B=Liquid
>>
>> Equation 1 for A:
>> dCA/dt=d/dz(D*dCA/dz) - ka*CA*CB + kb*CA*CB
>>
>> Equation 2 for B:
>> dCB/dt=d/dz(D*dCB/dz) - kb*CA*CB + ka*CA*CB
>>
>
> Something like this might work.
>
>  from fipy import TransientTerm, etc
>
>  ...
>
>  eqnCA = TransientTerm(var=CA) == DiffusionTerm(D, var=CA) -
> ImplicitSourceTerm(ka * CB, var=CA) + ImplicitSourceTerm(kb * CA, var=CB)
>
>  eqnCB = TransientTerm(var=CB) == DiffusionTerm(D, var=CB) -
> ImplicitSourceTerm(ka * CA, var=CB) + ImplicitSourceTerm(ka * CB, var=CA)
>
>  eqn = eqnA & eqnB
>
>  ...
>
>  for sweep in range(sweeps):
>      res = eqn.solve()
>      print res
>
> It's just a question of adjusting the ImplicitSourceTerms to give the
> optimal convergence. Try explicit to start and then see if implicit helps
> any and then try coupled. Having both implicit and coupled should improve
> convergence.
>
>
>>
>> I am not sure yet of the order of the reaction rates or if I will need to
>> add a third component (since the reaction is in fact A + B <-> C). Can you
>> guide me in setting up such a system?
>>
>
> Try explicit sources, implicit and then coupled and see how the
> convergence changes for a very simple system. Try 1D to start with.
>
> Set something up and then I can help you debug it. Cheers.
>
> --
> Daniel Wheeler
>
> _______________________________________________
> fipy mailing list
> [email protected]
> http://www.ctcms.nist.gov/fipy
>   [ NIST internal ONLY: https://email.nist.gov/mailman/listinfo/fipy ]
>
>


-- 
Salomon Turgman Cohen
Postdoctoral Associate
Cornell University
(919) 341-9650
_______________________________________________
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