Hi, I'm doing it as follow:
mesh1 = Grid1D(nx = nx, dx = dx) x = mesh1.getCellCenters()[0] and source term in equation: Intensity*alpha*numerix.exp(-alpha*x) regards Jacek W dniu 02.04.2012 06:54, Daniel Farrell pisze: > Dear list, > > I'm trying to solve a simple 1D (diffusion only) problem, but I'm > having difficulty writing the source term. The equations is of the > form (here for a typeset version, http://i.imgur.com/GOBww.png), > > TransientTerm(n) = DiffusionTerm(n) + SourceTerm(n) + SourceTerm(x) > > where 'n' is the CellVariable an 'x' is space coordinate. > > How can I write a source term that is a function of the spatial coordinate? > > This is the script I have constructed so far, > http://gist.github.com/2280822, I have assumed a 'variable' course > term is a constant to get things working. > > Best regards, > > Dan > _______________________________________________ > fipy mailing list > [email protected] > http://www.ctcms.nist.gov/fipy > [ NIST internal ONLY: https://email.nist.gov/mailman/listinfo/fipy ] _______________________________________________ fipy mailing list [email protected] http://www.ctcms.nist.gov/fipy [ NIST internal ONLY: https://email.nist.gov/mailman/listinfo/fipy ]
