Skip to content

Commit

Permalink
Merge 5d8e2b5 into b77e844
Browse files Browse the repository at this point in the history
  • Loading branch information
fwitte committed Apr 30, 2024
2 parents b77e844 + 5d8e2b5 commit 59a2525
Show file tree
Hide file tree
Showing 30 changed files with 102 additions and 91 deletions.
4 changes: 2 additions & 2 deletions src/tespy/components/basics/cycle_closer.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@
import numpy as np

from tespy.components.component import Component
from tespy.components.component import component_registry
from tespy.tools.data_containers import ComponentProperties as dc_cp

# %%


@component_registry
class CycleCloser(Component):
r"""
Component for closing cycles.
Expand Down
2 changes: 2 additions & 0 deletions src/tespy/components/basics/sink.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,10 @@
import numpy as np

from tespy.components.component import Component
from tespy.components.component import component_registry


@component_registry
class Sink(Component):
r"""
A flow drains in a Sink.
Expand Down
2 changes: 2 additions & 0 deletions src/tespy/components/basics/source.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,10 @@
import numpy as np

from tespy.components.component import Component
from tespy.components.component import component_registry


@component_registry
class Source(Component):
r"""
A flow originates from a Source.
Expand Down
2 changes: 2 additions & 0 deletions src/tespy/components/basics/subsystem_interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,11 @@
"""

from tespy.components.component import Component
from tespy.components.component import component_registry
from tespy.tools.data_containers import SimpleDataContainer as dc_simple


@component_registry
class SubsystemInterface(Component):
r"""
The subsystem interface does not change fluid properties.
Expand Down
2 changes: 2 additions & 0 deletions src/tespy/components/combustion/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
import numpy as np

from tespy.components.component import Component
from tespy.components.component import component_registry
from tespy.tools import logger
from tespy.tools.data_containers import ComponentProperties as dc_cp
from tespy.tools.document_models import generate_latex_eq
Expand All @@ -27,6 +28,7 @@
from tespy.tools.helpers import fluidalias_in_list


@component_registry
class CombustionChamber(Component):
r"""
The class CombustionChamber is parent class of all combustion components.
Expand Down
2 changes: 2 additions & 0 deletions src/tespy/components/combustion/diabatic.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,14 @@
import numpy as np

from tespy.components import CombustionChamber
from tespy.components.component import component_registry
from tespy.tools import logger
from tespy.tools.data_containers import ComponentProperties as dc_cp
from tespy.tools.document_models import generate_latex_eq
from tespy.tools.fluid_properties import h_mix_pT


@component_registry
class DiabaticCombustionChamber(CombustionChamber):
r"""
The class CombustionChamber is parent class of all combustion components.
Expand Down
4 changes: 3 additions & 1 deletion src/tespy/components/combustion/engine.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,21 @@
SPDX-License-Identifier: MIT
"""

import numpy as np

from tespy.components.combustion.base import CombustionChamber
from tespy.components.component import component_registry
from tespy.tools import logger
from tespy.tools.data_containers import ComponentCharacteristics as dc_cc
from tespy.tools.data_containers import ComponentProperties as dc_cp
from tespy.tools.data_containers import SimpleDataContainer as dc_simple
from tespy.tools.document_models import generate_latex_eq
from tespy.tools.fluid_properties import h_mix_pT
from tespy.tools.fluid_properties import s_mix_ph
from tespy.tools.fluid_properties import s_mix_pT


@component_registry
class CombustionEngine(CombustionChamber):
r"""
An internal combustion engine supplies power and heat cogeneration.
Expand Down
9 changes: 9 additions & 0 deletions src/tespy/components/component.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,15 @@
from tespy.tools.helpers import newton_with_kwargs


def component_registry(type):
component_registry.items[type.__name__] = type
return type


component_registry.items = {}


@component_registry
class Component:
r"""
Class Component is the base class of all TESPy components.
Expand Down
2 changes: 2 additions & 0 deletions src/tespy/components/heat_exchangers/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
import numpy as np

from tespy.components.component import Component
from tespy.components.component import component_registry
from tespy.tools.data_containers import ComponentCharacteristics as dc_cc
from tespy.tools.data_containers import ComponentProperties as dc_cp
from tespy.tools.data_containers import GroupedComponentCharacteristics as dc_gcc
Expand All @@ -21,6 +22,7 @@
from tespy.tools.fluid_properties import s_mix_ph


