Skip to content

Commit

Permalink
Fix input problem for blank type
Browse files Browse the repository at this point in the history
Fixed an issue with a blank solution type.  It should now interpret the input when solution type is blank correctly (default back to Basic).  There should be no diffs in the ci results (hopefully).
  • Loading branch information
RKStrand committed Jul 30, 2023
1 parent d1370a2 commit b22afa2
Showing 1 changed file with 17 additions and 2 deletions.
19 changes: 17 additions & 2 deletions src/EnergyPlus/EarthTube.cc
Original file line number Diff line number Diff line change
Expand Up @@ -432,7 +432,22 @@ void GetEarthTube(EnergyPlusData &state, bool &ErrorsFound) // If errors found i

// cAlphaArgs(5)--Model type: basic or vertical
// only process cAlphaArgs(6) if cAlphaArgs(5) is "Vertical"
thisEarthTube.ModelType = static_cast<EarthTubeModelType>(getEnumValue(solutionTypeNamesUC, state.dataIPShortCut->cAlphaArgs(5)));
if (state.dataIPShortCut->cAlphaArgs(5).empty()) {
thisEarthTube.ModelType = EarthTubeModelType::Basic;
} else {
thisEarthTube.ModelType = static_cast<EarthTubeModelType>(getEnumValue(solutionTypeNamesUC, state.dataIPShortCut->cAlphaArgs(5)));
if (thisEarthTube.ModelType == EarthTubeModelType::Invalid) {
ShowSevereError(state,
format("{}: {}={}, {} invalid={}",
cCurrentModuleObject,
state.dataIPShortCut->cAlphaFieldNames(1),
state.dataIPShortCut->cAlphaArgs(1),
state.dataIPShortCut->cAlphaFieldNames(5),
state.dataIPShortCut->cAlphaArgs(5)));
ErrorsFound = true;
}
}

if (thisEarthTube.ModelType == EarthTubeModelType::Vertical) {
thisEarthTube.r3 = 0.0; // Vertical model does not use this parameter--reset to zero (keep because r3=0 necessary so Rs=0 in calc routine)
// Process the parameters based on the name (link via index)
Expand All @@ -443,7 +458,7 @@ void GetEarthTube(EnergyPlusData &state, bool &ErrorsFound) // If errors found i
break;
}
}
if (thisEarthTube.vertParametersPtr = 0) { // didn't find a match
if (thisEarthTube.vertParametersPtr == 0) { // didn't find a match
ShowSevereError(state,
format("{}: {}={}, Parameter Object {} was not found in the input file.",
cCurrentModuleObject,
Expand Down

5 comments on commit b22afa2

@nrel-bot-2c
Copy link

Choose a reason for hiding this comment

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

5114327-EarthTube1DVerticalEnhancement (RKStrand) - x86_64-Linux-Ubuntu-22.04-gcc-11.3: OK (3487 of 3487 tests passed, 0 test warnings)

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.

5114327-EarthTube1DVerticalEnhancement (RKStrand) - Win64-Windows-10-VisualStudio-16: OK (2673 of 2673 tests passed, 0 test warnings)

Build Badge Test Badge

@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.

5114327-EarthTube1DVerticalEnhancement (RKStrand) - x86_64-MacOS-10.17-clang-13.0.0: OK (3446 of 3446 tests passed, 0 test warnings)

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.

5114327-EarthTube1DVerticalEnhancement (RKStrand) - x86_64-Linux-Ubuntu-22.04-gcc-11.3-UnitTestsCoverage-Debug: OK (1900 of 1900 tests passed, 0 test warnings)

Build Badge Test Badge Coverage Badge

@nrel-bot-2b
Copy link

Choose a reason for hiding this comment

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

5114327-EarthTube1DVerticalEnhancement (RKStrand) - x86_64-Linux-Ubuntu-22.04-gcc-11.3-IntegrationCoverage-Debug: OK (776 of 776 tests passed, 0 test warnings)

Build Badge Test Badge Coverage Badge

Please sign in to comment.