ASPECT
reaction_chain.h
Go to the documentation of this file.
1 // ------------------------------------------------------
2 //
3 // SPDX-License-Identifier: GPL-2.0-or-later
4 //
5 // SPDX-FileCopyrightText: Copyright (C) 2011-2026 by the ASPECT authors.
6 //
7 // This file is part of ASPECT.
8 //
9 // Detailed license information governing the source code and
10 // contributions can be found in the folder LICENSES and in
11 // LICENSE and CONTRIBUTING.md at the top level directory.
12 //
13 // ------------------------------------------------------
14 
15 #ifndef _aspect_material_model_reaction_model_reaction_chain_h
16 #define _aspect_material_model_reaction_model_reaction_chain_h
17 
18 #include <aspect/material_model/reaction_model/kinetics/cahn1956_interface.h>
19 #include <aspect/utilities.h>
20 
21 namespace aspect
22 {
23  namespace MaterialModel
24  {
25  namespace ReactionModel
26  {
30  template <int dim>
31  struct ReactionStep
32  {
33  std::shared_ptr<Cahn1956Interface<dim>> kinetics;
35  };
36 
47  template <int dim>
49  {
50  public:
51  std::vector<ReactionStep<dim>> reactions;
52 
53  void
54  initialize();
55 
56  unsigned int
57  n_reactions() const;
58 
59  std::vector<double>
60  clamp_cumulative_progress(std::vector<double> reaction_progress_values) const;
61 
62  std::vector<double>
63  compute_phase_mass_fractions(const std::vector<double> &reaction_progress_values,
64  const std::vector<double> &phase_densities) const;
65 
66  double
67  net_forward_reaction_rate(const double temperature,
68  const double pressure,
69  const double delta_forward_gibbs_energy,
70  const double cumulative_forward_reaction_progress,
71  const unsigned int reaction_index) const;
72 
73  static
74  void
76 
77  void
78  parse_parameters(ParameterHandler &prm);
79 
80  private:
84  std::vector<std::shared_ptr<Cahn1956Interface<dim>>> kinetics_models;
85 
91  };
92  }
93  }
94 }
95 #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