## FCSys.Conditions.ByConnector.Boundary.Single

Conditions for a single Boundary connector

### Information

Extends from Modelica.Icons.Package (Icon for standard packages).

### Package Content

Name | Description
--- | ---
Source | Material source for a Boundary connector
Sink | Material sink for a Boundary connector
Material | Material conditions
Translational | Translational conditions
Thermal | Conditions for thermal diffusion

## FCSys.Conditions.ByConnector.Boundary.Single.Source

Material source for a Boundary connector

### Information

Extends from FCSys.Icons.Conditions.SingleShort (Short icon for a single-connector boundary condition).

### Parameters

Type | Name | Default | Description
--- | --- | --- | ---
Specification
Material
replaceable function materialSpec | Material.current | Quantity
Boolean | internalMaterial | true | Use internal specification
RealExpression | materialSet | redeclare Sources.RealExpres… | Source of internal specification
First transverse
replaceable function afterSpec | Translational.velocity | Quantity
Boolean | internalAfter | true | Use internal specification
RealExpression | afterSet | redeclare Sources.RealExpres… | Source of internal specification
Second transverse
replaceable function beforeSpec | Translational.velocity | Quantity
Boolean | internalBefore | true | Use internal specification
RealExpression | beforeSet | redeclare Sources.RealExpres… | Source of internal specification
Thermal
replaceable function thermalSpec | Thermal.temperature | Quantity
Boolean | internalThermal | true | Use internal specification
RealExpression | thermalSet | redeclare Sources.RealExpres… | Source of internal specification
Measurement
replaceable function materialMeas | Material.pressure | Material quantity
replaceable function afterMeas | Translational.force | First transverse quantity
replaceable function beforeMeas | Translational.force | Second transverse quantity
replaceable function thermalMeas | Thermal.heatRate | Thermal quantity

### Connectors

Type | Name | Description
--- | --- | ---
Boundary | boundary | Connector to transport material, translational momentum, and thermal energy
RealInputBus | u | Bus of specifications
RealOutputBus | y | Bus of measurements
Specification
Material
replaceable function materialSpec | Quantity
First transverse
replaceable function afterSpec | Quantity
Second transverse
replaceable function beforeSpec | Quantity
Thermal
replaceable function thermalSpec | Quantity
Measurement
replaceable function materialMeas | Material quantity
replaceable function afterMeas | First transverse quantity
replaceable function beforeMeas | Second transverse quantity
replaceable function thermalMeas | Thermal quantity

### Modelica definition

    model Source
      "Material source for a Boundary connector"
      import Modelica.Blocks.Sources;
      extends FCSys.Icons.Conditions.SingleShort;

      // Specification
      // -------------
      // Material
      replaceable function materialSpec = Material.current constrainedby
        Material.Partial "Quantity";
      parameter Boolean internalMaterial=true "Use internal specification";
      replaceable Sources.RealExpression materialSet if internalMaterial
        constrainedby Modelica.Blocks.Interfaces.SO
        "Source of internal specification";
      //
      // 1st transverse
      replaceable function afterSpec = Translational.velocity constrainedby
        Translational.Partial "Quantity";
      parameter Boolean internalAfter=true "Use internal specification";
      replaceable Sources.RealExpression afterSet if internalAfter constrainedby
        Modelica.Blocks.Interfaces.SO "Source of internal specification";

      //
      // 2nd transverse
      replaceable function beforeSpec = Translational.velocity constrainedby
        Translational.Partial "Quantity";

      parameter Boolean internalBefore=true "Use internal specification";
      replaceable Sources.RealExpression beforeSet if internalBefore constrainedby
        Modelica.Blocks.Interfaces.SO "Source of internal specification";

      //
      // Thermal
      replaceable function thermalSpec = Thermal.temperature constrainedby
        Thermal.Partial "Quantity";

      parameter Boolean internalThermal=true "Use internal specification";
      replaceable Sources.RealExpression thermalSet(y=298.15*U.K) if
        internalThermal constrainedby Modelica.Blocks.Interfaces.SO
        "Source of internal specification";

      // Measurement
      // -----------
      // Aliases
      Q.PressureAbsolute p "Pressure";
      Q.TemperatureAbsolute T "Temperature";
      // Material
      replaceable function materialMeas = Material.pressure constrainedby
        Material.Partial "Material quantity";

      // 1st transverse
      replaceable function afterMeas = Translational.force constrainedby
        Translational.Partial "First transverse quantity";

      // 2nd transverse
      replaceable function beforeMeas = Translational.force constrainedby
        Translational.Partial "Second transverse quantity";

      // Thermal
      replaceable function thermalMeas = Thermal.heatRate constrainedby
        Thermal.Partial "Thermal quantity";

      Connectors.Boundary boundary
        "Connector to transport material, translational momentum, and thermal energy";
      Connectors.RealInputBus u if not (internalMaterial and internalAfter and
        internalBefore and internalThermal) "Bus of specifications";
      Connectors.RealOutputBus y "Bus of measurements";

      // Inputs
    protected
      Connectors.RealInputInternal u_material if not internalMaterial
        "Material specification";
      Connectors.RealInputInternal u_after if not internalAfter
        "First transverse specification";
      Connectors.RealInputInternal u_before if not internalBefore
        "Second transverse specification";
      Connectors.RealInputInternal u_thermal if not internalThermal
        "Thermal specification";

      Connectors.RealOutputInternal _u_material
        "Internal, working value of material specification";
      Connectors.RealOutputInternal _u_after=afterSpec(
          boundary.p,
          boundary.Ndot,
          boundary.phi,
          boundary.mPhidot,
          boundary.T,
          boundary.Qdot,
          orient=Orient.after)
        "Internal, working value of first transverse specification";
      Connectors.RealOutputInternal _u_before=beforeSpec(
          boundary.p,
          boundary.Ndot,
          boundary.phi,
          boundary.mPhidot,
          boundary.T,
          boundary.Qdot,
          orient=Orient.before)
        "Internal, working value of second transverse specification";
      Connectors.RealOutputInternal _u_thermal
        "Internal, working value of thermal specification";
    public
      Sources.RealExpression materialOut(y=materialMeas(
            boundary.p,
            boundary.Ndot,
            boundary.phi,
            boundary.mPhidot,
            boundary.T,
            boundary.Qdot)) "Generate the material output";
      Sources.RealExpression beforeOut(y=beforeMeas(
            boundary.p,
            boundary.Ndot,
            boundary.phi,
            boundary.mPhidot,
            boundary.T,
            boundary.Qdot,
            orient=Orient.before)) "Generate the 2nd transverse output";
      Sources.RealExpression afterOut(y=afterMeas(
            boundary.p,
            boundary.Ndot,
            boundary.phi,
            boundary.mPhidot,
            boundary.T,
            boundary.Qdot,
            orient=Orient.after)) "Generate the 1st transverse output";
      Sources.RealExpression thermalOut(y=thermalMeas(
            boundary.p,
            boundary.Ndot,
            boundary.phi,
            boundary.mPhidot,
            boundary.T,
            boundary.Qdot)) "Generate the thermal output";
    equation
      // Aliases
      p = boundary.p;
      T = boundary.T;

      _u_material = materialSpec(
        boundary.p,
        boundary.Ndot,
        boundary.phi,
        boundary.mPhidot,
        boundary.T,
        boundary.Qdot);
      _u_thermal = thermalSpec(
        boundary.p,
        boundary.Ndot,
        boundary.phi,
        boundary.mPhidot,
        boundary.T,
        boundary.Qdot);

      // Material
      connect(u_material, _u_material);

      connect(materialSet.y, _u_material);
      connect(u_material, u.material);

      connect(materialOut.y, y.material);

      // First transverse
      connect(u_after, _u_after);

      connect(afterSet.y, _u_after);
      connect(u_after, u.after);

      connect(afterOut.y, y.after);

      // Second transverse
      connect(u_before, _u_before);

      connect(beforeSet.y, _u_before);
      connect(u_before, u.before);

      connect(beforeOut.y, y.before);

      // Thermal
      connect(thermalSet.y, _u_thermal);
      connect(u_thermal, u.thermal);

      connect(u_thermal, _u_thermal);
      connect(thermalOut.y, y.thermal);
    end Source;

