Skip to content

Commit

Permalink
Merge remote-tracking branch 'remotes/origin/develop' into Beyond1Air…
Browse files Browse the repository at this point in the history
…loop

Conflicts:
	src/EnergyPlus/SingleDuct.cc
  • Loading branch information
mjwitte committed Feb 28, 2017
2 parents 8d2cbf8 + ded3c56 commit 49fedfd
Show file tree
Hide file tree
Showing 5,935 changed files with 1,208,563 additions and 22,089 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
2 changes: 1 addition & 1 deletion .decent_ci-Linux.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ compilers:
s3_upload_bucket: energyplus

- name: cppcheck
compiler_extra_flags: --enable=warning --suppress="*:*gtest*" --suppress="constStatement:*Objex*" --suppress="cppcheckError:*" --suppress="uninitvar:*" --suppress="syntaxError:*" --suppress="*:*sqlite*" --suppress="invalidscanf:*DElight*" --suppress="uninitMemberVar:*DElight*" --suppress="invalidScanfArgType_int:*DElight*" --suppress="uninitMemberVar:*jsoncpp*" --suppress="*:*re2*"
compiler_extra_flags: --enable=warning --suppress="*:*gtest*" --suppress="constStatement:*Objex*" --suppress="cppcheckError:*" --suppress="uninitvar:*" --suppress="syntaxError:*" --suppress="*:*sqlite*" --suppress="invalidscanf:*DElight*" --suppress="uninitMemberVar:*DElight*" --suppress="invalidScanfArgType_int:*DElight*" --suppress="uninitMemberVar:*jsoncpp*" --suppress="*:*re2*" --suppress="*:*eigen*"

- name: "gcc"
version: "4.8"
Expand Down
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -46,4 +46,3 @@ cmake-build-debug

# py2app puts things inside dist/ and build/, build/ is already ignored, just add dist/
dist

7 changes: 6 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -128,12 +128,12 @@ include(cmake/CompilerFlags.cmake)
INCLUDE_DIRECTORIES( ${CMAKE_SOURCE_DIR}/src )
INCLUDE_DIRECTORIES( ${CMAKE_SOURCE_DIR}/third_party )
INCLUDE_DIRECTORIES( ${CMAKE_SOURCE_DIR}/third_party/re2 )
INCLUDE_DIRECTORIES( ${CMAKE_SOURCE_DIR}/third_party/zlib )
INCLUDE_DIRECTORIES( ${CMAKE_SOURCE_DIR}/third_party/gtest/include/ SYSTEM )
INCLUDE_DIRECTORIES( ${CMAKE_SOURCE_DIR}/third_party/ObjexxFCL/src/ )
INCLUDE_DIRECTORIES( ${CMAKE_SOURCE_DIR}/third_party/SQLite/ SYSTEM )
INCLUDE_DIRECTORIES( "${CMAKE_SOURCE_DIR}/third_party/Expat" "${CMAKE_SOURCE_DIR}/third_party/Expat/lib" SYSTEM)
INCLUDE_DIRECTORIES( ${CMAKE_SOURCE_DIR}/third_party/CLI/ )
INCLUDE_DIRECTORIES( ${CMAKE_SOURCE_DIR}/third_party/eigen-3.3.2/ )
INCLUDE_DIRECTORIES( ${CMAKE_SOURCE_DIR}/third_party/jsoncpp)
INCLUDE_DIRECTORIES( ${CMAKE_BINARY_DIR}/src/EnergyPlus) # so that any source can #include <ConfiguredFunctions.hh>

Expand All @@ -158,6 +158,11 @@ IF(NOT APPLE )
ENDIF()
ADD_SUBDIRECTORY(third_party/jsoncpp)

# Kiva
option( BUILD_GROUND_PLOT "Build ground plotting library (for Kiva debugging only)" OFF )
mark_as_advanced(FORCE BUILD_GROUND_PLOT)
INCLUDE(third_party/cmake/kiva.cmake)

# of course E+ itself
ADD_SUBDIRECTORY(src/EnergyPlus)

Expand Down
507 changes: 507 additions & 0 deletions design/FY2016/New Fan Design Document.md

Large diffs are not rendered by default.

