calculate body force without field data
Is there a way to calculate body force experienced by a particle due to another particle around it?
If so, can you point out any tutorial that would help me in achieving such a thing
Just In case someone is going to suggest a Heat conduction tutorial
I looked at it already, and I can't understand how body force is calculated in it. It has so many files that you will get lost in understanding.
Is there any other example that is simple enough?
I want to calculate the columbic body force experienced by a particle due to the presence of another particle.
Answers
-
Hi Shyam
Calculating a body force based on the presence of another particle is in itself a complex thing to achieve using EDEM API. There is no 'simple enough' example to look at.
Please take a look at the Heat Conduction tutorial that you are well aware of, and you should be able to replicate that. The Heat Conduction model does not apply a body force based on the mere presence of the particle, but applies one due to contacts. One addition would be to use Contact Radius for the particles, and then you would be able to calculate the Coulombic force due to the presence of other particles.
Thanks,
Jerrin Job0 -
So the heat conduction API uses both contact and body force. I want to evaluate body force only I don't want to use that as a contact model. I have Hertz-Mindlin API for the contact model. I have given certain amount of charge on the particle. Based on this, I want to evaluate the body force that the particle experiences.
lets say I will write API similar to heat conduction API. Please let me know of this
1) should I use that as both body force and contact force model?
2) there are tow files named as CHeatConduction.cpp and CTemperatureUpdate.cpp, which among these will take the body force and contact force? Let me know if this is correct (CHeatConduction.cpp->BODY FORCE and CTemperatureUpdate.cpp->CONTACT FORCE)
0 -
Shyam Prasad V Atri said:
So the heat conduction API uses both contact and body force. I want to evaluate body force only I don't want to use that as a contact model. I have Hertz-Mindlin API for the contact model. I have given certain amount of charge on the particle. Based on this, I want to evaluate the body force that the particle experiences.
lets say I will write API similar to heat conduction API. Please let me know of this
1) should I use that as both body force and contact force model?
2) there are tow files named as CHeatConduction.cpp and CTemperatureUpdate.cpp, which among these will take the body force and contact force? Let me know if this is correct (CHeatConduction.cpp->BODY FORCE and CTemperatureUpdate.cpp->CONTACT FORCE)
Hi Shyam
You need both body force and contact model for such an API. The body force will calculate the Coulombic force, the contact model will help identify the neighboring particles that is influencing the body force.
You got it the other way around. CHeatConduction.cpp is the contact model API and CTemperatureUpdate.cpp is the body force API.
Hope this helps.
Thanks,
Jerrin Job0 -
So you are saying this
CHeatConduction.cpp -> Contact model -> Identify the particles
CTemperatureUpdate.cpp -> Body force -> Columbic force
So this is what I understand for the heat conduction model based on your statement
The CHeatConduction.cpp should create a list of particles and CTemperatureUpdate.cpp should update the temperature of all those particles based on Fourier law
when I look at the API it does not do that. In which line on CHeatConduction.cpp are you creating the list of particles?
how are you updating the forces here in CTemperatureUpdate.cpp
please let me know if this understanding is wrong. And what is the correct understanding
0 -
In line 149 of CHeatConduction.cpp you are evaluating the change. But as you told this CheatConduction.cpp is the API for making the list of particles but where is that happening.
from what i understand in line 149 you are trying to evaluate the force and applying that force as flux to the particles in line 156 and 157.
Just to let you know this is being calculated when they are in contact. In my case electric field force exists even when the particles are not in contact. so how will this HeatConduction API help me in achieving this. please let me know
0 -
Shyam Prasad V Atri said:
So you are saying this
CHeatConduction.cpp -> Contact model -> Identify the particles
CTemperatureUpdate.cpp -> Body force -> Columbic force
So this is what I understand for the heat conduction model based on your statement
The CHeatConduction.cpp should create a list of particles and CTemperatureUpdate.cpp should update the temperature of all those particles based on Fourier law
when I look at the API it does not do that. In which line on CHeatConduction.cpp are you creating the list of particles?
how are you updating the forces here in CTemperatureUpdate.cpp
please let me know if this understanding is wrong. And what is the correct understanding
Hi Shyam
Now that I think about it, you do not need a body force API at all. You can do it all within the contact model API.
Your understanding of the contact model API is incorrect. The contact model does not create a list. It only identifies the contacts. Based on the contacts (in your case, presence of other particles), you can apply appropriate forces on both particles in question. If you are familiar with MD (Molecular Dynamics), this is similar to that, except that EDEM reduces your coding efforts in identifying contacts (presence of other particles in your case), and then once the two particles in question are identified, you apply a force.
You can probably also take a look at the Hertz Mindlin API and see how the force is applied.
Hope this helps.
Thanks,
Jerrin Job0 -
Shyam Prasad V Atri said:
In line 149 of CHeatConduction.cpp you are evaluating the change. But as you told this CheatConduction.cpp is the API for making the list of particles but where is that happening.
from what i understand in line 149 you are trying to evaluate the force and applying that force as flux to the particles in line 156 and 157.
Just to let you know this is being calculated when they are in contact. In my case electric field force exists even when the particles are not in contact. so how will this HeatConduction API help me in achieving this. please let me know
Hi Shyam
As I said earlier in my response, you will need to use a Contact Radius to identify particles that are not in contact with each other, but still close enough, for you to apply force on them. However, there will always be a cutoff limit beyond which the effect of other particles will not be calculated. But you can choose your cutoff to be the whole domain in which case all the particles will be used for the force calculation of all the others, but this could make your simulation slow.
You can take a look at this Bonding model example to see how the Contact Radius is used in the API.
Hope this helps.
Thanks,
Jerrin Job0 -
Jerrin Job Sibychan said:
Hi Shyam
Now that I think about it, you do not need a body force API at all. You can do it all within the contact model API.
Your understanding of the contact model API is incorrect. The contact model does not create a list. It only identifies the contacts. Based on the contacts (in your case, presence of other particles), you can apply appropriate forces on both particles in question. If you are familiar with MD (Molecular Dynamics), this is similar to that, except that EDEM reduces your coding efforts in identifying contacts (presence of other particles in your case), and then once the two particles in question are identified, you apply a force.
You can probably also take a look at the Hertz Mindlin API and see how the force is applied.
Hope this helps.
Thanks,
Jerrin JobHi Jerrin,
Now i am really getting lost.
What I am trying to say is I do not need to evaluate if the particles are in contact or not.
If its something that I have to use to make the simulation run, then sure I will have (CHeatConduction.cpp) in the API
irrespective of that my particles are charged. Because of which there will be coulombic force of attraction/repulsion. This will be a body force. It's not a contact force. Irrespective of the fact that the particles are in contact or not the body force need to be evaluated with all the particles in the domain. So in this file CTemperatureUpdate.cpp how do I get the positions of all the particles in the domain? Can this be achieved?
or is it that only the particles present within the contact radius can be used? : If this is true. How can I access the particles' position inside the contact radius? What is the syntax for that and how can I access the custom property associated with that particle inside the contact radius. please let me know.
0 -
Shyam Prasad V Atri said:
Hi Jerrin,
Now i am really getting lost.
What I am trying to say is I do not need to evaluate if the particles are in contact or not.
If its something that I have to use to make the simulation run, then sure I will have (CHeatConduction.cpp) in the API
irrespective of that my particles are charged. Because of which there will be coulombic force of attraction/repulsion. This will be a body force. It's not a contact force. Irrespective of the fact that the particles are in contact or not the body force need to be evaluated with all the particles in the domain. So in this file CTemperatureUpdate.cpp how do I get the positions of all the particles in the domain? Can this be achieved?
or is it that only the particles present within the contact radius can be used? : If this is true. How can I access the particles' position inside the contact radius? What is the syntax for that and how can I access the custom property associated with that particle inside the contact radius. please let me know.
Hi Shyam
You are confusing the 'body force' and 'contact force' terms. What would you say your definition of a body force is? Is that any force applied to a body? If that is true, one could also argue that the contact force is also a body force, which is applied to the bodies when the particles are in contact.
For EDEM, if the force is due to another particle, then it is a contact force. For example, the forces calculated in MD (Molecular Dynamics) will be a contact force for EDEM, even though the forces are applied on the body of the particle. 'Body force' for EDEM is any force calculated on particles every timestep regardless of whether the particles are in contact or not.
Now, the 'body force' that you are referring to as the Coulombic force, is applied to the particles when they are close to each other. This Coulombic force (as I understand it) is not applied when particles are not close to each other. In case my understanding is incorrect, then the Coulombic force is a 'body force' according to EDEM.
Hope that clarifies the two models (according to EDEM terminology).
Please check the Bonding Model API to see how contact radius is used.
Hope this helps.
Thanks,
Jerrin Job0 -
Jerrin Job Sibychan said:
Hi Shyam
You are confusing the 'body force' and 'contact force' terms. What would you say your definition of a body force is? Is that any force applied to a body? If that is true, one could also argue that the contact force is also a body force, which is applied to the bodies when the particles are in contact.
For EDEM, if the force is due to another particle, then it is a contact force. For example, the forces calculated in MD (Molecular Dynamics) will be a contact force for EDEM, even though the forces are applied on the body of the particle. 'Body force' for EDEM is any force calculated on particles every timestep regardless of whether the particles are in contact or not.
Now, the 'body force' that you are referring to as the Coulombic force, is applied to the particles when they are close to each other. This Coulombic force (as I understand it) is not applied when particles are not close to each other. In case my understanding is incorrect, then the Coulombic force is a 'body force' according to EDEM.
Hope that clarifies the two models (according to EDEM terminology).
Please check the Bonding Model API to see how contact radius is used.
Hope this helps.
Thanks,
Jerrin JobHi Jerrin,
In terms of describing the body force as equation this is what I am trying to achieve.
The right hand side of this equation has the different body forces that the particle experiences. I am trying to evaluate only the F_{Ci}; the equation of F_{Ci} is given below
l believe what you are trying to say is this
Evaluate this force only when the particles are inside the contact radius. For which I need to use the Bonding model API to understand how to evaluate the number of particles inside the contact radius. --> (statement 1)
please tell me if this is what you are trying to tell me?
If that is the case
I don't understand why we should do such a simple calculation in a complicated manner. Isn't there a simple API to explain this? Bonded model API is a nightmare.
Please tell me if there is any other alternative way to do this other than using this Bonded model API.
If you decide to say Bodnded model is the only way to go. Please tell me which parameter in this gigantic API represents particles inside the contact radius
0 -
Shyam Prasad V Atri said:
Hi Jerrin,
In terms of describing the body force as equation this is what I am trying to achieve.
The right hand side of this equation has the different body forces that the particle experiences. I am trying to evaluate only the F_{Ci}; the equation of F_{Ci} is given below
l believe what you are trying to say is this
Evaluate this force only when the particles are inside the contact radius. For which I need to use the Bonding model API to understand how to evaluate the number of particles inside the contact radius. --> (statement 1)
please tell me if this is what you are trying to tell me?
If that is the case
I don't understand why we should do such a simple calculation in a complicated manner. Isn't there a simple API to explain this? Bonded model API is a nightmare.
Please tell me if there is any other alternative way to do this other than using this Bonded model API.
If you decide to say Bodnded model is the only way to go. Please tell me which parameter in this gigantic API represents particles inside the contact radius
Hi Shyam
I apologize if I was unclear. You do not need to use Bonding model API - I recommended that API for you to look at how contact radius is used in an API, and not to replicate the API. The Bonding model API has a lot of things going on, which is not necessary for your case.
There is no simpler way to do this (other than using contact radius) with the current API capabilities, as far as I understand. (I am sure I will be corrected in case I am wrong) And unfortunately, there is no example API that can do this either.
Finally, I do want to be clear that you will not get a list of particles that are inside the contact radius. You will not be able to do the summation as in the equation shown. EDEM will do the vector (not scalar) summation for you, but you have to tell EDEM how to compute the forces for each pair (which are within the contact radii of each other).
It occurs to me that you have a limited understanding of how contact model API works. I would highly recommend you to check a couple of contact model APIs before you dive into this one.
Hope this helps.
Thanks,
Jerrin JobP.S. This is a similar discussion in the past that could also give you some insights.
0 -
Hi Shyam,
Let me try to help you with your problem. Please look at the image below, in which each circle represents a particle in EDEM:
Even though the particles are not physically touching, they are still considered to be in contact with each other, given that their contact radii overlap.
This means that there will be a force between particles even if they are not physically touching, as long as you define a contact radius greater than the physical radius. If your contact radius is large enough, then each particle will interact with every other particle in the simulation. Keep in mind that this will make your simulation much slower and more expensive.
One thing that you can do is to manually calculate a cut-off distance and set the contact radius of the particles to be equal to half of that distance. This means that if the distance between two particles is greater than the cut-off distance then the force between those particles will be zero. This approach can make your simulation a bit less expensive.
Hope this helps.
Regards,
Renan
0 -
Hello Renan and Jerrin.
I understand the concept of contact radius and physical radius. What I am asking is how to know what particles are in contact. (I can use this variable to get contact radius - contact.normalContactOverlap)
I have a decent understanding of your APIs.
I want to use contact radius to evaluate charge transfer. Now after the charge transfer. the two particles are charged hence there will be columbic force.
Jerin says columbic force will only act between the particles in close contact. I will agree to an extent the other particles may not contribute too much to Columbic force. (but this is not 100% correct)-> (let us consider this as an assumption for now.)
Say I have two particles with contact radius overlapping. There will be a charge transfer when the contact radius overlaps. Now, after that, the two particles are charged. This will result in Columbic body force between the particles, and I want to evaluate this body force (Columbic force)
I am asking how should I do this?
I should write an API to do this. Is there an example that will tell me how to achieve this?
My first thought is to use the API of - "EDEM API: Particle Body Force - Field Data Coupling – Choice of Drag Models with Lift Force" here instead of body force being computed from drag data use the custom particle property to get the particles inside contact radius and then evaluate the columbic force. Please tell me if this idea is executable or not?
0 -
Shyam Prasad V Atri said:
Hello Renan and Jerrin.
I understand the concept of contact radius and physical radius. What I am asking is how to know what particles are in contact. (I can use this variable to get contact radius - contact.normalContactOverlap)
I have a decent understanding of your APIs.
I want to use contact radius to evaluate charge transfer. Now after the charge transfer. the two particles are charged hence there will be columbic force.
Jerin says columbic force will only act between the particles in close contact. I will agree to an extent the other particles may not contribute too much to Columbic force. (but this is not 100% correct)-> (let us consider this as an assumption for now.)
Say I have two particles with contact radius overlapping. There will be a charge transfer when the contact radius overlaps. Now, after that, the two particles are charged. This will result in Columbic body force between the particles, and I want to evaluate this body force (Columbic force)
I am asking how should I do this?
I should write an API to do this. Is there an example that will tell me how to achieve this?
My first thought is to use the API of - "EDEM API: Particle Body Force - Field Data Coupling – Choice of Drag Models with Lift Force" here instead of body force being computed from drag data use the custom particle property to get the particles inside contact radius and then evaluate the columbic force. Please tell me if this idea is executable or not?
Hi Shyam
I did not say that the particles will be in close contact - I said the particles will be close to each other (but not necessarily in contact). As I mentioned earlier, you can choose a very large contact radius and then the influence from all the particles, no matter how far, will have an effect on the forces of the other particles. This will however make your simulation slow, so it is worth considering what your cutoff distance would be.
To repeat myself again, you do not need a body force API. You can only do it within a contact model API. The charge transfer can also be done within a contact model API.
First step would be to introduce a particle custom property.
Use the following logic (use the correct functions from API documentation):
if (contact.normalphysicaloverlap > 0) {//charge transfer} distance = (element1.position - element2.position).length; force = k*element1.charge*element2.charge/(distance*distance); contactresults.normalforce = force;
Hope this helps.
Thanks,
Jerrin Job0 -
Shyam Prasad V Atri said:
Hello Renan and Jerrin.
I understand the concept of contact radius and physical radius. What I am asking is how to know what particles are in contact. (I can use this variable to get contact radius - contact.normalContactOverlap)
I have a decent understanding of your APIs.
I want to use contact radius to evaluate charge transfer. Now after the charge transfer. the two particles are charged hence there will be columbic force.
Jerin says columbic force will only act between the particles in close contact. I will agree to an extent the other particles may not contribute too much to Columbic force. (but this is not 100% correct)-> (let us consider this as an assumption for now.)
Say I have two particles with contact radius overlapping. There will be a charge transfer when the contact radius overlaps. Now, after that, the two particles are charged. This will result in Columbic body force between the particles, and I want to evaluate this body force (Columbic force)
I am asking how should I do this?
I should write an API to do this. Is there an example that will tell me how to achieve this?
My first thought is to use the API of - "EDEM API: Particle Body Force - Field Data Coupling – Choice of Drag Models with Lift Force" here instead of body force being computed from drag data use the custom particle property to get the particles inside contact radius and then evaluate the columbic force. Please tell me if this idea is executable or not?
Hi Shyam,
It seems that that you have a limited understanding of how APIs work, especially regarding the difference between contact models and particle body forces.
Let's break this down:
Say I have two particles with contact radius overlapping. There will be a charge transfer when the contact radius overlaps. Now, after that, the two particles are charged. This will result in Columbic body force between the particles, and I want to evaluate this body force (Columbic force)
It is clear, from the quote above, that you're trying to model an interaction between two particles. This means that you have to create a contact model, not a particle body force.
Let me give you a quick overview on how to accomplish what you want:
- Create a new contact model, named MyContactModel, that is derived from one of the IPluginContactModel classes
- In that contact model, create a particle custom property named MyCharge. Make sure the the usesCustomProperties function returns true and that the appropriate values are defined in the getDetailsForProperty and getNumberOfRequiredProperties functions
- In the calculateForce function, write something like:
// get the charge of each particle const double* charge1 = elem1CustomProperties->getValue(MyCharge.c_str()); const double* charge2 = elem2CustomProperties->getValue(MyCharge.c_str()); // add equation to determine the charge of each particle after contact double newCharge1 = (*charge1 + *charge2)/2.0; double newCharge2 = (*charge1 + *charge2)/2.0; // update the charge property double* charge1Delta = elem1CustomProperties->getDelta(MyCharge.c_str()); *charge1Delta = -(*charge1) + newCharge1; double* charge2Delta = elem2CustomProperties->getDelta(MyCharge.c_str()); *charge2Delta = -(*charge2) + newCharge2; // calculate the coulomb force between the particles // calculate the normal vector CSimple3DVector unitCPVect = contact.contactPoint - element1.position; unitCPVect.normalize(); double distance = (element1.position - element2.position).length(); CSimple3DVector coulombForce = (k*charge1 *charge2 /(distance*distance ))*unitCPVect; contactResults.normalForce += coulombForce; return eSucess;
With the code above you have a very good starting point for your API. Finally, I just want to clarify that the code above is just an example and you modify it whenever it is appropriate.
Regards,
Renan
0 -
Renan Calmon_20325 said:
Hi Shyam,
It seems that that you have a limited understanding of how APIs work, especially regarding the difference between contact models and particle body forces.
Let's break this down:
Say I have two particles with contact radius overlapping. There will be a charge transfer when the contact radius overlaps. Now, after that, the two particles are charged. This will result in Columbic body force between the particles, and I want to evaluate this body force (Columbic force)
It is clear, from the quote above, that you're trying to model an interaction between two particles. This means that you have to create a contact model, not a particle body force.
Let me give you a quick overview on how to accomplish what you want:
- Create a new contact model, named MyContactModel, that is derived from one of the IPluginContactModel classes
- In that contact model, create a particle custom property named MyCharge. Make sure the the usesCustomProperties function returns true and that the appropriate values are defined in the getDetailsForProperty and getNumberOfRequiredProperties functions
- In the calculateForce function, write something like:
// get the charge of each particle const double* charge1 = elem1CustomProperties->getValue(MyCharge.c_str()); const double* charge2 = elem2CustomProperties->getValue(MyCharge.c_str()); // add equation to determine the charge of each particle after contact double newCharge1 = (*charge1 + *charge2)/2.0; double newCharge2 = (*charge1 + *charge2)/2.0; // update the charge property double* charge1Delta = elem1CustomProperties->getDelta(MyCharge.c_str()); *charge1Delta = -(*charge1) + newCharge1; double* charge2Delta = elem2CustomProperties->getDelta(MyCharge.c_str()); *charge2Delta = -(*charge2) + newCharge2; // calculate the coulomb force between the particles // calculate the normal vector CSimple3DVector unitCPVect = contact.contactPoint - element1.position; unitCPVect.normalize(); double distance = (element1.position - element2.position).length(); CSimple3DVector coulombForce = (k*charge1 *charge2 /(distance*distance ))*unitCPVect; contactResults.normalForce += coulombForce; return eSucess;
With the code above you have a very good starting point for your API. Finally, I just want to clarify that the code above is just an example and you modify it whenever it is appropriate.
Regards,
Renan
Hello Jerrin and Renan,
Ok i get it now so i do not need different API. I have already written the charge transfer equation long ago. I have used custom property and am able to get charge transfer done but I am not able to make particles attract based on the charge developed.
based on both your responses, this is an important statement missing in my version of MyContactModel. And I have always thought body force need to be evaluated separately. did not realize evaluating body force inside MyContactModel is same as body force in body force section
contactresults.normalforce = force;
contactResults.normalForce += coulombForce
I always thought I needed to follow this sequence
I always thought step 4 and 5 need to be in two different APIs.
what you guys are saying is it can be in the same API. Anyway I will try your method.
0 -
Hey look i tried doing it like you suggested now I have a double. Which particle will experience what type of contact force this might sound trivial but its important.
I have intentionally scaled up the columbForce by factor of 1.0E8. I want the particles to stick to each other because of high columbic force. But they do not stick to each other the simulation keeps going
what happens is on line 314 in the attached image if I have a scale factor of (-1.0E8 or -1E11) the particles attract the simulation keeps continuing where as if I have scale factor of (+1.0E8) the particles repel with extreme high force so I should have a negative scale to make it attract.
But my question is
in the contact force API how will I know which particle is experiencing what value of force? how will I know which is element is experiencing what force and in what direction?
I can get the position by probing element1 and element2 but how will I get the value of force each element is experiencing?
And if I want the particles to go to rest ofter they attract how should I do it? i don't want the simulation to progress. i want both particles to come to rest. how can I force a value of velocity to the particles?
0 -
Hello Jerren and Renen
Please let me know about this
in the contact force API how will I know which particle is experiencing what value of force? how will I know which is element is experiencing what force and in what direction?
I can get the position by probing element1 and element2 but how will I get the value of force each element is experiencing?
And if I want the particles to go to rest ofter they attract how should I do it? i don't want the simulation to progress. i want both particles to come to rest. how can I force a value of velocity to the particles?
Also, adding the columbic force inside the contact force only solves half of my problem. I want the body force to account for particles over long distances...i have asked about it here. (I may have asked this in the past. I am still not convinced by your past solutions) (https://community.altair.com/community?id=community_question&sys_id=b2f1af85db919610cfd5f6a4e29619d8 )
0