LiquidMigrationLSInteraction Class Reference

Defines the liquid bridge LS interaction between two particles or walls. More...

#include <LiquidMigrationLSInteraction.h>

+ Inheritance diagram for LiquidMigrationLSInteraction:

Public Types

typedef LiquidMigrationLSSpecies SpeciesType
 An alias name for LiquidMigrationLSSpecies data type. More...
 

Public Member Functions

 LiquidMigrationLSInteraction (BaseInteractable *P, BaseInteractable *I, unsigned timeStamp)
 Constructor. More...
 
 LiquidMigrationLSInteraction ()
 
 LiquidMigrationLSInteraction (const LiquidMigrationLSInteraction &p)
 Copy constructor. More...
 
 ~LiquidMigrationLSInteraction () override
 Destructor. More...
 
void actionsOnErase () override
 If an interaction needs to do something before it gets erased, add it here. E.g. Liquid bridges rupture at the end of their lifetime, and the liquid bridge volume has to be redistributed. The reason this action is not done in the destructor is that this action should not be taken when erasing ghost interactions. More...
 
void actionsAfterTimeStep () override
 test if particle needs to be ruptured More...
 
void computeAdhesionForce ()
 Computes the adhesive forces for liquid bridge LS type of interaction. More...
 
void read (std::istream &is) override
 Interaction read function, which accepts an std::istream as input. More...
 
void write (std::ostream &os) const override
 Interaction print function, which accepts an std::ostream as input. More...
 
Mdouble getElasticEnergy () const override
 Returns the amount of Elastic energy involved in an interaction. Basically used in case you want to write the elastic energy into an output file. More...
 
const LiquidMigrationLSSpeciesgetSpecies () const
 Returns a pointer to the adhesive force species LiquidMigrationLSSpecies. More...
 
std::string getBaseName () const
 Returns the name of the interaction, see Interaction.h. More...
 
Mdouble getLiquidBridgeVolume () const
 
void setLiquidBridgeVolume (Mdouble liquidBridgeVolume)
 
void addLiquidBridgeVolume (Mdouble liquidBridgeVolume)
 
bool getWasInContact () const
 
void setWasInContact (bool wasInContact)
 
void rupture ()
 
void form ()
 
Mdouble getRuptureDistance ()
 
Mdouble getHalfFillingAngle ()
 
Mdouble getLimitingDistance ()
 
int getNumberOfContacts (BaseInteractable *interactable)
 
unsigned getNumberOfFieldsVTK () const override
 
std::string getTypeVTK (unsigned i) const override
 
std::string getNameVTK (unsigned i) const override
 
std::vector< MdoublegetFieldVTK (unsigned i) const override
 
- Public Member Functions inherited from BaseInteraction
 BaseInteraction (BaseInteractable *P, BaseInteractable *I, unsigned timeStamp)
 A constructor takes the BaseInteractable objects which are interacting (come into contact) and time the interaction starts. More...
 
 BaseInteraction ()
 
 BaseInteraction (const BaseInteraction &p)
 Copy constructor. More...
 
 ~BaseInteraction () override
 The destructor. It removes this interactions from the objects that were interacting, and writes the time to a file when needed. More...
 
virtual void computeForce ()
 Virtual function that contains the force law between the two objects interacting. More...
 
void read (std::istream &is) override
 Interaction read function, which accepts an std::istream as input. More...
 
void write (std::ostream &os) const override
 Interaction print function, which accepts an std::ostream as input. More...
 
void writeToFStat (std::ostream &os, Mdouble time) const
 Writes forces data to the FStat file. More...
 
std::string getName () const override
 Virtual function which allows interactions to be named. More...
 
void setDistance (Mdouble distance)
 Sets the interaction distance between the two interacting objects. More...
 
void setNormal (Vec3D normal)
 Sets the normal vector between the two interacting objects. More...
 
void setOverlap (Mdouble overlap)
 Set the overlap between the two interacting object. More...
 
void setContactPoint (Vec3D contactPoint)
 Set the location of the contact point between the two interacting objects. More...
 
void setTimeStamp (unsigned timeStamp)
 Updates the time step of the interacting. Note, time steps used to find completed interactions. More...
 
void setSpecies (const BaseSpecies *species)
 Set the Species of the interaction; note this can either be a Species or MixedSpecies. More...
 
void setP (BaseInteractable *P)
 Sets the first object involved in the interaction (normally a particle). More...
 
void setI (BaseInteractable *I)
 Sets the second object involved in the interaction (often particle or wall). More...
 
void importP (BaseInteractable *P)
 Sets the first object involved in the interaction (normally a particle). More...
 
void importI (BaseInteractable *I)
 Sets the second object involved in the interaction (often particle or wall). More...
 
Vec3D getIP () const
 
Vec3D getIC () const
 
Vec3D getCP () const
 
void setLagrangeMultiplier (Mdouble multiplier)
 
Mdouble getLagrangeMultiplier ()
 
void setHandler (InteractionHandler *handler)
 Sets the pointer to the interaction hander which is storing this interaction. More...
 
InteractionHandlergetHandler () const
 Gets a point to the interaction handlers to which this interaction belongs. More...
 
const Vec3DgetForce () const
 Gets the current force (vector) between the two interacting objects. More...
 
const Vec3DgetTorque () const
 Gets the current torque (vector) between the two interacting objects. More...
 
const Vec3DgetNormal () const
 Gets the normal vector between the two interacting objects. More...
 
const Vec3DgetContactPoint () const
 Gets constant reference to contact point (vector). More...
 
Mdouble getOverlap () const
 Returns a Mdouble with the current overlap between the two interacting objects. More...
 
Mdouble getOverlapVolume () const
 Returns the overlap volume between two interacting objects. More...
 
