CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Pre-Processing (https://www.cfd-online.com/Forums/openfoam-pre-processing/)
-   -   Adapting interFoam's floatingObject tutorial for pimpleFoam (https://www.cfd-online.com/Forums/openfoam-pre-processing/219062-adapting-interfoams-floatingobject-tutorial-pimplefoam.html)

tecmul July 13, 2019 19:39

Adapting interFoam's floatingObject tutorial for pimpleFoam
 
Hi all,

I'm running OpenFOAM 6.0 and have run into a problem using the rigidBodyMotion motion solver with pimpleFoam. The motion solver apparently uses the forces function object to calculate the forces on bodies. This works fine with the tutorial's interFoam solver. Running with pimpleFoam however results in the following error:

Could not find rho

From function void Foam::functionObjects::forces::initialise()
in file forces/forces.C at line 208.

This is predictable as pimpleFoam works with the dynamic pressure, so the density is required in order to calculate forces. Modifying the solver to read rho as a constant in the transport properties dictionary gives the same error. I looked at interFoam and saw that it defines rho as a volume scalar field. Doing the same and defining rho as a constant volume scalar field resolved the error.

But a new one came up:

Dynamic pressure is expected but kinematic is provided.

I'm stuck here. The error itself isn't confusing, but the problem is that I can't find the piece of code in the rigid body dynamics library that calls the forces function object. Searching with grep doesn't yield anything. I assume I'll have to modify the manner in which the function object is called?

Can anyone give some hints on how to proceed?

tecmul July 14, 2019 12:57

Turns out all I needed to do was enter the following two lines of code in the rigidBodyMotionCoeffs section of dynamicMeshDict:

rho rhoInf;
rhoInf 1000;


All times are GMT -4. The time now is 18:55.