Modifying MLMG to solve general advection diffusion Equation #3509
-
Hey AMReX team, What would be the best location to start if I wanted to modify MLMG so that it can solve general advection diffusion equation of the form I was thinking of creating a new class that inherits MLCellLinOpT and start by implementing the pure virtual functions. Any thoughts ? Kind regards, |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
That should work. Note that you are allowed to override non-pure virtual functions too if it's needed. For the |
Beta Was this translation helpful? Give feedback.
That should work. Note that you are allowed to override non-pure virtual functions too if it's needed. For the$$\nabla \cdot (\mathbf{v} \phi)$$ term, you might want to consider write it as $$(\nabla \cdot \mathbf{v}) \phi + \mathbf{v} \cdot \nabla \phi.$$ Then the first term can be merged into the A term, and the grad term is easy to compute at the domain and coarse/fine boundaries. The applyBC function we have fills the domain ghost cells with values that allow you to compute the derivative on the face. So you just need to average two faces to get it to the cell center.