@component_registry
class HeatExchanger(Component):
r"""
Class for counter current heat exchanger.
Expand Down
2 changes: 2 additions & 0 deletions src/tespy/components/heat_exchangers/condenser.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@

import numpy as np

from tespy.components.component import component_registry
from tespy.components.heat_exchangers.base import HeatExchanger
from tespy.tools.data_containers import ComponentCharacteristics as dc_cc
from tespy.tools.data_containers import ComponentProperties as dc_cp
Expand All @@ -23,6 +24,7 @@
from tespy.tools.fluid_properties import h_mix_pQ


@component_registry
class Condenser(HeatExchanger):
r"""
A Condenser cools a fluid until it is in liquid state.
Expand Down
2 changes: 2 additions & 0 deletions src/tespy/components/heat_exchangers/desuperheater.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,14 @@
SPDX-License-Identifier: MIT
"""

from tespy.components.component import component_registry
from tespy.components.heat_exchangers.base import HeatExchanger
from tespy.tools.document_models import generate_latex_eq
from tespy.tools.fluid_properties import dh_mix_dpQ
from tespy.tools.fluid_properties import h_mix_pQ


@component_registry
class Desuperheater(HeatExchanger):
r"""
The Desuperheater cools a fluid to the saturated gas state.
Expand Down
5 changes: 2 additions & 3 deletions src/tespy/components/heat_exchangers/parabolic_trough.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,14 @@
SPDX-License-Identifier: MIT
"""

import numpy as np

from tespy.components.component import component_registry
from tespy.components.heat_exchangers.simple import SimpleHeatExchanger
from tespy.tools.data_containers import ComponentProperties as dc_cp
from tespy.tools.data_containers import GroupedComponentProperties as dc_gcp
from tespy.tools.data_containers import SimpleDataContainer as dc_simple
from tespy.tools.document_models import generate_latex_eq


@component_registry
class ParabolicTrough(SimpleHeatExchanger):
r"""
The ParabolicTrough calculates heat output from irradiance.
Expand Down
2 changes: 2 additions & 0 deletions src/tespy/components/heat_exchangers/simple.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
import numpy as np

from tespy.components.component import Component
from tespy.components.component import component_registry
from tespy.tools import logger
from tespy.tools.data_containers import ComponentCharacteristics as dc_cc
from tespy.tools.data_containers import ComponentProperties as dc_cp
Expand All @@ -27,6 +28,7 @@
from tespy.tools.helpers import convert_to_SI


@component_registry
class SimpleHeatExchanger(Component):
r"""
A basic heat exchanger representing a heat source or heat sink.
Expand Down
5 changes: 2 additions & 3 deletions src/tespy/components/heat_exchangers/solar_collector.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,14 @@
SPDX-License-Identifier: MIT
"""

import numpy as np

from tespy.components.component import component_registry
from tespy.components.heat_exchangers.simple import SimpleHeatExchanger
from tespy.tools.data_containers import ComponentProperties as dc_cp
from tespy.tools.data_containers import GroupedComponentProperties as dc_gcp
from tespy.tools.data_containers import SimpleDataContainer as dc_simple
from tespy.tools.document_models import generate_latex_eq


@component_registry
class SolarCollector(SimpleHeatExchanger):
r"""
The solar collector calculates heat output from irradiance.
Expand Down
4 changes: 2 additions & 2 deletions src/tespy/components/nodes/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@
SPDX-License-Identifier: MIT
"""

import numpy as np

from tespy.components.component import Component
from tespy.components.component import component_registry
from tespy.tools.document_models import generate_latex_eq


@component_registry
class NodeBase(Component):
"""Class NodeBase is parent class for all components of submodule nodes."""

Expand Down
3 changes: 3 additions & 0 deletions src/tespy/components/nodes/droplet_separator.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,15 @@
SPDX-License-Identifier: MIT
"""

from tespy.components.component import component_registry
from tespy.components.nodes.base import NodeBase
from tespy.tools.document_models import generate_latex_eq
from tespy.tools.fluid_properties import dh_mix_dpQ
from tespy.tools.fluid_properties import h_mix_pQ


@component_registry
class DropletSeparator(NodeBase):
r"""
Separate liquid phase from gas phase of a single fluid.
Expand Down
2 changes: 2 additions & 0 deletions src/tespy/components/nodes/drum.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,12 @@

import numpy as np

from tespy.components.component import component_registry
from tespy.components.nodes.droplet_separator import DropletSeparator
from tespy.tools.fluid_properties import h_mix_pQ


