ASPECT
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
melt_boukare.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2015 - 2023 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 LICENSE. If not see
18  <http://www.gnu.org/licenses/>.
19 */
20 
21 #ifndef _aspect_material_model_melt_boukare_h
22 #define _aspect_material_model_melt_boukare_h
23 
26 #include <aspect/melt.h>
27 
28 namespace aspect
29 {
30  namespace MaterialModel
31  {
35  template <int dim>
37  {
38  public:
39  BoukareOutputs(const unsigned int n_points);
40 
41  std::vector<double> get_nth_output(const unsigned int idx) const override;
42 
46  std::vector<double> bulk_composition;
47  std::vector<double> molar_volatiles_in_melt;
48  };
49 
65  template <int dim>
68  public ::aspect::SimulatorAccess<dim>
69  {
70  public:
74  void
75  initialize () override;
76 
81  bool is_compressible () const override;
82 
83  void evaluate(const typename Interface<dim>::MaterialModelInputs &in,
84  typename Interface<dim>::MaterialModelOutputs &out) const override;
85 
98  void melt_fractions (const MaterialModel::MaterialModelInputs<dim> &in,
99  std::vector<double> &melt_fractions,
100  const MaterialModel::MaterialModelOutputs<dim> *out = nullptr) const override;
101 
106  double reference_darcy_coefficient () const override;
107 
119  static
120  void
121  declare_parameters (ParameterHandler &prm);
122 
126  void
127  parse_parameters (ParameterHandler &prm) override;
128 
133  void
134  create_additional_named_outputs (MaterialModel::MaterialModelOutputs<dim> &out) const override;
135 
136 
137  private:
138  // Thermodynamic parameters of the endmember components in the equation of state,
139  // needed to compute their material properties.
140  std::vector<std::string> endmember_names;
141  std::vector<double> molar_masses;
142  std::vector<double> number_of_atoms;
143  std::vector<double> reference_volumes;
144  std::vector<double> reference_thermal_expansivities;
145  std::vector<double> reference_bulk_moduli;
148  std::vector<double> Einstein_temperatures;
149  std::vector<double> reference_enthalpies;
150  std::vector<double> reference_entropies;
151  std::vector<double> reference_specific_heats;
154  std::vector<double> specific_heat_third_coefficients;
155 
156  std::vector<double> tait_parameters_a;
157  std::vector<double> tait_parameters_b;
158  std::vector<double> tait_parameters_c;
159 
160  // Reference conditions for computing the material properties in the equation of state.
163 
164  // Rheological properties.
165  double eta_0;
166  double xi_0;
167  double eta_f;
170  double alpha_phi;
171 
172  // Transport properties that are not computed from the equation of state.
175 
176  // Parameters controlling melting and solidification of melt.
179 
180  // Parameters defining the molar composition of the two endmember compositions we use
181  // in the melting model.
182  const double molar_MgO_in_Mg_mantle_endmember = 0.581;
183  const double molar_SiO2_in_Mg_mantle_endmember = 0.419;
184  const double molar_FeO_in_Fe_mantle_endmember = 0.908;
185  const double molar_SiO2_in_Fe_mantle_endmember = 0.092;
186 
187  // Parameters describing the melting properties of the two endmembers of the melting model.
188  const double melting_reference_pressure = 120.e9;
189 
190  // reference melting temperature for Fe and Mg mantle endmember at the reference pressure
193 
194  // molar entropy change of melting in J/mol K
195  const double Fe_mantle_melting_entropy = 33.77;
196  const double Mg_mantle_melting_entropy = 34.33;
197 
198  // molar volume change of melting of solid Fe and Mg mantle endmember in m3/mol
199  const double Fe_mantle_melting_volume = 1.51e-07;
200  const double Mg_mantle_melting_volume = 9.29e-08;
201 
202  // Number of moles of atoms mixing on pseudosite in mantle lattice (empirical model fitting the full Boukare model).
205 
206  // Indices for the endmembers in the equation of state.
207  unsigned int febdg_idx;
208  unsigned int mgbdg_idx;
209  unsigned int wus_idx;
210  unsigned int per_idx;
211  unsigned int femelt_idx;
212  unsigned int mgmelt_idx;
213 
214 
215  // Parameter describing if an endmember in the equation of state is solid or molten.
217  {
218  enum Kind
219  {
221  melt
222  };
223  };
224 
225  std::vector<typename EndmemberState::Kind> endmember_states;
226 
227 
228  // Material properties of the different endmembers of the equation of state.
230  {
235  EndmemberProperties(const unsigned int n_endmembers);
236 
237  std::vector<double> volumes;
238  std::vector<double> gibbs_energies;
239  std::vector<double> entropies;
240  std::vector<double> thermal_expansivities;
241  std::vector<double> bulk_moduli;
242  std::vector<double> heat_capacities;
243  };
244 
245 
249  virtual
250  void
251  fill_endmember_properties (const typename Interface<dim>::MaterialModelInputs &in,
252  const unsigned int q,
253  EndmemberProperties &properties) const;
254 
255 
259  virtual
260  double
261  endmember_thermal_energy (const double temperature,
262  const unsigned int endmember_index) const;
263 
264 
268  virtual
269  double
270  endmember_molar_heat_capacity (const double temperature,
271  const unsigned int endmember_index) const;
272 
276  virtual
277  double
278  endmember_thermal_pressure (const double temperature,
279  const unsigned int endmember_index) const;
280 
285  virtual
286  double
287  endmember_enthalpy_thermal_addition (const double temperature,
288  const unsigned int endmember_index) const;
289 
294  virtual
295  double
296  endmember_entropy_thermal_addition (const double temperature,
297  const unsigned int endmember_index) const;
298 
299 
305  virtual
306  void
307  convert_composition_to_fraction_of_endmembers (const double temperature,
308  const double molar_Fe_in_solid,
309  const double molar_Fe_in_melt,
310  const std::vector<double> &endmember_gibbs_energies,
311  std::vector<double> &endmember_mole_fractions_per_phase,
312  double &molar_bridgmanite_in_solid) const;
313 
314 
320  virtual
321  double
322  compute_melt_molar_fraction (const double porosity,
323  const double bridgmanite_molar_fraction_in_solid,
324  EndmemberProperties &properties,
325  const std::vector<double> &endmember_mole_fractions_per_phase) const;
326 
327 
332  virtual
333  double
334  assert_update_is_within_0_and_1 (const double value,
335  const double change_of_value) const;
336 
337 
345  virtual
346  double
347  melt_fraction (const double temperature,
348  const double pressure,
349  const double bulk_composition,
350  double &molar_volatiles_in_melt,
351  double &solid_composition,
352  double &melt_composition) const;
353  };
354 
355  }
356 }
357 
358 #endif
std::vector< double > tait_parameters_b
Definition: melt_boukare.h:157
std::vector< double > get_nth_output(const unsigned int idx) const override
std::vector< double > number_of_atoms
Definition: melt_boukare.h:142
std::vector< double > bulk_modulus_second_pressure_derivatives
Definition: melt_boukare.h:147
std::vector< double > reference_volumes
Definition: melt_boukare.h:143
std::vector< std::string > endmember_names
Definition: melt_boukare.h:140
BoukareOutputs(const unsigned int n_points)
void declare_parameters(ParameterHandler &prm)
std::vector< double > tait_parameters_a
Definition: melt_boukare.h:156
std::vector< double > specific_heat_linear_coefficients
Definition: melt_boukare.h:152
std::vector< typename EndmemberState::Kind > endmember_states
Definition: melt_boukare.h:225
std::vector< double > bulk_composition
Definition: melt_boukare.h:46
std::vector< double > specific_heat_second_coefficients
Definition: melt_boukare.h:153
std::vector< double > reference_entropies
Definition: melt_boukare.h:150
std::vector< double > specific_heat_third_coefficients
Definition: melt_boukare.h:154
std::vector< double > bulk_modulus_pressure_derivatives
Definition: melt_boukare.h:146
std::vector< double > reference_bulk_moduli
Definition: melt_boukare.h:145
std::vector< double > molar_masses
Definition: melt_boukare.h:141
std::vector< double > reference_thermal_expansivities
Definition: melt_boukare.h:144
std::vector< double > Einstein_temperatures
Definition: melt_boukare.h:148
std::vector< double > reference_specific_heats
Definition: melt_boukare.h:151
std::vector< double > tait_parameters_c
Definition: melt_boukare.h:158
std::vector< double > reference_enthalpies
Definition: melt_boukare.h:149
std::vector< double > molar_volatiles_in_melt
Definition: melt_boukare.h:47