CFD Online Discussion Forums

CFD Online Discussion Forums (
-   OpenFOAM (
-   -   Reletive Motion (

dandalf April 26, 2011 06:57

Reletive Motion
Hi all,

I am working on simulating the flow over a moving three dimensional body immersed in incompressible fluid.

In openFoam 1.7.0, I am using pimpleDyMFoam to achieve the local deformation of the body however I now need to simulate the net movement of the body. To minimize the mesh transformation cost and to keep my object of interest centered in my mesh, I wish to take a Eulerian approach, and simply update the relative free stream velocity at each iteration.

For this I need to update not just the relative boundary velocity values but also the velocities of the internal mesh.

Can anybody suggest a way to achieve this. Am I missing an obvious trick here?

pablodecastillo April 26, 2011 15:17

Hi Dan,

I think that you can do it with solidbodymotion, it has SDA and SDK class, who let define movements for the domain. But they are very restrictives. So it seems that if you want to implement your own movements with ODE or similar, you can move your domain with fvMesh::movePoints.

fvMesh::movePoints will move your points and calculate volumen variation, phi variation etc... then this value will be used by makerelative or makeabsolute to take account the influence of the velocity body/domain in your problem.

In theory it will be done, if it is wrong i hope that somebody give light.

Do not forget say mesh.moving(true);, or makerelative and absolute is not going to work.


deepsterblue April 26, 2011 16:11

fvMesh::movePoints() calls polyMesh::movePoints(), which in-turn calls the moving(bool) member function, so there's no need to call the moving() function explicitly

pablodecastillo April 26, 2011 17:38

And when/where is updated C() and Cf()?, i was trying to find it without succesful.


deepsterblue April 26, 2011 19:55

All geometry is demand-driven. Once movePoints is called, geometry information is cleared (using clearGeom()? Can't remember the function name), and reconstructed on-demand only when mesh.C(), etc is called the next time.

Look for calls to deleteDemandDrivenData() in the source-tree for clues...

pablodecastillo April 26, 2011 22:24

So, i can not find what i am missing.
I am coding a solver based in interdymfoam, but using my own movement mesh.

The problem is that when i move all the domain, the free surface is moving with the domain, it is like flux relative was not working right for phi interface.

Any idea?


pablodecastillo April 27, 2011 12:29

I go to try to explain my problem better;

The solver is solving the towing tank resistance for ships with trim and sink. It is using rigid body motion (motion for all the domain) to trim&sink.

The mistake is coming when solving the sink, when the boat (all the domain) goes up or down, the free surface is going with him (so if the body sink 10 cm all the domain is moving too 10 cm and the free surface level too). It means that the relative flux is not updating the free surface or i am not giving the properly boundary conditions.

Any idea??

Advanced thanks

pablodecastillo April 27, 2011 19:19

Hello again,

I found that i have no relative flux, i did it surfaceScalarField phi44 = fvc::meshPhi(U); and i got 0 for the average of phi44. It seems that phiPtr_ is not saving the old value. Anybody can help me to figurate what is happening?


Arnoldinho December 6, 2011 13:08

Hi Pablo,

I think I am facing a similar problem right now (but am still figuring out if it might be related to your situation): After modifying the point positions, the water in my flume is running out of it. Boundary conditions for U and alpha1 are still properly defined.

So: Did you figure out what the reason was, and could you fix it?


pablodecastillo December 20, 2011 08:08

Hi Arne,

Sorry this late reply. I fixed doing fix the velocity at the top and bottom of the domain, in my case it works pretty well.


All times are GMT -4. The time now is 12:14.