Problem "Did not find the correct rho." Using compressibleInterFoam base on OpenFoam-9 couple with solids4foam

Hello, I am trying to run a simulation by using compressibleInterFoam base on OpenFoam-9 couple with solids4foam. it’s a simple coupling case between depthCharge2D and perpendicular-flap, which both of them coming from official tutorials.

But in the fluid terminal show an error " Did not find the correct rho. ", and " From function Foam::tmp<Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh> > preciceAdapter::FSI::ForceBase::rho() const
in file FSI/ForceBase.C at line 85.

I check out the source code of openfoam-adapter which located in FSI/ForceBase.C at line 85.
It seems need to find a field rho in compressible problem,but there is not a rho field in the folder 0.

This problem has been bothering me for two weeks, I don’t know why

Hi zeng,

I think the rho is in the preciseDict file, you can check if the rho is set correctly.

1 Like

Hello Gong,
I have checked the preciceDict and set solverType to compressible in the FSI subdictionary, which seems to not specify the rho fields according to the ForceBase.C description.

Hm… For other fields, the user can provide alternative names via the configuration: Configure the OpenFOAM adapter | preCICE - The Coupling Library

Unfortunately, we don’t do that for the density. Since this is a two-phase solver, I assume that your density field is called differently. What if you hard-code the name that this solver uses into lines 63 and 65 of ForceBase.C? You would then need to rebuild the adapter.

Hi, Makis, thank you for your reply.

Does this mean that the current adapter does not support compressibleInterFoam?
Or I can specify density fields with different names in the FSI dictionary?

In the official OpenFoam example, there is no density field in the 0 folder, instead of the density field name is not “rho”.

I also didn’t see the definition of rho in the compressibleInterFoam solver, but I did see rhoPhi in CreateFields.H

I’m still confused.

Probably the rho field is generated by the solver. Do you see it in the later time directories?

I checked, and neither was the folder in the later time directories. I still haven’t figured out how the compressibleInterFoam handles the density field.

I don’t know more about it, so understanding how this works first would be rather important.

In the meantime, have you seen the new interFoam tutorial? Could give some hints on the rest: Breaking dam with flexible pillar 2D | preCICE - The Coupling Library

Yes, I am currently updating my software version to learn interFoam case, Thank you Makis !

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.