porepy.models.material_constants module

Storage classes for material constants.

Materials are storage classes for values of physical properties. They are typically used when composing constitutive laws. A material is instantiated with a Units object, which defines the units of the physical properties. The material can then be used to convert from units set by the user (standard SI units) to those specified by the Units object, which are the ones used internally in the simulation. The conversion hopefully reduces problems with scaling/rounding errors and condition numbers.

class FluidConstants(constants=None)[source]

Bases: MaterialConstants

Class giving scaled values of fluid parameters.

Each constant (class attribute) typically corresponds to exactly one method which scales the value and broadcasts to relevant size, typically number of cells in the specified subdomains or interfaces.

Note

Return types are discussed in fluid_density and fluid_thermal_expansion.

Prefix fluid must be included if we decide for inheritance and not composition for the material classes.

Parameters

constants (dict) –

Dictionary of constants. Only keys corresponding to a constant in the class will be used. The permissible keys are:

  • thermal_expansion: Thermal expansion coefficient [1/K].

  • density: Density [kg/m^3].

  • viscosity: Viscosity [Pa s].

  • compressibility: Compressibility [1/Pa].

If not specified, default values are used.

compressibility()[source]

Compressibility [1/Pa].

Returns

Compressibility array in converted pressure units.

Return type

Union[float, int]

density()[source]

Density [kg/m^3].

Returns

Density in converted mass and length units.

Return type

Union[float, int]

normal_thermal_conductivity()[source]

Normal thermal conductivity [W/m/K].

Resides in fluid, not solid, because of the assumption of open fractures.

Returns

Normal thermal conductivity in converted energy, length and temperature units.

Return type

Union[float, int]

pressure()[source]

Pressure [Pa].

Intended usage: Reference pressure.

Returns

Pressure in converted pressure units.

Return type

Union[float, int]

specific_heat_capacity()[source]

Specific heat [J/kg/K].

Returns

Specific heat in converted mass, temperature and time units.

Return type

Union[float, int]

temperature()[source]

Temperature [K].

Intended usage: Reference temperature.

Returns

Temperature in converted temperature units.

Return type

Union[float, int]

thermal_conductivity()[source]

Thermal conductivity [W/m/K].

Returns

Thermal conductivity in converted mass, length and temperature units.

Return type

Union[float, int]

thermal_expansion()[source]

Thermal expansion coefficient [1/K].

Returns

Thermal expansion coefficient in converted temperature units.

Return type

Union[float, int]

viscosity()[source]

Viscosity [Pa s].

Returns

Viscosity array in converted pressure and time units.

Return type

Union[float, int]

class MaterialConstants(constants)[source]

Bases: object

Material property container and conversion class.

Modifications to parameter values should be done by subclassing. To set a different constant value, simply define a new class attribute with the same name. If a different value is needed for a specific subdomain or there is spatial heterogeneity internal to a subdomain, the method should be overridden. The latter is assumed to be most relevant for solids.

Parameters

constants (dict) –

convert_units(value, units, to_si=False)[source]

Convert value between SI and user specified units.

The method divides the value by the units as defined by the user. As an example, if the user has defined the unit for pressure to be 1 MPa, then a value of 1e8 will be converted to 1e8 / 1e6 = 1e2. Conversely, if to_si is True, the value will be converted to SI units, i.e. a value of 1e-2 results in 1e-2 * 1e6 = 1e4.

Parameters
  • value (Union[float, int]) – Value to be converted.

  • units (str) – Units of value defined as a string in the form of unit1 * unit2 * unit3^-1, e.g., "Pa*m^3/kg". Valid units are the attributes and properties of the Units class. Valid operators are * and ^, including negative powers (e.g. m^-2). A dimensionless value can be specified by setting units to “”, “1” or “-“.

  • to_si (Optional[bool]) – If True, the value is converted to SI units. If False, the value is converted to the units specified by the user, which are the ones used in the

Returns

Value in the user specified units to be used in the simulation.

Return type

Union[float, int]

set_units(units)[source]

Set units of the material.

Parameters

units (Units) – Units object.

Return type

None

property constants: dict

Constants of the material.

Returns

Dictionary of constants.

property units: Units

Units of the material.

Returns

Units object.

class SolidConstants(constants=None)[source]

Bases: MaterialConstants

Solid material with unit values.

Each constant (class attribute) typically corresponds to exactly one method which scales the value and broadcasts to relevant size, typically number of cells in the specified subdomains or interfaces.

Parameters

constants (dict) –

Dictionary of constants. Only keys corresponding to a constant in the class will be used. The permissible keys are:

  • thermal_expansion: Thermal expansion coefficient [1/K].

  • density: Density [kg/m^3].

  • porosity: Porosity [-].

  • permeability: Permeability [m^2].

  • normal_permeability: Normal permeability [m^2].

  • lame_lambda: Lame parameter lambda [Pa].

  • shear_modulus: Shear modulus [Pa].

  • friction_coefficient: Friction coefficient [-].

  • fracture_gap: Fracture gap [m].

  • dilation_angle: Dilation angle [radians].

biot_coefficient()[source]

Biot coefficient [-].

Returns

Biot coefficient.

Return type

Union[float, int]

density()[source]

Density [kg/m^3].

Returns

Density in converted mass and length units.

Return type

Union[float, int]

dilation_angle()[source]

Dilation angle.

Returns

Dilation angle in converted angle units.

Return type

Union[float, int]

friction_coefficient()[source]

Friction coefficient [-].

Returns

Friction coefficient.

Return type

Union[float, int]

gap()[source]

Fracture gap [m].

Returns

Fracture gap in converted length units.

Return type

Union[float, int]

lame_lambda()[source]

Lame’s first parameter [Pa].

Returns

Lame’s first parameter in converted pressure units.

Return type

Union[float, int]

normal_permeability()[source]

Normal permeability [m^2].

Returns

Normal permeability in converted length units.

Return type

Union[float, int]

permeability()[source]

Permeability [m^2].

Returns

Permeability in converted length units.

Return type

Union[float, int]

porosity()[source]

Porosity [-].

Returns

Porosity.

Return type

Union[float, int]

residual_aperture()[source]

Residual aperture [m].

Returns

Residual aperture.

Return type

Union[float, int]

shear_modulus()[source]

Young’s modulus [Pa].

Returns

Shear modulus in converted pressure units.

Return type

Union[float, int]

specific_heat_capacity()[source]

Specific heat [energy / (mass * temperature)].

Returns

Specific heat in converted energy, mass and temperature units.

Return type

Union[float, int]

temperature()[source]

Temperature [K].

Returns

Temperature in converted temperature units.

Return type

Union[float, int]

thermal_conductivity()[source]

Thermal conductivity [W/m/K].

Returns

Thermal conductivity in converted energy, length and temperature units.

Return type

Union[float, int]

thermal_expansion()[source]

Thermal expansion coefficient [1/K].

Returns

Thermal expansion coefficient in converted temperature units.

Return type

Union[float, int]