World Builder  1.1.0-pre
A geodynamic initial conditions generator
tian2019_water_content.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2018 - 2024 by the authors of the World Builder code.
3 
4  This file is part of the World Builder.
5 
6  This program is free software: you can redistribute it and/or modify
7  it under the terms of the GNU Lesser General Public License as published
8  by the Free Software Foundation, either version 2 of the License, or
9  (at your option) any later version.
10 
11  This program 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 Lesser General Public License for more details.
15 
16  You should have received a copy of the GNU Lesser General Public License
17  along with this program. If not, see <https://www.gnu.org/licenses/>.
18 */
19 
20 #ifndef WORLD_BUILDER_FEATURES_SUBDUCTING_PLATE_MODELS_COMPOSITION_WATER_CONTENT_H
21 #define WORLD_BUILDER_FEATURES_SUBDUCTING_PLATE_MODELS_COMPOSITION_WATER_CONTENT_H
22 
23 
25 #include <mutex>
26 
27 
28 namespace WorldBuilder
29 {
30 
31  namespace Features
32  {
33  namespace SubductingPlateModels
34  {
35  namespace Composition
36  {
45  class TianWaterContent final: public Interface
46  {
47  public:
52 
56  ~TianWaterContent() override final;
57 
61  static
62  void declare_entries(Parameters &prm, const std::string &parent_name = "");
63 
67  void parse_entries(Parameters &prm) override final;
68 
74  double calculate_water_content(double pressure,
75  double temperature) const;
80  double get_composition(const Point<3> &position,
81  const double depth,
82  const unsigned int composition_number,
83  double composition,
84  const double feature_min_depth,
85  const double feature_max_depth,
87  const AdditionalParameters &additional_parameters) const override final;
88 
89 
90  private:
91  // TianWaterContent composition submodule parameters
92  double min_depth;
93  double max_depth;
94  double density; // Density used to calculate the lithostatic pressure
95  std::vector<unsigned int> compositions;
97  std::string lithology_str;
99 
101  {
106  };
108 
109  // Define the coefficients for the polynomials for 3 quantities: LR which represents the
110  // enthalpy change of the dehydration reactions, c_sat which represents the volatile saturation
111  // content, and Td which represents the onset temperature of dehydration. The first row is for
112  // 'peridotite', the second row is for 'gabbro', the third row is for 'MORB', and the fourth row
113  // is for 'sediment'.
114  std::vector<std::vector<double>> LR_poly =
115  {
116  {-19.0609, 168.983, -630.032, 1281.84, -1543.14, 1111.88, -459.142, 95.4143, 1.97246},
117  {-1.81745, 7.67198, -10.8507, 5.09329, 8.14519},
118  {-1.78177, 7.50871, -10.4840, 5.19725, 7.96365},
119  {-2.03283, 10.8186, -21.2119, 18.3351, -6.48711, 8.32459}
120  };
121 
122  std::vector<std::vector<double>> c_sat_poly =
123  {
124  {0.00115628, 2.42179},
125  {-0.0176673, 0.0893044, 1.52732},
126  {0.0102725, -0.115390, 0.324452, 1.41588},
127  {-0.150662, 0.301807, 1.01867}
128  };
129 
130  std::vector<std::vector<double>> Td_poly =
131  {
132  {-15.4627, 94.9716, 636.603},
133  {-1.72277, 20.5898, 637.517},
134  {-3.81280, 22.7809, 638.049},
135  {2.83277, -24.7593, 85.9090, 524.898}
136  };
137 
138  // Maximum pressure for the lithologies (Peridotite, Gabbro, MORB, Sediment). These are required because
139  // Above these pressures, the parameterized phase diagrams break down and the solubility goes to infinity.
141  };
142  } // namespace Composition
143  } // namespace SubductingPlateModels
144  } // namespace Features
145 } // namespace WorldBuilder
146 
147 #endif
double get_composition(const Point< 3 > &position, const double depth, const unsigned int composition_number, double composition, const double feature_min_depth, const double feature_max_depth, const WorldBuilder::Utilities::PointDistanceFromCurvedPlanes &distance_from_planes, const AdditionalParameters &additional_parameters) const override final
static void declare_entries(Parameters &prm, const std::string &parent_name="")