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, unsigned timeStamp)
 Constructor. More...
 
 LiquidMigrationWilletInteraction ()
 
 LiquidMigrationWilletInteraction (const LiquidMigrationWilletInteraction &p)
 Copy constructor. More...
 
 ~LiquidMigrationWilletInteraction () 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 Willet 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 LiquidMigrationWilletSpeciesgetSpecies () const
 Returns a pointer to the adhesive force species 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
 
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 willet interaction between two particles or walls.

Member Typedef Documentation

◆ SpeciesType

An alias name for LiquidMigrationWilletSpecies data type.

Constructor & Destructor Documentation

◆ LiquidMigrationWilletInteraction() [1/3]

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

Constructor.

Parameters
[in]P
[in]I
[in]timeStamp
42  : BaseInteraction(P, I, timeStamp)
43 {
44  liquidBridgeVolume_ = 0.0;
45  wasInContact_ = false;
46 #ifdef DEBUG_CONSTRUCTOR
47  std::cout << "LiquidMigrationWilletInteraction::LiquidMigrationWilletInteraction() finished" << std::endl;
48 #endif
49 }
BaseInteraction()
Definition: BaseInteraction.cc:65
Mdouble liquidBridgeVolume_
Definition: LiquidMigrationWilletInteraction.h:145
bool wasInContact_
A history parameter to store if the particles were in contact or not. Useful to compute adhesive forc...
Definition: LiquidMigrationWilletInteraction.h:143
double P
Uniform pressure.
Definition: TwenteMeshGluing.cpp:73

References liquidBridgeVolume_, and wasInContact_.

◆ LiquidMigrationWilletInteraction() [2/3]

LiquidMigrationWilletInteraction::LiquidMigrationWilletInteraction ( )
53  : BaseInteraction()
54 {
55  liquidBridgeVolume_ = 0.0;
56  wasInContact_ = false;
57 #ifdef DEBUG_CONSTRUCTOR
58  std::cout << "LiquidMigrationWilletInteraction::LiquidMigrationWilletInteraction() finished" << std::endl;
59 #endif
60 }

References liquidBridgeVolume_, and wasInContact_.

◆ LiquidMigrationWilletInteraction() [3/3]

LiquidMigrationWilletInteraction::LiquidMigrationWilletInteraction ( const LiquidMigrationWilletInteraction p)

Copy constructor.

Parameters
[in]p
66  : BaseInteraction(p)
67 {
70 #ifdef DEBUG_CONSTRUCTOR
71  std::cout << "LiquidMigrationWilletInteraction::LiquidMigrationWilletInteraction(const LiquidMigrationWilletInteraction &p finished" << std::endl;
72 #endif
73 }

References liquidBridgeVolume_, and wasInContact_.

◆ ~LiquidMigrationWilletInteraction()

LiquidMigrationWilletInteraction::~LiquidMigrationWilletInteraction ( )
override

Destructor.

79 {
80 #ifdef DEBUG_DESTRUCTOR
81  std::cout << "LiquidMigrationWilletInteraction::~LiquidMigrationWilletInteraction() finished" << std::endl;
82 #endif
83 }

Member Function Documentation

◆ actionsAfterTimeStep()

void LiquidMigrationWilletInteraction::actionsAfterTimeStep ( )
overridevirtual

test if particle needs to be ruptured

Reimplemented from BaseInteraction.

141 {
142  if (wasInContact_)
143  {
144  if (-getOverlap() >= getRuptureDistance())
145  {
146  rupture();
147  }
148  }
149  else
150  {
151  if (getOverlap() >= 0)
152  {
153  form();
154  }
155  }
156 }
Mdouble getOverlap() const
Returns a Mdouble with the current overlap between the two interacting objects.
Definition: BaseInteraction.h:240
void rupture()
Definition: LiquidMigrationWilletInteraction.cc:253
void form()
Definition: LiquidMigrationWilletInteraction.cc:158
Mdouble getRuptureDistance()
Definition: LiquidMigrationWilletInteraction.cc:487

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

◆ actionsOnErase()

void LiquidMigrationWilletInteraction::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.

86 {
87  rupture();
88 };

References rupture().

