CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM Meshing & Mesh Conversion (http://www.cfd-online.com/Forums/openfoam-meshing/)
-   -   boxToCell versus rotatedBoxToCell (http://www.cfd-online.com/Forums/openfoam-meshing/128013-boxtocell-versus-rotatedboxtocell.html)

engineer_the December 30, 2013 13:47

boxToCell versus rotatedBoxToCell
 
Hello,

Inside of topoSet I was using rotatedBoxToCell and was getting an unexpected selection of cells. To clarify I started comparing rotatedBoxtoCell (using non-rotated coordinates) with a simple boxToCell. Can anyone help explain why the two examples below result in two vastly different selections?

Code:

{
    name test;
    type cellSet;
    action new;
    source boxToCell;
    sourceInfo
    {
    box (0.03 0.05 0) (1 1 1);
    }
}

versus

Code:

{
    name test;
    type cellSet;
    action new;
    source rotatedBoxToCell;
    sourceInfo
    {
    origin (0.03 0.05 0);
    i (1 0.05 0);
    j (0.03 1 0);
    k (0.03 0.05 1);
    }
}


It should be noted that the following definitions give the same selection, which confuses me even more:

Code:

box (0 0 0) (1 1 1);
origin (0 0 0);
i (1 0 0);
j (0 1 0);
k (0 0 1);


engineer_the December 30, 2013 14:38

I ended up solving my own problem. The i,j,k vectors are relative to the origin specified, in my example:

box (0.03 0.05 0) (1 1 1);

should be equivalent to

origin (0.03 0.05 0);
i (0.97 0 0);
j (0 0.95 0);
k (0 0 1);

yourvahid August 6, 2014 14:07

Hi,
If you look at the source code it helps you to get it easier, a part of it that I think is helpful and related to your post is shown below:

Code:

    boxPoints[0] = origin_;
    boxPoints[1] = origin_ + i_;
    boxPoints[2] = origin_ + i_ + j_;
    boxPoints[3] = origin_ + j_;
    boxPoints[4] = origin_ + k_;
    boxPoints[5] = origin_ + k_ + i_;
    boxPoints[6] = origin_ + k_ + i_ + j_;
    boxPoints[7] = origin_ + k_ + j_;



All times are GMT -4. The time now is 18:25.