Conditions for a pair of Boundary connectors
Information
Extends from
Modelica.Icons.Package (Icon for standard packages).
Package Content
| Name | Description |
Temperature
| Impose a temperature difference across and a current between a pair of Boundary connectors |
Pressure
| Impose a pressure difference across and a heat flow rate between a pair of Boundary connectors |
Material
| Material conditions |
Translational
| Translational conditions |
Thermal
| Conditions for thermal diffusion |
Impose a temperature difference across and a current between a pair of Boundary connectors
Information
Extends from
FCSys.Icons.Conditions.PairShort (Short icon for a two-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 | negative | Negative boundary |
| Boundary | positive | Positive boundary |
| 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 Temperature
"Impose a temperature difference across and a current between a pair of Boundary connectors"
import Modelica.Blocks.Sources;
extends FCSys.Icons.Conditions.PairShort;
// 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 if internalThermal
constrainedby Modelica.Blocks.Interfaces.SO
"Source of internal specification";
// Measurement
// -----------
// 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";
// Aliases
Q.Pressure Deltap "Difference in pressure";
Q.Velocity Deltaphi[Orient] "Difference in velocity";
Q.Temperature DeltaT "Difference in temperature";
Connectors.Boundary negative "Negative boundary";
Connectors.Boundary positive "Positive boundary";
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";
// Outputs
Connectors.RealOutputInternal _u_material=materialSpec(
Deltap,
negative.Ndot,
Deltaphi,
negative.mPhidot,
DeltaT,
negative.Qdot) "Internal, working value of material specification";
Connectors.RealOutputInternal _u_after=afterSpec(
Deltap,
negative.Ndot,
Deltaphi,
negative.mPhidot,
DeltaT,
negative.Qdot,
orient=Orient.after)
"Internal, working value of first transverse specification";
Connectors.RealOutputInternal _u_before=beforeSpec(
Deltap,
negative.Ndot,
Deltaphi,
negative.mPhidot,
DeltaT,
negative.Qdot,
orient=Orient.before)
"Internal, working value of second transverse specification";
Connectors.RealOutputInternal _u_thermal=thermalSpec(
Deltap,
negative.Ndot,
Deltaphi,
negative.mPhidot,
DeltaT,
negative.Qdot) "Internal, working value of thermal specification";
Sources.RealExpression materialOut(y=materialMeas(
Deltap,
negative.Ndot,
Deltaphi,
negative.mPhidot,
DeltaT,
negative.Qdot)) "Generate the material output";
Sources.RealExpression beforeOut(y=beforeMeas(
Deltap,
negative.Ndot,
Deltaphi,
negative.mPhidot,
DeltaT,
negative.Qdot,
orient=Orient.before)) "Generate the 2nd transverse output";
Sources.RealExpression afterOut(y=afterMeas(
Deltap,
negative.Ndot,
Deltaphi,
negative.mPhidot,
DeltaT,
negative.Qdot,
orient=Orient.after)) "Generate the 1st transverse output";
Sources.RealExpression thermalOut(y=thermalMeas(
Deltap,
negative.Ndot,
Deltaphi,
negative.mPhidot,
DeltaT,
negative.Qdot)) "Generate the thermal output";
equation
// Differences in efforts
Deltap = positive.p - negative.p;
Deltaphi = positive.phi - negative.phi;
DeltaT = positive.T - negative.T;
// Conservation (without storage)
0 = positive.Ndot + negative.Ndot "Material";
{0,0} = positive.mPhidot + negative.mPhidot "Translational momentum";
DeltaT = positive.Qdot + negative.Qdot "Energy";
// Material
connect(u_material, _u_material);
connect(materialSet.y, _u_material);
// First transverse
connect(u_after, _u_after);
connect(afterSet.y, _u_after);
// Second transverse
connect(u_before, _u_before);
connect(beforeSet.y, _u_before);
// Thermal
connect(u_thermal, _u_thermal);
connect(thermalSet.y, _u_thermal);
connect(materialOut.y, y.material);
connect(afterOut.y, y.after);
connect(beforeOut.y, y.before);
connect(u_material, u.material);
connect(u_after, u.after);
connect(u_before, u.before);
connect(u_thermal, u.thermal);
connect(thermalOut.y, y.thermal);
end Temperature;
Impose a pressure difference across and a heat flow rate between a pair of Boundary connectors
Information
Extends from
Temperature (Impose a temperature difference across and a current between a pair of
Boundary connectors).
Parameters
| Type | Name | Default | Description |
| Specification |
| Material |
| replaceable function materialSpec | Material.pressure | Quantity |
| Boolean | internalMaterial | true | Use internal specification |
| RealExpression | materialSet | redeclare Sources.RealExpres… | Source of 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 |
| RealExpression | thermalSet | redeclare Sources.RealExpres… | Source of 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 | negative | Negative boundary |
| Boundary | positive | Positive boundary |
| 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 Pressure
"Impose a pressure difference across and a heat flow rate between a pair of Boundary connectors"
extends Temperature(
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);
// See note in Reaction.Efforts.
end Pressure;