Skip to content

Conversation

hoehnp
Copy link
Contributor

@hoehnp hoehnp commented Jul 4, 2025

I added a modified version of the quickstart tutorial for foam-extend with the purpose of testing the foam-extend adapter.

@MakisH MakisH self-requested a review July 4, 2025 14:55
Copy link
Member

@MakisH MakisH left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the contribution! A first quick review of the changes, without having tried to run the code.

We generally have alternatives for the perpendicular-flap tutorial (which is meant to be something to copy from), not for the Quickstart (which is meant to be a specific first case to run). With that said, I do understand that this is a minimal case for you.

Since the changes are very minimal, I wonder if we could make the original case compatible with foam-extend, even if we just applied a small patch automatically. Some of the changes for foam-extend should still work with OpenFOAM (e.g., the noSlip/zeroGradient or the path of the preCICE config) or not be that relevant (e.g., the forces function object).


List of differences compared to fluid-openfoam:

0/U:

- type            noSlip;
+ type            zeroGradient;

dynamicMeshDict:

- motionSolverLibs ("libfvMotionSolvers.so");
+ motionSolverLibs ("libfvMotionSolver.so");
+ diffusivity uniform;

controlDict:

  libs
  (
+    "libforces.so"
+    "liblduSolvers.so"
     "libpreciceAdapterFunctionObject.so"
  );
  • forces function object configuration (do we actually need that?).

fvSchemes:

-     div((nuEff*dev2(T(grad(U))))) Gauss linear;
+     div((nuEff*dev(T(grad(U))))) Gauss linear;

fvSolution:

     p
     {
         solver           GAMG;
         tolerance        1e-6;
         relTol           1e-4;
         smoother         DICGaussSeidel;
+        agglomerator    faceAreaPair;
+        nCellsInCoarsestLevel 10;
+        mergeLevels 1;
     }

preciceDict:

- preciceConfig "../precice-config.xml";
+ preciceConfig ".."/"precice-config.xml";

@hoehnp hoehnp marked this pull request as draft July 10, 2025 18:20
Copy link
Member

@MakisH MakisH left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking good, just needs some comments.

@MakisH MakisH marked this pull request as ready for review September 12, 2025 12:46
Copy link
Member

@MakisH MakisH left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you once more for the contribution. I have added some documentation, and I think that this is now ready to merge.

Note that this tutorial is not meant to provide alternatives (and this is why we should not have an alternative folder - I missed the context when we talked in person). A better tutorial to have a foam-extend alternative for would be the perpendicular-flap. However, since foam-extend can be seen as an alternative version of the same solver, and since this is a test case for you, I see the value and I hold back my general objection to modifying this tutorial.

I also notice now that the "porting" script is actually in the tools/, so it is rather reusable across tutorials. This is a great step in the right direction. As a user, I would expect an overview of needed configuration changes in the adapter documentation (currently the best place would be https://precice.org/adapter-openfoam-support.html, which is sourced from the openfoam-adapter repository).

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

Successfully merging this pull request may close these issues.

2 participants