-
-
October 10, 2024 at 3:53 pmgentleman1990Subscriber
Dear 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 pmRam GopisettiAnsys Employee
Hi,Â
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 pmgentleman1990Subscriber
Dear 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.
- LS-DYNA Installation Issues with Student Workbench 2024 R2
- Mathematical model generation stuck at 10%
- About combine different unconnected body into one part
- Cross-coupled stiffness elements in LS-DYNA
- LS-Dyna CESE SMP d vs MPP d solver
- CESE solver – Ignition mechanism
- Initial Stress Shell Application and HistVarCosine in LS-DYNA
- shape memory alloy material in LS-DYNA
- *** Error 40058 (SOL+58) retractor 1000002:convergence failure at time1.01E+02
- MAT072R3- concrete damage rel3 validation
-
1436
-
599
-
591
-
591
-
366
© 2025 Copyright ANSYS, Inc. All rights reserved.