Volume mesh difference exporting from Interface and Script

General discussion about TexGen.

Moderators: Martin, Developers

Post Reply
cmagdalena
Posts: 3
Joined: Wed Oct 05, 2022 12:53 pm

Volume mesh difference exporting from Interface and Script

Post by cmagdalena »

Hello,

I have a problem exporting a volume mesh, whe I export it from the interface, it consideres the yarns and the matrix as two different bodies (this is what I want to get from the script), but when I try to do it from script, it only cionsideres one. I1m using same commands , am I messing something? (pictures order is Script Interface/Script)
Comandos_Script.PNG
Comandos_Script.PNG (8.3 KiB) Viewed 62985 times
Ansys_Interface.PNG
Ansys_Interface.PNG (26.01 KiB) Viewed 62985 times
Ansys_Script.PNG
Ansys_Script.PNG (18.5 KiB) Viewed 62985 times


Thanks,
louisepb
Project Leader
Posts: 998
Joined: Tue Dec 08, 2009 2:27 pm
Location: Nottingham

Re: Volume mesh difference exporting from Interface and Scri

Post by louisepb »

Hi,
There is nothing obvious which springs to mind. The commands all seem correct but it is difficult to say without seeing the rest of your script. It may seem obvious, but have you added the yarns to your textile in your script? (I'm afraid that's the only thing I can think of without seeing it or being able to test it).

Best wishes,
Louise
cmagdalena
Posts: 3
Joined: Wed Oct 05, 2022 12:53 pm

Re: Volume mesh difference exporting from Interface and Scri

Post by cmagdalena »

Hi,

Thank you for your quickly answer. I have added the yarns, because in the user interface they appear. Here is the Script I'm using( is not too long):

Code: Select all

# Creamos el textile
Textile=CTextile()

#Definir parametros seccion tow(mm)
w =8 #width
h = 2 #height
p = 0.5 #power
L = 50 #Longitud yarn

Yarns0 = [CYarn(), CYarn(), CYarn(), CYarn()]
Yarns90 =[CYarn()]
Yarns45 = [CYarn()]

Yarns0[0].AddNode(CNode(XYZ(0, 0, 0)))
Yarns0[0].AddNode(CNode(XYZ(0, L, 0)))

Yarns0[1].AddNode(CNode(XYZ(0, 0, 0)))
Yarns0[1].AddNode(CNode(XYZ(0, L, 0)))

Yarns0[2].AddNode(CNode(XYZ(-w, 0, 0)))
Yarns0[2].AddNode(CNode(XYZ(-w, L, 0)))

Yarns0[3].AddNode(CNode(XYZ(10 + w/2, 0, 0)))
Yarns0[3].AddNode(CNode(XYZ(10 + w/2, L, 0)))

#Definimos Nodos yarn 90º
Yarns90[0].AddNode(CNode(XYZ(-3*w/2, 0, 1.25*h)))
Yarns90[0].AddNode(CNode(XYZ(-w/2, 0, 2.75*h/2)))
Yarns90[0].AddNode(CNode(XYZ(0, 0, 3.25*h/2)))
Yarns90[0].AddNode(CNode(XYZ(2, 0, 2*h)))
Yarns90[0].AddNode(CNode(XYZ(7, 0, 2.5*h/2)))
Yarns90[0].AddNode(CNode(XYZ(10 + w, 0, 1.25*h)))

#Definimos Nodos yarn 45º
Yarns45[0].AddNode(CNode(XYZ(-2*L-w, -2*L, 6.25*h/2)))
Yarns45[0].AddNode(CNode(XYZ(2*L-w, 2*L, 6.25*h/2)))

#Repeticion yarn 90º
Yarns90[0].AddRepeat(XYZ(0, w, 0))

#Definimos secciones
    
