Skip to content

Commit 807dcae

Browse files
committed
added elasticity to CompositeViscoPlastic
1 parent 2f09e15 commit 807dcae

File tree

12 files changed

+939
-40
lines changed

12 files changed

+939
-40
lines changed

doc/modules/changes/20240726_myhill

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
New: The CompositeViscoPlastic rheology in ASPECT now
2+
includes an implementation of elasticity.
3+
<br>
4+
(Bob Myhill, 2024/07/26)

include/aspect/material_model/rheology/composite_visco_plastic.h

Lines changed: 113 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
#include <aspect/material_model/rheology/dislocation_creep.h>
2929
#include <aspect/material_model/rheology/peierls_creep.h>
3030
#include <aspect/material_model/rheology/drucker_prager_power.h>
31+
#include <aspect/material_model/rheology/elasticity.h>
3132
#include <aspect/simulator_access.h>
3233

3334
namespace aspect
@@ -91,6 +92,24 @@ namespace aspect
9192
parse_parameters (ParameterHandler &prm,
9293
const std::unique_ptr<std::vector<unsigned int>> &expected_n_phases_per_composition = nullptr);
9394

95+
/**
96+
* Compute the inverse of the scalar elastic viscosity
97+
* obtained from the elasticity rheology. The required scalar shear modulus is
98+
* calculated by harmonically averaging the individual component shear moduli
99+
* weighted by the @p volume_fractions of the components.
100+
*/
101+
double
102+
compute_inverse_kelvin_viscosity(const std::vector<double> &volume_fractions) const;
103+
104+
/**
105+
* Compute the effective viscoelastic strain rate used to calculate the
106+
* viscosity.
107+
*/
108+
SymmetricTensor<2, dim>
109+
compute_effective_strain_rate(const SymmetricTensor<2, dim> &strain_rate,
110+
const SymmetricTensor<2, dim> &elastic_stress,
111+
const double inverse_kelvin_viscosity) const;
112+
94113
/**
95114
* Compute the viscosity based on the composite viscous creep law.
96115
* If @p n_phase_transitions_per_composition points to a vector of
@@ -103,7 +122,8 @@ namespace aspect
103122
const double temperature,
104123
const double grain_size,
105124
const std::vector<double> &volume_fractions,
106-
const SymmetricTensor<2,dim> &strain_rate,
125+
const SymmetricTensor<2,dim> &effective_strain_rate,
126+
const double inverse_kelvin_viscosity,
107127
std::vector<double> &partial_strain_rates,
108128
const std::vector<double> &phase_function_values = std::vector<double>(),
109129
const std::vector<unsigned int> &n_phase_transitions_per_composition = std::vector<unsigned int>()) const;
@@ -122,7 +142,8 @@ namespace aspect
122142
const double temperature,
123143
const double grain_size,
124144
const std::vector<double> &volume_fractions,
125-
const SymmetricTensor<2,dim> &strain_rate,
145+
const SymmetricTensor<2,dim> &effective_strain_rate,
146+
const double inverse_kelvin_viscosity,
126147
std::vector<double> &partial_strain_rates,
127148
const std::vector<double> &phase_function_values = std::vector<double>(),
128149
const std::vector<unsigned int> &n_phase_transitions_per_composition = std::vector<unsigned int>()) const;
@@ -135,6 +156,7 @@ namespace aspect
135156
std::pair<double, double>
136157
calculate_isostress_log_strain_rate_and_derivative(const std::vector<std::array<std::pair<double, double>, 4>> &logarithmic_strain_rates_and_stress_derivatives,
137158
const double viscoplastic_stress,
159+
const double inverse_kelvin_viscosity,
138160
std::vector<double> &partial_strain_rates) const;
139161

140162
/**
@@ -185,6 +207,69 @@ namespace aspect
185207
const double viscoplastic_stress,
186208
std::vector<double> &partial_strain_rates) const;
187209

210+
/**
211+
* Create the two additional material model output objects that contain the
212+
* elastic shear moduli, elastic viscosity, ratio of computational to elastic timestep,
213+
* and deviatoric stress of the current timestep and the reaction rates.
214+
*/
215+
/*
216+
void
217+
create_elastic_additional_outputs (MaterialModel::MaterialModelOutputs<dim> &out) const;
218+
*/
219+
220+
/**
221+
* Given the stress of the previous time step in the material model inputs @p in,
222+
* the elastic shear moduli @p average_elastic_shear_moduli at each point,
223+
* and the (viscous) viscosities given in the material model outputs object @p out,
224+
* fill a material model outputs objects with the elastic force terms, viscoelastic
225+
* strain rate and viscous dissipation.
226+
*/
227+
/*
228+
void
229+
fill_elastic_outputs (const MaterialModel::MaterialModelInputs<dim> &in,
230+
const std::vector<double> &average_elastic_shear_moduli,
231+
MaterialModel::MaterialModelOutputs<dim> &out) const;
232+
*/
233+
234+
/**
235+
* Given the stress of the previous time step in the material model inputs @p in,
236+
* the elastic shear moduli @p average_elastic_shear_moduli at each point,
237+
* and the (viscous) viscosities given in the material model outputs object @p out,
238+
* fill a material model outputs (ElasticAdditionalOutputs) object with the
239+
* average shear modulus, elastic viscosity, and the deviatoric stress of the current timestep.
240+
*/
241+
/*
242+
void
243+
fill_elastic_additional_outputs (const MaterialModel::MaterialModelInputs<dim> &in,
244+
const std::vector<double> &average_elastic_shear_moduli,
245+
MaterialModel::MaterialModelOutputs<dim> &out) const;
246+
*/
247+
248+
/**
249+
* Given the stress of the previous time step in the material model inputs @p in,
250+
* the elastic shear moduli @p average_elastic_shear_moduli at each point,
251+
* and the (viscous) viscosities given in the material model outputs object @p out,
252+
* compute an update to the elastic stresses and use it to fill the reaction terms
253+
* material model output property.
254+
*/
255+
void
256+
fill_reaction_outputs (const MaterialModel::MaterialModelInputs<dim> &in,
257+
const std::vector<double> &average_elastic_shear_moduli,
258+
MaterialModel::MaterialModelOutputs<dim> &out) const;
259+
260+
/**
261+
* Given the stress of the previous time step in the material model inputs @p in,
262+
* the elastic shear moduli @p average_elastic_shear_moduli at each point,
263+
* and the (viscous) viscosities given in the material model outputs object @p out,
264+
* compute the update to the elastic stresses of the previous timestep and use it
265+
* to fill the reaction rates material model output property.
266+
*/
267+
void
268+
fill_reaction_rates (const MaterialModel::MaterialModelInputs<dim> &in,
269+
const std::vector<double> &average_elastic_shear_moduli,
270+
MaterialModel::MaterialModelOutputs<dim> &out) const;
271+
272+
private:
188273
/**
189274
* Enumeration for selecting which type of viscosity averaging to use.
190275
*/
@@ -197,6 +282,7 @@ namespace aspect
197282
bool use_dislocation_creep;
198283
bool use_peierls_creep;
199284
bool use_drucker_prager;
285+
bool use_elasticity;
200286

