Skip to content

Commit

Permalink
adjust function Utilities::calculate_effective_trench_and_plate_ages
Browse files Browse the repository at this point in the history
  • Loading branch information
lhy11009 committed Mar 9, 2024
1 parent 2361838 commit a3624b5
Show file tree
Hide file tree
Showing 14 changed files with 297 additions and 46 deletions.
16 changes: 8 additions & 8 deletions doc/world_builder_declarations.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -7744,7 +7744,7 @@
"description": "The velocity with which the ridge is moving through time, and how long the ridge has been moving. First value is the velocity, second is the time. Default is [0 cm/yr, 0 yr]",
"oneOf": [
{
"default value": -1.0,
"default value": 0.05,
"type": "number",
"description": ""
},
Expand All @@ -7761,7 +7761,7 @@
"uniqueItems": false,
"description": "",
"items": {
"default value": -1.0,
"default value": 0.05,
"type": "number",
"description": ""
}
Expand Down Expand Up @@ -8599,7 +8599,7 @@
"description": "The velocity with which the ridge is moving through time, and how long the ridge has been moving. First value is the velocity, second is the time. Default is [0 cm/yr, 0 yr]",
"oneOf": [
{
"default value": -1.0,
"default value": 0.05,
"type": "number",
"description": ""
},
Expand All @@ -8616,7 +8616,7 @@
"uniqueItems": false,
"description": "",
"items": {
"default value": -1.0,
"default value": 0.05,
"type": "number",
"description": ""
}
Expand Down Expand Up @@ -9524,7 +9524,7 @@
"description": "The velocity with which the ridge is moving through time, and how long the ridge has been moving. First value is the velocity, second is the time. Default is [0 cm/yr, 0 yr]",
"oneOf": [
{
"default value": -1.0,
"default value": 0.05,
"type": "number",
"description": ""
},
Expand All @@ -9541,7 +9541,7 @@
"uniqueItems": false,
"description": "",
"items": {
"default value": -1.0,
"default value": 0.05,
"type": "number",
"description": ""
}
Expand Down Expand Up @@ -10379,7 +10379,7 @@
"description": "The velocity with which the ridge is moving through time, and how long the ridge has been moving. First value is the velocity, second is the time. Default is [0 cm/yr, 0 yr]",
"oneOf": [
{
"default value": -1.0,
"default value": 0.05,
"type": "number",
"description": ""
},
Expand All @@ -10396,7 +10396,7 @@
"uniqueItems": false,
"description": "",
"items": {
"default value": -1.0,
"default value": 0.05,
"type": "number",
"description": ""
}
Expand Down
16 changes: 8 additions & 8 deletions doc/world_builder_declarations_closed.md
Original file line number Diff line number Diff line change
Expand Up @@ -11332,7 +11332,7 @@
::::::::::::{dropdown} /features/items/oneOf/6/segments/items/temperature models/items/oneOf/3/subducting velocity/oneOf/1
:name: closed_features_items_oneOf_6_segments_items_temperature-models_items_oneOf_3_subducting-velocity_oneOf_1

- **default value**:-1.0
- **default value**:0.05
- **type**:number
- **description**:
::::::::::::
Expand All @@ -11356,7 +11356,7 @@
::::::::::{dropdown} /features/items/oneOf/6/segments/items/temperature models/items/oneOf/3/subducting velocity/oneOf/2/items/items
:name: closed_features_items_oneOf_6_segments_items_temperature-models_items_oneOf_3_subducting-velocity_oneOf_2_items_items

- **default value**:-1.0
- **default value**:0.05
- **type**:number
- **description**:
::::::::::
Expand Down Expand Up @@ -12532,7 +12532,7 @@
::::::::::::::{dropdown} /features/items/oneOf/6/temperature models/items/oneOf/3/subducting velocity/oneOf/1
:name: closed_features_items_oneOf_6_temperature-models_items_oneOf_3_subducting-velocity_oneOf_1

- **default value**:-1.0
- **default value**:0.05
- **type**:number
- **description**:
::::::::::::::
Expand All @@ -12556,7 +12556,7 @@
::::::::::::{dropdown} /features/items/oneOf/6/temperature models/items/oneOf/3/subducting velocity/oneOf/2/items/items
:name: closed_features_items_oneOf_6_temperature-models_items_oneOf_3_subducting-velocity_oneOf_2_items_items

- **default value**:-1.0
- **default value**:0.05
- **type**:number
- **description**:
::::::::::::
Expand Down Expand Up @@ -13836,7 +13836,7 @@
::::::::::{dropdown} /features/items/oneOf/6/sections/items/segments/items/temperature models/items/oneOf/3/subducting velocity/oneOf/1
:name: closed_features_items_oneOf_6_sections_items_segments_items_temperature-models_items_oneOf_3_subducting-velocity_oneOf_1

- **default value**:-1.0
- **default value**:0.05
- **type**:number
- **description**:
::::::::::
Expand All @@ -13860,7 +13860,7 @@
::::::::{dropdown} /features/items/oneOf/6/sections/items/segments/items/temperature models/items/oneOf/3/subducting velocity/oneOf/2/items/items
:name: closed_features_items_oneOf_6_sections_items_segments_items_temperature-models_items_oneOf_3_subducting-velocity_oneOf_2_items_items

- **default value**:-1.0
- **default value**:0.05
- **type**:number
- **description**:
::::::::
Expand Down Expand Up @@ -15036,7 +15036,7 @@
::::::::::::{dropdown} /features/items/oneOf/6/sections/items/temperature models/items/oneOf/3/subducting velocity/oneOf/1
:name: closed_features_items_oneOf_6_sections_items_temperature-models_items_oneOf_3_subducting-velocity_oneOf_1

- **default value**:-1.0
- **default value**:0.05
- **type**:number
- **description**:
::::::::::::
Expand All @@ -15060,7 +15060,7 @@
::::::::::{dropdown} /features/items/oneOf/6/sections/items/temperature models/items/oneOf/3/subducting velocity/oneOf/2/items/items
:name: closed_features_items_oneOf_6_sections_items_temperature-models_items_oneOf_3_subducting-velocity_oneOf_2_items_items

- **default value**:-1.0
- **default value**:0.05
- **type**:number
- **description**:
::::::::::
Expand Down
16 changes: 8 additions & 8 deletions doc/world_builder_declarations_open.md
Original file line number Diff line number Diff line change
Expand Up @@ -12774,7 +12774,7 @@
:open:
:name: open_features_items_oneOf_6_segments_items_temperature-models_items_oneOf_3_subducting-velocity_oneOf_1

- **default value**:-1.0
- **default value**:0.05
- **type**:number
- **description**:
::::::::::::
Expand All @@ -12801,7 +12801,7 @@
:open:
:name: open_features_items_oneOf_6_segments_items_temperature-models_items_oneOf_3_subducting-velocity_oneOf_2_items_items

- **default value**:-1.0
- **default value**:0.05
- **type**:number
- **description**:
::::::::::
Expand Down Expand Up @@ -14115,7 +14115,7 @@
:open:
:name: open_features_items_oneOf_6_temperature-models_items_oneOf_3_subducting-velocity_oneOf_1

- **default value**:-1.0
- **default value**:0.05
- **type**:number
- **description**:
::::::::::::::
Expand All @@ -14142,7 +14142,7 @@
:open:
:name: open_features_items_oneOf_6_temperature-models_items_oneOf_3_subducting-velocity_oneOf_2_items_items

- **default value**:-1.0
- **default value**:0.05
- **type**:number
- **description**:
::::::::::::
Expand Down Expand Up @@ -15575,7 +15575,7 @@
:open:
:name: open_features_items_oneOf_6_sections_items_segments_items_temperature-models_items_oneOf_3_subducting-velocity_oneOf_1

- **default value**:-1.0
- **default value**:0.05
- **type**:number
- **description**:
::::::::::
Expand All @@ -15602,7 +15602,7 @@
:open:
:name: open_features_items_oneOf_6_sections_items_segments_items_temperature-models_items_oneOf_3_subducting-velocity_oneOf_2_items_items

- **default value**:-1.0
- **default value**:0.05
- **type**:number
- **description**:
::::::::
Expand Down Expand Up @@ -16916,7 +16916,7 @@
:open:
:name: open_features_items_oneOf_6_sections_items_temperature-models_items_oneOf_3_subducting-velocity_oneOf_1

- **default value**:-1.0
- **default value**:0.05
- **type**:number
- **description**:
::::::::::::
Expand All @@ -16943,7 +16943,7 @@
:open:
:name: open_features_items_oneOf_6_sections_items_temperature-models_items_oneOf_3_subducting-velocity_oneOf_2_items_items

- **default value**:-1.0
- **default value**:0.05
- **type**:number
- **description**:
::::::::::
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ namespace WorldBuilder
prm.declare_entry("plate velocity", Types::OneOf(Types::Double(0.05),Types::Array(Types::ValueAtPoints(0.05, std::numeric_limits<uint64_t>::max()))),
"The velocity with which the plate subducts in meters per year. Default is 5 cm/yr");

prm.declare_entry("subducting velocity", Types::OneOf(Types::Double(-1), Types::Array(Types::Array(Types::Double(-1), 1), 1)),
prm.declare_entry("subducting velocity", Types::OneOf(Types::Double(0.05), Types::Array(Types::Array(Types::Double(0.05), 1), 1)),
"The velocity with which the ridge is moving through time, and how long the ridge "
"has been moving. First value is the velocity, second is the time. Default is [0 cm/yr, 0 yr]");

Expand Down Expand Up @@ -289,6 +289,8 @@ namespace WorldBuilder
const AdditionalParameters &additional_parameters) const
{

const double seconds_in_year = 60.0 * 60.0 * 24.0 * 365.25; // sec/y

const double distance_from_plane = distance_from_planes.distance_from_plane;

if (distance_from_plane <= max_depth && distance_from_plane >= min_depth)
Expand Down Expand Up @@ -317,7 +319,6 @@ namespace WorldBuilder

std::vector<double> slab_ages = calculate_effective_trench_and_plate_ages(ridge_parameters, distance_along_plane);

const double seconds_in_year = 60.0 * 60.0 * 24.0 * 365.25; // sec/y
const double spreading_velocity = ridge_parameters[0] * seconds_in_year; // m/yr
double subducting_velocity = ridge_parameters[2] * seconds_in_year; // m/yr

Expand Down Expand Up @@ -358,7 +359,7 @@ namespace WorldBuilder
}

// Plate age increases with distance along the slab in the mantle
double effective_plate_age = slab_ages[1];
double effective_plate_age_sec = slab_ages[1] * seconds_in_year;

// Need adiabatic temperature at position of grid point
const double background_temperature = adiabatic_heating ? potential_mantle_temperature *
Expand Down Expand Up @@ -452,7 +453,7 @@ namespace WorldBuilder

// Also taper the initial heat content and effective plate age
initial_heat_content = initial_heat_content * std::erfc(1.5*taper_con*theta);
effective_plate_age = effective_plate_age * std::erfc(1.5*taper_con*theta);
effective_plate_age_sec = effective_plate_age_sec * std::erfc(1.5*taper_con*theta);
}

else
Expand Down Expand Up @@ -495,14 +496,14 @@ namespace WorldBuilder
exp((subducting_velocity_UI * max_depth / 2.0 / thermal_diffusivity -
std::sqrt(subducting_velocity_UI * subducting_velocity_UI * max_depth * max_depth / 4.0 / thermal_diffusivity / thermal_diffusivity +
double(2*i + 1) * double(2*i + 1) * Consts::PI * Consts::PI)) *
subducting_velocity_UI * effective_plate_age / max_depth);
subducting_velocity_UI * effective_plate_age_sec / max_depth);
bottom_heat_content -= temp_heat_content;
}
}
else
{
bottom_heat_content = 2 * thermal_conductivity * (min_temperature - potential_mantle_temperature) *
std::sqrt(effective_plate_age /(thermal_diffusivity * Consts::PI));
std::sqrt(effective_plate_age_sec /(thermal_diffusivity * Consts::PI));
}

