CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Special Topics > Mesh Generation & Pre-Processing

[GMSH] extrude rotation from arbitrary OpenCASCADE center

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

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   February 2, 2022, 13:44
Default [GMSH] extrude rotation from arbitrary OpenCASCADE center
  #1
Senior Member
 
Carlos Rubio Abujas
Join Date: Jan 2018
Location: Spain
Posts: 124
Rep Power: 7
crubio.abujas is on a distinguished road
Hello everyone,

I'm trying to create a boundary around a cylinder in gmsh from a STEP file.
My idea is to extrude the seam line to generate a plane and afterwards revolute the plane around the cylinder axis. This approach is successfull as long as the center is precisely, but as soon as minor deviation are present the meshing crashes.

For simple models this works fine as I can cheat the axis to be in exact position, but for real geometries this center would not be in general positioned in a rounded number point. I've tried to add the considered by the CAD software for all the decimals available with success. I guess I need to use the exact position gmsh is using. I've seen that there is a property in gmsh which can be used for this (CenterOfMass), but I cannot make it work.

Code:
SetFactory("OpenCASCADE");

 Merge "Piece.step";


 // Extrude the seam line
Extrude {2, 0, 0} {
    Line{24}; Layers{3}; Recombine;
}

// First half
Extrude {{0, 0, 1}, {CenterOfMass Curve{19} }, Pi} {
    Surface{22}; Layers{30}; Recombine;
}
// Second half
Extrude {{0, 0, 1}, {0,30,0}, Pi} {
    Surface{27}; Layers{30}; Recombine;
}

Coherence;
But it gives me a syntax error. I've been checking the gmsh documentation and CenterOfMass Curve|Surface|Volume {expression} is a valid expresion-list-item so it shall work. I've also tried to save it in an external variable:


Code:
...

com() = CenterOfMass Curve {19};
Printf("",com());

Extrude {{0, 0, 1}, { com() }, Pi} {
    Surface{22}; Layers{30}; Recombine;
}
...
It prints me the center of mass on the Printf statement, but it gives me a syntax error when using it. Trying to manually introduce these coordinates lead to the same error.

Does anybody knows how to deal with this issue?
Attached Files
File Type: zip Piece.zip (10.8 KB, 1 views)
crubio.abujas is offline   Reply With Quote

Reply

Tags
expression-list, extrude, gmsh

Thread Tools Search this Thread
Search this Thread:

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Rotating frame does not rotate about the center of rotation jdp810 SU2 16 July 28, 2020 02:26
6dof for rotation of turbine: unable to fix the center Havinh Fluent UDF and Scheme Programming 0 August 5, 2015 05:35
Rotation center in oscillating airfoil alireza_b FLUENT 0 June 14, 2015 13:02
[ICEM] How can I extrude a 2D Hexa Mesh along a center curve? Daniel C ANSYS Meshing & Geometry 21 November 9, 2012 09:10
[Gmsh] Cannot get the right mesh from gmsh JinBiao OpenFOAM Meshing & Mesh Conversion 2 August 31, 2010 04:51


All times are GMT -4. The time now is 19:36.