Personal tools
You are here: Home Forum Use Cylinder RadialQuadrangle_1D2D

Cylinder RadialQuadrangle_1D2D

Up to Use

Cylinder RadialQuadrangle_1D2D

Posted by Alexis Coppalle at April 13. 2018


I try to use 'RadialQuadrangle_1D2D'  to mesh a cylinder.

(the base is the inlet, the top is the outlet, and the last one id the wall)

I found a solution, but it use 'Prism_3D' to propagate the mesh along the cylinder axis.


I do not find any other solution than this one.

The probl√®me is that the meshes have not the same size through the cylinder 

see picture giving a slice in the Y-Z plan (the inlet is at the bottom)


Is there another solution?

thanks for an answer




below the .py file


PS: if I don't find the solution, I will use divided cylinder option. However, I would like to know why my solution doesn't work



### GEOM component


import GEOM

from salome.geom import geomBuilder

import math



geompy = geomBuilder.New(theStudy)

O = geompy.MakeVertex(0, 0, 0)

OX = geompy.MakeVectorDXDYDZ(1, 0, 0)

OY = geompy.MakeVectorDXDYDZ(0, 1, 0)

OZ = geompy.MakeVectorDXDYDZ(0, 0, 1) 


# construction du cylindre

TubeFlamme = geompy.MakeCylinderRH(5, 10)

[Face_1,Face_2,Face_3] = geompy.ExtractShapes(TubeFlamme, geompy.ShapeType["FACE"], True)

listSubShapeIDs = geompy.SubShapeAllIDs(TubeFlamme, geompy.ShapeType["FACE"])

listSubShapeIDs = geompy.SubShapeAllIDs(TubeFlamme, geompy.ShapeType["FACE"])

[Edge_1,Edge_2,Edge_3] = geompy.ExtractShapes(TubeFlamme, geompy.ShapeType["EDGE"], True)

# construction des sous-groupes pour faire les patch de openFoam

inlet = geompy.CreateGroup(TubeFlamme, geompy.ShapeType["FACE"])

geompy.UnionList(inlet, [Face_1])

outlet = geompy.CreateGroup(TubeFlamme, geompy.ShapeType["FACE"])

geompy.UnionList(outlet, [Face_3])

wall = geompy.CreateGroup(TubeFlamme, geompy.ShapeType["FACE"])

geompy.UnionList(wall, [Face_2])


geompy.addToStudy( TubeFlamme, 'TubeFlamme' )

geompy.addToStudyInFather( TubeFlamme, Face_1, 'Face_1' )

geompy.addToStudyInFather( TubeFlamme, Face_2, 'Face_2' )

geompy.addToStudyInFather( TubeFlamme, Face_3, 'Face_3' )

geompy.addToStudyInFather( TubeFlamme, Edge_1, 'Edge_1' )

geompy.addToStudyInFather( TubeFlamme, Edge_2, 'Edge_2' )

geompy.addToStudyInFather( TubeFlamme, Edge_3, 'Edge_3' )

geompy.addToStudyInFather( TubeFlamme, inlet, 'inlet' )

geompy.addToStudyInFather( TubeFlamme, outlet, 'outlet' )

geompy.addToStudyInFather( TubeFlamme, wall, 'wall' )



### SMESH component




from salome.smesh import smeshBuilder


smesh = smeshBuilder.New(theStudy)




TubeFlamme = smesh.Mesh(TubeFlamme) 

# algorithmes

Regular_1D = smesh.CreateHypothesis('Regular_1D')

RadialQuadrangle_1D2D = TubeFlamme.Quadrangle(algo=smeshBuilder.RADIAL_QUAD)

Prism_3D = smesh.CreateHypothesis('Prism_3D')


#  nbr de couches concentriques

Number_of_Layers = smesh.CreateHypothesis('NumberOfLayers2D')

Number_of_Layers.SetNumberOfLayers( 15 )

#nbr de segments sur les cercles

Nb_Segments = smesh.CreateHypothesis('NumberOfSegments')

Nb_Segments.SetNumberOfSegments( 30 )

Nb_Segments.SetDistrType( 0 )


# Define submesh on one edge to provide different number of segments

Regular_1D = TubeFlamme.Segment(geom=Edge_3)

Nb_Segments_z = Regular_1D.NumberOfSegments(20)

Nb_Segments_z.SetDistrType( 0 )

SubMesh_1 = Regular_1D.GetSubMesh()

status = TubeFlamme.AddHypothesis(Nb_Segments)

status = TubeFlamme.AddHypothesis(Regular_1D)

status = TubeFlamme.AddHypothesis(Number_of_Layers)

status = TubeFlamme.AddHypothesis(RadialQuadrangle_1D2D)

status = TubeFlamme.AddHypothesis(Prism_3D)

isDone = TubeFlamme.Compute()


inlet = TubeFlamme.GroupOnGeom(inlet,'inlet',SMESH.FACE)

inlet.SetColor( SALOMEDS.Color( 1, 0.666667, 0 ))

outlet = TubeFlamme.GroupOnGeom(outlet,'outlet',SMESH.FACE)

outlet.SetColor( SALOMEDS.Color( 1, 0.666667, 0 ))

wall = TubeFlamme.GroupOnGeom(wall,'wall',SMESH.FACE)

wall.SetColor( SALOMEDS.Color( 1, 0.666667, 0 ))

isDone = TubeFlamme.Compute()

[inlet,outlet,wall] = TubeFlamme.GetGroups()


## Set names of Mesh objects


smesh.SetName(Regular_1D.GetAlgorithm(), 'Regular_1D')

smesh.SetName(Number_of_Layers, 'Number of Layers')

smesh.SetName(RadialQuadrangle_1D2D.GetAlgorithm(), 'RadialQuadrangle_1D2D')

smesh.SetName(Nb_Segments, 'Nb. Segments')

smesh.SetName(Nb_Segments_z, 'Nb. Segments_z')

smesh.SetName(inlet, 'inlet')

smesh.SetName(outlet, 'outlet')

smesh.SetName(wall, 'wall')








Re: Cylinder RadialQuadrangle_1D2D

Posted by Saint Michael at April 13. 2018

Hi Alexis

I tried you script on V8.4.0 Linux and I see no defects in the mesh:


Powered by Ploneboard
Document Actions