Skip to content

Commit

Permalink
Merge pull request #1466 from RWTH-EBC/1426-non-standard-annotation-phe
Browse files Browse the repository at this point in the history
1426 non standard annotation phe
  • Loading branch information
PatrickHenkel1 authored Jan 25, 2024
2 parents 25a9c1e + aebb679 commit 26e999f
Show file tree
Hide file tree
Showing 43 changed files with 439 additions and 413 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,12 @@ equation
connect(heatFlowSensorConv.port_b,fixedTemp. port) annotation (Line(points={{52,19},{56,19},{56,14},{60,14}}, color={191,0,0}));
connect(fixedTemp.port,heatFlowSensorRad. port_b) annotation (Line(points={{60,14},{56,14},{56,-8},{34,-8}},
color={191,0,0}));
connect(heatFlowSensorConv.Q_flow,sumQ_flows. u[1]) annotation (Line(points={{45,12},{46,12},{46,-50},{30,-50},{30,-61.9},{34,-61.9}}, color={0,0,127}));
connect(heatFlowSensorRad.Q_flow,sumQ_flows. u[2]) annotation (Line(points={{26,-16},{26,-66.1},{34,-66.1}}, color={0,0,127}));
connect(sumQ_flows.y,HeatOut) annotation (Line(points={{47.02,-64},{100,-64}},color={0,0,127}));
connect(heatFlowSensorConv.Q_flow,sumQ_flows. u[1]) annotation (Line(points={{45,11.3},
{46,11.3},{46,-50},{30,-50},{30,-65.05},{34,-65.05}}, color={0,0,127}));
connect(heatFlowSensorRad.Q_flow,sumQ_flows. u[2]) annotation (Line(points={{26,
-16.8},{26,-62.95},{34,-62.95}}, color={0,0,127}));
connect(sumQ_flows.y,HeatOut) annotation (Line(points={{47.02,-64},{24,-64},{
24,0},{0,0}}, color={0,0,127}));
connect(varTempRoom.port, humanIntGains.TRoom) annotation (Line(points={{-64,52},{-40,52},{-40,12.7},{-14.7,12.7}}, color={191,0,0}));
connect(combiTimeTable.y[1], humanIntGains.uRel) annotation (Line(points={{-61,-16},{-40,-16},{-40,1},{-16,1}}, color={0,0,127}));
connect(heatFlowSensorConv.port_a, humanIntGains.convHeat) annotation (Line(points={{38,19},{24,19},{24,8.8},{8.7,8.8}}, color={191,0,0}));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ model MachinesDIN18599 "Heat flow due to machines based on DIN 18599 (number of
gain(final k=nrPeople),
gainSurfaces(final k=areaSurfaceMachinesTotal));

parameter Integer activityType=2 "Machine activity" annotation(Dialog( compact = true, descriptionLabel = true), choices(choice=1 "low", choice = 2 "middle", choice = 3 "high", radioButtons = true));
parameter AixLib.BoundaryConditions.InternalGains.Types.MachineActivity activityType=AixLib.BoundaryConditions.InternalGains.Types.MachineActivity.middle "Machine activity" annotation(Dialog( compact = true, descriptionLabel = true));
parameter Real nrPeople=1.0 "Number of people with machines" annotation(Dialog(descriptionLabel = true));
parameter Modelica.Units.SI.Area areaSurfaceMachinesTotal=max(1e-4,
surfaceMachine*nrPeople)
Expand All @@ -21,7 +21,9 @@ protected
table=[1,50; 2,100; 3,150],
columns={2})
annotation (Placement(transformation(extent={{-60,40},{-40,60}})));
Modelica.Blocks.Sources.Constant activity(k=activityType)
Modelica.Blocks.Sources.Constant activity(k=if activityType==AixLib.BoundaryConditions.InternalGains.Types.MachineActivity.low then 1
elseif activityType==AixLib.BoundaryConditions.InternalGains.Types.MachineActivity.middle then 2
else 3)
annotation (Placement(transformation(extent={{-90,40},{-70,60}})));
equation
connect(activity.y, tableHeatOutput.u[1]) annotation (Line(points={{-69,50},{-62,50}}, color={0,0,127}));
Expand Down
7 changes: 7 additions & 0 deletions AixLib/BoundaryConditions/InternalGains/Types.mo
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
within AixLib.BoundaryConditions.InternalGains;
package Types
type MachineActivity = enumeration(
low "low",
middle "middle",
high "high") "Enumeration to define the machine activity";
end Types;
1 change: 1 addition & 0 deletions AixLib/BoundaryConditions/InternalGains/package.order
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ Machines
Moisture
Examples
BaseClasses
Types
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
within AixLib.BoundaryConditions.WeatherData.Old.WeatherTRY.RadiationOnTiltedSurface.BaseClasses;
partial model PartialRadOnTiltedSurf
parameter Integer WeatherFormat = 1 "Format weather file" annotation (Dialog(group=
"Properties of Weather Data", compact = true, descriptionLabel = true), choices(choice = 1 "TRY", choice= 2 "TMY", radioButtons = true));
parameter Boolean WeatherFormat = false "Format weather file: If checked TMY, else TRY" annotation (Dialog(group=
"Properties of Weather Data", descriptionLabel = true), choices(checkBox = true));
parameter Modelica.Units.NonSI.Angle_deg Latitude=49.5 "latitude of location"
annotation (Dialog(group="Location Properties"));
parameter Real GroundReflection=0.2 "ground reflection coefficient"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,10 @@ equation
R = R_help;

