Frozen particle in the simulation
Hi,
I want to fix the specify type of particles in the system, so I can't use the particle limit->capped. I think maybe I can set the velocity and angvel of particle to 0 by particle body force, but I can't give a value to "particle.vel" or "particle.angVel" directly, can anyone help me solve this problem?
Thanks
Raheem
Answers
-
Hi Raheem,
If you use the latest version of the API then with a Particle Body Force you can add or overwrite the forces on a particle.
The easiest way to set a specific velocity is to overwrite all previously calculated forces and apply your own force, you can't specify the velocity but given the time-step and particle mass you can apply a force to accelerate to a set velocity. Or just overwrite all forces to 0 to keep it stationary.
Gravity is calculated in EDEM separately so sometimes it is easier to turn gravity off in EDEM and apply the gravitational force yourself in the particle body force otherwise you'd have to account for that when considering the velocity.
Regards
Stephen
0 -
Stephen Cole_21117 said:
Hi Raheem,
If you use the latest version of the API then with a Particle Body Force you can add or overwrite the forces on a particle.
The easiest way to set a specific velocity is to overwrite all previously calculated forces and apply your own force, you can't specify the velocity but given the time-step and particle mass you can apply a force to accelerate to a set velocity. Or just overwrite all forces to 0 to keep it stationary.
Gravity is calculated in EDEM separately so sometimes it is easier to turn gravity off in EDEM and apply the gravitational force yourself in the particle body force otherwise you'd have to account for that when considering the velocity.
Regards
Stephen
Hi Stephen,
It helps a lot, thanks, by the way, in EDEM, when I used particle body force, at the end of each step, will the "result.force" in PBF be the finall total force of particle?
Regards
Raheem
0 -
Raheem Sterling_22160 said:
Hi Stephen,
It helps a lot, thanks, by the way, in EDEM, when I used particle body force, at the end of each step, will the "result.force" in PBF be the finall total force of particle?
Regards
Raheem
Hi Raheem,
If you are using the latest API (3.4) then:results.force += value;
Will add the value to the existing forces on the particles. However if you do:
results.force = value;
This will overwrite all previously calculated forces (with the exception of gravity) and just provide the value to the particle. Note this works as a chain so if you have two Particle Body Force models the first will pass the updated calculated forces to the second, so the order of the models matters but only if you have more than 1.
Older API versions don't do contact chaining in the same way so ensure you use the latest version.
Contact models are always calculated before Particle Body Forces so all contact forces are passed down the chain to the body force.
Just to note I did an introduction to the API YouTube video here which is part of 3 which also look at updating API versions and converting to CUDA GPU code - https://www.youtube.com/watch?v=TAbvgzrGP8Y&list=PLGNemB0NFb0CieSxPqWNBFpim7EfHkXKT
Regards
Stephen
0 -
Stephen Cole_21117 said:
Hi Raheem,
If you are using the latest API (3.4) then:results.force += value;
Will add the value to the existing forces on the particles. However if you do:
results.force = value;
This will overwrite all previously calculated forces (with the exception of gravity) and just provide the value to the particle. Note this works as a chain so if you have two Particle Body Force models the first will pass the updated calculated forces to the second, so the order of the models matters but only if you have more than 1.
Older API versions don't do contact chaining in the same way so ensure you use the latest version.
Contact models are always calculated before Particle Body Forces so all contact forces are passed down the chain to the body force.
Just to note I did an introduction to the API YouTube video here which is part of 3 which also look at updating API versions and converting to CUDA GPU code - https://www.youtube.com/watch?v=TAbvgzrGP8Y&list=PLGNemB0NFb0CieSxPqWNBFpim7EfHkXKT
Regards
Stephen
Hi Stephen,
Thanks, as you mean, contact models are always calculated before Particle body forces, when I go back to my first question, to froze the particle. I adopted the way to un-click the gravity in EDEM and add it in API, as I show below:
CSimple3DVector F_p; CSimple3DVector m_gravity(0, 0, -9.8); //ADD CODE HERE FOR YOUR PARTICLE BODY FORCE MODEL if (strcmp(particle.type,"pwall")==0) { F_p = m_gravity * 0;; } else { F_p = m_gravity*particle.mass; } results.force = F_p;
It works as I hope, as figure shows. Blue particles were fixed and red particles falled down. My question is that: Did the stated of picture contains the effect contact model(like Hertz conatct here I used), or did the red particles move only under the effect of F_p here?
And are there examples like empty API of v_3_3_0? I can only find the example of v_3_1_0.
Regards!
Raheem
0 -
Raheem Sterling_22160 said:
Hi Stephen,
Thanks, as you mean, contact models are always calculated before Particle body forces, when I go back to my first question, to froze the particle. I adopted the way to un-click the gravity in EDEM and add it in API, as I show below:
CSimple3DVector F_p; CSimple3DVector m_gravity(0, 0, -9.8); //ADD CODE HERE FOR YOUR PARTICLE BODY FORCE MODEL if (strcmp(particle.type,"pwall")==0) { F_p = m_gravity * 0;; } else { F_p = m_gravity*particle.mass; } results.force = F_p;
It works as I hope, as figure shows. Blue particles were fixed and red particles falled down. My question is that: Did the stated of picture contains the effect contact model(like Hertz conatct here I used), or did the red particles move only under the effect of F_p here?
And are there examples like empty API of v_3_3_0? I can only find the example of v_3_1_0.
Regards!
Raheem
Hi Raheem,
There is an example of a PBF with the latest 3.4 API here - https://community.altair.com/community?id=kb_article&sysparm_article=KB0113656 Post contains both the old and new versions.
I would expect that for the red particles they would only experience gravity force in which case they should fall 'through' the geometry as any calculated forces would be overwritten. This maybe if you are using an older API version it doesn't do the same contact chaining as the latest one.
RegardsStephen
0 -
Stephen Cole_21117 said:
Hi Raheem,
There is an example of a PBF with the latest 3.4 API here - https://community.altair.com/community?id=kb_article&sysparm_article=KB0113656 Post contains both the old and new versions.
I would expect that for the red particles they would only experience gravity force in which case they should fall 'through' the geometry as any calculated forces would be overwritten. This maybe if you are using an older API version it doesn't do the same contact chaining as the latest one.
RegardsStephen
Hi Stephen,
As you expect, if I want to fix blue particles and red particles move under gravity during packing in the old version, my way is acceptable I think.
But in the new version, should I change the order of contact chaining?
Regards
Raheem
0 -
Raheem Sterling_22160 said:
Hi Stephen,
As you expect, if I want to fix blue particles and red particles move under gravity during packing in the old version, my way is acceptable I think.
But in the new version, should I change the order of contact chaining?
Regards
Raheem
Hi Raheem,
You'll only need to change the order if you have more than 1 particle body force model so in this case should not matter.
Regards
Stephen
0