-
-
October 10, 2024 at 3:53 pm
gentleman1990
SubscriberDear All,
I have a quick question about DEM in LS-DYNA and would appreciate your feedback.
Can we generate a certain number of particles (let's say 10) with different radii inside a cube in ls-PrePost? Based on what I see, we can only define Min R and Max R and we don't have any control over the number of the particles. Am I wrong?
Thanks,
M.
Â
-
October 11, 2024 at 1:42 pm
Ram Gopisetti
Ansys EmployeeHi,Â
Yes, LSPP has no control over the number of particles, however, there is a workaround with SPH and then with conversion, you can first create an SPH in place of DES and then use the following sudo routine to replace the SPH with DES . It would be easier if you isolate the SPH as a separate include file Â
READÂ input_filenameÂ
SET output_filenameÂ
SET density TO 1000
OPEN input_file FOR READING
OPEN output_file FOR WRITING
FOR EACH line IN input_file:
 IF line STARTS WITH "*ELEMENT_SPH":
WRITEÂ "*ELEMENT_DISCRETE_SPHERE_VOLUME" TO output_file
WRITE header_line TO output_file
ELSE IF line STARTS WITH "*":
CONTINUE
ELSE IF line IS NOT EMPTY AND NOT COMMENT:
SPLIT line INTO data SET mass TO FLOAT(data[2])
 // Calculate volume, radius, and inertia
SET volume TO mass / density
SET radius TO ((3 / (4 * PI)) * volume)^(1 / 3)
SET inertia TO (2 / 5) * mass * radius^2
// Format outputÂ
WRITE formatted_output TO output_file
CLOSE input_file
CLOSE output_file
END
Cheers, RamÂ
-
October 15, 2024 at 5:01 pm
gentleman1990
SubscriberDear Ram,
Thanks so much for your prompt response. Can you elaborate on how your proposed method can be implemented? Is that through the command line or any other way? I have never used this approach. If a document/tutorial shows how the "sudo routine" implementation works, I can also read it. Sorry in advance if my request is dumb.
Best Regards,
M
-
- You must be logged in to reply to this topic.
-
3427
-
1057
-
1051
-
896
-
892
© 2025 Copyright ANSYS, Inc. All rights reserved.