Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OpenFOAM: Strictly require the preciceAdapterFunctionObject #642

Open
wants to merge 3 commits into
base: develop
Choose a base branch
from

Conversation

MakisH
Copy link
Member

@MakisH MakisH commented Apr 2, 2025

Asks OpenFOAM to abort in case an error is raised inside the adapter, or in case the adapter cannot be loaded (most common source of confusion). Previously, the simulation would continue without the adapter/coupling. Now:

Starting time loop

forces forces:
    rho: rhoInf
    Freestream density (rhoInf) set to 10
    Not including porosity effects

--> FOAM Warning : 
    From void* Foam::dlLibraryTable::openLibrary(const Foam::fileName&, bool)
    in file db/dynamicLibrary/dlLibraryTable/dlLibraryTable.C at line 188
    Could not load "libpreciceAdapterFunctionObject.so"
libpreciceAdapterFunctionObject.so: cannot open shared object file: No such file or directory


--> FOAM FATAL ERROR: (openfoam-2412)
Unknown function type preciceAdapterFunctionObject

Valid function types :

15
(
...
)



    From static Foam::autoPtr<Foam::functionObject> Foam::functionObject::New(const Foam::word&, const Foam::Time&, const Foam::dictionary&)
    in file db/functionObjects/functionObject/functionObject.C at line 129.

FOAM exiting

Future reader: In case you get this error, check for issues with the OpenFOAM adapter / preCICE / dependencies installation. Search or ask in the forum.

Option available since v2012, already long enough. Related discussion in the OpenFOAM GitLab.

I have added a comment, so that users of other versions can get a hint to remove it.

Pending PR to the adapter, to update the documentation and any error-handling workarounds.

Thanks to @fsimonis for asking again for a solution to this.

@vidulejs: Do you see any reason not to merge this?

Checklist:

  • I added a summary of any user-facing changes (compared to the last release) in the changelog-entries/<PRnumber>.md.
  • I will remember to squash-and-merge, providing a useful summary of the changes of this PR.

@MakisH MakisH requested review from fsimonis and vidulejs April 2, 2025 09:31
@MakisH MakisH self-assigned this Apr 2, 2025
@MakisH
Copy link
Member Author

MakisH commented Apr 2, 2025

I now also moved the libs(...) list outside the functions{...} dictionary. This is required in some cases (for custom boundary conditions in the partitioned flow cases), but we should probably be consistent everywhere.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants