Skip to content

Commit

Permalink
Merge branch 'features/flexible-fluid-property-back-end' into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
fwitte committed Oct 11, 2023
2 parents 0b034ca + 269ea8a commit 0d8fed3
Show file tree
Hide file tree
Showing 102 changed files with 8,417 additions and 9,499 deletions.
8 changes: 0 additions & 8 deletions docs/api/components.rst
Original file line number Diff line number Diff line change
Expand Up @@ -78,14 +78,6 @@ tespy.components.combustion.engine module
:undoc-members:
:show-inheritance:

tespy.components.customs.orc_evaporator module
----------------------------------------------

.. automodule:: tespy.components.customs.orc_evaporator
:members:
:undoc-members:
:show-inheritance:

tespy.components.heat_exchangers.condenser module
-------------------------------------------------

Expand Down
30 changes: 27 additions & 3 deletions docs/api/tools.rst
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,34 @@ tespy.tools.document_models module
:undoc-members:
:show-inheritance:

tespy.tools.fluid_properties module
-----------------------------------
tespy.tools.fluid_properties.functions module
---------------------------------------------

.. automodule:: tespy.tools.fluid_properties
.. automodule:: tespy.tools.fluid_properties.functions
:members:
:undoc-members:
:show-inheritance:

tespy.tools.fluid_properties.helpers module
-------------------------------------------

.. automodule:: tespy.tools.fluid_properties.helpers
:members:
:undoc-members:
:show-inheritance:

tespy.tools.fluid_properties.mixtures module
--------------------------------------------

.. automodule:: tespy.tools.fluid_properties.mixtures
:members:
:undoc-members:
:show-inheritance:

tespy.tools.fluid_properties.wrappers module
--------------------------------------------

.. automodule:: tespy.tools.fluid_properties.wrappers
:members:
:undoc-members:
:show-inheritance:
Expand Down
5 changes: 2 additions & 3 deletions docs/basics/district_heating.rst
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,10 @@ Setting up the System
For this model we have to import the :code:`Network` and :code:`Connection`
classes as well as the respective components. After setting up the network we
can create the components, connect them to the network (as shown in the other)
examples. As a fluid, we will use the incompressibles back-end of CoolProp,
since we only need liquid water. The incompressible back-end has much higher
examples. As a fluid, we will use the incompressibles back end of CoolProp,
since we only need liquid water. The incompressible back end has much higher
access speed while preserving high accuracy.


.. tip::

For more information on the fluid properties in TESPy,
Expand Down
27 changes: 13 additions & 14 deletions docs/basics/gas_turbine.rst
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,7 @@ documentation.

In this tutorial, we will use the
:py:class:`tespy.components.combustion.diabatic.DiabaticCombustionChamber`.
First, we set up a network and the components. The network's fluid list must
contain all fluid components used for the combustion chamber. **These are at**
**least the fuel, oxygen, carbon-dioxide and water**. For this example we
add Nitrogen, since it is the most important fresh air component.
First, we set up a network and the components.

.. literalinclude:: /../tutorial/basics/gas_turbine.py
:language: python
Expand All @@ -70,8 +67,8 @@ combustion chamber is directly connected to the flue gas sink.
:start-after: [sec_2]
:end-before: [sec_3]

There are many different specifications possible. For the combustion chamber
we will specify its air to stoichiometric air ratio lamb and the thermal input
There are many specifications possible. For the combustion chamber we will
specify its air to stoichiometric air ratio lamb and the thermal input
(:math:`LHV \cdot \dot{m}_{f}`).

Furthermore, we specify the efficiency :code:`eta` of the component, which
Expand All @@ -85,9 +82,9 @@ parameter specification. In this example, we set it directly. Initially, we
assume adiabatic behavior :code:`eta=1` and no pressure losses :code:`pr=1`.

The ambient conditions as well as the fuel gas inlet temperature are defined
in the next step. The full vector for the air and the fuel gas composition
have to be defined. The component can not handle "Air" as input fluid. We can
run the code after the specifications.
in the next step. The vectors for the air and the fuel gas composition have to
be specified using the individual fluids. The component can not handle `"Air"`
as input fluid. We can run the code after the specifications.

.. literalinclude:: /../tutorial/basics/gas_turbine.py
:language: python
Expand Down Expand Up @@ -148,17 +145,19 @@ generator, assuming 98 % mechanical-electrical efficiency.
Since we deleted the connection 2 and 3, all specifications for those
connections have to be added again. The air fluid composition is specified on
connection 1 with ambient pressure and temperature. The compressor pressure
ratio is set to 15 bar, the turbine inlet temperature to 1200 °C. Finally, set
the gas turbine outlet pressure to ambient pressure as well as the
compressor's and turbine's efficiency.
ratio is set to 15 bar. Finally, set the gas turbine outlet pressure to ambient
pressure as well as the compressor's and turbine's efficiency. We start with
simulation which specifies a fixed value for the flue gas mass flow to generate
good starting values. After that, the turbine inlet temperature is set to
1200 °C.

