Skip to content

Commit

Permalink
Update heatmaps for all iph technologies
Browse files Browse the repository at this point in the history
  • Loading branch information
sjanzou committed Oct 31, 2024
1 parent 5e77079 commit afa33b9
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 9 deletions.
2 changes: 1 addition & 1 deletion ssc/cmod_fresnel_physical_iph.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1625,7 +1625,7 @@ class cm_fresnel_physical_iph : public compute_module

// Do unit post-processing here

ssc_number_t* p_annual_energy_dist_time = gen_heatmap(this, steps_per_hour);
ssc_number_t* p_annual_energy_dist_time = gen_heatmap(this, steps_per_hour, true);
// Non-timeseries array outputs
double P_adj = storage.P_in_des; // slightly adjust all field design pressures to account for pressure drop in TES before hot tank
transform(c_fresnel.m_P_rnr_dsn.begin(), c_fresnel.m_P_rnr_dsn.end(), c_fresnel.m_P_rnr_dsn.begin(), [P_adj](double x) {return x + P_adj; });
Expand Down
4 changes: 2 additions & 2 deletions ssc/cmod_linear_fresnel_dsg_iph.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ class cm_linear_fresnel_dsg_iph : public compute_module
{
add_var_info(_cm_vtab_linear_fresnel_dsg_iph);
add_var_info(vtab_adjustment_factors);
//add_var_info(vtab_technology_outputs);
add_var_info(vtab_technology_outputs);
}

void exec( )
Expand Down Expand Up @@ -630,7 +630,7 @@ class cm_linear_fresnel_dsg_iph : public compute_module
p_load[i] = p_W_dot_par_tot_haf[i];
}

ssc_number_t* p_annual_energy_dist_time = gen_heatmap(this, steps_per_hour);
ssc_number_t* p_annual_energy_dist_time = gen_heatmap(this, steps_per_hour, true);


accumulate_annual_for_year("gen", "annual_field_energy", sim_setup.m_report_step / 3600.0, steps_per_hour); //[kWt-hr]
Expand Down
2 changes: 1 addition & 1 deletion ssc/cmod_mspt_iph.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2327,7 +2327,7 @@ class cm_mspt_iph : public compute_module
p_load[i] = p_W_dot_par_tot_haf[i];
}

ssc_number_t* p_annual_energy_dist_time = gen_heatmap(this, steps_per_hour);
ssc_number_t* p_annual_energy_dist_time = gen_heatmap(this, steps_per_hour, true);

accumulate_annual_for_year("gen_heat", "annual_energy", sim_setup.m_report_step / 3600.0, steps_per_hour, 1, n_steps_fixed / steps_per_hour); //[kWt-hr]

Expand Down
4 changes: 2 additions & 2 deletions ssc/cmod_trough_physical_iph.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -740,7 +740,7 @@ class cm_trough_physical_iph : public compute_module
{
add_var_info( _cm_vtab_trough_physical_iph );
add_var_info( vtab_adjustment_factors );
//add_var_info(vtab_technology_outputs);
add_var_info(vtab_technology_outputs);
add_var_info(vtab_utility_rate_common); // Required for dispatch w/ utility rates

}
Expand Down Expand Up @@ -2276,7 +2276,7 @@ class cm_trough_physical_iph : public compute_module
annual_elec_cost += i_elec_cost; //[$]
}

ssc_number_t* p_annual_energy_dist_time = gen_heatmap(this, steps_per_hour);
ssc_number_t* p_annual_energy_dist_time = gen_heatmap(this, steps_per_hour, true);
// Non-timeseries array outputs
double P_adj = 0; // slightly adjust all field design pressures to account for pressure drop in TES before hot tank
if (tes_type == C_csp_tes::csp_tes_types::E_TES_TWO_TANK)
Expand Down
9 changes: 7 additions & 2 deletions ssc/common.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -649,15 +649,20 @@ var_info vtab_technology_outputs[] = {

var_info_invalid };

ssc_number_t* gen_heatmap(compute_module* cm, double step_per_hour) {
ssc_number_t* gen_heatmap(compute_module* cm, double step_per_hour, bool heat) {
if (!cm)
return 0;
size_t count = (size_t)(8760 * step_per_hour);
// size_t imonth = 0;
size_t iday = 0;
size_t hour;
size_t count_gen;
ssc_number_t* p_gen = cm->as_array("gen", &count_gen);
ssc_number_t* p_gen = NULL;
if (heat)
p_gen = cm->as_array("gen_heat", &count_gen);
else
p_gen = cm->as_array("gen", &count_gen);

ssc_number_t* p_annual_energy_dist_time = cm->allocate("annual_energy_distribution_time", 25, 366);
for (size_t i = 0; i < count; i++) {
hour = (size_t)fmod(floor(double(i) / step_per_hour), 24);
Expand Down
2 changes: 1 addition & 1 deletion ssc/common.h
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ bool calculate_p50p90(compute_module *cm);

void calculate_resilience_outputs(compute_module *cm, std::unique_ptr<resilience_runner> &resilience);

ssc_number_t* gen_heatmap(compute_module* cm, double step_per_hour);
ssc_number_t* gen_heatmap(compute_module* cm, double step_per_hour, bool heat=false);

void prepend_to_output(compute_module* cm, std::string var_name, size_t count, ssc_number_t value);

Expand Down

0 comments on commit afa33b9

Please sign in to comment.