MercuryDPM  Trunk
 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, 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
LiquidMigrationWilletSpecies
getSpecies () 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
 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, 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. 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 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 setForce (Vec3D force)
 set total force (this is used by the normal force, tangential forces are added use addForce) 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 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...
 
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.

Definition at line 44 of file LiquidMigrationWilletInteraction.h.

Member Typedef Documentation

Constructor & Destructor Documentation

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

Constructor.

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

Definition at line 40 of file LiquidMigrationWilletInteraction.cc.

References liquidBridgeVolume_, and wasInContact_.

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 }
bool wasInContact_
A history parameter to store if the particles were in contact or not. Useful to compute adhesive forc...
LiquidMigrationWilletInteraction::LiquidMigrationWilletInteraction ( )

Definition at line 52 of file LiquidMigrationWilletInteraction.cc.

References liquidBridgeVolume_, and wasInContact_.

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 }
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 65 of file LiquidMigrationWilletInteraction.cc.

References liquidBridgeVolume_, and wasInContact_.

66  : BaseInteraction(p)
67 {
70 #ifdef DEBUG_CONSTRUCTOR
71  std::cout << "LiquidMigrationWilletInteraction::LiquidMigrationWilletInteraction(const LiquidMigrationWilletInteraction &p finished" << std::endl;
72 #endif
73 }
bool wasInContact_
A history parameter to store if the particles were in contact or not. Useful to compute adhesive forc...
LiquidMigrationWilletInteraction::~LiquidMigrationWilletInteraction ( )
override

Destructor.

Definition at line 78 of file LiquidMigrationWilletInteraction.cc.

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

Member Function Documentation

void LiquidMigrationWilletInteraction::actionsAfterTimeStep ( )
overridevirtual

test if particle needs to be ruptured

Reimplemented from BaseInteraction.

Definition at line 140 of file LiquidMigrationWilletInteraction.cc.

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

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 }
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 ( )
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.

Definition at line 85 of file LiquidMigrationWilletInteraction.cc.

References rupture().

void LiquidMigrationWilletInteraction::addLiquidBridgeVolume ( Mdouble  liquidBridgeVolume)

Definition at line 472 of file LiquidMigrationWilletInteraction.cc.

References liquidBridgeVolume_.

Referenced by rupture().

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

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

Definition at line 113 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_.

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 }
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
Definition: GeneralDefine.h:34
Mdouble getContactAngle() const
used to access the contact angle between particle and liquid bridge surface.
const Vec3D & getNormal() const
Gets the normal vector between the two interacting objects.
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:64
const Mdouble pi
Definition: ExtendedMath.h:45
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
Returns a pointer to the adhesive force species LiquidMigrationWilletSpecies.
void LiquidMigrationWilletInteraction::form ( )
Todo:
: maybe we need to check ghost particles?

Definition at line 158 of file LiquidMigrationWilletInteraction.cc.

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

Referenced by actionsAfterTimeStep().

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 (IParticle == nullptr) //if I is a wall
168  {
169  //do not form bridge if the volume is below minimum
170  if (PParticle->getLiquidVolume() < species->getLiquidBridgeVolumeMin())
171  {
172  return;
173  }
174  //if below max bridge volume, move all liquid from film to volume
175  else if (PParticle->getLiquidVolume() <= species->getLiquidBridgeVolumeMax())
176  {
177  liquidBridgeVolume_ = PParticle->getLiquidVolume();
178  PParticle->setLiquidVolume(0.0);
179  }
180  //if above max bridge volume, fill the liquid bridge and keep the rest of the liquid in the particle
181  else
182  {
184  PParticle->setLiquidVolume(PParticle->getLiquidVolume() - species->getLiquidBridgeVolumeMax());
185  }
186 // if (liquidBridgeVolume_) logger(INFO,"Forming liquid bridge of volume % between particles % and wall %",liquidBridgeVolume_,getP()->getId(),getI()->getId());
187  }
188  else if (PParticle == nullptr) //if P is a wall
189  {
190  logger(ERROR,"Should not happen");
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 }
unsigned int getIndex() const
Returns the index of the object in the handler.
Definition: BaseObject.h:118
LiquidMigrationWilletSpecies contains the parameters used to describe a short-range force caused by l...
void addLiquidVolume(Mdouble liquidVolume)
Logger< MERCURY_LOGLEVEL > logger("MercuryKernel")
double Mdouble
Definition: GeneralDefine.h:34
Mdouble getLiquidBridgeVolumeMin() const
used to access the Volume of the liquid bridge.
BaseParticle * getPeriodicFromParticle() const
Returns the 'original' particle this one's a periodic copy of.
Definition: BaseParticle.h:338
BaseInteractable * getI()
Returns a pointer to the second object involved in the interaction (often a wall or a particle)...
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...
BaseInteractable * getP()
Returns a pointer to first object involved in the interaction (normally a particle).
void setLiquidVolume(Mdouble liquidVolume)
Mdouble getLiquidVolume() const
const LiquidMigrationWilletSpecies * getSpecies() const
Returns a pointer to the adhesive force species LiquidMigrationWilletSpecies.
std::string LiquidMigrationWilletInteraction::getBaseName ( ) const

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