Binary file added design/FY2016/Two-Speed_FanPowerProblem_PNNL.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
228 changes: 228 additions & 0 deletions design/FY2017/Design_AFNDuctRadiation.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,228 @@
Air Duct Radiation Heat Transfer
===============

**Anthony Fontanini, Matt Mitchell, and Jan Kosny: Fraunhofer CSE**

- December 6, 2016

## New Feature Proposal
Details on the justification, overview, and IDD changes of the project are provided in the NFP.

## Overview

The current source files that are related to the following objects:

- AirflowNetwork:Distribution:Component:Duct
- AirflowNetwork:Distribution:Linkage

are primarily:

- AirflowNetworkSolver.cc
- AirflowNetworkBalanceManager.cc
- DataAirflowNetwork.cc

Most of the data structures will remain unchanged. New data structures will be added for the new object, and a few others for surfaces, ducts, and linkages will be modified to accommodate the duct radiation and user view factor changes. Little effort is expected to be given to refactorization. Changes and additions to data structures, and code changes are outlined below.

## Approach

### Modifications to DataAirFlowNetwork.hh

Modify the ```DisSysLinkageProp``` struct by adding the following:

``` C++
struct DisSysLinkageProp // Distribution system linkage data
{
// New Member
int viewFactorID;

// Default Constructor
AirflowNetworkLinkage() :
viewFactorID(0)
{}
};
```

Modify the ```AirflowNetworkExchangeProp``` struct by adding the following:

```C++
// New member
Real64 DuctRadEnergy;

// Default constructor
AirflowNetworkExchangeProp() :
DuctRadEnergy(0.0)
{}
```
Add the ```AirflowNetworkLinkageViewFactorProp``` and ```LinkageSurfaceData``` structs as follows:
```C++
struct LinkageSurfaceProp
{
// Members
std::string surfaceName;
int surfaceID;
Real64 viewFactor;
// Default Constructor
LinkageSurfaceProp() :
surfaceID(0),
viewFactor(0)
{}
};
struct AirflowNetworkLinkageViewFactorProp
{
// Members
std::string name;
Real64 surfaceExposureFraction;
Real64 surfaceEmittance;
Array1D< LinkageSurfaceProp > linkageSurfaceData;
// Default Constructor
AirflowNetworkLinkageViewFactorProp() :
surfaceExposureFraction(0),
surfaceEmittance(0)
{}
};
```

It appears that the nomenclature throughout AFN has been to name the struct with the ```Prop``` suffix, and the instance with the ```Data``` suffix. This was replicated in these changes.

### Modifications to DataAirFlowNetwork.cc

Add the ```CompTypeNum``` as follows:

```C++
// ~ Line 107
int const CompTypeNum_DVF(21); // Distribution system linkage view factor
```
Add an array of ```AirflowNetworkLinkageViewFactorData```, and in the ```clear_state()``` as follows:
``` C++
// ~ Line 244
Array1D< AirflowNetworkLinkageViewFactorProp > AirflowNetworkLinkageViewFactorData;
// ~ Line 315
AirflowNetworkLinkageViewFactorData.deallocate();
```

### Modifications to AirFlowNetworkBalanceManger.cc

Add to ```clear_state()``` the following:

```C++
// ~ Line 338
DisSysNumOfDuctViewFactors = 0;
```

Add to ```GetAirflowNetworkInput()``` the following:

