MercuryDPM  Alpha
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
LiquidMigrationWilletInteraction Class Reference

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

#include <LiquidMigrationWilletInteraction.h>

+ Inheritance diagram for LiquidMigrationWilletInteraction:

Public Types

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

Public Member Functions

 LiquidMigrationWilletInteraction (BaseInteractable *P, BaseInteractable *I, Mdouble timeStamp)
 Constructor. More...
 
 LiquidMigrationWilletInteraction (const LiquidMigrationWilletInteraction &p)
 Copy constructor. More...
 
virtual ~LiquidMigrationWilletInteraction ()
 Destructor. More...
 
virtual void actionsOnErase ()
 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 ()
 test if particle needs to be ruptured More...
 
void computeAdhesionForce ()
 Computes the adhesive forces for liquid bridge Willet type of interaction. More...
 
void read (std::istream &is)
 Interaction read function, which accepts an std::istream as input. More...
 
void write (std::ostream &os) const
 Interaction print function, which accepts an std::ostream as input. More...
 
Mdouble getElasticEnergy () const
 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
LiquidMigrationWilletSpecies
getSpecies () const
 A dynamic_cast of BaseSpecies type pointer to a pointer of type LiquidMigrationWilletSpecies. 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 ()
 
int getNumberOfContacts (BaseInteractable *interactable)
 
unsigned getNumberOfFieldsVTK () const override
 writes extra information to the VTK output More...
 
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, Mdouble timeStamp)
 A constructor takes the BaseInteractable objects which are interacting (come into contact) and time the interaction starts. More...
 
 BaseInteraction (const BaseInteraction &p)
 Copy constructor. More...
 
 BaseInteraction ()
 Empty constructor. More...
 
virtual ~BaseInteraction ()
 The default destructor. More...
 
virtual void computeForce ()
 Virtual function that contains the force law between the two objects interacting. More...
 
void writeToFStat (std::ostream &os) const
 Writes forces data to the FStat file. More...
 
virtual std::string getName () const
 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 (Mdouble timeStamp)
 Updates the time step of the interacting. Note, timesteps used to find completed interactions. More...
 
