Skip to content

Commit

Permalink
changed radioButtons to enumeration #1426
Browse files Browse the repository at this point in the history
Changed CalcMethodConvectiveHeatTransfer.mo, CalcMethodConvectiveHeatTransferInsideSurface.mo, CalcMethodLongwaveRadiationHeatTransfer.mo, SurfaceOrientation.mo
  • Loading branch information
PatrickHenkel committed Jun 6, 2023
1 parent 1f18a83 commit 7500d67
Show file tree
Hide file tree
Showing 9 changed files with 72 additions and 60 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
within AixLib.ThermalZones.HighOrder.Components.Types;
type CalcMethodConvectiveHeatTransfer = enumeration(
DIN_6946
"DIN 6946",
ASHRAE_Fundamentals
"ASHRAE Fundamentals",
Custom_hCon
"Custom hCon (constant)")
"Calculation method for convective heat transfer coefficient at outside surface";
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
within AixLib.ThermalZones.HighOrder.Components.Types;
type CalcMethodConvectiveHeatTransferInsideSurface = enumeration(
EN_ISO_6946_Appendix_A
"EN ISO 6946 Appendix A >>Flat Surfaces<<",
Bernd_Glueck
"By Bernd Glueck",
Custom_hCon
"Custom hCon (constant)",
ASHRAE140_2017
"ASHRAE140-2017")
"Calculation method for convective heat transfer coefficient at inside surface";
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
within AixLib.ThermalZones.HighOrder.Components.Types;
type CalcMethodLongwaveRadiationHeatTransfer = enumeration(
No_Approx
"No approx",
Linear_Wall
"Linear approx at wall temp",
Linear_Rad
"Linear approx at rad temp",
Linear_Constant_Tref
"Linear approx at constant T_ref")
"Calculation method for longwave radiation heat transfer";
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
within AixLib.ThermalZones.HighOrder.Components.Types;
type SurfaceOrientation = enumeration(
vertical
"vertical",
horizontal_facing_up
"horizontal facing up",
horizontal_facing_down
"horizontal facing down") "Surface Orientation";
4 changes: 4 additions & 0 deletions AixLib/ThermalZones/HighOrder/Components/Types/package.order
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,7 @@ selectorCoefficients
CoeffTableEastWestWindow
CoeffTableSouthWindow
PartialCoeffTable
CalcMethodConvectiveHeatTransfer
CalcMethodConvectiveHeatTransferInsideSurface
CalcMethodLongwaveRadiationHeatTransfer
SurfaceOrientation
Original file line number Diff line number Diff line change
Expand Up @@ -27,20 +27,12 @@ model ConvNLayerClearanceStar
"Specific heat capacity"
annotation (Dialog(group="Structure of wall layers"));
// which orientation of surface?
parameter Integer surfaceOrientation "Surface orientation" annotation(Dialog(descriptionLabel = true, enable = if IsHConvConstant == true then false else true), choices(choice = 1
"vertical", choice = 2
"horizontal facing up", choice = 3
"horizontal facing down", radioButtons = true));
parameter Integer calcMethod=2 "Calculation method for convective heat transfer coefficient at inside surface" annotation (Dialog(
group="Convection", descriptionLabel=true), choices(
choice=1 "EN ISO 6946 Appendix A >>Flat Surfaces<<",
choice=2 "By Bernd Glueck",
choice=3 "Custom hCon (constant)",
choice=4 "ASHRAE140-2017",
radioButtons=true));
parameter AixLib.ThermalZones.HighOrder.Components.Types.SurfaceOrientation surfaceOrientation "Surface orientation" annotation(Dialog(descriptionLabel = true, enable = if IsHConvConstant == true then false else true));
parameter AixLib.ThermalZones.HighOrder.Components.Types.CalcMethodConvectiveHeatTransferInsideSurface calcMethod=AixLib.ThermalZones.HighOrder.Components.Types.CalcMethodConvectiveHeatTransferInsideSurface.Bernd_Glueck "Calculation method for convective heat transfer coefficient at inside surface" annotation (Dialog(
group="Convection", descriptionLabel=true));
parameter Modelica.Units.SI.CoefficientOfHeatTransfer hCon_const=2
"Constant convective heat transfer coefficient"
annotation (Dialog(group="Convection", enable=calcMethod == 1));
annotation (Dialog(group="Convection", enable=calcMethod == AixLib.ThermalZones.HighOrder.Components.Types.CalcMethodConvectiveHeatTransferInsideSurface.EN_ISO_6946_Appendix_A));

parameter Integer radCalcMethod=1 "Calculation method for radiation heat transfer" annotation (
Evaluate=true,
Expand Down
19 changes: 8 additions & 11 deletions AixLib/ThermalZones/HighOrder/Components/Walls/Wall.mo
Original file line number Diff line number Diff line change
Expand Up @@ -25,24 +25,20 @@ model Wall
// Surface parameters
parameter Real solar_absorptance = 0.25
"Solar absorptance coefficient of outside wall surface" annotation(Dialog(tab = "Surface Parameters", group = "Outside surface", enable = outside));
parameter Integer calcMethodOut=1 "Calculation method for convective heat transfer coefficient at outside surface" annotation (Dialog(
parameter AixLib.ThermalZones.HighOrder.Components.Types.CalcMethodConvectiveHeatTransfer calcMethodOut=AixLib.ThermalZones.HighOrder.Components.Types.CalcMethodConvectiveHeatTransfer.DIN_6946 "Calculation method for convective heat transfer coefficient at outside surface" annotation (Dialog(
tab="Surface Parameters",
group="Outside surface",
enable=outside,
compact=true), choices(
choice=1 "DIN 6946",
choice=2 "ASHRAE Fundamentals",
choice=3 "Custom hCon (constant)",
radioButtons=true));
compact=true));
parameter Modelica.Units.SI.CoefficientOfHeatTransfer hConOut_const=25
"Custom convective heat transfer coefficient (just for manual selection, not recommended)"
annotation (Dialog(
tab="Surface Parameters",
group="Outside surface",
enable=calcMethodOut == 3 and outside));
enable=calcMethodOut == AixLib.ThermalZones.HighOrder.Components.Types.CalcMethodConvectiveHeatTransfer.Custom_hCon and outside));
parameter DataBase.Surfaces.RoughnessForHT.PolynomialCoefficients_ASHRAEHandbook surfaceType = DataBase.Surfaces.RoughnessForHT.Brick_RoughPlaster()
"Surface type of outside wall" annotation(Dialog(tab = "Surface Parameters", group = "Outside surface", enable=
calcMethodOut == 2 and outside), choicesAllMatching = true);
calcMethodOut == AixLib.ThermalZones.HighOrder.Components.Types.CalcMethodConvectiveHeatTransfer.ASHRAE_Fundamentals and outside), choicesAllMatching = true);
parameter Integer ISOrientation = 1 "Inside surface orientation" annotation(Dialog(tab = "Surface Parameters", group = "Inside surface", compact = true, descriptionLabel = true), choices(choice = 1
"vertical wall", choice = 2 "floor", choice = 3 "ceiling", radioButtons = true));

Expand Down Expand Up @@ -158,7 +154,7 @@ parameter DataBase.Surfaces.RoughnessForHT.PolynomialCoefficients_ASHRAEHandbook
Utilities.HeatTransfer.SolarRadToHeat SolarAbsorption(coeff = solar_absorptance, A=ANet) if outside annotation(Placement(transformation(origin={-37.5,90.5},extent={{-10.5,-10.5},{10.5,10.5}})));
AixLib.Utilities.Interfaces.SolarRad_in SolarRadiationPort if outside annotation(Placement(transformation(extent = {{-116, 79}, {-96, 99}}), iconTransformation(extent = {{-36, 100}, {-16, 120}})));
Modelica.Thermal.HeatTransfer.Interfaces.HeatPort_a port_outside annotation(Placement(transformation(extent = {{-108, -6}, {-88, 14}}), iconTransformation(extent = {{-31, -10}, {-11, 10}})));
Modelica.Blocks.Interfaces.RealInput WindSpeedPort if outside and (calcMethodOut == 1 or calcMethodOut == 2)
Modelica.Blocks.Interfaces.RealInput WindSpeedPort if outside and (calcMethodOut == AixLib.ThermalZones.HighOrder.Components.Types.CalcMethodConvectiveHeatTransfer.DIN_6946 or calcMethodOut == AixLib.ThermalZones.HighOrder.Components.Types.CalcMethodConvectiveHeatTransfer.ASHRAE_Fundamentals)
annotation(Placement(transformation(extent = {{-113, 54}, {-93, 74}}), iconTransformation(extent = {{-31, 78}, {-11, 98}})));
Sunblinds.Sunblind Sunblind(
final n=1,
Expand Down Expand Up @@ -230,7 +226,7 @@ equation
//******************************************************************
if outside then
connect(SolarRadiationPort, SolarAbsorption.solarRad_in) annotation(Line(points={{-106,89},{-48,89},{-48,88.4},{-48.105,88.4}}, color = {255, 128, 0}));
if calcMethodOut == 1 or calcMethodOut == 2 then
if calcMethodOut == AixLib.ThermalZones.HighOrder.Components.Types.CalcMethodConvectiveHeatTransfer.DIN_6946 or calcMethodOut == AixLib.ThermalZones.HighOrder.Components.Types.CalcMethodConvectiveHeatTransfer.ASHRAE_Fundamentals then
connect(WindSpeedPort, heatTransfer_Outside.WindSpeedPort) annotation(Line(points={{-103,64},{-68,64},{-68,51},{-46,51}}, color = {0, 0, 127}));
end if;
connect(heatTransfer_Outside.port_a, port_outside) annotation(Line(points = {{-47, 58}, {-56, 58}, {-56, 4}, {-98, 4}}, color = {191, 0, 0}));
Expand Down Expand Up @@ -275,7 +271,8 @@ equation
color = {255, 128, 0}));
end if;
connect(heatStarToComb.portConvRadComb, thermStarComb_inside) annotation (Line(points={{79,-1},{79,-1.05},{102,-1.05},{102,0}}, color={191,0,0}));
connect(tempOutAirSensor.T, Sunblind.TOutAir) annotation (Line(points={{-62,-40},{-54,-40},{-54,-38.875},{-47.4375,-38.875}},
connect(tempOutAirSensor.T, Sunblind.TOutAir) annotation (Line(points={{-61.6,
-40},{-54,-40},{-54,-38.875},{-47.4375,-38.875}},
color={0,0,127}));
connect(port_outside, tempOutAirSensor.port) annotation (Line(points={{-98,4},{-90,4},{-90,-40},{-70,-40}},
color={191,0,0}));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,43 +26,32 @@ partial model PartialRoomParams "Partial model with base parameters that are nec

//// Inner / Interior wall parameters
// Heat convection
parameter Integer calcMethodIn=1
parameter AixLib.ThermalZones.HighOrder.Components.Types.CalcMethodConvectiveHeatTransferInsideSurface calcMethodIn=AixLib.ThermalZones.HighOrder.Components.Types.CalcMethodConvectiveHeatTransferInsideSurface.EN_ISO_6946_Appendix_A
"Calculation method of convective heat transfer coefficient at inside surface"
annotation (Dialog(
tab="Inner walls",
group="Heat convection",
compact=true,
descriptionLabel=true), choices(
choice=1 "EN ISO 6946 Appendix A >>Flat Surfaces<<",
choice=2 "By Bernd Glueck",
choice=3 "Custom hCon (constant)",
choice=4 "ASHRAE140-2017",
radioButtons=true));
descriptionLabel=true));

parameter Modelica.Units.SI.CoefficientOfHeatTransfer hConIn_const=2.5
"Custom convective heat transfer coefficient (just for manual selection, not recommended)"
annotation (Dialog(
tab="Inner walls",
group="Heat convection",
enable=(calcMethodIn == 3)));
enable=(calcMethodIn == AixLib.ThermalZones.HighOrder.Components.Types.CalcMethodConvectiveHeatTransferInsideSurface.Custom_hCon)));

parameter Integer radLongCalcMethod=1 "Calculation method for longwave radiation heat transfer"
parameter AixLib.ThermalZones.HighOrder.Components.Types.CalcMethodLongwaveRadiationHeatTransfer radLongCalcMethod=AixLib.ThermalZones.HighOrder.Components.Types.CalcMethodLongwaveRadiationHeatTransfer.No_Approx "Calculation method for longwave radiation heat transfer"
annotation (
Evaluate=true,
Dialog(tab="Inner walls", group="Longwave radiation", compact=true),
choices(
choice=1 "No approx",
choice=2 "Linear approx at wall temp",
choice=3 "Linear approx at rad temp",
choice=4 "Linear approx at constant T_ref",
radioButtons=true));
Dialog(tab="Inner walls", group="Longwave radiation", compact=true));
parameter Modelica.Units.SI.Temperature T_ref=
Modelica.Units.Conversions.from_degC(16)
"Reference temperature for optional linearization of longwave radiation"
annotation (Dialog(
tab="Inner walls",
group="Longwave radiation",
enable=radLongCalcMethod == 4));
enable=radLongCalcMethod == AixLib.ThermalZones.HighOrder.Components.Types.CalcMethodLongwaveRadiationHeatTransfer.Linear_Constant_Tref));

//// Outer / Exterior wall parameters
//Window type
Expand All @@ -81,23 +70,19 @@ partial model PartialRoomParams "Partial model with base parameters that are nec
parameter Real solar_absorptance_OW(min=0, max=1)=0.6 "Solar absoptance outer walls "
annotation (Dialog(tab="Outer walls", group="Solar absorptance", descriptionLabel=true));
// Heat convection
parameter Integer calcMethodOut=1 "Calculation method for convective heat transfer coefficient"
parameter AixLib.ThermalZones.HighOrder.Components.Types.CalcMethodConvectiveHeatTransfer calcMethodOut=AixLib.ThermalZones.HighOrder.Components.Types.CalcMethodConvectiveHeatTransfer.DIN_6946 "Calculation method for convective heat transfer coefficient"
annotation (Dialog(
tab="Outer walls",
group="Heat convection",
compact=true,
descriptionLabel=true), choices(
choice=1 "DIN 6946",
choice=2 "ASHRAE Fundamentals",
choice=3 "Custom hCon (constant)",
radioButtons=true));
replaceable parameter DataBase.Surfaces.RoughnessForHT.PolynomialCoefficients_ASHRAEHandbook surfaceType=DataBase.Surfaces.RoughnessForHT.Brick_RoughPlaster() "Surface type of outside wall" annotation (Dialog(tab="Outer walls", group="Heat convection", enable=(calcMethodOut == 2)));
descriptionLabel=true));
replaceable parameter DataBase.Surfaces.RoughnessForHT.PolynomialCoefficients_ASHRAEHandbook surfaceType=DataBase.Surfaces.RoughnessForHT.Brick_RoughPlaster() "Surface type of outside wall" annotation (Dialog(tab="Outer walls", group="Heat convection", enable=(calcMethodOut == AixLib.ThermalZones.HighOrder.Components.Types.CalcMethodConvectiveHeatTransfer.ASHRAE_Fundamentals)));
parameter Modelica.Units.SI.CoefficientOfHeatTransfer hConOut_const=25
"Custom convective heat transfer coefficient (just for manual selection, not recommended)"
annotation (Dialog(
tab="Outer walls",
group="Heat convection",
enable=(calcMethodOut == 3)));
enable=(calcMethodOut == AixLib.ThermalZones.HighOrder.Components.Types.CalcMethodConvectiveHeatTransfer.Custom_hCon)));
// Sunblind
parameter Boolean use_sunblind = false
"Will sunblind become active automatically?"
Expand Down
19 changes: 7 additions & 12 deletions AixLib/Utilities/HeatTransfer/HeatConvOutside.mo
Original file line number Diff line number Diff line change
@@ -1,32 +1,27 @@
within AixLib.Utilities.HeatTransfer;
model HeatConvOutside "Model for heat transfer at outside surfaces. Choice between multiple models"
extends Modelica.Thermal.HeatTransfer.Interfaces.Element1D;
parameter Integer calcMethod=2 "Calculation method for convective heat transfer coefficient" annotation (
parameter AixLib.ThermalZones.HighOrder.Components.Types.CalcMethodConvectiveHeatTransfer calcMethod=AixLib.ThermalZones.HighOrder.Components.Types.CalcMethodConvectiveHeatTransfer.ASHRAE_Fundamentals "Calculation method for convective heat transfer coefficient" annotation (
Evaluate=true,
Dialog(
group="Computational Models",
compact=true,
descriptionLabel=true),
choices(
choice=1 "DIN 6946",
choice=2 "ASHRAE Fundamentals (convective + radiative)",
choice=3 "Custom hCon (constant)",
radioButtons=true));
descriptionLabel=true));
parameter Modelica.Units.SI.Area A(min=0) "Area of surface"
annotation (Dialog(group="Surface properties", descriptionLabel=true));
parameter Modelica.Units.SI.CoefficientOfHeatTransfer hCon_const=25
"Custom convective heat transfer coeffient" annotation (Dialog(
group="Surface properties",
descriptionLabel=true,
enable=calcMethod == 3));
enable=calcMethod == AixLib.ThermalZones.HighOrder.Components.Types.CalcMethodConvectiveHeatTransfer.Custom_hCon));
parameter
DataBase.Surfaces.RoughnessForHT.PolynomialCoefficients_ASHRAEHandbook surfaceType = DataBase.Surfaces.RoughnessForHT.Brick_RoughPlaster()
"Surface type" annotation(Dialog(group = "Surface properties", descriptionLabel = true, enable=
calcMethod == 2), choicesAllMatching = true);
calcMethod == AixLib.ThermalZones.HighOrder.Components.Types.CalcMethodConvectiveHeatTransfer.ASHRAE_Fundamentals), choicesAllMatching = true);
// Variables
Modelica.Units.SI.CoefficientOfHeatTransfer hCon
"Convection heat transfer coeffient";
Modelica.Blocks.Interfaces.RealInput WindSpeedPort if calcMethod == 1 or calcMethod == 2 annotation(Placement(transformation(extent = {{-102, -82}, {-82, -62}}), iconTransformation(extent={{-100,-80},{-80,-60}})));
Modelica.Blocks.Interfaces.RealInput WindSpeedPort if calcMethod == AixLib.ThermalZones.HighOrder.Components.Types.CalcMethodConvectiveHeatTransfer.DIN_6946 or calcMethod == AixLib.ThermalZones.HighOrder.Components.Types.CalcMethodConvectiveHeatTransfer.ASHRAE_Fundamentals annotation(Placement(transformation(extent = {{-102, -82}, {-82, -62}}), iconTransformation(extent={{-100,-80},{-80,-60}})));

protected
Modelica.Blocks.Interfaces.RealInput WindSpeed_internal(unit="m/s");
Expand All @@ -35,9 +30,9 @@ equation
port_a.Q_flow =hCon*A*(port_a.T - port_b.T);

//Determine convection heat transfer coefficient hCon
if calcMethod == 1 then
if calcMethod == AixLib.ThermalZones.HighOrder.Components.Types.CalcMethodConvectiveHeatTransfer.DIN_6946 then
hCon = (4 + 4*WindSpeed_internal);
elseif calcMethod == 2 then
elseif calcMethod == AixLib.ThermalZones.HighOrder.Components.Types.CalcMethodConvectiveHeatTransfer.ASHRAE_Fundamentals then
hCon = surfaceType.D + surfaceType.E*WindSpeed_internal + surfaceType.F*(WindSpeed_internal^2);
else
hCon = hCon_const;
Expand Down

0 comments on commit 7500d67

Please sign in to comment.