ASPECT
reaction_chain.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2011 - 2026 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_reaction_model_reaction_chain_h
22 #define _aspect_material_model_reaction_model_reaction_chain_h
23 
24 #include <aspect/material_model/reaction_model/kinetics/cahn1956_interface.h>
25 #include <aspect/utilities.h>
26 
27 namespace aspect
28 {
29  namespace MaterialModel
30  {
31  namespace ReactionModel
32  {
36  template <int dim>
37  struct ReactionStep
38  {
39  std::shared_ptr<Cahn1956Interface<dim>> kinetics;
41  };
42 
53  template <int dim>
55  {
56  public:
57  std::vector<ReactionStep<dim>> reactions;
58 
59  void initialize();
60  unsigned int n_reactions() const;
61 
62  std::vector<double> clamp_cumulative_progress(std::vector<double> reaction_progress_values) const;
63  std::vector<double> compute_phase_mass_fractions(const std::vector<double> &reaction_progress_values,
64  const std::vector<double> &phase_densities) const;
65 
66  double net_forward_reaction_rate(const double temperature,
67  const double pressure,
68  const double delta_forward_gibbs_energy,
69  const double cumulative_forward_reaction_progress,
70  const unsigned int reaction_index) const;
71 
72  static void declare_parameters(ParameterHandler &prm);
73  void parse_parameters(ParameterHandler &prm);
74 
75  private:
79  std::vector<std::shared_ptr<Cahn1956Interface<dim>>> kinetics_models;
80 
86  };
87  }
88  }
89 }
90 #endif
constexpr unsigned int invalid_unsigned_int
void declare_parameters(ParameterHandler &prm)
std::shared_ptr< Cahn1956Interface< dim > > kinetics
std::vector< std::shared_ptr< Cahn1956Interface< dim > > > kinetics_models
std::vector< ReactionStep< dim > > reactions