◆ addLiquidBridgeVolume()

void LiquidMigrationWilletInteraction::addLiquidBridgeVolume ( Mdouble  liquidBridgeVolume)
473 {
474  liquidBridgeVolume_ += liquidBridgeVolume;
475 }

References liquidBridgeVolume_.

Referenced by rupture().

◆ computeAdhesionForce()

void LiquidMigrationWilletInteraction::computeAdhesionForce ( )

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

114 {
115  // Adding no capillary force for liquid bridge volume = 0
116  if (getLiquidBridgeVolume() == 0) return;
117 
118  if (getOverlap() >= 0)
119  {
120  // if particles are in contact
121  const LiquidMigrationWilletSpecies* species = getSpecies();
122  const Mdouble effectiveRadius = 2.0 * getEffectiveRadius();
123  const Mdouble fdotn = -2.0 * constants::pi * effectiveRadius * species->getSurfaceTension()
124  * std::cos(species->getContactAngle());
125  addForce(getNormal() * fdotn);
126  }
127  else if (wasInContact_)
128  {
129  // if particles are not in contact, but within their interaction distance
130  const LiquidMigrationWilletSpecies* species = getSpecies();
131  const Mdouble effectiveRadius = 2.0 * getEffectiveRadius();
132  const Mdouble s_c = -getOverlap() * std::sqrt(effectiveRadius / getLiquidBridgeVolume());
133  const Mdouble fdotn = -2.0 * constants::pi * effectiveRadius * species->getSurfaceTension()
134  * std::cos(species->getContactAngle()) / (1 + (1.05 + 2.5 * s_c) * s_c);
135  addForce(getNormal() * fdotn);
136  }
137 }
double Mdouble
Definition: GeneralDefine.h:34
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 getEffectiveRadius() const
Returns a Mdouble to the effective radius of the interaction. (Not corrected for the overlap)
Definition: BaseInteraction.cc:793
Mdouble getLiquidBridgeVolume() const
Definition: LiquidMigrationWilletInteraction.cc:462
const LiquidMigrationWilletSpecies * getSpecies() const
Returns a pointer to the adhesive force species LiquidMigrationWilletSpecies.
Definition: LiquidMigrationWilletInteraction.cc:448
LiquidMigrationWilletSpecies contains the parameters used to describe a short-range force caused by l...
Definition: LiquidMigrationWilletSpecies.h:38
Mdouble getContactAngle() const
used to access the contact angle between particle and liquid bridge surface.
Definition: LiquidMigrationWilletSpecies.cc:209
Mdouble getSurfaceTension() const
used to access the surface tension of the liquid.
Definition: LiquidMigrationWilletSpecies.cc:185
const Mdouble pi
Definition: ExtendedMath.h:45
Mdouble cos(Mdouble x)
Definition: ExtendedMath.cc:64

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

◆ form()

