CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Running, Solving & CFD (https://www.cfd-online.com/Forums/openfoam-solving/)
-   -   rhoInf in dynamicMeshDict dictionary for wingMotion tutorial (https://www.cfd-online.com/Forums/openfoam-solving/203377-rhoinf-dynamicmeshdict-dictionary-wingmotion-tutorial.html)

jiadongw June 26, 2018 04:58

rhoInf in dynamicMeshDict dictionary for wingMotion tutorial
 
Hi Foamers,
I’m working on the wingMotion tutorial using pimpleDyMFoam. I want to change the fluid from air to water. So I modified the nu (10e-6 for water) in transportProperties dictionary and rhoInf in dynamicMeshDict dictionary. I assume that the rhoInf means fluid density, so I put it to 1000 for water.

But the case blow up within several time step. I found the Linear Acceleration of wing become very huge when the rhoInf is set to 1000. After I set the rhoInf to 1 everything is okay.

I seem to see some threads that say the incompressible flow solver solve for kinematic pressure, namely p/rho.

So my question is that what does rhoInf in dynamicMeshDict dictionary means? Fluid density or something else? How should I set this value if I want to the fluid is water?

Any suggestions are appreciated.
Thank you.

jiadongw June 26, 2018 23:59

Any ideas?:o:o

tomf June 30, 2018 16:45

Hi,

I would guess that if you do not modify the velocity, your forces acting on the wing will also increase by about a factor of 1000. The change in viscosity will probably only make this worse, as the Reynolds Reynolds number would increase: inertial effects become more dominant.

You may need to adapt the mass of the solid object as well, or decrease the velocity significantly.

Hope this helps,
Tom

jiadongw July 1, 2018 20:46

Hi Tom,

Thanks for your reply. You are definitely correct. In fact, I have decrease the velocity to a large extent (to 3m/s), but it seems do not work. When I increase mass of wing significantly, the case can run smoothly.

I’m still confused about the rhoInf in dynamicMeshDict dictionary.

If I want to simulate a hydrofoil in water, does I have to modify the rhoInf to 1000?

Because I find several tutorials using interDyMFoam still employ the rhoInf of 1 for water fluid. For example, tutorials / multiphase / interDyMFoam / RAS / DTCHull / constant / dynamicMeshDict.sixDoF and tutorials / incompressible / pimpleDyMFoam / propeller / system / forces.

Is there any difference for them?

Jiadong

tomf July 2, 2018 17:10

Hi Jiadong,

There are quite some differences yes. First of all, the propeller case only uses rhoInf to determine the forces on the propeller. In fact I would think that it needs to be 1000 in that tutorial indeed. As the motion is driving the flow and not vice versa it has nothing to do with your issue.

for the interDyMFoam solver I guess the actual density rho (as alpha1*rho1+alpha2*rho2) is used in the multiphase sense to get the correct result for the forces that drive the motion. So it is diiferent from you pimpleDyMFoam where there is not direct reference to the fluid density.

So in you case I would guess that rhoInf should be 1000 in the dynamicMeshDict yes. The pimpleDyMFoam propeller tutorial is confusing to say the least. You may want to file a bug report. Or one could say that the forces reported are kN instead of N, but that would require a comment in the forces file I guess.

Hope this helps,
Tom

jiadongw July 2, 2018 21:23

Thanks, Tom

It's really helpful for me.

I guess I need to figure out some ways to stabilize the acceleration with rhoInf of 1000 for my case.

Thank you so much.

Jiadong

vava10 March 13, 2021 16:02

Mass property
 
Hey,

I have a ship of 77 kg. I try to find the mass properties using the surfaceInertia tool. In this I used "surfaceInertia -denisty 369.54" so that when this command works I get mass same as 77kg

From this thread rhoInf should be 1000 since it is water. But in the DTCHull simulation rhoInf is 1

I am really confused about rhoInf. I checked rhoInf in https://www.openfoam.com/documentati...8H_source.html and it says

Reference density required by the forces object for
// incompressible calculations, required if rho == rhoInf

?


Thanks in advance

mAlletto March 14, 2021 11:46

Did you have a look at this:


https://www.openfoam.com/documentati...8C_source.html


The normal force is calculated as follows:


Code:



 
            vectorField fN
 
            (
 
                rho(p)*Sfb[patchi]*(p.boundaryField()[patchi] - pRef)
 
            );

the function rho(p) is computed as follows:




Code:



 Foam::scalar Foam::functionObjects::forces::rho(const volScalarField& p) const
 
 {
 
    if (p.dimensions() == dimPressure)
 
    {
 
        return 1.0;
 
    }
 
 
 
    if (rhoName_ != "rhoInf")
 
    {
 
        FatalErrorInFunction
 
            << "Dynamic pressure is expected but kinematic is provided."
 
            << exit(FatalError);
 
    }
 
 
 
    return rhoRef_;
 
 }

and



Code:



if (rhoName_ == "rhoInf")
 
        {
 
            rhoRef_ = dict.get<scalar>("rhoInf");
 
            Info<< "    Freestream density (rhoInf) set to " << rhoRef_ << endl;
 
        }

So for solvers where the pressure has the dimension of pressure (for incompressible flows the dimension of the pressure is the pressure/density) like interFoam


rhoInf should not be considered at all. So basically rho(p) would always return 1 regardless what value rhoInf has.



To test this you could apply different rhoInf values to your simulation and see if the motion of the ship changes




Best


Michael


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