33 using namespace Utilities;
46 this->
name =
"gaussian";
58 "Gaussian temperature model. The temperature is interpolated between the plume center " 59 "and margin (as defined by the plume feature) using a Gaussian function: " 60 "T(r) = T_center(z) exp(-r^2/(2 sigma^2). " 61 "The temperature at the plume centerline T_center can be changed with depth by defining " 62 "an array of depths and centerline temperatures, and temperature is interpolated linearly " 63 "with depth. Similarly, the sigma of the Gaussian function (relative to the width of " 64 "the plume as given by the plume feature) can be changed with depth. " 65 "Temperature is always interpolated in a horizonzal/radial plane, except for the plume " 66 "head: If the first depth of the plume centerline and the minimum depth of the plume " 67 "feature are different, an ellipsoidal plume head is created in this depth range. " 68 "Within this plume head, temperature is interpolated radially, i.e., depending on the " 69 "distance from the center of the ellipsoid.");
72 "The list of depths where both the temperature in the center of the plume " 73 "and the width of the temperature anomaly in terms of the sigma of a Gaussian " 74 "function can be provided. Temperature is interpolated linearly in vertical " 75 "direction between these depths. Units: m.");
77 "The temperature at the center of this feature in degree Kelvin." 78 "If the value is below zero, then an adiabatic temperature is used.");
80 "The sigma (standard deviation) of the Gaussian function used to compute the " 81 "temperature distribution within the plume. This sigma is non-dimensional, i.e. " 82 "it is defined relative to the distance between the plume center and margin as " 83 "defined by the plume feature. Choosing a sigma of 1 therefore means that the " 84 "temperature at the plume margin is set to a fraction of 1/sqrt(e) (approx. 0.61) " 85 "of the centerline temperature. To achieve a smoother transition between the " 86 "plume temperature and the outside temperature a smaller values has to be chosen " 87 "for the gaussian sigmas.");
100 "The depths, center_temperatures and gaussian_sigmas arrays need to have the same number of entries. " 101 "At the moment there are: " 102 <<
depths.size() <<
" depth entries, " 103 << center_temperatures.size() <<
" centerline temperature entries, and " 104 << gaussian_sigmas.size() <<
" gaussian sigma entries!");
112 const double gravity_norm,
114 const double feature_min_depth,
115 const double feature_max_depth,
116 const double relative_distance_from_center)
const 118 if (depth <= feature_max_depth && depth >= feature_min_depth && relative_distance_from_center <= 1.)
121 auto upper = std::upper_bound(
depths.begin(),
depths.end(), depth);
123 double center_temperature_local;
124 double gaussian_sigma;
126 if (upper -
depths.begin() == 0)
131 else if (upper -
depths.end() == 0)
138 const unsigned int index =
static_cast<unsigned int>(std::distance(
depths.begin(), upper));
139 const double fraction = (depth -
depths[index-1]) / (
depths[index] -
depths[index-1]);
145 if (center_temperature_local < 0)
149 this->world->specific_heat) * depth);
152 const double new_temperature = center_temperature_local * std::exp(-relative_distance_from_center/(2.*std::pow(gaussian_sigma, 2)));
std::vector< double > center_temperatures
~Gaussian() override final
std::vector< double > depths
double potential_mantle_temperature
Operations string_operations_to_enum(const std::string &operation)
static void declare_entries(Parameters &prm, const std::string &parent_name="")
#define WBAssert(condition, message)
std::vector< double > gaussian_sigmas
#define WB_REGISTER_FEATURE_PLUME_TEMPERATURE_MODEL(classname, name)
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 double relative_distance_from_center) const override final
WorldBuilder::World * world
void parse_entries(Parameters &prm) override final
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)
std::vector< T > get_vector(const std::string &name)
T get(const std::string &name)