Skip to content

Commit

Permalink
Merge pull request #767 from danieldouglas92/convert_bound_fluid_to_p…
Browse files Browse the repository at this point in the history
…ercentage

Convert water content from percent to a fraction in tian2019 composition model
  • Loading branch information
MFraters authored Nov 14, 2024
2 parents e6eb1fc + 8f4b946 commit 203a7d5
Show file tree
Hide file tree
Showing 6 changed files with 36 additions and 34 deletions.
6 changes: 3 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm
- There is now a properties_output_size function, which returns the size of the output vector/array returned by the properties functions for a given properties input vector \[Menno Fraters; 2024-10-27; [#765](https://github.com/GeodynamicWorldBuilder/WorldBuilder/pull/765)\]
- Added 2d and 3d versions of the properties function to the C wrapper \[Menno Fraters; 2024-10-27; [#765](https://github.com/GeodynamicWorldBuilder/WorldBuilder/pull/765)\]

## Changed

## Fixed
### Changed
- The tian2019 composition model now returns a mass fraction instead of a mass percentage. \[Daniel Douglas; 2024-11-12; [#767](https://github.com/GeodynamicWorldBuilder/WorldBuilder/pull/767)\]
### Fixed

## [1.0.0]
### Added
Expand Down
2 changes: 1 addition & 1 deletion doc/JOSS/1.0/paper.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ affiliations:
index: 2
- name: GEOMAR Helmholtz-Zentrum für Ozeanforschung, Kiel, Germany
index: 3
- name: Universiy of Florida, USA
- name: University of Florida, USA
index: 4
- name: Clemson University, USA
index: 5
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -178,8 +178,9 @@ namespace WorldBuilder
const double slab_temperature = world->properties(position_in_cartesian_coordinates.get_array(), depth, {{{1,0,0}}})[0];
double partition_coefficient = calculate_water_content(lithostatic_pressure,
slab_temperature);

partition_coefficient = std::min(max_water_content, partition_coefficient);
// The partition_coefficient is output as a percentage, but geodynamic modeling software
// typically deal with fractions, so we divide by 100 below
partition_coefficient = std::min(max_water_content, partition_coefficient) / 100;

for (unsigned int i = 0; i < compositions.size(); ++i)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -171,8 +171,9 @@ namespace WorldBuilder
const double slab_temperature = world->properties(position_in_cartesian_coordinates.get_array(), depth, {{{1,0,0}}})[0];
double partition_coefficient = calculate_water_content(lithostatic_pressure,
slab_temperature);

partition_coefficient = std::min(max_water_content, partition_coefficient);
// The partition_coefficient is output as a percentage, but geodynamic modeling software
// typically deal with fractions, so we divide by 100 below
partition_coefficient = std::min(max_water_content, partition_coefficient) / 100;

for (unsigned int i = 0; i < compositions.size(); ++i)
{
Expand Down
4 changes: 2 additions & 2 deletions tests/gwb-dat/water_content_subducting_plate.dat
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# file.
# Now define parameters:
# dim = 2
# compositions = 1
# compositions = 2
# x y d T C0
50e3 0e3 1e3
50e3 0e3 4e3
Expand All @@ -26,4 +26,4 @@
210e3 0e3 92.5e3
210e3 0e3 95e3
210e3 0e3 97.5e3
210e3 0e3 100e3
210e3 0e3 100e3
48 changes: 24 additions & 24 deletions tests/gwb-dat/water_content_subducting_plate/screen-output.log
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
# x z d T vx vz c0 tag
50e3 0e3 1e3 312.405 0 0 0 0
50e3 0e3 4e3 430.229 0 0 0 0
50e3 0e3 8e3 584.338 0 0 0 0
50e3 0e3 11e3 695.831 0 0 0 0
210e3 0e3 55e3 1322.25 0 2 0 1
210e3 0e3 57.5e3 1203.62 0 2 0 1
210e3 0e3 60e3 1034.33 0 2 0 1
210e3 0e3 62.5e3 849.688 0 2 0 1
210e3 0e3 65e3 697.68 0 2 0 1
210e3 0e3 67.5e3 614.688 0 2 0 1
210e3 0e3 70e3 616.639 0 2 0 1
210e3 0e3 72.5e3 652.908 0 2 0 1
210e3 0e3 75e3 687.783 0 2 0 1
210e3 0e3 77.5e3 721.222 0 2 0 1
210e3 0e3 80e3 753.193 0 2 0 1
210e3 0e3 82.5e3 783.675 0 2 0 1
210e3 0e3 85e3 812.658 0 2 0 1
210e3 0e3 87.5e3 839.142 0 2 0 1
210e3 0e3 90e3 863.691 0 2 0 1
210e3 0e3 92.5e3 886.838 0 2 0 1
210e3 0e3 95e3 908.585 0 2 0 1
210e3 0e3 97.5e3 928.938 0 2 0 1
210e3 0e3 100e3 947.908 0 2 0 1
# x z d T vx vz c0 c1 tag
50e3 0e3 1e3 312.405 0 0 0 0.03 0
50e3 0e3 4e3 430.229 0 0 0 0.01 0
50e3 0e3 8e3 584.338 0 0 0 0.005 0
50e3 0e3 11e3 695.831 0 0 0 0.02 0
210e3 0e3 55e3 1322.25 0 2 0 0 1
210e3 0e3 57.5e3 1203.62 0 2 0 0.00372427 1
210e3 0e3 60e3 1034.33 0 2 0 0.00510104 1
210e3 0e3 62.5e3 849.688 0 2 0 0.00689769 1
210e3 0e3 65e3 697.68 0 2 0 0.01 1
210e3 0e3 67.5e3 614.688 0 2 0 0.01 1
210e3 0e3 70e3 616.639 0 2 0 0.005 1
210e3 0e3 72.5e3 652.908 0 2 0 0.005 1
210e3 0e3 75e3 687.783 0 2 0 0.005 1
210e3 0e3 77.5e3 721.222 0 2 0 0.02 1
210e3 0e3 80e3 753.193 0 2 0 0.02 1
210e3 0e3 82.5e3 783.675 0 2 0 0.02 1
210e3 0e3 85e3 812.658 0 2 0 0.02 1
210e3 0e3 87.5e3 839.142 0 2 0 0.02 1
210e3 0e3 90e3 863.691 0 2 0 0.02 1
210e3 0e3 92.5e3 886.838 0 2 0 0.0191775 1
210e3 0e3 95e3 908.585 0 2 0 0.0130946 1
210e3 0e3 97.5e3 928.938 0 2 0 0.00908444 1
210e3 0e3 100e3 947.908 0 2 0 0.00640881 1

0 comments on commit 203a7d5

Please sign in to comment.