Skip to content

Commit

Permalink
Merge branch 'use_MPL_LIE_HM0' into 'master'
Browse files Browse the repository at this point in the history
Replacing the parameter medium properties of HM#LIE with MPL ones

See merge request ogs/ogs!5144
  • Loading branch information
endJunction committed Dec 1, 2024
2 parents 1f6d10b + 88e1694 commit 725cd56
Show file tree
Hide file tree
Showing 45 changed files with 2,438 additions and 527 deletions.
4 changes: 2 additions & 2 deletions Applications/ApplicationsLib/ProjectData.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -922,15 +922,15 @@ 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::
createHydroMechanicsProcess<3>(
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(
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1 +1 @@
Collection of fracture properties for a specific fracture given by material id.
\copydoc MaterialPropertyLib::CubicLawPermeability::_b
14 changes: 11 additions & 3 deletions MaterialLib/MPL/Properties/CreateCubicLawPermeability.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@

#include "CreateCubicLawPermeability.h"

#include <limits>
#include <string>

#include "BaseLib/ConfigTree.h"
#include "CubicLawPermeability.h"
#include "ParameterLib/Utils.h"
Expand All @@ -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);
}
Expand Down
8 changes: 4 additions & 4 deletions MaterialLib/MPL/Properties/CreateCubicLawPermeability.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
22 changes: 18 additions & 4 deletions MaterialLib/MPL/Properties/CubicLawPermeability.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
18 changes: 9 additions & 9 deletions MaterialLib/MPL/Properties/CubicLawPermeability.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -37,20 +41,16 @@ 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
{
if (!std::holds_alternative<Medium*>(scale_))
{
OGS_FATAL(
"The property 'CubicLawPermeability' is implemented on the "
"'media' scaleonly.");
"'media' scale only.");
}
}

Expand All @@ -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
2 changes: 2 additions & 0 deletions MaterialLib/MPL/VariableType.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
3 changes: 3 additions & 0 deletions MaterialLib/MPL/VariableType.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ enum class Variable : int
enthalpy,
enthalpy_of_evaporation,
equivalent_plastic_strain,
fracture_aperture,
grain_compressibility,
liquid_phase_pressure,
liquid_saturation,
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -174,6 +176,7 @@ class VariableArray
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_;
Expand Down
18 changes: 0 additions & 18 deletions ProcessLib/LIE/Common/FractureProperty.h
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Loading

0 comments on commit 725cd56

Please sign in to comment.