diff --git a/Applications/ApplicationsLib/ProjectData.cpp b/Applications/ApplicationsLib/ProjectData.cpp index 95eece383956bcc27c23e692e1850f3feb30ab84..9aae20a6fa952f0b29783914d2ad15b022c7ebba 100644 --- a/Applications/ApplicationsLib/ProjectData.cpp +++ b/Applications/ApplicationsLib/ProjectData.cpp @@ -922,7 +922,7 @@ void ProjectData::parseProcesses( name, *_mesh_vec[0], std::move(jacobian_assembler), _process_variables, _parameters, _local_coordinate_system, integration_order, - process_config); + process_config, _media); break; case 3: process = ProcessLib::LIE::HydroMechanics:: @@ -930,7 +930,7 @@ void ProjectData::parseProcesses( name, *_mesh_vec[0], std::move(jacobian_assembler), _process_variables, _parameters, _local_coordinate_system, integration_order, - process_config); + process_config, _media); break; default: OGS_FATAL( diff --git a/Documentation/ProjectFile/prj/processes/process/HYDRO_MECHANICS_WITH_LIE/fracture_properties/t_biot_coefficient.md b/Documentation/ProjectFile/prj/processes/process/HYDRO_MECHANICS_WITH_LIE/fracture_properties/t_biot_coefficient.md deleted file mode 100644 index 576add64edccf5d980a0ff86143dc43a7109a788..0000000000000000000000000000000000000000 --- a/Documentation/ProjectFile/prj/processes/process/HYDRO_MECHANICS_WITH_LIE/fracture_properties/t_biot_coefficient.md +++ /dev/null @@ -1 +0,0 @@ -\ogs_missing_documentation diff --git a/Documentation/ProjectFile/prj/processes/process/HYDRO_MECHANICS_WITH_LIE/fracture_properties/t_material_id.md b/Documentation/ProjectFile/prj/processes/process/HYDRO_MECHANICS_WITH_LIE/fracture_properties/t_material_id.md deleted file mode 100644 index 576add64edccf5d980a0ff86143dc43a7109a788..0000000000000000000000000000000000000000 --- a/Documentation/ProjectFile/prj/processes/process/HYDRO_MECHANICS_WITH_LIE/fracture_properties/t_material_id.md +++ /dev/null @@ -1 +0,0 @@ -\ogs_missing_documentation diff --git a/Documentation/ProjectFile/prj/processes/process/HYDRO_MECHANICS_WITH_LIE/fracture_properties/t_specific_storage.md b/Documentation/ProjectFile/prj/processes/process/HYDRO_MECHANICS_WITH_LIE/fracture_properties/t_specific_storage.md deleted file mode 100644 index 576add64edccf5d980a0ff86143dc43a7109a788..0000000000000000000000000000000000000000 --- a/Documentation/ProjectFile/prj/processes/process/HYDRO_MECHANICS_WITH_LIE/fracture_properties/t_specific_storage.md +++ /dev/null @@ -1 +0,0 @@ -\ogs_missing_documentation diff --git a/Documentation/ProjectFile/prj/processes/process/HYDRO_MECHANICS_WITH_LIE/t_biot_coefficient.md b/Documentation/ProjectFile/prj/processes/process/HYDRO_MECHANICS_WITH_LIE/t_biot_coefficient.md deleted file mode 100644 index 576add64edccf5d980a0ff86143dc43a7109a788..0000000000000000000000000000000000000000 --- a/Documentation/ProjectFile/prj/processes/process/HYDRO_MECHANICS_WITH_LIE/t_biot_coefficient.md +++ /dev/null @@ -1 +0,0 @@ -\ogs_missing_documentation diff --git a/Documentation/ProjectFile/prj/processes/process/HYDRO_MECHANICS_WITH_LIE/t_fluid_density.md b/Documentation/ProjectFile/prj/processes/process/HYDRO_MECHANICS_WITH_LIE/t_fluid_density.md deleted file mode 100644 index 576add64edccf5d980a0ff86143dc43a7109a788..0000000000000000000000000000000000000000 --- a/Documentation/ProjectFile/prj/processes/process/HYDRO_MECHANICS_WITH_LIE/t_fluid_density.md +++ /dev/null @@ -1 +0,0 @@ -\ogs_missing_documentation diff --git a/Documentation/ProjectFile/prj/processes/process/HYDRO_MECHANICS_WITH_LIE/t_fluid_viscosity.md b/Documentation/ProjectFile/prj/processes/process/HYDRO_MECHANICS_WITH_LIE/t_fluid_viscosity.md deleted file mode 100644 index 576add64edccf5d980a0ff86143dc43a7109a788..0000000000000000000000000000000000000000 --- a/Documentation/ProjectFile/prj/processes/process/HYDRO_MECHANICS_WITH_LIE/t_fluid_viscosity.md +++ /dev/null @@ -1 +0,0 @@ -\ogs_missing_documentation diff --git a/Documentation/ProjectFile/prj/processes/process/HYDRO_MECHANICS_WITH_LIE/t_intrinsic_permeability.md b/Documentation/ProjectFile/prj/processes/process/HYDRO_MECHANICS_WITH_LIE/t_intrinsic_permeability.md deleted file mode 100644 index 576add64edccf5d980a0ff86143dc43a7109a788..0000000000000000000000000000000000000000 --- a/Documentation/ProjectFile/prj/processes/process/HYDRO_MECHANICS_WITH_LIE/t_intrinsic_permeability.md +++ /dev/null @@ -1 +0,0 @@ -\ogs_missing_documentation diff --git a/Documentation/ProjectFile/prj/processes/process/HYDRO_MECHANICS_WITH_LIE/t_porosity.md b/Documentation/ProjectFile/prj/processes/process/HYDRO_MECHANICS_WITH_LIE/t_porosity.md deleted file mode 100644 index 576add64edccf5d980a0ff86143dc43a7109a788..0000000000000000000000000000000000000000 --- a/Documentation/ProjectFile/prj/processes/process/HYDRO_MECHANICS_WITH_LIE/t_porosity.md +++ /dev/null @@ -1 +0,0 @@ -\ogs_missing_documentation diff --git a/Documentation/ProjectFile/prj/processes/process/HYDRO_MECHANICS_WITH_LIE/t_reference_temperature.md b/Documentation/ProjectFile/prj/processes/process/HYDRO_MECHANICS_WITH_LIE/t_reference_temperature.md deleted file mode 100644 index ce255b04b7954788eb839b536e39a8f146dc9f1d..0000000000000000000000000000000000000000 --- a/Documentation/ProjectFile/prj/processes/process/HYDRO_MECHANICS_WITH_LIE/t_reference_temperature.md +++ /dev/null @@ -1 +0,0 @@ -Reference temperature, an optional input. diff --git a/Documentation/ProjectFile/prj/processes/process/HYDRO_MECHANICS_WITH_LIE/t_solid_density.md b/Documentation/ProjectFile/prj/processes/process/HYDRO_MECHANICS_WITH_LIE/t_solid_density.md deleted file mode 100644 index 576add64edccf5d980a0ff86143dc43a7109a788..0000000000000000000000000000000000000000 --- a/Documentation/ProjectFile/prj/processes/process/HYDRO_MECHANICS_WITH_LIE/t_solid_density.md +++ /dev/null @@ -1 +0,0 @@ -\ogs_missing_documentation diff --git a/Documentation/ProjectFile/prj/processes/process/HYDRO_MECHANICS_WITH_LIE/t_specific_storage.md b/Documentation/ProjectFile/prj/processes/process/HYDRO_MECHANICS_WITH_LIE/t_specific_storage.md deleted file mode 100644 index 576add64edccf5d980a0ff86143dc43a7109a788..0000000000000000000000000000000000000000 --- a/Documentation/ProjectFile/prj/processes/process/HYDRO_MECHANICS_WITH_LIE/t_specific_storage.md +++ /dev/null @@ -1 +0,0 @@ -\ogs_missing_documentation diff --git a/Documentation/ProjectFile/properties/property/CubicLawPermeability/t_fracture_aperture.md b/Documentation/ProjectFile/properties/property/CubicLawPermeability/t_fracture_aperture.md index 325bb3c6eed811c57e0d492aeaac38a670867400..738e2566f2f6791a8b6f9a25e4df0fe55b27c0a3 100644 --- a/Documentation/ProjectFile/properties/property/CubicLawPermeability/t_fracture_aperture.md +++ b/Documentation/ProjectFile/properties/property/CubicLawPermeability/t_fracture_aperture.md @@ -1 +1 @@ -Collection of fracture properties for a specific fracture given by material id. +\copydoc MaterialPropertyLib::CubicLawPermeability::_b diff --git a/MaterialLib/MPL/Properties/CreateCubicLawPermeability.cpp b/MaterialLib/MPL/Properties/CreateCubicLawPermeability.cpp index d73c1519e942481348a2cf9c57a870046e84ba56..5191ac6895f1b9b4a142c5b752914ec0c4baf90e 100644 --- a/MaterialLib/MPL/Properties/CreateCubicLawPermeability.cpp +++ b/MaterialLib/MPL/Properties/CreateCubicLawPermeability.cpp @@ -9,6 +9,9 @@ #include "CreateCubicLawPermeability.h" +#include <limits> +#include <string> + #include "BaseLib/ConfigTree.h" #include "CubicLawPermeability.h" #include "ParameterLib/Utils.h" @@ -27,10 +30,15 @@ std::unique_ptr<Property> createCubicLawPermeability( //! \ogs_file_param{properties__property__name} auto property_name = config.peekConfigParameter<std::string>("name"); - auto const& b = ParameterLib::findParameter<double>( + auto const fracture_aperture_name = //! \ogs_file_param{properties__property__CubicLawPermeability__fracture_aperture} - config.getConfigParameter<std::string>("fracture_aperture"), parameters, - 0, nullptr); + config.getConfigParameter<std::string>("fracture_aperture", ""); + + ParameterLib::Parameter<double>* b = + fracture_aperture_name == "" + ? nullptr + : &ParameterLib::findParameter<double>( + fracture_aperture_name, parameters, 0, nullptr); return std::make_unique<CubicLawPermeability>(std::move(property_name), b); } diff --git a/MaterialLib/MPL/Properties/CreateCubicLawPermeability.h b/MaterialLib/MPL/Properties/CreateCubicLawPermeability.h index fee4541eb45f7b51bc74c9a714170397181f5467..97d02a32da3834d5f1e859550f8fa259266bb18e 100644 --- a/MaterialLib/MPL/Properties/CreateCubicLawPermeability.h +++ b/MaterialLib/MPL/Properties/CreateCubicLawPermeability.h @@ -17,14 +17,14 @@ namespace BaseLib class ConfigTree; } -namespace MaterialPropertyLib +namespace ParameterLib { -class Property; +struct ParameterBase; } -namespace ParameterLib +namespace MaterialPropertyLib { -struct ParameterBase; +class Property; } namespace MaterialPropertyLib diff --git a/MaterialLib/MPL/Properties/CubicLawPermeability.cpp b/MaterialLib/MPL/Properties/CubicLawPermeability.cpp index abb8ca587aa1f8b2b4319116d386a8d16f0e4bbc..8c609106dcf57344e30096be76f1d2b44cc8a5e7 100644 --- a/MaterialLib/MPL/Properties/CubicLawPermeability.cpp +++ b/MaterialLib/MPL/Properties/CubicLawPermeability.cpp @@ -11,20 +11,34 @@ namespace MaterialPropertyLib { +CubicLawPermeability::CubicLawPermeability( + std::string name, ParameterLib::Parameter<double> const* b) + : _b(b) +{ + name_ = std::move(name); +} + PropertyDataType CubicLawPermeability::value( - VariableArray const& /*variable_array*/, + VariableArray const& variable_array, ParameterLib::SpatialPosition const& pos, double const t, double const /*dt*/) const { - double const aperture_m = _b(t, pos)[0]; + double const aperture_m = + _b ? (*_b)(t, pos)[0] : variable_array.fracture_aperture; + return aperture_m * aperture_m / 12; } PropertyDataType CubicLawPermeability::dValue( - VariableArray const& /*variable_array*/, Variable const /*variable*/, + VariableArray const& variable_array, Variable const variable, ParameterLib::SpatialPosition const& /*pos*/, double const /*t*/, double const /*dt*/) const { - OGS_FATAL("CubicLawPermeability::dValue is not implemented."); + if (variable != Variable::fracture_aperture || _b) + { + return 0.0; + } + + return variable_array.fracture_aperture / 6.0; } } // namespace MaterialPropertyLib diff --git a/MaterialLib/MPL/Properties/CubicLawPermeability.h b/MaterialLib/MPL/Properties/CubicLawPermeability.h index 95aec8d192fac6c3adff641424fde84928200b7f..1bc9fffbb4928d75a19142dc8c294726043c362c 100644 --- a/MaterialLib/MPL/Properties/CubicLawPermeability.h +++ b/MaterialLib/MPL/Properties/CubicLawPermeability.h @@ -9,8 +9,12 @@ #pragma once +#include <limits> +#include <string> + #include "MaterialLib/MPL/Property.h" #include "MaterialLib/MPL/VariableType.h" +#include "ParameterLib/ConstantParameter.h" #include "ParameterLib/Parameter.h" namespace MaterialPropertyLib @@ -37,12 +41,8 @@ namespace MaterialPropertyLib */ struct CubicLawPermeability final : public Property { - explicit CubicLawPermeability(std::string name, - ParameterLib::Parameter<double> const& b) - : _b(b) - { - name_ = std::move(name); - } + CubicLawPermeability(std::string name, + ParameterLib::Parameter<double> const* b); void checkScale() const override { @@ -50,7 +50,7 @@ struct CubicLawPermeability final : public Property { OGS_FATAL( "The property 'CubicLawPermeability' is implemented on the " - "'media' scaleonly."); + "'media' scale only."); } } @@ -65,7 +65,7 @@ struct CubicLawPermeability final : public Property double const t, double const dt) const override; private: - /// fracture aperture - ParameterLib::Parameter<double> const& _b; + /// Predefined fracture aperture. + ParameterLib::Parameter<double> const* _b = nullptr; }; } // namespace MaterialPropertyLib diff --git a/MaterialLib/MPL/VariableType.cpp b/MaterialLib/MPL/VariableType.cpp index 491f3759aaa5c64a982394c49961e10a43728edc..7a7b97083cfdc168b8e7ae2ce9357e9041e6860b 100644 --- a/MaterialLib/MPL/VariableType.cpp +++ b/MaterialLib/MPL/VariableType.cpp @@ -60,6 +60,8 @@ VariableArray::VariablePointerConst VariableArray::address_of( return &enthalpy_of_evaporation; case Variable::equivalent_plastic_strain: return &equivalent_plastic_strain; + case Variable::fracture_aperture: + return &fracture_aperture; case Variable::grain_compressibility: return &grain_compressibility; case Variable::liquid_phase_pressure: diff --git a/MaterialLib/MPL/VariableType.h b/MaterialLib/MPL/VariableType.h index f7351bd46901bd94f081e4db37cac38dcecf0221..2d4f3ea84af620df67765dcaa4baa8d1f4269ad2 100644 --- a/MaterialLib/MPL/VariableType.h +++ b/MaterialLib/MPL/VariableType.h @@ -36,6 +36,7 @@ enum class Variable : int enthalpy, enthalpy_of_evaporation, equivalent_plastic_strain, + fracture_aperture, grain_compressibility, liquid_phase_pressure, liquid_saturation, @@ -66,6 +67,7 @@ static const std::array<std::string, "enthalpy", "enthalpy_of_evaporation", "equivalent_plastic_strain", + "fracture_aperture", "grain_compressibility", "liquid_phase_pressure", "liquid_saturation", @@ -174,6 +176,7 @@ public: double enthalpy = nan_; double enthalpy_of_evaporation = nan_; double equivalent_plastic_strain = nan_; + double fracture_aperture = nan_; double grain_compressibility = nan_; double liquid_phase_pressure = nan_; double liquid_saturation = nan_; diff --git a/ProcessLib/LIE/Common/FractureProperty.h b/ProcessLib/LIE/Common/FractureProperty.h index 0dbddebde3ba2e4a5cb8a380fc33ce7cab1842b3..883a5a4c9d91400cdd3da6f5317251ecfd7f6033 100644 --- a/ProcessLib/LIE/Common/FractureProperty.h +++ b/ProcessLib/LIE/Common/FractureProperty.h @@ -53,24 +53,6 @@ struct FractureProperty virtual ~FractureProperty() = default; }; -struct FracturePropertyHM : public FractureProperty -{ - FracturePropertyHM(int const fracture_id_, int const material_id, - ParameterLib::Parameter<double> const& initial_aperture, - ParameterLib::Parameter<double> const& specific_storage_, - ParameterLib::Parameter<double> const& biot_coefficient_) - : FractureProperty(fracture_id_, material_id, initial_aperture), - specific_storage(specific_storage_), - biot_coefficient(biot_coefficient_) - { - } - ParameterLib::Parameter<double> const& specific_storage; - ParameterLib::Parameter<double> const& biot_coefficient; - - std::unique_ptr<MaterialLib::Fracture::Permeability::Permeability> - permeability_model; -}; - /// configure fracture property based on a fracture element assuming /// a fracture is a straight line/flat plane inline void setFractureProperty(int const dim, MeshLib::Element const& e, diff --git a/ProcessLib/LIE/HydroMechanics/CreateHydroMechanicsProcess.cpp b/ProcessLib/LIE/HydroMechanics/CreateHydroMechanicsProcess.cpp index ba887104e637b90ec1c99818edf360e319b29d17..268d9f20b234052a78b069f0221e747d4af1196c 100644 --- a/ProcessLib/LIE/HydroMechanics/CreateHydroMechanicsProcess.cpp +++ b/ProcessLib/LIE/HydroMechanics/CreateHydroMechanicsProcess.cpp @@ -18,7 +18,13 @@ #include "MaterialLib/FractureModels/CreateCoulomb.h" #include "MaterialLib/FractureModels/CreateLinearElasticIsotropic.h" #include "MaterialLib/FractureModels/Permeability/CreatePermeabilityModel.h" +#include "MaterialLib/MPL/CreateMaterialSpatialDistributionMap.h" +#include "MaterialLib/MPL/MaterialSpatialDistributionMap.h" +#include "MaterialLib/MPL/PropertyType.h" +#include "MaterialLib/MPL/Utils/CheckMPLPhasesForSinglePhaseFlow.h" +#include "MaterialLib/MPL/VariableType.h" #include "MaterialLib/SolidModels/CreateConstitutiveRelation.h" +#include "ParameterLib/SpatialPosition.h" #include "ParameterLib/Utils.h" #include "ProcessLib/Output/CreateSecondaryVariables.h" @@ -38,7 +44,8 @@ std::unique_ptr<Process> createHydroMechanicsProcess( std::optional<ParameterLib::CoordinateSystem> const& local_coordinate_system, unsigned const integration_order, - BaseLib::ConfigTree const& config) + BaseLib::ConfigTree const& config, + std::map<int, std::shared_ptr<MaterialPropertyLib::Medium>> const& media) { //! \ogs_file_param{prj__processes__process__type} config.checkConfigParameter("type", "HYDRO_MECHANICS_WITH_LIE"); @@ -137,58 +144,6 @@ std::unique_ptr<Process> createHydroMechanicsProcess( MaterialLib::Solids::createConstitutiveRelations<GlobalDim>( parameters, local_coordinate_system, materialIDs(mesh), config); - // Intrinsic permeability - auto& intrinsic_permeability = ParameterLib::findParameter<double>( - config, - //! \ogs_file_param_special{prj__processes__process__HYDRO_MECHANICS_WITH_LIE__intrinsic_permeability} - "intrinsic_permeability", parameters, 1, &mesh); - - DBUG("Use '{:s}' as intrinsic permeability parameter.", - intrinsic_permeability.name); - - // Storage coefficient - auto& specific_storage = ParameterLib::findParameter<double>( - config, - //! \ogs_file_param_special{prj__processes__process__HYDRO_MECHANICS_WITH_LIE__specific_storage} - "specific_storage", parameters, 1, &mesh); - - DBUG("Use '{:s}' as specific storage parameter.", specific_storage.name); - - // Fluid viscosity - auto& fluid_viscosity = ParameterLib::findParameter<double>( - config, - //! \ogs_file_param_special{prj__processes__process__HYDRO_MECHANICS_WITH_LIE__fluid_viscosity} - "fluid_viscosity", parameters, 1, &mesh); - DBUG("Use '{:s}' as fluid viscosity parameter.", fluid_viscosity.name); - - // Fluid density - auto& fluid_density = ParameterLib::findParameter<double>( - config, - //! \ogs_file_param_special{prj__processes__process__HYDRO_MECHANICS_WITH_LIE__fluid_density} - "fluid_density", parameters, 1, &mesh); - DBUG("Use '{:s}' as fluid density parameter.", fluid_density.name); - - // Biot coefficient - auto& biot_coefficient = ParameterLib::findParameter<double>( - config, - //! \ogs_file_param_special{prj__processes__process__HYDRO_MECHANICS_WITH_LIE__biot_coefficient} - "biot_coefficient", parameters, 1, &mesh); - DBUG("Use '{:s}' as Biot coefficient parameter.", biot_coefficient.name); - - // Porosity - auto& porosity = ParameterLib::findParameter<double>( - config, - //! \ogs_file_param_special{prj__processes__process__HYDRO_MECHANICS_WITH_LIE__porosity} - "porosity", parameters, 1, &mesh); - DBUG("Use '{:s}' as porosity parameter.", porosity.name); - - // Solid density - auto& solid_density = ParameterLib::findParameter<double>( - config, - //! \ogs_file_param_special{prj__processes__process__HYDRO_MECHANICS_WITH_LIE__solid_density} - "solid_density", parameters, 1, &mesh); - DBUG("Use '{:s}' as solid density parameter.", solid_density.name); - // Specific body force Eigen::Matrix<double, GlobalDim, 1> specific_body_force; { @@ -249,7 +204,7 @@ std::unique_ptr<Process> createHydroMechanicsProcess( } // Fracture properties - std::unique_ptr<FracturePropertyHM> frac_prop = nullptr; + std::unique_ptr<FractureProperty> frac_prop = nullptr; auto opt_fracture_properties_config = //! \ogs_file_param{prj__processes__process__HYDRO_MECHANICS_WITH_LIE__fracture_properties} config.getConfigSubtreeOptional("fracture_properties"); @@ -257,21 +212,11 @@ std::unique_ptr<Process> createHydroMechanicsProcess( { auto& fracture_properties_config = *opt_fracture_properties_config; - frac_prop = std::make_unique<ProcessLib::LIE::FracturePropertyHM>( - 0 /*fracture_id*/, - //! \ogs_file_param{prj__processes__process__HYDRO_MECHANICS_WITH_LIE__fracture_properties__material_id} - fracture_properties_config.getConfigParameter<int>("material_id"), + frac_prop = std::make_unique<ProcessLib::LIE::FractureProperty>( + 0 /*fracture_id*/, 0 /*material_id*/, ParameterLib::findParameter<double>( //! \ogs_file_param_special{prj__processes__process__HYDRO_MECHANICS_WITH_LIE__fracture_properties__initial_aperture} fracture_properties_config, "initial_aperture", parameters, 1, - &mesh), - ParameterLib::findParameter<double>( - //! \ogs_file_param_special{prj__processes__process__HYDRO_MECHANICS_WITH_LIE__fracture_properties__specific_storage} - fracture_properties_config, "specific_storage", parameters, 1, - &mesh), - ParameterLib::findParameter<double>( - //! \ogs_file_param_special{prj__processes__process__HYDRO_MECHANICS_WITH_LIE__fracture_properties__biot_coefficient} - fracture_properties_config, "biot_coefficient", parameters, 1, &mesh)); if (frac_prop->aperture0.isTimeDependent()) { @@ -280,13 +225,6 @@ std::unique_ptr<Process> createHydroMechanicsProcess( "time-dependent.", frac_prop->aperture0.name); } - - auto permeability_model_config = - //! \ogs_file_param{prj__processes__process__HYDRO_MECHANICS_WITH_LIE__fracture_properties__permeability_model} - fracture_properties_config.getConfigSubtree("permeability_model"); - frac_prop->permeability_model = - MaterialLib::Fracture::Permeability::createPermeabilityModel( - permeability_model_config); } // initial effective stress in matrix @@ -317,33 +255,59 @@ std::unique_ptr<Process> createHydroMechanicsProcess( if (deactivate_matrix_in_flow) INFO("Deactivate matrix elements in flow calculation."); - // Reference temperature - const auto& reference_temperature = - //! \ogs_file_param{prj__processes__process__HYDRO_MECHANICS_WITH_LIE__reference_temperature} - config.getConfigParameter<double>( - "reference_temperature", std::numeric_limits<double>::quiet_NaN()); - //! \ogs_file_param{prj__processes__process__HYDRO_MECHANICS_WITH_LIE__use_b_bar} auto const use_b_bar = config.getConfigParameter<bool>("use_b_bar", false); + auto media_map = + MaterialPropertyLib::createMaterialSpatialDistributionMap(media, mesh); + + std::array const requiredMediumProperties = { + MaterialPropertyLib::reference_temperature, + MaterialPropertyLib::permeability, + MaterialPropertyLib::biot_coefficient}; + std::array const requiredFluidProperties = {MaterialPropertyLib::viscosity, + MaterialPropertyLib::density}; + std::array const requiredSolidProperties = {MaterialPropertyLib::density}; + + MaterialPropertyLib::checkMPLPhasesForSinglePhaseFlow(mesh, media_map); + + for (auto const& medium : media_map.media()) + { + checkRequiredProperties(*medium, requiredMediumProperties); + checkRequiredProperties(fluidPhase(*medium), requiredFluidProperties); + checkRequiredProperties(medium->phase("Solid"), + requiredSolidProperties); + } + + // Check whether fracture permeability is given as a scalar value. + for (auto const& element_id : mesh.getElements() | MeshLib::views::ids) + { + media_map.checkElementHasMedium(element_id); + auto const& medium = *media_map.getMedium(element_id); + + // For fracture element + if (mesh.getElement(element_id)->getDimension() != GlobalDim) + { + ParameterLib::SpatialPosition x_position; + MaterialPropertyLib::VariableArray variables; + auto const permeability = + medium.property(MaterialPropertyLib::PropertyType::permeability) + .value(variables, x_position, 0.0 /*t*/, 0.0 /*dt*/); + if (!std::holds_alternative<double>(permeability)) + { + OGS_FATAL( + "The permeability model for the fracture must be " + "isotropic, and it must return a scalar value."); + } + } + } + HydroMechanicsProcessData<GlobalDim> process_data{ - materialIDs(mesh), - std::move(solid_constitutive_relations), - intrinsic_permeability, - specific_storage, - fluid_viscosity, - fluid_density, - biot_coefficient, - porosity, - solid_density, - specific_body_force, - std::move(fracture_model), - std::move(frac_prop), - initial_effective_stress, - initial_fracture_effective_stress, - deactivate_matrix_in_flow, - reference_temperature, - use_b_bar}; + materialIDs(mesh), std::move(solid_constitutive_relations), + std::move(media_map), specific_body_force, + std::move(fracture_model), std::move(frac_prop), + initial_effective_stress, initial_fracture_effective_stress, + deactivate_matrix_in_flow, use_b_bar}; SecondaryVariableCollection secondary_variables; @@ -365,7 +329,9 @@ template std::unique_ptr<Process> createHydroMechanicsProcess<2>( std::optional<ParameterLib::CoordinateSystem> const& local_coordinate_system, unsigned const integration_order, - BaseLib::ConfigTree const& config); + BaseLib::ConfigTree const& config, + std::map<int, std::shared_ptr<MaterialPropertyLib::Medium>> const& media); + template std::unique_ptr<Process> createHydroMechanicsProcess<3>( std::string const& name, MeshLib::Mesh& mesh, @@ -375,7 +341,8 @@ template std::unique_ptr<Process> createHydroMechanicsProcess<3>( std::optional<ParameterLib::CoordinateSystem> const& local_coordinate_system, unsigned const integration_order, - BaseLib::ConfigTree const& config); + BaseLib::ConfigTree const& config, + std::map<int, std::shared_ptr<MaterialPropertyLib::Medium>> const& media); } // namespace HydroMechanics } // namespace LIE diff --git a/ProcessLib/LIE/HydroMechanics/CreateHydroMechanicsProcess.h b/ProcessLib/LIE/HydroMechanics/CreateHydroMechanicsProcess.h index c3795c43471d32ec4dd299f90368e7a4f732bf52..02ce3c87434fee179e43b9c97ac87523e3b12d82 100644 --- a/ProcessLib/LIE/HydroMechanics/CreateHydroMechanicsProcess.h +++ b/ProcessLib/LIE/HydroMechanics/CreateHydroMechanicsProcess.h @@ -10,6 +10,7 @@ #pragma once +#include <map> #include <memory> #include <optional> #include <string> @@ -19,6 +20,12 @@ namespace BaseLib { class ConfigTree; } + +namespace MaterialPropertyLib +{ +class Medium; +} + namespace MeshLib { class Mesh; @@ -51,8 +58,8 @@ std::unique_ptr<Process> createHydroMechanicsProcess( std::optional<ParameterLib::CoordinateSystem> const& local_coordinate_system, unsigned const integration_order, - BaseLib::ConfigTree const& config); - + BaseLib::ConfigTree const& config, + std::map<int, std::shared_ptr<MaterialPropertyLib::Medium>> const& media); } // namespace HydroMechanics } // namespace LIE } // namespace ProcessLib diff --git a/ProcessLib/LIE/HydroMechanics/HydroMechanicsProcessData.h b/ProcessLib/LIE/HydroMechanics/HydroMechanicsProcessData.h index 09d0e506b27338f69a6b773def104ef32a435b6d..dfb508d267ab394874bdcb2b3f9e5cd31afbbb80 100644 --- a/ProcessLib/LIE/HydroMechanics/HydroMechanicsProcessData.h +++ b/ProcessLib/LIE/HydroMechanics/HydroMechanicsProcessData.h @@ -15,6 +15,7 @@ #include <utility> #include "MaterialLib/FractureModels/FractureModelBase.h" +#include "MaterialLib/MPL/MaterialSpatialDistributionMap.h" #include "MaterialLib/SolidModels/MechanicsBase.h" #include "MeshLib/ElementStatus.h" #include "MeshLib/PropertyVector.h" @@ -38,24 +39,18 @@ struct HydroMechanicsProcessData std::map<int, std::shared_ptr<MaterialLib::Solids::MechanicsBase<GlobalDim>>> solid_materials; - ParameterLib::Parameter<double> const& intrinsic_permeability; - ParameterLib::Parameter<double> const& specific_storage; - ParameterLib::Parameter<double> const& fluid_viscosity; - ParameterLib::Parameter<double> const& fluid_density; - ParameterLib::Parameter<double> const& biot_coefficient; - ParameterLib::Parameter<double> const& porosity; - ParameterLib::Parameter<double> const& solid_density; + + MaterialPropertyLib::MaterialSpatialDistributionMap media_map; + Eigen::Matrix<double, GlobalDim, 1> const specific_body_force; std::unique_ptr<MaterialLib::Fracture::FractureModelBase<GlobalDim>> fracture_model; - std::unique_ptr<FracturePropertyHM> fracture_property; + std::unique_ptr<FractureProperty> fracture_property; ParameterLib::Parameter<double> const& initial_effective_stress; ParameterLib::Parameter<double> const& initial_fracture_effective_stress; bool const deactivate_matrix_in_flow; - double const reference_temperature; - /// An indicator to use the B bar method \cite hughes1980generalization to /// tackle the volumetric locking. const bool use_b_bar; diff --git a/ProcessLib/LIE/HydroMechanics/LocalAssembler/HydroMechanicsLocalAssemblerFracture-impl.h b/ProcessLib/LIE/HydroMechanics/LocalAssembler/HydroMechanicsLocalAssemblerFracture-impl.h index 1625f43f7b221f75b5d9743a360a45762ae2e6d5..a0e9b2eb0ac12f488a7e1fd1b89112ac8efa2e16 100644 --- a/ProcessLib/LIE/HydroMechanics/LocalAssembler/HydroMechanicsLocalAssemblerFracture-impl.h +++ b/ProcessLib/LIE/HydroMechanics/LocalAssembler/HydroMechanicsLocalAssemblerFracture-impl.h @@ -10,6 +10,8 @@ #pragma once +#include <variant> + #include "HydroMechanicsLocalAssemblerFracture.h" #include "MaterialLib/FractureModels/FractureIdentity2.h" #include "MathLib/KelvinVector.h" @@ -24,6 +26,8 @@ namespace LIE { namespace HydroMechanics { +namespace MPL = MaterialPropertyLib; + template <int GlobalDim, typename RotationMatrix> Eigen::Matrix<double, GlobalDim, GlobalDim> createRotatedTensor( RotationMatrix const& R, double const value) @@ -116,9 +120,6 @@ HydroMechanicsLocalAssemblerFracture<ShapeFunctionDisplacement, ip_data.aperture0 = aperture0_node_values.dot(sm_u.N); ip_data.aperture = ip_data.aperture0; - ip_data.permeability_state = - frac_prop.permeability_model->getNewState(); - auto const initial_effective_stress = _process_data.initial_fracture_effective_stress(0, x_position); for (int i = 0; i < GlobalDim; i++) @@ -206,6 +207,14 @@ void HydroMechanicsLocalAssemblerFracture<ShapeFunctionDisplacement, ParameterLib::SpatialPosition x_position; x_position.setElementID(_element.getID()); + MPL::VariableArray variables; + auto const& medium = _process_data.media_map.getMedium(_element.getID()); + auto const& liquid_phase = medium->phase("AqueousLiquid"); + auto const T_ref = + medium->property(MPL::PropertyType::reference_temperature) + .template value<double>(variables, x_position, t, dt); + variables.temperature = T_ref; + unsigned const n_integration_points = _ip_data.size(); for (unsigned ip = 0; ip < n_integration_points; ip++) { @@ -228,10 +237,22 @@ void HydroMechanicsLocalAssemblerFracture<ShapeFunctionDisplacement, auto& state = *ip_data.material_state_variables; auto& b_m = ip_data.aperture; - double const S = frac_prop.specific_storage(t, x_position)[0]; - double const mu = _process_data.fluid_viscosity(t, x_position)[0]; - auto const alpha = frac_prop.biot_coefficient(t, x_position)[0]; - auto const rho_fr = _process_data.fluid_density(t, x_position)[0]; + auto const rho_fr = + liquid_phase.property(MPL::PropertyType::density) + .template value<double>(variables, x_position, t, dt); + variables.density = rho_fr; + + auto const alpha = + medium->property(MPL::PropertyType::biot_coefficient) + .template value<double>(variables, x_position, t, dt); + + double const S = + medium->property(MPL::PropertyType::storage) + .template value<double>(variables, x_position, t, dt); + + auto const mu = + liquid_phase.property(MPL::PropertyType::viscosity) + .template value<double>(variables, x_position, t, dt); // displacement jumps in local coordinates w.noalias() = R * H_g * g; @@ -259,15 +280,6 @@ void HydroMechanicsLocalAssemblerFracture<ShapeFunctionDisplacement, t, x_position, ip_data.aperture0, stress0, w_prev, w, effective_stress_prev, effective_stress, C, state); - auto& k = ip_data.permeability; - k = frac_prop.permeability_model->permeability( - ip_data.permeability_state.get(), ip_data.aperture0, b_m); - - // derivative of permeability respect to aperture - double const dk_db = - frac_prop.permeability_model->dpermeability_daperture( - ip_data.permeability_state.get(), ip_data.aperture0, b_m); - // // displacement equation, displacement jump part // @@ -284,26 +296,43 @@ void HydroMechanicsLocalAssemblerFracture<ShapeFunctionDisplacement, // // pressure equation, pressure part. // + + variables.fracture_aperture = b_m; + // Assume that the fracture permeability is isotropic + auto const permeability = + medium->property(MPL::PropertyType::permeability) + .value(variables, x_position, t, dt); + + auto& k = ip_data.permeability; + k = std::get<double>(permeability); + double const k_over_mu = k / mu; storage_p.noalias() += N_p.transpose() * b_m * S * N_p * ip_w; laplace_p.noalias() += - dNdx_p.transpose() * b_m * k / mu * dNdx_p * ip_w; + dNdx_p.transpose() * b_m * k_over_mu * dNdx_p * ip_w; rhs_p.noalias() += - dNdx_p.transpose() * b_m * k / mu * rho_fr * gravity_vec * ip_w; + dNdx_p.transpose() * b_m * k_over_mu * rho_fr * gravity_vec * ip_w; // // pressure equation, displacement jump part. // - GlobalDimVectorType const grad_head_over_mu = - (dNdx_p * p + rho_fr * gravity_vec) / mu; + GlobalDimVectorType const grad_head = dNdx_p * p + rho_fr * gravity_vec; Eigen::Matrix<double, 1, displacement_size> const mT_R_Hg = identity2.transpose() * R * H_g; // velocity in global coordinates - ip_data.darcy_velocity = -k * grad_head_over_mu; + ip_data.darcy_velocity = -k_over_mu * grad_head; J_pg.noalias() += N_p.transpose() * S * N_p * (p - p_prev) / dt * mT_R_Hg * ip_w; + + // derivative of permeability with respect to aperture + double const dk_db_over_mu = + medium->property(MPL::PropertyType::permeability) + .template dValue<double>(variables, + MPL::Variable::fracture_aperture, + x_position, t, dt) / + mu; J_pg.noalias() += - dNdx_p.transpose() * k * grad_head_over_mu * mT_R_Hg * ip_w; - J_pg.noalias() += dNdx_p.transpose() * b_m * dk_db * grad_head_over_mu * + dNdx_p.transpose() * k_over_mu * grad_head * mT_R_Hg * ip_w; + J_pg.noalias() += dNdx_p.transpose() * b_m * dk_db_over_mu * grad_head * mT_R_Hg * ip_w; } diff --git a/ProcessLib/LIE/HydroMechanics/LocalAssembler/HydroMechanicsLocalAssemblerMatrix-impl.h b/ProcessLib/LIE/HydroMechanics/LocalAssembler/HydroMechanicsLocalAssemblerMatrix-impl.h index 220a524ab851c93578f1f74e2ca3ac5f2dd2f803..8d977b1d6b1e834f9563204e9cfdf0606c6706cd 100644 --- a/ProcessLib/LIE/HydroMechanics/LocalAssembler/HydroMechanicsLocalAssemblerMatrix-impl.h +++ b/ProcessLib/LIE/HydroMechanics/LocalAssembler/HydroMechanicsLocalAssemblerMatrix-impl.h @@ -10,7 +10,12 @@ #pragma once +#include <limits> + #include "HydroMechanicsLocalAssemblerMatrix.h" +#include "MaterialLib/MPL/Medium.h" +#include "MaterialLib/MPL/Property.h" +#include "MaterialLib/MPL/Utils/FormEigenTensor.h" #include "MaterialLib/PhysicalConstant.h" #include "MaterialLib/SolidModels/SelectSolidConstitutiveRelation.h" #include "MathLib/KelvinVector.h" @@ -26,6 +31,8 @@ namespace LIE { namespace HydroMechanics { +namespace MPL = MaterialPropertyLib; + template <typename ShapeFunctionDisplacement, typename ShapeFunctionPressure, int GlobalDim> HydroMechanicsLocalAssemblerMatrix<ShapeFunctionDisplacement, @@ -125,8 +132,7 @@ void HydroMechanicsLocalAssemblerMatrix<ShapeFunctionDisplacement, { auto p = const_cast<Eigen::VectorXd&>(local_x).segment(pressure_index, pressure_size); - auto p_prev = const_cast<Eigen::VectorXd&>(local_x_prev) - .segment(pressure_index, pressure_size); + auto const p_prev = local_x_prev.segment(pressure_index, pressure_size); if (_process_data.deactivate_matrix_in_flow) { @@ -190,6 +196,19 @@ void HydroMechanicsLocalAssemblerMatrix<ShapeFunctionDisplacement, ParameterLib::SpatialPosition x_position; x_position.setElementID(_element.getID()); + auto const& medium = _process_data.media_map.getMedium(_element.getID()); + auto const& liquid_phase = medium->phase("AqueousLiquid"); + auto const& solid_phase = medium->phase("Solid"); + + auto const T_ref = + medium->property(MPL::PropertyType::reference_temperature) + .template value<double>(variables, x_position, t, dt); + variables.temperature = T_ref; + variables_prev.temperature = T_ref; + + bool const has_storage_property = + medium->hasProperty(MPL::PropertyType::storage); + auto const B_dil_bar = getDilatationalBBarMatrix(); unsigned const n_integration_points = _ip_data.size(); @@ -205,14 +224,18 @@ void HydroMechanicsLocalAssemblerMatrix<ShapeFunctionDisplacement, auto const& dNdx_p = ip_data.dNdx_p; auto const& H_u = ip_data.H_u; + variables.liquid_phase_pressure = N_p.dot(p); + auto const x_coord = NumLib::interpolateXCoordinate<ShapeFunctionDisplacement, ShapeMatricesTypeDisplacement>( _element, N_u); - auto const B = LinearBMatrix::computeBMatrixPossiblyWithBbar< - GlobalDim, ShapeFunctionDisplacement::NPOINTS, BBarMatrixType, - typename BMatricesType::BMatrixType>( - dNdx_u, N_u, B_dil_bar, x_coord, this->_is_axially_symmetric); + auto const B = + LinearBMatrix::computeBMatrixPossiblyWithBbar< + GlobalDim, ShapeFunctionDisplacement::NPOINTS, BBarMatrixType, + typename BMatricesType::BMatrixType>( + dNdx_u, N_u, B_dil_bar, x_coord, this->_is_axially_symmetric) + .eval(); auto const& eps_prev = ip_data.eps_prev; auto const& sigma_eff_prev = ip_data.sigma_eff_prev; @@ -221,10 +244,19 @@ void HydroMechanicsLocalAssemblerMatrix<ShapeFunctionDisplacement, auto& eps = ip_data.eps; auto& state = ip_data.material_state_variables; - auto const alpha = _process_data.biot_coefficient(t, x_position)[0]; - auto const rho_sr = _process_data.solid_density(t, x_position)[0]; - auto const rho_fr = _process_data.fluid_density(t, x_position)[0]; - auto const porosity = _process_data.porosity(t, x_position)[0]; + auto const rho_sr = + solid_phase.property(MPL::PropertyType::density) + .template value<double>(variables, x_position, t, dt); + auto const rho_fr = + liquid_phase.property(MPL::PropertyType::density) + .template value<double>(variables, x_position, t, dt); + + auto const alpha = + medium->property(MPL::PropertyType::biot_coefficient) + .template value<double>(variables, x_position, t, dt); + auto const porosity = + medium->property(MPL::PropertyType::porosity) + .template value<double>(variables, x_position, t, dt); double const rho = rho_sr * (1 - porosity) + porosity * rho_fr; auto const& identity2 = @@ -241,7 +273,7 @@ void HydroMechanicsLocalAssemblerMatrix<ShapeFunctionDisplacement, variables_prev.mechanical_strain .emplace<MathLib::KelvinVector::KelvinVectorType<GlobalDim>>( eps_prev); - variables_prev.temperature = _process_data.reference_temperature; + variables_prev.temperature = T_ref; auto&& solution = _ip_data[ip].solid_material.integrateStress( variables_prev, variables, t, x_position, dt, *state); @@ -268,10 +300,32 @@ void HydroMechanicsLocalAssemblerMatrix<ShapeFunctionDisplacement, { Kup.noalias() += B.transpose() * alpha * identity2 * N_p * ip_w; - double const k_over_mu = - _process_data.intrinsic_permeability(t, x_position)[0] / - _process_data.fluid_viscosity(t, x_position)[0]; - double const S = _process_data.specific_storage(t, x_position)[0]; + variables.density = rho_fr; + auto const mu = + liquid_phase.property(MPL::PropertyType::viscosity) + .template value<double>(variables, x_position, t, dt); + + auto const k_over_mu = + (MPL::formEigenTensor<GlobalDim>( + medium->property(MPL::PropertyType::permeability) + .value(variables, x_position, t, dt)) / + mu) + .eval(); + + double const S = + has_storage_property + ? medium->property(MPL::PropertyType::storage) + .template value<double>(variables, x_position, t, dt) + : porosity * + (liquid_phase.property(MPL::PropertyType::density) + .template dValue<double>( + variables, + MPL::Variable::liquid_phase_pressure, + x_position, t, dt) / + rho_fr) + + (porosity - alpha) * (1.0 - alpha) / + _ip_data[ip].solid_material.getBulkModulus( + t, x_position, &C); auto q = ip_data.darcy_velocity.head(GlobalDim); q.noalias() = -k_over_mu * (dNdx_p * p + rho_fr * gravity_vec); @@ -342,6 +396,15 @@ void HydroMechanicsLocalAssemblerMatrix<ShapeFunctionDisplacement, velocity_avg.setZero(); unsigned const n_integration_points = _ip_data.size(); + + auto const& medium = _process_data.media_map.getMedium(_element.getID()); + auto const& liquid_phase = medium->phase("AqueousLiquid"); + auto const T_ref = + medium->property(MPL::PropertyType::reference_temperature) + .template value<double>(variables, x_position, t, dt); + variables.temperature = T_ref; + variables_prev.temperature = T_ref; + auto const B_dil_bar = getDilatationalBBarMatrix(); for (unsigned ip = 0; ip < n_integration_points; ip++) @@ -358,16 +421,21 @@ void HydroMechanicsLocalAssemblerMatrix<ShapeFunctionDisplacement, auto& state = ip_data.material_state_variables; auto const& N_u = ip_data.N_u; + auto const& N_p = ip_data.N_p; auto const& dNdx_u = ip_data.dNdx_u; + variables.liquid_phase_pressure = N_p.dot(p); + auto const x_coord = NumLib::interpolateXCoordinate<ShapeFunctionDisplacement, ShapeMatricesTypeDisplacement>( _element, N_u); - auto const B = LinearBMatrix::computeBMatrixPossiblyWithBbar< - GlobalDim, ShapeFunctionDisplacement::NPOINTS, BBarMatrixType, - typename BMatricesType::BMatrixType>( - dNdx_u, N_u, B_dil_bar, x_coord, this->_is_axially_symmetric); + auto const B = + LinearBMatrix::computeBMatrixPossiblyWithBbar< + GlobalDim, ShapeFunctionDisplacement::NPOINTS, BBarMatrixType, + typename BMatricesType::BMatrixType>( + dNdx_u, N_u, B_dil_bar, x_coord, this->_is_axially_symmetric) + .eval(); eps.noalias() = B * u; @@ -380,7 +448,6 @@ void HydroMechanicsLocalAssemblerMatrix<ShapeFunctionDisplacement, variables_prev.mechanical_strain .emplace<MathLib::KelvinVector::KelvinVectorType<GlobalDim>>( eps_prev); - variables_prev.temperature = _process_data.reference_temperature; auto&& solution = _ip_data[ip].solid_material.integrateStress( variables_prev, variables, t, x_position, dt, *state); @@ -398,16 +465,27 @@ void HydroMechanicsLocalAssemblerMatrix<ShapeFunctionDisplacement, if (!_process_data.deactivate_matrix_in_flow) // Only for hydraulically // active matrix { - double const k_over_mu = - _process_data.intrinsic_permeability(t, x_position)[0] / - _process_data.fluid_viscosity(t, x_position)[0]; - auto const rho_fr = _process_data.fluid_density(t, x_position)[0]; + auto const rho_fr = + liquid_phase.property(MPL::PropertyType::density) + .template value<double>(variables, x_position, t, dt); + variables.density = rho_fr; + auto const mu = + liquid_phase.property(MPL::PropertyType::viscosity) + .template value<double>(variables, x_position, t, dt); + + auto const k = MPL::formEigenTensor<GlobalDim>( + medium->property(MPL::PropertyType::permeability) + .value(variables, x_position, t, dt)) + .eval(); + + GlobalDimMatrixType const k_over_mu = k / mu; + auto const& gravity_vec = _process_data.specific_body_force; auto const& dNdx_p = ip_data.dNdx_p; ip_data.darcy_velocity.head(GlobalDim).noalias() = -k_over_mu * (dNdx_p * p + rho_fr * gravity_vec); - velocity_avg += ip_data.darcy_velocity.head(GlobalDim); + velocity_avg.noalias() += ip_data.darcy_velocity.head(GlobalDim); } } diff --git a/ProcessLib/LIE/HydroMechanics/LocalAssembler/HydroMechanicsLocalAssemblerMatrix.h b/ProcessLib/LIE/HydroMechanics/LocalAssembler/HydroMechanicsLocalAssemblerMatrix.h index ce522b8db72a5606023c5a813cc5f8d0199366c6..a77947978a70165a9756c91e4805b58fe18827e4 100644 --- a/ProcessLib/LIE/HydroMechanics/LocalAssembler/HydroMechanicsLocalAssemblerMatrix.h +++ b/ProcessLib/LIE/HydroMechanics/LocalAssembler/HydroMechanicsLocalAssemblerMatrix.h @@ -171,6 +171,8 @@ protected: IntegrationPointDataMatrix<BMatricesType, ShapeMatricesTypeDisplacement, ShapeMatricesTypePressure, GlobalDim, ShapeFunctionDisplacement::NPOINTS>; + using GlobalDimMatrixType = + typename ShapeMatricesTypePressure::GlobalDimMatrixType; using GlobalDimVector = Eigen::Matrix<double, GlobalDim, 1>; diff --git a/ProcessLib/LIE/HydroMechanics/LocalAssembler/IntegrationPointDataFracture.h b/ProcessLib/LIE/HydroMechanics/LocalAssembler/IntegrationPointDataFracture.h index 5234a9538c3b7c953b217dedeb7188fecfb923fe..9c24fa8760b2291df6374880d2763205e6fcb7e6 100644 --- a/ProcessLib/LIE/HydroMechanics/LocalAssembler/IntegrationPointDataFracture.h +++ b/ProcessLib/LIE/HydroMechanics/LocalAssembler/IntegrationPointDataFracture.h @@ -51,10 +51,6 @@ struct IntegrationPointDataFracture final GlobalDim>::MaterialStateVariables> material_state_variables; - std::unique_ptr< - typename MaterialLib::Fracture::Permeability::PermeabilityState> - permeability_state; - Eigen::MatrixXd C; double integration_weight; diff --git a/ProcessLib/LIE/HydroMechanics/LocalAssembler/IntegrationPointDataMatrix.h b/ProcessLib/LIE/HydroMechanics/LocalAssembler/IntegrationPointDataMatrix.h index 083da8852747f098d43229df07b4757b8d5ea44b..395d7d86259d5ca792bb4b5dcd3d6f71b819b7c7 100644 --- a/ProcessLib/LIE/HydroMechanics/LocalAssembler/IntegrationPointDataMatrix.h +++ b/ProcessLib/LIE/HydroMechanics/LocalAssembler/IntegrationPointDataMatrix.h @@ -47,6 +47,9 @@ struct IntegrationPointDataMatrix final typename ShapeMatrixTypePressure::NodalRowVectorType N_p; typename ShapeMatrixTypePressure::GlobalDimNodalMatrixType dNdx_p; + using GlobalDimVectorType = + typename ShapeMatrixTypePressure::GlobalDimVectorType; + MaterialLib::Solids::MechanicsBase<GlobalDim>& solid_material; std::unique_ptr<typename MaterialLib::Solids::MechanicsBase< GlobalDim>::MaterialStateVariables> @@ -55,7 +58,7 @@ struct IntegrationPointDataMatrix final typename BMatricesType::KelvinMatrixType C; double integration_weight; - GlobalDimVector darcy_velocity; + GlobalDimVectorType darcy_velocity; void pushBackState() { diff --git a/Tests/Data/LIE/HydroMechanics/GreatCellWithBBar/point_injection_embedded_fracture_F.prj b/Tests/Data/LIE/HydroMechanics/GreatCellWithBBar/point_injection_embedded_fracture_F.prj index 6af1546001cb5b05dbc85a617fc8d0f9a2733956..7147657cecf18104b6d615d59cea2f3546a9f16b 100644 --- a/Tests/Data/LIE/HydroMechanics/GreatCellWithBBar/point_injection_embedded_fracture_F.prj +++ b/Tests/Data/LIE/HydroMechanics/GreatCellWithBBar/point_injection_embedded_fracture_F.prj @@ -1,4 +1,4 @@ -<?xml version='1.0' encoding='ISO-8859-1'?> +<?xml version="1.0" encoding="ISO-8859-1"?> <OpenGeoSysProject> <meshes> <mesh>2d_mesh.vtu</mesh> @@ -70,13 +70,6 @@ <secondary_variable internal_name="fracture_stress" output_name="fracture_stress"/> <secondary_variable internal_name="fracture_velocity" output_name="fracture_velocity"/> </secondary_variables> - <intrinsic_permeability>k</intrinsic_permeability> - <specific_storage>S</specific_storage> - <fluid_viscosity>mu</fluid_viscosity> - <biot_coefficient>biot_m</biot_coefficient> - <porosity>phi</porosity> - <solid_density>rho_sr</solid_density> - <fluid_density>rho_fr</fluid_density> <initial_effective_stress>effective_stress0</initial_effective_stress> <fracture_model> <type>LinearElasticIsotropic</type> @@ -86,13 +79,7 @@ <tension_cutoff>1</tension_cutoff> </fracture_model> <fracture_properties> - <material_id>2</material_id> <initial_aperture>aperture0</initial_aperture> - <specific_storage>S_f</specific_storage> - <biot_coefficient>biot_f</biot_coefficient> - <permeability_model> - <type>CubicLaw</type> - </permeability_model> </fracture_properties> <deactivate_matrix_in_flow>true</deactivate_matrix_in_flow> <initial_fracture_effective_stress>fracture_effective_stress0</initial_fracture_effective_stress> @@ -149,6 +136,170 @@ </timesteps> </output> </time_loop> + <media> + <medium id="0"> + <phases> + <phase> + <type>AqueousLiquid</type> + <properties> + <property> + <name>viscosity</name> + <type>Parameter</type> + <parameter_name>mu</parameter_name> + </property> + <property> + <name>density</name> + <type>Parameter</type> + <parameter_name>rho_fr</parameter_name> + </property> + </properties> + </phase> + <phase> + <type>Solid</type> + <properties> + <property> + <name>density</name> + <type>Parameter</type> + <parameter_name>rho_sr</parameter_name> + </property> + </properties> + </phase> + </phases> + <properties> + <property> + <name>permeability</name> + <type>Parameter</type> + <parameter_name>k</parameter_name> + </property> + <property> + <name>porosity</name> + <type>Parameter</type> + <parameter_name>phi</parameter_name> + </property> + <property> + <name>storage</name> + <type>Parameter</type> + <parameter_name>S</parameter_name> + </property> + <property> + <name>biot_coefficient</name> + <type>Parameter</type> + <parameter_name>biot_m</parameter_name> + </property> + <property> + <name>reference_temperature</name> + <type>Constant</type> + <value>293.15</value> + </property> + </properties> + </medium> + <medium id="1"> + <phases> + <phase> + <type>AqueousLiquid</type> + <properties> + <property> + <name>viscosity</name> + <type>Parameter</type> + <parameter_name>mu</parameter_name> + </property> + <property> + <name>density</name> + <type>Parameter</type> + <parameter_name>rho_fr</parameter_name> + </property> + </properties> + </phase> + <phase> + <type>Solid</type> + <properties> + <property> + <name>density</name> + <type>Parameter</type> + <parameter_name>rho_sr</parameter_name> + </property> + </properties> + </phase> + </phases> + <properties> + <property> + <name>permeability</name> + <type>Parameter</type> + <parameter_name>k</parameter_name> + </property> + <property> + <name>porosity</name> + <type>Parameter</type> + <parameter_name>phi</parameter_name> + </property> + <property> + <name>storage</name> + <type>Parameter</type> + <parameter_name>S</parameter_name> + </property> + <property> + <name>biot_coefficient</name> + <type>Parameter</type> + <parameter_name>biot_m</parameter_name> + </property> + <property> + <name>reference_temperature</name> + <type>Constant</type> + <value>293.15</value> + </property> + </properties> + </medium> + <medium id="2"> + <phases> + <phase> + <type>AqueousLiquid</type> + <properties> + <property> + <name>viscosity</name> + <type>Parameter</type> + <parameter_name>mu</parameter_name> + </property> + <property> + <name>density</name> + <type>Parameter</type> + <parameter_name>rho_fr</parameter_name> + </property> + </properties> + </phase> + <phase> + <type>Solid</type> + <properties> + <property> + <name>density</name> + <type>Parameter</type> + <parameter_name>rho_sr</parameter_name> + </property> + </properties> + </phase> + </phases> + <properties> + <property> + <name>permeability</name> + <type>CubicLawPermeability</type> + </property> + <property> + <name>storage</name> + <type>Parameter</type> + <parameter_name>S_f</parameter_name> + </property> + <property> + <name>biot_coefficient</name> + <type>Parameter</type> + <parameter_name>biot_f</parameter_name> + </property> + <property> + <name>reference_temperature</name> + <type>Constant</type> + <value>293.15</value> + </property> + </properties> + </medium> + </media> <parameters> <parameter> <name>E1</name> diff --git a/Tests/Data/LIE/HydroMechanics/GreatCellWithTrianglularMesh/great_cell_2d_HM_LIE_embedded_fracture.prj b/Tests/Data/LIE/HydroMechanics/GreatCellWithTrianglularMesh/great_cell_2d_HM_LIE_embedded_fracture.prj index 7f7da5c14d89e6fa6089d36270882b7531b46800..c963d0fc49339ea9911b0968aa683f5d89c1bcfe 100644 --- a/Tests/Data/LIE/HydroMechanics/GreatCellWithTrianglularMesh/great_cell_2d_HM_LIE_embedded_fracture.prj +++ b/Tests/Data/LIE/HydroMechanics/GreatCellWithTrianglularMesh/great_cell_2d_HM_LIE_embedded_fracture.prj @@ -1,4 +1,4 @@ -<?xml version='1.0' encoding='ISO-8859-1'?> +<?xml version="1.0" encoding="ISO-8859-1"?> <OpenGeoSysProject> <meshes> <mesh>2d_mesh.vtu</mesh> @@ -39,7 +39,7 @@ <mesh>2D_p_top.vtu</mesh> <mesh>2D_p_bottom.vtu</mesh> <mesh>2D_injection_position.vtu</mesh> - <mesh>2D_outflow_position.vtu</mesh> + <mesh>2D_outflow_position.vtu</mesh> </meshes> <processes> <process> @@ -71,13 +71,6 @@ <secondary_variable internal_name="fracture_stress" output_name="fracture_stress"/> <secondary_variable internal_name="fracture_velocity" output_name="fracture_velocity"/> </secondary_variables> - <intrinsic_permeability>k</intrinsic_permeability> - <specific_storage>S</specific_storage> - <fluid_viscosity>mu</fluid_viscosity> - <biot_coefficient>biot_m</biot_coefficient> - <porosity>phi</porosity> - <solid_density>rho_sr</solid_density> - <fluid_density>rho_fr</fluid_density> <initial_effective_stress>effective_stress0</initial_effective_stress> <fracture_model> <type>LinearElasticIsotropic</type> @@ -87,13 +80,7 @@ <tension_cutoff>1</tension_cutoff> </fracture_model> <fracture_properties> - <material_id>2</material_id> <initial_aperture>aperture0</initial_aperture> - <specific_storage>S_f</specific_storage> - <biot_coefficient>biot_f</biot_coefficient> - <permeability_model> - <type>CubicLaw</type> - </permeability_model> </fracture_properties> <deactivate_matrix_in_flow>true</deactivate_matrix_in_flow> <initial_fracture_effective_stress>fracture_effective_stress0</initial_fracture_effective_stress> @@ -150,6 +137,170 @@ </timesteps> </output> </time_loop> + <media> + <medium id="0"> + <phases> + <phase> + <type>AqueousLiquid</type> + <properties> + <property> + <name>viscosity</name> + <type>Parameter</type> + <parameter_name>mu</parameter_name> + </property> + <property> + <name>density</name> + <type>Parameter</type> + <parameter_name>rho_fr</parameter_name> + </property> + </properties> + </phase> + <phase> + <type>Solid</type> + <properties> + <property> + <name>density</name> + <type>Parameter</type> + <parameter_name>rho_sr</parameter_name> + </property> + </properties> + </phase> + </phases> + <properties> + <property> + <name>permeability</name> + <type>Parameter</type> + <parameter_name>k</parameter_name> + </property> + <property> + <name>porosity</name> + <type>Parameter</type> + <parameter_name>phi</parameter_name> + </property> + <property> + <name>storage</name> + <type>Parameter</type> + <parameter_name>S</parameter_name> + </property> + <property> + <name>biot_coefficient</name> + <type>Parameter</type> + <parameter_name>biot_m</parameter_name> + </property> + <property> + <name>reference_temperature</name> + <type>Constant</type> + <value>293.15</value> + </property> + </properties> + </medium> + <medium id="1"> + <phases> + <phase> + <type>AqueousLiquid</type> + <properties> + <property> + <name>viscosity</name> + <type>Parameter</type> + <parameter_name>mu</parameter_name> + </property> + <property> + <name>density</name> + <type>Parameter</type> + <parameter_name>rho_fr</parameter_name> + </property> + </properties> + </phase> + <phase> + <type>Solid</type> + <properties> + <property> + <name>density</name> + <type>Parameter</type> + <parameter_name>rho_sr</parameter_name> + </property> + </properties> + </phase> + </phases> + <properties> + <property> + <name>permeability</name> + <type>Parameter</type> + <parameter_name>k</parameter_name> + </property> + <property> + <name>porosity</name> + <type>Parameter</type> + <parameter_name>phi</parameter_name> + </property> + <property> + <name>storage</name> + <type>Parameter</type> + <parameter_name>S</parameter_name> + </property> + <property> + <name>biot_coefficient</name> + <type>Parameter</type> + <parameter_name>biot_m</parameter_name> + </property> + <property> + <name>reference_temperature</name> + <type>Constant</type> + <value>293.15</value> + </property> + </properties> + </medium> + <medium id="2"> + <phases> + <phase> + <type>AqueousLiquid</type> + <properties> + <property> + <name>viscosity</name> + <type>Parameter</type> + <parameter_name>mu</parameter_name> + </property> + <property> + <name>density</name> + <type>Parameter</type> + <parameter_name>rho_fr</parameter_name> + </property> + </properties> + </phase> + <phase> + <type>Solid</type> + <properties> + <property> + <name>density</name> + <type>Parameter</type> + <parameter_name>rho_sr</parameter_name> + </property> + </properties> + </phase> + </phases> + <properties> + <property> + <name>permeability</name> + <type>CubicLawPermeability</type> + </property> + <property> + <name>storage</name> + <type>Parameter</type> + <parameter_name>S_f</parameter_name> + </property> + <property> + <name>biot_coefficient</name> + <type>Parameter</type> + <parameter_name>biot_f</parameter_name> + </property> + <property> + <name>reference_temperature</name> + <type>Constant</type> + <value>293.15</value> + </property> + </properties> + </medium> + </media> <parameters> <parameter> <name>E1</name> @@ -205,7 +356,7 @@ <parameter> <name>biot_m</name> <type>Constant</type> - <value>0.005</value> + <value>0.005</value> </parameter> <!-- Fracture properties --> <parameter> @@ -220,7 +371,7 @@ </parameter> <parameter> <name>S_f</name> - <type>Constant</type> + <type>Constant</type> <value>1e-11</value> </parameter> <parameter> @@ -253,7 +404,7 @@ <name>p0</name> <type>Constant</type> <value>2.0e6</value> - </parameter> + </parameter> <!-- BC --> <parameter> <name>p_down_stream</name> @@ -265,14 +416,12 @@ <type>Constant</type> <value>4.167e-7</value> </parameter> - <parameter> <name>p_injection_ramp</name> <type>CurveScaled</type> <curve>timeRamp</curve> <parameter>p_injection_rate</parameter> </parameter> - <parameter> <name>u0</name> <type>Constant</type> diff --git a/Tests/Data/LIE/HydroMechanics/TaskB.prj b/Tests/Data/LIE/HydroMechanics/TaskB.prj index 00327e78cf2ee879143c481c65cbc7021a2e5a8b..bd8766965a4bdeba12d0acf71faac0b95e383adf 100644 --- a/Tests/Data/LIE/HydroMechanics/TaskB.prj +++ b/Tests/Data/LIE/HydroMechanics/TaskB.prj @@ -17,13 +17,6 @@ <youngs_modulus>E</youngs_modulus> <poissons_ratio>nu</poissons_ratio> </constitutive_relation> - <intrinsic_permeability>k</intrinsic_permeability> - <specific_storage>S</specific_storage> - <fluid_viscosity>mu</fluid_viscosity> - <biot_coefficient>biot_m</biot_coefficient> - <porosity>phi</porosity> - <solid_density>rho_sr</solid_density> - <fluid_density>rho_fr</fluid_density> <specific_body_force>0 0</specific_body_force> <initial_effective_stress>effective_stress0</initial_effective_stress> <initial_fracture_effective_stress>fracture_effective_stress0</initial_fracture_effective_stress> @@ -36,13 +29,7 @@ <tension_cutoff>1</tension_cutoff> </fracture_model> <fracture_properties> - <material_id>1</material_id> <initial_aperture>aperture0</initial_aperture> - <specific_storage>S_f</specific_storage> - <biot_coefficient>biot_f</biot_coefficient> - <permeability_model> - <type>CubicLaw</type> - </permeability_model> </fracture_properties> <secondary_variables> <secondary_variable internal_name="sigma" output_name="sigma" /> @@ -120,6 +107,119 @@ <suffix>_ts_{:timestep}_t_{:time}</suffix> </output> </time_loop> + <media> + <medium id="0"> + <phases> + <phase> + <type>AqueousLiquid</type> + <properties> + <property> + <name>viscosity</name> + <type>Parameter</type> + <parameter_name>mu</parameter_name> + </property> + <property> + <name>density</name> + <type>Parameter</type> + <parameter_name>rho_fr</parameter_name> + </property> + </properties> + </phase> + <phase> + <type>Solid</type> + <properties> + <property> + <name>density</name> + <type>Parameter</type> + <parameter_name>rho_sr</parameter_name> + </property> + </properties> + </phase> + </phases> + <properties> + <property> + <name>permeability</name> + <type>Parameter</type> + <parameter_name>k</parameter_name> + </property> + <property> + <name>reference_temperature</name> + <type>Constant</type> + <value>293.15</value> + </property> + <property> + <name>porosity</name> + <type>Parameter</type> + <parameter_name>phi</parameter_name> + </property> + <property> + <name>storage</name> + <type>Parameter</type> + <parameter_name>S</parameter_name> + </property> + <property> + <name>biot_coefficient</name> + <type>Parameter</type> + <parameter_name>biot_m</parameter_name> + </property> + </properties> + </medium> + <medium id="1"> + <phases> + <phase> + <type>AqueousLiquid</type> + <properties> + <property> + <name>viscosity</name> + <type>Parameter</type> + <parameter_name>mu</parameter_name> + </property> + <property> + <name>density</name> + <type>Parameter</type> + <parameter_name>rho_fr</parameter_name> + </property> + </properties> + </phase> + <phase> + <type>Solid</type> + <properties> + <property> + <name>density</name> + <type>Parameter</type> + <parameter_name>rho_sr</parameter_name> + </property> + </properties> + </phase> + </phases> + <properties> + <property> + <name>permeability</name> + <type>CubicLawPermeability</type> + </property> + <property> + <name>reference_temperature</name> + <type>Constant</type> + <value>293.15</value> + </property> + <property> + <name>porosity</name> + <type>Constant</type> + <value>0.0</value> + </property> + <property> + <name>storage</name> + <type>Parameter</type> + <parameter_name>S_f</parameter_name> + </property> + <property> + <name>biot_coefficient</name> + <type>Parameter</type> + <parameter_name>biot_f</parameter_name> + </property> + </properties> + </medium> + </media> <parameters> <!-- Fluid phase properties --> <parameter> diff --git a/Tests/Data/LIE/HydroMechanics/convert_LIE_HM2MPL.py b/Tests/Data/LIE/HydroMechanics/convert_LIE_HM2MPL.py new file mode 100644 index 0000000000000000000000000000000000000000..47b9674120af51ae8e2d1b359d227d3be40ceb02 --- /dev/null +++ b/Tests/Data/LIE/HydroMechanics/convert_LIE_HM2MPL.py @@ -0,0 +1,271 @@ +import sys +import xml.etree.ElementTree as ET +from pathlib import Path +from xml.dom import minidom + + +def add_parameter_property(properties, name_, parameter_name): + new_property = ET.SubElement(properties, "property") + ET.SubElement(new_property, "name").text = name_ + ET.SubElement(new_property, "type").text = "Parameter" + ET.SubElement(new_property, "parameter_name").text = parameter_name + + +def add_liquid_phase(phases, parameter_name_viscosity, parameter_name_density): + phase = ET.SubElement(phases, "phase") + ET.SubElement(phase, "type").text = "AqueousLiquid" + properties = ET.SubElement(phase, "properties") + + add_parameter_property(properties, "viscosity", parameter_name_viscosity) + add_parameter_property(properties, "density", parameter_name_density) + + +def add_solid_phase(phases, parameter_name_density): + phase = ET.SubElement(phases, "phase") + ET.SubElement(phase, "type").text = "Solid" + properties = ET.SubElement(phase, "properties") + + add_parameter_property(properties, "density", parameter_name_density) + + +def add_medium_properties_common(properties, storage_parameter, biot_parameter): + add_parameter_property(properties, "storage", storage_parameter) + add_parameter_property(properties, "biot_coefficient", biot_parameter) + + property_T = ET.SubElement(properties, "property") + ET.SubElement(property_T, "name").text = "reference_temperature" + ET.SubElement(property_T, "type").text = "Constant" + ET.SubElement(property_T, "value").text = "293.15" + + +def add_medium_properties_matrix( + medium, + storage_parameter, + biot_parameter, + permeability_parameter, + porosity_parameter, +): + properties = ET.SubElement(medium, "properties") + add_parameter_property(properties, "permeability", permeability_parameter) + add_parameter_property(properties, "porosity", porosity_parameter) + + add_medium_properties_common(properties, storage_parameter, biot_parameter) + + +def add_medium_properties_fracture( + medium, storage_parameter, biot_parameter, permeability_parameter +): + properties = ET.SubElement(medium, "properties") + property_kf = ET.SubElement(properties, "property") + ET.SubElement(property_kf, "name").text = "permeability" + if permeability_parameter == "0.0": + ET.SubElement(property_kf, "type").text = "CubicLawPermeability" + else: + ET.SubElement(property_kf, "type").text = "Constant" + ET.SubElement(property_kf, "value").text = permeability_parameter + + add_medium_properties_common(properties, storage_parameter, biot_parameter) + + +def add_matrix_medium( + media, + mat_id, + k_m_tag, + S_m_tag, + biot_m_tag, + phi_m_tag, + mu_tag, + rho_fr_tag, + rho_sr_tag, +): + medium = ET.SubElement(media, "medium", id=mat_id) + phases = ET.SubElement(medium, "phases") + + add_liquid_phase(phases, mu_tag.text, rho_fr_tag.text) + + add_solid_phase(phases, rho_sr_tag.text) + + add_medium_properties_matrix( + medium, + storage_parameter=S_m_tag.text, + biot_parameter=biot_m_tag.text, + permeability_parameter=k_m_tag.text, + porosity_parameter=phi_m_tag.text, + ) + + +def add_fracture_medium( + media, + mat_id, + if_constant_permeability, + fracture_props_tag, + mu_tag, + rho_fr_tag, + rho_sr_tag, +): + medium = ET.SubElement(media, "medium", id=mat_id) + phases = ET.SubElement(medium, "phases") + + add_liquid_phase(phases, mu_tag.text, rho_fr_tag.text) + add_solid_phase(phases, rho_sr_tag.text) + + S_f_tag = fracture_props_tag.find("specific_storage") + fracture_props_tag.remove(S_f_tag) + b_f_tag = fracture_props_tag.find("biot_coefficient") + fracture_props_tag.remove(b_f_tag) + k_f_tag = fracture_props_tag.find("permeability_model") + fracture_props_tag.remove(k_f_tag) + + add_medium_properties_fracture( + medium, + storage_parameter=S_f_tag.text, + biot_parameter=b_f_tag.text, + permeability_parameter=if_constant_permeability, + ) + + +def prettify(elem): + """Return a pretty-printed XML string for the Element without extra blank lines.""" + encoding = "ISO-8859-1" + rough_string = ET.tostring(elem, encoding=encoding) + reparsed = minidom.parseString(rough_string) + pretty_xml = reparsed.toprettyxml(indent=" ", encoding=encoding) + + pretty_xml_decode = pretty_xml.decode(encoding) + # Remove extra blank lines + return "\n".join([line for line in pretty_xml_decode.splitlines() if line.strip()]) + + +def insert_media_tags_after_time_loop(input_file, output_file): + parser = ET.XMLParser(target=ET.TreeBuilder(insert_comments=True)) + tree = ET.parse(input_file, parser=parser) + root = tree.getroot() + + if root.find(".//media") is not None: + print(f"The project file {input_file} has already been processed") + return False + + process_tag = root.find(".//processes/process") + mu_tag = process_tag.find("fluid_viscosity") + process_tag.remove(mu_tag) + rho_fr_tag = process_tag.find("fluid_density") + process_tag.remove(rho_fr_tag) + rho_sr_tag = process_tag.find("solid_density") + process_tag.remove(rho_sr_tag) + + k_m_tag = process_tag.find("intrinsic_permeability") + process_tag.remove(k_m_tag) + S_m_tag = process_tag.find("specific_storage") + process_tag.remove(S_m_tag) + biot_m_tag = process_tag.find("biot_coefficient") + process_tag.remove(biot_m_tag) + phi_m_tag = process_tag.find("porosity") + process_tag.remove(phi_m_tag) + + constitutive_relation_tags = process_tag.findall("constitutive_relation") + + matrix_ids = [] + if len(constitutive_relation_tags) > 1: + for tag in constitutive_relation_tags: + matrix_ids.append(tag.attrib["id"]) + else: + matrix_ids.append("0") + + fracture_props_tag = process_tag.find("fracture_properties") + fracture_id_tag = fracture_props_tag.find("material_id") + fracture_id = fracture_id_tag.text + if len(matrix_ids) > 1: + if fracture_id in matrix_ids: + print( + f"The fracture material id {fracture_id} is the same as one" + "of one matrix material IDs." + ) + else: + if int(fracture_id) == 0: + matrix_ids[0] = "1" + fracture_id = "0" + fracture_props_tag.remove(fracture_id_tag) + + time_loop = root.find(".//time_loop") + + if time_loop is None: + print("<time_loop> tag not found in the project file.") + return False + + # Create the new <media> structure + media = ET.Element("media") + + # Matrix medium + for matrix_id in matrix_ids: + add_matrix_medium( + media, + matrix_id, + k_m_tag, + S_m_tag, + biot_m_tag, + phi_m_tag, + mu_tag, + rho_fr_tag, + rho_sr_tag, + ) + + # Fracture medium + fracture_permeability_tag = fracture_props_tag.find("permeability_model") + fracture_permeability_type = fracture_permeability_tag.find("type").text + const_k_f = ( + fracture_permeability_tag.find("value").text + if fracture_permeability_type == "ConstantPermeability" + else "0.0" + ) + + add_fracture_medium( + media, + fracture_id, + const_k_f, + fracture_props_tag, + mu_tag, + rho_fr_tag, + rho_sr_tag, + ) + + # Insert the <media> element after <time_loop> + parent = root + index = list(parent).index(time_loop) + parent.insert(index + 1, media) + + with Path(output_file).open("w") as f: + f.write(prettify(root)) + f.write("\n") + + return True + + +def main(): + if "--help" in sys.argv: + print( + "This script converts the LIE_HM project file to the new " + "output syntax for MPL properties." + ) + print("Usage: convert_LIE_HM2MPL.py <input_file> <output_file>") + return + + if len(sys.argv) != 3: + print("Usage: convert_LIE_HM2MPL <input_file> <output_file>") + return + + input_file = sys.argv[1] + output_file = sys.argv[2] + + try: + status = insert_media_tags_after_time_loop(input_file, output_file) + if status: + print("The conversion succeeds!") + + except FileNotFoundError: + print(f"Error: The file {input_file} is not found") + except Exception as e: + print(f"An error occurred: {e}") + + +if __name__ == "__main__": + main() diff --git a/Tests/Data/LIE/HydroMechanics/single_fracture.prj b/Tests/Data/LIE/HydroMechanics/single_fracture.prj index 8a32d24596216fc54d16033e0a9ab0200515780b..2bc05171821e6ad2c9c9a66c062502149fb2df03 100644 --- a/Tests/Data/LIE/HydroMechanics/single_fracture.prj +++ b/Tests/Data/LIE/HydroMechanics/single_fracture.prj @@ -1,4 +1,4 @@ -<?xml version='1.0' encoding='ISO-8859-1'?> +<?xml version="1.0" encoding="ISO-8859-1"?> <OpenGeoSysProject> <mesh>single_fracture.vtu</mesh> <geometry>single_fracture.gml</geometry> @@ -17,13 +17,6 @@ <youngs_modulus>E</youngs_modulus> <poissons_ratio>nu</poissons_ratio> </constitutive_relation> - <intrinsic_permeability>k</intrinsic_permeability> - <specific_storage>S</specific_storage> - <fluid_viscosity>mu</fluid_viscosity> - <biot_coefficient>biot_m</biot_coefficient> - <porosity>phi</porosity> - <solid_density>rho_sr</solid_density> - <fluid_density>rho_fr</fluid_density> <specific_body_force>0 0</specific_body_force> <initial_effective_stress>effective_stress0</initial_effective_stress> <fracture_model> @@ -34,23 +27,17 @@ <tension_cutoff>1</tension_cutoff> </fracture_model> <fracture_properties> - <material_id>0</material_id> <initial_aperture>aperture0</initial_aperture> - <specific_storage>S_f</specific_storage> - <biot_coefficient>biot_f</biot_coefficient> - <permeability_model> - <type>CubicLaw</type> - </permeability_model> </fracture_properties> <initial_fracture_effective_stress>fracture_effective_stress0</initial_fracture_effective_stress> <secondary_variables> - <secondary_variable internal_name="sigma" output_name="sigma" /> - <secondary_variable internal_name="epsilon" output_name="epsilon" /> - <secondary_variable internal_name="velocity" output_name="velocity" /> - <secondary_variable internal_name="fracture_velocity" output_name="fracture_velocity" /> - <secondary_variable internal_name="fracture_permeability" output_name="fracture_permeability" /> - <secondary_variable internal_name="fracture_stress" output_name="fracture_stress" /> - <secondary_variable internal_name="fracture_aperture" output_name="fracture_aperture" /> + <secondary_variable internal_name="sigma" output_name="sigma"/> + <secondary_variable internal_name="epsilon" output_name="epsilon"/> + <secondary_variable internal_name="velocity" output_name="velocity"/> + <secondary_variable internal_name="fracture_velocity" output_name="fracture_velocity"/> + <secondary_variable internal_name="fracture_permeability" output_name="fracture_permeability"/> + <secondary_variable internal_name="fracture_stress" output_name="fracture_stress"/> + <secondary_variable internal_name="fracture_aperture" output_name="fracture_aperture"/> </secondary_variables> </process> </processes> @@ -114,6 +101,114 @@ <suffix>_ts_{:timestep}_t_{:time}</suffix> </output> </time_loop> + <media> + <medium id="1"> + <phases> + <phase> + <type>AqueousLiquid</type> + <properties> + <property> + <name>viscosity</name> + <type>Parameter</type> + <parameter_name>mu</parameter_name> + </property> + <property> + <name>density</name> + <type>Parameter</type> + <parameter_name>rho_fr</parameter_name> + </property> + </properties> + </phase> + <phase> + <type>Solid</type> + <properties> + <property> + <name>density</name> + <type>Parameter</type> + <parameter_name>rho_sr</parameter_name> + </property> + </properties> + </phase> + </phases> + <properties> + <property> + <name>permeability</name> + <type>Parameter</type> + <parameter_name>k</parameter_name> + </property> + <property> + <name>porosity</name> + <type>Parameter</type> + <parameter_name>phi</parameter_name> + </property> + <property> + <name>storage</name> + <type>Parameter</type> + <parameter_name>S</parameter_name> + </property> + <property> + <name>biot_coefficient</name> + <type>Parameter</type> + <parameter_name>biot_m</parameter_name> + </property> + <property> + <name>reference_temperature</name> + <type>Constant</type> + <value>293.15</value> + </property> + </properties> + </medium> + <medium id="0"> + <phases> + <phase> + <type>AqueousLiquid</type> + <properties> + <property> + <name>viscosity</name> + <type>Parameter</type> + <parameter_name>mu</parameter_name> + </property> + <property> + <name>density</name> + <type>Parameter</type> + <parameter_name>rho_fr</parameter_name> + </property> + </properties> + </phase> + <phase> + <type>Solid</type> + <properties> + <property> + <name>density</name> + <type>Parameter</type> + <parameter_name>rho_sr</parameter_name> + </property> + </properties> + </phase> + </phases> + <properties> + <property> + <name>permeability</name> + <type>CubicLawPermeability</type> + </property> + <property> + <name>storage</name> + <type>Parameter</type> + <parameter_name>S_f</parameter_name> + </property> + <property> + <name>biot_coefficient</name> + <type>Parameter</type> + <parameter_name>biot_f</parameter_name> + </property> + <property> + <name>reference_temperature</name> + <type>Constant</type> + <value>293.15</value> + </property> + </properties> + </medium> + </media> <parameters> <!-- Fluid phase properties --> <parameter> diff --git a/Tests/Data/LIE/HydroMechanics/single_fracture_3D.prj b/Tests/Data/LIE/HydroMechanics/single_fracture_3D.prj index 5836e3f7c063fb3d804bb12c7203bacee6a4e4c2..f0ed314c71c65e3f7b52df73ebc1dd3a0f4cbc05 100644 --- a/Tests/Data/LIE/HydroMechanics/single_fracture_3D.prj +++ b/Tests/Data/LIE/HydroMechanics/single_fracture_3D.prj @@ -1,4 +1,4 @@ -<?xml version='1.0' encoding='ISO-8859-1'?> +<?xml version="1.0" encoding="ISO-8859-1"?> <OpenGeoSysProject> <mesh>single_fracture_3D.vtu</mesh> <geometry>single_fracture_3D.gml</geometry> @@ -17,13 +17,6 @@ <youngs_modulus>E</youngs_modulus> <poissons_ratio>nu</poissons_ratio> </constitutive_relation> - <intrinsic_permeability>k</intrinsic_permeability> - <specific_storage>S</specific_storage> - <fluid_viscosity>mu</fluid_viscosity> - <biot_coefficient>biot_m</biot_coefficient> - <porosity>phi</porosity> - <solid_density>rho_sr</solid_density> - <fluid_density>rho_fr</fluid_density> <specific_body_force>0 0 0</specific_body_force> <initial_effective_stress>effective_stress0</initial_effective_stress> <fracture_model> @@ -34,23 +27,17 @@ <tension_cutoff>1</tension_cutoff> </fracture_model> <fracture_properties> - <material_id>0</material_id> <initial_aperture>aperture0</initial_aperture> - <specific_storage>S_f</specific_storage> - <biot_coefficient>biot_f</biot_coefficient> - <permeability_model> - <type>CubicLaw</type> - </permeability_model> </fracture_properties> <initial_fracture_effective_stress>fracture_effective_stress0</initial_fracture_effective_stress> <secondary_variables> - <secondary_variable internal_name="sigma" output_name="sigma" /> - <secondary_variable internal_name="epsilon" output_name="epsilon" /> - <secondary_variable internal_name="velocity" output_name="velocity" /> - <secondary_variable internal_name="fracture_velocity" output_name="fracture_velocity" /> - <secondary_variable internal_name="fracture_permeability" output_name="fracture_permeability" /> - <secondary_variable internal_name="fracture_stress" output_name="fracture_stress" /> - <secondary_variable internal_name="fracture_aperture" output_name="fracture_aperture" /> + <secondary_variable internal_name="sigma" output_name="sigma"/> + <secondary_variable internal_name="epsilon" output_name="epsilon"/> + <secondary_variable internal_name="velocity" output_name="velocity"/> + <secondary_variable internal_name="fracture_velocity" output_name="fracture_velocity"/> + <secondary_variable internal_name="fracture_permeability" output_name="fracture_permeability"/> + <secondary_variable internal_name="fracture_stress" output_name="fracture_stress"/> + <secondary_variable internal_name="fracture_aperture" output_name="fracture_aperture"/> </secondary_variables> </process> </processes> @@ -114,6 +101,114 @@ <suffix>_ts_{:timestep}_t_{:time}</suffix> </output> </time_loop> + <media> + <medium id="0"> + <phases> + <phase> + <type>AqueousLiquid</type> + <properties> + <property> + <name>viscosity</name> + <type>Parameter</type> + <parameter_name>mu</parameter_name> + </property> + <property> + <name>density</name> + <type>Parameter</type> + <parameter_name>rho_fr</parameter_name> + </property> + </properties> + </phase> + <phase> + <type>Solid</type> + <properties> + <property> + <name>density</name> + <type>Parameter</type> + <parameter_name>rho_sr</parameter_name> + </property> + </properties> + </phase> + </phases> + <properties> + <property> + <name>permeability</name> + <type>Parameter</type> + <parameter_name>k</parameter_name> + </property> + <property> + <name>porosity</name> + <type>Parameter</type> + <parameter_name>phi</parameter_name> + </property> + <property> + <name>storage</name> + <type>Parameter</type> + <parameter_name>S</parameter_name> + </property> + <property> + <name>biot_coefficient</name> + <type>Parameter</type> + <parameter_name>biot_m</parameter_name> + </property> + <property> + <name>reference_temperature</name> + <type>Constant</type> + <value>293.15</value> + </property> + </properties> + </medium> + <medium id="1"> + <phases> + <phase> + <type>AqueousLiquid</type> + <properties> + <property> + <name>viscosity</name> + <type>Parameter</type> + <parameter_name>mu</parameter_name> + </property> + <property> + <name>density</name> + <type>Parameter</type> + <parameter_name>rho_fr</parameter_name> + </property> + </properties> + </phase> + <phase> + <type>Solid</type> + <properties> + <property> + <name>density</name> + <type>Parameter</type> + <parameter_name>rho_sr</parameter_name> + </property> + </properties> + </phase> + </phases> + <properties> + <property> + <name>permeability</name> + <type>CubicLawPermeability</type> + </property> + <property> + <name>storage</name> + <type>Parameter</type> + <parameter_name>S_f</parameter_name> + </property> + <property> + <name>biot_coefficient</name> + <type>Parameter</type> + <parameter_name>biot_f</parameter_name> + </property> + <property> + <name>reference_temperature</name> + <type>Constant</type> + <value>293.15</value> + </property> + </properties> + </medium> + </media> <parameters> <!-- Fluid phase properties --> <parameter> diff --git a/Tests/Data/LIE/HydroMechanics/single_fracture_3compartments_flow.prj b/Tests/Data/LIE/HydroMechanics/single_fracture_3compartments_flow.prj index 1a580e72d5ebaf24ddc2729009e62382d13bbbbc..347b0791a7481a9b9a10465d65086fd48c19eb19 100644 --- a/Tests/Data/LIE/HydroMechanics/single_fracture_3compartments_flow.prj +++ b/Tests/Data/LIE/HydroMechanics/single_fracture_3compartments_flow.prj @@ -1,4 +1,4 @@ -<?xml version='1.0' encoding='ISO-8859-1'?> +<?xml version="1.0" encoding="ISO-8859-1"?> <OpenGeoSysProject> <mesh>single_fracture_2x2.vtu</mesh> <geometry>single_fracture_2x2.gml</geometry> @@ -17,13 +17,6 @@ <youngs_modulus>E</youngs_modulus> <poissons_ratio>nu</poissons_ratio> </constitutive_relation> - <intrinsic_permeability>k</intrinsic_permeability> - <specific_storage>S</specific_storage> - <fluid_viscosity>mu</fluid_viscosity> - <biot_coefficient>biot_m</biot_coefficient> - <porosity>phi</porosity> - <solid_density>rho_sr</solid_density> - <fluid_density>rho_fr</fluid_density> <specific_body_force>0 0</specific_body_force> <initial_effective_stress>effective_stress0</initial_effective_stress> <fracture_model> @@ -34,24 +27,18 @@ <tension_cutoff>1</tension_cutoff> </fracture_model> <fracture_properties> - <material_id>1</material_id> <initial_aperture>aperture0</initial_aperture> - <specific_storage>S_f</specific_storage> - <biot_coefficient>biot_f</biot_coefficient> - <permeability_model> - <type>CubicLaw</type> - </permeability_model> </fracture_properties> <initial_fracture_effective_stress>fracture_effective_stress0</initial_fracture_effective_stress> <deactivate_matrix_in_flow>true</deactivate_matrix_in_flow> <secondary_variables> - <secondary_variable internal_name="sigma" output_name="sigma" /> - <secondary_variable internal_name="epsilon" output_name="epsilon" /> - <secondary_variable internal_name="velocity" output_name="velocity" /> - <secondary_variable internal_name="fracture_velocity" output_name="fracture_velocity" /> - <secondary_variable internal_name="fracture_permeability" output_name="fracture_permeability" /> - <secondary_variable internal_name="fracture_stress" output_name="fracture_stress" /> - <secondary_variable internal_name="fracture_aperture" output_name="fracture_aperture" /> + <secondary_variable internal_name="sigma" output_name="sigma"/> + <secondary_variable internal_name="epsilon" output_name="epsilon"/> + <secondary_variable internal_name="velocity" output_name="velocity"/> + <secondary_variable internal_name="fracture_velocity" output_name="fracture_velocity"/> + <secondary_variable internal_name="fracture_permeability" output_name="fracture_permeability"/> + <secondary_variable internal_name="fracture_stress" output_name="fracture_stress"/> + <secondary_variable internal_name="fracture_aperture" output_name="fracture_aperture"/> </secondary_variables> </process> </processes> @@ -120,6 +107,114 @@ <suffix>_ts_{:timestep}_t_{:time}</suffix> </output> </time_loop> + <media> + <medium id="0"> + <phases> + <phase> + <type>AqueousLiquid</type> + <properties> + <property> + <name>viscosity</name> + <type>Parameter</type> + <parameter_name>mu</parameter_name> + </property> + <property> + <name>density</name> + <type>Parameter</type> + <parameter_name>rho_fr</parameter_name> + </property> + </properties> + </phase> + <phase> + <type>Solid</type> + <properties> + <property> + <name>density</name> + <type>Parameter</type> + <parameter_name>rho_sr</parameter_name> + </property> + </properties> + </phase> + </phases> + <properties> + <property> + <name>permeability</name> + <type>Parameter</type> + <parameter_name>k</parameter_name> + </property> + <property> + <name>porosity</name> + <type>Parameter</type> + <parameter_name>phi</parameter_name> + </property> + <property> + <name>storage</name> + <type>Parameter</type> + <parameter_name>S</parameter_name> + </property> + <property> + <name>biot_coefficient</name> + <type>Parameter</type> + <parameter_name>biot_m</parameter_name> + </property> + <property> + <name>reference_temperature</name> + <type>Constant</type> + <value>293.15</value> + </property> + </properties> + </medium> + <medium id="1"> + <phases> + <phase> + <type>AqueousLiquid</type> + <properties> + <property> + <name>viscosity</name> + <type>Parameter</type> + <parameter_name>mu</parameter_name> + </property> + <property> + <name>density</name> + <type>Parameter</type> + <parameter_name>rho_fr</parameter_name> + </property> + </properties> + </phase> + <phase> + <type>Solid</type> + <properties> + <property> + <name>density</name> + <type>Parameter</type> + <parameter_name>rho_sr</parameter_name> + </property> + </properties> + </phase> + </phases> + <properties> + <property> + <name>permeability</name> + <type>CubicLawPermeability</type> + </property> + <property> + <name>storage</name> + <type>Parameter</type> + <parameter_name>S_f</parameter_name> + </property> + <property> + <name>biot_coefficient</name> + <type>Parameter</type> + <parameter_name>biot_f</parameter_name> + </property> + <property> + <name>reference_temperature</name> + <type>Constant</type> + <value>293.15</value> + </property> + </properties> + </medium> + </media> <parameters> <!-- Fluid phase properties --> <parameter> diff --git a/Tests/Data/LIE/HydroMechanics/single_fracture_3compartments_flow_CHZ.prj b/Tests/Data/LIE/HydroMechanics/single_fracture_3compartments_flow_CHZ.prj index 7a0e944784f7bba59ee264db4e81a70b289c8fa5..fb71cacdd2f35e32ae4b8116af5a352ab195ace1 100644 --- a/Tests/Data/LIE/HydroMechanics/single_fracture_3compartments_flow_CHZ.prj +++ b/Tests/Data/LIE/HydroMechanics/single_fracture_3compartments_flow_CHZ.prj @@ -1,4 +1,4 @@ -<?xml version='1.0' encoding='ISO-8859-1'?> +<?xml version="1.0" encoding="ISO-8859-1"?> <OpenGeoSysProject> <mesh>single_fracture_2x2.vtu</mesh> <geometry>single_fracture_2x2.gml</geometry> @@ -17,13 +17,6 @@ <youngs_modulus>E</youngs_modulus> <poissons_ratio>nu</poissons_ratio> </constitutive_relation> - <intrinsic_permeability>k</intrinsic_permeability> - <specific_storage>S</specific_storage> - <fluid_viscosity>mu</fluid_viscosity> - <biot_coefficient>biot_m</biot_coefficient> - <porosity>phi</porosity> - <solid_density>rho_sr</solid_density> - <fluid_density>rho_fr</fluid_density> <specific_body_force>0 0</specific_body_force> <initial_effective_stress>effective_stress0</initial_effective_stress> <!--fracture_model> @@ -43,24 +36,18 @@ <tension_cutoff>1</tension_cutoff> </fracture_model> <fracture_properties> - <material_id>0</material_id> <initial_aperture>aperture0</initial_aperture> - <specific_storage>S_f</specific_storage> - <biot_coefficient>biot_f</biot_coefficient> - <permeability_model> - <type>CubicLaw</type> - </permeability_model> </fracture_properties> <initial_fracture_effective_stress>fracture_effective_stress0</initial_fracture_effective_stress> <deactivate_matrix_in_flow>true</deactivate_matrix_in_flow> <secondary_variables> - <secondary_variable internal_name="sigma" output_name="sigma" /> - <secondary_variable internal_name="epsilon" output_name="epsilon" /> - <secondary_variable internal_name="velocity" output_name="velocity" /> - <secondary_variable internal_name="fracture_velocity" output_name="fracture_velocity" /> - <secondary_variable internal_name="fracture_permeability" output_name="fracture_permeability" /> - <secondary_variable internal_name="fracture_stress" output_name="fracture_stress" /> - <secondary_variable internal_name="fracture_aperture" output_name="fracture_aperture" /> + <secondary_variable internal_name="sigma" output_name="sigma"/> + <secondary_variable internal_name="epsilon" output_name="epsilon"/> + <secondary_variable internal_name="velocity" output_name="velocity"/> + <secondary_variable internal_name="fracture_velocity" output_name="fracture_velocity"/> + <secondary_variable internal_name="fracture_permeability" output_name="fracture_permeability"/> + <secondary_variable internal_name="fracture_stress" output_name="fracture_stress"/> + <secondary_variable internal_name="fracture_aperture" output_name="fracture_aperture"/> </secondary_variables> </process> </processes> @@ -129,6 +116,114 @@ <suffix>_ts_{:timestep}_t_{:time}</suffix> </output> </time_loop> + <media> + <medium id="0"> + <phases> + <phase> + <type>AqueousLiquid</type> + <properties> + <property> + <name>viscosity</name> + <type>Parameter</type> + <parameter_name>mu</parameter_name> + </property> + <property> + <name>density</name> + <type>Parameter</type> + <parameter_name>rho_fr</parameter_name> + </property> + </properties> + </phase> + <phase> + <type>Solid</type> + <properties> + <property> + <name>density</name> + <type>Parameter</type> + <parameter_name>rho_sr</parameter_name> + </property> + </properties> + </phase> + </phases> + <properties> + <property> + <name>permeability</name> + <type>Parameter</type> + <parameter_name>k</parameter_name> + </property> + <property> + <name>porosity</name> + <type>Parameter</type> + <parameter_name>phi</parameter_name> + </property> + <property> + <name>storage</name> + <type>Parameter</type> + <parameter_name>S</parameter_name> + </property> + <property> + <name>biot_coefficient</name> + <type>Parameter</type> + <parameter_name>biot_m</parameter_name> + </property> + <property> + <name>reference_temperature</name> + <type>Constant</type> + <value>293.15</value> + </property> + </properties> + </medium> + <medium id="1"> + <phases> + <phase> + <type>AqueousLiquid</type> + <properties> + <property> + <name>viscosity</name> + <type>Parameter</type> + <parameter_name>mu</parameter_name> + </property> + <property> + <name>density</name> + <type>Parameter</type> + <parameter_name>rho_fr</parameter_name> + </property> + </properties> + </phase> + <phase> + <type>Solid</type> + <properties> + <property> + <name>density</name> + <type>Parameter</type> + <parameter_name>rho_sr</parameter_name> + </property> + </properties> + </phase> + </phases> + <properties> + <property> + <name>permeability</name> + <type>CubicLawPermeability</type> + </property> + <property> + <name>storage</name> + <type>Parameter</type> + <parameter_name>S_f</parameter_name> + </property> + <property> + <name>biot_coefficient</name> + <type>Parameter</type> + <parameter_name>biot_f</parameter_name> + </property> + <property> + <name>reference_temperature</name> + <type>Constant</type> + <value>293.15</value> + </property> + </properties> + </medium> + </media> <parameters> <!-- Fluid phase properties --> <parameter> diff --git a/Tests/Data/LIE/HydroMechanics/single_fracture_3compartments_flow_CHZ_sigma0.prj b/Tests/Data/LIE/HydroMechanics/single_fracture_3compartments_flow_CHZ_sigma0.prj index 81b613da30015092a0178f9d5505d118c792b1ec..fc310e67d1d31dc9a7cef99fd1fa516210b55776 100644 --- a/Tests/Data/LIE/HydroMechanics/single_fracture_3compartments_flow_CHZ_sigma0.prj +++ b/Tests/Data/LIE/HydroMechanics/single_fracture_3compartments_flow_CHZ_sigma0.prj @@ -1,4 +1,4 @@ -<?xml version='1.0' encoding='ISO-8859-1'?> +<?xml version="1.0" encoding="ISO-8859-1"?> <OpenGeoSysProject> <mesh>single_fracture_2x2.vtu</mesh> <geometry>single_fracture_2x2.gml</geometry> @@ -17,13 +17,6 @@ <youngs_modulus>E</youngs_modulus> <poissons_ratio>nu</poissons_ratio> </constitutive_relation> - <intrinsic_permeability>k</intrinsic_permeability> - <specific_storage>S</specific_storage> - <fluid_viscosity>mu</fluid_viscosity> - <biot_coefficient>biot_m</biot_coefficient> - <porosity>phi</porosity> - <solid_density>rho_sr</solid_density> - <fluid_density>rho_fr</fluid_density> <specific_body_force>0 0</specific_body_force> <initial_effective_stress>effective_stress0</initial_effective_stress> <!--fracture_model> @@ -43,24 +36,18 @@ <tension_cutoff>1</tension_cutoff> </fracture_model> <fracture_properties> - <material_id>0</material_id> <initial_aperture>aperture0</initial_aperture> - <specific_storage>S_f</specific_storage> - <biot_coefficient>biot_f</biot_coefficient> - <permeability_model> - <type>CubicLaw</type> - </permeability_model> </fracture_properties> <initial_fracture_effective_stress>fracture_effective_stress0</initial_fracture_effective_stress> <deactivate_matrix_in_flow>true</deactivate_matrix_in_flow> <secondary_variables> - <secondary_variable internal_name="sigma" output_name="sigma" /> - <secondary_variable internal_name="epsilon" output_name="epsilon" /> - <secondary_variable internal_name="velocity" output_name="velocity" /> - <secondary_variable internal_name="fracture_velocity" output_name="fracture_velocity" /> - <secondary_variable internal_name="fracture_permeability" output_name="fracture_permeability" /> - <secondary_variable internal_name="fracture_stress" output_name="fracture_stress" /> - <secondary_variable internal_name="fracture_aperture" output_name="fracture_aperture" /> + <secondary_variable internal_name="sigma" output_name="sigma"/> + <secondary_variable internal_name="epsilon" output_name="epsilon"/> + <secondary_variable internal_name="velocity" output_name="velocity"/> + <secondary_variable internal_name="fracture_velocity" output_name="fracture_velocity"/> + <secondary_variable internal_name="fracture_permeability" output_name="fracture_permeability"/> + <secondary_variable internal_name="fracture_stress" output_name="fracture_stress"/> + <secondary_variable internal_name="fracture_aperture" output_name="fracture_aperture"/> </secondary_variables> </process> </processes> @@ -129,6 +116,114 @@ <suffix>_ts_{:timestep}_t_{:time}</suffix> </output> </time_loop> + <media> + <medium id="0"> + <phases> + <phase> + <type>AqueousLiquid</type> + <properties> + <property> + <name>viscosity</name> + <type>Parameter</type> + <parameter_name>mu</parameter_name> + </property> + <property> + <name>density</name> + <type>Parameter</type> + <parameter_name>rho_fr</parameter_name> + </property> + </properties> + </phase> + <phase> + <type>Solid</type> + <properties> + <property> + <name>density</name> + <type>Parameter</type> + <parameter_name>rho_sr</parameter_name> + </property> + </properties> + </phase> + </phases> + <properties> + <property> + <name>permeability</name> + <type>Parameter</type> + <parameter_name>k</parameter_name> + </property> + <property> + <name>porosity</name> + <type>Parameter</type> + <parameter_name>phi</parameter_name> + </property> + <property> + <name>storage</name> + <type>Parameter</type> + <parameter_name>S</parameter_name> + </property> + <property> + <name>biot_coefficient</name> + <type>Parameter</type> + <parameter_name>biot_m</parameter_name> + </property> + <property> + <name>reference_temperature</name> + <type>Constant</type> + <value>293.15</value> + </property> + </properties> + </medium> + <medium id="1"> + <phases> + <phase> + <type>AqueousLiquid</type> + <properties> + <property> + <name>viscosity</name> + <type>Parameter</type> + <parameter_name>mu</parameter_name> + </property> + <property> + <name>density</name> + <type>Parameter</type> + <parameter_name>rho_fr</parameter_name> + </property> + </properties> + </phase> + <phase> + <type>Solid</type> + <properties> + <property> + <name>density</name> + <type>Parameter</type> + <parameter_name>rho_sr</parameter_name> + </property> + </properties> + </phase> + </phases> + <properties> + <property> + <name>permeability</name> + <type>CubicLawPermeability</type> + </property> + <property> + <name>storage</name> + <type>Parameter</type> + <parameter_name>S_f</parameter_name> + </property> + <property> + <name>biot_coefficient</name> + <type>Parameter</type> + <parameter_name>biot_f</parameter_name> + </property> + <property> + <name>reference_temperature</name> + <type>Constant</type> + <value>293.15</value> + </property> + </properties> + </medium> + </media> <parameters> <!-- Fluid phase properties --> <parameter> diff --git a/Tests/Data/LIE/HydroMechanics/single_fracture_3compartments_flow_linear_aperture0.prj b/Tests/Data/LIE/HydroMechanics/single_fracture_3compartments_flow_linear_aperture0.prj index 0d6400773a667410780bc67c6cd408fc9c40d6f4..0a73011541e05e7b66187c0e984ef3e87ab9765d 100644 --- a/Tests/Data/LIE/HydroMechanics/single_fracture_3compartments_flow_linear_aperture0.prj +++ b/Tests/Data/LIE/HydroMechanics/single_fracture_3compartments_flow_linear_aperture0.prj @@ -1,4 +1,4 @@ -<?xml version='1.0' encoding='ISO-8859-1'?> +<?xml version="1.0" encoding="ISO-8859-1"?> <OpenGeoSysProject> <mesh>single_fracture_linear_aperture.vtu</mesh> <geometry>single_fracture_2x2.gml</geometry> @@ -17,13 +17,6 @@ <youngs_modulus>E</youngs_modulus> <poissons_ratio>nu</poissons_ratio> </constitutive_relation> - <intrinsic_permeability>k</intrinsic_permeability> - <specific_storage>S</specific_storage> - <fluid_viscosity>mu</fluid_viscosity> - <biot_coefficient>biot_m</biot_coefficient> - <porosity>phi</porosity> - <solid_density>rho_sr</solid_density> - <fluid_density>rho_fr</fluid_density> <specific_body_force>0 0</specific_body_force> <initial_effective_stress>effective_stress0</initial_effective_stress> <fracture_model> @@ -34,24 +27,18 @@ <tension_cutoff>1</tension_cutoff> </fracture_model> <fracture_properties> - <material_id>1</material_id> <initial_aperture>aperture0</initial_aperture> - <specific_storage>S_f</specific_storage> - <biot_coefficient>biot_f</biot_coefficient> - <permeability_model> - <type>CubicLaw</type> - </permeability_model> </fracture_properties> <initial_fracture_effective_stress>fracture_effective_stress0</initial_fracture_effective_stress> <deactivate_matrix_in_flow>true</deactivate_matrix_in_flow> <secondary_variables> - <secondary_variable internal_name="sigma" output_name="sigma" /> - <secondary_variable internal_name="epsilon" output_name="epsilon" /> - <secondary_variable internal_name="velocity" output_name="velocity" /> - <secondary_variable internal_name="fracture_velocity" output_name="fracture_velocity" /> - <secondary_variable internal_name="fracture_permeability" output_name="fracture_permeability" /> - <secondary_variable internal_name="fracture_stress" output_name="fracture_stress" /> - <secondary_variable internal_name="fracture_aperture" output_name="fracture_aperture" /> + <secondary_variable internal_name="sigma" output_name="sigma"/> + <secondary_variable internal_name="epsilon" output_name="epsilon"/> + <secondary_variable internal_name="velocity" output_name="velocity"/> + <secondary_variable internal_name="fracture_velocity" output_name="fracture_velocity"/> + <secondary_variable internal_name="fracture_permeability" output_name="fracture_permeability"/> + <secondary_variable internal_name="fracture_stress" output_name="fracture_stress"/> + <secondary_variable internal_name="fracture_aperture" output_name="fracture_aperture"/> </secondary_variables> </process> </processes> @@ -120,6 +107,114 @@ <suffix>_ts_{:timestep}_t_{:time}</suffix> </output> </time_loop> + <media> + <medium id="0"> + <phases> + <phase> + <type>AqueousLiquid</type> + <properties> + <property> + <name>viscosity</name> + <type>Parameter</type> + <parameter_name>mu</parameter_name> + </property> + <property> + <name>density</name> + <type>Parameter</type> + <parameter_name>rho_fr</parameter_name> + </property> + </properties> + </phase> + <phase> + <type>Solid</type> + <properties> + <property> + <name>density</name> + <type>Parameter</type> + <parameter_name>rho_sr</parameter_name> + </property> + </properties> + </phase> + </phases> + <properties> + <property> + <name>permeability</name> + <type>Parameter</type> + <parameter_name>k</parameter_name> + </property> + <property> + <name>porosity</name> + <type>Parameter</type> + <parameter_name>phi</parameter_name> + </property> + <property> + <name>storage</name> + <type>Parameter</type> + <parameter_name>S</parameter_name> + </property> + <property> + <name>biot_coefficient</name> + <type>Parameter</type> + <parameter_name>biot_m</parameter_name> + </property> + <property> + <name>reference_temperature</name> + <type>Constant</type> + <value>293.15</value> + </property> + </properties> + </medium> + <medium id="1"> + <phases> + <phase> + <type>AqueousLiquid</type> + <properties> + <property> + <name>viscosity</name> + <type>Parameter</type> + <parameter_name>mu</parameter_name> + </property> + <property> + <name>density</name> + <type>Parameter</type> + <parameter_name>rho_fr</parameter_name> + </property> + </properties> + </phase> + <phase> + <type>Solid</type> + <properties> + <property> + <name>density</name> + <type>Parameter</type> + <parameter_name>rho_sr</parameter_name> + </property> + </properties> + </phase> + </phases> + <properties> + <property> + <name>permeability</name> + <type>CubicLawPermeability</type> + </property> + <property> + <name>storage</name> + <type>Parameter</type> + <parameter_name>S_f</parameter_name> + </property> + <property> + <name>biot_coefficient</name> + <type>Parameter</type> + <parameter_name>biot_f</parameter_name> + </property> + <property> + <name>reference_temperature</name> + <type>Constant</type> + <value>293.15</value> + </property> + </properties> + </medium> + </media> <parameters> <!-- Fluid phase properties --> <parameter> diff --git a/Tests/Data/LIE/HydroMechanics/single_fracture_3compartments_flow_linear_aperture0_e.prj b/Tests/Data/LIE/HydroMechanics/single_fracture_3compartments_flow_linear_aperture0_e.prj index 96e1ed516e48b2f945f84af79fc30f38031679f6..629446cecb6f1e7f815f658794862bb3ace42913 100644 --- a/Tests/Data/LIE/HydroMechanics/single_fracture_3compartments_flow_linear_aperture0_e.prj +++ b/Tests/Data/LIE/HydroMechanics/single_fracture_3compartments_flow_linear_aperture0_e.prj @@ -1,4 +1,4 @@ -<?xml version='1.0' encoding='ISO-8859-1'?> +<?xml version="1.0" encoding="ISO-8859-1"?> <OpenGeoSysProject> <mesh>single_fracture_linear_aperture_e.vtu</mesh> <geometry>single_fracture_2x2.gml</geometry> @@ -17,13 +17,6 @@ <youngs_modulus>E</youngs_modulus> <poissons_ratio>nu</poissons_ratio> </constitutive_relation> - <intrinsic_permeability>k</intrinsic_permeability> - <specific_storage>S</specific_storage> - <fluid_viscosity>mu</fluid_viscosity> - <biot_coefficient>biot_m</biot_coefficient> - <porosity>phi</porosity> - <solid_density>rho_sr</solid_density> - <fluid_density>rho_fr</fluid_density> <specific_body_force>0 0</specific_body_force> <initial_effective_stress>effective_stress0</initial_effective_stress> <fracture_model> @@ -34,24 +27,18 @@ <tension_cutoff>1</tension_cutoff> </fracture_model> <fracture_properties> - <material_id>1</material_id> <initial_aperture>aperture0</initial_aperture> - <specific_storage>S_f</specific_storage> - <biot_coefficient>biot_f</biot_coefficient> - <permeability_model> - <type>CubicLaw</type> - </permeability_model> </fracture_properties> <initial_fracture_effective_stress>fracture_effective_stress0</initial_fracture_effective_stress> <deactivate_matrix_in_flow>true</deactivate_matrix_in_flow> <secondary_variables> - <secondary_variable internal_name="sigma" output_name="sigma" /> - <secondary_variable internal_name="epsilon" output_name="epsilon" /> - <secondary_variable internal_name="velocity" output_name="velocity" /> - <secondary_variable internal_name="fracture_velocity" output_name="fracture_velocity" /> - <secondary_variable internal_name="fracture_permeability" output_name="fracture_permeability" /> - <secondary_variable internal_name="fracture_stress" output_name="fracture_stress" /> - <secondary_variable internal_name="fracture_aperture" output_name="fracture_aperture" /> + <secondary_variable internal_name="sigma" output_name="sigma"/> + <secondary_variable internal_name="epsilon" output_name="epsilon"/> + <secondary_variable internal_name="velocity" output_name="velocity"/> + <secondary_variable internal_name="fracture_velocity" output_name="fracture_velocity"/> + <secondary_variable internal_name="fracture_permeability" output_name="fracture_permeability"/> + <secondary_variable internal_name="fracture_stress" output_name="fracture_stress"/> + <secondary_variable internal_name="fracture_aperture" output_name="fracture_aperture"/> </secondary_variables> </process> </processes> @@ -120,6 +107,114 @@ <suffix>_ts_{:timestep}_t_{:time}</suffix> </output> </time_loop> + <media> + <medium id="0"> + <phases> + <phase> + <type>AqueousLiquid</type> + <properties> + <property> + <name>viscosity</name> + <type>Parameter</type> + <parameter_name>mu</parameter_name> + </property> + <property> + <name>density</name> + <type>Parameter</type> + <parameter_name>rho_fr</parameter_name> + </property> + </properties> + </phase> + <phase> + <type>Solid</type> + <properties> + <property> + <name>density</name> + <type>Parameter</type> + <parameter_name>rho_sr</parameter_name> + </property> + </properties> + </phase> + </phases> + <properties> + <property> + <name>permeability</name> + <type>Parameter</type> + <parameter_name>k</parameter_name> + </property> + <property> + <name>porosity</name> + <type>Parameter</type> + <parameter_name>phi</parameter_name> + </property> + <property> + <name>storage</name> + <type>Parameter</type> + <parameter_name>S</parameter_name> + </property> + <property> + <name>biot_coefficient</name> + <type>Parameter</type> + <parameter_name>biot_m</parameter_name> + </property> + <property> + <name>reference_temperature</name> + <type>Constant</type> + <value>293.15</value> + </property> + </properties> + </medium> + <medium id="1"> + <phases> + <phase> + <type>AqueousLiquid</type> + <properties> + <property> + <name>viscosity</name> + <type>Parameter</type> + <parameter_name>mu</parameter_name> + </property> + <property> + <name>density</name> + <type>Parameter</type> + <parameter_name>rho_fr</parameter_name> + </property> + </properties> + </phase> + <phase> + <type>Solid</type> + <properties> + <property> + <name>density</name> + <type>Parameter</type> + <parameter_name>rho_sr</parameter_name> + </property> + </properties> + </phase> + </phases> + <properties> + <property> + <name>permeability</name> + <type>CubicLawPermeability</type> + </property> + <property> + <name>storage</name> + <type>Parameter</type> + <parameter_name>S_f</parameter_name> + </property> + <property> + <name>biot_coefficient</name> + <type>Parameter</type> + <parameter_name>biot_f</parameter_name> + </property> + <property> + <name>reference_temperature</name> + <type>Constant</type> + <value>293.15</value> + </property> + </properties> + </medium> + </media> <parameters> <!-- Fluid phase properties --> <parameter> diff --git a/Tests/Data/LIE/HydroMechanics/single_fracture_CZ_kf_const.prj b/Tests/Data/LIE/HydroMechanics/single_fracture_CZ_kf_const.prj index 0e260300f8a43f3a39a1a80393b68394acc3214a..8eff034510861967afc4d8240fd4c844485c5362 100644 --- a/Tests/Data/LIE/HydroMechanics/single_fracture_CZ_kf_const.prj +++ b/Tests/Data/LIE/HydroMechanics/single_fracture_CZ_kf_const.prj @@ -1,4 +1,4 @@ -<?xml version='1.0' encoding='ISO-8859-1'?> +<?xml version="1.0" encoding="ISO-8859-1"?> <OpenGeoSysProject> <mesh>single_fracture_2x2_mesh2.vtu</mesh> <geometry>single_fracture_2x2.gml</geometry> @@ -17,13 +17,6 @@ <youngs_modulus>E</youngs_modulus> <poissons_ratio>nu</poissons_ratio> </constitutive_relation> - <intrinsic_permeability>k</intrinsic_permeability> - <specific_storage>S</specific_storage> - <fluid_viscosity>mu</fluid_viscosity> - <biot_coefficient>biot_m</biot_coefficient> - <porosity>phi</porosity> - <solid_density>rho_sr</solid_density> - <fluid_density>rho_fr</fluid_density> <specific_body_force>0 0</specific_body_force> <initial_effective_stress>effective_stress0</initial_effective_stress> <fracture_model> @@ -36,25 +29,18 @@ <tension_cutoff>1</tension_cutoff> </fracture_model> <fracture_properties> - <material_id>0</material_id> <initial_aperture>aperture0</initial_aperture> - <specific_storage>S_f</specific_storage> - <biot_coefficient>biot_f</biot_coefficient> - <permeability_model> - <type>ConstantPermeability</type> - <value>8.33333E-12</value> - </permeability_model> </fracture_properties> <initial_fracture_effective_stress>fracture_effective_stress0</initial_fracture_effective_stress> <deactivate_matrix_in_flow>true</deactivate_matrix_in_flow> <secondary_variables> - <secondary_variable internal_name="sigma" output_name="sigma" /> - <secondary_variable internal_name="epsilon" output_name="epsilon" /> - <secondary_variable internal_name="velocity" output_name="velocity" /> - <secondary_variable internal_name="fracture_velocity" output_name="fracture_velocity" /> - <secondary_variable internal_name="fracture_permeability" output_name="fracture_permeability" /> - <secondary_variable internal_name="fracture_stress" output_name="fracture_stress" /> - <secondary_variable internal_name="fracture_aperture" output_name="fracture_aperture" /> + <secondary_variable internal_name="sigma" output_name="sigma"/> + <secondary_variable internal_name="epsilon" output_name="epsilon"/> + <secondary_variable internal_name="velocity" output_name="velocity"/> + <secondary_variable internal_name="fracture_velocity" output_name="fracture_velocity"/> + <secondary_variable internal_name="fracture_permeability" output_name="fracture_permeability"/> + <secondary_variable internal_name="fracture_stress" output_name="fracture_stress"/> + <secondary_variable internal_name="fracture_aperture" output_name="fracture_aperture"/> </secondary_variables> </process> </processes> @@ -127,6 +113,115 @@ <suffix>_ts_{:timestep}_t_{:time}</suffix> </output> </time_loop> + <media> + <medium id="0"> + <phases> + <phase> + <type>AqueousLiquid</type> + <properties> + <property> + <name>viscosity</name> + <type>Parameter</type> + <parameter_name>mu</parameter_name> + </property> + <property> + <name>density</name> + <type>Parameter</type> + <parameter_name>rho_fr</parameter_name> + </property> + </properties> + </phase> + <phase> + <type>Solid</type> + <properties> + <property> + <name>density</name> + <type>Parameter</type> + <parameter_name>rho_sr</parameter_name> + </property> + </properties> + </phase> + </phases> + <properties> + <property> + <name>permeability</name> + <type>Parameter</type> + <parameter_name>k</parameter_name> + </property> + <property> + <name>porosity</name> + <type>Parameter</type> + <parameter_name>phi</parameter_name> + </property> + <property> + <name>storage</name> + <type>Parameter</type> + <parameter_name>S</parameter_name> + </property> + <property> + <name>biot_coefficient</name> + <type>Parameter</type> + <parameter_name>biot_m</parameter_name> + </property> + <property> + <name>reference_temperature</name> + <type>Constant</type> + <value>293.15</value> + </property> + </properties> + </medium> + <medium id="1"> + <phases> + <phase> + <type>AqueousLiquid</type> + <properties> + <property> + <name>viscosity</name> + <type>Parameter</type> + <parameter_name>mu</parameter_name> + </property> + <property> + <name>density</name> + <type>Parameter</type> + <parameter_name>rho_fr</parameter_name> + </property> + </properties> + </phase> + <phase> + <type>Solid</type> + <properties> + <property> + <name>density</name> + <type>Parameter</type> + <parameter_name>rho_sr</parameter_name> + </property> + </properties> + </phase> + </phases> + <properties> + <property> + <name>permeability</name> + <type>Constant</type> + <value>8.33333E-12</value> + </property> + <property> + <name>storage</name> + <type>Parameter</type> + <parameter_name>S_f</parameter_name> + </property> + <property> + <name>biot_coefficient</name> + <type>Parameter</type> + <parameter_name>biot_f</parameter_name> + </property> + <property> + <name>reference_temperature</name> + <type>Constant</type> + <value>293.15</value> + </property> + </properties> + </medium> + </media> <parameters> <!-- Fluid phase properties --> <parameter> diff --git a/Tests/Data/LIE/HydroMechanics/single_fracture_CZ_kf_cubic.prj b/Tests/Data/LIE/HydroMechanics/single_fracture_CZ_kf_cubic.prj index bd0ed802345372c537f822d40ba2e634a0194bcc..44dc72694e5283dc2043bb1d2e167eaf8f1a8add 100644 --- a/Tests/Data/LIE/HydroMechanics/single_fracture_CZ_kf_cubic.prj +++ b/Tests/Data/LIE/HydroMechanics/single_fracture_CZ_kf_cubic.prj @@ -1,4 +1,4 @@ -<?xml version='1.0' encoding='ISO-8859-1'?> +<?xml version="1.0" encoding="ISO-8859-1"?> <OpenGeoSysProject> <mesh>single_fracture_2x2_mesh2.vtu</mesh> <geometry>single_fracture_2x2.gml</geometry> @@ -17,13 +17,6 @@ <youngs_modulus>E</youngs_modulus> <poissons_ratio>nu</poissons_ratio> </constitutive_relation> - <intrinsic_permeability>k</intrinsic_permeability> - <specific_storage>S</specific_storage> - <fluid_viscosity>mu</fluid_viscosity> - <biot_coefficient>biot_m</biot_coefficient> - <porosity>phi</porosity> - <solid_density>rho_sr</solid_density> - <fluid_density>rho_fr</fluid_density> <specific_body_force>0 0</specific_body_force> <initial_effective_stress>effective_stress0</initial_effective_stress> <fracture_model> @@ -36,24 +29,18 @@ <tension_cutoff>1</tension_cutoff> </fracture_model> <fracture_properties> - <material_id>0</material_id> <initial_aperture>aperture0</initial_aperture> - <specific_storage>S_f</specific_storage> - <biot_coefficient>biot_f</biot_coefficient> - <permeability_model> - <type>CubicLaw</type> - </permeability_model> </fracture_properties> <initial_fracture_effective_stress>fracture_effective_stress0</initial_fracture_effective_stress> <deactivate_matrix_in_flow>true</deactivate_matrix_in_flow> <secondary_variables> - <secondary_variable internal_name="sigma" output_name="sigma" /> - <secondary_variable internal_name="epsilon" output_name="epsilon" /> - <secondary_variable internal_name="velocity" output_name="velocity" /> - <secondary_variable internal_name="fracture_velocity" output_name="fracture_velocity" /> - <secondary_variable internal_name="fracture_permeability" output_name="fracture_permeability" /> - <secondary_variable internal_name="fracture_stress" output_name="fracture_stress" /> - <secondary_variable internal_name="fracture_aperture" output_name="fracture_aperture" /> + <secondary_variable internal_name="sigma" output_name="sigma"/> + <secondary_variable internal_name="epsilon" output_name="epsilon"/> + <secondary_variable internal_name="velocity" output_name="velocity"/> + <secondary_variable internal_name="fracture_velocity" output_name="fracture_velocity"/> + <secondary_variable internal_name="fracture_permeability" output_name="fracture_permeability"/> + <secondary_variable internal_name="fracture_stress" output_name="fracture_stress"/> + <secondary_variable internal_name="fracture_aperture" output_name="fracture_aperture"/> </secondary_variables> </process> </processes> @@ -126,6 +113,114 @@ <suffix>_ts_{:timestep}_t_{:time}</suffix> </output> </time_loop> + <media> + <medium id="0"> + <phases> + <phase> + <type>AqueousLiquid</type> + <properties> + <property> + <name>viscosity</name> + <type>Parameter</type> + <parameter_name>mu</parameter_name> + </property> + <property> + <name>density</name> + <type>Parameter</type> + <parameter_name>rho_fr</parameter_name> + </property> + </properties> + </phase> + <phase> + <type>Solid</type> + <properties> + <property> + <name>density</name> + <type>Parameter</type> + <parameter_name>rho_sr</parameter_name> + </property> + </properties> + </phase> + </phases> + <properties> + <property> + <name>permeability</name> + <type>Parameter</type> + <parameter_name>k</parameter_name> + </property> + <property> + <name>porosity</name> + <type>Parameter</type> + <parameter_name>phi</parameter_name> + </property> + <property> + <name>storage</name> + <type>Parameter</type> + <parameter_name>S</parameter_name> + </property> + <property> + <name>biot_coefficient</name> + <type>Parameter</type> + <parameter_name>biot_m</parameter_name> + </property> + <property> + <name>reference_temperature</name> + <type>Constant</type> + <value>293.15</value> + </property> + </properties> + </medium> + <medium id="1"> + <phases> + <phase> + <type>AqueousLiquid</type> + <properties> + <property> + <name>viscosity</name> + <type>Parameter</type> + <parameter_name>mu</parameter_name> + </property> + <property> + <name>density</name> + <type>Parameter</type> + <parameter_name>rho_fr</parameter_name> + </property> + </properties> + </phase> + <phase> + <type>Solid</type> + <properties> + <property> + <name>density</name> + <type>Parameter</type> + <parameter_name>rho_sr</parameter_name> + </property> + </properties> + </phase> + </phases> + <properties> + <property> + <name>permeability</name> + <type>CubicLawPermeability</type> + </property> + <property> + <name>storage</name> + <type>Parameter</type> + <parameter_name>S_f</parameter_name> + </property> + <property> + <name>biot_coefficient</name> + <type>Parameter</type> + <parameter_name>biot_f</parameter_name> + </property> + <property> + <name>reference_temperature</name> + <type>Constant</type> + <value>293.15</value> + </property> + </properties> + </medium> + </media> <parameters> <!-- Fluid phase properties --> <parameter> diff --git a/Tests/Data/LIE/HydroMechanics/single_fracture_LE_kf_const.prj b/Tests/Data/LIE/HydroMechanics/single_fracture_LE_kf_const.prj index 641924e6d783656b850e6d0aa54927b39e738869..eb38ad71563673270ea858af7a044f7f6ad99efb 100644 --- a/Tests/Data/LIE/HydroMechanics/single_fracture_LE_kf_const.prj +++ b/Tests/Data/LIE/HydroMechanics/single_fracture_LE_kf_const.prj @@ -1,4 +1,4 @@ -<?xml version='1.0' encoding='ISO-8859-1'?> +<?xml version="1.0" encoding="ISO-8859-1"?> <OpenGeoSysProject> <mesh>single_fracture_2x2_mesh2.vtu</mesh> <geometry>single_fracture_2x2.gml</geometry> @@ -17,13 +17,6 @@ <youngs_modulus>E</youngs_modulus> <poissons_ratio>nu</poissons_ratio> </constitutive_relation> - <intrinsic_permeability>k</intrinsic_permeability> - <specific_storage>S</specific_storage> - <fluid_viscosity>mu</fluid_viscosity> - <biot_coefficient>biot_m</biot_coefficient> - <porosity>phi</porosity> - <solid_density>rho_sr</solid_density> - <fluid_density>rho_fr</fluid_density> <specific_body_force>0 0</specific_body_force> <initial_effective_stress>effective_stress0</initial_effective_stress> <fracture_model> @@ -34,25 +27,18 @@ <tension_cutoff>1</tension_cutoff> </fracture_model> <fracture_properties> - <material_id>0</material_id> <initial_aperture>aperture0</initial_aperture> - <specific_storage>S_f</specific_storage> - <biot_coefficient>biot_f</biot_coefficient> - <permeability_model> - <type>ConstantPermeability</type> - <value>8.33333E-12</value> - </permeability_model> </fracture_properties> <initial_fracture_effective_stress>fracture_effective_stress0</initial_fracture_effective_stress> <deactivate_matrix_in_flow>true</deactivate_matrix_in_flow> <secondary_variables> - <secondary_variable internal_name="sigma" output_name="sigma" /> - <secondary_variable internal_name="epsilon" output_name="epsilon" /> - <secondary_variable internal_name="velocity" output_name="velocity" /> - <secondary_variable internal_name="fracture_velocity" output_name="fracture_velocity" /> - <secondary_variable internal_name="fracture_permeability" output_name="fracture_permeability" /> - <secondary_variable internal_name="fracture_stress" output_name="fracture_stress" /> - <secondary_variable internal_name="fracture_aperture" output_name="fracture_aperture" /> + <secondary_variable internal_name="sigma" output_name="sigma"/> + <secondary_variable internal_name="epsilon" output_name="epsilon"/> + <secondary_variable internal_name="velocity" output_name="velocity"/> + <secondary_variable internal_name="fracture_velocity" output_name="fracture_velocity"/> + <secondary_variable internal_name="fracture_permeability" output_name="fracture_permeability"/> + <secondary_variable internal_name="fracture_stress" output_name="fracture_stress"/> + <secondary_variable internal_name="fracture_aperture" output_name="fracture_aperture"/> </secondary_variables> </process> </processes> @@ -125,6 +111,115 @@ <suffix>_ts_{:timestep}_t_{:time}</suffix> </output> </time_loop> + <media> + <medium id="0"> + <phases> + <phase> + <type>AqueousLiquid</type> + <properties> + <property> + <name>viscosity</name> + <type>Parameter</type> + <parameter_name>mu</parameter_name> + </property> + <property> + <name>density</name> + <type>Parameter</type> + <parameter_name>rho_fr</parameter_name> + </property> + </properties> + </phase> + <phase> + <type>Solid</type> + <properties> + <property> + <name>density</name> + <type>Parameter</type> + <parameter_name>rho_sr</parameter_name> + </property> + </properties> + </phase> + </phases> + <properties> + <property> + <name>permeability</name> + <type>Parameter</type> + <parameter_name>k</parameter_name> + </property> + <property> + <name>porosity</name> + <type>Parameter</type> + <parameter_name>phi</parameter_name> + </property> + <property> + <name>storage</name> + <type>Parameter</type> + <parameter_name>S</parameter_name> + </property> + <property> + <name>biot_coefficient</name> + <type>Parameter</type> + <parameter_name>biot_m</parameter_name> + </property> + <property> + <name>reference_temperature</name> + <type>Constant</type> + <value>293.15</value> + </property> + </properties> + </medium> + <medium id="1"> + <phases> + <phase> + <type>AqueousLiquid</type> + <properties> + <property> + <name>viscosity</name> + <type>Parameter</type> + <parameter_name>mu</parameter_name> + </property> + <property> + <name>density</name> + <type>Parameter</type> + <parameter_name>rho_fr</parameter_name> + </property> + </properties> + </phase> + <phase> + <type>Solid</type> + <properties> + <property> + <name>density</name> + <type>Parameter</type> + <parameter_name>rho_sr</parameter_name> + </property> + </properties> + </phase> + </phases> + <properties> + <property> + <name>permeability</name> + <type>Constant</type> + <value>8.33333E-12</value> + </property> + <property> + <name>storage</name> + <type>Parameter</type> + <parameter_name>S_f</parameter_name> + </property> + <property> + <name>biot_coefficient</name> + <type>Parameter</type> + <parameter_name>biot_f</parameter_name> + </property> + <property> + <name>reference_temperature</name> + <type>Constant</type> + <value>293.15</value> + </property> + </properties> + </medium> + </media> <parameters> <!-- Fluid phase properties --> <parameter> diff --git a/Tests/Data/LIE/HydroMechanics/single_fracture_LE_kf_cubic.prj b/Tests/Data/LIE/HydroMechanics/single_fracture_LE_kf_cubic.prj index ce62abac908b29eb5efcb66b580fa52c2c7b0735..b0c3bd7bc5d7be012a00c2a150be628fe0fb43c2 100644 --- a/Tests/Data/LIE/HydroMechanics/single_fracture_LE_kf_cubic.prj +++ b/Tests/Data/LIE/HydroMechanics/single_fracture_LE_kf_cubic.prj @@ -1,4 +1,4 @@ -<?xml version='1.0' encoding='ISO-8859-1'?> +<?xml version="1.0" encoding="ISO-8859-1"?> <OpenGeoSysProject> <mesh>single_fracture_2x2_mesh2.vtu</mesh> <geometry>single_fracture_2x2.gml</geometry> @@ -17,13 +17,6 @@ <youngs_modulus>E</youngs_modulus> <poissons_ratio>nu</poissons_ratio> </constitutive_relation> - <intrinsic_permeability>k</intrinsic_permeability> - <specific_storage>S</specific_storage> - <fluid_viscosity>mu</fluid_viscosity> - <biot_coefficient>biot_m</biot_coefficient> - <porosity>phi</porosity> - <solid_density>rho_sr</solid_density> - <fluid_density>rho_fr</fluid_density> <specific_body_force>0 0</specific_body_force> <initial_effective_stress>effective_stress0</initial_effective_stress> <fracture_model> @@ -34,24 +27,18 @@ <tension_cutoff>1</tension_cutoff> </fracture_model> <fracture_properties> - <material_id>0</material_id> <initial_aperture>aperture0</initial_aperture> - <specific_storage>S_f</specific_storage> - <biot_coefficient>biot_f</biot_coefficient> - <permeability_model> - <type>CubicLaw</type> - </permeability_model> </fracture_properties> <initial_fracture_effective_stress>fracture_effective_stress0</initial_fracture_effective_stress> <deactivate_matrix_in_flow>true</deactivate_matrix_in_flow> <secondary_variables> - <secondary_variable internal_name="sigma" output_name="sigma" /> - <secondary_variable internal_name="epsilon" output_name="epsilon" /> - <secondary_variable internal_name="velocity" output_name="velocity" /> - <secondary_variable internal_name="fracture_velocity" output_name="fracture_velocity" /> - <secondary_variable internal_name="fracture_permeability" output_name="fracture_permeability" /> - <secondary_variable internal_name="fracture_stress" output_name="fracture_stress" /> - <secondary_variable internal_name="fracture_aperture" output_name="fracture_aperture" /> + <secondary_variable internal_name="sigma" output_name="sigma"/> + <secondary_variable internal_name="epsilon" output_name="epsilon"/> + <secondary_variable internal_name="velocity" output_name="velocity"/> + <secondary_variable internal_name="fracture_velocity" output_name="fracture_velocity"/> + <secondary_variable internal_name="fracture_permeability" output_name="fracture_permeability"/> + <secondary_variable internal_name="fracture_stress" output_name="fracture_stress"/> + <secondary_variable internal_name="fracture_aperture" output_name="fracture_aperture"/> </secondary_variables> </process> </processes> @@ -124,6 +111,114 @@ <suffix>_ts_{:timestep}_t_{:time}</suffix> </output> </time_loop> + <media> + <medium id="0"> + <phases> + <phase> + <type>AqueousLiquid</type> + <properties> + <property> + <name>viscosity</name> + <type>Parameter</type> + <parameter_name>mu</parameter_name> + </property> + <property> + <name>density</name> + <type>Parameter</type> + <parameter_name>rho_fr</parameter_name> + </property> + </properties> + </phase> + <phase> + <type>Solid</type> + <properties> + <property> + <name>density</name> + <type>Parameter</type> + <parameter_name>rho_sr</parameter_name> + </property> + </properties> + </phase> + </phases> + <properties> + <property> + <name>permeability</name> + <type>Parameter</type> + <parameter_name>k</parameter_name> + </property> + <property> + <name>porosity</name> + <type>Parameter</type> + <parameter_name>phi</parameter_name> + </property> + <property> + <name>storage</name> + <type>Parameter</type> + <parameter_name>S</parameter_name> + </property> + <property> + <name>biot_coefficient</name> + <type>Parameter</type> + <parameter_name>biot_m</parameter_name> + </property> + <property> + <name>reference_temperature</name> + <type>Constant</type> + <value>293.15</value> + </property> + </properties> + </medium> + <medium id="1"> + <phases> + <phase> + <type>AqueousLiquid</type> + <properties> + <property> + <name>viscosity</name> + <type>Parameter</type> + <parameter_name>mu</parameter_name> + </property> + <property> + <name>density</name> + <type>Parameter</type> + <parameter_name>rho_fr</parameter_name> + </property> + </properties> + </phase> + <phase> + <type>Solid</type> + <properties> + <property> + <name>density</name> + <type>Parameter</type> + <parameter_name>rho_sr</parameter_name> + </property> + </properties> + </phase> + </phases> + <properties> + <property> + <name>permeability</name> + <type>CubicLawPermeability</type> + </property> + <property> + <name>storage</name> + <type>Parameter</type> + <parameter_name>S_f</parameter_name> + </property> + <property> + <name>biot_coefficient</name> + <type>Parameter</type> + <parameter_name>biot_f</parameter_name> + </property> + <property> + <name>reference_temperature</name> + <type>Constant</type> + <value>293.15</value> + </property> + </properties> + </medium> + </media> <parameters> <!-- Fluid phase properties --> <parameter> diff --git a/Tests/Data/LIE/HydroMechanics/single_fracture_constK.prj b/Tests/Data/LIE/HydroMechanics/single_fracture_constK.prj index 8cea18e4d43b170a55c8daa814b335019468edc8..7090706538bc805617610fdc21155dde981fc3d7 100644 --- a/Tests/Data/LIE/HydroMechanics/single_fracture_constK.prj +++ b/Tests/Data/LIE/HydroMechanics/single_fracture_constK.prj @@ -1,4 +1,4 @@ -<?xml version='1.0' encoding='ISO-8859-1'?> +<?xml version="1.0" encoding="ISO-8859-1"?> <OpenGeoSysProject> <mesh>single_fracture.vtu</mesh> <geometry>single_fracture.gml</geometry> @@ -17,13 +17,6 @@ <youngs_modulus>E</youngs_modulus> <poissons_ratio>nu</poissons_ratio> </constitutive_relation> - <intrinsic_permeability>k</intrinsic_permeability> - <specific_storage>S</specific_storage> - <fluid_viscosity>mu</fluid_viscosity> - <biot_coefficient>biot_m</biot_coefficient> - <porosity>phi</porosity> - <solid_density>rho_sr</solid_density> - <fluid_density>rho_fr</fluid_density> <specific_body_force>0 0</specific_body_force> <initial_effective_stress>effective_stress0</initial_effective_stress> <fracture_model> @@ -34,24 +27,17 @@ <tension_cutoff>1</tension_cutoff> </fracture_model> <fracture_properties> - <material_id>0</material_id> <initial_aperture>aperture0</initial_aperture> - <specific_storage>S_f</specific_storage> - <biot_coefficient>biot_f</biot_coefficient> - <permeability_model> - <type>ConstantPermeability</type> - <value>1e-11</value> - </permeability_model> </fracture_properties> <initial_fracture_effective_stress>fracture_effective_stress0</initial_fracture_effective_stress> <secondary_variables> - <secondary_variable internal_name="sigma" output_name="sigma" /> - <secondary_variable internal_name="epsilon" output_name="epsilon" /> - <secondary_variable internal_name="velocity" output_name="velocity" /> - <secondary_variable internal_name="fracture_velocity" output_name="fracture_velocity" /> - <secondary_variable internal_name="fracture_permeability" output_name="fracture_permeability" /> - <secondary_variable internal_name="fracture_stress" output_name="fracture_stress" /> - <secondary_variable internal_name="fracture_aperture" output_name="fracture_aperture" /> + <secondary_variable internal_name="sigma" output_name="sigma"/> + <secondary_variable internal_name="epsilon" output_name="epsilon"/> + <secondary_variable internal_name="velocity" output_name="velocity"/> + <secondary_variable internal_name="fracture_velocity" output_name="fracture_velocity"/> + <secondary_variable internal_name="fracture_permeability" output_name="fracture_permeability"/> + <secondary_variable internal_name="fracture_stress" output_name="fracture_stress"/> + <secondary_variable internal_name="fracture_aperture" output_name="fracture_aperture"/> </secondary_variables> </process> </processes> @@ -112,6 +98,115 @@ <suffix>_ts_{:timestep}_t_{:time}</suffix> </output> </time_loop> + <media> + <medium id="1"> + <phases> + <phase> + <type>AqueousLiquid</type> + <properties> + <property> + <name>viscosity</name> + <type>Parameter</type> + <parameter_name>mu</parameter_name> + </property> + <property> + <name>density</name> + <type>Parameter</type> + <parameter_name>rho_fr</parameter_name> + </property> + </properties> + </phase> + <phase> + <type>Solid</type> + <properties> + <property> + <name>density</name> + <type>Parameter</type> + <parameter_name>rho_sr</parameter_name> + </property> + </properties> + </phase> + </phases> + <properties> + <property> + <name>permeability</name> + <type>Parameter</type> + <parameter_name>k</parameter_name> + </property> + <property> + <name>porosity</name> + <type>Parameter</type> + <parameter_name>phi</parameter_name> + </property> + <property> + <name>storage</name> + <type>Parameter</type> + <parameter_name>S</parameter_name> + </property> + <property> + <name>biot_coefficient</name> + <type>Parameter</type> + <parameter_name>biot_m</parameter_name> + </property> + <property> + <name>reference_temperature</name> + <type>Constant</type> + <value>293.15</value> + </property> + </properties> + </medium> + <medium id="0"> + <phases> + <phase> + <type>AqueousLiquid</type> + <properties> + <property> + <name>viscosity</name> + <type>Parameter</type> + <parameter_name>mu</parameter_name> + </property> + <property> + <name>density</name> + <type>Parameter</type> + <parameter_name>rho_fr</parameter_name> + </property> + </properties> + </phase> + <phase> + <type>Solid</type> + <properties> + <property> + <name>density</name> + <type>Parameter</type> + <parameter_name>rho_sr</parameter_name> + </property> + </properties> + </phase> + </phases> + <properties> + <property> + <name>permeability</name> + <type>Constant</type> + <value>1e-11</value> + </property> + <property> + <name>storage</name> + <type>Parameter</type> + <parameter_name>S_f</parameter_name> + </property> + <property> + <name>biot_coefficient</name> + <type>Parameter</type> + <parameter_name>biot_f</parameter_name> + </property> + <property> + <name>reference_temperature</name> + <type>Constant</type> + <value>293.15</value> + </property> + </properties> + </medium> + </media> <parameters> <!-- Fluid phase properties --> <parameter> diff --git a/Tests/MaterialLib/TestMPLCubicLawPermeability.cpp b/Tests/MaterialLib/TestMPLCubicLawPermeability.cpp index 4aa8dd7271afd9a66a0f797c57a1adb835b3c646..7c1d00a5ef931cc0b830861f450f2cae3c624baf 100644 --- a/Tests/MaterialLib/TestMPLCubicLawPermeability.cpp +++ b/Tests/MaterialLib/TestMPLCubicLawPermeability.cpp @@ -7,30 +7,55 @@ Distributed under a Modified BSD License. See accompanying file LICENSE.txt or http://www.opengeosys.org/project/license -*/ + */ #include <gtest/gtest.h> #include <memory> +#include <vector> #include "MaterialLib/MPL/Properties/CubicLawPermeability.h" #include "ParameterLib/ConstantParameter.h" #include "TestMPL.h" -TEST(MaterialPropertyLib, checkCubicLawPermeability) +void testCubicLawPermeability(MPL::Property const& k_model, + double const aperture, bool const is_predefined_b) { - ParameterLib::ConstantParameter<double> const b("b", 1.e-4); - - MPL::Property const& k_model = - MPL::CubicLawPermeability{"CubicLawPermeability", b}; - - double const expected_k = 8.3333e-10; - ParameterLib::SpatialPosition const pos; double const t = std::numeric_limits<double>::quiet_NaN(); double const dt = std::numeric_limits<double>::quiet_NaN(); MPL::VariableArray vars; + vars.fracture_aperture = aperture; + double const expected_k = aperture * aperture / 12.0; double const k = k_model.template value<double>(vars, pos, t, dt); - ASSERT_NEAR(expected_k, k, 3.4e-15); + + double const expected_dk = is_predefined_b ? 0.0 : aperture / 6.0; + double const dk = k_model.template dValue<double>( + vars, MPL::Variable::fracture_aperture, pos, t, dt); + ASSERT_NEAR(expected_dk, dk, 3.4e-15) + << "\nExpected dk " << expected_dk << "\nCalculated dk " << dk; +} + +TEST(MaterialPropertyLib, checkCubicLawPermeability) +{ + std::vector<double> const apertures = {1.0e-4, 2.e-5, 3.0e-6}; + for (double const aperture : apertures) + { + { // Aperture as a variable: + MPL::Property const& k_model = MPL::CubicLawPermeability{ + "CubicLawPermeability", nullptr /*predefined b*/}; + testCubicLawPermeability(k_model, aperture, + false /*is_predefined_b*/); + } + + { // Aperture being pre-defined: + ParameterLib::ConstantParameter<double> const b("b", aperture); + + MPL::Property const& k_model = + MPL::CubicLawPermeability{"CubicLawPermeability", &b}; + testCubicLawPermeability(k_model, aperture, + true /*is_predefined_b*/); + } + } }