Mdouble getContactRadius () const
 Returns a Mdouble with the current contact between the two interacting objects. More...
 
void removeFromHandler ()
 Removes this interaction from its interaction hander. More...
 
void copySwitchPointer (const BaseInteractable *original, BaseInteractable *ghost) const
 This copies the interactions of the original particle and replaces the original with the ghost copy. More...
 
void gatherContactStatistics ()
 
BaseInteractablegetP ()
 Returns a pointer to first object involved in the interaction (normally a particle). More...
 
BaseInteractablegetI ()
 Returns a pointer to the second object involved in the interaction (often a wall or a particle). More...
 
const BaseInteractablegetP () const
 Returns a constant pointer to the first object involved in the interaction. More...
 
const BaseInteractablegetI () const
 Returns a constant pointer to the second object involved in the interaction. More...
 
Mdouble getTimeStamp () const
 Returns an Mdouble which is the time stamp of the interaction. More...
 
virtual void integrate (Mdouble timeStep)
 integrates variables of the interaction which need to be integrate e.g. the tangential overlap. More...
 
virtual Mdouble getTangentialOverlap () const
 get the length of the current tangential overlap More...
 
Mdouble getDistance () const
 Returns an Mdouble which is the norm (length) of distance vector. More...
 
const Vec3DgetRelativeVelocity () const
 Returns a constant reference to a vector of relative velocity. More...
 
Mdouble getNormalRelativeVelocity () const
 Returns a double which is the norm (length) of the relative velocity vector. More...
 
Mdouble getAbsoluteNormalForce () const
 Returns the absolute value of the norm (length) of the Normal force vector. More...
 
virtual BaseInteractioncopy () const =0
 Makes a copy of the interaction and returns a pointer to the copy. More...
 
void setFStatData (std::fstream &fstat, BaseParticle *P, BaseWall *I)
 
void setFStatData (std::fstream &fstat, BaseParticle *P, BaseParticle *I)
 
unsigned int getMultiContactIdentifier () const
 
void setMultiContactIdentifier (unsigned int multiContactIdentifier_)
 
virtual void rotateHistory (Matrix3D &rotationMatrix)
 When periodic particles are used, some interactions need certain history properties rotated (e.g. tangential springs). This is the function for that. More...
 
void addForce (Vec3D force)
 add an force increment to the total force. More...
 
void addTorque (Vec3D torque)
 add a torque increment to the total torque. More...
 
void setForce (Vec3D force)
 set total force (this is used by the normal force, tangential forces are added use addForce) More...
 
void setTorque (Vec3D torque)
 set the total force (this is used by the normal force, tangential torques are added use addTorque) More...
 
const BaseSpeciesgetBaseSpecies () const
 Return a constant point to BaseSpecies of the interaction. More...
 
virtual void createMPIType ()
 
virtual void * createMPIInteractionDataArray (unsigned int numberOfInteractions) const
 
virtual void deleteMPIInteractionDataArray (void *dataArray)
 
virtual void getMPIInteraction (void *historyDataArray, unsigned int index) const
 copies the history interactions into the data array More...
 
virtual void getInteractionDetails (void *interactionDataArray, unsigned int index, unsigned int &identificationP, unsigned int &identificationI, bool &isWallInteraction, unsigned &timeStamp)
 
virtual void setMPIInteraction (void *interactionDataArray, unsigned int index, bool resetPointers)
 
void setBasicMPIInteractionValues (int P, int I, unsigned timeStamp, Vec3D force, Vec3D torque, bool isWallInteraction, bool resetPointers)
 
void setIdentificationP (unsigned int identification)
 
void setIdentificationI (int identification)
 
void setWallInteraction (bool flag)
 
unsigned int getIdentificationP ()
 
int getIdentificationI ()
 
bool isWallInteraction ()
 
virtual bool isBonded () const
 
- Public Member Functions inherited from BaseObject
 BaseObject ()=default
 Default constructor. More...
 
 BaseObject (const BaseObject &p)=default
 Copy constructor, copies all the objects BaseObject contains. More...
 
virtual ~BaseObject ()=default
 virtual destructor More...
 
virtual void moveInHandler (unsigned int index)
 Except that it is virtual, it does the same thing as setIndex() does. More...
 
void setIndex (unsigned int index)
 Allows one to assign an index to an object in the handler/container. More...
 
void setId (unsigned long id)
 Assigns a unique identifier to each object in the handler (container) which remains constant even after the object is deleted from the container/handler. More...
 
unsigned int getIndex () const
 Returns the index of the object in the handler. More...
 
unsigned int getId () const
 Returns the unique identifier of any particular object. More...
 
void setGroupId (unsigned groupId)
 
unsigned getGroupId () const
 

Static Public Member Functions

static Mdouble getTotalLiquidFilmVolume (ParticleHandler &)
 
static Mdouble getTotalLiquidBridgeVolume (InteractionHandler &)
 

Private Attributes

bool wasInContact_
 A history parameter to store if the particles were in contact or not. Useful to compute adhesive forces. More...
 
Mdouble liquidBridgeVolume_
 

Additional Inherited Members

- Protected Member Functions inherited from BaseInteraction
virtual const Vec3D getTangentialForce () const
 
Mdouble getEffectiveRadius () const
 Returns a Mdouble to the effective radius of the interaction. (Not corrected for the overlap) More...
 
Mdouble getEffectiveMass () const
 Returns a Mdouble to the effective radius of the interaction. (Not corrected for the overlap) More...
 
void setRelativeVelocity (Vec3D relativeVelocity)
 set the relative velocity of the current of the interactions. More...
 
void setNormalRelativeVelocity (Mdouble normalRelativeVelocit)
 set the normal component of the relative velocity. More...
 
void setAbsoluteNormalForce (Mdouble absoluteNormalForce)
 the absolute values of the norm (length) of the normal force More...
 
