Skip to content

Commit

Permalink
try fixing new subtimestep aggregator for linux v5
Browse files Browse the repository at this point in the history
  • Loading branch information
tyneises committed Jan 13, 2025
1 parent 8ab3e82 commit 28520c9
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions tcs/csp_solver_core.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

#include <sstream>

#include <ctime>

#undef min
#undef max

Expand Down Expand Up @@ -179,7 +181,7 @@ static C_csp_reported_outputs::S_output_info S_solver_output_info[] =
{ C_csp_solver::C_solver_outputs::MONTH, C_csp_reported_outputs::TS_1ST}, //[-] Month of year
{ C_csp_solver::C_solver_outputs::HOUR_DAY, C_csp_reported_outputs::TS_1ST}, //[hr] hour of day
// Controller, TES, & Dispatch
{C_csp_solver::C_solver_outputs::ERR_M_DOT, C_csp_reported_outputs::SUMMED}, //[-] Relative mass conservation error
{C_csp_solver::C_solver_outputs::ERR_M_DOT, C_csp_reported_outputs::TS_1ST}, //[-] Relative mass conservation error
{C_csp_solver::C_solver_outputs::ERR_Q_DOT, C_csp_reported_outputs::TS_1ST}, //[-] Relative energy conservation error
{C_csp_solver::C_solver_outputs::N_OP_MODES, C_csp_reported_outputs::TS_LAST}, //[-] Number of subtimesteps in reporting timestep
{C_csp_solver::C_solver_outputs::OP_MODE_1, C_csp_reported_outputs::TS_1ST}, //[-] Operating mode in first subtimestep
Expand Down Expand Up @@ -598,7 +600,7 @@ void C_csp_solver::Ssimulate(C_csp_solver::S_sim_setup & sim_setup)

while( mc_kernel.mc_sim_info.ms_ts.m_time <= mc_kernel.get_sim_setup()->m_sim_time_end )
{
//std::clock_t clock_start = std::clock();
std::clock_t clock_start = std::clock();

// Report simulation progress
double calc_frac_current = (mc_kernel.mc_sim_info.ms_ts.m_time - mc_kernel.get_sim_setup()->m_sim_time_start) / (mc_kernel.get_sim_setup()->m_sim_time_end - mc_kernel.get_sim_setup()->m_sim_time_start);
Expand Down Expand Up @@ -1129,10 +1131,10 @@ void C_csp_solver::Ssimulate(C_csp_solver::S_sim_setup & sim_setup)
mc_pc_out_solver.m_q_dot_htf -
mc_tes_outputs.m_q_dot_ch_from_htf) / m_cycle_q_dot_des; //[-]

//std::clock_t clock_end = std::clock();
//double timestep_cpu_run_time = (clock_end - clock_start) / (double)CLOCKS_PER_SEC; //[s]
std::clock_t clock_end = std::clock();
double timestep_cpu_run_time = (clock_end - clock_start) / (double)CLOCKS_PER_SEC; //[s]

//mc_reported_outputs.value(C_solver_outputs::SIM_DURATION, timestep_cpu_run_time);
mc_reported_outputs.value(C_solver_outputs::SIM_DURATION, timestep_cpu_run_time);

mc_reported_outputs.value(C_solver_outputs::ERR_M_DOT, m_dot_bal_max);
mc_reported_outputs.value(C_solver_outputs::ERR_Q_DOT, q_dot_bal);
Expand Down

0 comments on commit 28520c9

Please sign in to comment.