LiquidBridgeBagheriInteraction Class Reference

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

#include <LiquidBridgeBagheriInteraction.h>

+ Inheritance diagram for LiquidBridgeBagheriInteraction:

Public Types

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

Public Member Functions

 LiquidBridgeBagheriInteraction (BaseInteractable *P, BaseInteractable *I, unsigned timeStamp)
 Constructor. More...
 
 LiquidBridgeBagheriInteraction ()
 
 LiquidBridgeBagheriInteraction (const LiquidBridgeBagheriInteraction &p)
 Copy constructor. More...
 
 ~LiquidBridgeBagheriInteraction () override
 Destructor. More...
 
void computeAdhesionForce ()
 Computes the adhesive forces for liquid bridge Bagheri 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 LiquidBridgeBagheriSpeciesgetSpecies () const
 Returns a pointer to the adhesive force species LiquidBridgeBagheriSpecies. More...
 
std::string getBaseName () const
 Returns the name of the interaction, see Interaction.h. More...
 
bool getWasInContact () const
 
void setWasInContact (bool wasInContact)
 
- 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 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...
 
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...
 
virtual void actionsAfterTimeStep ()
 
virtual unsigned getNumberOfFieldsVTK () const
 
virtual std::string getTypeVTK (unsigned i) const
 
virtual std::string getNameVTK (unsigned i) const
 
virtual std::vector< MdoublegetFieldVTK (unsigned i) const
 
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
 

Private Attributes

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

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 Bagheri interaction between two particles or walls.

Member Typedef Documentation

◆ SpeciesType

An alias name for LiquidBridgeBagheriSpecies data type.

Constructor & Destructor Documentation

◆ LiquidBridgeBagheriInteraction() [1/3]

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

Constructor.

Parameters
[in]P
[in]I
[in]timeStamp
19  : BaseInteraction(P, I, timeStamp)
20 {
21  wasInContact_ = false;
22 #ifdef DEBUG_CONSTRUCTOR
23  std::cout<<"LiquidBridgeBagheriInteraction::LiquidBridgeBagheriInteraction() finished"<<std::endl;
24 #endif
25 }
BaseInteraction()
Definition: BaseInteraction.cc:43
bool wasInContact_
A history parameter to store if the particles were in contact or not. Useful to compute adhesive forc...
Definition: LiquidBridgeBagheriInteraction.h:87
#define I
Definition: main.h:127
double P
Uniform pressure.
Definition: TwenteMeshGluing.cpp:77

References wasInContact_.

◆ LiquidBridgeBagheriInteraction() [2/3]

LiquidBridgeBagheriInteraction::LiquidBridgeBagheriInteraction ( )
29  : BaseInteraction()
30 {
31  wasInContact_ = false;
32 #ifdef DEBUG_CONSTRUCTOR
33  std::cout<<"LiquidBridgeBagheriInteraction::LiquidBridgeBagheriInteraction() finished"<<std::endl;
34 #endif
35 }

References wasInContact_.

◆ LiquidBridgeBagheriInteraction() [3/3]

LiquidBridgeBagheriInteraction::LiquidBridgeBagheriInteraction ( const LiquidBridgeBagheriInteraction p)

Copy constructor.

Parameters
[in]p
42 {
43  wasInContact_ = p.wasInContact_;
44 #ifdef DEBUG_CONSTRUCTOR
45  std::cout<<"LiquidBridgeBagheriInteraction::LiquidBridgeBagheriInteraction(const LiquidBridgeBagheriInteraction &p finished"<<std::endl;
46 #endif
47 }
float * p
Definition: Tutorial_Map_using.cpp:9

References p, and wasInContact_.

◆ ~LiquidBridgeBagheriInteraction()

LiquidBridgeBagheriInteraction::~LiquidBridgeBagheriInteraction ( )
override

Destructor.

53 {
54 #ifdef DEBUG_DESTRUCTOR
55  std::cout<<"LiquidBridgeBagheriInteraction::~LiquidBridgeBagheriInteraction() finished"<<std::endl;
56 #endif
57 }

Member Function Documentation

◆ computeAdhesionForce()

void LiquidBridgeBagheriInteraction::computeAdhesionForce ( )

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

81 {
82  const LiquidBridgeBagheriSpecies* species = getSpecies();
83 
84  // if the liquid bridge volume is zero, there is no liquid bridge and no force
85  if (species->getLiquidBridgeVolume() == 0)
86  {
87  return;
88  }
89 
90  if (getOverlap() >= 0)
91  {
92  wasInContact_ = true;
93 
94  // The effective radius is calculated as twice the effective radius of the particles, because the harmonic mean is needed. For same size spheres, this should be the radius of the spheres.
95  Mdouble effectiveRadius = 2 * getEffectiveRadius();
96  Mdouble V = species->getLiquidBridgeVolume()/std::pow(effectiveRadius,3);
97 
98  // Only allow volumes which are valid according to https://doi.org/10.1007/s40571-024-00772-5
99  logger.assert_debug(V >= 1e-6 && V <= 1e-1, "Liquid bridge volume is out of range for the Bagheri model. V/R^3 = % (It should be in the range [1e-6, 1e-1]).", V);
100 
101  // full model according to Eq. 24-26 from Bagheri et al. 2024, CPM
102  Mdouble f0 = 2*constants::pi*(1 - 0.3823*std::pow(V,0.2586));
103  // std::cout << species->getMeanRadius() << std::endl;
104  Mdouble a = 0.4158*std::pow(V,0.2835)+0.6474;
105  Mdouble b = -0.2087*std::pow(V,0.3113)+2.267;
106  Mdouble ft = (1 - a*std::pow(std::sin(species->getContactAngle()),b))*f0;
107 
108  Mdouble force_full_fit = ft;
109  Mdouble fdotn = -force_full_fit * effectiveRadius * species->getSurfaceTension();
110 
111  addForce(getNormal() * fdotn);
112  }
113  else if (wasInContact_)
114  {
115  Mdouble effectiveRadius = 2 * getEffectiveRadius();
116  Mdouble V = species->getLiquidBridgeVolume()/std::pow(effectiveRadius,3);
117 
118  // Only allow volumes which are valid according to https://doi.org/10.1007/s40571-024-00772-5
119  logger.assert_debug(V >= 1e-6 && V <= 1e-1, "Liquid bridge volume is out of range for the Bagheri model. V/R^3 = % (It should be in the range [1e-6, 1e-1]).", V);
120 
121  Mdouble S_rupture = (1.0 + species->getContactAngle()*0.5)*(std::pow(V,1.0/3.0)+0.1*std::pow(V,2.0/3.0));
122  Mdouble S = -getOverlap()/(effectiveRadius*S_rupture);
123 
124  // if the overlap is too large, the liquid bridge is ruptured and no force is applied
125  if (S > 1.0)
126  {
127  wasInContact_ = false;
128  return;
129  }
130 
131  Mdouble log_V = std::log(V);
132 
133  // full model according to Eq. 27-30 from Bagheri et al. 2024, CPM
134  Mdouble f0 = 2*constants::pi*(1 - 0.3823*std::pow(V,0.2586));
135 
136  Mdouble a = 0.4158*std::pow(V,0.2835)+0.6474;
137  Mdouble b = -0.2087*std::pow(V,0.3113)+2.267;
138  Mdouble ft = (1 - a*std::pow(std::sin(species->getContactAngle()),b))*f0;
139 
140  Mdouble a_s = -0.3319*std::pow(V,0.4974) + 0.6717*std::pow(V,0.1995);
141  Mdouble b_s = 13.84*std::pow(V,-0.3909) - 12.11*std::pow(V,-0.3945);
142 
143  Mdouble a_t_a = -0.007815*std::pow(log_V,2)-0.2105 *log_V -1.426;
144  Mdouble b_t_a = -1.78*std::pow(V,0.8351) + 0.6669*std::pow(V,-0.01391);
145  Mdouble a_t = a_t_a*std::pow(species->getContactAngle(),3)+b_t_a*species->getContactAngle()+1.0;
146 
147  Mdouble force_full_fit = ft*(1+a_s*S)/(1+a_t*b_s*a_s*S+a_t*b_s*std::pow(S,2));
148 
149  Mdouble fdotn = -force_full_fit * effectiveRadius * species->getSurfaceTension();
150 
151  addForce(getNormal() * fdotn);
152  }
153 }
AnnoyingScalar sin(const AnnoyingScalar &x)
Definition: AnnoyingScalar.h:137
Array< double, 1, 3 > e(1./3., 0.5, 2.)
MatrixXcd V
Definition: EigenSolver_EigenSolver_MatrixType.cpp:15
Logger< MERCURYDPM_LOGLEVEL > logger("MercuryKernel")
Definition of different loggers with certain modules. A user can define its own custom logger here.
Scalar * b
Definition: benchVecAdd.cpp:17
const Vec3D & getNormal() const
Gets the normal vector between the two interacting objects.
Definition: BaseInteraction.h:205
void addForce(Vec3D force)
add an force increment to the total force.
Definition: BaseInteraction.cc:587
Mdouble getEffectiveRadius() const
Returns a Mdouble to the effective radius of the interaction. (Not corrected for the overlap)
Definition: BaseInteraction.cc:774
Mdouble getOverlap() const
Returns a Mdouble with the current overlap between the two interacting objects.
Definition: BaseInteraction.h:219
const LiquidBridgeBagheriSpecies * getSpecies() const
Returns a pointer to the adhesive force species LiquidBridgeBagheriSpecies.
Definition: LiquidBridgeBagheriInteraction.cc:167
LiquidBridgeBagheriSpecies contains the parameters used to describe a short-range force caused by liq...
Definition: LiquidBridgeBagheriSpecies.h:17
Mdouble getLiquidBridgeVolume() const
used to access the Volume of the liquid bridge.
Definition: LiquidBridgeBagheriSpecies.cc:107
Mdouble getContactAngle() const
used to access the contact angle between particle and liquid bridge surface.
Definition: LiquidBridgeBagheriSpecies.cc:144
Mdouble getSurfaceTension() const
used to access the surface tension of the liquid.
Definition: LiquidBridgeBagheriSpecies.cc:124
const Scalar * a
Definition: level2_cplx_impl.h:32
EIGEN_STRONG_INLINE EIGEN_DEVICE_FUNC bfloat16 pow(const bfloat16 &a, const bfloat16 &b)
Definition: BFloat16.h:625
EIGEN_STRONG_INLINE EIGEN_DEVICE_FUNC bfloat16 log(const bfloat16 &a)
Definition: BFloat16.h:618
const Mdouble pi
Definition: ExtendedMath.h:23
@ S
Definition: quadtree.h:62

References a, BaseInteraction::addForce(), b, e(), LiquidBridgeBagheriSpecies::getContactAngle(), BaseInteraction::getEffectiveRadius(), LiquidBridgeBagheriSpecies::getLiquidBridgeVolume(), BaseInteraction::getNormal(), BaseInteraction::getOverlap(), getSpecies(), LiquidBridgeBagheriSpecies::getSurfaceTension(), Eigen::bfloat16_impl::log(), logger, constants::pi, Eigen::bfloat16_impl::pow(), oomph::QuadTreeNames::S, sin(), V, and wasInContact_.

◆ getBaseName()

std::string LiquidBridgeBagheriInteraction::getBaseName ( ) const

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

Returns
std::string
176 {
177  return "LiquidBridgeBagheri";
178 }

◆ getElasticEnergy()

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

159 {
161  return 0.0;
162 }

◆ getSpecies()

const LiquidBridgeBagheriSpecies * LiquidBridgeBagheriInteraction::getSpecies ( ) const

Returns a pointer to the adhesive force species LiquidBridgeBagheriSpecies.

Returns
const LiquidBridgeBagheriSpecies*
168 {
169  return static_cast<const LiquidBridgeBagheriSpecies*>(getBaseSpecies()->getAdhesiveForce());
170 }
const BaseSpecies * getBaseSpecies() const
Return a constant point to BaseSpecies of the interaction.
Definition: BaseInteraction.cc:663
BaseAdhesiveForce * getAdhesiveForce() const
Definition: BaseSpecies.h:131

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

Referenced by computeAdhesionForce().

◆ getWasInContact()

bool LiquidBridgeBagheriInteraction::getWasInContact ( ) const
181 {
182  return wasInContact_;
183 }

References wasInContact_.

◆ read()

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

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

Parameters
[in,out]is

Implements BaseObject.

71 {
72  // we read in wasInContact_ like this because an early version did not initialize it.
73  std::string dummy;
74  is >> dummy >> wasInContact_;
75 }
std::string string(const unsigned &i)
Definition: oomph_definitions.cc:286

References oomph::Global_string_for_annotation::string(), and wasInContact_.

◆ setWasInContact()

void LiquidBridgeBagheriInteraction::setWasInContact ( bool  wasInContact)
186 {
187  wasInContact_ = wasInContact;
188 }

References wasInContact_.

◆ write()

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

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

Parameters
[in,out]os

Implements BaseObject.

63 {
64  os << " wasInContact " << wasInContact_;
65 }

References wasInContact_.

Member Data Documentation

◆ wasInContact_

bool LiquidBridgeBagheriInteraction::wasInContact_
private

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

Referenced by computeAdhesionForce(), getWasInContact(), LiquidBridgeBagheriInteraction(), read(), setWasInContact(), and write().


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