## FCSys.Conditions.ByConnector.Inter

Conditions for an Intra or Inter connector

### Information

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

### Package Content

Name | Description
--- | ---
Flows | Condition for an Inter or Intra connector, with flows specified by default
Efforts | Condition for an Inter or Intra connector, with efforts specified by default
Translational | Translational conditions
ThermalDiffusive | Conditions for thermal diffusion

## FCSys.Conditions.ByConnector.Inter.Flows

Condition for an Inter or Intra connector, with flows specified by default

### Information

Extends from FCSys.Icons.Conditions.Single (Icon for a single-connector boundary condition).

### Parameters

Type | Name | Default | Description
--- | --- | --- | ---
Specification
X-axis translational
replaceable function transXSpec | Translational.force | Quantity
Boolean | internalTransX | true | Use internal specification
RealExpression | transXSet | redeclare Sources.RealExpres… | Source of internal specification
Y-axis translational
replaceable function transYSpec | Translational.force | Quantity
Boolean | internalTransY | true | Use internal specification
RealExpression | transYSet | redeclare Sources.RealExpres… | Source of internal specification
Z-axis translational
replaceable function transZSpec | Translational.force | Quantity
Boolean | internalTransZ | true | Use internal specification
RealExpression | transZSet | redeclare Sources.RealExpres… | Source of internal specification
Thermal
replaceable function thermalSpec | ThermalDiffusive.heatRate | Quantity
Boolean | internalThermal | true | Use internal specification
RealExpression | thermalSet | redeclare Sources.RealExpres… | Source of internal specification
Measurement
replaceable function transXMeas | Conditions.ByConnector.Inter… | X-axis translational quantity
replaceable function transYMeas | Conditions.ByConnector.Inter… | Y-axis translational quantity
replaceable function transZMeas | Conditions.ByConnector.Inter… | Z-axis translational quantity
replaceable function thermalMeas | Conditions.ByConnector.Inter… | Thermal quantity
Assumptions
Included transport axes
Boolean | inclTransX | true | X
Boolean | inclTransY | true | Y
Boolean | inclTransZ | true | Z

### Connectors

Type | Name | Description
--- | --- | ---
Inert | inter | Connector to exchange translational momentum and thermal energy by diffusion
input RealInput | u_transX | X-axis translational specification
input RealInput | u_transY | Y-axis translational specification
input RealInput | u_transZ | Z-axis translational specification
input RealInput | u_thermal | Thermal specification
output RealOutput | y_transX | X-axis translational measurement
output RealOutput | y_transY | Y-axis translational measurement
output RealOutput | y_transZ | Z-axis translational measurement
output RealOutput | y_thermal | Thermal measurement
Specification
X-axis translational
replaceable function transXSpec | Quantity
Y-axis translational
replaceable function transYSpec | Quantity
Z-axis translational
replaceable function transZSpec | Quantity
Thermal
replaceable function thermalSpec | Quantity
Measurement
replaceable function transXMeas | X-axis translational quantity
replaceable function transYMeas | Y-axis translational quantity
replaceable function transZMeas | Z-axis translational quantity
replaceable function thermalMeas | Thermal quantity

