-
Notifications
You must be signed in to change notification settings - Fork 390
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Exclude air boundaries and non-used constructions in conduction finite difference #8594
Merged
Merged
Changes from 5 commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
f18f35e
Exclude air and non-used constructions in conduction finite difference
LipingWang 382139b
Merge branch 'develop' into construction_hb_fd_new
LipingWang a994860
Merge branch 'develop' into construction_hb_fd_new
LipingWang 7582e79
Update unit test
LipingWang 80c3229
Merge branch 'develop' into construction_hb_fd_new
LipingWang 510f3d8
Merge remote-tracking branch 'upstream/develop' into construction_hb_…
Myoldmopar File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -51,15 +51,19 @@ | |
#include <gtest/gtest.h> | ||
|
||
// EnergyPlus Headers | ||
#include <EnergyPlus/Construction.hh> | ||
#include <EnergyPlus/Data/EnergyPlusData.hh> | ||
#include <EnergyPlus/DataHeatBalSurface.hh> | ||
#include <EnergyPlus/HeatBalFiniteDiffManager.hh> | ||
#include <EnergyPlus/HeatBalanceManager.hh> | ||
#include <EnergyPlus/Material.hh> | ||
#include <EnergyPlus/PhaseChangeModeling/HysteresisModel.hh> | ||
|
||
#include "Fixtures/EnergyPlusFixture.hh" | ||
|
||
using namespace EnergyPlus::HeatBalFiniteDiffManager; | ||
using namespace EnergyPlus::HeatBalanceManager; | ||
|
||
|
||
namespace EnergyPlus { | ||
|
||
|
@@ -188,7 +192,7 @@ TEST_F(EnergyPlusFixture, HeatBalFiniteDiffManager_CalcNodeHeatFluxTest) | |
} | ||
|
||
TEST_F(EnergyPlusFixture, HeatBalFiniteDiffManager_adjustPropertiesForPhaseChange) | ||
{ | ||
{ | ||
// create a single PCM object in the input and process it | ||
std::string const idf_objects = delimited_string( | ||
{" MaterialProperty:PhaseChangeHysteresis,", " PCMNAME, !- Name", | ||
|
@@ -233,4 +237,106 @@ TEST_F(EnergyPlusFixture, HeatBalFiniteDiffManager_adjustPropertiesForPhaseChang | |
SurfaceFD.deallocate(); | ||
} | ||
|
||
|
||
|
||
TEST_F(EnergyPlusFixture, HeatBalFiniteDiffManager_skipNotUsedConstructionAndAirLayer) | ||
{ | ||
bool ErrorsFound(false); | ||
int thisConstructNum; | ||
int thisTotalLayers; | ||
// create three construction objects with one object not in use and another object assigned to surfaces, and one object as air wall. | ||
std::string const idf_objects = delimited_string( | ||
{ | ||
"Material,", | ||
" MAT - CC05 4 HW CONCRETE, !- Name", | ||
" Rough, !- Roughness", | ||
" 0.1016, !- Thickness{ m }", | ||
" 1.311, !- Conductivity{ W / m - K }", | ||
" 2240, !- Density{ kg / m3 }", | ||
" 836.800000000001, !- Specific Heat{ J / kg - K }", | ||
" 0.9, !- Thermal Absorptance", | ||
" 0.85, !- Solar Absorptance", | ||
" 0.85; !- Visible Absorptance", | ||
"Material:AirGap,", | ||
" F05 Ceiling air space resistance, !- Name", | ||
" 0.18; !- Thermal Resistance{ m2 - K / W }", | ||
"Material:NoMass,", | ||
" CP02 CARPET PAD, !- Name", | ||
" Smooth, !- Roughness", | ||
" 0.1, !- Thermal Resistance{ m2 - K / W }", | ||
" 0.9, !- Thermal Absorptance", | ||
" 0.8, !- Solar Absorptance", | ||
" 0.8; !- Visible Absorptance", | ||
|
||
"Material,", | ||
" F16 Acoustic tile, !- Name", | ||
" MediumSmooth, !- Roughness", | ||
" 0.0191, !- Thickness{ m }", | ||
" 0.06, !- Conductivity{ W / m - K }", | ||
" 368, !- Density{ kg / m3 }", | ||
" 590.000000000002, !- Specific Heat{ J / kg - K }", | ||
" 0.9, !- Thermal Absorptance", | ||
" 0.3, !- Solar Absorptance", | ||
" 0.3; !- Visible Absorptance", | ||
|
||
"Material,", | ||
" M11 100mm lightweight concrete, !- Name", | ||
" MediumRough, !- Roughness", | ||
" 0.1016, !- Thickness{ m }", | ||
" 0.53, !- Conductivity{ W / m - K }", | ||
" 1280, !- Density{ kg / m3 }", | ||
" 840.000000000002, !- Specific Heat{ J / kg - K }", | ||
" 0.9, !- Thermal Absorptance", | ||
" 0.5, !- Solar Absorptance", | ||
" 0.5; !- Visible Absorptance", | ||
|
||
"Construction,", | ||
" ExtSlabCarpet 4in ClimateZone 1 - 8, !- Name", | ||
" MAT - CC05 4 HW CONCRETE, !- Outside Layer", | ||
" CP02 CARPET PAD; !- Layer 2", | ||
"Construction,", | ||
" Interior Floor, !- Name", | ||
" F16 Acoustic tile, !- Outside Layer", | ||
" F05 Ceiling air space resistance, !- Layer 2", | ||
" M11 100mm lightweight concrete; !- Layer 3", | ||
"Construction:AirBoundary,", | ||
" Air Wall_ConstructionAirBoundary, !- Name", | ||
" None, !- Air Exchange Method", | ||
" 0; !- Simple Mixing Air Changes per Hour {1 / hr}", | ||
"Output:Constructions,", | ||
"Constructions;", | ||
"Output:Constructions,", | ||
"Materials;", }); | ||
|
||
ASSERT_TRUE(process_idf(idf_objects)); | ||
|
||
ErrorsFound = false; | ||
GetMaterialData(*state, ErrorsFound); // read material data | ||
EXPECT_FALSE(ErrorsFound); // expect no errors | ||
|
||
ErrorsFound = false; | ||
GetConstructData(*state, ErrorsFound); // read construction data | ||
EXPECT_FALSE(ErrorsFound); // expect no errors | ||
|
||
// allocate properties for construction objects when it is used or not for building surfaces in the model | ||
|
||
state->dataConstruction->Construct(1).IsUsed=false; | ||
state->dataConstruction->Construct(2).IsUsed = true; | ||
state->dataConstruction->Construct(3).IsUsed = true; | ||
|
||
//call the function for initialization of finite difference calculation | ||
InitialInitHeatBalFiniteDiff(*state); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Much better! OK, I'll build locally but this is now on track to go in. Thanks for the quick fix up. |
||
|
||
// check the values are correct | ||
EXPECT_EQ(0, ConstructFD(1).Name.size()); | ||
EXPECT_EQ(3, ConstructFD(2).Name.size()); | ||
EXPECT_EQ(0, ConstructFD(3).Name.size()); | ||
EXPECT_EQ("F16 ACOUSTIC TILE", ConstructFD(2).Name(1)); | ||
EXPECT_EQ("F05 CEILING AIR SPACE RESISTANCE", ConstructFD(2).Name(2)); | ||
EXPECT_EQ("M11 100MM LIGHTWEIGHT CONCRETE", ConstructFD(2).Name(3)); | ||
|
||
// deallocate | ||
ConstructFD.deallocate(); | ||
} | ||
|
||
} // namespace EnergyPlus |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The logic changes seem fine.