Skip to content

Commit

Permalink
Add stimulation option input, fix switch case, update calcs based on
Browse files Browse the repository at this point in the history
debugging Flash technologies (EGS and hydro)
  • Loading branch information
mjprilliman committed Jan 3, 2025
1 parent 1a21115 commit 9e66389
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
12 changes: 10 additions & 2 deletions shared/lib_geothermal.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1538,6 +1538,7 @@ void CGeothermalAnalyzer::WellCountDecisionTable(void)
production_stim_well = 0;
injection_stim_well = 0;
}
break;
case 1:
if (mo_geo_in.me_rt == HYDROTHERMAL) {
production_stim_well = SWDDE;
Expand All @@ -1555,6 +1556,7 @@ void CGeothermalAnalyzer::WellCountDecisionTable(void)
production_stim_well = 0;
injection_stim_well = 0;
}
break;
case 2:
if (mo_geo_in.me_rt == HYDROTHERMAL) {
production_stim_well = SWDDE;
Expand All @@ -1568,6 +1570,11 @@ void CGeothermalAnalyzer::WellCountDecisionTable(void)
production_stim_well = 0;
injection_stim_well = 0;
}
break;
case 3:
production_stim_well = 0;
injection_stim_well = 0;
break;
}
mp_geo_out->ProdWellsExploration = production_stim_well;
mp_geo_out->InjWellsExploration = injection_stim_well;
Expand Down Expand Up @@ -1597,8 +1604,9 @@ double CGeothermalAnalyzer::GetNumberOfWells(void)
mp_geo_out->md_PumpWorkWattHrPerLb = GetPumpWorkWattHrPerLb();
mp_geo_out->md_NumberOfWells = mo_geo_in.md_DesiredSalesCapacityKW / netCapacityPerWell;
if (mp_geo_out->md_NumberOfWells < 0) mp_geo_out->md_NumberOfWells = 0;
mp_geo_out->md_NumberOfWellsProdExp = (mp_geo_out->md_NumberOfWells > mp_geo_out->ProdWellsExploration) ? mp_geo_out->md_NumberOfWells - mo_geo_in.md_ExplorationWellsProd : 0.0;
mp_geo_out->md_NumberOfWellsProdDrilled = mp_geo_out->md_NumberOfWellsProdExp / (1 - (1 - mo_geo_in.md_StimSuccessRate) * (1 - mo_geo_in.md_DrillSuccessRate));
mp_geo_out->md_NumberOfWellsProdExp = (mp_geo_out->md_NumberOfWells > mp_geo_out->ProdWellsExploration) ? mp_geo_out->md_NumberOfWells - mp_geo_out->ProdWellsExploration : 0.0;
double prod_well_stim_success_rate = (prod_wells_stimulated) ? mo_geo_in.md_StimSuccessRate : 0.0;
mp_geo_out->md_NumberOfWellsProdDrilled = mp_geo_out->md_NumberOfWellsProdExp / (1 - (1 - prod_well_stim_success_rate) * (1 - mo_geo_in.md_DrillSuccessRate));
double num_prod_wells_successful = mp_geo_out->md_NumberOfWellsProdDrilled * mo_geo_in.md_DrillSuccessRate;
double num_prod_wells_failed = mp_geo_out->md_NumberOfWellsProdDrilled * (1 - mo_geo_in.md_DrillSuccessRate);
//2. # of Injection Wells Required = # successful injection wells required in drilling phase + # successful injection wells drilled in exploration phase
Expand Down
2 changes: 2 additions & 0 deletions ssc/cmod_geothermal.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ static var_info _cm_vtab_geothermal[] = {
{ SSC_INPUT, SSC_NUMBER, "drilling_success_rate", "Drilling success rate", "%", "", "GeoHourly", "", "", "" },
{ SSC_INPUT, SSC_NUMBER, "stim_success_rate", "Stimulation success rate", "%", "", "GeoHourly", "", "", "" },
{ SSC_INPUT, SSC_NUMBER, "failed_prod_flow_ratio", "Failed production well flow ratio", "", "", "GeoHourly", "", "", "" },
{ SSC_INPUT, SSC_NUMBER, "stimulation_type", "Which wells are stimulated", "0/1/2/3", "0=Injection,1=Production,2=Both,3=Neither", "GeoHourly", "?=3", "", "" },

//{ SSC_INOUT, SSC_NUMBER, "baseline_cost", "Baseline cost", "$/kW", "", "GeoHourly", "?=0", "", "" },

Expand Down Expand Up @@ -278,6 +279,7 @@ class cm_geothermal : public compute_module
geo_inputs.md_FailedProdFlowRatio = as_double("failed_prod_flow_ratio");
geo_inputs.md_DesiredSalesCapacityKW = as_double("nameplate");
geo_inputs.md_NumberOfWells = as_double("num_wells");
geo_inputs.md_WellsStimulated = as_integer("stimulation_type");
if ( as_integer("analysis_type") == 0)
geo_inputs.me_cb = POWER_SALES;
else
Expand Down

0 comments on commit 9e66389

Please sign in to comment.