MechanicalFemPhysics
The GeMA Mechanical FEM Physics Plugin
gmpMaterialPowerLawCreep.h
Go to the documentation of this file.
1 /************************************************************************
2 **
3 ** Copyright (C) 2014 by Carlos Augusto Teixera Mendes
4 ** All rights reserved.
5 **
6 ** This file is part of the "GeMA" software. It's use should respect
7 ** the terms in the license agreement that can be found together
8 ** with this source code.
9 ** It is provided AS IS, with NO WARRANTY OF ANY KIND,
10 ** INCLUDING THE WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR
11 ** A PARTICULAR PURPOSE.
12 **
13 ************************************************************************/
14 
25 #ifndef _GEMA_PLUGIN_MECHANICALMATERIAL_POWERLAWCREEP_H_
26 #define _GEMA_PLUGIN_MECHANICALMATERIAL_POWERLAWCREEP_H_
27 
28 #include "gmpMechanicalConfig.h"
29 #include <gmpFemPhysics.h>
30 #include <gmMathUtils.h>
31 
32 #include <gmpMaterialCreep.h>
33 #include "gmpMechanicPoint.h"
34 
35 class GMP_MECHANICAL_PHYSICS_API_EXPORT GmpMaterialPowerLawCreep : public GmpMaterialCreep
36 {
37 protected:
40  {
41  Af_ID = GmpMaterialCreep::ElementPropertyIds::NUM_PROPERTY_IDS,
45 
46  // --- NO ADDING BELOW THIS LINE
48  };
49 
50 public:
51 
53  GmpMaterialPowerLawCreep(int typeIndex, QString typeName, const GmLogCategory& logger)
54  : GmpMaterialCreep(typeIndex, typeName, logger) {}
55 
58 
60  static GmpFemPhysicsCommonMaterial* instance(GmSimulationData* simulation, int typeIndex, QString typeName, const GmLogCategory& logger)
61  {
62  Q_UNUSED(simulation);
63  return new GmpMaterialPowerLawCreep(typeIndex, typeName, logger);
64  }
65 
66  // Returns a map with material associated properties.
67  virtual const QVariantMap* materialMetaDataMap()
68  {
69  S_TRACE();
70  static QVariantMap m;
71  if (m.isEmpty())
72  {
73  // read the material attribute map from elastic interface material
75 
76  // Adds material properties
77  GmpFemPhysicsCommon::ValueList matPLProp = m["properties"].value<GmpFemPhysicsCommon::ValueList>();
78  matPLProp.append(GmpFemPhysicsCommon::ScalarValue(Af_ID, "Af", QObject::tr("Structure factor of PL"), "", true));
79  matPLProp.append(GmpFemPhysicsCommon::ScalarValue(An_ID, "An", QObject::tr("Stress power of PL"), "", true));
80  matPLProp.append(GmpFemPhysicsCommon::ScalarValue(Am_ID, "Am", QObject::tr("Time power of PL"), "", true));
81  matPLProp.append(GmpFemPhysicsCommon::ScalarValue(Ak_ID, "Ak", QObject::tr("Temperature power of PL"), "", true));
82  m["properties"] = matPLProp;
83  }
84  return &m;
85  }
86 
87  // Returns the stresses according to the material behavior adopted
88  virtual double fillCreepStrainRate(const GmElement* e, const GmpMechanicPoint* mp, const GmVector* coord, const GmVector& Time, double MISES) const
89  {
90  S_TRACE();
91  assert(e);
92 
93  double creepRate = 0.0, A, k, n, m;
94  double cTime, TEMP; //pTime, dTime,
95 
96  // Reads time parameters
97  cTime = Time(0);
98  //pTime = Time(1);
99  //dTime = cTime - pTime;
100 
101  // Reads steady-state creep parameters
102  A = structureFactorPL(e, coord, mp->_index); // Power law multiplier
103  n = stressPowerPL(e, coord, mp->_index); // stress power
104  m = timePowerPL(e, coord, mp->_index); // time power
105  k = temperaturePowerPL(e, coord, mp->_index); // Temperature power PL
106 
107  // No creep for Misses equal to zero
108  if (MISES == 0.0)
109  {
110  return 0.0;
111  }
112 
113  // Read the Temperature at integration point
114  if (nodeAttrAc(T_NA_ID) != NULL)
115  {
116  TEMP = fillTemperatureFromNodalAttr(e, coord);
117  }
118  else
119  {
120  TEMP = temperatureProperty(e, coord, mp->_index);
121  }
122 
123  // Computes the creep strain rate
124  if (cTime > 0)
125  {
126  creepRate = A * pow(TEMP, k) * pow(MISES, n) * pow(cTime, m);
127  }
128 
129 #if 0
130 
131  if (dTime > 0)
132  eCreepRate = (A * pow(MISES, n) * pow(TEMP, k) / (m + 1)) * (pow(cTime, (m + 1)) - pow(pTime, (m + 1))) * (1 / dTime);
133  else
134  eCreepRate = 0;
135 #endif // 0
136 
137  return creepRate;
138  }
139 
141  double timePowerPL(const GmElement* e, const GmVector* coord, int ip) const
142  {
143  return propertyAc(Am_ID)->scalarValueAt(e, coord, ip);
144  }
145 
147  double structureFactorPL(const GmElement* e, const GmVector* coord, int ip) const
148  {
149  return propertyAc(Af_ID)->scalarValueAt(e, coord, ip);
150  }
151 
153  double temperaturePowerPL(const GmElement* e, const GmVector* coord, int ip) const
154  {
155  return propertyAc(Ak_ID)->scalarValueAt(e, coord, ip);
156  }
157 
159  double stressPowerPL(const GmElement* e, const GmVector* coord, int ip) const
160  {
161  return propertyAc(An_ID)->scalarValueAt(e, coord, ip);
162  }
163 };
164 
165 #endif
ElementPropertyIds
IDs for material element properties.
Definition: gmpMaterialCreep.h:39
virtual double fillCreepStrainRate(const GmElement *e, const GmpMechanicPoint *mp, const GmVector *coord, const GmVector &Time, double MISES) const
Computes the creep deformation rate.
Definition: gmpMaterialPowerLawCreep.h:88
double structureFactorPL(const GmElement *e, const GmVector *coord, int ip) const
Returns the power law multiplier.
Definition: gmpMaterialPowerLawCreep.h:147
#define S_TRACE()
The number of property ids above.
Definition: gmpMaterialPowerLawCreep.h:47
Definition: gmpMaterialCreep.h:35
double temperaturePowerPL(const GmElement *e, const GmVector *coord, int ip) const
Returns the temperature power for PL.
Definition: gmpMaterialPowerLawCreep.h:153
double stressPowerPL(const GmElement *e, const GmVector *coord, int ip) const
Returns the stress power for PL.
Definition: gmpMaterialPowerLawCreep.h:159
QString tr(const char *sourceText, const char *disambiguation, int n)
Definition: gmpMechanicPoint.h:32
virtual ~GmpMaterialPowerLawCreep()
Virtual destructor.
Definition: gmpMaterialPowerLawCreep.h:57
virtual const QVariantMap * materialMetaDataMap()
Returns a pointer to the material attribute map, built when the function is called for the first time...
Definition: gmpMaterialPowerLawCreep.h:67
virtual double fillTemperatureFromNodalAttr(const GmElement *e, const GmVector *coord) const
Return temperature at integration point using the nodal Temperature field.
Definition: gmpMaterialCreep.cpp:400
Id for retrieving the stress power for DCL accessor.
Definition: gmpMaterialPowerLawCreep.h:42
virtual double temperatureProperty(const GmElement *e, const GmVector *coord, int ip) const
Returns the Temperature from property table.
Definition: gmpMaterialCreep.h:124
GmpMaterialPowerLawCreep(int typeIndex, QString typeName, const GmLogCategory &logger)
Constructor. Gets as parameters the material index and its name.
Definition: gmpMaterialPowerLawCreep.h:53
double timePowerPL(const GmElement *e, const GmVector *coord, int ip) const
Returns the time power for PL.
Definition: gmpMaterialPowerLawCreep.h:141
Declaration of the GmpMechanicPoint class.
static GmpFemPhysicsCommonMaterial * instance(GmSimulationData *simulation, int typeIndex, QString typeName, const GmLogCategory &logger)
A "factory" function used to register the material with the physics material factory.
Definition: gmpMaterialPowerLawCreep.h:60
Declaration of usefull configuration definitions for the plugin library.
Id for retrieving the thermal activation energy for DCL accessor.
Definition: gmpMaterialPowerLawCreep.h:43
Definition: gmpMaterialPowerLawCreep.h:35
arma::vec GmVector
Id for retrieving the structure factor for UMC accessor.
Definition: gmpMaterialPowerLawCreep.h:44
virtual const QVariantMap * materialMetaDataMap()
Returns a pointer to the material attribute map, built when the function is called for the first time...
Definition: gmpMaterialCreep.cpp:38