Skip to content

Commit

Permalink
Further worked on FMI container for #27.
Browse files Browse the repository at this point in the history
  • Loading branch information
mwetter committed Jan 28, 2014
1 parent b13e1a0 commit 0eb70aa
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 8 deletions.
3 changes: 2 additions & 1 deletion Annex60/Fluid/FMI/BaseClasses/Inlet.mo
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ equation
port.Xi_outflow = inlet.Xi_outflow;
port.C_outflow = inlet.C_outflow;

p = port.p;
// Send inlet pressure to signal port p
p = inlet.p;

annotation (defaultComponentName="boundary",
Icon(coordinateSystem(
Expand Down
6 changes: 5 additions & 1 deletion Annex60/Fluid/FMI/BaseClasses/Outlet.mo
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,11 @@ model Outlet "Model for exposing a fluid outlet to the FMI interface"
rotation=90,
origin={0,-120})));
equation
port.p = outlet.p;
// Set outlet pressure and port pressure to pressure
// of signal port
outlet.p = p;
port.p = p;

port.m_flow = outlet.m_flow;
port.h_outflow = outlet.h_outflow;
port.Xi_outflow = outlet.Xi_outflow;
Expand Down
5 changes: 3 additions & 2 deletions Annex60/Fluid/FMI/Fixme.mo
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
within Annex60.Fluid.FMI;
block Fixme
extends Annex60.Fluid.FMI.TwoPortSingleComponent(redeclare
HeatExchangers.HeaterCoolerPrescribed partialTwoPort(
extends Annex60.Fluid.FMI.TwoPortSingleComponent(
redeclare package Medium = Annex60.Media.Water,
redeclare HeatExchangers.HeaterCoolerPrescribed partialTwoPort(
m_flow_nominal=m_flow_nominal,
dp_nominal=dp_nominal,
Q_flow_nominal=Q_flow_nominal));
Expand Down
9 changes: 5 additions & 4 deletions Annex60/Fluid/FMI/TwoPortSingleComponent.mo
Original file line number Diff line number Diff line change
Expand Up @@ -4,24 +4,25 @@ block TwoPortSingleComponent
extends TwoPort;
replaceable Modelica.Fluid.Interfaces.PartialTwoPort partialTwoPort
constrainedby Modelica.Fluid.Interfaces.PartialTwoPort(
redeclare final package Medium = Medium,
redeclare package Medium = Medium,
final allowFlowReversal=allowFlowReversal)
annotation (Placement(transformation(extent={{-10,-10},{10,10}})));
parameter Boolean allowFlowReversal = true
"= true to allow flow reversal, false restricts to design direction (port_a -> port_b)"
annotation(Dialog(tab="Assumptions"), Evaluate=true);
Modelica.Blocks.Math.Feedback pOut "Pressure at component outlet"
annotation (Placement(transformation(extent={{10,-70},{30,-50}})));

protected
BaseClasses.Inlet bouIn(redeclare final package Medium=Medium)
"Boundary model for inlet"
annotation (Placement(transformation(extent={{-80,-10},{-60,10}})));
BaseClasses.Outlet bouOut(redeclare final package Medium=Medium)
"Boundary component for outlet"
annotation (Placement(transformation(extent={{60,-10},{80,10}})));
public

Sensors.RelativePressure senRelPre(redeclare package Medium = Medium)
annotation (Placement(transformation(extent={{-10,-44},{10,-24}})));
Modelica.Blocks.Math.Feedback pOut "Pressure at component outlet"
annotation (Placement(transformation(extent={{10,-70},{30,-50}})));
equation
connect(inlet, bouIn.inlet) annotation (Line(
points={{-110,0},{-81,0}},
Expand Down

0 comments on commit 0eb70aa

Please sign in to comment.