Skip to content

Commit

Permalink
Fix mdot bug on power cycle UI page. Finish system design code.
Browse files Browse the repository at this point in the history
  • Loading branch information
taylorbrown75 committed Oct 18, 2023
1 parent dbe6240 commit 0c6e37d
Show file tree
Hide file tree
Showing 2 changed files with 100 additions and 21 deletions.
5 changes: 0 additions & 5 deletions deploy/runtime/ui/Physical Trough Power Cycle Common.json
Original file line number Diff line number Diff line change
Expand Up @@ -1539,11 +1539,6 @@
"\t",
"equations{ 'PB_COPY_htf_cp_avg' } = define(){",
"\treturn ${field_htf_cp_avg}; };",
"\t",
"equations{ 'PB_m_dot_htf_cycle_des' } = define(){",
"\treturn ${PB_COPY_q_pb_design}*1000.0",
"\t\t/(${PB_COPY_htf_cp_avg}",
"\t\t*(${T_htf_hot_des}-${T_htf_cold_des})); };",
"\t\t",
"equations{ 'system_capacity' } = define() {",
"\treturn ${nameplate}*1000; };//MWh to kWh"
Expand Down
116 changes: 100 additions & 16 deletions deploy/runtime/ui/Physical Trough System Design.json
Original file line number Diff line number Diff line change
Expand Up @@ -1730,6 +1730,7 @@
"\t\r",
"\tif(ret == 0)\r",
"\t{\r",
"\t\t// System Design\r",
"\t\t${csp.dtr.pwrb.nameplate} = ssc_var(obj, \"nameplate\");\r",
"\t\t${q_pb_design} = ssc_var(obj, \"q_dot_cycle_des\");\r",
"\t\t\r",
Expand Down Expand Up @@ -1796,33 +1797,116 @@
"\t\t${csp.pt.par.calc.aux} = ssc_var(obj, \"aux_design\");\r",
"\t\t\r",
"\t\t// Capital Costs\r",
"\t\t${csp.dtr.cost.site_improvements} = ssc_var(obj, \"csp.dtr.cost.site_improvements\");\r",
"\t\t${csp.dtr.cost.solar_field} = ssc_var(obj, \"csp.dtr.cost.solar_field\");\r",
"\t\t${csp.dtr.cost.htf_system} = ssc_var(obj, \"csp.dtr.cost.htf_system\");\r",
"\t\t${csp.dtr.cost.storage} = ssc_var(obj, \"csp.dtr.cost.storage\");\r",
"\t\t${csp.dtr.cost.fossil_backup} = ssc_var(obj, \"csp.dtr.cost.fossil_backup\");\r",
"\t\t${csp.dtr.cost.power_plant} = ssc_var(obj, \"csp.dtr.cost.power_plant\");\r",
"\t\t${csp.dtr.cost.bop} = ssc_var(obj, \"csp.dtr.cost.bop\");\r",
"\t\t${csp.dtr.cost.contingency} = ssc_var(obj, \"csp.dtr.cost.contingency\");\r",
"\t\t${total_direct_cost} = ssc_var(obj, \"total_direct_cost\");\r",
"\t\t${csp.dtr.cost.epc.total} = ssc_var(obj, \"csp.dtr.cost.epc.total\");\r",
"\t\t${csp.dtr.cost.plm.total} = ssc_var(obj, \"csp.dtr.cost.plm.total\");\r",
"\t\t${total_indirect_cost} = ssc_var(obj, \"total_indirect_cost\");\r",
"\t\t${csp.dtr.cost.sales_tax.total} = ssc_var(obj, \"csp.dtr.cost.sales_tax.total\");\r",
"\t\t${total_installed_cost} = ssc_var(obj, \"total_installed_cost\");\r",
"\t\t${csp.dtr.cost.installed_per_capacity} = ssc_var(obj, \"csp.dtr.cost.installed_per_capacity\");\r",
"\t\r",
"\t\tcsp_financial_model = ${csp_financial_model};\r",
"\t\tif(csp_financial_model != 8)\r",
"\t\t{\r",
"\t\t\t${csp.dtr.cost.site_improvements} = ssc_var(obj, \"csp.dtr.cost.site_improvements\");\r",
"\t\t\t${csp.dtr.cost.solar_field} = ssc_var(obj, \"csp.dtr.cost.solar_field\");\r",
"\t\t\t${csp.dtr.cost.htf_system} = ssc_var(obj, \"csp.dtr.cost.htf_system\");\r",
"\t\t\t${csp.dtr.cost.storage} = ssc_var(obj, \"csp.dtr.cost.storage\");\r",
"\t\t\t${csp.dtr.cost.fossil_backup} = ssc_var(obj, \"csp.dtr.cost.fossil_backup\");\r",
"\t\t\t${csp.dtr.cost.power_plant} = ssc_var(obj, \"csp.dtr.cost.power_plant\");\r",
"\t\t\t${csp.dtr.cost.bop} = ssc_var(obj, \"csp.dtr.cost.bop\");\r",
"\t\t\t${csp.dtr.cost.contingency} = ssc_var(obj, \"csp.dtr.cost.contingency\");\r",
"\t\t\t${total_direct_cost} = ssc_var(obj, \"total_direct_cost\");\r",
"\t\t\t${csp.dtr.cost.epc.total} = ssc_var(obj, \"csp.dtr.cost.epc.total\");\r",
"\t\t\t${csp.dtr.cost.plm.total} = ssc_var(obj, \"csp.dtr.cost.plm.total\");\r",
"\t\t\t${total_indirect_cost} = ssc_var(obj, \"total_indirect_cost\");\r",
"\t\t\t${csp.dtr.cost.sales_tax.total} = ssc_var(obj, \"csp.dtr.cost.sales_tax.total\");\r",
"\t\t\t${total_installed_cost} = ssc_var(obj, \"total_installed_cost\");\r",
"\t\t\t${csp.dtr.cost.installed_per_capacity} = ssc_var(obj, \"csp.dtr.cost.installed_per_capacity\");\r",
"\t\t}\r",
"\t}\r",
"\telse\r",
"\t{\r",
"\t\tfail = -789;\r",
"\t\t\r",
"\t\t// System Design\r",
"\t\t${csp.dtr.pwrb.nameplate} = fail;\r",
"\t\t${q_pb_design} = fail;\r",
"\t\t\r",
"\t\t// Solar Field\r",
"\t\t${field_htf_min_operating_temp} = fail;\r",
"\t\t${field_htf_max_operating_temp} = fail;\r",
"\t\t${field_htf_cp_avg} = fail;\r",
"\t\t${single_loop_aperature} = fail;\r",
"\t\t${min_inner_diameter} = fail;\r",
"\t\t${csp_dtr_hce_design_heat_losses} = fail;\r",
"\t\t${cspdtr_loop_hce_heat_loss} = fail;\r",
"\t\t${csp_dtr_sca_calc_sca_effs} = fail;\r",
"\t\t${loop_optical_efficiency} = fail;\r",
"\t\t${csp_dtr_hce_optical_effs} = fail;\r",
"\t\t${SCAInfoArray} = fail;\r",
"\t\t${SCADefocusArray} = fail;\r",
"\t\t${max_field_flow_velocity} = fail;\r",
"\t\t${min_field_flow_velocity} = fail;\r",
"\t\t${total_loop_conversion_efficiency} = fail;\r",
"\t\t${total_required_aperture_for_SM1} = fail;\r",
"\t\t${required_number_of_loops_for_SM1} = fail;\r",
"\t\t${nLoops} = fail;\r",
"\t\t${total_aperture} = fail;\r",
"\t\t${field_thermal_output} = fail;\r",
"\t\t${solar_mult} = fail;\r",
"\t\t${fixed_land_area} = fail;\r",
"\t\t${total_land_area} = fail;\r",
"\t\t${total_tracking_power} = fail;\r",
"\t\t${K_cpnt} = fail;\r",
"\t\t${D_cpnt} = fail;\r",
"\t\t${L_cpnt} = fail;\r",
"\t\t${Type_cpnt} = fail;\r",
"\t\t\r",
"\t\t// Thermal Storage\r",
"\t\t${vol_tank} = fail;\r",
"\t\t${Q_tes} = fail;\r",
"\t\t${csp.pt.tes.tank_diameter} = fail;\r",
"\t\t${q_dot_tes_est} = fail;\r",
"\t\t${csp.pt.tes.htf_density} = fail;\r",
"\t\t${tes_avail_vol} = fail;\r",
"\t\t${is_hx} = fail;\r",
"\t\t${csp.dtr.tes.min_fluid_volume} = fail;\r",
"\t\t${V_tank_hot_ini} = fail;\r",
"\t\t${csp.dtr.tes.htf_calc_temp} = fail;\r",
"\t\r",
"\t\t// Collectors\r",
"\t\t${csp_dtr_sca_ap_lengths} = fail;\r",
"\t\t${csp_dtr_sca_calc_zenith} = fail;\r",
"\t\t${csp_dtr_sca_calc_costh} = fail;\r",
"\t\t${csp_dtr_sca_calc_theta} = fail;\r",
"\t\t${csp_dtr_sca_calc_end_gains} = fail;\r",
"\t\t${csp_dtr_sca_calc_end_losses} = fail;\r",
"\t\t${csp_dtr_sca_calc_latitude} = fail;\r",
"\t\t${csp_dtr_sca_calc_iams} = fail;\r",
"\t\r",
"\t\t// Power Cycle\r",
"\t\t${PB_m_dot_htf_cycle_des} = fail;\r",
"\t\r",
"\t\t// System Control\r",
"\t\t${is_wlim_series} = fail;\r",
"\t\t${disp_wlim_max} = fail;\r",
"\t\t${wlim_series} = fail;\r",
"\t\t${csp.pt.par.calc.bop} = fail;\r",
"\t\t${csp.pt.par.calc.aux} = fail;\r",
"\t\t\r",
"\t\t// Capital Costs\r",
"\t\tif(csp_financial_model != 8)\r",
"\t\t{\r",
"\t\t\t${csp.dtr.cost.site_improvements} = fail;\r",
"\t\t\t${csp.dtr.cost.solar_field} = fail;\r",
"\t\t\t${csp.dtr.cost.htf_system} = fail;\r",
"\t\t\t${csp.dtr.cost.storage} = fail;\r",
"\t\t\t${csp.dtr.cost.fossil_backup} = fail;\r",
"\t\t\t${csp.dtr.cost.power_plant} = fail;\r",
"\t\t\t${csp.dtr.cost.bop} = fail;\r",
"\t\t\t${csp.dtr.cost.contingency} = fail;\r",
"\t\t\t${total_direct_cost} = fail;\r",
"\t\t\t${csp.dtr.cost.epc.total} = fail;\r",
"\t\t\t${csp.dtr.cost.plm.total} = fail;\r",
"\t\t\t${total_indirect_cost} = fail;\r",
"\t\t\t${csp.dtr.cost.sales_tax.total} = fail;\r",
"\t\t\t${total_installed_cost} = fail;\r",
"\t\t\t${csp.dtr.cost.installed_per_capacity} = fail;\r",
"\t\t}\r",
"\t\t\r",
"\t}\r",
"\t\r",
"\t\r",
Expand Down

0 comments on commit 0c6e37d

Please sign in to comment.