The Siemens Community Catalyst program was co-created with our community to acknowledge technology leaders who consistently contribute to the Siemens Community. Nominations are accepted on a rolling basis.
Hi
When packing was generated in EDEM, can I change the type of particles in a specified region?
Hi Raheem,
Not really as standard but it would be possible using the API where you can delete a particle or set of particles, record their position and replace them with others.
This is what is done in the particle replacement tutorial https://community.altair.com/csm?id=kb_article_view&sysparm_article=KB0037689
Regards
Stephen
Hi Raheem, Not really as standard but it would be possible using the API where you can delete a particle or set of particles, record their position and replace them with others. This is what is done in the particle replacement tutorial https://community.altair.com/csm?id=kb_article_view&sysparm_article=KB0037689 Regards Stephen
Hi Stephen,
Thanks for your answer, it seems a good way to solve my meet.
I have a question about this forum, I know the reference file "Particle_cluster_Data" is exoprted by the code itself, may this part in CRemoval.cpp:
But I still unclear about the calculation of coordinate of Fraction particles, am I missing any functions or something else?
//write info to newPart strncpy(newPart.Type, ParticleCluster.c_str(), NApi::API_BASIC_STRING_LENGTH); newPart.Scale = m_particleMngr->getScale(particle.ID); newPart.Position = CSimple3DVector(particle.position.getX(), particle.position.getY(), particle.position.getZ()); newPart.Velocity = CSimple3DVector(particle.velocity.getX(), particle.velocity.getY(), particle.velocity.getZ()); newPart.AngVelocity = CSimple3DVector(particle.angVel.getX(), particle.angVel.getY(), particle.angVel.getZ()); newPart.Orientation = CSimple3x3Matrix(particle.orientation.getXX(), particle.orientation.getXY(), particle.orientation.getXZ(), particle.orientation.getYX(), particle.orientation.getYY(), particle.orientation.getYZ(), particle.orientation.getZX(), particle.orientation.getZY(), particle.orientation.getZZ()); //add particle to factory list ParticleList[threadID].push_back(newPart);
Raheem
Hi Stephen, Thanks for your answer, it seems a good way to solve my meet. I have a question about this forum, I know the reference file "Particle_cluster_Data" is exoprted by the code itself, may this part in CRemoval.cpp: But I still unclear about the calculation of coordinate of Fraction particles, am I missing any functions or something else? //write info to newPart strncpy(newPart.Type, ParticleCluster.c_str(), NApi::API_BASIC_STRING_LENGTH); newPart.Scale = m_particleMngr->getScale(particle.ID); newPart.Position = CSimple3DVector(particle.position.getX(), particle.position.getY(), particle.position.getZ()); newPart.Velocity = CSimple3DVector(particle.velocity.getX(), particle.velocity.getY(), particle.velocity.getZ()); newPart.AngVelocity = CSimple3DVector(particle.angVel.getX(), particle.angVel.getY(), particle.angVel.getZ()); newPart.Orientation = CSimple3x3Matrix(particle.orientation.getXX(), particle.orientation.getXY(), particle.orientation.getXZ(), particle.orientation.getYX(), particle.orientation.getYY(), particle.orientation.getYZ(), particle.orientation.getZX(), particle.orientation.getZY(), particle.orientation.getZZ()); //add particle to factory list ParticleList[threadID].push_back(newPart); Regards Raheem
The code you have above is taking the coordinates of the existing particles and writing them to an array (newPart which gets written to ParticleList), recording the velocity and orientation then later in the code it takes the ID and runs 'markForRemoval' to delete this.
Next time-step it runs CReplacementFactory where it checks ParticleList and writes one line of this list to NextParticle. The factory then creates new particles with the recorded velocity and orientation, adding the position of the deleted particle to the position in the Particle_Cluster_Data.txt
There is a description in the end of the EDEMAPI Tutorial 1 - Particle Replacement.pdf document also.
Hi Raheem, The code you have above is taking the coordinates of the existing particles and writing them to an array (newPart which gets written to ParticleList), recording the velocity and orientation then later in the code it takes the ID and runs 'markForRemoval' to delete this. Next time-step it runs CReplacementFactory where it checks ParticleList and writes one line of this list to NextParticle. The factory then creates new particles with the recorded velocity and orientation, adding the position of the deleted particle to the position in the Particle_Cluster_Data.txt There is a description in the end of the EDEMAPI Tutorial 1 - Particle Replacement.pdf document also. Regards Stephen
Thanks for your explanation. I still have two thing to make sure.
1 In my understanding, "Particle_cluster_data.txt" was defined independent of the code, is it defined before the simulation? So if I want to replace the particles in my simulations, I should write my "Particle_data.txt" to defined the coordination of replaced particles.
2 In the "Particle_replacement_prefs.txt":
ParticleReplace: WholeParticleCluster: FractionParticleReplace_MinScale: 2StartBondingTime: 0.4
StartBondingTime is a useless value, because it hasn't been readed in the code. Am I right?
prefsFile >> discard >> ParticleReplace >> discard >> ParticleCluster >> discard >> m_requestedBondTime;
Hi Stephen, Thanks for your explanation. I still have two thing to make sure. 1 In my understanding, "Particle_cluster_data.txt" was defined independent of the code, is it defined before the simulation? So if I want to replace the particles in my simulations, I should write my "Particle_data.txt" to defined the coordination of replaced particles. 2 In the "Particle_replacement_prefs.txt": ParticleReplace: WholeParticleCluster: FractionParticleReplace_MinScale: 2StartBondingTime: 0.4 StartBondingTime is a useless value, because it hasn't been readed in the code. Am I right? prefsFile >> discard >> ParticleReplace >> discard >> ParticleCluster >> discard >> m_requestedBondTime;
Hi Raheem, Particle_cluster_data.txt was created externally, there would be different ways of doing this but in this case a CAD geometry of the particle (sphere) was created and filled with particles. The positions of these were exported and formatted to create the .txt file.
As you say it looks like StartBondingTime isn't used, this is possibly left over from a legacy version which also used an API version of the bonded model, now the tutorial uses the in-built bondingV2 model and takes the bond time from that.
Hi Raheem, Particle_cluster_data.txt was created externally, there would be different ways of doing this but in this case a CAD geometry of the particle (sphere) was created and filled with particles. The positions of these were exported and formatted to create the .txt file. As you say it looks like StartBondingTime isn't used, this is possibly left over from a legacy version which also used an API version of the bonded model, now the tutorial uses the in-built bondingV2 model and takes the bond time from that.
Thanks, I have accomplished what I want, the similar way, remov and replace, it works well, thanks for your help.
Join us for a community conversation on how High-Performance Computing (HPC) and Simcenter PSIM work together to meet the increasing demands of modern power electronics simulation. During this one-hour technical session, you'll discover how leveraging HPC can speed up simulations, improve scalability, and empower engineers…
Join us for a community conversation on accelerating your motor simulation workflow with Simcenter Simlab. In this beginner-friendly session, we'll introduce the platform's automated model-building capabilities and show how easy it is to set up your first electric motor analysis. You'll see the basic steps of geometry…
Join us for a Community Conversation where we'll discuss practical approaches to analyzing complex electromagnetic models using hybrid solver techniques. This session will provide a general overview of how different computational methods can be combined within a single simulation to address models containing varied…