Hi,

 I'm trying to solve a system where an equation for a field is coupled to an equation for a scalar. But I'm having problems writing this into FiPy. To illustrate the point here I show you a simplified version of the equations I'm trying to solve:

$$\partial_t A^*=(\rho+\zeta A^*)A-d \nabla^2A^*$$
$$\partial_t A = -\int (\rho+\zeta A^*)A $$
Here $$A^*$$ is a one dimensional field and $$A$$ is a number.

I tried defining the equations like this:

a_s = fp.CellVariable(name = "a_s", mesh = mesh, value = 0.5)

a = fp.Variable(name = "a",value=0.)
eqa_s = fp.TransientTerm(var=a_s) == (-fp.DiffusionTerm(var=a,coeff=d_a)+(rho+zeta*a_s)*a)
eqa= fp.TransientTerm(var=a) == (-(rho+zeta*numerix.sum(a_s))*a)


And then I try to concatenate the equations:


eq=eqa_s & eqa


This doesn't work because the variables a and a_s are of different size. Is there any clever way of implementing this without having to define "a" as a CellVariable with it's value repeated for all of its points?


Best,
Adrian.

_______________________________________________
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