MercuryDPM  Beta
 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-2014, 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 
30 {
31  liquidBridgeVolume_ = std::numeric_limits<double>::quiet_NaN();
32  cbrtLiquidBridgeVolume_ = std::numeric_limits<double>::quiet_NaN();
33  surfaceTension_ = std::numeric_limits<double>::quiet_NaN();
34  contactAngle_ = std::numeric_limits<double>::quiet_NaN();
35 #ifdef DEBUG_CONSTRUCTOR
36  std::cout<<"LiquidBridgeWilletSpecies::LiquidBridgeWilletSpecies() finished"<<std::endl;
37 #endif
38 }
39 
44 {
48 #ifdef DEBUG_CONSTRUCTOR
49  std::cout<<"LiquidBridgeWilletSpecies::LiquidBridgeWilletSpecies(const LiquidBridgeWilletSpecies &p) finished"<<std::endl;
50 #endif
51 }
52 
54 {
55 #ifdef DEBUG_DESTRUCTOR
56  std::cout<<"LiquidBridgeWilletSpecies::~LiquidBridgeWilletSpecies() finished"<<std::endl;
57 #endif
58 }
59 
63 void LiquidBridgeWilletSpecies::write(std::ostream& os) const
64  {
65  os << " liquidBridgeVolume " << liquidBridgeVolume_;
66  os << " surfaceTension " << surfaceTension_;
67  os << " contactAngle " << contactAngle_;
68 }
69 
73 void LiquidBridgeWilletSpecies::read(std::istream& is)
74 {
75  std::string dummy;
76  is >> dummy >> liquidBridgeVolume_;
77  is >> dummy >> surfaceTension_;
78  is >> dummy >> contactAngle_;
79 }
80 
85 {
86  return "LiquidBridgeWillet";
87 }
88 
95 {
99 }
100 
105 {
106  return (1.0+0.5*contactAngle_)*cbrtLiquidBridgeVolume_;
107 }
108 
113 {
114  if (liquidBridgeVolume >= 0)
115  {
116  liquidBridgeVolume_ = liquidBridgeVolume;
117  cbrtLiquidBridgeVolume_ = cbrt(liquidBridgeVolume);
118  }
119  else
120  {
121  std::cerr << "Error in setLiquidBridgeVolume" << std::endl;
122  exit(-1);
123  }
124 }
125 
130 {
131  return liquidBridgeVolume_;
132 }
133 
138 {
139  if (surfaceTension >= 0)
140  surfaceTension_ = surfaceTension;
141  else
142  {
143  std::cerr << "Error in setSurfaceTension" << std::endl;
144  exit(-1);
145  }
146 }
147 
152 {
153  return surfaceTension_;
154 }
155 
160 {
161  if (contactAngle >= 0)
162  contactAngle_ = contactAngle;
163  else
164  {
165  std::cerr << "Error in setContactAngle" << std::endl;
166  exit(-1);
167  }
168 }
169 
174 {
175  return contactAngle_;
176 }
177 
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.
Mdouble getLiquidBridgeVolume() const
used to access the Volume of the liquid bridge.
double Mdouble
Mdouble getSurfaceTension() const
used to access the surface tension of the liquid.
void mix(LiquidBridgeWilletSpecies *const S, LiquidBridgeWilletSpecies *const T)
creates default values for mixed species
LiquidBridgeWilletSpecies()
The default constructor.
void setLiquidBridgeVolume(Mdouble liquidBridgeVolume)
used to set the Volume of the liquid bridge.
virtual ~LiquidBridgeWilletSpecies()
The default destructor.
Mdouble average(Mdouble a, Mdouble b)
defines the average of two variables by the harmonic mean.
Definition: BaseSpecies.cc:85
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.
Mdouble getInteractionDistance() const
returns the largest separation distance at which adhesive short-range forces can occur.
void write(std::ostream &os) const
Writes the species properties to an output stream.