# ThermodynamicCycleAPI

## Index

`Ai4EComponentLib.ThermodynamicCycle.ArbitraryProcess`

`Ai4EComponentLib.ThermodynamicCycle.DThermalStates`

`Ai4EComponentLib.ThermodynamicCycle.IsentropicProcess`

`Ai4EComponentLib.ThermodynamicCycle.IsobaricProcess`

`Ai4EComponentLib.ThermodynamicCycle.IsochoricProcess`

`Ai4EComponentLib.ThermodynamicCycle.IsoenthalpyProcess`

`Ai4EComponentLib.ThermodynamicCycle.IsothermalProcess`

`Ai4EComponentLib.ThermodynamicCycle.StreamNode`

`Ai4EComponentLib.ThermodynamicCycle.StreamPort`

`Ai4EComponentLib.ThermodynamicCycle.ThermalStates`

## ThermodynamicCycle Components

`Ai4EComponentLib.ThermodynamicCycle.ArbitraryProcess`

— Method```
ArbitraryProcess(; name, inter_state, process, fluid)
```

**Component: ArbitraryProcess**

Once the two states in a node are determined, the remaining 3 states can be obtained from these two known states. In `ArbitraryProcess`

, 2 states need to be determined.

**Connectors:**

`in`

: Inlet of process`out`

: Outlet of process

**Arguments:**

`inter_state`

: One state to be determined. There are 7 options:`"P"`

: Giving state pressure`"H"`

: Giving state enthalpy`"T"`

: Giving state temperature`"D"`

: Giving state density`"S"`

: Giving state entropy`"Q_0"`

: Giving saturated liquid(0 is value of the state, automatically passed into ODESystem)`"Q_1"`

: Giving saturated vapor(1 is value of the state, automatically passed into ODESystem)

`process`

: Another state to be determined. There are 5 options:`"P"`

: Giving state pressure`"H"`

: Giving state enthalpy`"T"`

: Giving state temperature`"D"`

: Giving state density`"S"`

: Giving state entropy

`fluid`

: The fluid passing throught the component, default: "Water"

`Ai4EComponentLib.ThermodynamicCycle.DThermalStates`

— Method```
DThermalStates(; name, state, value, u0)
```

**Component: DThermalStates**

The `DThermalStates`

make the value of state changes over time.

\[\frac{\partial State}{\partial t} = ConstantValue\]

**Connectors:**

`node`

: A node passing value

**Arguments:**

`state`

: State that determined in process. There are 5 options:`"P"`

: Giving state pressure`"H"`

: Giving state enthalpy`"T"`

: Giving state temperature`"D"`

: Giving state density`"S"`

: Giving state entropy

`value`

: The value of`ConstantValue`

in above formula:`u0`

: The initial value of the state

`Ai4EComponentLib.ThermodynamicCycle.IsentropicProcess`

— Method```
IsentropicProcess(; name, inter_state, fluid)
```

**Component: IsentropicProcess**

The `Entropy`

is constant during the process.

Once the two states in a node are determined, the remaining 3 states can be obtained from these two known states. In IsentropicProcess, `entropy`

are the same from inlet to outlet. So another state still needed.

**Connectors:**

`in`

: Inlet of process`out`

: Outlet of process

**Arguments:**

`inter_state`

: Another state need to be determined. There are 7 options:`"P"`

: Giving state pressure`"H"`

: Giving state enthalpy`"T"`

: Giving state temperature`"D"`

: Giving state density`"S"`

: Giving state entropy`"Q_0"`

: Giving saturated liquid(0 is value of the state, automatically passed into ODESystem)`"Q_1"`

: Giving saturated vapor(1 is value of the state, automatically passed into ODESystem)

`fluid`

: The fluid passing throught the component, default: "Water"

`Ai4EComponentLib.ThermodynamicCycle.IsobaricProcess`

— Method```
IsobaricProcess(; name, inter_state, fluid)
```

**Component: IsobaricProcess**

The `Pressure`

is constant during the process.

Once the two states in a node are determined, the remaining 3 states can be obtained from these two known states. In IsobaricProcess, `pressure`

are the same from inlet to outlet. So another state still needed.

**Connectors:**

`in`

: Inlet of process`out`

: Outlet of process

**Arguments:**

`inter_state`

: Another state need to be determined. There are 7 options:`"P"`

: Giving state pressure`"H"`

: Giving state enthalpy`"T"`

: Giving state temperature`"D"`

: Giving state density`"S"`

: Giving state entropy`"Q_0"`

: Giving saturated liquid(0 is value of the state, automatically passed into ODESystem)`"Q_1"`

: Giving saturated vapor(1 is value of the state, automatically passed into ODESystem)

`fluid`

: The fluid passing throught the component, default: "Water"

