OGS
MaterialLib::PorousMedium Namespace Reference

Classes

class  DupuitPermeability
 
class  Permeability
 
class  Porosity
 
class  PorousMediaProperties
 
class  ConstantStorage
 
class  Storage
 
class  BrooksCoreyCapillaryPressureSaturation
 Brooks-Corey capillary pressure saturation model. More...
 
class  CapillaryPressureSaturation
 Base class of capillary pressure models. More...
 
class  CapillaryPressureSaturationCurve
 
class  VanGenuchtenCapillaryPressureSaturation
 van Genuchten water retention model More...
 
class  NonWettingPhaseBrooksCoreyOilGas
 BrooksCorey oil-gas model: non-wetting phase. More...
 
class  NonWettingPhaseVanGenuchten
 van Genuchten model: non-wetting phase More...
 
class  RelativePermeability
 Base class of relative permeability models. More...
 
class  RelativePermeabilityCurve
 
class  WettingPhaseBrooksCoreyOilGas
 BrooksCorey oil-gas model: wetting phase. More...
 
class  WettingPhaseVanGenuchten
 van Genuchten model model: wetting phase More...
 

Functions

PorousMediaProperties createPorousMediaProperties (MeshLib::Mesh &mesh, BaseLib::ConfigTree const &configs, std::vector< std::unique_ptr< ParameterLib::ParameterBase >> const &parameters)
 
std::unique_ptr< PermeabilitycreatePermeabilityModel (BaseLib::ConfigTree const &config, std::vector< std::unique_ptr< ParameterLib::ParameterBase >> const &parameters)
 
std::unique_ptr< PorositycreatePorosityModel (BaseLib::ConfigTree const &config, std::vector< std::unique_ptr< ParameterLib::ParameterBase >> const &parameters)
 
std::unique_ptr< StoragecreateStorageModel (BaseLib::ConfigTree const &config)
 
static std::unique_ptr< CapillaryPressureSaturationcreateBrooksCorey (BaseLib::ConfigTree const &config)
 
static std::unique_ptr< CapillaryPressureSaturationcreateVanGenuchten (BaseLib::ConfigTree const &config)
 
std::unique_ptr< CapillaryPressureSaturationcreateCapillaryPressureModel (BaseLib::ConfigTree const &config)
 
std::unique_ptr< RelativePermeabilitycreateWettingPhaseVanGenuchten (BaseLib::ConfigTree const &config)
 
std::unique_ptr< RelativePermeabilitycreateNonWettingPhaseVanGenuchten (BaseLib::ConfigTree const &config)
 
std::unique_ptr< RelativePermeabilitycreateWettingPhaseBrooksCoreyOilGas (BaseLib::ConfigTree const &config)
 
std::unique_ptr< RelativePermeabilitycreateNonWettingPhaseBrooksCoreyOilGas (BaseLib::ConfigTree const &config)
 
std::unique_ptr< RelativePermeabilitycreateRelativePermeabilityModel (BaseLib::ConfigTree const &config)
 

Function Documentation

◆ createBrooksCorey()

static std::unique_ptr<CapillaryPressureSaturation> MaterialLib::PorousMedium::createBrooksCorey ( BaseLib::ConfigTree const &  config)
static
Parameters
configConfigTree object which contains the input data including <type>BrooksCorey</type> and it has a tag of <capillary_pressure>
Input File Parameter:
material__porous_medium__capillary_pressure__type
Input File Parameter:
material__porous_medium__capillary_pressure__BrooksCorey__pd
Input File Parameter:
material__porous_medium__capillary_pressure__BrooksCorey__sr
Input File Parameter:
material__porous_medium__capillary_pressure__BrooksCorey__sg_r
Input File Parameter:
material__porous_medium__capillary_pressure__BrooksCorey__smax
Input File Parameter:
material__porous_medium__capillary_pressure__BrooksCorey__m
Input File Parameter:
material__porous_medium__capillary_pressure__BrooksCorey__pc_max

Definition at line 33 of file CreateCapillaryPressureModel.cpp.

