---
url: /dyad/dev/stdlib/FluidComponents/types/Sources.BaseClasses.PartialSource.md
description: >-
  Dyad Sources.BaseClasses.PartialSource docs.  Base class for prescribed fluid
  boundaries with one or more fluid ports.
---

# `Sources.BaseClasses.PartialSource` {#Sources.BaseClasses.PartialSource}

Base class for prescribed fluid boundaries with one or more fluid ports.

All ports share the pressure, outflow enthalpy, and outflow composition of the boundary medium. Extending components determine the boundary state and trace substances.

## Usage {#Usage}

`FluidComponents.Sources.BaseClasses.PartialSource()`

## Parameters: {#Parameters:}

|          Name | Description | Units |             Default value |
| -------------:| -----------:| -----:| -------------------------:|
| `medium_data` |             |     – |                           |
|      `nPorts` |             |     – |                           |
|          `nX` |             |     – | MediaCompon...edium_data) |
|         `nXi` |             |     – | MediaCompon...edium_data) |
|          `nC` |             |     – | MediaCompon...edium_data) |

## Connectors {#Connectors}

* `ports` - Generic fluid connector at the design outlet. ([`FluidPort_b`](@ref))

## Source {#Source}

```dyad
"""
Base class for prescribed fluid boundaries with one or more fluid ports.

All ports share the pressure, outflow enthalpy, and outflow composition of the
boundary medium. Extending components determine the boundary state and trace
substances.
"""
partial component PartialSource
  # Immutable medium definition selected at model construction [-]
  structural parameter medium_data::MediaComponents.Interfaces.AbstractPartialMediumData
  # Number of fluid ports [-]
  structural parameter nPorts::Integer(min = 0)
  # Number of mass fractions [-]
  final structural parameter nX::Integer = MediaComponents.Interfaces.medium_nX(medium_data)
  # Number of independent mass fractions [-]
  final structural parameter nXi::Integer = MediaComponents.Interfaces.medium_nXi(medium_data)
  # Number of extra transported properties [-]
  final structural parameter nC::Integer = MediaComponents.Interfaces.medium_nC(medium_data)
  "Thermodynamic properties inside the boundary."
  medium = MediaComponents.Interfaces.BaseProperties(medium_data = medium_data)
  "Fluid ports connected to the boundary."
  ports = [FluidComponents.Interfaces.FluidPort_b(medium_data = medium_data) for i in 1:nPorts] {
    "Dyad": {
      "placement": {
        "diagram": {"iconName": "default", "x1": 950, "y1": 300, "x2": 1050, "y2": 700, "rot": 0},
        "icon": {"iconName": "default", "x1": 950, "y1": 300, "x2": 1050, "y2": 700, "rot": 0}
      }
    }
  }
relations
  for i in 1:nPorts
    ports[i].p = medium.p
    ports[i].h_outflow = medium.h
    if nXi > 0
      for j in 1:nXi
        ports[i].Xi_outflow[j] = medium.Xi[j]
      end
    else
      ports[i].Xi_outflow[1] = 0
    end
    if nC == 0
      ports[i].C_outflow[1] = 0
    end
  end
end
```

```dyad
"""
Base class for prescribed fluid boundaries with one or more fluid ports.

All ports share the pressure, outflow enthalpy, and outflow composition of the
boundary medium. Extending components determine the boundary state and trace
substances.
"""
partial component PartialSource
  # Immutable medium definition selected at model construction [-]
  structural parameter medium_data::MediaComponents.Interfaces.AbstractPartialMediumData
  # Number of fluid ports [-]
  structural parameter nPorts::Integer(min = 0)
  # Number of mass fractions [-]
  final structural parameter nX::Integer = MediaComponents.Interfaces.medium_nX(medium_data)
  # Number of independent mass fractions [-]
  final structural parameter nXi::Integer = MediaComponents.Interfaces.medium_nXi(medium_data)
  # Number of extra transported properties [-]
  final structural parameter nC::Integer = MediaComponents.Interfaces.medium_nC(medium_data)
  "Thermodynamic properties inside the boundary."
  medium = MediaComponents.Interfaces.BaseProperties(medium_data = medium_data)
  "Fluid ports connected to the boundary."
  ports = [FluidComponents.Interfaces.FluidPort_b(medium_data = medium_data) for i in 1:nPorts] {
    "Dyad": {
      "placement": {
        "diagram": {"iconName": "default", "x1": 950, "y1": 300, "x2": 1050, "y2": 700, "rot": 0},
        "icon": {"iconName": "default", "x1": 950, "y1": 300, "x2": 1050, "y2": 700, "rot": 0}
      }
    }
  }
relations
  for i in 1:nPorts
    ports[i].p = medium.p
    ports[i].h_outflow = medium.h
    if nXi > 0
      for j in 1:nXi
        ports[i].Xi_outflow[j] = medium.Xi[j]
      end
    else
      ports[i].Xi_outflow[1] = 0
    end
    if nC == 0
      ports[i].C_outflow[1] = 0
    end
  end
metadata {}
end
```

## Test Cases {#Test-Cases}

No test cases defined.

## Related {#Related}

* Examples

* Experiments

* Analyses
