LiquidFilm< Particle > Class Template Reference

#include <LiquidFilmParticle.h>

+ Inheritance diagram for LiquidFilm< Particle >:

Public Member Functions

 LiquidFilm ()
 Basic Particle constructor, creates an Particle at (0,0,0) with radius, mass and inertia equal to 1. More...
 
 LiquidFilm (const LiquidFilm &p)
 Particle copy constructor, which accepts as input a reference to a Particle. It creates a copy of this Particle and all it's information. Usually it is better to use the copy() function for polymorfism. More...
 
 ~LiquidFilm () override=default
 Particle destructor, needs to be implemented and checked if it removes tangential spring information. More...
 
LiquidFilmcopy () const override
 Particle copy method. It calls to copy constructor of this Particle, useful for polymorfism. More...
 
void write (std::ostream &os) const override
 
std::string getName () const override
 
void read (std::istream &is) override
 
Mdouble getLiquidVolume () const
 
void setLiquidVolume (Mdouble liquidVolume)
 
void addLiquidVolume (Mdouble liquidVolume)
 
Mdouble getFullLiquidVolume () const
 
Mdouble getLiquidBridgeVolume () const
 
Mdouble getTotalEvaporatedLiquidVolume () const
 
void setTotalEvaporatedLiquidVolume (Mdouble liquidVolume)
 
void addTotalEvaporatedLiquidVolume (Mdouble liquidVolume)
 
Mdouble getMeanLiquidFilmThickness () const
 
Mdouble getRelativeLiquidVolume () const
 
unsigned getNumberOfFieldsVTK () const override
 
std::string getTypeVTK (unsigned i) const override
 
std::string getNameVTK (unsigned i) const override
 
std::vector< MdoublegetFieldVTK (unsigned i) const override
 
bool isSphericalParticle () const override
 

Protected Attributes

Mdouble liquidVolume_
 
Mdouble totalEvaporatedLiquidVolume_
 

Constructor & Destructor Documentation

◆ LiquidFilm() [1/2]

template<class Particle >
LiquidFilm< Particle >::LiquidFilm ( )
inline

Basic Particle constructor, creates an Particle at (0,0,0) with radius, mass and inertia equal to 1.

default constructor

22  {
23  liquidVolume_ = 0;
25  }
Mdouble totalEvaporatedLiquidVolume_
Definition: LiquidFilmParticle.h:153
Mdouble liquidVolume_
Definition: LiquidFilmParticle.h:153

References LiquidFilm< Particle >::liquidVolume_, and LiquidFilm< Particle >::totalEvaporatedLiquidVolume_.

Referenced by LiquidFilm< Particle >::copy().

◆ LiquidFilm() [2/2]

template<class Particle >
LiquidFilm< Particle >::LiquidFilm ( const LiquidFilm< Particle > &  p)
inline

Particle copy constructor, which accepts as input a reference to a Particle. It creates a copy of this Particle and all it's information. Usually it is better to use the copy() function for polymorfism.

Constructor that copies most of the properties of the given particle. Please note that not everything is copied, for example the position in the HGrid is not determined yet by the end of this constructor. It also does not copy the interactions and the pointer to the handler that handles this particle. Use with care.

Parameters
[in,out]pReference to the LiquidFilm this one should become a copy of.
36  : Particle(p)
37  {
38  liquidVolume_ = p.liquidVolume_;
39  totalEvaporatedLiquidVolume_ = p.totalEvaporatedLiquidVolume_;
40  }
float * p
Definition: Tutorial_Map_using.cpp:9

References LiquidFilm< Particle >::liquidVolume_, p, and LiquidFilm< Particle >::totalEvaporatedLiquidVolume_.

◆ ~LiquidFilm()

template<class Particle >
LiquidFilm< Particle >::~LiquidFilm ( )
overridedefault

Particle destructor, needs to be implemented and checked if it removes tangential spring information.

Destructor. It asks the ParticleHandler to check if this was the smallest or largest particle and adjust itself accordingly.

Member Function Documentation

◆ addLiquidVolume()

◆ addTotalEvaporatedLiquidVolume()

template<class Particle >
void LiquidFilm< Particle >::addTotalEvaporatedLiquidVolume ( Mdouble  liquidVolume)
inline
117  {
118  totalEvaporatedLiquidVolume_ += liquidVolume;
119  }

References LiquidFilm< Particle >::totalEvaporatedLiquidVolume_.

