Skip to content

Commit

Permalink
API updates to build and test pysam for GETEM
Browse files Browse the repository at this point in the history
  • Loading branch information
sjanzou committed Jan 7, 2025
1 parent 9dbd1a8 commit ff0eea6
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 23 deletions.
36 changes: 23 additions & 13 deletions api/include/SAM_GeothermalCosts.h
Original file line number Diff line number Diff line change
Expand Up @@ -121,47 +121,47 @@ extern "C"

/**
* Set geotherm.cost.conf_multiplier: Confirmation cost multiplier
* options: ?=1.2
* options: None
* 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
* options: None
* 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
* options: None
* 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
* options: None
* 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
* options: None
* 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
* options: None
* constraints: None
* required if: calc_drill_costs=1
*/
Expand Down Expand Up @@ -240,20 +240,20 @@ 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.pump_fixed: Fixed pump workover and casing cost [$]
* Set geotherm.cost.pump_depth: Pump depth [ft]
* options: None
* constraints: None
* required if: None
*/
SAM_EXPORT void SAM_GeothermalCosts_GeoHourly_geotherm_cost_pump_fixed_nset(SAM_table ptr, double number, SAM_error *err);
SAM_EXPORT void SAM_GeothermalCosts_GeoHourly_geotherm_cost_pump_depth_nset(SAM_table ptr, double number, SAM_error *err);

/**
* Set geotherm.cost.pump_geotherm.cost.pump_depth: Pump depth [ft]
* Set geotherm.cost.pump_fixed: Fixed pump workover and casing cost [$]
* options: None
* constraints: None
* required if: None
*/
SAM_EXPORT void SAM_GeothermalCosts_GeoHourly_geotherm_cost_pump_geotherm_cost_pump_depth_nset(SAM_table ptr, double number, SAM_error *err);
SAM_EXPORT void SAM_GeothermalCosts_GeoHourly_geotherm_cost_pump_fixed_nset(SAM_table ptr, double number, SAM_error *err);

/**
* Set geotherm.cost.pump_per_foot: Pump cost per foot [$/ft]
Expand All @@ -265,7 +265,7 @@ extern "C"

/**
* Set geotherm.cost.stim_non_drill: Stimulation non drilling costs [$]
* options: ?=0
* options: None
* constraints: None
* required if: calc_drill_costs=1
*/
Expand Down Expand Up @@ -295,6 +295,14 @@ extern "C"
*/
SAM_EXPORT void SAM_GeothermalCosts_GeoHourly_hp_flash_pressure_nset(SAM_table ptr, double number, SAM_error *err);

/**
* Set inj_num_pumps: Number of injection pumps [p]
* options: None
* constraints: None
* required if: None
*/
SAM_EXPORT void SAM_GeothermalCosts_GeoHourly_inj_num_pumps_nset(SAM_table ptr, double number, SAM_error *err);

/**
* Set inj_pump_hp: Injection pump power [hp]
* options: None
Expand Down Expand Up @@ -520,9 +528,9 @@ 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_pump_fixed_nget(SAM_table ptr, SAM_error *err);
SAM_EXPORT double SAM_GeothermalCosts_GeoHourly_geotherm_cost_pump_depth_nget(SAM_table ptr, SAM_error *err);

SAM_EXPORT double SAM_GeothermalCosts_GeoHourly_geotherm_cost_pump_geotherm_cost_pump_depth_nget(SAM_table ptr, SAM_error *err);
SAM_EXPORT double SAM_GeothermalCosts_GeoHourly_geotherm_cost_pump_fixed_nget(SAM_table ptr, SAM_error *err);

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

Expand All @@ -534,6 +542,8 @@ extern "C"

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

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

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

SAM_EXPORT double SAM_GeothermalCosts_GeoHourly_lp_flash_pressure_nget(SAM_table ptr, SAM_error *err);
Expand Down
35 changes: 25 additions & 10 deletions api/modules/SAM_GeothermalCosts.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -170,15 +170,15 @@ SAM_EXPORT void SAM_GeothermalCosts_GeoHourly_geotherm_cost_prod_wells_drilled_n
});
}

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

SAM_EXPORT void SAM_GeothermalCosts_GeoHourly_geotherm_cost_pump_geotherm_cost_pump_depth_nset(SAM_table ptr, double number, SAM_error *err){
SAM_EXPORT void SAM_GeothermalCosts_GeoHourly_geotherm_cost_pump_fixed_nset(SAM_table ptr, double number, SAM_error *err){
translateExceptions(err, [&]{
ssc_data_set_number(ptr, "geotherm.cost.pump_geotherm.cost.pump_depth", number);
ssc_data_set_number(ptr, "geotherm.cost.pump_fixed", number);
});
}

Expand Down Expand Up @@ -212,6 +212,12 @@ SAM_EXPORT void SAM_GeothermalCosts_GeoHourly_hp_flash_pressure_nset(SAM_table p
});
}

SAM_EXPORT void SAM_GeothermalCosts_GeoHourly_inj_num_pumps_nset(SAM_table ptr, double number, SAM_error *err){
translateExceptions(err, [&]{
ssc_data_set_number(ptr, "inj_num_pumps", number);
});
}

SAM_EXPORT void SAM_GeothermalCosts_GeoHourly_inj_pump_hp_nset(SAM_table ptr, double number, SAM_error *err){
translateExceptions(err, [&]{
ssc_data_set_number(ptr, "inj_pump_hp", number);
Expand Down Expand Up @@ -572,20 +578,20 @@ SAM_EXPORT double SAM_GeothermalCosts_GeoHourly_geotherm_cost_prod_wells_drilled
return result;
}

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

SAM_EXPORT double SAM_GeothermalCosts_GeoHourly_geotherm_cost_pump_geotherm_cost_pump_depth_nget(SAM_table ptr, SAM_error *err){
SAM_EXPORT double SAM_GeothermalCosts_GeoHourly_geotherm_cost_pump_fixed_nget(SAM_table ptr, SAM_error *err){
double result;
translateExceptions(err, [&]{
if (!ssc_data_get_number(ptr, "geotherm.cost.pump_geotherm.cost.pump_depth", &result))
make_access_error("SAM_GeothermalCosts", "geotherm.cost.pump_geotherm.cost.pump_depth");
if (!ssc_data_get_number(ptr, "geotherm.cost.pump_fixed", &result))
make_access_error("SAM_GeothermalCosts", "geotherm.cost.pump_fixed");
});
return result;
}
Expand Down Expand Up @@ -635,6 +641,15 @@ SAM_EXPORT double SAM_GeothermalCosts_GeoHourly_hp_flash_pressure_nget(SAM_table
return result;
}

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

SAM_EXPORT double SAM_GeothermalCosts_GeoHourly_inj_pump_hp_nget(SAM_table ptr, SAM_error *err){
double result;
translateExceptions(err, [&]{
Expand Down

0 comments on commit ff0eea6

Please sign in to comment.