Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
TAeZoSysPro
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
TAeZoSysPro
TAeZoSysPro
Commits
8a526fbc
Commit
8a526fbc
authored
2 years ago
by
Felix MARSOLLIER
Browse files
Options
Downloads
Patches
Plain Diff
Removal of reference to X from ThermodynamicState record to handle media where X is not present
parent
53fb7ef2
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
FluidDynamics/Components/Orifices/Opening.mo
+11
-11
11 additions, 11 deletions
FluidDynamics/Components/Orifices/Opening.mo
with
11 additions
and
11 deletions
FluidDynamics/Components/Orifices/Opening.mo
+
11
−
11
View file @
8a526fbc
...
...
@@ -13,8 +13,8 @@ model Opening
parameter Dynamics massDynamics = Dynamics.SteadyStateInitial "Formulation of mass balance";
parameter Modelica.SIunits.Velocity Vel_start = 0.0 "Start value for velocity, if not steady state";
parameter Modelica.SIunits.Length Alt_a = 1.0 "Altitude of po
int
a";
parameter Modelica.SIunits.Length Alt_b = 1.0 "Altitude of po
int
b";
parameter Modelica.SIunits.Length Alt_a = 1.0 "Altitude of po
rt_
a";
parameter Modelica.SIunits.Length Alt_b = 1.0 "Altitude of po
rt_
b";
parameter Modelica.SIunits.Length Alt_opening = 1.0 "Altitude at the opening center";
// Internal variables
...
...
@@ -33,9 +33,9 @@ model Opening
// Imported modules
TAeZoSysPro.FluidDynamics.Interfaces.FlowPort_a port_a(redeclare package Medium = Medium) annotation (
Placement(visible = true, transformation(origin = {-58, 0}, extent = {{-10, -10}, {10, 10}}, rotation = 0), iconTransformation(origin = {-
7
0, 0}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
Placement(visible = true, transformation(origin = {-58, 0}, extent = {{-10, -10}, {10, 10}}, rotation = 0), iconTransformation(origin = {-
9
0, 0}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
TAeZoSysPro.FluidDynamics.Interfaces.FlowPort_b port_b(redeclare package Medium = Medium) annotation (
Placement(visible = true, transformation(origin = {38, 0}, extent = {{-10, -10}, {10, 10}}, rotation = 0), iconTransformation(origin = {
7
0, 0}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
Placement(visible = true, transformation(origin = {38, 0}, extent = {{-10, -10}, {10, 10}}, rotation = 0), iconTransformation(origin = {
9
0, 0}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
protected
parameter Modelica.SIunits.Height H_fluidStream = H * Cd ^0.5 "Minimal height between top and bottom flow path";
...
...
@@ -59,8 +59,8 @@ equation
state_b = Medium.setState_dTX(d = sum(port_b.d), T = port_b.T, X = port_b.d / sum(port_b.d));
// pressure reconstruction
p_a = Medium.pressure(state_a)
+
sum(port_a.d) * Modelica.Constants.g_n * (Alt_a-Alt_opening);
p_b = Medium.pressure(state_b)+ sum(port_b.d) * Modelica.Constants.g_n * (Alt_b-Alt_opening);
p_a = Medium.pressure(state_a)
+
sum(port_a.d) * Modelica.Constants.g_n * (Alt_a-Alt_opening);
p_b = Medium.pressure(state_b)
+ sum(port_b.d) * Modelica.Constants.g_n * (Alt_b-Alt_opening);
dp = p_a - p_b;
// specific enthalpy reconstruction
...
...
@@ -85,8 +85,8 @@ equation
mX_flow_i = {m_flow_i[i] * TAeZoSysPro.FluidDynamics.Utilities.regStep(
x = Vel[i],
x_small = 1e-14,
y1 =
X_a
,
y2 =
X_b
) for i in 1:N} ;
y1 =
port_a.d/sum(port_a.d)
,
y2 =
port_b.d/sum(port_b.d)
) for i in 1:N} ;
m_flow = sum(m_flow_i) ;
...
...
@@ -99,7 +99,7 @@ equation
gamma = Medium.isentropicExponent(state) /* gamma is supposed contant along the flow */;
// Mach number calculation: The pressure at the orifice is the downstream node pressure
M = min(1, (2 / (gamma - 1) * ((min(p_a, p_b) / max(p_a, p_b)) ^ ((1 - gamma) / gamma) - 1)) ^ 0.5);
assert(M
<
=0.3,"
Mach
number
>
0.3,
l
e flow becomes compressible. The assumption of uncrompressible flow is not valid", AssertionLevel.warning) ;
assert(M
<
=0.3,"
Mach
number
>
0.3,
th
e flow becomes compressible. The assumption of uncrompressible flow is not valid", AssertionLevel.warning) ;
// Port handover
port_a.m_flow = {sum(mX_flow_i[:, i]) for i in 1:Medium.nX} ;
...
...
@@ -113,7 +113,7 @@ equation
y2 = h_b);
port_a.H_flow + port_b.H_flow = 0;
annotation(defaultComponentName="
O
pening",
annotation(defaultComponentName="
o
pening",
Documentation(info = "
<html>
<head>
<title>
VerticalOpening
</title>
...
...
@@ -198,4 +198,4 @@ Documentation(info = "<html>
Icon(graphics = {Line(origin = {0, 50}, points = {{0, 30}, {0, -20}}, thickness = 2), Line(origin = {0, -50}, points = {{0, 20}, {0, -30}}, thickness = 2), Text(origin = {16, -113}, extent = {{-116, 33}, {84, 13}}, textString = "A=%A"), Text(origin = {-43, 88}, extent = {{-57, 12}, {143, -8}}, textString = "%name"), Line(points = {{0, 24}, {0, -24}}, color = {255, 0, 0}, arrow = {Arrow.Filled, Arrow.Filled}, arrowSize = 5), Text(origin = {120, 39}, extent = {{-116, 33}, {-20, 13}}, textString = "H=%H"), Line(points = {{-40, 0}, {40, 0}}, pattern = LinePattern.Dash, arrow = {Arrow.Filled, Arrow.Filled}), Line(origin = {-1, 27.24}, points = {{-39, 12.7571}, {-19, -7.24287}, {1, -15.2429}, {21, -7.24287}, {41, 12.7571}}, pattern = LinePattern.Dash, arrow = {Arrow.Filled, Arrow.Filled}, smooth = Smooth.Bezier), Line(origin = {1.02, -27.23}, rotation = 180, points = {{-39, 12.7571}, {-19, -7.24287}, {1, -15.2429}, {21, -7.24287}, {41, 12.7571}}, pattern = LinePattern.Dash, arrow = {Arrow.Filled, Arrow.Filled}, smooth = Smooth.Bezier), Line(origin = {6, 32}, points = {{-6, -8}, {44, 22}}, color = {255, 0, 0})}, coordinateSystem(initialScale = 0.1)));
end Opening;
\ No newline at end of file
end Opening;
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment