34 using namespace Utilities;
38 namespace MantleLayerModels
44 min_depth(NaN::
DSNAN),
45 max_depth(NaN::
DSNAN),
46 top_temperature(NaN::
DSNAN),
47 bottom_temperature(NaN::
DSNAN),
51 this->
name =
"linear";
63 "Linear temperature model. Can be set to use an adiabatic temperature at the boundaries.");
67 "The depth in meters from which the temperature of this feature is present.");
70 "The depth in meters to which the temperature of this feature is present.");
73 "The temperature at the top in degree Kelvin of this feature." 74 "If the value is below zero, the an adiabatic temperature is used.");
77 "The temperature at the top in degree Kelvin of this feature. " 78 "If the value is below zero, an adiabatic temperature is used.");
88 WBAssert(max_depth >= min_depth,
"max depth needs to be larger or equal to min depth.");
99 const double gravity_norm,
101 const double feature_min_depth,
102 const double feature_max_depth)
const 104 if (depth <= max_depth && depth >=
min_depth)
108 if (depth <= max_depth_local && depth >= min_depth_local)
110 const double min_depth_local_local = std::max(feature_min_depth, min_depth_local);
111 const double max_depth_local_local = std::min(feature_max_depth, max_depth_local);
114 if (top_temperature_local < 0)
118 this->world->specific_heat) * min_depth_local_local);
122 if (bottom_temperature_local < 0)
126 this->world->specific_heat) * max_depth_local_local);
130 const double new_temperature = top_temperature_local + (max_depth_local_local - min_depth_local_local < 10.0*std::numeric_limits<double>::epsilon() ? 0.0 :
131 (depth - min_depth_local_local) *
132 ((bottom_temperature_local - top_temperature_local) / (max_depth_local_local - min_depth_local_local)));
static void declare_entries(Parameters &prm, const std::string &parent_name="")
Objects::Surface max_depth_surface
Objects::Surface min_depth_surface
double potential_mantle_temperature
void parse_entries(Parameters &prm, const std::vector< Point< 2 >> &coordinates) override final
#define WB_REGISTER_FEATURE_MANTLE_LAYER_TEMPERATURE_MODEL(classname, name)
WorldBuilder::World * world
Operations string_operations_to_enum(const std::string &operation)
#define WBAssert(condition, message)
double bottom_temperature
Point< 2 > get_surface_point() const
double get_temperature(const Point< 3 > &position, const Objects::NaturalCoordinate &position_in_natural_coordinates, const double depth, const double gravity, double temperature, const double feature_min_depth, const double feature_max_depth) const override final
SurfaceValueInfo local_value(const Point< 2 > &check_point) const
double thermal_expansion_coefficient
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)
T get(const std::string &name)