35 {
37  config.checkConfigParameter("type", "BrooksCorey");
38 
40  const auto pd = config.getConfigParameter<double>("pd");
41 
43  const auto Sr = config.getConfigParameter<double>("sr");
44 
45  double Sg_r = 0.0;
47  if (auto const Sg_r_ptr = config.getConfigParameterOptional<double>("sg_r"))
48  {
49  DBUG(
50  "Using value {:g} for nonwetting phase residual saturation in "
51  "capillary pressure model.",
52  (*Sg_r_ptr));
53  Sg_r = *Sg_r_ptr;
54  }
56  const auto Smax = config.getConfigParameter<double>("smax");
57 
59  const auto m = config.getConfigParameter<double>("m");
60  if (m < 1.0) // m >= 1
61  {
62  OGS_FATAL(
63  "The exponent parameter of BrooksCorey capillary pressure "
64  "saturation model, m, must not be smaller than 1");
65  }
67  const auto Pc_max = config.getConfigParameter<double>("pc_max");
68 
69  return std::make_unique<BrooksCoreyCapillaryPressureSaturation>(
70  pd, Sr, Sg_r, Smax, m, Pc_max);
71 }
#define OGS_FATAL(...)
Definition: Error.h:26
void DBUG(char const *fmt, Args const &... args)
Definition: Logging.h:27

References BaseLib::ConfigTree::checkConfigParameter(), DBUG(), BaseLib::ConfigTree::getConfigParameter(), BaseLib::ConfigTree::getConfigParameterOptional(), and OGS_FATAL.

Referenced by createCapillaryPressureModel().

◆ createCapillaryPressureModel()

std::unique_ptr< CapillaryPressureSaturation > MaterialLib::PorousMedium::createCapillaryPressureModel ( BaseLib::ConfigTree const &  config)

Create a capillary pressure model

Parameters
configConfigTree object has a tag of <capillary_pressure>
Input File Parameter:
material__porous_medium__capillary_pressure__type
Input File Parameter:
material__porous_medium__capillary_pressure__type
Input File Parameter:
material__porous_medium__capillary_pressure__Curve__curve

Definition at line 128 of file CreateCapillaryPressureModel.cpp.

130 {
132  auto const type = config.peekConfigParameter<std::string>("type");
133 
134  if (type == "BrooksCorey")
135  {
136  return createBrooksCorey(config);
137  }
138  if (type == "vanGenuchten")
139  {
140  return createVanGenuchten(config);
141  }
142  if (type == "Curve")
143  {
145  config.checkConfigParameter("type", "Curve");
146 
148  auto const& curve_config = config.getConfigSubtree("curve");
149 
152 
153  return std::make_unique<CapillaryPressureSaturationCurve>(
154  std::move(curve));
155  }
156 
157  OGS_FATAL(
158  "The capillary pressure saturation models {:s} are unavailable.\nThe "
159  "available types are: \n\tBrooksCorey, \n\tvanGenuchten,",
160  "\n\tCurve.\n",
161  type.data());
162 }
static std::unique_ptr< CapillaryPressureSaturation > createVanGenuchten(BaseLib::ConfigTree const &config)
static std::unique_ptr< CapillaryPressureSaturation > createBrooksCorey(BaseLib::ConfigTree const &config)
std::unique_ptr< CurveType > createPiecewiseLinearCurve(BaseLib::ConfigTree const &config)

References BaseLib::ConfigTree::checkConfigParameter(), createBrooksCorey(), MathLib::createPiecewiseLinearCurve(), createVanGenuchten(), BaseLib::ConfigTree::getConfigSubtree(), OGS_FATAL, and BaseLib::ConfigTree::peekConfigParameter().

Referenced by MaterialLib::TwoPhaseFlowWithPP::createTwoPhaseFlowMaterialProperties(), and ProcessLib::TwoPhaseFlowWithPrho::createTwoPhaseFlowPrhoMaterialProperties().

◆ createNonWettingPhaseBrooksCoreyOilGas()

std::unique_ptr<RelativePermeability> MaterialLib::PorousMedium::createNonWettingPhaseBrooksCoreyOilGas ( BaseLib::ConfigTree const &  config)
Parameters
configConfigTree object which contains the input data including <type>NonWettingPhaseBrooksCoreyOilGas</type> and it has a tag of <relative_permeability>
Input File Parameter:
material__porous_medium__relative_permeability__type
Input File Parameter:
material__porous_medium__relative_permeability__NonWettingPhaseBrooksCoreyOilGas__sr
Input File Parameter:
material__porous_medium__relative_permeability__NonWettingPhaseBrooksCoreyOilGas__smax
Input File Parameter:
material__porous_medium__relative_permeability__NonWettingPhaseBrooksCoreyOilGas__m
Input File Parameter:
material__porous_medium__relative_permeability__NonWettingPhaseBrooksCoreyOilGas__krel_min

Definition at line 136 of file CreateRelativePermeabilityModel.cpp.

138 {
140  config.checkConfigParameter("type", "NonWettingPhaseBrooksCoreyOilGas");
141 
143  const auto Sr = config.getConfigParameter<double>("sr");
144 
146  const auto Smax = config.getConfigParameter<double>("smax");
147 
149  const auto m = config.getConfigParameter<double>("m");
150  if (m < 1.0) // m >= 1
151  {
152  OGS_FATAL(
153  "The exponent parameter of NonWettingPhaseBrooksCoreyOilGas\n"
154  "relative permeability model, m, must not be smaller than 1");
155  }
156 
158  const auto krel_min = config.getConfigParameter<double>("krel_min");
159 
160  return std::make_unique<NonWettingPhaseBrooksCoreyOilGas>(
161  Sr, Smax, m, krel_min);
162 }

References BaseLib::ConfigTree::checkConfigParameter(), BaseLib::ConfigTree::getConfigParameter(), and OGS_FATAL.

Referenced by createRelativePermeabilityModel().

◆ createNonWettingPhaseVanGenuchten()

std::unique_ptr<RelativePermeability> MaterialLib::PorousMedium::createNonWettingPhaseVanGenuchten ( BaseLib::ConfigTree const &  config)
Parameters
configConfigTree object which contains the input data including <type>NonWettingPhaseVanGenuchten</type> and it has a tag of <relative_permeability>
Input File Parameter:
material__porous_medium__relative_permeability__type
Input File Parameter:
material__porous_medium__relative_permeability__NonWettingPhaseVanGenuchten__sr
Input File Parameter:
material__porous_medium__relative_permeability__NonWettingPhaseVanGenuchten__smax
Input File Parameter:
material__porous_medium__relative_permeability__NonWettingPhaseVanGenuchten__m
Input File Parameter:
material__porous_medium__relative_permeability__NonWettingPhaseVanGenuchten__krel_min

Definition at line 71 of file CreateRelativePermeabilityModel.cpp.

73 {
75  config.checkConfigParameter("type", "NonWettingPhaseVanGenuchten");
76 
78  const auto Sr = config.getConfigParameter<double>("sr");
79 
81  const auto Smax = config.getConfigParameter<double>("smax");
82 
84  const auto m = config.getConfigParameter<double>("m");
85  if (m < 0. || m > 1.0)
86  {
87  OGS_FATAL(
88  "The exponent parameter of NonWettingPhaseVanGenuchten relative\n"
89  " permeability model, m, must be in an interval of [0, 1]");
90  }
91 
93  const auto krel_min = config.getConfigParameter<double>("krel_min");
94 
95  return std::make_unique<NonWettingPhaseVanGenuchten>(Sr, Smax, m, krel_min);
96 }

References BaseLib::ConfigTree::checkConfigParameter(), BaseLib::ConfigTree::getConfigParameter(), and OGS_FATAL.

Referenced by createRelativePermeabilityModel().

◆ createPermeabilityModel()

std::unique_ptr< Permeability > MaterialLib::PorousMedium::createPermeabilityModel ( BaseLib::ConfigTree const &  config,
std::vector< std::unique_ptr< ParameterLib::ParameterBase >> const &  parameters 
)

Create a porosity model

Parameters
configConfigTree object has a tag of <permeability> that describes the permeability relationsship and contains the name of the parameter
parametersa vector containing the available parameters
Input File Parameter:
material__porous_medium__permeability__type
Input File Parameter:
material__porous_medium__permeability__permeability_tensor_entries
Input File Parameter:
material__porous_medium__permeability__permeability_tensor_entries

Definition at line 29 of file createPermeabilityModel.cpp.

32 {
34  auto const type = config.getConfigParameter<std::string>("type");
35 
36  if (type == "Constant")
37  {
38  auto const& permeability_parameter = ParameterLib::findParameter<
39  double>(
40  config,
42  "permeability_tensor_entries", parameters, 0);
43 
44  int dimension = static_cast<int>(
45  std::sqrt(permeability_parameter.getNumberOfGlobalComponents()));
46  if (permeability_parameter.getNumberOfGlobalComponents() !=
47  dimension * dimension)
48  {
49  OGS_FATAL(
50  "The given parameter has {:d} components, but the permeability "
51  "tensor is defined for a {:d} dimensional problem.",
52  permeability_parameter.getNumberOfGlobalComponents(),
53  dimension);
54  }
55 
56  return std::make_unique<Permeability>(permeability_parameter,
57  dimension);
58  }
59 
60  if (type == "Dupuit")
61  {
62  auto const& permeability_parameter = ParameterLib::findParameter<
63  double>(
64  config,
66  "permeability_tensor_entries", parameters, 0);
67 
68  int dimension = static_cast<int>(
69  std::sqrt(permeability_parameter.getNumberOfGlobalComponents()));
70  if (permeability_parameter.getNumberOfGlobalComponents() !=
71  dimension * dimension)
72  {
73  OGS_FATAL(
74  "The given parameter has {:d} components, but the permeability "
75  "tensor is defined for a {:d} dimensional problem.",
76  permeability_parameter.getNumberOfGlobalComponents(),
77  dimension);
78  }
79 
80  return std::make_unique<DupuitPermeability>(permeability_parameter,
81  dimension);
82  }
83  OGS_FATAL("The permeability type '{:s}' is unavailable.\n",
84  "The available types are \n\tConstant.",
85  type.data());
86 }
Parameter< ParameterDataType > & findParameter(std::string const &parameter_name, std::vector< std::unique_ptr< ParameterBase >> const &parameters, int const num_components, MeshLib::Mesh const *const mesh=nullptr)
Definition: Utils.h:102

References ParameterLib::findParameter(), BaseLib::ConfigTree::getConfigParameter(), and OGS_FATAL.

Referenced by createPorousMediaProperties(), MaterialLib::TwoPhaseFlowWithPP::createTwoPhaseFlowMaterialProperties(), and ProcessLib::TwoPhaseFlowWithPrho::createTwoPhaseFlowPrhoMaterialProperties().

◆ createPorosityModel()

std::unique_ptr< Porosity > MaterialLib::PorousMedium::createPorosityModel ( BaseLib::ConfigTree const &  config,
std::vector< std::unique_ptr< ParameterLib::ParameterBase >> const &  parameters 
)

Create a porosity model

Parameters
configConfigTree object has a tag of <porosity> that describes the porosity relationsship and contains the name of the parameter
parametersa vector containing the available parameters
Input File Parameter:
material__porous_medium__porosity__type
Input File Parameter:
material__porous_medium__porosity__porosity_parameter

Definition at line 24 of file createPorosityModel.cpp.

27 {
29  auto const type = config.getConfigParameter<std::string>("type");
30 
31  if (type == "Constant")
32  {
33  auto const& constant_porosity = ParameterLib::findParameter<double>(
34  config,
36  "porosity_parameter", parameters, 1);
37 
38  return std::make_unique<Porosity>(constant_porosity);
39  }
40 
41  OGS_FATAL("The porosity type {:s} is unavailable.\n",
42  "The available type is Constant.",
43  type.data());
44 }

References BaseLib::ConfigTree::getConfigParameter(), and OGS_FATAL.

Referenced by createPorousMediaProperties(), MaterialLib::TwoPhaseFlowWithPP::createTwoPhaseFlowMaterialProperties(), and ProcessLib::TwoPhaseFlowWithPrho::createTwoPhaseFlowPrhoMaterialProperties().

◆ createPorousMediaProperties()

PorousMediaProperties MaterialLib::PorousMedium::createPorousMediaProperties ( MeshLib::Mesh mesh,
BaseLib::ConfigTree const &  configs,
std::vector< std::unique_ptr< ParameterLib::ParameterBase >> const &  parameters 
)
Input File Parameter:
material__porous_medium__porous_medium
Input File Parameter:
material__porous_medium__porous_medium
Input File Parameter:
material__porous_medium__porous_medium__id
Input File Parameter:
material__porous_medium__porous_medium__porosity
Input File Parameter:
material__porous_medium__porous_medium__permeability
Input File Parameter:
material__porous_medium__porous_medium__storage

Definition at line 23 of file CreatePorousMediaProperties.cpp.

26 {
27  DBUG("Create PorousMediaProperties.");
28 
29  auto const& porous_medium_configs =
31  configs.getConfigSubtree("porous_medium");
32 
33  std::vector<std::unique_ptr<MaterialLib::PorousMedium::Permeability>>
34  intrinsic_permeability_models;
35  std::vector<std::unique_ptr<MaterialLib::PorousMedium::Porosity>>
36  porosity_models;
37  std::vector<std::unique_ptr<MaterialLib::PorousMedium::Storage>>
38  storage_models;
39 
40  std::vector<int> mat_ids;
41  for (auto const& porous_medium_config :
43  porous_medium_configs.getConfigSubtreeList("porous_medium"))
44  {
46  auto const id = porous_medium_config.getConfigAttribute<int>("id");
47  mat_ids.push_back(id);
48 
49  auto const& porosity_config =
51  porous_medium_config.getConfigSubtree("porosity");
52  porosity_models.emplace_back(
54  parameters));
55 
56  // Configuration for the intrinsic permeability (only one scalar per
57  // element, i.e., the isotropic case is handled at the moment)
58  auto const& permeability_config =
60  porous_medium_config.getConfigSubtree("permeability");
61  intrinsic_permeability_models.emplace_back(
63  permeability_config, parameters));
64 
65  // Configuration for the specific storage.
66  auto const& storage_config =
68  porous_medium_config.getConfigSubtree("storage");
69  storage_models.emplace_back(
71  }
72 
73  BaseLib::reorderVector(intrinsic_permeability_models, mat_ids);
74  BaseLib::reorderVector(porosity_models, mat_ids);
75  BaseLib::reorderVector(storage_models, mat_ids);
76 
77  auto const material_ids = materialIDs(mesh);
78  int const max_material_id =
79  !material_ids
80  ? 0
81  : *std::max_element(begin(*material_ids), end(*material_ids));
82 
83  if (max_material_id > static_cast<int>(mat_ids.size() - 1))
84  {
85  OGS_FATAL(
86  "The maximum value of MaterialIDs in mesh is {:d}. As the "
87  "given number of porous media definitions in the project file is "
88  "{:d}, the maximum value of MaterialIDs in mesh must be {:d} "
89  "(index starts with zero).",
90  max_material_id, mat_ids.size(), max_material_id - 1);
91  }
92 
93  if (max_material_id < static_cast<int>(mat_ids.size() - 1))
94  WARN(
95  "There are {:d} porous medium definitions in the project file but "
96  "only {:d} different values in the MaterialIDs vector/data_array "
97  "in the mesh.",
98  mat_ids.size(), max_material_id - 1);
99 
100  if (mat_ids.back() != static_cast<int>(mat_ids.size()) - 1)
101  {
102  OGS_FATAL(
103  "The ids in the porous media definitions in the project file have "
104  "to be sequential, starting with the id zero.");
105  }
106 
107  return PorousMediaProperties{std::move(porosity_models),
108  std::move(intrinsic_permeability_models),
109  std::move(storage_models), material_ids};
110 }
void WARN(char const *fmt, Args const &... args)
Definition: Logging.h:37
void reorderVector(std::vector< ValueType > &v, std::vector< IndexType > const &order)
Definition: Algorithm.h:232
std::unique_ptr< Permeability > createPermeabilityModel(BaseLib::ConfigTree const &config, std::vector< std::unique_ptr< ParameterLib::ParameterBase >> const &parameters)
std::unique_ptr< Porosity > createPorosityModel(BaseLib::ConfigTree const &config, std::vector< std::unique_ptr< ParameterLib::ParameterBase >> const &parameters)
std::unique_ptr< Storage > createStorageModel(BaseLib::ConfigTree const &config)
PropertyVector< int > const * materialIDs(Mesh const &mesh)
Definition: Mesh.cpp:258

References createPermeabilityModel(), createPorosityModel(), createStorageModel(), DBUG(), BaseLib::ConfigTree::getConfigAttribute(), BaseLib::ConfigTree::getConfigSubtree(), MeshLib::materialIDs(), OGS_FATAL, BaseLib::reorderVector(), and WARN().

◆ createRelativePermeabilityModel()

std::unique_ptr< RelativePermeability > MaterialLib::PorousMedium::createRelativePermeabilityModel ( BaseLib::ConfigTree const &  config)

Create a capillary pressure model

Parameters
configConfigTree object has a tag of <relative_permeability>
Input File Parameter:
material__porous_medium__relative_permeability__type
Input File Parameter:
material__porous_medium__relative_permeability__type
Input File Parameter:
material__porous_medium__relative_permeability__Curve__curve

Definition at line 164 of file CreateRelativePermeabilityModel.cpp.

166 {
168  auto const type = config.peekConfigParameter<std::string>("type");
169 
170  if (type == "WettingPhaseVanGenuchten")
171  {
172  return createWettingPhaseVanGenuchten(config);
173  }
174  if (type == "NonWettingPhaseVanGenuchten")
175  {
176  return createNonWettingPhaseVanGenuchten(config);
177  }
178  if (type == "WettingPhaseBrooksCoreyOilGas")
179  {
181  }
182  if (type == "NonWettingPhaseBrooksCoreyOilGas")
183  {
185  }
186  if (type == "Curve")
187  {
189  config.checkConfigParameter("type", "Curve");
190 
192  auto const& curve_config = config.getConfigSubtree("curve");
193 
195  MathLib ::PiecewiseLinearInterpolation>(curve_config);
196  return std::make_unique<RelativePermeabilityCurve>(std::move(curve));
197  }
198 
199  OGS_FATAL(
200  "The relative permeability model {:s} is unavailable.\n"
201  "The available models are:"
202  "\n\tWettingPhaseVanGenuchten,"
203  "\n\tNonWettingPhaseVanGenuchten,"
204  "\n\tWettingPhaseBrooksCoreyOilGas,"
205  "\n\tNonWettingPhaseBrooksCoreyOilGas,",
206  "\n\tCurve.\n",
207  type.data());
208 }
std::unique_ptr< RelativePermeability > createWettingPhaseBrooksCoreyOilGas(BaseLib::ConfigTree const &config)
std::unique_ptr< RelativePermeability > createWettingPhaseVanGenuchten(BaseLib::ConfigTree const &config)
std::unique_ptr< RelativePermeability > createNonWettingPhaseBrooksCoreyOilGas(BaseLib::ConfigTree const &config)
std::unique_ptr< RelativePermeability > createNonWettingPhaseVanGenuchten(BaseLib::ConfigTree const &config)

References BaseLib::ConfigTree::checkConfigParameter(), createNonWettingPhaseBrooksCoreyOilGas(), createNonWettingPhaseVanGenuchten(), MathLib::createPiecewiseLinearCurve(), createWettingPhaseBrooksCoreyOilGas(), createWettingPhaseVanGenuchten(), BaseLib::ConfigTree::getConfigSubtree(), OGS_FATAL, and BaseLib::ConfigTree::peekConfigParameter().

Referenced by MaterialLib::TwoPhaseFlowWithPP::createTwoPhaseFlowMaterialProperties(), and ProcessLib::TwoPhaseFlowWithPrho::createTwoPhaseFlowPrhoMaterialProperties().

◆ createStorageModel()

std::unique_ptr< Storage > MaterialLib::PorousMedium::createStorageModel ( BaseLib::ConfigTree const &  config)

Create a storage model

Parameters
configConfigTree object has a tag of <storage>
Input File Parameter:
material__porous_medium__storage__type
Input File Parameter:
material__porous_medium__storage__Constant__value

Definition at line 24 of file createStorageModel.cpp.

25 {
27  auto const type = config.getConfigParameter<std::string>("type");
28 
29  if (type == "Constant")
30  {
31  return std::make_unique<ConstantStorage>(
33  config.getConfigParameter<double>("value"));
34  }
35 
36  OGS_FATAL("The storage type {:s} is unavailable.\n", type.data(),
37  "The available type is Constant.");
38 }

References BaseLib::ConfigTree::getConfigParameter(), and OGS_FATAL.

Referenced by createPorousMediaProperties(), MaterialLib::TwoPhaseFlowWithPP::createTwoPhaseFlowMaterialProperties(), and ProcessLib::TwoPhaseFlowWithPrho::createTwoPhaseFlowPrhoMaterialProperties().

◆ createVanGenuchten()

static std::unique_ptr<CapillaryPressureSaturation> MaterialLib::PorousMedium::createVanGenuchten ( BaseLib::ConfigTree const &  config)
static
Parameters
configConfigTree object which contains the input data including <type>vanGenuchten</type> and it has a tag of <capillary_pressure>
Input File Parameter:
material__porous_medium__capillary_pressure__type
Input File Parameter:
material__porous_medium__capillary_pressure__vanGenuchten__pd
Input File Parameter:
material__porous_medium__capillary_pressure__vanGenuchten__sr
Input File Parameter:
material__porous_medium__capillary_pressure__vanGenuchten__sg_r
Input File Parameter:
material__porous_medium__capillary_pressure__vanGenuchten__smax
Input File Parameter:
material__porous_medium__capillary_pressure__vanGenuchten__m
Input File Parameter:
material__porous_medium__capillary_pressure__vanGenuchten__pc_max
Input File Parameter:
material__porous_medium__capillary_pressure__vanGenuchten__has_regularized

Definition at line 78 of file CreateCapillaryPressureModel.cpp.

80 {
82  config.checkConfigParameter("type", "vanGenuchten");
83 
85  const auto pd = config.getConfigParameter<double>("pd");
86 
88  const auto Sr = config.getConfigParameter<double>("sr");
89 
90  double Sg_r = 0.0;
92  if (auto const Sg_r_ptr = config.getConfigParameterOptional<double>("sg_r"))
93  {
94  DBUG(
95  "Using value {:g} for nonwetting phase residual saturation in "
96  "capillary pressure model.",
97  (*Sg_r_ptr));
98  Sg_r = *Sg_r_ptr;
99  }
100 
102  const auto Smax = config.getConfigParameter<double>("smax");
103 
105  const auto m = config.getConfigParameter<double>("m");
106  if (m < 0. || m > 1.0)
107  {
108  OGS_FATAL(
109  "The exponent parameter of van Genuchten capillary pressure "
110  "saturation model, m, must be in an interval of [0, 1]");
111  }
113  const auto Pc_max = config.getConfigParameter<double>("pc_max");
114 
115  bool has_regularized = false;
116  if (auto const has_regularized_conf =
118  config.getConfigParameterOptional<bool>("has_regularized"))
119  {
120  DBUG("capillary pressure model: {:s}",
121  (*has_regularized_conf) ? "true" : "false");
122  has_regularized = *has_regularized_conf;
123  }
124  return std::make_unique<VanGenuchtenCapillaryPressureSaturation>(
125  pd, Sr, Sg_r, Smax, m, Pc_max, has_regularized);
126 }

References BaseLib::ConfigTree::checkConfigParameter(), DBUG(), BaseLib::ConfigTree::getConfigParameter(), BaseLib::ConfigTree::getConfigParameterOptional(), and OGS_FATAL.

Referenced by createCapillaryPressureModel().

◆ createWettingPhaseBrooksCoreyOilGas()

std::unique_ptr<RelativePermeability> MaterialLib::PorousMedium::createWettingPhaseBrooksCoreyOilGas ( BaseLib::ConfigTree const &  config)
Parameters
configConfigTree object which contains the input data including <type>WettingPhaseBrooksCoreyOilGas</type> and it has a tag of <relative_permeability>
Input File Parameter:
material__porous_medium__relative_permeability__type
Input File Parameter:
material__porous_medium__relative_permeability__WettingPhaseBrooksCoreyOilGas__sr
Input File Parameter:
material__porous_medium__relative_permeability__WettingPhaseBrooksCoreyOilGas__smax
Input File Parameter:
material__porous_medium__relative_permeability__WettingPhaseBrooksCoreyOilGas__m
Input File Parameter:
material__porous_medium__relative_permeability__WettingPhaseBrooksCoreyOilGas__krel_min

Definition at line 103 of file CreateRelativePermeabilityModel.cpp.

105 {
107  config.checkConfigParameter("type", "WettingPhaseBrooksCoreyOilGas");
108 
110  const auto Sr = config.getConfigParameter<double>("sr");
111 
113  const auto Smax = config.getConfigParameter<double>("smax");
114 
116  const auto m = config.getConfigParameter<double>("m");
117  if (m < 1.0) // m >= 1
118  {
119  OGS_FATAL(
120  "The exponent parameter of WettingPhaseBrooksCoreyOilGas\n"
121  "relative permeability model, m, must not be smaller than 1");
122  }
123 
125  const auto krel_min = config.getConfigParameter<double>("krel_min");
126 
127  return std::make_unique<WettingPhaseBrooksCoreyOilGas>(
128  Sr, Smax, m, krel_min);
129 }

References BaseLib::ConfigTree::checkConfigParameter(), BaseLib::ConfigTree::getConfigParameter(), and OGS_FATAL.

Referenced by createRelativePermeabilityModel().

◆ createWettingPhaseVanGenuchten()

std::unique_ptr<RelativePermeability> MaterialLib::PorousMedium::createWettingPhaseVanGenuchten ( BaseLib::ConfigTree const &  config)
Parameters
configConfigTree object which contains the input data including <type>WettingPhaseVanGenuchten</type> and it has a tag of <relative_permeability>
Input File Parameter:
material__porous_medium__relative_permeability__type
Input File Parameter:
material__porous_medium__relative_permeability__WettingPhaseVanGenuchten__sr
Input File Parameter:
material__porous_medium__relative_permeability__WettingPhaseVanGenuchten__smax
Input File Parameter:
material__porous_medium__relative_permeability__WettingPhaseVanGenuchten__m
Input File Parameter:
material__porous_medium__relative_permeability__WettingPhaseVanGenuchten__krel_min

Definition at line 40 of file CreateRelativePermeabilityModel.cpp.

42 {
44  config.checkConfigParameter("type", "WettingPhaseVanGenuchten");
45 
47  const auto Sr = config.getConfigParameter<double>("sr");
48 
50  const auto Smax = config.getConfigParameter<double>("smax");
51 
53  const auto m = config.getConfigParameter<double>("m");
54  if (m < 0. || m > 1.0)
55  {
56  OGS_FATAL(
57  "The exponent parameter of WettingPhaseVanGenuchten relative\n"
58  " permeability model, m, must be in an interval of [0, 1]");
59  }
61  const auto krel_min = config.getConfigParameter<double>("krel_min");
62 
63  return std::make_unique<WettingPhaseVanGenuchten>(Sr, Smax, m, krel_min);
64 }

References BaseLib::ConfigTree::checkConfigParameter(), BaseLib::ConfigTree::getConfigParameter(), and OGS_FATAL.

Referenced by createRelativePermeabilityModel().