CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM Running, Solving & CFD (http://www.cfd-online.com/Forums/openfoam-solving/)
-   -   Pressure instabilities with interDyMFoam for the floatingObject case (http://www.cfd-online.com/Forums/openfoam-solving/81948-pressure-instabilities-interdymfoam-floatingobject-case.html)

nbadano November 11, 2010 10:00

Pressure instabilities with interDyMFoam for the floatingObject case
 
Dear OpenFoam community

Hi to all,

I’ve been working for a few weeks trying to model the oscillation of big ships inside a shiplock during the filling/emptying of the chamber with OpenFOAM 1.7.1 using interDyMFoam with sixDoFRigidBodyDisplacement. I’ve come across serious instabilities in the pressure field, which eventually blow the simulations. I’ve observed this oscillation along any of the three coordinate axis, depending on the test conditions. I tried both decreasing the time step and improving the discretization, with no beneficial effects at all.

After some testing, I was able to tie this instabilities to the size of the ship in relation to the chamber studying a modified version of the floatingObject tutorial case. As far as I know, the bigger the object is in relation to the chamber the more unstable is the pressure solution is.

The modifications i made to the floatingObject tutorial case were:
1 Removed the splash of water that produced a big perturbation

2 Added an initial condition for the p_rgh field. This is missing in the tutorial case producing a free fall of the floating object during the first time step (which produces a physical vertical oscillation afterward).
I named this case “small” regarding the size of the “ship” a.k.a. floatingObject. Under this setup, the tutorial case runs fine. Numerical pressure oscillations are present, although they diminish after some time without blowing the simulation. The object remains oscillating physically up and down for some time.

After that I increased slightly the size of the floating object, from 0.30x0.30x0.12 m to 0.50x0.50x0.32 m and increased the mass accordingly to initialize it very close to equilibrium flotation conditions. With the same numerical parameters, the simulation failed catastrophically after few time steps. The oscillation in this case get bigger and bigger and eventually shake the object violently.

http://www.lausinacreativa.com.ar/Op...scilations.png
Figure 1: Pressure below the ship for small and medium floatingObjects using interDyMFoam

I’ve made tests reducing the convergence tolerances to very low values (tolerance 1e-13, relTol 0). The oscillations increase a bit slower but I couldn’t get this case to converge with this solver.

There's a small video of the pressure oscillation for the Medium floatingObject here: video

Both test cases can be found here: floatingObject_NoPerturbation_Small.tar.gz
floatingObject_NoPerturbation_Medium.tar.gz

Next I came across the code of shipFoam in openfoam-extend version 1.6 (openfoam-extend/trunk/Breeder_1.6/shipHydrodynamicIG/applications/solvers/shipFoam1.6.2) by M. Couwenberg, febr 2009.

As this solver was made for openFoam version 1.6, it solves for total pressure and not for p_rgh. It also introduces a relaxation stage for the p field during the piso loop, which the author suggests helps reduce pressure instabilities. I though both this characteristics were promising.

I graved both this ideas and modified interDyMFoam into inaInterDyMFoam. As shipFoam ,this solves for total pressure and relaxes the p field (with a coefficient of 0.1~0.2). It also generates automatically the initial hydrostatic conditions for the p field from the alpha initial field (ensuring they are compatible before initiating the calculation). The new source code can be found here:

inaInterDyMFoam source code: inaInterDyMFoam.tar.gz

With this new solver I tested the “Medium” floatingObject again (after modifying the BCs and changing fvSchemes and fvSolutions the in other to account for the new methodology). Much to my surprise, all numerical oscillations vanished from the case!

The case can be found here: floatingObject_NoPerturbation_Medium_pTotal.tar.gz

However “Medium” floatingObject was not big enough (in relation to the chamber) to represent the ships I needed, so I’ve generated a “Large” floatingObject. This one is 0.80x0.80x0.32 m in size inside the 1x1x1 m chamber. Unfortunately, even with the same inaInterDyMFoam solver, pressure oscillation appear in this case after 40 timesteps or so, which increase in magnitude until the simulation is blown.

This last case can be found here: floatingObject_NoPerturbation_Large_pTotal.tar.gz

The oscillation of total pressure below the ship for both this case is as follow:

http://www.lausinacreativa.com.ar/Op...terDyMFoam.png
Figure 2: Pressure below the ship for medium and large floatingObjects using inaInterDyMFoam

I've finally tried once more refining the mesh, fidling with time steps, tolerances, correctors and time integration schemes with no success. I've also made some test with compresibleInterDyMFoam, but ultimately I found it just to slow to solve the problem I need (I've also came across numerical pressure oscillations with this solver, but that's another story!)


So, this is my problem! I publish this here in hope somebody has a better idea of how to deal with this instabilities. I know it should be posible to solve this problem but, right now I don't have many promising ideas as to how to move forward!

Thank you very much!

Nicolás Badano

afo3 November 11, 2010 11:58

hello, I've tried to do something like your experiment, on movement of boats. (and I started too studing floatingObject tutorial)

I have a model of a ship, and I'm studing the advancing resistence ( and then if I can I will study see keeping).
I'm sorry I can't help you because stopping before.
I did a snappyhexmesh starting from the model in stl format. When compiling piontDisplacement, I declared the buondary of the ship as sixDoFRigidBodyDisplacement, but running the case I had the error

FOAM FATAL IO ERROR:
Unknown patchField type sixDoFRigidBodyDisplacement for patch type wall

what about your mesh?
do you have any idea to solve my problem?

anyway, another user (ralph m) gave me an alternative solution about ship motion.
it's the solver shipFoam, but it was developed for openfoam 1.6.2
we're working to make it running well on openfoam 1.7.1

if it can help you here the link :

http://openfoam-extend.svn.sourcefor...ydrodynamicIG/

nbadano November 11, 2010 12:13

Unknown patchField type sixDoFRigidBodyDisplacement for patch type wall
 
Dear asfo3,

Thank you for your reply. Make sure you add this lines at the end of controlDict:

Code:

libs
(
    "libOpenFOAM.so"
    "libincompressibleRASModels.so"
    "libfvMotionSolvers.so"
    "libforces.so"
);

libforces.so is the library containig the 6dof code and boundary conditions (sixDoFRigidBodyDisplacement).

Hope this helps!

Nicolas

PD: I've just finished writing my previous post. As you can now read there, i've given shipFoam some thought. If you want, give inaInterDyMFoam a try.

Ralph M November 11, 2010 17:15

Hi Nicolas,

I'll have a look at your modified code tomorrow. I'm not an expert, but i recognize the pressure thing which makes it very hard to get a solution. Shipfoam is now running smoothly for a sailing ship (fn=0.3) which is free to trim and sink with a maxCo of 0.25. Maybe you should try shipFoam too?

Ralph

afo3 November 11, 2010 17:58

Quote:

Originally Posted by nbadano (Post 283113)
Dear asfo3,

Thank you for your reply. Make sure you add this lines at the end of controlDict:

Code:

libs
(
    "libOpenFOAM.so"
    "libincompressibleRASModels.so"
    "libfvMotionSolvers.so"
    "libforces.so"
);

libforces.so is the library containig the 6dof code and boundary conditions (sixDoFRigidBodyDisplacement).

Hope this helps!

Nicolas

PD: I've just finished writing my previous post. As you can now read there, i've given shipFoam some thought. If you want, give inaInterDyMFoam a try.


thank you! the problem was in controlDict!
just a question about your problem: do you have some restricton about the chamber? I think you've done a very good work with the smaller case.
I will look at your inaInterDyMFoam and let you know!

Ralph M November 12, 2010 08:31

Hi Nicolas,

After compiling (which is performed without problems) and running of Allrun I got an error. Seems that the solver inaInterDyMFoam is not known?

I put the solver at openfoam171/applications/inaInterDyMFoam.

Cheers,

Ralph

afo3 November 12, 2010 08:56

Quote:

Originally Posted by Ralph M (Post 283224)
Hi Nicolas,

After compiling (which is performed without problems) and running of Allrun I got an error. Seems that the solver inaInterDyMFoam is not known?

I put the solver at openfoam171/applications/inaInterDyMFoam.

Cheers,

Ralph

Ralph,
open the file "files" in make folder, delete all and copy this :

inaInterDyMFoam.C

EXE = $(FOAM_USER_APPBIN)/inaInterDyMFoam


save,then do wmake again.

hope it works! (worked with me)


Michele

Ralph M November 12, 2010 09:05

Yep, that's the trick! Thanks!

Ralph M November 12, 2010 10:34

I've done two calculations with my version of shipFoam and with the inaInterDyMFoam. Same mesh and same BC (except voor the absence of epsilon/nut/etc) but shipFoam was stable while the other one diverged already soon (yes, again the pressure which is messing with the problem).

Nicolas, did you tried to run Shipfoam already?

Cheers,

Ralph

nbadano November 12, 2010 12:30

Thanks Ralph! The only thing different between both solvers is the way the ship movement ODEs are resolved. I'll try shipFoam right now and see if it solves my problem!

Regards!

Nicolas

nbadano November 12, 2010 13:54

"Large" floatingObject seems to be running very well with shipFoam!! I still have to try it in my base problem, but I feel optimistic about that! I think the calculation of the ship's movement (custom made in shipFoam) makes all the difference. I'll let what results of my next few tests. Thank you very much Michelle and Ralph for your help!

shipFoam rules!

Best regards,

Nicolas

Ralph M November 12, 2010 13:57

We expect some colourful pictures in the next few days Nicolas! :D

msbealo March 4, 2011 14:55

Ralph,

I haven't got around to compiling shipFoam yet (as I only found it yesterday) but I have a problem with interDymFoam which shipFoam may or may not solve.

Firstly a made a case by combining floatingObject, WingMotion and damBreak to model a ship in a tow tank. As a simplification I initially used a 2 meter diameter sphere to act as my boat. This worked fine. I had it bobbing up and down in zero flow and causing bow waves at a Fn of about 0.5. However, when I replaced this sphere with a yacht hull things when pear shaped.

I am no longer able to run interDyMFoam in parallel (intel core i7), however I can run is as a single process. I did manage to run is with 2 processors but the solution became unstable after a little time. I see from other forum posts that this has been a problem, but I don't know if things have changed since these posts or what the solution is. I tried changing etc/controlDict comms to blocking as suggested but nothing changed.

Will shipFoam solve these issues? If so, how? Or will I still have to run shipFoam on a single processor.

Kind Regards,

Mark

Ralph M March 7, 2011 17:48

Hi Mark,

Sorry for my late reply, I've been busy with carnaval festivities for a couple of days. To answer your question: I really don't have a clue! If you can post the error message things might get more clear?
If not there is a theory which you might use: trial-and-error. Sometimes it works (and sometimes not) :)

Cheers,

Ralph

jordi.muela March 8, 2011 09:19

Hi everyone,

i'm new in OF and i have a question. I downloaded inaInterDyMFoam and compared the source-code with InterDyMFoam and i see the difference how it solves the pressure. I also have downloaded shipFoam and i have tried to understand how it works, and also have understood the difference solving the pressure.

Now the question: in shipFoam, i can see the physics how the solver solves the bodymotion, but i don't find info about how the patch 'sixDoFRigidBodyDisplacement' solves it. Where I can find the info? Can somebody make me a simple explanation of the differences?

My objective is do simulations of a buoy for obtain de added mass and damping coefficients in function of the oscillation frequency and i want to know which 'solver' is better for my purpose.

Thanks!


All times are GMT -4. The time now is 21:08.