ALGORITHMIC_MODEL CESkySun /* In order to activate Debug feature: /* deb = */ 1. Change IDA file to give integration time in hours. 2. Set parameters in CESkySun to select time interval where debugging is desired (DebugFrom,DebugTo) /* deb */ 1. Inhibit daylight saving (CESkySun does not have info). 2. Set parameters in CESkySun to select time interval where debugging is desired (DebugFrom,DebugTo); use hours within year for this. /* deb . */ 3. Run from Command Line: IDA i=input S > logfile */ ABSTRACT "Solar radiation thru skylight. For further doc, see Skylight.doc Prepares incoming radiation and heat fluxes used by equation model CESkyLit.nmf. Radiation back from zone to skylight is modeled in CESkyLit.nmf. Variable shading controlled by schedule is implemented (by radiation levels can be included later). The coordinates of the skylight surfaces should be in the same coordinate system. The origin of the coordinate system is insignificant. The z-axis should be directed upwards from ground. The y-axis should have azimut equal to the azimutFace in the connected Face model. Notation The skylight has floor and roof plus four sides. The roof and sides together form five faces. History (in reverse order): 020305 PG Calc light when IDifShd > 0.01, even if Elev<0 020226 PG Added orientation w.r.t. face coordinates Changed order of points in SkyFloor: 3 <--> 4 011002 Abg Calc of slopeFace corrected 010902 ABg Add check on zero face area. 010612 ABg deb Debug modified to handle calendar time 000726 AB First version started " EQUATIONS /* Calculate shading, current target is just skyligth floor */ IF nShades == 0 THEN DirectShad := 1 ELSE CALL CalcShad(1, Azimut, Elev, SkyFloor, nShades, nPoints, Coords, Trans, DirectShad, THREE, FOUR) END_IF; /* Get radiation incident on skylight */ IDirShd := IDirInc * DirectShad; IDifSkyShd := IDifSkyInc * DifShadSky; IDifGrdShd := IDifGrdInc * DifShadGrd; IDifShd := IDifSkyShd + IDifGrdShd; /* Select shading coefficients */ /* deliver factor_absorbed corrected for U value */ ShadingOn := SchedShading; IF ShadingOn > 0.5 THEN DET_In := DET1; EAiP_In := 1 / (1 - h_12*0.11) * (SF1 - DET1); DET_Out := DET2; EAiP_Out := 1 / (1 - h_12*0.11) * (SF2 - DET2); ELSE DET_In := DET0_In; EAiP_In := 1 / (1 - h_0*0.11) * (SF0_In - DET0_In); DET_Out := DET0_Out; EAiP_Out := 1 / (1 - h_0*0.11) * (SF0_Out - DET0_Out); END_IF; /* IF Elev > 0 THEN */ IF Elev > 0 OR IDifShd > 0.01 THEN /* deb + */ IF DebugTo > DebugFrom THEN IF time > 1E8 THEN /* calendar time is used */ CALL UT2Calendar(time, 1E6, 1E6, year_no, day_in_year, hour1_in_year, hour1_in_day, month, day, week_day); ELSE /* assume that integration is specified in hours */ hour1_in_year := time/3600; END_IF; DebugF := IF DebugFrom < hour1_in_year AND hour1_in_year < DebugTo THEN 1 ELSE 0 END_IF; ELSE DebugF := 0; END_IF; /* deb . */ CALL SkyTrace (DebugF, Azimut, Elev, IDirShd, IDifShd, SkyCoord, aFace, frameRat, aFloor, aGlassTot, aFrameTot, DET_In, EAiP_In, DET_Out, EAiP_Out, reflFrmExt, reflFrmInt, THREE, FOUR, FIVE, EIGHT, RDir, RDifInt, RSwFrmExt, QAbsGlsInt, QAbsFrmInt, RSwOut); RDirZone := Rdir; RDifEmInt := RDifInt; RSwFrameExt := RSwFrmExt; ROut2Amb := RSwOut; AzimutZone := Azimut; ElevZone := Elev; QAbsGlassInt := QAbsGlsInt; QAbsFrameInt := QAbsFrmInt; ELSE RDirZone := 0; RDifEmInt := 0; RSwFrameExt := 0; ROut2Amb := 0; AzimutZone := Azimut; ElevZone := Elev; QAbsGlassInt := 0; QAbsFrameInt := 0; END_IF; LINKS /* type name variables... */ /* from Face.nmf */ Face2Wind Amb2Skyl TAmb, TGround, TSky, hExt, IDirInc, IDifSkyInc, IDifGrdInc, Azimut, Elev, AngleInc; /* to CESkyLit.nmf */ RRRWW Sun2Skyl POS_OUT RDirZone, POS_OUT RDifEmInt, POS_OUT ROut2Amb, AzimutZone, ElevZone; QQQ QAbsGlsFrm POS_OUT QAbsGlassInt, POS_OUT RSwFrameExt, POS_OUT QAbsFrameInt; /* shading control */ Z CtrlShading SchedShading; VARIABLES /* type name role def min max description */ Factor DebugF LOC 0 0 BIG "set 1 to get debug, when time in specified range" Temp TAmb IN 20 ABS_ZERO BIG "ambient temp" Temp TSky IN 16 ABS_ZERO BIG "sky temperature" Temp TGround IN 21 ABS_ZERO BIG "ground temperature" HeatCondA hExt IN 1 0 BIG "external conv heat coeff" Angle Azimut IN 0 0 360 "sun's rel azimut" Angle Elev IN 0 0 90 "sun's elevation" Angle AzimutZone OUT 0 0 360 "sun's rel azimut" Angle ElevZone OUT 0 0 90 "sun's elevation" Angle AngleInc IN 0 0 90 "incident angle of direct radiation" RadA IDifSkyInc IN 0 0 BIG "incident diffuse rad fr sky" RadA IDifGrdInc IN 0 0 BIG "incident diffuse rad fr ground" RadA IDirInc IN 0 0 BIG "incident direct rad" Factor DirectShad LOC "Eff shading factor for direct rad" RadA IDifSkyShd LOC "shaded diffuse rad fr sky" RadA IDifGrdShd LOC "shaded diffuse rad fr ground" RadA IDifShd LOC "total shaded diffuse rad" RadA IDirShd LOC "shaded direct rad" /* new nomenclature */ Factor DET_In LOC "direct energy transm, inward" Factor EAiP_In LOC "energy absorbed inner pane, inward" Factor DET_Out LOC "direct energy transm, outward" Factor EAiP_Out LOC "energy absorbed inner pane, outward" HeatFlux QAbsGlsInt LOC 0 -BIG BIG "SW heat absorbed on glass inside" HeatFlux QAbsFrmInt LOC 0 -BIG BIG "SW heat absorbed on frame inside" HeatFlux QAbsGlassInt OUT 0 -BIG BIG "SW heat absorbed on glass inside" HeatFlux QAbsFrameInt OUT 0 -BIG BIG "SW heat absorbed on frame inside" Radiation RDir LOC "direct rad thru floor" Radiation RDifInt LOC "diffuse rad emanating from inside of skylight" Radiation RSwFrmExt LOC "SW rad onto frame exterior" HeatFlux RSwOut LOC "SW rad reflected or returning out thru glass; does not include rad fr zone" Radiation RDirZone OUT 0 0 BIG "direct rad to zone" Radiation RDifEmInt OUT 0 0 BIG "diffuse rad emanating from inside of skylight" Heatflux RSwFrameExt OUT 0 0 BIG "SW rad onto frame exterior" Radiation ROut2Amb OUT 0 0 BIG "direct rad returned to ambient" Factor schedShading IN 0 0 1 "time control 0=OFF/1=ON" Factor ShadingOn LOC 0 0 1 "shading 0=OFF/1=ON" /* deb + */ Factor year_no LOC 0 0 BIG "work for debug" Factor day_in_year LOC 0 0 BIG "work for debug" Factor hour1_in_year LOC 0 0 BIG "work for debug" Factor hour1_in_day LOC 0 0 BIG "work for debug" Factor month LOC 0 0 BIG "work for debug" Factor day LOC 0 0 BIG "work for debug" Factor week_day LOC 0 0 BIG "work for debug" /* deb . */ MODEL_PARAMETERS /* type name role [def min max] decription */ INT nShades SMP 0 0 BIGINT "number of shading surfaces" INT nPoints SMP 0 0 BIGINT "number of shading surfaces * 4" INT Three CMP 3 3 3 "The number 3" INT Four CMP 4 4 4 "The number 4" INT Five CMP 5 5 5 "The number 5" INT Eight CMP 8 8 8 "The number 8" PARAMETERS /* type name role def min max description */ Generic DebugFrom S_P 1 -BIG BIG "define time interval [hr] for debug" Generic DebugTo S_P 0 -BIG BIG "define time interval [hr] for debug" Length x0 S_P "x of floor lower left corner" Length y0 S_P "y of floor lower left corner" Length z0 S_P "z of floor lower left corner" Length width S_P "Floor width (x-axis)" Length length S_P "Floor length (y-axis)" Length height S_P "Skylight height (z-axis)" Length l1 S_P "Distances between floor .." Length l2 S_P "and roof rectangles in .." Length l3 S_P "normal projection .." Length l4 S_P "of roof onto floor" Angle orient S_P 0.0 "zone orientation wr to site" Area aGlass[Five] S_P "Glass area by face" /* new nomenclature */ Factor SF0_In S_P 0.87 SMALL 1 "solar factor wo shading, inward" Factor DET0_In S_P 0.81 SMALL 1 "dir energy transm wo shading, inward" Factor SF0_Out S_P 0.87 SMALL 1 "solar factor wo shading, outward" Factor DET0_Out S_P 0.81 SMALL 1 "dir energy transm wo shading, outward" Factor m_SF1 S_P 0.5 SMALL 1 "red SF thru shading, in" Factor m_DET1 S_P 0.3 SMALL 1 "red DET thru shading, in" Factor m_SF2 S_P 0.5 SMALL 1 "red SF thru shading, out" Factor m_DET2 S_P 0.3 SMALL 1 "red DET thru shading, out" Factor m_h S_P 0.9 SMALL 1 "reduction of h thru shading" HeatCondA h_0 S_P 3.1 SMALL 5.9 "U-value wo shading" Factor reflFrmExt S_P 0.6 SMALL 1 "Reflectivity of frame outside" Factor reflFrmInt S_P 0.6 SMALL 1 "Reflectivity of frame inside" /* shading surfaces */ Length Coords[Three,nPoints] S_P 0 -BIG BIG "coordinates of surfaces, relative to skylight floor" Factor Trans[nShades] S_P 0 0 1 "Transparency of shade, 1 = totally transparent" /* calculated parameters */ Area aFloor C_P "Floor area" Area aFace[Five] C_P "Area by face" Factor frameRat[Five] C_P "Frame area / total area by face" Area aFrameTot C_P "Total frame area" Area aGlassTot C_P "Total glass area" Factor DifShadSky C_P "Eff factor for diff rad sky" Factor DifShadGrd C_P "Eff factor for diff rad grd" Angle SlopeFace[Five] C_P "Slope of face 0 = hor upward 90 = vertical 180 = hor downward; Note: window is opposite" Length SkyFloor[Three,Four] C_P "coordinates of skylight floor" Length SkyCoord[Three,Eight] C_P "coordinates of skyliht corners 1st four are for floor" Factor SF1 C_P "factor SF w shading, in" Factor DET1 C_P "factor DET w shading, in" Factor SF2 C_P "factor SF w shading, out" Factor DET2 C_P "factor DET w shading, out" Factor h_12 C_P "U-value w shading, in or out" Factor cos_phi C_P "cos of rotation" Factor sin_phi C_P "sin of rotation" PARAMETER_PROCESSING Three := 3; Four := 4; Five := 5; Eight := 8; /* extend geometry description */ aFloor := length * width; aFace[1] := (width + width -l2-l4)/2 * sqrt(height**2 + l1**2); aFace[2] := (length + length -l1-l3)/2 * sqrt(height**2 + l2**2); aFace[3] := (width + width -l2-l4)/2 * sqrt(height**2 + l3**2); aFace[4] := (length + length -l1-l3)/2 * sqrt(height**2 + l4**2); aFace[5] := (width-l2-l4) * (length-l1-l3); FOR i = 1,Five frameRat[i] := IF aFAce[i] > 0 THEN 1 - aGlass[i] / aFace[i] ELSE 1 END_IF; END_FOR; aGlassTot := SUM i = 1,Five aGlass[i] END_SUM; aFrameTot := SUM i = 1,Five aFace[i] END_SUM - aGlassTot; slopeFace[1] := 90 - 180/PI * ATAN(l1/height); slopeFace[2] := 90 - 180/PI * ATAN(l2/height); slopeFace[3] := 90 - 180/PI * ATAN(l3/height); slopeFace[4] := 90 - 180/PI * ATAN(l4/height); slopeFace[5] := 0; /* calculate coords of floor */ sin_phi := sin(orient/180*PI); cos_phi := cos(orient/180*PI); SkyFloor[1,1] := x0; SkyFloor[2,1] := y0; SkyFloor[3,1] := z0; SkyFloor[1,2] := x0 + width*cos_phi; SkyFloor[2,2] := y0 + width*sin_phi; SkyFloor[3,2] := z0; SkyFloor[1,3] := x0 - length*sin_phi; SkyFloor[2,3] := y0 + length*cos_phi; SkyFloor[3,3] := z0; SkyFloor[1,4] := x0 + width*cos_phi - length*sin_phi; SkyFloor[2,4] := y0 + width*sin_phi + length*cos_phi; SkyFloor[3,4] := z0; /* calculate coords of skylight floor + roof */ SkyCoord[1,1] := x0; SkyCoord[2,1] := y0; SkyCoord[3,1] := z0; SkyCoord[1,2] := x0 + width*cos_phi; SkyCoord[2,2] := y0 + width*sin_phi; SkyCoord[3,2] := z0; SkyCoord[1,3] := x0 + width*cos_phi - length*sin_phi; SkyCoord[2,3] := y0 + width*sin_phi + length*cos_phi; SkyCoord[3,3] := z0; SkyCoord[1,4] := x0 - length*sin_phi; SkyCoord[2,4] := y0 + length*cos_phi; SkyCoord[3,4] := z0; SkyCoord[1,5] := x0 + l4*cos_phi - l3*sin_phi; SkyCoord[2,5] := y0 + l4*sin_phi + l3*cos_phi; SkyCoord[3,5] := z0 + height; SkyCoord[1,6] := x0 + (width-l2)*cos_phi - l3*sin_phi; SkyCoord[2,6] := y0 + (width-l2)*sin_phi + l3*cos_phi; SkyCoord[3,6] := z0 + height; SkyCoord[1,7] := x0 + (width-l2)*cos_phi - (length-l1)*sin_phi; SkyCoord[2,7] := y0 + (width-l2)*sin_phi + (length-l1)*cos_phi; SkyCoord[3,7] := z0 + height; SkyCoord[1,8] := x0 + l4*cos_phi - (length-l1)*sin_phi; SkyCoord[2,8] := y0 + l4*sin_phi + (length-l1)*cos_phi; SkyCoord[3,8] := z0 + height; IF nShades == 0 THEN DifShadSky := 1; DifShadGrd := 1; ELSE CALL DiffShad( nShades, nPoints, slopeFace[5], SkyFloor, Coords, Trans, DifShadSky, DifShadGrd, THREE, FOUR) END_IF; SF1 := SF0_In * m_SF1; DET1 := DET0_In * m_DET1; SF2 := SF0_Out * m_SF2; DET2 := DET0_Out * m_DET2; h_12 := h_0 * m_h; END_MODEL