void LiquidMigrationWilletInteraction::form ( )
Todo:
: maybe we need to check ghost particles?
159 {
160  //form a bridge
161  //todo: extend to neighbours
162 
163  wasInContact_ = true;
164  const LiquidMigrationWilletSpecies* species = getSpecies();
165  LiquidFilmParticle* IParticle = dynamic_cast<LiquidFilmParticle*>(getI());
166  LiquidFilmParticle* PParticle = dynamic_cast<LiquidFilmParticle*>(getP());
167  if (PParticle == nullptr) //if P is a wall
168  {
169  logger(ERROR,"In LiquidMigrationWilletInteraction::form, P should be a particle");
170  }
171  else if (IParticle == nullptr) //if I is a wall
172  {
173  //do not form bridge if the volume is below minimum
174  if (PParticle->getLiquidVolume() < species->getLiquidBridgeVolumeMin())
175  {
176  return;
177  }
178  //if below max bridge volume, move all liquid from film to volume
179  else if (PParticle->getLiquidVolume() <= species->getLiquidBridgeVolumeMax())
180  {
181  liquidBridgeVolume_ = PParticle->getLiquidVolume();
182  PParticle->setLiquidVolume(0.0);
183  }
184  //if above max bridge volume, fill the liquid bridge and keep the rest of the liquid in the particle
185  else
186  {
188  PParticle->setLiquidVolume(PParticle->getLiquidVolume() - species->getLiquidBridgeVolumeMax());
189  }
190 // if (liquidBridgeVolume_) logger(INFO,"Forming liquid bridge of volume % between particles % and wall %",liquidBridgeVolume_,getP()->getId(),getI()->getId());
191  }
192  else //if P and I are particles
193  {
194  //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!)
195  LiquidFilmParticle* IParticleReal;
196  if (IParticle->getPeriodicFromParticle())
197  {
198  IParticleReal = dynamic_cast<LiquidFilmParticle*>(IParticle->getPeriodicFromParticle());
199  }
200  else
201  {
202  IParticleReal = IParticle;
203  }
204 
205  Mdouble distributableLiquidVolume =
206  PParticle->getLiquidVolume() + IParticleReal->getLiquidVolume();
207  //assign all liquid of the contacting particles to the bridge,
208  //if the total volume does not exceed LiquidBridgeVolumeMax
210  if (distributableLiquidVolume <= species->getLiquidBridgeVolumeMin())
211  {
212  return;
213  }
214  else if (distributableLiquidVolume <= species->getLiquidBridgeVolumeMax())
215  {
216  liquidBridgeVolume_ = distributableLiquidVolume;
217  if (!IParticle->getPeriodicFromParticle() ||
218  PParticle->getIndex() < IParticle->getPeriodicFromParticle()->getIndex())
219  {
220  PParticle->setLiquidVolume(0.0);
221  IParticleReal->setLiquidVolume(0.0);
222  }
223  }
224  else //if the total volume exceeds LiquidBridgeVolumeMax, only distribute the max value
225  {
227  Mdouble pFraction =
228  PParticle->getLiquidVolume() / distributableLiquidVolume;
229  if (!IParticle->getPeriodicFromParticle() ||
230  PParticle->getIndex() < IParticle->getPeriodicFromParticle()->getIndex())
231  {
232  PParticle->addLiquidVolume(-pFraction * species->getLiquidBridgeVolumeMax());
233  IParticleReal->addLiquidVolume(-(1.0 - pFraction) * species->getLiquidBridgeVolumeMax());
234  }
235  }
236 // 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());
237  }
238 }
Logger< MERCURYDPM_LOGLEVEL > logger("MercuryKernel")
Definition of different loggers with certain modules. A user can define its own custom logger here.
@ 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: LiquidMigrationWilletSpecies.cc:142
Mdouble getLiquidBridgeVolumeMax() const
used to access the Volume of the liquid bridge.
Definition: LiquidMigrationWilletSpecies.cc:137

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

Referenced by actionsAfterTimeStep().

◆ getBaseName()

std::string LiquidMigrationWilletInteraction::getBaseName ( ) const

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

Returns
std::string
458 {
459  return "LiquidMigrationWillet";
460 }

◆ getElasticEnergy()

Mdouble LiquidMigrationWilletInteraction::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.

440 {
442  return 0.0;
443 }

◆ getFieldVTK()

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

Reimplemented from BaseInteraction.

510 {
511  return std::vector<Mdouble>(1, cbrt(liquidBridgeVolume_));
512 }

References liquidBridgeVolume_.

◆ getLiquidBridgeVolume()

◆ getNameVTK()

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

Reimplemented from BaseInteraction.

504 {
505  return "liquidBridgeRadius";
506 
507 }

◆ getNumberOfContacts()

int LiquidMigrationWilletInteraction::getNumberOfContacts ( BaseInteractable interactable)
241 {
242  int numContacts = 0;
243  for (auto i : interactable->getInteractions())
244  {
246  LiquidFilmParticle* jIParticle = dynamic_cast<LiquidFilmParticle*>(i->getI());
247  if (j != this && jIParticle != nullptr && j->getLiquidBridgeVolume() != 0.0)
248  numContacts++;
249  }
250  return numContacts;
251 }
const std::vector< BaseInteraction * > & getInteractions() const
Returns a list of interactions which belong to this interactable.
Definition: BaseInteractable.h:277
Defines the liquid bridge willet interaction between two particles or walls.
Definition: LiquidMigrationWilletInteraction.h:45
const std::complex< Mdouble > i
Definition: ExtendedMath.h:51

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

