src/energyplus/ForwardTranslator/ForwardTranslateSolarCollectorPerformanceFlatPlate.cpp
| Line | Branch | Exec | Source |
|---|---|---|---|
| 1 | /*********************************************************************************************************************** | ||
| 2 | * OpenStudio(R), Copyright (c) Alliance for Energy Innovation, LLC. | ||
| 3 | * See also https://openstudio.net/license | ||
| 4 | ***********************************************************************************************************************/ | ||
| 5 | |||
| 6 | #include "../ForwardTranslator.hpp" | ||
| 7 | |||
| 8 | #include "../../model/SolarCollectorPerformanceFlatPlate.hpp" | ||
| 9 | |||
| 10 | #include <utilities/idd/SolarCollectorPerformance_FlatPlate_FieldEnums.hxx> | ||
| 11 | #include "../../utilities/idd/IddEnums.hpp" | ||
| 12 | #include <utilities/idd/IddEnums.hxx> | ||
| 13 | |||
| 14 | using namespace openstudio::model; | ||
| 15 | |||
| 16 | namespace openstudio { | ||
| 17 | |||
| 18 | namespace energyplus { | ||
| 19 | |||
| 20 | 1 | boost::optional<IdfObject> ForwardTranslator::translateSolarCollectorPerformanceFlatPlate(model::SolarCollectorPerformanceFlatPlate& modelObject) { | |
| 21 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | IdfObject idfObject(openstudio::IddObjectType::SolarCollectorPerformance_FlatPlate); |
| 22 | |||
| 23 |
1/1✓ Branch 1 taken 1 time.
|
1 | m_idfObjects.push_back(idfObject); |
| 24 | |||
| 25 | 1 | boost::optional<double> d; | |
| 26 | |||
| 27 |
3/3✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
✓ Branch 7 taken 1 time.
|
1 | idfObject.setString(SolarCollectorPerformance_FlatPlateFields::Name, modelObject.name().get()); |
| 28 | |||
| 29 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | idfObject.setDouble(SolarCollectorPerformance_FlatPlateFields::GrossArea, modelObject.grossArea()); |
| 30 | |||
| 31 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | idfObject.setString(SolarCollectorPerformance_FlatPlateFields::TestFluid, modelObject.testFluid()); |
| 32 | |||
| 33 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | idfObject.setDouble(SolarCollectorPerformance_FlatPlateFields::TestFlowRate, modelObject.testFlowRate()); |
| 34 | |||
| 35 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | idfObject.setString(SolarCollectorPerformance_FlatPlateFields::TestCorrelationType, modelObject.testCorrelationType()); |
| 36 | |||
| 37 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | idfObject.setDouble(SolarCollectorPerformance_FlatPlateFields::Coefficient1ofEfficiencyEquation, modelObject.coefficient1ofEfficiencyEquation()); |
| 38 | |||
| 39 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | idfObject.setDouble(SolarCollectorPerformance_FlatPlateFields::Coefficient2ofEfficiencyEquation, modelObject.coefficient2ofEfficiencyEquation()); |
| 40 | |||
| 41 |
1/1✓ Branch 1 taken 1 time.
|
1 | d = modelObject.coefficient3ofEfficiencyEquation(); |
| 42 |
1/2✗ Branch 0 not taken.
✓ Branch 1 taken 1 time.
|
1 | if (d) { |
| 43 | ✗ | idfObject.setDouble(SolarCollectorPerformance_FlatPlateFields::Coefficient3ofEfficiencyEquation, *d); | |
| 44 | } | ||
| 45 | |||
| 46 |
1/1✓ Branch 1 taken 1 time.
|
1 | d = modelObject.coefficient2ofIncidentAngleModifier(); |
| 47 |
1/2✓ Branch 0 taken 1 time.
✗ Branch 1 not taken.
|
1 | if (d) { |
| 48 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | idfObject.setDouble(SolarCollectorPerformance_FlatPlateFields::Coefficient2ofIncidentAngleModifier, *d); |
| 49 | } | ||
| 50 | |||
| 51 |
1/1✓ Branch 1 taken 1 time.
|
1 | d = modelObject.coefficient3ofIncidentAngleModifier(); |
| 52 |
1/2✓ Branch 0 taken 1 time.
✗ Branch 1 not taken.
|
1 | if (d) { |
| 53 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | idfObject.setDouble(SolarCollectorPerformance_FlatPlateFields::Coefficient3ofIncidentAngleModifier, *d); |
| 54 | } | ||
| 55 | |||
| 56 |
1/1✓ Branch 1 taken 1 time.
|
2 | return idfObject; |
| 57 | 1 | } | |
| 58 | |||
| 59 | } // namespace energyplus | ||
| 60 | |||
| 61 | } // namespace openstudio | ||
| 62 |