Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Getem reservoir replacements #1222

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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", "", "" },

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for getting the new variable in before the release!

// 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