A complex simulation can consist of different spatial domains in which different equations are being solved, different numerical methods being used or the grid structure is different. One example would be a fluid in a tank and an extended hot plate attached to it. We would then like to solve the Navier-Stokes equations in the fluid domain and the heat conduction equations in the plate. The coupling would happen at the interface through the exchange of thermal energy.
It may happen that the two systems to be coupled do not share any variables, but share some of the physics. In such a situation, the same physics is just represented in a different form and with a different set of variables. This is the case, for instance assuming two domains, if there is a fluid system in one domain and a Vlasov system in the other domain. In that case we would have variables representing distribution functions of the Vlasov system on one side and variables representing the mechanical quantities, like density, of the fluid system. To translate the fields from one description to the other one needs to use converter functions. These functions need to be hand tailored by the user in the elixir file where each pair of coupled systems requires two coupling functions, one for each direction.
In the general case, we have a system
In their minimal form they take the position vector examples/structured_2d_dgsem/elixir_advection_coupled.jl
.
When simulating an MHD system and the GlmSpeedCallback
is required,
we need to specify for which semidiscretization we need the GLM speed updated.
This can be done with an additional parameter called semi_indices
, which
is a tuple containing the semidiscretization indices for all systems
that require the GLM speed updated.
An example elixir can be found at examples/structured_2d_dgsem/elixir_mhd_coupled.jl
.
Currently the coordinate values on the nodes can differ by machine precision when simulating the mesh and when splitting the mesh in multiple domains. This is an issue coming from the coordinate interpolation on the nodes. As a result, running a simulation in a single system and in two coupled domains may result in a difference of the order of the machine precision. While this is not an issue for most practical problems, it is best to keep this in mind when comparing test runs.