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

[PL/HT] Use Medium::hasProperty and Phase::hasProperty to check the existence of properties.

fixup! [PL/HT] Use Medium::isProperty and Phase::isProperty to check the existence of properties.
parent dd8d6b9f
No related branches found
No related tags found
No related merge requests found
......@@ -53,19 +53,7 @@ void HTProcess::initializeConcreteProcess(
MeshLib::Mesh const& mesh,
unsigned const integration_order)
{
unsigned const global_dim = mesh.getDimension();
if (global_dim == 1)
{
checkProperties<1>(mesh);
}
if (global_dim == 2)
{
checkProperties<2>(mesh);
}
if (global_dim == 3)
{
checkProperties<3>(mesh);
}
checkMPLProperties(mesh, _process_data);
// For the staggered scheme, both processes are assumed to use the same
// element order. Therefore the order of shape function can be fetched from
......@@ -299,5 +287,73 @@ void HTProcess::postTimestepConcreteProcess(std::vector<GlobalVector*> const& x,
_surfaceflux->save(t);
}
void checkMPLProperties(MeshLib::Mesh const& mesh,
HTProcessData const& process_data)
{
DBUG("Check the media properties of HT process ...");
for (auto const& element : mesh.getElements())
{
auto const element_id = element->getID();
// check if a definition of the porous media exists
auto const& medium = *process_data.media_map->getMedium(element_id);
// checking general medium properties
if (!medium.hasProperty(MaterialPropertyLib::PropertyType::porosity))
{
OGS_FATAL("The porosity for the porous media isn't specified.");
}
if (!medium.hasProperty(
MaterialPropertyLib::PropertyType::permeability))
{
OGS_FATAL("The permeability for the porous media isn't specified.");
}
// check if liquid phase definition and the corresponding properties
// exists
auto const& liquid_phase = medium.phase("AqueousLiquid");
if (!liquid_phase.hasProperty(
MaterialPropertyLib::PropertyType::viscosity))
{
OGS_FATAL(
"The viscosity for the AqueousLiquid phase isn't specified.");
}
if (!liquid_phase.hasProperty(
MaterialPropertyLib::PropertyType::density))
{
OGS_FATAL(
"The density for the AqueousLiquid phase isn't specified.");
}
if (!liquid_phase.hasProperty(
MaterialPropertyLib::PropertyType::specific_heat_capacity))
{
OGS_FATAL(
"The specific heat capacity for the AqueousLiquid phase "
"isn't specified.");
}
// check if solid phase definition and the corresponding properties
// exists
auto const& solid_phase = medium.phase("Solid");
if (!solid_phase.hasProperty(
MaterialPropertyLib::PropertyType::specific_heat_capacity))
{
OGS_FATAL(
"The specific heat capacity for the Solid phase isn't "
"specified.");
}
if (!solid_phase.hasProperty(
MaterialPropertyLib::PropertyType::density))
{
OGS_FATAL("The density for the Solid phase isn't specified.");
}
if (!solid_phase.hasProperty(
MaterialPropertyLib::PropertyType::storage))
{
OGS_FATAL("The storage for the Solid phase isn't specified.");
}
}
DBUG("Media properties verified.");
}
} // namespace HT
} // namespace ProcessLib
......@@ -88,65 +88,6 @@ public:
int const process_id) override;
private:
template <unsigned GlobalDim>
void checkProperties(MeshLib::Mesh const& mesh) const
{
// only needed as dummy for checking of existence of properties
MaterialPropertyLib::VariableArray vars;
double const t = 0.0;
DBUG("Check the media properties ...");
for (auto const& element : mesh.getElements())
{
auto const element_id = element->getID();
ParameterLib::SpatialPosition pos;
pos.setElementID(element_id);
// check if a definition of the porous media exists
auto const& medium =
*_process_data.media_map->getMedium(element_id);
// checking general medium properties
auto const porosity =
medium.property(MaterialPropertyLib::PropertyType::porosity)
.template value<double>(vars, pos, t);
auto const K = MaterialPropertyLib::formEigenTensor<GlobalDim>(
medium.property(MaterialPropertyLib::PropertyType::permeability)
.value(vars, pos, t));
// check if liquid phase definition and the corresponding properties
// exists
auto const& liquid_phase = medium.phase("AqueousLiquid");
auto const mu =
liquid_phase
.property(MaterialPropertyLib::PropertyType::viscosity)
.template value<double>(vars, pos, t);
auto const liquid_density =
liquid_phase
.property(MaterialPropertyLib::PropertyType::density)
.template value<double>(vars, pos, t);
auto const specific_heat_capacity_fluid =
liquid_phase
.property(MaterialPropertyLib::specific_heat_capacity)
.template value<double>(vars, pos, t);
// check if solid phase definition and the corresponding properties
// exists
auto const& solid_phase = medium.phase("Solid");
auto const specific_heat_capacity_solid =
solid_phase
.property(MaterialPropertyLib::PropertyType::
specific_heat_capacity)
.template value<double>(vars, pos, t);
auto const solid_density =
solid_phase.property(MaterialPropertyLib::PropertyType::density)
.template value<double>(vars, pos, t);
auto const specific_storage =
solid_phase.property(MaterialPropertyLib::PropertyType::storage)
.template value<double>(vars, pos, t);
}
DBUG("Media properties verified.");
}
void initializeConcreteProcess(
NumLib::LocalToGlobalIndexMap const& dof_table,
......@@ -194,5 +135,8 @@ private:
const int _hydraulic_process_id;
};
void checkMPLProperties(MeshLib::Mesh const& mesh,
HTProcessData const& process_data);
} // namespace HT
} // namespace ProcessLib
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