ASPECT
grain_size.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2014 - 2022 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_model_grain_size_h
23 #define _aspect_model_grain_size_h
24 
27 
28 #include <deal.II/matrix_free/fe_point_evaluation.h>
29 
30 #include <array>
31 
32 namespace aspect
33 {
34  namespace MaterialModel
35  {
36  using namespace dealii;
37 
43  template <int dim>
45  {
46  public:
47  DislocationViscosityOutputs(const unsigned int n_points);
48 
49  std::vector<double> get_nth_output(const unsigned int idx) const override;
50 
56  std::vector<double> dislocation_viscosities;
57 
63  std::vector<double> diffusion_viscosities;
64 
72  };
73 
74 
75 
97  template <int dim>
99  {
100  public:
105  void
106  initialize () override;
107 
116  bool is_compressible () const override;
117 
118  void evaluate(const typename Interface<dim>::MaterialModelInputs &in,
119  typename Interface<dim>::MaterialModelOutputs &out) const override;
120 
128  static
129  void
130  declare_parameters (ParameterHandler &prm);
131 
135  void
136  parse_parameters (ParameterHandler &prm) override;
137 
138 
139  void
140  create_additional_named_outputs (MaterialModel::MaterialModelOutputs<dim> &out) const override;
141 
149  double enthalpy (const double temperature,
150  const double pressure,
151  const std::vector<double> &compositional_fields,
152  const Point<dim> &position) const;
153 
165  std::array<std::pair<double, unsigned int>,2>
166  enthalpy_derivative (const typename Interface<dim>::MaterialModelInputs &in) const;
167 
168  protected:
170  double reference_T;
171  double eta;
174 
179 
183  double k_value;
184 
188  std::vector<double> grain_growth_activation_energy;
189  std::vector<double> grain_growth_activation_volume;
190  std::vector<double> grain_growth_rate_constant;
191  std::vector<double> grain_growth_exponent;
193  std::vector<double> reciprocal_required_strain;
194  std::vector<double> recrystallized_grain_size;
195 
206  std::vector<double> grain_boundary_energy;
208  std::vector<double> geometric_constant;
209 
215  std::vector<double> dislocation_creep_exponent;
216  std::vector<double> dislocation_activation_energy;
217  std::vector<double> dislocation_activation_volume;
218  std::vector<double> dislocation_creep_prefactor;
219  std::vector<double> diffusion_creep_exponent;
220  std::vector<double> diffusion_activation_energy;
221  std::vector<double> diffusion_activation_volume;
222  std::vector<double> diffusion_creep_prefactor;
224 
231  double min_eta;
232  double max_eta;
240 
246 
247 
248  double viscosity (const double temperature,
249  const double pressure,
250  const std::vector<double> &compositional_fields,
251  const SymmetricTensor<2,dim> &strain_rate,
252  const Point<dim> &position) const;
253 
254  double diffusion_viscosity (const double temperature,
255  const double pressure,
256  const std::vector<double> &compositional_fields,
257  const SymmetricTensor<2,dim> &,
258  const Point<dim> &position) const;
259 
271  double dislocation_viscosity (const double temperature,
272  const double pressure,
273  const std::vector<double> &compositional_fields,
274  const SymmetricTensor<2,dim> &strain_rate,
275  const Point<dim> &position,
276  const double viscosity_guess = 0) const;
277 
282  double dislocation_viscosity_fixed_strain_rate (const double temperature,
283  const double pressure,
284  const std::vector<double> &,
285  const SymmetricTensor<2,dim> &dislocation_strain_rate,
286  const Point<dim> &position) const;
287 
288  double density (const double temperature,
289  const double pressure,
290  const std::vector<double> &compositional_fields,
291  const Point<dim> &position) const;
292 
293  double compressibility (const double temperature,
294  const double pressure,
295  const std::vector<double> &compositional_fields,
296  const Point<dim> &position) const;
297 
298  double specific_heat (const double temperature,
299  const double pressure,
300  const std::vector<double> &compositional_fields,
301  const Point<dim> &position) const;
302 
303  double thermal_expansion_coefficient (const double temperature,
304  const double pressure,
305  const std::vector<double> &compositional_fields,
306  const Point<dim> &position) const;
307 
311  double seismic_Vp (const double temperature,
312  const double pressure,
313  const std::vector<double> &compositional_fields,
314  const Point<dim> &position) const;
315 
319  double seismic_Vs (const double temperature,
320  const double pressure,
321  const std::vector<double> &compositional_fields,
322  const Point<dim> &position) const;
323 
339  double
340  grain_size_change (const double temperature,
341  const double pressure,
342  const std::vector<double> &compositional_fields,
343  const SymmetricTensor<2,dim> &strain_rate,
344  const Tensor<1,dim> &velocity,
345  const Point<dim> &position,
346  const unsigned int phase_index,
347  const int crossed_transition) const;
348 
354  double
355  phase_function (const Point<dim> &position,
356  const double temperature,
357  const double pressure,
358  const unsigned int phase) const;
359 
365  unsigned int
366  get_phase_index (const Point<dim> &position,
367  const double temperature,
368  const double pressure) const;
369 
378  void
379  convert_log_grain_size (std::vector<double> &compositional_fields) const;
380 
385  std::vector<double> transition_depths;
386  std::vector<double> transition_temperatures;
387  std::vector<double> transition_slopes;
388  std::vector<double> transition_widths;
389 
390 
395  std::string datadirectory;
396  std::vector<std::string> material_file_names;
397  std::vector<std::string> derivatives_file_names;
398  unsigned int n_material_data;
402 
403 
408  enum formats
409  {
411  hefesto
412  } material_file_format;
413 
419  std::vector<std::unique_ptr<MaterialModel::MaterialUtilities::Lookup::MaterialLookup>> material_lookup;
420 
427  mutable std::unique_ptr<FEPointEvaluation<1, dim>> temperature_evaluator;
428  mutable std::unique_ptr<FEPointEvaluation<1, dim>> pressure_evaluator;
429  };
430 
431  }
432 }
433 
434 #endif
std::vector< double > grain_growth_rate_constant
Definition: grain_size.h:190
std::vector< double > diffusion_activation_volume
Definition: grain_size.h:221
std::vector< double > grain_boundary_energy
Definition: grain_size.h:206
std::vector< std::string > material_file_names
Definition: grain_size.h:396
std::vector< double > grain_growth_activation_energy
Definition: grain_size.h:188
std::vector< double > transition_depths
Definition: grain_size.h:385
std::vector< double > diffusion_creep_exponent
Definition: grain_size.h:219
std::vector< double > dislocation_activation_volume
Definition: grain_size.h:217
std::vector< double > reciprocal_required_strain
Definition: grain_size.h:193
void declare_parameters(ParameterHandler &prm)
std::vector< std::unique_ptr< MaterialModel::MaterialUtilities::Lookup::MaterialLookup > > material_lookup
Definition: grain_size.h:419
std::vector< double > geometric_constant
Definition: grain_size.h:208
std::vector< double > grain_growth_exponent
Definition: grain_size.h:191
std::vector< double > diffusion_creep_grain_size_exponent
Definition: grain_size.h:223
std::vector< double > diffusion_creep_prefactor
Definition: grain_size.h:222
std::vector< double > dislocation_activation_energy
Definition: grain_size.h:216
std::vector< double > boundary_area_change_work_fractions
Definition: grain_size.h:71
unsigned int dislocation_viscosity_iteration_number
Definition: grain_size.h:214
std::vector< double > transition_slopes
Definition: grain_size.h:387
std::vector< double > grain_growth_activation_volume
Definition: grain_size.h:189
std::vector< double > dislocation_creep_exponent
Definition: grain_size.h:215
std::vector< double > recrystallized_grain_size
Definition: grain_size.h:194
std::unique_ptr< FEPointEvaluation< 1, dim > > temperature_evaluator
Definition: grain_size.h:427
std::vector< double > diffusion_activation_energy
Definition: grain_size.h:220
std::vector< double > transition_temperatures
Definition: grain_size.h:386
std::vector< double > transition_widths
Definition: grain_size.h:388
std::vector< double > boundary_area_change_work_fraction
Definition: grain_size.h:207
Definition: compat.h:88
std::vector< std::string > derivatives_file_names
Definition: grain_size.h:397
std::unique_ptr< FEPointEvaluation< 1, dim > > pressure_evaluator
Definition: grain_size.h:428
std::vector< double > dislocation_creep_prefactor
Definition: grain_size.h:218