CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM Running, Solving & CFD (http://www.cfd-online.com/Forums/openfoam-solving/)
-   -   Rotational averaging in a circular container/mesh (http://www.cfd-online.com/Forums/openfoam-solving/66013-rotational-averaging-circular-container-mesh.html)

 Shany July 3, 2009 03:51

Rotational averaging in a circular container/mesh

Hello everyone,

I have a little problem doing some calculations on geometric Fields. Since I'm very new to OpenFOAM I'm sure there's some very easy solution I'm just failing to figure out.

We have a circular mesh and simulate with LES the rotation and turbulence of a fluid inside. The walls are set to a certain rotation speed, heating temperature and so on...

What I try to accomplish is an averaging procedure, that circulary averages the temperatures (T) and fluid speeds (U) .. or any other geometric field we might need in the future. Best described as making slices every one degree and then average over the slices to get mean temperature and velocity distribution in a rotational sense in the fluid.

The idea I investigated last, was to create a copy of the mesh, rotate this and use the meshToMesh class to interpolate the rotated fields back on the original mesh. Reading the second mesh simply from disk would work, but is unwanted as I would have t make a save/read operation of the mesh with each timestep.

creating a mesh in this way:
Foam::fvMesh rotatedMesh
(
IOobject
(
Foam::fvMesh::defaultRegion,
runTime.timeName(),
runTime,
Foam::IOobject::NO_WRITE
),
mesh.points(),
mesh.faces(),
mesh.cells(),
true
);

and then using meshToMesh fails because he requires the patches to be set correctly
rotatingField = transform( Ten, rotatingField );
rotatedMesh.movePoints( rotatingField );
meshToMesh meshToMeshInterp( rotatedMesh, mesh );
meshToMeshInterp.interpolateInternalField
(
(*(AAscalarFields.begin())).internalField(),
originalField,
meshToMesh::INTERPOLATE
);

Right now I'm working in reading the boundary from the disk but my question is: can't this be done in a much simpler way?

 henrik July 6, 2009 05:25

Dear Shany,

I have not looked into your approach in detail. So I won't comment whether it will work or is a good idea.

However, I would go about this by calculating cylindrical coordinates

Code:

`volScalarField Phi = atan2(mesh.C().y(), mesh.C().x());`
Here, I assume that the mesh is aligned with the z-coordinate.

Now you can walk through the Phi and collect your statistics as needed. If this is too expensive, you may create addressing for each sector.

Henrik

 All times are GMT -4. The time now is 06:03.