Ticket #2745: system2.mo

File system2.mo, 1.4 KB (added by Per Östlund, 11 years ago)

Minimal model of System2

Line 
1package Modelica
2 package Media
3 package Interfaces
4 partial package PartialMedium
5 constant Real h_default = specificEnthalpy_pTX();
6
7 replaceable partial function specificEnthalpy
8 output Real h;
9 end specificEnthalpy;
10
11 replaceable function specificEnthalpy_pTX
12 output Real h;
13 algorithm
14 h := specificEnthalpy();
15 end specificEnthalpy_pTX;
16 end PartialMedium;
17 end Interfaces;
18 end Media;
19end Modelica;
20
21package Buildings
22 package Fluid
23 package Interfaces
24 model FourPort
25 replaceable package Medium1 = Modelica.Media.Interfaces.PartialMedium;
26 parameter Real h_outflow_a1_start = Medium1.h_default;
27 end FourPort;
28 end Interfaces;
29 end Fluid;
30
31 package Media
32 package GasesPTDecoupled
33 package MoistAirUnsaturated
34 extends Modelica.Media.Interfaces.PartialMedium;
35
36 redeclare function extends specificEnthalpy
37 algorithm
38 MoistAirUnsaturated.h_pTX();
39 end specificEnthalpy;
40
41 function h_pTX
42 end h_pTX;
43 end MoistAirUnsaturated;
44 end GasesPTDecoupled;
45 end Media;
46end Buildings;
47
48model System2
49 replaceable package MediumA = Buildings.Media.GasesPTDecoupled.MoistAirUnsaturated;
50 Buildings.Fluid.Interfaces.FourPort hex(redeclare package Medium1 = MediumA);
51end System2;