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.
- normal_thermal_conductivity()[source]
Normal thermal conductivity [W/m/K].
Resides in fluid, not solid, because of the assumption of open fractures.
- 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
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
- 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].