Skip to content
Draft
Show file tree
Hide file tree
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
21 changes: 7 additions & 14 deletions ThermofluidStream/Boundaries/DynamicPressureInflow.mo
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ model DynamicPressureInflow "Extension of (p,T) source to (p,T,velocity)"
annotation(Dialog(tab="Layout",group="Display parameters",enable=displayParameters),Evaluate=true, HideResult=true, choices(checkBox=true));
parameter Boolean displayOutletArea = true "= true, if outlet cross section area A_par is displayed"
annotation(Dialog(tab="Layout",group="Display parameters",enable=displayParameters),Evaluate=true, HideResult=true, choices(checkBox=true));
parameter Boolean displayInertance = false "= true, if inertance L is displayed"
annotation(Dialog(tab="Layout",group="Display parameters",enable=displayParameters),Evaluate=true, HideResult=true, choices(checkBox=true));
parameter Boolean displayInertance = false "DEPRECATED: =true will cause a warning, no longer has any other effect and will be removed in the next major release v2.0.0"
annotation(Dialog(tab="Layout",group="Display parameters"),Evaluate=true, HideResult=true);
final parameter Boolean dv_in = displayParameters and not velocityFromInput and displayInletVelocity "Display inlet velocity"
annotation(Evaluate=true, HideResult=true);
final parameter Boolean displayA = displayParameters and displayOutletArea and not areaFromInput "Display outlet cross section area"
Expand All @@ -38,18 +38,10 @@ model DynamicPressureInflow "Extension of (p,T) source to (p,T,velocity)"
compressibilityString
elseif displayA then
"A_out = %A_par"
elseif displayInertance then
"L = %L"
else "" annotation(Evaluate=true, HideResult=true);
final parameter String displayPos2=
if displayCompressibilityApproach and displayA then
"A_out = %A_par"
elseif displayInertance and not displayPos1 == "L = %L" then
"L = %L"
else "" annotation(Evaluate=true, HideResult=true);
final parameter String displayPos3=
if displayCompressibilityApproach and displayA and displayInertance then
"L = %L"
else "" annotation(Evaluate=true, HideResult=true);
//----------------------------------------------------------------

Expand All @@ -70,6 +62,11 @@ protected
SI.Velocity v_mean "Mean velocity";
SI.Velocity delta_v "Velocity difference";

initial equation
assert(not displayInertance,
"Parameter displayInertance is deprecated and has no effect. It will be removed in the next major release. Please remove modifier.",
level=AssertionLevel.warning);

equation

