src/energyplus/ForwardTranslator/ForwardTranslateCurveFunctionalPressureDrop.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/CurveFunctionalPressureDrop.hpp" | ||
| 9 | #include "../../model/CurveFunctionalPressureDrop_Impl.hpp" | ||
| 10 | |||
| 11 | #include "../../utilities/core/Assert.hpp" | ||
| 12 | |||
| 13 | #include <utilities/idd/Curve_Functional_PressureDrop_FieldEnums.hxx> | ||
| 14 | #include <utilities/idd/IddEnums.hxx> | ||
| 15 | |||
| 16 | using namespace openstudio::model; | ||
| 17 | using namespace std; | ||
| 18 | |||
| 19 | namespace openstudio { | ||
| 20 | namespace energyplus { | ||
| 21 | |||
| 22 | ✗ | boost::optional<IdfObject> ForwardTranslator::translateCurveFunctionalPressureDrop(CurveFunctionalPressureDrop& modelObject) { | |
| 23 | ✗ | IdfObject idfObject(IddObjectType::Curve_Functional_PressureDrop); | |
| 24 | |||
| 25 | ✗ | m_idfObjects.push_back(idfObject); | |
| 26 | |||
| 27 | ✗ | OptionalString s; | |
| 28 | ✗ | OptionalDouble d; | |
| 29 | |||
| 30 | ✗ | if ((s = modelObject.name())) { | |
| 31 | ✗ | idfObject.setName(*s); | |
| 32 | } | ||
| 33 | |||
| 34 | ✗ | idfObject.setDouble(Curve_Functional_PressureDropFields::Diameter, modelObject.diameter()); | |
| 35 | ✗ | if ((d = modelObject.minorLossCoefficient())) { | |
| 36 | ✗ | idfObject.setDouble(Curve_Functional_PressureDropFields::MinorLossCoefficient, *d); | |
| 37 | } | ||
| 38 | ✗ | if ((d = modelObject.length())) { | |
| 39 | ✗ | idfObject.setDouble(Curve_Functional_PressureDropFields::Length, *d); | |
| 40 | } | ||
| 41 | ✗ | if ((d = modelObject.roughness())) { | |
| 42 | ✗ | idfObject.setDouble(Curve_Functional_PressureDropFields::Roughness, *d); | |
| 43 | } | ||
| 44 | ✗ | if ((d = modelObject.fixedFrictionFactor())) { | |
| 45 | ✗ | idfObject.setDouble(Curve_Functional_PressureDropFields::FixedFrictionFactor, *d); | |
| 46 | } | ||
| 47 | |||
| 48 | ✗ | return idfObject; | |
| 49 | ✗ | } | |
| 50 | |||
| 51 | } // namespace energyplus | ||
| 52 | } // namespace openstudio | ||
| 53 |