HeatFluidCoupledParticle.h
Go to the documentation of this file.
1 //Copyright (c) 2013-2023, 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 
26 #ifndef HeatFluidCoupledParticle_H
27 #define HeatFluidCoupledParticle_H
28 
29 #include "ThermalParticle.h"
30 #include "LiquidFilmParticle.h"
31 
44 template<class Particle>
45 class HeatFluidCoupled final : public Thermal<LiquidFilm<Particle>>
46 {
47 public:
52  HeatFluidCoupled() = default;
53 
65  HeatFluidCoupled(const HeatFluidCoupled& p) = default;
66 
71  ~HeatFluidCoupled() override = default;
72 
78  HeatFluidCoupled* copy() const override
79  {
80  return new HeatFluidCoupled<Particle>(*this);
81  }
82 
87  std::string getName() const override
88  {
89  return "HeatFluidCoupledParticle";
90  }
92  unsigned getNumberOfFieldsVTK() const override { return 4; }
93 
95  std::string getTypeVTK(unsigned) const override { return "Float32"; }
96 
98  std::string getNameVTK(unsigned i) const override {
99  if (i==1)
100  return "liquidFilmVolume";
101  else if (i==2)
102  return "liquidBridgeVolume";
103  else if (i==0)
104  return "fullLiquidVolume";
105  else /* i=3 */
106  return "temperature";
107  }
108 
110  std::vector<Mdouble> getFieldVTK(unsigned i) const override {
111  if (i==1) {
112  return {this->liquidVolume_};
113  } else if (i==2 || i==0) {
114  Mdouble fullLiquidVolume = (i==2)?0:this->liquidVolume_;
115  for (auto k : this->getInteractions()) {
116  auto j = dynamic_cast<LiquidMigrationWilletInteraction*>(k);
117  if (j) {
118  fullLiquidVolume += 0.5*j->getLiquidBridgeVolume();
119  }
120  }
121  return {fullLiquidVolume};
122  } else {
123  return {this->temperature_};
124  }
125  }
126 
128  void actionsAfterTimeStep() override {
129  this->getSpecies()->actionsAfterTimeStep(this);
130  }
131 };
132 
135 #endif
HeatFluidCoupled< SphericalParticle > HeatFluidCoupledParticle
Template specialisation of HeatFluidCoupled<Particle> for spherical particles.
Definition: HeatFluidCoupledParticle.h:134
Class of particles that store both temperature and liquid volume, which is adapted for the CFD-DEM st...
Definition: HeatFluidCoupledParticle.h:46
void actionsAfterTimeStep() override
The actionAfterTimeStep is defined in the species, as we cannot extract the species properties of a H...
Definition: HeatFluidCoupledParticle.h:128
std::vector< Mdouble > getFieldVTK(unsigned i) const override
Tells the vtkWriter the value of each field written for this particle type.
Definition: HeatFluidCoupledParticle.h:110
HeatFluidCoupled * copy() const override
HeatFluidCoupled copy method. Use copy constructor of this HeatFluidCoupled to create a copy on the h...
Definition: HeatFluidCoupledParticle.h:78
unsigned getNumberOfFieldsVTK() const override
Tells the vtkWriter how many fields should be written for this particle type.
Definition: HeatFluidCoupledParticle.h:92
HeatFluidCoupled(const HeatFluidCoupled &p)=default
HeatFluidCoupled copy constructor, which accepts as input a reference to a HeatFluidCoupled....
std::string getName() const override
Returns the name of the object; in this case "HeatFluidCoupledParticle".
Definition: HeatFluidCoupledParticle.h:87
HeatFluidCoupled()=default
HeatFluidCoupled constructor creates a HeatFluidCoupled at (0,0,0) with radius, mass and inertia equa...
std::string getTypeVTK(unsigned) const override
Tells the vtkWriter the type of each field written for this particle type.
Definition: HeatFluidCoupledParticle.h:95
std::string getNameVTK(unsigned i) const override
Tells the vtkWriter the name of each field written for this particle type.
Definition: HeatFluidCoupledParticle.h:98
~HeatFluidCoupled() override=default
HeatFluidCoupled destructor, needs to be implemented and checked if it removes tangential spring info...
Mdouble liquidVolume_
Definition: LiquidFilmParticle.h:136
Defines the liquid bridge willet interaction between two particles or walls.
Definition: LiquidMigrationWilletInteraction.h:45
Definition: ThermalParticle.h:36
Mdouble temperature_
Definition: ThermalParticle.h:141
const std::complex< Mdouble > i
Definition: ExtendedMath.h:51