virtual Mdouble getElasticEnergyAtEquilibrium (Mdouble adhesiveForce) const
 
virtual void reverseHistory ()
 When periodic particles some interaction need certain history properties reversing. This is the function for that. More...
 
void writeInteraction (std::ostream &os, bool created) const
 Writes information about a interaction to the interaction file. More...
 

Detailed Description

Defines the liquid bridge LS interaction between two particles or walls.

Member Typedef Documentation

◆ SpeciesType

An alias name for LiquidMigrationLSSpecies data type.

Constructor & Destructor Documentation

◆ LiquidMigrationLSInteraction() [1/3]

LiquidMigrationLSInteraction::LiquidMigrationLSInteraction ( BaseInteractable P,
BaseInteractable I,
unsigned  timeStamp 
)

Constructor.

Parameters
[in]P
[in]I
[in]timeStamp
44  : BaseInteraction(P, I, timeStamp)
45 {
46  liquidBridgeVolume_ = 0.0;
47  wasInContact_ = false;
48 #ifdef DEBUG_CONSTRUCTOR
49  logger(INFO, "LiquidMigrationLSInteraction::LiquidMigrationLSInteraction() finished");
50 #endif
51 }
Logger< MERCURYDPM_LOGLEVEL > logger("MercuryKernel")
Definition of different loggers with certain modules. A user can define its own custom logger here.
@ INFO
BaseInteraction()
Definition: BaseInteraction.cc:65
Mdouble liquidBridgeVolume_
Definition: LiquidMigrationLSInteraction.h:149
bool wasInContact_
A history parameter to store if the particles were in contact or not. Useful to compute adhesive forc...
Definition: LiquidMigrationLSInteraction.h:147
double P
Uniform pressure.
Definition: TwenteMeshGluing.cpp:73

References INFO, liquidBridgeVolume_, logger, and wasInContact_.

◆ LiquidMigrationLSInteraction() [2/3]

LiquidMigrationLSInteraction::LiquidMigrationLSInteraction ( )
55  : BaseInteraction()
56 {
57  liquidBridgeVolume_ = 0.0;
58  wasInContact_ = false;
59 #ifdef DEBUG_CONSTRUCTOR
60  logger(INFO, "LiquidMigrationLSInteraction::LiquidMigrationLSInteraction() finished");
61 #endif
62 }

References INFO, liquidBridgeVolume_, logger, and wasInContact_.

◆ LiquidMigrationLSInteraction() [3/3]

LiquidMigrationLSInteraction::LiquidMigrationLSInteraction ( const LiquidMigrationLSInteraction p)

Copy constructor.

Parameters
[in]p
68  : BaseInteraction(p)
69 {
72 #ifdef DEBUG_CONSTRUCTOR
73  logger(INFO, "LiquidMigrationLSInteraction::LiquidMigrationLSInteraction(const LiquidMigrationLSInteraction &p finished");
74 #endif
75 }

References INFO, liquidBridgeVolume_, logger, and wasInContact_.

◆ ~LiquidMigrationLSInteraction()

LiquidMigrationLSInteraction::~LiquidMigrationLSInteraction ( )
override

Destructor.

81 {
82 #ifdef DEBUG_DESTRUCTOR
83  logger(INFO, "LiquidMigrationLSInteraction::~LiquidMigrationLSInteraction() finished");
84 #endif
85 }

References INFO, and logger.

Member Function Documentation

◆ actionsAfterTimeStep()

void LiquidMigrationLSInteraction::actionsAfterTimeStep ( )
overridevirtual

test if particle needs to be ruptured

Reimplemented from BaseInteraction.

176 {
177  if (wasInContact_)
178  {
179  if (-getOverlap() >= getRuptureDistance())
180  {
181  rupture();
182  }
183  }
184  else
185  {
186  if (getOverlap() >= 0)
187  {
188  form();
189  }
190  }
191 }
Mdouble getOverlap() const
Returns a Mdouble with the current overlap between the two interacting objects.
Definition: BaseInteraction.h:240
void rupture()
Definition: LiquidMigrationLSInteraction.cc:288
void form()
Definition: LiquidMigrationLSInteraction.cc:193
Mdouble getRuptureDistance()
Definition: LiquidMigrationLSInteraction.cc:522

References form(), BaseInteraction::getOverlap(), getRuptureDistance(), rupture(), and wasInContact_.

◆ actionsOnErase()

void LiquidMigrationLSInteraction::actionsOnErase ( )
overridevirtual

If an interaction needs to do something before it gets erased, add it here. E.g. Liquid bridges rupture at the end of their lifetime, and the liquid bridge volume has to be redistributed. The reason this action is not done in the destructor is that this action should not be taken when erasing ghost interactions.

Reimplemented from BaseInteraction.

88 {
89  rupture();
90 };

References rupture().

◆ addLiquidBridgeVolume()

void LiquidMigrationLSInteraction::addLiquidBridgeVolume ( Mdouble  liquidBridgeVolume)
508 {
509  liquidBridgeVolume_ += liquidBridgeVolume;
510 }

References liquidBridgeVolume_.

Referenced by rupture().

◆ computeAdhesionForce()

void LiquidMigrationLSInteraction::computeAdhesionForce ( )

Computes the adhesive forces for liquid bridge LS type of interaction.

The contact model is based on the description given in (Zhang and Wu, 2020): https://www.sciencedirect.com/science/article/pii/S0032591019311258 This model includes a normal capillary force, a normal lubrication force and a tangential lubrication force. The capillary force is valid when particles are within rupture distance. The formulation is in (Lian and Seville, 2015): https://doi.org/10.1016/j.cis.2015.11.003. The lubrication force is valid when particles are within limiting distance. Note: the tangential lubrication force is added to sliding friction force through SlidingFrictionInteraction::addTangentialForce().