# seccion NO overlap
Section = CSectionPowerEllipse(w, h, p, 0)
Yarns0[0].AssignSection(CYarnSectionConstant(Section))
Yarns0[2].AssignSection(CYarnSectionConstant(Section))
Yarns0[3].AssignSection(CYarnSectionConstant(Section))

Yarns45[0].AssignSection(CYarnSectionConstant(Section))
Yarns45[0].AddRepeat(XYZ(w*sqrt(2), 0, 0))

Yarns90[0].AssignSection(CYarnSectionConstant(Section))

# set resoltuion
Yarns0[0].SetResolution(40,20)
Yarns0[1].SetResolution(40,20)
Yarns0[2].SetResolution(40,20)
Yarns0[3].SetResolution(40,20)
Yarns90[0].SetResolution(40,20)
Yarns45[0].SetResolution(40,20)

# section overlap
Points = XYVector()
Points.push_back(XY(2, 2.9))
Points.push_back(XY(1.5, 2))
Points.push_back(XY(2, 1))
Points.push_back(XY(4, 0.8))
Points.push_back(XY(5, 0))
Points.push_back(XY(7, -0.9))
Points.push_back(XY(9, -0.9))
Points.push_back(XY(10, 0))
Points.push_back(XY(9, 1))
Points.push_back(XY(7, 1))
Points.push_back(XY(6, 1.5))
Points.push_back(XY(3, 2.8))
Shape = CSectionPolygon(Points)
Yarns0[1].AssignSection(CYarnSectionConstant(Shape))

for yarn in Yarns0:    
    #Set interpolation
    interpolation = CInterpolationBezier(True, True)
    yarn.AssignInterpolation(interpolation)
    Textile.AddYarn(yarn)

for yarn in Yarns90:    
    #Set interpolation
    interpolation = CInterpolationBezier(True, True)
    yarn.AssignInterpolation(interpolation)
    Textile.AddYarn(yarn)
    
for yarn in Yarns45:    
    #Set interpolation
    interpolation = CInterpolationBezier(True, True)
    yarn.AssignInterpolation(interpolation)
    Textile.AddYarn(yarn)

Domain = CDomainPlanes(XYZ(-3*w/2, 0, -h/3),XYZ(10 + w, 4*w, 7.5*h/2))
Textile.AssignDomain(Domain)

#-----------------------------------------Meshing

mesher = CMesher(MATERIAL_CONTINUUM)
mesher.SetSeed(0.5)
mesher.SetPeriodic(True)
mesher.SetMergeTolerance(0.001)
mesher.CreateMesh(Textile)
mesher.SaveVolumeMeshToABAQUS(r"C/Test/Test.inp", Textile)

AddTextile(Textile)
And also a picture of how the textile looks in the interface,

Thank you,

Carlos
Attachments
Imagen_GUI.PNG
Imagen_GUI.PNG (42.49 KiB) Viewed 62975 times
Last edited by cmagdalena on Tue Nov 15, 2022 11:46 am, edited 2 times in total.
louisepb
Project Leader
Posts: 998
Joined: Tue Dec 08, 2009 2:27 pm
Location: Nottingham

Re: Volume mesh difference exporting from Interface and Scri

Post by louisepb »

Hi Carlos,

Apologies for the slow reply. I'm slightly confused by this. When I run your model the volume mesh export doesn't work either from the script or from the user interface. It doesn't manage to create a mesh. I think that this is probably to do with how the yarn repeats are set up for yarns 4 and 5. The algorithm won't be able to deal with the same yarn side by side in the unit cell. It was written quite a long time ago with simple 2D weaves in mind. I think that if you create each of the yarns in the unit cell as individual yarns and then have each of those repeating with a larger repeat (should you want to create a larger model) then the volume mesh export should work.
Which options did you use in the GUI to create the volume export? The image you show looks more like a STEP/IGES export of just the geometry.

I managed to create a voxel mesh export without issues. That was with an import into ABAQUS as I don't have access to ANSYS.

Best wishes,
Louise
Post Reply