Solving 2D PDE similar to advection-diffusion on unstructured mesh with Trixi

Dear all,

I am trying to solve the following equation:

\frac{\partial \phi}{\partial t} + \nabla\cdot(\phi \boldsymbol{u}) - \frac{\partial}{\partial z} \left[\mathcal{F} \phi(1-\phi)\right] = \nabla \cdot (\mathcal{D} \nabla\phi),

where:

  • \phi is a scalar, \boldsymbol{u} is a vector field advecting the scalar
  • \mathcal{D} and \mathcal{F} are coefficients that can be taken constant, but that will probably become functions of \phi but also x and z.

The domain is bounded by two parabolas (red and brown) and the black lines represent streamlines of the advection field \mathbf{u}:

The boundary conditions are zero-flux through the boundaries.

Is Trixi.jl the right tool for this? I am especially interested in solving the equation from D = 0 (purely hyperbolic, with shocks) to large values of D.

From what I have read in the documentation:

  • Trixi can deal with unstructured (triangular) meshes
  • I can define new equations
  • There are shock-capturing methods with flux-limiter
  • There is a trick to using a spatially varying advecting field by adding a new equation with a 0 temporal derivative

Remaining questions:

  • Can use all discretization methods with custom-implemented equations?
  • Should I expect difficulties with non-linearities induced by D and F becoming functions of the variable \phi?

More generally, I welcome any suggestions on how to approach this with Trixi.jl .

1 Like

Hiya @Liris, I’m one of the Trixi devs. First, let me answer your two questions:

Can use all discretization methods with custom-implemented equations?

Yes, you should be able to. However, I should note that shock capturing and limiting are not implemented for every discretization method.

Should I expect difficulties with non-linearities induced by D and F becoming functions of the variable ϕ?

The implementation of the nonlinearities shouldn’t be an issue; Trixi.jl uses explicit time-stepping which accommodates nonlinearities fairly easily for both hyperbolic and parabolic terms. However, if you need to enforce something like 0 < ϕ < 1, this can be more challenging.

I should note that currently, only the DGMulti solvers in Trixi.jl can accommodate triangular meshes, and while I believe we implemented shock capturing I’m not sure how much it’s been tested on triangles. DGMulti is also less mature than the other solvers, as it hasn’t had as many students working on it over the years. If unstructured quadrilateral meshes are also an option for you, then the P4estMesh solver may also be a good option.

To complement Jesse’s answer: The P4estMesh (and the UnstructuredMesh2D) can deal with unstructured, curved meshes which should be fine for your application as far as I see.
I am not completely sure whether Trixi.jl is the best tool right now in the diffusion-dominated case (large values of D) since we have only implemented the BR1 method for parabolic terms (and focus on explicit time integration methods in the exampels etc.). However, we would like to change this in the future.

What about GitHub - WIAS-PDELib/VoronoiFVM.jl: Solution of nonlinear multiphysics partial differential equation systems using the Voronoi finite volume method?

Hi all,

Thanks for you quick answers !

If unstructured quadrilateral meshes are also an option for you, then the P4estMesh solver may also be a good option.

Yes, they are an option and I can go for this.

I am not completely sure whether Trixi.jl] is the best tool right now in the diffusion-dominated case (large values of D) since we have only implemented the BR1 method for parabolic terms (and focus on explicit time integration methods in the exampels etc.).

I have another (python) package that deals very well with large values of D. As it goes to fairly low values of D, I mainly need a code that can deal with the hyperbolic, and slightly parabolic to have an overlap between the two. So it should be fine.

I’m going to give it a try and see how it goes, probably with the 1D simpler case of:

\frac{\partial \phi}{\partial t} + \frac{\partial}{\partial z}[\mathcal{F}\phi(1-\phi)] = 0

In case I need more help, should I keep the discussion here or move it to the Trixi.jl Github repo?

Thanks again!

You can also ask smaller questions in our Slack channel.

1 Like

I moved the discussion on the github repo as it is easier to write there.