31 using namespace Utilities;
35 namespace SubductingPlateModels
41 min_depth(NaN::
DSNAN),
42 max_depth(NaN::
DSNAN),
44 plate_velocity(NaN::
DSNAN),
45 thermal_conductivity(NaN::
DSNAN),
46 thermal_expansion_coefficient(NaN::
DSNAN),
47 specific_heat(NaN::
DSNAN),
48 potential_mantle_temperature(NaN::
DSNAN),
49 surface_temperature(NaN::
DSNAN),
50 adiabatic_heating(true),
54 this->
name =
"plate model";
66 "Plate model (based on McKenzie, 1970).");
70 "todo The depth in meters from which the composition of this feature is present.");
73 "todo The depth in meters to which the composition of this feature is present.");
76 "The reference density of the subducting plate in $kg/m^3$");
79 "The velocity in meters per year with which the plate subducts in meters per year.");
82 "The thermal conductivity of the subducting plate material in $W m^{-1} K^{-1}$.");
85 "The thermal expansivity of the subducting plate material in $K^{-1}$. If smaller than zero, the global value is used.");
88 "The specific heat of the subducting plate material in $J kg^{-1} K^{-1}$. If smaller than zero, the global value is used.");
91 "Whether adiabatic heating should be used for the slab. Setting the parameter to false leads to equation 26 from McKenzie (1970)," 92 "which is the result obtained from McKenzie 1969.");
95 "The potential temperature of the mantle at the surface in Kelvin. If smaller than zero, the global value is used.");
111 if (thermal_expansion_coefficient < 0 )
125 prm.
get<
double>(
"potential mantle temperature");
133 const double gravity_norm,
144 if (distance_from_plane <= max_depth && distance_from_plane >=
min_depth)
157 WBAssert(!std::isnan(R),
"Internal error: R is not a number: " << R <<
'.');
159 const int n_sum = 500;
161 const double z_scaled = 1 - (std::fabs(distance_from_plane) < 2.0 * std::numeric_limits<double>::epsilon() ?
162 2.0 * std::numeric_limits<double>::epsilon()
164 distance_from_plane/thickness_local);
167 const double x_scaled = (std::fabs(distance_along_plane) < 2.0 * std::numeric_limits<double>::epsilon() ?
168 2.0 *std::numeric_limits<double>::epsilon()
170 distance_along_plane/thickness_local);
183 WBAssert(!std::isnan(temp),
"Internal error: temp is not a number: " << temp <<
". In exponent: " 186 <<
", specific_heat = "<<
specific_heat <<
", depth = " << depth );
189 for (
int i=1; i<=n_sum; i++)
193 * (
sin(i * Consts::PI * z_scaled));
199 WBAssert(!std::isnan(temperature),
"Internal error: temperature is not a number: " << temperature <<
'.');
200 WBAssert(std::isfinite(temperature),
"Internal error: temperature is not finite: " << temperature <<
'.');
WorldBuilder::World * world
double surface_temperature
double potential_mantle_temperature
void parse_entries(Parameters &prm) override final
Operations string_operations_to_enum(const std::string &operation)
double thermal_conductivity
double potential_mantle_temperature
#define WBAssert(condition, message)
double distance_from_plane
double distance_along_plane
~PlateModel() override final
double surface_temperature
#define WB_REGISTER_FEATURE_SUBDUCTING_PLATE_TEMPERATURE_MODEL(classname, name)
double get_temperature(const Point< 3 > &position, const double depth, const double gravity, double temperature, const double feature_min_depth, const double feature_max_depth, const WorldBuilder::Utilities::PointDistanceFromCurvedPlanes &distance_from_planes, const AdditionalParameters &additional_parameters) const override final
double thermal_expansion_coefficient
double thermal_expansion_coefficient
double apply_operation(const Operations operation, const double old_value, const double new_value)
double sin(const double raw_angle)
void declare_entry(const std::string &name, const Types::Interface &type, const std::string &documentation)
static void declare_entries(Parameters &prm, const std::string &parent_name="")
T get(const std::string &name)