KratosMultiphysics
KRATOS Multiphysics (Kratos) is a framework for building parallel, multi-disciplinary simulation software, aiming at modularity, extensibility, and high performance. Kratos is written in C++, and counts with an extensive Python interface.
nonlocal_v2_gens_nova_model.hpp
Go to the documentation of this file.
1 //
2 // Project Name: KratosConstitutiveModelsApplication $
3 // Created by: $Author: LMonforte $
4 // Last modified by: $Co-Author: MCiantia $
5 // Date: $Date: July 2018 $
6 // Revision: $Revision: 0.0 $
7 //
8 //
9 
10 #if !defined(KRATOS_NONLOCAL_V2_GENS_NOVA_MODEL_H_INCLUDED )
11 #define KRATOS_NONLOCAL_V2_GENS_NOVA_MODEL_H_INCLUDED
12 
13 // System includes
14 
15 // External includes
16 #include <iostream>
17 #include <fstream>
18 
19 // Project includes
25 
26 
27 
28 //***** the hardening law associated to this Model has ... variables
29 // 0. Plastic multiplier
30 // 1. Plastic Volumetric deformation
31 // 2. Plastic Deviatoric deformation
32 // 3. ps (mechanical)
33 // 4. pt (ageing)
34 // 5. pcSTAR = ps + (1+k) p_t
35 // 6. Plastic Volumetric deformation Absolut Value
36 // 7. NonLocal Plastic Vol Def
37 // 8. NonLocal Plastic Dev Def
38 // 9. NonLocal Plastic Vol Def ABS
39 // ... (the number now is then..., xD)
40 
41 namespace Kratos
42 {
45 
48 
52 
56 
60 
64 
66 
68  class KRATOS_API(CONSTITUTIVE_MODELS_APPLICATION) NonlocalV2GensNovaModel : public StructuredSoilModel<TamagniniModel, GensNovaYieldSurface<GensNovaHardeningRule> >
69  {
70  public:
71 
74 
75  //elasticity model
76  //typedef BorjaModel ElasticityModelType;
78  typedef ElasticityModelType::Pointer ElasticityModelPointer;
79 
80  //yield surface
83  typedef YieldSurfaceType::Pointer YieldSurfacePointer;
84 
85  //base type
87 
88  //common types
89  typedef BaseType::Pointer BaseTypePointer;
97 
98 
101 
105 
108 
111 
114  {
115  BaseType::operator=(rOther);
116  return *this;
117  }
118 
120  ConstitutiveModel::Pointer Clone() const override
121  {
122  return ( NonlocalV2GensNovaModel::Pointer(new NonlocalV2GensNovaModel(*this)) );
123  }
124 
127 
128 
132 
133 
137 
138 
142 
143 
147 
148 
152 
154  virtual std::string Info() const override
155  {
156  std::stringstream buffer;
157  buffer << "NonlocalV2GensNovaModel" ;
158  return buffer.str();
159  }
160 
162  virtual void PrintInfo(std::ostream& rOStream) const override
163  {
164  rOStream << "NonlocalV2GensNovaModel";
165  }
166 
168  virtual void PrintData(std::ostream& rOStream) const override
169  {
170  rOStream << "NonlocalV2GensNovaModel Data";
171  }
172 
173 
177 
178 
180 
181  protected:
184 
185 
189 
190 
194 
195 
199  // Calculate Stress and constitutive tensor
200  void CalculateStressAndConstitutiveTensors(ModelDataType& rValues, MatrixType& rStressMatrix, Matrix& rConstitutiveMatrix) override
201  {
202  KRATOS_TRY
203 
204  { // modify the internal variables to make it nonlocal
205  }
206 
207  double LocalPlasticVolStrain = mInternal.Variables[1];
208  double NonLocalPlasticVolStrain = mInternal.Variables[7];
209  mInternal.Variables[1] = mInternal.Variables[7];
210 
211  double LocalPlasticDevStrain = mInternal.Variables[2];
212  double NonLocalPlasticDevStrain = mInternal.Variables[8];
213  mInternal.Variables[2] = mInternal.Variables[8];
214 
215  double LocalPlasticVolStrainAbs = mInternal.Variables[6];
216  double NonLocalPlasticVolStrainAbs = mInternal.Variables[9];
217  mInternal.Variables[6] = mInternal.Variables[9];
218 
219  // integrate "analytically" ps and pt from plastic variables. Then update the internal variables.
220 
221  PlasticDataType Variables;
222  this->InitializeVariables( rValues, Variables);
223 
224  const ModelDataType & rModelData = Variables.GetModelData();
225  const Properties & rMaterialProperties = rModelData.GetProperties();
226 
227  const double & rPs0 = rMaterialProperties[PS];
228  const double & rPt0 = rMaterialProperties[PT];
229  const double & rChis = rMaterialProperties[CHIS];
230  const double & rChit = rMaterialProperties[CHIT];
231  const double & rhos = rMaterialProperties[RHOS];
232  const double & rhot = rMaterialProperties[RHOT];
233  const double & k = rMaterialProperties[KSIM];
234 
235  const double & rPlasticVolDef = Variables.Internal.Variables[1];
236  const double & rPlasticDevDef = Variables.Internal.Variables[2];
237  const double & rPlasticVolDefAbs = Variables.Internal.Variables[6];
238 
239  double sq2_3 = sqrt(2.0/3.0);
240 
241  double ps;
242  ps = rPlasticVolDef + sq2_3 * rChis * rPlasticDevDef;
243  ps = (-rPs0) * std::exp( -rhos*ps);
244 
245  double pt;
246  pt = rPlasticVolDefAbs + sq2_3 * rChit * rPlasticDevDef;
247  pt = (-rPt0) * std::exp( rhot*pt);
248 
249  double pm;
250  pm = ps + (1.0+k)*pt;
251 
252 
253  mInternal.Variables[3] = ps;
254  mInternal.Variables[4] = pt;
255  mInternal.Variables[5] = pm;
256 
257  StructuredSoilModel::CalculateStressAndConstitutiveTensors( rValues, rStressMatrix, rConstitutiveMatrix);
258 
259  if ( rValues.State.Is(ConstitutiveModelData::UPDATE_INTERNAL_VARIABLES) ) {
260 
261  mPreviousInternal.Variables[7] = mInternal.Variables[7];
262  mPreviousInternal.Variables[8] = mInternal.Variables[8];
263  mPreviousInternal.Variables[9] = mInternal.Variables[9];
264 
265  mInternal.Variables[7] = mInternal.Variables[1];
266  mInternal.Variables[8] = mInternal.Variables[2];
267  mInternal.Variables[9] = mInternal.Variables[6];
268 
269  mInternal.Variables[1] = LocalPlasticVolStrain + ( mInternal.Variables[1] - NonLocalPlasticVolStrain);
270  mInternal.Variables[2] = LocalPlasticDevStrain + ( mInternal.Variables[2] - NonLocalPlasticDevStrain);
271  mInternal.Variables[6] = LocalPlasticVolStrainAbs + ( mInternal.Variables[6] - NonLocalPlasticVolStrainAbs);
272 
273 
274 
275  } else {
276  mInternal.Variables[1] = LocalPlasticVolStrain;
277  mInternal.Variables[2] = LocalPlasticDevStrain;
278  mInternal.Variables[6] = LocalPlasticVolStrainAbs;
279  }
280 
281 
282 
283  KRATOS_CATCH("")
284  }
288 
289 
293 
294 
298 
299 
301 
302  private:
305 
306 
310 
311 
315 
316 
320 
321 
325 
326 
330 
331 
335  friend class Serializer;
336 
337  virtual void save(Serializer& rSerializer) const override
338  {
340  }
341 
342  virtual void load(Serializer& rSerializer) override
343  {
344  KRATOS_SERIALIZE_LOAD_BASE_CLASS( rSerializer, BaseType )
345  }
346 
350 
351 
353 
354  }; // Class NonlocalV2GensNovaModel
355 
357 
360 
361 
365 
366 
370 
371 
373 
375 
376 
377 } // namespace Kratos.
378 
379 #endif // KRATOS_NONLOCAL_V2_GENS_NOVA_MODEL_H_INCLUDED defined
380 
381 
PeriodicInterfaceProcess & operator=(const PeriodicInterfaceProcess &)=delete
bool Is(Flags const &rOther) const
Definition: flags.h:274
Short class definition.
Definition: gens_nova_hardening_rule.hpp:48
Short class definition.
Definition: gens_nova_yield_surface.hpp:51
Definition: amatrix_interface.h:41
void CalculateStressAndConstitutiveTensors(ModelDataType &rValues, MatrixType &rStressMatrix, Matrix &rConstitutiveMatrix) override
Definition: non_associative_plasticity_model.hpp:222
BaseType::PlasticDataType PlasticDataType
Definition: non_associative_plasticity_model.hpp:86
Short class definition.
Definition: nonlocal_v2_gens_nova_model.hpp:69
BaseType::MatrixType MatrixType
Definition: nonlocal_v2_gens_nova_model.hpp:92
BaseType::PlasticDataType PlasticDataType
Definition: nonlocal_v2_gens_nova_model.hpp:95
virtual ~NonlocalV2GensNovaModel()
Destructor.
Definition: nonlocal_v2_gens_nova_model.hpp:126
BaseType::Pointer BaseTypePointer
Definition: nonlocal_v2_gens_nova_model.hpp:89
NonlocalV2GensNovaModel & operator=(NonlocalV2GensNovaModel const &rOther)
Assignment operator.
Definition: nonlocal_v2_gens_nova_model.hpp:113
void CalculateStressAndConstitutiveTensors(ModelDataType &rValues, MatrixType &rStressMatrix, Matrix &rConstitutiveMatrix) override
Definition: nonlocal_v2_gens_nova_model.hpp:200
virtual std::string Info() const override
Turn back information as a string.
Definition: nonlocal_v2_gens_nova_model.hpp:154
NonlocalV2GensNovaModel()
Default constructor.
Definition: nonlocal_v2_gens_nova_model.hpp:107
ConstitutiveModel::Pointer Clone() const override
Clone.
Definition: nonlocal_v2_gens_nova_model.hpp:120
ElasticityModelType::Pointer ElasticityModelPointer
Definition: nonlocal_v2_gens_nova_model.hpp:78
BaseType::ModelDataType ModelDataType
Definition: nonlocal_v2_gens_nova_model.hpp:93
NonlocalV2GensNovaModel(NonlocalV2GensNovaModel const &rOther)
Copy constructor.
Definition: nonlocal_v2_gens_nova_model.hpp:110
virtual void PrintInfo(std::ostream &rOStream) const override
Print information about this object.
Definition: nonlocal_v2_gens_nova_model.hpp:162
YieldSurfaceType::Pointer YieldSurfacePointer
Definition: nonlocal_v2_gens_nova_model.hpp:83
BaseType::InternalVariablesType InternalVariablesType
Definition: nonlocal_v2_gens_nova_model.hpp:96
virtual void PrintData(std::ostream &rOStream) const override
Print object's data.
Definition: nonlocal_v2_gens_nova_model.hpp:168
BaseType::MaterialDataType MaterialDataType
Definition: nonlocal_v2_gens_nova_model.hpp:94
KRATOS_CLASS_POINTER_DEFINITION(NonlocalV2GensNovaModel)
Pointer definition of NonlocalV2GensNovaModel.
BaseType::VoigtIndexType VoigtIndexType
Definition: nonlocal_v2_gens_nova_model.hpp:91
BaseType::SizeType SizeType
Definition: nonlocal_v2_gens_nova_model.hpp:90
StructuredSoilModel< ElasticityModelType, YieldSurfaceType > BaseType
Definition: nonlocal_v2_gens_nova_model.hpp:86
TamagniniModel ElasticityModelType
Definition: nonlocal_v2_gens_nova_model.hpp:77
GensNovaHardeningRule HardeningRuleType
Definition: nonlocal_v2_gens_nova_model.hpp:81
GensNovaYieldSurface< HardeningRuleType > YieldSurfaceType
Definition: nonlocal_v2_gens_nova_model.hpp:82
Short class definition.
Definition: plasticity_model.hpp:50
TYieldSurface::InternalVariablesType InternalVariablesType
Definition: plasticity_model.hpp:69
ConstitutiveModelData::SizeType SizeType
Definition: plasticity_model.hpp:63
ConstitutiveModelData::VoigtIndexType VoigtIndexType
Definition: plasticity_model.hpp:64
TYieldSurface::PlasticDataType PlasticDataType
Definition: plasticity_model.hpp:68
Properties encapsulates data shared by different Elements or Conditions. It can store any type of dat...
Definition: properties.h:69
The serialization consists in storing the state of an object into a storage format like data file or ...
Definition: serializer.h:123
Short class definition.
Definition: structured_soil_model.hpp:66
Short class definition.
Definition: tamagnini_model.hpp:48
#define KRATOS_SERIALIZE_SAVE_BASE_CLASS(Serializer, BaseType)
Definition: define.h:812
#define KRATOS_CATCH(MoreInfo)
Definition: define.h:110
#define KRATOS_TRY
Definition: define.h:109
#define KRATOS_SERIALIZE_LOAD_BASE_CLASS(Serializer, BaseType)
Definition: define.h:815
void InitializeVariables(TContainerType &rContainer, const Variable< TDataType > &rOutputVariable, const Variable< TDataType > &rReferenceVariable)
Definition: temporal_method_utilities.h:36
REF: G. R. Cowper, GAUSSIAN QUADRATURE FORMULAS FOR TRIANGLES.
Definition: mesh_condition.cpp:21
def load(f)
Definition: ode_solve.py:307
int k
Definition: quadrature.py:595
Definition: constitutive_model_data.hpp:92
Definition: constitutive_model_data.hpp:383
const Properties & GetProperties() const
Definition: constitutive_model_data.hpp:431
Flags State
Definition: constitutive_model_data.hpp:399