Skip to content

Commit

Permalink
Latest GETEM updates
Browse files Browse the repository at this point in the history
  • Loading branch information
sjanzou committed Jan 13, 2025
1 parent f5f1597 commit 496dd8b
Show file tree
Hide file tree
Showing 11 changed files with 159 additions and 7 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,7 @@ files/defaults/
.mypy_cache

*.zip

*.dll

*.lib
Binary file removed files/SAM_api.dll
Binary file not shown.
Binary file removed files/SAM_api.lib
Binary file not shown.
Binary file removed files/ssc.dll
Binary file not shown.
Binary file removed files/ssc.lib
Binary file not shown.
Binary file removed files/sscd.dll
Binary file not shown.
Binary file removed files/sscd.lib
Binary file not shown.
15 changes: 15 additions & 0 deletions modules/Geothermal.c
Original file line number Diff line number Diff line change
Expand Up @@ -1013,6 +1013,18 @@ GeoHourly_set_stim_success_rate(VarGroupObject *self, PyObject *value, void *clo
return PySAM_double_setter(value, SAM_Geothermal_GeoHourly_stim_success_rate_nset, self->data_ptr);
}

static PyObject *
GeoHourly_get_stimulation_type(VarGroupObject *self, void *closure)
{
return PySAM_double_getter(SAM_Geothermal_GeoHourly_stimulation_type_nget, self->data_ptr);
}

static int
GeoHourly_set_stimulation_type(VarGroupObject *self, PyObject *value, void *closure)
{
return PySAM_double_setter(value, SAM_Geothermal_GeoHourly_stimulation_type_nset, self->data_ptr);
}

