SPHinXsys  alpha version
thin_structure_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  * HU1527/12-1 and HU1527/12-4. *
14  * *
15  * Portions copyright (c) 2017-2022 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 THIN_STRUCTURE_DYNAMICS_H
31 #define THIN_STRUCTURE_DYNAMICS_H
32 
33 #include "all_particle_dynamics.h"
34 #include "base_kernel.h"
35 #include "all_body_relations.h"
36 #include "solid_body.h"
37 #include "solid_particles.h"
38 #include "elastic_solid.h"
39 
40 namespace SPH
41 {
42  namespace thin_structure_dynamics
43  {
44  typedef DataDelegateSimple<SolidBody, ShellParticles, ElasticSolid> ShellDataSimple;
45  typedef DataDelegateInner<SolidBody, ShellParticles, ElasticSolid> ShellDataInner;
46 
53  {
54  public:
55  explicit ShellDynamicsInitialCondition(SolidBody &solid_body);
56  virtual ~ShellDynamicsInitialCondition(){};
57 
58  protected:
59  StdLargeVec<Vecd> &n0_, &n_, &pseudo_n_, &pos0_;
60  StdLargeVec<Matd> &transformation_matrix_;
61  };
62 
67  class ShellAcousticTimeStepSize : public ParticleDynamicsReduce<Real, ReduceMin>,
68  public ShellDataSimple
69  {
70  public:
71  explicit ShellAcousticTimeStepSize(SolidBody &sph_body);
72  virtual ~ShellAcousticTimeStepSize(){};
73 
74  protected:
75  StdLargeVec<Vecd> &vel_, &acc_, &angular_vel_, &dangular_vel_dt_;
76  StdLargeVec<Real> &thickness_;
77  Real rho0_, physical_viscosity_, E0_, nu_, c0_;
78  Real smoothing_length_;
79  Real ReduceFunction(size_t index_i, Real dt = 0.0) override;
80  };
81 
87  {
88  public:
89  explicit ShellCorrectConfiguration(BaseBodyRelationInner &inner_relation);
90  virtual ~ShellCorrectConfiguration(){};
91 
92  protected:
93  StdLargeVec<Real> &Vol_;
95  StdLargeVec<Vecd> &n0_;
96  StdLargeVec<Matd> &transformation_matrix_;
97  virtual void Interaction(size_t index_i, Real dt = 0.0) override;
98  };
99 
105  {
106  public:
107  explicit ShellDeformationGradientTensor(BaseBodyRelationInner &inner_relation);
108  virtual ~ShellDeformationGradientTensor(){};
109 
110  protected:
111  StdLargeVec<Real> &Vol_;
112  StdLargeVec<Vecd> &pos_, &pseudo_n_, &n0_;
113  StdLargeVec<Matd> &B_, &F_, &F_bending_;
114  StdLargeVec<Matd> &transformation_matrix_;
115  virtual void Interaction(size_t index_i, Real dt = 0.0) override;
116  };
117 
123  {
124  public:
125  explicit BaseShellRelaxation(BaseBodyRelationInner &inner_relation);
126  virtual ~BaseShellRelaxation(){};
127 
128  protected:
129  StdLargeVec<Real> &Vol_, &rho_, &mass_, &thickness_;
130  StdLargeVec<Vecd> &pos_, &vel_, &acc_, &acc_prior_;
131  StdLargeVec<Vecd> &n0_, &pseudo_n_, &dpseudo_n_dt_, &dpseudo_n_d2t_, &rotation_,
132  &angular_vel_, dangular_vel_dt_;
133  StdLargeVec<Matd> &B_, &F_, &dF_dt_, &F_bending_, &dF_bending_dt_;
134  StdLargeVec<Matd> &transformation_matrix_;
135  };
136 
143  {
144  public:
145  explicit ShellStressRelaxationFirstHalf(BaseBodyRelationInner &inner_relation,
146  int number_of_gaussian_points = 3, bool hourglass_control = false);
147  virtual ~ShellStressRelaxationFirstHalf() {};
148 
149  protected:
150  Real rho0_, inv_rho0_;
151  StdLargeVec<Matd> &global_stress_, &global_moment_;
152  StdLargeVec<Vecd> &global_shear_stress_, &n_;
153  Real smoothing_length_, E0_, G0_, nu_, hourglass_control_factor_;
154  bool hourglass_control_;
155  const Real inv_W0_ = 1.0 / body_->sph_adaptation_->getKernel()->W0(Vecd(0));
156  const Real shear_correction_factor_ = 5.0 / 6.0;
157 
158  const StdVec<Real> three_gaussian_points_ = { 0.0, 0.7745966692414834, -0.7745966692414834 };
159  const StdVec<Real> three_gaussian_weights_ = { 0.8888888888888889, 0.5555555555555556, 0.5555555555555556 };
160  const StdVec<Real> five_gaussian_points_
161  = { 0.0, 0.5384693101056831, -0.5384693101056831, 0.9061798459386640, -0.9061798459386640 };
162  const StdVec<Real> five_gaussian_weights_
163  = { 0.5688888888888889, 0.4786286704993665, 0.4786286704993665, 0.2369268850561891, 0.2369268850561891 };
164  int number_of_gaussian_points_;
165  StdVec<Real> gaussian_point_;
166  StdVec<Real> gaussian_weight_;
167 
168 
169  virtual void Initialization(size_t index_i, Real dt = 0.0) override;
170  virtual void Interaction(size_t index_i, Real dt = 0.0) override;
171  virtual void Update(size_t index_i, Real dt = 0.0) override;
172  };
173 
180  {
181  public:
183  : BaseShellRelaxation(inner_relation){};
184  virtual ~ShellStressRelaxationSecondHalf(){};
185 
186  protected:
187  virtual void Initialization(size_t index_i, Real dt = 0.0) override;
188  virtual void Interaction(size_t index_i, Real dt = 0.0) override;
189  virtual void Update(size_t index_i, Real dt = 0.0) override;
190  };
191 
197  {
198  public:
200  virtual ~ConstrainShellBodyRegion(){};
201 
202  protected:
203  StdLargeVec<Vecd> &pos_, &pos0_;
204  StdLargeVec<Vecd> &n_;
205  StdLargeVec<Vecd> &vel_, &acc_;
206  StdLargeVec<Vecd> &rotation_, &angular_vel_, &dangular_vel_dt_;
207  StdLargeVec<Vecd> &pseudo_n_, &dpseudo_n_dt_;
208  virtual Vecd getDisplacement(const Vecd &pos_0, const Vecd &pos_n) { return pos_0; };
209  virtual Vecd getVelocity(const Vecd &pos_0, const Vecd &pos_n, const Vecd &vel_n) { return Vecd(0); };
210  virtual Vecd GetAcceleration(const Vecd &pos_0, const Vecd &pos_n, const Vecd &acc) { return Vecd(0); };
211  virtual Vecd GetRotationAngle(const Vecd &pos_0, const Vecd &pos_n, const Vecd &rotation_angles_0_) { return rotation_angles_0_; };
212  virtual Vecd GetAngularVelocity(const Vecd &pos_0, const Vecd &pos_n, const Vecd &angular_vel_) { return Vecd(0); };
213  virtual Vecd GetAngularAcceleration(const Vecd &pos_0, const Vecd &pos_n, const Vecd &dangular_vel_dt_) { return Vecd(0); };
214  virtual Vecd GetPseudoNormal(const Vecd &pos_0, const Vecd &pos_n, const Vecd &n_0) { return n_0; };
215  virtual Vecd GetPseudoNormalChangeRate(const Vecd &pos_0, const Vecd &pos_n, const Vecd &dpseudo_normal_dt_) { return Vecd(0); };
216  virtual void Update(size_t index_i, Real dt = 0.0) override;
217  };
218 
224  public ShellDataInner
225  {
226  public:
228  BodyPartByParticle &body_part, Vecd constrained_direction = Vecd(0));
229  virtual ~FixedFreeRotateShellBoundary(){};
230 
231  protected:
232  Real W0_;
233  Matd constrain_matrix_, recover_matrix_;
234  StdLargeVec<Real> &Vol_;
235  StdLargeVec<Vecd> &vel_, &angular_vel_;
236  StdLargeVec<Vecd> vel_n_temp_, angular_vel_temp_;
237 
238  virtual void Initialization(size_t index_i, Real dt = 0.0) override;
239  virtual void Interaction(size_t index_i, Real dt = 0.0) override;
240  virtual void Update(size_t index_i, Real dt = 0.0) override;
241  };
242 
248  public ShellDataInner
249  {
250  public:
252  virtual ~ClampConstrainShellBodyRegion(){};
253 
254  protected:
255  StdLargeVec<Real> &Vol_;
256  StdLargeVec<Vecd> &vel_, &angular_vel_;
257  StdLargeVec<Vecd> vel_n_temp_, angular_vel_temp_;
258 
259  virtual void Initialization(size_t index_i, Real dt = 0.0) override;
260  virtual void Interaction(size_t index_i, Real dt = 0.0) override;
261  virtual void Update(size_t index_i, Real dt = 0.0) override;
262  };
263 
270  {
271  public:
272  ConstrainShellBodyRegionInAxisDirection(SolidBody &sph_body, BodyPartByParticle &body_part, int axis_direction);
274 
275  protected:
276  const int axis_;
277  StdLargeVec<Vecd> &pos_, &pos0_;
278  StdLargeVec<Vecd> &vel_, &acc_;
279  StdLargeVec<Vecd> &rotation_, &angular_vel_, &dangular_vel_dt_;
280  virtual void Update(size_t index_i, Real dt = 0.0) override;
281  };
282 
288  {
289  protected:
290  std::vector<Vecd> point_forces_, reference_positions_, time_dependent_point_forces_;
291  Real time_to_full_external_force_;
292  Real particle_spacing_ref_, h_spacing_ratio_;
293  StdLargeVec<Vecd> &pos0_, &acc_prior_;
294  StdLargeVec<Real> &Vol_, &mass_, &thickness_;
295  std::vector <StdLargeVec<Real>> weight_;
296  std::vector<Real> sum_of_weight_;
297 
298  public:
299  DistributingPointForcesToShell(SolidBody &sph_body, std::vector<Vecd> point_forces,
300  std::vector<Vecd> reference_positions, Real time_to_full_external_force,
301  Real particle_spacing_ref, Real h_spacing_ratio = 1.6);
302  virtual ~DistributingPointForcesToShell() {};
303 
304  void getWeight();
305  void getForce();
306  virtual void Update(size_t index_i, Real dt = 0.0) override;
307  };
308  }
309 }
310 #endif //THIN_STRUCTURE_DYNAMICS_H
The boundary conditions are denoted by SS1 according to the references. The axis_direction must be 0 ...
Definition: thin_structure_dynamics.h:269
set initial condition for shell particles This is a abstract class to be override for case specific i...
Definition: thin_structure_dynamics.h:52
prepare data for inner particle dynamics
Definition: base_particle_dynamics.h:216
Computing the acoustic time step size for shell.
Definition: thin_structure_dynamics.h:67
const int axis_
Definition: thin_structure_dynamics.h:273
ShellStressRelaxationFirstHalf(BaseBodyRelationInner &inner_relation, int number_of_gaussian_points=3, bool hourglass_control=false)
Definition: thin_structure_dynamics.cpp:128
Simple particle dynamics without considering particle interaction.
Definition: particle_dynamics_algorithms.h:48
A body part with a collection of particles.
Definition: base_body_part.h:64
Distribute a series of point forces to its contact shell bodies.
Definition: thin_structure_dynamics.h:287
Declaration of solidbody which is used for Solid BCs and derived from RealBody.
Definition: solid_body.h:46
obtain the corrected initial configuration in strong form
Definition: thin_structure_dynamics.h:86
Abstract class for body part simple particle dynamics.
Definition: particle_dynamics_bodypart.h:70
Base abstract class for reduce.
Definition: particle_dynamics_algorithms.h:69
virtual void Initialization(size_t index_i, Real dt=0.0) override
Definition: thin_structure_dynamics.cpp:166
computing deformation gradient tensor for shell
Definition: thin_structure_dynamics.h:104
This class includes an initialization, an interaction and a update steps.
Definition: particle_dynamics_algorithms.h:181
The clamped constrain of a shell body part.
Definition: thin_structure_dynamics.h:247
abstract class for preparing shell relaxation
Definition: thin_structure_dynamics.h:122
virtual void Interaction(size_t index_i, Real dt=0.0) override
Definition: thin_structure_dynamics.cpp:61
This is the class for particle interaction with other particles.
Definition: particle_dynamics_algorithms.h:115
Definition: particle_dynamics_bodypart.h:124
This is the derived class of base particles.
The abstract relation within a SPH body.
Definition: base_body_relation.h:117
computing stress relaxation process by verlet time stepping This is the first step ...
Definition: thin_structure_dynamics.h:142
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...
Fix the position and angle of a shell body part. Note that the average values for FSI are prescribed ...
Definition: thin_structure_dynamics.h:196
Soft the constraint of a solid body part.
Definition: thin_structure_dynamics.h:223
virtual void Interaction(size_t index_i, Real dt=0.0) override
Definition: thin_structure_dynamics.cpp:236
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.
computing stress relaxation process by verlet time stepping This is the second step ...
Definition: thin_structure_dynamics.h:179
Definition: solid_body_supplementary.cpp:9