Skip to content
Open
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
14 changes: 13 additions & 1 deletion IDEAS/Buildings/Components/OuterWall.mo
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,12 @@ model OuterWall "Opaque building envelope construction"
parameter Modelica.Units.SI.Length dh(min=-hWal) = 0
"Height difference between top of object and top of wall"
annotation (Dialog(group="Building shade", enable=hasBuildingShade));
parameter Modelica.Units.SI.Length LOv(min=0) = 0
"Distance between overhang edge and wall, perpendicular to wall"
annotation (Dialog(group="Building shade", enable=hasBuildingShade));
parameter Modelica.Units.SI.Length dhOv(min=-hWal) = 0
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would apply the min attribute in the BuildingShade model, in case someone uses this model for e.g. a window.

"Height difference between bottom of overhang and top of wall"
annotation (Dialog(group="Building shade", enable=hasBuildingShade));
parameter Modelica.Units.SI.Length hWal(min=0) = 0 "Wall height"
annotation (Dialog(group="Building shade", enable=hasBuildingShade));
final parameter Real U_value=1/(1/8 + sum(constructionType.mats.R) + 1/25)
Expand Down Expand Up @@ -52,6 +58,8 @@ model OuterWall "Opaque building envelope construction"
final haveBoundaryPorts=false,
final L=L,
final dh=dh,
final LOv=LOv,
final dhOv=dhOv,
final hWin=hWal) if hasBuildingShade
constrainedby IDEAS.Buildings.Components.Shading.Interfaces.PartialShading(
final azi=aziInt)
Expand Down Expand Up @@ -304,6 +312,10 @@ The correct shading parameter values should then be passed through the redeclara
</html>", revisions="<html>
<ul>
<li>
October 19, 2025 by Filip Jorissen:<br/>
Added support for shading overhangs <a href=\"https://github.com/open-ideas/IDEAS/issues/1467\">#1467</a>.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added support for shading overhangs.
See <a href="https://github.com/open-ideas/IDEAS/issues/1467\">#1467

</li>
<li>
August 18, 2025, by Klaas De Jonge:<br/>
Changed inc to incInt where nececarry.
</li>
Expand Down Expand Up @@ -386,4 +398,4 @@ Adjusted implementation for grouping of solar calculations.
</li>
</ul>
</html>"));
end OuterWall;
end OuterWall;
81 changes: 58 additions & 23 deletions IDEAS/Buildings/Components/Shading/BuildingShade.mo
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,23 @@ model BuildingShade
parameter Modelica.Units.SI.Length L(min=0)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Update model documentation: "Component for modeling shade cast by distant opposite objects such as buildings and treelines and/or an overhang"

"Distance to object perpendicular to window"
annotation (Dialog(group="Dimensions (see illustration in documentation)"));
parameter Modelica.Units.SI.Length LOv(min=0) = 0
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would unify the parameter naming of this model and the Overhang model. So either:

  1. dep (as used in the Overhang model)
  2. LOve (use three characters) and apply this change to the Overhang model as well

"Overhang length perpendicular to window"
annotation (Dialog(group="Dimensions (see illustration in documentation)"));
parameter Modelica.Units.SI.Length dh
"Height difference between top of object and top of window glazing"
annotation (Dialog(group="Dimensions (see illustration in documentation)"));
parameter Modelica.Units.SI.Length dhOv = 0
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

gap or dhOve

"Height difference between bottom of overhang and top of window glazing"
annotation (Dialog(group="Dimensions (see illustration in documentation)"));
parameter Modelica.Units.SI.Length hWin(min=0) = 1
"Window height: distance between top and bottom of window glazing"
annotation (Dialog(group="Dimensions (see illustration in documentation)"));
parameter Real fraSha(min=0,max=1) = 1
"Fraction of the light that is shaded, e.g. smaller than 1 for shading cast by tree lines.";
final parameter Real fraSunDifSky(final min=0,final max=1, final unit="1") = 1-vieAngObj/(Modelica.Constants.pi/2)
"Fraction of the light that is absorbed, e.g. smaller than 1 for shading cast by tree lines.";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fraction of the light that is absorbed by the opposite object

parameter Real fraShaOv(min=0,max=1) = fraSha
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fraShaOve

"Fraction of the light that is absorbed for overhang, e.g. smaller than 1 for shading cast by screens.";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. absorbed by the overvang
  2. I find the example somewhat weird. Couldn't you say something like "equal to 1 for a concrete overhang and smaller than 1 for a glass overhang"

final parameter Real fraSunDifSky(final min=0,final max=1, final unit="1") = max(0, 1-(vieAngObj + vieAngOv)/(Modelica.Constants.pi/2))
"Fraction of window area exposed to diffuse sun light";

