diff --git a/bifacial_radiance/module.py b/bifacial_radiance/module.py index 9ec3f968..6f863ca8 100644 --- a/bifacial_radiance/module.py +++ b/bifacial_radiance/module.py @@ -53,7 +53,7 @@ def __init__(self, name=None, x=None, y=None, z=None, bifi=1, Length of module (meters) z : numeric Thickness of the module (meters), or of the glass if glass = True, - in which case absorber thickness will be 0.002 and glass whatever + in which case absorber thickness will be 0.001 and glass whatever thickness is given, with absorber in the middle of the glass. bifi : numeric Bifaciality of the panel (not currently used). Between 0 @@ -173,8 +173,7 @@ def __init__(self, name=None, x=None, y=None, z=None, bifi=1, self.modulefile = os.path.join('objects', self.name + '.rad') print("\nModule Name:", self.name) - - # @Chris 8/24 should this be a radObj check for hpc value? + if hpc: self.compileText(rewriteModulefile, json=False) else: diff --git a/docs/sphinx/source/whatsnew/pending.rst b/docs/sphinx/source/whatsnew/pending.rst index 8ebb8014..6482cb5c 100644 --- a/docs/sphinx/source/whatsnew/pending.rst +++ b/docs/sphinx/source/whatsnew/pending.rst @@ -7,7 +7,8 @@ Bugfix Release ... API Changes ~~~~~~~~~~~~ -* +* New input parameter to :py:class:`~bifacial_radiance.ModuleObj and :py:class:`~bifacial_radiance.RadianceObj.makeModule`: `glassEdge`. If :py:class:`~bifacial_radiance.RadianceObj.makeModule` `glass` = True, then this extends the glass past the absorber edge by this total amount (half in each x and y direction). Default 10mm. +* Module glass thickness can be changed. In :py:class:`~bifacial_radiance.RadianceObj.makeModule`, if `glass` = True, then setting the `z` parameter will indicate the total (front + back) glass thickness with the 1mm absorber in the middle. The default is z = 10mm. Enhancements ~~~~~~~~~~~~ diff --git a/tests/test_module.py b/tests/test_module.py index ba17d9f1..66cc53c1 100644 --- a/tests/test_module.py +++ b/tests/test_module.py @@ -147,4 +147,20 @@ def test_moduleFrameandOmegas(): scene = demo.makeScene(module, sceneDict) analysis = bifacial_radiance.AnalysisObj() # return an analysis object including the scan dimensions for back irradiance frontscan, backscan = analysis.moduleAnalysis(scene, sensorsy=10) # Gives us the dictionaries with coordinates - assert backscan['xstart'] == pytest.approx(0.792) \ No newline at end of file + assert backscan['xstart'] == pytest.approx(0.792) + +def test_GlassModule(): + # test the cell-level module generation + name = "_test_GlassModule" + # default glass=True with .001 absorber and 0.01 glass + demo = bifacial_radiance.RadianceObj(name) # Create a RadianceObj 'object' + module = demo.makeModule(name='test-module', rewriteModulefile=True, glass=True, x=1, y=2) + assert module.text == '! genbox black test-module 1 2 0.001 | xform -t -0.5 -1.0 0 -a 1 -t 0 2.0' +\ + ' 0\r\n! genbox stock_glass test-module_Glass 1.01 2.01 0.01 | xform -t -0.505 -1.005 -0.005 -a 1 -t 0 2.0 0' + # custom glass=True with .001 absorber and 0.005 glass + module = demo.makeModule(name='test-module', glass=True, x=1, y=2, z=0.005) + assert module.text == '! genbox black test-module 1 2 0.001 | xform -t -0.5 -1.0 0 -a 1 -t 0 2.0' +\ + ' 0\r\n! genbox stock_glass test-module_Glass 1.01 2.01 0.005 | xform -t -0.505 -1.005 -0.0025 -a 1 -t 0 2.0 0' + + + \ No newline at end of file