NeoPZ
pzthermicelast3d.cpp
Go to the documentation of this file.
1 
6 #include "pzthermicelast3d.h"
7 
8 TPZThermicElast3D::TPZThermicElast3D(int nummat, STATE ThermalCoeff, STATE RefTemp, STATE E, STATE poisson, TPZVec<STATE> &force):
10 TPZElasticity3D(nummat,E,poisson,force){
12  this->fThermalCoeff = ThermalCoeff;
13  this->fRefTemperature = RefTemp;
14 }
15 
17 
19  REAL weight,
21  TPZFMatrix<STATE> &ef){
22 
23  TPZElasticity3D::Contribute(data, weight, ek, ef);
24 
25  int numbersol = data.sol.size();
26  if (numbersol != 1) {
27  DebugStop();
28  }
29 
30  this->ContributeThermalStress(data.sol[0], data.phi, data.dphix, weight, ef);
31 }
32 
34 
35  const int nshape = phi.Rows();
36  const STATE E = this->fE;
37  const STATE nu = this->fPoisson;
38  const STATE RefTemp = this->fRefTemperature;
39 
40  STATE FinalTemp;
41  if (this->IsReferredTemperatureField()) FinalTemp = sol[0];
42  else FinalTemp = this->fFinalTemperature;
43 
44  const STATE DeltaT = FinalTemp - RefTemp;
45  const STATE Gamma = this->fThermalCoeff;
46 
47  const STATE ThermalStress = DeltaT * E * Gamma / (1.-2.*nu);
48 
49  int i, k;
50  for(i = 0; i < nshape; i++) {
51  for(k = 0; k < 3; k++){
52  ef(i*3+k, 0) += weight * dphi(k, i) * ThermalStress;
53  }//kd
54  }//in
55 
56 }//method
57 
59  TPZFMatrix<REAL> &axes, int var, TPZVec<STATE> &Solout){
60 
61  if (var == EPrincipalStress || var == EVonMisesStress || var == EStress || var == EStress1){
62  //When computing a stress solution, the thermal stress must be subtracted from the elastic stress
63  //For that purpose the thermal strain will be subtracted before stress computations
64 
65  const STATE RefTemp = this->fRefTemperature;
66  STATE FinalTemp;
67  if (this->IsReferredTemperatureField()){
68  FinalTemp = Sol[3];
69  }
70  else FinalTemp = this->fFinalTemperature;
71 
72  const STATE DeltaT = FinalTemp - RefTemp;
73  const STATE Gamma = this->fThermalCoeff;
74 
75  const STATE ThermalStrain = DeltaT * Gamma;
76  for(int it = 0; it < 3; it++) DSol(it,it) += -1. * ThermalStrain;
77  }//if var
78 
79  TPZElasticity3D::Solution(Sol, DSol, axes, var, Solout);
80 
81 }
82 
84  return Hash("TPZThermicElast3D") ^ TPZElasticity3D::ClassId() << 1;
85 }
Contains the TPZThermicElast3D class which implements a 3D isotropic elasticity material with thermal...
virtual void Solution(TPZVec< STATE > &Sol, TPZFMatrix< STATE > &DSol, TPZFMatrix< REAL > &axes, int var, TPZVec< STATE > &Solout) override
Post-processing method. Based on solution Sol and its derivatives DSol, it computes the post-processe...
Definition: pzelast3d.cpp:831
This class implements a 3D isotropic elasticity material with thermal stress.
This class implements a 3D isotropic elasticity material.
Definition: pzelast3d.h:21
virtual void Contribute(TPZMaterialData &data, REAL weight, TPZFMatrix< STATE > &ek, TPZFMatrix< STATE > &ef) override
It computes a contribution to the stiffness matrix and load vector at one integration point...
Definition: pzelast3d.cpp:88
STATE fThermalCoeff
Thermal expansion coefficient of the material.
TPZFNMatrix< 220, REAL > phi
vector of shapefunctions (format is dependent on the value of shapetype)
virtual int ClassId() const override
Define the class id associated with the class.
Definition: pzelast3d.cpp:1272
bool IsReferredTemperatureField()
TPZFNMatrix< 660, REAL > dphix
values of the derivative of the shape functions
int64_t size() const
Returns the number of elements of the vector.
Definition: pzvec.h:196
#define DebugStop()
Returns a message to user put a breakpoint in.
Definition: pzerror.h:20
TPZThermicElast3D(int nummat, STATE ThermalCoeff, STATE RefTemp, STATE E, STATE poisson, TPZVec< STATE > &force)
Class constructor.
void ContributeThermalStress(TPZVec< STATE > &sol, TPZFMatrix< REAL > &phi, TPZFMatrix< REAL > &dphi, REAL weight, TPZFMatrix< STATE > &ef)
int64_t Rows() const
Returns number of rows.
Definition: pzmatrix.h:803
virtual void Contribute(TPZMaterialData &data, REAL weight, TPZFMatrix< STATE > &ek, TPZFMatrix< STATE > &ef) override
Contribute to stiff matrix and load vector.
void SetReferredTemperatureField()
virtual ~TPZThermicElast3D()
Default destructor.
int32_t Hash(std::string str)
Definition: TPZHash.cpp:10
STATE fRefTemperature
Temperature of reference. The thermal stress is given by the difference of the temperature field to t...
int ClassId() const override
Define the class id associated with the class.
STATE fPoisson
Poisson&#39;s ratio.
Definition: pzelast3d.h:261
virtual void Solution(TPZVec< STATE > &Sol, TPZFMatrix< STATE > &DSol, TPZFMatrix< REAL > &axes, int var, TPZVec< STATE > &Solout) override
Post-processing method. Based on solution Sol and its derivatives DSol, it computes the post-processe...
STATE fE
Young&#39;s modulus.
Definition: pzelast3d.h:258
STATE fFinalTemperature
When solving problem with a constant field of temperature (fReferred = false) fFinalTemperature is t...
TPZSolVec sol
vector of the solutions at the integration point