Posts for the month of May 2011

Vector Diffusion Terms

We are now planning to implement equations of the form,

$ \partial_t q_i + \partial_j \left(F_{ji} \left( \vec{q} \right) \right)  = 0$

This has already been done partially in source:branches/vectorEquations. The convection term looks something like this

$ \partial_t q_i + \partial_j \left( u_{jik} q_k \right) = 0$

The coefficient $u_{jik}$ is a rank 3 tensor in this case. The first index is always over the spatial range. The next two indices refer to the q's. We now have to address diffusion terms. The trouble is that we already have effective rank 3 coefficients for higher order diffusion terms so it's all getting a bit complicated, but it is still manageable.

For higher order terms, we generally use a list or tuple and don't embed the index as part of the tensor so I think that is automatically dealt with. So higher order terms should always be indexed with a tuple or list. That is our current policy and it makes sense. A second order diffusion term will now be of the following form,

$ \partial_t q_i = \partial_k \left( \Gamma_{klij} \partial_l q_j \right) $

Of course the rank of $\Gamma$ can vary depending on whether anisotropy is required. This requires some interpretation. If $q$ is rank 0 then it will be assumed that all the indices of $\Gamma$ are spatial. If q is rank 1 then it will be assumed that the last two indices are over q. For example if the variable is $q_i$ and the coefficient is $\Gamma_{kij}$ then it's assumed that $\Gamma$ has a vector coefficient. If the variable was instead just $q$ then FiPy should throw an error as the coefficient has too many indices. Similarly, for a non-anisotropic vector equation the coefficient would simply be $\Gamma_{ij}$. The meaning of the coefficient indices changes based on context.

  • Posted: 2011-05-24 12:35 (Updated: 2011-05-24 12:36)
  • Author: wd15
  • Categories: (none)
  • Comments (0)