FCSys.Conditions.ByConnector.Reaction

Conditions for a Reaction connector

Information

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

Package Content

NameDescription
FCSys.Conditions.ByConnector.Reaction.Rate Rate Impose a reaction rate via a Reaction connector
FCSys.Conditions.ByConnector.Reaction.Offset Offset Add a potential to a Reaction connector
FCSys.Conditions.ByConnector.Reaction.Material Material Material conditions
FCSys.Conditions.ByConnector.Reaction.Translational Translational Translational conditions
FCSys.Conditions.ByConnector.Reaction.ThermalAdvective ThermalAdvective Conditions for thermal advection

FCSys.Conditions.ByConnector.Reaction.Rate FCSys.Conditions.ByConnector.Reaction.Rate

Impose a reaction rate via a Reaction connector FCSys.Conditions.ByConnector.Reaction.Rate

Information

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

Parameters

TypeNameDefaultDescription
Specification
Material
replaceable function materialSpecMaterial.reactionRateQuantity
BooleaninternalMaterialtrueUse internal specification
RealExpressionmaterialSetredeclare Sources.RealExpres…Source of internal 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 thermalSpecThermalAdvective.specificEnt…Quantity
BooleaninternalThermaltrueUse internal specification
RealExpressionthermalSetredeclare Sources.RealExpres…Source of internal specification
Measurement
replaceable function materialMeasMaterial.potentialMaterial quantity
replaceable function transXMeasTranslational.forceX-axis translational quantity
replaceable function transYMeasTranslational.forceY-axis translational quantity
replaceable function transZMeasTranslational.forceZ-axis translational quantity
replaceable function thermalMeasThermalAdvective.heatRateThermal quantity
Assumptions
Included transport axes
BooleaninclTransXtrueX
BooleaninclTransYtrueY
BooleaninclTransZtrueZ

Connectors

TypeNameDescription
input RealInputu_materialMaterial specification
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
ReactionreactionStoichiometric connector for the chemical reaction
Specification
Material
replaceable function materialSpecQuantity
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 materialMeasMaterial quantity
replaceable function transXMeasX-axis translational quantity
replaceable function transYMeasY-axis translational quantity
replaceable function transZMeasZ-axis translational quantity
replaceable function thermalMeasThermal quantity
output RealOutputy_materialMaterial measurement

Modelica definition

model Rate 
  "Impose a reaction rate via a Reaction connector"
  import Modelica.Math.BooleanVectors.countTrue;
  import Modelica.Math.BooleanVectors.enumerate;
  import Modelica.Blocks.Sources;
  extends FCSys.Icons.Conditions.Single;

  // Specification
  // -------------
  // Material
  replaceable function materialSpec = Material.reactionRate 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";

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

  parameter Boolean internalTransX=true if inclTransX 
    "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.velocity constrainedby 
    Translational.Partial "Quantity";

  parameter Boolean internalTransY=true if inclTransY 
    "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.velocity constrainedby 
    Translational.Partial "Quantity";

  parameter Boolean internalTransZ=true if inclTransZ 
    "Use internal specification";
  replaceable Sources.RealExpression transZSet if inclTransZ and internalTransZ
    constrainedby Modelica.Blocks.Interfaces.SO 
    "Source of internal specification";

  // 
  // Thermal
  replaceable function thermalSpec = ThermalAdvective.specificEntropyTemperature
    constrainedby ThermalAdvective.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
  // -----------
  // Material
  replaceable function materialMeas = Material.potential constrainedby 
    Material.Partial "Material quantity";

  // X-axis translational
  replaceable function transXMeas = Translational.force constrainedby 
    Translational.Partial "X-axis translational quantity";

  // Y-axis translational
  replaceable function transYMeas = Translational.force constrainedby 
    Translational.Partial "Y-axis translational quantity";

  // Z-axis translational
  replaceable function transZMeas = Translational.force constrainedby 
    Translational.Partial "Z-axis translational quantity";

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

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

  // Inputs
  Connectors.RealInput u_material if not internalMaterial 
    "Material specification";
  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_material=materialMeas(
      reaction.Ndot,
      reaction.g,
      reaction.phi,
      reaction.mPhidot,
      reaction.sT,
      reaction.Qdot) "Material measurement";
  final Connectors.RealOutput y_transX=transXMeas(
      reaction.Ndot,
      reaction.g,
      reaction.phi,
      reaction.mPhidot,
      reaction.sT,
      reaction.Qdot,
      i=transCart[Axis.x]) if inclTransX "X-axis translational measurement";
  final Connectors.RealOutput y_transY=transYMeas(
      reaction.Ndot,
      reaction.g,
      reaction.phi,
      reaction.mPhidot,
      reaction.sT,
      reaction.Qdot,
      i=transCart[Axis.y]) if inclTransY "Y-axis translational measurement";
  final Connectors.RealOutput y_transZ=transZMeas(
      reaction.Ndot,
      reaction.g,
      reaction.phi,
      reaction.mPhidot,
      reaction.sT,
      reaction.Qdot,
      i=transCart[Axis.z]) if inclTransZ "Z-axis translational measurement";
  final Connectors.RealOutput y_thermal=thermalMeas(
      reaction.Ndot,
      reaction.g,
      reaction.phi,
      reaction.mPhidot,
      reaction.sT,
      reaction.Qdot) "Thermal measurement";

  Connectors.Reaction reaction(final n_trans=n_trans) 
    "Stoichiometric connector for the chemical reaction";

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_material=materialSpec(
      reaction.Ndot,
      reaction.g,
      reaction.phi,
      reaction.mPhidot,
      reaction.sT,
      reaction.Qdot) "Internal, working value of material specification";
  Connectors.RealOutputInternal _u_transX=transXSpec(
      reaction.Ndot,
      reaction.g,
      reaction.phi,
      reaction.mPhidot,
      reaction.sT,
      reaction.Qdot,
      i=transCart[Axis.x]) if inclTransX 
    "Internal, working value of X-axis translational specification";
  Connectors.RealOutputInternal _u_transY=transYSpec(
      reaction.Ndot,
      reaction.g,
      reaction.phi,
      reaction.mPhidot,
      reaction.sT,
      reaction.Qdot,
      i=transCart[Axis.y]) if inclTransY 
    "Internal, working value of Y-axis translational specification";
  Connectors.RealOutputInternal _u_transZ=transZSpec(
      reaction.Ndot,
      reaction.g,
      reaction.phi,
      reaction.mPhidot,
      reaction.sT,
      reaction.Qdot,
      i=transCart[Axis.z]) if inclTransZ 
    "Internal, working value of Z-axis translational specification";
  Connectors.RealOutputInternal _u_thermal=thermalSpec(
      reaction.Ndot,
      reaction.g,
      reaction.phi,
      reaction.mPhidot,
      reaction.sT,
      reaction.Qdot) "Internal, working value of thermal specification";