123 {
124  // Adding no capillary force for liquid bridge volume = 0
125  if (getLiquidBridgeVolume() == 0) return;
126 
127  if (getOverlap() >= 0)
128  {
129  // if particles are in contact
130  const LiquidMigrationLSSpecies* species = getSpecies();
131  const Mdouble effectiveRadius = getEffectiveRadius();
132  const Mdouble fdotn = -2.0 * species->getSurfaceTension() * effectiveRadius *
133  (2.0 * constants::pi - 2.082 * pow(getHalfFillingAngle(), 0.9197)) *
134  (std::cos(species->getContactAngle()) - 0.16 * getHalfFillingAngle() *
135  (1.0 + getHalfFillingAngle()) * std::tan(species->getContactAngle())); //max value of capillary;
136  addForce(getNormal() * fdotn);
137  }
138  else if (wasInContact_)
139  {
140  // if particles are not in contact, but within their interaction distance
141  const LiquidMigrationLSSpecies* species = getSpecies();
142  const Mdouble effectiveRadius = getEffectiveRadius();
143  const Mdouble s_nondim = -getOverlap()/getRuptureDistance() * (1.0 + 0.5 * species->getContactAngle() *
144  std::cos(species->getContactAngle()) * std::cos(getHalfFillingAngle() + species->getContactAngle()) ); //dimensionless S
145  const Mdouble fdotnc = -2.0 * species->getSurfaceTension() * effectiveRadius *
146  (2.0 * constants::pi - 2.082 * pow(getHalfFillingAngle(), 0.9197)) *
147  (std::cos(species->getContactAngle()) - 0.16 * getHalfFillingAngle() *
148  (1.0 + getHalfFillingAngle()) * std::tan(species->getContactAngle()))
149  /(1.0 + 0.8438 * pow(getHalfFillingAngle(), -0.724) * s_nondim +
150  1.3393 * pow(getHalfFillingAngle(), -1.459) * pow(s_nondim, 2.0));//capillary force
151 
152  Mdouble fdotnl = 0.0;//normal lubrication force in value
153  Vec3D fdottl = Vec3D(0.0, 0.0, 0.0);//tangential lubrication force in vector
154 
156  {
157  fdotnl = -6.0 * constants::pi * species->getViscosity() * pow(effectiveRadius, 2.0)
159 
160  Vec3D tangentialRelativeVelocity = getRelativeVelocity() - getNormal() * getNormalRelativeVelocity();
161 
162  fdottl = -6.0 * constants::pi * species->getViscosity() * effectiveRadius * tangentialRelativeVelocity
163  * (8.0/15.0 * std::log(effectiveRadius/(-getOverlap())) + 0.9588);
164 
165  }
166  addForce(getNormal() * (fdotnc + fdotnl) + fdottl);
167 
168  //add tangential lubrication force to sliding friction force
169  auto slidingFrictionInteraction = dynamic_cast<SlidingFrictionInteraction*>(this);
170  slidingFrictionInteraction->addTangentialForce(fdottl);
171  }
172 }
double Mdouble
Definition: GeneralDefine.h:34
const Vec3D & getRelativeVelocity() const
Returns a constant reference to a vector of relative velocity.
Definition: BaseInteraction.cc:573
const Vec3D & getNormal() const
Gets the normal vector between the two interacting objects.
Definition: BaseInteraction.h:226
void addForce(Vec3D force)
add an force increment to the total force.
Definition: BaseInteraction.cc:606
Mdouble getNormalRelativeVelocity() const
Returns a double which is the norm (length) of the relative velocity vector.
Definition: BaseInteraction.cc:584
Mdouble getEffectiveRadius() const
Returns a Mdouble to the effective radius of the interaction. (Not corrected for the overlap)
Definition: BaseInteraction.cc:793
Mdouble getHalfFillingAngle()
Definition: LiquidMigrationLSInteraction.cc:528
Mdouble getLimitingDistance()
Definition: LiquidMigrationLSInteraction.cc:534
const LiquidMigrationLSSpecies * getSpecies() const
Returns a pointer to the adhesive force species LiquidMigrationLSSpecies.
Definition: LiquidMigrationLSInteraction.cc:483
Mdouble getLiquidBridgeVolume() const
Definition: LiquidMigrationLSInteraction.cc:497
LiquidMigrationLSSpecies contains the parameters used to describe a short-range force caused by liqui...
Definition: LiquidMigrationLSSpecies.h:38
Mdouble getSurfaceTension() const
used to access the surface tension of the liquid.
Definition: LiquidMigrationLSSpecies.cc:200
Mdouble getViscosity() const
used to access the Viscosity of the liquid.
Definition: LiquidMigrationLSSpecies.cc:249
Mdouble getContactAngle() const
used to access the contact angle between particle and liquid bridge surface.
Definition: LiquidMigrationLSSpecies.cc:225
Computes the forces corresponding to sliding friction.
Definition: SlidingFrictionInteraction.h:43
void addTangentialForce(Vec3D force)
adds an extra tangential force, mainly for the tangential lubrication force from LiquidMigrationLS mo...
Definition: SlidingFrictionInteraction.h:117
Definition: Vector.h:51
const Mdouble pi
Definition: ExtendedMath.h:45
Mdouble log(Mdouble Power)
Definition: ExtendedMath.cc:104
Mdouble cos(Mdouble x)
Definition: ExtendedMath.cc:64
T tan(T x)
Definition: ExtendedMath.h:178

