Skip to content

Add a quickstart rigid flap tutorial#123

Merged
uekerman merged 23 commits intoprecice:developfrom
davidscn:rigid-flap-tutorial
Dec 14, 2020
Merged

Add a quickstart rigid flap tutorial#123
uekerman merged 23 commits intoprecice:developfrom
davidscn:rigid-flap-tutorial

Conversation

@davidscn
Copy link
Copy Markdown
Member

@davidscn davidscn commented Dec 2, 2020

Resolves #117
Setup as described in #117 . We decided to remove the nearest-projection capability and use a RBF mappings instead.

@davidscn davidscn requested review from MakisH and uekerman December 2, 2020 08:35
@uekerman uekerman changed the base branch from master to develop December 2, 2020 15:36
pisoTol 1e-6;
consistent true;

// OpenFOAM (.com), OpenFOAM 5 or older (.org)
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I will check if we can remove this block completely since it is an unnecessary complication for newcomer.

Copy link
Copy Markdown
Member

@uekerman uekerman left a comment

Choose a reason for hiding this comment

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

Nice 👍

  • Let's also add a export:vtk to the Solid participant and explain in the docs how to visualize the point cloud.
  • Could you please format the C++ file with the same clang-format options as used in preCICE?

The IQN convergence is still a bit bad. I'll try whether better settings are possible.

Comment thread FSI/rigid_flap/OpenFOAM-RigidBody/Fluid/system/blockMeshDict Outdated
Comment thread FSI/rigid_flap/OpenFOAM-RigidBody/Fluid/system/fvSchemes Outdated
Comment thread FSI/rigid_flap/OpenFOAM-RigidBody/precice-config.xml Outdated
Comment thread FSI/rigid_flap/OpenFOAM-RigidBody/precice-config.xml Outdated
Comment thread FSI/rigid_flap/OpenFOAM-RigidBody/precice-config.xml Outdated
Comment thread FSI/rigid_flap/OpenFOAM-RigidBody/Solid/rigid_body_solver.cpp Outdated
Comment thread FSI/rigid_flap/OpenFOAM-RigidBody/Solid/rigid_body_solver.cpp Outdated
Comment thread FSI/rigid_flap/OpenFOAM-RigidBody/Solid/rigid_body_solver.cpp Outdated
Comment thread FSI/rigid_flap/OpenFOAM-RigidBody/Solid/rigid_body_solver.cpp Outdated
Comment thread FSI/rigid_flap/OpenFOAM-RigidBody/Solid/rigid_body_solver.cpp Outdated
@davidscn
Copy link
Copy Markdown
Member Author

davidscn commented Dec 7, 2020

Could you please format the C++ file with the same clang-format options as used in preCICE?

I used now the main repo .clang-format file and it should be formatted properly. I'm still a bit confused why the comments are not formatted (linebreaks), but I guess this is not configured in preCICE itself.

@davidscn davidscn requested a review from uekerman December 7, 2020 12:46
Copy link
Copy Markdown
Member

@uekerman uekerman left a comment

Choose a reason for hiding this comment

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

Looks good. Let me only still check the IQN performance. I can merge then.

Copy link
Copy Markdown
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.

I quickly went through the code (did not try to run it) and I have a few minor suggestions. Feel free to integrate as many as you want. I can also try running it, if you want.

Comment thread FSI/rigid_flap/OpenFOAM-RigidBody/Fluid/system/decomposeParDict Outdated
Comment thread FSI/rigid_flap/OpenFOAM-RigidBody/Solid/rigid_body_solver.cpp Outdated
Comment thread FSI/rigid_flap/OpenFOAM-RigidBody/Solid/rigid_body_solver.cpp
Comment thread FSI/rigid_flap/OpenFOAM-RigidBody/Solid/rigid_body_solver.cpp
Comment thread FSI/rigid_flap/OpenFOAM-RigidBody/Solid/rigid_body_solver.cpp Outdated
Comment thread FSI/rigid_flap/OpenFOAM-RigidBody/Solid/rigid_body_solver.cpp
Comment thread FSI/rigid_flap/OpenFOAM-RigidBody/Solid/rigid_body_solver.cpp
@davidscn
Copy link
Copy Markdown
Member Author

davidscn commented Dec 8, 2020

Looks good. Let me only still check the IQN performance. I can merge then.

Where should the README go? I guess I should add it before merging this?

@MakisH
Copy link
Copy Markdown
Member

MakisH commented Dec 8, 2020

Looks good. Let me only still check the IQN performance. I can merge then.

Where should the README go? I guess I should add it before merging this?

