Hello Daniel,

Thanks for the reply. I will then put in effort to setup my problem in
Fipy. And so naturally you will see me ask more questions in this
mailing list..!


> You will have to go equation by equation.

Do you mean that, in 2D, I have to write out the equations separately
for $v_x$ and $v_y$ as in
$$
\nabla^2 v_x + \zeta \partial_x^2 v_x + \zeta
\partial_{xy}^2 v_y = v_x - \partial_x F(\{c_i\})
\\
\nabla^2 v_y + \zeta \partial_{xy}^2 v_x + \zeta
\partial_{y}^2 v_y = v_y - \partial_y F(\{c_i\})
$$
and treat the cross derivatives as ImplicitSourceTerm's? This should not
be an issue. But I dont understand what $v_x$ and $v_y$ would mean when
solving on the surface of a sphere for instance. In the Cahn-Hilliard
example, it was a simple diffusion term for a scalar field which makes
sense. But for a vector field? Does it still work?



> Don't bother coupling these equation. The benefit comes in coupling
> the flow equation in 2D.

I dont understand this. I do want to solve these equations in 1D in a
flat geometry too. I wanted to know what was wrong with this code, since
it produces this error

http://pastebin.com/2PwYcBW5

In 1D, should I make $v$ a rank-0 variable? With this modification as in

http://pastebin.com/QSMhvRjc

gives me this error

http://pastebin.com/x89MpuEJ

How do I solve this system in 1D? This is the first step. I definitely
need this.

-- 
With my best regards
Vijay 







On Thu, 2013-07-18 at 12:51 -0400, Daniel Wheeler wrote:
> On Wed, Jul 17, 2013 at 9:00 PM, Vijay Krishnamurthy
> <[email protected]> wrote:
>         Hello,
>         
>         I am trying to solve a bunch of advection-diffusion-reaction
>         equations for $N$ scalar fields coupled to a flow field in
>         $d=1,2$ dimensions.
>         
>         Equation for the vectorial flow field
>         $$
>         \nabla^2 \mathbf{v} + \zeta \nabla (\nabla \cdot \mathbf{v})
>         = \mathbf{v} - \nabla F(\{c_i\})
>         $$
>         The flow field is not divergence free. $F$ is a function of
>         the $N$ scalar fields $c_i$, $i=1,\ldots N$. These scalar
>         fields are evolved by coupled advection-diffusion-reaction
>         equations of the form
>         $$
>         \frac{\partial c_i}{\partial t} =
>         -\mathbf{v} \cdot \nabla c_i
>         -(\nabla \cdot \mathbf{v})  c_i
>         + D_i \nabla^2 c_i + R_i(\{c_i\})
>         $$
>         where $D_i$ are the diffusion constants and $R_i$ are
>         (polynomial) reaction terms.
>         
>         ------------------
>         
>         Before investing a lot of time, I want to know if this
>         system of equations can be solved via FIPY in $d=1,2$ in flat
>         and curved geometries (e.g., on a circular/elliptical loop
>         for 1D, on a spherical/ellipsoidal surface for 2D). The
>         example of the Cahn-Hilliard equation solved on a sphere is
>         very promising.
> 
> 
> You can definitely pose this problem to FiPy and probably for the
> geometries of interest. You will not be able to use the coupled
> equation to make the non-standard terms (second term in each
> equation).
> 
>  
>         
>         For 2D, this post
>         http://thread.gmane.org/gmane.comp.python.fipy/2819/focus=2833
>         might be relevant, and I dont know if one can still solve the
>         equations despite the discussion in that thread.
>         
> 
> As this thread suggest, you will not be able to use a coupled equation
> to solve this. You will have to go equation by equation. Sorry about
> that limitation. We really should fix it.
> 
> 
>  
>         I started with the simplest case of a single scalar field on
>         a flat line in 1D, with no reaction terms. For a given $c$
>         field, I can get the flow field and for a given flow field,
>         I can evolve the advection-diffusion-reaction equation for
>         the $c$ field. The trouble is when they are coupled and
>         evolved together.
>         
>         My attempt is here
>         http://pastebin.com/vrnTX5sj
> 
> 
> Don't bother coupling these equation. The benefit comes in coupling
> the flow equation in 2D.
> 
> 
> 
>         
>         Also could you please give your opinion regarding 2D and
>         curved geometries?
> 
> 
> The gemetry should not present a challange to FiPy assuming that Gmsh
> can generate it and with the caveat that FiPy looses accuracy as the
> non-orthogonality and non-conjunctinality is increased. If you are
> looking for an "engineering solution", then it's fine.
> 
> 
> 
> -- 
> Daniel Wheeler

_______________________________________________
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