.. literalinclude:: /../tutorial/basics/gas_turbine.py
:language: python
:start-after: [sec_9]
:end-before: [sec_10]

Note, that the pressure of the fuel is lower than the pressure of the air at
the combustion chamber as we did not change the pressure of connection 5. A
Note, that the pressure of the fuel is lower than the pressure of the air at the
combustion chamber as we did not change the pressure of connection 5. A
respective warning is printed after the calculation. We can fix it like so:

.. literalinclude:: /../tutorial/basics/gas_turbine.py
Expand Down
14 changes: 5 additions & 9 deletions docs/basics/intro.rst
Original file line number Diff line number Diff line change
Expand Up @@ -19,19 +19,15 @@ Set up a plant

In order to simulate a plant we start by creating the network
(:py:class:`tespy.networks.network.Network`). The network is the main container
for the model. You need to specify a list of the fluids you require for the
calculation in your plant. For more information on the fluid properties go to
the :ref:`corresponding section <tespy_fluid_properties_label>` in the
documentation.
for the model.

.. literalinclude:: /../tutorial/basics/heat_pump.py
:language: python
:start-after: [sec_1]
:end-before: [sec_2]

On top of that, it is possible to specify a unit system and value ranges for
the network's variables. If you do not specify these, TESPy will use SI-units.
We will thus only specify the unit systems, in this case.
It is possible to specify a unit system and value ranges for the network's
variables. If you do not specify these, TESPy will use SI-units.

.. literalinclude:: /../tutorial/basics/heat_pump.py
:language: python
Expand Down Expand Up @@ -136,7 +132,7 @@ compressor. On top of that, the heat production of the heat pump can be set
with :code:`Q` for the condenser. Since we are working in **subcritical**
regime in this tutorial, we set the state of the fluid at the evaporator's
outlet to fully saturated steam (:code:`x=1`) and at the condenser's outlet to
fully saturated liqud (:code:`x=0`). On top of that, we want to set the
fully saturated liquid (:code:`x=0`). On top of that, we want to set the
condensation and the evaporation temperature levels. Last, we have to specify
the fluid vector at one point in our network.

Expand Down Expand Up @@ -175,7 +171,7 @@ condenser including the cooling water side of the system.

In the more advanced tutorials, you will learn, how to set up more complex
plants step by step, make a design calculation of the plant as well as calculate
offdesign/partload performance.
offdesign/part load performance.

In order to get a good overview of the TESPy functionalities, the sections on
the :ref:`TESPy modules <tespy_modules_label>` will guide you in detail.
16 changes: 8 additions & 8 deletions docs/basics/rankine_cycle.rst
Original file line number Diff line number Diff line change
Expand Up @@ -161,10 +161,10 @@ can disable the printout of the convergence history.

Figure: Parametric analysis of the efficiency and power output

Partload Simulation
^^^^^^^^^^^^^^^^^^^
In the partload simulation part, we are starting with a specific design of the
plant and calculate the partload performance with some assumptions on the
Part load Simulation
^^^^^^^^^^^^^^^^^^^^
In the part load simulation part, we are starting with a specific design of the
plant and calculate the part load performance with some assumptions on the
component's individual behavior. The table below summarizes the assumptions,
which we will keep as simple as possible at this moment. For more insights
have a look at the step by step
Expand Down Expand Up @@ -239,14 +239,14 @@ Finally, we can alter the mass flow from its design value of 20 kg/s to only

.. figure:: /_static/images/basics/rankine_partload.svg
:align: center
:alt: Partload electric efficiency of the rankine cycle
:alt: Part load electric efficiency of the Rankine cycle
:figclass: only-light

Figure: Partload electric efficiency of the rankine cycle
Figure: Part load electric efficiency of the Rankine cycle

.. figure:: /_static/images/basics/rankine_partload_darkmode.svg
:align: center
:alt: Partload electric efficiency of the rankine cycle
:alt: Part load electric efficiency of the Rankine cycle
:figclass: only-dark

Figure: Partload electric efficiency of the rankine cycle
Figure: Part load electric efficiency of the Rankine cycle
2 changes: 1 addition & 1 deletion docs/benchmarks.rst
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ using a standard industry software in parallel. **The comparison showed**
**identical results**. For the other two applications we have compared the
results of the TESPy model with the data published in the respective research
paper and found very well matching results. Differences can be explained by
different implementations of the fluid property back-end.
different implementations of the fluid property back end.

Finally, in the extension of the exergy analysis to chemical exergy
:cite:`Hofmann2022` we have also compared results of the CGAM process
Expand Down
Loading

0 comments on commit 0d8fed3

Please sign in to comment.