Returns
std::string

Definition at line 457 of file LiquidMigrationWilletInteraction.cc.

458 {
459  return "LiquidMigrationWillet";
460 }
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.

Definition at line 439 of file LiquidMigrationWilletInteraction.cc.

440 {
442  return 0.0;
443 }
std::vector< Mdouble > LiquidMigrationWilletInteraction::getFieldVTK ( unsigned  i) const
overridevirtual

Reimplemented from BaseInteraction.

Definition at line 509 of file LiquidMigrationWilletInteraction.cc.

References liquidBridgeVolume_.

510 {
511  return std::vector<Mdouble>(1, cbrt(liquidBridgeVolume_));
512 }
std::string LiquidMigrationWilletInteraction::getNameVTK ( unsigned  i) const
overridevirtual

Reimplemented from BaseInteraction.

Definition at line 503 of file LiquidMigrationWilletInteraction.cc.

504 {
505  return "liquidBridgeRadius";
506 
507 }
int LiquidMigrationWilletInteraction::getNumberOfContacts ( BaseInteractable interactable)

Definition at line 240 of file LiquidMigrationWilletInteraction.cc.

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

Referenced by rupture().

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 }
Defines the liquid bridge willet interaction between two particles or walls.
const std::complex< Mdouble > i
Definition: ExtendedMath.h:50
const std::vector< BaseInteraction * > & getInteractions() const
Returns a list of interactions which belong to this interactable.
unsigned LiquidMigrationWilletInteraction::getNumberOfFieldsVTK ( ) const
overridevirtual

writes extra information to the VTK output

Reimplemented from BaseInteraction.

Definition at line 493 of file LiquidMigrationWilletInteraction.cc.

494 {
495  return 1;
496 }
Mdouble LiquidMigrationWilletInteraction::getRuptureDistance ( )

Definition at line 487 of file LiquidMigrationWilletInteraction.cc.

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

Referenced by actionsAfterTimeStep().

488 {
489  const LiquidMigrationWilletSpecies* species = getSpecies();
490  return (1.0 + 0.5 * species->getContactAngle()) * cbrt(liquidBridgeVolume_);
491 }
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
Returns a pointer to the adhesive force species LiquidMigrationWilletSpecies.
const LiquidMigrationWilletSpecies * LiquidMigrationWilletInteraction::getSpecies ( ) const

Returns a pointer to the adhesive force species LiquidMigrationWilletSpecies.

Returns
const LiquidMigrationWilletSpecies*

Definition at line 448 of file LiquidMigrationWilletInteraction.cc.

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

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

449 {
450  return static_cast<const LiquidMigrationWilletSpecies*>(getBaseSpecies()->getAdhesiveForce());
451 ;
452 }
LiquidMigrationWilletSpecies contains the parameters used to describe a short-range force caused by l...
BaseAdhesiveForce * getAdhesiveForce() const
Definition: BaseSpecies.h:152
const BaseSpecies * getBaseSpecies() const
Return a constant point to BaseSpecies of the interaction.
Mdouble LiquidMigrationWilletInteraction::getTotalLiquidBridgeVolume ( InteractionHandler h)
static

