Thanks for the quick response. > You might also want to look at Clawpack for this class of equations. FiPy > isn't great at dealing with strictly hyperbolic equations. It will give you > an answer, but in general high order schemes are necessary.
Will do, I have in fact looked at Clawpack before, but FiPy seemed somewhat more accessible. I am not at all a numerics person, so I will need to read up on that before being able to fully leverage Clawpack. > I am confused by the above equation. Are the x and t derivatives on the > correct terms? Yes they are. This equation comes from expressing the equation rho_t + (g(rho)*rho)_x in terms of the flux u rather the density rho. The function f is the partial inverse of the flux function g(rho)*rho. This equation shows up in a PDE constrained optimal control problem. > Why do you need either the ".divergence" or ".grad" methods? I am not sure > what you are trying to do. I was hoping relabel variables x <=> t and then write u_t + f(u)_x = 0 with initial condition u(x,.), and then express the term f(u)_x by fu.getGrad(), where fu is a new Cell or FaceVariable updated to f(u) at each step. But if I just do this I get the following Type Error at runtime: TypeError, "The coefficient must be rank 0 for a rank 0 solution variable." Does what I have in mind make any sense here? Thanks, Max On Jan 17, 2013, at 8:47 AM, Daniel Wheeler <[email protected]> wrote: > On Wed, Jan 16, 2013 at 4:17 PM, Maximilian Balandat <[email protected]> > wrote: > Hi, > > I am trying to solve the following nonlinear conservation law in one spatial > dimension in the variable u(t,x): > > u_x + f(u)_t = 0 > > You might also want to look at Clawpack for this class of equations. FiPy > isn't great at dealing with strictly hyperbolic equations. It will give you > an answer, but in general high order schemes are necessary. > > I am confused by the above equation. Are the x and t derivatives on the > correct terms? > > > with initial condition u(.,0) = u0. Here f is a nonlinear function of u (f is > a local operator). I want to solve this on the domain [-tmin, tmax] x [0,L] > (this is just a conservation law with variables x,t interchanged...), so the > mesh is on the interval [-tmin, tmax]. So far I am using periodic boundary > conditions for simplicity. > > If f were of the form f(u) = f_0(u)*u I could simply use a Convection term > and update the coefficient f_0(0) at each step, I have done that successfully. > > Good. > > But for the above problem I am not sure how to employ the .divergence or > getGradient() methods and I am struggling to find examples. > > Why do you need either the ".divergence" or ".grad" methods? I am not sure > what you are trying to do. > > -- > Daniel Wheeler > _______________________________________________ > 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 ]