References BaseInteraction::addForce(), SlidingFrictionInteraction::addTangentialForce(), mathsFunc::cos(), LiquidMigrationLSSpecies::getContactAngle(), BaseInteraction::getEffectiveRadius(), getHalfFillingAngle(), getLimitingDistance(), getLiquidBridgeVolume(), BaseInteraction::getNormal(), BaseInteraction::getNormalRelativeVelocity(), BaseInteraction::getOverlap(), BaseInteraction::getRelativeVelocity(), getRuptureDistance(), getSpecies(), LiquidMigrationLSSpecies::getSurfaceTension(), LiquidMigrationLSSpecies::getViscosity(), mathsFunc::log(), constants::pi, mathsFunc::tan(), and wasInContact_.

◆ form()

void LiquidMigrationLSInteraction::form ( )
Todo:
: maybe we need to check ghost particles?
194 {
195  //form a bridge
196  //todo: extend to neighbours
197 
198  wasInContact_ = true;
199  const LiquidMigrationLSSpecies* species = getSpecies();
200  LiquidFilmParticle* IParticle = dynamic_cast<LiquidFilmParticle*>(getI());
201  LiquidFilmParticle* PParticle = dynamic_cast<LiquidFilmParticle*>(getP());
202  if (IParticle == nullptr) //if I is a wall
203  {
204  //do not form bridge if the volume is below minimum
205  if (PParticle->getLiquidVolume() < species->getLiquidBridgeVolumeMin())
206  {
207  return;
208  }
209  //if below max bridge volume, move all liquid from film to volume
210  else if (PParticle->getLiquidVolume() <= species->getLiquidBridgeVolumeMax())
211  {
212  liquidBridgeVolume_ = PParticle->getLiquidVolume();
213  PParticle->setLiquidVolume(0.0);
214  }
215  //if above max bridge volume, fill the liquid bridge and keep the rest of the liquid in the particle
216  else
217  {
219  PParticle->setLiquidVolume(PParticle->getLiquidVolume() - species->getLiquidBridgeVolumeMax());
220  }
221 // if (liquidBridgeVolume_) logger(INFO,"Forming liquid bridge of volume % between particles % and wall %",liquidBridgeVolume_,getP()->getId(),getI()->getId());
222  }
223  else if (PParticle == nullptr) //if P is a wall
224  {
225  logger(ERROR,"Should not happen");
226  }
227  else //if P and I are particles
228  {
229  //if I is a ghost particle, apply volume change only to real particles (this removes the possibility that contacts are established only on one side of the periodic boundary; the same problem could exist for ruptures!)
230  LiquidFilmParticle* IParticleReal;
231  if (IParticle->getPeriodicFromParticle())
232  {
233  IParticleReal = dynamic_cast<LiquidFilmParticle*>(IParticle->getPeriodicFromParticle());
234  }
235  else
236  {
237  IParticleReal = IParticle;
238  }
239 
240  Mdouble distributableLiquidVolume =
241  PParticle->getLiquidVolume() + IParticleReal->getLiquidVolume();
242  //assign all liquid of the contacting particles to the bridge,
243  //if the total volume does not exceed LiquidBridgeVolumeMax
245  if (distributableLiquidVolume <= species->getLiquidBridgeVolumeMin())
246  {
247  return;
248  }
249  else if (distributableLiquidVolume <= species->getLiquidBridgeVolumeMax())
250  {
251  liquidBridgeVolume_ = distributableLiquidVolume;
252  if (!IParticle->getPeriodicFromParticle() ||
253  PParticle->getIndex() < IParticle->getPeriodicFromParticle()->getIndex())
254  {
255  PParticle->setLiquidVolume(0.0);
256  IParticleReal->setLiquidVolume(0.0);
257  }
258  }
259  else //if the total volume exceeds LiquidBridgeVolumeMax, only distribute the max value
260  {
262  Mdouble pFraction =
263  PParticle->getLiquidVolume() / distributableLiquidVolume;
264  if (!IParticle->getPeriodicFromParticle() ||
265  PParticle->getIndex() < IParticle->getPeriodicFromParticle()->getIndex())
266  {
267  PParticle->addLiquidVolume(-pFraction * species->getLiquidBridgeVolumeMax());
268  IParticleReal->addLiquidVolume(-(1.0 - pFraction) * species->getLiquidBridgeVolumeMax());
269  }
270  }
271 // if (liquidBridgeVolume_) logger(INFO,"Forming liquid bridge of volume % between particles % and % (MPI %%, V % %, overlap %)",liquidBridgeVolume_,getP()->getId(),getI()->getId(),PParticle->isMPIParticle(),IParticle->isMPIParticle(),PParticle->getLiquidVolume(),IParticle->getLiquidVolume(),getOverlap());
272  }
273 }
@ ERROR
BaseInteractable * getI()
Returns a pointer to the second object involved in the interaction (often a wall or a particle).
Definition: BaseInteraction.h:285
BaseInteractable * getP()
Returns a pointer to first object involved in the interaction (normally a particle).
Definition: BaseInteraction.h:274
Definition: LiquidFilmParticle.h:36
void setLiquidVolume(Mdouble liquidVolume)
Definition: LiquidFilmParticle.h:108
Mdouble getLiquidVolume() const
Definition: LiquidFilmParticle.h:103
void addLiquidVolume(Mdouble liquidVolume)
Definition: LiquidFilmParticle.h:113
Mdouble getLiquidBridgeVolumeMin() const
used to access the Volume of the liquid bridge.
Definition: LiquidMigrationLSSpecies.cc:155
Mdouble getLiquidBridgeVolumeMax() const
used to access the Volume of the liquid bridge.
Definition: LiquidMigrationLSSpecies.cc:147

References LiquidFilm< Particle >::addLiquidVolume(), ERROR, BaseInteraction::getI(), LiquidMigrationLSSpecies::getLiquidBridgeVolumeMax(), LiquidMigrationLSSpecies::getLiquidBridgeVolumeMin(), LiquidFilm< Particle >::getLiquidVolume(), BaseInteraction::getP(), getSpecies(), liquidBridgeVolume_, logger, LiquidFilm< Particle >::setLiquidVolume(), and wasInContact_.

