void C_csp_mspt_collector_receiver::estimates(const C_csp_weatherreader::S_outputs &weather, const C_csp_solver_htf_1state &htf_state_in, C_csp_collector_receiver::S_csp_cr_est_out &est_out, const C_csp_solver_sim_info &sim_info) { // For now, define estimates(...) shell that calls call() with operation mode defined. // Should eventually develop an estimate(...) method for the MSPT C_csp_collector_receiver::S_csp_cr_inputs inputs; inputs.m_input_operation_mode = C_csp_collector_receiver::STEADY_STATE; inputs.m_field_control = 1.0; C_csp_collector_receiver::S_csp_cr_out_solver cr_out_solver; call(weather, htf_state_in, inputs, cr_out_solver, sim_info); int mode = get_operating_state(); if( mode == C_csp_collector_receiver::ON ) { est_out.m_q_dot_avail = cr_out_solver.m_q_thermal; //[MWt] est_out.m_m_dot_avail = cr_out_solver.m_m_dot_salt_tot; //[kg/hr] est_out.m_T_htf_hot = cr_out_solver.m_T_salt_hot; //[C] est_out.m_q_startup_avail = 0.0; } else { est_out.m_q_startup_avail = cr_out_solver.m_q_thermal; //[MWt] est_out.m_q_dot_avail = 0.0; est_out.m_m_dot_avail = 0.0; est_out.m_T_htf_hot = 0.0; } }
void GLArea::runCommand( std::string cmd ){ std::cout << "run command: "<<cmd<<std::endl; char buffer[128] ; if( cmd == "save og nbs" ) { if( get_operating_state() != onesweepReady ) return ; std::ofstream ofs( appstate.path + "\/ognbs.txt" ) ; std::vector<int> tmpIdx = dataMgr.swp.ongoingSkel.tempalteIdss[0] ; std::vector<ON_NurbsCurve> nbss = dataMgr.swp.ongoingSkel.Nurbsss[0] ; Curve3D brch = dataMgr.swp.ongoingSkel.smoothedBrchPts[0] ; std::vector<double> conf = dataMgr.swp.ongoingSkel.profile_conf[0] ; if( tmpIdx.size() != nbss.size() ){ std::cout <<__FILE__<<__LINE__<<std::endl; system("error") ; } // save skeleton ofs << brch.size() <<std::endl ; for( int i=0; i<brch.size(); ++i ) ofs << brch[i].X() << " " << brch[i].Y()<< " " << brch[i].Z() <<std::endl; // save confidence ofs << conf.size() <<std::endl ; for( int i=0; i<conf.size(); ++i ) ofs << conf[i] <<std::endl; // save tmpId ofs<< tmpIdx.size() <<std::endl; for( int i=0; i<tmpIdx.size(); ++i ) ofs << tmpIdx[i] <<std::endl; // save nurbs ofs<< nbss.size() <<std::endl; for( int i=0; i<nbss.size(); ++i ){ Curve2D cvs = ReconstructorUtility::getCvPts( nbss[i] ) ; for( int j=0; j<cvs.size(); ++j ) ofs << cvs[j].X() << " " << cvs[j].Y() <<std::endl; } ofs.close() ; int ogSkelId = dataMgr.swp.settings.size() ; if( ogSkelId!=0 && dataMgr.swp.settings.back().iditifier == dataMgr.swp.ongoingSkel.iditifier ) ogSkelId-- ; std::string cpyCmd = std::string( "copy " ) + "\"" + appstate.path + "\/ognbs.txt\"" + " \"" + appstate.path + "\/ognbs_" + itoa( ogSkelId, buffer,10 ) + ".txt\"" ; for( int i=0; i<cpyCmd.size(); ++i ) if( cpyCmd[i] == '\/' ) cpyCmd[i] = '\\' ; system(cpyCmd.c_str()) ; std::cout << "cpyCmd = "<< cpyCmd <<std::endl; } else if( cmd == "load og nbs" ){