ASPECT
grain_size.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2014 - 2024 by the authors of the ASPECT code.
3 
4  This file is part of ASPECT.
5 
6  ASPECT is free software; you can redistribute it and/or modify
7  it under the terms of the GNU General Public License as published by
8  the Free Software Foundation; either version 2, or (at your option)
9  any later version.
10 
11  ASPECT is distributed in the hope that it will be useful,
12  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  GNU General Public License for more details.
15 
16  You should have received a copy of the GNU General Public License
17  along with ASPECT; see the file doc/COPYING. If not see
18  <http://www.gnu.org/licenses/>.
19 */
20 
21 
22 #ifndef _aspect_material_model_grain_size_h
23 #define _aspect_material_model_grain_size_h
24 
27 
31 
32 #include <deal.II/matrix_free/fe_point_evaluation.h>
33 
34 #include <array>
35 
36 namespace aspect
37 {
38  namespace MaterialModel
39  {
40  using namespace dealii;
41 
47  template <int dim>
49  {
50  public:
51  DislocationViscosityOutputs(const unsigned int n_points);
52 
53  std::vector<double> get_nth_output(const unsigned int idx) const override;
54 
60  std::vector<double> dislocation_viscosities;
61 
67  std::vector<double> diffusion_viscosities;
68  };
69 
70 
71 
93  template <int dim>
95  {
96  public:
101  void
102  initialize () override;
103 
112  bool is_compressible () const override;
113 
117  void evaluate(const typename Interface<dim>::MaterialModelInputs &in,
118  typename Interface<dim>::MaterialModelOutputs &out) const override;
119 
127  static
128  void
129  declare_parameters (ParameterHandler &prm);
130 
134  void
135  parse_parameters (ParameterHandler &prm) override;
136 
141  void
142  create_additional_named_outputs (MaterialModel::MaterialModelOutputs<dim> &out) const override;
143 
147  double enthalpy (const double temperature,
148  const double pressure,
149  const std::vector<double> &compositional_fields,
150  const Point<dim> &position) const;
151 
163  std::array<std::pair<double, unsigned int>,2>
164  enthalpy_derivative (const typename Interface<dim>::MaterialModelInputs &in) const;
165 
166  private:
168  double reference_T;
169  double eta;
172 
177 
181  double k_value;
182 
188  std::vector<double> dislocation_creep_exponent;
189  std::vector<double> dislocation_activation_energy;
190  std::vector<double> dislocation_activation_volume;
191  std::vector<double> dislocation_creep_prefactor;
192  std::vector<double> diffusion_creep_exponent;
193  std::vector<double> diffusion_activation_energy;
194  std::vector<double> diffusion_activation_volume;
195  std::vector<double> diffusion_creep_prefactor;
197 
204  double min_eta;
205  double max_eta;
212 
217  double diffusion_viscosity (const double temperature,
218  const double adiabatic_temperature,
219  const double adiabatic_pressure,
220  const double grain_size,
221  const double second_strain_rate_invariant,
222  const unsigned int phase_index) const;
223 
235  double dislocation_viscosity (const double temperature,
236  const double adiabatic_temperature,
237  const double adiabatic_pressure,
238  const SymmetricTensor<2,dim> &strain_rate,
239  const unsigned int phase_index,
240  const double diffusion_viscosity,
241  const double viscosity_guess = 0) const;
242 
243  double density (const double temperature,
244  const double pressure,
245  const std::vector<double> &compositional_fields,
246  const Point<dim> &position) const;
247 
248  double compressibility (const double temperature,
249  const double pressure,
250  const std::vector<double> &compositional_fields,
251  const Point<dim> &position) const;
252 
253  double specific_heat (const double temperature,
254  const double pressure,
255  const std::vector<double> &compositional_fields,
256  const Point<dim> &position) const;
257 
258  double thermal_expansion_coefficient (const double temperature,
259  const double pressure,
260  const std::vector<double> &compositional_fields,
261  const Point<dim> &position) const;
262 
266  double seismic_Vp (const double temperature,
267  const double pressure,
268  const std::vector<double> &compositional_fields,
269  const Point<dim> &position) const;
270 
274  double seismic_Vs (const double temperature,
275  const double pressure,
276  const std::vector<double> &compositional_fields,
277  const Point<dim> &position) const;
278 
279 
288  unsigned int
289  get_phase_index (const MaterialUtilities::PhaseFunctionInputs<dim> &in) const;
290 
291 
295  unsigned int n_phase_transitions;
296 
303  std::shared_ptr<MaterialUtilities::PhaseFunction<dim>> phase_function;
304 
305 
310  std::string datadirectory;
311  std::vector<std::string> material_file_names;
312  std::vector<std::string> derivatives_file_names;
313  unsigned int n_material_data;
317 
318 
323  enum formats
324  {
326  hefesto
327  } material_file_format;
328 
334  std::vector<std::unique_ptr<MaterialModel::MaterialUtilities::Lookup::MaterialLookup>> material_lookup;
335 
342  mutable std::unique_ptr<FEPointEvaluation<1, dim>> temperature_evaluator;
343  mutable std::unique_ptr<FEPointEvaluation<1, dim>> pressure_evaluator;
344 
345  /*
346  * Object for computing plastic stresses, viscosities, and additional outputs,
347  * as well as an object for the required input parameters.
348  */
353 
357  std::unique_ptr<ReactionModel::GrainSizeEvolution<dim>> grain_size_evolution;
358  };
359 
360  }
361 }
362 
363 #endif
std::vector< double > diffusion_activation_volume
Definition: grain_size.h:194
Rheology::DruckerPrager< dim > drucker_prager_plasticity
Definition: grain_size.h:351
std::vector< std::string > material_file_names
Definition: grain_size.h:311
std::unique_ptr< ReactionModel::GrainSizeEvolution< dim > > grain_size_evolution
Definition: grain_size.h:357
std::vector< double > diffusion_creep_exponent
Definition: grain_size.h:192
std::vector< double > dislocation_activation_volume
Definition: grain_size.h:190
void declare_parameters(ParameterHandler &prm)
std::vector< std::unique_ptr< MaterialModel::MaterialUtilities::Lookup::MaterialLookup > > material_lookup
Definition: grain_size.h:334
Rheology::DruckerPragerParameters drucker_prager_parameters
Definition: grain_size.h:352
std::vector< double > diffusion_creep_grain_size_exponent
Definition: grain_size.h:196
std::vector< double > diffusion_creep_prefactor
Definition: grain_size.h:195
std::vector< double > dislocation_activation_energy
Definition: grain_size.h:189
unsigned int dislocation_viscosity_iteration_number
Definition: grain_size.h:187
std::vector< double > dislocation_creep_exponent
Definition: grain_size.h:188
Definition: compat.h:59
std::unique_ptr< FEPointEvaluation< 1, dim > > temperature_evaluator
Definition: grain_size.h:342
std::vector< double > diffusion_activation_energy
Definition: grain_size.h:193
Definition: compat.h:42
std::vector< std::string > derivatives_file_names
Definition: grain_size.h:312
std::unique_ptr< FEPointEvaluation< 1, dim > > pressure_evaluator
Definition: grain_size.h:343
std::shared_ptr< MaterialUtilities::PhaseFunction< dim > > phase_function
Definition: grain_size.h:303
std::vector< double > dislocation_creep_prefactor
Definition: grain_size.h:191