diff --git a/ProcessLib/HT/HTFEM.h b/ProcessLib/HT/HTFEM.h index a748da5cdb68db8c364e2e77fac19f5cdf1df875..4fd444ff1366d1eecbe56ab4d2594884bc84a43e 100644 --- a/ProcessLib/HT/HTFEM.h +++ b/ProcessLib/HT/HTFEM.h @@ -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)); diff --git a/ProcessLib/HT/HTProcess.cpp b/ProcessLib/HT/HTProcess.cpp index 946e94d9e21ae500d36b2fa12af823e29d455eb8..dbb53bb1aaaa2b6751acb544f6a8fcec24aa342c 100644 --- a/ProcessLib/HT/HTProcess.cpp +++ b/ProcessLib/HT/HTProcess.cpp @@ -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, diff --git a/ProcessLib/HT/HTProcess.h b/ProcessLib/HT/HTProcess.h index 89ca365d5fb56cb0c769c242ecc5892750f7b2af..44ab526a0bf6f91649599cfc7917844331f478e5 100644 --- a/ProcessLib/HT/HTProcess.h +++ b/ProcessLib/HT/HTProcess.h @@ -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,