201287
/**
202288
* Vector storing which flow mechanisms are active.
@@ -209,16 +295,31 @@ namespace aspect
209295
* which is arranged in parallel with the viscoplastic elements and
210296
* therefore does not contribute to the total strain rate.
211297
*/
212-
static constexpr unsigned int n_decomposed_strain_rates = 5;
298+
static constexpr unsigned int n_decomposed_strain_rates = 6;
299+
300+
/**
301+
* The index of the hard damper in the decomposed strain rates.
302+
* This is always the last element.
303+
*/
304+
static constexpr unsigned int damper_strain_rate_index = 5;
305+
static constexpr unsigned int isostrain_damper_strain_rate_index = 4;
306+
307+
/**
308+
* The index of the elastic element in the decomposed strain rates.
309+
* This is always the penultimate element.
310+
*/
311+
static constexpr unsigned int elastic_strain_rate_index = 4;
213312

214313
/**
215314
* Pointers to objects for computing deformation mechanism
216315
* strain rates and effective viscosities.
217316
*/
218-
std::unique_ptr<Rheology::DiffusionCreep<dim>> diffusion_creep;
317+
std::unique_ptr<Rheology::DiffusionCreep<dim>>
318+
diffusion_creep;
219319
std::unique_ptr<Rheology::DislocationCreep<dim>> dislocation_creep;
220320
std::unique_ptr<Rheology::PeierlsCreep<dim>> peierls_creep;
221321
std::unique_ptr<Rheology::DruckerPragerPower<dim>> drucker_prager;
322+
std::unique_ptr<Rheology::Elasticity<dim>> elasticity;
222323

223324
/**
224325
* The expected number of chemical compositional fields.
@@ -229,8 +330,14 @@ namespace aspect
229330
* The maximum viscosity, imposed via an isoviscous damper
230331
* in series with the composite viscoplastic element.
231332
*/
333+
double inverse_maximum_viscosity;
232334
double maximum_viscosity;
233335

336+
/**
337+
* The minimum viscosity, imposed via an isoviscous damper
338+
* in parallel with the flow law components
339+
*/
340+
double minimum_viscosity;
234341

235342
/**
236343
* The viscosity of an isoviscous damper placed in parallel
@@ -273,6 +380,8 @@ namespace aspect
273380
* Useful number to aid in adding together exponentials.
274381
*/
275382
const double logmin = std::log(std::numeric_limits<double>::min());
383+
384+
static constexpr unsigned int n_independent_components = SymmetricTensor<2, dim>::n_independent_components;
276385
};
277386
}
278387
}

include/aspect/material_model/rheology/elasticity.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,12 @@ namespace aspect
112112
const std::vector<double> &
113113
get_elastic_shear_moduli () const;
114114

115+
/**
116+
* Return the values of the damper viscosity used in the rheology model.
117+
*/
118+
double
119+
get_damper_viscosity() const;
120+
115121
/**
116122
* Calculates the effective elastic viscosity (this is the equivalent viscosity of
117123
* a material which was unstressed at the end of the previous timestep).

0 commit comments

Comments
 (0)