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 initialize();
54  unsigned int n_reactions() const;
55 
56  std::vector<double> clamp_cumulative_progress(std::vector<double> reaction_progress_values) const;
57  std::vector<double> compute_phase_mass_fractions(const std::vector<double> &reaction_progress_values,
58  const std::vector<double> &phase_densities) const;
59 
60  double net_forward_reaction_rate(const double temperature,
61  const double pressure,
62  const double delta_forward_gibbs_energy,
63  const double cumulative_forward_reaction_progress,
64  const unsigned int reaction_index) const;
65 
66  static void declare_parameters(ParameterHandler &prm);
67  void parse_parameters(ParameterHandler &prm);
68 
69  private:
73  std::vector<std::shared_ptr<Cahn1956Interface<dim>>> kinetics_models;
74 
80  };
81  }
82  }
83 }
84 #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