Yes, please. Even if we keep the instructions in a separate place (already now or later), we need a minimal README here as well.

Copy link
Copy Markdown
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.

  • I tried running it (serial & parallel) and it works nicely. The Fluid results in ParaView look fine, the watchpoint plot was clear. The motion feels a bit too intense, but good that preCICE converges in such conditions.
  • The code looks clean & nice 👍

Two small todos:

  • We still need a README, but you have this already in mind.
  • We still need to add the script removeObsoleteFolders.sh, similarly to other OpenFOAM tutorials.

@MakisH
Copy link
Copy Markdown
Member

MakisH commented Dec 8, 2020

Looks good. Let me only still check the IQN performance. I can merge then.

Here are the convergence and iteration files for the parallel case:

precice-Solid-convergence.log
precice-Solid-iterations.log

It starts converging in 3-4 iterations, goes up to 7 iterations in the given time frame.

@davidscn
Copy link
Copy Markdown
Member Author

davidscn commented Dec 8, 2020

The motion feels a bit too intense

It's indeed near an (even with implicit coupling) unstable configuration. We could reduce the motion by, e.g., modifying the Fluid density.

@MakisH
Copy link
Copy Markdown
Member

MakisH commented Dec 8, 2020

We could reduce the motion by, e.g., modifying the Fluid density.

Or maybe reducing the (output) time step. We mainly want to change the visual effect here.

Comment thread FSI/rigid_flap/OpenFOAM-RigidBody/README.md Outdated
@davidscn
Copy link
Copy Markdown
Member Author

I added now a README and the tutorial is ready to merge from my side.

Or maybe reducing the (output) time step. We mainly want to change the visual effect here.

I like the visual effect :D

@MakisH
Copy link
Copy Markdown
Member

MakisH commented Dec 11, 2020

I added now a README and the tutorial is ready to merge from my side.

Or maybe reducing the (output) time step. We mainly want to change the visual effect here.

I like the visual effect :D

For me it feels that the flap moves too sharply with every plotting step. Usually we have more smooth transitions. But this can indeed be a matter of preference.

@uekerman
Copy link
Copy Markdown
Member

I also think we need a smaller timestep size:

  • The displacement jumps are too big and, thus, accuracy is probably weak. Might be a strange "first impression".
  • The visual effect.
  • Quasi-Newton coupling needs more similarity of the coupled system between the current and the last timestep.

Furthermore, the fluid side is rather unstable. Many inner iterations are needed. Small changes in the parameters can let the case crash (e.g. smaller dt + parallel coupling). We need a setup that is rather insensitive to changes, robustness-wise. I guess users would want to play around with such things.

What worked well for me was sth like:

  • density fluid 1000
  • nu 0.001
  • density solid 10000
  • dt = 0.005
  • T= 2.5
    ... but then the displacement gets too big. I guess we will need some sort of rotational spring that works against the fluid force.

@davidscn
Copy link
Copy Markdown
Member Author

I added now an implicit rotational spring. After (too) many test runs, I conclude the following: The spring doesn't change the general problem. We have either stable setups or unstable setups. I guess there is even an analytic solution for some characteristic numbers which could tell us the stability region. If we want to see a visual effect in the results, the setups are (after a certain amount of time) unstable, for stable setups, the effect is 'only' visible in the watchpoint. Therefore, I added now a 'switch' in the middle of the simulation, which stiffens the spring so that the unstable initial setup is stabilized. The advantage would be, that you can really play around with the parameters and the simulation is rather stable. If it is not stable, the reason should be clear enough for the user.
As always, feel free to try it yourself. I just realized that I need to update the given formulas.

@uekerman
Copy link
Copy Markdown
Member

I think the stiffness switch is a good solution. With all that, however, the simulation became a little bit too slow maybe. I'll try more things.

@uekerman
Copy link
Copy Markdown
Member

With a few tweaks, we are now done to 30s compute time for adapter + preCICE in debug mode. 🎉

@uekerman uekerman merged commit 2ded95a into precice:develop Dec 14, 2020
@davidscn
Copy link
Copy Markdown
Member Author

With a few tweaks, we are now done to 30s compute time for adapter + preCICE in debug mode. 🎉

Sounds good. I still had some points on my list for the README, in particular the formulas and an explanation for the rigid body model as well as the the explanation of the additional spring. Should this go in a separate PR or are you fine with the current state?

@uekerman
Copy link
Copy Markdown
Member

Feel free to open another PR or directly push to develop if the changes are pure extensions.

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.

Create quickstart tutorial: rotating rigid body in a channel flow

3 participants