2

I'm trying to solve a non-linear PDE HJB equation using FiPy, but i have some difficulties translating the PDE into the proper FiPy syntax:

I tried something like : eqX = TransientTerm() == -DiffusionTerm(coeff=1) + (phi.faceGrad * phi.faceGrad) and It doesn't work because of the square of the gradient

My equation: (du/dt = - \delta u + ||\grad(u)||^2)

Does FiPy allow to solve this kind of equations? if not is there a package or a way to solve it using finite difference ? Thank you!

jessi_123
  • 21
  • 1

1 Answers1

2

It's possible to recast the final term to be a diffusion term and a source term so that the equation can be rewritten as,

eqn = TransientTerm() = DiffusionTerm(u - 1) - u * u.faceGrad.divergence

That won't give an error, but might not be very stable

wd15
  • 1,068
  • 5
  • 8