equation 
  // Material
  connect(u_material, _u_material);

  connect(materialSet.y, _u_material);

  // 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 Rate;

FCSys.Conditions.ByConnector.Reaction.Offset FCSys.Conditions.ByConnector.Reaction.Offset

Add a potential to a Reaction connector FCSys.Conditions.ByConnector.Reaction.Offset

Information

Extends from FCSys.Conditions.ByConnector.Reaction.Rate (Impose a reaction rate via a Reaction connector).

Parameters

TypeNameDefaultDescription
Specification
Material
replaceable function materialSpecMaterial.potentialQuantity
BooleaninternalMaterialtrueUse internal specification
RealExpressionmaterialSetredeclare Sources.RealExpres…Source of internal specification
X-axis translational
replaceable function transXSpecConditions.ByConnector.React…Quantity
BooleaninternalTransXtrueUse internal specification
RealExpressiontransXSetredeclare Sources.RealExpres…Source of internal specification
Y-axis translational
replaceable function transYSpecConditions.ByConnector.React…Quantity
BooleaninternalTransYtrueUse internal specification
RealExpressiontransYSetredeclare Sources.RealExpres…Source of internal specification
Z-axis translational
replaceable function transZSpecConditions.ByConnector.React…Quantity
BooleaninternalTransZtrueUse internal specification
RealExpressiontransZSetredeclare Sources.RealExpres…Source of internal specification
Thermal
replaceable function thermalSpecConditions.ByConnector.React…Quantity
BooleaninternalThermaltrueUse internal specification
RealExpressionthermalSetredeclare Sources.RealExpres…Source of internal specification
Measurement
replaceable function materialMeasConditions.ByConnector.React…Material quantity
replaceable function transXMeasConditions.ByConnector.React…X-axis translational quantity
replaceable function transYMeasConditions.ByConnector.React…Y-axis translational quantity
replaceable function transZMeasConditions.ByConnector.React…Z-axis translational quantity
replaceable function thermalMeasConditions.ByConnector.React…Thermal quantity
Assumptions
Included transport axes
BooleaninclTransXtrueX
BooleaninclTransYtrueY
BooleaninclTransZtrueZ

Connectors

TypeNameDescription
input RealInputu_materialMaterial specification
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
ReactionreactionStoichiometric connector for the chemical reaction
Specification
Material
replaceable function materialSpecQuantity
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 materialMeasMaterial quantity
replaceable function transXMeasX-axis translational quantity
replaceable function transYMeasY-axis translational quantity
replaceable function transZMeasZ-axis translational quantity
replaceable function thermalMeasThermal quantity
output RealOutputy_materialMaterial measurement

Modelica definition

model Offset 
  "Add a potential to a Reaction connector"

  extends FCSys.Conditions.ByConnector.Reaction.Rate(
    redeclare replaceable function materialSpec = Material.potential,
    redeclare replaceable function transXSpec = Conditions.ByConnector.Reaction.Translational.velocity,

    redeclare replaceable function transYSpec = Conditions.ByConnector.Reaction.Translational.velocity,

    redeclare replaceable function transZSpec = Conditions.ByConnector.Reaction.Translational.velocity,

    redeclare replaceable function thermalSpec = Conditions.ByConnector.Reaction.ThermalAdvective.specificEntropyTemperature,

    redeclare replaceable function materialMeas = Conditions.ByConnector.Reaction.Material.reactionRate,

    redeclare replaceable function transXMeas = Conditions.ByConnector.Reaction.Translational.force,

    redeclare replaceable function transYMeas = Conditions.ByConnector.Reaction.Translational.force,

    redeclare replaceable function transZMeas = Conditions.ByConnector.Reaction.Translational.force,

    redeclare replaceable function thermalMeas = Conditions.ByConnector.Reaction.ThermalAdvective.heatRate);

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

end Offset;