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

[HT] Check if porous media, liquid, and solid phase exists.

parent de519445
No related branches found
No related tags found
No related merge requests found
......@@ -110,7 +110,6 @@ public:
fe.computeShapeFunctions(pnt_local_coords.getCoords(), shape_matrices,
GlobalDim, false);
// fetch permeability, viscosity, density
ParameterLib::SpatialPosition pos;
pos.setElementID(this->_element.getID());
......@@ -131,6 +130,7 @@ public:
*_process_data.media_map->getMedium(_element.getID());
auto const& liquid_phase = medium.phase("AqueousLiquid");
// fetch permeability, viscosity, density
auto const K = MaterialPropertyLib::formEigenTensor<GlobalDim>(
medium.property(MaterialPropertyLib::PropertyType::permeability)
.value(vars, pos, t));
......
......@@ -53,6 +53,20 @@ 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);
}
// For the staggered scheme, both processes are assumed to use the same
// element order. Therefore the order of shape function can be fetched from
// any set of the sets of process variables of the coupled processes. Here,
......
......@@ -13,6 +13,8 @@
#include <array>
#include "HTProcessData.h"
#include "MaterialLib/MPL/Medium.h"
#include "MaterialLib/MPL/Utils/FormEigenTensor.h"
#include "ProcessLib/Process.h"
namespace NumLib
......@@ -86,6 +88,66 @@ 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,
MeshLib::Mesh const& mesh,
......
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