Skip to content

Commit

Permalink
Merge pull request #1222 from NREL/getem-reservoir-replacements
Browse files Browse the repository at this point in the history
Getem reservoir replacements
  • Loading branch information
mjprilliman authored Oct 21, 2024
2 parents e1c8169 + b26f79e commit a48633a
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion shared/lib_geothermal.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2414,7 +2414,7 @@ bool CGeothermalAnalyzer::RunAnalysis(bool(*update_function)(float, void*), void

// Is it possible and do we want to replace the reservoir in the next time step?
//bWantToReplaceReservoir = ( md_WorkingTemperatureC < (GetResourceTemperatureC() - geothermal::MAX_TEMPERATURE_DECLINE_C) ) ? true : false;
bWantToReplaceReservoir = (md_WorkingTemperatureC < (GetResourceTemperatureC() - mo_geo_in.md_MaxTempDeclineC)) ? true : false;
bWantToReplaceReservoir = (md_WorkingTemperatureC < (GetResourceTemperatureC() - mo_geo_in.md_MaxTempDeclineC) && mo_geo_in.md_AllowReservoirReplacements) ? true : false;
if (bWantToReplaceReservoir && CanReplaceReservoir(dElapsedTimeInYears + (1.0 / 12)))
{
ReplaceReservoir(dElapsedTimeInYears); // this will 'reset' temperature back to original resource temp
Expand Down
4 changes: 3 additions & 1 deletion shared/lib_geothermal.h
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ struct SGeothermal_Inputs
md_dtProdWell = md_dtProdWellChoice = 0.0;
md_NumberOfWellsProdExp = md_NumberOfWellsInjDrilled = md_NumberOfWellsProdDrilled = md_FailedWells = md_StimSuccessRate = md_DrillSuccessRate = 0;
md_FailedInjFlowRatio = md_FailedProdFlowRatio = md_InjWellFriction = md_ProdWellFriction = md_InjWellPressurePSI = md_InjectivityIndex = md_ExplorationWellsProd = 0;
md_UseWeatherFileConditions = 0.0;
md_UseWeatherFileConditions = md_AllowReservoirReplacements = 0.0;
}

calculationBasis me_cb; // { NO_CALCULATION_BASIS, POWER_SALES, NUMBER_OF_WELLS };
Expand Down Expand Up @@ -153,6 +153,8 @@ struct SGeothermal_Inputs
double md_dtProdWell; // degrees C, temperature loss in production well
double md_dtProdWellChoice; // Constant dt prod well or Ramey model

bool md_AllowReservoirReplacements;


const char * mc_WeatherFileName;
int * mia_tou; // time of use array
Expand Down
4 changes: 4 additions & 0 deletions ssc/cmod_geothermal.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,8 @@ static var_info _cm_vtab_geothermal[] = {
// dispatch
{ SSC_INPUT, SSC_STRING, "hybrid_dispatch_schedule", "Daily dispatch schedule", "", "", "GeoHourly", "ui_calculations_only=0", "TOUSCHED", "" },

{ SSC_INPUT, SSC_NUMBER, "allow_reservoir_replacements", "Allow reservoir replacements", "", "", "GeoHourly", "?=0", "", "" },

// OUTPUTS
// VARTYPE DATATYPE NAME LABEL UNITS META GROUP REQUIRED_IF CONSTRAINTS UI_HINTS

Expand Down Expand Up @@ -366,6 +368,8 @@ class cm_geothermal : public compute_module
geo_inputs.md_EGSFractureWidthM = as_double("fracture_width");
geo_inputs.md_EGSFractureAngle = as_double("fracture_angle");

geo_inputs.md_AllowReservoirReplacements = as_boolean("allow_reservoir_replacements");

// calculate output array sizes
geo_inputs.mi_ModelChoice = as_integer("model_choice"); // 0=GETEM, 1=Power Block monthly, 2=Power Block hourly
if (is_assigned("reservoir_model_inputs"))
Expand Down

0 comments on commit a48633a

Please sign in to comment.