1 #pragma once
2 
3 /// \file Rheology.h
4 /// \brief Rheology of materials
5 /// \author Pavel Sevecek (sevecek at sirrah.troja.mff.cuni.cz)
6 /// \date 2016-2021
7 
8 #include "common/ForwardDecl.h"
9 #include "objects/containers/Array.h"
10 #include "objects/geometry/TracelessTensor.h"
11 #include "objects/wrappers/AutoPtr.h"
12 
13 NAMESPACE_SPH_BEGIN
14 
15 struct MaterialInitialContext;
16 class IFractureModel;
17 class IScheduler;
18 
19 /// \brief Base class of rheological models
20 ///
21 /// Shall be only used in \ref SolidMaterial, functions do not have to be called directly from the solver.
22 class IRheology : public Polymorphic {
23 public:
24     /// \brief Creates all the necessary quantities and material parameters needed by the rheology.
25     ///
26     /// The function is called for each body added to the simulation.
27     /// \param storage Particle storage, containing particle positions and their masses (optionally also
28     ///                other quantities). Particles belong only to the body being created, other bodies
29     ///                have separate storages.
30     /// \param material Material containing input material parameters. The rheology may sets the
31     ///                 timestepping parameters (range and minimal values) of the material.
32     /// \param context Shared data for creating all materials in the simulation.
33     virtual void create(Storage& storage,
34         IMaterial& material,
35         const MaterialInitialContext& context) const = 0;
36 
37     /// \brief Evaluates the stress tensor reduction factors.
38     ///
39     /// Called for every material in the simulation every timestep, before iteration over particle pairs
40     /// \param scheduler Scheduler used for parallelization.
41     /// \param storage Storage including all the particles.
42     /// \param material Material properties and sequence of particles with this material. Implementation
43     ///                 should only modify particles with indices in this sequence.
44     virtual void initialize(IScheduler& scheduler, Storage& storage, const MaterialView material) = 0;
45 
46     /// \brief Computes derivatives of the time-dependent quantities of the rheological model.
47     ///
48     /// Called for every material in the simulation every timestep, after all derivatives are computed.
49     /// \param scheduler Scheduler used for parallelization.
50     /// \param storage Storage including all the particles.
51     /// \param material Material properties and sequence of particles with this material. Implementation
52     ///                 should only modify particles with indices in this sequence.
53     virtual void integrate(IScheduler& scheduler, Storage& storage, const MaterialView material) = 0;
54 };
55 
56 
57 /// Introduces plastic behavior for stress tensor, using von Mises yield criterion \cite vonMises_1913.
58 class VonMisesRheology : public IRheology {
59 private:
60     AutoPtr<IFractureModel> damage;
61 
62 public:
63     /// \brief Constructs a rheology with no fragmentation model.
64     ///
65     /// Stress tensor is only modified by von Mises criterion, yielding strength does not depend on damage.
66     VonMisesRheology();
67 
68     /// \brief Constructs a rheology with given fragmentation model.
69     VonMisesRheology(AutoPtr<IFractureModel>&& damage);
70 
71     ~VonMisesRheology();
72 
73     virtual void create(Storage& storage,
74         IMaterial& settings,
75         const MaterialInitialContext& context) const override;
76 
77     virtual void initialize(IScheduler& scheduler, Storage& storage, const MaterialView material) override;
78 
79     virtual void integrate(IScheduler& scheduler, Storage& storage, const MaterialView material) override;
80 };
81 
82 
83 /// Pressure dependent failure modes \cite Collins_2004
84 class DruckerPragerRheology : public IRheology {
85 private:
86     AutoPtr<IFractureModel> damage;
87 
88 public:
89     /// \brief Constructs a rheology with no fragmentation model.
90     ///
91     /// Stress tensor is only modified by von Mises criterion, yielding strength does not depend on damage.
92     DruckerPragerRheology();
93 
94     /// \brief Constructs a rheology with given fragmentation model.
95     DruckerPragerRheology(AutoPtr<IFractureModel>&& damage);
96 
97     ~DruckerPragerRheology();
98 
99     virtual void create(Storage& storage,
100         IMaterial& material,
101         const MaterialInitialContext& context) const override;
102 
103     virtual void initialize(IScheduler& scheduler, Storage& storage, const MaterialView material) override;
104 
105     virtual void integrate(IScheduler& scheduler, Storage& storage, const MaterialView material) override;
106 };
107 
108 /// Perfectly elastic material, no yielding nor fragmentation
109 class ElasticRheology : public IRheology {
110 public:
111     virtual void create(Storage& storage,
112         IMaterial& material,
113         const MaterialInitialContext& context) const override;
114 
115     virtual void initialize(IScheduler& scheduler, Storage& storage, const MaterialView material) override;
116 
117     virtual void integrate(IScheduler& scheduler, Storage& storage, const MaterialView material) override;
118 };
119 
120 /// Limit the pressure to positive values
121 class DustRheology : public IRheology {
122 public:
123     virtual void create(Storage& storage,
124         IMaterial& material,
125         const MaterialInitialContext& context) const override;
126 
127     virtual void initialize(IScheduler& scheduler, Storage& storage, const MaterialView material) override;
128 
129     virtual void integrate(IScheduler& scheduler, Storage& storage, const MaterialView material) override;
130 };
131 
132 
133 NAMESPACE_SPH_END
134