On Sat, Feb 11, 2012 at 3:07 AM, Michael Brown <[email protected]
> wrote:

> Hi all,
>
> I'm totally new to FiPy (and finite volume methods generally) so I
> apologize if this is a silly question.


Thanks for your interest in FiPy. This is actually a difficult problem to
solve with current versions of FiPy. It's certainly not a silly question.


> I need to solve a semilinear
> wave equation of the form (in 1 dimension):
>
> utt - uxx = f(x, u)
>
> where the notation is: u unknown, ux is the first space derivative, utt
> the second time derivative etc. f(x, u) is a nonlinear
> function of both x and u which can vary quite rapidly with both variables.
> I'd also like to solve the analogous problem in 2-D and 3-D
> and it would be really good to be able to solve it on arbitrary domains.
>


>
> It's easy to get this into first order form,
>
> ut = v
> vt = uxx + f(x, u)
>

I think a better substitution is

  v_t = u_x + g

where g_x = f, so you end up solving a hyperbolic system of the form

  v_t - u_x = g

  u_t - v_x = 0

This enables the solution in a fully coupled manner using Riemann solution
type flux updates allowing the coupled nature of the equations to be used
in the interpolation.
Solving with standard non-coupled interpolation (currently used in FiPy)
leads to decoupling of the solution variables.

Unfortunately the Riemann type flux updates have not been fully integrated
into FiPy yet. This is available on a research branch of the code if you
are feeling brave. The branch is fairly mature, but use at your own risk.
It requires cython to be installed. See

  <http://matforge.org/fipy/browser/branches/riemann>

There are a two examples

  <
http://matforge.org/fipy/browser/branches/riemann/examples/riemann/acoustics.py
>

and

  <
http://matforge.org/fipy/browser/branches/riemann/examples/riemann/rotation.py
>

The first solves the linearized acoustics equations in 1D. The second
solves a single advection equation in 2D for a rotating square.


> But it's still not quite in the standard form for FiPy. I'm guessing I'd
> have to write the uxx term as a source term? Is FiPy suited to this
> kind of problem - and if not can you recommend another (preferably open
> source) tool? I'd appreciate any advice.
>

You could also try CLAWPACK as an alternative.

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