FCSys.Conditions.ByConnector.Inter

Conditions for an Intra or Inter connector

Information

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

Package Content

NameDescription
FCSys.Conditions.ByConnector.Inter.Flows Flows Condition for an Inter or Intra connector, with flows specified by default
FCSys.Conditions.ByConnector.Inter.Efforts Efforts Condition for an Inter or Intra connector, with efforts specified by default
FCSys.Conditions.ByConnector.Inter.Translational Translational Translational conditions
FCSys.Conditions.ByConnector.Inter.ThermalDiffusive ThermalDiffusive Conditions for thermal diffusion

FCSys.Conditions.ByConnector.Inter.Flows FCSys.Conditions.ByConnector.Inter.Flows

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

Information

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

Parameters

TypeNameDefaultDescription
Specification
X-axis translational
replaceable function transXSpecTranslational.forceQuantity
BooleaninternalTransXtrueUse internal specification
RealExpressiontransXSetredeclare Sources.RealExpres…Source of internal specification
Y-axis translational
replaceable function transYSpecTranslational.forceQuantity
BooleaninternalTransYtrueUse internal specification
RealExpressiontransYSetredeclare Sources.RealExpres…Source of internal specification
Z-axis translational
replaceable function transZSpecTranslational.forceQuantity
BooleaninternalTransZtrueUse internal specification
RealExpressiontransZSetredeclare Sources.RealExpres…Source of internal specification
Thermal
replaceable function thermalSpecThermalDiffusive.heatRateQuantity
BooleaninternalThermaltrueUse internal specification
RealExpressionthermalSetredeclare Sources.RealExpres…Source of internal specification
Measurement
replaceable function transXMeasConditions.ByConnector.Inter…X-axis translational quantity
replaceable function transYMeasConditions.ByConnector.Inter…Y-axis translational quantity
replaceable function transZMeasConditions.ByConnector.Inter…Z-axis translational quantity
replaceable function thermalMeasConditions.ByConnector.Inter…Thermal quantity
Assumptions
Included transport axes
BooleaninclTransXtrueX
BooleaninclTransYtrueY
BooleaninclTransZtrueZ

Connectors

TypeNameDescription
InertinterConnector to exchange translational momentum and thermal energy by diffusion
input RealInputu_transXX-axis translational specification
input RealInputu_transYY-axis translational specification
input RealInputu_transZZ-axis translational specification
input RealInputu_thermalThermal specification
output RealOutputy_transXX-axis translational measurement
output RealOutputy_transYY-axis translational measurement
output RealOutputy_transZZ-axis translational measurement
output RealOutputy_thermalThermal measurement
Specification
X-axis translational
replaceable function transXSpecQuantity
Y-axis translational
replaceable function transYSpecQuantity
Z-axis translational
replaceable function transZSpecQuantity
Thermal
replaceable function thermalSpecQuantity
Measurement
replaceable function transXMeasX-axis translational quantity
replaceable function transYMeasY-axis translational quantity
replaceable function transZMeasZ-axis translational quantity
replaceable function thermalMeasThermal 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 FCSys.Conditions.ByConnector.Inter.Efforts

Condition for an Inter or Intra connector, with efforts specified by default FCSys.Conditions.ByConnector.Inter.Efforts

Information

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

Parameters

TypeNameDefaultDescription
Specification
X-axis translational
replaceable function transXSpecTranslational.velocityQuantity
BooleaninternalTransXtrueUse internal specification
RealExpressiontransXSetredeclare Sources.RealExpres…Source of internal specification
Y-axis translational
replaceable function transYSpecTranslational.velocityQuantity
BooleaninternalTransYtrueUse internal specification
RealExpressiontransYSetredeclare Sources.RealExpres…Source of internal specification
Z-axis translational
replaceable function transZSpecTranslational.velocityQuantity
BooleaninternalTransZtrueUse internal specification
RealExpressiontransZSetredeclare Sources.RealExpres…Source of internal specification
Thermal
replaceable function thermalSpecThermalDiffusive.temperatureQuantity
BooleaninternalThermaltrueUse internal specification
Measurement
replaceable function transXMeasTranslational.forceX-axis translational quantity
replaceable function transYMeasTranslational.forceY-axis translational quantity
replaceable function transZMeasTranslational.forceZ-axis translational quantity
replaceable function thermalMeasThermalDiffusive.heatRateThermal quantity
Assumptions
Included transport axes
BooleaninclTransXtrueX
BooleaninclTransYtrueY
BooleaninclTransZtrueZ

Connectors

TypeNameDescription
InertinterConnector to exchange translational momentum and thermal energy by diffusion
input RealInputu_transXX-axis translational specification
input RealInputu_transYY-axis translational specification
input RealInputu_transZZ-axis translational specification
input RealInputu_thermalThermal specification
output RealOutputy_transXX-axis translational measurement
output RealOutputy_transYY-axis translational measurement
output RealOutputy_transZZ-axis translational measurement
output RealOutputy_thermalThermal measurement
Specification
X-axis translational
replaceable function transXSpecQuantity
Y-axis translational
replaceable function transYSpecQuantity
Z-axis translational
replaceable function transZSpecQuantity
Thermal
replaceable function thermalSpecQuantity
Measurement
replaceable function transXMeasX-axis translational quantity
replaceable function transYMeasY-axis translational quantity
replaceable function transZMeasZ-axis translational quantity
replaceable function thermalMeasThermal 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;