Skip to content

Commit

Permalink
Dynamic pressure fixes (#147)
Browse files Browse the repository at this point in the history
* Documentation: fix some spellings and add hyperlinks to components

* Fix typo

* Add explanation of sign of velocity

* Update documentation of nozzle

* Another update of docu on dynamic pressure components

* Fix typo

---------

Co-authored-by: tobolar <[email protected]>
  • Loading branch information
nieweber and tobolar authored Sep 13, 2023
1 parent 05e7f58 commit fde5d85
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 12 deletions.
10 changes: 5 additions & 5 deletions ThermofluidStream/Boundaries/DynamicPressureInflow.mo
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ equation
if extrapolateQuadratic then
v_mean = (v_out+v_in)*0.5;
else
//the mean velocity is limited to half the velcocity that is bound to the actual mass-flow rate
//the mean velocity is limited to half the velocity that is bound to the actual mass-flow rate
v_mean =Undirected.Internal.regStep(
sign(v_in)*m_flow,
(v_out + v_in)*0.5,
Expand Down Expand Up @@ -111,11 +111,11 @@ equation
color={0,127,0},
thickness=0.5)}),
Documentation(info="<html>
<p>This Inflow Boundary is supposed to start an area of the model where dynamic pressure is taken into account. The area is ended with DynamicPressureOutflows. </p>
<p>This inflow boundary is supposed to start an area of the model where dynamic pressure is taken into account. The area is ended with <a href=\"modelica://ThermofluidStream.Boundaries.DynamicPressureOutflow\">DynamicPressureOutflows</a>.</p>
<p>Components that take dynamic pressure into account (marked with green symbols) should only be used in areas surrounded by DynamicPressureInflows and DynamicPressureOutflows. </p>
<p>The components input velocity can be set to a fixed value or given by a signal. From this reference inflow velocity the medium is accelerated to fit the outflow velocity, that is computed by the Area of the Component. </p>
<p>The components input velocity can be set to a fixed value or given by a signal. From this reference inflow velocity the medium is accelerated to fit the outflow velocity, that is computed by the area of the component. The sign of the velocity is defined to match the sign of the mass-flow rate at the inlet.</p>
<p>The pressure difference resulting from the velocity difference is based on the total pressure balance, implicitly assuming a nozzle/diffusor of suitable area ratio. When the sign of the velocity does not match the sign of the mass-flow rate, this assumption cannot be upheld. The model then extrapolates the dynamic pressure difference in order to maintain a stable and well-natured behavior but its validity is lost. </p>
<p>The area can be set to a fixed value or given by a signal, representing a variable-area inlets.</p>
<p>In general the component has a non-linear equation system of size 1, because it computes the outlet velocity based on the outlet density. This can be resolved by setting Advanced-&gt;assumeConstantDensity=true (default: false), because then only the inlet density is used in the whole component.</p>
<p>The area can be set to a fixed value or given by a signal, representing a variable-area inlet.</p>
<p>By default, the density is assumed to be constant across the component and only the inlet density is used for the calculation of the velocity. This assumption can be reverted by setting <code>assumeConstantDensity = false</code>. This will lead to a non-linear equation system of size 1, as the outlet velocity is calculated based on the outlet density.</p>
</html>"));
end DynamicPressureInflow;
8 changes: 4 additions & 4 deletions ThermofluidStream/Boundaries/DynamicPressureOutflow.mo
Original file line number Diff line number Diff line change
Expand Up @@ -114,11 +114,11 @@ equation
color={0,127,0},
thickness=0.5)}),
Documentation(info="<html>
<p>This Outflow Boundary is supposed to end a area of the model where dynamic pressure is taken into account. The area is started with DynamicPressureInflows. </p>
<p>This outflow boundary is supposed to end an area of the model where dynamic pressure is taken into account. The area is started with <a href=\"modelica://ThermofluidStream.Boundaries.DynamicPressureInflow\">DynamicPressureInflows</a>. </p>
<p>Components that take dynamic pressure into account (marked with green symbols) should only be used in areas surrounded by DynamicPressureInflows and DynamicPressureOutflows. </p>
<p>The components output velocity can be set to a fixed Value or given by a signal. From the inflow velocity, that is computed by the Area of the Component, the flow is decelerated to the reference outflow velocity.</p>
<p>The components output velocity can be set to a fixed value or given by a signal. From the inflow velocity, that is computed by the area of the component, the flow is decelerated to the reference outflow velocity. The sign of the velocity is defined to match the sign of the mass-flow rate at the inlet.</p>
<p>The pressure difference resulting from the velocity difference is based on the total pressure balance, implicitly assuming a nozzle/diffusor of suitable area ratio. When the sign of the velocity does not match the sign of the mass-flow rate, this assumption cannot be upheld. The model then extrapolates the dynamic pressure difference in order to maintain a stable and well-natured behavior but its validity is lost. </p>
<p>The area can be set to a fixed value or given by a signal, representing a variable-area outlets.</p>
<p>In general the component has a non-linear equation system of size 1, because it computes the outlet velocity based on the outlet density. This can be resolved by setting Advanced-&gt;assumeConstantDensity=true (default: false), because then only the inlet density is used in the whole component.</p>
<p>The area can be set to a fixed value or given by a signal, representing a variable-area outlet.</p>
<p>By default, the density is assumed to be constant across the component and only the inlet density is used for the calculation of the velocity. This assumption can be reverted by setting <code>assumeConstantDensity = false</code>. This will lead to a non-linear equation system of size 1, as the outlet velocity is calculated based on the outlet density.</p>
</html>"));
end DynamicPressureOutflow;
8 changes: 5 additions & 3 deletions ThermofluidStream/Processes/Nozzle.mo
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ model Nozzle "Model for dynamic pressure difference"
annotation(Dialog(tab="Advanced"));

protected
SI.Density rho_in = Medium.density(inlet.state) "density of medium entering";
SI.Density rho_out "density of medium exiting";
SI.Density rho_in = Medium.density(inlet.state) "Density of medium entering";
SI.Density rho_out "Density of medium exiting";

SI.Velocity v_in;
SI.Velocity v_out;
Expand Down Expand Up @@ -67,6 +67,8 @@ equation
lineThickness=0.5)}),
Diagram(coordinateSystem(preserveAspectRatio=false)),
Documentation(info="<html>
<p>Implementation of nozzle taking gas dynamic effects into account.</p>
<p>Implementation of a nozzle taking gas dynamic effects into account.</p>
<p>By default, the density is assumed to be constant across the component. This assumption can be reverted by setting <code>assumeConstantDensity = false</code> and hence the outlet velocity is computed by the outlet density. Beware that this will lead to a non-linear equation system in the component.</p>
<p>By definition, the sign of the velocity matches the sign of the mass-flow rate at the inlet.</p>
</html>"));
end Nozzle;

0 comments on commit fde5d85

Please sign in to comment.