HeatFluidCoupledInteraction.h
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 
26 #ifndef HeatFluidCoupledINTERACTION_H
27 #define HeatFluidCoupledINTERACTION_H
28 
29 #include "ThermalInteraction.h"
30 //#include "Species/NormalForceSpecies/HeatFluidCoupledSpecies.h"
32 
33 template<class NormalForceSpecies>
35 
36 template<class NormalForceInteraction>
37 class HeatFluidCoupledInteraction : public ThermalInteraction<NormalForceInteraction>
38 {
39 public:
41 
46  : BaseInteraction(P, I, timeStamp), ThermalInteraction<NormalForceInteraction>(P, I, timeStamp)
47  {}
48 
54  {}
55 
56 
62  {}
63 
68  {}
69 
73  void computeNormalForce();
74 };
75 
76 template<class NormalForceInteraction>
78 {
79  NormalForceInteraction::computeNormalForce();
80  Mdouble radius = 2.0 * NormalForceInteraction::getEffectiveRadius();
81  Mdouble contactArea = constants::pi * radius * std::max(0.0,NormalForceInteraction::getOverlap());
82  const SpeciesType* species = static_cast<const SpeciesType*>(NormalForceInteraction::getBaseSpecies()->getNormalForce());
83  auto pParticle = dynamic_cast<HeatFluidCoupledParticle*>(NormalForceInteraction::getP());
84  auto iParticle = dynamic_cast<HeatFluidCoupledParticle*>(NormalForceInteraction::getI());
85  // if both p and i are particles
86  if (pParticle && iParticle)
87  {
88  /* heat transfer rate Q=m*c*dT/dt */
89  Mdouble heatTransfer = species->getThermalConductivity()
90  * (pParticle->getTemperature() - iParticle->getTemperature())
91  * contactArea / NormalForceInteraction::getDistance();
92  /* m*dT = Q/c*dt */
93  Mdouble mdT = heatTransfer / species->getHeatCapacity()
94  * NormalForceInteraction::getHandler()->getDPMBase()->getTimeStep();
95  pParticle->addTemperature(-mdT * pParticle->getInvMass());
96  iParticle->addTemperature(mdT * iParticle->getInvMass());
97  }
98 }
99 
100 #endif
Defines the basic properties that a interactable object can have.
Definition: BaseInteractable.h:55
Stores information about interactions between two interactable objects; often particles but could be ...
Definition: BaseInteraction.h:60
Definition: HeatFluidCoupledInteraction.h:38
HeatFluidCoupledSpecies< typename NormalForceInteraction::SpeciesType > SpeciesType
Definition: HeatFluidCoupledInteraction.h:40
void computeNormalForce()
Computes the normal forces due to linear plastic visco elastic interaction.
Definition: HeatFluidCoupledInteraction.h:77
virtual ~HeatFluidCoupledInteraction()
Destructor.
Definition: HeatFluidCoupledInteraction.h:67
HeatFluidCoupledInteraction(const HeatFluidCoupledInteraction &p)
Copy constructor.
Definition: HeatFluidCoupledInteraction.h:60
HeatFluidCoupledInteraction()
Default Constructor.
Definition: HeatFluidCoupledInteraction.h:52
HeatFluidCoupledInteraction(BaseInteractable *P, BaseInteractable *I, unsigned timeStamp)
Constructor.
Definition: HeatFluidCoupledInteraction.h:45
Species for the HeatFluidCoupledParticle.
Definition: HeatFluidCoupledSpecies.h:35
Class of particles that store both temperature and liquid volume, which is adapted for the CFD-DEM st...
Definition: HeatFluidCoupledParticle.h:46
Definition: ThermalInteraction.h:37
Mdouble getThermalConductivity() const
Allows heatCapacity_ to be accessed.
Definition: ThermalSpecies.h:143
Mdouble getHeatCapacity() const
Allows heatCapacity_ to be accessed.
Definition: ThermalSpecies.h:128
double P
Uniform pressure.
Definition: TwenteMeshGluing.cpp:73
const Mdouble pi
Definition: ExtendedMath.h:45