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 Kernels 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 Kernels 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 Kernels 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...):

    type = TimeDerivative
    variable = u

    type = Diffusion
    variable = u

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

    type = TimeDerivative
    variable = v

    type = Diffusion
    variable = v

    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


There are currently no comments

New Comment


required (not published)


R&D 100

Recent Blog Posts

Using our new clang-format Style

2 weeks, 3 days ago

Steady State Algorithm Change

9 months, 3 weeks ago

Making an App inherit from an App

10 months ago

Changing a published API (Deprecation)

10 months, 1 week ago

DiscreteMaterial Objects

1 year ago

Recent Posts






RSS / Atom