CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM Running, Solving & CFD (http://www.cfd-online.com/Forums/openfoam-solving/)
-   -   Rotating boundary simplefoam (http://www.cfd-online.com/Forums/openfoam-solving/59666-rotating-boundary-simplefoam.html)

 gabriel May 31, 2007 10:01

Is there an easy way to make r

Is there an easy way to make rotating wall boundary conditions? I have an outlet which is rotating and it would be very elegant if the boundary could be set as in the cavity tutorial with a constant velocity but in tangential direction.

Bests, Gabriel

 rswbroers May 31, 2007 10:09

Gabriel, I don't know if it

Gabriel,

I don't know if it will work on an outlet b.c., but you can see here http://www.cfd-online.com/OpenFOAM_D...es/1/4473.html how to create a rotating wall boundary condition.

Good luck!

best regards,
Roland

 fra76 May 31, 2007 10:21

You "just" have to loop on the

You "just" have to loop on the patch and assign, for each file, a different velocity vector, computed in the proper way.
If you don't need something very general, it's enough to modifiy the standard solver (i.e. simpleFoam) and set ther the velocitis before the time loop.
If you want something more general, you have to write some more code, and handle for example dictionary files for specifying rotating patches and velocities, etc...

For example:

vector axis; /* To be defined as rotation axis */
vector center; /* To be defined as center of rotation */
scalar omega; /* Rotation speed */
label patchID=mesh.boundaryMesh().findPatchID("rotating_ patch");
fvPatchVectorField& wU = U.boundaryField()[patchID];
const fvPatchVectorField& faceCentres = mesh.Cf().boundaryField()[patchID];

forAll(wU, faceI)
{
vector c1 = faceCentres[faceI]; /* You probably need it */
wU[faceI] = (axis*omega) ^ (c1 - center);/* Your velocity law ... */

}

I cannot assure that this code works as it is, but the idea should be correct.

Have fun!
Francesco

 cedric_duprat June 1, 2007 06:13

Hi there, I just would like

Hi there,

I just would like to continu the topic there without any answer for Gabriel (sorry) but with other questions ...:
1- what's the difference between your link, Roland (uniformAxialRotation for exemple) and the swirl inlet condition avaiable with OF engineSwirl ?
2- in OF V 1.3, we have to copy the piece of code in OpenFOAM-1.3/applications/utilities/preProcessing and then compiling with wmake or .....not (copy on an other file ...)?

Cedric

 rswbroers June 4, 2007 03:41

Cedric, I have never used t

Cedric,

I have never used the swirl inlet condition or engineSwirl, so I really can't comment on any differences with the code that I am using.

As for your second question, I am not quite sure what you mean.
To use uniformAxialRotation in simpleFoam I copied it to the simpleFoam directory, added the line

uniformAxialRotation/uniformAxialRotation.C

to simpleFoam/Make/files and then did 'wmake' in thi simpleFoam directory.