Skip to content

Commit

Permalink
follow
Browse files Browse the repository at this point in the history
  • Loading branch information
lhy11009 committed Nov 2, 2024
1 parent 613c695 commit 4704f45
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 7 deletions.
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# This is a data output from HeFESTo
# Independent variables are T(K) and P(bar)
# POINTS: 2 2
T(K) P(bar) s,J/K/kg rho,kg/m3 alpha,1/K cp,J/K/kg vp,km/s vs,km/s h,J/kg
250.0 0.0 509.74740059944844 3332.8967443100287 1.9781287327429287e-05 748.5636509347647 8.116376883289359 4.7495273882440685 -13445454.390915
4000.0 0.0 3804.799798825367 2879.31713365359 0.00012376961201237974 1865.6003296108431 5.89690417370827 3.068046128481904 -8401781.805825338
250.0 1500000.0 198.7646619931198 5836.877132241759 3.4121952803538903e-06 376.4469624433934 14.555814776451808 7.855984247196738 16942560.667925145
4000.0 1500000.0 3001.438264292299 5612.196624661615 1.174389488674247e-05 1244.420157015243 14.133650137979814 7.318949741082264 21273542.53213353
T(K) P(bar) s,J/K/kg rho,kg/m3 alpha,1/K cp,J/K/kg vp,km/s vs,km/s h,J/kg maph,1
250.0 0.0 509.74740059944844 3332.8967443100287 1.9781287327429287e-05 748.5636509347647 8.116376883289359 4.7495273882440685 -13445454.390915 0.0
4000.0 0.0 3804.799798825367 2879.31713365359 0.00012376961201237974 1865.6003296108431 5.89690417370827 3.068046128481904 -8401781.805825338 0.0
250.0 1500000.0 198.7646619931198 5836.877132241759 3.4121952803538903e-06 376.4469624433934 14.555814776451808 7.855984247196738 16942560.667925145 1.0
4000.0 1500000.0 3001.438264292299 5612.196624661615 1.174389488674247e-05 1244.420157015243 14.133650137979814 7.318949741082264 21273542.53213353 1.0
17 changes: 15 additions & 2 deletions source/material_model/utilities.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1170,7 +1170,7 @@ namespace aspect
for (unsigned i = 0; i < material_file_names.size(); ++i)
{
material_lookup
.push_back(std::make_unique<Utilities::StructuredDataLookup<2>>(7,1.0));
.push_back(std::make_unique<Utilities::StructuredDataLookup<2>>(8,1.0));

material_lookup[i]->load_file(data_directory+material_file_names[i],
this->get_mpi_communicator());
Expand All @@ -1187,7 +1187,20 @@ namespace aspect
// the percentage of material that has undergone the transition
double function_value;

function_value = 0.0;
// lookup the most abundant phase

// Convert pressure from Pa to bar, bar is used in the table.
Point<2> temperature_pressure(in.temperature, in.pressure / 1.e5);

const unsigned maph = unsigned(material_lookup[0]->get_data(temperature_pressure, 7));

// Convert pressure from Pa to bar, bar is used in the table.

// determine the value
if (in.phase_index < maph)
function_value = 1.0;
else
function_value = 0.0;

return function_value;
}
Expand Down

0 comments on commit 4704f45

Please sign in to comment.