Numerical methods and mathematical models of Elmer
spacedout
Posts: 163
Joined: 30 Mar 2020, 23:27
Antispam: Yes

Hello everyone

I will call AdvectionDiffusionSolver 3 times in a row in the SIF, one for each of 3 different ion variables N1, N2, N3.

The source term for N1 has a non linear term proportional to N1*N2
The source term for N2 has 2 non linear terms , one proportional to N1*N2 and the other to N2*N3
The source term for N3 has a non linear term proportional to N2*N3

They are of course easy to linearize in the Picard way.

Now the Elmer manual has a section entitled Block-matrix construct to build tightly coupled solvers and several keywords are mentioned in it.

I have a feeling though that they will not create the off-diagonal blocks required to solve the global matrix equation and I am unclear as to how
I should proceed to construct them.

Marc
spacedout
Posts: 163
Joined: 30 Mar 2020, 23:27
Antispam: Yes

### Re: Off-diagonal blocks for AdvectionDiffusionSolver

Even worse. There is nothing about interaction matrices in file BlockSolver.F90. It will take the matrices from the individual solvers and insert then as diagonal blocks in the final block matrix. So I really don't know how to fill the off-diagonal blocks with my own interaction terms. I am afraid it will involve a lot of hard coding similar to what is found under the individual solvers and also in global assembly routines.
raback
Posts: 4707
Joined: 22 Aug 2009, 11:57
Antispam: Yes
Location: Espoo, Finland
Contact:

### Re: Off-diagonal blocks for AdvectionDiffusionSolver

Hi Marc,

If you have an AdvectionDiffusionSolver then it has basically just one block. If you want to consider the implicit couplings of the three components you should generate an modified version of the solver with 3 components. Then you can interpret the resulting matrix equation Ax=b such that A is a block 3x3 block matrix. This may be useful for solution strategies since a block-preconditioning method is often efficient for such problems.

In block preconditioner you solve the equations for x1, x2 and x3 one-by-one (either in Jacobi or Gauss-Seidel fashion). This process gives a new search direction that is used by GCR iterative method to find the optiomal update. So here the off-diagonal terms come to play.

The assembly and solution of this block matrix are two separate things. Your first priority is assembly, you can deal with the solution purely as sif magic.

If I had this problem I would start from the generic & modern version of ModelPDE:
https://github.com/ElmerCSC/elmerfem/bl ... DEevol.F90

and just generalize it for multiple components. Here is a strongly coupled system of two Poisson equations:
https://github.com/ElmerCSC/elmerfem/bl ... Solver.F90

-Peter