diff --git a/ssc/cmod_csp_tower_particle.cpp b/ssc/cmod_csp_tower_particle.cpp index 6c75a79b3..2415250a6 100644 --- a/ssc/cmod_csp_tower_particle.cpp +++ b/ssc/cmod_csp_tower_particle.cpp @@ -780,6 +780,7 @@ class cm_csp_tower_particle : public compute_module int n_flux_x = 10; // Number of points in the horizontal direction of flux surface // TODO (Bill): Make these user inputs, if Janna agrees // - n_flux_y must be greater than the number of troughs in the curtain + // - Add a limit to these values <= 50? if (field_model_type < 4) { // Field types 0-3 require solarPILOT @@ -801,8 +802,7 @@ class cm_csp_tower_particle : public compute_module assign("is_optimize", 0); // Turn-off heliostat layout and tower optimization assign("calc_fluxmaps", 1); // Include flux map calculations if (field_model_type == 0 && sim_type == 1) { // Optimize design field and tower/receiver geometry - // TODO (Bill): Test if optimization works... - // How receiver area being using in the objective function + // TODO (Bill): Update optimization if cost function change assign("is_optimize", 1); } else if (field_model_type == 3 || sim_type == 2) { @@ -845,22 +845,22 @@ class cm_csp_tower_particle : public compute_module spi.run(weather_reader.m_weather_data_provider); // Runs SolarPILOT //Optimization iteration history - if (field_model_type == 0) { // is optimize - vector > steps; - vector obj, flux; - spi.getOptimizationSimulationHistory(steps, obj, flux); - size_t nr = steps.size(); - if (nr > 0) { - size_t nc = steps.front().size() + 2; - ssc_number_t* ssc_hist = allocate("opt_history", nr, nc); // TODO (Bill): who owns "opt_history"? GUI? - for (size_t i = 0; i < nr; i++) { - for (size_t j = 0; j < steps.front().size(); j++) - ssc_hist[i * nc + j] = (ssc_number_t)steps.at(i).at(j); - ssc_hist[i * nc + nc - 2] = (ssc_number_t)obj.at(i); - ssc_hist[i * nc + nc - 1] = (ssc_number_t)flux.at(i); - } - } - } + //if (field_model_type == 0) { // is optimize + // vector > steps; + // vector obj, flux; + // spi.getOptimizationSimulationHistory(steps, obj, flux); + // size_t nr = steps.size(); + // if (nr > 0) { + // size_t nc = steps.front().size() + 2; + // ssc_number_t* ssc_hist = allocate("opt_history", nr, nc); // TODO (Bill): who owns "opt_history"? GUI? + // for (size_t i = 0; i < nr; i++) { + // for (size_t j = 0; j < steps.front().size(); j++) + // ssc_hist[i * nc + j] = (ssc_number_t)steps.at(i).at(j); + // ssc_hist[i * nc + nc - 2] = (ssc_number_t)obj.at(i); + // ssc_hist[i * nc + nc - 1] = (ssc_number_t)flux.at(i); + // } + // } + //} // Collect the optical efficiency and flux map data if (field_model_type <= 2) { @@ -919,7 +919,7 @@ class cm_csp_tower_particle : public compute_module // Need to specify: // 1) reflective area (scale flux map) // 2) number heliostats for heliostats (tracking parasitics) - // 3) total land area before radiative cooling + // 3) total land area // 4) tower and receiver dimensions N_hel = as_number("N_hel"); A_sf = as_number("A_sf_in"); //[m2] @@ -967,7 +967,6 @@ class cm_csp_tower_particle : public compute_module n_steps_fixed = steps_per_hour * (size_t)( (sim_setup.m_sim_time_end - sim_setup.m_sim_time_start)/3600. ); sim_setup.m_report_step = 3600.0 / (double)steps_per_hour; //[s] -#ifndef TESTING // *********************************************** // Power cycle // *********************************************** @@ -1061,17 +1060,12 @@ class cm_csp_tower_particle : public compute_module p_csp_power_cycle->assign(C_pc_Rankine_indirect_224::E_W_DOT_COOLER, allocate("P_cooling_tower_tot", n_steps_fixed), n_steps_fixed); p_csp_power_cycle->assign(C_pc_Rankine_indirect_224::E_P_COND, allocate("P_cond", n_steps_fixed), n_steps_fixed); p_csp_power_cycle->assign(C_pc_Rankine_indirect_224::E_P_COND_ITER_ERR, allocate("P_cond_iter_err", n_steps_fixed), n_steps_fixed); - p_csp_power_cycle->assign(C_pc_Rankine_indirect_224::E_ETA_THERMAL, allocate("eta", n_steps_fixed), n_steps_fixed); - - //// ********************************************************* - //// ********************************************************* - //// ********************************************************* - //// Now set Type 222 parameters - //// ********************************************************* - //// ********************************************************* - //// ********************************************************* +#ifndef TESTING + // ********************************************************* + // Receiver model + // ********************************************************* double A_rec = std::numeric_limits::quiet_NaN(); // TODO: This needs to be calculated @@ -2171,7 +2165,7 @@ class cm_csp_tower_particle : public compute_module for (size_t j = 0; j < rec_n_flux_y; j++) { // for all y flux positions idx = rec_n_flux_y * n_cols_flux_maps * i + n_cols_flux_maps * j; flux_maps_for_import[idx] = flux_maps_out[idx] = azi_angle; - flux_maps_for_import[idx] = flux_maps_out[idx + 1] = zen_angle; + flux_maps_for_import[idx + 1] = flux_maps_out[idx + 1] = zen_angle; size_t flux_map_row; for (size_t k = 2; k < n_cols_flux_maps; k++) { flux_map_row = rec_n_flux_y * i + j; diff --git a/ssc/cmod_tcsmolten_salt.cpp b/ssc/cmod_tcsmolten_salt.cpp index a24e0aa38..a2f3e7cdf 100644 --- a/ssc/cmod_tcsmolten_salt.cpp +++ b/ssc/cmod_tcsmolten_salt.cpp @@ -977,6 +977,7 @@ class cm_tcsmolten_salt : public compute_module if (is_optimize) { //Optimization iteration history + // TODO (Bill): who owns "opt_history"? GUI? It doesn't appear anywhere... vector > steps; vector obj, flux; spi.getOptimizationSimulationHistory(steps, obj, flux); @@ -984,7 +985,7 @@ class cm_tcsmolten_salt : public compute_module if (nr > 0) { size_t nc = steps.front().size() + 2; - ssc_number_t* ssc_hist = allocate("opt_history", nr, nc); + ssc_number_t* ssc_hist = allocate("opt_history", nr, nc); for (size_t i = 0; i < nr; i++) { for (size_t j = 0; j < steps.front().size(); j++) diff --git a/tcs/csp_solver_pt_sf_perf_interp.cpp b/tcs/csp_solver_pt_sf_perf_interp.cpp index b933d8651..0a57ad4a9 100644 --- a/tcs/csp_solver_pt_sf_perf_interp.cpp +++ b/tcs/csp_solver_pt_sf_perf_interp.cpp @@ -340,7 +340,7 @@ void C_pt_sf_perf_interp::call(const C_csp_weatherreader::S_outputs &weather, do for (int j = 0; j < m_n_flux_y; j++) { // for all flux y-points for (int i = 0; i < m_n_flux_x; i++) { // for all flux x-points - // scaling flux map to absolute power, Solarfield area * field efficiency * DNI / feceiver node area + // scaling flux map to absolute power, Solar field area * field efficiency * DNI / receiver node area ms_outputs.m_flux_map_out(j, i) *= ms_params.m_A_sf*eta_field/m_A_rec_flux_node*weather.m_beam*1.E-3; //[kW/m2] } } @@ -356,11 +356,11 @@ void C_pt_sf_perf_interp::call(const C_csp_weatherreader::S_outputs &weather, do void C_pt_sf_perf_interp::off(const C_csp_weatherreader::S_outputs& weather, const C_csp_solver_sim_info &sim_info) { - // Increase call-per-timestep counter + // Increase call-per-time step counter // Converge() sets it to -1, so on first call this line will adjust it = 0 m_ncall++; - // Get sim info + // Get simulation info double step = sim_info.ms_ts.m_step; m_is_field_tracking = false; diff --git a/tcs/ud_power_cycle.h b/tcs/ud_power_cycle.h index ac6ab74c8..09cd2a5d9 100644 --- a/tcs/ud_power_cycle.h +++ b/tcs/ud_power_cycle.h @@ -209,7 +209,7 @@ class C_ud_pc_table_generator double m_dot_htf_ND_ref /*-*/, double m_dot_htf_ND_low /*-*/, double m_dot_htf_ND_high /*-*/, int n_m_dot_htf_ND, util::matrix_t & T_htf_ind, util::matrix_t & T_amb_ind, util::matrix_t & m_dot_htf_ind); - // Callback funtion + // Callback function bool(*mf_callback)(std::string &log_msg, std::string &progress_msg, void *data, double progress, int out_type); void *mp_mf_active;