The best way to learn how to couple a Nutils application script is to look at some examples:
- Two heat conduction scripts coupled to one another (Nutils 6 and 7)
- A heat conduction script coupled to CFD for conjugate heat transfer (Nutils 7)
- An ALE incompressible Navier-Stokes solver coupled to solid mechanics for fluid-structure interaction (Nutils 6)
- A linear solid mechanics solver coupled to fluid mechanics for fluid-structure interaction (Nutils 8)
- A channel flow solver coupled to a transport problem solver (Nutils 7)
- A fracture mechanics solver volume-coupled to a dummy electro-chemistry corrosion model (Nutils 6)
- A 1D compressible fluid solver coupled to a 3D compressible fluid solver (uses deprecated version of Python bindings) (Nutils 5)
We recommend using a Python virtual environment to install different Nutils versions. See the requirements.txt and the run.sh of the cases included in the preCICE tutorials for an example.
Version 8 requires bottombar as a dependency. pip might automatically install version 2.0, which has known issues when used with preCICE. A patch was implemented in version 2.1, thus a workaround is to explicitly re-install version 2.1: pip3 install bottombar==2.1 (in the same virtual environment).
In case you get an error nutils.Matrix.MatrixError: reordering problem, this might be an issue with the solver backend on your system. In that case, try setting NUTILS_MATRIX=scipy before calling the respective Nutils solver (requires installing the Python package scipy).