CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Meshing & Mesh Conversion

[mesh manipulation] topoSetDict. rotate box

Register Blogs Community New Posts Updated Threads Search

Like Tree3Likes
  • 1 Post By alexeym
  • 2 Post By derekm

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   February 23, 2015, 04:58
Default topoSetDict. rotate box
  #1
Senior Member
 
Join Date: Jan 2015
Posts: 150
Rep Power: 11
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, 05:07
Default
  #2
Senior Member
 
Alexey Matveichev
Join Date: Aug 2011
Location: Nancy, France
Posts: 1,930
Rep Power: 38
alexeym has a spectacular aura aboutalexeym has a spectacular aura about
Send a message via Skype™ to alexeym
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.
kokab likes this.
alexeym is offline   Reply With Quote

Old   February 23, 2015, 07:03
Default
  #3
Senior Member
 
Join Date: Jan 2015
Posts: 150
Rep Power: 11
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, 07:12
Default
  #4
Senior Member
 
Alexey Matveichev
Join Date: Aug 2011
Location: Nancy, France
Posts: 1,930
Rep Power: 38
alexeym has a spectacular aura aboutalexeym has a spectacular aura about
Send a message via Skype™ to alexeym
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, 16:22
Default
  #5
Senior Member
 
Join Date: Jan 2015
Posts: 150
Rep Power: 11
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, 148 views)
Svensen is offline   Reply With Quote

Old   March 6, 2015, 16:48
Default
  #6
Senior Member
 
Derek Mitchell
Join Date: Mar 2014
Location: UK, Reading
Posts: 172
Rep Power: 13
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
jherb and zfaraday like 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, 03:03
Default
  #7
Senior Member
 
Alexey Matveichev
Join Date: Aug 2011
Location: Nancy, France
Posts: 1,930
Rep Power: 38
alexeym has a spectacular aura aboutalexeym has a spectacular aura about
Send a message via Skype™ to alexeym
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, 04:18
Default
  #8
Senior Member
 
Join Date: Jan 2015
Posts: 150
Rep Power: 11
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, 15:38
Default
  #9
Senior Member
 
Alex
Join Date: Oct 2013
Posts: 337
Rep Power: 21
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


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 Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
The sampled data is not restricted to the defined zone in topoSetDict jiaodanuma OpenFOAM Post-Processing 1 August 14, 2018 07:25
Initial values and boundary condition for LES simulation of a box SaddamH OpenFOAM Running, Solving & CFD 1 July 31, 2018 02:21
I get different results when I scale the 'falling box' tutorial Hossein1 FLUENT 7 August 19, 2017 02:52
[DesignModeler] simply model, empty box conquer ANSYS Meshing & Geometry 0 March 28, 2014 18:26
Immersol Simulation of a Heated Box Dong Phoenics 0 March 2, 2006 21:20


All times are GMT -4. The time now is 09:48.