Skip to content
Snippets Groups Projects
Commit 04a22b68 authored by Tom Fischer's avatar Tom Fischer
Browse files

[PL/HeatConduction] Use MPL for heat capacity.

parent b7ce1bc3
No related branches found
No related tags found
No related merge requests found
......@@ -28,7 +28,8 @@ void checkMPLProperties(
MaterialPropertyLib::MaterialSpatialDistributionMap const& media_map)
{
std::array const required_medium_properties = {
MaterialPropertyLib::PropertyType::thermal_conductivity};
MaterialPropertyLib::PropertyType::thermal_conductivity,
MaterialPropertyLib::PropertyType::heat_capacity};
std::array<MaterialPropertyLib::PropertyType, 0> const empty{};
MaterialPropertyLib::checkMaterialSpatialDistributionMap(
......@@ -70,14 +71,6 @@ std::unique_ptr<Process> createHeatConductionProcess(
checkMPLProperties(mesh, *media_map);
DBUG("Media properties verified.");
// heat capacity parameter.
auto& heat_capacity = ParameterLib::findParameter<double>(
config,
//! \ogs_file_param_special{prj__processes__process__HEAT_CONDUCTION__heat_capacity}
"heat_capacity", parameters, 1, &mesh);
DBUG("Use '{:s}' as heat capacity parameter.", heat_capacity.name);
// density parameter.
auto& density = ParameterLib::findParameter<double>(
config,
......@@ -90,8 +83,8 @@ std::unique_ptr<Process> createHeatConductionProcess(
//! \ogs_file_param{prj__processes__process__HEAT_CONDUCTION__mass_lumping}
config.getConfigParameter<bool>("mass_lumping", false);
HeatConductionProcessData process_data{std::move(media_map), heat_capacity,
density, mass_lumping};
HeatConductionProcessData process_data{std::move(media_map), density,
mass_lumping};
SecondaryVariableCollection secondary_variables;
......
......@@ -135,7 +135,11 @@ public:
.property(
MaterialPropertyLib::PropertyType::thermal_conductivity)
.value(vars, pos, t, dt));
auto const heat_capacity = _process_data.heat_capacity(t, pos)[0];
auto const heat_capacity =
medium
.property(
MaterialPropertyLib::PropertyType::heat_capacity)
.template value<double>(vars, pos, t, dt);
auto const density = _process_data.density(t, pos)[0];
local_K.noalias() += sm.dNdx.transpose() * k * sm.dNdx * sm.detJ *
......@@ -208,7 +212,11 @@ public:
.property(
MaterialPropertyLib::PropertyType::thermal_conductivity)
.value(vars, pos, t, dt));
auto const heat_capacity = _process_data.heat_capacity(t, pos)[0];
auto const heat_capacity =
medium
.property(
MaterialPropertyLib::PropertyType::heat_capacity)
.template value<double>(vars, pos, t, dt);
auto const density = _process_data.density(t, pos)[0];
laplace.noalias() += sm.dNdx.transpose() * k * sm.dNdx * w;
......
......@@ -26,7 +26,6 @@ struct HeatConductionProcessData
std::unique_ptr<MaterialPropertyLib::MaterialSpatialDistributionMap>
media_map;
ParameterLib::Parameter<double> const& heat_capacity;
ParameterLib::Parameter<double> const& density;
/// If set mass lumping will be applied to the equation.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment