Skip to content

Commit

Permalink
add getem eqn to SAM_eqns
Browse files Browse the repository at this point in the history
  • Loading branch information
dguittet committed Jan 3, 2025
1 parent 23c775c commit 2cdad1b
Show file tree
Hide file tree
Showing 4 changed files with 228 additions and 0 deletions.
78 changes: 78 additions & 0 deletions api/include/SAM_GeothermalCosts.h
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,54 @@ extern "C"
*/
SAM_EXPORT void SAM_GeothermalCosts_GeoHourly_flash_count_nset(SAM_table ptr, double number, SAM_error *err);

/**
* Set geotherm.cost.conf_multiplier: Confirmation cost multiplier
* options: ?=1.2
* constraints: None
* required if: calc_drill_costs=1
*/
SAM_EXPORT void SAM_GeothermalCosts_GeoHourly_geotherm_cost_conf_multiplier_nset(SAM_table ptr, double number, SAM_error *err);

/**
* Set geotherm.cost.conf_non_drill: Confirmation non drilling costs [$]
* options: ?=250000
* constraints: None
* required if: calc_drill_costs=1
*/
SAM_EXPORT void SAM_GeothermalCosts_GeoHourly_geotherm_cost_conf_non_drill_nset(SAM_table ptr, double number, SAM_error *err);

/**
* Set geotherm.cost.conf_num_wells: Number of confirmation wells
* options: ?=2
* constraints: None
* required if: calc_drill_costs=1
*/
SAM_EXPORT void SAM_GeothermalCosts_GeoHourly_geotherm_cost_conf_num_wells_nset(SAM_table ptr, double number, SAM_error *err);

/**
* Set geotherm.cost.expl_multiplier: Exploration cost multiplier
* options: ?=0.5
* constraints: None
* required if: calc_drill_costs=1
*/
SAM_EXPORT void SAM_GeothermalCosts_GeoHourly_geotherm_cost_expl_multiplier_nset(SAM_table ptr, double number, SAM_error *err);

/**
* Set geotherm.cost.expl_non_drill: Exploration non drilling costs [$]
* options: ?=750000
* constraints: None
* required if: calc_drill_costs=1
*/
SAM_EXPORT void SAM_GeothermalCosts_GeoHourly_geotherm_cost_expl_non_drill_nset(SAM_table ptr, double number, SAM_error *err);

/**
* Set geotherm.cost.expl_num_wells: Number of exploration wells
* options: ?=2
* constraints: None
* required if: calc_drill_costs=1
*/
SAM_EXPORT void SAM_GeothermalCosts_GeoHourly_geotherm_cost_expl_num_wells_nset(SAM_table ptr, double number, SAM_error *err);

/**
* Set geotherm.cost.inj_cost_curve: Injection well diameter type [0/1]
* options: 0=LargerDiameter,1=SmallerDiameter
Expand Down Expand Up @@ -183,6 +231,14 @@ extern "C"
*/
SAM_EXPORT void SAM_GeothermalCosts_GeoHourly_geotherm_cost_prod_wells_drilled_nset(SAM_table ptr, double number, SAM_error *err);

/**
* Set geotherm.cost.stim_non_drill: Stimulation non drilling costs [$]
* options: ?=0
* constraints: None
* required if: calc_drill_costs=1
*/
SAM_EXPORT void SAM_GeothermalCosts_GeoHourly_geotherm_cost_stim_non_drill_nset(SAM_table ptr, double number, SAM_error *err);

/**
* Set gross_cost_output: Gross output from GETEM for cost calculations [MW]
* options: None
Expand Down Expand Up @@ -386,6 +442,18 @@ extern "C"

SAM_EXPORT double SAM_GeothermalCosts_GeoHourly_flash_count_nget(SAM_table ptr, SAM_error *err);

SAM_EXPORT double SAM_GeothermalCosts_GeoHourly_geotherm_cost_conf_multiplier_nget(SAM_table ptr, SAM_error *err);

SAM_EXPORT double SAM_GeothermalCosts_GeoHourly_geotherm_cost_conf_non_drill_nget(SAM_table ptr, SAM_error *err);

SAM_EXPORT double SAM_GeothermalCosts_GeoHourly_geotherm_cost_conf_num_wells_nget(SAM_table ptr, SAM_error *err);

SAM_EXPORT double SAM_GeothermalCosts_GeoHourly_geotherm_cost_expl_multiplier_nget(SAM_table ptr, SAM_error *err);

SAM_EXPORT double SAM_GeothermalCosts_GeoHourly_geotherm_cost_expl_non_drill_nget(SAM_table ptr, SAM_error *err);

SAM_EXPORT double SAM_GeothermalCosts_GeoHourly_geotherm_cost_expl_num_wells_nget(SAM_table ptr, SAM_error *err);

SAM_EXPORT double SAM_GeothermalCosts_GeoHourly_geotherm_cost_inj_cost_curve_nget(SAM_table ptr, SAM_error *err);

SAM_EXPORT double SAM_GeothermalCosts_GeoHourly_geotherm_cost_inj_cost_curve_welldiam_nget(SAM_table ptr, SAM_error *err);
Expand All @@ -402,6 +470,8 @@ extern "C"

SAM_EXPORT double SAM_GeothermalCosts_GeoHourly_geotherm_cost_prod_wells_drilled_nget(SAM_table ptr, SAM_error *err);

SAM_EXPORT double SAM_GeothermalCosts_GeoHourly_geotherm_cost_stim_non_drill_nget(SAM_table ptr, SAM_error *err);

SAM_EXPORT double SAM_GeothermalCosts_GeoHourly_gross_cost_output_nget(SAM_table ptr, SAM_error *err);

SAM_EXPORT double SAM_GeothermalCosts_GeoHourly_gross_output_nget(SAM_table ptr, SAM_error *err);
Expand Down Expand Up @@ -453,10 +523,18 @@ extern "C"

SAM_EXPORT double SAM_GeothermalCosts_Outputs_baseline_cost_nget(SAM_table ptr, SAM_error *err);

SAM_EXPORT double SAM_GeothermalCosts_Outputs_conf_total_cost_nget(SAM_table ptr, SAM_error *err);

SAM_EXPORT double SAM_GeothermalCosts_Outputs_drilling_total_cost_nget(SAM_table ptr, SAM_error *err);

SAM_EXPORT double SAM_GeothermalCosts_Outputs_expl_total_cost_nget(SAM_table ptr, SAM_error *err);

SAM_EXPORT double SAM_GeothermalCosts_Outputs_inj_total_cost_nget(SAM_table ptr, SAM_error *err);

SAM_EXPORT double SAM_GeothermalCosts_Outputs_prod_total_cost_nget(SAM_table ptr, SAM_error *err);

SAM_EXPORT double SAM_GeothermalCosts_Outputs_stim_total_cost_nget(SAM_table ptr, SAM_error *err);

#ifdef __cplusplus
} /* end of extern "C" { */
#endif
Expand Down
141 changes: 141 additions & 0 deletions api/modules/SAM_GeothermalCosts.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,42 @@ SAM_EXPORT void SAM_GeothermalCosts_GeoHourly_flash_count_nset(SAM_table ptr, do
});
}

SAM_EXPORT void SAM_GeothermalCosts_GeoHourly_geotherm_cost_conf_multiplier_nset(SAM_table ptr, double number, SAM_error *err){
translateExceptions(err, [&]{
ssc_data_set_number(ptr, "geotherm.cost.conf_multiplier", number);
});
}

SAM_EXPORT void SAM_GeothermalCosts_GeoHourly_geotherm_cost_conf_non_drill_nset(SAM_table ptr, double number, SAM_error *err){
translateExceptions(err, [&]{
ssc_data_set_number(ptr, "geotherm.cost.conf_non_drill", number);
});
}

SAM_EXPORT void SAM_GeothermalCosts_GeoHourly_geotherm_cost_conf_num_wells_nset(SAM_table ptr, double number, SAM_error *err){
translateExceptions(err, [&]{
ssc_data_set_number(ptr, "geotherm.cost.conf_num_wells", number);
});
}

SAM_EXPORT void SAM_GeothermalCosts_GeoHourly_geotherm_cost_expl_multiplier_nset(SAM_table ptr, double number, SAM_error *err){
translateExceptions(err, [&]{
ssc_data_set_number(ptr, "geotherm.cost.expl_multiplier", number);
});
}

SAM_EXPORT void SAM_GeothermalCosts_GeoHourly_geotherm_cost_expl_non_drill_nset(SAM_table ptr, double number, SAM_error *err){
translateExceptions(err, [&]{
ssc_data_set_number(ptr, "geotherm.cost.expl_non_drill", number);
});
}

