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.
DEM_D_Linear_viscous_Coulomb_CL.h
Go to the documentation of this file.
1 //Authors: M.A. Celigueta and S. Latorre (CIMNE)
2 // Date: July 2015
3 
4 #if !defined(DEM_D_LINEAR_VISCOUS_COULOMB_CL_H_INCLUDED)
5 #define DEM_D_LINEAR_VISCOUS_COULOMB_CL_H_INCLUDED
6 
7 #include <string>
8 #include <iostream>
10 
11 namespace Kratos {
12 
13  class SphericParticle;
14 
15  class KRATOS_API(DEM_APPLICATION) DEM_D_Linear_viscous_Coulomb : public DEMDiscontinuumConstitutiveLaw {
16 
17  public:
18 
20 
22 
24 
26 
27  std::string GetTypeOfLaw() override;
28 
29  void Check(Properties::Pointer pProp) const override;
30 
31  DEMDiscontinuumConstitutiveLaw::Pointer Clone() const override;
32 
33  std::unique_ptr<DEMDiscontinuumConstitutiveLaw> CloneUnique() override;
34 
35  void InitializeContact(SphericParticle* const element1, SphericParticle* const element2, const double indentation) override;
36 
37  void InitializeContactWithFEM(SphericParticle* const element, Condition* const wall, const double indentation, const double ini_delta = 0.0) override;
38 
39  void CalculateForces(const ProcessInfo& r_process_info,
40  const double OldLocalElasticContactForce[3],
41  double LocalElasticContactForce[3],
42  double LocalDeltDisp[3],
43  double LocalRelVel[3],
44  double indentation,
45  double previous_indentation,
46  double ViscoDampingLocalContactForce[3],
47  double& cohesive_force,
48  SphericParticle* element1,
49  SphericParticle* element2,
50  bool& sliding, double LocalCoordSystem[3][3]) override;
51 
52  void CalculateForcesWithFEM(const ProcessInfo& r_process_info,
53  const double OldLocalElasticContactForce[3],
54  double LocalElasticContactForce[3],
55  double LocalDeltDisp[3],
56  double LocalRelVel[3],
57  double indentation,
58  double previous_indentation,
59  double ViscoDampingLocalContactForce[3],
60  double& cohesive_force,
61  SphericParticle* const element,
62  Condition* const wall,
63  bool& sliding) override;
64 
65 
66  double CalculateNormalForce(SphericParticle* const element1,
67  SphericParticle* const element2,
68  const double indentation,
69  double LocalCoordSystem[3][3]) override;
70 
71  double CalculateNormalForce(SphericParticle* const element,
72  Condition* const wall,
73  const double indentation) override;
74 
75  double CalculateNormalForce(const double indentation) override;
76 
77  double CalculateCohesiveNormalForce(SphericParticle* const element1,
78  SphericParticle* const element2,
79  const double indentation) override;
80 
81  double CalculateCohesiveNormalForceWithFEM(SphericParticle* const element,
82  Condition* const wall,
83  const double indentation) override;
84 
85  Properties& GetPropertiesOfThisContact(SphericParticle* const element, SphericParticle* const neighbour);
86  Properties& GetPropertiesOfThisContact(SphericParticle* const element, Condition* const neighbour);
87 
88  template <class NeighbourClassType>
89  void CalculateTangentialForceWithNeighbour(const double normal_contact_force,
90  const double OldLocalElasticContactForce[3],
91  double LocalElasticContactForce[3],
92  double ViscoDampingLocalContactForce[3],
93  const double LocalDeltDisp[3],
94  const double LocalRelVel[3],
95  bool& sliding,
96  SphericParticle* const element,
97  NeighbourClassType* const neighbour,
98  double indentation,
99  double previous_indentation,
100  double& modulus_of_elastic_shear_force,
101  double& maximum_admissible_shear_force){
102 
103  LocalElasticContactForce[0] = OldLocalElasticContactForce[0] - mKt * LocalDeltDisp[0];
104  LocalElasticContactForce[1] = OldLocalElasticContactForce[1] - mKt * LocalDeltDisp[1];
105 
106  modulus_of_elastic_shear_force = sqrt(LocalElasticContactForce[0] * LocalElasticContactForce[0] + LocalElasticContactForce[1] * LocalElasticContactForce[1]);
107 
108  Properties& properties_of_this_contact = GetPropertiesOfThisContact(element, neighbour);
109  const double equiv_tg_of_static_fri_ang = properties_of_this_contact[STATIC_FRICTION];
110  const double equiv_tg_of_dynamic_fri_ang = properties_of_this_contact[DYNAMIC_FRICTION];
111  const double equiv_friction_decay_coefficient = properties_of_this_contact[FRICTION_DECAY];
112 
113  const double ShearRelVel = sqrt(LocalRelVel[0] * LocalRelVel[0] + LocalRelVel[1] * LocalRelVel[1]);
114  double equiv_friction = equiv_tg_of_dynamic_fri_ang + (equiv_tg_of_static_fri_ang - equiv_tg_of_dynamic_fri_ang) * exp(-equiv_friction_decay_coefficient * ShearRelVel);
115 
116  maximum_admissible_shear_force = normal_contact_force * equiv_friction;
117 
118  const double tangential_contact_force_0 = LocalElasticContactForce[0] + ViscoDampingLocalContactForce[0];
119  const double tangential_contact_force_1 = LocalElasticContactForce[1] + ViscoDampingLocalContactForce[1];
120 
121  const double ActualTotalShearForce = sqrt(tangential_contact_force_0 * tangential_contact_force_0 + tangential_contact_force_1 * tangential_contact_force_1);
122 
123  if (ActualTotalShearForce > maximum_admissible_shear_force) {
124 
125  const double ActualElasticShearForce = sqrt(LocalElasticContactForce[0] * LocalElasticContactForce[0] + LocalElasticContactForce[1] * LocalElasticContactForce[1]);
126 
127  const double dot_product = LocalElasticContactForce[0] * ViscoDampingLocalContactForce[0] + LocalElasticContactForce[1] * ViscoDampingLocalContactForce[1];
128  const double ViscoDampingLocalContactForceModule = sqrt(ViscoDampingLocalContactForce[0] * ViscoDampingLocalContactForce[0] +\
129  ViscoDampingLocalContactForce[1] * ViscoDampingLocalContactForce[1]);
130 
131  if (dot_product >= 0.0) {
132 
133  if (ActualElasticShearForce > maximum_admissible_shear_force) {
134  const double fraction = maximum_admissible_shear_force / ActualElasticShearForce;
135  LocalElasticContactForce[0] = LocalElasticContactForce[0] * fraction;
136  LocalElasticContactForce[1] = LocalElasticContactForce[1] * fraction;
137  ViscoDampingLocalContactForce[0] = 0.0;
138  ViscoDampingLocalContactForce[1] = 0.0;
139  }
140  else {
141  const double ActualViscousShearForce = maximum_admissible_shear_force - ActualElasticShearForce;
142  const double fraction = ActualViscousShearForce / ViscoDampingLocalContactForceModule;
143  ViscoDampingLocalContactForce[0] *= fraction;
144  ViscoDampingLocalContactForce[1] *= fraction;
145  }
146  }
147  else {
148  if (ViscoDampingLocalContactForceModule >= ActualElasticShearForce) {
149  const double fraction = (maximum_admissible_shear_force + ActualElasticShearForce) / ViscoDampingLocalContactForceModule;
150  ViscoDampingLocalContactForce[0] *= fraction;
151  ViscoDampingLocalContactForce[1] *= fraction;
152  }
153  else {
154  const double fraction = maximum_admissible_shear_force / ActualElasticShearForce;
155  LocalElasticContactForce[0] = LocalElasticContactForce[0] * fraction;
156  LocalElasticContactForce[1] = LocalElasticContactForce[1] * fraction;
157  ViscoDampingLocalContactForce[0] = 0.0;
158  ViscoDampingLocalContactForce[1] = 0.0;
159  }
160  }
161  sliding = true;
162  }
163  }
164 
165  void CalculateViscoDampingForce(double LocalRelVel[3],
166  double ViscoDampingLocalContactForce[3],
167  SphericParticle* const element1,
168  SphericParticle* const element2);
169 
170  void CalculateViscoDampingForceWithFEM(double LocalRelVel[3],
171  double ViscoDampingLocalContactForce[3],
172  SphericParticle* const element,
173  Condition* const wall);
174 
175  void CalculateElasticEnergyDEM(double& elastic_energy,
176  double indentation,
177  double LocalElasticContactForce[3]);
178 
179  void CalculateInelasticFrictionalEnergyDEM(double& inelastic_frictional_energy,
180  double& AuxElasticShearForce,
181  double LocalElasticContactForce[3]);
182 
183  void CalculateInelasticViscodampingEnergyDEM(double& inelastic_viscodamping_energy,
184  double ViscoDampingLocalContactForce[3],
185  double LocalDeltDisp[3]);
186 
187  void CalculateElasticEnergyFEM(double& elastic_energy,
188  double indentation,
189  double LocalElasticContactForce[3]);
190 
191  void CalculateInelasticFrictionalEnergyFEM(double& inelastic_frictional_energy,
192  double& AuxElasticShearForce,
193  double LocalElasticContactForce[3]);
194 
195  void CalculateInelasticViscodampingEnergyFEM(double& inelastic_viscodamping_energy,
196  double ViscoDampingLocalContactForce[3],
197  double LocalDeltDisp[3]);
198 
199  protected:
200 
201  std::size_t GetElementId(SphericParticle* element);
202 
203  private:
204 
205  friend class Serializer;
206 
207  virtual void save(Serializer& rSerializer) const override {
209  //rSerializer.save("MyMemberName",myMember);
210  }
211 
212  virtual void load(Serializer& rSerializer) override {
214  //rSerializer.load("MyMemberName",myMember);
215  }
216 
217  }; //class DEM_D_Linear_viscous_Coulomb
218 
219 } /* namespace Kratos.*/
220 #endif /* DEM_D_LINEAR_VISCOUS_COULOMB_CL_H_INCLUDED defined */
Base class for all Conditions.
Definition: condition.h:59
Definition: DEM_D_Linear_viscous_Coulomb_CL.h:15
~DEM_D_Linear_viscous_Coulomb()
Definition: DEM_D_Linear_viscous_Coulomb_CL.h:25
KRATOS_CLASS_POINTER_DEFINITION(DEM_D_Linear_viscous_Coulomb)
DEM_D_Linear_viscous_Coulomb()
Definition: DEM_D_Linear_viscous_Coulomb_CL.h:23
void CalculateTangentialForceWithNeighbour(const double normal_contact_force, const double OldLocalElasticContactForce[3], double LocalElasticContactForce[3], double ViscoDampingLocalContactForce[3], const double LocalDeltDisp[3], const double LocalRelVel[3], bool &sliding, SphericParticle *const element, NeighbourClassType *const neighbour, double indentation, double previous_indentation, double &modulus_of_elastic_shear_force, double &maximum_admissible_shear_force)
Definition: DEM_D_Linear_viscous_Coulomb_CL.h:89
Definition: DEM_discontinuum_constitutive_law.h:22
virtual double CalculateNormalForce(const double indentation)
Definition: DEM_discontinuum_constitutive_law.cpp:81
ProcessInfo holds the current value of different solution parameters.
Definition: process_info.h:59
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
Definition: spheric_particle.h:31
#define KRATOS_SERIALIZE_SAVE_BASE_CLASS(Serializer, BaseType)
Definition: define.h:812
#define KRATOS_SERIALIZE_LOAD_BASE_CLASS(Serializer, BaseType)
Definition: define.h:815
REF: G. R. Cowper, GAUSSIAN QUADRATURE FORMULAS FOR TRIANGLES.
Definition: mesh_condition.cpp:21
list fraction
Definition: angle_finder.py:11
def load(f)
Definition: ode_solve.py:307
Definition: mesh_converter.cpp:33