Book-keeping of Wall charge

Submitted by clarence91 on Thu, 01/29/2015 - 00:34

Hello everybody,
I am a new bee to LIGGGHTS.
How can I have a book-keeping of the wall-properties of my domain? I just have to introduce a variable and I am not pretty sure about how to define it.
All I am doing is calculating the charge transfer from particle-particle and particle-wall contacts.
I am able to save the data about particle charge (q[i]=q[i]+dq) (q-charge) at each time-step.
To validate my results and prove that charge is conserved (conservation law) I would like to have the data about the wall charge too i.e if the particle hits the wall then it might gain or loose the charge depending on the work function and similarly in this process even WALL is either losing or gaining electrons from particles, Can anyone please let me know how do I define a variable for WALL which can calculate the charge?
May be if I have just one particle then you can say like upon collision with wall, the charge attained by particle is (q_particle + dq) and for the wall is (q_wall - dq) but if I have N-particles then it will not be the same situation as it's not mandatory that all the particles come in contact with wall at each and every time-step.

If I am not clear with my explanation, please let me know.

Thank you.

richti83's picture

richti83 | Thu, 01/29/2015 - 19:53

Because the TO contacted me by mail, I repeat my answer here for reference:

I'm not a physicist nor the programmer of the granular wall style in liggghts, but I bet it is not implemented. When you don't use fix wall/gran than you better ask the LAMMPS people from sandia labs about this topic.
LIGGGHTS is only for granular mechanics, most of us are bulk solid engineers. LAMMPS is for molecular dynamics and therefore responsible for charge and all the atom depending stuff.

Sorry, we can't help you,
Christian.

I'm not an associate of DCS GmbH and not a core developer of LIGGGHTS®
ResearchGate | Contact

clarence91 | Thu, 01/29/2015 - 22:04

I want to define a parameter to the wall and update the value of that variable for each time-step. How can I define a parameter and update it?

richti83's picture

richti83 | Fri, 01/30/2015 - 08:27


I want to define a parameter to the wall and update the value of that variable for each time-step. How can I define a parameter and update it?

I thought about this last night. When you have strong C++ skills you could adapt fix_mesh_surface_stress, have a look how wear is tracked. You need two new mesh->property scalar container for charge_step and charge_total (see void FixMeshSurfaceStress::initWear() ) and than in add_particle_contribution a new inputparameter with the charge of your atom, add this to charge_step(itri) and after all in calc_total_force a loop to sum all charge_step to charge_total.
To ouput the result you have 2 possibilities:
1: adapt dump_mesh_vtk to dump the the scalarcontainer for each triangle,
2: append the overall-processors-charge in compute_vector to the fix and access it on scriptlevel with f_ID[7]
This approach asumes you use mesh walls and not primitive walls.
We could do this for money for you...

On Scriptlevel I can not imagine how to do this.

Best,
Christian.

I'm not an associate of DCS GmbH and not a core developer of LIGGGHTS®
ResearchGate | Contact

ravirasoon1991 | Tue, 02/17/2015 - 17:32

Hey,

Could you fix your problem?
My problem is similar to yours but mine deals with temperature. I want to account for the walls.

If you could solve, please let me know.
Thank you.

clarence91 | Fri, 02/20/2015 - 01:06

I could not fix it by defining a new variable to the wall but I just wrote all the data into a new file by "fopen". (I know this is not the professional way but still it works)

May be for your case, like if I had an equation with T_wall=T+dt then I managed to write all the dt (change in temperature) to a new file.

I hope this helps.