Ansys Learning Forum Forums Discuss Simulation LS Dyna Discrete Element Method (DEM) Reply To: Discrete Element Method (DEM)

Ram Gopisetti
Ansys 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Â