34 using namespace Utilities;
38 namespace SubductingPlateModels
44 min_depth(NaN::
DSNAN),
45 max_depth(NaN::
DSNAN),
49 this->
name =
"water content";
61 "TianWaterContent compositional model. Sets bound water content as a compositional field. The returned " 62 "water content is based on the the temperature and pressure at a point within the world. Currently, " 63 "the bound water content can be determined for four different lithologies: 'sediment', mid-ocean " 64 "ridge basalt ('MORB'), 'gabbro', and 'peridotite', using parameterized phase diagrams from Tian et al., 2019 " 65 "(https://doi.org/10.1029/2019GC008488). The pressure is lithostatic, calculated with a constant user defined " 66 "density, and is limited by a user defined cutoff pressure (in GPa) for each lithology. This is required because the " 67 "parameterization breaks down at large pressures. Recommended cutoff pressures are 10 GPa is used for 'peridotite', " 68 "26 GPa is used for 'gabbro', 16 GPa is used for 'MORB', and 1 GPa is used for 'sediment'.");
72 "todo The depth in meters from which the composition of this feature is present.");
74 "todo The depth in meters to which the composition of this feature is present.");
76 "The reference density used for determining the lithostatic pressure for calculating " 77 "the bound water content.");
79 "A list with the labels of the composition which are present there.");
81 "The lithology used to determine which polynomials to use for calculating the water content. Valid options are: " 82 "'sediment', 'MORB', 'gabbro', and 'peridotite'.");
84 "The value of the initial water content (in wt%) for the lithology at the trench. This represents the " 85 "max value applied to this lithology.");
87 "The upper bound for the pressure, in GPa, for the specified lithology in the Tian parameterization. This is necessary because " 88 "the parameterization breaks down for high pressures. It is recommended that 10 GPa is used for 'peridotite', 26 GPa is used for " 89 "'gabbro', 16 GPa is used for 'MORB', and 1 GPa is used for 'sediment'.");
90 prm.
declare_entry(
"operation",
Types::String(
"replace", std::vector<std::string> {
"replace",
"replace defined only",
"add",
"subtract"}),
91 "Whether the value should replace any value previously defined at this location (replace) or " 92 "add the value to the previously define value. Replacing implies that all compositions not " 93 "explicitly defined are set to zero. To only replace the defined compositions use the replace only defined option.");
107 std::string lithology_string = prm.
get<std::string>(
"lithology");
109 if (lithology_string==
"peridotite")
111 else if (lithology_string==
"gabbro")
113 else if (lithology_string==
"MORB")
115 else if (lithology_string==
"sediment")
122 double temperature)
const 124 double ln_LR_value = 0;
125 double ln_c_sat_value = 0;
127 std::vector<double> LR_polynomial_coeffs;
128 std::vector<double> c_sat_polynomial_coeffs;
129 std::vector<double> Td_polynomial_coeffs;
144 for (
unsigned int LR_coeff_index = 0; LR_coeff_index <
LR_poly[
lithology_type].size(); ++LR_coeff_index)
148 for (
unsigned int Td_coeff_index = 0; Td_coeff_index <
Td_poly[
lithology_type].size(); ++Td_coeff_index)
151 double partition_coeff = std::exp(ln_c_sat_value) * std::exp(std::exp(ln_LR_value) * (1/temperature - 1/Td_value));
152 return partition_coeff;
159 const unsigned int composition_number,
170 const double lithostatic_pressure = std::max(0.5, std::min(
density * 9.81 * depth / 1e9,
cutoff_pressure));
171 const double slab_temperature =
world->
properties(position_in_cartesian_coordinates.
get_array(), depth, {{{1,0,0}}})[0];
176 partition_coefficient = std::min(
max_water_content, partition_coefficient) / 100;
void parse_entries(Parameters &prm) override final
LithologyName lithology_type
std::vector< std::vector< double > > Td_poly
std::vector< double > properties(const std::array< double, 2 > &point, const double depth, const std::vector< std::array< unsigned int, 3 >> &properties) const
double calculate_water_content(double pressure, double temperature) const
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
std::vector< std::vector< double > > c_sat_poly
const std::array< double, dim > & get_array() const
Operations string_operations_to_enum(const std::string &operation)
static void declare_entries(Parameters &prm, const std::string &parent_name="")
WorldBuilder::World * world
~TianWaterContent() override final
double distance_from_plane
std::vector< std::vector< double > > LR_poly
#define WB_REGISTER_FEATURE_SUBDUCTING_PLATE_COMPOSITION_MODEL(classname, name)
std::vector< unsigned int > compositions
double apply_operation(const Operations operation, const double old_value, const double new_value)
void declare_entry(const std::string &name, const Types::Interface &type, const std::string &documentation)
std::vector< T > get_vector(const std::string &name)
T get(const std::string &name)