SAM_EXPORT void SAM_GeothermalCosts_GeoHourly_geotherm_cost_expl_num_wells_nset(SAM_table ptr, double number, SAM_error *err){
translateExceptions(err, [&]{
ssc_data_set_number(ptr, "geotherm.cost.expl_num_wells", number);
});
}

SAM_EXPORT void SAM_GeothermalCosts_GeoHourly_geotherm_cost_inj_cost_curve_nset(SAM_table ptr, double number, SAM_error *err){
translateExceptions(err, [&]{
ssc_data_set_number(ptr, "geotherm.cost.inj_cost_curve", number);
Expand Down Expand Up @@ -128,6 +164,12 @@ SAM_EXPORT void SAM_GeothermalCosts_GeoHourly_geotherm_cost_prod_wells_drilled_n
});
}

SAM_EXPORT void SAM_GeothermalCosts_GeoHourly_geotherm_cost_stim_non_drill_nset(SAM_table ptr, double number, SAM_error *err){
translateExceptions(err, [&]{
ssc_data_set_number(ptr, "geotherm.cost.stim_non_drill", number);
});
}

SAM_EXPORT void SAM_GeothermalCosts_GeoHourly_gross_cost_output_nset(SAM_table ptr, double number, SAM_error *err){
translateExceptions(err, [&]{
ssc_data_set_number(ptr, "gross_cost_output", number);
Expand Down Expand Up @@ -359,6 +401,60 @@ SAM_EXPORT double SAM_GeothermalCosts_GeoHourly_flash_count_nget(SAM_table ptr,
return result;
}

SAM_EXPORT double SAM_GeothermalCosts_GeoHourly_geotherm_cost_conf_multiplier_nget(SAM_table ptr, SAM_error *err){
double result;
translateExceptions(err, [&]{
if (!ssc_data_get_number(ptr, "geotherm.cost.conf_multiplier", &result))
make_access_error("SAM_GeothermalCosts", "geotherm.cost.conf_multiplier");
});
return result;
}

SAM_EXPORT double SAM_GeothermalCosts_GeoHourly_geotherm_cost_conf_non_drill_nget(SAM_table ptr, SAM_error *err){
double result;
translateExceptions(err, [&]{
if (!ssc_data_get_number(ptr, "geotherm.cost.conf_non_drill", &result))
make_access_error("SAM_GeothermalCosts", "geotherm.cost.conf_non_drill");
});
return result;
}

SAM_EXPORT double SAM_GeothermalCosts_GeoHourly_geotherm_cost_conf_num_wells_nget(SAM_table ptr, SAM_error *err){
double result;
translateExceptions(err, [&]{
if (!ssc_data_get_number(ptr, "geotherm.cost.conf_num_wells", &result))
make_access_error("SAM_GeothermalCosts", "geotherm.cost.conf_num_wells");
});
return result;
}

SAM_EXPORT double SAM_GeothermalCosts_GeoHourly_geotherm_cost_expl_multiplier_nget(SAM_table ptr, SAM_error *err){
double result;
translateExceptions(err, [&]{
if (!ssc_data_get_number(ptr, "geotherm.cost.expl_multiplier", &result))
make_access_error("SAM_GeothermalCosts", "geotherm.cost.expl_multiplier");
});
return result;
}

SAM_EXPORT double SAM_GeothermalCosts_GeoHourly_geotherm_cost_expl_non_drill_nget(SAM_table ptr, SAM_error *err){
double result;
translateExceptions(err, [&]{
if (!ssc_data_get_number(ptr, "geotherm.cost.expl_non_drill", &result))
make_access_error("SAM_GeothermalCosts", "geotherm.cost.expl_non_drill");
});
return result;
}

SAM_EXPORT double SAM_GeothermalCosts_GeoHourly_geotherm_cost_expl_num_wells_nget(SAM_table ptr, SAM_error *err){
double result;
translateExceptions(err, [&]{
if (!ssc_data_get_number(ptr, "geotherm.cost.expl_num_wells", &result))
make_access_error("SAM_GeothermalCosts", "geotherm.cost.expl_num_wells");
});
return result;
}

SAM_EXPORT double SAM_GeothermalCosts_GeoHourly_geotherm_cost_inj_cost_curve_nget(SAM_table ptr, SAM_error *err){
double result;
translateExceptions(err, [&]{
Expand Down Expand Up @@ -431,6 +527,15 @@ SAM_EXPORT double SAM_GeothermalCosts_GeoHourly_geotherm_cost_prod_wells_drilled
return result;
}

SAM_EXPORT double SAM_GeothermalCosts_GeoHourly_geotherm_cost_stim_non_drill_nget(SAM_table ptr, SAM_error *err){
double result;
translateExceptions(err, [&]{
if (!ssc_data_get_number(ptr, "geotherm.cost.stim_non_drill", &result))
make_access_error("SAM_GeothermalCosts", "geotherm.cost.stim_non_drill");
});
return result;
}

SAM_EXPORT double SAM_GeothermalCosts_GeoHourly_gross_cost_output_nget(SAM_table ptr, SAM_error *err){
double result;
translateExceptions(err, [&]{
Expand Down Expand Up @@ -638,6 +743,33 @@ SAM_EXPORT double SAM_GeothermalCosts_Outputs_baseline_cost_nget(SAM_table ptr,
return result;
}

SAM_EXPORT double SAM_GeothermalCosts_Outputs_conf_total_cost_nget(SAM_table ptr, SAM_error *err){
double result;
translateExceptions(err, [&]{
if (!ssc_data_get_number(ptr, "conf_total_cost", &result))
make_access_error("SAM_GeothermalCosts", "conf_total_cost");
});
return result;
}

SAM_EXPORT double SAM_GeothermalCosts_Outputs_drilling_total_cost_nget(SAM_table ptr, SAM_error *err){
double result;
translateExceptions(err, [&]{
if (!ssc_data_get_number(ptr, "drilling_total_cost", &result))
make_access_error("SAM_GeothermalCosts", "drilling_total_cost");
});
return result;
}

SAM_EXPORT double SAM_GeothermalCosts_Outputs_expl_total_cost_nget(SAM_table ptr, SAM_error *err){
double result;
translateExceptions(err, [&]{
if (!ssc_data_get_number(ptr, "expl_total_cost", &result))
make_access_error("SAM_GeothermalCosts", "expl_total_cost");
});
return result;
}

SAM_EXPORT double SAM_GeothermalCosts_Outputs_inj_total_cost_nget(SAM_table ptr, SAM_error *err){
double result;
translateExceptions(err, [&]{
Expand All @@ -656,3 +788,12 @@ SAM_EXPORT double SAM_GeothermalCosts_Outputs_prod_total_cost_nget(SAM_table ptr
return result;
}

SAM_EXPORT double SAM_GeothermalCosts_Outputs_stim_total_cost_nget(SAM_table ptr, SAM_error *err){
double result;
translateExceptions(err, [&]{
if (!ssc_data_get_number(ptr, "stim_total_cost", &result))
make_access_error("SAM_GeothermalCosts", "stim_total_cost");
});
return result;
}

7 changes: 7 additions & 0 deletions api/src/SAM_eqns.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include <ssc/cmod_pvsamv1_eqns.h>
#include <ssc/cmod_merchantplant_eqns.h>
#include <ssc/cmod_analysisperiodchange_eqns.h>
#include <ssc/cmod_geothermal_eqns.h>

#include "SAM_api.h"
#include "SAM_eqns.h"
Expand Down Expand Up @@ -78,3 +79,9 @@ SAM_EXPORT void SAM_Reopt_size_standalone_battery_post_eqn(ssc_data_t data, SAM_
Reopt_size_standalone_battery_params(data);
});
}

SAM_EXPORT void SAM_getem_om_cost_calc_eqn(SAM_table data, SAM_error* err) {
translateExceptions(err, [&] {
getem_om_cost_calc(data);
});
}
2 changes: 2 additions & 0 deletions api/src/SAM_eqns.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ SAM_EXPORT void SAM_mp_ancillary_services_eqn(SAM_table data, SAM_error* err);

SAM_EXPORT void SAM_Reopt_size_standalone_battery_post_eqn(SAM_table data, SAM_error* err);

SAM_EXPORT void SAM_getem_om_cost_calc_eqn(SAM_table data, SAM_error* err);

#ifdef __cplusplus
} // extern "C"
#endif
Expand Down

0 comments on commit 2cdad1b

Please sign in to comment.