Question about cylinderical shell model constructed using PyMAPDL

83 views Asked by At

I'm new for both python and mapdl and a I was writing a code in PyMAPDL to generate a cylindrical shell model and studey its mechanical performance, the solid model looks strange where we can notice an irregulaty in the walls of the shell (please check the photo)Shell walls irregularity this irrugularity affected the mesh generation of the model.

The code that I used on Jupyter lab is:

import numpy as np
from ansys.mapdl.core import launch_mapdl
mapdl = launch_mapdl()
mapdl.clear()
mapdl.prep7()


#create the solid cylynder
inn_rad=50.0e-2
out_rad=55.0e-2
external_pressure=175.0e6
start_surface=0.0
end_surface=30.0e-2
theta1=0.0
theta2=360.0
Sigma_y=350.0e6
FactorOfSafetey=3
#assigning units
mapdl.units('SI')
secnum_cyl = mapdl.cyl4(0.0, 0.0, inn_rad, theta1, out_rad, theta2, (end_surface-start_surface))
mapdl.vplot()

I tried to use: mapdl.cylind (inn_rad, out_rad, start_surface, end_surface, theta1, theta2)

but I got the same result.

2

There are 2 answers

0
Tzane On

I think it is just a view visualization "feature". I created a cylindrical surface just like you, but I saved it to an .stl file and opened in Ansys SpaceClaim and it look round and straight walled as it should.

from ansys.mapdl.core import launch_mapdl

mapdl = launch_mapdl()
mapdl.clear()
mapdl.prep7()
mapdl.units('SI')
secnum_cyl = mapdl.cyl4(xcenter=0.0, ycenter=0.0, rad1=50.0e-2, rad2=55.0e-2, depth=20.0e-2)
mapdl.aplot(show_lines=True, show_bounds=True)
surface = mapdl.geometry.generate_surface()
surface.save("test.stl")

Image of geometry stl in SpaceClaim

The "fisheye" effect in the plot is super confusing, but Im not sure how to get rid of it..

0
Mike R On

It looks an update to either VTK, PyVista, or PyMAPDL has resulted in the parallel projection being turned off. If you use these to plot then the cylinder looks as you are expecting...but the edge lines are still "squished".

pl = mapdl.vplot(return_plotter = True)
pl.enable_parallel_projection()
pl.show()

enter image description here

Mike