forked from mtiller/OpenCollaboration
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathAnnularFlow1DBase.mo
123 lines (121 loc) · 6.13 KB
/
AnnularFlow1DBase.mo
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
within Ethan2;
partial model AnnularFlow1DBase
"Basic interface for 1-dimensional Annular water/steam fluid flow models"
replaceable package Medium = ThermoPower3.Water.StandardWater constrainedby
Modelica.Media.Interfaces.PartialMedium "Medium model";
extends ThermoPower3.Icons.Water.Tube;
import ThermoPower3.Choices.Flow1D.FFtypes;
import ThermoPower3.Choices.Flow1D.HCtypes;
parameter Integer N(min=2) = 2 "Number of nodes for thermal variables";
parameter Integer Nt=1 "Number of tubes in parallel";
parameter Modelica.SIunits.Distance L "Tube length" annotation (Evaluate=true);
parameter Modelica.SIunits.Position H=0 "Elevation of outlet over inlet";
parameter Modelica.SIunits.Area A "Cross-sectional area (single tube)";
parameter Modelica.SIunits.Length omega
"Perimeter of heat transfer surface on the internal tubes";
parameter Modelica.SIunits.Length Dhyd1
"Hydraulic Diameter (wall 1) (single tube)";
parameter Modelica.SIunits.Length Dhyd2
"Hydraulic Diameter (wall 2) (single tube)";
parameter Modelica.SIunits.MassFlowRate wnom "Nominal mass flowrate (total)";
parameter FFtypes FFtype=FFtypes.NoFriction "Friction Factor Type"
annotation (Evaluate=true);
parameter Real Kfnom(
unit="Pa.kg/(m3.kg2/s2)",
min=0) = 0 "Nominal hydraulic resistance coefficient";
parameter Modelica.SIunits.Pressure dpnom=0
"Nominal pressure drop (friction term only!)";
parameter ThermoPower3.Density rhonom=0 "Nominal inlet density";
parameter Real Cfnom=0 "Nominal Fanning friction factor";
parameter Real e=0 "Relative roughness (ratio roughness/diameter)";
parameter Boolean DynamicMomentum=false "Inertial phenomena accounted for"
annotation (Evaluate=true);
parameter HCtypes HydraulicCapacitance=HCtypes.Downstream
"Location of the hydraulic capacitance";
parameter Boolean avoidInletEnthalpyDerivative=true
"Avoid inlet enthalpy derivative";
parameter Boolean allowFlowReversal=system.allowFlowReversal
"= true to allow flow reversal, false restricts to design direction";
outer ThermoPower3.System system "System wide properties";
parameter ThermoPower3.Choices.FluidPhase.FluidPhases FluidPhaseStart=
ThermoPower3.Choices.FluidPhase.FluidPhases.Liquid
"Fluid phase (only for initialization!)"
annotation (Dialog(tab="Initialisation"));
parameter Modelica.SIunits.Pressure pstart=1e5 "Pressure start value"
annotation (Dialog(tab="Initialisation"));
parameter Modelica.SIunits.SpecificEnthalpy hstartin=if FluidPhaseStart ==
ThermoPower3.Choices.FluidPhase.FluidPhases.Liquid then 1e5 else if
FluidPhaseStart == ThermoPower3.Choices.FluidPhase.FluidPhases.Steam
then 3e6 else 1e6 "Inlet enthalpy start value"
annotation (Dialog(tab="Initialisation"));
parameter Modelica.SIunits.SpecificEnthalpy hstartout=if FluidPhaseStart ==
ThermoPower3.Choices.FluidPhase.FluidPhases.Liquid then 1e5 else if
FluidPhaseStart == ThermoPower3.Choices.FluidPhase.FluidPhases.Steam
then 3e6 else 1e6 "Outlet enthalpy start value"
annotation (Dialog(tab="Initialisation"));
parameter Modelica.SIunits.SpecificEnthalpy hstart[N]=linspace(
hstartin,
hstartout,
N) "Start value of enthalpy vector (initialized by default)"
annotation (Dialog(tab="Initialisation"));
parameter Real wnf=0.02
"Fraction of nominal flow rate at which linear friction equals turbulent friction";
parameter Real Kfc=1 "Friction factor correction coefficient";
parameter ThermoPower3.Choices.Init.Options initOpt=ThermoPower3.Choices.Init.Options.noInit
"Initialisation option" annotation (Dialog(tab="Initialisation"));
constant Real g=Modelica.Constants.g_n;
function squareReg = ThermoPower3.Functions.squareReg;
ThermoPower3.Water.FlangeA infl(
h_outflow(start=hstartin),
redeclare package Medium = Medium,
m_flow(start=wnom, min=if allowFlowReversal then -Modelica.Constants.inf
else 0)) annotation (Placement(transformation(extent={{-120,-20},{-80,
20}}, rotation=0)));
ThermoPower3.Water.FlangeB outfl(
h_outflow(start=hstartout),
redeclare package Medium = Medium,
m_flow(start=-wnom, max=if allowFlowReversal then +Modelica.Constants.inf
else 0)) annotation (Placement(transformation(extent={{80,-20},{120,20}},
rotation=0)));
replaceable ThermoPower3.Thermal.DHT wall1(N=N) annotation (Dialog(enable=
false), Placement(transformation(extent={{-40,40},{40,60}},
rotation=0)));
Modelica.SIunits.Power Q
"Total heat flow through the lateral boundary (all Nt tubes)";
Modelica.SIunits.Time Tr "Residence time";
final parameter Real dzdx=H/L "Slope" annotation (Evaluate=true);
final parameter Modelica.SIunits.Length l=L/(N - 1)
"Length of a single volume" annotation (Evaluate=true);
replaceable ThermoPower3.Thermal.DHT wall2(N=N) annotation (Dialog(enable=
false), Placement(transformation(extent={{-40,-62},{40,-42}},
rotation=0)));
annotation (
Documentation(info="<HTML>
Basic interface of the <tt>Flow1D</tt> models, containing the common parameters and connectors.
</HTML>
",
revisions="<html>
<ul>
<li><i>23 Jul 2007</i>
by <a href=\"mailto:[email protected]\">Francesco Casella</a>:<br>
Added hstart for more detailed initialization of enthalpy vector.</li>
<li><i>30 May 2005</i>
by <a href=\"mailto:[email protected]\">Francesco Casella</a>:<br>
Initialisation support added.</li>
<li><i>24 Mar 2005</i>
by <a href=\"mailto:[email protected]\">Francesco Casella</a>:<br>
<tt>FFtypes</tt> package and <tt>NoFriction</tt> option added.</li>
<li><i>16 Dec 2004</i>
by <a href=\"mailto:[email protected]\">Francesco Casella</a>:<br>
Standard medium definition added.</li>
<li><i>8 Oct 2004</i>
by <a href=\"mailto:[email protected]\">Francesco Casella</a>:<br>
Created.</li>
</ul>
</html>"),
Diagram(coordinateSystem(preserveAspectRatio=false, extent={{-100,-100},{
100,100}}),
graphics),
Icon(coordinateSystem(preserveAspectRatio=false, extent={{-100,-100},{100,100}}),
graphics));
end AnnularFlow1DBase;