CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Programming & Development (https://www.cfd-online.com/Forums/openfoam-programming-development/)
-   -   Cell Faces: Determining orientation? (https://www.cfd-online.com/Forums/openfoam-programming-development/92111-cell-faces-determining-orientation.html)

 robertmaier9 September 2, 2011 11:22

Cell Faces: Determining orientation?

Hi All,

A little background:

I'm working on a project concerned with the heat transfer across the interface of a multiphase flow using VOF. I am using an adapted version of interFoam. When you have a cell on the interface of two fluids with different heat transfer coeeficients then 0 < alpha < 1. Depending on the angle of the interface you might expect an arithmetic or a harmonic mean of the two to get the overall heat transfer coefficient of the two. Sometimes it's in between both methods. This model tries address this using alpha and the angle of the interface to get a more accurate representation of the heat transfer coefficient, k.

My question:

I would like to calculate for k (heat transfer coefficient) on the faces, but it is critical to know whether the face is horizontal or vertical as the angle of the interface in relation to the direction of heat flow is important. Is there a way to determine the orrientation of a face, i.e. is it horizontal or vertical?

Thanks!

Robert

 robertmaier9 September 2, 2011 11:49

Nevermind. problem solved!

 banji March 17, 2015 13:24

To determine if a face is aligned vertically or horizontally, you can also follow these instructions:

Code:

//Find the surface normal vector for each face and get its internal field
Field<vector> list = mesh.Sf().internalField();

//iterate through all elements of the list, using 'iter', say, and
//determine the sign of the x-component.
//If the x component > 0, it is vertical, else it is horizontal:

forAll (list, iter)
{
if (list[iter].x() > 0)
Info<< "it is vertical" << endl;
else
Info<< "it is horizontal" << endl;
}

Cheers!

 All times are GMT -4. The time now is 16:39.