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 
94  void melt_fractions (const MaterialModel::MaterialModelInputs<dim> &in,
95  std::vector<double> &melt_fractions) const override;
96 
101  double reference_darcy_coefficient () const override;
102 
114  static
115  void
116  declare_parameters (ParameterHandler &prm);
117 
121  void
122  parse_parameters (ParameterHandler &prm) override;
123 
128  void
129  create_additional_named_outputs (MaterialModel::MaterialModelOutputs<dim> &out) const override;
130 
131 
132  private:
133  // Thermodynamic parameters of the endmember components in the equation of state,
134  // needed to compute their material properties.
135  std::vector<std::string> endmember_names;
136  std::vector<double> molar_masses;
137  std::vector<double> number_of_atoms;
138  std::vector<double> reference_volumes;
139  std::vector<double> reference_thermal_expansivities;
140  std::vector<double> reference_bulk_moduli;
143  std::vector<double> Einstein_temperatures;
144  std::vector<double> reference_enthalpies;
145  std::vector<double> reference_entropies;
146  std::vector<double> reference_specific_heats;
149  std::vector<double> specific_heat_third_coefficients;
150 
151  std::vector<double> tait_parameters_a;
152  std::vector<double> tait_parameters_b;
153  std::vector<double> tait_parameters_c;
154 
155  // Reference conditions for computing the material properties in the equation of state.
158 
159  // Rheological properties.
160  double eta_0;
161  double xi_0;
162  double eta_f;
165  double alpha_phi;
166 
167  // Transport properties that are not computed from the equation of state.
170 
171  // Parameters controlling melting and solidification of melt.
174 
175  // Parameters defining the molar composition of the two endmember compositions we use
176  // in the melting model.
177  const double molar_MgO_in_Mg_mantle_endmember = 0.581;
178  const double molar_SiO2_in_Mg_mantle_endmember = 0.419;
179  const double molar_FeO_in_Fe_mantle_endmember = 0.908;
180  const double molar_SiO2_in_Fe_mantle_endmember = 0.092;
181 
182  // Parameters describing the melting properties of the two endmembers of the melting model.
183  const double melting_reference_pressure = 120.e9;
184 
185  // reference melting temperature for Fe and Mg mantle endmember at the reference pressure
188 
189  // molar entropy change of melting in J/mol K
190  const double Fe_mantle_melting_entropy = 33.77;
191  const double Mg_mantle_melting_entropy = 34.33;
192 
193  // molar volume change of melting of solid Fe and Mg mantle endmember in m3/mol
194  const double Fe_mantle_melting_volume = 1.51e-07;
195  const double Mg_mantle_melting_volume = 9.29e-08;
196 
197  // Number of moles of atoms mixing on pseudosite in mantle lattice (empirical model fitting the full Boukare model).
200 
201  // Indices for the endmembers in the equation of state.
202  unsigned int febdg_idx;
203  unsigned int mgbdg_idx;
204  unsigned int wus_idx;
205  unsigned int per_idx;
206  unsigned int femelt_idx;
207  unsigned int mgmelt_idx;
208 
209 
210  // Parameter describing if an endmember in the equation of state is solid or molten.
212  {
213  enum Kind
214  {
216  melt
217  };
218  };
219 
220  std::vector<typename EndmemberState::Kind> endmember_states;
221 
222 
223  // Material properties of the different endmembers of the equation of state.
225  {
230  EndmemberProperties(const unsigned int n_endmembers);
231 
232  std::vector<double> volumes;
233  std::vector<double> gibbs_energies;
234  std::vector<double> entropies;
235  std::vector<double> thermal_expansivities;
236  std::vector<double> bulk_moduli;
237  std::vector<double> heat_capacities;
238  };
239 
240 
244  virtual
245  void
246  fill_endmember_properties (const typename Interface<dim>::MaterialModelInputs &in,
247  const unsigned int q,
248  EndmemberProperties &properties) const;
249 
250 
254  virtual
255  double
256  endmember_thermal_energy (const double temperature,
257  const unsigned int endmember_index) const;
258 
259 
263  virtual
264  double
265  endmember_molar_heat_capacity (const double temperature,
266  const unsigned int endmember_index) const;
267 
271  virtual
272  double
273  endmember_thermal_pressure (const double temperature,
274  const unsigned int endmember_index) const;
275 
280  virtual
281  double
282  endmember_enthalpy_thermal_addition (const double temperature,
283  const unsigned int endmember_index) const;
284 
289  virtual
290  double
291  endmember_entropy_thermal_addition (const double temperature,
292  const unsigned int endmember_index) const;
293 
294 
300  virtual
301  void
302  convert_composition_to_fraction_of_endmembers (const double temperature,
303  const double molar_Fe_in_solid,
304  const double molar_Fe_in_melt,
305  const std::vector<double> &endmember_gibbs_energies,
306  std::vector<double> &endmember_mole_fractions_per_phase,
307  double &molar_bridgmanite_in_solid) const;
308 
309 
315  virtual
316  double
317  compute_melt_molar_fraction (const double porosity,
318  const double bridgmanite_molar_fraction_in_solid,
319  EndmemberProperties &properties,
320  const std::vector<double> &endmember_mole_fractions_per_phase) const;
321 
322 
327  virtual
328  double
329  assert_update_is_within_0_and_1 (const double value,
330  const double change_of_value) const;
331 
332 
340  virtual
341  double
342  melt_fraction (const double temperature,
343  const double pressure,
344  const double bulk_composition,
345  double &molar_volatiles_in_melt,
346  double &solid_composition,
347  double &melt_composition) const;
348  };
349 
350  }
351 }
352 
353 #endif
std::vector< double > tait_parameters_b
Definition: melt_boukare.h:152
std::vector< double > get_nth_output(const unsigned int idx) const override
std::vector< double > number_of_atoms
Definition: melt_boukare.h:137
std::vector< double > bulk_modulus_second_pressure_derivatives
Definition: melt_boukare.h:142
std::vector< double > reference_volumes
Definition: melt_boukare.h:138
std::vector< std::string > endmember_names
Definition: melt_boukare.h:135
BoukareOutputs(const unsigned int n_points)
void declare_parameters(ParameterHandler &prm)
std::vector< double > tait_parameters_a
Definition: melt_boukare.h:151
std::vector< double > specific_heat_linear_coefficients
Definition: melt_boukare.h:147
std::vector< typename EndmemberState::Kind > endmember_states
Definition: melt_boukare.h:220
std::vector< double > bulk_composition
Definition: melt_boukare.h:46
Definition: compat.h:59
std::vector< double > specific_heat_second_coefficients
Definition: melt_boukare.h:148
std::vector< double > reference_entropies
Definition: melt_boukare.h:145
std::vector< double > specific_heat_third_coefficients
Definition: melt_boukare.h:149
std::vector< double > bulk_modulus_pressure_derivatives
Definition: melt_boukare.h:141
std::vector< double > reference_bulk_moduli
Definition: melt_boukare.h:140
std::vector< double > molar_masses
Definition: melt_boukare.h:136
std::vector< double > reference_thermal_expansivities
Definition: melt_boukare.h:139
std::vector< double > Einstein_temperatures
Definition: melt_boukare.h:143
std::vector< double > reference_specific_heats
Definition: melt_boukare.h:146
std::vector< double > tait_parameters_c
Definition: melt_boukare.h:153
std::vector< double > reference_enthalpies
Definition: melt_boukare.h:144
std::vector< double > molar_volatiles_in_melt
Definition: melt_boukare.h:47