// 4. The difference in heat content goes into the temperature above where Tmin occurs.
Expand Down Expand Up @@ -533,7 +534,7 @@ namespace WorldBuilder
for (int i = 0; i < 2 * spline_n_points + 1; ++i)
{
const double i_adjusted_distance = (i * interval_spline_distance - 1.0) * max_depth;
const double i_temperature = get_temperature_analytic(top_heat_content, min_temperature, background_temperature, temperature_, spreading_velocity, effective_plate_age, i_adjusted_distance);
const double i_temperature = get_temperature_analytic(top_heat_content, min_temperature, background_temperature, temperature_, spreading_velocity, effective_plate_age_sec, i_adjusted_distance);
i_temperatures[i] = i_temperature;
}

Expand All @@ -545,7 +546,7 @@ namespace WorldBuilder
else
{
// Call the analytic solution to compute the temperature
temperature = get_temperature_analytic(top_heat_content, min_temperature, background_temperature, temperature_, spreading_velocity, effective_plate_age, adjusted_distance);
temperature = get_temperature_analytic(top_heat_content, min_temperature, background_temperature, temperature_, spreading_velocity, effective_plate_age_sec, adjusted_distance);
}
}
else
Expand All @@ -569,7 +570,7 @@ namespace WorldBuilder
const double background_temperature,
const double temperature_,
const double subducting_velocity,
const double effective_plate_age,
const double effective_plate_age_sec,
const double adjusted_distance) const
{
const double seconds_in_year = 60.0 * 60.0 * 24.0 * 365.25; // sec/y
Expand Down Expand Up @@ -613,7 +614,7 @@ namespace WorldBuilder
std::exp((((subducting_velocity_UI * max_depth)/(2 * thermal_diffusivity)) -
std::sqrt(((subducting_velocity_UI*subducting_velocity_UI*max_depth*max_depth) /
(4*thermal_diffusivity*thermal_diffusivity)) + double(i) * double(i) * Consts::PI * Consts::PI)) *
((subducting_velocity_UI * effective_plate_age) / max_depth)));
((subducting_velocity_UI * effective_plate_age_sec) / max_depth)));
}
}
else
Expand All @@ -624,7 +625,7 @@ namespace WorldBuilder
else
{
temperature = background_temperature + (min_temperature - background_temperature) *
std::erfc(adjusted_distance / (2 * std::sqrt(thermal_diffusivity * effective_plate_age)));
std::erfc(adjusted_distance / (2 * std::sqrt(thermal_diffusivity * effective_plate_age_sec)));

}
}
Expand Down
Loading

0 comments on commit a3624b5

Please sign in to comment.