diff --git a/shared/lib_geothermal.cpp b/shared/lib_geothermal.cpp index 2bab0fc42..def77e0a5 100644 --- a/shared/lib_geothermal.cpp +++ b/shared/lib_geothermal.cpp @@ -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 diff --git a/shared/lib_geothermal.h b/shared/lib_geothermal.h index b970493ee..9dcdff2cc 100644 --- a/shared/lib_geothermal.h +++ b/shared/lib_geothermal.h @@ -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 }; @@ -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 diff --git a/ssc/cmod_geothermal.cpp b/ssc/cmod_geothermal.cpp index c9561e957..58d5acd71 100644 --- a/ssc/cmod_geothermal.cpp +++ b/ssc/cmod_geothermal.cpp @@ -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 @@ -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"))