```C++
// ~ Line 679
GetObjectDefMaxArgs( "AirflowNetwork:Distribution:DuctViewFactors", TotalArgs, NumAlphas, NumNumbers );
MaxNums = max( MaxNums, NumNumbers );
MaxAlphas = max( MaxAlphas, NumAlphas );

// ~ Line 2750
// Read AirflowNetwork distribution system component: DuctViewFactors
CurrentModuleObject = "AirflowNetwork:Distribution:DuctViewFactors";
DisSysNumOfDuctViewFactors = GetNumObjectsFound( CurrentModuleObject );
if ( DisSysNumOfDuctViewFactors > 0 ) {
AirflowNetworkLinkageViewFactorData.allocate( DisSysNumOfDuctViewFactors );
for ( i = 1; i <= DisSysNumOfDucts; ++i ) {
GetObjectItem( CurrentModuleObject, i, Alphas, NumAlphas, Numbers, NumNumbers, IOStatus, lNumericBlanks, lAlphaBlanks, cAlphaFields, cNumericFields );
IsNotOK = false;
IsBlank = false;
VerifyName( Alphas( 1 ), DisSysCompDuctData, i - 1, IsNotOK, IsBlank, CurrentModuleObject + " Name" );
if ( IsNotOK ) {
ErrorsFound = true;
if ( IsBlank ) Alphas( 1 ) = "xxxxx";
}
AirFlowNetworkLinkageViewFactorData( i ).name = Alphas( 1 ); // Name duct view factor component
AirFlowNetworkLinkageViewFactorData( i ).surfaceExposureFraction = Numbers( 1 ); // Surface exposure fraction []
AirFlowNetworkLinkageViewFactorData( i ).surfaceEmittance = Numbers( 2 ); // Duct surface emittance

numSurfaces = NumAlphas - 1;
AirflowNetworkLinkageViewFactorData( i ).linkageSurfaceData.allocate(numSurfaces)
for (int i = 0; i < numAlphas; ++i)
{
AirFlowNetworkLinkageViewFactorData( i ).surfaceName = Alphas( i + 1 ); // Surface name
AirFlowNetworkLinkageViewFactorData( i ).surfaceNum = FindItemInList( Alphas( i + 1 ), Surface );
AirFlowNetworkLinkageViewFactorData( i ).viewFactor = Numbers( i + 2 ); // Surface view factor
}
}
}

// ~ Line 3749
if ( AirflowNetworkCompData( i ).CompTypeNum == CompTypeNum_DVF ) CompName( 1 ) = "AirflowNetwork:Distribution:DuctViewFactors";
```
Add to ```AllocateAndInitData()``` the following:
```C++
// Radiation losses due to the forced air systems
SetupOutputVariable( "AFN Zone Duct Radiation Heat Gain Rate [W]", AirflowNetworkReportData( i ).RadGainW, "System", "Average", Zone( i ).Name );
SetupOutputVariable( "AFN Zone Duct Radiation Sensible Heat Gain Energy [J]", AirflowNetworkReportData( i ).RadGainJ, "System", "Sum", Zone( i ).Name );
SetupOutputVariable( "AFN Zone Duct Radiation Heat Loss Rate [W]", AirflowNetworkReportData( i ).RadLossW, "System", "Average", Zone( i ).Name );
SetupOutputVariable( "AFN Zone Duct Radiation Sensible Heat Loss Energy [J]", AirflowNetworkReportData( i ).RadLossJ, "System", "Sum", Zone( i ).Name );
```

Add to ```ReportAirflowNetwork()``` the following:

```C++
if ( AirflowNetworkExchangeData( i ).RadGain > 0.0 ) {
AirflowNetworkReportData( i ).RadGainW = AirflowNetworkExchangeData( i ).RadGain;
AirflowNetworkReportData( i ).RadGainJ = AirflowNetworkExchangeData( i ).RadGain * ReportingConstant;
} else {
AirflowNetworkReportData( i ).RadLossW = -AirflowNetworkExchangeData( i ).RadGain;
AirflowNetworkReportData( i ).RadLossJ = -AirflowNetworkExchangeData( i ).RadGain * ReportingConstant;
}
```

Add to ```UpdateAirFlowNetwork()``` the following:

```C++
// ~ Line 6973
AirflowNetworkExchangeData( i ).TotalSen = AirflowNetworkExchangeData( i ).LeakSen + AirflowNetworkExchangeData( i ).CondSen + AirflowNetworkExchangeData( i ).RadGain;

// ~ Line 6984
AirflowNetworkExchangeData( i ).RadGain *= OnOffFanRunTimeFraction;
```
Add to ```ManageAirflowNetworkBalance()``` the following:
```C++
// ~ Line 493
CalcAirflowNetworkRadiation();
```

Currenty, it anticpated that this will be called before the heat and moisture balance's are calculated. The function will stand alone and be capable of being called by either of the other heat balance methods if deemed necessary. This will require some futher investigation to determine what works best in practice.

Add ```CalcAirflowNetworkRadiation()```:

