CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > OpenFOAM Mesh Utilities

topoSetDict. rotate box

Register Blogs Members List Search Today's Posts Mark Forums Read

Like Tree1Likes
  • 1 Post By derekm

Reply
 
LinkBack Thread Tools Display Modes
Old   February 23, 2015, 05:58
Default topoSetDict. rotate box
  #1
Senior Member
 
Join Date: Jan 2015
Posts: 122
Rep Power: 3
Svensen is on a distinguished road
Is there a way to rotate box defined in the topoSetDict ?
I want to define a set of faces with a boxside not parallel to any of x, y, z axis
Svensen is offline   Reply With Quote

Old   February 23, 2015, 06:07
Default
  #2
Senior Member
 
Alexey Matveichev
Join Date: Aug 2011
Location: Nancy, France
Posts: 1,438
Rep Power: 25
alexeym will become famous soon enoughalexeym will become famous soon enough
Hi,

Yes, there is, it is called rotatedBoxToCell, here's an example

Code:
    {
        name c0;
        type cellSet;
        action new;
        source rotatedBoxToCell;
        sourceInfo
        {
            origin (-0.0312     -0.0202 -1);
            i (0.009238795325112868 -0.003826834323650898 0);
            j (0.022961005941905387 0.0554327719506772 0);
            k (0 0 2);
        }
    }
You can find another example in topoSetDict in topoSet utility source folder. Also inside H and C files in $FOAM_SRC/meshTools/sets/cellSources/rotatedBoxToCell.
alexeym is offline   Reply With Quote

Old   February 23, 2015, 08:03
Default
  #3
Senior Member
 
Join Date: Jan 2015
Posts: 122
Rep Power: 3
Svensen is on a distinguished road
Can you explain the meaning of each parameter ?
Because all I want is to specify the center point, the length, axis of rotation and the angle of rotation.
But I don't understand how using the rotatedBoxToCell specify the rotated box in this way...
Svensen is offline   Reply With Quote

Old   February 23, 2015, 08:12
Default
  #4
Senior Member
 
Alexey Matveichev
Join Date: Aug 2011
Location: Nancy, France
Posts: 1,438
Rep Power: 25
alexeym will become famous soon enoughalexeym will become famous soon enough
Hi,

if you go to $FOAM_SRC/meshTools/sets/cellSources/rotatedBoxToCell and open rotatedBoxToCell.C file, you will see these lines:

Code:
    pointField boxPoints(8);
    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_;
This is how coordinates of the corners of the box are calculated.

Quote:
Because all I want is to specify the center point, the length, axis of rotation and the angle of rotation.
Well, you can implement your own anotherRotatedBoxToCell to take described parameters.
alexeym is offline   Reply With Quote

Old   March 6, 2015, 17:22
Default
  #5
Senior Member
 
Join Date: Jan 2015
Posts: 122
Rep Power: 3
Svensen is on a distinguished road
I've tried to use the rotatedBoxToCell with defining the origin and i,j,k components, but I've got strange results... topoSet says that "0 cells are selected"... I've attached the Image with my geometry and original point (shown as green) and i,j,k points.
The coordinates of origin point were used "as is". i,j,k components were defined with subtraction of components. For example for j component j=(j_x - origin_x; j_y - origin_y; j_z - origin_z). Mathematically it is OK, because according to the source code of the rotatedBoxToCell there values of components will be added with the values of the origin point (addition of vectors). But why topoSet gives me "0 cells are selected"... ?

Maybe someone had this problem before ?...
Attached Images
File Type: png rotatedBoxToCell.png (53.7 KB, 23 views)
Svensen is offline   Reply With Quote

Old   March 6, 2015, 17:48
Default
  #6
Senior Member
 
Derek Mitchell
Join Date: Mar 2014
Location: UK, Reading
Posts: 134
Rep Power: 5
derekm is on a distinguished road
Quote:
Originally Posted by Svensen View Post
I've tried to use the rotatedBoxToCell with defining the origin and i,j,k components, but I've got strange results... topoSet says that "0 cells are selected"... I've attached the Image with my geometry and original point (shown as green) and i,j,k points.
The coordinates of origin point were used "as is". i,j,k components were defined with subtraction of components. For example for j component j=(j_x - origin_x; j_y - origin_y; j_z - origin_z). Mathematically it is OK, because according to the source code of the rotatedBoxToCell there values of components will be added with the values of the origin point (addition of vectors). But why topoSet gives me "0 cells are selected"... ?

Maybe someone had this problem before ?...
yes, i,j,k have to be correct handed or it gives you zero
zfaraday likes this.
__________________
A CHEERING BAND OF FRIENDLY ELVES CARRY THE CONQUERING ADVENTURER OFF INTO THE SUNSET
derekm is offline   Reply With Quote

Old   March 7, 2015, 04:03
Default
  #7
Senior Member
 
Alexey Matveichev
Join Date: Aug 2011
Location: Nancy, France
Posts: 1,438
Rep Power: 25
alexeym will become famous soon enoughalexeym will become famous soon enough
Hi,

@Svensen, if you provide more details (real values of i, j, k and location of (0, 0, 0) point on the picture) the answer could be more precise. Usually topoSet selects 0 cells if volume of box is negative (or maybe you just miss the scale of the mesh?).
alexeym is offline   Reply With Quote

Old   March 7, 2015, 05:18
Default
  #8
Senior Member
 
Join Date: Jan 2015
Posts: 122
Rep Power: 3
Svensen is on a distinguished road
I've already founded the solution for this problem: I redefined the vectors to form right-hand system of vectors.
Svensen is offline   Reply With Quote

Old   March 13, 2015, 16:38
Default
  #9
Senior Member
 
Alex
Join Date: Oct 2013
Posts: 332
Rep Power: 14
zfaraday will become famous soon enough
Quote:
yes, i,j,k have to be correct handed or it gives you zero
Thanks Derek for your wise words! I've been struggling all the afternoon trying to select a set of cells with a rotated box and I had no clue what was the reason why it wasn't selecting anything. Now I finally could make it work as I wanted!

Cheers,

Alex
__________________
Web site where I present my Master's Thesis: foamingtime.wordpress.com

The case I talk about in this site was solved with chtMultiRegionSimpleFoam solver and involves radiation. Some basic tutorials are also resolved step by step in the web. If you are interested in these matters, you are invited to come in!
zfaraday is offline   Reply With Quote

Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
[DesignModeler] simply model, empty box conquer ANSYS Meshing & Geometry 0 March 28, 2014 19:26
Regarding box keyword in toposet Dict! mukut OpenFOAM Pre-Processing 8 September 28, 2013 23:36
best way to mesh a thin box? tony CFX 1 January 14, 2008 14:22
Junction Box Anil CFX 2 June 27, 2006 10:18
Immersol Simulation of a Heated Box Dong Phoenics 0 March 2, 2006 22:20


All times are GMT -4. The time now is 21:40.