Referenced by actionsAfterTimeStep().

◆ getBaseName()

std::string LiquidMigrationLSInteraction::getBaseName ( ) const

Returns the name of the interaction, see Interaction.h.

Returns
std::string
493 {
494  return "LiquidMigrationLS";
495 }

◆ getElasticEnergy()

Mdouble LiquidMigrationLSInteraction::getElasticEnergy ( ) const
overridevirtual

Returns the amount of Elastic energy involved in an interaction. Basically used in case you want to write the elastic energy into an output file.

Returns
Mdouble
Todo:
TW

Reimplemented from BaseInteraction.

475 {
477  return 0.0;
478 }

◆ getFieldVTK()

std::vector< Mdouble > LiquidMigrationLSInteraction::getFieldVTK ( unsigned  i) const
overridevirtual

Reimplemented from BaseInteraction.

556 {
557  return std::vector<Mdouble>(1, cbrt(liquidBridgeVolume_));
558 }

References liquidBridgeVolume_.

◆ getHalfFillingAngle()

Mdouble LiquidMigrationLSInteraction::getHalfFillingAngle ( )
529 {
530  const LiquidMigrationLSSpecies* species = getSpecies();
531  return pow(liquidBridgeVolume_, 0.26) + (0.285 - 0.4594 * species->getContactAngle()) * pow(liquidBridgeVolume_, (0.6327 + 0.897 * species->getContactAngle()));
532 }

References LiquidMigrationLSSpecies::getContactAngle(), getSpecies(), and liquidBridgeVolume_.

Referenced by computeAdhesionForce().

◆ getLimitingDistance()

Mdouble LiquidMigrationLSInteraction::getLimitingDistance ( )
535 {
536  return getRuptureDistance()/4.0;
537 }

References getRuptureDistance().

Referenced by computeAdhesionForce().

◆ getLiquidBridgeVolume()

Mdouble LiquidMigrationLSInteraction::getLiquidBridgeVolume ( ) const
498 {
499  return liquidBridgeVolume_;
500 }

References liquidBridgeVolume_.

Referenced by computeAdhesionForce(), getNumberOfContacts(), and rupture().

◆ getNameVTK()

std::string LiquidMigrationLSInteraction::getNameVTK ( unsigned  i) const
overridevirtual

Reimplemented from BaseInteraction.

550 {
551  return "liquidBridgeRadius";
552 
553 }

◆ getNumberOfContacts()

int LiquidMigrationLSInteraction::getNumberOfContacts ( BaseInteractable interactable)
276 {
277  int numContacts = 0;
278  for (auto i : interactable->getInteractions())
279  {
281  LiquidFilmParticle* jIParticle = dynamic_cast<LiquidFilmParticle*>(i->getI());
282  if (j != this && jIParticle != nullptr && j->getLiquidBridgeVolume() != 0.0)
283  numContacts++;
284  }
285  return numContacts;
286 }
const std::vector< BaseInteraction * > & getInteractions() const
Returns a list of interactions which belong to this interactable.
Definition: BaseInteractable.h:277
Defines the liquid bridge LS interaction between two particles or walls.
Definition: LiquidMigrationLSInteraction.h:45
const std::complex< Mdouble > i
Definition: ExtendedMath.h:51

References BaseInteractable::getInteractions(), getLiquidBridgeVolume(), and constants::i.

Referenced by rupture().

◆ getNumberOfFieldsVTK()

unsigned LiquidMigrationLSInteraction::getNumberOfFieldsVTK ( ) const
overridevirtual

writes extra information to the VTK output

Reimplemented from BaseInteraction.

540 {
541  return 1;
542 }

◆ getRuptureDistance()

Mdouble LiquidMigrationLSInteraction::getRuptureDistance ( )
523 {
524  const LiquidMigrationLSSpecies* species = getSpecies();
525  return (1.0 + 0.5 * species->getContactAngle()) * (cbrt(liquidBridgeVolume_) + 0.1 * pow(liquidBridgeVolume_, 2.0/3.0));
526 }

References LiquidMigrationLSSpecies::getContactAngle(), getSpecies(), and liquidBridgeVolume_.

Referenced by actionsAfterTimeStep(), computeAdhesionForce(), and getLimitingDistance().

◆ getSpecies()

const LiquidMigrationLSSpecies * LiquidMigrationLSInteraction::getSpecies ( ) const

Returns a pointer to the adhesive force species LiquidMigrationLSSpecies.

Returns
const LiquidMigrationLSSpecies*
484 {
485  return static_cast<const LiquidMigrationLSSpecies*>(getBaseSpecies()->getAdhesiveForce());
486 
487 }
const BaseSpecies * getBaseSpecies() const
Return a constant point to BaseSpecies of the interaction.
Definition: BaseInteraction.cc:682
BaseAdhesiveForce * getAdhesiveForce() const
Definition: BaseSpecies.h:152

References BaseSpecies::getAdhesiveForce(), and BaseInteraction::getBaseSpecies().

Referenced by computeAdhesionForce(), form(), getHalfFillingAngle(), getRuptureDistance(), and rupture().

◆ getTotalLiquidBridgeVolume()

Mdouble LiquidMigrationLSInteraction::getTotalLiquidBridgeVolume ( InteractionHandler h)
static
575 {
576  Mdouble volume = 0;
577  for (auto i : h)
578  {
579  auto l = dynamic_cast<LiquidMigrationLSInteraction*>(i);
580  if (l)
581  {
582  volume += l->getLiquidBridgeVolume();
583  }
584  }
585  return volume;
586 }

References constants::i.

◆ getTotalLiquidFilmVolume()