@component_registry
class Drum(DropletSeparator):
r"""
A drum separates saturated gas from saturated liquid.
Expand Down
2 changes: 2 additions & 0 deletions src/tespy/components/nodes/merge.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,14 @@

import numpy as np

from tespy.components.component import component_registry
from tespy.components.nodes.base import NodeBase
from tespy.tools.data_containers import SimpleDataContainer as dc_simple
from tespy.tools.document_models import generate_latex_eq
from tespy.tools.fluid_properties import s_mix_pT


@component_registry
class Merge(NodeBase):
r"""
Class for merge points with multiple inflows and one outflow.
Expand Down
4 changes: 2 additions & 2 deletions src/tespy/components/nodes/separator.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@
SPDX-License-Identifier: MIT
"""

import numpy as np

from tespy.components.component import component_registry
from tespy.components.nodes.base import NodeBase
from tespy.tools.data_containers import SimpleDataContainer as dc_simple
from tespy.tools.document_models import generate_latex_eq
Expand All @@ -21,6 +20,7 @@
# from tespy.tools.fluid_properties import dT_mix_ph_dfluid


@component_registry
class Separator(NodeBase):
r"""
A separator separates fluid components from a mass flow.
Expand Down
4 changes: 2 additions & 2 deletions src/tespy/components/nodes/splitter.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@
SPDX-License-Identifier: MIT
"""

import numpy as np

from tespy.components.component import component_registry
from tespy.components.nodes.base import NodeBase
from tespy.tools.data_containers import SimpleDataContainer as dc_simple
from tespy.tools.document_models import generate_latex_eq


@component_registry
class Splitter(NodeBase):
r"""
Split up a mass flow in parts of identical enthalpy and fluid composition.
Expand Down
2 changes: 2 additions & 0 deletions src/tespy/components/piping/pipe.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,11 @@
SPDX-License-Identifier: MIT
"""

from tespy.components.component import component_registry
from tespy.components.heat_exchangers.simple import SimpleHeatExchanger


@component_registry
class Pipe(SimpleHeatExchanger):
r"""
The Pipe is a subclass of a SimpleHeatExchanger.
Expand Down
2 changes: 2 additions & 0 deletions src/tespy/components/piping/valve.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,14 @@
import numpy as np

from tespy.components.component import Component
from tespy.components.component import component_registry
from tespy.tools import logger
from tespy.tools.data_containers import ComponentCharacteristics as dc_cc
from tespy.tools.data_containers import ComponentProperties as dc_cp
from tespy.tools.document_models import generate_latex_eq


@component_registry
class Valve(Component):
r"""
The Valve throttles a fluid without changing enthalpy.
Expand Down
3 changes: 2 additions & 1 deletion src/tespy/components/reactors/fuel_cell.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,16 @@
SPDX-License-Identifier: MIT
"""
import numpy as np

from tespy.components.component import Component
from tespy.components.component import component_registry
from tespy.tools import logger
from tespy.tools.data_containers import ComponentProperties as dc_cp
from tespy.tools.document_models import generate_latex_eq
from tespy.tools.fluid_properties import h_mix_pT


@component_registry
class FuelCell(Component):
r"""
The fuel cell produces power by oxidation of hydrogen.
Expand Down
4 changes: 2 additions & 2 deletions src/tespy/components/reactors/water_electrolyzer.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,8 @@
SPDX-License-Identifier: MIT
"""

import numpy as np

from tespy.components.component import Component
from tespy.components.component import component_registry
from tespy.tools import logger
from tespy.tools.data_containers import ComponentCharacteristics as dc_cc
from tespy.tools.data_containers import ComponentProperties as dc_cp
Expand All @@ -23,6 +22,7 @@
from tespy.tools.fluid_properties import h_mix_pT


@component_registry
class WaterElectrolyzer(Component):
r"""
The water electrolyzer produces hydrogen and oxygen from water and power.
Expand Down
2 changes: 2 additions & 0 deletions src/tespy/components/turbomachinery/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,12 @@
"""

from tespy.components.component import Component
from tespy.components.component import component_registry
from tespy.tools.data_containers import ComponentProperties as dc_cp
from tespy.tools.document_models import generate_latex_eq


@component_registry
class Turbomachine(Component):
r"""
Parent class for compressor, pump and turbine.
Expand Down
Loading

0 comments on commit 59a2525

Please sign in to comment.