ThermalInteraction.h
Go to the documentation of this file.
1 // This file is part of the MercuryDPM project (https://www.mercurydpm.org).
2 // Copyright (c), The MercuryDPM Developers Team. All rights reserved.
3 // License: BSD 3-Clause License; see the LICENSE file in the root directory.
4 
5 #ifndef THERMALINTERACTION_H
6 #define THERMALINTERACTION_H
7 
10 
11 template<class NormalForceSpecies>
12 class ThermalSpecies;
13 
14 template<class NormalForceInteraction>
16 {
17 public:
19 
23  ThermalInteraction(BaseInteractable* P, BaseInteractable* I, unsigned timeStamp);
24 
29 
34 
38  virtual ~ThermalInteraction();
39 
43  void computeNormalForce();
44 
45 };
46 
47 template<class NormalForceInteraction>
49  unsigned timeStamp)
50  : BaseInteraction(P, I, timeStamp), NormalForceInteraction(P, I, timeStamp)
51 {}
52 
53 template<class NormalForceInteraction>
56 {}
57 
58 template<class NormalForceInteraction>
61 {}
62 
63 template<class NormalForceInteraction>
65 {}
66 
68 template<class NormalForceInteraction>
70 {
71  NormalForceInteraction::computeNormalForce();
72  Mdouble radius = 2.0 * NormalForceInteraction::getEffectiveRadius();
73  Mdouble contactArea = constants::pi * radius * std::max(0.0,NormalForceInteraction::getOverlap());
74  const SpeciesType* species = static_cast<const SpeciesType*>(NormalForceInteraction::getBaseSpecies()->getNormalForce());
75  ThermalParticle* pParticle = dynamic_cast<ThermalParticle*>(NormalForceInteraction::getP());
76  ThermalParticle* iParticle = dynamic_cast<ThermalParticle*>(NormalForceInteraction::getI());
77  // if both p and i are particles
78  if (pParticle && iParticle)
79  {
80  /* compute heat transfer rate due to heat conduction, Q=cond*dTemp*area/dist */
81  Mdouble heatTransfer = species->getThermalConductivity()
82  * (pParticle->getTemperature() - iParticle->getTemperature())
83  * contactArea / NormalForceInteraction::getDistance();
84  /* m*dT = Q/c*dt */
85  Mdouble mdT = heatTransfer / species->getHeatCapacity()
86  * NormalForceInteraction::getHandler()->getDPMBase()->getTimeStep();
87  pParticle->addTemperature(-mdT * pParticle->getInvMass());
88  iParticle->addTemperature(mdT * iParticle->getInvMass());
89  }
90 }
91 
92 #endif
float * p
Definition: Tutorial_Map_using.cpp:9
Defines the basic properties that a interactable object can have.
Definition: BaseInteractable.h:34
Stores information about interactions between two interactable objects; often particles but could be ...
Definition: BaseInteraction.h:39
Definition: ThermalInteraction.h:16
ThermalInteraction()
Default Constructor.
Definition: ThermalInteraction.h:54
ThermalSpecies< typename NormalForceInteraction::SpeciesType > SpeciesType
Definition: ThermalInteraction.h:18
virtual ~ThermalInteraction()
Destructor.
Definition: ThermalInteraction.h:64
void computeNormalForce()
Computes the normal forces due to linear plastic visco elastic interaction.
Definition: ThermalInteraction.h:69
Definition: ThermalSpecies.h:14
Mdouble getThermalConductivity() const
Allows heatCapacity_ to be accessed.
Definition: ThermalSpecies.h:247
Mdouble getHeatCapacity() const
Allows heatCapacity_ to be accessed.
Definition: ThermalSpecies.h:232
Definition: ThermalParticle.h:15
void addTemperature(Mdouble temperature)
Definition: ThermalParticle.h:91
Mdouble getTemperature() const
Definition: ThermalParticle.h:80
#define max(a, b)
Definition: datatypes.h:23
#define I
Definition: main.h:127
double P
Uniform pressure.
Definition: TwenteMeshGluing.cpp:77
radius
Definition: UniformPSDSelfTest.py:15
const Mdouble pi
Definition: ExtendedMath.h:23