void setSpecies (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 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 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 ()
 
const BaseInteractablegetP () const
 
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...
 
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 setForce (Vec3D force)
 set total force (this is used by the normal force, tangential forces are added use addForce) More...
 
- Public Member Functions inherited from BaseObject
 BaseObject ()
 Default constructor. More...
 
 BaseObject (const BaseObject &p)
 Copy constructor, copies all the objects BaseObject contains. More...
 
virtual ~BaseObject ()
 virtual destructor More...
 
virtual void moveInHandler (const unsigned int index)
 Except that it is virtual, it does the same thing as setIndex() does. More...
 
void setIndex (const unsigned int index)
 Allows one to assign an index to an object in the handler/container. More...
 
void setId (const unsigned int 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...
 

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...
 
Mdouble getEffectiveCorrectedRadius ()
 Returns a Mdouble to the effective radius corrected for the overlaps of the particles. More...
 
void addForce (Vec3D force)
 add an force increment to the total force. More...
 
void addTorque (Vec3D torque)
 
void setTorque (Vec3D torque)
 set the total force (this is used by the normal force, tangential torques are added use addTorque) 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...
 
const BaseSpeciesgetBaseSpecies () const
 Return a constant point to BaseSpecies of the interaction. 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...
 

Detailed Description

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

Definition at line 39 of file LiquidMigrationWilletInteraction.h.

Member Typedef Documentation

Constructor & Destructor Documentation

LiquidMigrationWilletInteraction::LiquidMigrationWilletInteraction ( BaseInteractable P,
BaseInteractable I,
Mdouble  timeStamp 
)

Constructor.

Parameters
[in]P
[in]I
[in]timeStamp

Definition at line 40 of file LiquidMigrationWilletInteraction.cc.

References liquidBridgeVolume_, and wasInContact_.

41  : BaseInteraction(P, I, timeStamp)
42 {
43  liquidBridgeVolume_ = 0.0;
44  wasInContact_ = false;
45 #ifdef DEBUG_CONSTRUCTOR
46  std::cout << "LiquidMigrationWilletInteraction::LiquidMigrationWilletInteraction() finished" << std::endl;
47 #endif
48 }
BaseInteraction()
Empty constructor.
bool wasInContact_
A history parameter to store if the particles were in contact or not. Useful to compute adhesive forc...
LiquidMigrationWilletInteraction::LiquidMigrationWilletInteraction ( const LiquidMigrationWilletInteraction p)

Copy constructor.

Parameters
[in]p

Definition at line 53 of file LiquidMigrationWilletInteraction.cc.

References liquidBridgeVolume_, and wasInContact_.

54  : BaseInteraction(p)
55 {
58 #ifdef DEBUG_CONSTRUCTOR
59  std::cout << "LiquidMigrationWilletInteraction::LiquidMigrationWilletInteraction(const LiquidMigrationWilletInteraction &p finished" << std::endl;
60 #endif
61 }
BaseInteraction()
Empty constructor.
bool wasInContact_
A history parameter to store if the particles were in contact or not. Useful to compute adhesive forc...
LiquidMigrationWilletInteraction::~LiquidMigrationWilletInteraction ( )
virtual

Destructor.

Definition at line 66 of file LiquidMigrationWilletInteraction.cc.

67 {
68 #ifdef DEBUG_DESTRUCTOR
69  std::cout << "LiquidMigrationWilletInteraction::~LiquidMigrationWilletInteraction() finished" << std::endl;
70 #endif
71 }

Member Function Documentation

void LiquidMigrationWilletInteraction::actionsAfterTimeStep ( )
virtual

test if particle needs to be ruptured

Reimplemented from BaseInteraction.

Definition at line 126 of file LiquidMigrationWilletInteraction.cc.

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

127 {
128  if (wasInContact_)
129  {
130  if (-getOverlap() >= getRuptureDistance())
131  {
132  rupture();
133  }
134  } else {
135  if (getOverlap() >= 0)
136  {
137  form();
138  }
139  }
140 }
bool wasInContact_
A history parameter to store if the particles were in contact or not. Useful to compute adhesive forc...
Mdouble getOverlap() const
Returns a Mdouble with the current overlap between the two interacting objects.
void LiquidMigrationWilletInteraction::actionsOnErase ( )
virtual

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.

Definition at line 73 of file LiquidMigrationWilletInteraction.cc.

References rupture().

void LiquidMigrationWilletInteraction::addLiquidBridgeVolume ( Mdouble  liquidBridgeVolume)

Definition at line 482 of file LiquidMigrationWilletInteraction.cc.

References liquidBridgeVolume_.

Referenced by rupture().

483 {
484  liquidBridgeVolume_ += liquidBridgeVolume;
485 }
void LiquidMigrationWilletInteraction::computeAdhesionForce ( )

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

Definition at line 101 of file LiquidMigrationWilletInteraction.cc.

References BaseInteraction::addForce(), mathsFunc::cos(), LiquidMigrationWilletSpecies::getContactAngle(), BaseInteraction::getEffectiveRadius(), getLiquidBridgeVolume(), BaseInteraction::getNormal(), BaseInteraction::getOverlap(), getSpecies(), LiquidMigrationWilletSpecies::getSurfaceTension(), constants::pi, and wasInContact_.

102 {
103  // Adding no capillary force for liquid bridge volume = 0
104  if (getLiquidBridgeVolume() == 0) return;
105 
106  if (getOverlap() >= 0)
107  {
108  // if particles are in contact
109  const LiquidMigrationWilletSpecies* species = getSpecies();
110  const Mdouble effectiveRadius = 2.0*getEffectiveRadius();
111  const Mdouble fdotn = -2.0 * constants::pi * effectiveRadius * species->getSurfaceTension()
112  * std::cos(species->getContactAngle());
113  addForce(getNormal() * fdotn);
114  } else if (wasInContact_) {
115  // if particles are not in contact, but within their interaction distance
116  const LiquidMigrationWilletSpecies* species = getSpecies();
117  const Mdouble effectiveRadius = 2.0*getEffectiveRadius();
118  const Mdouble s_c = -getOverlap() * std::sqrt(effectiveRadius / getLiquidBridgeVolume());
119  const Mdouble fdotn = -2.0 * constants::pi * effectiveRadius * species->getSurfaceTension()
120  * std::cos(species->getContactAngle()) / (1 + (1.05 + 2.5 * s_c) * s_c);
121  addForce(getNormal() * fdotn);
122  }
123 }
LiquidMigrationWilletSpecies contains the parameters used to describe a short-range force caused by l...
Mdouble getEffectiveRadius() const
Returns a Mdouble to the effective radius of the interaction. (Not corrected for the overlap) ...
double Mdouble
Mdouble getContactAngle() const
used to access the contact angle between particle and liquid bridge surface.
bool wasInContact_
A history parameter to store if the particles were in contact or not. Useful to compute adhesive forc...
Mdouble cos(Mdouble x)
Definition: ExtendedMath.cc:60
const Mdouble pi
Definition: ExtendedMath.h:42
const Vec3D & getNormal() const
Gets the normal vector between the two interacting objects.
Mdouble getOverlap() const
Returns a Mdouble with the current overlap between the two interacting objects.
void addForce(Vec3D force)
add an force increment to the total force.
Mdouble getSurfaceTension() const
used to access the surface tension of the liquid.
const LiquidMigrationWilletSpecies * getSpecies() const
A dynamic_cast of BaseSpecies type pointer to a pointer of type LiquidMigrationWilletSpecies.
void LiquidMigrationWilletInteraction::form ( )
Todo:
: maybe we need to check ghost particles?

Definition at line 142 of file LiquidMigrationWilletInteraction.cc.

References LiquidFilmParticle::addLiquidVolume(), BaseInteraction::getI(), BaseObject::getIndex(), LiquidMigrationWilletSpecies::getLiquidBridgeVolumeMax(), LiquidFilmParticle::getLiquidVolume(), BaseInteraction::getP(), BaseParticle::getPeriodicFromParticle(), getSpecies(), liquidBridgeVolume_, LiquidFilmParticle::setLiquidVolume(), and wasInContact_.

Referenced by actionsAfterTimeStep().

143 {
144  //form a bridge
145  //todo: extend to neighbours
146 
147  wasInContact_ = true;
148  const LiquidMigrationWilletSpecies* species = getSpecies();
149  LiquidFilmParticle* IParticle = dynamic_cast<LiquidFilmParticle*>(getI());
150  LiquidFilmParticle* PParticle = dynamic_cast<LiquidFilmParticle*>(getP());
151  if (IParticle == 0) //if I is a wall
152  {
153  //consider max bridge volume and add the rest to particles
154  if (PParticle->getLiquidVolume() <= species->getLiquidBridgeVolumeMax())
155  {
156  liquidBridgeVolume_ = PParticle->getLiquidVolume();
157  PParticle->setLiquidVolume(0.0);
158  }
159  else
160  {
162  PParticle->setLiquidVolume(PParticle->getLiquidVolume() - species->getLiquidBridgeVolumeMax());
163  }
164  }
165  else if (PParticle == 0) //if P is a wall
166  {
167  //consider max bridge volume and add the rest to particles
168  if (IParticle->getLiquidVolume() <= species->getLiquidBridgeVolumeMax())
169  {
170  liquidBridgeVolume_ = IParticle->getLiquidVolume();
171  IParticle->setLiquidVolume(0.0);
172  }
173  else
174  {
176  IParticle->setLiquidVolume(IParticle->getLiquidVolume() - species->getLiquidBridgeVolumeMax());
177  }
178  }
179  else //if P and I are particles
180  {
181  //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!)
182  LiquidFilmParticle* IParticleReal;
183  if (IParticle->getPeriodicFromParticle())
184  {
185  IParticleReal = dynamic_cast<LiquidFilmParticle*>(IParticle->getPeriodicFromParticle());
186  } else {
187  IParticleReal = IParticle;
188  }
189 
190  Mdouble distributableLiquidVolume =
191  PParticle->getLiquidVolume() + IParticleReal->getLiquidVolume();
192  //assign all liquid of the contacting particles to the bridge,
193  //if the total volume does not exceed LiquidBridgeVolumeMax
195  if (distributableLiquidVolume <= 0)
196  {
197  return;
198  }
199  else if (distributableLiquidVolume <= species->getLiquidBridgeVolumeMax())
200  {
201  liquidBridgeVolume_ = distributableLiquidVolume;
202  if (!IParticle->getPeriodicFromParticle() || PParticle->getIndex()<IParticle->getPeriodicFromParticle()->getIndex())
203  {
204  PParticle->setLiquidVolume(0.0);
205  IParticleReal->setLiquidVolume(0.0);
206  }
207  }
208  else //if the total volume exceeds LiquidBridgeVolumeMax, only distribute the max value
209  {
211  Mdouble pFraction =
212  PParticle->getLiquidVolume() / distributableLiquidVolume;
213  if (!IParticle->getPeriodicFromParticle() || PParticle->getIndex()<IParticle->getPeriodicFromParticle()->getIndex())
214  {
215  PParticle->addLiquidVolume(-pFraction * species->getLiquidBridgeVolumeMax());
216  IParticleReal->addLiquidVolume(-(1.0 - pFraction) * species->getLiquidBridgeVolumeMax());
217  }
218  }
219  }
220 }
unsigned int getIndex() const
Returns the index of the object in the handler.
Definition: BaseObject.cc:108
LiquidMigrationWilletSpecies contains the parameters used to describe a short-range force caused by l...
void addLiquidVolume(Mdouble liquidVolume)
double Mdouble
Mdouble getLiquidBridgeVolumeMax() const
used to access the Volume of the liquid bridge.
bool wasInContact_
A history parameter to store if the particles were in contact or not. Useful to compute adhesive forc...
BaseParticle * getPeriodicFromParticle() const
Returns the 'original' particle this one's a periodic copy of.
void setLiquidVolume(Mdouble liquidVolume)
BaseInteractable * getI()
Mdouble getLiquidVolume() const
BaseInteractable * getP()
Returns a pointer to first object involved in the interaction (normally a particle).
const LiquidMigrationWilletSpecies * getSpecies() const
A dynamic_cast of BaseSpecies type pointer to a pointer of type LiquidMigrationWilletSpecies.
std::string LiquidMigrationWilletInteraction::getBaseName ( ) const

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

Returns
std::string

Definition at line 467 of file LiquidMigrationWilletInteraction.cc.

468 {
469  return "LiquidMigrationWillet";
470 }
Mdouble LiquidMigrationWilletInteraction::getElasticEnergy ( ) const
virtual

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.

Definition at line 450 of file LiquidMigrationWilletInteraction.cc.

451 {
453  return 0.0;
454 }
std::vector< Mdouble > LiquidMigrationWilletInteraction::getFieldVTK ( unsigned  i) const
overridevirtual

Reimplemented from BaseInteraction.

Definition at line 516 of file LiquidMigrationWilletInteraction.cc.

References liquidBridgeVolume_.

516  {
517  return std::vector<Mdouble>(1, cbrt(liquidBridgeVolume_));
518 }
Mdouble LiquidMigrationWilletInteraction::getLiquidBridgeVolume ( ) const
std::string LiquidMigrationWilletInteraction::getNameVTK ( unsigned  i) const
overridevirtual

Reimplemented from BaseInteraction.

Definition at line 511 of file LiquidMigrationWilletInteraction.cc.

511  {
512  return "liquidBridgeRadius";
513 
514 }
int LiquidMigrationWilletInteraction::getNumberOfContacts ( BaseInteractable interactable)

Definition at line 222 of file LiquidMigrationWilletInteraction.cc.

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

Referenced by rupture().

223 {
224  int numContacts = 0;
225  for (auto i : interactable->getInteractions())
226  {
228  LiquidFilmParticle* jIParticle = dynamic_cast<LiquidFilmParticle*>(i->getI());
229  if (j != this && jIParticle != nullptr && j->getLiquidBridgeVolume() != 0.0)
230  numContacts++;
231  }
232  return numContacts;
233 }
Defines the liquid bridge willet interaction between two particles or walls.
const std::list< BaseInteraction * > & getInteractions() const
Returns a reference to the list of interactions in this BaseInteractable.
unsigned LiquidMigrationWilletInteraction::getNumberOfFieldsVTK ( ) const
overridevirtual

writes extra information to the VTK output

Reimplemented from BaseInteraction.

Definition at line 503 of file LiquidMigrationWilletInteraction.cc.

503  {
504  return 1;
505 }
Mdouble LiquidMigrationWilletInteraction::getRuptureDistance ( )

Definition at line 497 of file LiquidMigrationWilletInteraction.cc.

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

Referenced by actionsAfterTimeStep().

498 {
499  const LiquidMigrationWilletSpecies* species = getSpecies();
500  return (1.0 + 0.5 * species->getContactAngle())*cbrt(liquidBridgeVolume_);
501 }
LiquidMigrationWilletSpecies contains the parameters used to describe a short-range force caused by l...
Mdouble getContactAngle() const
used to access the contact angle between particle and liquid bridge surface.
const LiquidMigrationWilletSpecies * getSpecies() const
A dynamic_cast of BaseSpecies type pointer to a pointer of type LiquidMigrationWilletSpecies.
const LiquidMigrationWilletSpecies * LiquidMigrationWilletInteraction::getSpecies ( ) const

A dynamic_cast of BaseSpecies type pointer to a pointer of type LiquidMigrationWilletSpecies.

Returns
const LiquidMigrationWilletSpecies*

Definition at line 459 of file LiquidMigrationWilletInteraction.cc.

References BaseInteraction::getBaseSpecies().

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

460 {
461  return dynamic_cast<const LiquidMigrationWilletSpecies *>(getBaseSpecies());
462 }
LiquidMigrationWilletSpecies contains the parameters used to describe a short-range force caused by l...
const BaseSpecies * getBaseSpecies() const
Return a constant point to BaseSpecies of the interaction.
std::string LiquidMigrationWilletInteraction::getTypeVTK ( unsigned  i) const
overridevirtual

Reimplemented from BaseInteraction.

Definition at line 507 of file LiquidMigrationWilletInteraction.cc.

507  {
508  return "Float32";
509 }
bool LiquidMigrationWilletInteraction::getWasInContact ( ) const

Definition at line 487 of file LiquidMigrationWilletInteraction.cc.

References wasInContact_.

488 {
489  return wasInContact_;
490 }
bool wasInContact_
A history parameter to store if the particles were in contact or not. Useful to compute adhesive forc...
void LiquidMigrationWilletInteraction::read ( std::istream &  is)
virtual

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

Parameters
[in,out]is

Reimplemented from BaseInteraction.

Definition at line 91 of file LiquidMigrationWilletInteraction.cc.

References liquidBridgeVolume_, and wasInContact_.

92 {
93  std::string dummy;
94  is >> dummy >> wasInContact_;
95  is >> dummy >> liquidBridgeVolume_;
96 }
bool wasInContact_
A history parameter to store if the particles were in contact or not. Useful to compute adhesive forc...
void LiquidMigrationWilletInteraction::rupture ( )

Definition at line 235 of file LiquidMigrationWilletInteraction.cc.

References addLiquidBridgeVolume(), LiquidFilmParticle::addLiquidVolume(), LiquidMigrationWilletSpecies::getDistributionCoefficient(), BaseHandler< T >::getDPMBase(), BaseInteraction::getHandler(), BaseInteraction::getI(), BaseInteractable::getInteractions(), getLiquidBridgeVolume(), LiquidMigrationWilletSpecies::getLiquidBridgeVolumeMax(), LiquidFilmParticle::getLiquidVolume(), getNumberOfContacts(), BaseInteraction::getP(), getSpecies(), liquidBridgeVolume_, DPMBase::particleHandler, setLiquidBridgeVolume(), LiquidFilmParticle::setLiquidVolume(), and wasInContact_.

Referenced by actionsAfterTimeStep(), and actionsOnErase().

236 {
237  // remove the contact history
238  wasInContact_ = false;
239 
240  //if the bridge is already empty, do nothing
241  if (getLiquidBridgeVolume() == 0.0)
242  return;
243 
244  //logger(INFO,"rupture % cp % p % i %",getIndex(),getContactPoint(),getP()->getIndex(),getI()->getIndex());
245 
246  //else rupture a bridge
247  const LiquidMigrationWilletSpecies* species = getSpecies();
248  LiquidFilmParticle* IParticle = dynamic_cast<LiquidFilmParticle*>(getI());
249  LiquidFilmParticle* PParticle = dynamic_cast<LiquidFilmParticle*>(getP());
250  if (IParticle == 0) //if I is a wall
251  {
252  int numContactsP = 0;
253  for (auto i : getP()->getInteractions())
254  {
256  if (j != this && j != nullptr && j->getLiquidBridgeVolume() != 0.0)
257  {
258  numContactsP++;
259  }
260 
261  }
262  if (numContactsP > 0)
263  {
264  // Updating new volume with distribution less than critical volume
265  Mdouble ExcessBridgeVolume = 0.0;
266  Mdouble newVolume = liquidBridgeVolume_ *species->getDistributionCoefficient()/ (numContactsP);
267 
268  for (auto i : getP()->getInteractions())
269  {
271  dynamic_cast<LiquidMigrationWilletInteraction*>(i);
272  if (j != this && j != nullptr && j->getLiquidBridgeVolume() != 0.0)
273  {
275  j->getLiquidBridgeVolume() + newVolume);
276  if (j->getLiquidBridgeVolume() >=
277  species->getLiquidBridgeVolumeMax())
278  {
279  ExcessBridgeVolume +=
281  - species->getLiquidBridgeVolumeMax();
283  species->getLiquidBridgeVolumeMax());
284  }
285  }
286  }
287  PParticle->setLiquidVolume(
288  PParticle->getLiquidVolume() + ExcessBridgeVolume + liquidBridgeVolume_ *(1-species->getDistributionCoefficient()));
289 
291  }
292  else
293  {
294  PParticle->setLiquidVolume(PParticle->getLiquidVolume() + liquidBridgeVolume_);
295  }
296  liquidBridgeVolume_ = 0.0;
297  for (auto i : *getHandler())
298  {
300  dynamic_cast<LiquidMigrationWilletInteraction*>(i);
301  }
302  for (auto i : getHandler()->getDPMBase()->particleHandler)
303  {
304  LiquidFilmParticle* j = dynamic_cast<LiquidFilmParticle*>(i);
305  }
306  }
307  else if (PParticle == 0) //if P is a wall
308  {
309  int numContactsI = 0;
310  for (auto i : getI()->getInteractions())
311  {
313  dynamic_cast<LiquidMigrationWilletInteraction*>(i);
314  if (j != this && j != nullptr && j->getLiquidBridgeVolume() != 0.0)
315  numContactsI++;
316  }
317  if (numContactsI > 0)
318  {
319  // Updating new volume with distribution less than critical volume
320  Mdouble ExcessBridgeVolume = 0.0;
321  Mdouble newVolume = liquidBridgeVolume_*species->getDistributionCoefficient() / (numContactsI);
322  for (auto i : getI()->getInteractions())
323  {
325  dynamic_cast<LiquidMigrationWilletInteraction*>(i);
326  if (j != this && j != nullptr && j->getLiquidBridgeVolume() != 0.0)
327  {
329  j->getLiquidBridgeVolume() + newVolume);
330  if (j->getLiquidBridgeVolume() >=
331  species->getLiquidBridgeVolumeMax())
332  {
333  ExcessBridgeVolume += j->getLiquidBridgeVolume()
334  - species->getLiquidBridgeVolumeMax();
336  }
337  }
338  }
339  IParticle->setLiquidVolume(IParticle->getLiquidVolume() + ExcessBridgeVolume + liquidBridgeVolume_ *(1-species->getDistributionCoefficient()));
340 
342  }
343  else
344  {
345  IParticle->setLiquidVolume(IParticle->getLiquidVolume() + liquidBridgeVolume_);
346  }
347  liquidBridgeVolume_ = 0.0;
348  }
349  else //if P and I are particles
350  {
351  //count interaction partners of p (this contact, ghosts and interaction without liquid bridge dont count)
352  int numContactsP = getNumberOfContacts(getP());
353  if (numContactsP < 1) //if P has only one contact (the one that gets ruptured), pass the fluid into it)
354  {
355  PParticle->addLiquidVolume(0.5 * liquidBridgeVolume_);
356  }
357  else //if P has only multiple contacts pass the fluid into it)
358  {
359  // move fluid to neighbouring contacts
360  Mdouble perContactVolume = 0.5 * liquidBridgeVolume_*species->getDistributionCoefficient() / numContactsP;
361  for (auto i : getP()->getInteractions())
362  {
364  dynamic_cast<LiquidMigrationWilletInteraction*>(i);
365  LiquidFilmParticle* jIParticle =
366  dynamic_cast<LiquidFilmParticle*>(i->getI());
367  if (j != this && jIParticle != nullptr && j->getLiquidBridgeVolume() != 0.0)
368  {
369  Mdouble excessVolume = perContactVolume - (species->getLiquidBridgeVolumeMax() - j->getLiquidBridgeVolume());
370  if (excessVolume < 0.0)
371  {
372  j->addLiquidBridgeVolume(perContactVolume);
373  PParticle->addLiquidVolume(0.5 * liquidBridgeVolume_*(1-species->getDistributionCoefficient()) / numContactsP);
374  }
375  else
376  {
378  PParticle->addLiquidVolume(excessVolume);
379  PParticle->addLiquidVolume(0.5 * liquidBridgeVolume_*(1-species->getDistributionCoefficient()) / numContactsP);
380  }
381  }
382  }
383  Mdouble PParticle_fin = PParticle->getLiquidVolume();
384 
385  }
386 
387  //count interaction partners of i (ghosts and interaction without liquid bridge dont count)
388  int numContactsI = getNumberOfContacts(getI());
389  if (numContactsI < 1)
390  {
391  IParticle->addLiquidVolume(0.5 * liquidBridgeVolume_);
392  //std::cout << "added " << 0.5 * liquidBridgeVolume_
393  // << " to particle #" << IParticle->getIndex()
394  //<< ", V=" << IParticle->getLiquidVolume() << std::endl;
395  }
396  else
397  {
398  // move fluid to neighbouring contacts
399  Mdouble perContactVolume = 0.5 * liquidBridgeVolume_*species->getDistributionCoefficient() / (numContactsI);
400  for (BaseInteraction* i : getI()->getInteractions())
401  {
403  LiquidFilmParticle* jIParticle = dynamic_cast<LiquidFilmParticle*>(i->getI());
404  if (j != this && jIParticle != nullptr && j->getLiquidBridgeVolume() != 0.0)
405  {
406  Mdouble excessVolume =
407  perContactVolume
408  - species->getLiquidBridgeVolumeMax()
409  + j->getLiquidBridgeVolume();
410  if (excessVolume < 0.0)
411  {
412  j->addLiquidBridgeVolume(perContactVolume);
413  IParticle->addLiquidVolume(0.5 * liquidBridgeVolume_*(1-species->getDistributionCoefficient()) / (numContactsI));
414  }
415  else
416  {
417  //std::cout << "excess i-Volume " << excessVolume << std::endl;
419  IParticle->addLiquidVolume(excessVolume);
420  IParticle->addLiquidVolume(0.5 * liquidBridgeVolume_*(1-species->getDistributionCoefficient()) / (numContactsI));
421  }
422  //~ std::cout << "added " << perContactVolume
423  //~ << " to i-contact #" << j->getIndex()
424  //~ << ", V=" << j->getLiquidBridgeVolume() << std::endl;
425  }
426  }
427  }
428 
429  //~ std::cout << "ruptured liquid bridge #" << getId()
430  //~ << " between particles #"
431  //~ << PParticle->getIndex()
432  //~ << " and #"
433  //~ << IParticle->getIndex()
434  //~ << ": V" << liquidBridgeVolume_
435  //~ << " -> Vp" << PParticle->getLiquidVolume()
436  //~ << " Vi" << IParticle->getLiquidVolume()
437  //~ << " Np" << numContactsP
438  //~ << " Ni" << numContactsI
439  //~ << std::endl;
440 
441  //to balance the added volume, remove the liquid from the bridge
442  liquidBridgeVolume_ = 0.0;
443 
444  }
445 }
LiquidMigrationWilletSpecies contains the parameters used to describe a short-range force caused by l...
int getNumberOfContacts(BaseInteractable *interactable)
Defines the liquid bridge willet interaction between two particles or walls.
void addLiquidVolume(Mdouble liquidVolume)
InteractionHandler * getHandler() const
Gets a point to the interaction handlers to which this interaction belongs.
double Mdouble
Stores information about interactions between two interactable objects; often particles but could be ...
Mdouble getLiquidBridgeVolumeMax() const
used to access the Volume of the liquid bridge.
bool wasInContact_
A history parameter to store if the particles were in contact or not. Useful to compute adhesive forc...
Mdouble getDistributionCoefficient() const
used to access the surface tension of the liquid.
ParticleHandler particleHandler
An object of the class ParticleHandler, contains the pointers to all the particles created...
Definition: DPMBase.h:1001
void setLiquidVolume(Mdouble liquidVolume)
void addLiquidBridgeVolume(Mdouble liquidBridgeVolume)
BaseInteractable * getI()
Mdouble getLiquidVolume() const
void setLiquidBridgeVolume(Mdouble liquidBridgeVolume)
const std::list< BaseInteraction * > & getInteractions() const
Returns a reference to the list of interactions in this BaseInteractable.
BaseInteractable * getP()
Returns a pointer to first object involved in the interaction (normally a particle).
DPMBase * getDPMBase()
Gets the problem that is solved using this handler.
Definition: BaseHandler.h:543
const LiquidMigrationWilletSpecies * getSpecies() const
A dynamic_cast of BaseSpecies type pointer to a pointer of type LiquidMigrationWilletSpecies.
void LiquidMigrationWilletInteraction::setLiquidBridgeVolume ( Mdouble  liquidBridgeVolume)