Mdouble LiquidMigrationLSInteraction::getTotalLiquidFilmVolume ( ParticleHandler h)
static
561 {
562  Mdouble volume = 0;
563  for (auto p : h)
564  {
565  auto l = dynamic_cast<LiquidFilmParticle*>(p);
566  if (l)
567  {
568  volume += l->getLiquidVolume();
569  }
570  }
571  return volume;
572 }

◆ getTypeVTK()

std::string LiquidMigrationLSInteraction::getTypeVTK ( unsigned  i) const
overridevirtual

Reimplemented from BaseInteraction.

545 {
546  return "Float32";
547 }

◆ getWasInContact()

bool LiquidMigrationLSInteraction::getWasInContact ( ) const
513 {
514  return wasInContact_;
515 }

References wasInContact_.

◆ read()

void LiquidMigrationLSInteraction::read ( std::istream &  is)
overridevirtual

Interaction read function, which accepts an std::istream as input.

Parameters
[in,out]is

Implements BaseObject.

106 {
107  std::string dummy;
108  is >> dummy >> wasInContact_;
109  is >> dummy >> liquidBridgeVolume_;
110 }

References liquidBridgeVolume_, and wasInContact_.

◆ rupture()

void LiquidMigrationLSInteraction::rupture ( )
289 {
290  // remove the contact history
291  wasInContact_ = false;
292 
293  //if the bridge is already empty, do nothing
294  if (getLiquidBridgeVolume() == 0.0)
295  return;
296 
297  //else rupture a bridge
298  const LiquidMigrationLSSpecies* species = getSpecies();
299  LiquidFilmParticle* IParticle = dynamic_cast<LiquidFilmParticle*>(getI());
300  LiquidFilmParticle* PParticle = dynamic_cast<LiquidFilmParticle*>(getP());
301  if (IParticle == nullptr) //if I is a wall
302  {
303  int numContactsP = 0;
304  for (auto i : getP()->getInteractions())
305  {
307  if (j != this && j != nullptr && j->getLiquidBridgeVolume() != 0.0)
308  {
309  numContactsP++;
310  }
311 
312  }
313 // logger(INFO,"Rupturing liquid bridge of volume % between particles % and wall % (numContacts %)",liquidBridgeVolume_,getP()->getId(),getI()->getId(),numContactsP);
314  if (numContactsP > 0)
315  {
316  // Updating new volume with distribution less than critical volume
317  Mdouble ExcessBridgeVolume = 0.0;
318  Mdouble newVolume = liquidBridgeVolume_ * species->getDistributionCoefficient() / (numContactsP);
319 
320  for (auto i : getP()->getInteractions())
321  {
323  dynamic_cast<LiquidMigrationLSInteraction*>(i);
324  if (j != this && j != nullptr && j->getLiquidBridgeVolume() != 0.0)
325  {
327  j->getLiquidBridgeVolume() + newVolume);
328  if (j->getLiquidBridgeVolume() >=
329  species->getLiquidBridgeVolumeMax())
330  {
331  ExcessBridgeVolume +=
333  - species->getLiquidBridgeVolumeMax();
335  species->getLiquidBridgeVolumeMax());
336  }
337  }
338  }
339  PParticle->setLiquidVolume(
340  PParticle->getLiquidVolume() + ExcessBridgeVolume +
342 
344  }
345  else
346  {
347  PParticle->setLiquidVolume(PParticle->getLiquidVolume() + liquidBridgeVolume_);
348  }
349  liquidBridgeVolume_ = 0.0;
350  //for (auto i : *getHandler())
351  //{
352  // LiquidMigrationLSInteraction* j =
353  // dynamic_cast<LiquidMigrationLSInteraction*>(i);
354  //}
355  //for (auto i : getHandler()->getDPMBase()->particleHandler)
356  //{
357  // LiquidFilmParticle* j = dynamic_cast<LiquidFilmParticle*>(i);
358  //}
359  }
360  else if (PParticle == nullptr) //if P is a wall
361  {
362  logger(ERROR,"this should not happen");
363  }
364  else //if P and I are particles
365  {
366  //count interaction partners of p (this contact, ghosts and interaction without liquid bridge dont count)
367  int numContactsP = getNumberOfContacts(getP());
368 // logger(INFO,"Rupturing liquid bridge of volume % between particles % and % (numContacts %, MPI %%, overlap %)",liquidBridgeVolume_,getP()->getId(),getI()->getId(),numContactsP,PParticle->isMPIParticle(),IParticle->isMPIParticle(),getOverlap());
369  if (numContactsP < 1) //if P has only one contact (the one that gets ruptured), pass the fluid into it)
370  {
371  PParticle->addLiquidVolume(0.5 * liquidBridgeVolume_);
372  }
373  else //if P has only multiple contacts pass the fluid into it)
374  {
375  // move fluid to neighbouring contacts
376  Mdouble perContactVolume = 0.5 * liquidBridgeVolume_ * species->getDistributionCoefficient() / numContactsP;
377  for (auto i : getP()->getInteractions())
378  {
380  dynamic_cast<LiquidMigrationLSInteraction*>(i);
381  LiquidFilmParticle* jIParticle =
382  dynamic_cast<LiquidFilmParticle*>(i->getI());
383  if (j != this && jIParticle != nullptr && j->getLiquidBridgeVolume() != 0.0)
384  {
385  Mdouble excessVolume =
386  perContactVolume - (species->getLiquidBridgeVolumeMax() - j->getLiquidBridgeVolume());
387  if (excessVolume < 0.0)
388  {
389  j->addLiquidBridgeVolume(perContactVolume);
390  PParticle->addLiquidVolume(
391  0.5 * liquidBridgeVolume_ * (1 - species->getDistributionCoefficient()) / numContactsP);
392  }
393  else
394  {
396  PParticle->addLiquidVolume(excessVolume);
397  PParticle->addLiquidVolume(
398  0.5 * liquidBridgeVolume_ * (1 - species->getDistributionCoefficient()) / numContactsP);
399  }
400  }
401  }
402  //Mdouble PParticle_fin = PParticle->getLiquidVolume();
403 
404  }
405 
406  //count interaction partners of i (ghosts and interaction without liquid bridge dont count)
407  int numContactsI = getNumberOfContacts(getI());
408  if (numContactsI < 1)
409  {
410  IParticle->addLiquidVolume(0.5 * liquidBridgeVolume_);
411  //std::cout << "added " << 0.5 * liquidBridgeVolume_
412  // << " to particle #" << IParticle->getIndex()
413  //<< ", V=" << IParticle->getLiquidVolume() << std::endl;
414  }
415  else
416  {
417  // move fluid to neighbouring contacts
418  Mdouble perContactVolume =
419  0.5 * liquidBridgeVolume_ * species->getDistributionCoefficient() / (numContactsI);
420  for (BaseInteraction* i : getI()->getInteractions())
421  {
423  LiquidFilmParticle* jIParticle = dynamic_cast<LiquidFilmParticle*>(i->getI());
424  if (j != this && jIParticle != nullptr && j->getLiquidBridgeVolume() != 0.0)
425  {
426  Mdouble excessVolume =
427  perContactVolume
428  - species->getLiquidBridgeVolumeMax()
429  + j->getLiquidBridgeVolume();
430  if (excessVolume < 0.0)
431  {
432  j->addLiquidBridgeVolume(perContactVolume);
433  IParticle->addLiquidVolume(
434  0.5 * liquidBridgeVolume_ * (1 - species->getDistributionCoefficient()) /
435  (numContactsI));
436  }
437  else
438  {
439  //std::cout << "excess i-Volume " << excessVolume << std::endl;
441  IParticle->addLiquidVolume(excessVolume);
442  IParticle->addLiquidVolume(
443  0.5 * liquidBridgeVolume_ * (1 - species->getDistributionCoefficient()) /
444  (numContactsI));
445  }
446  //~ std::cout << "added " << perContactVolume
447  //~ << " to i-contact #" << j->getIndex()
448  //~ << ", V=" << j->getLiquidBridgeVolume() << std::endl;
449  }
450  }
451  }
452 
453  //~ std::cout << "ruptured liquid bridge #" << getId()
454  //~ << " between particles #"
455  //~ << PParticle->getIndex()
456  //~ << " and #"
457  //~ << IParticle->getIndex()
458  //~ << ": V" << liquidBridgeVolume_
459  //~ << " -> Vp" << PParticle->getLiquidVolume()
460  //~ << " Vi" << IParticle->getLiquidVolume()
461  //~ << " Np" << numContactsP
462  //~ << " Ni" << numContactsI
463  //~ << std::endl;
464 
465  //to balance the added volume, remove the liquid from the bridge
466  liquidBridgeVolume_ = 0.0;
467 
468  }
469 }
Stores information about interactions between two interactable objects; often particles but could be ...
Definition: BaseInteraction.h:60
int getNumberOfContacts(BaseInteractable *interactable)
Definition: LiquidMigrationLSInteraction.cc:275
void setLiquidBridgeVolume(Mdouble liquidBridgeVolume)
Definition: LiquidMigrationLSInteraction.cc:502
void addLiquidBridgeVolume(Mdouble liquidBridgeVolume)
Definition: LiquidMigrationLSInteraction.cc:507
Mdouble getDistributionCoefficient() const
used to access the surface tension of the liquid.
Definition: LiquidMigrationLSSpecies.cc:177

