CoilHeatingDXMultiSpeed::CoilHeatingDXMultiSpeed(const Model& model)
  : StraightComponent(CoilHeatingDXMultiSpeed::iddObjectType(),model)
{
  OS_ASSERT(getImpl<detail::CoilHeatingDXMultiSpeed_Impl>());

  bool ok = true;
  auto always_on = model.alwaysOnDiscreteSchedule();
  ok = setAvailabilitySchedule( always_on );
  OS_ASSERT(ok);
  setMinimumOutdoorDryBulbTemperatureforCompressorOperation(-8.0);
  ok = setCrankcaseHeaterCapacity(0.0);
  OS_ASSERT(ok);
  ok = setMaximumOutdoorDryBulbTemperatureforCrankcaseHeaterOperation(10.0);
  OS_ASSERT(ok);
  ok = setMaximumOutdoorDryBulbTemperatureforDefrostOperation(5.0);
  OS_ASSERT(ok);
  ok = setDefrostStrategy("Resistive");
  OS_ASSERT(ok);
  ok = setDefrostControl("OnDemand");
  OS_ASSERT(ok);
  ok = setDefrostTimePeriodFraction(0.058333);
  OS_ASSERT(ok);
  autosizeResistiveDefrostHeaterCapacity();
  setApplyPartLoadFractiontoSpeedsGreaterthan1(false);
  ok = setFuelType("NaturalGas");
  OS_ASSERT(ok);
  ok = setRegionnumberforCalculatingHSPF(4);
  OS_ASSERT(ok);

  auto stageDataList = ModelObjectList(model);
  stageDataList.setName(this->name().get() + " Stage Data List");
  ok = getImpl<detail::CoilHeatingDXMultiSpeed_Impl>()->setStageDataList(stageDataList);
  OS_ASSERT(ok);

}
CoilCoolingDXMultiSpeed::CoilCoolingDXMultiSpeed(const Model& model)
    : StraightComponent(CoilCoolingDXMultiSpeed::iddObjectType(),model)
{
    OS_ASSERT(getImpl<detail::CoilCoolingDXMultiSpeed_Impl>());

    setCondenserType("AirCooled");
    setApplyPartLoadFractiontoSpeedsGreaterthan1(false);
    setCrankcaseHeaterCapacity(0.0);
    setMaximumOutdoorDryBulbTemperatureforCrankcaseHeaterOperation(10.0);
    setBasinHeaterCapacity(0.0);
    setBasinHeaterSetpointTemperature(2.0);
    setFuelType("NaturalGas");
}
CoilCoolingDXTwoStageWithHumidityControlMode::CoilCoolingDXTwoStageWithHumidityControlMode(const Model& model)
  : StraightComponent(CoilCoolingDXTwoStageWithHumidityControlMode::iddObjectType(),model)
{
  OS_ASSERT(getImpl<detail::CoilCoolingDXTwoStageWithHumidityControlMode_Impl>());

  setNumberofCapacityStages(2);
  setNumberofEnhancedDehumidificationModes(1);
  setCrankcaseHeaterCapacity(0.0);
  setMaximumOutdoorDryBulbTemperatureforCrankcaseHeaterOperation(10.0);
  setBasinHeaterCapacity(0.0);
  setBasinHeaterSetpointTemperature(2.0);

  {
    CurveBiquadratic totalCoolingCapacityFunctionofTemperatureCurve(model);
    totalCoolingCapacityFunctionofTemperatureCurve.setCoefficient1Constant(1.067939449);
    totalCoolingCapacityFunctionofTemperatureCurve.setCoefficient2x(-0.031261829);
    totalCoolingCapacityFunctionofTemperatureCurve.setCoefficient3xPOW2(0.001974308);
    totalCoolingCapacityFunctionofTemperatureCurve.setCoefficient4y(-0.002726426);
    totalCoolingCapacityFunctionofTemperatureCurve.setCoefficient5yPOW2(-5.52654E-05);
    totalCoolingCapacityFunctionofTemperatureCurve.setCoefficient6xTIMESY(-6.31169E-05);
    totalCoolingCapacityFunctionofTemperatureCurve.setMinimumValueofx(-100);
    totalCoolingCapacityFunctionofTemperatureCurve.setMaximumValueofx(100);
    totalCoolingCapacityFunctionofTemperatureCurve.setMinimumValueofy(-100);
    totalCoolingCapacityFunctionofTemperatureCurve.setMaximumValueofy(100);

    CurveQuadratic totalCoolingCapacityFunctionofFlowFractionCurve(model);
    totalCoolingCapacityFunctionofFlowFractionCurve.setCoefficient1Constant(0.8);
    totalCoolingCapacityFunctionofFlowFractionCurve.setCoefficient2x(0.2);
    totalCoolingCapacityFunctionofFlowFractionCurve.setCoefficient3xPOW2(0.0);
    totalCoolingCapacityFunctionofFlowFractionCurve.setMinimumValueofx(0.5);
    totalCoolingCapacityFunctionofFlowFractionCurve.setMaximumValueofx(1.5);

    CurveBiquadratic energyInputRatioFunctionofTemperatureCurve(model);
    energyInputRatioFunctionofTemperatureCurve.setCoefficient1Constant(0.174059889);
    energyInputRatioFunctionofTemperatureCurve.setCoefficient2x(0.022281508);
    energyInputRatioFunctionofTemperatureCurve.setCoefficient3xPOW2(-0.000134077);
    energyInputRatioFunctionofTemperatureCurve.setCoefficient4y(0.028298025);
    energyInputRatioFunctionofTemperatureCurve.setCoefficient5yPOW2(0.00048510);
    energyInputRatioFunctionofTemperatureCurve.setCoefficient6xTIMESY(-0.001677095);
    energyInputRatioFunctionofTemperatureCurve.setMinimumValueofx(-100);
    energyInputRatioFunctionofTemperatureCurve.setMaximumValueofx(100);
    energyInputRatioFunctionofTemperatureCurve.setMinimumValueofy(-100);
    energyInputRatioFunctionofTemperatureCurve.setMaximumValueofy(100);

    CurveQuadratic energyInputRatioFunctionofFlowFractionCurve(model);
    energyInputRatioFunctionofFlowFractionCurve.setCoefficient1Constant(1.1552);
    energyInputRatioFunctionofFlowFractionCurve.setCoefficient2x(-0.1808);
    energyInputRatioFunctionofFlowFractionCurve.setCoefficient3xPOW2(0.0256);
    energyInputRatioFunctionofFlowFractionCurve.setMinimumValueofx(0.5);
    energyInputRatioFunctionofFlowFractionCurve.setMaximumValueofx(1.5);

    CurveQuadratic partLoadFractionCorrelationCurve(model);
    partLoadFractionCorrelationCurve.setCoefficient1Constant(0.85);
    partLoadFractionCorrelationCurve.setCoefficient2x(0.15);
    partLoadFractionCorrelationCurve.setCoefficient3xPOW2(0.0);
    partLoadFractionCorrelationCurve.setMinimumValueofx(0.0);
    partLoadFractionCorrelationCurve.setMaximumValueofx(1.0);

    CoilPerformanceDXCooling coilPerformanceDXCooling(model,
      totalCoolingCapacityFunctionofTemperatureCurve,
      totalCoolingCapacityFunctionofFlowFractionCurve,
      energyInputRatioFunctionofTemperatureCurve,
      energyInputRatioFunctionofFlowFractionCurve,
      partLoadFractionCorrelationCurve);

    coilPerformanceDXCooling.setGrossRatedCoolingCOP(3.0);
    coilPerformanceDXCooling.setFractionofAirFlowBypassedAroundCoil(0.5);

    setNormalModeStage1CoilPerformance(coilPerformanceDXCooling);
  }

  {
    CurveBiquadratic totalCoolingCapacityFunctionofTemperatureCurve(model);
    totalCoolingCapacityFunctionofTemperatureCurve.setCoefficient1Constant(1.067939449);
    totalCoolingCapacityFunctionofTemperatureCurve.setCoefficient2x(-0.031261829);
    totalCoolingCapacityFunctionofTemperatureCurve.setCoefficient3xPOW2(0.001974308);
    totalCoolingCapacityFunctionofTemperatureCurve.setCoefficient4y(-0.002726426);
    totalCoolingCapacityFunctionofTemperatureCurve.setCoefficient5yPOW2(-5.52654E-05);
    totalCoolingCapacityFunctionofTemperatureCurve.setCoefficient6xTIMESY(-6.31169E-05);
    totalCoolingCapacityFunctionofTemperatureCurve.setMinimumValueofx(-100);
    totalCoolingCapacityFunctionofTemperatureCurve.setMaximumValueofx(100);
    totalCoolingCapacityFunctionofTemperatureCurve.setMinimumValueofy(-100);
    totalCoolingCapacityFunctionofTemperatureCurve.setMaximumValueofy(100);

    CurveQuadratic totalCoolingCapacityFunctionofFlowFractionCurve(model);
    totalCoolingCapacityFunctionofFlowFractionCurve.setCoefficient1Constant(0.8);
    totalCoolingCapacityFunctionofFlowFractionCurve.setCoefficient2x(0.2);
    totalCoolingCapacityFunctionofFlowFractionCurve.setCoefficient3xPOW2(0.0);
    totalCoolingCapacityFunctionofFlowFractionCurve.setMinimumValueofx(0.5);
    totalCoolingCapacityFunctionofFlowFractionCurve.setMaximumValueofx(1.5);

    CurveBiquadratic energyInputRatioFunctionofTemperatureCurve(model);
    energyInputRatioFunctionofTemperatureCurve.setCoefficient1Constant(0.174059889);
    energyInputRatioFunctionofTemperatureCurve.setCoefficient2x(0.022281508);
    energyInputRatioFunctionofTemperatureCurve.setCoefficient3xPOW2(-0.000134077);
    energyInputRatioFunctionofTemperatureCurve.setCoefficient4y(0.028298025);
    energyInputRatioFunctionofTemperatureCurve.setCoefficient5yPOW2(0.00048510);
    energyInputRatioFunctionofTemperatureCurve.setCoefficient6xTIMESY(-0.001677095);
    energyInputRatioFunctionofTemperatureCurve.setMinimumValueofx(-100);
    energyInputRatioFunctionofTemperatureCurve.setMaximumValueofx(100);
    energyInputRatioFunctionofTemperatureCurve.setMinimumValueofy(-100);
    energyInputRatioFunctionofTemperatureCurve.setMaximumValueofy(100);

    CurveQuadratic energyInputRatioFunctionofFlowFractionCurve(model);
    energyInputRatioFunctionofFlowFractionCurve.setCoefficient1Constant(1.1552);
    energyInputRatioFunctionofFlowFractionCurve.setCoefficient2x(-0.1808);
    energyInputRatioFunctionofFlowFractionCurve.setCoefficient3xPOW2(0.0256);
    energyInputRatioFunctionofFlowFractionCurve.setMinimumValueofx(0.5);
    energyInputRatioFunctionofFlowFractionCurve.setMaximumValueofx(1.5);

    CurveQuadratic partLoadFractionCorrelationCurve(model);
    partLoadFractionCorrelationCurve.setCoefficient1Constant(0.85);
    partLoadFractionCorrelationCurve.setCoefficient2x(0.15);
    partLoadFractionCorrelationCurve.setCoefficient3xPOW2(0.0);
    partLoadFractionCorrelationCurve.setMinimumValueofx(0.0);
    partLoadFractionCorrelationCurve.setMaximumValueofx(1.0);

    CoilPerformanceDXCooling coilPerformanceDXCooling(model,
      totalCoolingCapacityFunctionofTemperatureCurve,
      totalCoolingCapacityFunctionofFlowFractionCurve,
      energyInputRatioFunctionofTemperatureCurve,
      energyInputRatioFunctionofFlowFractionCurve,
      partLoadFractionCorrelationCurve);

    coilPerformanceDXCooling.setGrossRatedCoolingCOP(3.0);
    coilPerformanceDXCooling.setFractionofAirFlowBypassedAroundCoil(0.0);

    setNormalModeStage1Plus2CoilPerformance(coilPerformanceDXCooling);
  }

  {
    CurveBiquadratic totalCoolingCapacityFunctionofTemperatureCurve(model);
    totalCoolingCapacityFunctionofTemperatureCurve.setCoefficient1Constant(0.596779741);
    totalCoolingCapacityFunctionofTemperatureCurve.setCoefficient2x(0.034216637);
    totalCoolingCapacityFunctionofTemperatureCurve.setCoefficient3xPOW2(0.000113924);
    totalCoolingCapacityFunctionofTemperatureCurve.setCoefficient4y(-0.00375859);
    totalCoolingCapacityFunctionofTemperatureCurve.setCoefficient5yPOW2(-9.17495E-05);
    totalCoolingCapacityFunctionofTemperatureCurve.setCoefficient6xTIMESY(-8.98373E-05);
    totalCoolingCapacityFunctionofTemperatureCurve.setMinimumValueofx(-100);
    totalCoolingCapacityFunctionofTemperatureCurve.setMaximumValueofx(100);
    totalCoolingCapacityFunctionofTemperatureCurve.setMinimumValueofy(-100);
    totalCoolingCapacityFunctionofTemperatureCurve.setMaximumValueofy(100);

    CurveQuadratic totalCoolingCapacityFunctionofFlowFractionCurve(model);
    totalCoolingCapacityFunctionofFlowFractionCurve.setCoefficient1Constant(0.8);
    totalCoolingCapacityFunctionofFlowFractionCurve.setCoefficient2x(0.2);
    totalCoolingCapacityFunctionofFlowFractionCurve.setCoefficient3xPOW2(0.0);
    totalCoolingCapacityFunctionofFlowFractionCurve.setMinimumValueofx(0.5);
    totalCoolingCapacityFunctionofFlowFractionCurve.setMaximumValueofx(1.5);

    CurveBiquadratic energyInputRatioFunctionofTemperatureCurve(model);
    energyInputRatioFunctionofTemperatureCurve.setCoefficient1Constant(0.435347586);
    energyInputRatioFunctionofTemperatureCurve.setCoefficient2x(0.004015641);
    energyInputRatioFunctionofTemperatureCurve.setCoefficient3xPOW2(0.000604235);
    energyInputRatioFunctionofTemperatureCurve.setCoefficient4y(0.015824043);
    energyInputRatioFunctionofTemperatureCurve.setCoefficient5yPOW2(0.000747287);
    energyInputRatioFunctionofTemperatureCurve.setCoefficient6xTIMESY(-0.001779745);
    energyInputRatioFunctionofTemperatureCurve.setMinimumValueofx(-100);
    energyInputRatioFunctionofTemperatureCurve.setMaximumValueofx(100);
    energyInputRatioFunctionofTemperatureCurve.setMinimumValueofy(-100);
    energyInputRatioFunctionofTemperatureCurve.setMaximumValueofy(100);

    CurveQuadratic energyInputRatioFunctionofFlowFractionCurve(model);
    energyInputRatioFunctionofFlowFractionCurve.setCoefficient1Constant(1.1552);
    energyInputRatioFunctionofFlowFractionCurve.setCoefficient2x(-0.1808);
    energyInputRatioFunctionofFlowFractionCurve.setCoefficient3xPOW2(0.0256);
    energyInputRatioFunctionofFlowFractionCurve.setMinimumValueofx(0.5);
    energyInputRatioFunctionofFlowFractionCurve.setMaximumValueofx(1.5);

    CurveQuadratic partLoadFractionCorrelationCurve(model);
    partLoadFractionCorrelationCurve.setCoefficient1Constant(0.85);
    partLoadFractionCorrelationCurve.setCoefficient2x(0.15);
    partLoadFractionCorrelationCurve.setCoefficient3xPOW2(0.0);
    partLoadFractionCorrelationCurve.setMinimumValueofx(0.0);
    partLoadFractionCorrelationCurve.setMaximumValueofx(1.0);


    CoilPerformanceDXCooling coilPerformanceDXCooling(model,
      totalCoolingCapacityFunctionofTemperatureCurve,
      totalCoolingCapacityFunctionofFlowFractionCurve,
      energyInputRatioFunctionofTemperatureCurve,
      energyInputRatioFunctionofFlowFractionCurve,
      partLoadFractionCorrelationCurve);

    coilPerformanceDXCooling.setGrossRatedCoolingCOP(2.7);
    coilPerformanceDXCooling.setFractionofAirFlowBypassedAroundCoil(0.5); 

    setDehumidificationMode1Stage1CoilPerformance(coilPerformanceDXCooling);
  }

  {
    CurveBiquadratic totalCoolingCapacityFunctionofTemperatureCurve(model);
    totalCoolingCapacityFunctionofTemperatureCurve.setCoefficient1Constant(0.596779741);
    totalCoolingCapacityFunctionofTemperatureCurve.setCoefficient2x(0.034216637);
    totalCoolingCapacityFunctionofTemperatureCurve.setCoefficient3xPOW2(0.000113924);
    totalCoolingCapacityFunctionofTemperatureCurve.setCoefficient4y(-0.00375859);
    totalCoolingCapacityFunctionofTemperatureCurve.setCoefficient5yPOW2(-9.17495E-05);
    totalCoolingCapacityFunctionofTemperatureCurve.setCoefficient6xTIMESY(-8.98373E-05);
    totalCoolingCapacityFunctionofTemperatureCurve.setMinimumValueofx(-100);
    totalCoolingCapacityFunctionofTemperatureCurve.setMaximumValueofx(100);
    totalCoolingCapacityFunctionofTemperatureCurve.setMinimumValueofy(-100);
    totalCoolingCapacityFunctionofTemperatureCurve.setMaximumValueofy(100);

    CurveQuadratic totalCoolingCapacityFunctionofFlowFractionCurve(model);
    totalCoolingCapacityFunctionofFlowFractionCurve.setCoefficient1Constant(0.8);
    totalCoolingCapacityFunctionofFlowFractionCurve.setCoefficient2x(0.2);
    totalCoolingCapacityFunctionofFlowFractionCurve.setCoefficient3xPOW2(0.0);
    totalCoolingCapacityFunctionofFlowFractionCurve.setMinimumValueofx(0.5);
    totalCoolingCapacityFunctionofFlowFractionCurve.setMaximumValueofx(1.5);

    CurveBiquadratic energyInputRatioFunctionofTemperatureCurve(model);
    energyInputRatioFunctionofTemperatureCurve.setCoefficient1Constant(0.435347586);
    energyInputRatioFunctionofTemperatureCurve.setCoefficient2x(0.004015641);
    energyInputRatioFunctionofTemperatureCurve.setCoefficient3xPOW2(0.000604235);
    energyInputRatioFunctionofTemperatureCurve.setCoefficient4y(0.015824043);
    energyInputRatioFunctionofTemperatureCurve.setCoefficient5yPOW2(0.000747287);
    energyInputRatioFunctionofTemperatureCurve.setCoefficient6xTIMESY(-0.001779745);
    energyInputRatioFunctionofTemperatureCurve.setMinimumValueofx(-100);
    energyInputRatioFunctionofTemperatureCurve.setMaximumValueofx(100);
    energyInputRatioFunctionofTemperatureCurve.setMinimumValueofy(-100);
    energyInputRatioFunctionofTemperatureCurve.setMaximumValueofy(100);

    CurveQuadratic energyInputRatioFunctionofFlowFractionCurve(model);
    energyInputRatioFunctionofFlowFractionCurve.setCoefficient1Constant(1.1552);
    energyInputRatioFunctionofFlowFractionCurve.setCoefficient2x(-0.1808);
    energyInputRatioFunctionofFlowFractionCurve.setCoefficient3xPOW2(0.0256);
    energyInputRatioFunctionofFlowFractionCurve.setMinimumValueofx(0.5);
    energyInputRatioFunctionofFlowFractionCurve.setMaximumValueofx(1.5);

    CurveQuadratic partLoadFractionCorrelationCurve(model);
    partLoadFractionCorrelationCurve.setCoefficient1Constant(0.85);
    partLoadFractionCorrelationCurve.setCoefficient2x(0.15);
    partLoadFractionCorrelationCurve.setCoefficient3xPOW2(0.0);
    partLoadFractionCorrelationCurve.setMinimumValueofx(0.0);
    partLoadFractionCorrelationCurve.setMaximumValueofx(1.0);


    CoilPerformanceDXCooling coilPerformanceDXCooling(model,
      totalCoolingCapacityFunctionofTemperatureCurve,
      totalCoolingCapacityFunctionofFlowFractionCurve,
      energyInputRatioFunctionofTemperatureCurve,
      energyInputRatioFunctionofFlowFractionCurve,
      partLoadFractionCorrelationCurve);

    coilPerformanceDXCooling.setGrossRatedCoolingCOP(2.7);
    coilPerformanceDXCooling.setFractionofAirFlowBypassedAroundCoil(0.0); 

    setDehumidificationMode1Stage1Plus2CoilPerformance(coilPerformanceDXCooling);
  }
}
CoilWaterHeatingAirToWaterHeatPumpWrapped::CoilWaterHeatingAirToWaterHeatPumpWrapped(const Model& model)
  : ModelObject(CoilWaterHeatingAirToWaterHeatPumpWrapped::iddObjectType(),model)
{
  OS_ASSERT(getImpl<detail::CoilWaterHeatingAirToWaterHeatPumpWrapped_Impl>());

  setRatedHeatingCapacity(2349.6);
  setRatedCOP(2.4);
  setRatedSensibleHeatRatio(0.981);
  setRatedEvaporatorInletAirDryBulbTemperature(19.72);
  setRatedEvaporatorInletAirWetBulbTemperature(13.5);
  setRatedCondenserWaterTemperature(48.89);
  setRatedEvaporatorAirFlowRate(0.189);
  setEvaporatorFanPowerIncludedinRatedCOP(true);
  setCrankcaseHeaterCapacity(0.0);
  setMaximumAmbientTemperatureforCrankcaseHeaterOperation(10.0);
  setEvaporatorAirTemperatureTypeforCurveObjects("WetBulbTemperature");

  {
    CurveBiquadratic curve(model);
    curve.setName("HPWH-Htg-Cap-fT");
    curve.setCoefficient1Constant(0.563);
    curve.setCoefficient2x(0.0437);
    curve.setCoefficient3xPOW2(0.000039);
    curve.setCoefficient4y(0.0055);
    curve.setCoefficient5yPOW2(-.000148);
    curve.setCoefficient6xTIMESY(-.000145);
    curve.setMinimumValueofx(0);
    curve.setMaximumValueofx(100);
    curve.setMinimumValueofy(0);
    curve.setMaximumValueofy(100);
    curve.setMinimumCurveOutput(0);

    setHeatingCapacityFunctionofTemperatureCurve(curve);
  }

  {
    CurveCubic curve(model);
    curve.setName("HPWH-Htg-Cap-FF");
    curve.setCoefficient1Constant(1.0);
    curve.setCoefficient2x(0.0);
    curve.setCoefficient3xPOW2(0.0);
    curve.setCoefficient4xPOW3(0.0);
    curve.setMinimumValueofx(0);
    curve.setMaximumValueofx(100);

    setHeatingCapacityFunctionofAirFlowFractionCurve(curve);
  }

  {
    CurveBiquadratic curve(model);
    curve.setName("HPWH-Htg-COP-fT");
    curve.setCoefficient1Constant(1.1332);
    curve.setCoefficient2x(0.063);
    curve.setCoefficient3xPOW2(-.0000979);
    curve.setCoefficient4y(-.00972);
    curve.setCoefficient5yPOW2(-.0000214);
    curve.setCoefficient6xTIMESY(-.000686);
    curve.setMinimumValueofx(0);
    curve.setMaximumValueofx(100);
    curve.setMinimumValueofy(0);
    curve.setMaximumValueofy(100);

    setHeatingCOPFunctionofTemperatureCurve(curve);
  }

  {
    CurveCubic curve(model);
    curve.setName("HPWH-Htg-COP-FF");
    curve.setCoefficient1Constant(1.0);
    curve.setCoefficient2x(0.0);
    curve.setCoefficient3xPOW2(0.0);
    curve.setCoefficient4xPOW3(0.0);
    curve.setMinimumValueofx(0);
    curve.setMaximumValueofx(100);

    setHeatingCOPFunctionofAirFlowFractionCurve(curve);
  }

  {
    CurveCubic curve(model);
    curve.setName("HPWH-COP-fPLR");
    curve.setCoefficient1Constant(1);
    curve.setCoefficient2x(0);
    curve.setCoefficient3xPOW2(0);
    curve.setCoefficient4xPOW3(0);
    curve.setMinimumValueofx(0);
    curve.setMaximumValueofx(1);

    setPartLoadFractionCorrelationCurve(curve);
  }
}