◆ copy()

template<class Particle >
LiquidFilm* LiquidFilm< Particle >::copy ( ) const
inlineoverride

Particle copy method. It calls to copy constructor of this Particle, useful for polymorfism.

Copy method. Uses copy constructor to create a copy on the heap. Useful for polymorphism.

Returns
pointer to the particle's copy
57  {
58  return new LiquidFilm(*this);
59  }
LiquidFilm()
Basic Particle constructor, creates an Particle at (0,0,0) with radius, mass and inertia equal to 1.
Definition: LiquidFilmParticle.h:21

References LiquidFilm< Particle >::LiquidFilm().

◆ getFieldVTK()

template<class Particle >
std::vector< Mdouble > LiquidFilm< Particle >::getFieldVTK ( unsigned  i) const
override
199 {
200  if (i==1)
201  return { liquidVolume_ };
202  else if (i==2)
203  return { getLiquidBridgeVolume() };
204  else if (i==3)
205  return { totalEvaporatedLiquidVolume_ };
206  else if (i==4)
207  return { getMeanLiquidFilmThickness() };
208  else if (i==5)
209  return { getRelativeLiquidVolume() };
210  else /*i=0*/
211  return { getFullLiquidVolume() };
212 }
int i
Definition: BiCGSTAB_step_by_step.cpp:9
Mdouble getMeanLiquidFilmThickness() const
Definition: LiquidFilmParticle.h:125
Mdouble getLiquidBridgeVolume() const
Definition: LiquidFilmParticle.h:215
Mdouble getRelativeLiquidVolume() const
Definition: LiquidFilmParticle.h:130
Mdouble getFullLiquidVolume() const
Definition: LiquidFilmParticle.h:99

References i.

◆ getFullLiquidVolume()

template<class Particle >
Mdouble LiquidFilm< Particle >::getFullLiquidVolume ( ) const
inline

◆ getLiquidBridgeVolume()

template<class Particle >
Mdouble LiquidFilm< Particle >::getLiquidBridgeVolume
216 {
217  // Sums the volume of all liquid bridges. Half when interacting with a particle, full when interacting with a wall.
218  Mdouble volume = 0.0;
219  for (auto i : this->getInteractions())
220  {
221  auto j = dynamic_cast<LiquidMigrationWilletInteraction*>(i);
222  if (j)
223  {
224  if (dynamic_cast<BaseParticle*>(j->getI()))
225  volume += 0.5 * j->getLiquidBridgeVolume();
226  else
227  volume += j->getLiquidBridgeVolume();
228  }
229  else
230  {
231  auto k = dynamic_cast<LiquidMigrationLSInteraction*>(i);
232  if (k)
233  {
234  if (dynamic_cast<BaseParticle*>(k->getI()))
235  volume += 0.5 * k->getLiquidBridgeVolume();
236  else
237  volume += k->getLiquidBridgeVolume();
238  }
239  }
240  }
241  return volume;
242 }
Definition: BaseParticle.h:33
Defines the liquid bridge LS interaction between two particles or walls.
Definition: LiquidMigrationLSInteraction.h:30
Defines the liquid bridge willet interaction between two particles or walls.
Definition: LiquidMigrationWilletInteraction.h:30
char char char int int * k
Definition: level2_impl.h:374
std::ptrdiff_t j
Definition: tut_arithmetic_redux_minmax.cpp:2

References i, j, and k.

Referenced by HeatFluidCoupled< Particle >::getFieldVTK(), and LiquidFilm< Particle >::getFullLiquidVolume().

◆ getLiquidVolume()

template<class Particle >
Mdouble LiquidFilm< Particle >::getLiquidVolume ( ) const
inline
85  {
86  return liquidVolume_;
87  }

References LiquidFilm< Particle >::liquidVolume_.

Referenced by LiquidMigrationSelfTest::printTime().

◆ getMeanLiquidFilmThickness()

template<class Particle >
Mdouble LiquidFilm< Particle >::getMeanLiquidFilmThickness ( ) const
inline

This is an approximated value of the thickness, used to be compatible with all particle types. Note that some particles might not have a getSurfaceArea() function implemented!

126  {
127  return liquidVolume_ / Particle::getSurfaceArea();
128  }

References LiquidFilm< Particle >::liquidVolume_.

◆ getName()

template<class Particle >
std::string LiquidFilm< Particle >::getName ( ) const
inlineoverride

