diff --git a/ProcessLib/TwoPhaseFlowWithPP/CreateTwoPhaseFlowWithPPMaterialProperties.cpp b/ProcessLib/TwoPhaseFlowWithPP/CreateTwoPhaseFlowWithPPMaterialProperties.cpp deleted file mode 100644 index 1c8f49f1c58626798c65faa618ef7082fe2ef56f..0000000000000000000000000000000000000000 --- a/ProcessLib/TwoPhaseFlowWithPP/CreateTwoPhaseFlowWithPPMaterialProperties.cpp +++ /dev/null @@ -1,140 +0,0 @@ -/** - * \file - * \copyright - * Copyright (c) 2012-2019, OpenGeoSys Community (http://www.opengeosys.org) - * Distributed under a Modified BSD License. - * See accompanying file LICENSE.txt or - * http://www.opengeosys.org/project/license - * - */ - -#include "CreateTwoPhaseFlowWithPPMaterialProperties.h" -#include <logog/include/logog.hpp> -#include "BaseLib/Algorithm.h" -#include "MaterialLib/Fluid/FluidProperty.h" -#include "MaterialLib/PorousMedium/Porosity/Porosity.h" -#include "MaterialLib/PorousMedium/Storage/Storage.h" -#include "MaterialLib/PorousMedium/UnsaturatedProperty/CapillaryPressure/CapillaryPressureSaturation.h" -#include "MaterialLib/PorousMedium/UnsaturatedProperty/CapillaryPressure/CreateCapillaryPressureModel.h" -#include "MaterialLib/PorousMedium/UnsaturatedProperty/RelativePermeability/CreateRelativePermeabilityModel.h" -#include "MaterialLib/PorousMedium/UnsaturatedProperty/RelativePermeability/RelativePermeability.h" -#include "MathLib/InterpolationAlgorithms/PiecewiseLinearInterpolation.h" -#include "MeshLib/Mesh.h" -#include "MeshLib/PropertyVector.h" -#include "ParameterLib/Parameter.h" -#include "ParameterLib/SpatialPosition.h" -#include "TwoPhaseFlowWithPPMaterialProperties.h" - -namespace ProcessLib -{ -namespace TwoPhaseFlowWithPP -{ -std::unique_ptr<TwoPhaseFlowWithPPMaterialProperties> -createTwoPhaseFlowWithPPMaterialProperties( - BaseLib::ConfigTree const& config, - MeshLib::PropertyVector<int> const* const material_ids, - std::vector<std::unique_ptr<ParameterLib::ParameterBase>> const& parameters) -{ - DBUG("Reading material properties of two-phase flow process."); - - //! \ogs_file_param{prj__processes__process__TWOPHASE_FLOW_PP__material_property__fluid} - auto const& fluid_config = config.getConfigSubtree("fluid"); - - // Get fluid properties - //! \ogs_file_param{prj__processes__process__TWOPHASE_FLOW_PP__material_property__liquid_density} - auto const& rho_conf = fluid_config.getConfigSubtree("liquid_density"); - auto liquid_density = MaterialLib::Fluid::createFluidDensityModel(rho_conf); - //! \ogs_file_param{prj__processes__process__TWOPHASE_FLOW_PP__material_property__gas_density} - auto const& rho_gas_conf = fluid_config.getConfigSubtree("gas_density"); - auto gas_density = - MaterialLib::Fluid::createFluidDensityModel(rho_gas_conf); - //! \ogs_file_param{prj__processes__process__TWOPHASE_FLOW_PP__material_property__liquid_viscosity} - auto const& mu_conf = fluid_config.getConfigSubtree("liquid_viscosity"); - auto liquid_viscosity = MaterialLib::Fluid::createViscosityModel(mu_conf); - //! \ogs_file_param{prj__processes__process__TWOPHASE_FLOW_PP__material_property__gas_viscosity} - auto const& mu_gas_conf = fluid_config.getConfigSubtree("gas_viscosity"); - auto gas_viscosity = MaterialLib::Fluid::createViscosityModel(mu_gas_conf); - - // Get porous properties - std::vector<int> mat_ids; - std::vector<int> mat_krel_ids; - std::vector<std::unique_ptr<MaterialLib::PorousMedium::Permeability>> - intrinsic_permeability_models; - std::vector<std::unique_ptr<MaterialLib::PorousMedium::Porosity>> - porosity_models; - std::vector<std::unique_ptr<MaterialLib::PorousMedium::Storage>> - storage_models; - std::vector< - std::unique_ptr<MaterialLib::PorousMedium::CapillaryPressureSaturation>> - capillary_pressure_models; - std::vector< - std::unique_ptr<MaterialLib::PorousMedium::RelativePermeability>> - relative_permeability_models; - - //! \ogs_file_param{prj__processes__process__TWOPHASE_FLOW_PP__material_property__porous_medium} - auto const& poro_config = config.getConfigSubtree("porous_medium"); - //! \ogs_file_param{prj__processes__process__TWOPHASE_FLOW_PP__material_property__porous_medium__porous_medium} - for (auto const& conf : poro_config.getConfigSubtreeList("porous_medium")) - { - //! \ogs_file_attr{prj__processes__process__TWOPHASE_FLOW_PP__material_property__porous_medium__porous_medium__id} - auto const id = conf.getConfigAttributeOptional<int>("id"); - mat_ids.push_back(*id); - - //! \ogs_file_param{prj__processes__process__TWOPHASE_FLOW_PP__material_property__porous_medium__porous_medium__permeability} - auto const& permeability_conf = conf.getConfigSubtree("permeability"); - intrinsic_permeability_models.emplace_back( - MaterialLib::PorousMedium::createPermeabilityModel( - permeability_conf, parameters)); - - //! \ogs_file_param{prj__processes__process__TWOPHASE_FLOW_PP__material_property__porous_medium__porous_medium__porosity} - auto const& porosity_conf = conf.getConfigSubtree("porosity"); - auto n = MaterialLib::PorousMedium::createPorosityModel(porosity_conf, - parameters); - porosity_models.emplace_back(std::move(n)); - - //! \ogs_file_param{prj__processes__process__TWOPHASE_FLOW_PP__material_property__porous_medium__porous_medium__storage} - auto const& storage_conf = conf.getConfigSubtree("storage"); - auto beta = MaterialLib::PorousMedium::createStorageModel(storage_conf); - storage_models.emplace_back(std::move(beta)); - - auto const& capillary_pressure_conf = - //! \ogs_file_param{prj__processes__process__TWOPHASE_FLOW_PP__material_property__porous_medium__porous_medium__capillary_pressure} - conf.getConfigSubtree("capillary_pressure"); - auto pc = MaterialLib::PorousMedium::createCapillaryPressureModel( - capillary_pressure_conf); - capillary_pressure_models.emplace_back(std::move(pc)); - - auto const& krel_config = - //! \ogs_file_param{prj__processes__process__TWOPHASE_FLOW_PP__material_property__porous_medium__porous_medium__relative_permeability} - conf.getConfigSubtree("relative_permeability"); - for ( - auto const& krel_conf : - //! \ogs_file_param{prj__processes__process__TWOPHASE_FLOW_PP__material_property__porous_medium__porous_medium__relative_permeability__relative_permeability} - krel_config.getConfigSubtreeList("relative_permeability")) - { - auto const krel_id = - //! \ogs_file_attr{prj__processes__process__TWOPHASE_FLOW_PP__material_property__porous_medium__porous_medium__relative_permeability__relative_permeability__id} - krel_conf.getConfigAttributeOptional<int>("id"); - mat_krel_ids.push_back(*krel_id); - auto krel_n = - MaterialLib::PorousMedium::createRelativePermeabilityModel( - krel_conf); - relative_permeability_models.emplace_back(std::move(krel_n)); - } - BaseLib::reorderVector(relative_permeability_models, mat_krel_ids); - } - - BaseLib::reorderVector(intrinsic_permeability_models, mat_ids); - BaseLib::reorderVector(porosity_models, mat_ids); - BaseLib::reorderVector(storage_models, mat_ids); - - return std::make_unique<TwoPhaseFlowWithPPMaterialProperties>( - material_ids, std::move(liquid_density), std::move(liquid_viscosity), - std::move(gas_density), std::move(gas_viscosity), - std::move(intrinsic_permeability_models), std::move(porosity_models), - std::move(storage_models), std::move(capillary_pressure_models), - std::move(relative_permeability_models)); -} - -} // namespace TwoPhaseFlowWithPP -} // namespace ProcessLib diff --git a/ProcessLib/TwoPhaseFlowWithPP/CreateTwoPhaseFlowWithPPMaterialProperties.h b/ProcessLib/TwoPhaseFlowWithPP/CreateTwoPhaseFlowWithPPMaterialProperties.h deleted file mode 100644 index ab4268b9d0c58809cb097bae5f4cde73ff70b8f8..0000000000000000000000000000000000000000 --- a/ProcessLib/TwoPhaseFlowWithPP/CreateTwoPhaseFlowWithPPMaterialProperties.h +++ /dev/null @@ -1,31 +0,0 @@ -/** - * \file - * \copyright - * Copyright (c) 2012-2019, OpenGeoSys Community (http://www.opengeosys.org) - * Distributed under a Modified BSD License. - * See accompanying file LICENSE.txt or - * http://www.opengeosys.org/project/license - * - */ - -#pragma once - -#include "TwoPhaseFlowWithPPMaterialProperties.h" -namespace BaseLib -{ -class ConfigTree; -} - -namespace ProcessLib -{ -namespace TwoPhaseFlowWithPP -{ -std::unique_ptr<TwoPhaseFlowWithPPMaterialProperties> -createTwoPhaseFlowWithPPMaterialProperties( - BaseLib::ConfigTree const& config, - MeshLib::PropertyVector<int> const* const material_ids, - std::vector<std::unique_ptr<ParameterLib::ParameterBase>> const& - parameters); - -} // namespace TwoPhaseFlowWithPP -} // namespace ProcessLib diff --git a/ProcessLib/TwoPhaseFlowWithPP/CreateTwoPhaseFlowWithPPProcess.cpp b/ProcessLib/TwoPhaseFlowWithPP/CreateTwoPhaseFlowWithPPProcess.cpp index 4fdbd05ef13a849d4b5383e42d9e0eb132869f6f..d9feaf9c0284f1c276d9dcfd9dc56d35be996e1b 100644 --- a/ProcessLib/TwoPhaseFlowWithPP/CreateTwoPhaseFlowWithPPProcess.cpp +++ b/ProcessLib/TwoPhaseFlowWithPP/CreateTwoPhaseFlowWithPPProcess.cpp @@ -19,8 +19,6 @@ #include "ProcessLib/Output/CreateSecondaryVariables.h" #include "ProcessLib/Utils/ProcessUtils.h" -#include "CreateTwoPhaseFlowWithPPMaterialProperties.h" -#include "TwoPhaseFlowWithPPMaterialProperties.h" #include "TwoPhaseFlowWithPPProcess.h" #include "TwoPhaseFlowWithPPProcessData.h" namespace ProcessLib @@ -84,9 +82,6 @@ std::unique_ptr<Process> createTwoPhaseFlowWithPPProcess( //! \ogs_file_param_special{prj__processes__process__TWOPHASE_FLOW_PP__temperature} "temperature", parameters, 1, &mesh); - //! \ogs_file_param{prj__processes__process__TWOPHASE_FLOW_PP__material_property} - auto const& mat_config = config.getConfigSubtree("material_property"); - auto const material_ids = materialIDs(mesh); if (material_ids) { @@ -100,19 +95,15 @@ std::unique_ptr<Process> createTwoPhaseFlowWithPPProcess( auto media_map = MaterialPropertyLib::createMaterialSpatialDistributionMap(media, mesh); - std::unique_ptr<TwoPhaseFlowWithPPMaterialProperties> material = - createTwoPhaseFlowWithPPMaterialProperties(mat_config, material_ids, - parameters); - - TwoPhaseFlowWithPPProcessData process_data{ - specific_body_force, has_gravity, mass_lumping, - temperature, std::move(material), std::move(media_map)}; + TwoPhaseFlowWithPPProcessData process_data{specific_body_force, has_gravity, + mass_lumping, temperature, + std::move(media_map)}; return std::make_unique<TwoPhaseFlowWithPPProcess>( std::move(name), mesh, std::move(jacobian_assembler), parameters, integration_order, std::move(process_variables), std::move(process_data), std::move(secondary_variables), - std::move(named_function_caller), mat_config, curves); + std::move(named_function_caller), curves); } } // namespace TwoPhaseFlowWithPP diff --git a/ProcessLib/TwoPhaseFlowWithPP/TwoPhaseFlowWithPPLocalAssembler-impl.h b/ProcessLib/TwoPhaseFlowWithPP/TwoPhaseFlowWithPPLocalAssembler-impl.h index f946f0b39fb0fb42630f26d07d9d4d06b4399e4b..733e2ae89a2f03cd882345c9aef05832284f7391 100644 --- a/ProcessLib/TwoPhaseFlowWithPP/TwoPhaseFlowWithPPLocalAssembler-impl.h +++ b/ProcessLib/TwoPhaseFlowWithPP/TwoPhaseFlowWithPPLocalAssembler-impl.h @@ -34,7 +34,6 @@ #include "MaterialLib/MPL/Medium.h" #include "TwoPhaseFlowWithPPLocalAssembler.h" -#include <iostream> #include "MathLib/InterpolationAlgorithms/PiecewiseLinearInterpolation.h" #include "NumLib/Function/Interpolation.h" #include "TwoPhaseFlowWithPPProcessData.h" @@ -99,22 +98,6 @@ void TwoPhaseFlowWithPPLocalAssembler< ParameterLib::SpatialPosition pos; pos.setElementID(_element.getID()); - const int material_id = - _process_data.material->getMaterialID(pos.getElementID().get()); - - const Eigen::MatrixXd& perm = _process_data.material->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)); - } for (unsigned ip = 0; ip < n_integration_points; ip++) { @@ -129,8 +112,8 @@ void TwoPhaseFlowWithPPLocalAssembler< auto const& medium = *_process_data.media_map->getMedium(_element.getID()); - auto const& liquid_phase = medium.phase("liquid"); - auto const& gas_phase = medium.phase("gas"); + auto const& liquid_phase = medium.phase("AqueousLiquid"); + auto const& gas_phase = medium.phase("Gas"); MPL::VariableArray variables; @@ -180,6 +163,14 @@ void TwoPhaseFlowWithPPLocalAssembler< auto const lambda_wet = k_rel_wet / mu_wet; + auto const perm = medium.property(MPL::PropertyType::permeability) + .template value<double>(variables, pos, t); + + GlobalDimMatrixType permeability = GlobalDimMatrixType::Zero( + _element.getDimension(), _element.getDimension()); + + permeability.diagonal().setConstant(perm); + Mgp.noalias() += porosity * (1 - Sw) * drhononwet_dpn * _ip_data[ip].massOperator; Mgpc.noalias() += diff --git a/ProcessLib/TwoPhaseFlowWithPP/TwoPhaseFlowWithPPLocalAssembler.h b/ProcessLib/TwoPhaseFlowWithPP/TwoPhaseFlowWithPPLocalAssembler.h index b51b04452ac35d5fe556284bd8c3f7c0955b0b03..36c5397b053665b471df8805fc3b9fe58d4a9fc5 100644 --- a/ProcessLib/TwoPhaseFlowWithPP/TwoPhaseFlowWithPPLocalAssembler.h +++ b/ProcessLib/TwoPhaseFlowWithPP/TwoPhaseFlowWithPPLocalAssembler.h @@ -21,7 +21,6 @@ #include "ProcessLib/LocalAssemblerTraits.h" #include "ProcessLib/Utils/InitShapeMatrices.h" -#include "TwoPhaseFlowWithPPMaterialProperties.h" #include "TwoPhaseFlowWithPPProcessData.h" namespace ProcessLib @@ -32,13 +31,12 @@ template <typename NodalRowVectorType, typename GlobalDimNodalMatrixType, typename NodalMatrixType> struct IntegrationPointData final { - explicit IntegrationPointData( - NodalRowVectorType N_, GlobalDimNodalMatrixType dNdx_, - TwoPhaseFlowWithPPMaterialProperties& material_property_, - double const& integration_weight_, NodalMatrixType const massOperator_) + explicit IntegrationPointData(NodalRowVectorType N_, + GlobalDimNodalMatrixType dNdx_, + double const& integration_weight_, + NodalMatrixType const massOperator_) : N(std::move(N_)), dNdx(std::move(dNdx_)), - mat_property(material_property_), integration_weight(integration_weight_), massOperator(massOperator_) @@ -46,7 +44,6 @@ struct IntegrationPointData final } NodalRowVectorType const N; GlobalDimNodalMatrixType const dNdx; - TwoPhaseFlowWithPPMaterialProperties const& mat_property; const double integration_weight; NodalMatrixType const massOperator; @@ -119,7 +116,7 @@ public: { auto const& sm = shape_matrices[ip]; _ip_data.emplace_back( - sm.N, sm.dNdx, *_process_data.material, + sm.N, sm.dNdx, sm.integralMeasure * sm.detJ * _integration_method.getWeightedPoint(ip).getWeight(), sm.N.transpose() * sm.N * sm.integralMeasure * sm.detJ * diff --git a/ProcessLib/TwoPhaseFlowWithPP/TwoPhaseFlowWithPPMaterialProperties.cpp b/ProcessLib/TwoPhaseFlowWithPP/TwoPhaseFlowWithPPMaterialProperties.cpp deleted file mode 100644 index f755942b231a4a0cfb2a8ac3a4299148c265c220..0000000000000000000000000000000000000000 --- a/ProcessLib/TwoPhaseFlowWithPP/TwoPhaseFlowWithPPMaterialProperties.cpp +++ /dev/null @@ -1,172 +0,0 @@ -/** - * \file - * \copyright - * Copyright (c) 2012-2019, OpenGeoSys Community (http://www.opengeosys.org) - * Distributed under a Modified BSD License. - * See accompanying file LICENSE.txt or - * http://www.opengeosys.org/project/license - * - */ - -#include "TwoPhaseFlowWithPPMaterialProperties.h" -#include <logog/include/logog.hpp> -#include <utility> -#include "MaterialLib/Fluid/FluidProperty.h" -#include "MaterialLib/PorousMedium/Porosity/Porosity.h" -#include "MaterialLib/PorousMedium/Storage/Storage.h" -#include "MaterialLib/PorousMedium/UnsaturatedProperty/CapillaryPressure/CapillaryPressureSaturation.h" -#include "MaterialLib/PorousMedium/UnsaturatedProperty/CapillaryPressure/CreateCapillaryPressureModel.h" -#include "MaterialLib/PorousMedium/UnsaturatedProperty/RelativePermeability/CreateRelativePermeabilityModel.h" -#include "MaterialLib/PorousMedium/UnsaturatedProperty/RelativePermeability/RelativePermeability.h" -#include "MathLib/InterpolationAlgorithms/PiecewiseLinearInterpolation.h" -#include "MeshLib/Mesh.h" -#include "MeshLib/PropertyVector.h" -#include "ParameterLib/Parameter.h" -#include "ParameterLib/SpatialPosition.h" -namespace ProcessLib -{ -namespace TwoPhaseFlowWithPP -{ -TwoPhaseFlowWithPPMaterialProperties::TwoPhaseFlowWithPPMaterialProperties( - MeshLib::PropertyVector<int> const* const material_ids, - std::unique_ptr<MaterialLib::Fluid::FluidProperty> - liquid_density, - std::unique_ptr<MaterialLib::Fluid::FluidProperty> - liquid_viscosity, - std::unique_ptr<MaterialLib::Fluid::FluidProperty> - gas_density, - std::unique_ptr<MaterialLib::Fluid::FluidProperty> - gas_viscosity, - std::vector<std::unique_ptr<MaterialLib::PorousMedium::Permeability>>&& - intrinsic_permeability_models, - std::vector<std::unique_ptr<MaterialLib::PorousMedium::Porosity>>&& - porosity_models, - std::vector<std::unique_ptr<MaterialLib::PorousMedium::Storage>>&& - storage_models, - std::vector<std::unique_ptr< - MaterialLib::PorousMedium::CapillaryPressureSaturation>>&& - capillary_pressure_models, - std::vector< - std::unique_ptr<MaterialLib::PorousMedium::RelativePermeability>>&& - relative_permeability_models) - : _liquid_density(std::move(liquid_density)), - _liquid_viscosity(std::move(liquid_viscosity)), - _gas_density(std::move(gas_density)), - _gas_viscosity(std::move(gas_viscosity)), - _material_ids(material_ids), - _intrinsic_permeability_models(std::move(intrinsic_permeability_models)), - _porosity_models(std::move(porosity_models)), - _storage_models(std::move(storage_models)), - _capillary_pressure_models(std::move(capillary_pressure_models)), - _relative_permeability_models(std::move(relative_permeability_models)) -{ - DBUG("Create material properties for Two-Phase flow with PP model."); -} - -int TwoPhaseFlowWithPPMaterialProperties::getMaterialID( - const std::size_t element_id) -{ - if (!_material_ids) - { - return 0; - } - - assert(element_id < _material_ids->size()); - return (*_material_ids)[element_id]; -} - -double TwoPhaseFlowWithPPMaterialProperties::getLiquidDensity( - const double p, const double T) const -{ - ArrayType vars; - vars[static_cast<int>(MaterialLib::Fluid::PropertyVariableType::T)] = T; - vars[static_cast<int>(MaterialLib::Fluid::PropertyVariableType::p)] = p; - return _liquid_density->getValue(vars); -} - -double TwoPhaseFlowWithPPMaterialProperties::getGasDensity(const double p, - const double T) const -{ - ArrayType vars; - vars[static_cast<int>(MaterialLib::Fluid::PropertyVariableType::T)] = T; - vars[static_cast<int>(MaterialLib::Fluid::PropertyVariableType::p)] = p; - return _gas_density->getValue(vars); -} - -double TwoPhaseFlowWithPPMaterialProperties::getGasDensityDerivative( - const double p, const double T) const -{ - ArrayType vars; - vars[static_cast<int>(MaterialLib::Fluid::PropertyVariableType::T)] = T; - vars[static_cast<int>(MaterialLib::Fluid::PropertyVariableType::p)] = p; - - return _gas_density->getdValue(vars, - MaterialLib::Fluid::PropertyVariableType::p); -} -double TwoPhaseFlowWithPPMaterialProperties::getLiquidViscosity( - const double p, const double T) const -{ - ArrayType vars; - vars[static_cast<int>(MaterialLib::Fluid::PropertyVariableType::T)] = T; - vars[static_cast<int>(MaterialLib::Fluid::PropertyVariableType::p)] = p; - return _liquid_viscosity->getValue(vars); -} - -double TwoPhaseFlowWithPPMaterialProperties::getGasViscosity( - const double p, const double T) const -{ - ArrayType vars; - vars[static_cast<int>(MaterialLib::Fluid::PropertyVariableType::T)] = T; - vars[static_cast<int>(MaterialLib::Fluid::PropertyVariableType::p)] = p; - return _gas_viscosity->getValue(vars); -} - -Eigen::MatrixXd TwoPhaseFlowWithPPMaterialProperties::getPermeability( - const int material_id, const double t, - const ParameterLib::SpatialPosition& pos, const int /*dim*/) const -{ - return _intrinsic_permeability_models[material_id]->getValue(t, pos, 0.0, - 0.0); -} - -double TwoPhaseFlowWithPPMaterialProperties::getPorosity( - const int material_id, const double t, - const ParameterLib::SpatialPosition& pos, const double /*p*/, - const double T, const double porosity_variable) const -{ - return _porosity_models[material_id]->getValue(t, pos, porosity_variable, - T); -} - -double TwoPhaseFlowWithPPMaterialProperties::getNonwetRelativePermeability( - const double /*t*/, const ParameterLib::SpatialPosition& /*pos*/, - const double /*p*/, const double /*T*/, const double saturation) const -{ - return _relative_permeability_models[0]->getValue(saturation); -} - -double TwoPhaseFlowWithPPMaterialProperties::getWetRelativePermeability( - const double /*t*/, const ParameterLib::SpatialPosition& /*pos*/, - const double /*p*/, const double /*T*/, const double saturation) const -{ - return _relative_permeability_models[1]->getValue(saturation); -} - -double TwoPhaseFlowWithPPMaterialProperties::getSaturation( - const int material_id, const double /*t*/, - const ParameterLib::SpatialPosition& /*pos*/, const double /*p*/, - const double /*T*/, const double pc) const -{ - return _capillary_pressure_models[material_id]->getSaturation(pc); -} -double TwoPhaseFlowWithPPMaterialProperties::getSaturationDerivative( - const int material_id, const double /*t*/, - const ParameterLib::SpatialPosition& /*pos*/, const double /*p*/, - const double /*T*/, const double saturation) const -{ - const double dpcdsw = - _capillary_pressure_models[material_id]->getdPcdS(saturation); - return 1 / dpcdsw; -} -} // namespace TwoPhaseFlowWithPP -} // namespace ProcessLib diff --git a/ProcessLib/TwoPhaseFlowWithPP/TwoPhaseFlowWithPPMaterialProperties.h b/ProcessLib/TwoPhaseFlowWithPP/TwoPhaseFlowWithPPMaterialProperties.h deleted file mode 100644 index 67a9f525bafa5578d4a4141a9162fe0fc902f5f9..0000000000000000000000000000000000000000 --- a/ProcessLib/TwoPhaseFlowWithPP/TwoPhaseFlowWithPPMaterialProperties.h +++ /dev/null @@ -1,126 +0,0 @@ -/** - * \file - * \copyright - * Copyright (c) 2012-2019, OpenGeoSys Community (http://www.opengeosys.org) - * Distributed under a Modified BSD License. - * See accompanying file LICENSE.txt or - * http://www.opengeosys.org/project/license - * - */ - -#pragma once - -#include <memory> -#include <vector> -#include "MaterialLib/Fluid/FluidPropertyHeaders.h" -#include "MaterialLib/PhysicalConstant.h" -#include "MaterialLib/PorousMedium/Porosity/Porosity.h" -#include "MaterialLib/PorousMedium/PorousPropertyHeaders.h" -#include "MaterialLib/PorousMedium/Storage/Storage.h" -#include "MaterialLib/PorousMedium/UnsaturatedProperty/CapillaryPressure/CapillaryPressureSaturation.h" -#include "MaterialLib/PorousMedium/UnsaturatedProperty/CapillaryPressure/CreateCapillaryPressureModel.h" -#include "MaterialLib/PorousMedium/UnsaturatedProperty/RelativePermeability/CreateRelativePermeabilityModel.h" -#include "MaterialLib/PorousMedium/UnsaturatedProperty/RelativePermeability/RelativePermeability.h" - -namespace MeshLib -{ -template <typename PROP_VAL_TYPE> -class PropertyVector; -} - -namespace ProcessLib::TwoPhaseFlowWithPP -{ -/** This class has a collection of material properties for two-phase flow with - * PP model and it makes description of the material properties for two-phase - * condition, i.e. the gas/liquid density and viscosity models, respectively, - * the relative permeability models with respect to two phases, - * the capillary pressure-saturation relationships. - * It generally provides the computation of the PDE coefficients for two-phase - * flow. - */ - -class TwoPhaseFlowWithPPMaterialProperties -{ -public: - using ArrayType = MaterialLib::Fluid::FluidProperty::ArrayType; - - TwoPhaseFlowWithPPMaterialProperties( - MeshLib::PropertyVector<int> const* const material_ids, - std::unique_ptr<MaterialLib::Fluid::FluidProperty> - liquid_density, - std::unique_ptr<MaterialLib::Fluid::FluidProperty> - liquid_viscosity, - std::unique_ptr<MaterialLib::Fluid::FluidProperty> - gas_density, - std::unique_ptr<MaterialLib::Fluid::FluidProperty> - gas_viscosity, - std::vector<std::unique_ptr<MaterialLib::PorousMedium::Permeability>>&& - intrinsic_permeability_models, - std::vector<std::unique_ptr<MaterialLib::PorousMedium::Porosity>>&& - porosity_models, - std::vector<std::unique_ptr<MaterialLib::PorousMedium::Storage>>&& - storage_models, - std::vector<std::unique_ptr< - MaterialLib::PorousMedium::CapillaryPressureSaturation>>&& - capillary_pressure_models, - std::vector< - std::unique_ptr<MaterialLib::PorousMedium::RelativePermeability>>&& - relative_permeability_models); - - int getMaterialID(const std::size_t element_id); - - Eigen::MatrixXd getPermeability(const int material_id, - const double t, - const ParameterLib::SpatialPosition& pos, - const int dim) const; - - double getPorosity(const int material_id, const double t, - const ParameterLib::SpatialPosition& pos, const double p, - const double T, const double porosity_variable) const; - - double getNonwetRelativePermeability( - const double t, const ParameterLib::SpatialPosition& pos, - const double p, const double T, const double saturation) const; - double getWetRelativePermeability(const double t, - const ParameterLib::SpatialPosition& pos, - const double p, const double T, - const double saturation) const; - double getSaturation(const int material_id, const double t, - const ParameterLib::SpatialPosition& pos, - const double p, const double T, const double pc) const; - double getSaturationDerivative(const int material_id, const double t, - const ParameterLib::SpatialPosition& pos, - const double p, const double T, - const double saturation) const; - double getLiquidDensity(const double p, const double T) const; - double getGasDensity(const double p, const double T) const; - double getGasViscosity(const double p, const double T) const; - double getLiquidViscosity(const double p, const double T) const; - double getGasDensityDerivative(double const p, double const T) const; - -protected: - std::unique_ptr<MaterialLib::Fluid::FluidProperty> _liquid_density; - std::unique_ptr<MaterialLib::Fluid::FluidProperty> _liquid_viscosity; - std::unique_ptr<MaterialLib::Fluid::FluidProperty> _gas_density; - std::unique_ptr<MaterialLib::Fluid::FluidProperty> _gas_viscosity; - - /** Use two phase models for different material zones. - * Material IDs must be given as mesh element properties. - */ - MeshLib::PropertyVector<int> const* const _material_ids; - - std::vector<std::unique_ptr<MaterialLib::PorousMedium::Permeability>> - _intrinsic_permeability_models; - std::vector<std::unique_ptr<MaterialLib::PorousMedium::Porosity>> - _porosity_models; - std::vector<std::unique_ptr<MaterialLib::PorousMedium::Storage>> - _storage_models; - std::vector< - std::unique_ptr<MaterialLib::PorousMedium::CapillaryPressureSaturation>> - _capillary_pressure_models; - std::vector< - std::unique_ptr<MaterialLib::PorousMedium::RelativePermeability>> - _relative_permeability_models; -}; - -} // namespace ProcessLib::TwoPhaseFlowWithPP diff --git a/ProcessLib/TwoPhaseFlowWithPP/TwoPhaseFlowWithPPProcess.cpp b/ProcessLib/TwoPhaseFlowWithPP/TwoPhaseFlowWithPPProcess.cpp index bf5bf0f4c20dae8cd40a4c3520c65250832e977f..c1cf2c66500b4922b46e7673923c5876cf866a61 100644 --- a/ProcessLib/TwoPhaseFlowWithPP/TwoPhaseFlowWithPPProcess.cpp +++ b/ProcessLib/TwoPhaseFlowWithPP/TwoPhaseFlowWithPPProcess.cpp @@ -35,7 +35,6 @@ TwoPhaseFlowWithPPProcess::TwoPhaseFlowWithPPProcess( TwoPhaseFlowWithPPProcessData&& process_data, SecondaryVariableCollection&& secondary_variables, NumLib::NamedFunctionCaller&& named_function_caller, - BaseLib::ConfigTree const& /*config*/, std::map<std::string, std::unique_ptr<MathLib::PiecewiseLinearInterpolation>> const& /*curves*/) diff --git a/ProcessLib/TwoPhaseFlowWithPP/TwoPhaseFlowWithPPProcess.h b/ProcessLib/TwoPhaseFlowWithPP/TwoPhaseFlowWithPPProcess.h index e1ef5f6e5ebd2948b0494cf909d4936e302cedf3..c020b37dfdea76930934c0690f37d5ee905f7d8a 100644 --- a/ProcessLib/TwoPhaseFlowWithPP/TwoPhaseFlowWithPPProcess.h +++ b/ProcessLib/TwoPhaseFlowWithPP/TwoPhaseFlowWithPPProcess.h @@ -48,7 +48,6 @@ public: TwoPhaseFlowWithPPProcessData&& process_data, SecondaryVariableCollection&& secondary_variables, NumLib::NamedFunctionCaller&& named_function_caller, - BaseLib::ConfigTree const& config, std::map<std::string, std::unique_ptr<MathLib::PiecewiseLinearInterpolation>> const& curves); diff --git a/ProcessLib/TwoPhaseFlowWithPP/TwoPhaseFlowWithPPProcessData.h b/ProcessLib/TwoPhaseFlowWithPP/TwoPhaseFlowWithPPProcessData.h index 08cfb90d0c58d282992a1c3f3a7039f828628f2e..525971480b43b59b0a8d764aacabcb3126c1aec2 100644 --- a/ProcessLib/TwoPhaseFlowWithPP/TwoPhaseFlowWithPPProcessData.h +++ b/ProcessLib/TwoPhaseFlowWithPP/TwoPhaseFlowWithPPProcessData.h @@ -10,7 +10,6 @@ #pragma once #include "MaterialLib/MPL/MaterialSpatialDistributionMap.h" -#include "TwoPhaseFlowWithPPMaterialProperties.h" namespace ProcessLib { @@ -31,7 +30,6 @@ struct TwoPhaseFlowWithPPProcessData //! Enables lumping of the mass matrix. bool const has_mass_lumping; ParameterLib::Parameter<double> const& temperature; - std::unique_ptr<TwoPhaseFlowWithPPMaterialProperties> material; std::unique_ptr<MaterialPropertyLib::MaterialSpatialDistributionMap> media_map; };