connect(A_var, A);
Expand Down Expand Up @@ -121,10 +118,6 @@ equation
extent={{-150,-140},{150,-170}},
textColor={0,0,0},
textString=displayPos2),
Text(visible=displayParameters,
extent={{-150,-180},{150,-210}},
textColor={0,0,0},
textString=displayPos3),
Text(visible=dv_in,
extent={{-210,-45},{-10,-75}},
textColor={0,0,0},
Expand Down
22 changes: 7 additions & 15 deletions ThermofluidStream/Boundaries/DynamicPressureOutflow.mo
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ model DynamicPressureOutflow "Extension of (p) sink to (p,velocity)"
annotation(Dialog(tab="Layout",group="Display parameters",enable=displayParameters),Evaluate=true, HideResult=true, choices(checkBox=true));
parameter Boolean displayOutletVelocity = true "= true, if outlet velocity v_out_par is displayed"
annotation(Dialog(tab="Layout",group="Display parameters",enable=displayParameters),Evaluate=true, HideResult=true, choices(checkBox=true));
parameter Boolean displayInertance = false "= true, if inertance L is displayed"
annotation(Dialog(tab="Layout",group="Display parameters",enable=displayParameters),Evaluate=true, HideResult=true, choices(checkBox=true));
parameter Boolean displayInertance = false "DEPRECATED: =true will cause a warning, no longer has any other effect and will be removed in the next major release v2.0.0"
annotation(Dialog(tab="Layout",group="Display parameters"),Evaluate=true, HideResult=true);
final parameter Boolean displayA = displayParameters and displayInletArea and not areaFromInput
annotation(Evaluate=true, HideResult=true);
final parameter Boolean dv_out = displayParameters and displayOutletVelocity and not velocityFromInput
Expand All @@ -38,20 +38,11 @@ model DynamicPressureOutflow "Extension of (p) sink to (p,velocity)"
compressibilityString
elseif displayA then
"A_in = %A_par"
elseif displayInertance then
"L = %L"
else ""
annotation(Evaluate=true, HideResult=true);
final parameter String displayPos2=
if displayCompressibilityApproach and displayA then
"A_in = %A_par"
elseif displayInertance and not displayPos1 == "L = %L" then
"L = %L"
else ""
annotation(Evaluate=true, HideResult=true);
final parameter String displayPos3=
if displayCompressibilityApproach and displayA and displayInertance then
"L = %L"
else ""
annotation(Evaluate=true, HideResult=true);
//----------------------------------------------------------------
Expand All @@ -74,6 +65,11 @@ protected
Medium.Density rho_out "Outlet density";
Medium.Density rho_mean "Mean density";

initial equation
assert(not displayInertance,
"Parameter displayInertance is deprecated and has no effect. It will be removed in the next major release. Please remove modifier.",
level=AssertionLevel.warning);

equation
connect(A_var, A);
if not areaFromInput then
Expand Down Expand Up @@ -123,10 +119,6 @@ equation
extent={{-150,-140},{150,-170}},
textColor={0,0,0},
textString=displayPos2),
Text(visible=displayParameters,
extent={{-150,-180},{150,-210}},
textColor={0,0,0},
textString=displayPos3),
Text(visible=dv_out,
extent={{210,-45},{15,-75}},
textColor={0,0,0},
Expand Down
19 changes: 7 additions & 12 deletions ThermofluidStream/Boundaries/Sink.mo
Original file line number Diff line number Diff line change
Expand Up @@ -21,19 +21,13 @@ the outlet the sink is connected to.
// ------ Parameter Display Configuration ------------------------
parameter Boolean displayPressure = true "= true, if pressure p0_par is displayed"
annotation(Dialog(tab="Layout",group="Display parameters",enable=displayParameters and not pressureFromInput),Evaluate=true, HideResult=true, choices(checkBox=true));
parameter Boolean displayInertance = false "= true, if inertance L is displayed"
annotation(Dialog(tab="Layout",group="Display parameters",enable=displayParameters),Evaluate=true, HideResult=true, choices(checkBox=true));
parameter Boolean displayInertance = false "DEPRECATED: =true will cause a warning, no longer has any other effect and will be removed in the next major release v2.0.0"
annotation(Dialog(tab="Layout",group="Display parameters"),Evaluate=true, HideResult=true);
final parameter Boolean displayP = displayPressure and not pressureFromInput
annotation(Evaluate=true, HideResult=true);
final parameter String displayPos1=
if displayP then
"p = %p0_par"
elseif displayInertance then
"L = %L"
else "";
final parameter String displayPos2=
if displayP and displayInertance then
"L = %L"
else "";
//-----------------------------------------------------------------

Expand All @@ -47,6 +41,11 @@ protected
SI.Pressure r "Inertial pressure";
Medium.AbsolutePressure p = Medium.pressure(inlet.state) "Steady state pressure";

initial equation
assert(not displayInertance,
"Parameter displayInertance is deprecated and has no effect. It will be removed in the next major release. Please remove modifier.",
level=AssertionLevel.warning);

equation
connect(p0_var, p0);
if not pressureFromInput then
Expand All @@ -68,10 +67,6 @@ equation
extent={{-150,-90},{150,-120}},
textColor={0,0,0},
textString=displayPos1),
Text(visible=displayParameters,
extent={{-150,-130},{150,-160}},
textColor={0,0,0},
textString=displayPos2),
Rectangle(
extent={{-56,76},{4,-84}},
lineColor={28,108,200},
Expand Down
23 changes: 7 additions & 16 deletions ThermofluidStream/Boundaries/Source.mo
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ the inlet the source is connected to.
annotation(Dialog(tab="Layout",group="Display parameters",enable=displayParameters and not xiFromInput),Evaluate=true, HideResult=true, choices(checkBox=true));
// parameter Boolean displayTemperatureOrEnthalpy = true "= true, if temperature T0_par or specific enthalpy h0_par is displayed"
// annotation(Dialog(tab="Layout",group="Display parameters",enable=displayParameters and not temperatureFromInput),Evaluate=true, HideResult=true, choices(checkBox=true));
parameter Boolean displayInertance = false "= true, if inertance L is displayed"
annotation(Dialog(tab="Layout",group="Display parameters",enable=displayParameters),Evaluate=true, HideResult=true, choices(checkBox=true));
parameter Boolean displayInertance = false "DEPRECATED: =true will cause a warning, no longer has any other effect and will be removed in the next major release v2.0.0"
annotation(Dialog(tab="Layout",group="Display parameters"),Evaluate=true, HideResult=true);
final parameter Boolean displayP = displayPressure and not pressureFromInput
annotation(Evaluate=true, HideResult=true);
final parameter Boolean displayT = displayTemperature and not temperatureFromInput and not setEnthalpy
Expand All @@ -61,8 +61,6 @@ the inlet the source is connected to.
"h = %h0_par"
elseif displayXi then
"Xi = %Xi0_par"
elseif displayInertance then
"L = %L"
else "";
final parameter String displayPos2=
if displayP and displayT then
Expand All @@ -71,19 +69,11 @@ the inlet the source is connected to.
"h = %h0_par"
elseif displayXi and (displayP or displayT or displayH) then
"Xi = %Xi0_par"
elseif displayInertance and (displayP or displayT or displayH or displayXi) then
"L = %L"
else "";
final parameter String displayPos3=
if displayXi and displayP and (displayT or displayH) then
"Xi = %Xi0_par"
elseif displayInertance and not displayPos2 == "L = %L" and not displayPos1 == "L = %L" then
"L = %L"
else "";
final parameter String displayPos4=
if displayP and (displayT or displayH) and displayXi and displayInertance then
"L = %L"
else "" annotation(Evaluate=true, HideResult=true);
//-----------------------------------------------------------------

Modelica.Blocks.Interfaces.RealInput p0_var(unit="Pa") if pressureFromInput "Pressure input connector [Pa]"
Expand All @@ -103,6 +93,11 @@ protected
Modelica.Blocks.Interfaces.RealInput h0(unit = "J/kg") "Internal enthalpy connector";
Modelica.Blocks.Interfaces.RealInput Xi0[Medium.nXi](each unit = "kg/kg") "Internal mass fractions connector";

initial equation
assert(not displayInertance,
"Parameter displayInertance is deprecated and has no effect. It will be removed in the next major release. Please remove modifier.",
level=AssertionLevel.warning);

equation
connect(T0_var, T0);
if not temperatureFromInput or setEnthalpy then
Expand Down Expand Up @@ -147,10 +142,6 @@ equation
extent={{-150,-170},{150,-200}},
textColor={0,0,0},
textString=displayPos3),
Text(visible=displayParameters,
extent={{-150,-240},{150,-210}},
textColor={0,0,0},
textString=displayPos4),
Rectangle(
extent={{0,76},{64,-84}},
lineColor={28,108,200},
Expand Down
22 changes: 8 additions & 14 deletions ThermofluidStream/Processes/Nozzle.mo
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ model Nozzle "Model for dynamic pressure difference"
annotation(Dialog(tab="Layout",group="Display parameters",enable=displayParameters),Evaluate=true, HideResult=true, choices(checkBox=true));
parameter Boolean displayOutletArea = true "= true, if outlet area A_out is displayed"
annotation(Dialog(tab="Layout",group="Display parameters",enable=displayParameters),Evaluate=true, HideResult=true, choices(checkBox=true));
parameter Boolean displayInertance = false "=true, if inertance L is displayed"
annotation(Dialog(tab="Layout",group="Display parameters",enable=displayParameters),Evaluate=true, HideResult=true, choices(checkBox=true));
parameter Boolean displayInertance = false "DEPRECATED: =true will cause a warning, no longer has any other effect and will be removed in the next major release v2.0.0"
annotation(Dialog(tab="Layout",group="Display parameters"),Evaluate=true, HideResult=true);
final parameter Boolean dA_in = displayParameters and displayInletArea and not area_in_FromInput "Display inlet area"
annotation(Evaluate=true, HideResult=true);
final parameter Boolean dA_out = displayParameters and displayOutletArea and not area_out_FromInput "Display outlet area"
Expand All @@ -45,18 +45,10 @@ model Nozzle "Model for dynamic pressure difference"
compressibilityString
elseif displayA then
AreaString
elseif displayInertance then
"L = %L_value"
else "" annotation(Evaluate=true, HideResult=true);
final parameter String displayPos2=
if displayCompressibilityApproach and displayA then
AreaString
elseif displayInertance and not displayPos1 == "L = %L" then
"L = %L_value"
else "" annotation(Evaluate=true, HideResult=true);
final parameter String displayPos3=
if displayCompressibilityApproach and displayA and displayInertance then
"L = %L_value"
else "" annotation(Evaluate=true, HideResult=true);
//-----------------------------------------------------------------

Expand All @@ -76,6 +68,12 @@ protected
SI.Velocity v_in "Inlet velocity";
SI.Velocity v_out "Outlet velocity";
//Medium.Density rho_mean;

initial equation
assert(not displayInertance,
"Parameter displayInertance is deprecated and has no effect. It will be removed in the next major release. Please remove modifier.",
level=AssertionLevel.warning);

equation

connect(A_in_var, A_in_internal);
Expand Down Expand Up @@ -115,10 +113,6 @@ equation
extent={{-150,-110},{150,-140}},
textColor={0,0,0},
textString=displayPos2),
Text(visible=displayParameters,
extent={{-150,-150},{150,-180}},
textColor={0,0,0},
textString=displayPos3),
Ellipse(
extent={{-56,54},{64,-66}},
lineColor={28,108,200},
Expand Down
21 changes: 7 additions & 14 deletions ThermofluidStream/Undirected/Boundaries/BoundaryFore.mo
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ model BoundaryFore "Generic Boundary model (may act as source or sink)"
annotation(Dialog(tab="Layout",group="Display parameters",enable=displayParameters and not pressureFromInput),Evaluate=true, HideResult=true, choices(checkBox=true));
parameter Boolean displayTemperature = true "= true, if temperature T0_par is displayed"
annotation(Dialog(tab="Layout",group="Display parameters",enable=displayParameters and not temperatureFromInput),Evaluate=true, HideResult=true, choices(checkBox=true));
parameter Boolean displayInertance = false "= true, if inertance L is displayed"
annotation(Dialog(tab="Layout",group="Display parameters",enable=displayParameters),Evaluate=true, HideResult=true, choices(checkBox=true));
parameter Boolean displayInertance = false "DEPRECATED: =true will cause a warning, no longer has any other effect and will be removed in the next major release v2.0.0"
annotation(Dialog(tab="Layout",group="Display parameters"),Evaluate=true, HideResult=true);
final parameter Boolean displayP = displayPressure and not pressureFromInput
annotation(Evaluate=true, HideResult=true);
final parameter Boolean displayT = displayTemperature and not temperatureFromInput and not setEnthalpy
Expand All @@ -46,19 +46,11 @@ model BoundaryFore "Generic Boundary model (may act as source or sink)"
"p = %p0_par"
elseif displayT then
"T = %T0_par"
elseif displayInertance then
"L = %L"
else "";
final parameter String displayPos2=
if displayP and displayT then
"T = %T0_par"
elseif displayInertance and (displayP or displayT) then
"L = %L"
else "";
final parameter String displayPos3=
if displayP and displayT and displayInertance then
"L = %L"
else "" annotation(Evaluate=true, HideResult=true);
//-----------------------------------------------------------------

Modelica.Blocks.Interfaces.RealInput p0_var(unit="Pa") if pressureFromInput "Pressure input connector [Pa]"
Expand All @@ -83,6 +75,11 @@ protected

SI.Pressure r "Inertial pressure";

initial equation
assert(not displayInertance,
"Parameter displayInertance is deprecated and has no effect. It will be removed in the next major release. Please remove modifier.",
level=AssertionLevel.warning);

equation
connect(T0_var, T0);
if not temperatureFromInput or setEnthalpy then
Expand Down Expand Up @@ -124,10 +121,6 @@ equation
extent={{-150,-130},{150,-160}},
textColor={0,0,0},
textString=displayPos2),
Text(visible=displayParameters,
extent={{-150,-170},{150,-200}},
textColor={0,0,0},
textString=displayPos3),
Rectangle(
extent={{4,76},{-60,-84}},
lineColor={28,108,200},
Expand Down
21 changes: 7 additions & 14 deletions ThermofluidStream/Undirected/Boundaries/BoundaryRear.mo
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ model BoundaryRear "Generic Boundary model (may act as source or sink)"
annotation(Dialog(tab="Layout",group="Display parameters",enable=displayParameters and not pressureFromInput),Evaluate=true, HideResult=true, choices(checkBox=true));
parameter Boolean displayTemperature = true "= true, if temperature T0_par is displayed"
annotation(Dialog(tab="Layout",group="Display parameters",enable=displayParameters and not temperatureFromInput),Evaluate=true, HideResult=true, choices(checkBox=true));
parameter Boolean displayInertance = false "= true, if inertance L is displayed"
annotation(Dialog(tab="Layout",group="Display parameters",enable=displayParameters),Evaluate=true, HideResult=true, choices(checkBox=true));
parameter Boolean displayInertance = false "DEPRECATED: =true will cause a warning, no longer has any other effect and will be removed in the next major release v2.0.0"
annotation(Dialog(tab="Layout",group="Display parameters"),Evaluate=true, HideResult=true);
final parameter Boolean displayP = displayPressure and not pressureFromInput
annotation(Evaluate=true, HideResult=true);
final parameter Boolean displayT = displayTemperature and not temperatureFromInput and not setEnthalpy
Expand All @@ -46,19 +46,11 @@ model BoundaryRear "Generic Boundary model (may act as source or sink)"
"p = %p0_par"
elseif displayT then
"T = %T0_par"
elseif displayInertance then
"L = %L"
else "";
final parameter String displayPos2=
if displayP and displayT then
"T = %T0_par"
elseif displayInertance and (displayP or displayT) then
"L = %L"
else "";
final parameter String displayPos3=
if displayP and displayT and displayInertance then
"L = %L"
else "" annotation(Evaluate=true, HideResult=true);
//-----------------------------------------------------------------

Modelica.Blocks.Interfaces.RealInput p0_var(unit="Pa") if pressureFromInput "Pressure input connector [Pa]"
Expand All @@ -82,6 +74,11 @@ protected

SI.Pressure r "Inertial pressure";

initial equation
assert(not displayInertance,
"Parameter displayInertance is deprecated and has no effect. It will be removed in the next major release. Please remove modifier.",
level=AssertionLevel.warning);

equation
connect(T0_var, T0);
if not temperatureFromInput or setEnthalpy then
Expand Down Expand Up @@ -123,10 +120,6 @@ equation
extent={{-150,-130},{150,-160}},
textColor={0,0,0},
textString=displayPos2),
Text(visible=displayParameters,
extent={{-150,-170},{150,-200}},
textColor={0,0,0},
textString=displayPos3),
Rectangle(
extent={{0,76},{64,-84}},
lineColor={28,108,200},
Expand Down
Loading