sunpeek.components.fluids.FluidDefinition#
- class sunpeek.components.fluids.FluidDefinition(fluid_string=None, **kwargs)#
Bases:
Base
,AttrSetterMixin
Fluid with all information to store in database.
- Variables:
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:
- 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
orWPDFluidDefinition object if a unique match for `fluid string
is found in thefluid_definitions
table`- Raises:
ValueError – If no or more than one fluid is found.