## FCSys.Conditions.ByConnector.Boundary.Single.Sink

Material sink for a Boundary connector

### Information

Extends from Source (Material source for a Boundary connector).

### Parameters

Type | Name | Default | Description
--- | --- | --- | ---
Specification
Material
replaceable function materialSpec | Material.pressure | Quantity
Boolean | internalMaterial | true | Use internal specification
First transverse
replaceable function afterSpec | Translational.force | Quantity
Boolean | internalAfter | true | Use internal specification
RealExpression | afterSet | redeclare Sources.RealExpres… | Source of internal specification
Second transverse
replaceable function beforeSpec | Translational.force | Quantity
Boolean | internalBefore | true | Use internal specification
RealExpression | beforeSet | redeclare Sources.RealExpres… | Source of internal specification
Thermal
replaceable function thermalSpec | Thermal.heatRate | Quantity
Boolean | internalThermal | true | Use internal specification
Measurement
replaceable function materialMeas | Material.current | Material quantity
replaceable function afterMeas | Translational.velocity | First transverse quantity
replaceable function beforeMeas | Translational.velocity | Second transverse quantity
replaceable function thermalMeas | Thermal.temperature | Thermal quantity

### Connectors

Type | Name | Description
--- | --- | ---
Boundary | boundary | Connector to transport material, translational momentum, and thermal energy
RealInputBus | u | Bus of specifications
RealOutputBus | y | Bus of measurements
Specification
Material
replaceable function materialSpec | Quantity
First transverse
replaceable function afterSpec | Quantity
Second transverse
replaceable function beforeSpec | Quantity
Thermal
replaceable function thermalSpec | Quantity
Measurement
replaceable function materialMeas | Material quantity
replaceable function afterMeas | First transverse quantity
replaceable function beforeMeas | Second transverse quantity
replaceable function thermalMeas | Thermal quantity

### Modelica definition

    model Sink
      "Material sink for a Boundary connector"
      extends Source(
        redeclare replaceable function materialSpec = Material.pressure,
        redeclare replaceable function afterSpec = Translational.force,
        redeclare replaceable function beforeSpec = Translational.force,
        redeclare replaceable function thermalSpec = Thermal.heatRate,
        redeclare replaceable function materialMeas = Material.current,
        redeclare replaceable function afterMeas = Translational.velocity,
        redeclare replaceable function beforeMeas = Translational.velocity,
        redeclare replaceable function thermalMeas = Thermal.temperature,
        redeclare Modelica.Blocks.Sources.RealExpression materialSet(y=U.atm),
        redeclare Modelica.Blocks.Sources.RealExpression thermalSet(y=0));

      // Note:  In Dymola 2014, the paths must be explicitly given to prevent
      // the error "Cannot show the parameter dialog for redeclared class […]".

      // The materialSet and thermalSet blocks are redeclared as not replaceable
      // because y is set directly and can't be undone at instantiation.

    end Sink;