Line data Source code
1 : // EnergyPlus, Copyright (c) 1996-2025, The Board of Trustees of the University of Illinois,
2 : // The Regents of the University of California, through Lawrence Berkeley National Laboratory
3 : // (subject to receipt of any required approvals from the U.S. Dept. of Energy), Oak Ridge
4 : // National Laboratory, managed by UT-Battelle, Alliance for Sustainable Energy, LLC, and other
5 : // contributors. All rights reserved.
6 : //
7 : // NOTICE: This Software was developed under funding from the U.S. Department of Energy and the
8 : // U.S. Government consequently retains certain rights. As such, the U.S. Government has been
9 : // granted for itself and others acting on its behalf a paid-up, nonexclusive, irrevocable,
10 : // worldwide license in the Software to reproduce, distribute copies to the public, prepare
11 : // derivative works, and perform publicly and display publicly, and to permit others to do so.
12 : //
13 : // Redistribution and use in source and binary forms, with or without modification, are permitted
14 : // provided that the following conditions are met:
15 : //
16 : // (1) Redistributions of source code must retain the above copyright notice, this list of
17 : // conditions and the following disclaimer.
18 : //
19 : // (2) Redistributions in binary form must reproduce the above copyright notice, this list of
20 : // conditions and the following disclaimer in the documentation and/or other materials
21 : // provided with the distribution.
22 : //
23 : // (3) Neither the name of the University of California, Lawrence Berkeley National Laboratory,
24 : // the University of Illinois, U.S. Dept. of Energy nor the names of its contributors may be
25 : // used to endorse or promote products derived from this software without specific prior
26 : // written permission.
27 : //
28 : // (4) Use of EnergyPlus(TM) Name. If Licensee (i) distributes the software in stand-alone form
29 : // without changes from the version obtained under this License, or (ii) Licensee makes a
30 : // reference solely to the software portion of its product, Licensee must refer to the
31 : // software as "EnergyPlus version X" software, where "X" is the version number Licensee
32 : // obtained under this License and may not use a different name for the software. Except as
33 : // specifically required in this Section (4), Licensee shall not use in a company name, a
34 : // product name, in advertising, publicity, or other promotional activities any name, trade
35 : // name, trademark, logo, or other designation of "EnergyPlus", "E+", "e+" or confusingly
36 : // similar designation, without the U.S. Department of Energy's prior written consent.
37 : //
38 : // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
39 : // IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
40 : // AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
41 : // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
42 : // CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
43 : // SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
44 : // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
45 : // OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
46 : // POSSIBILITY OF SUCH DAMAGE.
47 :
48 : // ObjexxFCL Headers
49 : #include <ObjexxFCL/string.functions.hh>
50 : #include <ObjexxFCL/time.hh>
51 :
52 : // EnergyPlus Headers
53 : #include <EnergyPlus/Data/EnergyPlusData.hh>
54 : #include <EnergyPlus/DataGlobals.hh>
55 : #include <EnergyPlus/FileSystem.hh>
56 : #include <EnergyPlus/TARCOGCommon.hh>
57 : #include <EnergyPlus/TARCOGGassesParams.hh>
58 : #include <EnergyPlus/TARCOGOutput.hh>
59 : #include <EnergyPlus/TARCOGParams.hh>
60 :
61 : namespace EnergyPlus::TARCOGOutput {
62 :
63 : // MODULE INFORMATION:
64 : // AUTHOR Simon Vidanovic
65 : // DATE WRITTEN June/22/2010
66 : // MODIFIED na
67 : // RE-ENGINEERED na
68 :
69 : // Revision: 6.0.36 (June/22/2010)
70 : // - Initial setup, extracted from TARCOG.for
71 :
72 : // PURPOSE OF THIS MODULE:
73 : // A module which contains debug dump subroutines
74 :
75 : // Using/Aliasing
76 : using namespace TARCOGCommon;
77 : using namespace TARCOGGassesParams;
78 : using namespace TARCOGParams;
79 :
80 0 : void WriteInputArguments(EnergyPlusData &state,
81 : InputOutputFile &InArgumentsFile,
82 : const fs::path &DBGD,
83 : Real64 const tout,
84 : Real64 const tind,
85 : Real64 const trmin,
86 : Real64 const wso,
87 : int const iwd,
88 : Real64 const wsi,
89 : Real64 const dir,
90 : Real64 const outir,
91 : int const isky,
92 : Real64 const tsky,
93 : Real64 const esky,
94 : Real64 const fclr,
95 : Real64 const VacuumPressure,
96 : Real64 const VacuumMaxGapThickness,
97 : const Array1D_int &ibc,
98 : Real64 const hout,
99 : Real64 const hin,
100 : TARCOGGassesParams::Stdrd const standard,
101 : TARCOGThermalModel const ThermalMod,
102 : Real64 const SDScalar,
103 : Real64 const height,
104 : Real64 const heightt,
105 : Real64 const width,
106 : Real64 const tilt,
107 : Real64 const totsol,
108 : int const nlayer,
109 : const Array1D<TARCOGParams::TARCOGLayerType> &LayerType,
110 : const Array1D<Real64> &thick,
111 : const Array1D<Real64> &scon,
112 : const Array1D<Real64> &asol,
113 : const Array1D<Real64> &tir,
114 : const Array1D<Real64> &emis,
115 : const Array1D<Real64> &Atop,
116 : const Array1D<Real64> &Abot,
117 : const Array1D<Real64> &Al,
118 : const Array1D<Real64> &Ar,
119 : const Array1D<Real64> &Ah,
120 : const Array1D<Real64> &SlatThick,
121 : const Array1D<Real64> &SlatWidth,
122 : const Array1D<Real64> &SlatAngle,
123 : const Array1D<Real64> &SlatCond,
124 : const Array1D<Real64> &SlatSpacing,
125 : const Array1D<Real64> &SlatCurve,
126 : const Array1D_int &nslice,
127 : const Array1D<Real64> &LaminateA,
128 : const Array1D<Real64> &LaminateB,
129 : const Array1D<Real64> &sumsol,
130 : const Array1D<Real64> &gap,
131 : const Array1D<Real64> &vvent,
132 : const Array1D<Real64> &tvent,
133 : const Array1D<Real64> &presure,
134 : const Array1D_int &nmix,
135 : Array2A_int const iprop,
136 : Array2A<Real64> const frct,
137 : Array2A<Real64> const xgcon,
138 : Array2A<Real64> const xgvis,
139 : Array2A<Real64> const xgcp,
140 : const Array1D<Real64> &xwght)
141 : {
142 :
143 : // Using/Aliasing
144 : // Argument array dimensioning
145 0 : EP_SIZE_CHECK(ibc, 2);
146 0 : EP_SIZE_CHECK(LayerType, maxlay);
147 0 : EP_SIZE_CHECK(thick, maxlay);
148 0 : EP_SIZE_CHECK(scon, maxlay);
149 0 : EP_SIZE_CHECK(asol, maxlay);
150 0 : EP_SIZE_CHECK(tir, maxlay2);
151 0 : EP_SIZE_CHECK(emis, maxlay2);
152 0 : EP_SIZE_CHECK(Atop, maxlay);
153 0 : EP_SIZE_CHECK(Abot, maxlay);
154 0 : EP_SIZE_CHECK(Al, maxlay);
155 0 : EP_SIZE_CHECK(Ar, maxlay);
156 0 : EP_SIZE_CHECK(Ah, maxlay);
157 0 : EP_SIZE_CHECK(SlatThick, maxlay);
158 0 : EP_SIZE_CHECK(SlatWidth, maxlay);
159 0 : EP_SIZE_CHECK(SlatAngle, maxlay);
160 0 : EP_SIZE_CHECK(SlatCond, maxlay);
161 0 : EP_SIZE_CHECK(SlatSpacing, maxlay);
162 0 : EP_SIZE_CHECK(SlatCurve, maxlay);
163 0 : EP_SIZE_CHECK(nslice, maxlay);
164 0 : EP_SIZE_CHECK(LaminateA, maxlay);
165 0 : EP_SIZE_CHECK(LaminateB, maxlay);
166 0 : EP_SIZE_CHECK(sumsol, maxlay);
167 0 : EP_SIZE_CHECK(gap, maxlay);
168 0 : EP_SIZE_CHECK(vvent, maxlay1);
169 0 : EP_SIZE_CHECK(tvent, maxlay1);
170 0 : EP_SIZE_CHECK(presure, maxlay1);
171 0 : EP_SIZE_CHECK(nmix, maxlay1);
172 0 : iprop.dim(maxgas, maxlay1);
173 0 : frct.dim(maxgas, maxlay1);
174 0 : xgcon.dim(3, maxgas);
175 0 : xgvis.dim(3, maxgas);
176 0 : xgcp.dim(3, maxgas);
177 0 : EP_SIZE_CHECK(xwght, maxgas);
178 :
179 : // Locals
180 0 : Array1D_int DATE_TIME(8);
181 0 : Array1D_string real_CLOCK(3);
182 :
183 : int i;
184 : int j;
185 :
186 : // Formats
187 : static constexpr std::string_view Format_1000("TARCOG input arguments:\n");
188 : static constexpr std::string_view Format_1001("TARCOG debug output, {:4}-{:02}-{:02}, {:02}:{:02}:{:02}\n");
189 : static constexpr std::string_view Format_1002(" WindowID:{:8} - Not specified\n");
190 : static constexpr std::string_view Format_1003(" WindowID:{:8} \n");
191 : static constexpr std::string_view Format_1006(" IGUID: {:8} - Not specified\n");
192 : static constexpr std::string_view Format_1007(" IGUID: {:8} \n");
193 : static constexpr std::string_view Format_1005("Simulation parameters:\n");
194 : static constexpr std::string_view Format_1010(" Tout = {:10.6F} K ( {:7.3F} deg C) - Outdoor temperature\n");
195 : static constexpr std::string_view Format_1015(" Tint = {:10.6F} K ( {:7.3F} deg C) - Indoor temperature\n");
196 : static constexpr std::string_view Format_1020(" Trmin = {:10.6F} K ( {:7.3F} deg C) - Indoor mean radiant temp.\n");
197 : static constexpr std::string_view Format_1030(" wso = {:7.3F} - Outdoor wind speed [m/s]\n");
198 : static constexpr std::string_view Format_1032(" iwd = 0 - Wind direction - windward\n");
199 : static constexpr std::string_view Format_1033(" iwd = 1 - Wind direction - leeward\n");
200 : static constexpr std::string_view Format_1035(" wsi = {:7.3F} - Indoor forced air speed [m/s]\n");
201 : static constexpr std::string_view Format_1040(" dir = {:8.3F} - Direct solar radiation [W/m^2]\n");
202 : static constexpr std::string_view Format_1041(" outir = {:8.3F} - IR radiation [W/m^2]\n");
203 : static constexpr std::string_view Format_1045(" isky = {:3} - Flag for handling tsky, esky\n");
204 : static constexpr std::string_view Format_1050(" tsky = {:10.6F} K ( {:7.3F} deg C) - Night sky temperature\n");
205 : static constexpr std::string_view Format_1055(" esky = {:7.3F} - Effective night sky emmitance\n");
206 : static constexpr std::string_view Format_1060(" fclr = {:7.3F} - Fraction of sky that is clear\n");
207 : static constexpr std::string_view Format_1061(" VacuumPressure = {:7.3F} - maximum allowed gas pressure to be considered as vacuum\n");
208 : static constexpr std::string_view Format_1062(
209 : " VacuumMaxGapThickness = {:7.3F} - maximum allowed vacuum gap thickness with support pillar\n");
210 : static constexpr std::string_view Format_1063(" ibc(1) = {:3} - Outdoor BC switch\n");
211 : static constexpr std::string_view Format_1065(" hout = {:9.5F} - Outdoor film coeff. [W/m^2-K]\n");
212 : static constexpr std::string_view Format_1066(" ibc(2) = {:3} - Indoor BC switch\n");
213 : static constexpr std::string_view Format_1068(" hin = {:9.5F} - Indoor film coeff. [W/m^2-K]\n");
214 : static constexpr std::string_view Format_1070(" standard = {:3} - ISO 15099 calc. standard\n");
215 : static constexpr std::string_view Format_1071(" standard = {:3} - EN 673/ISO 10292 Declared calc. standard\n");
216 : static constexpr std::string_view Format_1072(" standard = {:3} - EN 673/ISO 10292 Design calc. standard\n");
217 : static constexpr std::string_view Format_10731(" ThermalMod = {:3} - ISO15099 thermal model\n");
218 : static constexpr std::string_view Format_10732(" ThermalMod = {:3} - Scaled Cavity Width (SCW) thermal model\n");
219 : static constexpr std::string_view Format_10733(" ThermalMod = {:3} - Convective Scalar Model (CSM) thermal model\n");
220 : static constexpr std::string_view Format_10740(" SDScalar = {:7.5F} - Factor of Venetian SD layer contribution to convection\n\n (only if "
221 : "ThermalModel = 2, otherwise ignored)\n");
222 : static constexpr std::string_view Format_1075("IGU parameters:\n");
223 : static constexpr std::string_view Format_1076(" height = {:10.6F} - IGU cavity height [m]\n");
224 : static constexpr std::string_view Format_1077(" heightt = {:10.6F} - Total window height [m]\n");
225 : static constexpr std::string_view Format_1078(" width = {:10.6F} - Window width [m]\n");
226 : static constexpr std::string_view Format_1079(" tilt = {:7.3F} - Window tilt [deg]\n");
227 : static constexpr std::string_view Format_1080(" totsol = {:10.6F} - Total solar transmittance of IGU\n");
228 : static constexpr std::string_view Format_1081(" nlayer = {:3} - Number of glazing layers\n");
229 : static constexpr std::string_view Format_1089("IGU layers list:\n");
230 : static constexpr std::string_view Format_10802(" Layer{:3} : {:1} - Specular layer - Monolyhtic Glass\n");
231 : static constexpr std::string_view Format_10803(" Layer{:3} : {:1} - Laminated Glass\n");
232 : static constexpr std::string_view Format_10804(" Layer{:3} : {:1} - Horizontal Venetian Blind\n");
233 : static constexpr std::string_view Format_10805(" Layer{:3} : {:1} - Woven Shade\n");
234 : static constexpr std::string_view Format_10806(" Layer{:3} : {:1} - Diffuse Shade\n");
235 : static constexpr std::string_view Format_10809(" Layer{:3} : {:1} - UNKNOWN TYPE!\n");
236 : static constexpr std::string_view Format_10810(" Layer{:3} : {:1} - Vertical Venetian Blind\n");
237 : static constexpr std::string_view Format_1085(" nslice = {:3} - Number of slices\n");
238 : static constexpr std::string_view Format_1090(" thick = {:10.6F} - Thickness [m]\n");
239 : static constexpr std::string_view Format_1091(" scon = {:10.6F} - Thermal conductivity [W/m-K]\n");
240 : static constexpr std::string_view Format_1092(" asol = {:12.8F} - Absorbed solar energy [W/m^2]\n");
241 : static constexpr std::string_view Format_1093(" tir = {:12.8F} - IR transmittance\n");
242 : static constexpr std::string_view Format_1094(" emis1 = {:10.6F} - IR outdoor emissivity\n");
243 : static constexpr std::string_view Format_1095(" emis2 = {:10.6F} - IR indoor emissivity\n");
244 : static constexpr std::string_view Format_1100(" Atop = {:10.6F} - Top opening area [m^2]\n");
245 : static constexpr std::string_view Format_1101(" Abot = {:10.6F} - Bottom opening area [m^2]\n");
246 : static constexpr std::string_view Format_1102(" Al = {:10.6F} - Left opening area [m^2]\n");
247 : static constexpr std::string_view Format_1103(" Ar = {:10.6F} - Right opening area [m^2]\n");
248 : static constexpr std::string_view Format_1105(" Ah = {:10.6F} - Total area of holes [m^2]\n");
249 : static constexpr std::string_view Format_11051(" SlatThick = {:10.6F} - Slat thickness [m]\n");
250 : static constexpr std::string_view Format_11052(" SlatWidth = {:10.6F} - Slat width [m]\n");
251 : static constexpr std::string_view Format_11053(" SlatAngle = {:10.6F} - Slat tilt angle [deg]\n");
252 : static constexpr std::string_view Format_11054(" SlatCond = {:10.6F} - Conductivity of the slat material [W/m.K]\n");
253 : static constexpr std::string_view Format_11055(" SlatSpacing = {:10.6F} - Distance between slats [m]\n");
254 : static constexpr std::string_view Format_11056(" SlatCurve = {:10.6F} - Curvature radius of the slat [m]\n");
255 : static constexpr std::string_view Format_1110("IGU Gaps:\n");
256 : static constexpr std::string_view Format_1111(" Gap {:2}:\n");
257 : static constexpr std::string_view Format_11110(" Outdoor space:\n");
258 : static constexpr std::string_view Format_11111(" Indoor space:\n");
259 : static constexpr std::string_view Format_1112(" gap = {:12.5F} - Gap width [m]\n");
260 : static constexpr std::string_view Format_1113(" presure = {:12.5F} - Gas pressure [N/m^2]\n");
261 : static constexpr std::string_view Format_1114(" nmix = {:6} - Num. of gasses in a gas mix\n");
262 : static constexpr std::string_view Format_1115(" Gas {:1}: {} {:6.2F} %\n");
263 : static constexpr std::string_view Format_1120(" vvent = {:12.5F} - Forced ventilation speed [m/s]\n");
264 : static constexpr std::string_view Format_1121(" tvent = {:12.5F} - Temperature in connected gap [K]\n");
265 : static constexpr std::string_view Format_1130(" Gas mix coefficients - gas {:1}, {:6.2F} %\n");
266 : static constexpr std::string_view Format_1131(" gcon = {:11.6F}, {:11.6F}, {:11.6F} - Conductivity\n");
267 : static constexpr std::string_view Format_1132(" gvis = {:11.6F}, {:11.6F}, {:11.6F} - Dynamic viscosity\n");
268 : static constexpr std::string_view Format_1133(" gcp = {:11.6F}, {:11.6F}, {:11.6F} - Spec.heat @ const.P\n");
269 : static constexpr std::string_view Format_1134(" wght = {:11.6F} - Molecular weight\n");
270 : static constexpr std::string_view Format_1198("===== ===== ===== ===== ===== ===== ===== ===== ===== ===== =====\n");
271 :
272 : // bi...Create debug file w/ Tarcog's input arguments:
273 :
274 : // File is not open and nothing cannot be written
275 0 : if (!InArgumentsFile.good()) {
276 0 : return;
277 : }
278 :
279 0 : date_and_time(real_CLOCK(1), real_CLOCK(2), real_CLOCK(3), DATE_TIME);
280 :
281 0 : print(InArgumentsFile, "\n");
282 0 : print(InArgumentsFile, Format_1001, DATE_TIME(1), DATE_TIME(2), DATE_TIME(3), DATE_TIME(5), DATE_TIME(6), DATE_TIME(7));
283 0 : print(InArgumentsFile, "\n");
284 :
285 0 : if (state.dataTARCOGOutputs->winID == -1) {
286 0 : print(InArgumentsFile, Format_1002, state.dataTARCOGOutputs->winID);
287 : } else {
288 0 : print(InArgumentsFile, Format_1003, state.dataTARCOGOutputs->winID);
289 : }
290 :
291 0 : if (state.dataTARCOGOutputs->iguID == -1) {
292 0 : print(InArgumentsFile, Format_1006, state.dataTARCOGOutputs->iguID);
293 : } else {
294 0 : print(InArgumentsFile, Format_1007, state.dataTARCOGOutputs->iguID);
295 : }
296 :
297 0 : print(InArgumentsFile, " Debug dir: {}\n", DBGD);
298 :
299 0 : print(InArgumentsFile, "\n");
300 0 : print(InArgumentsFile, Format_1000);
301 0 : print(InArgumentsFile, "\n");
302 0 : print(InArgumentsFile, Format_1005);
303 0 : print(InArgumentsFile, Format_1010, tout, tout - Constant::Kelvin);
304 0 : print(InArgumentsFile, Format_1015, tind, tind - Constant::Kelvin);
305 0 : print(InArgumentsFile, Format_1020, trmin, trmin - Constant::Kelvin);
306 0 : print(InArgumentsFile, Format_1030, wso);
307 0 : if (iwd == 0) {
308 0 : print(InArgumentsFile, Format_1032); // windward
309 : }
310 0 : if (iwd == 1) {
311 0 : print(InArgumentsFile, Format_1033); // leeward
312 : }
313 0 : print(InArgumentsFile, Format_1035, wsi);
314 0 : print(InArgumentsFile, Format_1040, dir);
315 0 : print(InArgumentsFile, Format_1041, outir);
316 0 : print(InArgumentsFile, Format_1045, isky);
317 0 : print(InArgumentsFile, Format_1050, tsky, tsky - Constant::Kelvin);
318 0 : print(InArgumentsFile, Format_1055, esky);
319 0 : print(InArgumentsFile, Format_1060, fclr);
320 0 : print(InArgumentsFile, Format_1061, VacuumPressure);
321 0 : print(InArgumentsFile, Format_1062, VacuumMaxGapThickness);
322 0 : print(InArgumentsFile, Format_1063, ibc(1));
323 0 : print(InArgumentsFile, Format_1065, hout);
324 0 : print(InArgumentsFile, Format_1066, ibc(2));
325 0 : print(InArgumentsFile, Format_1068, hin);
326 :
327 0 : if (standard == TARCOGGassesParams::Stdrd::ISO15099) {
328 0 : print(InArgumentsFile, Format_1070, standard);
329 : }
330 0 : if (standard == TARCOGGassesParams::Stdrd::EN673) {
331 0 : print(InArgumentsFile, Format_1071, standard);
332 : }
333 0 : if (standard == TARCOGGassesParams::Stdrd::EN673Design) {
334 0 : print(InArgumentsFile, Format_1072, standard);
335 : }
336 :
337 0 : if (ThermalMod == TARCOGThermalModel::ISO15099) {
338 0 : print(InArgumentsFile, Format_10731, ThermalMod);
339 0 : print(InArgumentsFile, Format_10740, SDScalar);
340 : }
341 :
342 0 : if (ThermalMod == TARCOGThermalModel::SCW) {
343 0 : print(InArgumentsFile, Format_10732, ThermalMod);
344 0 : print(InArgumentsFile, Format_10740, SDScalar);
345 : }
346 :
347 0 : if (ThermalMod == TARCOGThermalModel::CSM) {
348 0 : print(InArgumentsFile, Format_10733, ThermalMod);
349 0 : print(InArgumentsFile, Format_10740, SDScalar);
350 : }
351 :
352 0 : print(InArgumentsFile, "\n");
353 :
354 0 : print(InArgumentsFile, Format_1075);
355 0 : print(InArgumentsFile, Format_1076, height);
356 0 : print(InArgumentsFile, Format_1077, heightt);
357 0 : print(InArgumentsFile, Format_1078, width);
358 0 : print(InArgumentsFile, Format_1079, tilt);
359 0 : print(InArgumentsFile, Format_1080, totsol);
360 0 : print(InArgumentsFile, Format_1081, nlayer);
361 0 : print(InArgumentsFile, "\n");
362 :
363 0 : print(InArgumentsFile, Format_1089);
364 0 : for (i = 1; i <= nlayer; ++i) {
365 0 : switch (LayerType(i)) {
366 0 : case TARCOGLayerType::DIFFSHADE: { // Diffuse Shade
367 0 : print(InArgumentsFile, Format_10806, i, LayerType(i));
368 0 : } break;
369 0 : case TARCOGLayerType::WOVSHADE: { // Woven Shade
370 0 : print(InArgumentsFile, Format_10805, i, LayerType(i));
371 0 : } break;
372 0 : case TARCOGLayerType::VENETBLIND_HORIZ: { // Horizontal venetian blind
373 0 : print(InArgumentsFile, Format_10804, i, LayerType(i));
374 0 : } break;
375 0 : case TARCOGLayerType::VENETBLIND_VERT: { // Vertical venetian blind
376 0 : print(InArgumentsFile, Format_10810, i, LayerType(i));
377 0 : } break;
378 0 : case TARCOGLayerType::SPECULAR: { // Specular layer
379 0 : if (nslice(i) <= 1) {
380 0 : print(InArgumentsFile, Format_10802, i, LayerType(i)); // Monolithic glass
381 : } else {
382 0 : print(InArgumentsFile, Format_10803, i, LayerType(i)); // Laminated layer
383 : }
384 0 : } break;
385 0 : default: {
386 0 : print(InArgumentsFile, Format_10809, i, LayerType(i));
387 0 : } break;
388 : }
389 :
390 0 : print(InArgumentsFile, Format_1090, thick(i));
391 0 : print(InArgumentsFile, Format_1091, scon(i));
392 0 : print(InArgumentsFile, Format_1092, asol(i));
393 0 : print(InArgumentsFile, Format_1093, tir(2 * i - 1));
394 0 : print(InArgumentsFile, Format_1094, emis(2 * i - 1));
395 0 : print(InArgumentsFile, Format_1095, emis(2 * i));
396 :
397 0 : if (LayerType(i) == TARCOGLayerType::VENETBLIND_HORIZ || LayerType(i) == TARCOGLayerType::VENETBLIND_VERT) { // SD layer
398 0 : print(InArgumentsFile, Format_1100, Atop(i));
399 0 : print(InArgumentsFile, Format_1101, Abot(i));
400 0 : print(InArgumentsFile, Format_1102, Al(i));
401 0 : print(InArgumentsFile, Format_1103, Ar(i));
402 0 : print(InArgumentsFile, Format_1105, Ah(i));
403 :
404 0 : print(InArgumentsFile, Format_11051, SlatThick(i));
405 0 : print(InArgumentsFile, Format_11052, SlatWidth(i));
406 0 : print(InArgumentsFile, Format_11053, SlatAngle(i));
407 0 : print(InArgumentsFile, Format_11054, SlatCond(i));
408 0 : print(InArgumentsFile, Format_11055, SlatSpacing(i));
409 0 : print(InArgumentsFile, Format_11056, SlatCurve(i));
410 : }
411 :
412 0 : if (nslice(i) > 1) { // SD layer
413 0 : print(InArgumentsFile, Format_1085, nslice(i));
414 0 : print(InArgumentsFile, Format_1085, LaminateA(i));
415 0 : print(InArgumentsFile, Format_1085, LaminateB(i));
416 0 : print(InArgumentsFile, Format_1085, sumsol(i));
417 : }
418 : } // i - layers
419 :
420 0 : print(InArgumentsFile, "\n");
421 :
422 0 : print(InArgumentsFile, Format_1110);
423 :
424 0 : for (i = 1; i <= nlayer + 1; ++i) { // loop through gaps:
425 0 : if ((i > 1) && (i <= nlayer)) {
426 0 : print(InArgumentsFile, Format_1111, i - 1);
427 : }
428 0 : if (i == 1) {
429 0 : print(InArgumentsFile, Format_11110);
430 : }
431 0 : if (i == nlayer + 1) {
432 0 : print(InArgumentsFile, Format_11111);
433 : }
434 0 : if ((i > 1) && (i <= nlayer)) {
435 0 : print(InArgumentsFile, Format_1112, gap(i - 1));
436 : }
437 0 : print(InArgumentsFile, Format_1113, presure(i));
438 0 : if ((i > 1) && (i <= nlayer)) {
439 0 : print(InArgumentsFile, Format_1120, vvent(i));
440 : }
441 0 : if ((i > 1) && (i <= nlayer)) {
442 0 : print(InArgumentsFile, Format_1121, tvent(i));
443 : }
444 0 : print(InArgumentsFile, Format_1114, nmix(i));
445 :
446 0 : for (j = 1; j <= nmix(i); ++j) {
447 : // if (iprop(i, j).eq.1) write(InArgumentsFile, 1115) iprop(i, j), ' ' 100*frct(i, j) ! Air
448 0 : print(InArgumentsFile, Format_1115, iprop(j, i), ' ', 100 * frct(j, i)); // gas
449 : // if (iprop(i, j).eq.2) write(InArgumentsFile, 1116) iprop(i, j), 100*frct(i, j) ! Argon
450 : // if (iprop(i, j).eq.3) write(InArgumentsFile, 1117) iprop(i, j), 100*frct(i, j) ! Krypton
451 : // if (iprop(i, j).eq.4) write(InArgumentsFile, 1118) iprop(i, j), 100*frct(i, j) ! Xenon
452 0 : print(InArgumentsFile, Format_1130, iprop(j, i), 100 * frct(j, i));
453 0 : print(InArgumentsFile, Format_1131, xgcon(1, iprop(j, i)), xgcon(2, iprop(j, i)), xgcon(3, iprop(j, i)));
454 0 : print(InArgumentsFile, Format_1132, xgvis(1, iprop(j, i)), xgvis(2, iprop(j, i)), xgvis(3, iprop(j, i)));
455 0 : print(InArgumentsFile, Format_1133, xgcp(1, iprop(j, i)), xgcp(2, iprop(j, i)), xgcp(3, iprop(j, i)));
456 0 : print(InArgumentsFile, Format_1134, xwght(iprop(j, i)));
457 : } // - j - one mix
458 : } // i - gas loop
459 :
460 0 : print(InArgumentsFile, "\n");
461 0 : print(InArgumentsFile, Format_1198);
462 0 : }
463 :
464 0 : void WriteModifiedArguments(InputOutputFile &InArgumentsFile,
465 : [[maybe_unused]] fs::path const &DBGD,
466 : Real64 const esky,
467 : Real64 const trmout,
468 : Real64 const trmin,
469 : Real64 const ebsky,
470 : Real64 const ebroom,
471 : Real64 const Gout,
472 : Real64 const Gin,
473 : int const nlayer,
474 : const Array1D<TARCOGParams::TARCOGLayerType> &LayerType,
475 : const Array1D_int &nmix,
476 : Array2A<Real64> const frct,
477 : const Array1D<Real64> &thick,
478 : const Array1D<Real64> &scon,
479 : const Array1D<Real64> &gap,
480 : Array2A<Real64> const xgcon,
481 : Array2A<Real64> const xgvis,
482 : Array2A<Real64> const xgcp,
483 : const Array1D<Real64> &xwght)
484 : {
485 :
486 : // Using/Aliasing
487 : // Argument array dimensioning
488 0 : EP_SIZE_CHECK(LayerType, maxlay);
489 0 : EP_SIZE_CHECK(nmix, maxlay1);
490 0 : frct.dim(maxgas, maxlay1);
491 0 : EP_SIZE_CHECK(thick, maxlay);
492 0 : EP_SIZE_CHECK(scon, maxlay);
493 0 : EP_SIZE_CHECK(gap, MaxGap);
494 0 : xgcon.dim(3, maxgas);
495 0 : xgvis.dim(3, maxgas);
496 0 : xgcp.dim(3, maxgas);
497 0 : EP_SIZE_CHECK(xwght, maxgas);
498 :
499 : // Locals
500 : int i;
501 : int j;
502 :
503 : // Formats
504 : static constexpr std::string_view Format_1014("Adjusted input arguments:\n");
505 : static constexpr std::string_view Format_1013(" Gass coefficients:\n");
506 : static constexpr std::string_view Format_1016(" Trmout = {:10.6F} K ( {:7.3F} deg C) - Outdoor mean radiant temp.\n");
507 : static constexpr std::string_view Format_1017(" Gout = {:10.6F} \n");
508 : static constexpr std::string_view Format_1018(" Gin = {:10.6F} \n");
509 : static constexpr std::string_view Format_1019(" Ebsky = {:10.6F} \n");
510 : static constexpr std::string_view Format_10191(" Ebroom = {:10.6F} \n");
511 : static constexpr std::string_view Format_1020(" Trmin = {:10.6F} K ( {:7.3F} deg C) - Indoor mean radiant temp.\n");
512 : static constexpr std::string_view Format_1055(" esky = {:7.3F} - Effective night sky emmitance\n");
513 : static constexpr std::string_view Format_1084(" Layer{:3} : {:1} - Venetian Blind\n");
514 : static constexpr std::string_view Format_1090(" thick = {:10.6F} - Thickness [m]\n");
515 : static constexpr std::string_view Format_1091(" scon = {:10.6F} - Thermal conductivity [W/m-K]\n");
516 : static constexpr std::string_view Format_1130(" Gas mix coefficients - gas {:1}, {:6.2F} %\n");
517 : static constexpr std::string_view Format_1131(" gcon = {:11.6F}, {:11.6F}, {:11.6F} - Conductivity\n");
518 : static constexpr std::string_view Format_1132(" gvis = {:11.6F}, {:11.6F}, {:11.6F} - Dynamic viscosity\n");
519 : static constexpr std::string_view Format_1133(" gcp = {:11.6F}, {:11.6F}, {:11.6F} - Spec.heat @ const.P\n");
520 : static constexpr std::string_view Format_1134(" wght = {:11.6F} - Molecular weight\n");
521 : static constexpr std::string_view Format_1111(" Gap {:2}:\n");
522 : static constexpr std::string_view Format_1112(" Gap width: {:11.8F}\n");
523 : static constexpr std::string_view Format_11110(" Outdoor space:\n");
524 : static constexpr std::string_view Format_11111(" Indoor space:\n");
525 : static constexpr std::string_view Format_1198("===== ===== ===== ===== ===== ===== ===== ===== ===== ===== =====\n");
526 :
527 0 : print(InArgumentsFile, "\n");
528 0 : print(InArgumentsFile, Format_1014);
529 0 : print(InArgumentsFile, "\n");
530 0 : print(InArgumentsFile, Format_1055, esky);
531 0 : print(InArgumentsFile, Format_1016, trmout, trmout - Constant::Kelvin);
532 0 : print(InArgumentsFile, Format_1020, trmin, trmin - Constant::Kelvin);
533 0 : print(InArgumentsFile, Format_1019, ebsky);
534 0 : print(InArgumentsFile, Format_10191, ebroom);
535 0 : print(InArgumentsFile, Format_1017, Gout);
536 0 : print(InArgumentsFile, Format_1018, Gin);
537 0 : print(InArgumentsFile, "\n");
538 :
539 0 : for (i = 1; i <= nlayer; ++i) {
540 0 : if ((TARCOGLayerType)LayerType(i) == TARCOGLayerType::VENETBLIND_HORIZ ||
541 0 : (TARCOGLayerType)LayerType(i) == TARCOGLayerType::VENETBLIND_VERT) { // SD layer
542 0 : print(InArgumentsFile, Format_1084, i, LayerType(i));
543 0 : print(InArgumentsFile, Format_1090, thick(i));
544 0 : print(InArgumentsFile, Format_1091, scon(i));
545 : }
546 : }
547 0 : print(InArgumentsFile, "\n");
548 :
549 0 : print(InArgumentsFile, Format_1013);
550 0 : for (i = 1; i <= nlayer + 1; ++i) { // loop through gaps:
551 0 : if ((i > 1) && (i <= nlayer)) {
552 0 : print(InArgumentsFile, Format_1111, i - 1);
553 : }
554 0 : if ((i > 1) && (i <= nlayer)) {
555 0 : print(InArgumentsFile, Format_1112, gap(i - 1));
556 : }
557 0 : if (i == 1) {
558 0 : print(InArgumentsFile, Format_11110);
559 : }
560 0 : if (i == nlayer + 1) {
561 0 : print(InArgumentsFile, Format_11111);
562 : }
563 0 : for (j = 1; j <= nmix(i); ++j) {
564 0 : print(InArgumentsFile, Format_1130, j, 100 * frct(j, i));
565 0 : print(InArgumentsFile, Format_1131, xgcon(1, j), xgcon(2, j), xgcon(3, j));
566 0 : print(InArgumentsFile, Format_1132, xgvis(1, j), xgvis(2, j), xgvis(3, j));
567 0 : print(InArgumentsFile, Format_1133, xgcp(1, j), xgcp(2, j), xgcp(3, j));
568 0 : print(InArgumentsFile, Format_1134, xwght(j));
569 : } // j - gas mix
570 : } // i - gaps
571 0 : print(InArgumentsFile, "\n");
572 0 : print(InArgumentsFile, Format_1198);
573 0 : }
574 :
575 0 : void WriteOutputArguments(InputOutputFile &OutArgumentsFile,
576 : [[maybe_unused]] fs::path const &DBGD,
577 : int const nlayer,
578 : Real64 const tamb,
579 : const Array1D<Real64> &q,
580 : const Array1D<Real64> &qv,
581 : const Array1D<Real64> &qcgas,
582 : const Array1D<Real64> &qrgas,
583 : const Array1D<Real64> &theta,
584 : const Array1D<Real64> &vfreevent,
585 : const Array1D<Real64> &vvent,
586 : const Array1D<Real64> &Keff,
587 : const Array1D<Real64> &ShadeGapKeffConv,
588 : Real64 const troom,
589 : Real64 const ufactor,
590 : Real64 const shgc,
591 : Real64 const sc,
592 : Real64 const hflux,
593 : Real64 const shgct,
594 : Real64 const hcin,
595 : Real64 const hrin,
596 : Real64 const hcout,
597 : Real64 const hrout,
598 : const Array1D<Real64> &Ra,
599 : const Array1D<Real64> &Nu,
600 : const Array1D<TARCOGParams::TARCOGLayerType> &LayerType,
601 : const Array1D<Real64> &Ebf,
602 : const Array1D<Real64> &Ebb,
603 : const Array1D<Real64> &Rf,
604 : const Array1D<Real64> &Rb,
605 : Real64 const ebsky,
606 : Real64 const Gout,
607 : Real64 const ebroom,
608 : Real64 const Gin,
609 : Real64 const ShadeEmisRatioIn,
610 : Real64 const ShadeEmisRatioOut,
611 : Real64 const ShadeHcRatioIn,
612 : Real64 const ShadeHcRatioOut,
613 : Real64 const HcUnshadedIn,
614 : Real64 const HcUnshadedOut,
615 : const Array1D<Real64> &hcgas,
616 : const Array1D<Real64> &hrgas,
617 : Real64 const AchievedErrorTolerance,
618 : int const NumOfIter)
619 : {
620 :
621 : // Using/Aliasing
622 : // Argument array dimensioning
623 0 : EP_SIZE_CHECK(q, maxlay3);
624 0 : EP_SIZE_CHECK(qv, maxlay1);
625 0 : EP_SIZE_CHECK(qcgas, maxlay1);
626 0 : EP_SIZE_CHECK(qrgas, maxlay1);
627 0 : EP_SIZE_CHECK(theta, maxlay2);
628 0 : EP_SIZE_CHECK(vfreevent, maxlay1);
629 0 : EP_SIZE_CHECK(vvent, maxlay1);
630 0 : EP_SIZE_CHECK(Keff, maxlay);
631 0 : EP_SIZE_CHECK(ShadeGapKeffConv, MaxGap);
632 0 : EP_SIZE_CHECK(Ra, maxlay);
633 0 : EP_SIZE_CHECK(Nu, maxlay);
634 0 : EP_SIZE_CHECK(LayerType, maxlay);
635 0 : EP_SIZE_CHECK(Ebf, maxlay);
636 0 : EP_SIZE_CHECK(Ebb, maxlay);
637 0 : EP_SIZE_CHECK(Rf, maxlay);
638 0 : EP_SIZE_CHECK(Rb, maxlay);
639 0 : EP_SIZE_CHECK(hcgas, maxlay);
640 0 : EP_SIZE_CHECK(hrgas, maxlay);
641 :
642 : // Locals
643 0 : Array1D_int DATE_TIME(8);
644 0 : Array1D_string real_CLOCK(3);
645 :
646 : int i;
647 :
648 : // Formats
649 : static constexpr std::string_view Format_2000("TARCOG calculation results - {:4}-{:02}-{:02}, {:02}:{:02}:{:02}\n");
650 : static constexpr std::string_view Format_2120(" Ufactor = {:12.6F}\n");
651 : static constexpr std::string_view Format_2130(" SHGC = {:12.6F}\n");
652 : static constexpr std::string_view Format_2131(" SHGC_OLD = {:12.6F}\n");
653 : static constexpr std::string_view Format_2132(" SC = {:12.6F}\n");
654 : static constexpr std::string_view Format_2140(" hcin = {:10.6F} hrin = {:10.6F} hin = {:10.6F}\n");
655 : static constexpr std::string_view Format_2150(" hcout = {:10.6F} hrout = {:10.6F} hout = {:10.6F}\n");
656 : static constexpr std::string_view Format_2155(" Ra({:1}) ={:15.6F} Nu({:1}) ={:12.6F}\n");
657 : static constexpr std::string_view Format_2160(" hcgas({:1}) ={:15.6F} hrgas({:1}) ={:24.6F}\n");
658 : static constexpr std::string_view Format_2170(" hflux = {:12.6F}\n");
659 : static constexpr std::string_view Format_2105(" Tamb ={:11.6F} K ( {:7.3F} deg C)\n");
660 : static constexpr std::string_view Format_2110(" ----------------- ------------------ Theta{:2} ={:11.6F} K ( {:7.3F} deg C)\n");
661 : static constexpr std::string_view Format_2111(
662 : " \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ "
663 : "\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ Theta{:2} ={:11.6F} K ( {:7.3F} "
664 : "deg C)\n");
665 : static constexpr std::string_view Format_2112(" +++++++++++++++++ ++++++++++++++++++ Theta{:2} ={:11.6F} K ( {:7.3F} deg C)\n");
666 : static constexpr std::string_view Format_2115(" Troom ={:11.6F} K ( {:7.3F} deg C)\n");
667 : static constexpr std::string_view Format_2180(" qout ={:12.5F}\n");
668 : static constexpr std::string_view Format_2190(" | qpane{:2} ={:12.5F} |\n");
669 : static constexpr std::string_view Format_2195(" | qpane{:2} ={:12.5F} | keffc{:2} ={:11.6F}\n");
670 : static constexpr std::string_view Format_2199(" | qlayer{:2} ={:12.5F} |\n");
671 : static constexpr std::string_view Format_2210(" qin ={:11.6F}\n");
672 : static constexpr std::string_view Format_2300(" q{:2} ={:12.5F}\n");
673 : static constexpr std::string_view Format_2320(" qv{:2} ={:12.5F}\n");
674 : static constexpr std::string_view Format_2321(" airspd{:2} ={:12.5F} keff{:2} ={:12.5F}\n");
675 : static constexpr std::string_view Format_2322(" qc{:2} ={:12.5F} qr{:2} ={:12.5F}\n");
676 : static constexpr std::string_view Format_2330(" ShadeEmisRatioIn ={:11.6F} ShadeEmisRatioOut ={:11.6F}\n");
677 : static constexpr std::string_view Format_2331(" ShadeHcRatioIn ={:11.6F} ShadeHcRatioOut ={:11.6F}\n");
678 : static constexpr std::string_view Format_2332(" HcUnshadedIn ={:11.6F} HcUnshadedOut ={:11.6F}\n");
679 : static constexpr std::string_view Format_2350("Heat Flux Flow and Temperatures of Layer Surfaces:\n");
680 : static constexpr std::string_view Format_2351("Basic IGU properties:\n");
681 : static constexpr std::string_view Format_4205(" Ebsky ={:11.6F} [W/m2], Gout ={:11.6F} [W/m2]\n");
682 : static constexpr std::string_view Format_4215(" Ebroom ={:11.6F} [W/m2], Gin ={:11.6F} [W/m2]\n");
683 : static constexpr std::string_view Format_4110(" Ef{:2} ={:11.6F} [W/m2], Rf{:2} ={:11.6F} [W/m2]\n");
684 : static constexpr std::string_view Format_4111(" ----------------- ------------------\n");
685 : static constexpr std::string_view Format_4112(" Ef{:2} ={:11.6F} [W/m2], Rf{:2} ={:11.6F} [W/m2]\n");
686 : static constexpr std::string_view Format_4113(" \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ "
687 : "\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\n");
688 : static constexpr std::string_view Format_4114(" Ef{:2} ={:11.6F} [W/m2], Rf{:2} ={:11.6F} [W/m2]\n");
689 : static constexpr std::string_view Format_4115(" +++++++++++++++++ ++++++++++++++++++\n");
690 : static constexpr std::string_view Format_4116(" Ef{:2} ={:11.6F} [W/m2], Rf{:2} ={:11.6F} [W/m2]\n");
691 : static constexpr std::string_view Format_4117(" ooooooooooooooooo oooooooooooooooooo\n");
692 : static constexpr std::string_view Format_4120(" Eb{:2} ={:11.6F} [W/m2], Rb{:2} ={:11.6F} [W/m2]\n");
693 : static constexpr std::string_view Format_4121(" ----------------- ------------------\n");
694 : static constexpr std::string_view Format_4122(" Eb{:2} ={:11.6F} [W/m2], Rb{:2} ={:11.6F} [W/m2]\n");
695 : static constexpr std::string_view Format_4123(" \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ "
696 : "\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\n");
697 : static constexpr std::string_view Format_4124(" Eb{:2} ={:11.6F} [W/m2], Rb{:2} ={:11.6F} [W/m2]\n");
698 : static constexpr std::string_view Format_4125(" +++++++++++++++++ ++++++++++++++++++\n");
699 : static constexpr std::string_view Format_4126(" Eb{:2} ={:11.6F} [W/m2], Rb{:2} ={:11.6F} [W/m2]\n");
700 : static constexpr std::string_view Format_4127(" ooooooooooooooooo oooooooooooooooooo\n");
701 : static constexpr std::string_view Format_4190(" | |\n");
702 : static constexpr std::string_view Format_4350("Energy balances on Layer Surfaces:\n");
703 :
704 0 : date_and_time(real_CLOCK(1), real_CLOCK(2), real_CLOCK(3), DATE_TIME);
705 0 : print(OutArgumentsFile, "\n");
706 0 : print(OutArgumentsFile, Format_2000, DATE_TIME(1), DATE_TIME(2), DATE_TIME(3), DATE_TIME(5), DATE_TIME(6), DATE_TIME(7));
707 0 : print(OutArgumentsFile, "\n");
708 0 : print(OutArgumentsFile, Format_2350);
709 0 : print(OutArgumentsFile, "\n");
710 0 : print(OutArgumentsFile, Format_2105, tamb, tamb - Constant::Kelvin);
711 0 : print(OutArgumentsFile, Format_2180, q(1));
712 :
713 : // bi Write out layer properties:
714 0 : for (i = 1; i <= nlayer; ++i) {
715 0 : switch (LayerType(i)) {
716 0 : case TARCOGLayerType::SPECULAR: { // Specular layer
717 0 : print(OutArgumentsFile, Format_2110, 2 * i - 1, theta(2 * i - 1), theta(2 * i - 1) - Constant::Kelvin);
718 0 : print(OutArgumentsFile, Format_2190, i, q(2 * i));
719 0 : print(OutArgumentsFile, Format_2110, 2 * i, theta(2 * i), theta(2 * i) - Constant::Kelvin);
720 0 : } break;
721 0 : case TARCOGLayerType::VENETBLIND_HORIZ:
722 : case TARCOGLayerType::VENETBLIND_VERT: { // Venetian blind
723 0 : print(OutArgumentsFile, Format_2111, 2 * i - 1, theta(2 * i - 1), theta(2 * i - 1) - Constant::Kelvin);
724 0 : print(OutArgumentsFile, Format_2195, i, q(2 * i), i, ShadeGapKeffConv(i));
725 0 : print(OutArgumentsFile, Format_2111, 2 * i, theta(2 * i), theta(2 * i) - Constant::Kelvin);
726 0 : } break;
727 0 : case TARCOGLayerType::WOVSHADE: { // Venetian blind
728 0 : print(OutArgumentsFile, Format_2112, 2 * i - 1, theta(2 * i - 1), theta(2 * i - 1) - Constant::Kelvin);
729 0 : print(OutArgumentsFile, Format_2195, i, q(2 * i), i, ShadeGapKeffConv(i));
730 0 : print(OutArgumentsFile, Format_2112, 2 * i, theta(2 * i), theta(2 * i) - Constant::Kelvin);
731 0 : } break;
732 0 : case TARCOGLayerType::DIFFSHADE: { // Venetian blind
733 0 : print(OutArgumentsFile, Format_2110, 2 * i - 1, theta(2 * i - 1), theta(2 * i - 1) - Constant::Kelvin);
734 0 : print(OutArgumentsFile, Format_2190, i, q(2 * i));
735 0 : print(OutArgumentsFile, Format_2110, 2 * i, theta(2 * i), theta(2 * i) - Constant::Kelvin);
736 0 : } break;
737 0 : default: {
738 0 : print(OutArgumentsFile, Format_2110, 2 * i - 1, theta(2 * i - 1), theta(2 * i - 1) - Constant::Kelvin);
739 0 : print(OutArgumentsFile, Format_2199, i, q(2 * i));
740 0 : print(OutArgumentsFile, Format_2110, 2 * i, theta(2 * i), theta(2 * i) - Constant::Kelvin);
741 0 : } break;
742 : }
743 :
744 : // bi Write out gap properties:
745 0 : if (i != nlayer) {
746 0 : print(OutArgumentsFile, Format_2300, i, q(2 * i + 1));
747 0 : print(OutArgumentsFile, Format_2320, i, qv(i + 1));
748 0 : if (vvent(i + 1) == 0) {
749 0 : print(OutArgumentsFile, Format_2321, i, vfreevent(i + 1), i, Keff(i));
750 : } else {
751 0 : if (i > 1) {
752 0 : print(OutArgumentsFile, Format_2321, i, vvent(i + 1), i, Keff(i - 1));
753 : // Autodesk:BoundsViolation Keff(i-1) @ i=1: Fixed in 8.2 by surrounding if block
754 : }
755 : }
756 0 : print(OutArgumentsFile, Format_2322, i, qcgas(i + 1), i, qrgas(i + 1));
757 : } else {
758 0 : print(OutArgumentsFile, Format_2210, q(2 * i + 1));
759 : }
760 : } // i - layers
761 :
762 0 : print(OutArgumentsFile, Format_2115, troom, troom - Constant::Kelvin);
763 :
764 0 : print(OutArgumentsFile, "\n");
765 :
766 : // Simon: Write energy balances on layer surfaces
767 0 : print(OutArgumentsFile, Format_4350);
768 0 : print(OutArgumentsFile, "\n");
769 0 : print(OutArgumentsFile, Format_4205, ebsky, Gout);
770 0 : print(OutArgumentsFile, "\n");
771 :
772 0 : for (i = 1; i <= nlayer; ++i) {
773 0 : switch (LayerType(i)) {
774 0 : case TARCOGLayerType::SPECULAR: { // Specular layer
775 0 : print(OutArgumentsFile, Format_4110, i, Ebf(i), i, Rf(i));
776 0 : print(OutArgumentsFile, Format_4111);
777 0 : print(OutArgumentsFile, Format_4190);
778 0 : print(OutArgumentsFile, Format_4121);
779 0 : print(OutArgumentsFile, Format_4120, i, Ebb(i), i, Rb(i));
780 0 : } break;
781 0 : case TARCOGLayerType::VENETBLIND_HORIZ:
782 : case TARCOGLayerType::VENETBLIND_VERT: { // Venetian blind
783 0 : print(OutArgumentsFile, Format_4112, i, Ebf(i), i, Rf(i));
784 0 : print(OutArgumentsFile, Format_4113);
785 0 : print(OutArgumentsFile, Format_4190);
786 0 : print(OutArgumentsFile, Format_4123);
787 0 : print(OutArgumentsFile, Format_4122, i, Ebb(i), i, Rb(i));
788 0 : } break;
789 0 : case TARCOGLayerType::WOVSHADE: { // Venetian blind
790 0 : print(OutArgumentsFile, Format_4114, i, Ebf(i), i, Rf(i));
791 0 : print(OutArgumentsFile, Format_4115);
792 0 : print(OutArgumentsFile, Format_4190);
793 0 : print(OutArgumentsFile, Format_4125);
794 0 : print(OutArgumentsFile, Format_4124, i, Ebb(i), i, Rb(i));
795 0 : } break;
796 0 : case TARCOGLayerType::DIFFSHADE: {
797 0 : print(OutArgumentsFile, Format_4116, i, Ebf(i), i, Rf(i));
798 0 : print(OutArgumentsFile, Format_4117);
799 0 : print(OutArgumentsFile, Format_4190);
800 0 : print(OutArgumentsFile, Format_4127);
801 0 : print(OutArgumentsFile, Format_4126, i, Ebb(i), i, Rb(i));
802 0 : } break;
803 0 : default: {
804 0 : print(OutArgumentsFile, Format_4110, i, Ebf(i), i, Rf(i));
805 0 : print(OutArgumentsFile, Format_4111);
806 0 : print(OutArgumentsFile, Format_4190);
807 0 : print(OutArgumentsFile, Format_4121);
808 0 : print(OutArgumentsFile, Format_4120, i, Ebb(i), i, Rb(i));
809 0 : } break;
810 : }
811 0 : print(OutArgumentsFile, "\n");
812 : }
813 :
814 0 : print(OutArgumentsFile, Format_4215, ebroom, Gin);
815 :
816 0 : print(OutArgumentsFile, "\n");
817 0 : print(OutArgumentsFile, Format_2351);
818 0 : print(OutArgumentsFile, "\n");
819 0 : print(OutArgumentsFile, Format_2120, ufactor);
820 0 : print(OutArgumentsFile, Format_2130, shgc);
821 0 : print(OutArgumentsFile, "\n");
822 0 : print(OutArgumentsFile, Format_2132, sc);
823 0 : print(OutArgumentsFile, Format_2170, hflux);
824 0 : print(OutArgumentsFile, "\n");
825 0 : print(OutArgumentsFile, Format_2131, shgct);
826 0 : print(OutArgumentsFile, "\n");
827 0 : print(OutArgumentsFile, Format_2140, hcin, hrin, hcin + hrin);
828 0 : print(OutArgumentsFile, Format_2150, hcout, hrout, hcout + hrout);
829 :
830 0 : print(OutArgumentsFile, "\n");
831 0 : for (i = 1; i <= nlayer - 1; ++i) {
832 0 : print(OutArgumentsFile, Format_2155, i, Ra(i), i, Nu(i));
833 : }
834 0 : print(OutArgumentsFile, "\n");
835 0 : print(OutArgumentsFile, Format_2330, ShadeEmisRatioIn, ShadeEmisRatioOut);
836 0 : print(OutArgumentsFile, Format_2331, ShadeHcRatioIn, ShadeHcRatioOut);
837 0 : print(OutArgumentsFile, Format_2332, HcUnshadedIn, HcUnshadedOut);
838 :
839 0 : print(OutArgumentsFile, "\n");
840 0 : for (i = 2; i <= nlayer; ++i) {
841 0 : print(OutArgumentsFile, Format_2160, i, hcgas(i), i, hrgas(i));
842 : }
843 :
844 0 : print(OutArgumentsFile, "\n");
845 0 : print(OutArgumentsFile, " Error Tolerance = {:12.6E}\n", AchievedErrorTolerance);
846 :
847 0 : print(OutArgumentsFile, "\n");
848 0 : print(OutArgumentsFile, " Number of Iterations = {}\n", NumOfIter);
849 0 : }
850 :
851 0 : void WriteOutputEN673(InputOutputFile &OutArgumentsFile,
852 : [[maybe_unused]] fs::path const &DBGD,
853 : int const nlayer,
854 : Real64 const ufactor,
855 : Real64 const hout,
856 : Real64 const hin,
857 : const Array1D<Real64> &Ra,
858 : const Array1D<Real64> &Nu,
859 : const Array1D<Real64> &hg,
860 : const Array1D<Real64> &hr,
861 : const Array1D<Real64> &hs,
862 : [[maybe_unused]] int &nperr)
863 : {
864 :
865 : // Argument array dimensioning
866 0 : EP_SIZE_CHECK(Ra, maxlay);
867 0 : EP_SIZE_CHECK(Nu, maxlay);
868 0 : EP_SIZE_CHECK(hg, maxlay);
869 0 : EP_SIZE_CHECK(hr, maxlay);
870 0 : EP_SIZE_CHECK(hs, maxlay);
871 :
872 0 : Array1D_int DATE_TIME(8);
873 0 : Array1D_string real_CLOCK(3);
874 :
875 : int i;
876 :
877 : // Formats
878 : static constexpr std::string_view Format_2000("TARCOG calculation results - {:4}-{:02}-{:02}, {:02}:{:02}:{:02}\n");
879 : static constexpr std::string_view Format_2351("Basic IGU properties:\n");
880 : static constexpr std::string_view Format_2120(" Ufactor = {:12.6F}\n");
881 : static constexpr std::string_view Format_2220(" he = {:8.4F}, hi = {:8.4F}\n");
882 : static constexpr std::string_view Format_2155(" Ra({:1}) ={:15.6F} Nu({:1}) ={:12.6F}\n");
883 : static constexpr std::string_view Format_2230(" hg{:2} ={:15.6E} hr{:2} ={:15.6E} hs{:2} ={:15.6E}\n");
884 :
885 0 : date_and_time(real_CLOCK(1), real_CLOCK(2), real_CLOCK(3), DATE_TIME);
886 0 : print(OutArgumentsFile, "\n");
887 0 : print(OutArgumentsFile, Format_2000, DATE_TIME(1), DATE_TIME(2), DATE_TIME(3), DATE_TIME(5), DATE_TIME(6), DATE_TIME(7));
888 0 : print(OutArgumentsFile, "\n");
889 :
890 0 : print(OutArgumentsFile, "\n");
891 0 : print(OutArgumentsFile, Format_2351);
892 0 : print(OutArgumentsFile, "\n");
893 0 : print(OutArgumentsFile, Format_2120, ufactor);
894 0 : print(OutArgumentsFile, "\n");
895 0 : print(OutArgumentsFile, Format_2220, hout, hin);
896 0 : print(OutArgumentsFile, "\n");
897 0 : for (i = 1; i <= nlayer - 1; ++i) {
898 0 : print(OutArgumentsFile, Format_2155, i, Ra(i), i, Nu(i));
899 : }
900 0 : print(OutArgumentsFile, "\n");
901 0 : for (i = 1; i <= nlayer - 1; ++i) {
902 0 : print(OutArgumentsFile, Format_2230, i, hg(i), i, hr(i), i, hs(i));
903 : }
904 0 : }
905 :
906 0 : void WriteTARCOGInputFile(EnergyPlusData &state,
907 : Files &files,
908 : std::string const &VerNum,
909 : Real64 const tout,
910 : Real64 const tind,
911 : Real64 const trmin,
912 : Real64 const wso,
913 : int const iwd,
914 : Real64 const wsi,
915 : Real64 const dir,
916 : Real64 const outir,
917 : int const isky,
918 : Real64 const tsky,
919 : Real64 const esky,
920 : Real64 const fclr,
921 : Real64 const VacuumPressure,
922 : Real64 const VacuumMaxGapThickness,
923 : DeflectionCalculation const CalcDeflection,
924 : Real64 const Pa,
925 : Real64 const Pini,
926 : Real64 const Tini,
927 : const Array1D_int &ibc,
928 : Real64 const hout,
929 : Real64 const hin,
930 : TARCOGGassesParams::Stdrd const standard,
931 : TARCOGThermalModel const ThermalMod,
932 : Real64 const SDScalar,
933 : Real64 const height,
934 : Real64 const heightt,
935 : Real64 const width,
936 : Real64 const tilt,
937 : Real64 const totsol,
938 : int const nlayer,
939 : const Array1D<TARCOGParams::TARCOGLayerType> &LayerType,
940 : const Array1D<Real64> &thick,
941 : const Array1D<Real64> &scon,
942 : const Array1D<Real64> &YoungsMod,
943 : const Array1D<Real64> &PoissonsRat,
944 : const Array1D<Real64> &asol,
945 : const Array1D<Real64> &tir,
946 : const Array1D<Real64> &emis,
947 : const Array1D<Real64> &Atop,
948 : const Array1D<Real64> &Abot,
949 : const Array1D<Real64> &Al,
950 : const Array1D<Real64> &Ar,
951 : const Array1D<Real64> &Ah,
952 : const Array1D_int &SupportPillar, // Shows whether or not gap have support pillar
953 : const Array1D<Real64> &PillarSpacing, // Pillar spacing for each gap (used in case there is support pillar)
954 : const Array1D<Real64> &PillarRadius, // Pillar radius for each gap (used in case there is support pillar)
955 : const Array1D<Real64> &SlatThick,
956 : const Array1D<Real64> &SlatWidth,
957 : const Array1D<Real64> &SlatAngle,
958 : const Array1D<Real64> &SlatCond,
959 : const Array1D<Real64> &SlatSpacing,
960 : const Array1D<Real64> &SlatCurve,
961 : const Array1D_int &nslice,
962 : const Array1D<Real64> &gap,
963 : const Array1D<Real64> &GapDef,
964 : const Array1D<Real64> &vvent,
965 : const Array1D<Real64> &tvent,
966 : const Array1D<Real64> &presure,
967 : const Array1D_int &nmix,
968 : Array2A_int const iprop,
969 : Array2A<Real64> const frct,
970 : Array2A<Real64> const xgcon,
971 : Array2A<Real64> const xgvis,
972 : Array2A<Real64> const xgcp,
973 : const Array1D<Real64> &xwght,
974 : const Array1D<Real64> &gama)
975 : {
976 :
977 : // Using/Aliasing
978 : using namespace TARCOGGassesParams;
979 :
980 : // Argument array dimensioning
981 0 : EP_SIZE_CHECK(ibc, 2);
982 0 : EP_SIZE_CHECK(LayerType, maxlay);
983 0 : EP_SIZE_CHECK(thick, maxlay);
984 0 : EP_SIZE_CHECK(scon, maxlay);
985 0 : EP_SIZE_CHECK(YoungsMod, maxlay);
986 0 : EP_SIZE_CHECK(PoissonsRat, maxlay);
987 0 : EP_SIZE_CHECK(asol, maxlay);
988 0 : EP_SIZE_CHECK(tir, maxlay2);
989 0 : EP_SIZE_CHECK(emis, maxlay2);
990 0 : EP_SIZE_CHECK(Atop, maxlay);
991 0 : EP_SIZE_CHECK(Abot, maxlay);
992 0 : EP_SIZE_CHECK(Al, maxlay);
993 0 : EP_SIZE_CHECK(Ar, maxlay);
994 0 : EP_SIZE_CHECK(Ah, maxlay);
995 0 : EP_SIZE_CHECK(SupportPillar, maxlay);
996 0 : EP_SIZE_CHECK(PillarSpacing, maxlay);
997 0 : EP_SIZE_CHECK(PillarRadius, maxlay);
998 0 : EP_SIZE_CHECK(SlatThick, maxlay);
999 0 : EP_SIZE_CHECK(SlatWidth, maxlay);
1000 0 : EP_SIZE_CHECK(SlatAngle, maxlay);
1001 0 : EP_SIZE_CHECK(SlatCond, maxlay);
1002 0 : EP_SIZE_CHECK(SlatSpacing, maxlay);
1003 0 : EP_SIZE_CHECK(SlatCurve, maxlay);
1004 0 : EP_SIZE_CHECK(nslice, maxlay);
1005 0 : EP_SIZE_CHECK(gap, maxlay);
1006 0 : EP_SIZE_CHECK(GapDef, MaxGap);
1007 0 : EP_SIZE_CHECK(vvent, maxlay1);
1008 0 : EP_SIZE_CHECK(tvent, maxlay1);
1009 0 : EP_SIZE_CHECK(presure, maxlay1);
1010 0 : EP_SIZE_CHECK(nmix, maxlay1);
1011 0 : iprop.dim(maxgas, maxlay1);
1012 0 : frct.dim(maxgas, maxlay1);
1013 0 : xgcon.dim(3, maxgas);
1014 0 : xgvis.dim(3, maxgas);
1015 0 : xgcp.dim(3, maxgas);
1016 0 : EP_SIZE_CHECK(xwght, maxgas);
1017 0 : EP_SIZE_CHECK(gama, maxgas);
1018 :
1019 : int i;
1020 : int j;
1021 : int NumOfProvGasses;
1022 :
1023 0 : Array1D_int DATE_TIME(8);
1024 0 : Array1D_string real_CLOCK(3);
1025 :
1026 : // Formats
1027 : static constexpr std::string_view Format_111("*\n");
1028 : static constexpr std::string_view Format_112("* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *\n");
1029 : static constexpr std::string_view Format_113("*------------------------------------------------------------\n");
1030 : static constexpr std::string_view Format_200("* General options:\n");
1031 : static constexpr std::string_view Format_210(
1032 : "* <nlayer, debug, standard, ThermalMod, CalcDeflection, SDScalar, VacuumPressure, VacuumMaxGapThickness>\n");
1033 : static constexpr std::string_view Format_300("* Environmental settings:\n");
1034 : static constexpr std::string_view Format_310("* <tout, tind, wso, iwd, wsi, dir, outir, isky, tsky, esky, fclr, trmin, Pa, Pini, Tini>\n");
1035 : static constexpr std::string_view Format_400("* Overall IGU properties:\n");
1036 : static constexpr std::string_view Format_410("* <totsol, tilt, height, heightt, width>\n");
1037 : static constexpr std::string_view Format_600("* Outdoor environment:\n");
1038 : static constexpr std::string_view Format_610("* <ibc(1), hout, presure(1), 1, 1, 1.0, vvent(1), tvent(1)>\n");
1039 : static constexpr std::string_view Format_700("* IGU definition:\n");
1040 : static constexpr std::string_view Format_800("* Indoor environment:\n");
1041 : static constexpr std::string_view Format_810("* <ibc(2), hin, presure(nlayer+1), 1, 1, 1.0, vvent(nlayer+1), tvent(nlayer+1)>\n");
1042 : static constexpr std::string_view Format_900("* End file\n");
1043 : static constexpr std::string_view Format_10001("* created by TARCOG v. {}\n");
1044 : static constexpr std::string_view Format_1001("* TARCOG debug output for WinCOG, {:4}-{:02}-{:02}, {:02}:{:02}:{:02}\n");
1045 : static constexpr std::string_view Format_1002("* WindowID: {:8} - Not specified\n");
1046 : static constexpr std::string_view Format_1003("* WindowID: {:8} \n");
1047 : static constexpr std::string_view Format_1006("* IGUID: {:8} - Not specified\n");
1048 : static constexpr std::string_view Format_1007("* IGUID: {:8} \n");
1049 : static constexpr std::string_view Format_1008("* Num Layers: {:8} \n");
1050 : static constexpr std::string_view Format_1010(" {:1}, {:1}, {:1}, {:1}, {:1}, {:24.12F}, {:24.12F}, {:24.12F}\n");
1051 : static constexpr std::string_view Format_1020(
1052 : " {:24.12F}, {:24.12F}, {:24.12F}, {:1}, {:24.12F}, {:24.12F}, {:24.12F}, {:1}, {:24.12F}, {:24.12F}, "
1053 : "{:24.12F}, {:24.12F}, {:24.12F}, {:24.12F}, {:24.12F}\n");
1054 : static constexpr std::string_view Format_1030(" {:24.12F}, {:24.12F}, {:24.12F}, {:24.12F}, {:24.12F}\n");
1055 : // static constexpr std::string_view Format_1031(" {:24.12F}, {:24.12F}, {:3}, {:24.12F}, {:3}, {:3}, {:24.12F}, {:24.12F}, {:24.12F},
1056 : // {:24.12F}, "
1057 : // "{:24.12F}, {:24.12F}, {:2}, {:2}, {:2}, {:2}\n");
1058 : static constexpr std::string_view Format_1034("* <PillarSpacing(i), PillarRadius(i)\n");
1059 : static constexpr std::string_view Format_1035(" {:24.12F}, {:24.12F}\n");
1060 : static constexpr std::string_view Format_1040(" {:1}, {:24.12F}, {:24.12F}, {:1}, {:1}, {:24.12F}, {:24.12F}, {:24.12F}\n");
1061 : static constexpr std::string_view Format_1048("* <gap(i), GapDef(i), presure(i+1), nmix(i+1), (iprop(i+1, j), j=1,nmix(i+1)), (frct(i+1, j), "
1062 : "\n\nj=1,nmix(i+1)), vvent(i), tvent(i), SupportPillar(i)>\n");
1063 : static constexpr std::string_view Format_1049("* Gap {:1}:\n");
1064 : static constexpr std::string_view Format_1050(
1065 : "* <scon(i), asol(i), thick(i), emis(2*i-1), emis(2*i), tir(2*i-1), YoungsMod(i),\n\n PoissonsRat(i), LayerType(i), nslice(i)>\n");
1066 : static constexpr std::string_view Format_1051(
1067 : " {:24.12F}, {:24.12F}, {:24.12F}, {:24.12F}, {:24.12F}, {:24.12F}, {:24.12F}, {:24.12F}, {:1}, {:1}\n");
1068 : static constexpr std::string_view Format_1052("* <Atop(i), Abot(i), Al(i), Ar(i), Ah(i)>\n");
1069 : static constexpr std::string_view Format_1053(" {:24.12F}, {:24.12F}, {:24.12F}, {:24.12F}, {:24.12F}\n");
1070 : static constexpr std::string_view Format_1054("* <SlatThick(i), SlatWidth(i), SlatAngle(i), SlatCond(i), SlatSpacing(i), SlatCurve(i)>\n");
1071 : static constexpr std::string_view Format_1055(" {:24.12F}, {:24.12F}, {:24.12F}, {:24.12F}, {:24.12F}, {:24.12F}\n");
1072 : static constexpr std::string_view Format_1060("* Layer {:1} - specular-glass:\n");
1073 : static constexpr std::string_view Format_1061("* Layer {:1} - venetian blind:\n");
1074 : static constexpr std::string_view Format_1062("* Layer {:1} - woven shade:\n");
1075 : static constexpr std::string_view Format_1063("* Layer {:1} - diffuse shade:\n");
1076 : static constexpr std::string_view Format_1064("* Layer {:1} - ???:\n");
1077 : static constexpr std::string_view Format_2000("* Gas coefficients information\n");
1078 : static constexpr std::string_view Format_2010(" {:2}\n");
1079 : static constexpr std::string_view Format_2011("* <NumberOfGasses>\n");
1080 : static constexpr std::string_view Format_2020(" {:12.6E}\n");
1081 : static constexpr std::string_view Format_2021("* <MolecularWeight>\n");
1082 : static constexpr std::string_view Format_2030(", {:12.6E}");
1083 : static constexpr std::string_view Format_2031("* <gconA, gconB, gconC>\n");
1084 : static constexpr std::string_view Format_2032("* <gvisA, gvisB, gvisC>\n");
1085 : static constexpr std::string_view Format_2033("* <gcpA, gcpB, gcpC>\n");
1086 : static constexpr std::string_view Format_2034("* <Gamma>\n");
1087 :
1088 0 : date_and_time(real_CLOCK(1), real_CLOCK(2), real_CLOCK(3), DATE_TIME);
1089 :
1090 0 : print(files.WINCogFile, Format_112);
1091 0 : print(files.WINCogFile, Format_111);
1092 0 : print(files.WINCogFile, Format_1001, DATE_TIME(1), DATE_TIME(2), DATE_TIME(3), DATE_TIME(5), DATE_TIME(6), DATE_TIME(7));
1093 0 : print(files.WINCogFile, Format_10001, VerNum); //, VerDat
1094 0 : print(files.WINCogFile, Format_111);
1095 :
1096 0 : if (state.dataTARCOGOutputs->winID == -1) {
1097 0 : print(files.WINCogFile, Format_1002, state.dataTARCOGOutputs->winID);
1098 : } else {
1099 0 : print(files.WINCogFile, Format_1003, state.dataTARCOGOutputs->winID);
1100 : }
1101 0 : if (state.dataTARCOGOutputs->iguID == -1) {
1102 0 : print(files.WINCogFile, Format_1006, state.dataTARCOGOutputs->iguID);
1103 : } else {
1104 0 : print(files.WINCogFile, Format_1007, state.dataTARCOGOutputs->iguID);
1105 : }
1106 :
1107 0 : print(files.WINCogFile, Format_1008, nlayer);
1108 0 : print(files.WINCogFile, Format_111);
1109 0 : print(files.WINCogFile, Format_112);
1110 :
1111 0 : print(files.WINCogFile, Format_113);
1112 0 : print(files.WINCogFile, Format_200);
1113 0 : print(files.WINCogFile, Format_113);
1114 0 : print(files.WINCogFile, Format_210);
1115 0 : print(files.WINCogFile, Format_1010, nlayer, 2, standard, ThermalMod, CalcDeflection, SDScalar, VacuumPressure, VacuumMaxGapThickness);
1116 :
1117 0 : print(files.WINCogFile, Format_113);
1118 0 : print(files.WINCogFile, Format_300);
1119 0 : print(files.WINCogFile, Format_113);
1120 0 : print(files.WINCogFile, Format_310);
1121 0 : print(files.WINCogFile, Format_1020, tout, tind, wso, iwd, wsi, dir, outir, isky, tsky, esky, fclr, trmin, Pa, Pini, Tini);
1122 :
1123 0 : NumOfProvGasses = 0;
1124 0 : while (xwght(NumOfProvGasses + 1) != 0) {
1125 0 : ++NumOfProvGasses;
1126 : }
1127 0 : print(files.WINCogFile, Format_113);
1128 0 : print(files.WINCogFile, Format_2000);
1129 0 : print(files.WINCogFile, Format_113);
1130 0 : print(files.WINCogFile, Format_2011);
1131 0 : print(files.WINCogFile, Format_2010, NumOfProvGasses);
1132 0 : for (i = 1; i <= NumOfProvGasses; ++i) {
1133 0 : print(files.WINCogFile, Format_2021);
1134 0 : print(files.WINCogFile, Format_2020, xwght(i));
1135 0 : print(files.WINCogFile, Format_2031);
1136 0 : for (j = 2; j <= 3; ++j) {
1137 0 : print(files.WINCogFile, Format_2030, xgcon(j, i));
1138 : }
1139 0 : print(files.WINCogFile, "\n");
1140 0 : print(files.WINCogFile, Format_2032);
1141 0 : for (j = 2; j <= 3; ++j) {
1142 0 : print(files.WINCogFile, Format_2030, xgvis(j, i));
1143 : }
1144 0 : print(files.WINCogFile, "\n");
1145 0 : print(files.WINCogFile, Format_2033);
1146 0 : for (j = 2; j <= 3; ++j) {
1147 0 : print(files.WINCogFile, Format_2030, xgcp(j, i));
1148 : }
1149 0 : print(files.WINCogFile, "\n");
1150 0 : print(files.WINCogFile, Format_2034);
1151 0 : print(files.WINCogFile, Format_2020, gama(i));
1152 : } // i = 1, NumProvGasses
1153 :
1154 0 : print(files.WINCogFile, Format_113);
1155 0 : print(files.WINCogFile, Format_400);
1156 0 : print(files.WINCogFile, Format_113);
1157 0 : print(files.WINCogFile, Format_410);
1158 0 : print(files.WINCogFile, Format_1030, totsol, tilt, height, heightt, width);
1159 :
1160 0 : print(files.WINCogFile, Format_113);
1161 0 : print(files.WINCogFile, Format_600);
1162 0 : print(files.WINCogFile, Format_113);
1163 0 : print(files.WINCogFile, Format_610);
1164 0 : print(files.WINCogFile, Format_1040, ibc(1), hout, presure(1), 1, 1, 1.0, vvent(1), tvent(1));
1165 :
1166 0 : print(files.WINCogFile, Format_700);
1167 :
1168 0 : for (i = 1; i <= nlayer; ++i) {
1169 0 : print(files.WINCogFile, Format_113);
1170 0 : if (LayerType(i) == TARCOGLayerType::SPECULAR) {
1171 0 : print(files.WINCogFile, Format_1060, i);
1172 0 : } else if (LayerType(i) == TARCOGLayerType::VENETBLIND_HORIZ || LayerType(i) == TARCOGLayerType::VENETBLIND_VERT) {
1173 0 : print(files.WINCogFile, Format_1061, i);
1174 0 : } else if (LayerType(i) == TARCOGLayerType::WOVSHADE) {
1175 0 : print(files.WINCogFile, Format_1062, i);
1176 0 : } else if (LayerType(i) == TARCOGLayerType::DIFFSHADE) {
1177 0 : print(files.WINCogFile, Format_1063, i);
1178 : } else {
1179 0 : print(files.WINCogFile, Format_1064, i);
1180 : }
1181 0 : print(files.WINCogFile, Format_113);
1182 :
1183 0 : print(files.WINCogFile, Format_1050);
1184 0 : print(files.WINCogFile,
1185 : Format_1051,
1186 : scon(i),
1187 : asol(i),
1188 : thick(i),
1189 0 : emis(2 * i - 1),
1190 : emis(2 * i),
1191 0 : tir(2 * i - 1),
1192 : YoungsMod(i),
1193 : PoissonsRat(i),
1194 : LayerType(i),
1195 : nslice(i));
1196 :
1197 0 : if (IsShadingLayer(LayerType(i))) {
1198 0 : print(files.WINCogFile, Format_1052);
1199 0 : print(files.WINCogFile, Format_1053, Atop(i), Abot(i), Al(i), Ar(i), Ah(i));
1200 : }
1201 :
1202 0 : if (LayerType(i) == TARCOGLayerType::VENETBLIND_HORIZ || LayerType(i) == TARCOGLayerType::VENETBLIND_VERT) {
1203 0 : print(files.WINCogFile, Format_1054);
1204 0 : print(files.WINCogFile, Format_1055, SlatThick(i), SlatWidth(i), SlatAngle(i), SlatCond(i), SlatSpacing(i), SlatCurve(i));
1205 : }
1206 :
1207 0 : if (i < nlayer) {
1208 0 : print(files.WINCogFile, Format_113);
1209 0 : print(files.WINCogFile, Format_1049, i);
1210 0 : print(files.WINCogFile, Format_113);
1211 0 : print(files.WINCogFile, Format_1048);
1212 0 : print(files.WINCogFile, " {:24.12F}, {:24.12F}, {:24.12F}, {:1}, ", gap(i), GapDef(i), presure(i + 1), nmix(i + 1));
1213 0 : for (j = 1; j <= nmix(i + 1); ++j) {
1214 0 : print(files.WINCogFile, "{:1}, ", iprop(j, i + 1));
1215 : }
1216 0 : for (j = 1; j <= nmix(i + 1); ++j) {
1217 0 : print(files.WINCogFile, "{:24.12F}, ", frct(j, i + 1));
1218 : }
1219 0 : print(files.WINCogFile, " {:24.12F}, {:24.12F}, {:1}, \n", vvent(i + 1), tvent(i + 1), SupportPillar(i));
1220 0 : if (SupportPillar(i) == YES_SupportPillar) {
1221 0 : print(files.WINCogFile, Format_1034);
1222 0 : print(files.WINCogFile, Format_1035, PillarSpacing(i), PillarRadius(i));
1223 : }
1224 : }
1225 : } // i - layers
1226 :
1227 0 : print(files.WINCogFile, Format_113);
1228 0 : print(files.WINCogFile, Format_800);
1229 0 : print(files.WINCogFile, Format_113);
1230 :
1231 0 : print(files.WINCogFile, Format_810);
1232 0 : print(files.WINCogFile, Format_1040, ibc(2), hin, presure(nlayer + 1), 1, 1, 1.0, vvent(nlayer + 1), tvent(nlayer + 1));
1233 :
1234 0 : print(files.WINCogFile, Format_113);
1235 0 : print(files.WINCogFile, Format_900);
1236 0 : print(files.WINCogFile, Format_113);
1237 0 : print(files.WINCogFile, "\n");
1238 0 : }
1239 :
1240 35972 : void FinishDebugOutputFiles(Files &files, int const nperr)
1241 : {
1242 :
1243 : static constexpr std::string_view Format_2360("TARCOG status: {:3} - Normal termination.\n");
1244 : static constexpr std::string_view Format_2361("TARCOG status: {:3} - Warning!\n");
1245 : static constexpr std::string_view Format_2362("TARCOG status: {:3} - Error!\n");
1246 : static constexpr std::string_view Format_1199("##### ##### ##### ##### ##### ##### ##### ##### ##### ##### #####\n");
1247 :
1248 35972 : if (files.WriteDebugOutput) {
1249 :
1250 0 : print(files.DebugOutputFile, "\n");
1251 0 : if ((nperr > 0) && (nperr < 1000)) {
1252 0 : print(files.DebugOutputFile, Format_2362, nperr);
1253 0 : } else if ((nperr >= 1000)) {
1254 0 : print(files.DebugOutputFile, Format_2361, nperr);
1255 : } else {
1256 0 : print(files.DebugOutputFile, Format_2360, nperr);
1257 : }
1258 :
1259 0 : print(files.DebugOutputFile, "\n");
1260 0 : print(files.DebugOutputFile, Format_1199);
1261 0 : print(files.DebugOutputFile, Format_1199);
1262 :
1263 : } // debug
1264 :
1265 : // Close debug files
1266 35972 : if (files.DebugOutputFile.good()) {
1267 0 : files.DebugOutputFile.close();
1268 : }
1269 :
1270 35972 : if (files.WINCogFile.good()) {
1271 0 : files.WINCogFile.close();
1272 : }
1273 :
1274 35972 : if (files.IterationCSVFile.good()) {
1275 0 : files.IterationCSVFile.close();
1276 : }
1277 :
1278 35972 : if (files.TarcogIterationsFile.good()) {
1279 0 : files.TarcogIterationsFile.close();
1280 : }
1281 35972 : }
1282 :
1283 37990 : void PrepDebugFilesAndVariables(EnergyPlusData &state,
1284 : Files &files,
1285 : fs::path const &Debug_dir,
1286 : fs::path const &Debug_file,
1287 : [[maybe_unused]] int const Debug_mode,
1288 : int const win_ID,
1289 : int const igu_ID)
1290 : {
1291 :
1292 37990 : files.DBGD = Debug_dir;
1293 :
1294 37990 : state.dataTARCOGOutputs->winID = win_ID;
1295 37990 : state.dataTARCOGOutputs->iguID = igu_ID;
1296 :
1297 : // setup file names if file name is provided, otherwise keep default
1298 37990 : if (!Debug_file.empty()) {
1299 75980 : files.WINCogFilePath = FileSystem::appendSuffixToPath(Debug_file, ".w7");
1300 75980 : files.DebugOutputFilePath = FileSystem::appendSuffixToPath(Debug_file, ".dbg");
1301 : }
1302 :
1303 37990 : files.WriteDebugOutput = false;
1304 : // there used to be a block under here but the debug flag was hardwired to not do any reporting, so it was removed
1305 37990 : }
1306 :
1307 : } // namespace EnergyPlus::TARCOGOutput
|