Real fraSunDir(final min=0,final max=1, final unit="1")
Expand All @@ -24,37 +32,60 @@ model BuildingShade
// Computation assumes that window base is at ground level.
// Viewing angle computed from center of glazing.
protected
final parameter Boolean haveOverhang = LOv > Modelica.Constants.small
"To avoid divisions by zero and obsolete computations";
parameter Modelica.Units.SI.Angle vieAngObj=atan((hWin/2 + dh)/L)
"Viewing angle of opposite object";
parameter Modelica.Units.SI.Angle vieAngOv=if haveOverhang then Modelica.Constants.pi/2 - atan((hWin/2 + dhOv)/LOv) else 0
"Viewing angle of overhang";
Comment on lines 37 to +40
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. Isn't view factor a better word?
  2. I would expect vieAngOve to be equal to atan(LOve/(hWin/2+dhOve)). How did you derive your expression?

final parameter Modelica.Units.SI.Angle rot=0
"Rotation angle of opposite building. Zero when parallel, positive when rotated clockwise"
annotation (Evaluate=true);
final parameter Real coeff = 1-fraSha "More efficient implementation";
final parameter Real hWinInv = 1/hWin "More efficient implementation";
final parameter Real coeff = 1-fraSha
"More efficient implementation";
final parameter Real coeffOv = 1-fraShaOv
"More efficient implementation";
final parameter Real hWinInv = 1/hWin
"More efficient implementation";
Comment on lines +44 to +49
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. Update parameter declaration to something like "Intermediate parameter to simplify model equations and expressions"
  2. Do you really need the coeff parameters? I guess the final expressions are more understandable if fraSha and fraShaOve are directly used.

Real tanZen = tan(min(angZen, Modelica.Constants.pi/2.01));
Modelica.Units.SI.Length L1
Modelica.Units.SI.Length L1 = max(0, L/cos(verAzi))
"Horizontal distance to object when following vertical plane through sun ray";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"opposite object" (clarify now that the model has two different shading objects)

Modelica.Units.SI.Length L2
"Distance to object, taking into account sun position";
Modelica.Units.SI.Angle alt=(Modelica.Constants.pi/2) - angZen;
Modelica.Units.SI.Angle verAzi
Modelica.Units.SI.Length L2 = L1*tan(alt)
"Maximum height of object before it casts some shade";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"opposite object" (clarify now that the model has two different shading objects)

Modelica.Units.SI.Length L1Ov = max(0, LOv/cos(verAzi))
"Horizontal distance to overhang edge when following vertical plane through sun ray";
Modelica.Units.SI.Length L2Ov = L1Ov*tan(alt)
"Minimum vertical distance between overhang and window before overhang casts some shade";
Modelica.Units.SI.Angle alt=(Modelica.Constants.pi/2) - angZen
"Solar altitude angle";
Modelica.Units.SI.Angle verAzi = Modelica.Math.acos(cos(angInc)/cos(alt))
"Angle between downward projection of sun's rays and normal to vertical surface";
initial equation
assert(fraSunDifSky>=0 and fraSunDifSky<=1, "In " + getInstanceName() +
": The parameter fraSunDifSky has the value " +String(fraSunDifSky) + " and
should be within [0,1]. Please contact the IDEAS developers.");


equation

verAzi = Modelica.Math.acos(cos(angInc)/cos(alt));
L1 = max(0,L/cos(verAzi));
L2 = L1*tan(alt);
if noEvent(L2<dh) then
fraSunDir=coeff;
elseif noEvent(L2<dh+hWin) then
fraSunDir=coeff + (L2-dh)*fraSha*hWinInv;
// the below implementation does not yet consider the case where both overhang and object
// cast shade at the same time

if haveOverhang then
if noEvent(L2<dh) then
fraSunDir=coeff;
elseif noEvent(L2<dh+hWin) then
fraSunDir=coeff + (L2-dh)*fraSha*hWinInv;
elseif noEvent(L2Ov>dhOv+hWin) then
fraSunDir=coeffOv;
elseif noEvent(L2Ov>dhOv) then
fraSunDir=coeffOv + (L2Ov-dhOv)*fraShaOv*hWinInv;
Comment on lines +69 to +76
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You first check L2 and then L2Ove, is it always guaranteed that only 1 elseif statement is true?

else
fraSunDir=1;
end if;
else
fraSunDir=1;
if noEvent(L2<dh) then
fraSunDir=coeff;
elseif noEvent(L2<dh+hWin) then
fraSunDir=coeff + (L2-dh)*fraSha*hWinInv;
else
fraSunDir=1;
end if;

end if;

HShaDirTil=fraSunDir*HDirTil;
Expand Down Expand Up @@ -96,6 +127,10 @@ can be modelled by changing the value of parameter <code>fraSha</code> according
</html>", revisions="<html>
<ul>
<li>
October 18, 2025 by Filip Jorissen:<br/>
Added support for shading overhangs <a href=\"https://github.com/open-ideas/IDEAS/issues/1467\">#1467</a> and updated documentation image.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added support for shading overhangs and updated documentation image.
See <a href="https://github.com/open-ideas/IDEAS/issues/1467\">#1467

</li>
<li>
July 18, 2022 by Filip Jorissen:<br/>
Refactored for <a href=\"https://github.com/open-ideas/IDEAS/issues/1270\">#1270</a> for including thermal effect of screens.
</li>
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading