Allow access to material temperature from openmc.lib

This commit is contained in:
Paul Romano 2020-08-06 14:19:53 -05:00
parent 2e1e669e8a
commit 77d99d499b
4 changed files with 44 additions and 15 deletions

View file

@ -181,17 +181,9 @@ assign_temperatures()
if (i_mat == MATERIAL_VOID) {
// Set void region to 0K.
c->sqrtkT_.push_back(0);
} else {
if (model::materials[i_mat]->temperature_ >= 0) {
// This material has a default temperature; use that value.
auto T = model::materials[i_mat]->temperature_;
c->sqrtkT_.push_back(std::sqrt(K_BOLTZMANN * T));
} else {
// Use the global default temperature.
c->sqrtkT_.push_back(std::sqrt(K_BOLTZMANN *
settings::temperature_default));
}
const auto& mat {model::materials[i_mat]};
c->sqrtkT_.push_back(std::sqrt(K_BOLTZMANN * mat->temperature()));
}
}
}