Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
104 commits
Select commit Hold shift + click to select a range
337a4b2
Add sco2 htr bypass clas to tcs project
taylorbrown75 Apr 12, 2023
930f80e
Add blank functions to htr bypass. Begin adding call from pc_csp_int
taylorbrown75 Apr 14, 2023
6d4f3da
Merge with online repository
taylorbrown75 Apr 14, 2023
254d001
Merge in bug fix for sco2
taylorbrown75 Apr 18, 2023
3856878
Add methods for solving htr bypass cycle. Add temporary code to cmod …
taylorbrown75 Apr 19, 2023
a4bb6a2
Fix bug in htr bypass solver
taylorbrown75 Apr 20, 2023
e8ffc4a
Change target cold approach temperature to PHX (instead of Bypass)
taylorbrown75 May 1, 2023
aaa879e
Fix bug to make htr bypass callable from python
taylorbrown75 May 2, 2023
49ce724
Transition solvers to shared monotonic equation class. Modify inputs …
taylorbrown75 May 3, 2023
d2f248d
Add additional bypass variables to cmod. Pass through to htr bypass m…
taylorbrown75 May 5, 2023
145a66e
Solve with PHX cold approach rather than Bypass cold approach
taylorbrown75 May 9, 2023
2e02898
Update branch to latest develop
taylorbrown75 May 9, 2023
1a51ca1
Integrate htr bypass cycle into upstream logic. Add bypass heat excha…
taylorbrown75 May 17, 2023
c0df2aa
Try modifying htr bypass optimizer to prevent crashes
taylorbrown75 May 24, 2023
675a055
Change bypass fraction optimization to non linear. Add penalty to cyc…
taylorbrown75 Jun 26, 2023
a3a74ed
Add alfani test case
taylorbrown75 Jun 28, 2023
98ca56e
Add HX model definitions to end of cycle simulation. Add debug code f…
taylorbrown75 Jul 16, 2023
1b69153
Add air cooler calculations (W and Q). Begin updating debug output st…
taylorbrown75 Jul 18, 2023
410f2b8
Add variables to debug output string
taylorbrown75 Jul 19, 2023
30a9907
Add bypass fraction to cmod. Add htr bypass outputs to cmod.
taylorbrown75 Jul 20, 2023
5201861
Add option to hard set HTF mass flow rate for HTR Bypass configuration.
taylorbrown75 Jul 24, 2023
f12628c
Ensure that HTR optimization sets the optimal values.
taylorbrown75 Jul 28, 2023
04a6153
Add cmod outputs. Fix bug with recomp_frac = 0 in htr bypass cycle
taylorbrown75 Jul 31, 2023
65d2930
Fix output when bypass heat exchanger has zero flow
taylorbrown75 Aug 3, 2023
f971152
Catch air cooler sizing exceptions. Add max evaluation limit to optim…
taylorbrown75 Sep 7, 2023
f309670
Change T_htf_cold_des to HTF outlet temperature (not necessarily PHX …
taylorbrown75 Sep 7, 2023
b18ecfc
Begin adding option to optimize for bypass fraction outside of main o…
taylorbrown75 Sep 12, 2023
a4ae653
Add optimization routine to optimize bypass fraction outside other va…
taylorbrown75 Sep 27, 2023
3078fa5
Use user defined tolerance, rather than hardcode.
taylorbrown75 Oct 5, 2023
89e6d80
Try adding max evaluation limit
taylorbrown75 Jan 29, 2024
bb7ef44
Add ability to target low sco2 temperature
taylorbrown75 Feb 15, 2024
2bbd64b
Add cmod to calculate sco2 plotting values
taylorbrown75 Feb 20, 2024
c359ef6
Add sco2_helper cmod to correct folder
taylorbrown75 Feb 20, 2024
f1f44c4
Begin creating stand alone htr bp design point model
taylorbrown75 Mar 5, 2024
150916f
Complete core simulation model
taylorbrown75 Mar 6, 2024
e1ba650
Move core simulation results to dedicated outputs class
taylorbrown75 Mar 6, 2024
89c1877
Add basic optimization functionality
taylorbrown75 Mar 7, 2024
fe5164a
Add comments and reorganize to plan optimization return values.
taylorbrown75 Mar 7, 2024
d8a37c9
Change function parameters to references and const where possible.
taylorbrown75 Mar 8, 2024
4fef9eb
Pass htrbp core solve class to optimizer, rather than inputs only.
taylorbrown75 Mar 8, 2024
2dba891
Add finalize design function. Rename optimization function
taylorbrown75 Mar 9, 2024
01f7da0
Remove old optimization routines and unused functions.
taylorbrown75 Mar 9, 2024
8fe848d
Reorganize code. Add initialization to htf inputs.
taylorbrown75 Mar 11, 2024
c24621d
Clean auto_opt_design_core
taylorbrown75 Mar 11, 2024
28cec8c
Begin adding total UA optimization
taylorbrown75 Mar 12, 2024
dc5fdcd
Complete total UA optimization. Remove unnecessary class.
taylorbrown75 Mar 13, 2024
8950685
Remove duplicate fields from ms_opt_des_par. Initialize variables.
taylorbrown75 Mar 13, 2024
382d6c7
Structure code. Synchronize naming convention. Add error check. Remov…
taylorbrown75 Mar 13, 2024
4ca0167
Make eta_thermal_target constant. Rename initialization function.
taylorbrown75 Mar 13, 2024
67cb2ce
Add message to report iterations out
taylorbrown75 Mar 15, 2024
794115a
Add turbine split flow cycle files (not complete).
taylorbrown75 Apr 2, 2024
a3e3ddd
Add tsf specific inputs to cmod and shared classes. Rename core tsf m…
taylorbrown75 Apr 2, 2024
13c86e8
Add tsf specific parameters to tsf class. Handle variable exchange fr…
taylorbrown75 Apr 3, 2024
19048fc
Develop tsf design point up to HTR mono opt.
taylorbrown75 Apr 4, 2024
e65a1ae
Complete TSF core model.
taylorbrown75 Apr 5, 2024
3563f61
Add tolerance to error check.
taylorbrown75 Apr 8, 2024
a3f5d2a
Add optimization for design_method == 2 or 3
taylorbrown75 Apr 9, 2024
70799cf
Update plotting functions for Turbine split flow. Cmod not complete.
taylorbrown75 Apr 15, 2024
cda42dd
Complete cmod for TSF.
taylorbrown75 Apr 16, 2024
c7bf852
Add missing t2 PH data
taylorbrown75 Apr 17, 2024
5f18142
Add monotonic solver for HTR. Fix Solve_HTR
taylorbrown75 Apr 18, 2024
046cbe8
Add error code to cmod. Allows cycle to fail and pass error out.
taylorbrown75 Apr 24, 2024
0dec486
Merge branch 'develop' into sco2_tsf
taylorbrown75 Sep 23, 2024
9f52a66
Add option to end simulation if efficiency is below cutoff.
taylorbrown75 Dec 10, 2024
9886104
Fix bug returning error code in recomp.
taylorbrown75 Dec 11, 2024
9f9ad62
Fix HX q_dot guess bug.
taylorbrown75 Dec 6, 2024
21fdb7d
Update cycle_config label to include tsf.
taylorbrown75 Dec 26, 2024
611b153
Update air cooler solver to account for large temperature differences.
taylorbrown75 Dec 30, 2024
34d5270
Fix bug preventing users from setting recomp frac to zero in partial …
taylorbrown75 Jan 13, 2025
b239525
Add high temperature correction to recuperator cost model.
taylorbrown75 Jan 23, 2025
b855cbe
Fix recuperator temperature correction bug.
taylorbrown75 Feb 3, 2025
7f27795
change exception to fix linus build
tyneises Feb 7, 2025
71b2701
Add temperature correction to turbine cost.
taylorbrown75 Dec 31, 2024
c18e306
Merge branch 'sco2_tsf' of https://github.com/nrel/ssc into sco2_tsf
taylorbrown75 Feb 7, 2025
5ae2e7d
remove class name from method to try to resolve linux error
tyneises Feb 7, 2025
4c53d26
Merge branch 'sco2_tsf' of https://github.com/nrel/ssc into sco2_tsf
tyneises Feb 7, 2025
9da26ff
remove class name from method to try to resolve linux error
tyneises Feb 7, 2025
2586338
remove maxeval from sco2 cycle optimization
tyneises Feb 10, 2025
3671fa7
Add inflation factor input.
taylorbrown75 Feb 7, 2025
5fb7300
update sco2 test results for new sco2 cost correlations
tyneises Feb 10, 2025
3e25329
Change inflation factor input to inflation year.
taylorbrown75 Feb 10, 2025
d9e0181
Merge branch 'sco2_tsf' of https://github.com/nrel/ssc into sco2_tsf
taylorbrown75 Feb 10, 2025
1e7700f
Change inflation factor input to inflation year.
taylorbrown75 Feb 10, 2025
d063857
Merge branch 'develop' into sco2_tsf
tyneises Feb 11, 2025
1effbcf
update function calls with inflation year that was required after bra…
tyneises Feb 11, 2025
23fed72
Merge branch 'develop' into sco2_tsf
taylorbrown75 Sep 23, 2025
0ec0747
Remove sco2 helper cmod.
taylorbrown75 Sep 23, 2025
cd8f24d
Modify htr bypass vartable inputs.
taylorbrown75 Sep 23, 2025
9ba8a1d
Add turbine split frac to cmod outputs.
taylorbrown75 Sep 23, 2025
f53d9c7
Remove debug code.
taylorbrown75 Sep 23, 2025
075cb64
Add unsupported error ENUM.
taylorbrown75 Sep 24, 2025
b04ddf0
Modify exception definition to fix Mac bug.
taylorbrown75 Sep 24, 2025
1ae2933
Revert "Modify exception definition to fix Mac bug."
taylorbrown75 Sep 24, 2025
5e2c5d0
Add check for off design unsupported configs.
taylorbrown75 Sep 25, 2025
be2bd76
Throw error instead of passing through vartable. Add sco2 tests.
taylorbrown75 Sep 25, 2025
f5bf2f8
Add sco2 tests.
taylorbrown75 Sep 25, 2025
a02451d
Update sco2 tolerance for tests.
taylorbrown75 Sep 26, 2025
a7414fe
Fix bug with reported mc mdot for TSF.
taylorbrown75 Sep 29, 2025
52843d3
Remove error_int check from vartable outputs.
taylorbrown75 Sep 30, 2025
52f458e
Merge branch 'develop' into sco2_tsf
taylorbrown75 Oct 9, 2025
11a6f1e
Replace hardcoded inflation year with variable.
taylorbrown75 Oct 9, 2025
1605250
Fix tsf comment.
taylorbrown75 Oct 9, 2025
4350dc0
Remove unnecessary semi colons
taylorbrown75 Oct 9, 2025
1e7fc7d
Fix inflation year bug.
taylorbrown75 Oct 9, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion ssc/cmod_csp_heatsink.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ class cm_csp_heatsink : public compute_module

NS_HX_counterflow_eqs::E_UA_target_type ua_type = NS_HX_counterflow_eqs::E_UA_target_type::E_constant_UA;

mc_phx.initialize(hot_fl, 10, ua_type);
mc_phx.initialize(hot_fl, 10, ua_type, 2024.0);

double q_dot = 1000.0; //[kWt]
double T_co2_hot = 700.0; //[C]
Expand Down
16 changes: 14 additions & 2 deletions ssc/cmod_sco2_csp_system.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include <ctime>

#include "sco2_pc_csp_int.h"
#include "sco2_htrbypass_cycle.h"

static var_info _cm_vtab_sco2_csp_system[] = {

Expand Down Expand Up @@ -363,7 +364,7 @@ class cm_sco2_csp_system : public compute_module
bool is_od_set_control = is_assigned("od_set_control");
bool is_od_generate_udpc_assigned = is_assigned("od_generate_udpc");
if (is_od_cases_assigned && is_P_mc_in_od_sweep_assigned)
{
{
log("Both off design cases and main compressor inlet pressure sweep assigned. Only modeling off design cases");
is_P_mc_in_od_sweep_assigned = false;
}
Expand Down Expand Up @@ -452,11 +453,18 @@ class cm_sco2_csp_system : public compute_module
P_LP_comp_in_des = c_sco2_cycle.get_design_solved()->ms_rc_cycle_solved.m_pres[C_sco2_cycle_core::MC_IN] / 1000.0; //[MPa] convert from kPa
delta_P = 10.0;
}
else
else if (cycle_config == 2)
{
P_LP_comp_in_des = c_sco2_cycle.get_design_solved()->ms_rc_cycle_solved.m_pres[C_sco2_cycle_core::PC_IN] / 1000.0; //[MPa] convert from kPa
delta_P = 6.0;
}
else
{
log("Cycle configuration not supported for off-design");
std::string err_msg = util::format("Cycle configuration not supported for off-design");
throw exec_error("sco2_csp_system", err_msg);
return;
}

// Get turbine inlet mode
int T_t_in_mode = as_integer("od_T_t_in_mode");
Expand Down Expand Up @@ -1741,3 +1749,7 @@ class cm_sco2_comp_curves : public compute_module
};

DEFINE_MODULE_ENTRY(sco2_comp_curves, "Calls sCO2 auto-design cycle function", 1)




325 changes: 279 additions & 46 deletions ssc/csp_common.cpp

Large diffs are not rendered by default.

4 changes: 1 addition & 3 deletions ssc/csp_common.h
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,6 @@ extern var_info vtab_sco2_design[];

int sco2_design_cmod_common(compute_module *cm, C_sco2_phx_air_cooler & c_sco2_cycle);

#endif




#endif
4 changes: 4 additions & 0 deletions tcs/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,12 @@ set(TCS_SRC
numeric_solvers.cpp
ptes_solver_design_point.cpp
sco2_cycle_components.cpp
sco2_htrbypass_cycle.cpp
sco2_partialcooling_cycle.cpp
sco2_pc_csp_int.cpp
sco2_power_cycle.cpp
sco2_recompression_cycle.cpp
sco2_turbinesplitflow_cycle.cpp
tcskernel.cpp
trnsys_weatherreader.cpp
typelib.cpp
Expand Down Expand Up @@ -131,10 +133,12 @@ set(TCS_SRC
sam_csp_util.h
sco2_cycle_components.h
sco2_cycle_templates.h
sco2_htrbypass_cycle.h
sco2_partialcooling_cycle.h
sco2_pc_csp_int.h
sco2_power_cycle.h
sco2_recompression_cycle.h
sco2_turbinesplitflow_cycle.h
storage_hx.h
tcskernel.h
tcstype.h
Expand Down
83 changes: 63 additions & 20 deletions tcs/heat_exchangers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "sam_csp_util.h"
#include <algorithm>
#include "numeric_solvers.h"
#include "sco2_cycle_components.h"

double NS_HX_counterflow_eqs::calc_max_q_dot_enth(int hot_fl_code /*-*/, HTFProperties & hot_htf_class,
int cold_fl_code /*-*/, HTFProperties & cold_htf_class,
Expand Down Expand Up @@ -1523,11 +1524,13 @@ void NS_HX_counterflow_eqs::solve_q_dot_for_fixed_UA_enth(int hot_fl_code /*-*/,
throw(C_csp_exception("Off-design heat exchanger method failed"));
}

//if (!(od_hx_code == C_monotonic_eq_solver::CONVERGED || od_hx_code == C_monotonic_eq_solver::SLOPE_POS_NO_POS_ERR || od_hx_code == C_monotonic_eq_solver::SLOPE_POS_BOTH_ERRS))
//{
// throw(C_csp_exception("Off-design heat exchanger method failed"));
//}
/*if (!(od_hx_code == C_monotonic_eq_solver::CONVERGED || od_hx_code == C_monotonic_eq_solver::SLOPE_POS_NO_POS_ERR || od_hx_code == C_monotonic_eq_solver::SLOPE_POS_BOTH_ERRS))
{
throw(C_csp_exception("Off-design heat exchanger method failed"));
}*/

}

else if (test_code == 0 && diff_UA_max_eff <= 0.0) // UA_max_eff <= UA_target)
{
// At maximum allowable heat transfer, the calculated UA is less than target
Expand Down Expand Up @@ -1785,16 +1788,37 @@ double C_HX_counterflow_CRM::calc_max_q_dot_enth(double h_h_in /*kJ/kg*/, double

double /*M$*/ C_HX_counterflow_CRM::calculate_equipment_cost(double UA /*kWt/K*/,
double T_hot_in /*K*/, double P_hot_in /*kPa*/, double m_dot_hot /*kg/s*/,
double T_cold_in /*K*/, double P_cold_in /*kPa*/, double m_dot_cold /*kg/s*/)
double T_cold_in /*K*/, double P_cold_in /*kPa*/, double m_dot_cold /*kg/s*/,
double yr_inflation /*yr*/)
{
switch (m_cost_model)
{
case C_HX_counterflow_CRM::E_CARLSON_17_RECUP:
return 1.25*1.E-3*UA; //[M$] needs UA in kWt/K
{
double yr_base_inflation = 2017;
double f_inflation = calculate_inflation_factor(yr_base_inflation, yr_inflation);
return 1.25 * 1.E-3 * UA * f_inflation; //[M$] needs UA in kWt/K
}
case C_HX_counterflow_CRM::E_WEILAND_19_RECUP:
return 49.45*std::pow(UA*1.E3, 0.7544)*1.E-6; //[M$] needs UA in Wt/K
{
double C_recup = 49.45 * std::pow(UA * 1.E3, 0.7544) * 1.E-6; //[M$] needs UA in Wt/K
double T_factor = 1;
double T_max_C = std::max(T_hot_in, T_cold_in) - 273.15;
if (T_max_C >= 550)
{
T_factor = 1.0 + 0.02141 * (T_max_C - 550);
}
double yr_base_inflation = 2017;
double f_inflation = calculate_inflation_factor(yr_base_inflation, yr_inflation);
return C_recup * T_factor * f_inflation; //[M$]
break;
}
case C_HX_counterflow_CRM::E_CARLSON_17_PHX:
return 3.5*1.E-3*UA; //[M$] needs UA in kWt/K
{
double yr_base_inflation = 2017;
double f_inflation = calculate_inflation_factor(yr_base_inflation, yr_inflation);
return 3.5 * 1.E-3 * UA * f_inflation; //[M$] needs UA in kWt/K
}
default:
return std::numeric_limits<double>::quiet_NaN();
}
Expand Down Expand Up @@ -1860,7 +1884,8 @@ void C_HX_counterflow_CRM::design_calc_UA(C_HX_counterflow_CRM::S_des_calc_UA_pa

ms_des_solved.m_cost_equipment = calculate_equipment_cost(ms_des_solved.m_UA_design,
ms_des_calc_UA_par.m_T_h_in, ms_des_calc_UA_par.m_P_h_in, ms_des_calc_UA_par.m_m_dot_hot_des,
ms_des_calc_UA_par.m_T_c_in, ms_des_calc_UA_par.m_P_c_in, ms_des_calc_UA_par.m_m_dot_cold_des);
ms_des_calc_UA_par.m_T_c_in, ms_des_calc_UA_par.m_P_c_in, ms_des_calc_UA_par.m_m_dot_cold_des,
m_yr_inflation);

ms_des_solved.m_cost_bare_erected = calculate_bare_erected_cost(ms_des_solved.m_cost_equipment);

Expand Down Expand Up @@ -1981,7 +2006,7 @@ void C_HX_counterflow_CRM::design_calc_UA_TP_to_PH(C_HX_counterflow_CRM::S_des_c

ms_des_solved.m_cost_equipment = calculate_equipment_cost(ms_des_solved.m_UA_design,
ms_des_calc_UA_par.m_T_h_in, ms_des_calc_UA_par.m_P_h_in, ms_des_calc_UA_par.m_m_dot_hot_des,
ms_des_calc_UA_par.m_T_c_in, ms_des_calc_UA_par.m_P_c_in, ms_des_calc_UA_par.m_m_dot_cold_des);
ms_des_calc_UA_par.m_T_c_in, ms_des_calc_UA_par.m_P_c_in, ms_des_calc_UA_par.m_m_dot_cold_des, m_yr_inflation);

ms_des_solved.m_cost_bare_erected = calculate_bare_erected_cost(ms_des_solved.m_cost_equipment);

Expand Down Expand Up @@ -2059,7 +2084,8 @@ void C_HX_counterflow_CRM::design_for_target__calc_outlet(int hx_target_code /*-

ms_des_solved.m_cost_equipment = calculate_equipment_cost(ms_des_solved.m_UA_design,
T_h_in, P_h_in, m_dot_h,
T_c_in, P_c_in, m_dot_c);
T_c_in, P_c_in, m_dot_c,
m_yr_inflation);

ms_des_solved.m_cost_bare_erected = calculate_bare_erected_cost(ms_des_solved.m_cost_equipment);
}
Expand Down Expand Up @@ -3370,7 +3396,8 @@ double NS_HX_counterflow_eqs::UA_scale_vs_m_dot(double m_dot_cold_over_des /*-*/
return pow(m_dot_ratio, 0.8);
}

void C_HX_co2_to_co2_CRM::initialize(int N_sub_hx, NS_HX_counterflow_eqs::E_UA_target_type od_UA_target_type)
void C_HX_co2_to_co2_CRM::initialize(int N_sub_hx, NS_HX_counterflow_eqs::E_UA_target_type od_UA_target_type,
double yr_inflation)
{
// Set design parameters member structure
ms_init_par.m_N_sub_hx = N_sub_hx;
Expand All @@ -3379,9 +3406,11 @@ void C_HX_co2_to_co2_CRM::initialize(int N_sub_hx, NS_HX_counterflow_eqs::E_UA_t
m_is_HX_initialized = true;

m_od_UA_target_type = od_UA_target_type;
m_yr_inflation = yr_inflation;
}

void C_HX_co2_to_htf::initialize(int hot_fl, util::matrix_t<double> hot_fl_props, int N_sub_hx, NS_HX_counterflow_eqs::E_UA_target_type od_UA_target_type)
void C_HX_co2_to_htf::initialize(int hot_fl, util::matrix_t<double> hot_fl_props, int N_sub_hx, NS_HX_counterflow_eqs::E_UA_target_type od_UA_target_type,
double yr_inflation)
{
// Hard-code some of the design parameters
ms_init_par.m_N_sub_hx = N_sub_hx; //[-]
Expand Down Expand Up @@ -3427,13 +3456,16 @@ void C_HX_co2_to_htf::initialize(int hot_fl, util::matrix_t<double> hot_fl_props
// Class is initialized
m_is_HX_initialized = true;

m_yr_inflation = yr_inflation;

}

void C_HX_co2_to_htf::initialize(int hot_fl, int N_sub_hx, NS_HX_counterflow_eqs::E_UA_target_type od_UA_target_type)
void C_HX_co2_to_htf::initialize(int hot_fl, int N_sub_hx, NS_HX_counterflow_eqs::E_UA_target_type od_UA_target_type,
double yr_inflation)
{
util::matrix_t<double> null_fluid_props;

initialize(hot_fl, null_fluid_props, N_sub_hx, od_UA_target_type);
initialize(hot_fl, null_fluid_props, N_sub_hx, od_UA_target_type, yr_inflation);
}

void C_HX_co2_to_htf::design_and_calc_m_dot_htf(C_HX_counterflow_CRM::S_des_calc_UA_par& des_par,
Expand Down Expand Up @@ -3691,7 +3723,8 @@ bool C_CO2_to_air_cooler::design_hx(S_des_par_ind des_par_ind, S_des_par_cycle_d
solver_code = -1;
i_W_par = -1;

while (solver_code != 0 || std::abs(T_hot_in_calc_2 - T_hot_in_calc) / T_hot_in_calc < 0.01)
while (solver_code != 0 || std::abs(T_hot_in_calc_2 - T_hot_in_calc) / T_hot_in_calc < 0.01
|| ms_des_par_cycle_dep.m_T_hot_in_des - T_hot_in_calc_2 > 100.0)
{
i_W_par++;

Expand Down Expand Up @@ -3774,7 +3807,7 @@ bool C_CO2_to_air_cooler::design_hx(S_des_par_ind des_par_ind, S_des_par_cycle_d
ms_hx_des_sol.m_W_dot_fan = ms_des_par_cycle_dep.m_W_dot_fan_des; //[MWe]

ms_hx_des_sol.m_cost_equipment = calculate_equipment_cost(ms_hx_des_sol.m_UA_total*1.E-3, ms_hx_des_sol.m_V_total,
ms_hx_des_sol.m_T_in_co2, ms_hx_des_sol.m_P_in_co2, ms_hx_des_sol.m_m_dot_co2); //[M$]
ms_hx_des_sol.m_T_in_co2, ms_hx_des_sol.m_P_in_co2, ms_hx_des_sol.m_m_dot_co2, des_par_ind.m_yr_inflation); //[M$]

ms_hx_des_sol.m_cost_bare_erected = calculate_bare_erected_cost(ms_hx_des_sol.m_cost_equipment);

Expand Down Expand Up @@ -4361,14 +4394,24 @@ int C_CO2_to_air_cooler::C_MEQ_target_T_hot__width_parallel::operator()(double W
}

double /*M$*/ C_CO2_to_air_cooler::calculate_equipment_cost(double UA /*kWt/K*/, double V_material /*m^3*/,
double T_hot_in /*K*/, double P_hot_in /*kPa*/, double m_dot_hot /*kg/s*/)
double T_hot_in /*K*/, double P_hot_in /*kPa*/, double m_dot_hot /*kg/s*/, double yr_inflation/**/)
{
switch (m_cost_model)
{
case C_CO2_to_air_cooler::E_CARLSON_17:
return 2.3*1.E-3*UA; //[M$] needs UA in kWt/K
{
double yr_base_inflation = 2017;
double f_inflation = calculate_inflation_factor(yr_base_inflation, yr_inflation);
return 2.3 * 1.E-3 * UA * f_inflation; //[M$] needs UA in kWt/K
}

case C_CO2_to_air_cooler::E_WEILAND_19:
return 32.88*std::pow(UA*1.E3, 0.75)*1.E-6; //[M$] needs UA in Wt/K
{
double yr_base_inflation = 2017;
double f_inflation = calculate_inflation_factor(yr_base_inflation, yr_inflation);
return 32.88 * std::pow(UA * 1.E3, 0.75) * 1.E-6 * f_inflation; //[M$] needs UA in Wt/K
}

default:
return std::numeric_limits<double>::quiet_NaN();
}
Expand Down
19 changes: 13 additions & 6 deletions tcs/heat_exchangers.h
Original file line number Diff line number Diff line change
Expand Up @@ -478,6 +478,7 @@ class C_HX_counterflow_CRM

int m_cost_model; //[-]
int m_od_solution_type; //[-]
double m_yr_inflation = 0; //[yr]

bool m_is_single_node_des_set;
NS_HX_counterflow_eqs::S_hx_node_info ms_node_info_des;
Expand Down Expand Up @@ -678,7 +679,8 @@ class C_HX_counterflow_CRM

double calculate_equipment_cost(double UA /*kWt/K*/,
double T_hot_in /*K*/, double P_hot_in /*kPa*/, double m_dot_hot /*kg/s*/,
double T_cold_in /*K*/, double P_cold_in /*kPa*/, double m_dot_cold /*kg/s*/);
double T_cold_in /*K*/, double P_cold_in /*kPa*/, double m_dot_cold /*kg/s*/,
double yr_inflation /*yr*/);

double calculate_bare_erected_cost(double cost_equipment /*M$*/);

Expand Down Expand Up @@ -838,9 +840,10 @@ class C_HX_co2_to_htf : public C_HX_counterflow_CRM
void design_and_calc_m_dot_htf(C_HX_counterflow_CRM::S_des_calc_UA_par &des_par,
double q_dot_design /*kWt*/, double dt_cold_approach /*C/K*/, C_HX_counterflow_CRM::S_des_solved &des_solved);

virtual void initialize(int hot_fl, util::matrix_t<double> hot_fl_props, int N_sub_hx, NS_HX_counterflow_eqs::E_UA_target_type od_UA_target_type);
virtual void initialize(int hot_fl, util::matrix_t<double> hot_fl_props, int N_sub_hx, NS_HX_counterflow_eqs::E_UA_target_type od_UA_target_type,
double yr_inflation);

virtual void initialize(int hot_fl, int N_sub_hx, NS_HX_counterflow_eqs::E_UA_target_type od_UA_target_type);
virtual void initialize(int hot_fl, int N_sub_hx, NS_HX_counterflow_eqs::E_UA_target_type od_UA_target_type, double yr_inflation);

};

Expand All @@ -861,7 +864,8 @@ class C_HX_co2_to_co2_CRM : public C_HX_counterflow_CRM

}

virtual void initialize(int N_sub_hx, NS_HX_counterflow_eqs::E_UA_target_type od_UA_target_type);
virtual void initialize(int N_sub_hx, NS_HX_counterflow_eqs::E_UA_target_type od_UA_target_type,
double yr_inflation);
};

namespace N_compact_hx
Expand Down Expand Up @@ -907,10 +911,12 @@ class C_CO2_to_air_cooler

double m_eta_fan; //[-] Fan isentropic efficiency
int m_N_nodes_pass; //[-] Number of nodes per pass
double m_yr_inflation; //[yr] Inflation year target

S_des_par_ind()
{
m_T_amb_des = m_elev = std::numeric_limits<double>::quiet_NaN();
m_T_amb_des = m_elev = m_yr_inflation =
std::numeric_limits<double>::quiet_NaN();

// Set realistic default values so model can solve without inputs for these values
m_eta_fan = 0.5;
Expand Down Expand Up @@ -1414,7 +1420,8 @@ class C_CO2_to_air_cooler
double & k_air /*W/m-K*/, double & Pr_air);

double /*M$*/ calculate_equipment_cost(double UA /*kWt/K*/, double V_material /*m^3*/,
double T_hot_in /*K*/, double P_hot_in /*kPa*/, double m_dot_hot /*kg/s*/);
double T_hot_in /*K*/, double P_hot_in /*kPa*/, double m_dot_hot /*kg/s*/,
double yr_inflation /*yr*/);

double /*M$*/ calculate_bare_erected_cost(double cost_equipment /*M$*/);
};
Expand Down
Loading