static PyObject *
GeoHourly_get_subsurface_water_loss(VarGroupObject *self, void *closure)
{
Expand Down Expand Up @@ -1344,6 +1356,9 @@ static PyGetSetDef GeoHourly_getset[] = {
{"stim_success_rate", (getter)GeoHourly_get_stim_success_rate,(setter)GeoHourly_set_stim_success_rate,
PyDoc_STR("*float*: Stimulation success rate [%]\n\nThe value of the following variables depends on ``stim_success_rate``:\n\n\t - num_wells_getem\n"),
NULL},
{"stimulation_type", (getter)GeoHourly_get_stimulation_type,(setter)GeoHourly_set_stimulation_type,
PyDoc_STR("*float*: Which wells are stimulated [0/1/2/3]\n\n**Options:**\n0=Injection,1=Production,2=Both,3=Neither\n\n**Required:**\nFalse. Automatically set to 3 if not assigned explicitly or loaded from defaults."),
NULL},
{"subsurface_water_loss", (getter)GeoHourly_get_subsurface_water_loss,(setter)GeoHourly_set_subsurface_water_loss,
PyDoc_STR("*float*: Subsurface water loss [%]\n\n**Required:**\nTrue\n\nThe value of the following variables depends on ``subsurface_water_loss``:\n\n\t - num_wells_getem\n"),
NULL},
Expand Down
137 changes: 130 additions & 7 deletions modules/GeothermalCosts.c
Original file line number Diff line number Diff line change
Expand Up @@ -367,6 +367,18 @@ GeoHourly_set_geotherm_cost_prod_cost_curve_welltype(VarGroupObject *self, PyObj
return PySAM_double_setter(value, SAM_GeothermalCosts_GeoHourly_geotherm_cost_prod_cost_curve_welltype_nset, self->data_ptr);
}

static PyObject *
GeoHourly_get_geotherm_cost_prod_req(VarGroupObject *self, void *closure)
{
return PySAM_double_getter(SAM_GeothermalCosts_GeoHourly_geotherm_cost_prod_req_nget, self->data_ptr);
}

static int
GeoHourly_set_geotherm_cost_prod_req(VarGroupObject *self, PyObject *value, void *closure)
{
return PySAM_double_setter(value, SAM_GeothermalCosts_GeoHourly_geotherm_cost_prod_req_nset, self->data_ptr);
}

static PyObject *
GeoHourly_get_geotherm_cost_prod_wells_drilled(VarGroupObject *self, void *closure)
{
Expand All @@ -379,6 +391,42 @@ GeoHourly_set_geotherm_cost_prod_wells_drilled(VarGroupObject *self, PyObject *v
return PySAM_double_setter(value, SAM_GeothermalCosts_GeoHourly_geotherm_cost_prod_wells_drilled_nset, self->data_ptr);
}

static PyObject *
GeoHourly_get_geotherm_cost_pump_depth(VarGroupObject *self, void *closure)
{
return PySAM_double_getter(SAM_GeothermalCosts_GeoHourly_geotherm_cost_pump_depth_nget, self->data_ptr);
}

static int
GeoHourly_set_geotherm_cost_pump_depth(VarGroupObject *self, PyObject *value, void *closure)
{
return PySAM_double_setter(value, SAM_GeothermalCosts_GeoHourly_geotherm_cost_pump_depth_nset, self->data_ptr);
}

static PyObject *
GeoHourly_get_geotherm_cost_pump_fixed(VarGroupObject *self, void *closure)
{
return PySAM_double_getter(SAM_GeothermalCosts_GeoHourly_geotherm_cost_pump_fixed_nget, self->data_ptr);
}

static int
GeoHourly_set_geotherm_cost_pump_fixed(VarGroupObject *self, PyObject *value, void *closure)
{
return PySAM_double_setter(value, SAM_GeothermalCosts_GeoHourly_geotherm_cost_pump_fixed_nset, self->data_ptr);
}

static PyObject *
GeoHourly_get_geotherm_cost_pump_per_foot(VarGroupObject *self, void *closure)
{
return PySAM_double_getter(SAM_GeothermalCosts_GeoHourly_geotherm_cost_pump_per_foot_nget, self->data_ptr);
}

static int
GeoHourly_set_geotherm_cost_pump_per_foot(VarGroupObject *self, PyObject *value, void *closure)
{
return PySAM_double_setter(value, SAM_GeothermalCosts_GeoHourly_geotherm_cost_pump_per_foot_nset, self->data_ptr);
}

static PyObject *
GeoHourly_get_geotherm_cost_stim_non_drill(VarGroupObject *self, void *closure)
{
Expand Down Expand Up @@ -427,6 +475,30 @@ GeoHourly_set_hp_flash_pressure(VarGroupObject *self, PyObject *value, void *clo
return PySAM_double_setter(value, SAM_GeothermalCosts_GeoHourly_hp_flash_pressure_nset, self->data_ptr);
}

static PyObject *
GeoHourly_get_inj_num_pumps(VarGroupObject *self, void *closure)
{
return PySAM_double_getter(SAM_GeothermalCosts_GeoHourly_inj_num_pumps_nget, self->data_ptr);
}

static int
GeoHourly_set_inj_num_pumps(VarGroupObject *self, PyObject *value, void *closure)
{
return PySAM_double_setter(value, SAM_GeothermalCosts_GeoHourly_inj_num_pumps_nset, self->data_ptr);
}

static PyObject *
GeoHourly_get_inj_pump_hp(VarGroupObject *self, void *closure)
{
return PySAM_double_getter(SAM_GeothermalCosts_GeoHourly_inj_pump_hp_nget, self->data_ptr);
}

static int
GeoHourly_set_inj_pump_hp(VarGroupObject *self, PyObject *value, void *closure)
{
return PySAM_double_setter(value, SAM_GeothermalCosts_GeoHourly_inj_pump_hp_nset, self->data_ptr);
}

static PyObject *
GeoHourly_get_lp_flash_pressure(VarGroupObject *self, void *closure)
{
Expand Down Expand Up @@ -499,6 +571,18 @@ GeoHourly_set_pressure_ratio_3(VarGroupObject *self, PyObject *value, void *clos
return PySAM_double_setter(value, SAM_GeothermalCosts_GeoHourly_pressure_ratio_3_nset, self->data_ptr);
}

static PyObject *
GeoHourly_get_pump_size_hp(VarGroupObject *self, void *closure)
{
return PySAM_double_getter(SAM_GeothermalCosts_GeoHourly_pump_size_hp_nget, self->data_ptr);
}

static int
GeoHourly_set_pump_size_hp(VarGroupObject *self, PyObject *value, void *closure)
{
return PySAM_double_setter(value, SAM_GeothermalCosts_GeoHourly_pump_size_hp_nset, self->data_ptr);
}

static PyObject *
GeoHourly_get_qCondenser(VarGroupObject *self, void *closure)
{
Expand Down Expand Up @@ -690,22 +774,22 @@ static PyGetSetDef GeoHourly_getset[] = {
PyDoc_STR("*float*: Flash Count [(1 -2)]\n\n**Required:**\nRequired if conversion_type=1"),
NULL},
{"geotherm_cost_conf_multiplier", (getter)GeoHourly_get_geotherm_cost_conf_multiplier,(setter)GeoHourly_set_geotherm_cost_conf_multiplier,
PyDoc_STR("*float*: Confirmation cost multiplier\n\n**Options:**\n?=1.2\n\n**Required:**\nRequired if calc_drill_costs=1"),
PyDoc_STR("*float*: Confirmation cost multiplier\n\n**Required:**\nRequired if calc_drill_costs=1"),
NULL},
{"geotherm_cost_conf_non_drill", (getter)GeoHourly_get_geotherm_cost_conf_non_drill,(setter)GeoHourly_set_geotherm_cost_conf_non_drill,
PyDoc_STR("*float*: Confirmation non drilling costs [$]\n\n**Options:**\n?=250000\n\n**Required:**\nRequired if calc_drill_costs=1"),
PyDoc_STR("*float*: Confirmation non drilling costs [$]\n\n**Required:**\nRequired if calc_drill_costs=1"),
NULL},
{"geotherm_cost_conf_num_wells", (getter)GeoHourly_get_geotherm_cost_conf_num_wells,(setter)GeoHourly_set_geotherm_cost_conf_num_wells,
PyDoc_STR("*float*: Number of confirmation wells\n\n**Options:**\n?=2\n\n**Required:**\nRequired if calc_drill_costs=1"),
PyDoc_STR("*float*: Number of confirmation wells\n\n**Required:**\nRequired if calc_drill_costs=1"),
NULL},
{"geotherm_cost_expl_multiplier", (getter)GeoHourly_get_geotherm_cost_expl_multiplier,(setter)GeoHourly_set_geotherm_cost_expl_multiplier,
PyDoc_STR("*float*: Exploration cost multiplier\n\n**Options:**\n?=0.5\n\n**Required:**\nRequired if calc_drill_costs=1"),
PyDoc_STR("*float*: Exploration cost multiplier\n\n**Required:**\nRequired if calc_drill_costs=1"),
NULL},
{"geotherm_cost_expl_non_drill", (getter)GeoHourly_get_geotherm_cost_expl_non_drill,(setter)GeoHourly_set_geotherm_cost_expl_non_drill,
PyDoc_STR("*float*: Exploration non drilling costs [$]\n\n**Options:**\n?=750000\n\n**Required:**\nRequired if calc_drill_costs=1"),
PyDoc_STR("*float*: Exploration non drilling costs [$]\n\n**Required:**\nRequired if calc_drill_costs=1"),
NULL},
{"geotherm_cost_expl_num_wells", (getter)GeoHourly_get_geotherm_cost_expl_num_wells,(setter)GeoHourly_set_geotherm_cost_expl_num_wells,
PyDoc_STR("*float*: Number of exploration wells\n\n**Options:**\n?=2\n\n**Required:**\nRequired if calc_drill_costs=1"),
PyDoc_STR("*float*: Number of exploration wells\n\n**Required:**\nRequired if calc_drill_costs=1"),
NULL},
{"geotherm_cost_inj_cost_curve", (getter)GeoHourly_get_geotherm_cost_inj_cost_curve,(setter)GeoHourly_set_geotherm_cost_inj_cost_curve,
PyDoc_STR("*float*: Injection well diameter type [0/1]\n\n**Options:**\n0=LargerDiameter,1=SmallerDiameter\n\n**Required:**\nRequired if calc_drill_costs=1"),
Expand All @@ -728,11 +812,23 @@ static PyGetSetDef GeoHourly_getset[] = {
{"geotherm_cost_prod_cost_curve_welltype", (getter)GeoHourly_get_geotherm_cost_prod_cost_curve_welltype,(setter)GeoHourly_set_geotherm_cost_prod_cost_curve_welltype,
PyDoc_STR("*float*: Production well type [0/1]\n\n**Required:**\nRequired if calc_drill_costs=1"),
NULL},
{"geotherm_cost_prod_req", (getter)GeoHourly_get_geotherm_cost_prod_req,(setter)GeoHourly_set_geotherm_cost_prod_req,
PyDoc_STR("*float*: Number of production wells required"),
NULL},
{"geotherm_cost_prod_wells_drilled", (getter)GeoHourly_get_geotherm_cost_prod_wells_drilled,(setter)GeoHourly_set_geotherm_cost_prod_wells_drilled,
PyDoc_STR("*float*: Number of drilled production wells [0/1]\n\n**Options:**\n0=LargerDiameter,1=SmallerDiameter\n\n**Required:**\nRequired if calc_drill_costs=1"),
NULL},
{"geotherm_cost_pump_depth", (getter)GeoHourly_get_geotherm_cost_pump_depth,(setter)GeoHourly_set_geotherm_cost_pump_depth,
PyDoc_STR("*float*: Pump depth [ft]"),
NULL},
{"geotherm_cost_pump_fixed", (getter)GeoHourly_get_geotherm_cost_pump_fixed,(setter)GeoHourly_set_geotherm_cost_pump_fixed,
PyDoc_STR("*float*: Fixed pump workover and casing cost [$]"),
NULL},
{"geotherm_cost_pump_per_foot", (getter)GeoHourly_get_geotherm_cost_pump_per_foot,(setter)GeoHourly_set_geotherm_cost_pump_per_foot,
PyDoc_STR("*float*: Pump cost per foot [$/ft]"),
NULL},
{"geotherm_cost_stim_non_drill", (getter)GeoHourly_get_geotherm_cost_stim_non_drill,(setter)GeoHourly_set_geotherm_cost_stim_non_drill,
PyDoc_STR("*float*: Stimulation non drilling costs [$]\n\n**Options:**\n?=0\n\n**Required:**\nRequired if calc_drill_costs=1"),
PyDoc_STR("*float*: Stimulation non drilling costs [$]\n\n**Required:**\nRequired if calc_drill_costs=1"),
NULL},
{"gross_cost_output", (getter)GeoHourly_get_gross_cost_output,(setter)GeoHourly_set_gross_cost_output,
PyDoc_STR("*float*: Gross output from GETEM for cost calculations [MW]\n\n**Required:**\nTrue"),
Expand All @@ -743,6 +839,12 @@ static PyGetSetDef GeoHourly_getset[] = {
{"hp_flash_pressure", (getter)GeoHourly_get_hp_flash_pressure,(setter)GeoHourly_set_hp_flash_pressure,
PyDoc_STR("*float*: HP Flash Pressure [psia]\n\n**Required:**\nRequired if conversion_type=1"),
NULL},
{"inj_num_pumps", (getter)GeoHourly_get_inj_num_pumps,(setter)GeoHourly_set_inj_num_pumps,
PyDoc_STR("*float*: Number of injection pumps [p]"),
NULL},
{"inj_pump_hp", (getter)GeoHourly_get_inj_pump_hp,(setter)GeoHourly_set_inj_pump_hp,
PyDoc_STR("*float*: Injection pump power [hp]"),
NULL},
{"lp_flash_pressure", (getter)GeoHourly_get_lp_flash_pressure,(setter)GeoHourly_set_lp_flash_pressure,
PyDoc_STR("*float*: LP Flash Pressure [psia]\n\n**Required:**\nRequired if conversion_type=1"),
NULL},
Expand All @@ -761,6 +863,9 @@ static PyGetSetDef GeoHourly_getset[] = {
{"pressure_ratio_3", (getter)GeoHourly_get_pressure_ratio_3,(setter)GeoHourly_set_pressure_ratio_3,
PyDoc_STR("*float*: Suction Steam Ratio 3\n\n**Required:**\nRequired if conversion_type=1"),
NULL},
{"pump_size_hp", (getter)GeoHourly_get_pump_size_hp,(setter)GeoHourly_set_pump_size_hp,
PyDoc_STR("*float*: Production pump power [hp]"),
NULL},
{"qCondenser", (getter)GeoHourly_get_qCondenser,(setter)GeoHourly_set_qCondenser,
PyDoc_STR("*float*: Condenser Heat Rejected [btu/h]\n\n**Required:**\nRequired if conversion_type=1"),
NULL},
Expand Down Expand Up @@ -963,6 +1068,18 @@ Outputs_get_stim_total_cost(VarGroupObject *self, void *closure)
return PySAM_double_getter(SAM_GeothermalCosts_Outputs_stim_total_cost_nget, self->data_ptr);
}

static PyObject *
Outputs_get_total_gathering_cost(VarGroupObject *self, void *closure)
{
return PySAM_double_getter(SAM_GeothermalCosts_Outputs_total_gathering_cost_nget, self->data_ptr);
}

static PyObject *
Outputs_get_total_pump_cost(VarGroupObject *self, void *closure)
{
return PySAM_double_getter(SAM_GeothermalCosts_Outputs_total_pump_cost_nget, self->data_ptr);
}

static PyGetSetDef Outputs_getset[] = {
{"baseline_cost", (getter)Outputs_get_baseline_cost,(setter)0,
PyDoc_STR("*float*: Baseline cost [$/kW]"),
Expand All @@ -985,6 +1102,12 @@ static PyGetSetDef Outputs_getset[] = {
{"stim_total_cost", (getter)Outputs_get_stim_total_cost,(setter)0,
PyDoc_STR("*float*: Total stimulation well cost [$]"),
NULL},
{"total_gathering_cost", (getter)Outputs_get_total_gathering_cost,(setter)0,
PyDoc_STR("*float*: Total gathering well cost [$/kW]"),
NULL},
{"total_pump_cost", (getter)Outputs_get_total_pump_cost,(setter)0,
PyDoc_STR("*float*: Total pumping cost [$/kW]"),
NULL},
{NULL} /* Sentinel */
};

Expand Down
1 change: 1 addition & 0 deletions stubs/stubs/Geothermal.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ class Geothermal(object):
startup_frac = float
startup_time = float
stim_success_rate = float
stimulation_type = float
subsurface_water_loss = float
system_use_lifetime_output = float
temp_decline_max = float
Expand Down
9 changes: 9 additions & 0 deletions stubs/stubs/GeothermalCosts.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -60,17 +60,24 @@ class GeothermalCosts(object):
geotherm_cost_prod_cost_curve = float
geotherm_cost_prod_cost_curve_welldiam = float
geotherm_cost_prod_cost_curve_welltype = float
geotherm_cost_prod_req = float
geotherm_cost_prod_wells_drilled = float
geotherm_cost_pump_depth = float
geotherm_cost_pump_fixed = float
geotherm_cost_pump_per_foot = float
geotherm_cost_stim_non_drill = float
gross_cost_output = float
gross_output = float
hp_flash_pressure = float
inj_num_pumps = float
inj_pump_hp = float
lp_flash_pressure = float
ncg_condensate_pump = float
ppi_base_year = float
pressure_ratio_1 = float
pressure_ratio_2 = float
pressure_ratio_3 = float
pump_size_hp = float
qCondenser = float
qRejectByStage_1 = float
qRejectByStage_2 = float
Expand Down Expand Up @@ -104,6 +111,8 @@ class GeothermalCosts(object):
inj_total_cost = float
prod_total_cost = float
stim_total_cost = float
total_gathering_cost = float
total_pump_cost = float



Expand Down

0 comments on commit 496dd8b

Please sign in to comment.