the thing im having trouble seeing possible is the mixer demo spawns the particles above the mesh when the demo initializes and im not sure compared to programs like StarCCM+ or ansys Rocky where there are options for assisting in it not spawning within the mesh. would it be something of the sort of making a solver within the code given the collision file to have the particles not contact the mesh, but im not sure how one would code that exactly, im just putting my thoughts out there. or is it better to spawn a lot of particles spawn in above the mesh and wait for all of them to settle
On Monday, November 4, 2024 at 1:04:40 PM UTC-6 Liam Murray wrote: > I have tried to make progress on this simulation from the last time i > posted on here. I got the shell to spin successfully and the meshes lined > up thanks to feedback. What im trying to do is fill up the basin and shell > meshes sort of like the mixer demo so that it is filled all of the way when > the simulation initializes to start getting data and not having to wait for > the particles to convey to the top. Ive tried messing with a lot of these > parameters, but im just continuing to get errors like " outputs this error: > I know setting max sphere in bin isnt the greatest practice or max > contacts, but i keep running into this again and again and i wish i could > spawn it in cleanly into the basin. the image attached is what the setup > looks like without particles currently. > > > butterco@NASALaptop:~/DEM-Engine/build/bin$ ./augertest Total number of > particles generated: 71996 WARNING! One GPU device is detected. On consumer > cards, DEME's performance edge is limited with only one GPU. Try allocating > 2 GPU devices if possible. WARNING! Some clumps do not have their family > numbers specified, so defaulted to 0 Number of total active devices: 1 > User-specified X-dimension range: [-0.75, 0.75] User-specified Y-dimension > range: [-0.75, 0.75] User-specified Z-dimension range: [-1, 1] > User-specified dimensions should NOT be larger than the following > simulation world. The dimension of the simulation world: > 1.7999999523162842, 1.7999999523162842, 3.5999999046325684 Simulation world > X range: [-0.9, 0.9] Simulation world Y range: [-0.9, 0.9] Simulation world > Z range: [-1.2, 2.4] The length unit in this simulation is: > 1.3096723358585471e-11 The edge length of a voxel: 8.5830686202825746e-07 > The initial time step size: 5e-06 The initial edge length of a bin: > 0.021110625075200021 The initial number of bins: 1264716 The total number > of clumps: 71996 The combined number of component spheres: 215988 The total > number of analytical objects: 1 The total number of meshes: 3 Grand total > number of owners: 72000 The number of material types: 1 History-based > Hertzian contact model is in use. The solver to set to adaptively change > the contact margin size. Bin 884 contains 35373 sphere components, > exceeding maximum allowance (32768). If you want the solver to run despite > this, set allowance higher via SetMaxSphereInBin before simulation starts. > -------- Simulation crashed "potentially" due to too many geometries in a > bin -------- The dT reported max velocity is 0 > ------------------------------------ If the velocity is huge, then the > simulation probably diverged due to encountering large particle velocities. > Decreasing the step size could help, and remember to check if your > simulation objects are initially within the domain you specified. > ------------------------------------ If the velocity is fair, and you are > using a custom force model, one thing to do is to > SetForceCalcThreadsPerBlock to a small number like 128 (see README.md > troubleshooting for details). If you are going to discuss this on forum > https://groups.google.com/g/projectchrono, please include a visual > rendering of the simulation before crash. terminate called after throwing > an instance of 'std::runtime_error' what(): GPU Assertion: unspecified > launch failure. This happened in > /home/butterco/DEM-Engine/src/algorithms/DEMCubContactDetection.cu:384 > Aborted (core dumped) butterco@NASALaptop:~/DEM-Engine/build/bin$" > > " > #include <DEM/API.h> > #include <DEM/HostSideHelpers.hpp> > #include <DEM/utils/Samplers.hpp> > #include <chrono> > #include <iostream> > #include <filesystem> > > using namespace deme; > using namespace std::chrono; > namespace fs = std::filesystem; > > int main() { > DEMSolver DEMSim; > DEMSim.SetVerbosity(INFO); > DEMSim.SetOutputFormat(OUTPUT_FORMAT::CSV); > DEMSim.SetOutputContent(OUTPUT_CONTENT::ABSV); > DEMSim.SetMeshOutputFormat(MESH_FORMAT::VTK); > > // Material properties > auto mat_type_mixer = DEMSim.LoadMaterial({{"E", 5e5}, {"nu", 0.3}, > {"CoR", 0.2}, {"mu", 0.3}, {"Crr", 0.0}}); > > // Set simulation domain dimensions > DEMSim.InstructBoxDomainDimension(1.5, 1.5, 2.0); > DEMSim.InstructBoxDomainBoundingBC("all", mat_type_mixer); > > // Load mesh objects (Basin, Auger, Drum) > auto basin = > DEMSim.AddWavefrontMeshObject("/home/butterco/DEM-Engine/data/mesh/augertest_shapes/body_1_1_collision.obj", > > mat_type_mixer); > auto auger = > DEMSim.AddWavefrontMeshObject("/home/butterco/DEM-Engine/data/mesh/augertest_shapes/body_2_1_collision.obj", > > mat_type_mixer); > auto drum = > DEMSim.AddWavefrontMeshObject("/home/butterco/DEM-Engine/data/mesh/augertest_shapes/body_3_1_collision.obj", > > mat_type_mixer); > > // Set initial positions and orientations > basin->Move(make_float3(-0.1, -0.1, -0.70), make_float4(0, 0, 0, 1)); > drum->Move(make_float3(0, 0, -0.6), make_float4(0, 0.7071, 0.7071, > 0)); > auger->Move(make_float3(0, 0, 0.85), make_float4(1, 0, 0, 0)); > > // Set family numbers for simulation properties > basin->SetFamily(0); > auger->SetFamily(1); > drum->SetFamily(2); > DEMSim.SetFamilyFixed(0); > DEMSim.SetFamilyFixed(1); > DEMSim.SetFamilyPrescribedAngVel(2, "0", "0", "0.1"); > > // Define particle template with increased radius > float particle_radius = 0.005f; // Increased radius to reduce particle > count > float particle_volume = (4.0f / 3.0f) * 3.14159f * > std::pow(particle_radius, 3); > float particle_mass = 2.6e3f * particle_volume; // Density * volume > (kg) > float3 particle_moi = make_float3(1.8327927f, 2.1580013f, 0.77010059f) > * (std::pow(particle_radius, 2) / std::pow(0.005f, 2)); > > auto particle_template = DEMSim.LoadClumpType(particle_mass, > particle_moi, "/home/butterco/DEM-Engine/data/clumps/3_clump.csv", > mat_type_mixer); > // No scaling needed as the particle radius matches the clump file > > // Sampler setup with increased spacing > HCPSampler basin_sampler(3.0f * particle_radius); // Increased spacing > float3 basin_center = make_float3(0.0f, 0.0f, -0.65f); > float basin_radius = 0.07f; > float basin_height = 0.15f; > auto basin_positions = basin_sampler.SampleCylinderZ(basin_center, > basin_radius, basin_height); > > std::cout << "Total number of particles generated: " << > basin_positions.size() << std::endl; > > if (!basin_positions.empty()) { > DEMSim.AddClumps(particle_template, basin_positions); > } else { > std::cerr << "Error: No particles were generated. Adjust sampling > parameters." << std::endl; > return -1; > } > > DEMSim.SetInitTimeStep(5e-6f); > DEMSim.SetGravitationalAcceleration(make_float3(0.0f, 0.0f, -9.81f)); > DEMSim.SetCDUpdateFreq(40); > DEMSim.SetExpandSafetyAdder(2.0f); > DEMSim.SetErrorOutAvgContacts(50); > DEMSim.SetAdaptiveBinSizeUpperProactivity(0.5f); > DEMSim.SetAdaptiveBinSizeLowerProactivity(0.15f); > > // Set initial bin size to prevent bins from becoming overpopulated > DEMSim.SetInitBinSize(25.0f * particle_radius); > > // Increase maximum spheres per bin if necessary > DEMSim.SetMaxSphereInBin(50000); > > // Initialize the simulation > DEMSim.Initialize(); > > // Create output directory > std::string output_dir = "/home/butterco/DEM-Engine/data/output/"; > fs::create_directories(output_dir); > > auto max_velocity_finder = DEMSim.CreateInspector("clump_max_absv"); > > // Set simulation time and frame rate > float sim_end = 1.0f; > unsigned int fps = 10; > float frame_time = 1.0f / fps; > unsigned int curr_frame = 0; > > // Simulation loop > for (float t = 0.0f; t < sim_end; t += frame_time) { > std::cout << "Simulating frame " << curr_frame << std::endl; > > char filename[200], mesh_filename[200]; > sprintf(filename, "%sDEM_output_%04d.csv", output_dir.c_str(), > curr_frame); > sprintf(mesh_filename, "%sDEM_mesh_output_%04d.vtk", > output_dir.c_str(), curr_frame++); > DEMSim.WriteSphereFile(std::string(filename)); > DEMSim.WriteMeshFile(std::string(mesh_filename)); > > DEMSim.DoDynamics(frame_time); > > float max_velocity = max_velocity_finder->GetValue(); > std::cout << "Max velocity of any particle: " << max_velocity << > std::endl; > } > > DEMSim.ShowTimingStats(); > std::cout << "Simulation complete." << std::endl; > > return 0; > } > " > > > > -- You received this message because you are subscribed to the Google Groups "ProjectChrono" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion visit https://groups.google.com/d/msgid/projectchrono/3ee0498f-5294-4289-b48d-57d4708cb801n%40googlegroups.com.
