diff --git a/MaterialLib/FractureModels/Permeability/ConstantPermeability.cpp b/MaterialLib/FractureModels/Permeability/ConstantPermeability.cpp new file mode 100644 index 0000000000000000000000000000000000000000..f7ea38d9f048aa24a969ceb980737f47ff7ea6b5 --- /dev/null +++ b/MaterialLib/FractureModels/Permeability/ConstantPermeability.cpp @@ -0,0 +1,35 @@ +/** + * \file + * \copyright + * Copyright (c) 2012-2019, OpenGeoSys Community (http://www.opengeosys.org) + * Distributed under a Modified BSD License. + * See accompanying file LICENSE.txt or + * http://www.opengeosys.org/project/license + * + */ + +#include "ConstantPermeability.h" + +namespace MaterialLib::Fracture::Permeability +{ +ConstantPermeability::ConstantPermeability(double const permeability) + : _permeability(permeability) +{ +} + +double ConstantPermeability::permeability( + PermeabilityState const* const /*state*/, + double const /*aperture0*/, + double const /*aperture_m*/) const +{ + return _permeability; +} + +double ConstantPermeability::dpermeability_daperture( + PermeabilityState const* const /*state*/, + double const /*aperture0*/, + double const /*aperture_m*/) const +{ + return 0.; +} +} // namespace MaterialLib::Fracture::Permeability diff --git a/MaterialLib/FractureModels/Permeability/ConstantPermeability.h b/MaterialLib/FractureModels/Permeability/ConstantPermeability.h new file mode 100644 index 0000000000000000000000000000000000000000..cbe99490ead5260a02832f496b10525c2ab6f0ba --- /dev/null +++ b/MaterialLib/FractureModels/Permeability/ConstantPermeability.h @@ -0,0 +1,35 @@ +/** + * \file + * \copyright + * Copyright (c) 2012-2019, OpenGeoSys Community (http://www.opengeosys.org) + * Distributed under a Modified BSD License. + * See accompanying file LICENSE.txt or + * http://www.opengeosys.org/project/license + * + */ + +#pragma once + +#include "Permeability.h" + +namespace MaterialLib::Fracture::Permeability +{ +/// A constant permeability model. +class ConstantPermeability final : public Permeability +{ +public: + ConstantPermeability(double const permeability); + +private: + double permeability(PermeabilityState const* const /*state*/, + double const /*aperture0*/, + double const /*aperture_m*/) const override; + + double dpermeability_daperture(PermeabilityState const* const /*state*/, + double const /*aperture0*/, + double const /*aperture_m*/) const override; + +private: + double const _permeability; +}; +} // namespace MaterialLib::Fracture::Permeability diff --git a/MaterialLib/FractureModels/Permeability/CreateConstantPermeability.cpp b/MaterialLib/FractureModels/Permeability/CreateConstantPermeability.cpp new file mode 100644 index 0000000000000000000000000000000000000000..9cc63bd489a9923daf748bc4d8779fe56f4d4081 --- /dev/null +++ b/MaterialLib/FractureModels/Permeability/CreateConstantPermeability.cpp @@ -0,0 +1,38 @@ +/** + * \file + * \copyright + * Copyright (c) 2012-2019, OpenGeoSys Community (http://www.opengeosys.org) + * Distributed under a Modified BSD License. + * See accompanying file LICENSE.txt or + * http://www.opengeosys.org/project/license + * + */ + +#include "CreateConstantPermeability.h" +#include "BaseLib/ConfigTree.h" +#include "BaseLib/Error.h" + +#include "ConstantPermeability.h" + +namespace MaterialLib::Fracture::Permeability +{ +std::unique_ptr<Permeability> createConstantPermeability( + BaseLib::ConfigTree const& config) +{ + //! \ogs_file_param{material__fracture_properties__permeability_model__type} + config.checkConfigParameter("type", "ConstantPermeability"); + + auto const permeability = + //! \ogs_file_param{material__fracture_properties__permeability_model__ConstantPermeability__value} + config.getConfigParameter<double>("value"); + + if (permeability < 0) + { + OGS_FATAL( + "The permeability parameter must be non-negative. Given value %g.", + permeability); + } + + return std::make_unique<ConstantPermeability>(permeability); +} +} // namespace MaterialLib::Fracture::Permeability diff --git a/MaterialLib/FractureModels/Permeability/CreateConstantPermeability.h b/MaterialLib/FractureModels/Permeability/CreateConstantPermeability.h new file mode 100644 index 0000000000000000000000000000000000000000..fcd66c5b3b099ad977eed223aa07e59777f3d845 --- /dev/null +++ b/MaterialLib/FractureModels/Permeability/CreateConstantPermeability.h @@ -0,0 +1,28 @@ +/** + * \file + * \copyright + * Copyright (c) 2012-2019, OpenGeoSys Community (http://www.opengeosys.org) + * Distributed under a Modified BSD License. + * See accompanying file LICENSE.txt or + * http://www.opengeosys.org/project/license + * + */ + +#pragma once + +#include <memory> + +namespace BaseLib +{ +class ConfigTree; +} +namespace MaterialLib::Fracture::Permeability +{ +class Permeability; +} + +namespace MaterialLib::Fracture::Permeability +{ +std::unique_ptr<Permeability> createConstantPermeability( + BaseLib::ConfigTree const& config); +} // namespace MaterialLib::Fracture::Permeability