Returns the name of the object; in this case 'LiquidFilm'.

Returns
The object name.
78  {
79  return "LiquidFilm" + Particle::getName();
80  }
std::string getName(int argc, char *argv[])
Definition: CombineParallelDataFiles.cpp:16

References getName().

◆ getNameVTK()

template<class Particle >
std::string LiquidFilm< Particle >::getNameVTK ( unsigned  i) const
override
182 {
183  if (i==1)
184  return "liquidFilmVolume";
185  else if (i==2)
186  return "liquidBridgeVolume";
187  else if (i==3)
188  return "totalEvaporatedLiquidVolume";
189  else if (i==4)
190  return "meanLiquidFilmThickness";
191  else if (i==5)
192  return "relativeLiquidVolume";
193  else /*i=0*/
194  return "fullLiquidVolume";
195 }

References i.

◆ getNumberOfFieldsVTK()

template<class Particle >
unsigned LiquidFilm< Particle >::getNumberOfFieldsVTK ( ) const
inlineoverride
136  {
137  return 6;
138  }

◆ getRelativeLiquidVolume()

template<class Particle >
Mdouble LiquidFilm< Particle >::getRelativeLiquidVolume ( ) const
inline
131  {
132  return liquidVolume_ / Particle::getVolume();
133  }

References LiquidFilm< Particle >::liquidVolume_.

◆ getTotalEvaporatedLiquidVolume()

template<class Particle >
Mdouble LiquidFilm< Particle >::getTotalEvaporatedLiquidVolume ( ) const
inline

◆ getTypeVTK()

template<class Particle >
std::string LiquidFilm< Particle >::getTypeVTK ( unsigned  i) const
inlineoverride
141  {
142  return "Float32";
143  }

◆ isSphericalParticle()

template<class Particle >
bool LiquidFilm< Particle >::isSphericalParticle ( ) const
inlineoverride
149 {return true;}

◆ read()

template<class Particle >
void LiquidFilm< Particle >::read ( std::istream &  is)
override

Particle read function. Has an std::istream as argument, from which it extracts the radius_, invMass_ and invInertia_, respectively. From these the mass_ and inertia_ are deduced. An additional set of properties is read through the call to the parent's method BaseParticle::read().

Parameters
[in,out]isinput stream with particle properties.
168 {
169  Particle::read(is);
170  std::string dummy;
171  is >> dummy >> liquidVolume_;
172  // a fix to allow reading of restart files pre-nonspherical
173  if (dummy == "invInertia")
174  {
175  is >> dummy >> liquidVolume_;
176  }
177  is >> dummy >> totalEvaporatedLiquidVolume_;
178 }
static EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE std::enable_if_t< PacketLoad, PacketType > read(const TensorMapper &tensorMapper, const StorageIndex &NCIndex, const StorageIndex &CIndex, const StorageIndex &ld)
read, a template function used for loading the data from global memory. This function is used to guar...
Definition: TensorContractionSycl.h:162
std::string string(const unsigned &i)
Definition: oomph_definitions.cc:286

References Eigen::TensorSycl::internal::read(), and oomph::Global_string_for_annotation::string().

◆ setLiquidVolume()

◆ setTotalEvaporatedLiquidVolume()

template<class Particle >
void LiquidFilm< Particle >::setTotalEvaporatedLiquidVolume ( Mdouble  liquidVolume)
inline

◆ write()

template<class Particle >
void LiquidFilm< Particle >::write ( std::ostream &  os) const
inlineoverride

LiquidFilm print method, which accepts an os std::ostream as input. It prints human readable LiquidFilm information to the std::ostream.

Parameters
[in,out]osstream to which the info is written
68  {
69  Particle::write(os);
70  os << " liquidVolume " << liquidVolume_ << " totalEvaporatedLiquidVolume " << totalEvaporatedLiquidVolume_;
71  }
static EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE std::enable_if_t< dt !=data_source::global_mem, void > write(PacketType &packet_data, DataScalar ptr)
write, a template function used for storing the data to local memory. This function is used to guaran...
Definition: TensorContractionSycl.h:221

References LiquidFilm< Particle >::liquidVolume_, LiquidFilm< Particle >::totalEvaporatedLiquidVolume_, and Eigen::TensorSycl::internal::write().

Member Data Documentation

◆ liquidVolume_

◆ totalEvaporatedLiquidVolume_


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