Definition at line 528 of file LiquidMigrationWilletInteraction.cc.

References getLiquidBridgeVolume(), and constants::i.

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 }
Defines the liquid bridge willet interaction between two particles or walls.
double Mdouble
Definition: GeneralDefine.h:34
const std::complex< Mdouble > i
Definition: ExtendedMath.h:50
Mdouble LiquidMigrationWilletInteraction::getTotalLiquidFilmVolume ( ParticleHandler h)
static

Definition at line 514 of file LiquidMigrationWilletInteraction.cc.

References LiquidFilmParticle::getLiquidVolume().

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 }
double Mdouble
Definition: GeneralDefine.h:34
Mdouble getLiquidVolume() const
std::string LiquidMigrationWilletInteraction::getTypeVTK ( unsigned  i) const
overridevirtual

Reimplemented from BaseInteraction.

Definition at line 498 of file LiquidMigrationWilletInteraction.cc.

499 {
500  return "Float32";
501 }
bool LiquidMigrationWilletInteraction::getWasInContact ( ) const

Definition at line 477 of file LiquidMigrationWilletInteraction.cc.

References wasInContact_.

478 {
479  return wasInContact_;
480 }
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)
overridevirtual

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

Parameters
[in,out]is

Implements BaseObject.

Definition at line 103 of file LiquidMigrationWilletInteraction.cc.

References liquidBridgeVolume_, and wasInContact_.

104 {
105  std::string dummy;
106  is >> dummy >> wasInContact_;
107  is >> dummy >> liquidBridgeVolume_;
108 }
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 253 of file LiquidMigrationWilletInteraction.cc.

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

Referenced by actionsAfterTimeStep(), and actionsOnErase().

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  {
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 }
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)
Logger< MERCURY_LOGLEVEL > logger("MercuryKernel")
InteractionHandler * getHandler() const
Gets a point to the interaction handlers to which this interaction belongs.
double Mdouble
Definition: GeneralDefine.h:34
const std::complex< Mdouble > i
Definition: ExtendedMath.h:50
BaseInteractable * getI()
Returns a pointer to the second object involved in the interaction (often a wall or a particle)...
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...
BaseInteractable * getP()
Returns a pointer to first object involved in the interaction (normally a particle).
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:1329
void setLiquidVolume(Mdouble liquidVolume)
void addLiquidBridgeVolume(Mdouble liquidBridgeVolume)
Mdouble getLiquidVolume() const
void setLiquidBridgeVolume(Mdouble liquidBridgeVolume)
const std::vector< BaseInteraction * > & getInteractions() const
Returns a list of interactions which belong to this interactable.
DPMBase * getDPMBase()
Gets the problem that is solved using this handler.
Definition: BaseHandler.h:725
const LiquidMigrationWilletSpecies * getSpecies() const
Returns a pointer to the adhesive force species LiquidMigrationWilletSpecies.
void LiquidMigrationWilletInteraction::setLiquidBridgeVolume ( Mdouble  liquidBridgeVolume)

Definition at line 467 of file LiquidMigrationWilletInteraction.cc.

References liquidBridgeVolume_.

Referenced by rupture().

468 {
469  liquidBridgeVolume_ = liquidBridgeVolume;
470 }
void LiquidMigrationWilletInteraction::setWasInContact ( bool  wasInContact)

Definition at line 482 of file LiquidMigrationWilletInteraction.cc.

References wasInContact_.

483 {
484  wasInContact_ = wasInContact;
485 }
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
overridevirtual

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

Parameters
[in,out]os

Implements BaseObject.

Definition at line 93 of file LiquidMigrationWilletInteraction.cc.

References liquidBridgeVolume_, and wasInContact_.

94 {
95  os
96  << " wasInContact " << wasInContact_
97  << " liquidBridgeVolume " << liquidBridgeVolume_;
98 }
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 143 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: