The material submodule

This module defines the Material class and related constants used by components that need wall/pipe material properties.

Overview

The Material object is a lightweight, unit-aware container for:

  • density rho

  • thermal conductivity k

  • absolute roughness e

  • reference temperature T

By default, values are initialized from module constants and converted to the internal unit system.

Public constants

The submodule exposes several constants:

  • CTE_G: gravitational acceleration

  • CTE_NT: normal/reference temperature

  • CTE_RHO: default density

  • CTE_K: default thermal conductivity

  • CTE_E_RVS: default absolute roughness (stainless steel)

It also exports:

  • u: shared unit registry

  • Quantity: quantity type alias

Usage examples

Create a material with defaults:

import fluidsolve as fls

mat = fls.Material()
print(mat)

Create a custom material with explicit values:

import fluidsolve as fls

mat = fls.Material(
    mat='steel',
    name='Steel',
    T=30 * fls.u.degC,
    rho=800 * fls.u.kg / fls.u.m**3,
    k=2 * fls.u.W / fls.u.m / fls.u.degK,
    e=5 * fls.u.um,
)

Notes

  • T is stored internally in Kelvin and exposed as degrees Celsius via the T property.

  • Setters convert incoming numeric values to default units.

  • _updateProduct() is currently a safe no-op placeholder for future material-library integration.

Material property definitions used by hydraulic components.

This module provides a lightweight Material model with the constants needed for component calculations (for example density, thermal conductivity, and surface roughness). It is designed to supply practical engineering defaults while still allowing user overrides.

Main features:

  • predefined defaults for common conditions,

  • unit-aware material properties using the shared unit registry,

  • simple initialization from a material key/name,

  • explicit override of key properties for custom materials.

Typical use cases:

  • define pipe/wall roughness assumptions,

  • set density values for pressure/head related conversions,

  • pass consistent material settings through factory-created components.

Typical usage:

mat = Material(mat='rvs')
custom = Material(name='custom_steel', rho=7800 * u.kg / u.m**3, e=5 * u.um)

The class intentionally keeps the data model compact so that materials remain easy to construct, inspect, and serialize as part of larger hydraulic models.

fluidsolve.material.CTE_G = <Quantity(9.80665, 'meter / second ** 2')>

normal temperature

fluidsolve.material.CTE_NT = <Quantity(20.0, 'degree_Celsius')>

density of water

fluidsolve.material.CTE_RHO = <Quantity(1.0, 'kilogram / meter ** 3')>

thermal conductivity of water

fluidsolve.material.CTE_K = <Quantity(1.0, 'watt / meter / kelvin')>

absolute roughness (epsilon) of stainless steel

class fluidsolve.material.Material(**kwargs: int)[source]

Bases: object

Class representing a material.

Can be created just using a known name. Can also get an arbitrary name. In that case, the user has to provide the constants (rho, mu, …)

Parameters:
  • mat (str, optional) – The material (in the database) name. Defaults to ‘rvs’.

  • name (str, optional) – Material name. Defaults to self._mat.

  • T (int | float | Quantity, optional) – The temperature. Defaults to 20°C.

  • rho (int | float | Quantity, optional) – The density. Defaults to water (at temperature).

  • k (int | float | Quantity, optional) – The thermal conductivity. Defaults to water (at temperature).

  • e (int | float | Quantity, optional) – The absolute roughness. Defaults to rvs.

Returns:

None

__init__(**kwargs: int) None[source]
property name: str

Name property.

Returns:

Name property.

Return type:

str

property cmat: str

underlying material object.

Returns:

cmat property.

Return type:

Any

property T: Quantity

Temperature property.

Returns:

Temperature in °C (internally stored in K).

Return type:

Quantity

property rho: Quantity

Density property.

Returns:

Density (in kg/m3) property.

Return type:

Quantity

property k: Quantity

Thermal conductivity property.

Returns:

Thermal conductivity (in W/m/K) property.

Return type:

Quantity

property e: Quantity

Absolute roughness (epsilon) property.

Returns:

absolute roughness (epsilon) (in um) property.

Return type:

Quantity

_updateProduct() Any[source]

Update the properties from the material library.

__str__() str[source]

String representation

Returns:

String representation

Return type:

str

toString(detail: int = 0) str[source]

String representation. Can be in more or less detail.

Parameters:

detail (int, optional) – The details to be returned. Defaults to 0.

Returns:

String representation

Return type:

str

__repr__() str[source]

Representation of the material object

Returns:

representation

Return type:

str