diff --git a/MaterialLib/MPL/Properties/CreateProperties.h b/MaterialLib/MPL/Properties/CreateProperties.h index 646a6e2213ab21729599674913def917a1b292cb..386d7be0313304e13b9f9f3e53e82fd6dab41e97 100644 --- a/MaterialLib/MPL/Properties/CreateProperties.h +++ b/MaterialLib/MPL/Properties/CreateProperties.h @@ -17,4 +17,5 @@ #include "CreateIdealGasLaw.h" #include "CreateLinearProperty.h" #include "CreateParameterProperty.h" +#include "CreateRelPermBrooksCorey.h" #include "CreateSaturationBrooksCorey.h" \ No newline at end of file diff --git a/MaterialLib/MPL/Properties/CreateRelPermBrooksCorey.cpp b/MaterialLib/MPL/Properties/CreateRelPermBrooksCorey.cpp new file mode 100644 index 0000000000000000000000000000000000000000..df32753c7b0e3d43b1201e21c54057bda3e31b1b --- /dev/null +++ b/MaterialLib/MPL/Properties/CreateRelPermBrooksCorey.cpp @@ -0,0 +1,50 @@ +/** + * \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 "BaseLib/ConfigTree.h" +#include "RelPermBrooksCorey.h" + +namespace MaterialPropertyLib +{ +std::unique_ptr<RelPermBrooksCorey> createRelPermBrooksCorey( + BaseLib::ConfigTree const& config) +{ + // check is reading the parameter, not peeking it... + //! \ogs_file_param{prj__media__medium__properties__property__RelPermBrooksCorey} + config.checkConfigParameter("type", "RelPermBrooksCorey"); + DBUG("Create RelPermBrooksCorey medium property"); + + auto const residual_liquid_saturation = + //! \ogs_file_param{prj__media__medium__properties__property__RelPermBrooksCorey__residual_liquid_saturation} + config.getConfigParameter<double>("residual_liquid_saturation"); + auto const residual_gas_saturation = + //! \ogs_file_param{prj__media__medium__properties__property__RelPermBrooksCorey__residual_gas_saturation} + config.getConfigParameter<double>("residual_gas_saturation"); + auto const min_relative_permeability_liquid = + //! \ogs_file_param{prj__media__medium__properties__property__RelPermBrooksCorey__k_rel_min_liquid} + config.getConfigParameter<double>("min_relative_permeability_liquid"); + auto const min_relative_permeability_gas = + //! \ogs_file_param{prj__media__medium__properties__property__RelPermBrooksCorey__k_rel_min_gas} + config.getConfigParameter<double>("min_relative_permeability_gas"); + auto const exponent = + //! \ogs_file_param{prj__media__medium__properties__property__RelPermBrooksCorey__lambda} + config.getConfigParameter<double>("lambda"); + if (exponent == 0.) + { + OGS_FATAL("Exponent 'lambda' must be positive."); + } + + return std::make_unique<RelPermBrooksCorey>( + residual_liquid_saturation, + residual_gas_saturation, + min_relative_permeability_liquid, + min_relative_permeability_gas, + exponent); +} +} // namespace MaterialPropertyLib diff --git a/MaterialLib/MPL/Properties/CreateRelPermBrooksCorey.h b/MaterialLib/MPL/Properties/CreateRelPermBrooksCorey.h new file mode 100644 index 0000000000000000000000000000000000000000..459c03fe34e80121bf9c34ad8cbb2002a9ee809d --- /dev/null +++ b/MaterialLib/MPL/Properties/CreateRelPermBrooksCorey.h @@ -0,0 +1,26 @@ +/** + * \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 + +namespace BaseLib +{ +class ConfigTree; +} + +namespace MaterialPropertyLib +{ +class RelPermBrooksCorey; +} + +namespace MaterialPropertyLib +{ +std::unique_ptr<RelPermBrooksCorey> createRelPermBrooksCorey( + BaseLib::ConfigTree const& config); +} // namespace MaterialPropertyLib diff --git a/MaterialLib/MPL/Properties/RelPermBrooksCorey.h b/MaterialLib/MPL/Properties/RelPermBrooksCorey.h index 247a9b600ec965005d7ecfb54c188556d2925bac..9043894a5f703fa0033abda89b1b9e207aa369bd 100644 --- a/MaterialLib/MPL/Properties/RelPermBrooksCorey.h +++ b/MaterialLib/MPL/Properties/RelPermBrooksCorey.h @@ -72,40 +72,4 @@ public: double const t) const override; }; -inline std::unique_ptr<RelPermBrooksCorey> createRelPermBrooksCorey( - BaseLib::ConfigTree const& config) -{ - // check is reading the parameter, not peeking it... - //! \ogs_file_param{prj__media__medium__properties__property__RelPermBrooksCorey} - // config.checkConfigParameter("type", "RelPermBrooksCorey"); - DBUG("Create RelPermBrooksCorey medium property"); - - auto const residual_liquid_saturation = - //! \ogs_file_param{prj__media__medium__properties__property__RelPermBrooksCorey__residual_liquid_saturation} - config.getConfigParameter<double>("residual_liquid_saturation"); - auto const residual_gas_saturation = - //! \ogs_file_param{prj__media__medium__properties__property__RelPermBrooksCorey__residual_gas_saturation} - config.getConfigParameter<double>("residual_gas_saturation"); - auto const min_relative_permeability_liquid = - //! \ogs_file_param{prj__media__medium__properties__property__RelPermBrooksCorey__k_rel_min_liquid} - config.getConfigParameter<double>("min_relative_permeability_liquid"); - auto const min_relative_permeability_gas = - //! \ogs_file_param{prj__media__medium__properties__property__RelPermBrooksCorey__k_rel_min_gas} - config.getConfigParameter<double>("min_relative_permeability_gas"); - auto const exponent = - //! \ogs_file_param{prj__media__medium__properties__property__RelPermBrooksCorey__lambda} - config.getConfigParameter<double>("lambda"); - if (exponent == 0.) - { - OGS_FATAL("Exponent 'lambda' must be positive."); - } - - return std::make_unique<RelPermBrooksCorey>( - residual_liquid_saturation, - residual_gas_saturation, - min_relative_permeability_liquid, - min_relative_permeability_gas, - exponent); -} - } // namespace MaterialPropertyLib