### Modelica definition

    model Flows
      "Condition for an Inter or Intra connector, with flows specified by default"
      import Modelica.Math.BooleanVectors.countTrue;
      import Modelica.Math.BooleanVectors.enumerate;
      import Modelica.Blocks.Sources;
      extends FCSys.Icons.Conditions.Single;

      // Specification
      // -------------
      // X-axis translational
      replaceable function transXSpec = Translational.force constrainedby
        Translational.Partial "Quantity";

      parameter Boolean internalTransX=true "Use internal specification";
      replaceable Sources.RealExpression transXSet if inclTransX and internalTransX
        constrainedby Modelica.Blocks.Interfaces.SO
        "Source of internal specification";

      //
      // Y-axis translational
      replaceable function transYSpec = Translational.force constrainedby
        Translational.Partial "Quantity";

      parameter Boolean internalTransY=true "Use internal specification";
      replaceable Sources.RealExpression transYSet if inclTransY and internalTransY
        constrainedby Modelica.Blocks.Interfaces.SO
        "Source of internal specification";
      //
      // Z-axis translational
      replaceable function transZSpec = Translational.force constrainedby
        Translational.Partial "Quantity";

      parameter Boolean internalTransZ=true "Use internal specification";
      replaceable Sources.RealExpression transZSet if inclTransZ and internalTransZ
        constrainedby Modelica.Blocks.Interfaces.SO
        "Source of internal specification";
      //
      // Thermal
      replaceable function thermalSpec = ThermalDiffusive.heatRate constrainedby
        ThermalDiffusive.Partial "Quantity";

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

      // Measurement
      // -----------
      // X-axis translational
      replaceable function transXMeas = Conditions.ByConnector.Inter.Translational.velocity
        constrainedby Translational.Partial "X-axis translational quantity";
      //
      // Y-axis translational
      replaceable function transYMeas = Conditions.ByConnector.Inter.Translational.velocity
        constrainedby Translational.Partial "Y-axis translational quantity";
      //
      // Z-axis translational
      replaceable function transZMeas = Conditions.ByConnector.Inter.Translational.velocity
        constrainedby Translational.Partial "Z-axis translational quantity";
      //
      // Thermal
      replaceable function thermalMeas = Conditions.ByConnector.Inter.ThermalDiffusive.temperature
        constrainedby ThermalDiffusive.Partial "Thermal quantity";

      // Included components of translational momentum
      parameter Boolean inclTransX=true "X";
      parameter Boolean inclTransY=true "Y";
      parameter Boolean inclTransZ=true "Z";

      Connectors.Inert inter(final n_trans=n_trans)
        "Connector to exchange translational momentum and thermal energy by diffusion";

      // Inputs
      Connectors.RealInput u_transX if inclTransX and not internalTransX
        "X-axis translational specification";
      Connectors.RealInput u_transY if inclTransY and not internalTransY
        "Y-axis translational specification";
      Connectors.RealInput u_transZ if inclTransZ and not internalTransZ
        "Z-axis translational specification";
      Connectors.RealInput u_thermal if not internalThermal "Thermal specification";

      // Outputs
      final Connectors.RealOutput y_transX=transXMeas(
          inter.phi,
          inter.mPhidot,
          inter.T,
          inter.Qdot,
          i=transCart[Axis.x]) if inclTransX "X-axis translational measurement";

      final Connectors.RealOutput y_transY=transYMeas(
          inter.phi,
          inter.mPhidot,
          inter.T,
          inter.Qdot,
          i=transCart[Axis.y]) if inclTransY "Y-axis translational measurement";

      final Connectors.RealOutput y_transZ=transZMeas(
          inter.phi,
          inter.mPhidot,
          inter.T,
          inter.Qdot,
          i=transCart[Axis.z]) if inclTransZ "Z-axis translational measurement";

      final Connectors.RealOutput y_thermal=thermalMeas(
          inter.phi,
          inter.mPhidot,
          inter.T,
          inter.Qdot) "Thermal measurement";

    protected
      final inner parameter Integer n_trans=countTrue({inclTransX,inclTransY,
          inclTransZ}) "Number of components of translational momentum";
      final inner parameter Integer transCart[Axis]=enumerate({inclTransX,
          inclTransY,inclTransZ})
        "Translational-momentum-component indices of the Cartesian axes";

      Connectors.RealOutputInternal _u_transX=transXSpec(
          inter.phi,
          inter.mPhidot,
          inter.T,
          inter.Qdot,
          i=transCart[Axis.x]) if inclTransX
        "Internal, working value of X-axis translational specification";

      Connectors.RealOutputInternal _u_transY=transYSpec(
          inter.phi,
          inter.mPhidot,
          inter.T,
          inter.Qdot,
          i=transCart[Axis.y]) if inclTransY
        "Internal, working value of Y-axis translational specification";

      Connectors.RealOutputInternal _u_transZ=transZSpec(
          inter.phi,
          inter.mPhidot,
          inter.T,
          inter.Qdot,
          i=transCart[Axis.z]) if inclTransZ
        "Internal, working value of Z-axis translational specification";

      Connectors.RealOutputInternal _u_thermal=thermalSpec(
          inter.phi,
          inter.mPhidot,
          inter.T,
          inter.Qdot) "Internal, working value of thermal specification";

    equation
      // X-axis translational
      connect(u_transX, _u_transX);

      connect(transXSet.y, _u_transX);

      // Y-axis translational
      connect(u_transY, _u_transY);

      connect(transYSet.y, _u_transY);

      // Z-axis translational
      connect(u_transZ, _u_transZ);

      connect(transZSet.y, _u_transZ);

      // Thermal
      connect(u_thermal, _u_thermal);

      connect(thermalSet.y, _u_thermal);
    end Flows;

