SPHinXsys  alpha version
elastic_dynamics.h
Go to the documentation of this file.
1 /* -------------------------------------------------------------------------*
2 * SPHinXsys *
3 * --------------------------------------------------------------------------*
4 * SPHinXsys (pronunciation: s'finksis) is an acronym from Smoothed Particle *
5 * Hydrodynamics for industrial compleX systems. It provides C++ APIs for *
6 * physical accurate simulation and aims to model coupled industrial dynamic *
7 * systems including fluid, solid, multi-body dynamics and beyond with SPH *
8 * (smoothed particle hydrodynamics), a meshless computational method using *
9 * particle discretization. *
10 * *
11 * SPHinXsys is partially funded by German Research Foundation *
12 * (Deutsche Forschungsgemeinschaft) DFG HU1527/6-1, HU1527/10-1 *
13 * and HU1527/12-1. *
14 * *
15 * Portions copyright (c) 2017-2020 Technical University of Munich and *
16 * the authors' affiliations. *
17 * *
18 * Licensed under the Apache License, Version 2.0 (the "License"); you may *
19 * not use this file except in compliance with the License. You may obtain a *
20 * copy of the License at http://www.apache.org/licenses/LICENSE-2.0. *
21 * *
22 * --------------------------------------------------------------------------*/
30 #ifndef ELASTIC_DYNAMICS_H
31 #define ELASTIC_DYNAMICS_H
32 
33 #include "all_particle_dynamics.h"
34 #include "general_dynamics.h"
35 #include "base_kernel.h"
36 #include "all_body_relations.h"
37 #include "solid_body.h"
38 #include "solid_particles.h"
39 #include "elastic_solid.h"
40 
41 
42 
43 namespace SPH
44 {
45  template <typename VariableType>
46  class BodySummation;
47  template <typename VariableType>
48  class BodyMoment;
49 
50  namespace solid_dynamics
51  {
52  //----------------------------------------------------------------------
53  // for elastic solid dynamics
54  //----------------------------------------------------------------------
55  typedef DataDelegateSimple<SolidBody, ElasticSolidParticles, ElasticSolid> ElasticSolidDataSimple;
56  typedef DataDelegateInner<SolidBody, ElasticSolidParticles, ElasticSolid> ElasticSolidDataInner;
57 
64  {
65  public:
66  explicit ElasticDynamicsInitialCondition(SolidBody &solid_body);
68 
69  protected:
70  StdLargeVec<Vecd> &pos_, &vel_;
71  };
72 
78  {
79  public:
80  explicit UpdateElasticNormalDirection(SolidBody &solid_body);
81  virtual ~UpdateElasticNormalDirection(){};
82 
83  protected:
84  StdLargeVec<Vecd> &n_, &n0_;
86  virtual void Update(size_t index_i, Real dt = 0.0) override;
87  };
88 
94  class AcousticTimeStepSize : public ParticleDynamicsReduce<Real, ReduceMin>,
96  {
97  public:
98  explicit AcousticTimeStepSize(SolidBody &solid_body, Real CFL = 0.6);
99  virtual ~AcousticTimeStepSize(){};
100 
101  protected:
102  Real CFL_;
103  StdLargeVec<Vecd> &vel_, &acc_;
104  Real smoothing_length_, c0_;
105  Real ReduceFunction(size_t index_i, Real dt = 0.0) override;
106  };
107 
113  {
114  public:
117 
118  protected:
119  StdLargeVec<Real> &Vol_;
120  StdLargeVec<Vecd> &pos_;
121  StdLargeVec<Matd> &B_, &F_;
122  virtual void Interaction(size_t index_i, Real dt = 0.0) override;
123  };
124 
130  : public ParticleDynamics1Level,
131  public ElasticSolidDataInner
132  {
133  public:
134  explicit BaseElasticRelaxation(BaseBodyRelationInner &inner_relation);
135  virtual ~BaseElasticRelaxation(){};
136 
137  protected:
138  StdLargeVec<Real> &Vol_, &rho_, &mass_;
139  StdLargeVec<Vecd> &pos_, &vel_, &acc_;
140  StdLargeVec<Matd> &B_, &F_, &dF_dt_;
141  };
142 
149  {
150  public:
151  explicit BaseStressRelaxationFirstHalf(BaseBodyRelationInner &inner_relation);
152  virtual ~BaseStressRelaxationFirstHalf(){};
153 
154  protected:
155  Real rho0_, inv_rho0_;
156  StdLargeVec<Vecd> &acc_prior_;
157  Real smoothing_length_;
158 
159  virtual void Update(size_t index_i, Real dt = 0.0) override;
160  };
161 
168  {
169  public:
170  explicit StressRelaxationFirstHalf(BaseBodyRelationInner &inner_relation);
171  virtual ~StressRelaxationFirstHalf(){};
172 
173  protected:
174  StdLargeVec<Matd> stress_PK1_B_;
175  Real numerical_dissipation_factor_;
176  Real inv_W0_ = 1.0 / body_->sph_adaptation_->getKernel()->W0(Vecd(0));
177 
178  virtual void Initialization(size_t index_i, Real dt = 0.0) override;
179  virtual void Interaction(size_t index_i, Real dt = 0.0) override;
180  };
181 
186  {
187  public:
190 
191  protected:
192  const Real one_over_dimensions_ = 1.0 / (Real)Dimensions;
193 
194  virtual void Initialization(size_t index_i, Real dt = 0.0) override;
195  };
196 
213  {
214  public:
217 
218  protected:
219  StdLargeVec<Real> J_to_minus_2_over_dimension_;
220  StdLargeVec<Matd> stress_on_particle_, inverse_F_T_;
221  const Real one_over_dimensions_ = 1.0 / (Real)Dimensions;
222  const Real correction_factor_ = 1.07;
223 
224  virtual void Initialization(size_t index_i, Real dt = 0.0) override;
225  virtual void Interaction(size_t index_i, Real dt = 0.0) override;
226  };
227 
234  {
235  public:
236  explicit StressRelaxationSecondHalf(BaseBodyRelationInner &inner_relation)
237  : BaseElasticRelaxation(inner_relation){};
238  virtual ~StressRelaxationSecondHalf(){};
239 
240  protected:
241  virtual void Initialization(size_t index_i, Real dt = 0.0) override;
242  virtual void Interaction(size_t index_i, Real dt = 0.0) override;
243  virtual void Update(size_t index_i, Real dt = 0.0) override;
244  };
245  }
246 }
247 #endif //ELASTIC_DYNAMICS_H
prepare data for inner particle dynamics
Definition: base_particle_dynamics.h:216
Decompose the stress into particle stress includes isotropic stress and the stress due to non-homogen...
Definition: elastic_dynamics.h:212
Simple particle dynamics without considering particle interaction.
Definition: particle_dynamics_algorithms.h:48
This is the particle dynamics aplliable for all type bodies.
Declaration of solidbody which is used for Solid BCs and derived from RealBody.
Definition: solid_body.h:46
computing stress relaxation process by verlet time stepping This is the second step ...
Definition: elastic_dynamics.h:233
computing stress relaxation process by verlet time stepping This is the first step ...
Definition: elastic_dynamics.h:167
Base abstract class for reduce.
Definition: particle_dynamics_algorithms.h:69
update particle normal directions for elastic solid
Definition: elastic_dynamics.h:77
base class for elastic relaxation
Definition: elastic_dynamics.h:129
computing stress relaxation process by verlet time stepping This is the first step ...
Definition: elastic_dynamics.h:148
This class includes an initialization, an interaction and a update steps.
Definition: particle_dynamics_algorithms.h:181
computing deformation gradient tensor by summation
Definition: elastic_dynamics.h:112
This is the class for particle interaction with other particles.
Definition: particle_dynamics_algorithms.h:115
Computing the acoustic time step size computing time step size.
Definition: elastic_dynamics.h:94
This is the derived class of base particles.
The abstract relation within a SPH body.
Definition: base_body_relation.h:117
prepare data for simple particle dynamics.
Definition: base_particle_dynamics.h:185
This is the base classes of kernel functions. Implementation will be implemented in derived classes...
These are classes for define properties of elastic solid materials. These classes are based on isotro...
This is the class for bodies used for solid BCs or Elastic structure.
set initial condition for a solid body with different material This is a abstract class to be overrid...
Definition: elastic_dynamics.h:63
Definition: solid_body_supplementary.cpp:9