ASPECT
grain_size.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2014 - 2019 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 #include <array>
28 
29 namespace aspect
30 {
31  namespace MaterialModel
32  {
33  using namespace dealii;
34 
40  template <int dim>
42  {
43  public:
44  DislocationViscosityOutputs(const unsigned int n_points);
45 
46  virtual std::vector<double> get_nth_output(const unsigned int idx) const;
47 
53  std::vector<double> dislocation_viscosities;
54 
62  };
63 
64 
65 
87  template <int dim>
89  {
90  public:
95  virtual
96  void
97  initialize ();
98 
107  virtual bool is_compressible () const;
108 
109  virtual double reference_viscosity () const;
110 
111  virtual void evaluate(const typename Interface<dim>::MaterialModelInputs &in,
112  typename Interface<dim>::MaterialModelOutputs &out) const;
113 
121  static
122  void
124 
128  virtual
129  void
130  parse_parameters (ParameterHandler &prm);
131 
132 
133  virtual
134  void
135  create_additional_named_outputs (MaterialModel::MaterialModelOutputs<dim> &out) const;
143  double enthalpy (const double temperature,
144  const double pressure,
145  const std::vector<double> &compositional_fields,
146  const Point<dim> &position) const;
147 
159  std::array<std::pair<double, unsigned int>,2>
160  enthalpy_derivative (const typename Interface<dim>::MaterialModelInputs &in) const;
161 
162  protected:
164  double reference_T;
165  double eta;
168 
173 
177  double k_value;
178 
182  std::vector<double> grain_growth_activation_energy;
183  std::vector<double> grain_growth_activation_volume;
184  std::vector<double> grain_growth_rate_constant;
185  std::vector<double> grain_growth_exponent;
187  std::vector<double> reciprocal_required_strain;
188  std::vector<double> recrystallized_grain_size;
189 
200  std::vector<double> grain_boundary_energy;
202  std::vector<double> geometric_constant;
203 
209  std::vector<double> dislocation_creep_exponent;
210  std::vector<double> dislocation_activation_energy;
211  std::vector<double> dislocation_activation_volume;
212  std::vector<double> dislocation_creep_prefactor;
213  std::vector<double> diffusion_creep_exponent;
214  std::vector<double> diffusion_activation_energy;
215  std::vector<double> diffusion_activation_volume;
216  std::vector<double> diffusion_creep_prefactor;
218 
225  double min_eta;
226  double max_eta;
234 
240 
241 
242  double viscosity (const double temperature,
243  const double pressure,
244  const std::vector<double> &compositional_fields,
246  const Point<dim> &position) const;
247 
248  double diffusion_viscosity (const double temperature,
249  const double pressure,
250  const std::vector<double> &compositional_fields,
251  const SymmetricTensor<2,dim> &,
252  const Point<dim> &position) const;
253 
265  double dislocation_viscosity (const double temperature,
266  const double pressure,
267  const std::vector<double> &compositional_fields,
269  const Point<dim> &position,
270  const double viscosity_guess = 0) const;
271 
276  double dislocation_viscosity_fixed_strain_rate (const double temperature,
277  const double pressure,
278  const std::vector<double> &,
279  const SymmetricTensor<2,dim> &dislocation_strain_rate,
280  const Point<dim> &position) const;
281 
282  double density (const double temperature,
283  const double pressure,
284  const std::vector<double> &compositional_fields,
285  const Point<dim> &position) const;
286 
287  double compressibility (const double temperature,
288  const double pressure,
289  const std::vector<double> &compositional_fields,
290  const Point<dim> &position) const;
291 
292  double specific_heat (const double temperature,
293  const double pressure,
294  const std::vector<double> &compositional_fields,
295  const Point<dim> &position) const;
296 
297  double thermal_expansion_coefficient (const double temperature,
298  const double pressure,
299  const std::vector<double> &compositional_fields,
300  const Point<dim> &position) const;
301 
305  double seismic_Vp (const double temperature,
306  const double pressure,
307  const std::vector<double> &compositional_fields,
308  const Point<dim> &position) const;
309 
313  double seismic_Vs (const double temperature,
314  const double pressure,
315  const std::vector<double> &compositional_fields,
316  const Point<dim> &position) const;
317 
333  double
334  grain_size_change (const double temperature,
335  const double pressure,
336  const std::vector<double> &compositional_fields,
338  const Tensor<1,dim> &velocity,
339  const Point<dim> &position,
340  const unsigned int phase_index,
341  const int crossed_transition) const;
342 
348  double
349  phase_function (const Point<dim> &position,
350  const double temperature,
351  const double pressure,
352  const unsigned int phase) const;
353 
359  unsigned int
360  get_phase_index (const Point<dim> &position,
361  const double temperature,
362  const double pressure) const;
363 
372  void
373  convert_log_grain_size (std::vector<double> &compositional_fields) const;
374 
379  std::vector<double> transition_depths;
380  std::vector<double> transition_temperatures;
381  std::vector<double> transition_slopes;
382  std::vector<double> transition_widths;
383 
384 
389  std::string datadirectory;
390  std::vector<std::string> material_file_names;
391  std::vector<std::string> derivatives_file_names;
392  unsigned int n_material_data;
396 
397 
402  enum formats
403  {
405  hefesto
406  } material_file_format;
407 
413  std::vector<std::unique_ptr<MaterialModel::MaterialUtilities::Lookup::MaterialLookup> > material_lookup;
414  };
415 
416  }
417 }
418 
419 #endif
std::vector< double > grain_growth_rate_constant
Definition: grain_size.h:184
std::vector< double > diffusion_activation_volume
Definition: grain_size.h:215
std::vector< double > grain_boundary_energy
Definition: grain_size.h:200
std::vector< std::string > material_file_names
Definition: grain_size.h:390
std::vector< double > grain_growth_activation_energy
Definition: grain_size.h:182
std::vector< double > transition_depths
Definition: grain_size.h:379
std::vector< double > diffusion_creep_exponent
Definition: grain_size.h:213
std::vector< double > dislocation_activation_volume
Definition: grain_size.h:211
std::vector< double > reciprocal_required_strain
Definition: grain_size.h:187
void declare_parameters(ParameterHandler &prm)
std::vector< std::unique_ptr< MaterialModel::MaterialUtilities::Lookup::MaterialLookup > > material_lookup
Definition: grain_size.h:413
std::vector< double > geometric_constant
Definition: grain_size.h:202
std::vector< double > grain_growth_exponent
Definition: grain_size.h:185
std::vector< double > diffusion_creep_grain_size_exponent
Definition: grain_size.h:217
std::vector< double > diffusion_creep_prefactor
Definition: grain_size.h:216
std::vector< double > dislocation_activation_energy
Definition: grain_size.h:210
std::vector< double > boundary_area_change_work_fractions
Definition: grain_size.h:61
unsigned int dislocation_viscosity_iteration_number
Definition: grain_size.h:208
std::vector< double > transition_slopes
Definition: grain_size.h:381
std::vector< double > grain_growth_activation_volume
Definition: grain_size.h:183
std::vector< double > dislocation_creep_exponent
Definition: grain_size.h:209
std::vector< double > recrystallized_grain_size
Definition: grain_size.h:188
Definition: compat.h:37
std::vector< double > diffusion_activation_energy
Definition: grain_size.h:214
std::vector< double > transition_temperatures
Definition: grain_size.h:380
std::vector< double > transition_widths
Definition: grain_size.h:382
std::vector< double > boundary_area_change_work_fraction
Definition: grain_size.h:201
std::vector< std::string > derivatives_file_names
Definition: grain_size.h:391
std::vector< double > dislocation_creep_prefactor
Definition: grain_size.h:212