How to use OpenFOAM adapter

Hello! Dear preCICE team, I have some questions about the OpenFOAM adapter. Previously, I used the fluent-adapter through UDF in Fluent, where I could call functions from the fluent-adapter through Function hooks or load UDFs in Boundary conditions. I’m wondering if calling the adapter in OpenFOAM is similar, and if so, how can I do it? Thank you very much if you can help me with this.
Best wishes,
Lee

Hi @LJR,

here is the documentation of the OpenFOAM adapter: The OpenFOAM adapter | preCICE - The Coupling Library

The adapter is an OpenFOAM function object (similar to the Fluent UDFs), which you just specify at your system/controlDict: Configure the OpenFOAM adapter | preCICE - The Coupling Library

Thank you, Makis. I have previously reviewed the OpenFOAM adapter code that you released on GitHub, but I still have some questions. Within the adapter.c file of the OpenFOAM adapter, there are many functions such as “bool preciceAdapter::Adapter::configFileRead();” and “void preciceAdapter::Adapter::configure();”. I am wondering if all of the functions in the adapter will be called during the coupling process between OpenFOAM and other solvers, or if it is possible to call specific functions by entering commands, such as “void preciceAdapter::Adapter::adjustTimeStep();”.

All of these functions are called automatically by OpenFOAM at specific steps.

What are you trying to achieve? You may be following a more complicated path than you need to.

Dear Makis,I am a graduate student, and my professor has asked me to explore how to use preCICE to couple Nemuca, Fluent, and CFX. I would like to try referencing the Fluent adapter and OpenFOAM adapter. I would like to know if this is feasible.

First of all: best wishes for your new project! :smiley:

Coupling commercial / closed-source codes is always a pain (but generally doable, depending on each case).

The Fluent adapter is in a rather experimental and currently inactive state.

The OpenFOAM adapter is well-tested and actively developed.

About Numeca and CFX, you would need to write your own adapters, depending on the interfaces each code provides.

But do you really need these codes? There are quite some open-source alternatives: Overview of adapters | preCICE - The Coupling Library

Thank you for your well wishes, Makis. I think I need to first learn how to use the existing adapters. I tried using the Fluent adapter and it seemed to work quite well. I really appreciate the effort your team has put into this. Thank you for your response. If this project is too difficult, I may have to give up, but before that, I think I need to make some attempts.

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.