References addLiquidBridgeVolume(), LiquidFilm< Particle >::addLiquidVolume(), ERROR, LiquidMigrationLSSpecies::getDistributionCoefficient(), BaseInteraction::getI(), BaseInteractable::getInteractions(), getLiquidBridgeVolume(), LiquidMigrationLSSpecies::getLiquidBridgeVolumeMax(), LiquidFilm< Particle >::getLiquidVolume(), getNumberOfContacts(), BaseInteraction::getP(), getSpecies(), constants::i, liquidBridgeVolume_, logger, setLiquidBridgeVolume(), LiquidFilm< Particle >::setLiquidVolume(), and wasInContact_.

Referenced by actionsAfterTimeStep(), and actionsOnErase().

◆ setLiquidBridgeVolume()

void LiquidMigrationLSInteraction::setLiquidBridgeVolume ( Mdouble  liquidBridgeVolume)
503 {
504  liquidBridgeVolume_ = liquidBridgeVolume;
505 }

References liquidBridgeVolume_.

Referenced by rupture().

◆ setWasInContact()

void LiquidMigrationLSInteraction::setWasInContact ( bool  wasInContact)
518 {
519  wasInContact_ = wasInContact;
520 }

References wasInContact_.

◆ write()

void LiquidMigrationLSInteraction::write ( std::ostream &  os) const
overridevirtual

Interaction print function, which accepts an std::ostream as input.

Parameters
[in,out]os

Implements BaseObject.

96 {
97  os
98  << " wasInContact " << wasInContact_
99  << " liquidBridgeVolume " << liquidBridgeVolume_;
100 }

References liquidBridgeVolume_, and wasInContact_.

Member Data Documentation

◆ liquidBridgeVolume_

◆ wasInContact_

bool LiquidMigrationLSInteraction::wasInContact_
private

A history parameter to store if the particles were in contact or not. Useful to compute adhesive forces.

Referenced by actionsAfterTimeStep(), computeAdhesionForce(), form(), getWasInContact(), LiquidMigrationLSInteraction(), read(), rupture(), setWasInContact(), and write().


The documentation for this class was generated from the following files: