diff --git a/ProcessLib/ThermalTwoPhaseFlowWithPP/CreateThermalTwoPhaseFlowWithPPProcess.cpp b/ProcessLib/ThermalTwoPhaseFlowWithPP/CreateThermalTwoPhaseFlowWithPPProcess.cpp index 8c02fb295564532819950f9a18801a463daa2ef4..a3da28785f7b18dc609579213c881ff841efcbcc 100644 --- a/ProcessLib/ThermalTwoPhaseFlowWithPP/CreateThermalTwoPhaseFlowWithPPProcess.cpp +++ b/ProcessLib/ThermalTwoPhaseFlowWithPP/CreateThermalTwoPhaseFlowWithPPProcess.cpp @@ -31,7 +31,8 @@ void checkMPLProperties( MaterialPropertyLib::MaterialSpatialDistributionMap const& media_map) { std::array const required_property_medium = { - MaterialPropertyLib::PropertyType::porosity}; + MaterialPropertyLib::PropertyType::porosity, + MaterialPropertyLib::PropertyType::permeability}; std::array const required_property_solid_phase = { MaterialPropertyLib::PropertyType::density}; diff --git a/ProcessLib/ThermalTwoPhaseFlowWithPP/ThermalTwoPhaseFlowWithPPLocalAssembler-impl.h b/ProcessLib/ThermalTwoPhaseFlowWithPP/ThermalTwoPhaseFlowWithPPLocalAssembler-impl.h index a63aee04bc402e26fe641e7ed61dc042c76ba1e5..59fbac6529ad7353fa64526d37e3b8a6d19473e6 100644 --- a/ProcessLib/ThermalTwoPhaseFlowWithPP/ThermalTwoPhaseFlowWithPPLocalAssembler-impl.h +++ b/ProcessLib/ThermalTwoPhaseFlowWithPP/ThermalTwoPhaseFlowWithPPLocalAssembler-impl.h @@ -45,6 +45,7 @@ #include "MaterialLib/MPL/Medium.h" #include "MaterialLib/MPL/Property.h" +#include "MaterialLib/MPL/Utils/FormEigenTensor.h" #include "MathLib/InterpolationAlgorithms/PiecewiseLinearInterpolation.h" #include "NumLib/Function/Interpolation.h" #include "ThermalTwoPhaseFlowWithPPLocalAssembler.h" @@ -150,20 +151,6 @@ void ThermalTwoPhaseFlowWithPPLocalAssembler< auto const pc_nodal_values = Eigen::Map<const NodalVectorType>(&local_x[num_nodes], num_nodes); - const Eigen::MatrixXd& perm = two_phase_material_model.getPermeability( - material_id, t, pos, _element.getDimension()); - assert(perm.rows() == _element.getDimension() || perm.rows() == 1); - GlobalDimMatrixType permeability = GlobalDimMatrixType::Zero( - _element.getDimension(), _element.getDimension()); - if (perm.rows() == _element.getDimension()) - { - permeability = perm; - } - else if (perm.rows() == 1) - { - permeability.diagonal().setConstant(perm(0, 0)); - } - MaterialPropertyLib::VariableArray vars; for (unsigned ip = 0; ip < n_integration_points; ip++) { @@ -358,6 +345,11 @@ void ThermalTwoPhaseFlowWithPPLocalAssembler< two_phase_material_model.getLiquidViscosity(pg_int_pt, T_int_pt); double const lambda_wet = k_rel_wet / mu_wet; + auto const permeability = + MaterialPropertyLib::formEigenTensor<GlobalDim>( + medium.property(MaterialPropertyLib::PropertyType::permeability) + .value(vars, pos, t, dt)); + GlobalDimVectorType const velocity_nonwet = -lambda_nonwet * permeability * (_ip_data[ip].dNdx * pg_nodal_values); diff --git a/Tests/Data/Parabolic/ThermalTwoPhaseFlowPP/HeatPipe/Twophase_HeatPipe_quad_curve_small.prj b/Tests/Data/Parabolic/ThermalTwoPhaseFlowPP/HeatPipe/Twophase_HeatPipe_quad_curve_small.prj index 926c894ead33f020ac6f40efd18b04c7d5c0e330..c0d221c0df09fa860be2525ecd040891176296c7 100644 --- a/Tests/Data/Parabolic/ThermalTwoPhaseFlowPP/HeatPipe/Twophase_HeatPipe_quad_curve_small.prj +++ b/Tests/Data/Parabolic/ThermalTwoPhaseFlowPP/HeatPipe/Twophase_HeatPipe_quad_curve_small.prj @@ -143,6 +143,11 @@ <type>Constant</type> <value>0.4</value> </property> + <property> + <name>permeability</name> + <type>Constant</type> + <value>1e-12</value> + </property> </properties> </medium> </media>