diff --git a/README.md b/README.md index d82c500c..fc2fffdd 100644 --- a/README.md +++ b/README.md @@ -33,7 +33,7 @@ The DLR ThermoFluid Stream Library uses a [innovative computational scheme](http Watch the introductory video from the 2021 Modelica Conference and read the corresponding paper in MDPI electronics (short version): -IMAGE ALT TEXT HERE ## License, Terms of Use, Literature diff --git a/ThermofluidStream/DropOfCommons.mo b/ThermofluidStream/DropOfCommons.mo index 1fb66d70..41e2a712 100644 --- a/ThermofluidStream/DropOfCommons.mo +++ b/ThermofluidStream/DropOfCommons.mo @@ -20,9 +20,9 @@ model DropOfCommons "Model for global parameters" parameter AssertionLevel assertionLevel = AssertionLevel.error "Global assertion level"; - parameter Boolean displayInstanceNames = true "= true, if ThermofluidStream instance names are displayed" annotation(Dialog(group="Layout"),Evaluate=true, HideResult=true, choices(checkBox=true)); - parameter Boolean displayParameters = true "= true, if displaying parameters is enabled" annotation(Dialog(group="Layout"),Evaluate=true, HideResult=true, choices(checkBox=true)); - final parameter Integer instanceNameColor[3] = {28,108,200}; // Default Color: {28,108,200} + parameter Boolean displayInstanceNames = false "= true, if ThermofluidStream instance names are displayed" annotation(Dialog(group="Layout"),Evaluate=true, HideResult=true, choices(checkBox=true)); + parameter Boolean displayParameters = false "= true, if displaying parameters is enabled" annotation(Dialog(group="Layout"),Evaluate=true, HideResult=true, choices(checkBox=true)); + final parameter Integer instanceNameColor[3] = {28,108,200}; // {28,108,200} annotation (defaultComponentName="dropOfCommons", defaultComponentPrefixes="inner", @@ -57,17 +57,5 @@ to specify system properties.",Icon(coordinateSystem(preserveAspectRatio=false), coordinateSystem(preserveAspectRatio=false)), Documentation(revisions="

(c) 2020-2021, DLR, Institute of System Dynamics and Control

-", info=" -

The DropOfCommons defines global parameters and settings for simulation models. This model serves several purposes:

- -

Since the global parameters defined in DropOfCommons are used by multiple ThermofluidStream components, exactly one instance of this model needs to be present at the top level of a simulation model. The basic declaration is:

-

inner ThermofluidStream.DropOfCommons dropOfCommons

-

Note, it must be an inner declaration with instance name dropOfCommons so that all components of a ThermofluidStream model can reference it. When dragging the "DropOfCommons" object from the package browser into the diagram layer, this declaration is automatically generated (defined via annotations in the model).

-

All flow, density, pressure, and visualization parameters in a simulation model are resolved relative to the settings in this dropOfCommons instance. Adjusting these parameters allows controlling global simulation behavior, visualization preferences, and regularization methods consistently across all components.

")); end DropOfCommons; diff --git a/ThermofluidStream/Examples/HeatPump.mo b/ThermofluidStream/Examples/HeatPump.mo index b601b3df..b7da5641 100644 --- a/ThermofluidStream/Examples/HeatPump.mo +++ b/ThermofluidStream/Examples/HeatPump.mo @@ -81,7 +81,7 @@ model HeatPump Boundaries.Source source(redeclare package Medium = Air, T0_par=293.15, p0_par=100000) - annotation (Placement(transformation(extent={{-160,86},{-140,106}}))); + annotation (Placement(transformation(extent={{-160,78},{-140,98}}))); Processes.FlowResistance flowResistance1( redeclare package Medium = Air, r=1, @@ -93,7 +93,7 @@ model HeatPump annotation (Placement(transformation( extent={{-10,-10},{10,10}}, rotation=0, - origin={-110,96}))); + origin={-110,88}))); Processes.FlowResistance flowResistance2( redeclare package Medium = Air, r=1, @@ -218,8 +218,7 @@ model HeatPump Sensors.SingleSensorSelect singleSensorSelect3( redeclare package Medium = Air, digits=1, - quantity=ThermofluidStream.Sensors.Internal.Types.Quantities.T_C) annotation (Placement(transformation(extent={{-120, - 108},{-100,128}}))); + quantity=ThermofluidStream.Sensors.Internal.Types.Quantities.T_C) annotation (Placement(transformation(extent={{-120,100},{-100,120}}))); Sensors.SingleSensorSelect singleSensorSelect4( redeclare package Medium = Air, digits=1, @@ -304,11 +303,11 @@ equation color={28,108,200}, thickness=0.5)); connect(source.outlet, flowResistance1.inlet) annotation (Line( - points={{-140,96},{-120,96}}, + points={{-140,88},{-120,88}}, color={28,108,200}, thickness=0.5)); connect(flowResistance1.outlet, condenser.inletA) annotation (Line( - points={{-100,96},{-94,96},{-94,88},{-90,88}}, + points={{-100,88},{-90,88}}, color={28,108,200}, thickness=0.5)); connect(condenser.outletA, fan.inlet) annotation (Line( @@ -389,7 +388,7 @@ equation thickness=0.5)); connect(singleSensorSelect3.inlet, flowResistance1.inlet) annotation (Line( - points={{-120,118},{-126,118},{-126,96},{-120,96}}, + points={{-120,110},{-126,110},{-126,88},{-120,88}}, color={28,108,200}, thickness=0.5)); connect(singleSensorSelect4.inlet, flowResistance2.inlet) diff --git a/ThermofluidStream/Examples/ReverseHeatPump.mo b/ThermofluidStream/Examples/ReverseHeatPump.mo index 25ce4a3a..c9c6e89d 100644 --- a/ThermofluidStream/Examples/ReverseHeatPump.mo +++ b/ThermofluidStream/Examples/ReverseHeatPump.mo @@ -558,7 +558,7 @@ equation thickness=0.5)); connect(multiSensor_Tpm6.rear, TEVcooling.fore) annotation (Line( - points={{70,130},{60,130},{60,180},{50,180}}, + points={{70,130},{70,180},{50,180}}, color={28,108,200}, thickness=0.5)); connect(junctionT1_1.inletB, multiSensor_Tpm.outlet) diff --git a/ThermofluidStream/Examples/SimpleGasTurbine.mo b/ThermofluidStream/Examples/SimpleGasTurbine.mo index c067345b..c8d27fb2 100644 --- a/ThermofluidStream/Examples/SimpleGasTurbine.mo +++ b/ThermofluidStream/Examples/SimpleGasTurbine.mo @@ -72,8 +72,7 @@ model SimpleGasTurbine "Simple version of a Gas Turbine" Sensors.MultiSensor_Tp multiSensor_Tp2( redeclare package Medium = Medium, digits=3, - pressureUnit="bar") annotation (Placement(transformation(extent={{-104,0},{ - -84,20}}))); + pressureUnit="bar") annotation (Placement(transformation(extent={{-104,-4},{-84,16}}))); Modelica.Blocks.Continuous.LimPID PI( controllerType=Modelica.Blocks.Types.SimpleController.PI, k=2000, @@ -110,7 +109,7 @@ equation annotation (Line(points={{-110,-60},{-80,-60},{-80,-20}}, color={0,0,0})); connect(multiSensor_Tp2.inlet, source.outlet) annotation (Line( - points={{-104,10},{-110,10},{-110,-10},{-120,-10}}, + points={{-104,6},{-110,6},{-110,-10},{-120,-10}}, color={28,108,200}, thickness=0.5)); connect(speedSensor.flange, turbine.flange) diff --git a/ThermofluidStream/Examples/Utilities/Tests/Piston.mo b/ThermofluidStream/Examples/Utilities/Tests/Piston.mo index eeee89dc..85b00c00 100644 --- a/ThermofluidStream/Examples/Utilities/Tests/Piston.mo +++ b/ThermofluidStream/Examples/Utilities/Tests/Piston.mo @@ -56,8 +56,7 @@ model Piston "Test for Piston model" extent={{-10,-10},{10,10}}, rotation=0, origin={10,10}))); - FlowControl.Switch switch(redeclare package Medium = Medium, - initializeOneMassflowSplit=false) + FlowControl.Switch switch(redeclare package Medium = Medium, initializeOneMassflowSplit=true) annotation (Placement(transformation(extent={{-10,10},{10,-10}}, rotation=0, origin={-66,10}))); @@ -84,7 +83,6 @@ model Piston "Test for Piston model" Processes.FlowResistance flowResistance2( redeclare package Medium = Medium, m_flowStateSelect=StateSelect.prefer, - initM_flow=ThermofluidStream.Utilities.Types.InitializationMethods.state, computeL=false, L_value=1e-3, r=0.1, @@ -127,19 +125,17 @@ initial equation equation - connect(linearSpeedDependentForce.flange, piston2_1.flange) annotation (Line(points={{40,-50}, - {40,-50},{14,-50}}, color={0,127,0})); + connect(linearSpeedDependentForce.flange, piston2_1.flange) annotation (Line(points={{40,-50},{40,-50.2},{14,-50.2}}, color={0,127,0})); - connect(piston2_1.x_out, showRealValue.numberPort) annotation (Line(points={{10, - -54.8},{10,-72},{30,-72}}, color={0,0,127})); + connect(piston2_1.x_out, showRealValue.numberPort) annotation (Line(points={{10,-55},{10,-72},{30.5,-72}}, color={0,0,127})); connect(switchConnector.fore, piston2_1.port_left) annotation (Line( - points={{-10,-30},{-10,-45.8},{-6,-45.8}}, + points={{-10,-30},{-10,-46},{-6,-46}}, color={28,108,200}, thickness=0.5)); connect(switchConnector1.fore, piston2_1.port_right) annotation (Line( - points={{10,0},{10,-10},{20,-10},{20,-45.8},{14,-45.8}}, + points={{10,0},{10,-10},{20,-10},{20,-46},{14,-46}}, color={28,108,200}, thickness=0.5)); connect(pulse.y, firstOrder.u) annotation (Line(points={{-43,56},{-32,56}}, color={0,0,127})); diff --git a/ThermofluidStream/Examples/VenturiPump.mo b/ThermofluidStream/Examples/VenturiPump.mo index 2ac87bd1..627b5c28 100644 --- a/ThermofluidStream/Examples/VenturiPump.mo +++ b/ThermofluidStream/Examples/VenturiPump.mo @@ -88,8 +88,7 @@ model VenturiPump "Pumping of liquid water using the venturi effect" extent={{-10,-10},{10,10}}, rotation=270, origin={0,50}))); - inner DropOfCommons dropOfCommons(p_min(displayUnit="Pa") = 612, - displayInstanceNames=true) + inner DropOfCommons dropOfCommons(p_min(displayUnit="Pa") = 612, displayInstanceNames=false) annotation (Placement(transformation(extent={{-90,12},{-70,32}}))); ThermofluidStream.Utilities.Icons.DLRLogo dLRLogo annotation (Placement(transformation(extent={{82,62},{118,98}}))); equation diff --git a/ThermofluidStream/Examples/WaterHammer.mo b/ThermofluidStream/Examples/WaterHammer.mo index 99aa7fd6..9a9fc997 100644 --- a/ThermofluidStream/Examples/WaterHammer.mo +++ b/ThermofluidStream/Examples/WaterHammer.mo @@ -8,8 +8,7 @@ model WaterHammer "Pump water by using dynamic pressures" "Medium model" annotation(choicesAllMatching=true); - inner ThermofluidStream.DropOfCommons dropOfCommons(assertionLevel = AssertionLevel.warning, - displayInstanceNames=true) + inner ThermofluidStream.DropOfCommons dropOfCommons(assertionLevel = AssertionLevel.warning, displayInstanceNames=false) annotation (Placement(transformation(extent={{-100,60},{-80,80}}))); ThermofluidStream.Boundaries.Source source( redeclare package Medium = Medium, diff --git a/ThermofluidStream/FlowControl/MCV.mo b/ThermofluidStream/FlowControl/MCV.mo index 8602944e..afdc1f1c 100644 --- a/ThermofluidStream/FlowControl/MCV.mo +++ b/ThermofluidStream/FlowControl/MCV.mo @@ -154,6 +154,6 @@ equation

This component can be used to emulate a mass- or volume-flow regulated valve, depending on its mode.

The mass- or volume-flow-setpoint can be set or given by a real input signal, and the valve tries to enforce a PT1- dynamic on this setpoint, within its pressure limits. The valve will not create pressure, or let the outlet pressure drop below p_min. To avoid this, the internally integrated pressure-drop is clipped. If it is clipped and hence the setpoint cannot be reached, an optional output leaves its "zero" value and a visual wanring is shown (circle becomes red).

Documentation of the used equations:

-

+

")); end MCV; diff --git a/ThermofluidStream/HeatExchangers/Internal/PartialNTU.mo b/ThermofluidStream/HeatExchangers/Internal/PartialNTU.mo index c34a0fb7..3addbf88 100644 --- a/ThermofluidStream/HeatExchangers/Internal/PartialNTU.mo +++ b/ThermofluidStream/HeatExchangers/Internal/PartialNTU.mo @@ -9,7 +9,7 @@ partial model PartialNTU "Partial heat exchanger model using the epsilon-NTU met annotation (choicesAllMatching=true); parameter Modelica.Units.SI.Area A "Heat transfer area"; - parameter Modelica.Units.SI.CoefficientOfHeatTransfer k_NTU=50 "Overall heat transfer coefficient"; + parameter Modelica.Units.SI.CoefficientOfHeatTransfer k_NTU=50 "Thermal transmittance"; parameter Utilities.Units.Inertance L=dropOfCommons.L "Inertance" annotation (Dialog(tab="Advanced")); parameter Modelica.Units.SI.MassFlowRate m_flow_reg=dropOfCommons.m_flow_reg "Nominal mass flow rate for regularization" @@ -19,7 +19,7 @@ partial model PartialNTU "Partial heat exchanger model using the epsilon-NTU met // ------ Parameter Display Configuration ------------------------ parameter Boolean displayArea = true "= true, if the heat transfer area A is displayed" annotation(Dialog(tab="Layout",group="Display parameters",enable=displayParameters),Evaluate=true, HideResult=true, choices(checkBox=true)); - parameter Boolean displaykNTU = true "= true, if the overall heat transfer coefficient k_NTU is displayed" + parameter Boolean displaykNTU = true "= true, if the thermal transmittance k_NTU is displayed" annotation(Dialog(tab="Layout",group="Display parameters",enable=displayParameters),Evaluate=true, HideResult=true, choices(checkBox=true)); final parameter Boolean d1A = displayParameters and displayArea "displayArea at position 1" annotation(Evaluate=true, HideResult=true); //d1A -> Display at position 1 A=Area @@ -53,7 +53,7 @@ partial model PartialNTU "Partial heat exchanger model using the epsilon-NTU met Modelica.Units.SI.SpecificEnthalpy dh_A "Specific enthalpy difference medium A"; Modelica.Units.SI.SpecificEnthalpy dh_B "Specific enthalpy difference medium B"; - SI.HeatFlowRate q_flow "Heat flow rate A to B (Q_flow)"; + SI.HeatFlowRate q_flow "Heat flow rate (Q_flow)"; Real effectiveness(unit="1") "Heat exchanger efficiency"; Real NTU(unit="1") "Number of transfer units"; @@ -78,9 +78,9 @@ protected Modelica.Units.SI.SpecificEnthalpy h_out_A "Specific enthalpy at outlet A"; Modelica.Units.SI.SpecificEnthalpy h_out_B "Specific enthalpy at outlet B"; - SI.HeatFlowRate q_max "Maximum heat flow rate A to B (Q_flow_max)"; - SI.HeatFlowRate q_flowA "Heat flow rate A to B (Q_flowA)"; - SI.HeatFlowRate q_flowB "Heat flow rate B to A (Q_flowB)"; + SI.HeatFlowRate q_max "Maximum heat flow rate (Q_max)"; + SI.HeatFlowRate q_flowA "Heat flow rate side A (Q_flowA)"; + SI.HeatFlowRate q_flowB "Heat flow rate side B (Q_flowB)"; Real C_A(unit="J/(K.s)") "Heat capacity flow rate of Medium A"; Real C_B(unit="J/(K.s)") "Heat capacity flow rate of Medium B"; @@ -166,6 +166,9 @@ equation //Based on regularization for mass flow dh_B = (m_flow_B*q_flowB)/(m_flow_B^2 + (m_flow_reg/10)^2); + der(h_out_A)*TC = h_in_A - dh_A - h_out_A; + der(h_out_B)*TC = h_in_B - dh_B - h_out_B; + else //No heat is transferred, if both mass flow rates are smaller than regularization mass flow rate @@ -180,10 +183,11 @@ equation //Based on regularization for mass flow dh_A = (m_flow_A*q_flowA)/(m_flow_A^2 + (m_flow_reg/10)^2); - end if; - der(h_out_A)*TC = h_in_A - dh_A - h_out_A; - der(h_out_B)*TC = h_in_B - dh_B - h_out_B; + der(h_out_A)*TC = h_in_A - dh_A - h_out_A; + der(h_out_B)*TC = h_in_B - dh_B - h_out_B; + + end if; outletA.state = MediumA.setState_phX( p_A, diff --git a/ThermofluidStream/HeatExchangers/Tests/CounterFlowNTU.mo b/ThermofluidStream/HeatExchangers/Tests/CounterFlowNTU.mo index a814e192..9fffed66 100644 --- a/ThermofluidStream/HeatExchangers/Tests/CounterFlowNTU.mo +++ b/ThermofluidStream/HeatExchangers/Tests/CounterFlowNTU.mo @@ -55,7 +55,7 @@ model CounterFlowNTU Medium = MediumB, outputMassFlowRate=false, temperatureUnit="degC") annotation (Placement(transformation(extent={{60,20},{40,40}}))); - inner DropOfCommons dropOfCommons + inner DropOfCommons dropOfCommons(displayInstanceNames=false, displayParameters=false) annotation (Placement(transformation(extent={{-158,-98},{-138,-78}}))); ThermofluidStream.HeatExchangers.CounterFlowNTU counterFlowNTU( redeclare package MediumA = MediumA, diff --git a/ThermofluidStream/HeatExchangers/Tests/CrossFlowNTU.mo b/ThermofluidStream/HeatExchangers/Tests/CrossFlowNTU.mo index b850240b..64bab039 100644 --- a/ThermofluidStream/HeatExchangers/Tests/CrossFlowNTU.mo +++ b/ThermofluidStream/HeatExchangers/Tests/CrossFlowNTU.mo @@ -65,7 +65,7 @@ model CrossFlowNTU annotation (Placement(transformation(extent={{10,-10},{-10,10}}, rotation=90, origin={-10,32}))); - inner DropOfCommons dropOfCommons + inner DropOfCommons dropOfCommons(displayInstanceNames=false) annotation (Placement(transformation(extent={{-156,-98},{-136,-78}}))); ThermofluidStream.HeatExchangers.CrossFlowNTU crossFlowNTU( redeclare package MediumA = MediumA, diff --git a/ThermofluidStream/Processes/CentrifugalPump.mo b/ThermofluidStream/Processes/CentrifugalPump.mo index d12070df..95e60c6b 100644 --- a/ThermofluidStream/Processes/CentrifugalPump.mo +++ b/ThermofluidStream/Processes/CentrifugalPump.mo @@ -43,7 +43,7 @@ model CentrifugalPump "Model of a centrifugal pump" parameter SI.MassFlowRate m_flow_reg = dropOfCommons.m_flow_reg "Mass flow rate for regularization" annotation(Dialog(tab="Advanced")); - parameter SI.Power P_reg = 1 "Power for regularization (eta = 0 for P < P_reg)" + parameter SI.Power P_reg = dropOfCommons.m_flow_reg/1000*1e5 "Power for regularization (eta = 0 for P < eps_P)" annotation(Dialog(tab="Advanced")); // ------ Parameter Display Configuration ------------------------ @@ -174,14 +174,14 @@ equation if pumpMode == PumpMode.flowControlled or pumpMode == PumpMode.pressureControlled then w_n = 1/(2*c_head[1])*(-c_head[2]*V_n + sqrt(c_head[2]^2*V_n^2 - 4*c_head[1]*(c_head[3]*V_n^2 - h_n))); // To avoid systems of nonlinear equations the quadratic equation head_n = f(w_n) is solved for w_n explicitly elseif pumpMode == PumpMode.speedControlled or pumpMode == PumpMode.flange then - h_n = c_head[1]*w_n^2 + c_head[2]*abs(w_n)*V_n + c_head[3]*V_n*abs(V_n); // Simple extension for negative flow + h_n = c_head[1]*w_n^2 + c_head[2]*w_n*V_n + c_head[3]*V_n*abs(V_n); // Simple extension for negative flow end if; - tau_n = smooth(0, if noEvent(V_n > 0) then rho_n*(c_power[1]*w_n^2 + c_power[2]*abs(w_n)*V_n + c_power[3]*V_n^2) else rho_n*c_power[1]*w_n^2); // Simple extension for negative flow + tau_n = smooth(0, if noEvent(V_n > 0) then rho_n*(c_power[1]*w_n^2 + c_power[2]*w_n*V_n + c_power[3]*V_n^2) else rho_n*c_power[1]*w_n^2); // Simple extension for negative flow dp = head*rho*Modelica.Constants.g_n; P = tau*w; h_out = h_in + w_t; Xi_out = Xi_in; - eta_is = if noEvent(P >= P_reg) then dp*V_flow/P else 0; + eta_is = dp*V_flow/max(P,P_reg); w_t = P/max(m_flow,m_flow_reg); annotation (Icon(graphics={ Text(visible=displayInstanceName, @@ -318,11 +318,11 @@ further modifications are necessary.

", revisions=" - + ")); end CentrifugalPump; diff --git a/ThermofluidStream/Processes/ConductionElement.mo b/ThermofluidStream/Processes/ConductionElement.mo index 8b81a643..61b34a86 100644 --- a/ThermofluidStream/Processes/ConductionElement.mo +++ b/ThermofluidStream/Processes/ConductionElement.mo @@ -3,17 +3,15 @@ model ConductionElement "Model of quasi-stationary mass and heat transfer" extends Internal.PartialConductionElement; - parameter Boolean useHeatTransferPropertyInput = false "= true, if input connector for either U or k_par is enabled" - annotation(Dialog(group="Thermal Conductance"),Evaluate=true, HideResult=true, choices(checkBox=true)); parameter Boolean resistanceFromAU = true "= true, if thermal conductance is given by U*A" annotation(Dialog(group="Thermal Conductance"),Evaluate=true, HideResult=true, choices(checkBox=true)); parameter SI.Area A = 1 "Heat transfer area" annotation(Dialog(group="Thermal Conductance", enable=resistanceFromAU)); - parameter SI.CoefficientOfHeatTransfer U = 200 "Overall heat transfer coefficient" - annotation(Dialog(group="Thermal Conductance", enable=(resistanceFromAU and not useHeatTransferPropertyInput))); + parameter SI.CoefficientOfHeatTransfer U = 200 "Thermal transmittance" + annotation(Dialog(group="Thermal Conductance", enable=resistanceFromAU)); parameter SI.ThermalConductance k_par = 200 "Thermal conductance" - annotation(Dialog(group="Thermal Conductance", enable=(not resistanceFromAU and not useHeatTransferPropertyInput))); - //final parameter SI.ThermalConductance k_internal = if resistanceFromAU then A*U else k_par; + annotation(Dialog(group="Thermal Conductance", enable=not resistanceFromAU)); + final parameter SI.ThermalConductance k_internal = if resistanceFromAU then A*U else k_par; // ------ Parameter Display Configuration ------------------------ parameter Boolean displayVolume = true "= true, if volume V is displayed" @@ -31,71 +29,45 @@ model ConductionElement "Model of quasi-stationary mass and heat transfer" conductionString else "" annotation(Evaluate=true, HideResult=true); final parameter String conductionString= - if useHeatTransferPropertyInput and resistanceFromAU then "A=%A" - elseif not useHeatTransferPropertyInput and resistanceFromAU then "A=%A, U=%U" - elseif not useHeatTransferPropertyInput and not resistanceFromAU then "k=%k_par" - else "" annotation(Evaluate=true, HideResult=true); + if resistanceFromAU then "A=%A, U=%U" + else "k=%k_par" annotation(Evaluate=true, HideResult=true); //----------------------------------------------------------------- - Modelica.Blocks.Interfaces.RealInput U_var(unit = "W/(m2.K)") if (useHeatTransferPropertyInput and resistanceFromAU) "Overall heat transfer coefficient input connector [W/(m2.K)]" - annotation (Placement(transformation(extent={{-20,20},{20,-20}}, - rotation=90, - origin={-60,-120}))); - Modelica.Blocks.Interfaces.RealInput k_var(unit="W/K") if (useHeatTransferPropertyInput and not resistanceFromAU) "Thermal conductance input connector [W/K]" - annotation (Placement(transformation(extent={{-20,-20},{20,20}}, - rotation=90, - origin={-60,-120}))); - -protected - Modelica.Blocks.Interfaces.RealInput U_internal(unit = "W/(m2.K)") "Internal connector for overall heat transfer coefficient"; - Modelica.Blocks.Interfaces.RealInput k_internal(unit="W/K") "Internal connector for thermal conductance"; - equation - connect(U_var, U_internal); - if resistanceFromAU and not useHeatTransferPropertyInput then - U_internal = U; - end if; - - connect(k_var, k_internal); - if not resistanceFromAU and not useHeatTransferPropertyInput then - k_internal = k_par; - end if; - - k_internal = A*U_internal; k = k_internal; + annotation (Icon(coordinateSystem(preserveAspectRatio=true), graphics={ Text( extent={{-150,-60},{150,-90}}, textColor={0,0,0}, textString=parameterString), + Line(visible=displayAnything, points={{0,-60},{0,-65}}, + color={191,0,0}), + Line(visible=displayAnything, points={{0,-85},{0,-100}}, + color={191,0,0}), Line( + visible=not displayAnything, points={{0,-60},{0,-100}}, - color={191,0,0}, - pattern=LinePattern.Dot), - Line(visible = useHeatTransferPropertyInput, - points={{-60,-100},{0,-100}}, color={0,0,127})}), + color={191,0,0})}), Diagram(coordinateSystem(preserveAspectRatio=true)), Documentation(info=" -

- This model represents an element with a fixed volume (fig. 1). The mass inside the volume is assumed quasi-stationary, meaning it is computed statically using the volume and density, and the inlet mass flow is coupled to the outlet mass flow. -

-

- Because of this, the ConductionElement cannot be used as a loop breaker. -

-

- The advantage of this approach is that multiple ConductionElements can be connected in series without causing oscillations or fast eigenvalues between their masses. The ConductionElement implements conservation of mass and energy equations for the fluid contained within the component. -

-

- For further details, see the documentation of the base class Internal.PartialConductionElement. -

-

- The useHeatTransferPropertyInput option can be selected to enable input connectors for the overall heat transfer coefficient U or the thermal conductance k = U*A. The resistanceFromAU checkbox determines which quantity is activated: -

- +

+This model is an element with a fixed volume (fig. 1). The mass in the volume is +assumed quasi-stationary (statically computed with volume and density), and the +inlet massflow is coupled to the outlet massflow. +

+

+Because of this the ConductionElement cannot be used as a loop breaker. +

+

+The advantage is that multiple ConductionElements can be put behind each other +without worrying about oscillations or fast eigenvalues between their masses. +The ConductionElement implements equations for conservation of mass and energy +for the fluid mass contained in the component. +

+

+For further documentation see the documentation of the +motherclass. +

")); end ConductionElement; diff --git a/ThermofluidStream/Processes/Internal/CentrifugalPump/Auxiliaries/InternalCoefficients.mo b/ThermofluidStream/Processes/Internal/CentrifugalPump/Auxiliaries/InternalCoefficients.mo index 133bfc11..0978c90f 100644 --- a/ThermofluidStream/Processes/Internal/CentrifugalPump/Auxiliaries/InternalCoefficients.mo +++ b/ThermofluidStream/Processes/Internal/CentrifugalPump/Auxiliaries/InternalCoefficients.mo @@ -13,8 +13,8 @@ record InternalCoefficients "Coefficient record used in CentrifugalPump" parameter Real c_head[3] = {1,0.23,-1.23} "Coefficients of second order head approximation polynomial"; parameter Real c_power[3] = {0.20, 0.55,-0.28} "Coefficients of second order torque approximation polynomial (P=tau*w)"; - parameter SI.Power P_ref = rho_ref*Modelica.Constants.g_n*head_ref*V_flow_ref/eta_ref "Reference power"; - parameter SI.Torque tau_ref = P_ref/w_ref "Reference torque"; + final parameter SI.Power P_ref = rho_ref*Modelica.Constants.g_n*head_ref*V_flow_ref/eta_ref "Reference power"; + final parameter SI.Torque tau_ref = P_ref/w_ref "Reference torque"; annotation(defaultComponentPrefixes = "parameter", Documentation(info="

diff --git a/ThermofluidStream/Processes/Internal/CentrifugalPump/Auxiliaries/internalCoefficientsFromCoefficients.mo b/ThermofluidStream/Processes/Internal/CentrifugalPump/Auxiliaries/internalCoefficientsFromCoefficients.mo index 822059cc..cb7979ae 100644 --- a/ThermofluidStream/Processes/Internal/CentrifugalPump/Auxiliaries/internalCoefficientsFromCoefficients.mo +++ b/ThermofluidStream/Processes/Internal/CentrifugalPump/Auxiliaries/internalCoefficientsFromCoefficients.mo @@ -10,9 +10,7 @@ function internalCoefficientsFromCoefficients "Calculates InteralCoefficients re V_flow_ref=data.V_flow_peak, eta_ref=data.eta_peak, c_head={ch0,ch1,ch2}, - c_power={cp0,cp1,cp2}, - P_ref = data.rho_ref*Modelica.Constants.g_n*data.head_ref_internal* data.V_flow_peak/data.eta_peak, - tau_ref = data.rho_ref*Modelica.Constants.g_n*data.head_ref_internal* data.V_flow_peak/data.eta_peak/data.w_ref) "Internal pump coefficients"; + c_power={cp0,cp1,cp2}) "Internal pump coefficients"; protected Real ch0 = data.h_0n "First head coefficient"; diff --git a/ThermofluidStream/Processes/Internal/CentrifugalPump/Auxiliaries/internalCoefficientsFromMeasurements.mo b/ThermofluidStream/Processes/Internal/CentrifugalPump/Auxiliaries/internalCoefficientsFromMeasurements.mo index 54e4d9be..f0663b97 100644 --- a/ThermofluidStream/Processes/Internal/CentrifugalPump/Auxiliaries/internalCoefficientsFromMeasurements.mo +++ b/ThermofluidStream/Processes/Internal/CentrifugalPump/Auxiliaries/internalCoefficientsFromMeasurements.mo @@ -51,8 +51,6 @@ algorithm coefficients.V_flow_ref:=V_flow_ref; coefficients.c_head:=c_head; coefficients.c_power:=c_power; - coefficients.P_ref:=P_ref; - coefficients.tau_ref:=P_ref/data.w_ref; annotation (Documentation(info="

diff --git a/ThermofluidStream/Processes/Internal/CentrifugalPump/CalculateCoefficientsFromMeasurements.mo b/ThermofluidStream/Processes/Internal/CentrifugalPump/CalculateCoefficientsFromMeasurements.mo index 0b681fc5..9b8f5a9c 100644 --- a/ThermofluidStream/Processes/Internal/CentrifugalPump/CalculateCoefficientsFromMeasurements.mo +++ b/ThermofluidStream/Processes/Internal/CentrifugalPump/CalculateCoefficientsFromMeasurements.mo @@ -2,9 +2,7 @@ within ThermofluidStream.Processes.Internal.CentrifugalPump; model CalculateCoefficientsFromMeasurements "Determine and print pump coefficients based on measurements" extends Modelica.Icons.Example; import Modelica.Utilities.Streams.print; - replaceable parameter ThermofluidStream.Processes.Internal.CentrifugalPump.Measurements.Wilo.Stratos25slash1to4 measurements - constrainedby ThermofluidStream.Processes.Internal.CentrifugalPump.Measurements.GenericPump "Measurements" - annotation (Dialog(group="Data"), choicesAllMatching=true); + replaceable parameter ThermofluidStream.Processes.Internal.CentrifugalPump.Measurements.Wilo.CronolineIL80slash220dash4slash4 measurements "Measurements" annotation (Dialog(group="Data"), choicesAllMatching=true); final parameter ThermofluidStream.Processes.Internal.CentrifugalPump.Auxiliaries.InternalCoefficients c=ThermofluidStream.Processes.Internal.CentrifugalPump.Auxiliaries.internalCoefficientsFromMeasurements(measurements) "Pump coefficients internally used in the centrifugal pump model"; final parameter ThermofluidStream.Processes.Internal.CentrifugalPump.Coefficients.GenericPump coefficients=ThermofluidStream.Processes.Internal.CentrifugalPump.Auxiliaries.coefficientsFromInternalCoefficients(c); @@ -31,7 +29,7 @@ algorithm //print("Analytical zero = " + String(u_analytical[1], format="2.16f")); //print("Numerical zero = " + String(u_numerical[1], format="2.16f")); //print("Absolute difference = " + String(u_err[1], format="2.0e")); - annotation (experiment(StopTime=1.0, Tolerance=1e-6, Interval=1e-3, __Dymola_Algorithm="Dassl"), Documentation(revisions=" + annotation (Documentation(revisions="