Itasca C++ Interface
contactmodelthermal.h
1 #pragma once
2 // contactmodelthermal.h
3 
4 #include "contactmodel.h"
5 #include "contactmodel/interface/icontactmodelthermal.h"
6 
7 #ifndef __GNUC__
8 #pragma warning(push)
9 #pragma warning(disable:4251)
10 #endif
11 namespace itascaxd
12 {
13  class IContactThermal;
14  class IContactMechanical;
15 }
16 
17 namespace cmodelsxd
18 {
19  using namespace itasca;
20  using namespace itascaxd;
21 
23  {
24  public:
25  ContactModelThermalState() : power_(0.0), length_(0.0),
26  end1Temperature_(0.0), end2Temperature_(0.0), tempInc_(0.0), gapInc_(0.0)
27  { };
28 
29  ~ContactModelThermalState() override { };
30 
31  virtual const IContactThermal *getThermalContact() const=0;
32  virtual const IContactMechanical *getMechanicalContact() const=0;
33  const IProgram * getProgram() const override =0;
34 
35  double power_; // current total power (from 1 to 2) at this contact (computed by the contact model)
36  double length_; // length of the pipe
37  double end1Temperature_; // temperature in reservoir 1
38  double end2Temperature_; // temperature in reservoir 2
39  double tempInc_; // temperature increment in contact
40  double gapInc_; // gap increment in contact since last coupling step
41  };
42 
43  class CONTACTMODEL_EXPORT ContactModelThermal : public IContactModelThermal
44  ,public ContactModel
45  {
46  public:
48  ~ContactModelThermal() override;
49 
50  static const char * getPluginPrefix() { return "contactmodelthermal"; }
51  static const char * getPluginDirectory() { return "contactmodels/thermal"; }
52 
53  // IContactModelThermal functions.
54 
55  IContactModel * getContactModel() override {return this;}
56  const IContactModel * getContactModel() const override {return this;}
57 
58  // Returns true if the property was actually updated in the contact model.
59  virtual bool endPropertyUpdated(const QString &name,const IContactThermal *c)=0;
60 
61  // For the contact model state
62  virtual bool validate(ContactModelThermalState *state,const double &timestep)=0;
63  virtual bool checkActivity(ContactModelThermalState *d) const=0;
64 
65  // Returns Activity Distance (defaults to 0.0) -- distance between objects that contact is considered active.
66  double getActivityDistance() const override {return 0.0;}
67 
68  // Updates power from end1 to end2.
69  // Returns true if contact is active
70  virtual bool updatePower(ContactModelThermalState *state,const double &timestep)=0;
71 
72  // Returns timestep limits (defaults to (0.0,infinity))
73  // These are further timestep restrictions that the contact model can place on the simulation, over and above those implied by stiffness.
74  virtual DVect2 getTimestepLimits(ContactModelThermalState *,const double &) const { return DVect2(0.0,limits<double>::max());}
75 
76  // Returns the Resistance per unit length
77  virtual double getEffectiveResistance() const {return 0.0;}
78 
79  // For contact specific plotting
80  void getSphereList(const IContact *,std::vector<DVect> *,std::vector<double> *,
81  std::vector<double> *) override { }
82 #ifdef THREED
83  void getDiskList(const IContact *,std::vector<DVect> *,std::vector<DVect> *,
84  std::vector<double> *,std::vector<double> *) override { }
85 #endif
86  void getCylinderList(const IContact *,std::vector<DVect> *,std::vector<DVect> *,
87  std::vector<double> *,std::vector<double> *,
88  std::vector<double> *) override { }
89  };
90 } // namespace cmodel
91 
92 #ifndef __GNUC__
93 #pragma warning(pop)
94 #endif
95 
96 // EoF
Contact model implementation.
Definition: contactmodel.h:80
The ContactModelState class holds necessary information to communicate back and forth between the cod...
Definition: contactmodel.h:48
Definition: contactmodelthermal.h:45
Definition: contactmodelthermal.h:23
const IProgram * getProgram() const override=0
Return a const pointer to the IPrgram interface.
The main program access point.
Definition: iprogram.h:37
Contact class.
Definition: icontact.h:33
ContactMechanical class.
Definition: icontactmechanical.h:37
ContactThermal class.
Definition: icontactthermal.h:36
debug checked shorthand for std::numeric_limits<T>::
Definition: limit.h:25
Contact model class.
namespace Itasca
Definition: basememory.cpp:10
Itasca Library standard namespace, specific to 2D or 3D.
Definition: icontactmodule.h:4