Skip to content

Commit

Permalink
Fix #1675
Browse files Browse the repository at this point in the history
  • Loading branch information
jmarrec committed Jul 1, 2020
1 parent ba6c890 commit 8453299
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/energyplus/ForwardTranslator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3600,6 +3600,12 @@ std::vector<IddObjectType> ForwardTranslator::iddObjectsToTranslateInitializer()
result.push_back(IddObjectType::OS_Coil_Heating_Water);
result.push_back(IddObjectType::OS_Coil_Heating_WaterToAirHeatPump_EquationFit);
result.push_back(IddObjectType::OS_Coil_WaterHeating_Desuperheater);

// If using a plantLoop, this will be translated by the PlantLoop. But WaterHeaters can also be used stand-alone, so always translate them
// We'll check in their FT if the "Peak Use Flow Rate" is actually initialized as it's an indication that the WH was
result.push_back(OS_WaterHeater_Mixed);
result.push_back(OS_WaterHeater_Stratified);

result.push_back(IddObjectType::OS_Connection);
result.push_back(IddObjectType::OS_Connector_Mixer);
result.push_back(IddObjectType::OS_Connector_Splitter);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,12 @@ boost::optional<IdfObject> ForwardTranslator::translateWaterHeaterMixed( WaterHe
boost::optional<double> value;
boost::optional<Schedule> schedule;

if (!modelObject.plantLoop() && !(modelObject.peakUseFlowRate() && modelObject.useFlowRateFractionSchedule()) ) {
LOG(Warn, modelObject.briefDescription() << " will not be translated as it not on a PlantLoop, and it does not have both a Peak Use Flow Rate "
"and a Use Flow Rate Fraction Schedule which is a required condition for stand-alone operation");
return boost::none;
}

IdfObject idfObject(IddObjectType::WaterHeater_Mixed);

m_idfObjects.push_back(idfObject);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,12 @@ boost::optional<IdfObject> ForwardTranslator::translateWaterHeaterStratified( Wa
boost::optional<double> value;
boost::optional<Schedule> schedule;

if (!modelObject.plantLoop() && !(modelObject.peakUseFlowRate() && modelObject.useFlowRateFractionSchedule()) ) {
LOG(Warn, modelObject.briefDescription() << " will not be translated as it not on a PlantLoop, and it does not have both a Peak Use Flow Rate "
"and a Use Flow Rate Fraction Schedule which is a required condition for stand-alone operation");
return boost::none;
}

// Name
IdfObject idfObject = createRegisterAndNameIdfObject(openstudio::IddObjectType::WaterHeater_Stratified, modelObject);

Expand Down

0 comments on commit 8453299

Please sign in to comment.