Itasca C++ Interface
Loading...
Searching...
No Matches
contactmodelthermal.h
1#pragma once
2// contactmodelthermal.h
3
4#include "contactmodel.h"
5#include "contactmodel/interface/icontactmodelthermal.h"
6
7namespace itascaxd
8{
9 class IContactThermal;
10 class IContactMechanical;
11}
12
13namespace cmodelsxd
14{
15 using namespace itasca;
16 using namespace itascaxd;
17
19 {
20 public:
21 ContactModelThermalState() : power_(0.0), length_(0.0),
22 end1Temperature_(0.0), end2Temperature_(0.0), tempInc_(0.0), gapInc_(0.0)
23 { };
24
25 ~ContactModelThermalState() override { };
26
27 virtual const IContactThermal *getThermalContact() const=0;
28 virtual const IContactMechanical *getMechanicalContact() const=0;
29 const IProgram * getProgram() const override =0;
30
31 double power_; // current total power (from 1 to 2) at this contact (computed by the contact model)
32 double length_; // length of the pipe
33 double end1Temperature_; // temperature in reservoir 1
34 double end2Temperature_; // temperature in reservoir 2
35 double tempInc_; // temperature increment in contact
36 double gapInc_; // gap increment in contact since last coupling step
37 };
38
39 class CONTACTMODEL_EXPORT ContactModelThermal : public IContactModelThermal
40 ,public ContactModel
41 {
42 public:
44 ~ContactModelThermal() override;
45
46 static const char * getPluginPrefix() { return "contactmodelthermal"; }
47 static const char * getPluginDirectory() { return "contactmodels/thermal"; }
48
49 // IContactModelThermal functions.
50
51 IContactModel * getContactModel() override {return this;}
52 const IContactModel * getContactModel() const override {return this;}
53
54 // Returns true if the property was actually updated in the contact model.
55 virtual bool endPropertyUpdated(const string &name,const IContactThermal *c)=0;
56
57 // For the contact model state
58 virtual bool validate(ContactModelThermalState *state,const double &timestep)=0;
59 virtual bool checkActivity(ContactModelThermalState *d) const=0;
60
61 // Returns Activity Distance (defaults to 0.0) -- distance between objects that contact is considered active.
62 double getActivityDistance() const override {return 0.0;}
63
64 // Updates power from end1 to end2.
65 // Returns true if contact is active
66 virtual bool updatePower(ContactModelThermalState *state,const double &timestep)=0;
67
68 // Returns timestep limits (defaults to (0.0,infinity))
69 // These are further timestep restrictions that the contact model can place on the simulation, over and above those implied by stiffness.
70 virtual DVect2 getTimestepLimits(ContactModelThermalState *,const double &) const { return DVect2(0.0,limits<double>::max());}
71
72 // Returns the Resistance per unit length
73 virtual double getEffectiveResistance() const {return 0.0;}
74
75 // For contact specific plotting
76 void getSphereList(const IContact *,std::vector<DVect> *,std::vector<double> *,
77 std::vector<double> *) override { }
78#ifdef THREED
79 void getDiskList(const IContact *,std::vector<DVect> *,std::vector<DVect> *,
80 std::vector<double> *,std::vector<double> *) override { }
81#endif
82 void getCylinderList(const IContact *,std::vector<DVect> *,std::vector<DVect> *,
83 std::vector<double> *,std::vector<double> *,
84 std::vector<double> *) override { }
85 };
86} // namespace cmodel
87
88// 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:41
Definition contactmodelthermal.h:19
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:38
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:14
Itasca Library standard namespace, specific to 2D or 3D.
Definition icontactmodule.h:6