We had a question on our mailing list recently about how to solve for systems of equations that involve multiple interactions of equations. This comes up a lot in chemical systems, neutronics and lots of other places.

The thing to remember is that you only need one `Kernel` for each "type" of operator. In these kinds of systems it is common for the same "type" of mathematical operator to appear over and over again in different equations. So try to write a small number of `Kernel`s that you can reuse over and over to form your system.

This is why `modules/chemical_reactions` looks the way it does... because it's VERY generic and with a small number of `Kernel`s can completely represent an infinite number of convection/diffusion/reaction equations with arbitrary numbers of reactants and reactions.

Say you have a system that looks like (I'll just write it in 1D so it's easy to see):

```du/dt - u`` = 5*v + 6*w - 8*x
dv/dt - v`` = 2*u + 3*w - 2*x
dw/dt - w`` = 1*u + 4*v - 7*x
dx/dt - x`` = 42*u + 1*v - 8*w
```

If you use the `TimeDerivative` and `Diffusion Kernels` from MOOSE for the LHS of each equation then you would only need to create one `Kernel` that can represent all of those reactions on the RHS of each equation. And if you use "vector coupling" ( see the FAQ on the Wiki ) then your `Kernel`s section of your input file would look like this (I'm only going to write out the `u` and `v` equations you can infer the others...):

```[Kernels]
[./u_time]
type = TimeDerivative
variable = u
[../]

[./u_diff]
type = Diffusion
variable = u
[../]

[./u_reactions]
type = CoupledReactionNetwork  # New Kernel you could create
variable = u
coupled_vars = 'v w x'
reaction_coefs = '5 6 8'
[../]

[./v_time]
type = TimeDerivative
variable = v
[../]

[./v_diff]
type = Diffusion
variable = v
[../]

[./v_reactions]
type = CoupledReactionNetwork  # New Kernel you could create
variable = v
coupled_vars = 'u w x'
reaction_coefs = '2 3 2'
[../]
....
[]
```

The `CoupledReactionNetwork` `Kernel` would utilize "vector coupling" to completely create the residual for the RHS of each equation.

Currently unrated

### New Comment

required

required (not published)

optional

### Using our new clang-format Style

8 months, 2 weeks ago

1 year, 5 months ago

### Making an App inherit from an App

1 year, 5 months ago

### Changing a published API (Deprecation)

1 year, 6 months ago

### DiscreteMaterial Objects

1 year, 8 months ago
or