Definition at line 477 of file LiquidMigrationWilletInteraction.cc.

References liquidBridgeVolume_.

Referenced by rupture().

478 {
479  liquidBridgeVolume_ = liquidBridgeVolume;
480 }
void LiquidMigrationWilletInteraction::setWasInContact ( bool  wasInContact)

Definition at line 492 of file LiquidMigrationWilletInteraction.cc.

References wasInContact_.

493 {
494  wasInContact_ = wasInContact;
495 }
bool wasInContact_
A history parameter to store if the particles were in contact or not. Useful to compute adhesive forc...
void LiquidMigrationWilletInteraction::write ( std::ostream &  os) const
virtual

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

Parameters
[in,out]os

Reimplemented from BaseInteraction.

Definition at line 81 of file LiquidMigrationWilletInteraction.cc.

References liquidBridgeVolume_, and wasInContact_.

82 {
83  os
84  << " wasInContact " << wasInContact_
85  << " liquidBridgeVolume " << liquidBridgeVolume_;
86 }
bool wasInContact_
A history parameter to store if the particles were in contact or not. Useful to compute adhesive forc...

Member Data Documentation

bool LiquidMigrationWilletInteraction::wasInContact_
private

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

Definition at line 123 of file LiquidMigrationWilletInteraction.h.

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


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