Hi everyone,
I am currently modelling a three-layer angle-interlock weave where the second row of weft tows are offset (the second row is offset about half the width of a weft tow in the x direction). I first tried using CTextileAngleInterlock, but I was limited to weaving my warp tow to the second row of weft tows (i.e., I could only create a 2D weave architecture when I need a 3D weave architecture). I cannot attach files for some reason, but essentially, I have one warp tow weaving through 3 layers of weft tows and it resurfaces every 3 weft tows.
The problem I am encountering with a node-defined textile is that there are large intersections between the weft and warp tows. I would like to deform the tows to achieve a realistic model of a compacted reinforcement. It seems that if I use an automatic textile generator class (like CTextileOrthogonalWeave or CTextileAngleInterlock), TexGen automatically deforms the warp tows.
I tried using CAbaqusSimulation to deform the tows based on a set tolerance, but viewing the updated mesh on Abaqus, the intersections remain and there is no deformation of the tows. I also tried using the geometry solver, but TexGen becomes unresponsive. I should mention I also have latin hypercube sampling above this section of the code for five strata, from which I randomly sample the tow geometries.
I am trying to achieve weave deformations like in Example 2 on the TexGen website: https://texgen.sourceforge.io/index.php ... ard_way.29
It seems they used the same node-defined technique, yet they are able to avoid interferences and achieve a deformed textile.
I would really appreciate any advice on this issue. Thank you.
My code is below:
for i in range(1,4):
if i == 1:
yarn = CYarn()
# define y and z node positions
weft_space = random.uniform(weft_space_min, weft_space_max)
weft_space2 = random.uniform(weft_space2_min, weft_space2_max)
warp_space = random.uniform(1.1, 1.2)
weft_width = random.uniform(weft_width_min, weft_width_max)
weft_height = random.uniform(weft_height_min, weft_height_max)
compaction = random.uniform(compaction_min, compaction_max)
x_offset = random.uniform(-0.03,0.05)
z_offset = random.uniform(-0.03,0.05)
z_offset_repeat = random.uniform(0, 0.07)
yarn.AddNode(CNode(XYZ(0, 0, 0)))
yarn.AddNode(CNode(XYZ(0, 15*warp_space, 0)))
power = random.uniform(0.95,1.3)
offset = random.uniform(-0.1,0.1)
angle = random.uniform(-0.1,0.1)
shape = CSectionPowerEllipse(weft_width, weft_height, power, offset)
RotatedShape = CSectionRotated(shape, angle)
yarn.AssignSection(CYarnSectionConstant(RotatedShape))
yarn.SetResolution(20)
yarn.AssignInterpolation(CInterpolationCubic())
bottom_thk = compaction - 0.25*weft_height
if i == 2:
yarn = CYarn()
warp_space = random.uniform(1.1, 1.2)
compaction = random.uniform(compaction_min, compaction_max)
x_offset = random.uniform(-0.03,0.05)
z_offset = random.uniform(-0.03,0.05)
z_offset_repeat = random.uniform(-0.07, 0.07)
yarn.AddNode(CNode(XYZ(0.5*weft_space, 0, (1.5*ply_thk))))
yarn.AddNode(CNode(XYZ(0.5*weft_space, 15*warp_space, (1.5*ply_thk))))
power = random.uniform(0.95,1.3)
offset = random.uniform(-0.1,0.1)
angle = random.uniform(-0.1,0.1)
shape = CSectionPowerEllipse(weft_width, weft_height, power, offset)
RotatedShape = CSectionRotated(shape, angle)
yarn.AssignSection(CYarnSectionConstant(RotatedShape))
yarn.SetResolution(20)
yarn.AssignInterpolation(CInterpolationCubic())
if i == 3:
yarn = CYarn()
# define y and z node positions
warp_space = random.uniform(1.1, 1.2)
compaction = random.uniform(compaction_min, compaction_max)
x_offset = random.uniform(-0.03,0.05)
z_offset = random.uniform(-0.03,0.05)
z_offset_repeat = random.uniform(-0.07, 0)
yarn.AddNode(CNode(XYZ(0, 0, (3*ply_thk))))
yarn.AddNode(CNode(XYZ(0, 15*warp_space, (3*ply_thk))))
power = random.uniform(0.95,1.3)
offset = random.uniform(-0.1,0.1)
angle = random.uniform(-0.1,0.1)
shape = CSectionPowerEllipse(weft_width, weft_height, power, offset)
RotatedShape = CSectionRotated(shape, angle)
yarn.AssignSection(CYarnSectionConstant(RotatedShape))
yarn.SetResolution(20)
yarn.AssignInterpolation(CInterpolationCubic())
x_offset_repeat = random.uniform(-0.07, 0.07)
yarn.AddRepeat(XYZ(weft_space + x_offset_repeat, 0, z_offset_repeat))
current_min = z_offset_repeat
current_max = z_offset_repeat + (3*ply_thk)
height_min = min(height_min, current_min)
height_max = max(height_max, current_max)
# min and max thicknesses to use for the warp tow node placement
min_thickness = height_min - 0.5 * weft_height_max
max_thickness = height_max + 0.5 * weft_height_min
Textile.AddYarn(yarn)
# Create warp tows
# for each iteration of RUC assembly (AddRepeat command), randomize the warpwidth and t_tow
bottom_node = min_thickness
top_node = max_thickness
for p in range(1,5):
if p == 1:
yarn_warp = CYarn()
weft_space = random.uniform(weft_space_min, weft_space_max)
warp_width1 = random.uniform(warp_width_min, warp_width_max)
warp_height = random.uniform(warp_height_min, warp_height_max)
ratio = random.uniform(-0.1,0)
warp_space = warp_width1 + ratio*(warp_width1)
compaction = random.uniform(compaction_min, compaction_max)
yarn_warp.AddNode(CNode(XYZ((p-2)*weft_space, 0.5*warp_space, top_node)))
yarn_warp.AddNode(CNode(XYZ((p)*weft_space, 0.5*warp_space, bottom_node)))
yarn_warp.AddNode(CNode(XYZ((p+2)*weft_space, 0.5*warp_space, top_node)))
yarn_warp.AssignSection(CYarnSectionConstant(CSectionEllipse(warp_width1, warp_height)))
yarn_warp.SetResolution(20)
yarn_warp.AssignInterpolation(CInterpolationBezier())
if p == 2:
yarn_warp = CYarn()
weft_space = random.uniform(weft_space_min, weft_space_max)
# warp_space = random.uniform(1.1, 1.2)
warp_width = random.uniform(warp_width_min, warp_width_max)
warp_height = random.uniform(warp_height_min, warp_height_max)
ratio = random.uniform(-0.1,0)
warp_space = warp_width1 + ratio*(warp_width1)
compaction = random.uniform(compaction_min, compaction_max)
yarn_warp.AddNode(CNode(XYZ((p-2)*weft_space, 1.5*warp_space, top_node)))
yarn_warp.AddNode(CNode(XYZ((p)*weft_space, 1.5*warp_space, bottom_node)))
yarn_warp.AddNode(CNode(XYZ((p+2)*weft_space, 1.5*warp_space, top_node)))
yarn_warp.AssignSection(CYarnSectionConstant(CSectionEllipse(warp_width, warp_height)))
yarn_warp.SetResolution(20)
yarn_warp.AssignInterpolation(CInterpolationBezier())
if p == 3:
yarn_warp = CYarn()
weft_space = random.uniform(weft_space_min, weft_space_max)
# warp_space = random.uniform(1.1, 1.2)
warp_width = random.uniform(warp_width_min, warp_width_max)
warp_height = random.uniform(warp_height_min, warp_height_max)
ratio = random.uniform(-0.1,0)
warp_space = warp_width1 + ratio*(warp_width1)
compaction = random.uniform(compaction_min, compaction_max)
yarn_warp.AddNode(CNode(XYZ((p-2)*weft_space, 2.5*warp_space, top_node)))
yarn_warp.AddNode(CNode(XYZ((p)*weft_space, 2.5*warp_space, bottom_node)))
yarn_warp.AddNode(CNode(XYZ((p+2)*weft_space, 2.5*warp_space, top_node)))
yarn_warp.AssignSection(CYarnSectionConstant(CSectionEllipse(warp_width, warp_height)))
yarn_warp.SetResolution(20)
yarn_warp.AssignInterpolation(CInterpolationBezier())
if p == 4:
yarn_warp = CYarn()
weft_space = random.uniform(weft_space_min, weft_space_max)
# warp_space = random.uniform(1.1, 1.2)
warp_width = random.uniform(warp_width_min, warp_width_max)
warp_height = random.uniform(warp_height_min, warp_height_max)
ratio = random.uniform(-0.1,0)
warp_space = warp_width1 + ratio*(warp_width1)
compaction = random.uniform(compaction_min, compaction_max)
yarn_warp.AddNode(CNode(XYZ((p-2)*weft_space, 3.3*warp_space, top_node)))
yarn_warp.AddNode(CNode(XYZ((p)*weft_space, 3.3*warp_space, bottom_node)))
yarn_warp.AddNode(CNode(XYZ((p+2)*weft_space, 3.3*warp_space, top_node)))
yarn_warp.AssignSection(CYarnSectionConstant(CSectionEllipse(warp_width, warp_height)))
yarn_warp.SetResolution(20)
yarn_warp.AssignInterpolation(CInterpolationBezier())
# s_offset = random.uniform(-0.05, 0.05)
yarn_warp.AddRepeat(XYZ(4*(weft_space), 0, 0))
Textile.AddYarn(yarn_warp)
Textile.AssignDomain(CDomainPlanes(XYZ(0,0,-0.362-compaction), XYZ(7.5,5.1,1.3)))
AddTextile(Textile)
print(min_thickness, max_thickness)
# Set properties
Ex_tow = 179*random.uniform(0.7,1.3)
Ey_tow = 29*random.uniform(0.7,1.3)
Gxy_tow = 29*random.uniform(0.7,1.3)
Gyz_tow = 10*random.uniform(0.7,1.3)
vx_tow = 0.23*random.uniform(0.7,1.3)
vz_tow = 0.47*random.uniform(0.7,1.3)
E_matrix = 80*random.uniform(0.7,1.3)
Textile.SetAllYarnsYoungsModulusX( Ex_tow )
Textile.SetAllYarnsYoungsModulusY( Ey_tow )
Textile.SetAllYarnsShearModulusXY( Gxy_tow )
Textile.SetAllYarnsShearModulusYZ( Gyz_tow )
Textile.SetAllYarnsPoissonsRatioX( vx_tow )
Textile.SetAllYarnsPoissonsRatioZ( vz_tow )
Textile.SetMatrixYoungsModulus(E_matrix)
textile = GetTextile()
mesh = CMesh()
# Set up any x,y,z transformations
tension = CLinearTransformation()
tension.AddScale(10, 1, 10)
# Setup class which generates ABAQUS files with conformal wedge/hex elements
deformer = CSimulationAbaqus()
deformer.SetIncludePlates( False ) # Whether to include compression plates
deformer.AddDeformationStep(tension)
bRegenerateMesh = True # True if want to regenerate mesh after intersection correction
bElementType = True # True for C3D8, False for C3D8R
bAdjustIntersections = True
Tolerance = 1e-2
deformer.CreateAbaqusInputFile(textile, 'Intersection_Test', bRegenerateMesh, bElementType, bAdjustIntersections, Tolerance )
## This is the geometry solver portion that I had to comment out
# Solver = CGeometrySolver()
# Solver.SetContactStiffness(1e6)
# Solver.SetDisabledStiffness(1e-6)
# Solver.SetSeed(1)
# # Create the system of equations to be solved
# Solver.CreateSystem(textile)
# # Solve the system
# # Solver.SolveSystem()
# Solver.DeformTextile()
# # Save the result to a VTK file for viewing purposes
# Solver.SaveToVTK("GeomSolve")
Deforming Node-Defined Yarns to Remove Intersections
Moderators: Martin, Developers
Re: Deforming Node-Defined Yarns to Remove Intersections
Hi Rachel,
Please could you zip your file and then attach that. You can't upload Python files on the forum. I tried to copy and paste your code into a file but it has lost all the indentations so doesn't work.
All models in TexGen are created by specifying nodes in the yarn. If you look at any generated by one of the wizards and render the nodes you will see these. The wizards and derived textile classes just give a user friendly way of creating textiles without the user having to specify all the yarn nodes themselves.
I don't understand why you say that the angle interlock class gives you a 2D weave architecture. This is a 3D weave - the warp binder yarns will traverse through the layers depending on the number of weft yarns you have specified.
If you generate the yarns yourself by specifying nodes then if there are large intersections you will need to adapt your model to remove these, probably by changing the cross-sections at different points on the yarn. The intersection correction is intended to remove small intersections which may stop simulations from running. If the intersection is larger than one element deep it will not try to correct it - the reasoning for this was that if the intersection was larger than this then the model needs correcting.
The geometry solver is fairly experimental code and is slow. You can try it but there is no guarantee that it will give a good result!
I hope that helps.
Louise
Please could you zip your file and then attach that. You can't upload Python files on the forum. I tried to copy and paste your code into a file but it has lost all the indentations so doesn't work.
All models in TexGen are created by specifying nodes in the yarn. If you look at any generated by one of the wizards and render the nodes you will see these. The wizards and derived textile classes just give a user friendly way of creating textiles without the user having to specify all the yarn nodes themselves.
I don't understand why you say that the angle interlock class gives you a 2D weave architecture. This is a 3D weave - the warp binder yarns will traverse through the layers depending on the number of weft yarns you have specified.
If you generate the yarns yourself by specifying nodes then if there are large intersections you will need to adapt your model to remove these, probably by changing the cross-sections at different points on the yarn. The intersection correction is intended to remove small intersections which may stop simulations from running. If the intersection is larger than one element deep it will not try to correct it - the reasoning for this was that if the intersection was larger than this then the model needs correcting.
The geometry solver is fairly experimental code and is slow. You can try it but there is no guarantee that it will give a good result!
I hope that helps.
Louise