HeatFluidCoupledInteraction.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 HeatFluidCoupledINTERACTION_H
6 #define HeatFluidCoupledINTERACTION_H
7 
8 #include "ThermalInteraction.h"
9 //#include "Species/NormalForceSpecies/HeatFluidCoupledSpecies.h"
11 
12 template<class NormalForceSpecies>
14 
15 template<class NormalForceInteraction>
16 class HeatFluidCoupledInteraction : public ThermalInteraction<NormalForceInteraction>
17 {
18 public:
20 
25  : BaseInteraction(P, I, timeStamp), ThermalInteraction<NormalForceInteraction>(P, I, timeStamp)
26  {}
27 
33  {}
34 
35 
41  {}
42 
47  {}
48 
52  void computeNormalForce();
53 };
54 
56 template<class NormalForceInteraction>
58 {
59  NormalForceInteraction::computeNormalForce();
60  Mdouble radius = 2.0 * NormalForceInteraction::getEffectiveRadius();
61  Mdouble contactArea = constants::pi * radius * std::max(0.0,NormalForceInteraction::getOverlap());
62  const SpeciesType* species = static_cast<const SpeciesType*>(NormalForceInteraction::getBaseSpecies()->getNormalForce());
63  auto pParticle = dynamic_cast<HeatFluidCoupledParticle*>(NormalForceInteraction::getP());
64  auto iParticle = dynamic_cast<HeatFluidCoupledParticle*>(NormalForceInteraction::getI());
65  // if both p and i are particles
66  if (pParticle && iParticle)
67  {
68  /* compute heat conduction, Q = lambda * A dT / L, */
69  Mdouble heatTransfer = species->getThermalConductivity()
70  * (pParticle->getTemperature() - iParticle->getTemperature())
71  * contactArea / NormalForceInteraction::getDistance();
72  /* m*dT = Q/c*dt */
73  Mdouble mdT = heatTransfer / species->getHeatCapacity()
74  * NormalForceInteraction::getHandler()->getDPMBase()->getTimeStep();
75  pParticle->addTemperature(-mdT * pParticle->getInvMass());
76  iParticle->addTemperature(mdT * iParticle->getInvMass());
77  }
78 }
79 
80 #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: HeatFluidCoupledInteraction.h:17
HeatFluidCoupledSpecies< typename NormalForceInteraction::SpeciesType > SpeciesType
Definition: HeatFluidCoupledInteraction.h:19
void computeNormalForce()
Computes the normal forces due to linear plastic visco elastic interaction.
Definition: HeatFluidCoupledInteraction.h:57
virtual ~HeatFluidCoupledInteraction()
Destructor.
Definition: HeatFluidCoupledInteraction.h:46
HeatFluidCoupledInteraction(const HeatFluidCoupledInteraction &p)
Copy constructor.
Definition: HeatFluidCoupledInteraction.h:39
HeatFluidCoupledInteraction()
Default Constructor.
Definition: HeatFluidCoupledInteraction.h:31
HeatFluidCoupledInteraction(BaseInteractable *P, BaseInteractable *I, unsigned timeStamp)
Constructor.
Definition: HeatFluidCoupledInteraction.h:24
Species for the HeatFluidCoupledParticle.
Definition: HeatFluidCoupledSpecies.h:14
Class of particles that store both temperature and liquid volume, which is adapted for the CFD-DEM st...
Definition: HeatFluidCoupledParticle.h:25
Definition: ThermalInteraction.h:16
Mdouble getThermalConductivity() const
Allows heatCapacity_ to be accessed.
Definition: ThermalSpecies.h:247
Mdouble getHeatCapacity() const
Allows heatCapacity_ to be accessed.
Definition: ThermalSpecies.h:232
#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