Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix PCV #151

Merged
merged 4 commits into from
Sep 29, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 7 additions & 6 deletions ThermofluidStream/FlowControl/PCV.mo
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ model PCV "Pressure and pressure-drop control valve"

import Mode = ThermofluidStream.FlowControl.Internal.Types.PressureControlValveMode;

Modelica.Blocks.Interfaces.RealInput pressure_set_var(unit="Pa") if pressureFromInput "Output pressure [Pa]"
Modelica.Blocks.Interfaces.RealInput pressure_set_var(unit="Pa") if pressureFromInput "Pressure(-drop) set value [Pa]"
annotation (Placement(
transformation(extent={{-20,-20},{20,20}},
rotation=270,
Expand All @@ -13,7 +13,7 @@ model PCV "Pressure and pressure-drop control valve"
rotation=270,
origin={0,80})));

parameter Mode mode=Mode.drop "Valve mode";
parameter Mode mode = Mode.drop "Valve mode";
parameter Boolean pressureFromInput = false "Enable pressure difference input";
parameter SI.AbsolutePressure pressure_set_par = 0 "Setpoint for pressure difference"
annotation(Dialog(enable=not pressureFromInput));
Expand Down Expand Up @@ -43,6 +43,7 @@ equation
end if;

h_out = h_in;
Xi_out = Xi_in;

annotation (
Icon(coordinateSystem(preserveAspectRatio=false), graphics={
Expand Down Expand Up @@ -81,9 +82,9 @@ equation
color={28,108,200},
thickness=0.5)}), Diagram(coordinateSystem(preserveAspectRatio=false)),
Documentation(info="<html>
<p>This component can be used to emulate a pressure-drop or output-pressure regulated control valve, depending on its mode.</p>
<p>dp or p_out can be set directly, depending on the valve mode. Mass-flow will be determined by its usual dynamic.</p>
<p>Setting dp instead of p_out has advantages, when p_out is determined by a volume at the outlet (for instance an accumulator).</p>
<p>dp is normalized, such that it cannot create pressure and it is zero for zero or negative massflow. </p>
<p>This component can be used to emulate a pressure-drop or output-pressure regulated control valve, depending on the chosen valve mode.</p>
<p>Depending on the parameter <code>mode</code>, either the pressure at the outlet <code>p_out</code> or the pressure difference <code>dp</code> between inlet and outlet can be stipulated. This is done either by parameter <code>pressure_set_par</code> or via input connector <code>pressure_set_var</code> when setting <code>pressureFromInput = true</code>. The resulting mass flow will be determined by its usual dynamics.</p>
<p>Setting <code>dp</code> instead of <code>p_out</code> has advantages, when <code>p_out</code> is determined by a volume at the outlet (for instance an accumulator).</p>
<p>The pressure difference <code>dp</code> is normalized, such that it cannot create pressure and it is zero for zero or negative mass flow. </p>
</html>"));
end PCV;