// conversion of direct and diffuse horizontal radiation
if WeatherFormat == 1 then // TRY
if not WeatherFormat then // TRY
InBeamRadHor = solarInput1;
InDiffRadHor = solarInput2;
else // WeatherFormat == 2 , TMY then
else // WeatherFormat == true , TMY then
InBeamRadHor = solarInput1 * cos_theta_z;
InDiffRadHor = max(solarInput2-InBeamRadHor, 0);
end if;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -192,10 +192,10 @@ equation
R = a / b;

// conversion of direct and diffuse horizontal radiation
if WeatherFormat == 1 then // TRY
if not WeatherFormat then // TRY
InBeamRadHor = solarInput1;
InDiffRadHor = solarInput2;
else // WeatherFormat == 2 , TMY then
else // WeatherFormat == true , TMY then
InBeamRadHor = solarInput1 * cos_theta_z;
InDiffRadHor = max(solarInput2-InBeamRadHor, 0);
end if;
Expand Down
49 changes: 24 additions & 25 deletions AixLib/BoundaryConditions/WeatherData/Old/WeatherTRY/Weather.mo
Original file line number Diff line number Diff line change
Expand Up @@ -25,16 +25,15 @@ model Weather "Complex weather model"

replaceable model RadOnTiltedSurface =
AixLib.BoundaryConditions.WeatherData.Old.WeatherTRY.RadiationOnTiltedSurface.RadOnTiltedSurf_Liu
constrainedby AixLib.BoundaryConditions.WeatherData.Old.WeatherTRY.RadiationOnTiltedSurface.BaseClasses.PartialRadOnTiltedSurf
constrainedby
AixLib.BoundaryConditions.WeatherData.Old.WeatherTRY.RadiationOnTiltedSurface.BaseClasses.PartialRadOnTiltedSurf
"Model for calculating radiation on tilted surfaces" annotation(Dialog(group="Solar radiation on oriented surfaces", descriptionLabel = true), choicesAllMatching= true);

parameter
DataBase.Weather.SurfaceOrientation.SurfaceOrientationBaseDataDefinition SOD = DataBase.Weather.SurfaceOrientation.SurfaceOrientationData_N_E_S_W_Hor()
"Surface orientation data" annotation(Dialog(group = "Solar radiation on oriented surfaces", descriptionLabel = true), choicesAllMatching = true);
Utilities.Interfaces.SolarRad_out SolarRadiation_OrientedSurfaces[SOD.nSurfaces] annotation(Placement(transformation(extent = {{-10, -10}, {10, 10}}, rotation = 90, origin={50,96}), iconTransformation(extent = {{-10, -10}, {10, 10}}, rotation = 270, origin = {-78, -110})));
parameter Integer Outopt = 2 "Output options" annotation(Dialog(tab = "Optional output vector", compact = true, descriptionLabel = true), choices(choice = 1
"one vector", choice = 2
"individual vectors", radioButtons = true));
parameter Boolean outOpt = true "Output individual vectors instead of one vector [-]" annotation(Dialog(tab = "Optional output vector", descriptionLabel = true), choices(checkBox = true));
parameter Boolean Cloud_cover = false "Cloud cover [-] (TRY col 7)" annotation(Dialog(tab = "Optional output vector", descriptionLabel = true), choices(checkBox = true));
parameter Boolean Wind_dir = false "Wind direction [deg] (TRY col 8)" annotation(Dialog(tab = "Optional output vector", descriptionLabel = true), choices(checkBox = true));
parameter Boolean Wind_speed = false "Wind speed [m/s] (TRY col 9)" annotation(Dialog(tab = "Optional output vector", descriptionLabel = true), choices(checkBox = true));
Expand All @@ -52,24 +51,24 @@ model Weather "Complex weather model"
Latitude=Latitude,
DiffWeatherDataTime=DiffWeatherDataTime) annotation (Placement(
transformation(extent={{-62,18},{-38,42}})));
RadOnTiltedSurface RadOnTiltedSurf[SOD.nSurfaces](each Latitude = Latitude, each GroundReflection = GroundReflection, Azimut = SOD.Azimut, Tilt = SOD.Tilt, each WeatherFormat=1) annotation(Placement(transformation(extent = {{-2, 18}, {22, 42}})));
RadOnTiltedSurface RadOnTiltedSurf[SOD.nSurfaces](each Latitude = Latitude, each GroundReflection = GroundReflection, Azimut = SOD.Azimut, Tilt = SOD.Tilt, each WeatherFormat=false) annotation(Placement(transformation(extent = {{-2, 18}, {22, 42}})));
Modelica.Blocks.Sources.CombiTimeTable WeatherData(fileName = Modelica.Utilities.Files.loadResource(fileName), columns = columns, offset = offset, table = [0, 0; 1, 1], startTime = scalar(startTime), tableName = tableName, tableOnFile = tableName <> "NoName", smoothness = smoothness, extrapolation = extrapolation) annotation(Placement(transformation(extent = {{-60, -70}, {-40, -50}})));
Modelica.Blocks.Routing.DeMultiplex3 deMultiplex(n3 = 9) annotation(Placement(transformation(extent = {{-26, -70}, {-6, -50}})));
Modelica.Blocks.Interfaces.RealOutput WeatherDataVector[m] if Outopt == 1 and (Cloud_cover or Wind_dir or Wind_speed or Air_temp or Air_press or Mass_frac or Rel_hum or Sky_rad or Ter_rad) annotation(Placement(transformation(origin = {-1, -110}, extent = {{-10, -10}, {10, 10}}, rotation = 270)));
Modelica.Blocks.Interfaces.RealOutput CloudCover if Cloud_cover and Outopt == 2 "[0..8]" annotation(Placement(transformation(extent = {{114, 74}, {134, 94}}), iconTransformation(extent = {{150, 110}, {170, 130}})));
Modelica.Blocks.Interfaces.RealOutput WindDirection(unit = "deg") if Wind_dir and Outopt == 2
Modelica.Blocks.Interfaces.RealOutput WeatherDataVector[m] if outOpt == false and (Cloud_cover or Wind_dir or Wind_speed or Air_temp or Air_press or Mass_frac or Rel_hum or Sky_rad or Ter_rad) annotation(Placement(transformation(origin = {-1, -110}, extent = {{-10, -10}, {10, 10}}, rotation = 270)));
Modelica.Blocks.Interfaces.RealOutput CloudCover if Cloud_cover and outOpt "[0..8]" annotation(Placement(transformation(extent = {{114, 74}, {134, 94}}), iconTransformation(extent = {{150, 110}, {170, 130}})));
Modelica.Blocks.Interfaces.RealOutput WindDirection(unit = "deg") if Wind_dir and outOpt
"in deg [0...360]" annotation(Placement(transformation(extent = {{126, 52}, {146, 72}}), iconTransformation(extent = {{150, 80}, {170, 100}})));
Modelica.Blocks.Interfaces.RealOutput WindSpeed(unit = "m/s") if Wind_speed and Outopt == 2 "in m/s" annotation(Placement(transformation(extent = {{126, 32}, {146, 52}}), iconTransformation(extent = {{150, 50}, {170, 70}})));
Modelica.Blocks.Interfaces.RealOutput AirTemp(unit = "K") if Air_temp and Outopt == 2
Modelica.Blocks.Interfaces.RealOutput WindSpeed(unit = "m/s") if Wind_speed and outOpt "in m/s" annotation(Placement(transformation(extent = {{126, 32}, {146, 52}}), iconTransformation(extent = {{150, 50}, {170, 70}})));
Modelica.Blocks.Interfaces.RealOutput AirTemp(unit = "K") if Air_temp and outOpt
"in Kelvin" annotation(Placement(transformation(extent = {{126, 14}, {146, 34}}), iconTransformation(extent = {{150, 20}, {170, 40}})));
Modelica.Blocks.Interfaces.RealOutput AirPressure(unit = "Pa") if Air_press and Outopt == 2 "in Pa" annotation(Placement(transformation(extent = {{126, -8}, {146, 12}}), iconTransformation(extent = {{150, -10}, {170, 10}})));
Modelica.Blocks.Interfaces.RealOutput WaterInAir if Mass_frac and Outopt == 2
Modelica.Blocks.Interfaces.RealOutput AirPressure(unit = "Pa") if Air_press and outOpt "in Pa" annotation(Placement(transformation(extent = {{126, -8}, {146, 12}}), iconTransformation(extent = {{150, -10}, {170, 10}})));
Modelica.Blocks.Interfaces.RealOutput WaterInAir if Mass_frac and outOpt
"in kg/kg" annotation(Placement(transformation(extent = {{126, -24}, {146, -4}}), iconTransformation(extent = {{150, -40}, {170, -20}})));
Modelica.Blocks.Interfaces.RealOutput RelHumidity if Rel_hum and Outopt == 2
Modelica.Blocks.Interfaces.RealOutput RelHumidity if Rel_hum and outOpt
"in percent" annotation(Placement(transformation(extent = {{126, -42}, {146, -22}}), iconTransformation(extent = {{150, -70}, {170, -50}})));
Modelica.Blocks.Interfaces.RealOutput SkyRadiation(unit = "W/m2") if Sky_rad and Outopt == 2 "in W/m2"
annotation(Placement(transformation(extent = {{126, -62}, {146, -42}}), iconTransformation(extent = {{150, -100}, {170, -80}})));
Modelica.Blocks.Interfaces.RealOutput TerrestrialRadiation(unit = "W/m2") if Ter_rad and Outopt == 2 "in W/m2"
Modelica.Blocks.Interfaces.RealOutput SkyRadiation(unit = "W/m2") if Sky_rad and outOpt "in W/m2"
annotation(Placement(transformation(extent = {{126, -62}, {146, -42}}), iconTransformation(extent = {{150, -100}, {170, -80}})));
Modelica.Blocks.Interfaces.RealOutput TerrestrialRadiation(unit = "W/m2") if Ter_rad and outOpt "in W/m2"
annotation(Placement(transformation(extent = {{126, -78}, {146, -58}}), iconTransformation(extent = {{150, -130}, {170, -110}})));
Modelica.Blocks.Math.Gain hPa_to_Pa(k = 100) if Air_press annotation(Placement(transformation(extent = {{26, -60}, {36, -50}})));
Modelica.Blocks.Math.Gain percent_to_unit(k = 0.01) if Rel_hum annotation(Placement(transformation(extent = {{26, -78}, {36, -68}})));
Expand All @@ -93,31 +92,31 @@ initial equation
equation
// cloud cover
if Cloud_cover then
if Outopt == 1 then
if outOpt == false then
connect(WeatherDataVector[PosWV[1]], deMultiplex.y3[1]);
else
connect(CloudCover, deMultiplex.y3[1]);
end if;
end if;
// wind direction
if Wind_dir then
if Outopt == 1 then
if not outOpt then
connect(WeatherDataVector[PosWV[2]], deMultiplex.y3[2]);
else
connect(WindDirection, deMultiplex.y3[2]);
end if;
end if;
// wind speed
if Wind_speed then
if Outopt == 1 then
if not outOpt then
connect(WeatherDataVector[PosWV[3]], deMultiplex.y3[3]);
else
connect(WindSpeed, deMultiplex.y3[3]);
end if;
end if;
// air temperature
if Air_temp then
if Outopt == 1 then
if not outOpt then
connect(deMultiplex.y3[4], from_degC.u);
connect(WeatherDataVector[PosWV[4]], from_degC.y);
else
Expand All @@ -127,7 +126,7 @@ equation
end if;
// air pressure, conversion from hPa to Pa
if Air_press then
if Outopt == 1 then
if not outOpt then
connect(deMultiplex.y3[5], hPa_to_Pa.u);
connect(WeatherDataVector[PosWV[5]], hPa_to_Pa.y);
else
Expand All @@ -137,7 +136,7 @@ equation
end if;
// mass fraction water in dry air, conversion from g/kg to kg/kg
if Mass_frac then
if Outopt == 1 then
if not outOpt then
connect(deMultiplex.y3[6], g_to_kg.u);
connect(WeatherDataVector[PosWV[6]], g_to_kg.y);
else
Expand All @@ -147,7 +146,7 @@ equation
end if;
// rel. humidity, conversion from % to 0..1
if Rel_hum then
if Outopt == 1 then
if not outOpt then
connect(deMultiplex.y3[7], percent_to_unit.u);
connect(WeatherDataVector[PosWV[7]], percent_to_unit.y);
else
Expand All @@ -157,15 +156,15 @@ equation
end if;
// longwave sky radiation
if Sky_rad then
if Outopt == 1 then
if not outOpt then
connect(WeatherDataVector[PosWV[8]], deMultiplex.y3[8]);
else
connect(SkyRadiation, deMultiplex.y3[8]);
end if;
end if;
// longwave terrestric radiation
if Ter_rad then
if Outopt == 1 then
if not outOpt then
connect(WeatherDataVector[PosWV[9]], deMultiplex.y3[9]);
else
connect(TerrestrialRadiation, deMultiplex.y3[9]);
Expand Down
16 changes: 8 additions & 8 deletions AixLib/Fluid/Pools/BaseClasses/HeatTransferConduction.mo
Original file line number Diff line number Diff line change
Expand Up @@ -40,17 +40,17 @@ model HeatTransferConduction
AixLib.Utilities.HeatTransfer.HeatConvInside HeatConvWaterHorizontalInner(
hCon_const=hConWaterHorizontal,
A=AFloInt,
calcMethod=3,
surfaceOrientation=1)
calcMethod=AixLib.ThermalZones.HighOrder.Components.Types.CalcMethodConvectiveHeatTransferInsideSurface.Custom_hCon,
surfaceOrientation=AixLib.ThermalZones.HighOrder.Components.Types.InsideSurfaceOrientation.vertical_wall)
annotation (Placement(transformation(
origin={-50,-20},
extent={{-10,-10},{10,10}},
rotation=180)));
AixLib.Utilities.HeatTransfer.HeatConvInside HeatConvWaterVerticalOuter(
hCon_const=hConWaterVertical,
A=AWalExt,
calcMethod=3,
surfaceOrientation=1) annotation (Placement(transformation(
calcMethod=AixLib.ThermalZones.HighOrder.Components.Types.CalcMethodConvectiveHeatTransferInsideSurface.Custom_hCon,
surfaceOrientation=AixLib.ThermalZones.HighOrder.Components.Types.InsideSurfaceOrientation.vertical_wall) annotation (Placement(transformation(
origin={-50,40},
extent={{-10,-10},{10,10}},
rotation=180)));
Expand All @@ -64,8 +64,8 @@ model HeatTransferConduction
AixLib.Utilities.HeatTransfer.HeatConvInside HeatConvWaterHorizontalOuter(
hCon_const=hConWaterHorizontal,
A=AFloExt,
calcMethod=3,
surfaceOrientation=1) annotation (Placement(transformation(
calcMethod=AixLib.ThermalZones.HighOrder.Components.Types.CalcMethodConvectiveHeatTransferInsideSurface.Custom_hCon,
surfaceOrientation=AixLib.ThermalZones.HighOrder.Components.Types.InsideSurfaceOrientation.vertical_wall) annotation (Placement(transformation(
origin={-50,-60},
extent={{-10,-10},{10,10}},
rotation=180)));
Expand Down Expand Up @@ -95,8 +95,8 @@ model HeatTransferConduction
AixLib.Utilities.HeatTransfer.HeatConvInside HeatConvWaterVerticalInner(
hCon_const=hConWaterVertical,
A=AWalInt,
calcMethod=3,
surfaceOrientation=1) annotation (Placement(transformation(
calcMethod=AixLib.ThermalZones.HighOrder.Components.Types.CalcMethodConvectiveHeatTransferInsideSurface.Custom_hCon,
surfaceOrientation=AixLib.ThermalZones.HighOrder.Components.Types.InsideSurfaceOrientation.vertical_wall) annotation (Placement(transformation(
origin={-50,80},
extent={{-10,-10},{10,10}},
rotation=180)));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ model OutsideWall
AixLib.ThermalZones.HighOrder.Components.WindowsDoors.BaseClasses.CorrectionSolarGain.CorGSimple,
withSunblind=true,
outside=true,
calcMethodOut=2,
calcMethodOut=AixLib.ThermalZones.HighOrder.Components.Types.CalcMethodConvectiveHeatTransfer.ASHRAE_Fundamentals,
Blinding=0.2,
LimitSolIrr=100,
TOutAirLimit=282.15,
Expand Down
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";
Loading

0 comments on commit 26e999f

Please sign in to comment.