Hi all

ElzubeirElzubeir Member Posts: 2

I have generated a box of ellipsoidal particles by DEM, and I got the positions in (x, y, z) and orientations for every single ellipse in the Excel sheet. I need to reconstruct these particles in SpaceClaim by modelling one ellipse and copy it to the new positions with different orientations. My question is how can I read data that is recorded in my Excel into the script then I can run the code?

Answers

  • kkanadekkanade Posts: 3,298Forum Coordinator

    Can you please explain more. As I understand you have xyz for each particle. Now you want to create ellipse for each particle in SpaceClaim?

    Why do you want to create particles in SpacClaim? You can define them in Fluent.

    In SpacClaim please check pattern command.

    Please go through help manual for more details 

    Regards,

    Keyur

    How to access Ansys Online Help Document

    How to show full resolution image

    Guidelines on the Student Community

    How to use Google to search within Ansys Student Community

  • ElzubeirElzubeir Posts: 4Member

    Thanks,

    Yes I want to model a box of particles in order to simulate it in Fluent. A you see below, this particles I got from DEM therefore I have xyz for each particle and orientation in Excel sheet. I wrote a code in the script to model a master particle in order to copy it to new position. Due to huge number of particles I ask for a way or function to used excel sheet data as input. I hope you got my point!

    Regard

    Elzubeir



  • kkanadekkanade Posts: 3,298Forum Coordinator

    You may want to explore python for scripting in SpaceClaim.

    Also you can import txt in SpaceClaim as following.

    In SCDM, we can open a text file (*.txt) containing the points coordinates of curves. It will generate automatically the curves.

    From the menu File > Open, select "All Files" filter and select a .txt file.


    The syntax in the file for 2D curves is the following:


    polyline=false

    1 1.5 2.0

    1 1.0 3.2

    1 0.5 2.1

    2 0.3 4.2

    2 4.8 1.9


    The first column contains the number (ID) of the generated line, the second column the x-coordinate and the third column the y-coordinate.


    The file format for 3D curve is the following:


    polyline=false

    3d=true

    0 0 1

    0 1.5 1.2

    1.5 0 2.3

    1 1.5 4.2


    1.5 1.2 5.1

    2.3 4.2 6.2

    5.7 3.1 2.6


    With the option 3d=true, the different curves are delimited by a linebreak. The first column contains the z-coordinate, the second column the x-coordinate and the third column the y-coordinate of the points.

  • ElzubeirElzubeir Posts: 4Member

    After I modeled the master particle, I have wrote this code to copy it to other position (x,y,z). The issue is I am looking for a function to read these values from text or excel file as input to be changed till end of the columns 

    the code

    result = Copy.ToClipboard(Selection.Create(GetRootPart().Bodies[master particle]))

    result = Paste.FromClipboard()

    selection = Selection.Create(GetRootPart().Bodies[1])

    options = MoveOptions() 

    moveType = TransformType.RotateX 

    result = Move.Execute(selection, globalSystem, moveType, DEG(value1), options) 

    selection = Selection.Create(GetRootPart().Bodies[1])

    moveType = TransformType.RotateZ 

    result = Move.Execute(selection, globalSystem, moveType, DEG(value 2), options) 

    selection = Selection.Create(GetRootPart().Bodies[1])

    options = MoveOptions() 

    moveType = TransformType.TranslateX 

    result = Move.Execute(selection, globalSystem, moveType, MM(value 3), options) 

    selection = Selection.Create(GetRootPart().Bodies[1])

    options = MoveOptions() 

    moveType = TransformType.TranslateY 

    result = Move.Execute(selection, globalSystem, moveType, MM(value 4), options) 

    selection = Selection.Create(GetRootPart().Bodies[1])

    options = MoveOptions() 

    moveType = TransformType.TranslateZ 

    result = Move.Execute(selection, globalSystem, moveType, MM(value 5), options) 

    result = Copy.ToClipboard(Selection.Create(GetRootPart().Bodies[master particle]))

    result = Paste.FromClipboard()



    Thanks

Sign In or Register to comment.