test/ssc_test/cmod_windpower_test.cpp
/// Icing and Low Temp Cutoff, with Wind Resource Data
Icing and Low Temp Cutoff, with Wind Resource Data
Icing and Low Temp Cutoff with Wind Resource Data
TEST_F(CMWindPowerIntegration, IcingAndLowTempCutoff_cmod_windpower) {
	ssc_data_unassign(data, "wind_resource_filename");
	var_data* windresourcedata = create_winddata_array(1,1);
	double rh[8760];
	for (unsigned int i = 0; i < 8760; i++) {
		if (i % 2 == 0) rh[i] = 0.75f;
		else rh[i] = 0.0f;
	}
	var_data rh_vd = var_data(rh, 8760);
	windresourcedata->table.assign("rh", rh_vd);
	auto *vt = static_cast<var_table*>(data);
	vt->assign("wind_resource_data", *windresourcedata);
	vt->assign("en_low_temp_cutoff", 1);
	vt->assign("en_icing_cutoff", 1);
	vt->assign("low_temp_cutoff", 40.f);
	vt->assign("icing_cutoff_temp", 55.f);
	vt->assign("icing_cutoff_rh", 0.70f);
	compute();
	ssc_number_t annual_energy;
	ssc_data_get_number(data, "annual_energy", &annual_energy);
	EXPECT_NEAR(annual_energy, 2110545, e) << "Reduced annual energy";
	ssc_number_t monthly_energy = ssc_data_get_array(data, "monthly_energy", nullptr)[0];
	EXPECT_NEAR(monthly_energy, 0, e);
	monthly_energy = ssc_data_get_array(data, "monthly_energy", nullptr)[11];
	EXPECT_NEAR(monthly_energy, 986114, e);
	ssc_number_t losses_percent;
	ssc_data_get_number(data, "cutoff_losses", &losses_percent);
	EXPECT_NEAR(losses_percent, 0.5, 0.01);
	free_winddata_array(windresourcedata);
}
TEST_F ( CMWindPowerIntegration , IcingAndLowTempCutoff_cmod_windpower ) { ssc_data_unassign ( data , " " ) ; var_data * windresourcedata = create_winddata_array ( 1 , 1 ) ; double rh [ 8760 ] ; for ( unsigned int i = 0 ; i < 8760 ; i ++ ) { if ( i % 2 == 0 ) rh [ i ] = 0.75f ; else rh [ i ] = 0.0f ; } var_data rh_vd = var_data ( rh , 8760 ) ; windresourcedata -> table . assign ( " " , rh_vd ) ; auto * vt = static_cast < var_table * > ( data ) ; vt -> assign ( " " , * windresourcedata ) ; vt -> assign ( " " , 1 ) ; vt -> assign ( " " , 1 ) ; vt -> assign ( " " , 40.f ) ; vt -> assign ( " " , 55.f ) ; vt -> assign ( " " , 0.70f ) ; compute ( ) ; ssc_number_t annual_energy ; ssc_data_get_number ( data , " " , & annual_energy ) ; EXPECT_NEAR ( annual_energy , 2110545 , e ) << " " ; ssc_number_t monthly_energy = ssc_data_get_array ( data , " " , nullptr ) [ 0 ] ; EXPECT_NEAR ( monthly_energy , 0 , e ) ; monthly_energy = ssc_data_get_array ( data , " " , nullptr ) [ 11 ] ; EXPECT_NEAR ( monthly_energy , 986114 , e ) ; ssc_number_t losses_percent ; ssc_data_get_number ( data , " " , & losses_percent ) ; EXPECT_NEAR ( losses_percent , 0.5 , 0.01 ) ; free_winddata_array ( windresourcedata ) ; }
Icing and Low Temp Cutoff, with Wind Resource Data
Icing and Low Temp Cutoff with Wind Resource Data
//modify test inputs