Hi,

another question. This time on SourceTerm use. I'm checking an article with
diffusion and reaction. So some species diffuse, others only react (waiting
for diffused species to start). If there is an example with this floating
on the internet, do point it my way!

You then have a coupled set of equations, of which one of the non diffusive
species will have equation like

eqn3 = TransientTerm(var=P0) == ImplicitSourceTerm(-k3*M1, var=P0) +
ImplicitSourceTerm(-k5*M2, var=P0)


eqn4 = TransientTerm(var=P1) == ImplicitSourceTerm(k3*P0, var=M1)


M1 will have another equation that has a diffusionterm.

In eqn3 it is normal to use ImplicitSourceTerm as the rhs has -k3 M1 P0.

In eqn4, we could actually write


eqn4 = TransientTerm(var=P1) == k3*P0*M1


or


eqn4 = TransientTerm(var=P1) == ImplicitSourceTerm(k3*M1, var=P0)


In light that all will be coupled in one equation to solve, will this lead
to different solutions? Or will fipy internally all give this the same
matrix formulation?


Also, in eqn3, the first term in rhs is actually -k3 M1 P0. It seems nicest
if somehow it is guaranteed that values as in eqn4 for this term would be
used. Will this be the case in this formulation?

Perhaps there is a way to do this nicer and introduce a helper variable,
U=M1*P0, so as to have only in eqn3 and eqn4 ImplicitSourceTerm(-k3, var=U)
and ImplicitSourceTerm(k3, var=U) respectively. If so, how to go about to
do this. If I do ImplicitSourceTerm(-k3, var=M1*P0) I get immediately the
error

fipy.terms.SolutionVariableNumberError: Different number of solution
variables and equations.


So, I would need an equation for U, would that be

eqnhelper = ImplicitSourceTerm(1, var=U) == M1*P0

Or am I making things too complicated now.


Thanks!

Benny
_______________________________________________
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