precice / openfoam-adapter

OpenFOAM-preCICE adapter
https://precice.org/adapter-openfoam-overview.html
GNU General Public License v3.0
135 stars 82 forks source link

Support incompressible multiphase solver #127

Open moaxm opened 4 years ago

moaxm commented 4 years ago

Problem description The adapter does not seem to support the incompressible multiphase solver interFoam. This can be verified by comparing the forces transmitted to the structural mesh to the forces calculated by the OF forces function object, which are not equal.

At the moment, solvers are differentiated into compressible and incompressible. With the current implementation, the interFoam solver is identified as incompressible, which assumes both constant density throughout the domain as well as kinematic pressure. However, this is not true for the interFoam solver.

Possible Solution Implement force calculation similar to OF forces function object and do not use solver categories incompressible and compressible. See here

davidscn commented 4 years ago

This is a good point. We currently categorize the solver according to the pressure dimension, which is obviously not sufficient in case of a multi-phase problem.

JSeuffert commented 4 years ago

I thought interFoam should already work, I never really tested the forces caclulation for turbulent cases though.
Normally for density it should take the volScalarField rho before checking if the case is incompressible or compressible. For incompressible dynamic viscosity it takes the mu from "immiscibleIncompressibleTwoPhaseMixture" before looking for it in the dictionary.

Did you test it with turbulence or where exactly is the difference in the forces occuring? Maybe we can build a test case with a kind of "deformableDamBreak" set up?

Oh and I just tested it with OF4.x so maybe there also were some changes in OF...

moaxm commented 4 years ago

My setup is:

I use the kOmegaSST turbulence model.

I have used the droptest of an elastic cylindrical shell as a test case. It can be downloaded here

I think the abaqus input file should be working with calculix as well (the start scripts will have to be adapted).

moaxm commented 4 years ago

Normally for density it should take the volScalarField rho before checking if the case is incompressible or compressible.

One other thing: as far as I know there is no rho field in the interFoam solver. The density is implicitly accounted for by the pressure which is given in Pa instead of Pa per kg/m³.

JSeuffert commented 4 years ago

I just checked: in OF6 and also in OF1912 there is a field "rho" that is calculated with "alpha1rho1 + alpha2rho2" (you can check it in the createFields.H in the solver case).

You're right, pressure is in Pa. Was there an error of the dimensions when you tried it with the adapter?

Awesome that you couple it to Abaqus!

MakisH commented 4 years ago

Related to this, we also want to support interFoam for fluid-fluid coupling (#67), where we would need to exchange the kinematic pressure. See, for example, this post on our forum by @chrisosse: https://precice.discourse.group/t/inferfoam-interfoam-breaking-dam/227

Awesome that you couple it to Abaqus!

:+1: :+1: :+1: I think there is a lot of interest in our community about Abaqus. Any contribution (testimonial, adapter, post on Discourse, ...) would be very helpful. Similarly for Simulia-CSE.

moaxm commented 4 years ago

You're right, pressure is in Pa. Was there an error of the dimensions when you tried it with the adapter?

There was no dimensions error. Anyhow, the forces were not correct. If the normal forces are correct, maybe this is caused by the calculation of viscous forces? I will examine this further.

+1 +1 +1 I think there is a lot of interest in our community about Abaqus. Any contribution (testimonial, adapter, post on Discourse, ...) would be very helpful. Similarly for Simulia-CSE.

At the moment, both Python and the SIMULIA Cse C++ API are used. I am planning to make the adapter available on github soon!

precice-bot commented 4 years ago

This issue has been mentioned on preCICE Forum on Discourse. There might be relevant details there:

https://precice.discourse.group/t/inferfoam-interfoam-breaking-dam/227/3

JSeuffert commented 4 years ago

Fluid.log I got it to run with CalculiX (with some changes to the CalculiX input file but at least it runs for a couple of timesteps to check the forces).

I attached to Fluid log file and added an output in the adapter to write the sum of the forces. What is interesting is, that it seems like in the first iteration of the time window the forces of the adapter written after the last iteration and the functionObject are exactly the same (compare lines 628/629 to 652/653). During the iterations in one time window, the forces of the functionObject stay the same and the ones of the adapter are different each iteration (as meant to be). So I think the functionObject forces are somehow not updated during the iterations inside a time window.

This is of course a slightly different set-up as yours (precice 2.0.0, OF6, CalculiX) and I don't know whe I updated the OpenFOAM-adapter itself the last time :-D

The simulation runs for a couple of timesteps and than blows up. But its possible that this is because of my changes to the CalculiX part.

Edit: I set it to laminar for this run...

moaxm commented 4 years ago

CF2Sum.txt CF1Sum.txt

So I think the functionObject forces are somehow not updated during the iterations inside a time window.

Yes, this is something I also noticed in OF1912. I compared the forces from the function object to the ones that are read by the structural simulation and they match. So it seems the function object outputs the converged forces that are obtained at the end of the previous coupling time window.

I have attached the Abaqus forces of my simulation. Reference results for this case can also be found here

precice-bot commented 4 years ago

This issue has been mentioned on preCICE Forum on Discourse. There might be relevant details there:

https://precice.discourse.group/t/fsi-with-interfoam-and-calculix/277/5

precice-bot commented 3 years ago

This issue has been mentioned on preCICE Forum on Discourse. There might be relevant details there:

https://precice.discourse.group/t/fsi-with-interfoam-and-calculix-convergence/334/3

Lianxiali commented 2 years ago

Has moaxm's fix been merged in the current OpenFOAM adapter? It seems the density in FSI subdict does not affect the results for incompressible solvers at all. And the forces are scaled by the rho compared with the forces output by OpenFOAM.

MakisH commented 2 years ago

Has moaxm's fix been merged in the current OpenFOAM adapter? It seems the density in FSI subdict does not affect the results for incompressible solvers at all. And the forces are scaled by the rho compared with the forces output by OpenFOAM.

No, as there has not been any pull request. But maybe this is a good reminder!

BastiLoe commented 2 years ago

At the moment, both Python and the SIMULIA Cse C++ API are used. I am planning to make the adapter available on github soon!

Just wondering if this is available somewhere? I am highly interested in an precice Abaqus adapter.

MakisH commented 1 year ago

This issue seems to attract a lot of interest in the preCICE forum: https://precice.discourse.group/t/inferfoam-cannot-read-pressure-p-rgh/227/3?u=makis

onisps commented 8 months ago

I have used the droptest of an elastic cylindrical shell as a test case. It can be downloaded here

Hello, can you update link to your test case?