CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM Post-Processing (http://www.cfd-online.com/Forums/openfoam-post-processing/)
-   -   FvPatch operations (http://www.cfd-online.com/Forums/openfoam-post-processing/61377-fvpatch-operations.html)

 maka July 9, 2008 07:14

cell face side length. I ne

cell face side length.

I need to access the length of cell face in x or z direction. The cells are have hexagonal shape. I thought to use sqrt(magSf) but this will be correction only if dx=dz. Do you know any way to do this. Thansk.

Best regards,
Maka.

 maka July 9, 2008 07:39

I thought of the following but

I thought of the following but it is only valid if mesh resolution in z direction (dz) is uniform.

const fvPatchScalarField& vsfp = vsf.boundaryField()[patchI];
// first cell
scalar cf1 = vsfp[xPatchFaceLabel(0,k)].patch().Cf();
scalar A1 = vsfp[xPatchFaceLabel(0,k)].patch().magSf();

// last cell
scalar cfn = vsfp[xPatchFaceLabel(nx()-1,k)].patch().Cf();
scalar An = vsfp[xPatchFaceLabel(nx()-1,k)].patch().magSf();

// Assuming constant resolution in z direction and cell centered node.
scalar dz = (A1+An)/(2*(cf1+cfn));
scalar dx1 = A1/dz;
scalar dxn = A2/dz;

is there a general solution, like using bounding box on the cell? Thanks.

 maka July 9, 2008 07:40

scalar dxn = An/dz; That was a

scalar dxn = An/dz; That was a correction.

 maka July 9, 2008 11:37

The above is wrong, the correc

The above is wrong, the correct way is to get: faces from the patch and get the edges. I can do that but the problem is that I can not find the function that gives the faceList from polyPatch for example

vsfp.patch().*?* will give faceList of the patch ?

 maka July 10, 2008 07:36

The solution is: vsfp.patch()

The solution is:
vsfp.patch().patch().localFaces()[face_label].edges()[edge_label].centre(vsfp.pa tch().patch().localPoints())

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