## FCSys.Conditions.ByConnector.Inter.Efforts

Condition for an Inter or Intra connector, with efforts specified by default

### Information

Extends from FCSys.Conditions.ByConnector.Inter.Flows (Condition for an Inter or Intra connector, with flows specified by default).

### Parameters

Type | Name | Default | Description
--- | --- | --- | ---
Specification
X-axis translational
replaceable function transXSpec | Translational.velocity | Quantity
Boolean | internalTransX | true | Use internal specification
RealExpression | transXSet | redeclare Sources.RealExpres… | Source of internal specification
Y-axis translational
replaceable function transYSpec | Translational.velocity | Quantity
Boolean | internalTransY | true | Use internal specification
RealExpression | transYSet | redeclare Sources.RealExpres… | Source of internal specification
Z-axis translational
replaceable function transZSpec | Translational.velocity | Quantity
Boolean | internalTransZ | true | Use internal specification
RealExpression | transZSet | redeclare Sources.RealExpres… | Source of internal specification
Thermal
replaceable function thermalSpec | ThermalDiffusive.temperature | Quantity
Boolean | internalThermal | true | Use internal specification
Measurement
replaceable function transXMeas | Translational.force | X-axis translational quantity
replaceable function transYMeas | Translational.force | Y-axis translational quantity
replaceable function transZMeas | Translational.force | Z-axis translational quantity
replaceable function thermalMeas | ThermalDiffusive.heatRate | Thermal quantity
Assumptions
Included transport axes
Boolean | inclTransX | true | X
Boolean | inclTransY | true | Y
Boolean | inclTransZ | true | Z

### Connectors

Type | Name | Description
--- | --- | ---
Inert | inter | Connector to exchange translational momentum and thermal energy by diffusion
input RealInput | u_transX | X-axis translational specification
input RealInput | u_transY | Y-axis translational specification
input RealInput | u_transZ | Z-axis translational specification
input RealInput | u_thermal | Thermal specification
output RealOutput | y_transX | X-axis translational measurement
output RealOutput | y_transY | Y-axis translational measurement
output RealOutput | y_transZ | Z-axis translational measurement
output RealOutput | y_thermal | Thermal measurement
Specification
X-axis translational
replaceable function transXSpec | Quantity
Y-axis translational
replaceable function transYSpec | Quantity
Z-axis translational
replaceable function transZSpec | Quantity
Thermal
replaceable function thermalSpec | Quantity
Measurement
replaceable function transXMeas | X-axis translational quantity
replaceable function transYMeas | Y-axis translational quantity
replaceable function transZMeas | Z-axis translational quantity
replaceable function thermalMeas | Thermal quantity

### Modelica definition

    model Efforts
      "Condition for an Inter or Intra connector, with efforts specified by default"

      extends FCSys.Conditions.ByConnector.Inter.Flows(
        redeclare replaceable function transXSpec = Translational.velocity,
        redeclare replaceable function transYSpec = Translational.velocity,
        redeclare replaceable function transZSpec = Translational.velocity,
        redeclare replaceable function thermalSpec = ThermalDiffusive.temperature,
        redeclare replaceable function transXMeas = Translational.force,
        redeclare replaceable function transYMeas = Translational.force,
        redeclare replaceable function transZMeas = Translational.force,
        redeclare replaceable function thermalMeas = ThermalDiffusive.heatRate,
        redeclare Modelica.Blocks.Sources.RealExpression thermalSet(y=298.15*U.K));

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

    end Efforts;