Referenced by rupture().

◆ getNumberOfFieldsVTK()

unsigned LiquidMigrationWilletInteraction::getNumberOfFieldsVTK ( ) const
overridevirtual

writes extra information to the VTK output

Reimplemented from BaseInteraction.

494 {
495  return 1;
496 }

◆ getRuptureDistance()

Mdouble LiquidMigrationWilletInteraction::getRuptureDistance ( )
488 {
489  const LiquidMigrationWilletSpecies* species = getSpecies();
490  return (1.0 + 0.5 * species->getContactAngle()) * cbrt(liquidBridgeVolume_);
491 }

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

Referenced by actionsAfterTimeStep().

◆ getSpecies()

const LiquidMigrationWilletSpecies * LiquidMigrationWilletInteraction::getSpecies ( ) const

Returns a pointer to the adhesive force species LiquidMigrationWilletSpecies.

Returns
const LiquidMigrationWilletSpecies*
449 {
450  return static_cast<const LiquidMigrationWilletSpecies*>(getBaseSpecies()->getAdhesiveForce());
451 ;
452 }
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(), getRuptureDistance(), and rupture().

◆ getTotalLiquidBridgeVolume()

Mdouble LiquidMigrationWilletInteraction::getTotalLiquidBridgeVolume ( InteractionHandler h)
static
529 {
530  Mdouble volume = 0;
531  for (auto i : h)
532  {
533  auto l = dynamic_cast<LiquidMigrationWilletInteraction*>(i);
534  if (l)
535  {
536  volume += l->getLiquidBridgeVolume();
537  }
538  }
539  return volume;
540 }

References constants::i.

◆ getTotalLiquidFilmVolume()

Mdouble LiquidMigrationWilletInteraction::getTotalLiquidFilmVolume ( ParticleHandler h)
static
515 {
516  Mdouble volume = 0;
517  for (auto p : h)
518  {
519  auto l = dynamic_cast<LiquidFilmParticle*>(p);
520  if (l)
521  {
522  volume += l->getLiquidVolume();
523  }
524  }
525  return volume;
526 }

◆ getTypeVTK()

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

Reimplemented from BaseInteraction.

499 {
500  return "Float32";
501 }

◆ getWasInContact()

bool LiquidMigrationWilletInteraction::getWasInContact ( ) const
478 {
479  return wasInContact_;
480 }

References wasInContact_.

◆ read()

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

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

Parameters
[in,out]is

Implements BaseObject.

104 {
105  std::string dummy;
106  is >> dummy >> wasInContact_;
107  is >> dummy >> liquidBridgeVolume_;
108 }

References liquidBridgeVolume_, and wasInContact_.

◆ rupture()