```C++
for ( i = 1; i <= AirflowNetworkNumOfLinks; ++i ) {
CompNum = AirflowNetworkLinkageData( i ).CompNum;
CompTypeNum = AirflowNetworkCompData( CompNum ).CompTypeNum;
CompName = AirflowNetworkCompData( CompNum ).EPlusName;
// Calculate duct radiation
if ( CompTypeNum == CompTypeNum_DWC && CompName == BlankString ) { // Duct element only
// Duct radiation calcs here
}
}
```


### Modifications to DataSurfaceHeatBalance.cc

This will follow the pattern set out by objects such as the ```ZoneHVAC:Baseboard:RadiantConvective:Electric``` object for ducts to place heat gains/losses on the interior surface heat balance.


## OOP/Refactorization
Since the new duct view factor object described here and in the NFP are intended as a *first* step at evaluating the effects of duct radiation, no major refactorization will occur during this phase of the project. If in subsequent phases duct radiation view factors are to be calculated automatically by EnergyPlus, refactorization of the surface heat balance and airflow network will be further evaluated. Converting some of the affected list of component types, as shown [here](https://github.com/NREL/EnergyPlus/blob/ea65c6e0c28a9e40c4846062fadfbf198ede5681/src/EnergyPlus/DataAirflowNetwork.cc#L87) to ```enum``` types could be tasked given team support, though little effort for code refactorization is expected.

Lots of spelling errors and end-of-line whitespace--correct those at a minimum.

Loading

8 comments on commit 49fedfd

@nrel-bot-3
Copy link

Choose a reason for hiding this comment

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

Beyond1Airloop (mjwitte) - x86_64-MacOS-10.9-clang: OK (2444 of 2471 tests passed, 569 test warnings)

  • 571 tests had: AUD diffs.
  • 498 tests had: BND diffs.
  • 12 tests had: EIO diffs.
  • 2 tests had: ESO small diffs.
  • 2 tests had: Table small diffs.
  • 1 test had: RDD diffs.
  • 2 tests had: ESO big diffs.
  • 2 tests had: MTR big diffs.
  • 2 tests had: Table big diffs.

Build Badge Test Badge

@nrel-bot-2
Copy link

Choose a reason for hiding this comment

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

@nrel-bot-2
Copy link

Choose a reason for hiding this comment

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

Beyond1Airloop (mjwitte) - x86_64-Linux-Ubuntu-14.04-cppcheck-1.61: OK (0 of 0 tests passed, 0 test warnings)

Build Badge

@nrel-bot-2
Copy link

Choose a reason for hiding this comment

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

Beyond1Airloop (mjwitte) - x86_64-Linux-Ubuntu-14.04-gcc-4.8-UnitTestsCoverage-Debug: OK (1277 of 1277 tests passed, 0 test warnings)

Build Badge Test Badge Coverage Badge

@nrel-bot-2
Copy link

Choose a reason for hiding this comment

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

Beyond1Airloop (mjwitte) - x86_64-Linux-Ubuntu-14.04-gcc-4.8-IntegrationCoverage-Debug: OK (1850 of 1878 tests passed, 0 test warnings)

Build Badge Test Badge Coverage Badge

@nrel-bot-2
Copy link

Choose a reason for hiding this comment

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

Beyond1Airloop (mjwitte) - x86_64-Linux-Ubuntu-14.04-custom_check: OK (0 of 0 tests passed, 0 test warnings)

Build Badge

@nrel-bot
Copy link

Choose a reason for hiding this comment

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

Beyond1Airloop (mjwitte) - i386-Windows-7-VisualStudio-14: OK (2450 of 2477 tests passed, 572 test warnings)

  • 575 tests had: AUD diffs.
  • 501 tests had: BND diffs.
  • 13 tests had: EIO diffs.
  • 2 tests had: ESO small diffs.
  • 2 tests had: Table small diffs.
  • 1 test had: ERR diffs.
  • 3 tests had: ESO big diffs.
  • 3 tests had: MTR big diffs.
  • 3 tests had: Table big diffs.
  • 1 test had: RDD diffs.

Build Badge Test Badge

@nrel-bot
Copy link

Choose a reason for hiding this comment

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

Beyond1Airloop (mjwitte) - Win64-Windows-7-VisualStudio-14: OK (2452 of 2477 tests passed, 0 test warnings)

Build Badge Test Badge

Please sign in to comment.