-
Notifications
You must be signed in to change notification settings - Fork 4
Physics Modules
MrHyDE is designed to allow for rapid development of physics modules with automatic coupling to any existing physics module. This is achieved by having a lightweight and simple format for the physics modules that derives from a common base class. The physics modules are also isolated from the rest of code. Only the physics interface interacts with the physics modules, and the modules themselves only interact with the workset and the function manager. The MrHyDE repository has a number of physics modules to serve as examples for future users. Some of the more interesting (or more developed) physics modules live in external repositories and are not open source. Adding in a new physics module is straightforward and this part of the code rarely changes.
In general, weak formulations of partial differential equations can have three different types of contributions: volumetric, boundary and face. In MrHyDE, we consider general equations of the form
where
The weak formulation seeks
for all
Any number of physics modules can be added to a simulation and solved fully coupled or iteratively. In this section, we focus on the fully-coupled case and the next section will illustrate the iteratively coupled case. The key to enabling both of these cases is the workset object. Worksets span both physics modules and physics sets, which are groups of physics modules. They always know the latest available solutions for all physics in the problem and can provide this information at the integration points for any variable, regardless of the physics module.
Setting up a multiphysics system is simple:
While one can solve this system of equations, they are not yet coupled together. One simple way to couple the equations is through the definitions of source terms and coefficients. Both the Navier Stokes module and the convection-diffusion-reaction (cdr) module can read in functions defined in the input file, so we couple the equations through these:
Here, we have set the convection velocities to be the fluid velocities and introduced a nonlinear source term in the Navier Stokes equation that depends on the concentration of the advected field. Thus, there is a two-way coupling between these equations.