void LiquidMigrationWilletInteraction::rupture ( )
254 {
255  // remove the contact history
256  wasInContact_ = false;
257 
258  //if the bridge is already empty, do nothing
259  if (getLiquidBridgeVolume() == 0.0)
260  return;
261 
262  //else rupture a bridge
263  const LiquidMigrationWilletSpecies* species = getSpecies();
264  LiquidFilmParticle* IParticle = dynamic_cast<LiquidFilmParticle*>(getI());
265  LiquidFilmParticle* PParticle = dynamic_cast<LiquidFilmParticle*>(getP());
266  if (IParticle == nullptr) //if I is a wall
267  {
268  int numContactsP = 0;
269  for (auto i : getP()->getInteractions())
270  {
272  if (j != this && j != nullptr && j->getLiquidBridgeVolume() != 0.0)
273  {
274  numContactsP++;
275  }
276 
277  }
278 // logger(INFO,"Rupturing liquid bridge of volume % between particles % and wall % (numContacts %)",liquidBridgeVolume_,getP()->getId(),getI()->getId(),numContactsP);
279  if (numContactsP > 0)
280  {
281  // Updating new volume with distribution less than critical volume
282  Mdouble ExcessBridgeVolume = 0.0;
283  Mdouble newVolume = liquidBridgeVolume_ * species->getDistributionCoefficient() / (numContactsP);
284 
285  for (auto i : getP()->getInteractions())
286  {
288  dynamic_cast<LiquidMigrationWilletInteraction*>(i);
289  if (j != this && j != nullptr && j->getLiquidBridgeVolume() != 0.0)
290  {
292  j->getLiquidBridgeVolume() + newVolume);
293  if (j->getLiquidBridgeVolume() >=
294  species->getLiquidBridgeVolumeMax())
295  {
296  ExcessBridgeVolume +=
298  - species->getLiquidBridgeVolumeMax();
300  species->getLiquidBridgeVolumeMax());
301  }
302  }
303  }
304  PParticle->setLiquidVolume(
305  PParticle->getLiquidVolume() + ExcessBridgeVolume +
307 
309  }
310  else
311  {
312  PParticle->setLiquidVolume(PParticle->getLiquidVolume() + liquidBridgeVolume_);
313  }
314  liquidBridgeVolume_ = 0.0;
315  //for (auto i : *getHandler())
316  //{
317  // LiquidMigrationWilletInteraction* j =
318  // dynamic_cast<LiquidMigrationWilletInteraction*>(i);
319  //}
320  //for (auto i : getHandler()->getDPMBase()->particleHandler)
321  //{
322  // LiquidFilmParticle* j = dynamic_cast<LiquidFilmParticle*>(i);
323  //}
324  }
325  else if (PParticle == nullptr) //if P is a wall
326  {
327  logger(ERROR,"this should not happen");
328  }
329  else //if P and I are particles
330  {
331  //count interaction partners of p (this contact, ghosts and interaction without liquid bridge dont count)
332  int numContactsP = getNumberOfContacts(getP());
333 // logger(INFO,"Rupturing liquid bridge of volume % between particles % and % (numContacts %, MPI %%, overlap %)",liquidBridgeVolume_,getP()->getId(),getI()->getId(),numContactsP,PParticle->isMPIParticle(),IParticle->isMPIParticle(),getOverlap());
334  if (numContactsP < 1) //if P has only one contact (the one that gets ruptured), pass the fluid into it)
335  {
336  PParticle->addLiquidVolume(0.5 * liquidBridgeVolume_);
337  }
338  else //if P has only multiple contacts pass the fluid into it)
339  {
340  // move fluid to neighbouring contacts
341  Mdouble perContactVolume = 0.5 * liquidBridgeVolume_ * species->getDistributionCoefficient() / numContactsP;
342  for (auto i : getP()->getInteractions())
343  {
345  dynamic_cast<LiquidMigrationWilletInteraction*>(i);
346  LiquidFilmParticle* jIParticle =
347  dynamic_cast<LiquidFilmParticle*>(i->getI());
348  if (j != this && jIParticle != nullptr && j->getLiquidBridgeVolume() != 0.0)
349  {
350  Mdouble excessVolume =
351  perContactVolume - (species->getLiquidBridgeVolumeMax() - j->getLiquidBridgeVolume());
352  if (excessVolume < 0.0)
353  {
354  j->addLiquidBridgeVolume(perContactVolume);
355  PParticle->addLiquidVolume(
356  0.5 * liquidBridgeVolume_ * (1 - species->getDistributionCoefficient()) / numContactsP);
357  }
358  else
359  {
361  PParticle->addLiquidVolume(excessVolume);
362  PParticle->addLiquidVolume(
363  0.5 * liquidBridgeVolume_ * (1 - species->getDistributionCoefficient()) / numContactsP);
364  }
365  }
366  }
367  //Mdouble PParticle_fin = PParticle->getLiquidVolume();
368 
369  }
370 
371  //count interaction partners of i (ghosts and interaction without liquid bridge dont count)
372  int numContactsI = getNumberOfContacts(getI());
373  if (numContactsI < 1)
374  {
375  IParticle->addLiquidVolume(0.5 * liquidBridgeVolume_);
376  //std::cout << "added " << 0.5 * liquidBridgeVolume_
377  // << " to particle #" << IParticle->getIndex()
378  //<< ", V=" << IParticle->getLiquidVolume() << std::endl;
379  }
380  else
381  {
382  // move fluid to neighbouring contacts
383  Mdouble perContactVolume =
384  0.5 * liquidBridgeVolume_ * species->getDistributionCoefficient() / (numContactsI);
385  for (BaseInteraction* i : getI()->getInteractions())
386  {
388  LiquidFilmParticle* jIParticle = dynamic_cast<LiquidFilmParticle*>(i->getI());
389  if (j != this && jIParticle != nullptr && j->getLiquidBridgeVolume() != 0.0)
390  {
391  Mdouble excessVolume =
392  perContactVolume
393  - species->getLiquidBridgeVolumeMax()
394  + j->getLiquidBridgeVolume();
395  if (excessVolume < 0.0)
396  {
397  j->addLiquidBridgeVolume(perContactVolume);
398  IParticle->addLiquidVolume(
399  0.5 * liquidBridgeVolume_ * (1 - species->getDistributionCoefficient()) /
400  (numContactsI));
401  }
402  else
403  {
404  //std::cout << "excess i-Volume " << excessVolume << std::endl;
406  IParticle->addLiquidVolume(excessVolume);
407  IParticle->addLiquidVolume(
408  0.5 * liquidBridgeVolume_ * (1 - species->getDistributionCoefficient()) /
409  (numContactsI));
410  }
411  //~ std::cout << "added " << perContactVolume
412  //~ << " to i-contact #" << j->getIndex()
413  //~ << ", V=" << j->getLiquidBridgeVolume() << std::endl;
414  }
415  }
416  }
417 
418  //~ std::cout << "ruptured liquid bridge #" << getId()
419  //~ << " between particles #"
420  //~ << PParticle->getIndex()
421  //~ << " and #"
422  //~ << IParticle->getIndex()
423  //~ << ": V" << liquidBridgeVolume_
424  //~ << " -> Vp" << PParticle->getLiquidVolume()
425  //~ << " Vi" << IParticle->getLiquidVolume()
426  //~ << " Np" << numContactsP
427  //~ << " Ni" << numContactsI
428  //~ << std::endl;
429 
430  //to balance the added volume, remove the liquid from the bridge
431  liquidBridgeVolume_ = 0.0;
432 
433  }
434 }
Stores information about interactions between two interactable objects; often particles but could be ...
Definition: BaseInteraction.h:60
int getNumberOfContacts(BaseInteractable *interactable)
Definition: LiquidMigrationWilletInteraction.cc:240
void setLiquidBridgeVolume(Mdouble liquidBridgeVolume)
Definition: LiquidMigrationWilletInteraction.cc:467
void addLiquidBridgeVolume(Mdouble liquidBridgeVolume)
Definition: LiquidMigrationWilletInteraction.cc:472
Mdouble getDistributionCoefficient() const
used to access the surface tension of the liquid.
Definition: LiquidMigrationWilletSpecies.cc:163

