(0 comments)

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

[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

Comments

There are currently no comments

New Comment

required

required (not published)

optional

R&D 100

Recent Blog Posts

Using our new clang-format Style

3 months, 2 weeks ago

Steady State Algorithm Change

1 year ago

Making an App inherit from an App

1 year ago

Changing a published API (Deprecation)

1 year, 1 month ago

DiscreteMaterial Objects

1 year, 3 months ago

Recent Posts

Archive

2017
2016
2015
2014

Tags

Authors

Feeds

RSS / Atom