sunpeek.components.fluids.CoolPropFluidDefinition#

class sunpeek.components.fluids.CoolPropFluidDefinition(fluid_string=None, **kwargs)#

Bases: FluidDefinition

Methods

__init__([fluid_string])

A simple constructor that allows initialization from kwargs.

add_component_attr(name[, unit, minimum, ...])

all_subclasses([c])

define_component_attrs()

get_component_attribute(name)

get_default_unit(name)

Return default unit of a class attribute defined as ComponentParam.

get_definition(fluid_string, session)

Tries to find a match for fluid_string among fluids definitions.

register_callback(callback_type, func)

set_component_attribute(name, value, array_type)

classmethod get_default_unit(name)#

Return default unit of a class attribute defined as ComponentParam.

Return type:

str

classmethod get_definition(fluid_string, session)#

Tries to find a match for fluid_string among fluids definitions. Compares lower case and neglecting whitespaces. Checks against name and description.

Parameters:
  • fluid_string (str) – User-supplied string that must uniquely define a fluid within the CoolProp incompressible fluids, or predefined wpd_fluids. See `CoolProp Incompressibles`_.

  • session (sqlalchemy.orm.session.Session) – An active database session object

Return type:

A CoolpropFluidDefinition or WPDFluidDefinition object if a unique match for `fluid string is found in the fluid_definitions table`

Raises:

ValueError – If no or more than one fluid is found.