References addLiquidBridgeVolume(), LiquidFilm< Particle >::addLiquidVolume(), ERROR, LiquidMigrationWilletSpecies::getDistributionCoefficient(), BaseInteraction::getI(), BaseInteractable::getInteractions(), getLiquidBridgeVolume(), LiquidMigrationWilletSpecies::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 LiquidMigrationWilletInteraction::setLiquidBridgeVolume ( Mdouble  liquidBridgeVolume)
468 {
469  liquidBridgeVolume_ = liquidBridgeVolume;
470 }

References liquidBridgeVolume_.

Referenced by HeatFluidCoupledSpecies< NormalForceSpecies >::actionsAfterTimeStep(), and rupture().

◆ setWasInContact()

void LiquidMigrationWilletInteraction::setWasInContact ( bool  wasInContact)
483 {
484  wasInContact_ = wasInContact;
485 }

References wasInContact_.

◆ write()

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

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

Parameters
[in,out]os

Implements BaseObject.

94 {
95  os
96  << " wasInContact " << wasInContact_
97  << " liquidBridgeVolume " << liquidBridgeVolume_;
98 }

References liquidBridgeVolume_, and wasInContact_.

Member Data Documentation

◆ liquidBridgeVolume_

◆ wasInContact_

bool LiquidMigrationWilletInteraction::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(), LiquidMigrationWilletInteraction(), read(), rupture(), setWasInContact(), and write().


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