<script 
src="https://cdn.rawgit.com/google/code-prettify/master/loader/run_prettify.js";></script>
Hello,

The following PDE is defined in a non-square 2D (x-y) cartesian grid (20 x 10) 
domain

$$ \frac{\partial}{\partial t} (y^2 \phi(x,y,t)) = D \nabla^2 \phi(x,y,t) $$

wherein $y^2$ is the 'y' co-ordinate of my 2D domain.

The FiPy representation of an analogous type of equation is as follows:

$$ \frac{\partial}{\partial t} (\rho \phi(x,y,t)) = D \nabla^2 \phi(x,y,t) $$

    TransientTerm(coeff=rho) == DiffusionTerm(coeff=D)

By matching coefficients, we can see that my $\rho = y^2$

I am quite confused about setting up this problem in FiPy.

a. Are these types of non-linear coefficients allowed for the transient-term ?
b. All the examples that I have seen thus far, use constant/scalar 
coefficients. In my case, I have a coefficient-matrix which depends on the 
spatial variable in the y-direction.
c. If coefficient-matrix is indeed allowed, what must be the data-type ?


The following is my general approach thus far,


*         Construct a 'temporary' 1D mesh using the dy and ny parameters of the 
original 2D mesh, and extract it's node-values using Cellcenters method. This 
should correspond to the original nodes in the y-direction (am I right ?).

*         Convert this to 'ndarray' datatype using numerix.ndarray.

*         Transpose this, such as the result is a column vector.

The one-liner code that (potentially) implements this is shown below:

    discretised_y_vector = numerix.array((Grid1D(dx = dy_2D_original , nx = 
ny_2D_original)).cellCenters[0]).transpose()

Repeat (replicate) the column vector 'nx' times (in my case, 20 times) to 
obtain the coefficient matrix for the transient term.

    discretised_y_matrix = numerix.repeat(discretised_y_vector, nx)

Is this approach correct ? I am a beginner to FiPy and numerical PDE solving in 
general. Any pointers in this direction shall be much appreciated.


Regards

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