Greetings. I've been working on a hybrid (contact and no contact) force model for LIGGGHTS, which has been done by other users here on the forum before. However, I wish to store a pairwise value that is calculated by surfacesClose so that I can later use it on surfacesIntersect when contact occurs. I've tried creating a new variable on the scdata struct and storing it there, but failed to realize that it is reinitialized every timestep hence this method wont work. Is there any other way I can implement this?
Daniel Queteschiner | Fri, 10/08/2021 - 11:45
Contact history
Pairwise properties that should be preserved between consecutive time steps may be stored in the contact history.
Use the function
IContactHistorySetup::add_history_value(std::string name, std::string newtonflag)
See, for instance, https://github.com/CFDEMproject/LIGGGHTS-PUBLIC/blob/master/src/normal_m...
joaopfc | Mon, 10/18/2021 - 20:54
Thank you for your answer
Thank you for your answer Daniel, it was very helpful. I've been reading the source to understand how to correctly use the contact history function and I'd like to check if I understood it correctly: I should first call the function and register the pairwise variable name I wish to use, and then call it when needed by using scdata.variable (or sidata.variable). Is this correct? Also: what exactly is the number string in newtonflag?
Daniel Queteschiner | Tue, 10/19/2021 - 15:18
contact history
IContactHistorySetup::add_history_value
basically reserves a slot (onedouble
value) in the contact historySurfacesCloseData::contact_history
(cf. https://github.com/CFDEMproject/LIGGGHTS-PUBLIC/blob/master/src/contact_...)(or to be more precise, one data slot managed by
FixContactHistory
, but we shan't bother about that now)Furthermore, the return value of that function is the index into said
contact_history
array, as you may see here:https://github.com/CFDEMproject/LIGGGHTS-PUBLIC/blob/master/src/normal_m...
The
newtonflag
indicates whether Newton's third law is to be used for that history value, i.e. if the value for particle i and particle j has the same ("0"
) or opposite ("1"
) sign.