| title | Volume-coupled flow |
|---|---|
| permalink | tutorials-volume-coupled-flow.html |
| keywords | volume coupling, OpenFOAM, source terms |
| summary | A dummy source participant is coupled to a fluid in a uni-directional way over a region of the domain. The coupling enforces source terms on that region. |
{% note %} Get the case files of this tutorial, as continuously rendered here, or see the latest released version (if there is already one). Read how in the tutorials introduction. {% endnote %}
We introduce flow into a fluid through a square-shaped source located between $$ (3.0, 1.0) $$ and $$ (3.5, 1.5)
The state of the $$ U.x() $$ of the fluid at $$ t = 0.5s $$ (the source region is highlighted):
This case is a convenient starting point for volume coupling where OpenFOAM is a reading participant. The writing Nutils participant (dummy source) can be replaced by a more complex solver according to the user's needs.
preCICE configuration (image generated using the precice-config-visualizer):
Fluid participant:
- OpenFOAM (buoyantPimpleFoam). For more information, have a look at the OpenFOAM adapter documentation.
Source participant:
- Nutils. For more information, have a look at the Nutils adapter documentation. This Nutils solver requires at least Nutils v7.0.
Open two separate terminals and start the participants by calling the respective run scripts run.sh located in each of the participants' directory. For example:
cd fluid-openfoam
./run.shand
cd source-nutils
./run.shThe fluid participants generates a .foam file which can be visualized using, e.g., ParaView.
This case uses OpenFOAM's fvOptions to enforce source terms. Additionally, the coupled variable U needs to be given an alternative name in order for this to work:
FF
{
nameU U_vol;
};Since OpenFOAM already uses U, we need to create an additional velocity variable to use specifically for the coupling. That allows us to carry the desired value over to OpenFOAM and apply it at the correct moment in the iteration. A simplified view of the workflow:


