OGS
MaterialPropertyLib Namespace Reference

Namespaces

namespace  anonymous_namespace{CreateFunction.cpp}
namespace  IAPWSIF97Region1
namespace  IAPWSIF97Region4

Classes

class  AverageMolarMass
class  BishopsPowerLaw
 Bishop's power law for effective stress. More...
class  BishopsSaturationCutoff
class  CapillaryPressureRegularizedVanGenuchten
 This class handles the computation of the capillary pressure, \( p_c(S_l) \), with the capillary pressure regularization. More...
class  CapillaryPressureVanGenuchten
 The van Genuchten capillary pressure model. More...
class  ClausiusClapeyron
class  Component
 This class defines components (substances). More...
class  Constant
struct  CubicLawPermeability
class  Curve
struct  D2ValueConfig
struct  D2ValueExpression
struct  DriftFluxState
class  DupuitPermeability
class  EffectiveThermalConductivityPorosityMixing
class  EmbeddedFracturePermeability
 Permeability model as proposed by Olivella&Alonso. More...
struct  ExponentData
class  Exponential
struct  FormEigenTensor
struct  FormEigenVector
struct  FormKelvinVector
class  Function
class  GasPressureDependentPermeability
 A gas pressure dependent intrinsic permeability model. More...
struct  GetSymmetricTensor
class  IdealGasLaw
 Density function for ideal gases. More...
class  IdealGasLawBinaryMixture
 Density function for binary ideal gases. More...
struct  IndependentVariable
class  KozenyCarmanModel
 Kozeny-Carman equation. More...
class  Linear
class  LinearSaturationSwellingStress
 This class defines a linear saturation rate dependent swelling stress model for the materials that swell strongly when water content increases. More...
class  LinearWaterVapourLatentHeat
 An empirical function for the latent heat of vaporization of liquid water, which is given by [37] p.786f. More...
class  LiquidViscosityVogels
class  MaterialSpatialDistributionMap
class  Medium
class  OrthotropicEmbeddedFracturePermeability
 Extended Permeability model based on Olivella&Alonso. More...
class  Parameter
class  PengRobinson
 Peng-Robinson equation of state. More...
class  PermeabilityMohrCoulombFailureIndexModel
 A failure index dependent permeability model [44]. More...
class  PermeabilityOrthotropicPowerLaw
struct  PerThreadData
class  Phase
class  PorosityFromMassBalance
class  Property
class  RelPermBrooksCorey
 Relative permeability function of the wetting phase proposed by Brooks&Corey. More...
class  RelPermBrooksCoreyNonwettingPhase
 Relative permeability function of the non-wetting phase proposed by Brooks&Corey. More...
class  RelPermGeneralizedPower
class  RelPermGeneralizedPowerNonwettingPhase
class  RelPermLiakopoulos
 Relative permeability function for the wetting phase of the Liakopoulos experiment. More...
class  RelPermNonWettingPhaseVanGenuchtenMualem
class  RelPermUdell
class  RelPermUdellNonwettingPhase
class  RelPermVanGenuchten
class  SaturationBrooksCorey
 A well known soil characteristics function. More...
class  SaturationDependentSwelling
class  SaturationExponential
 A simplistic soil characteristics function. More...
class  SaturationLiakopoulos
 A well known soil characteristics function. More...
class  SaturationLuMcCartney
 The Lu - Mc Cartney water retention behavior. More...
class  SaturationVanGenuchten
 The van Genuchten capillary pressure model. More...
class  SaturationVanGenuchtenWithVolumetricStrain
 A strain dependent bimodal water retention model. More...
class  SaturationWeightedThermalConductivity
 Saturation dependent thermal conductivity model for soil. More...
struct  ScalarCopyOp
class  Sigmoid
class  SpecificHeatCapacityWithLatentHeat
class  StrainDependentPermeability
 A strain dependent intrinsic permeability model. More...
class  TemperatureDependentDiffusion
class  TransportPorosityFromMassBalance
class  VapourDiffusionDeVries
 DeVries type Vapour diffusion. More...
class  VapourDiffusionFEBEX
 FEBEX type Vapour diffusion. More...
class  VapourDiffusionPMQ
 The Penman-Millington-Quirk (PMQ) Vapour diffusion model. More...
class  VariableArray
struct  VariablePair
class  VermaPruessModel
 Verma-Pruess equation [43]. More...
struct  VogelsViscosityConstantsCH4
struct  VogelsViscosityConstantsCO2
struct  VogelsViscosityConstantsWater
struct  VoidFractionQuadratic
class  VolumeFractionAverage
struct  Water
class  WaterDensityIAPWSIF97Region1
class  WaterEnthalpyIAPWSIF97Region1
struct  WaterLiquidDensityIAPWSIF97Region4
struct  WaterLiquidEnthalpyIAPWSIF97Region4
struct  WaterSaturationTemperatureIAPWSIF97Region4
class  WaterTemperatureIAPWSIF97Region1
class  WaterThermalConductivityIAPWS
 A class for thermal conductivity model that is defined by The International Association for the Properties of Water and Steam IAPWS (File accessed at 13.01.2023) - (Daucik and Dooley, 2011) More...
class  WaterVapourDensity
 A model for water vapour density in the unsaturated porous media. More...
class  WaterVapourDensityIAPWSIF97Region4
class  WaterVapourEnthalpyIAPWSIF97Region4
class  WaterVapourLatentHeatWithCriticalTemperature
 A latent heat model of vaporisation of water considering the critical temperature. More...
class  WaterViscosityIAPWS
 A class for viscosity model that is defined by The International Association for the Properties of Water and Steam IAPWS More...
struct  ZeroInitPropertyDataType

Typedefs

using PropertyArray
using StringOrVariable = std::variant<std::string, Variable>
using PropertyDataType
template<int GlobalDim>
using SymmetricTensor
template<int Dim>
using Tensor = Eigen::Matrix<double, tensorSize(Dim), 1>
using VariableType

Enumerations

enum class  PhaseName { Solid , AqueousLiquid , Gas , FrozenLiquid }
 Enumeration of phase types. More...
enum class  MeanType { ARITHMETIC_LINEAR , ARITHMETIC_SQUAREROOT , GEOMETRIC }
enum  PropertyType : int {
  acentric_factor , binary_interaction_coefficient , biot_coefficient , bishops_effective_stress ,
  brooks_corey_exponent , bulk_modulus , capillary_pressure , compressibility ,
  concentration , critical_density , critical_pressure , critical_temperature ,
  decay_rate , density , diffusion , drhodT ,
  effective_stress , enthalpy , entry_pressure , evaporation_enthalpy ,
  fredlund_parameters , frozen_liquid_saturation , heat_capacity , henry_coefficient ,
  longitudinal_dispersivity , molality , molar_mass , molar_volume ,
  mole_fraction , molecular_diffusion , name , permeability ,
  phase_change_expansivity , phase_velocity , poissons_ratio , pore_diffusion ,
  porosity , reference_density , reference_pressure , reference_temperature ,
  relative_permeability , relative_permeability_nonwetting_phase , residual_gas_saturation , residual_liquid_saturation ,
  retardation_factor , saturation , saturation_density , saturation_enthalpy ,
  saturation_micro , saturation_temperature , specific_heat_capacity , specific_latent_heat ,
  storage , storage_contribution , swelling_stress_rate , temperature ,
  thermal_conductivity , thermal_diffusion_enhancement_factor , thermal_expansivity , thermal_expansivity_contribution ,
  thermal_longitudinal_dispersivity , thermal_osmosis_coefficient , thermal_osmosis_permeability , thermal_transversal_dispersivity ,
  tortuosity , transport_porosity , transversal_dispersivity , vapour_pressure ,
  viscosity , volume_fraction , youngs_modulus , number_of_properties
}
enum class  Variable : int {
  capillary_pressure , concentration , deformation_gradient , density ,
  effective_pore_pressure , enthalpy , enthalpy_of_evaporation , equivalent_plastic_strain ,
  fracture_aperture , frozen_liquid_saturation , grain_compressibility , liquid_phase_pressure ,
  liquid_saturation , mechanical_strain , molar_mass , molar_mass_derivative ,
  molar_fraction , gas_phase_pressure , porosity , solid_grain_pressure ,
  stress , temperature , total_strain , total_stress ,
  transport_porosity , vapour_pressure , volumetric_mechanical_strain , volumetric_strain ,
  number_of_variables
}

Functions

template<typename ContainerMedium, typename ContainerSolid, typename ContainerLiquid, typename ContainerGas>
void checkMaterialSpatialDistributionMap (MeshLib::Mesh const &mesh, MaterialPropertyLib::MaterialSpatialDistributionMap const &media_map, ContainerMedium const &required_properties_medium, ContainerSolid const &required_properties_solid_phase, ContainerLiquid const &required_properties_liquid_phase, ContainerGas const &required_properties_gas_phase)
void checkRequiredProperties (Component const &c, std::span< PropertyType const > const required_properties)
std::unique_ptr< ComponentnewComponent (std::string const &component_name, bool &isCustomComponent)
std::vector< std::unique_ptr< Component > > createComponents (int const geometry_dimension, std::optional< BaseLib::ConfigTree > const &config, std::vector< std::unique_ptr< ParameterLib::ParameterBase > > &parameters, ParameterLib::CoordinateSystem const *const local_coordinate_system, std::map< std::string, std::unique_ptr< MathLib::PiecewiseLinearInterpolation > > const &curves)
MaterialSpatialDistributionMap createMaterialSpatialDistributionMap (std::map< int, std::shared_ptr< Medium > > const &media, MeshLib::Mesh const &mesh)
std::unique_ptr< MediumcreateMedium (int const material_id, int const geometry_dimension, BaseLib::ConfigTree const &config, std::vector< std::unique_ptr< ParameterLib::ParameterBase > > &parameters, ParameterLib::CoordinateSystem const *const local_coordinate_system, std::map< std::string, std::unique_ptr< MathLib::PiecewiseLinearInterpolation > > const &curves)
std::vector< std::unique_ptr< Phase > > createPhases (int const geometry_dimension, std::optional< BaseLib::ConfigTree > const &config, std::vector< std::unique_ptr< ParameterLib::ParameterBase > > &parameters, ParameterLib::CoordinateSystem const *const local_coordinate_system, std::map< std::string, std::unique_ptr< MathLib::PiecewiseLinearInterpolation > > const &curves)
std::unique_ptr< PropertyArraycreateProperties (int const geometry_dimension, std::optional< BaseLib::ConfigTree > const &config, std::vector< std::unique_ptr< ParameterLib::ParameterBase > > &parameters, ParameterLib::CoordinateSystem const *const local_coordinate_system, std::map< std::string, std::unique_ptr< MathLib::PiecewiseLinearInterpolation > > const &curves)
void checkRequiredProperties (Medium const &medium, std::span< PropertyType const > const required_properties)
Phase const & fluidPhase (Medium const &medium)
 Returns a gas or aqueous liquid phase of the given medium.
Phase const * getOptionalPhase (Medium const &medium, PhaseName phase_name)
std::string_view toString (PhaseName phase_name)
 Convert phase enum to its string representation.
PhaseName fromString (std::string const &phase_name)
 Convert string to phase enum. Throws if invalid phase name.
void checkRequiredProperties (Phase const &phase, std::span< PropertyType const > const required_properties)
void checkSaturationRange (const double Sl)
std::unique_ptr< PropertycreateCapillaryPressureRegularizedVanGenuchten (BaseLib::ConfigTree const &config)
std::unique_ptr< PropertycreateCapillaryPressureVanGenuchten (BaseLib::ConfigTree const &config)
std::unique_ptr< SaturationBrooksCoreycreateSaturationBrooksCorey (BaseLib::ConfigTree const &config)
std::unique_ptr< SaturationExponentialcreateSaturationExponential (BaseLib::ConfigTree const &config)
std::unique_ptr< SaturationLiakopouloscreateSaturationLiakopoulos (BaseLib::ConfigTree const &config)
std::unique_ptr< SaturationLuMcCartneycreateSaturationLuMcCartney (BaseLib::ConfigTree const &config)
std::unique_ptr< SaturationVanGenuchtencreateSaturationVanGenuchten (BaseLib::ConfigTree const &config)
std::unique_ptr< SaturationVanGenuchtenWithVolumetricStraincreateSaturationVanGenuchtenWithVolumetricStrain (BaseLib::ConfigTree const &config)
std::unique_ptr< AverageMolarMasscreateAverageMolarMass (BaseLib::ConfigTree const &config)
std::unique_ptr< BishopsPowerLawcreateBishopsPowerLaw (BaseLib::ConfigTree const &config)
std::unique_ptr< BishopsSaturationCutoffcreateBishopsSaturationCutoff (BaseLib::ConfigTree const &config)
std::unique_ptr< ClausiusClapeyroncreateClausiusClapeyron (BaseLib::ConfigTree const &config)
std::unique_ptr< ConstantcreateConstant (BaseLib::ConfigTree const &config)
std::unique_ptr< PropertycreateCubicLawPermeability (BaseLib::ConfigTree const &config, std::vector< std::unique_ptr< ParameterLib::ParameterBase > > const &parameters)
std::unique_ptr< CurvecreateCurve (BaseLib::ConfigTree const &config, std::map< std::string, std::unique_ptr< MathLib::PiecewiseLinearInterpolation > > const &curves)
std::unique_ptr< DupuitPermeabilitycreateDupuitPermeability (BaseLib::ConfigTree const &config, std::vector< std::unique_ptr< ParameterLib::ParameterBase > > const &parameters)
std::unique_ptr< PropertycreateEffectiveThermalConductivityPorosityMixing (int const geometry_dimension, BaseLib::ConfigTree const &config, ParameterLib::CoordinateSystem const *const local_coordinate_system)
std::unique_ptr< PropertycreateEmbeddedFracturePermeability (int const geometry_dimension, BaseLib::ConfigTree const &config, std::vector< std::unique_ptr< ParameterLib::ParameterBase > > const &parameters)
std::unique_ptr< ExponentialcreateExponential (BaseLib::ConfigTree const &config)
std::unique_ptr< FunctioncreateFunction (BaseLib::ConfigTree const &config, std::map< std::string, std::unique_ptr< MathLib::PiecewiseLinearInterpolation > > const &curves)
std::unique_ptr< PropertycreateGasPressureDependentPermeability (int const geometry_dimension, BaseLib::ConfigTree const &config, std::vector< std::unique_ptr< ParameterLib::ParameterBase > > const &parameters, ParameterLib::CoordinateSystem const *const local_coordinate_system)
std::unique_ptr< IdealGasLawcreateIdealGasLaw (BaseLib::ConfigTree const &config)
std::unique_ptr< IdealGasLawBinaryMixturecreateIdealGasLawBinaryMixture (BaseLib::ConfigTree const &config)
std::unique_ptr< PropertycreateKozenyCarmanModel (BaseLib::ConfigTree const &config, std::vector< std::unique_ptr< ParameterLib::ParameterBase > > const &parameters)
std::unique_ptr< LinearcreateLinear (BaseLib::ConfigTree const &config)
std::unique_ptr< PropertycreateOrthotropicEmbeddedFracturePermeability (int const geometry_dimension, BaseLib::ConfigTree const &config, std::vector< std::unique_ptr< ParameterLib::ParameterBase > > const &parameters)
std::unique_ptr< ParametercreateParameterProperty (BaseLib::ConfigTree const &config, std::vector< std::unique_ptr< ParameterLib::ParameterBase > > const &parameters)
std::unique_ptr< PropertycreatePengRobinson (BaseLib::ConfigTree const &config)
std::unique_ptr< PropertycreatePermeabilityMohrCoulombFailureIndexModel (int const geometry_dimension, BaseLib::ConfigTree const &config, std::vector< std::unique_ptr< ParameterLib::ParameterBase > > const &parameters, ParameterLib::CoordinateSystem const *const local_coordinate_system)
std::unique_ptr< PropertycreatePermeabilityOrthotropicPowerLaw (BaseLib::ConfigTree const &config, ParameterLib::CoordinateSystem const *const local_coordinate_system)
std::unique_ptr< PorosityFromMassBalancecreatePorosityFromMassBalance (BaseLib::ConfigTree const &config, std::vector< std::unique_ptr< ParameterLib::ParameterBase > > const &parameters)
std::unique_ptr< SaturationDependentSwellingcreateSaturationDependentSwelling (BaseLib::ConfigTree const &config, ParameterLib::CoordinateSystem const *const local_coordinate_system)
std::unique_ptr< PropertycreateSaturationDependentThermalConductivity (BaseLib::ConfigTree const &config)
std::unique_ptr< SigmoidcreateSigmoid (BaseLib::ConfigTree const &config)
 Create a Sigmoid property from XML configuration.
std::unique_ptr< SpecificHeatCapacityWithLatentHeatcreateSpecificHeatCapacityWithLatentHeat (BaseLib::ConfigTree const &config)
std::unique_ptr< PropertycreateStrainDependentPermeability (int const geometry_dimension, BaseLib::ConfigTree const &config, std::vector< std::unique_ptr< ParameterLib::ParameterBase > > const &parameters, ParameterLib::CoordinateSystem const *const local_coordinate_system)
std::unique_ptr< PropertycreateTemperatureDependentDiffusion (BaseLib::ConfigTree const &config, std::vector< std::unique_ptr< ParameterLib::ParameterBase > > const &parameters)
std::unique_ptr< TransportPorosityFromMassBalancecreateTransportPorosityFromMassBalance (BaseLib::ConfigTree const &config, std::vector< std::unique_ptr< ParameterLib::ParameterBase > > const &parameters)
std::unique_ptr< PropertycreateVermaPruessModel (BaseLib::ConfigTree const &config, std::vector< std::unique_ptr< ParameterLib::ParameterBase > > const &parameters)
std::unique_ptr< VolumeFractionAveragecreateVolumeFractionAverage (BaseLib::ConfigTree const &config)
std::unique_ptr< PropertycreateWaterSaturationTemperatureIAPWSIF97Region4 (BaseLib::ConfigTree const &config)
std::unique_ptr< PropertycreateWaterTemperatureIAPWSIF97Region1 (BaseLib::ConfigTree const &config)
std::unique_ptr< PropertycreateWaterDensityIAPWSIF97Region1 (BaseLib::ConfigTree const &config)
std::unique_ptr< PropertycreateWaterLiquidDensityIAPWSIF97Region4 (BaseLib::ConfigTree const &config)
std::unique_ptr< PropertycreateWaterVapourDensity (BaseLib::ConfigTree const &config)
std::unique_ptr< PropertycreateWaterVapourDensityIAPWSIF97Region4 (BaseLib::ConfigTree const &config)
static double saturatedVaporDensity (double const T)
 \(\rho_{vS}\)
static double dsaturatedVaporDensitydT (double const T)
 \(\frac{\partial \rho_{vS}}{\partial T}\)
static double humidity (double const T, double const p, double const water_density)
std::unique_ptr< PropertycreateLinearWaterVapourLatentHeat (BaseLib::ConfigTree const &config)
std::unique_ptr< PropertycreateWaterEnthalpyIAPWSIF97Region1 (BaseLib::ConfigTree const &config)
std::unique_ptr< PropertycreateWaterLiquidEnthalpyIAPWSIF97Region4 (BaseLib::ConfigTree const &config)
std::unique_ptr< PropertycreateWaterVapourEnthalpyIAPWSIF97Region4 (BaseLib::ConfigTree const &config)
std::unique_ptr< PropertycreateWaterVapourLatentHeatWithCriticalTemperature (BaseLib::ConfigTree const &config)
template<int D>
static exprtk::symbol_table< double > createSymbolTable (std::vector< std::string > const &expression_symbol_names, bool const spatial_position_is_required, std::vector< std::string > const &used_curve_names, std::map< std::string, std::unique_ptr< MathLib::PiecewiseLinearInterpolation > > const &curves, VariableArray &variable_array, std::map< std::string, ParameterLib::CurveWrapper > &curve_wrappers)
template<std::size_t N>
static std::array< double, N > evaluateToArray (std::vector< exprtk::expression< double > > const &expressions)
static int currentThreadId (std::string const &property_name, std::size_t const num_slots)
std::unique_ptr< RelPermBrooksCoreycreateRelPermBrooksCorey (BaseLib::ConfigTree const &config)
std::unique_ptr< RelPermBrooksCoreyNonwettingPhasecreateRelPermBrooksCoreyNonwettingPhase (BaseLib::ConfigTree const &config)
std::unique_ptr< RelPermGeneralizedPowercreateRelPermGeneralizedPower (BaseLib::ConfigTree const &config)
std::unique_ptr< RelPermGeneralizedPowerNonwettingPhasecreateRelPermGeneralizedPowerNonwettingPhase (BaseLib::ConfigTree const &config)
std::unique_ptr< RelPermLiakopouloscreateRelPermLiakopoulos (BaseLib::ConfigTree const &config)
std::unique_ptr< PropertycreateRelPermNonWettingPhaseVanGenuchtenMualem (BaseLib::ConfigTree const &config)
std::unique_ptr< RelPermUdellcreateRelPermUdell (BaseLib::ConfigTree const &config)
std::unique_ptr< RelPermUdellNonwettingPhasecreateRelPermUdellNonwettingPhase (BaseLib::ConfigTree const &config)
std::unique_ptr< RelPermVanGenuchtencreateRelPermVanGenuchten (BaseLib::ConfigTree const &config)
double computeVanGenuchtenMualemValue (const double S_L, const double S_L_r, const double S_L_max, const double m)
static std::optional< std::pair< double, double > > normalizedState (double const f, double const lower_bound, double const upper_bound)
std::unique_ptr< PropertycreateLinearSaturationSwellingStress (BaseLib::ConfigTree const &config)
std::unique_ptr< PropertycreateSaturationWeightedThermalConductivity (int const geometry_dimension, BaseLib::ConfigTree const &config, std::vector< std::unique_ptr< ParameterLib::ParameterBase > > &parameters)
std::unique_ptr< PropertycreateSoilThermalConductivitySomerton (BaseLib::ConfigTree const &config)
std::unique_ptr< PropertycreateWaterThermalConductivityIAPWS (BaseLib::ConfigTree const &config)
template<MeanType MeanType>
double computeAverage (const double, double const, double const)=delete
template<MeanType MeanType>
double computeDAverage (const double, double const, double const)=delete
template<>
double computeAverage< MeanType::ARITHMETIC_LINEAR > (const double S, double const k_dry, double const k_wet)
template<>
double computeDAverage< MeanType::ARITHMETIC_LINEAR > (const double, double const k_dry, double const k_wet)
template<>
double computeAverage< MeanType::ARITHMETIC_SQUAREROOT > (const double S, double const k_dry, double const k_wet)
template<>
double computeDAverage< MeanType::ARITHMETIC_SQUAREROOT > (const double S, double const k_dry, double const k_wet)
template<>
double computeAverage< MeanType::GEOMETRIC > (const double S, double const k_dry, double const k_wet)
template<>
double computeDAverage< MeanType::GEOMETRIC > (const double S, double const k_dry, double const k_wet)
static double computeBarLambda0Factor (const double barT)
static std::array< double, 5 > computeSeriesFactorTForLambda1 (const double barT)
static std::array< double, 6 > computeSeriesFactorRhoForLambda1 (const double bar_rho)
static double computeBarLambda1Factor (const std::array< double, 5 > &series_factorT, const std::array< double, 6 > &series_factorRho)
static double computedBarLambda_dbarT (const double barT, double bar_rho)
static double computedBarLambda_dbarRho (const double barT, double bar_rho)
std::unique_ptr< PropertycreateVapourDiffusionDeVries (BaseLib::ConfigTree const &config)
std::unique_ptr< PropertycreateVapourDiffusionFEBEX (BaseLib::ConfigTree const &config)
std::unique_ptr< PropertycreateVapourDiffusionPMQ (BaseLib::ConfigTree const &config)
std::unique_ptr< PropertycreateLiquidViscosityVogels (BaseLib::ConfigTree const &config)
std::unique_ptr< PropertycreateWaterViscosityIAPWS (BaseLib::ConfigTree const &config)
static double computeBarMu0Factor (const double barT)
static std::array< double, 6 > computeSeriesFactorTForMu1 (const double barT)
static std::array< double, 7 > computeSeriesFactorRhoForMu1 (const double bar_rho)
static double computeBarMu1Factor (const std::array< double, 6 > &series_factorT, const std::array< double, 7 > &series_factorRho)
static double computedBarMu_dbarT (const double barT, double bar_rho)
static double computedBarMu_dbarRho (const double barT, double bar_rho)
double computeTemperature (double const pi, double const eta)
PropertyDataType fromVector (std::vector< double > const &values)
template<std::size_t N>
PropertyDataType fromArray (std::array< double, N > const &values)
void overwriteExistingProperties (PropertyArray &properties, PropertyArray &new_properties, std::variant< Medium *, Phase *, Component * > scale_pointer)
void updatePropertiesForAllPhases (PropertyArray &properties, std::vector< std::unique_ptr< Phase > > const &phases)
PropertyType convertStringToProperty (std::string const &string)
void checkMPLPhasesForSinglePhaseFlow (MeshLib::Mesh const &mesh, MaterialPropertyLib::MaterialSpatialDistributionMap const &media_map)
void checkVanGenuchtenExponentRange (const double m)
static double closureSlipParameter (DriftFluxState const &state)
static DriftFluxState alignDriftWithFlow (DriftFluxState const &state)
double alignedDriftFluxVelocity (double const u_gu, double const v_mix)
double driftFluxProfileParameter (double const dryness)
VoidFractionQuadratic voidFractionQuadratic (DriftFluxState const &state)
double voidFractionResidual (double const alpha, DriftFluxState const &state)
std::string voidFractionClosureDiagnostics (DriftFluxState const &state)
double driftFluxVelocity (double const dryness, double const temperature, double const vapour_water_density, double const liquid_water_density)
DriftFluxState driftFluxState (double const dryness, double const temperature, double const vapour_water_density, double const liquid_water_density, double const v_mix)
std::optional< double > computeVapourVoidFraction (DriftFluxState const &state)
double mixtureSlipParameter (double const alpha, DriftFluxState const &state)
template<int GlobalDim>
Eigen::Matrix< double, GlobalDim, GlobalDim > formEffectiveThermalConductivity (MaterialPropertyLib::PropertyDataType const &solid_thermal_conductivity, const double fluid_thermal_conductivity, const double porosity)
template Eigen::Matrix< double, 1, 1 > formEffectiveThermalConductivity< 1 > (MaterialPropertyLib::PropertyDataType const &solid_thermal_conductivity, const double fluid_thermal_conductivity, const double porosity)
template Eigen::Matrix< double, 2, 2 > formEffectiveThermalConductivity< 2 > (MaterialPropertyLib::PropertyDataType const &solid_thermal_conductivity, const double fluid_thermal_conductivity, const double porosity)
template Eigen::Matrix< double, 3, 3 > formEffectiveThermalConductivity< 3 > (MaterialPropertyLib::PropertyDataType const &solid_thermal_conductivity, const double fluid_thermal_conductivity, const double porosity)
template Eigen::Matrix< double, 1, 1 > formEigenTensor< 1 > (MaterialPropertyLib::PropertyDataType const &values)
template Eigen::Matrix< double, 2, 2 > formEigenTensor< 2 > (MaterialPropertyLib::PropertyDataType const &values)
template Eigen::Matrix< double, 3, 3 > formEigenTensor< 3 > (MaterialPropertyLib::PropertyDataType const &values)
template Eigen::Matrix< double, 4, 4 > formEigenTensor< 4 > (MaterialPropertyLib::PropertyDataType const &values)
template Eigen::Matrix< double, 6, 6 > formEigenTensor< 6 > (MaterialPropertyLib::PropertyDataType const &values)
template<int GlobalDim>
constexpr Eigen::Matrix< double, GlobalDim, GlobalDim > formEigenTensor (MaterialPropertyLib::PropertyDataType const &values)
template<int GlobalDim>
Eigen::Matrix< double, GlobalDim, 1 > formEigenVector (MaterialPropertyLib::PropertyDataType const &values)
template Eigen::Matrix< double, 1, 1 > formEigenVector< 1 > (MaterialPropertyLib::PropertyDataType const &values)
template Eigen::Matrix< double, 2, 1 > formEigenVector< 2 > (MaterialPropertyLib::PropertyDataType const &values)
template Eigen::Matrix< double, 3, 1 > formEigenVector< 3 > (MaterialPropertyLib::PropertyDataType const &values)
template<int GlobalDim>
MathLib::KelvinVector::KelvinVectorType< GlobalDim > formKelvinVector (MaterialPropertyLib::PropertyDataType const &values)
 A function to form a Kelvin vector from strain or stress alike property like thermal expansivity for thermal strain.
template MathLib::KelvinVector::KelvinVectorType< 2 > formKelvinVector< 2 > (MaterialPropertyLib::PropertyDataType const &values)
template MathLib::KelvinVector::KelvinVectorType< 3 > formKelvinVector< 3 > (MaterialPropertyLib::PropertyDataType const &values)
double getFluidDensity (double const t, double const dt, ParameterLib::SpatialPosition const &pos, Phase const &fluid_phase, VariableArray &vars)
 It computes fluid density for single phase flow model.
std::tuple< double, double > getFluidDensityAndViscosity (double const t, double const dt, ParameterLib::SpatialPosition const &pos, Phase const &fluid_phase, VariableArray &vars)
 It computes fluid density and viscosity for single phase flow model.
double getLiquidThermalExpansivity (Phase const &phase, VariableArray const &vars, const double density, ParameterLib::SpatialPosition const &pos, double const t, double const dt)
template<int GlobalDim>
SymmetricTensor< GlobalDim > getSymmetricTensor (MaterialPropertyLib::PropertyDataType const &values)
template Eigen::Matrix< double, 4, 1 > getSymmetricTensor< 2 > (MaterialPropertyLib::PropertyDataType const &values)
template Eigen::Matrix< double, 6, 1 > getSymmetricTensor< 3 > (MaterialPropertyLib::PropertyDataType const &values)
double steamDryness (double const enthalpy, double const h_sat_liquid, double const h_sat_vapour)
constexpr int tensorSize (int dim)
 See Tensor type for details.
Variable convertStringToVariable (std::string const &string)
static VariableArray::VariablePointer dropConst (VariableArray::VariablePointerConst const const_pointer)

Variables

const MaterialLib::Fluid::DimensionLessGibbsFreeEnergyRegion1 gibbs_free_energy_
static constexpr double ref_T_ = 1386
 reference temperature in K.
static constexpr double ref_p_ = 1.653e7
 reference pressure in Pa.
constexpr double T_c
 Critical temperature.
constexpr double alpha = 1. / 8.
constexpr double beta = 1. / 3.
constexpr double Delta = 0.79 - beta
constexpr std::array c
static constexpr double max_exp_argument
static constexpr double unused_dt = std::numeric_limits<double>::quiet_NaN()
static const double Li [5]
static const double Lij [5][6]
static const double Hi [4] = {1.67752, 2.20462, 0.6366564, -0.241605}
static const double Hij [6][7]
static constexpr std::array n_T
static constexpr std::array I_T
static constexpr std::array J_T
static const std::array< std::string, PropertyType::number_of_propertiesproperty_enum_to_string
static constexpr const char error_info []
template<int GlobalDim>
constexpr int symmetric_tensor_size
static const std::array< std::string, static_cast< int >(Variable::number_of_variables)> variable_enum_to_string
static const VariableArray EmptyVariableArray {}

Typedef Documentation

◆ PropertyArray

Initial value:
std::array<std::unique_ptr<Property>, PropertyType::number_of_properties>

This data type is based on a std::array. It can hold pointers to objects of class Property or its inheritors. The size of this array is determined by the number of entries of the PropertyType enumerator.

Definition at line 34 of file CreateProperty.h.

◆ PropertyDataType

Initial value:
std::variant<double, Eigen::Matrix<double, 2, 1>,
Eigen::Matrix<double, 3, 1>, Eigen::Matrix<double, 2, 2>,
Eigen::Matrix<double, 3, 3>, Eigen::Matrix<double, 4, 1>,
Eigen::Matrix<double, 6, 1>, Eigen::MatrixXd>

Definition at line 24 of file MaterialLib/MPL/Property.h.

◆ StringOrVariable

typedef std::variant< std::string, Variable > MaterialPropertyLib::StringOrVariable = std::variant<std::string, Variable>

Definition at line 12 of file Curve.h.

◆ SymmetricTensor

template<int GlobalDim>
using MaterialPropertyLib::SymmetricTensor
Initial value:
Eigen::Matrix<double, symmetric_tensor_size<GlobalDim>, 1>

Definition at line 18 of file GetSymmetricTensor.h.

◆ Tensor

template<int Dim>
using MaterialPropertyLib::Tensor = Eigen::Matrix<double, tensorSize(Dim), 1>

The tensor's components in 3D case are ordered in the usual way: (1,1), (1,2), (1,3) (2,1), (2,2), (2,3) (3,1), (3,2), (3,3).

For the 2D case the 2x2 block is as usual and is followed by the (3,3) component: (1,1), (1,2), (2,1), (2,2), (3,3).

For the 1D case only the diagonal is stored: (1,1), (2,2), (3,3).

Definition at line 46 of file Tensor.h.

◆ VariableType

Initial value:
std::variant<std::monostate,
double,
Eigen::Vector<double, 4>,
Eigen::Vector<double, 5>,
Eigen::Vector<double, 6>,
Eigen::Vector<double, 9>>

Data type for primary variables, designed to contain both scalar and vector data.

Definition at line 86 of file VariableType.h.

Enumeration Type Documentation

◆ MeanType

◆ PhaseName

enum class MaterialPropertyLib::PhaseName
strong

Enumeration of phase types.

Enumerator
Solid 
AqueousLiquid 
Gas 
FrozenLiquid 

Definition at line 18 of file Phase.h.

◆ PropertyType

PropertyType is an enumerator list of all known properties of a substance. This includes all properties on all scales (i.e. component, phase, and medium scales). It is used as an index for the PropertyArray of the materials. If a necessary property is not in the list, simply add a new one in alphabetical order (of course, except for the last entry). Please note that any of these entries must also appear in below convert functions.

Enumerator
acentric_factor 
binary_interaction_coefficient 
biot_coefficient 
bishops_effective_stress 
brooks_corey_exponent 
bulk_modulus 
capillary_pressure 
compressibility 
concentration 

used to specify decay rate of a substance.

critical_density 
critical_pressure 
critical_temperature 
decay_rate 
density 
diffusion 
drhodT 
effective_stress 
enthalpy 
entry_pressure 
evaporation_enthalpy 
fredlund_parameters 
frozen_liquid_saturation 

frozen liquid (ice) saturation, i.e. the fraction of the pore space occupied by ice. The corresponding volume fraction is this value times the porosity.

heat_capacity 
henry_coefficient 
longitudinal_dispersivity 

used to compute the hydrodynamic dispersion tensor.

molality 
molar_mass 
molar_volume 
mole_fraction 
molecular_diffusion 

ion diffusivity in free water.

name 
permeability 
phase_change_expansivity 
phase_velocity 
poissons_ratio 
pore_diffusion 

ion diffusivity in the porous medium with account of the effect of tortuosity and connectivity.

porosity 
reference_density 
reference_pressure 
reference_temperature 
relative_permeability 
relative_permeability_nonwetting_phase 
residual_gas_saturation 
residual_liquid_saturation 
retardation_factor 

specify retardation factor used in component transport process.

saturation 
saturation_density 
saturation_enthalpy 
saturation_micro 

capillary pressure saturation relationship for microstructure.

saturation_temperature 
specific_heat_capacity 
specific_latent_heat 
storage 
storage_contribution 
swelling_stress_rate 
temperature 
thermal_conductivity 
thermal_diffusion_enhancement_factor 

Thermal diffusion enhancement factor for water vapor flow.

thermal_expansivity 

The thermal expansivity corresponds to the linear thermal expansion coefficient for a solid and to the volumetric thermal expansion coefficient for a fluid

thermal_expansivity_contribution 
thermal_longitudinal_dispersivity 
thermal_osmosis_coefficient 
thermal_osmosis_permeability 

Scalar thermo-osmotic permeability \(\epsilon_T\) in Pa/K, the pore pressure gradient equivalent to a unit temperature gradient. It parametrises the thermo-osmotic coefficient as \(k_T = \epsilon_T k / \mu\), see ProcessLib::getThermoOsmoticCoefficient(); use it instead of, not next to, thermal_osmosis_coefficient.

thermal_transversal_dispersivity 
tortuosity 
transport_porosity 
transversal_dispersivity 

used to compute the hydrodynamic dispersion tensor.

vapour_pressure 
viscosity 
volume_fraction 
youngs_modulus 
number_of_properties 

Definition at line 23 of file PropertyType.h.

24{
39 density,
41 drhodT,
61 name,
87 storage,
113 viscosity,
117};
@ molecular_diffusion
ion diffusivity in free water.
@ thermal_diffusion_enhancement_factor
Thermal diffusion enhancement factor for water vapor flow.
@ saturation_micro
capillary pressure saturation relationship for microstructure.
@ relative_permeability_nonwetting_phase
@ longitudinal_dispersivity
used to compute the hydrodynamic dispersion tensor.
@ concentration
used to specify decay rate of a substance.
@ transversal_dispersivity
used to compute the hydrodynamic dispersion tensor.
@ retardation_factor
specify retardation factor used in component transport process.

◆ Variable

enum class MaterialPropertyLib::Variable : int
strong

Enum Variable is simply a list of all commonly used variables. If the variable of your choice is missing, simply add it somewhere at the list, but above the last entry.

Enumerator
capillary_pressure 
concentration 
deformation_gradient 
density 
effective_pore_pressure 
enthalpy 
enthalpy_of_evaporation 
equivalent_plastic_strain 
fracture_aperture 
frozen_liquid_saturation 
grain_compressibility 
liquid_phase_pressure 
liquid_saturation 
mechanical_strain 
molar_mass 
molar_mass_derivative 
molar_fraction 
gas_phase_pressure 
porosity 
solid_grain_pressure 
stress 
temperature 
total_strain 
total_stress 
transport_porosity 
vapour_pressure 
volumetric_mechanical_strain 
volumetric_strain 
number_of_variables 

Definition at line 20 of file VariableType.h.

21{
25 density,
42 stress,
51};

Function Documentation

◆ alignDriftWithFlow()

DriftFluxState MaterialPropertyLib::alignDriftWithFlow ( DriftFluxState const & state)
static

The same state with the drift aligned with the mixture flow, which is the closure computeVapourVoidFraction() actually solves.

Definition at line 28 of file DriftFluxModel.cpp.

29{
30 DriftFluxState aligned = state;
31 aligned.u_gu = alignedDriftFluxVelocity(state.u_gu, state.v_mix);
32 return aligned;
33}
double alignedDriftFluxVelocity(double const u_gu, double const v_mix)
double u_gu
The drift flux velocity in m/s, see driftFluxVelocity().

References alignedDriftFluxVelocity(), MaterialPropertyLib::DriftFluxState::u_gu, and MaterialPropertyLib::DriftFluxState::v_mix.

Referenced by computeVapourVoidFraction(), and voidFractionClosureDiagnostics().

◆ alignedDriftFluxVelocity()

double MaterialPropertyLib::alignedDriftFluxVelocity ( double const u_gu,
double const v_mix )

Drift flux velocity aligned with the mixture flow, \(\operatorname{sign}(v)\, u_{gu}\). The Rouhani-Axelsson closure is derived for co-current flow and has no admissible solution for backflow with a drift velocity that is fixed in the gravity frame, see computeVapourVoidFraction() for the reasoning.

Every use of the drift flux velocity next to a void fraction obtained from that closure, in particular the slip momentum term of the mixture, has to use the same aligned value: the void fraction is even in the mixture velocity, so a raw drift flux velocity leaves the slip term inconsistent with it and lets the term vanish at the finite backflow velocity \(v = -u_{gu} / (C_0 - 1)\).

Definition at line 35 of file DriftFluxModel.cpp.

36{
37 return std::copysign(u_gu, v_mix);
38}

Referenced by alignDriftWithFlow(), and driftFluxState().

◆ checkMaterialSpatialDistributionMap()

template<typename ContainerMedium, typename ContainerSolid, typename ContainerLiquid, typename ContainerGas>
void MaterialPropertyLib::checkMaterialSpatialDistributionMap ( MeshLib::Mesh const & mesh,
MaterialPropertyLib::MaterialSpatialDistributionMap const & media_map,
ContainerMedium const & required_properties_medium,
ContainerSolid const & required_properties_solid_phase,
ContainerLiquid const & required_properties_liquid_phase,
ContainerGas const & required_properties_gas_phase )

Definition at line 16 of file CheckMaterialSpatialDistributionMap.h.

23{
24 for (auto const element_id : mesh.getElements() | MeshLib::views::ids)
25 {
26 auto const& medium = *media_map.getMedium(element_id);
27 if (!required_properties_medium.empty())
28 {
30 medium, required_properties_medium);
31 }
32 if (!required_properties_liquid_phase.empty())
33 {
35 medium.phase(PhaseName::AqueousLiquid),
36 required_properties_liquid_phase);
37 }
38 if (!required_properties_gas_phase.empty())
39 {
41 medium.phase(PhaseName::Gas), required_properties_gas_phase);
42 }
43 if (!required_properties_solid_phase.empty())
44 {
46 medium.phase(PhaseName::Solid),
47 required_properties_solid_phase);
48 }
49 }
50}
void checkRequiredProperties(Component const &c, std::span< PropertyType const > const required_properties)
Definition Component.cpp:51
constexpr ranges::views::view_closure ids
For an element of a range view return its id.
Definition Mesh.h:223

References AqueousLiquid, checkRequiredProperties(), Gas, MeshLib::Mesh::getElements(), MaterialPropertyLib::MaterialSpatialDistributionMap::getMedium(), MeshLib::views::ids, and Solid.

Referenced by ProcessLib::HeatConduction::checkMPLProperties(), ProcessLib::HT::checkMPLProperties(), ProcessLib::RichardsFlow::checkMPLProperties(), ProcessLib::SteadyStateDiffusion::checkMPLProperties(), and ProcessLib::WellboreSimulator::checkMPLProperties().

◆ checkMPLPhasesForSinglePhaseFlow()

void MaterialPropertyLib::checkMPLPhasesForSinglePhaseFlow ( MeshLib::Mesh const & mesh,
MaterialPropertyLib::MaterialSpatialDistributionMap const & media_map )

Definition at line 17 of file CheckMPLPhasesForSinglePhaseFlow.cpp.

20{
21 // Check all of the elements have a medium defined.
22 ranges::for_each(mesh.getElements() | MeshLib::views::ids,
23 [&](auto const& element_id)
24 { media_map.checkElementHasMedium(element_id); });
25
26 // Collect phases of all elements...
27 auto all_phases =
28 media_map.media() |
29 ranges::views::transform([&](auto const& medium)
30 { return &fluidPhase(*medium); }) |
31 ranges::to_vector;
32
33 assert(!all_phases.empty());
34
35 // ... and check if any of the phases are different by type.
36 if (ranges::any_of(all_phases,
37 [p0 = all_phases.front()](auto const* const p)
38 { return p->phaseName != p0->phaseName; }))
39 {
41 "You are mixing liquid and gas phases in your model domain. OGS "
42 "does not yet know how to handle this.");
43 }
44}
#define OGS_FATAL(...)
Definition Error.h:10
Phase const & fluidPhase(Medium const &medium)
Returns a gas or aqueous liquid phase of the given medium.
Definition Medium.cpp:95

References fluidPhase(), MeshLib::Mesh::getElements(), MeshLib::views::ids, MaterialPropertyLib::MaterialSpatialDistributionMap::media(), and OGS_FATAL.

Referenced by ProcessLib::LiquidFlow::checkMPLProperties(), ProcessLib::HydroMechanics::createHydroMechanicsProcess(), and ProcessLib::LIE::HydroMechanics::createHydroMechanicsProcess().

◆ checkRequiredProperties() [1/3]

void MaterialPropertyLib::checkRequiredProperties ( Component const & c,
std::span< PropertyType const > const required_properties )

Definition at line 51 of file Component.cpp.

53{
54 for (auto const& p : required_properties)
55 {
56 if (!c.hasProperty(p))
57 {
58 OGS_FATAL("The property '{:s}' is missing in the component '{:s}'.",
59 property_enum_to_string[p], c.name);
60 }
61 }
62}
static const std::array< std::string, PropertyType::number_of_properties > property_enum_to_string

References c, OGS_FATAL, and property_enum_to_string.

Referenced by checkMaterialSpatialDistributionMap().

◆ checkRequiredProperties() [2/3]

void MaterialPropertyLib::checkRequiredProperties ( Medium const & medium,
std::span< PropertyType const > const required_properties )

Definition at line 80 of file Medium.cpp.

83{
84 for (auto const& p : required_properties)
85 {
86 if (!medium.hasProperty(p))
87 {
89 "The property '{:s}' is missing in the medium definition.",
91 }
92 }
93}

References MaterialPropertyLib::Medium::hasProperty(), OGS_FATAL, and property_enum_to_string.

◆ checkRequiredProperties() [3/3]

void MaterialPropertyLib::checkRequiredProperties ( Phase const & phase,
std::span< PropertyType const > const required_properties )

Definition at line 112 of file Phase.cpp.

114{
115 for (auto const& p : required_properties)
116 {
117 if (!phase.hasProperty(p))
118 {
119 OGS_FATAL("The property '{:s}' is missing in the {:s} phase.",
120 property_enum_to_string[p], toString(phase.phaseName));
121 }
122 }
123}
std::string_view toString(PhaseName phase_name)
Convert phase enum to its string representation.
Definition Phase.cpp:13

References MaterialPropertyLib::Phase::hasProperty(), OGS_FATAL, MaterialPropertyLib::Phase::phaseName, property_enum_to_string, and toString().

◆ checkSaturationRange()

void MaterialPropertyLib::checkSaturationRange ( const double Sl)

Definition at line 16 of file CapillaryPressureRegularizedVanGenuchten.cpp.

17{
18 if (Sl < 0 || Sl > 1)
19 {
20 OGS_FATAL("The saturation of {:e} is out of its range of [0, 1]", Sl);
21 }
22}

References OGS_FATAL.

Referenced by MaterialPropertyLib::CapillaryPressureRegularizedVanGenuchten::dValue(), and MaterialPropertyLib::CapillaryPressureRegularizedVanGenuchten::value().

◆ checkVanGenuchtenExponentRange()

void MaterialPropertyLib::checkVanGenuchtenExponentRange ( const double m)

Definition at line 10 of file CheckVanGenuchtenExponentRange.cpp.

11{
12 if (m <= 0 || m >= 1)
13 {
15 "The exponent value m = {:e} of van Genuchten saturation model, is "
16 "out of its range of(0, 1) ",
17 m);
18 }
19}

References OGS_FATAL.

Referenced by MaterialPropertyLib::CapillaryPressureRegularizedVanGenuchten::CapillaryPressureRegularizedVanGenuchten(), and MaterialPropertyLib::RelPermNonWettingPhaseVanGenuchtenMualem::RelPermNonWettingPhaseVanGenuchtenMualem().

◆ closureSlipParameter()

double MaterialPropertyLib::closureSlipParameter ( DriftFluxState const & state)
static

Slip parameter \(S = C_0 (x + (1 - x) \rho_v / \rho_l)\) of the drift-flux closure, see computeVapourVoidFraction().

Definition at line 19 of file DriftFluxModel.cpp.

20{
21 return state.C_0 *
22 (state.dryness + (1 - state.dryness) * state.vapour_water_density /
23 state.liquid_water_density);
24}

References MaterialPropertyLib::DriftFluxState::C_0, MaterialPropertyLib::DriftFluxState::dryness, MaterialPropertyLib::DriftFluxState::liquid_water_density, and MaterialPropertyLib::DriftFluxState::vapour_water_density.

Referenced by computeVapourVoidFraction(), voidFractionClosureDiagnostics(), voidFractionQuadratic(), and voidFractionResidual().

◆ computeAverage()

template<MeanType MeanType>
double MaterialPropertyLib::computeAverage ( const double ,
double const ,
double const  )
delete

◆ computeAverage< MeanType::ARITHMETIC_LINEAR >()

template<>
double MaterialPropertyLib::computeAverage< MeanType::ARITHMETIC_LINEAR > ( const double S,
double const k_dry,
double const k_wet )

Definition at line 30 of file SaturationWeightedThermalConductivity.cpp.

33{
34 return k_dry * (1.0 - S) + k_wet * S;
35}

◆ computeAverage< MeanType::ARITHMETIC_SQUAREROOT >()

template<>
double MaterialPropertyLib::computeAverage< MeanType::ARITHMETIC_SQUAREROOT > ( const double S,
double const k_dry,
double const k_wet )

Definition at line 46 of file SaturationWeightedThermalConductivity.cpp.

49{
50 return k_dry + std::sqrt(S) * (k_wet - k_dry);
51}

◆ computeAverage< MeanType::GEOMETRIC >()

template<>
double MaterialPropertyLib::computeAverage< MeanType::GEOMETRIC > ( const double S,
double const k_dry,
double const k_wet )

Definition at line 62 of file SaturationWeightedThermalConductivity.cpp.

64{
65 return k_dry * std::pow(k_wet / k_dry, S);
66}

◆ computeBarLambda0Factor()

double MaterialPropertyLib::computeBarLambda0Factor ( const double barT)
static

Definition at line 80 of file WaterThermalConductivityIAPWS.cpp.

81{
82 double sum_val = 0.;
83 double barT_i = 1.;
84 for (double value : Li)
85 {
86 sum_val += (value / barT_i);
87 barT_i *= barT;
88 }
89 return sum_val;
90}

References Li.

Referenced by computedBarLambda_dbarRho(), computedBarLambda_dbarT(), and MaterialPropertyLib::WaterThermalConductivityIAPWS::value().

◆ computeBarLambda1Factor()

double MaterialPropertyLib::computeBarLambda1Factor ( const std::array< double, 5 > & series_factorT,
const std::array< double, 6 > & series_factorRho )
static

Definition at line 117 of file WaterThermalConductivityIAPWS.cpp.

119{
120 double sum_val = 0.;
121 for (int i = 0; i < 5; i++)
122 {
123 double sum_val_j = 0;
124 for (int j = 0; j < 6; j++)
125 {
126 sum_val_j += Lij[i][j] * series_factorRho[j];
127 }
128 sum_val += series_factorT[i] * sum_val_j;
129 }
130
131 return sum_val;
132}
static const double Lij[5][6]

References Lij.

Referenced by computedBarLambda_dbarRho(), computedBarLambda_dbarT(), and MaterialPropertyLib::WaterThermalConductivityIAPWS::value().

◆ computeBarMu0Factor()

double MaterialPropertyLib::computeBarMu0Factor ( const double barT)
static

Definition at line 73 of file WaterViscosityIAPWS.cpp.

74{
75 double sum_val = 0.;
76 double barT_i = 1.;
77 for (double value : Hi)
78 {
79 sum_val += (value / barT_i);
80 barT_i *= barT;
81 }
82 return sum_val;
83}
static const double Hi[4]

References Hi.

Referenced by computedBarMu_dbarRho(), computedBarMu_dbarT(), and MaterialPropertyLib::WaterViscosityIAPWS::value().

◆ computeBarMu1Factor()

double MaterialPropertyLib::computeBarMu1Factor ( const std::array< double, 6 > & series_factorT,
const std::array< double, 7 > & series_factorRho )
static

Definition at line 110 of file WaterViscosityIAPWS.cpp.

112{
113 double sum_val = 0.;
114 for (int i = 0; i < 6; i++)
115 {
116 double sum_val_j = 0;
117 for (int j = 0; j < 7; j++)
118 {
119 sum_val_j += Hij[i][j] * series_factorRho[j];
120 }
121 sum_val += series_factorT[i] * sum_val_j;
122 }
123
124 return sum_val;
125}
static const double Hij[6][7]

References Hij.

Referenced by computedBarMu_dbarRho(), computedBarMu_dbarT(), and MaterialPropertyLib::WaterViscosityIAPWS::value().

◆ computeDAverage()

template<MeanType MeanType>
double MaterialPropertyLib::computeDAverage ( const double ,
double const ,
double const  )
delete

◆ computeDAverage< MeanType::ARITHMETIC_LINEAR >()

template<>
double MaterialPropertyLib::computeDAverage< MeanType::ARITHMETIC_LINEAR > ( const double ,
double const k_dry,
double const k_wet )

Definition at line 38 of file SaturationWeightedThermalConductivity.cpp.

41{
42 return k_wet - k_dry;
43}

◆ computeDAverage< MeanType::ARITHMETIC_SQUAREROOT >()

template<>
double MaterialPropertyLib::computeDAverage< MeanType::ARITHMETIC_SQUAREROOT > ( const double S,
double const k_dry,
double const k_wet )

Definition at line 54 of file SaturationWeightedThermalConductivity.cpp.

57{
58 return 0.5 * (k_wet - k_dry) / std::sqrt(S);
59}

◆ computeDAverage< MeanType::GEOMETRIC >()

template<>
double MaterialPropertyLib::computeDAverage< MeanType::GEOMETRIC > ( const double S,
double const k_dry,
double const k_wet )

Definition at line 69 of file SaturationWeightedThermalConductivity.cpp.

71{
72 return k_dry * std::pow(k_wet / k_dry, S) * std::log(k_wet / k_dry);
73}

◆ computedBarLambda_dbarRho()

double MaterialPropertyLib::computedBarLambda_dbarRho ( const double barT,
double bar_rho )
static

Definition at line 176 of file WaterThermalConductivityIAPWS.cpp.

177{
178 const auto& series_factorT = computeSeriesFactorTForLambda1(barT);
179 const auto& series_factorRho = computeSeriesFactorRhoForLambda1(bar_rho);
180
181 double dlambda1_factor_dbar_rho = 0.0;
182 for (int i = 0; i < 5; i++)
183 {
184 double sum_val_j = 0;
185 for (int j = 1; j < 6; j++)
186 {
187 sum_val_j +=
188 static_cast<double>(j) * Lij[i][j] * series_factorRho[j - 1];
189 }
190 dlambda1_factor_dbar_rho += series_factorT[i] * sum_val_j;
191 }
192
193 const double lambda0 = std::sqrt(barT) / computeBarLambda0Factor(barT);
194
195 const double lambda1_factor =
196 computeBarLambda1Factor(series_factorT, series_factorRho);
197 return lambda0 * std::exp(bar_rho * lambda1_factor) *
198 (lambda1_factor + bar_rho * dlambda1_factor_dbar_rho);
199}
static double computeBarLambda1Factor(const std::array< double, 5 > &series_factorT, const std::array< double, 6 > &series_factorRho)
static std::array< double, 6 > computeSeriesFactorRhoForLambda1(const double bar_rho)
static double computeBarLambda0Factor(const double barT)
static std::array< double, 5 > computeSeriesFactorTForLambda1(const double barT)

References computeBarLambda0Factor(), computeBarLambda1Factor(), computeSeriesFactorRhoForLambda1(), computeSeriesFactorTForLambda1(), and Lij.

Referenced by MaterialPropertyLib::WaterThermalConductivityIAPWS::dValue().

◆ computedBarLambda_dbarT()

double MaterialPropertyLib::computedBarLambda_dbarT ( const double barT,
double bar_rho )
static

Definition at line 134 of file WaterThermalConductivityIAPWS.cpp.

135{
136 const double lambda0_factor = computeBarLambda0Factor(barT);
137 const double sqrt_barT = std::sqrt(barT);
138
139 double dlambda0_factor_dbarT = 0.0;
140 double barT_i = barT * barT;
141 for (int i = 1; i < 5; i++)
142 {
143 dlambda0_factor_dbarT -= static_cast<double>(i) * (Li[i] / barT_i);
144 barT_i *= barT;
145 }
146
147 const double dbar_lambda0_dbarT =
148 0.5 / (lambda0_factor * sqrt_barT) -
149 sqrt_barT * dlambda0_factor_dbarT / (lambda0_factor * lambda0_factor);
150
151 const auto& series_factorT = computeSeriesFactorTForLambda1(barT);
152 const auto& series_factorRho = computeSeriesFactorRhoForLambda1(bar_rho);
153
154 double dlambda1_factor_dbarT = 0.0;
155 for (int i = 1; i < 5; i++)
156 {
157 double sum_val_j = 0;
158 for (int j = 0; j < 6; j++)
159 {
160 sum_val_j += Lij[i][j] * series_factorRho[j];
161 }
162 dlambda1_factor_dbarT -= static_cast<double>(i) *
163 series_factorT[i - 1] * sum_val_j /
164 (barT * barT);
165 }
166
167 const double lambda1_factor =
168 computeBarLambda1Factor(series_factorT, series_factorRho);
169 const double dbar_lambda1_dbarT =
170 bar_rho * std::exp(bar_rho * lambda1_factor) * dlambda1_factor_dbarT;
171
172 return dbar_lambda0_dbarT * std::exp(bar_rho * lambda1_factor) +
173 dbar_lambda1_dbarT * sqrt_barT / lambda0_factor;
174}

References computeBarLambda0Factor(), computeBarLambda1Factor(), computeSeriesFactorRhoForLambda1(), computeSeriesFactorTForLambda1(), Li, and Lij.

Referenced by MaterialPropertyLib::WaterThermalConductivityIAPWS::dValue().

◆ computedBarMu_dbarRho()

double MaterialPropertyLib::computedBarMu_dbarRho ( const double barT,
double bar_rho )
static

Definition at line 168 of file WaterViscosityIAPWS.cpp.

169{
170 const auto& series_factorT = computeSeriesFactorTForMu1(barT);
171 const auto& series_factorRho = computeSeriesFactorRhoForMu1(bar_rho);
172
173 double dmu1_factor_dbar_rho = 0.0;
174 for (int i = 0; i < 6; i++)
175 {
176 double sum_val_j = 0;
177 for (int j = 1; j < 7; j++)
178 {
179 sum_val_j +=
180 static_cast<double>(j) * Hij[i][j] * series_factorRho[j - 1];
181 }
182 dmu1_factor_dbar_rho += series_factorT[i] * sum_val_j;
183 }
184
185 const double mu0 = 100. * std::sqrt(barT) / computeBarMu0Factor(barT);
186
187 const double mu1_factor =
188 computeBarMu1Factor(series_factorT, series_factorRho);
189 return mu0 * std::exp(bar_rho * mu1_factor) *
190 (mu1_factor + bar_rho * dmu1_factor_dbar_rho);
191}
static double computeBarMu0Factor(const double barT)
static std::array< double, 7 > computeSeriesFactorRhoForMu1(const double bar_rho)
static double computeBarMu1Factor(const std::array< double, 6 > &series_factorT, const std::array< double, 7 > &series_factorRho)
static std::array< double, 6 > computeSeriesFactorTForMu1(const double barT)

References computeBarMu0Factor(), computeBarMu1Factor(), computeSeriesFactorRhoForMu1(), computeSeriesFactorTForMu1(), and Hij.

Referenced by MaterialPropertyLib::WaterViscosityIAPWS::dValue().

◆ computedBarMu_dbarT()

double MaterialPropertyLib::computedBarMu_dbarT ( const double barT,
double bar_rho )
static

Definition at line 127 of file WaterViscosityIAPWS.cpp.

128{
129 const double mu0_factor = computeBarMu0Factor(barT);
130 const double sqrt_barT = std::sqrt(barT);
131
132 double dmu0_factor_dbarT = 0.0;
133 double barT_i = barT * barT;
134 for (int i = 1; i < 4; i++)
135 {
136 dmu0_factor_dbarT -= static_cast<double>(i) * (Hi[i] / barT_i);
137 barT_i *= barT;
138 }
139
140 const double dbar_mu0_dbarT =
141 50. / (mu0_factor * sqrt_barT) -
142 100. * sqrt_barT * dmu0_factor_dbarT / (mu0_factor * mu0_factor);
143
144 const auto& series_factorT = computeSeriesFactorTForMu1(barT);
145 const auto& series_factorRho = computeSeriesFactorRhoForMu1(bar_rho);
146
147 double dmu1_factor_dbarT = 0.0;
148 for (int i = 1; i < 6; i++)
149 {
150 double sum_val_j = 0;
151 for (int j = 0; j < 7; j++)
152 {
153 sum_val_j += Hij[i][j] * series_factorRho[j];
154 }
155 dmu1_factor_dbarT -= static_cast<double>(i) * series_factorT[i - 1] *
156 sum_val_j / (barT * barT);
157 }
158
159 const double mu1_factor =
160 computeBarMu1Factor(series_factorT, series_factorRho);
161 const double dbar_mu1_dbarT =
162 bar_rho * std::exp(bar_rho * mu1_factor) * dmu1_factor_dbarT;
163
164 return dbar_mu0_dbarT * std::exp(bar_rho * mu1_factor) +
165 dbar_mu1_dbarT * 100. * sqrt_barT / mu0_factor;
166}

References computeBarMu0Factor(), computeBarMu1Factor(), computeSeriesFactorRhoForMu1(), computeSeriesFactorTForMu1(), Hi, and Hij.

Referenced by MaterialPropertyLib::WaterViscosityIAPWS::dValue().

◆ computeSeriesFactorRhoForLambda1()

std::array< double, 6 > MaterialPropertyLib::computeSeriesFactorRhoForLambda1 ( const double bar_rho)
static

Definition at line 105 of file WaterThermalConductivityIAPWS.cpp.

106{
107 std::array<double, 6> series_factorRho{};
108 series_factorRho[0] = 1.;
109 for (int i = 1; i < 6; i++)
110 {
111 series_factorRho[i] = series_factorRho[i - 1] * (bar_rho - 1.0);
112 }
113
114 return series_factorRho;
115}

Referenced by computedBarLambda_dbarRho(), computedBarLambda_dbarT(), and MaterialPropertyLib::WaterThermalConductivityIAPWS::value().

◆ computeSeriesFactorRhoForMu1()

std::array< double, 7 > MaterialPropertyLib::computeSeriesFactorRhoForMu1 ( const double bar_rho)
static

Definition at line 98 of file WaterViscosityIAPWS.cpp.

99{
100 std::array<double, 7> series_factorRho{};
101 series_factorRho[0] = 1.;
102 for (int i = 1; i < 7; i++)
103 {
104 series_factorRho[i] = series_factorRho[i - 1] * (bar_rho - 1.0);
105 }
106
107 return series_factorRho;
108}

Referenced by computedBarMu_dbarRho(), computedBarMu_dbarT(), and MaterialPropertyLib::WaterViscosityIAPWS::value().

◆ computeSeriesFactorTForLambda1()

std::array< double, 5 > MaterialPropertyLib::computeSeriesFactorTForLambda1 ( const double barT)
static

Definition at line 92 of file WaterThermalConductivityIAPWS.cpp.

93{
94 std::array<double, 5> series_factorT{};
95 series_factorT[0] = 1.;
96 const double barT_fac = 1 / barT - 1.0;
97 for (int i = 1; i < 5; i++)
98 {
99 series_factorT[i] = series_factorT[i - 1] * barT_fac;
100 }
101
102 return series_factorT;
103}

Referenced by computedBarLambda_dbarRho(), computedBarLambda_dbarT(), and MaterialPropertyLib::WaterThermalConductivityIAPWS::value().

◆ computeSeriesFactorTForMu1()

std::array< double, 6 > MaterialPropertyLib::computeSeriesFactorTForMu1 ( const double barT)
static

Definition at line 85 of file WaterViscosityIAPWS.cpp.

86{
87 std::array<double, 6> series_factorT{};
88 series_factorT[0] = 1.;
89 const double barT_fac = 1 / barT - 1.0;
90 for (int i = 1; i < 6; i++)
91 {
92 series_factorT[i] = series_factorT[i - 1] * barT_fac;
93 }
94
95 return series_factorT;
96}

Referenced by computedBarMu_dbarRho(), computedBarMu_dbarT(), and MaterialPropertyLib::WaterViscosityIAPWS::value().

◆ computeTemperature()

double MaterialPropertyLib::computeTemperature ( double const pi,
double const eta )

Definition at line 27 of file WaterTemperatureIAPWSIF97Region1.cpp.

28{
29 double val = 0.;
30 for (int i = 0; i < 20; i++)
31 {
32 val += n_T[i] * std::pow(pi, I_T[i]) * std::pow(eta + 1, J_T[i]);
33 }
34
35 return val;
36}
static constexpr std::array n_T
static constexpr std::array I_T
static constexpr std::array J_T

References I_T, J_T, and n_T.

Referenced by MaterialPropertyLib::WaterTemperatureIAPWSIF97Region1::value().

◆ computeVanGenuchtenMualemValue()

double MaterialPropertyLib::computeVanGenuchtenMualemValue ( const double S_L,
const double S_L_r,
const double S_L_max,
const double m )

Definition at line 17 of file RelPermNonWettingPhaseVanGenuchtenMualem.cpp.

19{
20 const double Se = (S_L - S_L_r) / (S_L_max - S_L_r);
21 return std::sqrt(1.0 - Se) * std::pow(1.0 - std::pow(Se, 1.0 / m), 2.0 * m);
22}

Referenced by MaterialPropertyLib::RelPermNonWettingPhaseVanGenuchtenMualem::computeSaturationForMinimumRelativePermeability(), and MaterialPropertyLib::RelPermNonWettingPhaseVanGenuchtenMualem::value().

◆ computeVapourVoidFraction()

std::optional< double > MaterialPropertyLib::computeVapourVoidFraction ( DriftFluxState const & state)

Vapour void fraction of the Rouhani-Axelsson drift-flux closure, see Rouhani, Z., and E. Axelsson. "Calculation of volume void fraction in a subcooled and quality region." International Journal of Heat and Mass Transfer 17 (1970): 383-393.

With the mixture density \(\rho_m = \alpha \rho_v + (1 - \alpha) \rho_l\) and the mass flux \(G = \rho_m v\) the closure reads

\[ G (x - \alpha S) - \alpha \rho_v u_{gu} = 0, \quad S = C_0 \left(x + (1 - x) \frac{\rho_v}{\rho_l}\right), \]

which is a quadratic equation in \(\alpha\) because \(\rho_m\) depends on \(\alpha\) linearly.

For co-current upflow, \(v > 0\) and \(0 < x < 1\), the residual is positive at \(\alpha = 0\) and negative at \(\alpha = 1\), hence a root exists, and it is the only root in the admissible interval \([0, \min(1, x / S)]\). The bound \(x / S\) is the homogeneous void fraction divided by the profile parameter and is at most one as long as \(C_0 \ge 1\), which is what driftFluxProfileParameter() gives; the minimum keeps the returned volume fraction below one for a profile parameter below one as well. As long as the phase densities are ordered, \(\rho_l > \rho_v\), the parabola opens upwards and the second root is larger than one. Where the two densities cross, in the immediate vicinity of the critical point, it opens downwards and both roots can lie below one, which is why the root is selected by testing the admissible interval rather than by its position.

The correlation is derived for co-current flow. Written with a drift velocity that is fixed in the gravity frame it has no admissible solution for backflow, \(v < 0\): the denominator \(S G + \rho_v u_{gu}\) of the closure changes sign, so the void fraction has a pole and leaves \([0, 1]\). The drift velocity is therefore aligned with the mixture flow, \(u_{gu} \to \operatorname{sign}(v)\, u_{gu}\), which makes the residual odd under \(v \to -v\) and hence the void fraction an even function of the mixture velocity. Existence and uniqueness above then hold for every mixture velocity, and \(\alpha \sim |v|\) near \(v = 0\), that is the void fraction is continuous but not differentiable where the flow reverses. They hold for the exact closure; the arithmetic that implements it reports no admissible root once the mixture velocity is small enough that the coefficients of the quadratic underflow, below some \(10^{-160}\) m/s, which is answered by a retreat like any other state without a root. A mixture at rest, \(v = 0\) exactly, is resolved by continuity instead, see below.

The kink at \(v = 0\) could be removed by scaling the drift velocity with \(v / \sqrt{v^2 + u_{gu}^2}\), using the drift velocity itself as the velocity scale so that no tuning parameter is introduced. This is not done because it changes the void fraction in the whole band \(|v| \lesssim u_{gu}\); what the kink does to the convergence of the global Newton solver has not been investigated.

Solves the closure in closed form and returns the root in the admissible interval, or no value if the closure has no admissible solution for the given state.

A mixture at rest without drift, \(v = 0\) and \(u_{gu} = 0\), leaves every coefficient of the quadratic zero and the closure is satisfied by every void fraction. It is resolved by continuity: without drift the closure reads \(x = \alpha S\) for every non-zero mixture velocity, independently of it, so the limit is the profile slip alone, \(\alpha = x / S\).

Single phase states, \(x \le 0\) and \(x \ge 1\), return \(0\) and \(1\) without looking at the state, in particular without looking at the density of the absent phase.

For a two-phase state it throws NumLib::AssemblyException for a non-positive phase density and for a non-finite dryness, mixture velocity, drift flux velocity, or profile parameter: all of those follow the solution iterate, so the assembly is aborted rather than the run ended.

What the abort leads to is up to the nonlinear solver, and both of them answer it the same way: the Newton and the Picard solver each catch NumLib::AssemblyException, end the nonlinear iteration and let the time stepping repeat the step with a smaller time step size, with the state of the closure reported.

Parameters
statethe state of the closure.
Returns
The vapour void fraction, dimensionless, or no value if the closure has no admissible solution for that state.

Definition at line 140 of file DriftFluxModel.cpp.

141{
142 auto const& [dryness, vapour_water_density, liquid_water_density, v_mix,
143 C_0, u_gu] = state;
144
145 // Single phase states are exact, no closure is needed. They are settled
146 // before the state validation below because the density of the absent
147 // phase does not enter the result: it is the one evaluated far off the
148 // saturation line and hence the one that may be non-positive, and a pure
149 // liquid or pure vapour section must not abort the assembly for it. A NaN
150 // dryness satisfies neither comparison and reaches the validation.
151 if (dryness <= 0)
152 {
153 return 0.;
154 }
155 if (dryness >= 1)
156 {
157 return 1.;
158 }
159
160 // All arguments are computed from the current solution iterate, so a
161 // non-physical value is a diverging global Newton step, not a broken
162 // input. Aborting the assembly ends the nonlinear iteration and lets the
163 // time stepping repeat the step under either solver, whereas OGS_FATAL
164 // would end the run; see the documentation of this function.
165 //
166 // The phase densities are evaluated on the IAPWS-IF97 region 4 saturation
167 // line, which is extrapolated outside of its pressure range 611.213 Pa to
168 // 22.064 MPa and then may return non-positive or NaN values. The negated
169 // comparison is deliberate; `density <= 0` lets a NaN density pass.
170 if (!(liquid_water_density > 0) || !(vapour_water_density > 0))
171 {
172 throw NumLib::AssemblyException(fmt::format(
173 "Non-positive phase density in the vapour void fraction closure: "
174 "liquid density {:g} kg/m^3, vapour density {:g} kg/m^3.",
175 liquid_water_density, vapour_water_density));
176 }
177 if (!std::isfinite(dryness) || !std::isfinite(v_mix) ||
178 !std::isfinite(u_gu) || !std::isfinite(C_0))
179 {
180 throw NumLib::AssemblyException(fmt::format(
181 "Non-finite state in the vapour void fraction closure: dryness "
182 "{:g}, mixture velocity {:g} m/s, drift flux velocity {:g} m/s, "
183 "profile parameter {:g}.",
184 dryness, v_mix, u_gu, C_0));
185 }
186
187 double const S = closureSlipParameter(state);
188
189 // Upper bound of the admissible interval. The slip transports vapour out
190 // of the control volume, so the void fraction stays below the homogeneous
191 // one, alpha <= dryness / S <= alpha_homogeneous. That bound is at most
192 // one for a profile parameter of at least one, which is what the
193 // Rouhani-Axelsson correlation of driftFluxProfileParameter() gives. A
194 // profile parameter below one describes a void profile peaking at the
195 // wall rather than at the centre; the bound then exceeds one and the
196 // volume fraction of the vapour, which cannot, hence the minimum.
197 double const alpha_max = std::min(1., dryness / S);
198
199 // The drift is aligned with the mixture flow, see above.
200 auto const [a, b, c] = voidFractionQuadratic(alignDriftWithFlow(state));
201
202 // The quadratic degenerates to a linear equation at vanishing mixture
203 // velocity and at the critical point, where both phase densities coincide.
204 // The tolerance is relative, to the linear coefficient below and to
205 // b^2 for the discriminant, and some tens of machine epsilons, 45 of
206 // them: that is the scale on which the coefficients, each a difference
207 // of products of the closure state, lose their last digits, while a
208 // quadratic whose leading coefficient is that much smaller than the linear
209 // one has its small root within the accuracy of the linear solve anyway.
210 constexpr double degeneracy_tolerance = 1e-14;
211
212 // A root and the bound alpha_max are computed by different expressions, so
213 // a root that coincides with the bound can come out just outside of it.
214 // Roots are therefore accepted with a tolerance and clamped afterwards.
215 // The tolerance is about the square root of the machine epsilon, which is
216 // the accuracy a root of a quadratic is worth near a double root, where the
217 // root shifts with the square root of the perturbation of the
218 // coefficients.
219 constexpr double interval_tolerance = 1e-8;
220
221 auto const admissible = [&](double const alpha) -> std::optional<double>
222 {
223 double const tolerance = interval_tolerance * std::max(1., alpha_max);
224 // The negated comparisons are deliberate; the plain form lets a NaN
225 // root through to the clamp below, which returns it as an admissible
226 // void fraction.
227 if (!(alpha >= -tolerance) || !(alpha <= alpha_max + tolerance))
228 {
229 return std::nullopt;
230 }
231 return std::clamp(alpha, 0., alpha_max);
232 };
233
234 if (std::abs(a) <= degeneracy_tolerance * std::abs(b))
235 {
236 if (b == 0)
237 {
238 // Every coefficient vanishes, which for a validated two-phase
239 // state happens exactly for a mixture at rest without drift, that
240 // is v_mix = 0 and u_gu = 0. The closure then holds for every void
241 // fraction. Retreating would not resolve it, because repeating the
242 // time step does not change the velocity of the current iterate,
243 // so the value is taken from the limit instead: without drift the
244 // closure reads x = alpha S for every non-zero mixture velocity,
245 // independently of it, hence alpha = x / S = alpha_max, the
246 // profile slip alone.
247 if (c == 0)
248 {
249 return admissible(alpha_max);
250 }
251 return std::nullopt;
252 }
253 return admissible(-c / b);
254 }
255
256 // Both terms underflow to zero for a mixture velocity in the subnormal
257 // range, which loses the small root and is reported as no admissible root
258 // rather than as a wrong one. Rescaling the coefficients would avoid it,
259 // at the price of perturbing the rounding of every reachable state, and
260 // the velocities in question are some 1e-160 m/s.
261 double discriminant = b * b - 4 * a * c;
262 if (discriminant < 0)
263 {
264 // A double root cannot be distinguished from a pair of complex roots
265 // within the accuracy of the cancelling difference above.
266 if (discriminant < -degeneracy_tolerance * b * b)
267 {
268 return std::nullopt;
269 }
270 discriminant = 0;
271 }
272
273 // Stable roots: the direct formula loses the small root to cancellation
274 // whenever 4 a c is small compared to b^2, which is the case for small
275 // dryness.
276 double const q = -0.5 * (b + std::copysign(std::sqrt(discriminant), b));
277 if (q == 0)
278 {
279 return admissible(0.);
280 }
281
282 // The smaller root is the one continuous with the single phase limit
283 // alpha(dryness -> 0) = 0.
284 double const root_1 = q / a;
285 double const root_2 = c / q;
286
287 auto const first = admissible(std::min(root_1, root_2));
288 return first ? first : admissible(std::max(root_1, root_2));
289}
VoidFractionQuadratic voidFractionQuadratic(DriftFluxState const &state)
static double closureSlipParameter(DriftFluxState const &state)
static DriftFluxState alignDriftWithFlow(DriftFluxState const &state)

References alignDriftWithFlow(), alpha, c, closureSlipParameter(), and voidFractionQuadratic().

Referenced by ProcessLib::WellboreCompensateNeumannBoundaryConditionLocalAssembler< ShapeFunction, GlobalDim >::assemble(), and ProcessLib::WellboreSimulator::WellboreSimulatorFEM< ShapeFunction, GlobalDim >::assemble().

◆ convertStringToProperty()

PropertyType MaterialPropertyLib::convertStringToProperty ( std::string const & string)

This function converts a string (e.g. a string from the configuration-tree) into one of the entries of the PropertyType enumerator.

Definition at line 12 of file PropertyType.cpp.

13{
14 for (int i = 0; i < static_cast<int>(PropertyType::number_of_properties);
15 ++i)
16 {
17 if (boost::iequals(string, property_enum_to_string[i]))
18 {
19 return static_cast<PropertyType>(i);
20 }
21 }
22
24 "The property name '{:s}' does not correspond to any known property",
25 string);
26}

References number_of_properties, OGS_FATAL, and property_enum_to_string.

Referenced by MaterialPropertyLib::VolumeFractionAverage::VolumeFractionAverage(), and createProperties().

◆ convertStringToVariable()

Variable MaterialPropertyLib::convertStringToVariable ( std::string const & string)

This function converts a string (e.g. a string from the configuration-tree) into one of the entries of the Variable enumerator.

Definition at line 20 of file VariableType.cpp.

21{
22 for (int i = 0; i < static_cast<int>(Variable::number_of_variables); ++i)
23 {
24 if (boost::iequals(string, variable_enum_to_string[i]))
25 {
26 return static_cast<Variable>(i);
27 }
28 }
29
31 "The variable name '{:s}' does not correspond to any known variable",
32 string);
33}
static const std::array< std::string, static_cast< int >(Variable::number_of_variables)> variable_enum_to_string

References number_of_variables, OGS_FATAL, and variable_enum_to_string.

Referenced by MaterialPropertyLib::Function::Function(), MaterialPropertyLib::PerThreadData::compileExpressions(), createCurve(), createExponential(), createLinear(), createSigmoid(), and createSymbolTable().

◆ createAverageMolarMass()

std::unique_ptr< AverageMolarMass > MaterialPropertyLib::createAverageMolarMass ( BaseLib::ConfigTree const & config)
Input File Parameter
properties__property__type
Input File Parameter
properties__property__name
Input File Parameter
properties__property__AverageMolarMass

Definition at line 9 of file CreateAverageMolarMass.cpp.

11{
13 config.checkConfigParameter("type", "AverageMolarMass");
14
16 auto property_name = config.peekConfigParameter<std::string>("name");
17
18 DBUG("Create AverageMolarMass medium property");
20 return std::make_unique<AverageMolarMass>(std::move(property_name));
21}
void DBUG(fmt::format_string< Args... > fmt, Args &&... args)
Definition Logging.h:22

References BaseLib::ConfigTree::checkConfigParameter(), DBUG(), and BaseLib::ConfigTree::peekConfigParameter().

Referenced by anonymous_namespace{CreateProperty.cpp}::createProperty().

◆ createBishopsPowerLaw()

std::unique_ptr< BishopsPowerLaw > MaterialPropertyLib::createBishopsPowerLaw ( BaseLib::ConfigTree const & config)
Input File Parameter
properties__property__type
Input File Parameter
properties__property__name
Input File Parameter
properties__property__BishopsPowerLaw__exponent

Definition at line 9 of file CreateBishopsPowerLaw.cpp.

11{
13 config.checkConfigParameter("type", "BishopsPowerLaw");
14
15 // Second access for storage.
17 auto property_name = config.peekConfigParameter<std::string>("name");
18
19 DBUG("Create BishopsPowerLaw property {:s}.", property_name);
20
21 auto const exponent =
23 config.getConfigParameter<double>("exponent");
24
25 return std::make_unique<MaterialPropertyLib::BishopsPowerLaw>(
26 std::move(property_name), exponent);
27}

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

Referenced by anonymous_namespace{CreateProperty.cpp}::createProperty().

◆ createBishopsSaturationCutoff()

std::unique_ptr< BishopsSaturationCutoff > MaterialPropertyLib::createBishopsSaturationCutoff ( BaseLib::ConfigTree const & config)
Input File Parameter
properties__property__type
Input File Parameter
properties__property__name
Input File Parameter
properties__property__BishopsSaturationCutoff__cutoff_value

Definition at line 9 of file CreateBishopsSaturationCutoff.cpp.

11{
13 config.checkConfigParameter("type", "BishopsSaturationCutoff");
14
15 // Second access for storage.
17 auto property_name = config.peekConfigParameter<std::string>("name");
18
19 DBUG("Create BishopsSaturationCutoff property {:s}.", property_name);
20
21 auto const cutoff_value =
23 config.getConfigParameter<double>("cutoff_value");
24
25 return std::make_unique<MaterialPropertyLib::BishopsSaturationCutoff>(
26 std::move(property_name), cutoff_value);
27}

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

Referenced by anonymous_namespace{CreateProperty.cpp}::createProperty().

◆ createCapillaryPressureRegularizedVanGenuchten()

std::unique_ptr< Property > MaterialPropertyLib::createCapillaryPressureRegularizedVanGenuchten ( BaseLib::ConfigTree const & config)
Input File Parameter
properties__property__type
Input File Parameter
properties__property__CapillaryPressureRegularizedVanGenuchten__residual_liquid_saturation
Input File Parameter
properties__property__CapillaryPressureRegularizedVanGenuchten__residual_gas_saturation
Input File Parameter
properties__property__CapillaryPressureRegularizedVanGenuchten__exponent
Input File Parameter
properties__property__CapillaryPressureRegularizedVanGenuchten__p_b

Definition at line 12 of file CreateCapillaryPressureRegularizedVanGenuchten.cpp.

14{
16 config.checkConfigParameter("type",
17 "CapillaryPressureRegularizedVanGenuchten");
18
19 DBUG("Create CapillaryPressureRegularizedVanGenuchten medium property");
20
23 config.getConfigParameter<double>("residual_liquid_saturation");
24 auto const maximum_liquid_saturation =
25 1.0 -
27 config.getConfigParameter<double>("residual_gas_saturation");
28 auto const exponent =
30 config.getConfigParameter<double>("exponent");
31 auto const p_b =
33 config.getConfigParameter<double>("p_b");
34
35 return std::make_unique<CapillaryPressureRegularizedVanGenuchten>(
36 residual_liquid_saturation, maximum_liquid_saturation, exponent, p_b);
37}

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

Referenced by anonymous_namespace{CreateProperty.cpp}::createProperty().

◆ createCapillaryPressureVanGenuchten()

std::unique_ptr< Property > MaterialPropertyLib::createCapillaryPressureVanGenuchten ( BaseLib::ConfigTree const & config)
Input File Parameter
properties__property__type
Input File Parameter
properties__property__name
Input File Parameter
properties__property__CapillaryPressureVanGenuchten__residual_liquid_saturation
Input File Parameter
properties__property__CapillaryPressureVanGenuchten__residual_gas_saturation
Input File Parameter
properties__property__CapillaryPressureVanGenuchten__exponent
Input File Parameter
properties__property__CapillaryPressureVanGenuchten__p_b
Input File Parameter
properties__property__CapillaryPressureVanGenuchten__maximum_capillary_pressure

Definition at line 12 of file CreateCapillaryPressureVanGenuchten.cpp.

14{
16 config.checkConfigParameter("type", "CapillaryPressureVanGenuchten");
17
18 // Second access for storage.
20 auto property_name = config.peekConfigParameter<std::string>("name");
21
22 DBUG("Create CapillaryPressureVanGenuchten medium property {:s}.",
23 property_name);
24
27 config.getConfigParameter<double>("residual_liquid_saturation");
28 auto const residual_gas_saturation =
30 config.getConfigParameter<double>("residual_gas_saturation");
31 auto const exponent =
33 config.getConfigParameter<double>("exponent");
34 auto const p_b =
36 config.getConfigParameter<double>("p_b");
37 auto const maximum_capillary_pressure =
39 config.getConfigParameter<double>("maximum_capillary_pressure");
40
41 return std::make_unique<CapillaryPressureVanGenuchten>(
42 std::move(property_name), residual_liquid_saturation,
43 residual_gas_saturation, exponent, p_b, maximum_capillary_pressure);
44}

References BaseLib::ConfigTree::checkConfigParameter(), DBUG(), BaseLib::ConfigTree::getConfigParameter(), BaseLib::ConfigTree::peekConfigParameter(), residual_gas_saturation, and residual_liquid_saturation.

Referenced by anonymous_namespace{CreateProperty.cpp}::createProperty().

◆ createClausiusClapeyron()

std::unique_ptr< ClausiusClapeyron > MaterialPropertyLib::createClausiusClapeyron ( BaseLib::ConfigTree const & config)
Input File Parameter
properties__property__type
Input File Parameter
properties__property__name
Input File Parameter
properties__property__ClausiusClapeyron__triple_temperature
Input File Parameter
properties__property__ClausiusClapeyron__triple_pressure
Input File Parameter
properties__property__ClausiusClapeyron__critical_temperature
Input File Parameter
properties__property__ClausiusClapeyron__critical_pressure
Input File Parameter
properties__property__ClausiusClapeyron__reference_temperature
Input File Parameter
properties__property__ClausiusClapeyron__reference_pressure
Input File Parameter
properties__property__ClausiusClapeyron

Definition at line 9 of file CreateClausiusClapeyron.cpp.

11{
13 config.checkConfigParameter("type", "ClausiusClapeyron");
14
16 auto property_name = config.peekConfigParameter<std::string>("name");
17
18 DBUG("Create ClausiusClapeyron property {:s}.", property_name);
19
20 auto const triple_temperature =
22 config.getConfigParameter<double>("triple_temperature");
23
24 auto const triple_pressure =
26 config.getConfigParameter<double>("triple_pressure");
27
28 auto const critical_temperature =
30 config.getConfigParameter<double>("critical_temperature");
31
32 auto const critical_pressure =
34 config.getConfigParameter<double>("critical_pressure");
35
36 auto const ref_temperature =
38 config.getConfigParameter<double>("reference_temperature");
39
40 auto const ref_pressure =
42 config.getConfigParameter<double>("reference_pressure");
43
45 return std::make_unique<ClausiusClapeyron>(
46 std::move(property_name), triple_temperature, triple_pressure,
47 critical_temperature, critical_pressure, ref_temperature, ref_pressure);
48}

References BaseLib::ConfigTree::checkConfigParameter(), critical_pressure, critical_temperature, DBUG(), BaseLib::ConfigTree::getConfigParameter(), and BaseLib::ConfigTree::peekConfigParameter().

Referenced by anonymous_namespace{CreateProperty.cpp}::createProperty().

◆ createComponents()

std::vector< std::unique_ptr< Component > > MaterialPropertyLib::createComponents ( int const geometry_dimension,
std::optional< BaseLib::ConfigTree > const & config,
std::vector< std::unique_ptr< ParameterLib::ParameterBase > > & parameters,
ParameterLib::CoordinateSystem const *const local_coordinate_system,
std::map< std::string, std::unique_ptr< MathLib::PiecewiseLinearInterpolation > > const & curves )

The method creates components based on config subtree.

Just like a phase, a component can have a name. But, in this case, the name has an important task. If a name is given, a specific component class referring to that name with corresponding physical material properties is created. Assigning a name is optional; If no name is given, a custom component without predefined properties is created.

Input File Parameter
prj__media__medium__phases__phase__components__component

Definition at line 67 of file CreateComponent.cpp.

75{
76 if (!config)
77 {
78 return {};
79 }
80
81 std::vector<std::unique_ptr<Component>> components;
82 for (
83 auto const& component_config :
85 config->getConfigSubtreeList("component"))
86 {
87 auto component =
88 createComponent(geometry_dimension, component_config, parameters,
89 local_coordinate_system, curves);
90
91 if (std::find_if(components.begin(),
92 components.end(),
93 [component_name = component->name](auto const& c) {
94 return c->name == component_name;
95 }) != components.end())
96 {
98 "Found duplicates with the same component name tag '{:s}'.",
99 component->name);
100 }
101
102 components.push_back(std::move(component));
103 }
104
105 return components;
106}
std::unique_ptr< MaterialPropertyLib::Component > createComponent(int const geometry_dimension, BaseLib::ConfigTree const &config, std::vector< std::unique_ptr< ParameterLib::ParameterBase > > &parameters, ParameterLib::CoordinateSystem const *const local_coordinate_system, std::map< std::string, std::unique_ptr< MathLib::PiecewiseLinearInterpolation > > const &curves)

References c, and OGS_FATAL.

Referenced by anonymous_namespace{CreatePhase.cpp}::createPhase().

◆ createConstant()

std::unique_ptr< Constant > MaterialPropertyLib::createConstant ( BaseLib::ConfigTree const & config)
Input File Parameter
properties__property__type
Input File Parameter
properties__property__name
Input File Parameter
properties__property__Constant__value
Input File Parameter
properties__property__Constant__values

Definition at line 9 of file CreateConstant.cpp.

10{
12 config.checkConfigParameter("type", "Constant");
13
14 // Second access for storage.
16 auto property_name = config.peekConfigParameter<std::string>("name");
17
18 DBUG("Create Constant property {:s}.", property_name);
19 auto const value_data =
21 config.getConfigParameterOptional<std::vector<double>>("value");
22
23 auto const values_data =
25 config.getConfigParameterOptional<std::vector<double>>("values");
26
27 if ((value_data) && (values_data))
28 {
30 "Both the value and the values tags were given.\n\
31 Please give only one of them.");
32 }
33
34 std::vector<double> values;
35
36 if (value_data)
37 {
38 values = *value_data;
39 }
40 else if (values_data)
41 {
42 values = *values_data;
43 }
44
45 if (values.empty())
46 {
47 OGS_FATAL("No value(s) was(were) provided.");
48 }
49
50 DBUG("Using following values for the constant parameter:");
51 for (double const v : values)
52 {
53 (void)v; // unused value if building w/o DBUG output.
54 DBUG("\t{:g}", v);
55 }
56
57 return std::make_unique<Constant>(std::move(property_name),
58 fromVector(values));
59}
PropertyDataType fromVector(std::vector< double > const &values)

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

Referenced by anonymous_namespace{CreateProperty.cpp}::createProperty().

◆ createCubicLawPermeability()

std::unique_ptr< Property > MaterialPropertyLib::createCubicLawPermeability ( BaseLib::ConfigTree const & config,
std::vector< std::unique_ptr< ParameterLib::ParameterBase > > const & parameters )
Input File Parameter
properties__property__type
Input File Parameter
properties__property__name
Input File Parameter
properties__property__CubicLawPermeability__fracture_aperture

Definition at line 15 of file CreateCubicLawPermeability.cpp.

18{
20 config.checkConfigParameter("type", "CubicLawPermeability");
21 DBUG("Create CubicLaw Permeability model");
22
23 // Second access for storage.
25 auto property_name = config.peekConfigParameter<std::string>("name");
26
27 auto const fracture_aperture_name =
29 config.getConfigParameter<std::string>("fracture_aperture", "");
30
32 fracture_aperture_name == ""
33 ? nullptr
35 fracture_aperture_name, parameters, 0, nullptr);
36
37 return std::make_unique<CubicLawPermeability>(std::move(property_name), b);
38}
OGS_NO_DANGLING 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)

References BaseLib::ConfigTree::checkConfigParameter(), DBUG(), ParameterLib::findParameter(), BaseLib::ConfigTree::getConfigParameter(), and BaseLib::ConfigTree::peekConfigParameter().

Referenced by anonymous_namespace{CreateProperty.cpp}::createProperty().

◆ createCurve()

std::unique_ptr< Curve > MaterialPropertyLib::createCurve ( BaseLib::ConfigTree const & config,
std::map< std::string, std::unique_ptr< MathLib::PiecewiseLinearInterpolation > > const & curves )
Input File Parameter
properties__property__type
Input File Parameter
properties__property__name
Input File Parameter
properties__property__Curve__curve
Input File Parameter
properties__property__Curve__independent_variable

Definition at line 16 of file CreateCurve.cpp.

21{
23 config.checkConfigParameter("type", "Curve");
24
25 // Second access for storage.
27 auto property_name = config.peekConfigParameter<std::string>("name");
28
29 DBUG("Create Curve {:s}.", property_name);
30
32 auto curve_name = config.getConfigParameter<std::string>("curve");
33 DBUG("Using curve '{:s}'", curve_name);
34
35 auto const& curve =
36 *BaseLib::getOrError(curves, curve_name, "Could not find curve.");
37
38 auto const independent_variable_string =
40 config.getConfigParameter<std::string>("independent_variable");
41 DBUG("Using independent_variable '{:s}'", independent_variable_string);
42
43 static const std::unordered_set<std::string> filter_not_variables = {
44 "t", "x", "y", "z"};
45 MaterialPropertyLib::StringOrVariable independent_variable;
46 if (filter_not_variables.contains(independent_variable_string))
47 {
48 independent_variable = independent_variable_string;
49 }
50 else
51 {
53 independent_variable_string);
54 }
55
56 return std::make_unique<Curve>(
57 std::move(property_name), independent_variable, curve);
58}
OGS_NO_DANGLING Map::mapped_type & getOrError(Map &map, Key const &key, std::string const &error_message)
Definition Algorithm.h:112
std::variant< std::string, Variable > StringOrVariable
Definition Curve.h:12
Variable convertStringToVariable(std::string const &string)

References BaseLib::ConfigTree::checkConfigParameter(), convertStringToVariable(), DBUG(), BaseLib::ConfigTree::getConfigParameter(), BaseLib::getOrError(), and BaseLib::ConfigTree::peekConfigParameter().

Referenced by anonymous_namespace{CreateProperty.cpp}::createProperty().

◆ createDupuitPermeability()

std::unique_ptr< DupuitPermeability > MaterialPropertyLib::createDupuitPermeability ( BaseLib::ConfigTree const & config,
std::vector< std::unique_ptr< ParameterLib::ParameterBase > > const & parameters )
Input File Parameter
properties__property__type
Input File Parameter
properties__property__name
Input File Parameter
properties__property__Dupuit__parameter_name

Definition at line 12 of file CreateDupuitPermeability.cpp.

15{
17 config.checkConfigParameter("type", "Dupuit");
18
19 // Second access for storage.
21 auto property_name = config.peekConfigParameter<std::string>("name");
22
23 DBUG("Create DupuitPermeability property {:s}.", property_name);
24
25 std::string const& parameter_name =
27 config.getConfigParameter<std::string>("parameter_name");
28 auto const& parameter = ParameterLib::findParameter<double>(
29 parameter_name, parameters, 0, nullptr);
30 return std::make_unique<MaterialPropertyLib::DupuitPermeability>(
31 std::move(property_name), parameter);
32}

References BaseLib::ConfigTree::checkConfigParameter(), DBUG(), ParameterLib::findParameter(), BaseLib::ConfigTree::getConfigParameter(), and BaseLib::ConfigTree::peekConfigParameter().

Referenced by anonymous_namespace{CreateProperty.cpp}::createProperty().

◆ createEffectiveThermalConductivityPorosityMixing()

std::unique_ptr< Property > MaterialPropertyLib::createEffectiveThermalConductivityPorosityMixing ( int const geometry_dimension,
BaseLib::ConfigTree const & config,
ParameterLib::CoordinateSystem const *const local_coordinate_system )
Input File Parameter
properties__property__type
Input File Parameter
properties__property__name
Input File Parameter
properties__property__EffectiveThermalConductivityPorosityMixing

Definition at line 11 of file CreateEffectiveThermalConductivityPorosityMixing.cpp.

15{
17 config.checkConfigParameter("type",
18 "EffectiveThermalConductivityPorosityMixing");
19
20 // Second access for storage.
22 auto property_name = config.peekConfigParameter<std::string>("name");
23
24 DBUG(
25 "Create effective thermal_conductivity property from porosity mixing "
26 "{:s}.",
27 property_name);
28
29 if (geometry_dimension == 1)
30 {
31 return std::make_unique<
33 std::move(property_name), local_coordinate_system);
34 }
35
36 if (geometry_dimension == 2)
37 {
38 return std::make_unique<
40 std::move(property_name), local_coordinate_system);
41 }
43 return std::make_unique<
44 MaterialPropertyLib::EffectiveThermalConductivityPorosityMixing<3>>(
45 std::move(property_name), local_coordinate_system);
46}

References BaseLib::ConfigTree::checkConfigParameter(), DBUG(), and BaseLib::ConfigTree::peekConfigParameter().

Referenced by anonymous_namespace{CreateProperty.cpp}::createProperty().

◆ createEmbeddedFracturePermeability()

std::unique_ptr< Property > MaterialPropertyLib::createEmbeddedFracturePermeability ( int const geometry_dimension,
BaseLib::ConfigTree const & config,
std::vector< std::unique_ptr< ParameterLib::ParameterBase > > const & parameters )
Input File Parameter
properties__property__type
Input File Parameter
properties__property__name
Input File Parameter
properties__property__EmbeddedFracturePermeability__intrinsic_permeability
Input File Parameter
properties__property__EmbeddedFracturePermeability__initial_aperture
Input File Parameter
properties__property__EmbeddedFracturePermeability__mean_frac_distance
Input File Parameter
properties__property__EmbeddedFracturePermeability__threshold_strain
Input File Parameter
properties__property__EmbeddedFracturePermeability__fracture_normal
Input File Parameter
properties__property__EmbeddedFracturePermeability__fracture_rotation_xy
Input File Parameter
properties__property__EmbeddedFracturePermeability__fracture_rotation_yz
Input File Parameter
properties__property__EmbeddedFracturePermeability__jacobian_factor

Definition at line 10 of file CreateEmbeddedFracturePermeability.cpp.

13{
14 if ((geometry_dimension != 2) && (geometry_dimension != 3))
15 {
17 "The EmbeddedFracturePermeability is implemented only for 2D or 3D "
18 "problems");
19 }
20
22 config.checkConfigParameter("type", "EmbeddedFracturePermeability");
23
24 // Second access for storage.
26 auto property_name = config.peekConfigParameter<std::string>("name");
27
28 DBUG("Create EmbeddedFracturePermeability medium property");
29
30 auto const k =
32 config.getConfigParameter<double>("intrinsic_permeability");
33
34 auto const b0 =
36 config.getConfigParameter<double>("initial_aperture");
37
38 auto const a =
40 config.getConfigParameter<double>("mean_frac_distance");
41
42 auto const e0 =
44 config.getConfigParameter<double>("threshold_strain");
45
46 bool n_const = false;
47 Eigen::Matrix<double, 3, 1> n;
48 if (auto const n_ptr =
50 config.getConfigParameterOptional<std::vector<double>>(
51 "fracture_normal"))
52 {
53 if ((*n_ptr).size() != 3)
54 {
56 "The size of the fracture normal vector must be 3, but is %d.",
57 (*n_ptr).size());
58 }
59 DBUG("Using constant fracture normal vector.");
60 std::copy_n((*n_ptr).data(), 3, n.data());
61 n_const = true;
62 n /= n.norm();
63 }
64 else
65 {
66 DBUG(
67 "No constant fracture normal was given. By default it will be "
68 "determined as the third principal stress vector.");
69 }
70
71 std::string const fracture_rotation_xy_param_name =
73 config.getConfigParameter<std::string>("fracture_rotation_xy");
74
75 auto const& phi_xy = ParameterLib::findParameter<double>(
76 fracture_rotation_xy_param_name, parameters, 0, nullptr);
77
78 std::string const fracture_rotation_yz_param_name =
80 config.getConfigParameter<std::string>("fracture_rotation_yz");
81
82 auto const& phi_yz = ParameterLib::findParameter<double>(
83 fracture_rotation_yz_param_name, parameters, 0, nullptr);
84
85 auto const jf =
87 config.getConfigParameter<double>("jacobian_factor", 0.);
88
89 if (geometry_dimension == 2)
90 {
91 return std::make_unique<EmbeddedFracturePermeability<2>>(
92 std::move(property_name), n, n_const, k, b0, a, e0, phi_xy, phi_yz,
93 jf);
94 }
95 return std::make_unique<EmbeddedFracturePermeability<3>>(
96 std::move(property_name), n, n_const, k, b0, a, e0, phi_xy, phi_yz, jf);
97}

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

Referenced by anonymous_namespace{CreateProperty.cpp}::createProperty().

◆ createExponential()

std::unique_ptr< Exponential > MaterialPropertyLib::createExponential ( BaseLib::ConfigTree const & config)
Input File Parameter
properties__property__type
Input File Parameter
properties__property__name
Input File Parameter
properties__property__Exponential__reference_value
Input File Parameter
properties__property__Exponential__exponent
Input File Parameter
properties__property__Exponential__exponent__variable_name
Input File Parameter
properties__property__Exponential__exponent__reference_condition
Input File Parameter
properties__property__Exponential__exponent__factor
Input File Parameter
properties__property__Exponential__offset

Definition at line 11 of file CreateExponential.cpp.

13{
15 config.checkConfigParameter("type", "Exponential");
16
17 // Second access for storage.
19 auto property_name = config.peekConfigParameter<std::string>("name");
20
21 DBUG("Create Exponential property {:s}.", property_name);
22 auto const reference_value =
24 config.getConfigParameter<double>("reference_value");
25
26 auto const& exponent_data_config =
28 config.getConfigSubtree("exponent");
29
30 auto const& variable_name =
32 exponent_data_config.getConfigParameter<std::string>("variable_name");
33 auto const reference_condition =
35 exponent_data_config.getConfigParameter<double>("reference_condition");
36 auto const factor =
38 exponent_data_config.getConfigParameter<double>("factor");
39
40 auto const offset =
42 config.getConfigParameter<double>("offset");
43
44 static const std::unordered_set<std::string> filter_not_variables = {
45 "t", "x", "y", "z"};
47 if (filter_not_variables.contains(variable_name))
48 {
49 exp_data_type = variable_name;
50 }
51 else
52 {
53 exp_data_type =
55 }
56
57 MaterialPropertyLib::ExponentData const exp_data{
58 exp_data_type, reference_condition, factor};
59
60 return std::make_unique<MaterialPropertyLib::Exponential>(
61 std::move(property_name), offset, reference_value, exp_data);
62}

References BaseLib::ConfigTree::checkConfigParameter(), convertStringToVariable(), DBUG(), BaseLib::ConfigTree::getConfigParameter(), BaseLib::ConfigTree::getConfigSubtree(), and BaseLib::ConfigTree::peekConfigParameter().

Referenced by anonymous_namespace{CreateProperty.cpp}::createProperty().

◆ createFunction()

std::unique_ptr< Function > MaterialPropertyLib::createFunction ( BaseLib::ConfigTree const & config,
std::map< std::string, std::unique_ptr< MathLib::PiecewiseLinearInterpolation > > const & curves )
Input File Parameter
properties__property__type
Input File Parameter
properties__property__name
Input File Parameter
properties__property__Function__value
Input File Parameter
properties__property__Function__value__expression
Input File Parameter
properties__property__Function__dvalue
Input File Parameter
properties__property__Function__dvalue__variable_name
Input File Parameter
properties__property__Function__dvalue__expression
Input File Parameter
properties__property__Function__d2value
Input File Parameter
properties__property__Function__d2value__variable_name
Input File Parameter
properties__property__Function__d2value__expression

Definition at line 30 of file CreateFunction.cpp.

35{
37 config.checkConfigParameter("type", "Function");
38
39 // Second access for storage.
41 auto property_name = config.peekConfigParameter<std::string>("name");
42
43 DBUG("Create Function property {:s}.", property_name);
44
46 auto const& value_config = config.getConfigSubtree("value");
47
48 auto const value_expressions = parseExpressionList(
50 value_config.getConfigSubtreeList("expression"));
51
52 // For each derivative a name of the variable and the list of expressions.
53 std::vector<std::pair<std::string, std::vector<std::string>>>
54 dvalue_expressions;
56 for (auto const& dvalue_config : config.getConfigSubtreeList("dvalue"))
57 {
58 auto variable_name =
60 dvalue_config.getConfigParameter<std::string>("variable_name");
61
62 auto expressions = parseExpressionList(
64 dvalue_config.getConfigSubtreeList("expression"));
65
66 dvalue_expressions.emplace_back(std::move(variable_name),
67 std::move(expressions));
68 }
69
70 // For each second derivative: two variable names and expression list.
71 std::vector<D2ValueConfig> d2value_expressions;
73 for (auto const& d2value_config : config.getConfigSubtreeList("d2value"))
74 {
75 auto variable_names_range =
77 d2value_config.getConfigParameterList<std::string>("variable_name");
78
79 std::vector<std::string> variable_names(variable_names_range.begin(),
80 variable_names_range.end());
81
82 if (variable_names.size() != 2)
83 {
85 "Function property '{}': each <d2value> block must contain "
86 "exactly two <variable_name> entries, but {:d} were given.",
87 property_name, variable_names.size());
88 }
89
90 auto expressions = parseExpressionList(
92 d2value_config.getConfigSubtreeList("expression"));
93
94 d2value_expressions.emplace_back(std::move(variable_names[0]),
95 std::move(variable_names[1]),
96 std::move(expressions));
97 }
98
99 return std::make_unique<MaterialPropertyLib::Function>(
100 std::move(property_name),
101 value_expressions,
102 dvalue_expressions,
103 d2value_expressions,
104 curves);
105}
std::vector< std::string > parseExpressionList(ConfigSubtreeList const &expression_configs)

References BaseLib::ConfigTree::checkConfigParameter(), DBUG(), BaseLib::ConfigTree::getConfigSubtree(), BaseLib::ConfigTree::getConfigSubtreeList(), OGS_FATAL, and BaseLib::ConfigTree::peekConfigParameter().

Referenced by anonymous_namespace{CreateProperty.cpp}::createProperty().

◆ createGasPressureDependentPermeability()

std::unique_ptr< Property > MaterialPropertyLib::createGasPressureDependentPermeability ( int const geometry_dimension,
BaseLib::ConfigTree const & config,
std::vector< std::unique_ptr< ParameterLib::ParameterBase > > const & parameters,
ParameterLib::CoordinateSystem const *const local_coordinate_system )
Input File Parameter
properties__property__type
Input File Parameter
properties__property__name
Input File Parameter
properties__property__GasPressureDependentPermeability__initial_permeability
Input File Parameter
properties__property__GasPressureDependentPermeability__a1
Input File Parameter
properties__property__GasPressureDependentPermeability__a2
Input File Parameter
properties__property__GasPressureDependentPermeability__pressure_threshold
Input File Parameter
properties__property__GasPressureDependentPermeability__minimum_permeability
Input File Parameter
properties__property__GasPressureDependentPermeability__maximum_permeability

Definition at line 18 of file CreateGasPressureDependentPermeability.cpp.

23{
24 if ((geometry_dimension != 2) && (geometry_dimension != 3))
25 {
27 "The GasPressureDependentPermeability is implemented only for 2D "
28 "or 3D problems");
29 }
30
32 config.checkConfigParameter("type", "GasPressureDependentPermeability");
33
34 // Second access for storage.
36 auto property_name = config.peekConfigParameter<std::string>("name");
37
38 DBUG("Create GasPressureDependentPermeability property {:s}.",
39 property_name);
40
41 std::string const& parameter_name =
43 config.getConfigParameter<std::string>("initial_permeability");
44 auto const& parameter_k0 = ParameterLib::findParameter<double>(
45 parameter_name, parameters, 0, nullptr);
46
47 auto const a1 =
49 config.getConfigParameter<double>("a1");
50 auto const a2 =
52 config.getConfigParameter<double>("a2");
53 auto const pressure_threshold =
55 config.getConfigParameter<double>("pressure_threshold");
56 auto const minimum_permeability =
58 config.getConfigParameter<double>("minimum_permeability");
59 auto const maximum_permeability =
61 config.getConfigParameter<double>("maximum_permeability");
62
63 if (minimum_permeability > maximum_permeability)
64 {
66 "The value of minimum_permeability of {:e} is larger that the "
67 "value of maximum_permeability of {:e} in "
68 "GasPressureDependentPermeability",
69 minimum_permeability, maximum_permeability);
70 }
71
72 if (geometry_dimension == 2)
73 {
74 return std::make_unique<GasPressureDependentPermeability<2>>(
75 std::move(property_name), parameter_k0, a1, a2, pressure_threshold,
76 minimum_permeability, maximum_permeability,
77 local_coordinate_system);
78 }
79
80 return std::make_unique<GasPressureDependentPermeability<3>>(
81 std::move(property_name), parameter_k0, a1, a2, pressure_threshold,
82 minimum_permeability, maximum_permeability, local_coordinate_system);
83}

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

Referenced by anonymous_namespace{CreateProperty.cpp}::createProperty().

◆ createIdealGasLaw()

std::unique_ptr< IdealGasLaw > MaterialPropertyLib::createIdealGasLaw ( BaseLib::ConfigTree const & config)
Input File Parameter
properties__property__type
Input File Parameter
properties__property__name
Input File Parameter
properties__property__IdealGasLaw

Definition at line 9 of file CreateIdealGasLaw.cpp.

11{
13 config.checkConfigParameter("type", "IdealGasLaw");
14
15 // Second access for storage.
17 auto property_name = config.peekConfigParameter<std::string>("name");
18
19 DBUG("Create IdealGasLaw medium property {:s}.", property_name);
21 return std::make_unique<IdealGasLaw>(std::move(property_name));
22}

References BaseLib::ConfigTree::checkConfigParameter(), DBUG(), and BaseLib::ConfigTree::peekConfigParameter().

Referenced by anonymous_namespace{CreateProperty.cpp}::createProperty().

◆ createIdealGasLawBinaryMixture()

std::unique_ptr< IdealGasLawBinaryMixture > MaterialPropertyLib::createIdealGasLawBinaryMixture ( BaseLib::ConfigTree const & config)
Input File Parameter
properties__property__type
Input File Parameter
properties__property__name
Input File Parameter
properties__property__IdealGasLawBinaryMixture

Definition at line 9 of file CreateIdealGasLawBinaryMixture.cpp.

11{
13 config.checkConfigParameter("type", "IdealGasLawBinaryMixture");
14
15 // Second access for storage.
17 auto property_name = config.peekConfigParameter<std::string>("name");
18
19 DBUG("Create IdealGasLawBinaryMixture medium property {:s}.",
20 property_name);
21
23 return std::make_unique<IdealGasLawBinaryMixture>(std::move(property_name));
24}

References BaseLib::ConfigTree::checkConfigParameter(), DBUG(), and BaseLib::ConfigTree::peekConfigParameter().

Referenced by anonymous_namespace{CreateProperty.cpp}::createProperty().

◆ createKozenyCarmanModel()

std::unique_ptr< Property > MaterialPropertyLib::createKozenyCarmanModel ( BaseLib::ConfigTree const & config,
std::vector< std::unique_ptr< ParameterLib::ParameterBase > > const & parameters )
Input File Parameter
properties__property__type
Input File Parameter
properties__property__KozenyCarman__initial_permeability
Input File Parameter
properties__property__KozenyCarman__initial_porosity

Definition at line 12 of file CreateKozenyCarmanModel.cpp.

15{
17 config.checkConfigParameter("type", "KozenyCarman");
18 DBUG("Create Kozeny-Carman model.");
19
22 config.getConfigParameter<std::string>("initial_permeability"),
23 parameters, 0, nullptr);
24
25 auto const& phi0 = ParameterLib::findParameter<double>(
27 config.getConfigParameter<std::string>("initial_porosity"), parameters,
28 1, nullptr);
29
30 return std::make_unique<KozenyCarmanModel>(k0, phi0);
31}

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

Referenced by anonymous_namespace{CreateProperty.cpp}::createProperty().

◆ createLinear()

std::unique_ptr< Linear > MaterialPropertyLib::createLinear ( BaseLib::ConfigTree const & config)
Input File Parameter
properties__property__type
Input File Parameter
properties__property__name
Input File Parameter
properties__property__Linear__reference_value
Input File Parameter
properties__property__Linear__independent_variable
Input File Parameter
properties__property__Linear__independent_variable__variable_name
Input File Parameter
properties__property__Linear__independent_variable__reference_condition
Input File Parameter
properties__property__Linear__independent_variable__slope
Input File Parameter
properties__property__Linear__independent_variable__min
Input File Parameter
properties__property__Linear__independent_variable__max

Definition at line 11 of file CreateLinear.cpp.

12{
14 config.checkConfigParameter("type", "Linear");
15
16 // Second access for storage.
18 auto property_name = config.peekConfigParameter<std::string>("name");
19
20 DBUG("Create Linear property {:s}.", property_name);
21 auto const reference_value =
23 config.getConfigParameter<double>("reference_value");
24
25 std::vector<MaterialPropertyLib::IndependentVariable> ivs;
26 for (auto const& independent_variable_config :
28 config.getConfigSubtreeList("independent_variable"))
29 {
30 auto const& variable_name =
32 independent_variable_config.getConfigParameter<std::string>(
33 "variable_name");
34 auto const reference_condition =
36 independent_variable_config.getConfigParameter<double>(
37 "reference_condition");
38 auto const slope =
40 independent_variable_config.getConfigParameter<double>("slope");
41
42 auto const min =
44 independent_variable_config.getConfigParameterOptional<double>(
45 "min");
46
47 auto const max =
49 independent_variable_config.getConfigParameterOptional<double>(
50 "max");
51
52 static const std::unordered_set<std::string> filter_not_variables = {
53 "t", "x", "y", "z"};
55 if (!filter_not_variables.contains(variable_name))
56 {
58 }
59 else
60 {
61 ivt = variable_name;
62 }
63
64 MaterialPropertyLib::IndependentVariable iv{ivt, reference_condition,
65 slope, min, max};
66
67 ivs.push_back(std::move(iv));
68 }
69
70 return std::make_unique<MaterialPropertyLib::Linear>(
71 std::move(property_name), reference_value, ivs);
72}

References BaseLib::ConfigTree::checkConfigParameter(), convertStringToVariable(), DBUG(), BaseLib::ConfigTree::getConfigParameter(), BaseLib::ConfigTree::getConfigSubtreeList(), and BaseLib::ConfigTree::peekConfigParameter().

Referenced by anonymous_namespace{CreateProperty.cpp}::createProperty().

◆ createLinearSaturationSwellingStress()

std::unique_ptr< Property > MaterialPropertyLib::createLinearSaturationSwellingStress ( BaseLib::ConfigTree const & config)
Input File Parameter
properties__property__type
Input File Parameter
properties__property__name
Input File Parameter
properties__property__LinearSaturationSwellingStress__coefficient
Input File Parameter
properties__property__LinearSaturationSwellingStress__reference_saturation

Definition at line 12 of file CreateLinearSaturationSwellingStress.cpp.

14{
16 config.checkConfigParameter("type", "LinearSaturationSwellingStress");
17
19 auto property_name = config.peekConfigParameter<std::string>("name");
20
21 DBUG("Create LinearSaturationSwellingStress phase property {:s}.",
22 property_name);
23
24 auto const coefficient =
26 config.getConfigParameter<double>("coefficient");
27
28 auto const reference_saturation =
30 config.getConfigParameter<double>("reference_saturation");
31
32 return std::make_unique<LinearSaturationSwellingStress>(
33 property_name, coefficient, reference_saturation);
34}

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

Referenced by anonymous_namespace{CreateProperty.cpp}::createProperty().

◆ createLinearWaterVapourLatentHeat()

std::unique_ptr< Property > MaterialPropertyLib::createLinearWaterVapourLatentHeat ( BaseLib::ConfigTree const & config)
Input File Parameter
properties__property__type
Input File Parameter
properties__property__name
Input File Parameter
properties__property__LinearWaterVapourLatentHeat

Definition at line 12 of file CreateLinearWaterVapourLatentHeat.cpp.

14{
16 config.checkConfigParameter("type", "LinearWaterVapourLatentHeat");
17 DBUG("Create LinearWaterVapourLatentHeat phase property");
18
19 // Second access for storage.
21 auto property_name = config.peekConfigParameter<std::string>("name");
22
24 return std::make_unique<LinearWaterVapourLatentHeat>(
25 std::move(property_name));
26}

References BaseLib::ConfigTree::checkConfigParameter(), DBUG(), and BaseLib::ConfigTree::peekConfigParameter().

Referenced by anonymous_namespace{CreateProperty.cpp}::createProperty().

◆ createLiquidViscosityVogels()

std::unique_ptr< Property > MaterialPropertyLib::createLiquidViscosityVogels ( BaseLib::ConfigTree const & config)
Input File Parameter
properties__property__type
Input File Parameter
properties__property__name
Input File Parameter
properties__property__LiquidViscosityVogels__liquid_type
Input File Parameter
properties__property__LiquidViscosityVogels__liquid_type
Input File Parameter
properties__property__LiquidViscosityVogels__liquid_type
Input File Parameter
properties__property__LiquidViscosityVogels__liquid_type

Definition at line 12 of file CreateLiquidViscosityVogels.cpp.

14{
16 config.checkConfigParameter("type", "LiquidViscosityVogels");
17 INFO("Using Vogels model, which gives viscosity in SI unit, Pa s");
18
19 // Second access for storage.
21 auto property_name = config.peekConfigParameter<std::string>("name");
22
23 auto const fluid_type =
25 config.peekConfigParameter<std::string>("liquid_type");
26
27 if (fluid_type == "Water")
28 {
30 config.checkConfigParameter("liquid_type", "Water");
31
32 const VogelsViscosityConstantsWater constants;
33 return std::make_unique<
35 std::move(property_name), std::move(constants));
36 }
37 if (fluid_type == "CO2")
38 {
40 config.checkConfigParameter("liquid_type", "CO2");
41 const VogelsViscosityConstantsCO2 constants;
42 return std::make_unique<
43 LiquidViscosityVogels<VogelsViscosityConstantsCO2>>(
44 std::move(property_name), std::move(constants));
45 }
46 if (fluid_type == "CH4")
47 {
49 config.checkConfigParameter("liquid_type", "CH4");
50 const VogelsViscosityConstantsCH4 constants;
51 return std::make_unique<
53 std::move(property_name), std::move(constants));
54 }
56 "The fluid type {:s} for Vogels model is unavailable.\n"
57 "The available fluid types are Water, CO2 and CH4\n",
58 fluid_type.data());
59}
void INFO(fmt::format_string< Args... > fmt, Args &&... args)
Definition Logging.h:28

References BaseLib::ConfigTree::checkConfigParameter(), INFO(), OGS_FATAL, and BaseLib::ConfigTree::peekConfigParameter().

Referenced by anonymous_namespace{CreateProperty.cpp}::createProperty().

◆ createMaterialSpatialDistributionMap()

MaterialSpatialDistributionMap MaterialPropertyLib::createMaterialSpatialDistributionMap ( std::map< int, std::shared_ptr< Medium > > const & media,
MeshLib::Mesh const & mesh )

Definition at line 11 of file CreateMaterialSpatialDistributionMap.cpp.

14{
15 auto const material_ids = materialIDs(mesh);
16
17 int const max_material_id = !material_ids ? 0 : ranges::max(*material_ids);
18
19 if (!material_ids && media.size() > 1)
20 {
22 "More than one porous medium definition (namely {}) is present in "
23 "the project file, but no MaterialIDs are present in the bulk "
24 "mesh.",
25 media.size());
26 }
27
28 if (max_material_id > static_cast<int>(media.size() - 1))
29 {
30 WARN(
31 "The maximum value of MaterialIDs in mesh is {:d}. As the given "
32 "number of porous media definitions in the project file is {:d}, "
33 "the maximum value of MaterialIDs in mesh must be {:d} (index "
34 "starts with zero).",
35 max_material_id, media.size(), max_material_id - 1);
36 }
37
38 if (max_material_id < static_cast<int>(media.size() - 1))
39 {
40 WARN(
41 "There are {:d} porous medium definitions in the project file but "
42 "only {:d} different values in the MaterialIDs vector/data_array "
43 "in the mesh.",
44 media.size(), max_material_id - 1);
45 }
46 return {media, material_ids};
47}
void WARN(fmt::format_string< Args... > fmt, Args &&... args)
Definition Logging.h:34

References OGS_FATAL, and WARN().

Referenced by ProcessLib::ComponentTransport::createComponentTransportProcess(), ProcessLib::HeatConduction::createHeatConductionProcess(), ProcessLib::HeatTransportBHE::createHeatTransportBHEProcess(), ProcessLib::HMPhaseField::createHMPhaseFieldProcess(), ProcessLib::HT::createHTProcess(), ProcessLib::HydroMechanics::createHydroMechanicsProcess(), ProcessLib::LIE::HydroMechanics::createHydroMechanicsProcess(), ProcessLib::LargeDeformation::createLargeDeformationProcess(), ProcessLib::LiquidFlow::createLiquidFlowProcess(), ProcessLib::RichardsComponentTransport::createRichardsComponentTransportProcess(), ProcessLib::RichardsFlow::createRichardsFlowProcess(), ProcessLib::RichardsMechanics::createRichardsMechanicsProcess(), ProcessLib::SmallDeformation::createSmallDeformationProcess(), ProcessLib::SteadyStateDiffusion::createSteadyStateDiffusion(), ProcessLib::TH2M::createTH2MProcess(), ProcessLib::ThermalTwoPhaseFlowWithPP::createThermalTwoPhaseFlowWithPPProcess(), ProcessLib::ThermoHydroMechanics::createThermoHydroMechanicsProcess(), ProcessLib::ThermoMechanics::createThermoMechanicsProcess(), ProcessLib::ThermoRichardsFlow::createThermoRichardsFlowProcess(), ProcessLib::ThermoRichardsMechanics::createThermoRichardsMechanicsProcessStage2(), ProcessLib::TwoPhaseFlowWithPP::createTwoPhaseFlowWithPPProcess(), ProcessLib::createWellboreCompensateNeumannBoundaryCondition(), and ProcessLib::WellboreSimulator::createWellboreSimulatorProcess().

◆ createMedium()

std::unique_ptr< Medium > MaterialPropertyLib::createMedium ( int const material_id,
int const geometry_dimension,
BaseLib::ConfigTree const & config,
std::vector< std::unique_ptr< ParameterLib::ParameterBase > > & parameters,
ParameterLib::CoordinateSystem const *const local_coordinate_system,
std::map< std::string, std::unique_ptr< MathLib::PiecewiseLinearInterpolation > > const & curves )

This function parses the "phases" and "properties" subtrees of the config tree and calls create methods for the phase vector and the properties array. Medium properties are optional. If not defined, default properties are assigned.

Input File Parameter
prj__media__medium__phases
Input File Parameter
prj__media__medium__properties

Definition at line 15 of file CreateMedium.cpp.

24{
25 // Parsing the phases
26 // Properties of phases may be not required in all the cases.
27 auto&& phases = createPhases(geometry_dimension,
29 config.getConfigSubtreeOptional("phases"),
30 parameters, local_coordinate_system, curves);
31
32 // Parsing medium properties, overwriting the defaults.
33 auto&& properties =
34 createProperties(geometry_dimension,
36 config.getConfigSubtreeOptional("properties"),
37 parameters, local_coordinate_system, curves);
38
39 if (phases.empty() && !properties)
40 {
41 OGS_FATAL("Neither tag <phases> nor tag <properties> has been found.");
42 }
43
44 return std::make_unique<Medium>(material_id, std::move(phases),
45 std::move(properties));
46}
std::unique_ptr< PropertyArray > createProperties(int const geometry_dimension, std::optional< BaseLib::ConfigTree > const &config, std::vector< std::unique_ptr< ParameterLib::ParameterBase > > &parameters, ParameterLib::CoordinateSystem const *const local_coordinate_system, std::map< std::string, std::unique_ptr< MathLib::PiecewiseLinearInterpolation > > const &curves)
std::vector< std::unique_ptr< Phase > > createPhases(int const geometry_dimension, std::optional< BaseLib::ConfigTree > const &config, std::vector< std::unique_ptr< ParameterLib::ParameterBase > > &parameters, ParameterLib::CoordinateSystem const *const local_coordinate_system, std::map< std::string, std::unique_ptr< MathLib::PiecewiseLinearInterpolation > > const &curves)

References createPhases(), createProperties(), BaseLib::ConfigTree::getConfigSubtreeOptional(), and OGS_FATAL.

Referenced by ProjectData::parseMedia().

◆ createOrthotropicEmbeddedFracturePermeability()

std::unique_ptr< Property > MaterialPropertyLib::createOrthotropicEmbeddedFracturePermeability ( int const geometry_dimension,
BaseLib::ConfigTree const & config,
std::vector< std::unique_ptr< ParameterLib::ParameterBase > > const & parameters )
Input File Parameter
properties__property__type
Input File Parameter
properties__property__name
Input File Parameter
properties__property__OrthotropicEmbeddedFracturePermeability__mean_frac_distances
Input File Parameter
properties__property__OrthotropicEmbeddedFracturePermeability__threshold_strains
Input File Parameter
properties__property__OrthotropicEmbeddedFracturePermeability__fracture_normals
Input File Parameter
properties__property__OrthotropicEmbeddedFracturePermeability__intrinsic_permeability
Input File Parameter
properties__property__OrthotropicEmbeddedFracturePermeability__fracture_rotation_xy
Input File Parameter
properties__property__OrthotropicEmbeddedFracturePermeability__fracture_rotation_yz
Input File Parameter
properties__property__OrthotropicEmbeddedFracturePermeability__jacobian_factor

Definition at line 12 of file CreateOrthotropicEmbeddedFracturePermeability.cpp.

15{
16 if ((geometry_dimension != 2) && (geometry_dimension != 3))
17 {
19 "The OrthotropicEmbeddedFracturePermeability is implemented only "
20 "for 2D or 3D problems");
21 }
22
24 config.checkConfigParameter("type",
25 "OrthotropicEmbeddedFracturePermeability");
26
27 // Second access for storage.
29 auto property_name = config.peekConfigParameter<std::string>("name");
30
31 DBUG("Create OrthotropicEmbeddedFracturePermeability medium property");
32
33 auto const a_i =
35 config.getConfigParameter<std::vector<double>>("mean_frac_distances");
36 if (a_i.size() != 3)
37 {
39 "The size of the mean fracture distances vector must be 3, but is "
40 "{}.",
41 a_i.size());
42 }
43
44 auto const e_i0 =
46 config.getConfigParameter<std::vector<double>>("threshold_strains");
47 if (e_i0.size() != 3)
48 {
50 "The size of the mean threshold strains vector must be 3, but is "
51 "{}.",
52 e_i0.size());
53 }
54
55 auto const n =
57 config.getConfigParameter<std::vector<double>>("fracture_normals");
58 if (n.size() != 6)
59 {
61 "The size of the fracture normals vector must be 6, but is {}.",
62 n.size());
63 }
64 Eigen::Vector3d const n1 = Eigen::Vector3d({n[0], n[1], n[2]}).normalized();
65 Eigen::Vector3d const n2 = Eigen::Vector3d({n[3], n[4], n[5]}).normalized();
66
67 if (n1.dot(n2) > std::numeric_limits<double>::epsilon())
68 {
70 "The given fracture normals are not orthogonal. Please provide two "
71 "orthogonal fracture normals");
72 }
73
74 Eigen::Matrix3d const n_i =
75 (Eigen::Matrix3d() << n1, n2, n1.cross(n2)).finished();
76
77 std::string const intrinsic_permeability_param_name =
79 config.getConfigParameter<std::string>("intrinsic_permeability");
80
82 intrinsic_permeability_param_name, parameters, 0, nullptr);
83
84 std::string const fracture_rotation_xy_param_name =
86 config.getConfigParameter<std::string>("fracture_rotation_xy");
87
88 auto const& phi_xy = ParameterLib::findParameter<double>(
89 fracture_rotation_xy_param_name, parameters, 0, nullptr);
90
91 std::string const fracture_rotation_yz_param_name =
93 config.getConfigParameter<std::string>("fracture_rotation_yz");
94
95 auto const& phi_yz = ParameterLib::findParameter<double>(
96 fracture_rotation_yz_param_name, parameters, 0, nullptr);
97
98 auto const jf =
100 config.getConfigParameter<double>("jacobian_factor", 0.);
101
102 if (geometry_dimension == 2)
103 {
104 return std::make_unique<OrthotropicEmbeddedFracturePermeability<2>>(
105 std::move(property_name), a_i, e_i0, n_i, k, phi_xy, phi_yz, jf);
106 }
107 return std::make_unique<OrthotropicEmbeddedFracturePermeability<3>>(
108 std::move(property_name), a_i, e_i0, n_i, k, phi_xy, phi_yz, jf);
109}

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

Referenced by anonymous_namespace{CreateProperty.cpp}::createProperty().

◆ createParameterProperty()

std::unique_ptr< Parameter > MaterialPropertyLib::createParameterProperty ( BaseLib::ConfigTree const & config,
std::vector< std::unique_ptr< ParameterLib::ParameterBase > > const & parameters )
Input File Parameter
properties__property__type
Input File Parameter
properties__property__name
Input File Parameter
properties__property__Parameter__parameter_name

Definition at line 13 of file CreateParameter.cpp.

16{
18 config.checkConfigParameter("type", "Parameter");
19
20 // Second access for storage.
22 auto property_name = config.peekConfigParameter<std::string>("name");
23
24 DBUG("Create Parameter property {:s}.", property_name);
25
26 std::string const& parameter_name =
28 config.getConfigParameter<std::string>("parameter_name");
29 auto const& parameter = ParameterLib::findParameter<double>(
30 parameter_name, parameters, 0, nullptr);
31 return std::make_unique<MaterialPropertyLib::Parameter>(
32 std::move(property_name), parameter);
33}

References BaseLib::ConfigTree::checkConfigParameter(), DBUG(), ParameterLib::findParameter(), BaseLib::ConfigTree::getConfigParameter(), and BaseLib::ConfigTree::peekConfigParameter().

Referenced by anonymous_namespace{CreateProperty.cpp}::createProperty().

◆ createPengRobinson()

std::unique_ptr< Property > MaterialPropertyLib::createPengRobinson ( BaseLib::ConfigTree const & config)
Input File Parameter
properties__property__type
Input File Parameter
properties__property__PengRobinson__critical_temperature
Input File Parameter
properties__property__PengRobinson__critical_pressure
Input File Parameter
properties__property__PengRobinson__acentric_factor

Definition at line 12 of file CreatePengRobinson.cpp.

13{
15 config.checkConfigParameter("type", "PengRobinson");
16 DBUG("Create PengRobinson EOS.");
17
18 auto const Tc =
20 config.getConfigParameter<double>("critical_temperature");
21
22 auto const pc =
24 config.getConfigParameter<double>("critical_pressure");
25
26 auto const omega =
28 config.getConfigParameter<double>("acentric_factor");
29
30 return std::make_unique<PengRobinson>(Tc, pc, omega);
31}

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

Referenced by anonymous_namespace{CreateProperty.cpp}::createProperty().

◆ createPermeabilityMohrCoulombFailureIndexModel()

std::unique_ptr< Property > MaterialPropertyLib::createPermeabilityMohrCoulombFailureIndexModel ( int const geometry_dimension,
BaseLib::ConfigTree const & config,
std::vector< std::unique_ptr< ParameterLib::ParameterBase > > const & parameters,
ParameterLib::CoordinateSystem const *const local_coordinate_system )
Input File Parameter
properties__property__type
Input File Parameter
properties__property__name
Input File Parameter
properties__property__PermeabilityMohrCoulombFailureIndexModel__initial_permeability
Input File Parameter
properties__property__PermeabilityMohrCoulombFailureIndexModel__reference_permeability
Input File Parameter
properties__property__PermeabilityMohrCoulombFailureIndexModel__fitting_factor
Input File Parameter
properties__property__PermeabilityMohrCoulombFailureIndexModel__cohesion
Input File Parameter
properties__property__PermeabilityMohrCoulombFailureIndexModel__friction_angle
Input File Parameter
properties__property__PermeabilityMohrCoulombFailureIndexModel__maximum_permeability
Input File Parameter
properties__property__PermeabilityMohrCoulombFailureIndexModel__tensile_strength_parameter

Definition at line 17 of file CreatePermeabilityMohrCoulombFailureIndexModel.cpp.

22{
23 if ((geometry_dimension != 2) && (geometry_dimension != 3))
24 {
26 "The PermeabilityMohrCoulombFailureIndexModel is implemented only "
27 "for 2D or 3D problems");
28 }
29
31 config.checkConfigParameter("type",
32 "PermeabilityMohrCoulombFailureIndexModel");
33
34 // Second access for storage.
36 auto property_name = config.peekConfigParameter<std::string>("name");
37
38 DBUG("Create PermeabilityMohrCoulombFailureIndexModel property {:s}.",
39 property_name);
40
41 std::string const& parameter_name =
43 config.getConfigParameter<std::string>("initial_permeability");
44 auto const& parameter_k0 = ParameterLib::findParameter<double>(
45 parameter_name, parameters, 0, nullptr);
46
47 auto const kr =
49 config.getConfigParameter<double>("reference_permeability");
50 auto const b =
52 config.getConfigParameter<double>("fitting_factor");
53 auto const c =
55 config.getConfigParameter<double>("cohesion");
56 auto const phi =
58 config.getConfigParameter<double>("friction_angle");
59 auto const max_k =
61 config.getConfigParameter<double>("maximum_permeability");
62 auto const t_sigma_max =
64 config.getConfigParameter<double>("tensile_strength_parameter");
65
66 if (geometry_dimension == 2)
67 {
68 return std::make_unique<PermeabilityMohrCoulombFailureIndexModel<2>>(
69 std::move(property_name), parameter_k0, kr, b, c, phi, max_k,
70 t_sigma_max, local_coordinate_system);
71 }
72
73 return std::make_unique<PermeabilityMohrCoulombFailureIndexModel<3>>(
74 std::move(property_name), parameter_k0, kr, b, c, phi, max_k,
75 t_sigma_max, local_coordinate_system);
76}

References c, BaseLib::ConfigTree::checkConfigParameter(), DBUG(), ParameterLib::findParameter(), BaseLib::ConfigTree::getConfigParameter(), OGS_FATAL, and BaseLib::ConfigTree::peekConfigParameter().

Referenced by anonymous_namespace{CreateProperty.cpp}::createProperty().

◆ createPermeabilityOrthotropicPowerLaw()

std::unique_ptr< Property > MaterialPropertyLib::createPermeabilityOrthotropicPowerLaw ( BaseLib::ConfigTree const & config,
ParameterLib::CoordinateSystem const *const local_coordinate_system )
Input File Parameter
properties__property__type
Input File Parameter
properties__property__name
Input File Parameter
properties__property__PermeabilityOrthotropicPowerLaw__intrinsic_permeabilities
Input File Parameter
properties__property__PermeabilityOrthotropicPowerLaw__exponents

Definition at line 10 of file CreatePermeabilityOrthotropicPowerLaw.cpp.

13{
15 config.checkConfigParameter("type", "PermeabilityOrthotropicPowerLaw");
16
17 // Second access for storage.
19 auto property_name = config.peekConfigParameter<std::string>("name");
20
21 DBUG("Create PermeabilityOrthotropicPowerLaw solid phase property {:s}.",
22 property_name);
23
24 auto const intrinsic_permeabilities =
26 config.getConfigParameter<std::vector<double>>(
27 "intrinsic_permeabilities");
28
29 if (intrinsic_permeabilities.size() != 3 &&
30 intrinsic_permeabilities.size() != 2)
31 {
33 "The number of intrinsic permeabilities must be two or three, but "
34 "{:d} were given.",
35 intrinsic_permeabilities.size());
36 }
37
38 auto const exponents =
40 config.getConfigParameter<std::vector<double>>("exponents");
41
42 if (exponents.size() != 3 && exponents.size() != 2)
43 {
45 "The number of exponents must be two or three, but {:d} were "
46 "given.",
47 exponents.size());
48 }
49
50 if (intrinsic_permeabilities.size() != exponents.size())
51 {
53 "The number of intrinsic permeabilities and exponents must be "
54 "equal, but they are {:d} and {:d}, respectively.",
55 intrinsic_permeabilities.size(), exponents.size());
56 }
57
58 if (exponents.size() == 2)
59 {
60 return std::make_unique<PermeabilityOrthotropicPowerLaw<2>>(
61 std::move(property_name),
62 std::array<double, 2>{intrinsic_permeabilities[0],
63 intrinsic_permeabilities[1]},
64 std::array<double, 2>{exponents[0], exponents[1]},
65 local_coordinate_system);
66 }
67 if (exponents.size() == 3)
68 {
69 return std::make_unique<PermeabilityOrthotropicPowerLaw<3>>(
70 std::move(property_name),
71 std::array<double, 3>{intrinsic_permeabilities[0],
72 intrinsic_permeabilities[1],
73 intrinsic_permeabilities[2]},
74 std::array<double, 3>{exponents[0], exponents[1], exponents[2]},
75 local_coordinate_system);
76 }
78 "Could not create PermeabilityOrthotropicPowerLaw material model.");
79}

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

Referenced by anonymous_namespace{CreateProperty.cpp}::createProperty().

◆ createPhases()

std::vector< std::unique_ptr< Phase > > MaterialPropertyLib::createPhases ( int const geometry_dimension,
std::optional< BaseLib::ConfigTree > const & config,
std::vector< std::unique_ptr< ParameterLib::ParameterBase > > & parameters,
ParameterLib::CoordinateSystem const *const local_coordinate_system,
std::map< std::string, std::unique_ptr< MathLib::PiecewiseLinearInterpolation > > const & curves )

A method that parses the phase details and stores them in the private phases_ member.

This method creates the phases of the medium. Unlike a medium, a phase may have a name. However, this is silly at the moment since this name still has no effect (except of some benefits in regard of readability). Phase components are required (a phase consists of at least one component). Phase properties are optional. If not given, default properties are assigned. These default properties average the component properties, weighted by mole fraction.

Input File Parameter
prj__media__medium__phases__phase

Definition at line 72 of file CreatePhase.cpp.

80{
81 if (!config)
82 {
83 return {};
84 }
85
86 std::vector<std::unique_ptr<Phase>> phases;
87
88 for (auto phase_config :
90 config->getConfigSubtreeList("phase"))
91 {
92 auto phase = createPhase(geometry_dimension, phase_config, parameters,
93 local_coordinate_system, curves);
94
95 if (std::find_if(phases.begin(),
96 phases.end(),
97 [phase_type = phase->phaseName](auto const& p)
98 { return p->phaseName == phase_type; }) !=
99 phases.end())
100 {
101 OGS_FATAL("Found duplicates with the same phase name tag '{:s}'.",
102 toString(phase->phaseName));
103 }
104
105 phases.push_back(std::move(phase));
106 }
107
108 return phases;
109}
std::unique_ptr< MaterialPropertyLib::Phase > createPhase(int const geometry_dimension, BaseLib::ConfigTree const &config, std::vector< std::unique_ptr< ParameterLib::ParameterBase > > &parameters, ParameterLib::CoordinateSystem const *const local_coordinate_system, std::map< std::string, std::unique_ptr< MathLib::PiecewiseLinearInterpolation > > const &curves)

References OGS_FATAL, and toString().

Referenced by createMedium().

◆ createPorosityFromMassBalance()

std::unique_ptr< PorosityFromMassBalance > MaterialPropertyLib::createPorosityFromMassBalance ( BaseLib::ConfigTree const & config,
std::vector< std::unique_ptr< ParameterLib::ParameterBase > > const & parameters )
Input File Parameter
properties__property__type
Input File Parameter
properties__property__name
Input File Parameter
properties__property__PorosityFromMassBalance__initial_porosity
Input File Parameter
properties__property__PorosityFromMassBalance__minimal_porosity
Input File Parameter
properties__property__PorosityFromMassBalance__maximal_porosity

Definition at line 12 of file CreatePorosityFromMassBalance.cpp.

15{
17 config.checkConfigParameter("type", "PorosityFromMassBalance");
18
19 // Second access for storage.
21 auto property_name = config.peekConfigParameter<std::string>("name");
22
23 DBUG("Create PorosityFromMassBalance medium property {:s}.", property_name);
24
25 std::string const& parameter_name =
27 config.getConfigParameter<std::string>("initial_porosity");
28 auto const& initial_porosity = ParameterLib::findParameter<double>(
29 parameter_name, parameters, 0, nullptr);
30
32 auto const& phi_min = config.getConfigParameter<double>("minimal_porosity");
33
35 auto const& phi_max = config.getConfigParameter<double>("maximal_porosity");
36
37 return std::make_unique<PorosityFromMassBalance>(
38 std::move(property_name), initial_porosity, phi_min, phi_max);
39}

References BaseLib::ConfigTree::checkConfigParameter(), DBUG(), ParameterLib::findParameter(), BaseLib::ConfigTree::getConfigParameter(), and BaseLib::ConfigTree::peekConfigParameter().

Referenced by anonymous_namespace{CreateProperty.cpp}::createProperty().

◆ createProperties()

std::unique_ptr< PropertyArray > MaterialPropertyLib::createProperties ( int const geometry_dimension,
std::optional< BaseLib::ConfigTree > const & config,
std::vector< std::unique_ptr< ParameterLib::ParameterBase > > & parameters,
ParameterLib::CoordinateSystem const *const local_coordinate_system,
std::map< std::string, std::unique_ptr< MathLib::PiecewiseLinearInterpolation > > const & curves )

The method reads the 'properties' tag in the prj-file and creates component properties accordingly.

First, a new property iy created based on the specified property type. Then, the property name is evaluated and the property is copied into the properties array.

Input File Parameter
properties__property
Input File Parameter
properties__property__name

Definition at line 390 of file CreateProperty.cpp.

398{
399 if (!config)
400 {
401 return nullptr;
402 }
403
405 auto const& property_configs = config->getConfigSubtreeList("property");
406 if (property_configs.empty())
407 {
408 return nullptr;
409 }
410
411 auto properties = std::make_unique<PropertyArray>();
412
413 for (auto property_config : property_configs)
414 {
415 // Parsing the property name:
416 auto const property_name =
418 property_config.getConfigParameter<std::string>("name");
419 // Create a new property based on the configuration subtree:
420 auto property =
421 createProperty(geometry_dimension, property_config, parameters,
422 local_coordinate_system, curves);
423
424 // Insert the new property at the right position into the components
425 // private PropertyArray:
426 (*properties)[convertStringToProperty(property_name)] =
427 std::move(property);
428 }
429 return properties;
430}
PropertyType convertStringToProperty(std::string const &string)
std::unique_ptr< MaterialPropertyLib::Property > createProperty(int const geometry_dimension, BaseLib::ConfigTree const &config, std::vector< std::unique_ptr< ParameterLib::ParameterBase > > &parameters, ParameterLib::CoordinateSystem const *const local_coordinate_system, std::map< std::string, std::unique_ptr< MathLib::PiecewiseLinearInterpolation > > const &curves)

References convertStringToProperty().

Referenced by anonymous_namespace{CreateComponent.cpp}::createComponent(), createMedium(), and anonymous_namespace{CreatePhase.cpp}::createPhase().

◆ createRelPermBrooksCorey()

std::unique_ptr< RelPermBrooksCorey > MaterialPropertyLib::createRelPermBrooksCorey ( BaseLib::ConfigTree const & config)
Input File Parameter
properties__property__type
Input File Parameter
properties__property__name
Input File Parameter
properties__property__RelPermBrooksCorey__residual_liquid_saturation
Input File Parameter
properties__property__RelPermBrooksCorey__residual_gas_saturation
Input File Parameter
properties__property__RelPermBrooksCorey__min_relative_permeability
Input File Parameter
properties__property__RelPermBrooksCorey__lambda

Definition at line 9 of file CreateRelPermBrooksCorey.cpp.

11{
13 config.checkConfigParameter("type", "RelPermBrooksCorey");
14
15 // Second access for storage.
17 auto property_name = config.peekConfigParameter<std::string>("name");
18
19 DBUG("Create RelPermBrooksCorey medium property {:s}.", property_name);
20
23 config.getConfigParameter<double>("residual_liquid_saturation");
24 auto const residual_gas_saturation =
26 config.getConfigParameter<double>("residual_gas_saturation");
27 auto const min_relative_permeability =
29 config.getConfigParameter<double>("min_relative_permeability");
30 auto const exponent =
32 config.getConfigParameter<double>("lambda");
33
34 // Parameter ranges are validated in the RelPermBrooksCorey constructor.
35 return std::make_unique<RelPermBrooksCorey>(std::move(property_name),
38 min_relative_permeability,
39 exponent);
40}

References BaseLib::ConfigTree::checkConfigParameter(), DBUG(), BaseLib::ConfigTree::getConfigParameter(), BaseLib::ConfigTree::peekConfigParameter(), residual_gas_saturation, and residual_liquid_saturation.

Referenced by anonymous_namespace{CreateProperty.cpp}::createProperty().

◆ createRelPermBrooksCoreyNonwettingPhase()

std::unique_ptr< RelPermBrooksCoreyNonwettingPhase > MaterialPropertyLib::createRelPermBrooksCoreyNonwettingPhase ( BaseLib::ConfigTree const & config)
Input File Parameter
properties__property__type
Input File Parameter
properties__property__name
Input File Parameter
properties__property__RelPermBrooksCoreyNonwettingPhase__residual_liquid_saturation
Input File Parameter
properties__property__RelPermBrooksCoreyNonwettingPhase__residual_gas_saturation
Input File Parameter
properties__property__RelPermBrooksCoreyNonwettingPhase__min_relative_permeability
Input File Parameter
properties__property__RelPermBrooksCoreyNonwettingPhase__lambda

Definition at line 12 of file CreateRelPermBrooksCoreyNonwettingPhase.cpp.

13{
15 config.checkConfigParameter("type", "RelPermBrooksCoreyNonwettingPhase");
16
17 // Second access for storage.
19 auto property_name = config.peekConfigParameter<std::string>("name");
20
21 DBUG("Create RelPermBrooksCoreyNonwettingPhase medium property {:s}.",
22 property_name);
23
26 config.getConfigParameter<double>("residual_liquid_saturation");
27 auto const residual_gas_saturation =
29 config.getConfigParameter<double>("residual_gas_saturation");
30 auto const min_relative_permeability =
32 config.getConfigParameter<double>("min_relative_permeability");
33 auto const exponent =
35 config.getConfigParameter<double>("lambda");
36
37 // Parameter ranges are validated in the
38 // RelPermBrooksCoreyNonwettingPhase constructor.
39 return std::make_unique<RelPermBrooksCoreyNonwettingPhase>(
40 std::move(property_name),
43 min_relative_permeability,
44 exponent);
45}

References BaseLib::ConfigTree::checkConfigParameter(), DBUG(), BaseLib::ConfigTree::getConfigParameter(), BaseLib::ConfigTree::peekConfigParameter(), residual_gas_saturation, and residual_liquid_saturation.

Referenced by anonymous_namespace{CreateProperty.cpp}::createProperty().

◆ createRelPermGeneralizedPower()

std::unique_ptr< RelPermGeneralizedPower > MaterialPropertyLib::createRelPermGeneralizedPower ( BaseLib::ConfigTree const & config)
Input File Parameter
properties__property__type
Input File Parameter
properties__property__name
Input File Parameter
properties__property__RelativePermeabilityGeneralizedPower__residual_liquid_saturation
Input File Parameter
properties__property__RelativePermeabilityGeneralizedPower__residual_gas_saturation
Input File Parameter
properties__property__RelativePermeabilityGeneralizedPower__min_relative_permeability
Input File Parameter
properties__property__RelativePermeabilityGeneralizedPower__enhancement_factor
Input File Parameter
properties__property__RelativePermeabilityGeneralizedPower__exponent

Definition at line 9 of file CreateRelPermGeneralizedPower.cpp.

11{
13 config.checkConfigParameter("type", "RelativePermeabilityGeneralizedPower");
14
15 // Second access for storage.
17 auto property_name = config.peekConfigParameter<std::string>("name");
18
19 DBUG("Create RelPermGeneralizedPower medium property {:s}.", property_name);
20
23 config.getConfigParameter<double>("residual_liquid_saturation");
24 auto const residual_gas_saturation =
26 config.getConfigParameter<double>("residual_gas_saturation");
27 auto const min_relative_permeability =
29 config.getConfigParameter<double>("min_relative_permeability");
30 double const a =
32 config.getConfigParameter<double>("enhancement_factor", 1);
33 double const lambda =
35 config.getConfigParameter<double>("exponent", 1);
36
37 if (min_relative_permeability < 0)
38 {
39 OGS_FATAL("Minimal relative permeability must be non-negative.");
40 }
41
42 return std::make_unique<RelPermGeneralizedPower>(
43 std::move(property_name), residual_liquid_saturation,
44 residual_gas_saturation, min_relative_permeability, a, lambda);
45}

References BaseLib::ConfigTree::checkConfigParameter(), DBUG(), BaseLib::ConfigTree::getConfigParameter(), OGS_FATAL, BaseLib::ConfigTree::peekConfigParameter(), residual_gas_saturation, and residual_liquid_saturation.

Referenced by anonymous_namespace{CreateProperty.cpp}::createProperty().

◆ createRelPermGeneralizedPowerNonwettingPhase()

std::unique_ptr< RelPermGeneralizedPowerNonwettingPhase > MaterialPropertyLib::createRelPermGeneralizedPowerNonwettingPhase ( BaseLib::ConfigTree const & config)
Input File Parameter
properties__property__type
Input File Parameter
properties__property__name
Input File Parameter
properties__property__RelativePermeabilityGeneralizedPowerNonwettingPhase__residual_liquid_saturation
Input File Parameter
properties__property__RelativePermeabilityGeneralizedPowerNonwettingPhase__residual_gas_saturation
Input File Parameter
properties__property__RelativePermeabilityGeneralizedPowerNonwettingPhase__min_relative_permeability
Input File Parameter
properties__property__RelativePermeabilityGeneralizedPowerNonwettingPhase__enhancement_factor
Input File Parameter
properties__property__RelativePermeabilityGeneralizedPowerNonwettingPhase__exponent

Definition at line 10 of file CreateRelPermGeneralizedPowerNonwettingPhase.cpp.

11{
13 config.checkConfigParameter(
14 "type", "RelativePermeabilityGeneralizedPowerNonwettingPhase");
15
16 // Second access for storage.
18 auto property_name = config.peekConfigParameter<std::string>("name");
19
20 DBUG("Create RelPermGeneralizedPowerNonwettingPhase medium property {:s}.",
21 property_name);
22
25 config.getConfigParameter<double>("residual_liquid_saturation");
26 auto const residual_gas_saturation =
28 config.getConfigParameter<double>("residual_gas_saturation");
29 auto const min_relative_permeability =
31 config.getConfigParameter<double>("min_relative_permeability");
32 double const a =
34 config.getConfigParameter<double>("enhancement_factor", 1000);
35 double const lambda =
37 config.getConfigParameter<double>("exponent", 0.8);
38
39 if (min_relative_permeability < 0)
40 {
41 OGS_FATAL("Minimal relative permeability must be non-negative.");
42 }
43
44 return std::make_unique<RelPermGeneralizedPowerNonwettingPhase>(
45 std::move(property_name), residual_liquid_saturation,
46 residual_gas_saturation, min_relative_permeability, a, lambda);
47}

References BaseLib::ConfigTree::checkConfigParameter(), DBUG(), BaseLib::ConfigTree::getConfigParameter(), OGS_FATAL, BaseLib::ConfigTree::peekConfigParameter(), residual_gas_saturation, and residual_liquid_saturation.

Referenced by anonymous_namespace{CreateProperty.cpp}::createProperty().

◆ createRelPermLiakopoulos()

std::unique_ptr< RelPermLiakopoulos > MaterialPropertyLib::createRelPermLiakopoulos ( BaseLib::ConfigTree const & config)
Input File Parameter
properties__property__type
Input File Parameter
properties__property__name
Input File Parameter
properties__property__RelPermLiakopoulos

Definition at line 9 of file CreateRelPermLiakopoulos.cpp.

11{
13 config.checkConfigParameter("type", "RelPermLiakopoulos");
14
15 // Second access for storage.
17 auto property_name = config.peekConfigParameter<std::string>("name");
18
19 DBUG("Create RelPermLiakopoulos medium property {:s}.", property_name);
20
22 return std::make_unique<RelPermLiakopoulos>(std::move(property_name));
23}

References BaseLib::ConfigTree::checkConfigParameter(), DBUG(), and BaseLib::ConfigTree::peekConfigParameter().

Referenced by anonymous_namespace{CreateProperty.cpp}::createProperty().

◆ createRelPermNonWettingPhaseVanGenuchtenMualem()

std::unique_ptr< Property > MaterialPropertyLib::createRelPermNonWettingPhaseVanGenuchtenMualem ( BaseLib::ConfigTree const & config)
Input File Parameter
properties__property__type
Input File Parameter
properties__property__name
Input File Parameter
properties__property__RelativePermeabilityNonWettingPhaseVanGenuchtenMualem__residual_liquid_saturation
Input File Parameter
properties__property__RelativePermeabilityNonWettingPhaseVanGenuchtenMualem__residual_gas_saturation
Input File Parameter
properties__property__RelativePermeabilityNonWettingPhaseVanGenuchtenMualem__exponent
Input File Parameter
properties__property__RelativePermeabilityNonWettingPhaseVanGenuchtenMualem__min_relative_permeability
Input File Parameter
properties__property__RelativePermeabilityNonWettingPhaseVanGenuchtenMualem__enhancement_factor

Definition at line 12 of file CreateRelPermNonWettingPhaseVanGenuchtenMualem.cpp.

14{
16 config.checkConfigParameter(
17 "type", "RelativePermeabilityNonWettingPhaseVanGenuchtenMualem");
18 DBUG("Create RelPermNonWettingPhaseVanGenuchtenMualem medium property");
19
20 // Second access for storage.
22 auto property_name = config.peekConfigParameter<std::string>("name");
23
26 config.getConfigParameter<double>("residual_liquid_saturation");
27 auto const residual_gas_saturation =
29 config.getConfigParameter<double>("residual_gas_saturation");
30
31 auto const exponent =
33 config.getConfigParameter<double>("exponent");
34
35 auto const min_relative_permeability =
37 config.getConfigParameter<double>("min_relative_permeability");
38 double const a =
40 config.getConfigParameter<double>("enhancement_factor", 1.0);
41
42 if (min_relative_permeability <= 0.0 || min_relative_permeability > 1.0)
43 {
45 "The value for min_relative_permeability of "
46 "RelativePermeabilityNonWettingPhaseVanGenuchtenMualem is {:g}, "
47 "which falls outside of the range of (0, 1]",
48 min_relative_permeability);
49 }
50 if (a < 0 || !std::isfinite(a))
51 {
53 "The value of the enhancement_factor for the nonwetting relative "
54 "permeability must be non-negative and finite."
55 "The value is {:g}, which is out of bounds.",
56 a);
57 }
58
59 return std::make_unique<RelPermNonWettingPhaseVanGenuchtenMualem>(
61 exponent, min_relative_permeability, a);
62}

References BaseLib::ConfigTree::checkConfigParameter(), DBUG(), BaseLib::ConfigTree::getConfigParameter(), OGS_FATAL, BaseLib::ConfigTree::peekConfigParameter(), residual_gas_saturation, and residual_liquid_saturation.

Referenced by anonymous_namespace{CreateProperty.cpp}::createProperty().

◆ createRelPermUdell()

std::unique_ptr< RelPermUdell > MaterialPropertyLib::createRelPermUdell ( BaseLib::ConfigTree const & config)
Input File Parameter
properties__property__type
Input File Parameter
properties__property__name
Input File Parameter
properties__property__RelativePermeabilityUdell__residual_liquid_saturation
Input File Parameter
properties__property__RelativePermeabilityUdell__residual_gas_saturation
Input File Parameter
properties__property__RelativePermeabilityUdell__min_relative_permeability

Definition at line 9 of file CreateRelPermUdell.cpp.

11{
13 config.checkConfigParameter("type", "RelativePermeabilityUdell");
14
15 // Second access for storage.
17 auto property_name = config.peekConfigParameter<std::string>("name");
18
19 DBUG("Create RelPermUdell medium property {:s}.", property_name);
20
23 config.getConfigParameter<double>("residual_liquid_saturation");
24 auto const residual_gas_saturation =
26 config.getConfigParameter<double>("residual_gas_saturation");
27 auto const min_relative_permeability =
29 config.getConfigParameter<double>("min_relative_permeability");
30
31 if (min_relative_permeability < 0)
32 {
33 OGS_FATAL("Minimal relative permeability must be non-negative.");
34 }
35
36 return std::make_unique<RelPermUdell>(
37 std::move(property_name), residual_liquid_saturation,
38 residual_gas_saturation, min_relative_permeability);
39}

References BaseLib::ConfigTree::checkConfigParameter(), DBUG(), BaseLib::ConfigTree::getConfigParameter(), OGS_FATAL, BaseLib::ConfigTree::peekConfigParameter(), residual_gas_saturation, and residual_liquid_saturation.

Referenced by anonymous_namespace{CreateProperty.cpp}::createProperty().

◆ createRelPermUdellNonwettingPhase()

std::unique_ptr< RelPermUdellNonwettingPhase > MaterialPropertyLib::createRelPermUdellNonwettingPhase ( BaseLib::ConfigTree const & config)
Input File Parameter
properties__property__type
Input File Parameter
properties__property__name
Input File Parameter
properties__property__RelativePermeabilityUdellNonwettingPhase__residual_liquid_saturation
Input File Parameter
properties__property__RelativePermeabilityUdellNonwettingPhase__residual_gas_saturation
Input File Parameter
properties__property__RelativePermeabilityUdellNonwettingPhase__min_relative_permeability

Definition at line 9 of file CreateRelPermUdellNonwettingPhase.cpp.

11{
13 config.checkConfigParameter("type",
14 "RelativePermeabilityUdellNonwettingPhase");
15
16 // Second access for storage.
18 auto property_name = config.peekConfigParameter<std::string>("name");
19
20 DBUG("Create RelPermUdellNonwettingPhase medium property {:s}.",
21 property_name);
22
25 config.getConfigParameter<double>("residual_liquid_saturation");
26 auto const residual_gas_saturation =
28 config.getConfigParameter<double>("residual_gas_saturation");
29 auto const min_relative_permeability =
31 config.getConfigParameter<double>("min_relative_permeability");
32
33 if (min_relative_permeability < 0)
34 {
35 OGS_FATAL("Minimal relative permeability must be non-negative.");
36 }
37
38 return std::make_unique<RelPermUdellNonwettingPhase>(
39 std::move(property_name), residual_liquid_saturation,
40 residual_gas_saturation, min_relative_permeability);
41}

References BaseLib::ConfigTree::checkConfigParameter(), DBUG(), BaseLib::ConfigTree::getConfigParameter(), OGS_FATAL, BaseLib::ConfigTree::peekConfigParameter(), residual_gas_saturation, and residual_liquid_saturation.

Referenced by anonymous_namespace{CreateProperty.cpp}::createProperty().

◆ createRelPermVanGenuchten()

std::unique_ptr< RelPermVanGenuchten > MaterialPropertyLib::createRelPermVanGenuchten ( BaseLib::ConfigTree const & config)
Input File Parameter
properties__property__type
Input File Parameter
properties__property__name
Input File Parameter
properties__property__RelativePermeabilityVanGenuchten__residual_liquid_saturation
Input File Parameter
properties__property__RelativePermeabilityVanGenuchten__residual_gas_saturation
Input File Parameter
properties__property__RelativePermeabilityVanGenuchten__minimum_relative_permeability_liquid
Input File Parameter
properties__property__RelativePermeabilityVanGenuchten__exponent

Definition at line 9 of file CreateRelPermVanGenuchten.cpp.

11{
13 config.checkConfigParameter("type", "RelativePermeabilityVanGenuchten");
14
15 // Second access for storage.
17 auto property_name = config.peekConfigParameter<std::string>("name");
18
19 DBUG("Create RelativePermeabilityVanGenuchten medium property {:s}.",
20 property_name);
21
24 config.getConfigParameter<double>("residual_liquid_saturation");
25 auto const residual_gas_saturation =
27 config.getConfigParameter<double>("residual_gas_saturation");
28 auto const min_relative_permeability_liquid =
30 config.getConfigParameter<double>(
31 "minimum_relative_permeability_liquid");
32 auto const exponent =
34 config.getConfigParameter<double>("exponent");
35 if (exponent <= 0. || exponent >= 1.)
36 {
37 OGS_FATAL("Exponent must be in the (0, 1) range.");
38 }
39
40 return std::make_unique<RelPermVanGenuchten>(
41 std::move(property_name),
44 min_relative_permeability_liquid,
45 exponent);
46}

References BaseLib::ConfigTree::checkConfigParameter(), DBUG(), BaseLib::ConfigTree::getConfigParameter(), OGS_FATAL, BaseLib::ConfigTree::peekConfigParameter(), residual_gas_saturation, and residual_liquid_saturation.

Referenced by anonymous_namespace{CreateProperty.cpp}::createProperty().

◆ createSaturationBrooksCorey()

std::unique_ptr< SaturationBrooksCorey > MaterialPropertyLib::createSaturationBrooksCorey ( BaseLib::ConfigTree const & config)
Input File Parameter
properties__property__type
Input File Parameter
properties__property__name
Input File Parameter
properties__property__SaturationBrooksCorey__residual_liquid_saturation
Input File Parameter
properties__property__SaturationBrooksCorey__residual_gas_saturation
Input File Parameter
properties__property__SaturationBrooksCorey__lambda
Input File Parameter
properties__property__SaturationBrooksCorey__entry_pressure

Definition at line 9 of file CreateSaturationBrooksCorey.cpp.

11{
13 config.checkConfigParameter("type", "SaturationBrooksCorey");
14
15 // Second access for storage.
17 auto property_name = config.peekConfigParameter<std::string>("name");
18
19 DBUG("Create SaturationBrooksCorey medium property {:s}.", property_name);
20
23 config.getConfigParameter<double>("residual_liquid_saturation");
24 auto const residual_gas_saturation =
26 config.getConfigParameter<double>("residual_gas_saturation");
27 auto const exponent =
29 config.getConfigParameter<double>("lambda");
30 auto const entry_pressure =
32 config.getConfigParameter<double>("entry_pressure");
33
34 return std::make_unique<SaturationBrooksCorey>(
35 std::move(property_name), residual_liquid_saturation,
37}

References BaseLib::ConfigTree::checkConfigParameter(), DBUG(), entry_pressure, BaseLib::ConfigTree::getConfigParameter(), BaseLib::ConfigTree::peekConfigParameter(), residual_gas_saturation, and residual_liquid_saturation.

Referenced by anonymous_namespace{CreateProperty.cpp}::createProperty().

◆ createSaturationDependentSwelling()

std::unique_ptr< SaturationDependentSwelling > MaterialPropertyLib::createSaturationDependentSwelling ( BaseLib::ConfigTree const & config,
ParameterLib::CoordinateSystem const *const local_coordinate_system )
Input File Parameter
properties__property__type
Input File Parameter
properties__property__name
Input File Parameter
properties__property__SaturationDependentSwelling__swelling_pressures
Input File Parameter
properties__property__SaturationDependentSwelling__exponents
Input File Parameter
properties__property__SaturationDependentSwelling__lower_saturation_limit
Input File Parameter
properties__property__SaturationDependentSwelling__upper_saturation_limit

Definition at line 10 of file CreateSaturationDependentSwelling.cpp.

13{
15 config.checkConfigParameter("type", "SaturationDependentSwelling");
16
17 // Second access for storage.
19 auto property_name = config.peekConfigParameter<std::string>("name");
20
21 DBUG("Create SaturationDependentSwelling solid phase property {:s}.",
22 property_name);
23
24 auto const swelling_pressures =
26 config.getConfigParameter<std::vector<double>>("swelling_pressures");
27
28 if (swelling_pressures.size() != 3)
29 {
31 "The number of swelling pressures must be three, but {:d} were "
32 "given.",
33 swelling_pressures.size());
34 }
35
36 auto const exponents =
38 config.getConfigParameter<std::vector<double>>("exponents");
39
40 if (exponents.size() != 3)
41 {
42 OGS_FATAL("The number of exponents must be three, but {:d} were given.",
43 exponents.size());
44 }
45
46 if (swelling_pressures.size() != exponents.size())
47 {
49 "The number of swelling pressures and exponents must be equal, but "
50 "they are {:d} and {:d}, respectively.",
51 swelling_pressures.size(), exponents.size());
52 }
53
54 auto const lower_saturation_limit =
56 config.getConfigParameter<double>("lower_saturation_limit");
57
58 auto const upper_saturation_limit =
60 config.getConfigParameter<double>("upper_saturation_limit");
61
62 return std::make_unique<SaturationDependentSwelling>(
63 std::move(property_name),
64 std::array<double, 3>{swelling_pressures[0], swelling_pressures[1],
65 swelling_pressures[2]},
66 std::array<double, 3>{exponents[0], exponents[1], exponents[2]},
67 lower_saturation_limit, upper_saturation_limit,
68 local_coordinate_system);
69}

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

Referenced by anonymous_namespace{CreateProperty.cpp}::createProperty().

◆ createSaturationDependentThermalConductivity()

std::unique_ptr< Property > MaterialPropertyLib::createSaturationDependentThermalConductivity ( BaseLib::ConfigTree const & config)
Input File Parameter
properties__property__type

Definition at line 8 of file CreateSaturationDependentThermalConductivity.cpp.

10{
12 config.checkConfigParameter("type",
13 "SaturationDependentThermalConductivity");
14
16 "The MPL property SaturationDependentThermalConductivity is "
17 "deprecated. Please use SaturationWeightedThermalConductivity "
18 "instead.");
19}

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

◆ createSaturationExponential()

std::unique_ptr< SaturationExponential > MaterialPropertyLib::createSaturationExponential ( BaseLib::ConfigTree const & config)
Input File Parameter
properties__property__type
Input File Parameter
properties__property__name
Input File Parameter
properties__property__SaturationExponential__residual_liquid_saturation
Input File Parameter
properties__property__SaturationExponential__residual_gas_saturation
Input File Parameter
properties__property__SaturationExponential__maximum_capillary_pressure
Input File Parameter
properties__property__SaturationExponential__exponent

Definition at line 9 of file CreateSaturationExponential.cpp.

11{
13 config.checkConfigParameter("type", "SaturationExponential");
14
15 // Second access for storage.
17 auto property_name = config.peekConfigParameter<std::string>("name");
18
19 DBUG("Create SaturationExponential medium property {:s}.", property_name);
20
23 config.getConfigParameter<double>("residual_liquid_saturation");
24 auto const residual_gas_saturation =
26 config.getConfigParameter<double>("residual_gas_saturation");
27 auto const p_cap_max =
29 config.getConfigParameter<double>("maximum_capillary_pressure");
30 auto const exponent =
32 config.getConfigParameter<double>("exponent");
33
34 return std::make_unique<SaturationExponential>(
35 std::move(property_name), residual_liquid_saturation,
36 residual_gas_saturation, p_cap_max, exponent);
37}

References BaseLib::ConfigTree::checkConfigParameter(), DBUG(), BaseLib::ConfigTree::getConfigParameter(), BaseLib::ConfigTree::peekConfigParameter(), residual_gas_saturation, and residual_liquid_saturation.

Referenced by anonymous_namespace{CreateProperty.cpp}::createProperty().

◆ createSaturationLiakopoulos()

std::unique_ptr< SaturationLiakopoulos > MaterialPropertyLib::createSaturationLiakopoulos ( BaseLib::ConfigTree const & config)
Input File Parameter
properties__property__type
Input File Parameter
properties__property__name
Input File Parameter
properties__property__SaturationLiakopoulos

Definition at line 9 of file CreateSaturationLiakopoulos.cpp.

11{
13 config.checkConfigParameter("type", "SaturationLiakopoulos");
14
15 // Second access for storage.
17 auto property_name = config.peekConfigParameter<std::string>("name");
18
19 DBUG("Create SaturationLiakopoulos medium property {:s}.", property_name);
20
22 return std::make_unique<SaturationLiakopoulos>(std::move(property_name));
23}

References BaseLib::ConfigTree::checkConfigParameter(), DBUG(), and BaseLib::ConfigTree::peekConfigParameter().

Referenced by anonymous_namespace{CreateProperty.cpp}::createProperty().

◆ createSaturationLuMcCartney()

std::unique_ptr< SaturationLuMcCartney > MaterialPropertyLib::createSaturationLuMcCartney ( BaseLib::ConfigTree const & config)
Input File Parameter
properties__property__type
Input File Parameter
properties__property__name
Input File Parameter
properties__property__SaturationLuMcCartney__material

Definition at line 8 of file CreateSaturationLuMcCartney.cpp.

10{
12 config.checkConfigParameter("type", "SaturationLuMcCartney");
13
14 // Second access for storage.
16 auto property_name = config.peekConfigParameter<std::string>("name");
17
18 DBUG("Create SaturationLuMcCartney medium property {:s}.", property_name);
19
20 auto const material =
22 config.getConfigParameter<std::string>("material");
23
24 return std::make_unique<SaturationLuMcCartney>(std::move(property_name),
25 material);
26}

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

Referenced by anonymous_namespace{CreateProperty.cpp}::createProperty().

◆ createSaturationVanGenuchten()

std::unique_ptr< SaturationVanGenuchten > MaterialPropertyLib::createSaturationVanGenuchten ( BaseLib::ConfigTree const & config)
Input File Parameter
properties__property__type
Input File Parameter
properties__property__name
Input File Parameter
properties__property__SaturationVanGenuchten__residual_liquid_saturation
Input File Parameter
properties__property__SaturationVanGenuchten__residual_gas_saturation
Input File Parameter
properties__property__SaturationVanGenuchten__exponent
Input File Parameter
properties__property__SaturationVanGenuchten__pressure_exponent
Input File Parameter
properties__property__SaturationVanGenuchten__saturation_exponent
Input File Parameter
properties__property__SaturationVanGenuchten__p_b

Definition at line 9 of file CreateSaturationVanGenuchten.cpp.

11{
13 config.checkConfigParameter("type", "SaturationVanGenuchten");
14
15 // Second access for storage.
17 auto property_name = config.peekConfigParameter<std::string>("name");
18
19 DBUG("Create SaturationVanGenuchten medium property {:s}.", property_name);
20
23 config.getConfigParameter<double>("residual_liquid_saturation");
24 auto const residual_gas_saturation =
26 config.getConfigParameter<double>("residual_gas_saturation");
27
28 double pressure_exponent;
29 double saturation_exponent;
30 if (auto const optional_exponent =
32 config.getConfigParameterOptional<double>("exponent"))
33 {
34 pressure_exponent = *optional_exponent;
35 saturation_exponent = 1.0 / (1.0 - pressure_exponent);
36 }
37 else
38 {
39 pressure_exponent =
41 config.getConfigParameter<double>("pressure_exponent");
42 saturation_exponent =
44 config.getConfigParameter<double>("saturation_exponent");
45 }
46
48 auto const p_b = config.getConfigParameter<double>("p_b");
49
50 return std::make_unique<SaturationVanGenuchten>(
51 std::move(property_name), residual_liquid_saturation,
52 residual_gas_saturation, pressure_exponent, saturation_exponent, p_b);
53}

References BaseLib::ConfigTree::checkConfigParameter(), DBUG(), BaseLib::ConfigTree::getConfigParameter(), BaseLib::ConfigTree::getConfigParameterOptional(), BaseLib::ConfigTree::peekConfigParameter(), residual_gas_saturation, and residual_liquid_saturation.

Referenced by anonymous_namespace{CreateProperty.cpp}::createProperty().

◆ createSaturationVanGenuchtenWithVolumetricStrain()

std::unique_ptr< SaturationVanGenuchtenWithVolumetricStrain > MaterialPropertyLib::createSaturationVanGenuchtenWithVolumetricStrain ( BaseLib::ConfigTree const & config)
Input File Parameter
properties__property__type
Input File Parameter
properties__property__name
Input File Parameter
properties__property__SaturationVanGenuchtenWithVolumetricStrain__residual_liquid_saturation
Input File Parameter
properties__property__SaturationVanGenuchtenWithVolumetricStrain__residual_gas_saturation
Input File Parameter
properties__property__SaturationVanGenuchtenWithVolumetricStrain__exponent
Input File Parameter
properties__property__SaturationVanGenuchtenWithVolumetricStrain__p_b
Input File Parameter
properties__property__SaturationVanGenuchtenWithVolumetricStrain__e_0
Input File Parameter
properties__property__SaturationVanGenuchtenWithVolumetricStrain__e_m
Input File Parameter
properties__property__SaturationVanGenuchtenWithVolumetricStrain__a
Input File Parameter
properties__property__SaturationVanGenuchtenWithVolumetricStrain__d_diff

Definition at line 10 of file CreateSaturationVanGenuchtenWithVolumetricStrain.cpp.

12{
14 config.checkConfigParameter("type",
15 "SaturationVanGenuchtenWithVolumetricStrain");
16
17 // Second access for storage.
19 auto property_name = config.peekConfigParameter<std::string>("name");
20
21 DBUG(
22 "Create SaturationVanGenuchtenWithVolumetricStrain medium property "
23 "{:s}.",
24 property_name);
25
28 config.getConfigParameter<double>("residual_liquid_saturation");
29 auto const residual_gas_saturation =
31 config.getConfigParameter<double>("residual_gas_saturation");
32 auto const exponent =
34 config.getConfigParameter<double>("exponent");
36 auto const p_b = config.getConfigParameter<double>("p_b");
37 auto const e_0 =
39 config.getConfigParameter<double>("e_0");
40 auto const e_m =
42 config.getConfigParameter<double>("e_m");
43 auto const a =
45 config.getConfigParameter<double>("a");
46 auto const d_diff =
48 config.getConfigParameter<double>("d_diff");
49
50 return std::make_unique<SaturationVanGenuchtenWithVolumetricStrain>(
51 std::move(property_name), residual_liquid_saturation,
52 residual_gas_saturation, exponent, p_b, e_0, e_m, a, d_diff);
53}

References BaseLib::ConfigTree::checkConfigParameter(), DBUG(), BaseLib::ConfigTree::getConfigParameter(), BaseLib::ConfigTree::peekConfigParameter(), residual_gas_saturation, and residual_liquid_saturation.

Referenced by anonymous_namespace{CreateProperty.cpp}::createProperty().

◆ createSaturationWeightedThermalConductivity()

std::unique_ptr< Property > MaterialPropertyLib::createSaturationWeightedThermalConductivity ( int const geometry_dimension,
BaseLib::ConfigTree const & config,
std::vector< std::unique_ptr< ParameterLib::ParameterBase > > & parameters )
Input File Parameter
properties__property__type
Input File Parameter
properties__property__name
Input File Parameter
properties__property__SaturationWeightedThermalConductivity__dry_thermal_conductivity
Input File Parameter
properties__property__SaturationWeightedThermalConductivity__wet_thermal_conductivity
Input File Parameter
properties__property__SaturationWeightedThermalConductivity__dry_thermal_conductivity
Input File Parameter
properties__property__SaturationWeightedThermalConductivity__wet_thermal_conductivity
Input File Parameter
properties__property__SaturationWeightedThermalConductivity__mean_type

Definition at line 34 of file CreateSaturationWeightedThermalConductivity.cpp.

38{
40 config.checkConfigParameter("type",
41 "SaturationWeightedThermalConductivity");
42
44 auto property_name = config.peekConfigParameter<std::string>("name");
45
46 DBUG("Create SaturationWeightedThermalConductivity medium property");
47
48 std::string const& dry_thermal_conductivity_parameter_or_value =
50 config.getConfigParameter<std::string>("dry_thermal_conductivity");
51
52 std::string const& wet_thermal_conductivity_parameter_or_value =
54 config.getConfigParameter<std::string>("wet_thermal_conductivity");
55
56 auto& dry_thermal_conductivity =
59 dry_thermal_conductivity_parameter_or_value, parameters,
60 property_name, "dry_inline");
61
62 auto& wet_thermal_conductivity =
65 wet_thermal_conductivity_parameter_or_value, parameters,
66 property_name, "wet_inline");
67
68 std::string const& mean_type_str =
70 config.getConfigParameter<std::string>("mean_type");
71
72 const std::map<std::string, MeanType> mean_type_map{
73 {"arithmetic_linear", MeanType::ARITHMETIC_LINEAR},
74 {"arithmetic_squareroot", MeanType::ARITHMETIC_SQUAREROOT},
75 {"geometric", MeanType::GEOMETRIC}};
76 MeanType const& mean_type = BaseLib::getOrError(
77 mean_type_map, mean_type_str,
78 "Specified mean type for the thermal conductivity could not be found.");
79
80 std::map<
81 std::pair<MeanType, int>,
82 std::unique_ptr<Property> (*)(
83 std::string /*name*/,
84 ParameterLib::Parameter<double> const& /*dry_thermal_conductivity*/,
85 ParameterLib::Parameter<
86 double> const& /*wet_thermal_conductivity*/)>
87 map_dim_and_mean_to_creator;
88
89 // initialize the map
90 {
91 using namespace boost::mp11;
92 using Dims = mp_list<mp_int<1>, mp_int<2>, mp_int<3>>;
93 using Means = mp_list<
94 std::integral_constant<MeanType, MeanType::ARITHMETIC_LINEAR>,
95 std::integral_constant<MeanType, MeanType::ARITHMETIC_SQUAREROOT>,
96 std::integral_constant<MeanType, MeanType::GEOMETRIC>>;
97 using DimsAndMeanTypes =
98 mp_product<mp_list, Dims,
99 Means>; // Cartesian product of Dims and Means.
100
101 mp_for_each<DimsAndMeanTypes>(
102 [&map_dim_and_mean_to_creator]<typename Dim, typename Mean>(
103 mp_list<Dim, Mean>)
104 {
105 map_dim_and_mean_to_creator.emplace(
106 std::pair{Mean::value, Dim::value},
108 Dim::value>);
109 });
110 }
111
112 auto const it = map_dim_and_mean_to_creator.find(
113 std::pair{mean_type, geometry_dimension});
114
115 if (it == map_dim_and_mean_to_creator.end())
116 {
117 OGS_FATAL(
118 "Cannot create a SaturationWeightedThermalConductivity model for "
119 "dimension {} and mean type {}",
120 geometry_dimension, mean_type_str);
121 }
122
123 auto* creator = it->second;
124 return creator(std::move(property_name),
125 dry_thermal_conductivity,
126 wet_thermal_conductivity);
127}
std::unique_ptr< Property > createSaturationWeightedThermalConductivity(int const geometry_dimension, BaseLib::ConfigTree const &config, std::vector< std::unique_ptr< ParameterLib::ParameterBase > > &parameters)
Parameter< double > & getNamedOrCreateInlineParameter(std::string const &parameter_or_value, std::vector< std::unique_ptr< ParameterBase > > &parameters, std::string const &property_name, std::string const &inline_suffix)

References ARITHMETIC_LINEAR, ARITHMETIC_SQUAREROOT, BaseLib::ConfigTree::checkConfigParameter(), createSaturationWeightedThermalConductivity(), DBUG(), GEOMETRIC, BaseLib::ConfigTree::getConfigParameter(), ParameterLib::getNamedOrCreateInlineParameter(), BaseLib::getOrError(), OGS_FATAL, and BaseLib::ConfigTree::peekConfigParameter().

Referenced by anonymous_namespace{CreateProperty.cpp}::createProperty(), and createSaturationWeightedThermalConductivity().

◆ createSigmoid()

std::unique_ptr< Sigmoid > MaterialPropertyLib::createSigmoid ( BaseLib::ConfigTree const & config)

Create a Sigmoid property from XML configuration.

Input File Parameter
properties__property__type
Input File Parameter
properties__property__name
Input File Parameter
properties__property__Sigmoid__steepness
Input File Parameter
properties__property__Sigmoid__midpoint
Input File Parameter
properties__property__Sigmoid__lower_bound
Input File Parameter
properties__property__Sigmoid__upper_bound
Input File Parameter
properties__property__Sigmoid__independent_variable

Definition at line 13 of file CreateSigmoid.cpp.

14{
16 config.checkConfigParameter("type", "Sigmoid");
17
19 auto const name = config.peekConfigParameter<std::string>("name");
20 DBUG("Create sigmoid property '{:s}'.", name);
21
22 auto const steepness =
24 config.getConfigParameter<double>("steepness");
25
26 auto const midpoint =
28 config.getConfigParameter<double>("midpoint");
29
30 auto const lower_bound =
32 config.getConfigParameter<double>("lower_bound");
33
34 auto const upper_bound =
36 config.getConfigParameter<double>("upper_bound");
37
38 // Parse independent variable
39 auto const independent_variable_str =
41 config.getConfigParameter<std::string>("independent_variable");
42
43 // Spatial/temporal coordinates not yet supported; would need to
44 // reintroduce a SpatialTemporalVariable and dispatch in value().
45 if (std::ranges::any_of(std::array{"t", "x", "y", "z"},
46 [&](const char* v)
47 { return independent_variable_str == v; }))
48
49 {
51 "In the sigmoid property '{:s}', the spatial/temporal independent "
52 "variable '{:s}' is not supported yet. Use a material variable "
53 "instead. See CreateSigmoid.cpp for how to re-enable "
54 "spatial/temporal independent variables.",
55 name, independent_variable_str);
56 }
57
58 auto const independent_variable =
59 convertStringToVariable(independent_variable_str);
60
61 return std::make_unique<Sigmoid>(name, steepness, midpoint, lower_bound,
62 upper_bound, independent_variable);
63}

References BaseLib::ConfigTree::checkConfigParameter(), convertStringToVariable(), DBUG(), BaseLib::ConfigTree::getConfigParameter(), name, OGS_FATAL, and BaseLib::ConfigTree::peekConfigParameter().

Referenced by anonymous_namespace{CreateProperty.cpp}::createProperty().

◆ createSoilThermalConductivitySomerton()

std::unique_ptr< Property > MaterialPropertyLib::createSoilThermalConductivitySomerton ( BaseLib::ConfigTree const & config)
Input File Parameter
properties__property__type

Definition at line 11 of file CreateSoilThermalConductivitySomerton.cpp.

13{
15 config.checkConfigParameter("type", "SoilThermalConductivitySomerton");
16
18 "The MPL property SoilThermalConductivitySomerton is "
19 "deprecated. Please use SaturationWeightedThermalConductivity "
20 "instead.");
21}

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

◆ createSpecificHeatCapacityWithLatentHeat()

std::unique_ptr< SpecificHeatCapacityWithLatentHeat > MaterialPropertyLib::createSpecificHeatCapacityWithLatentHeat ( BaseLib::ConfigTree const & config)
Input File Parameter
properties__property__type
Input File Parameter
properties__property__name
Input File Parameter
properties__property__SpecificHeatCapacityWithLatentHeat__specific_latent_heat

Definition at line 13 of file CreateSpecificHeatCapacityWithLatentHeat.cpp.

14{
16 config.checkConfigParameter("type", "SpecificHeatCapacityWithLatentHeat");
17
18 // Second access for storage.
20 auto property_name = config.peekConfigParameter<std::string>("name");
21
22 DBUG("Create temperature dependent specific heat capacity {:s}.",
23 property_name);
24
25 auto const l =
27 config.getConfigParameter<double>("specific_latent_heat");
28
29 return std::make_unique<
31 std::move(property_name), l);
32}

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

Referenced by anonymous_namespace{CreateProperty.cpp}::createProperty().

◆ createStrainDependentPermeability()

std::unique_ptr< Property > MaterialPropertyLib::createStrainDependentPermeability ( int const geometry_dimension,
BaseLib::ConfigTree const & config,
std::vector< std::unique_ptr< ParameterLib::ParameterBase > > const & parameters,
ParameterLib::CoordinateSystem const *const local_coordinate_system )
Input File Parameter
properties__property__type
Input File Parameter
properties__property__name
Input File Parameter
properties__property__StrainDependentPermeability__initial_permeability
Input File Parameter
properties__property__StrainDependentPermeability__b1
Input File Parameter
properties__property__StrainDependentPermeability__b2
Input File Parameter
properties__property__StrainDependentPermeability__b3
Input File Parameter
properties__property__StrainDependentPermeability__minimum_permeability
Input File Parameter
properties__property__StrainDependentPermeability__maximum_permeability

Definition at line 18 of file CreateStrainDependentPermeability.cpp.

23{
24 if ((geometry_dimension != 2) && (geometry_dimension != 3))
25 {
27 "The StrainDependentPermeability is implemented only for 2D or 3D "
28 "problems");
29 }
30
32 config.checkConfigParameter("type", "StrainDependentPermeability");
33
34 // Second access for storage.
36 auto property_name = config.peekConfigParameter<std::string>("name");
37
38 DBUG("Create StrainDependentPermeability property {:s}.", property_name);
39
40 std::string const& parameter_name =
42 config.getConfigParameter<std::string>("initial_permeability");
43 auto const& parameter_k0 = ParameterLib::findParameter<double>(
44 parameter_name, parameters, 0, nullptr);
45
46 auto const b1 =
48 config.getConfigParameter<double>("b1");
49 auto const b2 =
51 config.getConfigParameter<double>("b2");
52 auto const b3 =
54 config.getConfigParameter<double>("b3");
55 auto const minimum_permeability =
57 config.getConfigParameter<double>("minimum_permeability");
58 auto const maximum_permeability =
60 config.getConfigParameter<double>("maximum_permeability");
61
62 if (minimum_permeability > maximum_permeability)
63 {
65 "The value of minimum_permeability of {:e} is larger that the "
66 "value of maximum_permeability of {:e} in "
67 "StrainDependentPermeability",
68 minimum_permeability, maximum_permeability);
69 }
70
71 if (geometry_dimension == 2)
72 {
73 return std::make_unique<StrainDependentPermeability<2>>(
74 std::move(property_name), parameter_k0, b1, b2, b3,
75 minimum_permeability, maximum_permeability,
76 local_coordinate_system);
77 }
78
79 return std::make_unique<StrainDependentPermeability<3>>(
80 std::move(property_name), parameter_k0, b1, b2, b3,
81 minimum_permeability, maximum_permeability, local_coordinate_system);
82}

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

Referenced by anonymous_namespace{CreateProperty.cpp}::createProperty().

◆ createSymbolTable()

template<int D>
exprtk::symbol_table< double > MaterialPropertyLib::createSymbolTable ( std::vector< std::string > const & expression_symbol_names,
bool const spatial_position_is_required,
std::vector< std::string > const & used_curve_names,
std::map< std::string, std::unique_ptr< MathLib::PiecewiseLinearInterpolation > > const & curves,
VariableArray & variable_array,
std::map< std::string, ParameterLib::CurveWrapper > & curve_wrappers )
static

Creates a symbol table for one MPL Function thread, registering standard variables (t, x, y, z), VariableArray fields, and curve wrappers. variable_array and curve_wrappers are members of the owning PerThreadData and must already be at their final address.

Definition at line 66 of file Function.cpp.

75{
76 auto symbol_table =
77 ParameterLib::createBaseSymbolTable(spatial_position_is_required);
78
79 std::unordered_set<std::string> curve_name_set(used_curve_names.begin(),
80 used_curve_names.end());
81
82 for (auto const& v : expression_symbol_names)
83 {
84 if (ParameterLib::isBuiltinSymbol(v) || curve_name_set.contains(v))
85 {
86 continue;
87 }
88
89 auto add_scalar = [&v, &symbol_table](double& value)
90 { symbol_table.add_variable(v, value); };
91
92 auto add_vector =
93 [&v, &symbol_table](double* ptr, std::size_t const size)
94 { symbol_table.add_vector(v, ptr, size); };
95
96 auto add_any_variable = BaseLib::Overloaded{
97 [&add_scalar](VariableArray::Scalar* address)
98 { add_scalar(*address); },
99 [&add_vector](VariableArray::KelvinVector* address)
100 {
101 auto constexpr size =
103 auto& result =
104 address->template emplace<Eigen::Matrix<double, size, 1>>();
105 add_vector(result.data(), size);
106 },
107 [&add_vector](VariableArray::DeformationGradient* address)
108 {
109 auto constexpr size = MathLib::VectorizedTensor::size(D);
110 auto& result =
111 address->template emplace<Eigen::Matrix<double, size, 1>>();
112 add_vector(result.data(), size);
113 }};
114
115 Variable const variable = convertStringToVariable(v);
116 variable_array.visitVariable(add_any_variable, variable);
117 }
118
119 ParameterLib::registerCurveWrappers(symbol_table, used_curve_names, curves,
120 curve_wrappers);
121 return symbol_table;
122}
std::variant< std::monostate, Eigen::Vector< double, 5 >, Eigen::Vector< double, 9 > > DeformationGradient
std::variant< std::monostate, Eigen::Vector< double, 4 >, Eigen::Vector< double, 6 > > KelvinVector
auto visitVariable(Visitor &&visitor, Variable const variable)
constexpr int kelvin_vector_dimensions(int const displacement_dim)
Kelvin vector dimensions for given displacement dimension.
constexpr int size(int const displacement_dim)
Vectorized tensor size for given displacement dimension.
bool isBuiltinSymbol(std::string_view const name)
exprtk::symbol_table< double > createBaseSymbolTable(bool spatial_position_is_required)
void registerCurveWrappers(exprtk::symbol_table< double > &symbol_table, std::vector< std::string > const &curve_names, std::map< std::string, std::unique_ptr< MathLib::PiecewiseLinearInterpolation > > const &curves, std::map< std::string, CurveWrapper > &curve_wrappers)

References convertStringToVariable(), ParameterLib::createBaseSymbolTable(), ParameterLib::isBuiltinSymbol(), MathLib::KelvinVector::kelvin_vector_dimensions(), ParameterLib::registerCurveWrappers(), MathLib::VectorizedTensor::size(), and MaterialPropertyLib::VariableArray::visitVariable().

Referenced by MaterialPropertyLib::PerThreadData::PerThreadData().

◆ createTemperatureDependentDiffusion()

std::unique_ptr< Property > MaterialPropertyLib::createTemperatureDependentDiffusion ( BaseLib::ConfigTree const & config,
std::vector< std::unique_ptr< ParameterLib::ParameterBase > > const & parameters )
Input File Parameter
properties__property__type
Input File Parameter
properties__property__TemperatureDependentDiffusion__reference_diffusion
Input File Parameter
properties__property__TemperatureDependentDiffusion__activation_energy
Input File Parameter
properties__property__TemperatureDependentDiffusion__reference_temperature

Definition at line 10 of file CreateTemperatureDependentDiffusion.cpp.

13{
15 config.checkConfigParameter("type", "TemperatureDependentDiffusion");
16
19 config.getConfigParameter<std::string>("reference_diffusion"),
20 parameters, 0, nullptr);
21
22 auto const Ea =
24 config.getConfigParameter<double>("activation_energy");
25
26 auto const T0 =
28 config.getConfigParameter<double>("reference_temperature");
29
30 return std::make_unique<TemperatureDependentDiffusion>(D0, Ea, T0);
31}

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

Referenced by anonymous_namespace{CreateProperty.cpp}::createProperty().

◆ createTransportPorosityFromMassBalance()

std::unique_ptr< TransportPorosityFromMassBalance > MaterialPropertyLib::createTransportPorosityFromMassBalance ( BaseLib::ConfigTree const & config,
std::vector< std::unique_ptr< ParameterLib::ParameterBase > > const & parameters )
Input File Parameter
properties__property__type
Input File Parameter
properties__property__name
Input File Parameter
properties__property__TransportPorosityFromMassBalance__initial_porosity
Input File Parameter
properties__property__TransportPorosityFromMassBalance__minimal_porosity
Input File Parameter
properties__property__TransportPorosityFromMassBalance__maximal_porosity

Definition at line 13 of file CreateTransportPorosityFromMassBalance.cpp.

16{
18 config.checkConfigParameter("type", "TransportPorosityFromMassBalance");
19
20 // Second access for storage.
22 auto property_name = config.peekConfigParameter<std::string>("name");
23
24 DBUG("Create TransportPorosityFromMassBalance medium property {:s}.",
25 property_name);
26
27 std::string const& parameter_name =
29 config.getConfigParameter<std::string>("initial_porosity");
30 auto const& initial_porosity = ParameterLib::findParameter<double>(
31 parameter_name, parameters, 0, nullptr);
32
34 auto const& phi_min = config.getConfigParameter<double>("minimal_porosity");
35
37 auto const& phi_max = config.getConfigParameter<double>("maximal_porosity");
38
39 return std::make_unique<TransportPorosityFromMassBalance>(
40 std::move(property_name), initial_porosity, phi_min, phi_max);
41}

References BaseLib::ConfigTree::checkConfigParameter(), DBUG(), ParameterLib::findParameter(), BaseLib::ConfigTree::getConfigParameter(), and BaseLib::ConfigTree::peekConfigParameter().

Referenced by anonymous_namespace{CreateProperty.cpp}::createProperty().

◆ createVapourDiffusionDeVries()

std::unique_ptr< Property > MaterialPropertyLib::createVapourDiffusionDeVries ( BaseLib::ConfigTree const & config)
Input File Parameter
properties__property__type
Input File Parameter
properties__property__name
Input File Parameter
properties__property__VapourDiffusionDeVries__base_diffusion_coefficient
Input File Parameter
properties__property__VapourDiffusionDeVries__exponent

Definition at line 12 of file CreateVapourDiffusionDeVries.cpp.

14{
16 config.checkConfigParameter("type", "VapourDiffusionDeVries");
17 DBUG("Create VapourDiffusionDeVries phase property");
18
19 // Second access for storage.
21 auto property_name = config.peekConfigParameter<std::string>("name");
22
23 double const base_diffusion_coefficient =
25 config.getConfigParameter<double>("base_diffusion_coefficient", 5.9e-6);
26
27 double const exponent =
29 config.getConfigParameter<double>("exponent", 2.3);
30
31 return std::make_unique<VapourDiffusionDeVries>(
32 std::move(property_name), base_diffusion_coefficient, exponent);
33}

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

Referenced by anonymous_namespace{CreateProperty.cpp}::createProperty().

◆ createVapourDiffusionFEBEX()

std::unique_ptr< Property > MaterialPropertyLib::createVapourDiffusionFEBEX ( BaseLib::ConfigTree const & config)
Input File Parameter
properties__property__type
Input File Parameter
properties__property__name
Input File Parameter
properties__property__VapourDiffusionFEBEX__base_diffusion_coefficient
Input File Parameter
properties__property__VapourDiffusionFEBEX__exponent

Definition at line 12 of file CreateVapourDiffusionFEBEX.cpp.

14{
16 config.checkConfigParameter("type", "VapourDiffusionFEBEX");
17 DBUG("Create VapourDiffusionFEBEX phase property");
18
19 // Second access for storage.
21 auto property_name = config.peekConfigParameter<std::string>("name");
22
23 double const base_diffusion_coefficient =
25 config.getConfigParameter<double>("base_diffusion_coefficient",
26 2.16e-5);
27
28 double const exponent =
30 config.getConfigParameter<double>("exponent", 1.8);
31
32 return std::make_unique<VapourDiffusionFEBEX>(
33 std::move(property_name), base_diffusion_coefficient, exponent);
34}

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

Referenced by anonymous_namespace{CreateProperty.cpp}::createProperty().

◆ createVapourDiffusionPMQ()

std::unique_ptr< Property > MaterialPropertyLib::createVapourDiffusionPMQ ( BaseLib::ConfigTree const & config)
Input File Parameter
properties__property__type
Input File Parameter
properties__property__name
Input File Parameter
properties__property__VapourDiffusionPMQ__base_diffusion_coefficient
Input File Parameter
properties__property__VapourDiffusionPMQ__exponent
Input File Parameter
properties__property__VapourDiffusionPMQ

Definition at line 12 of file CreateVapourDiffusionPMQ.cpp.

14{
16 config.checkConfigParameter("type", "VapourDiffusionPMQ");
17 DBUG("Create VapourDiffusionPMQ phase property");
18
20 auto property_name = config.peekConfigParameter<std::string>("name");
21
22 double const base_diffusion_coefficient =
24 config.getConfigParameter<double>("base_diffusion_coefficient",
25 2.16e-5);
26
27 double const exponent =
29 config.getConfigParameter<double>("exponent", 1.8);
30
32 return std::make_unique<VapourDiffusionPMQ>(
33 std::move(property_name), base_diffusion_coefficient, exponent);
34}

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

Referenced by anonymous_namespace{CreateProperty.cpp}::createProperty().

◆ createVermaPruessModel()

std::unique_ptr< Property > MaterialPropertyLib::createVermaPruessModel ( BaseLib::ConfigTree const & config,
std::vector< std::unique_ptr< ParameterLib::ParameterBase > > const & parameters )
Input File Parameter
properties__property__type
Input File Parameter
properties__property__VermaPruessModel__initial_permeability
Input File Parameter
properties__property__VermaPruessModel__initial_porosity
Input File Parameter
properties__property__VermaPruessModel__critical_porosity
Input File Parameter
properties__property__VermaPruessModel__exponent

Definition at line 12 of file CreateVermaPruessModel.cpp.

15{
17 config.checkConfigParameter("type", "VermaPruess");
18 DBUG("Create Verma-Pruess model.");
19
22 config.getConfigParameter<std::string>("initial_permeability"),
23 parameters, 0, nullptr);
24
25 auto const& phi0 = ParameterLib::findParameter<double>(
27 config.getConfigParameter<std::string>("initial_porosity"), parameters,
28 1, nullptr);
29
30 auto const& phi_c = ParameterLib::findParameter<double>(
32 config.getConfigParameter<std::string>("critical_porosity"), parameters,
33 1, nullptr);
34
37 config.getConfigParameter<std::string>("exponent"), parameters, 1,
38 nullptr);
39
40 return std::make_unique<VermaPruessModel>(k0, phi0, phi_c, n);
41}

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

Referenced by anonymous_namespace{CreateProperty.cpp}::createProperty().

◆ createVolumeFractionAverage()

std::unique_ptr< VolumeFractionAverage > MaterialPropertyLib::createVolumeFractionAverage ( BaseLib::ConfigTree const & config)
Input File Parameter
properties__property__type
Input File Parameter
properties__property__name
Input File Parameter
properties__property__VolumeFractionAverage

Definition at line 9 of file CreateVolumeFractionAverage.cpp.

11{
13 config.checkConfigParameter("type", "VolumeFractionAverage");
14
15 // Second access for storage.
17 auto property_name = config.peekConfigParameter<std::string>("name");
18
20 DBUG("Create volume fraction average {:s}.", property_name);
21
22 // no input parameters required here (taken from phase properties)
23
24 return std::make_unique<MaterialPropertyLib::VolumeFractionAverage>(
25 std::move(property_name));
26}

References BaseLib::ConfigTree::checkConfigParameter(), DBUG(), and BaseLib::ConfigTree::peekConfigParameter().

Referenced by anonymous_namespace{CreateProperty.cpp}::createProperty().

◆ createWaterDensityIAPWSIF97Region1()

std::unique_ptr< Property > MaterialPropertyLib::createWaterDensityIAPWSIF97Region1 ( BaseLib::ConfigTree const & config)
Input File Parameter
properties__property__type
Input File Parameter
properties__property__name
Input File Parameter
properties__property__WaterDensityIAPWSIF97Region1

Definition at line 12 of file CreateWaterDensityIAPWSIF97Region1.cpp.

14{
16 config.checkConfigParameter("type", "WaterDensityIAPWSIF97Region1");
17 DBUG("Create WaterDensityIAPWSIF97Region1 phase property");
18
19 // Second access for storage.
21 auto property_name = config.peekConfigParameter<std::string>("name");
22
24 return std::make_unique<WaterDensityIAPWSIF97Region1>(
25 std::move(property_name));
26}

References BaseLib::ConfigTree::checkConfigParameter(), DBUG(), and BaseLib::ConfigTree::peekConfigParameter().

Referenced by anonymous_namespace{CreateProperty.cpp}::createProperty().

◆ createWaterEnthalpyIAPWSIF97Region1()

std::unique_ptr< Property > MaterialPropertyLib::createWaterEnthalpyIAPWSIF97Region1 ( BaseLib::ConfigTree const & config)
Input File Parameter
properties__property__type
Input File Parameter
properties__property__name
Input File Parameter
properties__property__WaterEnthalpyIAPWSIF97Region1

Definition at line 12 of file CreateWaterEnthalpyIAPWSIF97Region1.cpp.

14{
16 config.checkConfigParameter("type", "WaterEnthalpyIAPWSIF97Region1");
17 DBUG("Create WaterEnthalpyIAPWSIF97Region1 phase property");
18
19 // Second access for storage.
21 auto property_name = config.peekConfigParameter<std::string>("name");
22
24 return std::make_unique<WaterEnthalpyIAPWSIF97Region1>(
25 std::move(property_name));
26}

References BaseLib::ConfigTree::checkConfigParameter(), DBUG(), and BaseLib::ConfigTree::peekConfigParameter().

Referenced by anonymous_namespace{CreateProperty.cpp}::createProperty().

◆ createWaterLiquidDensityIAPWSIF97Region4()

std::unique_ptr< Property > MaterialPropertyLib::createWaterLiquidDensityIAPWSIF97Region4 ( BaseLib::ConfigTree const & config)
Input File Parameter
properties__property__type
Input File Parameter
properties__property__name
Input File Parameter
properties__property__WaterLiquidDensityIAPWSIF97Region4

Definition at line 12 of file CreateWaterLiquidDensityIAPWSIF97Region4.cpp.

14{
16 config.checkConfigParameter("type", "WaterLiquidDensityIAPWSIF97Region4");
17 DBUG("Create WaterLiquidDensityIAPWSIF97Region4 phase property");
18
19 // Second access for storage.
21 auto property_name = config.peekConfigParameter<std::string>("name");
22
24 return std::make_unique<WaterLiquidDensityIAPWSIF97Region4>(
25 std::move(property_name));
26}

References BaseLib::ConfigTree::checkConfigParameter(), DBUG(), and BaseLib::ConfigTree::peekConfigParameter().

Referenced by anonymous_namespace{CreateProperty.cpp}::createProperty().

◆ createWaterLiquidEnthalpyIAPWSIF97Region4()

std::unique_ptr< Property > MaterialPropertyLib::createWaterLiquidEnthalpyIAPWSIF97Region4 ( BaseLib::ConfigTree const & config)
Input File Parameter
properties__property__type
Input File Parameter
properties__property__name
Input File Parameter
properties__property__WaterLiquidEnthalpyIAPWSIF97Region4

Definition at line 12 of file CreateWaterLiquidEnthalpyIAPWSIF97Region4.cpp.

14{
16 config.checkConfigParameter("type", "WaterLiquidEnthalpyIAPWSIF97Region4");
17 DBUG("Create WaterLiquidEnthalpyIAPWSIF97Region4 phase property");
18
19 // Second access for storage.
21 auto property_name = config.peekConfigParameter<std::string>("name");
22
24 return std::make_unique<WaterLiquidEnthalpyIAPWSIF97Region4>(
25 std::move(property_name));
26}

References BaseLib::ConfigTree::checkConfigParameter(), DBUG(), and BaseLib::ConfigTree::peekConfigParameter().

Referenced by anonymous_namespace{CreateProperty.cpp}::createProperty().

◆ createWaterSaturationTemperatureIAPWSIF97Region4()

std::unique_ptr< Property > MaterialPropertyLib::createWaterSaturationTemperatureIAPWSIF97Region4 ( BaseLib::ConfigTree const & config)
Input File Parameter
properties__property__type
Input File Parameter
properties__property__name
Input File Parameter
properties__property__WaterSaturationTemperatureIAPWSIF97Region4

Definition at line 12 of file CreateWaterSaturationTemperatureIAPWSIF97Region4.cpp.

14{
16 config.checkConfigParameter("type",
17 "WaterSaturationTemperatureIAPWSIF97Region4");
18 DBUG("Create WaterSaturationTemperatureIAPWSIF97Region4 phase property");
19
20 // Second access for storage.
22 auto property_name = config.peekConfigParameter<std::string>("name");
23
25 return std::make_unique<WaterSaturationTemperatureIAPWSIF97Region4>(
26 std::move(property_name));
27}

References BaseLib::ConfigTree::checkConfigParameter(), DBUG(), and BaseLib::ConfigTree::peekConfigParameter().

Referenced by anonymous_namespace{CreateProperty.cpp}::createProperty().

◆ createWaterTemperatureIAPWSIF97Region1()

std::unique_ptr< Property > MaterialPropertyLib::createWaterTemperatureIAPWSIF97Region1 ( BaseLib::ConfigTree const & config)
Input File Parameter
properties__property__type
Input File Parameter
properties__property__name
Input File Parameter
properties__property__WaterTemperatureIAPWSIF97Region1

Definition at line 12 of file CreateWaterTemperatureIAPWSIF97Region1.cpp.

14{
16 config.checkConfigParameter("type", "WaterTemperatureIAPWSIF97Region1");
17 DBUG("Create WaterTemperatureIAPWSIF97Region1 phase property");
18
19 // Second access for storage.
21 auto property_name = config.peekConfigParameter<std::string>("name");
22
24 return std::make_unique<WaterTemperatureIAPWSIF97Region1>(
25 std::move(property_name));
26}

References BaseLib::ConfigTree::checkConfigParameter(), DBUG(), and BaseLib::ConfigTree::peekConfigParameter().

Referenced by anonymous_namespace{CreateProperty.cpp}::createProperty().

◆ createWaterThermalConductivityIAPWS()

std::unique_ptr< Property > MaterialPropertyLib::createWaterThermalConductivityIAPWS ( BaseLib::ConfigTree const & config)
Input File Parameter
properties__property__type
Input File Parameter
properties__property__name
Input File Parameter
properties__property__WaterThermalConductivityIAPWS

Definition at line 12 of file CreateWaterThermalConductivityIAPWS.cpp.

14{
16 config.checkConfigParameter("type", "WaterThermalConductivityIAPWS");
17 DBUG("Create WaterThermalConductivityIAPWS phase property");
18
19 // Second access for storage.
21 auto property_name = config.peekConfigParameter<std::string>("name");
22
24 return std::make_unique<WaterThermalConductivityIAPWS>(
25 std::move(property_name));
26}

References BaseLib::ConfigTree::checkConfigParameter(), DBUG(), and BaseLib::ConfigTree::peekConfigParameter().

Referenced by anonymous_namespace{CreateProperty.cpp}::createProperty().

◆ createWaterVapourDensity()

std::unique_ptr< Property > MaterialPropertyLib::createWaterVapourDensity ( BaseLib::ConfigTree const & config)
Input File Parameter
properties__property__type
Input File Parameter
properties__property__name
Input File Parameter
properties__property__WaterVapourDensity

Definition at line 12 of file CreateWaterVapourDensity.cpp.

14{
16 config.checkConfigParameter("type", "WaterVapourDensity");
17 DBUG("Create WaterVapourDensity phase property");
18
19 // Second access for storage.
21 auto property_name = config.peekConfigParameter<std::string>("name");
22
24 return std::make_unique<WaterVapourDensity>(std::move(property_name));
25}

References BaseLib::ConfigTree::checkConfigParameter(), DBUG(), and BaseLib::ConfigTree::peekConfigParameter().

Referenced by anonymous_namespace{CreateProperty.cpp}::createProperty().

◆ createWaterVapourDensityIAPWSIF97Region4()

std::unique_ptr< Property > MaterialPropertyLib::createWaterVapourDensityIAPWSIF97Region4 ( BaseLib::ConfigTree const & config)
Input File Parameter
properties__property__type
Input File Parameter
properties__property__name
Input File Parameter
properties__property__WaterVapourDensityIAPWSIF97Region4

Definition at line 12 of file CreateWaterVapourDensityIAPWSIF97Region4.cpp.

14{
16 config.checkConfigParameter("type", "WaterVapourDensityIAPWSIF97Region4");
17 DBUG("Create WaterVapourDensityIAPWSIF97Region4 phase property");
18
19 // Second access for storage.
21 auto property_name = config.peekConfigParameter<std::string>("name");
22
24 return std::make_unique<WaterVapourDensityIAPWSIF97Region4>(
25 std::move(property_name));
26}

References BaseLib::ConfigTree::checkConfigParameter(), DBUG(), and BaseLib::ConfigTree::peekConfigParameter().

Referenced by anonymous_namespace{CreateProperty.cpp}::createProperty().

◆ createWaterVapourEnthalpyIAPWSIF97Region4()

std::unique_ptr< Property > MaterialPropertyLib::createWaterVapourEnthalpyIAPWSIF97Region4 ( BaseLib::ConfigTree const & config)
Input File Parameter
properties__property__type
Input File Parameter
properties__property__name
Input File Parameter
properties__property__WaterVapourEnthalpyIAPWSIF97Region4

Definition at line 12 of file CreateWaterVapourEnthalpyIAPWSIF97Region4.cpp.

14{
16 config.checkConfigParameter("type", "WaterVapourEnthalpyIAPWSIF97Region4");
17 DBUG("Create WaterVapourEnthalpyIAPWSIF97Region4 phase property");
18
19 // Second access for storage.
21 auto property_name = config.peekConfigParameter<std::string>("name");
22
24 return std::make_unique<WaterVapourEnthalpyIAPWSIF97Region4>(
25 std::move(property_name));
26}

References BaseLib::ConfigTree::checkConfigParameter(), DBUG(), and BaseLib::ConfigTree::peekConfigParameter().

Referenced by anonymous_namespace{CreateProperty.cpp}::createProperty().

◆ createWaterVapourLatentHeatWithCriticalTemperature()

std::unique_ptr< Property > MaterialPropertyLib::createWaterVapourLatentHeatWithCriticalTemperature ( BaseLib::ConfigTree const & config)
Input File Parameter
properties__property__type
Input File Parameter
properties__property__name
Input File Parameter
properties__property__WaterVapourLatentHeatWithCriticalTemperature

Definition at line 12 of file CreateWaterVapourLatentHeatWithCriticalTemperature.cpp.

14{
16 config.checkConfigParameter("type",
17 "WaterVapourLatentHeatWithCriticalTemperature");
18 DBUG("Create WaterVapourLatentHeatWithCriticalTemperature phase property");
19
20 // Second access for storage.
22 auto property_name = config.peekConfigParameter<std::string>("name");
23
25 return std::make_unique<WaterVapourLatentHeatWithCriticalTemperature>(
26 std::move(property_name));
27}

References BaseLib::ConfigTree::checkConfigParameter(), DBUG(), and BaseLib::ConfigTree::peekConfigParameter().

Referenced by anonymous_namespace{CreateProperty.cpp}::createProperty().

◆ createWaterViscosityIAPWS()

std::unique_ptr< Property > MaterialPropertyLib::createWaterViscosityIAPWS ( BaseLib::ConfigTree const & config)
Input File Parameter
properties__property__type
Input File Parameter
properties__property__name
Input File Parameter
properties__property__WaterViscosityIAPWS

Definition at line 12 of file CreateWaterViscosityIAPWS.cpp.

14{
16 config.checkConfigParameter("type", "WaterViscosityIAPWS");
17 DBUG("Create WaterViscosityIAPWS phase property");
18
19 // Second access for storage.
21 auto property_name = config.peekConfigParameter<std::string>("name");
22
24 return std::make_unique<WaterViscosityIAPWS>(std::move(property_name));
25}

References BaseLib::ConfigTree::checkConfigParameter(), DBUG(), and BaseLib::ConfigTree::peekConfigParameter().

Referenced by anonymous_namespace{CreateProperty.cpp}::createProperty().

◆ currentThreadId()

int MaterialPropertyLib::currentThreadId ( std::string const & property_name,
std::size_t const num_slots )
static

OpenMP thread id validated against the number of allocated per-thread data slots. OGS_FATAL if the id exceeds the allocation.

Definition at line 661 of file Function.cpp.

663{
664#ifdef _OPENMP
665 int const thread_id = omp_get_thread_num();
666#else
667 int const thread_id = 0;
668#endif
669 if (thread_id >= static_cast<int>(num_slots))
670 {
671 OGS_FATAL(
672 "In Function-type property '{:s}' evaluation the OMP-thread with "
673 "id {:d} exceeds the number of allocated threads {:d}.",
674 property_name, thread_id, num_slots);
675 }
676 return thread_id;
677}

References OGS_FATAL.

Referenced by MaterialPropertyLib::Function::d2Value(), MaterialPropertyLib::Function::dValue(), and MaterialPropertyLib::Function::value().

◆ driftFluxProfileParameter()

double MaterialPropertyLib::driftFluxProfileParameter ( double const dryness)

Profile parameter \(C_0\) of the Rouhani-Axelsson drift-flux closure, the flow-weighted ratio of the cross-sectional averages that accounts for the non-uniform void and velocity profiles over the well cross-section.

Note
Like driftFluxVelocity(), the correlation is derived for vertical flow and carries no inclination correction. In an inclined well the phases segregate towards the high side of the cross-section, which changes the void profile the parameter stands for.
Parameters
drynessthe vapour mass fraction, dimensionless.
Returns
The profile parameter, dimensionless.

Definition at line 40 of file DriftFluxModel.cpp.

41{
42 return 1 + 0.12 * (1 - dryness);
43}

Referenced by driftFluxState().

◆ driftFluxState()

DriftFluxState MaterialPropertyLib::driftFluxState ( double const dryness,
double const temperature,
double const vapour_water_density,
double const liquid_water_density,
double const v_mix )

State of the drift-flux closure for a two-phase water mixture, assembled from the quantities a local assembler has at an integration point. The profile parameter and the drift flux velocity are not independent inputs: they follow from the same dryness, temperature and phase densities through driftFluxProfileParameter() and driftFluxVelocity(), and the drift has to be the one aligned with the mixture flow, see alignedDriftFluxVelocity(). Composing them here keeps every caller on the same closure.

Parameters
drynessthe vapour mass fraction, dimensionless.
temperaturein K.
vapour_water_densityin kg/m^3.
liquid_water_densityin kg/m^3.
v_mixthe mixture velocity in m/s.
Returns
The state, with its profile parameter and its aligned drift flux velocity.

Definition at line 124 of file DriftFluxModel.cpp.

128{
129 return {.dryness = dryness,
130 .vapour_water_density = vapour_water_density,
131 .liquid_water_density = liquid_water_density,
132 .v_mix = v_mix,
133 .C_0 = driftFluxProfileParameter(dryness),
135 driftFluxVelocity(dryness, temperature, vapour_water_density,
136 liquid_water_density),
137 v_mix)};
138}
double driftFluxVelocity(double const dryness, double const temperature, double const vapour_water_density, double const liquid_water_density)
double driftFluxProfileParameter(double const dryness)

References alignedDriftFluxVelocity(), driftFluxProfileParameter(), driftFluxVelocity(), and temperature.

Referenced by ProcessLib::WellboreCompensateNeumannBoundaryConditionLocalAssembler< ShapeFunction, GlobalDim >::assemble(), and ProcessLib::WellboreSimulator::WellboreSimulatorFEM< ShapeFunction, GlobalDim >::assemble().

◆ driftFluxVelocity()

double MaterialPropertyLib::driftFluxVelocity ( double const dryness,
double const temperature,
double const vapour_water_density,
double const liquid_water_density )

Drift flux velocity \(u_{gu}\) of the Rouhani-Axelsson closure, from the surface tension of the IAPWS correlation, see Cooper, J. R., and R. B. Dooley. "IAPWS release on surface tension of ordinary water substance." International Association for the Properties of Water and Steam (1994).

Both the surface tension correlation and the buoyancy driving the drift are capped at zero at the critical point, where the two phases become identical: beyond it the reduced temperature is negative and the phase densities cross, and std::pow of a negative base with the non-integer exponents of the two correlations is NaN, which would travel into the void fraction closure. Newton iterates do reach that range, so both are capped rather than assumed positive.

Note
The correlation is Harmathy's terminal rise velocity of a bubble in a quiescent liquid and is derived for vertical flow. It carries no inclination correction: the drift is the same for a vertical and for an inclined well, although the buoyancy driving it acts along the vertical and only its component \(g \cos\theta\) along the well axis, with the inclination \(\theta\) measured from the vertical, drives an axial drift. The value returned here is therefore an overestimate for an inclined well and stays at its full vertical value for a horizontal one, where the axial drift should vanish. A caller that projects its body force onto the well axis, as ProcessLib::WellboreSimulator does, is inconsistent with this closure unless the well is vertical. Correlations with an inclination correction exist, for instance Hasan, A. R., and C. S. Kabir. "A study of multiphase flow behavior in vertical wells." SPE Production Engineering 3 (1988): 263-272, but would need the inclination as a further argument.
Parameters
drynessthe vapour mass fraction, dimensionless.
temperaturein K.
vapour_water_densityin kg/m^3.
liquid_water_densityin kg/m^3.
Returns
The drift flux velocity in m/s.

Definition at line 93 of file DriftFluxModel.cpp.

96{
97 // The rounded value the original implementation of this closure used, not
98 // standard gravity, whose defined value is 9.80665 m/s^2. It stays rounded
99 // because sharpening it would move every existing two-phase result, and it
100 // stays local because a rounded stand-in is not the physical constant and
101 // so does not belong in PhysicalConstant.h beside the critical point.
102 constexpr double gravity = 9.81; // m/s^2
103
104 // Both caps are written as comparisons rather than with std::max, which
105 // returns its first argument for a NaN second one and would hand out a
106 // finite drift flux velocity for a non-finite state. The NaN is kept so
107 // that computeVapourVoidFraction() sees it and aborts the assembly.
108 double const temperature_ratio =
109 1 - temperature /
111 double const reduced_temperature =
112 temperature_ratio < 0 ? 0. : temperature_ratio;
113 double const sigma_gl = 0.2358 * std::pow(reduced_temperature, 1.256) *
114 (1 - 0.625 * reduced_temperature);
115
116 double const buoyancy =
117 gravity * sigma_gl * (liquid_water_density - vapour_water_density);
118 double const drift_buoyancy = buoyancy < 0 ? 0. : buoyancy;
119
120 return 1.18 * (1 - dryness) * std::sqrt(std::sqrt(drift_buoyancy)) /
121 std::sqrt(liquid_water_density);
122}

References temperature, and MaterialLib::PhysicalConstant::CriticalPoint::TemperatureWater.

Referenced by driftFluxState().

◆ dropConst()

VariableArray::VariablePointer MaterialPropertyLib::dropConst ( VariableArray::VariablePointerConst const const_pointer)
static

Definition at line 104 of file VariableType.cpp.

106{
107 return std::visit(
108 []<typename T>(T const* ptr) -> VariableArray::VariablePointer
109 { return const_cast<T*>(ptr); },
110 const_pointer);
111}
std::variant< Scalar *, KelvinVector *, DeformationGradient * > VariablePointer

Referenced by MaterialPropertyLib::VariableArray::address_of().

◆ dsaturatedVaporDensitydT()

double MaterialPropertyLib::dsaturatedVaporDensitydT ( double const T)
static

\(\frac{\partial \rho_{vS}}{\partial T}\)

Definition at line 21 of file WaterVapourDensity.cpp.

22{
23 return 4.9759 * std::exp(19.819 - 4975.9 / T) / (T * T);
24}

Referenced by MaterialPropertyLib::WaterVapourDensity::dValue().

◆ evaluateToArray()

template<std::size_t N>
std::array< double, N > MaterialPropertyLib::evaluateToArray ( std::vector< exprtk::expression< double > > const & expressions)
static

Helper to get fixed-size array from expressions for known sizes. This avoids heap allocation.

Definition at line 508 of file Function.cpp.

510{
511 std::array<double, N> result{};
512 for (std::size_t i = 0; i < N; ++i)
513 {
514 result[i] = expressions[i].value();
515 }
516 return result;
517}

Referenced by MaterialPropertyLib::PerThreadData::evaluate().

◆ fluidPhase()

Phase const & MaterialPropertyLib::fluidPhase ( Medium const & medium)

Returns a gas or aqueous liquid phase of the given medium.

Definition at line 95 of file Medium.cpp.

96{
97 if (medium.hasPhase(PhaseName::Gas))
98 {
99 return medium.phase(PhaseName::Gas);
100 }
101 if (medium.hasPhase(PhaseName::AqueousLiquid))
102 {
103 return medium.phase(PhaseName::AqueousLiquid);
104 }
105 OGS_FATAL(
106 "Neither Gas nor AqueousLiquid phase is available for the medium, but "
107 "a fluid phase was requested.");
108}

References AqueousLiquid, Gas, MaterialPropertyLib::Medium::hasPhase(), OGS_FATAL, and MaterialPropertyLib::Medium::phase().

Referenced by checkMPLPhasesForSinglePhaseFlow(), and ProcessLib::Common::HydraulicProcess::checkVolumeBalanceEquationSetting().

◆ formEffectiveThermalConductivity()

template<int GlobalDim>
Eigen::Matrix< double, GlobalDim, GlobalDim > MaterialPropertyLib::formEffectiveThermalConductivity ( MaterialPropertyLib::PropertyDataType const & solid_thermal_conductivity,
const double fluid_thermal_conductivity,
const double porosity )

Definition at line 11 of file FormEffectiveThermalConductivity.cpp.

14{
15 return (1.0 - porosity) *
16 formEigenTensor<GlobalDim>(solid_thermal_conductivity) +
17 porosity * fluid_thermal_conductivity *
18 Eigen::Matrix<double, GlobalDim, GlobalDim>::Identity();
19}
constexpr Eigen::Matrix< double, GlobalDim, GlobalDim > formEigenTensor(MaterialPropertyLib::PropertyDataType const &values)

References formEigenTensor(), and porosity.

Referenced by ProcessLib::ThermalTwoPhaseFlowWithPP::ThermalTwoPhaseFlowWithPPLocalAssembler< ShapeFunction, GlobalDim >::assemble().

◆ formEffectiveThermalConductivity< 1 >()

template Eigen::Matrix< double, 1, 1 > MaterialPropertyLib::formEffectiveThermalConductivity< 1 > ( MaterialPropertyLib::PropertyDataType const & solid_thermal_conductivity,
const double fluid_thermal_conductivity,
const double porosity )

References porosity.

◆ formEffectiveThermalConductivity< 2 >()

template Eigen::Matrix< double, 2, 2 > MaterialPropertyLib::formEffectiveThermalConductivity< 2 > ( MaterialPropertyLib::PropertyDataType const & solid_thermal_conductivity,
const double fluid_thermal_conductivity,
const double porosity )

References porosity.

◆ formEffectiveThermalConductivity< 3 >()

template Eigen::Matrix< double, 3, 3 > MaterialPropertyLib::formEffectiveThermalConductivity< 3 > ( MaterialPropertyLib::PropertyDataType const & solid_thermal_conductivity,
const double fluid_thermal_conductivity,
const double porosity )

References porosity.

◆ formEigenTensor()

template<int GlobalDim>
Eigen::Matrix< double, GlobalDim, GlobalDim > MaterialPropertyLib::formEigenTensor ( MaterialPropertyLib::PropertyDataType const & values)
constexpr

Definition at line 163 of file FormEigenTensor.h.

165{
166 return std::visit(FormEigenTensor<GlobalDim>(), values);
167}

Referenced by ProcessLib::HeatConduction::LocalAssemblerData< ShapeFunction, GlobalDim >::assemble(), ProcessLib::HT::MonolithicHTFEM< ShapeFunction, GlobalDim >::assemble(), ProcessLib::LiquidFlow::LiquidFlowLocalAssembler< ShapeFunction, GlobalDim >::assemble(), ProcessLib::RichardsComponentTransport::LocalAssemblerData< ShapeFunction, GlobalDim >::assemble(), ProcessLib::RichardsFlow::LocalAssemblerData< ShapeFunction, GlobalDim >::assemble(), ProcessLib::RichardsMechanics::RichardsMechanicsLocalAssembler< ShapeFunctionDisplacement, ShapeFunctionPressure, DisplacementDim >::assemble(), ProcessLib::SteadyStateDiffusion::LocalAssemblerData< ShapeFunction, GlobalDim >::assemble(), ProcessLib::ThermalTwoPhaseFlowWithPP::ThermalTwoPhaseFlowWithPPLocalAssembler< ShapeFunction, GlobalDim >::assemble(), ProcessLib::ThermoRichardsFlow::ThermoRichardsFlowLocalAssembler< ShapeFunction, GlobalDim >::assemble(), ProcessLib::TwoPhaseFlowWithPP::TwoPhaseFlowWithPPLocalAssembler< ShapeFunction, GlobalDim >::assemble(), ProcessLib::ComponentTransport::LocalAssemblerData< ShapeFunction, GlobalDim >::assembleBlockMatrices(), ProcessLib::LIE::HydroMechanics::HydroMechanicsLocalAssemblerMatrix< ShapeFunctionDisplacement, ShapeFunctionPressure, DisplacementDim >::assembleBlockMatricesWithJacobian(), ProcessLib::ComponentTransport::LocalAssemblerData< ShapeFunction, GlobalDim >::assembleComponentTransportEquation(), ProcessLib::ComponentTransport::LocalAssemblerData< ShapeFunction, GlobalDim >::assembleHeatTransportEquation(), ProcessLib::HT::StaggeredHTFEM< ShapeFunction, GlobalDim >::assembleHeatTransportEquation(), ProcessLib::ComponentTransport::LocalAssemblerData< ShapeFunction, GlobalDim >::assembleHydraulicEquation(), ProcessLib::HT::StaggeredHTFEM< ShapeFunction, GlobalDim >::assembleHydraulicEquation(), ProcessLib::LiquidFlow::LiquidFlowLocalAssembler< ShapeFunction, GlobalDim >::assembleMatrixAndVector(), ProcessLib::HeatConduction::LocalAssemblerData< ShapeFunction, GlobalDim >::assembleWithJacobian(), ProcessLib::HydroMechanics::HydroMechanicsLocalAssembler< ShapeFunctionDisplacement, ShapeFunctionPressure, DisplacementDim >::assembleWithJacobian(), ProcessLib::ThermoMechanics::ThermoMechanicsLocalAssembler< ShapeFunction, DisplacementDim >::assembleWithJacobian(), ProcessLib::ThermoRichardsFlow::ThermoRichardsFlowLocalAssembler< ShapeFunction, GlobalDim >::assembleWithJacobian(), ProcessLib::ComponentTransport::LocalAssemblerData< ShapeFunction, GlobalDim >::assembleWithJacobianComponentTransportEquation(), ProcessLib::RichardsMechanics::RichardsMechanicsLocalAssembler< ShapeFunctionDisplacement, ShapeFunctionPressure, DisplacementDim >::assembleWithJacobianEvalConstitutiveSetting(), ProcessLib::ThermoMechanics::ThermoMechanicsLocalAssembler< ShapeFunction, DisplacementDim >::assembleWithJacobianForHeatConductionEquations(), ProcessLib::HydroMechanics::HydroMechanicsLocalAssembler< ShapeFunctionDisplacement, ShapeFunctionPressure, DisplacementDim >::assembleWithJacobianForPressureEquations(), ProcessLib::ComponentTransport::LocalAssemblerData< ShapeFunction, GlobalDim >::assembleWithJacobianHydraulicEquation(), ProcessLib::HMPhaseField::HMPhaseFieldLocalAssembler< ShapeFunction, DisplacementDim >::assembleWithJacobianHydroEquations(), ProcessLib::ComponentTransport::LocalAssemblerData< ShapeFunction, GlobalDim >::calculateIntPtDarcyVelocity(), ProcessLib::LiquidFlow::LiquidFlowLocalAssembler< ShapeFunction, GlobalDim >::computeProjectedDarcyVelocity(), ProcessLib::ComponentTransport::LocalAssemblerData< ShapeFunction, GlobalDim >::computeSecondaryVariableConcrete(), ProcessLib::RichardsMechanics::RichardsMechanicsLocalAssembler< ShapeFunctionDisplacement, ShapeFunctionPressure, DisplacementDim >::computeSecondaryVariableConcrete(), ProcessLib::ThermoRichardsFlow::ThermoRichardsFlowLocalAssembler< ShapeFunction, GlobalDim >::computeSecondaryVariableConcrete(), ProcessLib::TH2M::ConstitutiveRelations::ThermalConductivityModel< DisplacementDim >::dEval(), MaterialPropertyLib::EffectiveThermalConductivityPorosityMixing< GlobalDim >::dValue(), ProcessLib::TH2M::ConstitutiveRelations::PermeabilityModel< DisplacementDim >::eval(), ProcessLib::TH2M::ConstitutiveRelations::SwellingModel< DisplacementDim >::eval(), ProcessLib::TH2M::ConstitutiveRelations::ThermalConductivityModel< DisplacementDim >::eval(), ProcessLib::ThermoRichardsMechanics::ConstitutiveStress_StrainTemperature::SwellingModel< DisplacementDim >::eval(), ProcessLib::ThermoRichardsMechanics::PermeabilityModel< DisplacementDim >::eval(), ProcessLib::ThermoRichardsMechanics::TRMHeatStorageAndFluxModel< DisplacementDim >::eval(), formEffectiveThermalConductivity(), ProcessLib::ComponentTransport::LocalAssemblerData< ShapeFunction, GlobalDim >::getFlux(), ProcessLib::HT::HTFEM< ShapeFunction, GlobalDim >::getFlux(), ProcessLib::LiquidFlow::LiquidFlowLocalAssembler< ShapeFunction, GlobalDim >::getFlux(), ProcessLib::SteadyStateDiffusion::LocalAssemblerData< ShapeFunction, GlobalDim >::getFlux(), ProcessLib::HydroMechanics::HydroMechanicsLocalAssembler< ShapeFunctionDisplacement, ShapeFunctionPressure, DisplacementDim >::getIntPtDarcyVelocity(), ProcessLib::LiquidFlow::LiquidFlowLocalAssembler< ShapeFunction, GlobalDim >::getIntPtDarcyVelocity(), ProcessLib::RichardsComponentTransport::LocalAssemblerData< ShapeFunction, GlobalDim >::getIntPtDarcyVelocity(), ProcessLib::RichardsFlow::LocalAssemblerData< ShapeFunction, GlobalDim >::getIntPtDarcyVelocity(), ProcessLib::SteadyStateDiffusion::LocalAssemblerData< ShapeFunction, GlobalDim >::getIntPtDarcyVelocity(), ProcessLib::HT::HTFEM< ShapeFunction, GlobalDim >::getIntPtDarcyVelocityLocal(), ProcessLib::HeatConduction::LocalAssemblerData< ShapeFunction, GlobalDim >::getIntPtHeatFlux(), ProcessLib::ComponentTransport::LocalAssemblerData< ShapeFunction, GlobalDim >::getIntPtMolarFlux(), ProcessLib::ComponentTransport::LocalAssemblerData< ShapeFunction, GlobalDim >::getThermalConductivityDispersivity(), ProcessLib::HT::HTFEM< ShapeFunction, GlobalDim >::getThermalConductivityDispersivity(), ProcessLib::getThermoOsmoticCoefficient(), ProcessLib::LIE::HydroMechanics::HydroMechanicsLocalAssemblerMatrix< ShapeFunctionDisplacement, ShapeFunctionPressure, DisplacementDim >::postTimestepConcreteWithBlockVectors(), ProcessLib::ThermoHydroMechanics::ThermoHydroMechanicsLocalAssembler< ShapeFunctionDisplacement, ShapeFunctionPressure, DisplacementDim >::updateConstitutiveRelations(), ProcessLib::RichardsMechanics::updateSwellingStressAndVolumetricStrain(), and MaterialPropertyLib::EffectiveThermalConductivityPorosityMixing< GlobalDim >::value().

◆ formEigenTensor< 1 >()

template Eigen::Matrix< double, 1, 1 > MaterialPropertyLib::formEigenTensor< 1 > ( MaterialPropertyLib::PropertyDataType const & values)

◆ formEigenTensor< 2 >()

template Eigen::Matrix< double, 2, 2 > MaterialPropertyLib::formEigenTensor< 2 > ( MaterialPropertyLib::PropertyDataType const & values)

◆ formEigenTensor< 3 >()

◆ formEigenTensor< 4 >()

template Eigen::Matrix< double, 4, 4 > MaterialPropertyLib::formEigenTensor< 4 > ( MaterialPropertyLib::PropertyDataType const & values)

◆ formEigenTensor< 6 >()

template Eigen::Matrix< double, 6, 6 > MaterialPropertyLib::formEigenTensor< 6 > ( MaterialPropertyLib::PropertyDataType const & values)

◆ formEigenVector()

template<int GlobalDim>
Eigen::Matrix< double, GlobalDim, 1 > MaterialPropertyLib::formEigenVector ( MaterialPropertyLib::PropertyDataType const & values)

Definition at line 98 of file FormEigenVector.cpp.

100{
101 return std::visit(FormEigenVector<GlobalDim>(), values);
102}

◆ formEigenVector< 1 >()

template Eigen::Matrix< double, 1, 1 > MaterialPropertyLib::formEigenVector< 1 > ( MaterialPropertyLib::PropertyDataType const & values)

◆ formEigenVector< 2 >()

template Eigen::Matrix< double, 2, 1 > MaterialPropertyLib::formEigenVector< 2 > ( MaterialPropertyLib::PropertyDataType const & values)

◆ formEigenVector< 3 >()

◆ formKelvinVector()

template<int GlobalDim>
MathLib::KelvinVector::KelvinVectorType< GlobalDim > MaterialPropertyLib::formKelvinVector ( MaterialPropertyLib::PropertyDataType const & values)

A function to form a Kelvin vector from strain or stress alike property like thermal expansivity for thermal strain.

It takes either a scalar number for isotropic thermal expansion or a three element vector or a 3 x 3 matrix for anisotropic properties, to get a Kelvin vector for strain or stress.

Parameters
valuese.g., Thermal expansivity, which can be scalar number, a three element vector or a 3 x 3 matrix.
Returns
Kelvin vector type property.

Definition at line 74 of file FormKelvinVector.cpp.

Referenced by ProcessLib::ThermoMechanics::ThermoMechanicsLocalAssembler< ShapeFunction, DisplacementDim >::assembleWithJacobian(), ProcessLib::ThermoMechanics::ThermoMechanicsLocalAssembler< ShapeFunction, DisplacementDim >::assembleWithJacobianForDeformationEquations(), ProcessLib::TH2M::ConstitutiveRelations::SolidThermalExpansionModel< DisplacementDim >::eval(), ProcessLib::ThermoRichardsMechanics::SolidThermalExpansionModel< DisplacementDim >::eval(), and ProcessLib::ThermoHydroMechanics::ThermoHydroMechanicsLocalAssembler< ShapeFunctionDisplacement, ShapeFunctionPressure, DisplacementDim >::updateConstitutiveRelations().

◆ formKelvinVector< 2 >()

◆ formKelvinVector< 3 >()

◆ fromArray()

template<std::size_t N>
PropertyDataType MaterialPropertyLib::fromArray ( std::array< double, N > const & values)

Conversion of a fixed-size array to PropertyDataType.

Supported sizes: 1, 2, 3, 4, 6, 9 - same semantics as fromVector().

Attention
This method cannot distinguish between 2x2 matrix and 4x1 vector.
Note
4-element arrays map to Eigen::Matrix2d (row-major), 9-element arrays map to Eigen::Matrix3d (row-major).

Definition at line 49 of file MaterialLib/MPL/Property.h.

50{
51 if constexpr (N == 1)
52 {
53 return values[0];
54 }
55 else if constexpr (N == 2)
56 {
57 return Eigen::Vector2d{values[0], values[1]};
58 }
59 else if constexpr (N == 3)
60 {
61 return Eigen::Vector3d{values[0], values[1], values[2]};
62 }
63 else if constexpr (N == 4)
64 {
65 using M = Eigen::Matrix2d;
66 using MRM = Eigen::Matrix<double, 2, 2, Eigen::RowMajor>;
67 return M{Eigen::Map<MRM const>{values.data(), 2, 2}};
68 }
69 else if constexpr (N == 6)
70 {
71 using M = Eigen::Matrix<double, 6, 1>;
72 return M{Eigen::Map<M const>{values.data(), 6}};
73 }
74 else if constexpr (N == 9)
75 {
76 using M = Eigen::Matrix3d;
77 using MRM = Eigen::Matrix<double, 3, 3, Eigen::RowMajor>;
78 return M{Eigen::Map<MRM const>{values.data(), 3, 3}};
79 }
80 else
81 {
82 static_assert(false, "Unsupported array size for fromArray.");
83 }
84}

Referenced by MaterialPropertyLib::PerThreadData::evaluate().

◆ fromString()

PhaseName MaterialPropertyLib::fromString ( std::string const & phase_name)
nodiscard

Convert string to phase enum. Throws if invalid phase name.

Definition at line 29 of file Phase.cpp.

30{
31 if (phase_name == "Solid")
32 {
33 return PhaseName::Solid;
34 }
35 if (phase_name == "AqueousLiquid")
36 {
38 }
39 if (phase_name == "Gas")
40 {
41 return PhaseName::Gas;
42 }
43 if (phase_name == "FrozenLiquid")
44 {
46 }
47 OGS_FATAL("Unknown phase name '{}'", phase_name);
48}

References AqueousLiquid, FrozenLiquid, Gas, OGS_FATAL, and Solid.

Referenced by anonymous_namespace{CreatePhase.cpp}::createPhase(), anonymous_namespace{PhaseTransition.cpp}::findComponentIndex(), and anonymous_namespace{PhaseTransition.cpp}::numberOfComponents().

◆ fromVector()

PropertyDataType MaterialPropertyLib::fromVector ( std::vector< double > const & values)

Conversion of a vector to PropertyDataType for different sizes of the vector.

Attention
This method cannot distinguish between 2x2 matrix and 4x1 vector.
Note
If the values vector stores all elements of a 2x2 or 3x3 matrix (i.e. the general case for 2x2 and 3x3 matrices), it is assumed to be in row major storage order.

Definition at line 14 of file MaterialLib/MPL/Property.cpp.

15{
16 switch (values.size())
17 {
18 case 1:
19 {
20 return values[0];
21 }
22 case 2:
23 {
24 return Eigen::Vector2d{values[0], values[1]};
25 }
26 case 3:
27 {
28 return Eigen::Vector3d{values[0], values[1], values[2]};
29 }
30 case 4:
31 {
32 using M = Eigen::Matrix2d;
33 // the values vector is in row major order
34 using MRM = Eigen::Matrix<double, 2, 2, Eigen::RowMajor>;
35 return M{Eigen::Map<MRM const>{values.data(), 2, 2}};
36 }
37 case 6:
38 {
39 // Symmetric Tensor - xx, yy, zz, xy, xz, yz
40 using M = Eigen::Matrix<double, 6, 1>;
41 return M{Eigen::Map<M const>{values.data(), 6}};
42 }
43 case 9:
44 {
45 using M = Eigen::Matrix3d;
46 // the values vector is in row major order
47 using MRM = Eigen::Matrix<double, 3, 3, Eigen::RowMajor>;
48 return M{Eigen::Map<MRM const>{values.data(), 3, 3}};
49 }
50 default:
51 {
53 "Conversion of a {:d}-vector to PropertyDataType is not "
54 "implemented.",
55 values.size());
56 }
57 }
58}

References OGS_FATAL.

Referenced by createConstant(), MaterialPropertyLib::OrthotropicEmbeddedFracturePermeability< DisplacementDim >::dValue(), MaterialPropertyLib::SaturationWeightedThermalConductivity< MeantType, GlobalDimension >::dValue(), MaterialPropertyLib::PorosityFromMassBalance::initialValue(), MaterialPropertyLib::TransportPorosityFromMassBalance::initialValue(), MaterialPropertyLib::DupuitPermeability::value(), MaterialPropertyLib::GasPressureDependentPermeability< DisplacementDim >::value(), MaterialPropertyLib::KozenyCarmanModel::value(), MaterialPropertyLib::OrthotropicEmbeddedFracturePermeability< DisplacementDim >::value(), MaterialPropertyLib::Parameter::value(), MaterialPropertyLib::Parameter::value(), MaterialPropertyLib::PermeabilityMohrCoulombFailureIndexModel< DisplacementDim >::value(), MaterialPropertyLib::SaturationWeightedThermalConductivity< MeantType, GlobalDimension >::value(), MaterialPropertyLib::StrainDependentPermeability< DisplacementDim >::value(), MaterialPropertyLib::TemperatureDependentDiffusion::value(), and MaterialPropertyLib::VermaPruessModel::value().

◆ getFluidDensity()

double MaterialPropertyLib::getFluidDensity ( double const t,
double const dt,
ParameterLib::SpatialPosition const & pos,
Phase const & fluid_phase,
VariableArray & vars )

It computes fluid density for single phase flow model.

Definition at line 13 of file GetFluidDensityAndViscosity.cpp.

16{
17 // Compute density:
18 // Quick workaround: If fluid density is described as ideal gas, then
19 // the molar mass must be passed to the MPL::IdealGasLaw via the
20 // variable_array and the fluid must have the property
21 // MPL::PropertyType::molar_mass. For other density models (e.g.
22 // Constant), it is not mandatory to specify the molar mass.
23 if (fluid_phase.hasProperty(MaterialPropertyLib::PropertyType::molar_mass))
24 {
25 vars.molar_mass =
27 .template value<double>(vars, pos, t, dt);
28 }
29
31 .template value<double>(vars, pos, t, dt);
32}

References density, MaterialPropertyLib::Phase::hasProperty(), molar_mass, MaterialPropertyLib::VariableArray::molar_mass, and MaterialPropertyLib::Phase::property().

Referenced by ProcessLib::HydroMechanics::HydroMechanicsLocalAssembler< ShapeFunctionDisplacement, ShapeFunctionPressure, DisplacementDim >::assembleWithJacobianForDeformationEquations(), and getFluidDensityAndViscosity().

◆ getFluidDensityAndViscosity()

std::tuple< double, double > MaterialPropertyLib::getFluidDensityAndViscosity ( double const t,
double const dt,
ParameterLib::SpatialPosition const & pos,
MaterialPropertyLib::Phase const & fluid_phase,
MaterialPropertyLib::VariableArray & vars )

It computes fluid density and viscosity for single phase flow model.

Definition at line 34 of file GetFluidDensityAndViscosity.cpp.

38{
39 auto const fluid_density = getFluidDensity(t, dt, pos, fluid_phase, vars);
40
41 assert(fluid_density > 0.);
42 vars.density = fluid_density;
43
44 auto const viscosity =
46 .template value<double>(vars, pos, t, dt);
47
48 return {fluid_density, viscosity};
49}
double getFluidDensity(double const t, double const dt, ParameterLib::SpatialPosition const &pos, Phase const &fluid_phase, VariableArray &vars)
It computes fluid density for single phase flow model.

References MaterialPropertyLib::VariableArray::density, getFluidDensity(), and viscosity.

Referenced by ProcessLib::LiquidFlow::LiquidFlowLocalAssembler< ShapeFunction, GlobalDim >::assembleMatrixAndVector(), ProcessLib::HydroMechanics::HydroMechanicsLocalAssembler< ShapeFunctionDisplacement, ShapeFunctionPressure, DisplacementDim >::assembleWithJacobian(), ProcessLib::HydroMechanics::HydroMechanicsLocalAssembler< ShapeFunctionDisplacement, ShapeFunctionPressure, DisplacementDim >::assembleWithJacobianForPressureEquations(), ProcessLib::LiquidFlow::LiquidFlowLocalAssembler< ShapeFunction, GlobalDim >::computeProjectedDarcyVelocity(), and ProcessLib::HydroMechanics::HydroMechanicsLocalAssembler< ShapeFunctionDisplacement, ShapeFunctionPressure, DisplacementDim >::getIntPtDarcyVelocity().

◆ getLiquidThermalExpansivity()

double MaterialPropertyLib::getLiquidThermalExpansivity ( Phase const & phase,
VariableArray const & vars,
const double density,
ParameterLib::SpatialPosition const & pos,
double const t,
double const dt )

It gets the thermal expansion coefficient.

If the the thermal expansion coefficient is given in the project file via the media property of thermal_expansivity, e.g

*     <property>
*       <name>thermal_expansivity</name>
*       <type>Constant</type>
*       <value>2.07e-4</value>
*     </property>
* 

it returns the value of the given property. Otherwise it returns the value computed from the density model by the following formula

\[ (\frac{\partial \rho}{\partial T})/\rho \]

where \(\rho\) is the density, \(T\) is the temperature.

Definition at line 12 of file GetLiquidThermalExpansivity.cpp.

17{
18 // The thermal expansivity is explicitly given in the project file.
19 if (phase.hasProperty(
21 {
22 return phase
24 .template value<double>(vars, pos, t, dt);
25 }
26
27 // The thermal expansivity calculated by the density model directly.
28 return (density == 0.0)
29 ? 0.0
31 .template dValue<double>(
33 pos, t, dt) /
34 density;
35}

References density, MaterialPropertyLib::Phase::hasProperty(), MaterialPropertyLib::Phase::property(), temperature, and thermal_expansivity.

Referenced by ProcessLib::ThermoRichardsFlow::ThermoRichardsFlowLocalAssembler< ShapeFunction, GlobalDim >::assemble(), ProcessLib::ThermoRichardsFlow::ThermoRichardsFlowLocalAssembler< ShapeFunction, GlobalDim >::assembleWithJacobian(), ProcessLib::ThermoRichardsMechanics::FluidThermalExpansionModel< DisplacementDim >::eval(), and ProcessLib::ThermoHydroMechanics::ThermoHydroMechanicsLocalAssembler< ShapeFunctionDisplacement, ShapeFunctionPressure, DisplacementDim >::updateConstitutiveRelations().

◆ getOptionalPhase()

Phase const * MaterialPropertyLib::getOptionalPhase ( Medium const & medium,
PhaseName phase_name )

Returns a pointer to the phase with the given type, or nullptr if the phase does not exist in the medium.

Definition at line 110 of file Medium.cpp.

111{
112 return medium.hasPhase(phase_name) ? &medium.phase(phase_name) : nullptr;
113}

References MaterialPropertyLib::Medium::hasPhase(), and MaterialPropertyLib::Medium::phase().

Referenced by MaterialPropertyLib::EffectiveThermalConductivityPorosityMixing< GlobalDim >::dValue(), ProcessLib::ThermoRichardsMechanics::TRMVaporDiffusionModel< DisplacementDim >::eval(), and MaterialPropertyLib::EffectiveThermalConductivityPorosityMixing< GlobalDim >::value().

◆ getSymmetricTensor()

◆ getSymmetricTensor< 2 >()

template Eigen::Matrix< double, 4, 1 > MaterialPropertyLib::getSymmetricTensor< 2 > ( MaterialPropertyLib::PropertyDataType const & values)

◆ getSymmetricTensor< 3 >()

template Eigen::Matrix< double, 6, 1 > MaterialPropertyLib::getSymmetricTensor< 3 > ( MaterialPropertyLib::PropertyDataType const & values)

◆ humidity()

double MaterialPropertyLib::humidity ( double const T,
double const p,
double const water_density )
static

◆ mixtureSlipParameter()

double MaterialPropertyLib::mixtureSlipParameter ( double const alpha,
DriftFluxState const & state )

Slip parameter \(\gamma\) of the two-phase mixture, the momentum flux carried by the relative motion of the phases, see Akbar, Somaieh, N. Fathianpour, and Rafid Al Khoury. "A finite element model for high enthalpy two-phase flow in geothermal wellbores." Renewable Energy 94 (2016): 223-236.

\[ \gamma = \frac{\alpha \rho_l \rho_v \rho_m}{(1 - \alpha) \left(\alpha C_0 \rho_v + (1 - \alpha C_0) \rho_l\right)^2} \left((C_0 - 1) v + u_{gu}\right)^2 \]

with the mixture density \(\rho_m = \alpha \rho_v + (1 - \alpha) \rho_l\).

A void fraction of one, which computeVapourVoidFraction() returns at a dryness of one, would divide by zero. There is no liquid phase left to slip against and the limit is zero slip: both the liquid fraction \(1 - \alpha\) and the bracket \((C_0 - 1) v + u_{gu}\) vanish linearly in \(1 - x\), and the bracket enters squared, so the quotient is of the order of \(1 - x\).

The dryness of state does not enter; the void fraction it leads to is passed instead.

Parameters
alphathe vapour void fraction, dimensionless.
statethe state of the closure the void fraction was solved from.
Returns
The slip parameter in Pa; it is a momentum flux and enters the momentum balance next to \(\rho_m v^2\).

Definition at line 291 of file DriftFluxModel.cpp.

292{
293 // The zero slip limit at a void fraction of one, see the documentation of
294 // this function.
295 if (alpha == 1)
296 {
297 return 0.;
298 }
299
300 double const rho_v = state.vapour_water_density;
301 double const rho_l = state.liquid_water_density;
302 double const C_0 = state.C_0;
303
304 double const rho_mix = alpha * rho_v + (1 - alpha) * rho_l;
305
306 return alpha * rho_l * rho_v * rho_mix / (1 - alpha) /
307 std::pow((alpha * C_0 * rho_v + (1 - alpha * C_0) * rho_l), 2) *
308 std::pow((C_0 - 1) * state.v_mix + state.u_gu, 2);
309}

References alpha, MaterialPropertyLib::DriftFluxState::C_0, MaterialPropertyLib::DriftFluxState::liquid_water_density, MaterialPropertyLib::DriftFluxState::u_gu, MaterialPropertyLib::DriftFluxState::v_mix, and MaterialPropertyLib::DriftFluxState::vapour_water_density.

Referenced by ProcessLib::WellboreCompensateNeumannBoundaryConditionLocalAssembler< ShapeFunction, GlobalDim >::assemble(), and ProcessLib::WellboreSimulator::WellboreSimulatorFEM< ShapeFunction, GlobalDim >::assemble().

◆ newComponent()

std::unique_ptr< Component > MaterialPropertyLib::newComponent ( std::string const & component_name,
bool & isCustomComponent )

Method for creating a new component based on the specified component name.

This function creates a new component based on the (optional) component name that is given in the prj-file.

The method evaluates the string in the 'name'-object and calls the constructors of the derived component classes (if found) or that of the base class (if no name is specified).

References c.

◆ normalizedState()

std::optional< std::pair< double, double > > MaterialPropertyLib::normalizedState ( double const f,
double const lower_bound,
double const upper_bound )
static

Definition at line 27 of file Sigmoid.cpp.

29{
30 double const range = upper_bound - lower_bound;
31 double const f_normalized = f - lower_bound;
32
33 if (f_normalized <= 0.0 || f_normalized >= range)
34 {
35 return std::nullopt;
36 }
37 return std::pair{f_normalized, range};
38}

Referenced by MaterialPropertyLib::Sigmoid::d2Value(), and MaterialPropertyLib::Sigmoid::dValue().

◆ overwriteExistingProperties()

void MaterialPropertyLib::overwriteExistingProperties ( PropertyArray & properties,
PropertyArray & new_properties,
std::variant< Medium *, Phase *, Component * > scale_pointer )
inline

Definition at line 361 of file MaterialLib/MPL/Property.h.

366{
367 for (std::size_t i = 0; i < properties.size(); ++i)
368 {
369 if (new_properties[i] != nullptr)
370 {
371 properties[i] = std::move(new_properties[i]);
372 properties[i]->setScale(scale_pointer);
373 }
374 }
375}

Referenced by MaterialPropertyLib::Component::Component(), MaterialPropertyLib::Medium::Medium(), and MaterialPropertyLib::Phase::Phase().

◆ saturatedVaporDensity()

double MaterialPropertyLib::saturatedVaporDensity ( double const T)
static

\(\rho_{vS}\)

Definition at line 15 of file WaterVapourDensity.cpp.

16{
17 return 1.0e-3 * std::exp(19.819 - 4975.9 / T);
18}

Referenced by MaterialPropertyLib::WaterVapourDensity::dValue(), and MaterialPropertyLib::WaterVapourDensity::value().

◆ steamDryness()

double MaterialPropertyLib::steamDryness ( double const enthalpy,
double const h_sat_liquid,
double const h_sat_vapour )

Steam dryness \(x\), the vapour mass fraction, from the specific enthalpy of the mixture and the saturation enthalpies of the two phases.

The dryness is capped at the two ends of the two-phase range, but the two caps do not carry the same weight.

Below the range, \(h < h_l\), the state is subcooled liquid. The callers detect it as a dryness of zero and then re-evaluate the liquid density and the temperature off the saturation line, so the cap only removes a negative vapour mass fraction from an otherwise fully represented state.

Above the range, \(h > h_v\), the state is superheated steam and there is no counterpart: the mixture is described by the saturation line alone, so such a section keeps the saturation temperature and the saturation vapour density, and its superheat is lost rather than represented. The cap is still applied, because the drift-flux closure is only defined on \([0, 1]\), but it is reported so that it does not pass silently.

A non-finite ratio, which the saturation enthalpies produce where they coincide at the critical point, passes through both caps unchanged and is rejected by the closure that consumes the dryness.

Definition at line 10 of file SteamDryness.cpp.

12{
13 double const dryness =
14 (enthalpy - h_sat_liquid) / (h_sat_vapour - h_sat_liquid);
15
16 if (dryness > 1)
17 {
18 WARN(
19 "Specific enthalpy {:g} J/kg exceeds the saturation enthalpy of "
20 "the vapour phase, {:g} J/kg. The steam is superheated, which the "
21 "saturated mixture cannot represent: the section is evaluated at "
22 "the saturation temperature and with the saturation vapour "
23 "density.",
24 enthalpy, h_sat_vapour);
25 return 1.;
26 }
27 if (dryness < 0)
28 {
29 return 0.;
30 }
31 return dryness;
32}

References enthalpy, and WARN().

Referenced by ProcessLib::WellboreCompensateNeumannBoundaryConditionLocalAssembler< ShapeFunction, GlobalDim >::assemble(), and ProcessLib::WellboreSimulator::WellboreSimulatorFEM< ShapeFunction, GlobalDim >::assemble().

◆ tensorSize()

int MaterialPropertyLib::tensorSize ( int dim)
constexpr

See Tensor type for details.

Definition at line 13 of file Tensor.h.

14{
15 if (dim == 1)
16 {
17 return 3; // Diagonal entries.
18 }
19 if (dim == 2)
20 {
21 return 5; // 2x2 matrix and the 3rd diagonal entry.
22 }
23 if (dim == 3)
24 {
25 return 9; // Full 3x3 matrix.
26 }
27 OGS_FATAL("Tensor size for dimension {} is not defined.", dim);
28}

References OGS_FATAL.

Referenced by ProcessLib::LargeDeformation::computeSigmaGeom(), MaterialLib::Solids::MFront::Variable< Derived >::rows(), and MaterialLib::Solids::MFront::OGSMFrontTangentOperatorBlocksView< DisplacementDim, ForcesGradsCombinations >::size().

◆ toString()

std::string_view MaterialPropertyLib::toString ( PhaseName phase_name)
nodiscard

Convert phase enum to its string representation.

Definition at line 13 of file Phase.cpp.

14{
15 switch (phase_name)
16 {
18 return "Solid";
20 return "AqueousLiquid";
21 case PhaseName::Gas:
22 return "Gas";
24 return "FrozenLiquid";
25 }
26 OGS_FATAL("Unknown phase name");
27}

References AqueousLiquid, FrozenLiquid, Gas, OGS_FATAL, and Solid.

Referenced by checkRequiredProperties(), MaterialPropertyLib::SaturationDependentSwelling::checkScale(), anonymous_namespace{CreatePhase.cpp}::createPhase(), createPhases(), MaterialPropertyLib::Phase::description(), MaterialPropertyLib::Medium::phase(), and MaterialPropertyLib::VolumeFractionAverage::setProperties().

◆ updatePropertiesForAllPhases()

void MaterialPropertyLib::updatePropertiesForAllPhases ( PropertyArray & properties,
std::vector< std::unique_ptr< Phase > > const & phases )
inline

Definition at line 377 of file MaterialLib/MPL/Property.h.

380{
381 for (auto& p : properties)
382 {
383 if (p != nullptr)
384 {
385 p->setProperties(phases);
386 }
387 }
388}

Referenced by MaterialPropertyLib::Medium::Medium().

◆ voidFractionClosureDiagnostics()

std::string MaterialPropertyLib::voidFractionClosureDiagnostics ( DriftFluxState const & state)

State of the drift-flux closure and its residuals at the ends of the admissible interval \([0, x / S]\), formatted for the message of an assembly aborted because computeVapourVoidFraction() found no admissible void fraction. The residuals are reported for the closure and the interval that computeVapourVoidFraction() actually solves on, that is with the drift aligned with the mixture flow and up to \(x / S\) rather than one.

The caller prepends its own context, the process or boundary condition, the element, and the primary variables it has at hand.

Parameters
statethe state of the closure, reported with its residuals.

Definition at line 69 of file DriftFluxModel.cpp.

70{
71 DriftFluxState const aligned = alignDriftWithFlow(state);
72
73 // computeVapourVoidFraction() accepts a root only from [0, alpha_max], so
74 // the sign change has to be reported over that interval. Over [0, 1] it
75 // says nothing: the second root of the closure is always larger than one,
76 // and the residual changes sign between alpha_max and one whenever the
77 // admissible interval holds no root at all.
78 double const alpha_max =
79 std::min(1., aligned.dryness / closureSlipParameter(aligned));
80
81 return fmt::format(
82 "dryness {:g}, liquid density {:g} kg/m^3, vapour density {:g} kg/m^3, "
83 "profile parameter {:g}, aligned drift flux velocity {:g} m/s. The "
84 "closure residual is {:g} at a void fraction of zero and {:g} at the "
85 "upper bound {:g} of the admissible interval; a root exists in between "
86 "only if the two have opposite signs.",
87 aligned.dryness, aligned.liquid_water_density,
88 aligned.vapour_water_density, aligned.C_0, aligned.u_gu,
89 voidFractionResidual(0., aligned),
90 voidFractionResidual(alpha_max, aligned), alpha_max);
91}
double voidFractionResidual(double const alpha, DriftFluxState const &state)
double dryness
The vapour mass fraction, dimensionless.

References alignDriftWithFlow(), MaterialPropertyLib::DriftFluxState::C_0, closureSlipParameter(), MaterialPropertyLib::DriftFluxState::dryness, MaterialPropertyLib::DriftFluxState::liquid_water_density, MaterialPropertyLib::DriftFluxState::u_gu, MaterialPropertyLib::DriftFluxState::vapour_water_density, and voidFractionResidual().

Referenced by ProcessLib::WellboreCompensateNeumannBoundaryConditionLocalAssembler< ShapeFunction, GlobalDim >::assemble(), and ProcessLib::WellboreSimulator::WellboreSimulatorFEM< ShapeFunction, GlobalDim >::assemble().

◆ voidFractionQuadratic()

VoidFractionQuadratic MaterialPropertyLib::voidFractionQuadratic ( DriftFluxState const & state)

Coefficients of the drift-flux closure written as a quadratic equation in the void fraction, see computeVapourVoidFraction().

Parameters
statethe state of the closure.
Returns
The coefficients, each in kg/(m^2 s).

Definition at line 45 of file DriftFluxModel.cpp.

46{
47 double const S = closureSlipParameter(state);
48 double const delta =
49 state.vapour_water_density - state.liquid_water_density;
50
51 return {
52 -S * delta * state.v_mix,
53 state.v_mix * (state.dryness * delta - S * state.liquid_water_density) -
54 state.vapour_water_density * state.u_gu,
55 state.dryness * state.v_mix * state.liquid_water_density};
56}

References closureSlipParameter(), MaterialPropertyLib::DriftFluxState::dryness, MaterialPropertyLib::DriftFluxState::liquid_water_density, MaterialPropertyLib::DriftFluxState::u_gu, MaterialPropertyLib::DriftFluxState::v_mix, and MaterialPropertyLib::DriftFluxState::vapour_water_density.

Referenced by computeVapourVoidFraction().

◆ voidFractionResidual()

double MaterialPropertyLib::voidFractionResidual ( double const alpha,
DriftFluxState const & state )

Residual of the drift-flux closure. Kept for testing and for the residuals reported with a non-solvable state; the void fraction itself is computed in closed form.

Parameters
alphathe vapour void fraction, dimensionless.
statethe state of the closure.
Returns
The residual in kg^2/(m^5 s), the mass flux of the closure times the liquid density it is written with.

Definition at line 58 of file DriftFluxModel.cpp.

59{
60 double const rho_mix = alpha * state.vapour_water_density +
61 (1 - alpha) * state.liquid_water_density;
62 double const S = closureSlipParameter(state);
63
64 return state.liquid_water_density *
65 (rho_mix * state.v_mix * (state.dryness - alpha * S) -
66 alpha * state.vapour_water_density * state.u_gu);
67}

References alpha, closureSlipParameter(), MaterialPropertyLib::DriftFluxState::dryness, MaterialPropertyLib::DriftFluxState::liquid_water_density, MaterialPropertyLib::DriftFluxState::u_gu, MaterialPropertyLib::DriftFluxState::v_mix, and MaterialPropertyLib::DriftFluxState::vapour_water_density.

Referenced by voidFractionClosureDiagnostics().

Variable Documentation

◆ alpha

◆ beta

◆ c

◆ Delta

◆ EmptyVariableArray

◆ error_info

const char MaterialPropertyLib::error_info[]
staticconstexpr
Initial value:
=
"The conversion to a Kelvin vector of correct dimensionality is ambiguous."
"Please use a scalar number for isotropic properties, a three element "
"array or a 3 x 3 matrix for anisotropic properties."

Definition at line 10 of file FormKelvinVector.cpp.

Referenced by MaterialPropertyLib::FormKelvinVector< GlobalDim >::operator()(), MaterialPropertyLib::FormKelvinVector< GlobalDim >::operator()(), MaterialPropertyLib::FormKelvinVector< GlobalDim >::operator()(), MaterialPropertyLib::FormKelvinVector< GlobalDim >::operator()(), and MaterialPropertyLib::FormKelvinVector< GlobalDim >::operator()().

◆ gibbs_free_energy_

◆ Hi

const double MaterialPropertyLib::Hi[4] = {1.67752, 2.20462, 0.6366564, -0.241605}
static

Definition at line 13 of file WaterViscosityIAPWS.cpp.

13{1.67752, 2.20462, 0.6366564, -0.241605};

Referenced by computeBarMu0Factor(), and computedBarMu_dbarT().

◆ Hij

const double MaterialPropertyLib::Hij[6][7]
static
Initial value:
= {
{0.520094, 0.222531, -0.281378, 0.161913, -0.0325372, 0, 0},
{0.0850895, 0.999115, -0.906851, 0.257399, 0, 0, 0},
{-1.08374, 1.88797, -0.772479, 0, 0, 0, 0},
{-0.289555, 1.26613, -0.489837, 0, 0.0698452, 0, -0.00435673},
{0, 0, -0.25704, 0, 0, 0.00872102, 0},
{0, 0.120573, 0, 0, 0, 0, -0.000593264}}

Definition at line 14 of file WaterViscosityIAPWS.cpp.

14 {
15 {0.520094, 0.222531, -0.281378, 0.161913, -0.0325372, 0, 0},
16 {0.0850895, 0.999115, -0.906851, 0.257399, 0, 0, 0},
17 {-1.08374, 1.88797, -0.772479, 0, 0, 0, 0},
18 {-0.289555, 1.26613, -0.489837, 0, 0.0698452, 0, -0.00435673},
19 {0, 0, -0.25704, 0, 0, 0.00872102, 0},
20 {0, 0.120573, 0, 0, 0, 0, -0.000593264}};

Referenced by computeBarMu1Factor(), computedBarMu_dbarRho(), and computedBarMu_dbarT().

◆ I_T

std::array MaterialPropertyLib::I_T
staticconstexpr
Initial value:
= {0, 0, 0, 0, 0, 0, 1, 1, 1, 1,
1, 1, 1, 2, 2, 3, 3, 4, 5, 6}

Definition at line 21 of file WaterTemperatureIAPWSIF97Region1.cpp.

21 {0, 0, 0, 0, 0, 0, 1, 1, 1, 1,
22 1, 1, 1, 2, 2, 3, 3, 4, 5, 6};

Referenced by computeTemperature().

◆ J_T

std::array MaterialPropertyLib::J_T
staticconstexpr
Initial value:
= {0, 1, 2, 6, 22, 32, 0, 1, 2, 3,
4, 10, 32, 10, 32, 10, 32, 32, 32, 32}

Definition at line 24 of file WaterTemperatureIAPWSIF97Region1.cpp.

24 {0, 1, 2, 6, 22, 32, 0, 1, 2, 3,
25 4, 10, 32, 10, 32, 10, 32, 32, 32, 32};

Referenced by computeTemperature().

◆ Li

const double MaterialPropertyLib::Li[5]
static
Initial value:
= {2.443221e-3, 1.323095e-2, 6.770357e-3,
-3.454586e-3, 4.096266e-4}

Definition at line 14 of file WaterThermalConductivityIAPWS.cpp.

14 {2.443221e-3, 1.323095e-2, 6.770357e-3,
15 -3.454586e-3, 4.096266e-4};

Referenced by computeBarLambda0Factor(), and computedBarLambda_dbarT().

◆ Lij

const double MaterialPropertyLib::Lij[5][6]
static
Initial value:
= {
{1.60397357, -0.646013523, 0.111443906, 0.102997357, -0.0504123634,
0.00609859258},
{2.33771842, -2.78843778, 1.53616167, -0.463045512, 0.0832827019,
-0.00719201245},
{2.19650529, -4.54580785, 3.55777244, -1.40944978, 0.275418278,
-0.0205938816},
{-1.21051378, 1.60812989, -0.621178141, 0.0716373224, 0, 0},
{-2.7203370, 4.57586331, -3.18369245, 1.1168348, -0.19268305, 0.012913842}}

Definition at line 16 of file WaterThermalConductivityIAPWS.cpp.

16 {
17 {1.60397357, -0.646013523, 0.111443906, 0.102997357, -0.0504123634,
18 0.00609859258},
19 {2.33771842, -2.78843778, 1.53616167, -0.463045512, 0.0832827019,
20 -0.00719201245},
21 {2.19650529, -4.54580785, 3.55777244, -1.40944978, 0.275418278,
22 -0.0205938816},
23 {-1.21051378, 1.60812989, -0.621178141, 0.0716373224, 0, 0},
24 {-2.7203370, 4.57586331, -3.18369245, 1.1168348, -0.19268305, 0.012913842}};

Referenced by computeBarLambda1Factor(), computedBarLambda_dbarRho(), and computedBarLambda_dbarT().

◆ max_exp_argument

double MaterialPropertyLib::max_exp_argument
staticconstexpr
Initial value:
=
std::numeric_limits<double>::max_exponent * std::numbers::ln2

Definition at line 17 of file Sigmoid.cpp.

Referenced by MaterialPropertyLib::Sigmoid::value().

◆ n_T

std::array MaterialPropertyLib::n_T
staticconstexpr
Initial value:
= {
-0.23872489924521e3, 0.40421188637945e3, 0.11349746881718e3,
-0.58457616048039e1, -0.15285482413140e-3, -0.10866707695377e-5,
-0.13391744872602e2, 0.43211039183559e2, -0.54010067170506e2,
0.30535892203916e2, -0.65964749423638e1, 0.93965400878363e-2,
0.11573647505340e-6, -0.25858641282073e-4, -0.40644363084799e-8,
0.66456186191635e-7, 0.80670734103027e-10, -0.93477771213947e-12,
0.58265442020601e-14, -0.15020185953503e-16}

Definition at line 12 of file WaterTemperatureIAPWSIF97Region1.cpp.

12 {
13 -0.23872489924521e3, 0.40421188637945e3, 0.11349746881718e3,
14 -0.58457616048039e1, -0.15285482413140e-3, -0.10866707695377e-5,
15 -0.13391744872602e2, 0.43211039183559e2, -0.54010067170506e2,
16 0.30535892203916e2, -0.65964749423638e1, 0.93965400878363e-2,
17 0.11573647505340e-6, -0.25858641282073e-4, -0.40644363084799e-8,
18 0.66456186191635e-7, 0.80670734103027e-10, -0.93477771213947e-12,
19 0.58265442020601e-14, -0.15020185953503e-16};

Referenced by computeTemperature().

◆ property_enum_to_string

const std::array<std::string, PropertyType::number_of_properties> MaterialPropertyLib::property_enum_to_string
static

Definition at line 120 of file PropertyType.h.

120 {{"acentric_factor",
121 "binary_interaction_coefficient",
122 "biot_coefficient",
123 "bishops_effective_stress",
124 "brooks_corey_exponent",
125 "bulk_modulus",
126 "capillary_pressure",
127 "compressibility",
128 "concentration",
129 "critical_density",
130 "critical_pressure",
131 "critical_temperature",
132 "decay_rate",
133 "density",
134 "diffusion",
135 "drhodT",
136 "effective_stress",
137 "enthalpy",
138 "entry_pressure",
139 "evaporation_enthalpy",
140 "fredlund_parameters",
141 "frozen_liquid_saturation",
142 "heat_capacity",
143 "henry_coefficient",
144 "longitudinal_dispersivity",
145 "molality",
146 "molar_mass",
147 "molar_volume",
148 "mole_fraction",
149 "molecular_diffusion",
150 "name",
151 "permeability",
152 "phase_change_expansivity",
153 "phase_velocity",
154 "poissons_ratio",
155 "pore_diffusion",
156 "porosity",
157 "reference_density",
158 "reference_pressure",
159 "reference_temperature",
160 "relative_permeability",
161 "relative_permeability_nonwetting_phase",
162 "residual_gas_saturation",
163 "residual_liquid_saturation",
164 "retardation_factor",
165 "saturation",
166 "saturation_density",
167 "saturation_enthalpy",
168 "saturation_micro",
169 "saturation_temperature",
170 "specific_heat_capacity",
171 "specific_latent_heat",
172 "storage",
173 "storage_contribution",
174 "swelling_stress_rate",
175 "temperature",
176 "thermal_conductivity",
177 "thermal_diffusion_enhancement_factor",
178 "thermal_expansivity",
179 "thermal_expansivity_contribution",
180 "thermal_longitudinal_dispersivity",
181 "thermal_osmosis_coefficient",
182 "thermal_osmosis_permeability",
183 "thermal_transversal_dispersivity",
184 "tortuosity",
185 "transport_porosity",
186 "transversal_dispersivity",
187 "vapour_pressure",
188 "viscosity",
189 "volume_fraction",
190 "youngs_modulus"}};

Referenced by checkRequiredProperties(), checkRequiredProperties(), checkRequiredProperties(), ProcessLib::checkThermoOsmosisProperties(), convertStringToProperty(), anonymous_namespace{PhaseTransition.cpp}::findComponentIndex(), MaterialPropertyLib::Component::property(), MaterialPropertyLib::Medium::property(), MaterialPropertyLib::Phase::property(), and MaterialPropertyLib::VolumeFractionAverage::setProperties().

◆ ref_p_

◆ ref_T_

◆ symmetric_tensor_size

template<int GlobalDim>
int MaterialPropertyLib::symmetric_tensor_size
constexpr
Initial value:

Definition at line 14 of file GetSymmetricTensor.h.

◆ T_c

double MaterialPropertyLib::T_c
constexpr

◆ unused_dt

double MaterialPropertyLib::unused_dt = std::numeric_limits<double>::quiet_NaN()
staticconstexpr

◆ variable_enum_to_string

const std::array<std::string, static_cast<int>(Variable::number_of_variables)> MaterialPropertyLib::variable_enum_to_string
static
Initial value:
{{"capillary_pressure",
"concentration",
"deformation_gradient",
"density",
"effective_pore_pressure",
"enthalpy",
"enthalpy_of_evaporation",
"equivalent_plastic_strain",
"fracture_aperture",
"frozen_liquid_saturation",
"grain_compressibility",
"liquid_phase_pressure",
"liquid_saturation",
"mechanical_strain",
"molar_mass",
"molar_mass_derivative",
"molar_fraction",
"gas_phase_pressure",
"porosity",
"solid_grain_pressure",
"stress",
"temperature",
"total_strain",
"total_stress",
"transport_porosity",
"vapour_pressure",
"volumetric_mechanical_strain",
"volumetric_strain"}}

Definition at line 55 of file VariableType.h.

55 {{"capillary_pressure",
56 "concentration",
57 "deformation_gradient",
58 "density",
59 "effective_pore_pressure",
60 "enthalpy",
61 "enthalpy_of_evaporation",
62 "equivalent_plastic_strain",
63 "fracture_aperture",
64 "frozen_liquid_saturation",
65 "grain_compressibility",
66 "liquid_phase_pressure",
67 "liquid_saturation",
68 "mechanical_strain",
69 "molar_mass",
70 "molar_mass_derivative",
71 "molar_fraction",
72 "gas_phase_pressure",
73 "porosity",
74 "solid_grain_pressure",
75 "stress",
76 "temperature",
77 "total_strain",
78 "total_stress",
79 "transport_porosity",
80 "vapour_pressure",
81 "volumetric_mechanical_strain",
82 "volumetric_strain"}};

Referenced by MaterialPropertyLib::ScalarCopyOp::apply(), convertStringToVariable(), MaterialPropertyLib::Function::d2Value(), MaterialPropertyLib::Function::dValue(), and MaterialPropertyLib::PerThreadData::updateNonScalarVariables().