Skip to content

Tidy up unused code#1

Open
greytape wants to merge 3 commits intoTrystanLea:masterfrom
greytape:tidy-up-unused-code
Open

Tidy up unused code#1
greytape wants to merge 3 commits intoTrystanLea:masterfrom
greytape:tidy-up-unused-code

Conversation

@greytape
Copy link
Copy Markdown

@greytape greytape commented Sep 21, 2023

Reading through the OpenBEM model, there were quite a few pieces where the code could do with some tidying up (eg commented out code, duplicate lines, typos, unused variables).

Hope this is helpful.

@@ -1,6 +1,5 @@
{
"region": 13,
"altitude": 0,
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Presumably altitude was used in the model at some point (to determine external temperature), but no longer seems to be part of the calculations.

"lib": "Insulated floor",
"l": 0,
"h": 0,
"perimeter": 6.8,
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

perimeter does not seem to be an input or output of the OpenBEM calcs.

//
//---------------------------------------------------------------------------------------------*/

calc.fabric = function (data, solar_acces_factor) {
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

typo

// SAP assumes we are using curtains: paragraph 3.2, p. 15, SAP2012
data.fabric.elements[z].wk = data.fabric.elements[z].netarea * (1 / (1 / data.fabric.elements[z].uvalue + 0.04));
} else {
// SAP assumes we are using curtains: paragraph 3.2, p. 15, SAP2012
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

comment is valid for line above (about windows) but not for this line.

// Monthly average external temperature from Table U1
// for (var i=1; i<13; i++) data['96-'+i] = table_u1[i.region][i-1]-(0.3 * i.altitude / 50);

// See utilisationfactor.js for calculation
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

There is no longer a separate utilisationfactor.js file

// for (var i=1; i<13; i++) data['96-'+i] = table_u1[i.region][i-1]-(0.3 * i.altitude / 50);

// See utilisationfactor.js for calculation
var Te = [];
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Moved this bit of code down below the "7. Mean internal temperature (heating season)" comment, as this seems to be the bit of code that is actually relevant to the comment.

}


// This function is no longer actually used anywhere...
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Tempted to delete this, but thought I'd just point out that it's currently redundant.

@greytape greytape marked this pull request as ready for review September 21, 2023 09:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant