MercuryDPM  Trunk
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
LiquidBridgeWilletSpecies.cc
Go to the documentation of this file.
1 //Copyright (c) 2013-2020, The MercuryDPM Developers Team. All rights reserved.
2 //For the list of developers, see <http://www.MercuryDPM.org/Team>.
3 //
4 //Redistribution and use in source and binary forms, with or without
5 //modification, are permitted provided that the following conditions are met:
6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above copyright
9 // notice, this list of conditions and the following disclaimer in the
10 // documentation and/or other materials provided with the distribution.
11 // * Neither the name MercuryDPM nor the
12 // names of its contributors may be used to endorse or promote products
13 // derived from this software without specific prior written permission.
14 //
15 //THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
16 //ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
17 //WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
18 //DISCLAIMED. IN NO EVENT SHALL THE MERCURYDPM DEVELOPERS TEAM BE LIABLE FOR ANY
19 //DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
20 //(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
21 //LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
22 //ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
23 //(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
24 //SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25 
27 #include "Logger.h"
28 #include "Species/BaseSpecies.h"
29 
31 {
34  surfaceTension_ = 0;
35  contactAngle_ = 0;
37 #ifdef DEBUG_CONSTRUCTOR
38  std::cout<<"LiquidBridgeWilletSpecies::LiquidBridgeWilletSpecies() finished"<<std::endl;
39 #endif
40 }
41 
46 {
51 #ifdef DEBUG_CONSTRUCTOR
52  std::cout<<"LiquidBridgeWilletSpecies::LiquidBridgeWilletSpecies(const LiquidBridgeWilletSpecies &p) finished"<<std::endl;
53 #endif
54 }
55 
57 {
58 #ifdef DEBUG_DESTRUCTOR
59  std::cout<<"LiquidBridgeWilletSpecies::~LiquidBridgeWilletSpecies() finished"<<std::endl;
60 #endif
61 }
62 
66 void LiquidBridgeWilletSpecies::write(std::ostream& os) const
67 {
68  os << " liquidBridgeVolume " << liquidBridgeVolume_;
69  os << " surfaceTension " << surfaceTension_;
70  os << " contactAngle " << contactAngle_;
71 }
72 
76 void LiquidBridgeWilletSpecies::read(std::istream& is)
77 {
78  std::string dummy;
79  is >> dummy >> liquidBridgeVolume_;
80  is >> dummy >> surfaceTension_;
81  is >> dummy >> contactAngle_;
83 }
84 
89 {
90  return "LiquidBridgeWillet";
91 }
92 
99 {
103 }
104 
107 {
109 }
110 
115 {
116  if (liquidBridgeVolume >= 0)
117  {
118  liquidBridgeVolume_ = liquidBridgeVolume;
119  cbrtLiquidBridgeVolume_ = cbrt(liquidBridgeVolume);
121  }
122  else
123  {
124  std::cerr << "Error in setLiquidBridgeVolume(" << liquidBridgeVolume << ")" << std::endl;
125  exit(-1);
126  }
127 }
128 
133 {
134  return liquidBridgeVolume_;
135 }
136 
141 {
142  if (surfaceTension >= 0)
143  surfaceTension_ = surfaceTension;
144  else
145  {
146  std::cerr << "Error in setSurfaceTension" << std::endl;
147  exit(-1);
148  }
149 }
150 
155 {
156  return surfaceTension_;
157 }
158 
163 {
164  logger.assert(contactAngle >= 0,"Error in setContactAngle");
165  contactAngle_ = contactAngle;
167 }
168 
173 {
174  return contactAngle_;
175 }
176 
void read(std::istream &is)
Reads the species properties from an input stream.
void setContactAngle(Mdouble contactAngle)
used to set the contact angle between particle and liquid bridge surface.
Mdouble contactAngle_
contact angle between particle and liquid bridge surface
Mdouble liquidBridgeVolume_
Volume of the liquid bridge.
Mdouble getContactAngle() const
used to access the contact angle between particle and liquid bridge surface.
BaseSpecies * getBaseSpecies() const
Definition: BaseForce.h:35
void mix(LiquidBridgeWilletSpecies *S, LiquidBridgeWilletSpecies *T)
creates default values for mixed species
Mdouble getLiquidBridgeVolume() const
used to access the Volume of the liquid bridge.
Logger< MERCURY_LOGLEVEL > logger("MercuryKernel")
double Mdouble
Definition: GeneralDefine.h:34
void setInteractionDistance(Mdouble interactionDistance)
Sets BaseSpecies::interactionDistance_.
Definition: BaseSpecies.cc:156
Mdouble getSurfaceTension() const
used to access the surface tension of the liquid.
LiquidBridgeWilletSpecies()
The default constructor.
void setLiquidBridgeVolume(Mdouble liquidBridgeVolume)
used to set the Volume of the liquid bridge.
~LiquidBridgeWilletSpecies()
The default destructor.
static Mdouble average(Mdouble a, Mdouble b)
Returns the harmonic mean of two variables.
Definition: BaseSpecies.cc:110
void setSurfaceTension(Mdouble surfaceTension)
used to set the surface tension of the liquid.
Mdouble surfaceTension_
surface tension of the liquid
LiquidBridgeWilletSpecies contains the parameters used to describe a short-range force caused by liqu...
Mdouble cbrtLiquidBridgeVolume_
Cube root of the liquid bridge.
std::string getBaseName() const
Used in Species::getName to obtain a unique name for each Species.
void write(std::ostream &os) const
Writes the species properties to an output stream.