`Ai4EComponentLib.ThermodynamicCycle.IsochoricProcess`

— Method```
IsochoricProcess(; name, inter_state, fluid)
```

**Component: IsochoricProcess**

The `Density`

is constant during the process.

Once the two states in a node are determined, the remaining 3 states can be obtained from these two known states. In IsochoricProcess, `density`

are the same from inlet to outlet. So another state still needed.

**Connectors:**

`in`

: Inlet of process`out`

: Outlet of process

**Arguments:**

`inter_state`

: Another state need to be determined. There are 7 options:`"P"`

: Giving state pressure`"H"`

: Giving state enthalpy`"T"`

: Giving state temperature`"D"`

: Giving state density`"S"`

: Giving state entropy`"Q_0"`

: Giving saturated liquid(0 is value of the state, automatically passed into ODESystem)`"Q_1"`

: Giving saturated vapor(1 is value of the state, automatically passed into ODESystem)

`fluid`

: The fluid passing throught the component, default: "Water"

`Ai4EComponentLib.ThermodynamicCycle.IsoenthalpyProcess`

— Method```
IsoenthalpyProcess(; name, inter_state, fluid)
```

**Component: IsoenthalpyProcess**

The `Enthalpy`

is constant during the process.

Once the two states in a node are determined, the remaining 3 states can be obtained from these two known states. In IsoenthalpyProcess, `enthalpy`

are the same from inlet to outlet. So another state still needed.

**Connectors:**

`in`

: Inlet of process`out`

: Outlet of process

**Arguments:**

`inter_state`

: Another state need to be determined. There are 7 options:`"P"`

: Giving state pressure`"H"`

: Giving state enthalpy`"T"`

: Giving state temperature`"D"`

: Giving state density`"S"`

: Giving state entropy`"Q_0"`

: Giving saturated liquid(0 is value of the state, automatically passed into ODESystem)`"Q_1"`

: Giving saturated vapor(1 is value of the state, automatically passed into ODESystem)

`fluid`

: The fluid passing throught the component, default: "Water"

`Ai4EComponentLib.ThermodynamicCycle.IsothermalProcess`

— Method```
IsothermalProcess(; name, inter_state, fluid)
```

**Component: IsothermalProcess**

The `Temperature`

is constant during the process.

Once the two states in a node are determined, the remaining 3 states can be obtained from these two known states. In IsothermalProcess, `temperature`

are the same from inlet to outlet. So another state still needed.

**Connectors:**

`in`

: Inlet of process`out`

: Outlet of process

**Arguments:**

`inter_state`

: Another state need to be determined. There are 7 options:`"P"`

: Giving state pressure`"H"`

: Giving state enthalpy`"T"`

: Giving state temperature`"D"`

: Giving state density`"S"`

: Giving state entropy`"Q_0"`

: Giving saturated liquid(0 is value of the state, automatically passed into ODESystem)`"Q_1"`

: Giving saturated vapor(1 is value of the state, automatically passed into ODESystem)

`fluid`

: The fluid passing throught the component, default: "Water"

`Ai4EComponentLib.ThermodynamicCycle.StreamNode`

— Method```
StreamNode(; name)
```

A stream node(inlet or outlet) in a thermodynamic cycle system. There are five states in a node: pressure, enthalpy, temperature, density, entropy.

**States:**

`p(t)`

: [`Pa`

] The pressure at this node`h(t)`

: [`J/kg`

] The enthalpy at this node`T(t)`

: [`K`

] The temperature at this node`ρ(t)`

: [`kg/m³`

] The density at this node`s(t)`

: [`J/(kg·K)`

] The entropy at this node

`Ai4EComponentLib.ThermodynamicCycle.StreamPort`

— Method```
StreamPort(; name)
```

Component with two stream nodes `in`

and `out`

and some variables between `in`

and `out`

.

**States:**

`Δp(t)`

: [`Pa`

] The pressure at this node`Δh(t)`

: [`J/kg`

] The enthalpy at this node`ΔT(t)`

: [`K`

] The temperature at this node`Δρ(t)`

: [`kg/m³`

] The density at this node`Δs(t)`

: [`J/(kg·K)`

] The entropy at this node

**Connectors:**

`in`

inlet of components`out`

outlet of components

`Ai4EComponentLib.ThermodynamicCycle.ThermalStates`

— Method```
ThermalStates(; name, state, value)
```

**Component: ThermalStates**

The `ThermalStates`

passed a fixed value of the state that determined in process.

**Connectors:**

`node`

: A node passing value

**Arguments:**

`state`

: State that determined in process. There are 5 options:`"P"`

: Giving state pressure`"H"`

: Giving state enthalpy`"T"`

: Giving state temperature`"D"`

: Giving state density`"S"`

: Giving state entropy

`value`

: The value of the state