Skip to content

Commit

Permalink
fixing rec_azimuth_opt for UI reporting
Browse files Browse the repository at this point in the history
  • Loading branch information
qualand committed Nov 6, 2024
1 parent 64d9bf0 commit ecdbbee
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
3 changes: 1 addition & 2 deletions solarpilot/AutoPilot_API.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -329,8 +329,7 @@ struct AutoOptHelper
vector<double> current;

//update the objective variables
for(int i=0; i<(int)m_opt_vars.size(); i++)
{
for(int i=0; i<(int)m_opt_vars.size(); i++) {
current.push_back( x[i] );
*m_opt_vars.at(i) = current.at(i)/* * m_normalizers.at(i)*/;
}
Expand Down
8 changes: 6 additions & 2 deletions ssc/cmod_solarpilot.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ static var_info _cm_vtab_solarpilot[] = {
{ SSC_OUTPUT, SSC_NUMBER, "rec_aspect_opt", "Optimized receiver aspect ratio", "-", "", "SolarPILOT", "receiver_type=0", "", "" },
{ SSC_OUTPUT, SSC_NUMBER, "cav_rec_aper_width_opt", "Optimized cavity receiver aperture width", "-", "", "SolarPILOT", "receiver_type=1", "", "" },
{ SSC_OUTPUT, SSC_NUMBER, "rec_width_opt", "Optimized receiver width", "m", "", "SolarPILOT", "receiver_type=3", "", "" },
{ SSC_OUTPUT, SSC_NUMBER, "rec_azimuth_opt", "Optimized receiver azimuth", "deg", "", "SolarPILOT", "receiver_type=3", "", "" },
{ SSC_OUTPUT, SSC_ARRAY, "rec_azimuth_opt", "Optimized receiver azimuth", "deg", "", "SolarPILOT", "receiver_type=3", "", "" },
{ SSC_OUTPUT, SSC_NUMBER, "flux_max_observed", "Maximum observed flux at design", "kW/m2", "", "SolarPILOT", "check_max_flux=1", "", "" },

{ SSC_OUTPUT, SSC_NUMBER, "cost_rec_tot", "Total receiver cost", "$", "", "SolarPILOT", "*", "", "" },
Expand Down Expand Up @@ -244,7 +244,11 @@ class cm_solarpilot : public compute_module
}
else if (rec_type == 3) { // free-falling receiver
assign("rec_width_opt", (ssc_number_t)spi.recs.front().rec_width.val);
assign("rec_azimuth_opt", (ssc_number_t)spi.recs.front().rec_azimuth.val);

ssc_number_t* rec_azi_opt = allocate("rec_azimuth_opt", spi.recs.size());
for (size_t i = 0; i < spi.recs.size(); i++) {
rec_azi_opt[i] = (ssc_number_t)spi.recs.at(i).rec_azimuth.val;
}
}

assign("h_tower_opt", (ssc_number_t)spi.sf.tht.val);
Expand Down
2 changes: 1 addition & 1 deletion ssc/csp_common.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -529,7 +529,7 @@ bool solarpilot_invoke::run(std::shared_ptr<weather_data_provider> wdata)
vector<double> step_size(nv);
vector<string> names(nv);

// NOTE: If variable order changes, update Simulate_fp_rec() within AutoPilot_API.cpp
// NOTE: If variable order changes, update update_fp_rec_dep_vars() within AutoPilot_API.cpp
//pointers
opt_vars.at(0) = &sf.tht.val;
opt_vars.at(1) = &recs.front().rec_height.val;
Expand Down

0 comments on commit ecdbbee

Please sign in to comment.