Skip to content

Commit

Permalink
syncing mjw SSC with SAM SSC
Browse files Browse the repository at this point in the history
  • Loading branch information
qualand committed Mar 7, 2024
1 parent fd4d6a2 commit 895948d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
8 changes: 4 additions & 4 deletions solarpilot/AutoPilot_API.cpp
Expand Up @@ -565,7 +565,7 @@ bool AutoPilot::Setup(var_map &V, bool /*for_optimize*/)
_SF->PrepareFieldLayout(*_SF, 0, true); //Run the layout method in refresh_only mode
Vect sun = Ambient::calcSunVectorFromAzZen( _SF->getVarMap()->sf.sun_az_des.Val()*D2R, (90. - _SF->getVarMap()->sf.sun_el_des.Val())*D2R );
_SF->calcHeliostatShadows(sun);
double area = V.land.land_area.Val(); //acre -> TODO (Bill) why is this here?
double area = V.land.land_area.Val(); //acre
V.land.bound_area.Setval( area );
V.land.land_area.Setval( area );
}
Expand Down Expand Up @@ -609,7 +609,7 @@ void AutoPilot::GenerateDesignPointSimulations(var_map &V, vector<string> &wdata
1.., 0.., 1-12, W/m2, C, bar, m/s
*/
#ifdef _DEBUG
interop::GenerateSimulationWeatherData(V, var_solarfield::DES_SIM_DETAIL::SINGLE_SIMULATION_POINT, wdata);
interop::GenerateSimulationWeatherData(V, var_solarfield::DES_SIM_DETAIL::SINGLE_SIMULATION_POINT, wdata); // Reduces number of cases to run in debug
#else
interop::GenerateSimulationWeatherData(V, -1, wdata);
#endif
Expand Down Expand Up @@ -740,9 +740,9 @@ void AutoPilot::PrepareFluxSimulation(sp_flux_table &fluxtab, int flux_res_x, in
fluxtab.flux_surfaces.resize(nsurftot);
//resize the flux surfaces to match the flux data and the number of annual simulation positions
for (int i = 0; i < (int)_SF->getReceivers()->size(); i++) {//for all receivers
for (int j = 0; j < (int)_SF->getReceivers()->at(i)->getFluxSurfaces()->size(); j++) {//for all receiver
for (int j = 0; j < (int)_SF->getReceivers()->at(i)->getFluxSurfaces()->size(); j++) {//for all receiver flux surfaces
FluxSurface *fs = &_SF->getReceivers()->at(i)->getFluxSurfaces()->at(j);
fluxtab.flux_surfaces.at(i+j).flux_data.resize(fs->getFluxNY(), fs->getFluxNX(), nflux_sim); // TODO (Bill): why is the resizing here?
fluxtab.flux_surfaces.at(i+j).flux_data.resize(fs->getFluxNY(), fs->getFluxNX(), nflux_sim);
}
}
}
Expand Down
5 changes: 2 additions & 3 deletions solarpilot/SolarField.cpp
Expand Up @@ -1010,9 +1010,8 @@ bool SolarField::CheckReceiverAcceptance(Receiver* Rec, sp_point *hpos, double t
acc_x *= 0.5;
acc_y *= 0.5;
if (Rv->accept_ang_type.mapval() == var_receiver::ACCEPT_ANG_TYPE::RECTANGULAR //Rectangular
|| rectype == var_receiver::REC_TYPE::EXTERNAL_CYLINDRICAL) //or, if this is a cylindrical receiver (no elliptical view from cylinder)
{
if (std::abs(theta_x) < acc_x && std::abs(theta_y) < acc_y)
|| rectype == var_receiver::REC_TYPE::EXTERNAL_CYLINDRICAL) { //or, if this is a cylindrical receiver (no elliptical view from cylinder)
if (std::abs(theta_x) <= acc_x + 1.e-6 && std::abs(theta_y) <= acc_y + 1.e-6)
return true;
}
else { //Elliptical
Expand Down

0 comments on commit 895948d

Please sign in to comment.