MercuryDPM  Alpha
 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 {
33  surfaceTension_ = 0;
34  contactAngle_ = 0;
35 #ifdef DEBUG_CONSTRUCTOR
36  std::cout<<"LiquidBridgeWilletSpecies::LiquidBridgeWilletSpecies() finished"<<std::endl;
37 #endif
38 }
39 
44 {
49 #ifdef DEBUG_CONSTRUCTOR
50  std::cout<<"LiquidBridgeWilletSpecies::LiquidBridgeWilletSpecies(const LiquidBridgeWilletSpecies &p) finished"<<std::endl;
51 #endif
52 }
53 
55 {
56 #ifdef DEBUG_DESTRUCTOR
57  std::cout<<"LiquidBridgeWilletSpecies::~LiquidBridgeWilletSpecies() finished"<<std::endl;
58 #endif
59 }
60 
64 void LiquidBridgeWilletSpecies::write(std::ostream& os) const
65  {
66  os << " liquidBridgeVolume " << liquidBridgeVolume_;
67  os << " surfaceTension " << surfaceTension_;
68  os << " contactAngle " << contactAngle_;
69 }
70 
74 void LiquidBridgeWilletSpecies::read(std::istream& is)
75 {
76  std::string dummy;
77  is >> dummy >> liquidBridgeVolume_;
78  is >> dummy >> surfaceTension_;
79  is >> dummy >> contactAngle_;
80 }
81 
86 {
87  return "LiquidBridgeWillet";
88 }
89 
96 {
100 }
101 
106 {
107  return (1.0+0.5*contactAngle_)*cbrtLiquidBridgeVolume_;
108 }
109 
114 {
115  if (liquidBridgeVolume >= 0)
116  {
117  liquidBridgeVolume_ = liquidBridgeVolume;
118  cbrtLiquidBridgeVolume_ = cbrt(liquidBridgeVolume);
119  }
120  else
121  {
122  std::cerr << "Error in setLiquidBridgeVolume(" << liquidBridgeVolume << ")" << std::endl;
123  exit(-1);
124  }
125 }
126 
131 {
132  return liquidBridgeVolume_;
133 }
134 
139 {
140  if (surfaceTension >= 0)
141  surfaceTension_ = surfaceTension;
142  else
143  {
144  std::cerr << "Error in setSurfaceTension" << std::endl;
145  exit(-1);
146  }
147 }
148 
153 {
154  return surfaceTension_;
155 }
156 
161 {
162  if (contactAngle >= 0)
163  contactAngle_ = contactAngle;
164  else
165  {
166  std::cerr << "Error in setContactAngle" << std::endl;
167  exit(-1);
168  }
169 }
170 
175 {
176  return contactAngle_;
177 }
178 
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.