Collection of models that illustrate model use and test models
Information
This package contains examples for the use of models that can be found in
Annex60.Fluid.FMI.Conversion.
Extends from Modelica.Icons.ExamplesPackage (Icon for packages containing runnable examples).
Package Content
Name |
Description |
AirToOutlet
|
Validation model for air to outlet conversion |
AirToOutletFlowReversal
|
Validation model for air to outlet converter with flow reversal enabled |
InletToAirDryAir
|
Validation model for inlet to air with dry air medium |
InletToAirDryAirCO2
|
Validation model for inlet to air with dry air medium and CO2 |
InletToAirMoistAir
|
Validation model for inlet to Annex60.Media.Air conversion without trace substances |
InletToAirMoistAirCO2
|
Validation model for inlet to Annex60.Media.Air conversion with C02 trace substances |
Validation model for air to outlet conversion
Information
This example validates the conversion model
Annex60.Fluid.FMI.Conversion.AirToOutlet
for the situation without reverse flow.
The conversion elements all have either a dry or
moist air medium, with our without trace substances,
in order to test all combinations of air.
Extends from Modelica.Icons.Example (Icon for runnable examples).
Parameters
Type | Name | Default | Description |
Boolean | allowFlowReversal | false | = true to allow flow reversal, false restricts to design direction (inlet -> outlet) |
Modelica definition
model AirToOutlet
extends Modelica.Icons.Example;
parameter Boolean allowFlowReversal = false
;
Modelica.Blocks.Sources.Constant m_flow(k=0.2) ;
Modelica.Blocks.Sources.Constant h(k=3E5) ;
Modelica.Blocks.Sources.Constant Xi[1](k={0.01}) ;
Modelica.Blocks.Sources.Constant C[1](k={1E-5}) ;
Annex60.Fluid.FMI.Conversion.AirToOutlet conAirNoC(
redeclare package Medium =
Annex60.Media.Air,
final allowFlowReversal=allowFlowReversal)
;
Annex60.Fluid.FMI.Conversion.AirToOutlet conAirWithC(
redeclare package Medium =
Annex60.Media.Air(extraPropertiesNames={"CO2"}),
final allowFlowReversal=allowFlowReversal)
;
Annex60.Fluid.FMI.Conversion.AirToOutlet conDryAirNoC(
redeclare package Medium =
Modelica.Media.Air.SimpleAir,
final allowFlowReversal=allowFlowReversal)
;
Annex60.Fluid.FMI.Conversion.AirToOutlet conDryAirWithC(
redeclare package Medium =
Modelica.Media.Air.SimpleAir(extraPropertiesNames={"CO2"}),
final allowFlowReversal=allowFlowReversal)
;
equation
connect(m_flow.y, conAirNoC.m_flow);
connect(h.y, conAirNoC.h);
connect(Xi.y, conAirNoC.Xi);
connect(m_flow.y, conAirWithC.m_flow);
connect(h.y, conAirWithC.h);
connect(Xi.y, conAirWithC.Xi);
connect(m_flow.y, conDryAirNoC.m_flow);
connect(h.y, conDryAirNoC.h);
connect(m_flow.y, conDryAirWithC.m_flow);
connect(h.y, conDryAirWithC.h);
connect(C.y, conAirWithC.C);
connect(C.y, conDryAirWithC.C);
end AirToOutlet;
Validation model for air to outlet converter with flow reversal enabled
Information
This example is identical to
Annex60.Fluid.FMI.Conversion.Validation.AirToOutlet,
except that it has reverse flow.
This tests whether the fluid properties from
the upstream media are correctly converted to
the output signals of
Annex60.Fluid.FMI.Conversion.AirToOutlet.
Extends from Annex60.Fluid.FMI.Conversion.Validation.AirToOutlet (Validation model for air to outlet conversion).
Parameters
Type | Name | Default | Description |
Boolean | allowFlowReversal | true | = true to allow flow reversal, false restricts to design direction (inlet -> outlet) |
Modelica definition
model AirToOutletFlowReversal
extends Annex60.Fluid.FMI.Conversion.Validation.AirToOutlet(
allowFlowReversal = true);
BoundaryCondition bouAirNoC(
redeclare package Medium =
Annex60.Media.Air (
X_default={0.015, 0.985}))
;
BoundaryCondition bouAirWithC(
redeclare package Medium =
Annex60.Media.Air (
X_default={0.015, 0.985},
extraPropertiesNames={"CO2"}))
;
BoundaryCondition bouDryAirNoC(
redeclare package Medium =
Modelica.Media.Air.SimpleAir)
;
BoundaryCondition bouDryAirWithC(
redeclare package Medium =
Modelica.Media.Air.SimpleAir (
extraPropertiesNames={"CO2"}))
;
protected
model BoundaryCondition
extends Modelica.Blocks.Icons.Block;
replaceable package Medium =
Modelica.Media.Interfaces.PartialMedium
;
final parameter Boolean use_p_in=false
;
Adaptors.Inlet bouInlAirNoC(
redeclare package Medium =
Medium,
allowFlowReversal=true,
use_p_in=false) ;
Sources.Boundary_pT bou(
redeclare package Medium =
Medium,
nPorts=1,
p=Medium.p_default + 1000,
T=298.15,
C=
fill(0.7, Medium.nC)) ;
Interfaces.Inlet inlet(
use_p_in=use_p_in,
redeclare package Medium =
Medium,
allowFlowReversal=true)
;
FixedResistances.PressureDrop res(
redeclare package Medium =
Medium,
m_flow_nominal=0.1,
dp_nominal=1000,
linearized=true) ;
equation
connect(bouInlAirNoC.inlet, inlet);
connect(res.port_b, bou.ports[1]);
connect(res.port_a, bouInlAirNoC.port_b);
end BoundaryCondition;
equation
connect(bouAirNoC.inlet, conAirNoC.outlet);
connect(bouAirWithC.inlet, conAirWithC.outlet);
connect(bouDryAirNoC.inlet, conDryAirNoC.outlet);
connect(bouDryAirWithC.inlet, conDryAirWithC.outlet);
end AirToOutletFlowReversal;
Validation model for inlet to air with dry air medium
Information
This validation test is identical to
Annex60.Fluid.FMI.Conversion.Validation.InletToAirMoistAir
except that it uses a medium model without moisture.
Hence, it tests whether the water vapor connectors are correctly removed.
Extends from Annex60.Fluid.FMI.Conversion.Validation.InletToAirMoistAir (Validation model for inlet to Annex60.Media.Air conversion without trace substances).
Parameters
Type | Name | Default | Description |
replaceable package Medium | Air | Medium model |
Boolean | use_p_in | false | = true to use a pressure from connector, false to output Medium.p_default |
Connectors
Type | Name | Description |
replaceable package Medium | Medium model |
Modelica definition
Validation model for inlet to air with dry air medium and CO2
Information
This validation test is identical to
Annex60.Fluid.FMI.Conversion.Validation.InletToAirMoistAirCO2
except that it uses a medium model without moisture.
Hence, it tests whether the water vapor connectors are correctly removed.
Extends from Annex60.Fluid.FMI.Conversion.Validation.InletToAirMoistAirCO2 (Validation model for inlet to Annex60.Media.Air conversion with C02 trace substances).
Parameters
Type | Name | Default | Description |
Boolean | use_p_in | false | = true to use a pressure from connector, false to output Medium.p_default |
Modelica definition
Validation model for inlet to Annex60.Media.Air conversion without trace substances
Information
This example validates the conversion model
Annex60.Fluid.FMI.Conversion.InletToAir
.
The medium used is
Annex60.Media.Air
without trace substances.
The top model has no reverse flow, whereas the
bottom model has reverse flow.
Extends from Modelica.Icons.Example (Icon for runnable examples).
Parameters
Type | Name | Default | Description |
replaceable package Medium | Annex60.Media.Air | Medium model |
Boolean | use_p_in | false | = true to use a pressure from connector, false to output Medium.p_default |
Connectors
Type | Name | Description |
replaceable package Medium | Medium model |
Modelica definition
model InletToAirMoistAir
extends Modelica.Icons.Example;
replaceable package Medium =
Annex60.Media.Air
constrainedby Modelica.Media.Interfaces.PartialMedium ;
parameter Boolean use_p_in = false
;
Modelica.Blocks.Sources.Constant m_flow(k=0.2) ;
Modelica.Blocks.Sources.Constant T(k=295.13) ;
Annex60.Fluid.FMI.Conversion.InletToAir conAir(
redeclare package Medium =
Medium, allowFlowReversal=false)
;
Source_T sou(
redeclare package Medium =
Medium,
use_p_in=use_p_in,
allowFlowReversal=false)
;
Modelica.Blocks.Sources.Constant pIn(k=100000) ;
Modelica.Blocks.Sources.Constant X_w_in(k=0.01) ;
Modelica.Blocks.Sources.Constant C[Medium.nC](
each k=0.01)
if
Medium.nC > 0 ;
Annex60.Fluid.FMI.Conversion.InletToAir conAirRevFlo(
redeclare package
Medium =
Medium, allowFlowReversal=true)
;
Source_T souRev(
redeclare package Medium =
Medium,
use_p_in=use_p_in,
allowFlowReversal=true)
;
Modelica.Blocks.Sources.Constant TRev(k=283.15)
;
Modelica.Blocks.Sources.Constant X_w(k=0.012)
;
equation
connect(m_flow.y, sou.m_flow_in);
connect(sou.outlet, conAir.inlet);
connect(sou.T_in, T.y);
connect(pIn.y, sou.p_in);
connect(X_w_in.y, sou.X_w_in);
connect(C.y, sou.C_in);
connect(m_flow.y, souRev.m_flow_in);
connect(souRev.outlet, conAirRevFlo.inlet);
connect(souRev.T_in, T.y);
connect(pIn.y, souRev.p_in);
connect(X_w_in.y, souRev.X_w_in);
connect(C.y, souRev.C_in);
connect(TRev.y, conAirRevFlo.TAirZon);
connect(X_w.y, conAirRevFlo.X_wZon);
end InletToAirMoistAir;
Validation model for inlet to Annex60.Media.Air conversion with C02 trace substances
Information
This example validates the conversion model
Annex60.Fluid.FMI.Conversion.InletToAir
.
It is identical to
Annex60.Fluid.FMI.Conversion.Validation.InletToAirMoistAir
except that
the medium has C02
trace substances.
Extends from Annex60.Fluid.FMI.Conversion.Validation.InletToAirDryAir (Validation model for inlet to air with dry air medium).
Parameters
Type | Name | Default | Description |
Boolean | use_p_in | false | = true to use a pressure from connector, false to output Medium.p_default |
Modelica definition
Information
Extends from Modelica.Blocks.Icons.Block (Basic graphical layout of input/output block).
Parameters
Type | Name | Default | Description |
replaceable package Medium | Modelica.Media.Interfaces.Pa... | Medium in the component |
Connectors
Type | Name | Description |
replaceable package Medium | Medium in the component |
Inlet | inlet | Fluid inlet |
Modelica definition
model BoundaryCondition
extends Modelica.Blocks.Icons.Block;
replaceable package Medium =
Modelica.Media.Interfaces.PartialMedium
;
final parameter Boolean use_p_in=false
;
Adaptors.Inlet bouInlAirNoC(
redeclare package Medium =
Medium,
allowFlowReversal=true,
use_p_in=false) ;
Sources.Boundary_pT bou(
redeclare package Medium =
Medium,
nPorts=1,
p=Medium.p_default + 1000,
T=298.15,
C=
fill(0.7, Medium.nC)) ;
Interfaces.Inlet inlet(
use_p_in=use_p_in,
redeclare package Medium =
Medium,
allowFlowReversal=true)
;
FixedResistances.PressureDrop res(
redeclare package Medium =
Medium,
m_flow_nominal=0.1,
dp_nominal=1000,
linearized=true) ;
equation
connect(bouInlAirNoC.inlet, inlet);
connect(res.port_b, bou.ports[1]);
connect(res.port_a, bouInlAirNoC.port_b);
end BoundaryCondition;
http://iea-annex60.org