-
Notifications
You must be signed in to change notification settings - Fork 231
/
drucker_prager.cc
289 lines (233 loc) · 13.3 KB
/
drucker_prager.cc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
/*
Copyright (C) 2019 - 2021 by the authors of the ASPECT code.
This file is part of ASPECT.
ASPECT is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
ASPECT is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with ASPECT; see the file LICENSE. If not see
<http://www.gnu.org/licenses/>.
*/
#include <aspect/material_model/rheology/drucker_prager.h>
#include <aspect/material_model/utilities.h>
#include <aspect/utilities.h>
#include <deal.II/base/signaling_nan.h>
#include <deal.II/base/parameter_handler.h>
namespace aspect
{
namespace MaterialModel
{
namespace Rheology
{
template <int dim>
DruckerPrager<dim>::DruckerPrager ()
{}
template <int dim>
const DruckerPragerParameters
DruckerPrager<dim>::compute_drucker_prager_parameters (const unsigned int composition,
const std::vector<double> &phase_function_values,
const std::vector<unsigned int> &n_phases_per_composition) const
{
DruckerPragerParameters drucker_prager_parameters;
drucker_prager_parameters.max_yield_stress = max_yield_stress;
if (phase_function_values == std::vector<double>())
{
// no phases
drucker_prager_parameters.angle_internal_friction = angles_internal_friction[composition];
drucker_prager_parameters.cohesion = cohesions[composition];
}
else
{
// Average among phases
drucker_prager_parameters.angle_internal_friction = MaterialModel::MaterialUtilities::phase_average_value(phase_function_values, n_phases_per_composition,
angles_internal_friction, composition);
drucker_prager_parameters.cohesion = MaterialModel::MaterialUtilities::phase_average_value(phase_function_values, n_phases_per_composition,
cohesions, composition);
}
return drucker_prager_parameters;
}
template <int dim>
double
DruckerPrager<dim>::compute_yield_stress (const double cohesion,
const double angle_internal_friction,
const double pressure,
const double max_yield_stress) const
{
const double sin_phi = std::sin(angle_internal_friction);
const double cos_phi = std::cos(angle_internal_friction);
const double stress_inv_part = 1. / (std::sqrt(3.0) * (3.0 + sin_phi));
// Initial yield stress (no stabilization terms)
const double yield_stress = ( (dim==3)
?
( 6.0 * cohesion * cos_phi + 6.0 * pressure * sin_phi) * stress_inv_part
:
cohesion * cos_phi + pressure * sin_phi);
return std::min(yield_stress, max_yield_stress);
}
template <int dim>
double
DruckerPrager<dim>::compute_viscosity (const double cohesion,
const double angle_internal_friction,
const double pressure,
const double effective_strain_rate,
const double max_yield_stress,
const double pre_yield_viscosity) const
{
const double yield_stress = compute_yield_stress(cohesion, angle_internal_friction, pressure, max_yield_stress);
const double strain_rate_effective_inv = 1./(2.*effective_strain_rate);
double plastic_viscosity = yield_stress * strain_rate_effective_inv;
if (use_plastic_damper)
{
const double total_stress = ( yield_stress + ( 2. * damper_viscosity * effective_strain_rate ) ) /
( 1 + ( damper_viscosity / pre_yield_viscosity ) );
const double pre_yield_strain_rate = total_stress / ( 2. * pre_yield_viscosity);
const double plastic_strain_rate = effective_strain_rate - pre_yield_strain_rate;
plastic_viscosity = yield_stress / (2.*plastic_strain_rate) + damper_viscosity;
// Effective viscosity
plastic_viscosity = 1. / (1./plastic_viscosity + 1./pre_yield_viscosity);
}
return plastic_viscosity;
}
template <int dim>
std::pair<double, double>
DruckerPrager<dim>::compute_strain_rate_and_derivative (const double stress,
const double pressure,
const DruckerPragerParameters p) const
{
const double yield_stress = compute_yield_stress(p.cohesion, p.angle_internal_friction, pressure, p.max_yield_stress);
if (stress > yield_stress)
{
return std::make_pair((stress - yield_stress)/(2.*damper_viscosity), 1./(2.*damper_viscosity));
}
else
{
return std::make_pair(0., 0.);
}
}
template <int dim>
double
DruckerPrager<dim>::compute_derivative (const double angle_internal_friction,
const double effective_strain_rate) const
{
const double sin_phi = std::sin(angle_internal_friction);
const double stress_inv_part = 1. / (std::sqrt(3.0) * (3.0 + sin_phi));
const double strain_rate_effective_inv = 1./(2.*effective_strain_rate);
const double viscosity_pressure_derivative = sin_phi * strain_rate_effective_inv *
(dim == 3
?
(6.0 * stress_inv_part)
:
1);
return viscosity_pressure_derivative;
}
template <int dim>
void
DruckerPrager<dim>::declare_parameters (ParameterHandler &prm)
{
prm.declare_entry ("Angles of internal friction", "0.",
Patterns::Anything(),
"List of angles of internal friction, $\\phi$, for background material and compositional fields, "
"for a total of N+1 values, where N is the number of compositional fields. "
"For a value of zero, in 2D the von Mises criterion is retrieved. "
"Angles higher than 30 degrees are harder to solve numerically. Units: degrees.");
prm.declare_entry ("Cohesions", "1e20",
Patterns::Anything(),
"List of cohesions, $C$, for background material and compositional fields, "
"for a total of N+1 values, where N is the number of compositional fields. "
"The extremely large default cohesion value (1e20 Pa) prevents the viscous stress from "
"exceeding the yield stress. Units: \\si{\\pascal}.");
prm.declare_entry ("Maximum yield stress", "1e12", Patterns::Double (0.),
"Limits the maximum value of the yield stress determined by the "
"Drucker-Prager plasticity parameters. Default value is chosen so this "
"is not automatically used. Values of 100e6--1000e6 $Pa$ have been used "
"in previous models. Units: \\si{\\pascal}.");
prm.declare_entry ("Use plastic damper","false",
Patterns::Bool (),
"Whether to use a plastic damper when computing the Drucker-Prager "
"plastic viscosity. The damper acts to stabilize the plastic shear "
"band width and remove associated mesh-dependent behavior at "
"sufficient resolutions.");
prm.declare_entry ("Plastic damper viscosity", "0.0", Patterns::Double(0),
"Viscosity of the damper that acts in parallel with the plastic viscosity "
"to produce mesh-independent behavior at sufficient resolutions. Units: \\si{\\pascal\\second}");
prm.declare_entry ("Define phase properties by differences instead of exact values", "true",
Patterns::Bool (),
"Whether to list phase transitions properties by differences between adjacent phases or an exact values on each phase."
"If this parameter is true, "
"then the input file will use a value for the first phase and M-1 values for the differences between phases "
"to define the material properties (e.g. density)."
"If it is false, the parameter file will use M values, one on each phase to"
"define the material properties instead.");
}
template <int dim>
void
DruckerPrager<dim>::parse_parameters (ParameterHandler &prm,
const std::unique_ptr<std::vector<unsigned int>> &expected_n_phases_per_composition)
{
// Retrieve the list of composition names
const std::vector<std::string> list_of_composition_names = this->introspection().get_composition_names();
// Establish that a background field is required here
const bool has_background_field = true;
use_values_instead_of_differences = prm.get_bool("Define phase properties by differences instead of exact values");
std::vector<double> angles_internal_friction_inputs = Utilities::parse_map_to_double_array(prm.get("Angles of internal friction"),
list_of_composition_names,
has_background_field,
"Angles of internal friction",
true,
expected_n_phases_per_composition,
false,
use_values_instead_of_differences);
std::vector<double> cohesion_inputs = Utilities::parse_map_to_double_array(prm.get("Cohesions"),
list_of_composition_names,
has_background_field,
"Cohesions",
true,
expected_n_phases_per_composition,
false,
use_values_instead_of_differences);
if (use_values_instead_of_differences)
{
angles_internal_friction = angles_internal_friction_inputs;
cohesions = cohesion_inputs;
}
else
{
angles_internal_friction = MaterialModel::MaterialUtilities::parse_map_differences_to_values(angles_internal_friction_inputs, expected_n_phases_per_composition);
cohesions = MaterialModel::MaterialUtilities::parse_map_differences_to_values(cohesion_inputs, expected_n_phases_per_composition, MaterialModel::MaterialUtilities::PhaseUtilities::logarithmic);
}
// Convert angles from degrees to radians
for (double &angle : angles_internal_friction)
angle *= numbers::PI/180.0;
// Limit maximum value of the Drucker-Prager yield stress
max_yield_stress = prm.get_double("Maximum yield stress");
// Whether to include a plastic damper when computing the Drucker-Prager plastic viscosity
use_plastic_damper = prm.get_bool("Use plastic damper");
// Stabilize plasticity through a viscous damper.
// The viscosity of the damper is implicitly zero if it is not used
if (use_plastic_damper)
damper_viscosity = prm.get_double("Plastic damper viscosity");
else
damper_viscosity = 0.;
}
}
}
}
// explicit instantiations
namespace aspect
{
namespace MaterialModel
{
#define INSTANTIATE(dim) \
namespace Rheology \
{ \
template class DruckerPrager<dim>; \
}
ASPECT_INSTANTIATE(INSTANTIATE)
#undef INSTANTIATE
}
}