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

Some FSI tutorials are not working with OpenFOAM6 #40

Closed
5 tasks
BenjaminRodenberg opened this issue Aug 15, 2019 · 1 comment · Fixed by #78
Closed
5 tasks

Some FSI tutorials are not working with OpenFOAM6 #40

BenjaminRodenberg opened this issue Aug 15, 2019 · 1 comment · Fixed by #78

Comments

@BenjaminRodenberg
Copy link
Member

BenjaminRodenberg commented Aug 15, 2019

What's the problem?

I am using OpenFOAM6 on my machine and the tutorial cases tutorials/FSI/cylinderFlap/* do not work. I explicitly tested the case tutorials/FSI/cylinderFlap/OpenFOAM-FEniCS while checking #38. For the other cases I tried executing runFluid and it always resulted in an error thrown by OpenFOAM (OF), even before the coupling was initialized.

My proposed workaround

Commenting out some lines in Fluid/system/fvSolution does the trick and it works:

PIMPLE
{
    nCorrectors 2;
    nNonOrthogonalCorrectors 0;
    tolerance 1.0e-14;
    relTol 5e-3;
    pisoTol 1e-6;
    consistent  true;

    nOuterCorrectors 50;

    // residualControl
    // {
    //        U
    //    {
    //        tolerance 5e-5;
    //        relTol      0;
    //    }
    //    p
    //    {
   //         tolerance 5e-4;
   //         relTol      0;
   //     }
   // }
}

Note again: I only explicitly tested the case with OpenFOAM and FEniCS. For OpenFOAM and deal.II, OpenFOAM and CalculiX respectively, I only ran runFluid and with the changes mentioned above OpenFOAM does not exit with an error, but executes until coupling is initialized and it is waiting for the second participant.

What I already did

  • The FEniCS test cases are working (until the very end) without changes on my machine with OF6 using the revision provided on master.
  • I needed to apply some changed for the other cases (CalculiX, deal.II). Using the revision on branch https://github.com/precice/tutorials/tree/OpenFOAM6 the cases are working without changes, but I only validated until the coupling is initialized and OpenFOAM is waiting for the Solid solver. 7f3344b.

What should we do now?

The fix I am proposing above seems to work. However, there are some more things we should do in order to improve the compatibility of the tutorials with different version of OpenFOAM (bold for important ones and italics for less important):

  • Check whether the proposed fix worsens the performance Especially the first few iterations are very expensive. This might be a property of the test case or the performance has been worsened by removing the residualControl. I am not an OpenFOAM expert and I did not compare with the performance using a different OpenFOAM version that accepts residualControl.
  • Test tutorials and OF-adapter for different versions of OF. I think we should open this issue in https://github.com/precice/systemtests. Currently, we only test with OF4 (see here).
  • Test cylinderFlap. Again, this is an issue for https://github.com/precice/systemtests. Currently, we only test flap_perp. Here, residualControl is not provided in fvSolution (see here). Therefore, I also did not observe any problems when running flap_perp under OF6 and I did not expect any problems to show up running cylinderFlap.
  • follow up: there are quite some differences in the tolerances provided in fvSolution of the both cases. Why?
  • automatically choose pimpleFoam or pimpleDyMFoam In Fluid/system/controlDict one has to manually choose the fitting solver. This straightforward, but still has to be done manually.
BenjaminRodenberg added a commit to richahert/tutorials that referenced this issue Aug 15, 2019
MakisH added a commit that referenced this issue May 22, 2020
Instead, offer commented-out ways to get the residualControl
in the various OpenFOAM versions, with the current values.

This may affect convergence, but the purpose of the tutorial is to demonstrate
how to configure preCICE and the adapters.

This fixes #40.
@MakisH
Copy link
Member

MakisH commented May 22, 2020

I can confirm this issue: OpenFOAM.org changed the expected structure of residualControl in version 6, see e.g. this discussion on CFDOnline. The Fluid simulation exits already in the beginning of pimpleFoam:

--> FOAM FATAL ERROR: 
Solution convergence criteria specified in PIMPLE.residualControl must be given as single values. Corrector loop convergence criteria, if appropriate, are specified as dictionaries in PIMPLE.<loopName>ResidualControl.

    From function bool Foam::singleRegionConvergenceControl::readResidualControls()
    in file cfdTools/general/solutionControl/convergenceControl/singleRegionConvergenceControl/singleRegionConvergenceControl.C at line 73.

#78 comments-out the residualControl and adds the OpenFOAM 6 or newer alternative.

On the rest of the comments:

  • Check whether the proposed fix worsens the performance

    I would not worry so much about performance, but about convergence. We should compare both cases, but this can take hours. In any case, this tutorial should only be a starting point to learn how to use preCICE and the adapters.

  • Test tutorials and OF-adapter for different versions of OF.

    This works with all the versions we currently support (quickly tested OpenFOAM 5, 6, 7, and v1912).

  • Test cylinderFlap.

    Good point, but the case is currently too large and long to run on Travis. I prefer that we just keep an eye on such differences for now, until we have better testing infrastructure. The case itself is already quite coarse.

  • follow up: there are quite some differences in the tolerances provided in fvSolution of the both cases. Why?

    I am not sure about the default values, but I think the primary objective here was to improve the results compared to the reference. But this tutorial is already a simplified version, so it does not make much sense to enforce this.

  • automatically choose pimpleFoam or pimpleDyMFoam

    This is something I want to work on as a follow-up of Version fusion openfoam-adapter#128. I may be able to cover also this case there.

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

Successfully merging a pull request may close this issue.

2 participants