1
1
import pywincalc
2
2
3
- # Path to the optical standard file. All other files referenced by the standard file must be in the same directory
4
- # Note: While all optical standards packaged with WINDOW should work with optical calculations care should be
5
- # taken to use NFRC standards if NFRC thermal results are desired. This is because for thermal calculations currently
6
- # only ISO 15099 is supported. While it is possible to use EN optical standards and create thermal results
7
- # those results will not be based on EN 673
8
- optical_standard_path = "standards/W5_NFRC_2003.std"
9
- optical_standard = pywincalc .load_standard (optical_standard_path )
10
-
11
3
# Load solid layer measured values. Solid layer information can come from either igsdb.lbl.gov or files generate
12
4
# by the Optics program. Since igsdb.lbl.gov requires registration some optics files are provided for example
13
5
# purposes
22
14
# that was just loaded and the middle is the same glass as the single clear example above
23
15
solid_layers = [clear_6 , clear_3 , clear_6 ]
24
16
25
- # Solid layers must be separated by gap layers
26
- # Currently there are four pre-defined gases available: Air, Argon, Krypton, and Xenon
27
- # Vacuum gaps are not yet supported
28
- # To create a gap with 100% of a predefined gas create a Gap_Data object with the gas type
29
- # and thickness in meters
30
- gap_1 = pywincalc .Gap (pywincalc .PredefinedGasType .AIR , .0127 ) # .0127 is gap thickness in meters
31
-
32
- # To create a mixture of predefined gases first create the components with the gas type and portion of the mixture
33
- # The following creates a gas that is 70% Krypton and 30% Xenon and 2cm thick
34
- gap_2_component_1 = pywincalc .PredefinedGasMixtureComponent (pywincalc .PredefinedGasType .KRYPTON , .7 )
35
- gap_2_component_2 = pywincalc .PredefinedGasMixtureComponent (pywincalc .PredefinedGasType .XENON , .3 )
36
- gap_2 = pywincalc .Gap ([gap_2_component_1 , gap_2_component_2 ], .02 ) # .02 is gap thickness in meters
17
+ # Solid layers must be separated by gap layers. This example uses two air gaps
18
+ # See gaps_and_gases.py in examples for more on creating gases
19
+ gap_1 = pywincalc .Layers .gap (thickness = .0127 )
20
+ gap_2 = pywincalc .Layers .gap (thickness = .02 )
37
21
38
22
# Put all gaps into a list ordered from outside to inside
39
23
# Note: This is only specifying gaps between solid layers
45
29
height = 1.0 # height of the glazing system in meters
46
30
tilt = 90 # glazing system tilt in degrees
47
31
48
- glazing_system = pywincalc .GlazingSystem (optical_standard = optical_standard , solid_layers = solid_layers , gap_layers = gaps ,
49
- width_meters = width , height_meters = height , tilt_degrees = tilt ,
50
- environment = pywincalc . nfrc_u_environments ())
32
+ glazing_system = pywincalc .GlazingSystem (solid_layers = solid_layers , gap_layers = gaps ,
33
+ width_meters = width , height_meters = height , tilt_degrees = tilt )
34
+
51
35
# Deflection calcs currently need to be specifically enabled
52
36
glazing_system .enable_deflection (True )
53
37
54
38
# Set initial temperature and pressure. Values just chosen for example purposes
55
- glazing_system .set_deflection_properties (temperature_initial = 273 , pressure_initial = 1013200 )
39
+ glazing_system .set_deflection_properties (temperature_initial = 273 , pressure_initial = 101320 )
56
40
57
41
# Density can be calculated using either U or SHGC TARCOG system types. Just using SHGC for this
58
42
# example for simplicity.
64
48
print ("\t U: {val}" .format (val = glazing_system .u ()))
65
49
print ("\t SHGC: {val}" .format (val = glazing_system .shgc ()))
66
50
print ("\t Layer temperatures (U): {val}" .format (val = glazing_system .layer_temperatures (pywincalc .TarcogSystemType .U )))
67
- print ("\t Layer temperatures (SHGC): {val}" .format (val = glazing_system .layer_temperatures (pywincalc .TarcogSystemType .SHGC )))
51
+ print (
52
+ "\t Layer temperatures (SHGC): {val}" .format (val = glazing_system .layer_temperatures (pywincalc .TarcogSystemType .SHGC )))
68
53
visible_results = glazing_system .optical_method_results ("PHOTOPIC" )
69
54
print ("\t VT: {val}" .format (val = visible_results .system_results .front .transmittance .direct_hemispherical ))
70
55
71
-
72
56
# Change initial temperature and pressure. Values just chosen for example purposes
73
- glazing_system .set_deflection_properties (temperature_initial = 290 , pressure_initial = 1014500 )
57
+ glazing_system .set_deflection_properties (temperature_initial = 290 , pressure_initial = 101450 )
74
58
print ("" )
75
59
print ("Changed initial temperature and pressure" )
76
60
print ("\t deflection max: {val}" .format (val = deflection_results .deflection_max ))
79
63
print ("\t U: {val}" .format (val = glazing_system .u ()))
80
64
print ("\t SHGC: {val}" .format (val = glazing_system .shgc ()))
81
65
print ("\t Layer temperatures (U): {val}" .format (val = glazing_system .layer_temperatures (pywincalc .TarcogSystemType .U )))
82
- print ("\t Layer temperatures (SHGC): {val}" .format (val = glazing_system .layer_temperatures (pywincalc .TarcogSystemType .SHGC )))
66
+ print (
67
+ "\t Layer temperatures (SHGC): {val}" .format (val = glazing_system .layer_temperatures (pywincalc .TarcogSystemType .SHGC )))
83
68
visible_results = glazing_system .optical_method_results ("PHOTOPIC" )
84
69
print ("\t VT: {val}" .format (val = visible_results .system_results .front .transmittance .direct_hemispherical ))
85
70
# Change tilt
94
79
print ("\t U: {val}" .format (val = glazing_system .u ()))
95
80
print ("\t SHGC: {val}" .format (val = glazing_system .shgc ()))
96
81
print ("\t Layer temperatures (U): {val}" .format (val = glazing_system .layer_temperatures (pywincalc .TarcogSystemType .U )))
97
- print ("\t Layer temperatures (SHGC): {val}" .format (val = glazing_system .layer_temperatures (pywincalc .TarcogSystemType .SHGC )))
82
+ print (
83
+ "\t Layer temperatures (SHGC): {val}" .format (val = glazing_system .layer_temperatures (pywincalc .TarcogSystemType .SHGC )))
98
84
visible_results = glazing_system .optical_method_results ("PHOTOPIC" )
99
85
print ("\t VT: {val}" .format (val = visible_results .system_results .front .transmittance .direct_hemispherical ))
100
86
111
97
print ("\t U: {val}" .format (val = glazing_system .u ()))
112
98
print ("\t SHGC: {val}" .format (val = glazing_system .shgc ()))
113
99
print ("\t Layer temperatures (U): {val}" .format (val = glazing_system .layer_temperatures (pywincalc .TarcogSystemType .U )))
114
- print ("\t Layer temperatures (SHGC): {val}" .format (val = glazing_system .layer_temperatures (pywincalc .TarcogSystemType .SHGC )))
100
+ print (
101
+ "\t Layer temperatures (SHGC): {val}" .format (val = glazing_system .layer_temperatures (pywincalc .TarcogSystemType .SHGC )))
115
102
visible_results = glazing_system .optical_method_results ("PHOTOPIC" )
116
103
print ("\t VT: {val}" .format (val = visible_results .system_results .front .transmittance .direct_hemispherical ))
117
104
160
147
161
148
custom_env = pywincalc .Environments (outside = custom_outside_env , inside = custom_inside_env )
162
149
163
- # changing environmental conditions currently requires creating a new glazing system
164
- # note: this resets any changes made such as if deflection is enabled or applied load is set.
165
- # if this is a problem or you think it would be better to be able to change environmental conditions
166
- # like tilt and load let us know.
167
-
168
- glazing_system = pywincalc .GlazingSystem (optical_standard = optical_standard , solid_layers = solid_layers , gap_layers = gaps ,
169
- width_meters = width , height_meters = height , tilt_degrees = tilt ,
170
- environment = custom_env )
171
-
172
- glazing_system .enable_deflection (True )
173
- glazing_system .set_deflection_properties (temperature_initial = 273 , pressure_initial = 1013200 )
150
+ glazing_system .environments (custom_env )
174
151
deflection_results = glazing_system .calc_deflection_properties (pywincalc .TarcogSystemType .SHGC )
175
152
176
153
print ("" )
181
158
print ("\t U: {val}" .format (val = glazing_system .u ()))
182
159
print ("\t SHGC: {val}" .format (val = glazing_system .shgc ()))
183
160
print ("\t Layer temperatures (U): {val}" .format (val = glazing_system .layer_temperatures (pywincalc .TarcogSystemType .U )))
184
- print ("\t Layer temperatures (SHGC): {val}" .format (val = glazing_system .layer_temperatures (pywincalc .TarcogSystemType .SHGC )))
161
+ print (
162
+ "\t Layer temperatures (SHGC): {val}" .format (val = glazing_system .layer_temperatures (pywincalc .TarcogSystemType .SHGC )))
185
163
visible_results = glazing_system .optical_method_results ("PHOTOPIC" )
186
164
print ("\t VT: {val}" .format (val = visible_results .system_results .front .transmittance .direct_hemispherical ))
187
165
194
172
custom_env_2 .outside .pressure += 500
195
173
custom_env_2 .inside .pressure -= 200
196
174
197
- glazing_system = pywincalc .GlazingSystem (optical_standard = optical_standard , solid_layers = solid_layers , gap_layers = gaps ,
198
- width_meters = width , height_meters = height , tilt_degrees = tilt ,
199
- environment = custom_env_2 )
175
+ glazing_system .environments (custom_env_2 )
200
176
201
- glazing_system .enable_deflection (True )
202
- glazing_system .set_deflection_properties (temperature_initial = 273 , pressure_initial = 1013200 )
177
+ glazing_system .set_deflection_properties (temperature_initial = 273 , pressure_initial = 101320 )
203
178
deflection_results = glazing_system .calc_deflection_properties (pywincalc .TarcogSystemType .SHGC )
204
179
205
180
print ("" )
210
185
print ("\t U: {val}" .format (val = glazing_system .u ()))
211
186
print ("\t SHGC: {val}" .format (val = glazing_system .shgc ()))
212
187
print ("\t Layer temperatures (U): {val}" .format (val = glazing_system .layer_temperatures (pywincalc .TarcogSystemType .U )))
213
- print ("\t Layer temperatures (SHGC): {val}" .format (val = glazing_system .layer_temperatures (pywincalc .TarcogSystemType .SHGC )))
188
+ print (
189
+ "\t Layer temperatures (SHGC): {val}" .format (val = glazing_system .layer_temperatures (pywincalc .TarcogSystemType .SHGC )))
214
190
visible_results = glazing_system .optical_method_results ("PHOTOPIC" )
215
191
print ("\t VT: {val}" .format (val = visible_results .system_results .front .transmittance .direct_hemispherical ))
216
192
224
200
225
201
solid_layers = [clear_6 , clear_3 , clear_6 ]
226
202
227
- glazing_system = pywincalc .GlazingSystem (optical_standard = optical_standard , solid_layers = solid_layers ,
228
- gap_layers = gaps , width_meters = width , height_meters = height , tilt_degrees = tilt ,
229
- environment = custom_env_2 )
203
+ glazing_system = pywincalc .GlazingSystem (solid_layers = solid_layers , gap_layers = gaps , width_meters = width ,
204
+ height_meters = height , tilt_degrees = tilt , environment = custom_env_2 )
230
205
231
206
glazing_system .enable_deflection (True )
232
- glazing_system .set_deflection_properties (temperature_initial = 273 , pressure_initial = 1013200 )
207
+ glazing_system .set_deflection_properties (temperature_initial = 273 , pressure_initial = 101320 )
233
208
deflection_results = glazing_system .calc_deflection_properties (pywincalc .TarcogSystemType .SHGC )
234
209
235
210
print ("" )
236
- print ("Set density and youngs modulus" )
211
+ print ("Set density and Young's modulus" )
237
212
print ("\t deflection max: {val}" .format (val = deflection_results .deflection_max ))
238
213
print ("\t deflection mean: {val}" .format (val = deflection_results .deflection_mean ))
239
214
print ("\t panes load: {val}" .format (val = deflection_results .panes_load ))
240
215
print ("\t U: {val}" .format (val = glazing_system .u ()))
241
216
print ("\t SHGC: {val}" .format (val = glazing_system .shgc ()))
242
217
print ("\t Layer temperatures (U): {val}" .format (val = glazing_system .layer_temperatures (pywincalc .TarcogSystemType .U )))
243
- print ("\t Layer temperatures (SHGC): {val}" .format (val = glazing_system .layer_temperatures (pywincalc .TarcogSystemType .SHGC )))
218
+ print (
219
+ "\t Layer temperatures (SHGC): {val}" .format (val = glazing_system .layer_temperatures (pywincalc .TarcogSystemType .SHGC )))
244
220
visible_results = glazing_system .optical_method_results ("PHOTOPIC" )
245
- print ("\t VT: {val}" .format (val = visible_results .system_results .front .transmittance .direct_hemispherical ))
221
+ print ("\t VT: {val}" .format (val = visible_results .system_results .front .transmittance .direct_hemispherical ))
0 commit comments