Hi everyone,
I am a new preCICE user, and I recently obtained funding to explore coupling two large 3D MHD codes that we use to simulate solar and stellar atmospheres. I would appreciate some advice on how to set up the coupling in a mathematically and physically consistent way.
The setup is the following: I have two 3D domains sharing a common horizontal interface. One code evolves the lower domain, the other the upper domain, and preCICE is used for two-way coupling across the interface. Simple Cartesian coordinates, and grids are block-structured, with uniform \Delta x, \Delta y, and \Delta z for each block.
One of the evolved quantities is the magnetic field \mathbf{B}, which must satisfy \nabla \cdot \mathbf{B} = 0.
To preserve this condition, both codes use a constrained-transport type scheme: the electric field \mathbf{E} is defined on cell edges, while the magnetic field components are defined on cell faces. The magnetic field is updated through Faraday’s law,
which guarantees \nabla \cdot \mathbf{B} = 0 by construction.
For example, for a face of size \Delta x \times \Delta y, with B_z located at the face centre, the update reads schematically
At the interface, exchanging the normal magnetic field component B_z with the “scaled-consistent-surface” mapping works well, since it conserves the vertical magnetic flux across the interface.
However, to maintain compatibility with the constrained-transport update, I would also need a mapping for the electric field that preserves its circulation along edges. In other words, I would need something conceptually similar to a “scaled-consistent-line” mapping for the electric field, where the integrated quantity along an edge is conserved.
More generally, I am looking for a mapping operator that is compatible with Stokes’ theorem, i.e. something satisfying a relation of the form
Does preCICE currently support something along these lines? Or has anyone encountered a similar problem?
Any suggestions or ideas would be extremely valuable.
Best regards,
Fabio