Skip to content

Commit

Permalink
Begin adding om cost module
Browse files Browse the repository at this point in the history
  • Loading branch information
mjprilliman committed Aug 8, 2023
1 parent 6a0808f commit 019fe35
Show file tree
Hide file tree
Showing 4 changed files with 592 additions and 3 deletions.
16 changes: 16 additions & 0 deletions shared/lib_geothermal.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1461,6 +1461,22 @@ double CGeothermalAnalyzer::GetNumberOfWells(void)
mp_geo_out->md_BrineEff = GetPlantBrineEffectiveness();
mp_geo_out->md_PumpWorkWattHrPerLb = GetPumpWorkWattHrPerLb();
mp_geo_out->md_NumberOfWells = mo_geo_in.md_DesiredSalesCapacityKW / netCapacityPerWell;
mp_geo_out->md_NumberOfWellsProdExp = mp_geo_out->md_NumberOfWells - mp_geo_out->md_FailedWells;
mp_geo_out->md_NumberOfWellsProdDrilled = mp_geo_out->md_NumberOfWellsProdExp / (1 - (1 - mp_geo_out->md_StimSuccessRate) * (1 - mp_geo_out->md_DrillSuccessRate));
double num_prod_wells_successful = mp_geo_out->md_NumberOfWellsProdDrilled * mp_geo_out->md_DrillSuccessRate;
double num_prod_wells_failed = mp_geo_out->md_NumberOfWellsProdDrilled * (1 - mp_geo_out->md_DrillSuccessRate);
double inj_flow = flowRatePerWell() * mp_geo_out->md_NumberOfWells;
double failed_prod_wells_inj = mp_geo_out->md_NumberOfWellsProdDrilled - num_prod_wells_successful;
double friction = 0.1;
double prod_failed_inj_rate = (mp_geo_out->md_FailedProdFlowRatio * 1000 / mo_geo_in.md_ReservoirDeltaPressure) *
GetPressureChangeAcrossReservoir() / mo_geo_in.md_RatioInjectionToProduction + GetInjectionPumpWorkft() * InjectionDensity() / 144.0 + pressureWellHeadPSI() -
friction * pow(mp_geo_out->md_FailedProdFlowRatio, 2) - pressureHydrostaticPSI();
double inj_rate_failed_prod_wells = MIN(0, flowRatePerWell()); //Injectivity of failed production well?
double inj_rate_failed_inj_wells = MIN(0, flowRatePerWell());
mp_geo_out->md_NumberOfWellsInj = (inj_flow - (failed_prod_wells_inj * inj_rate_failed_prod_wells)) / (flowPerWellInj + inj_rate_failed_inj_wells * (1 / (mp_geo_out->md_DrillSuccessRate - 1)));
mp_geo_out->md_NumberOfWellsInjDrilled = (1 / mp_geo_out->md_DrillSuccessRate) * mp_geo_out->md_NumberOfWellsInj;
double num_inj_wells_successful = mp_geo_out->md_NumberOfWellsInjDrilled * mp_geo_out->md_DrillSuccessRate;
double num_inj_wells_failed = mp_geo_out->md_NumberOfWellsInjDrilled * (1 - mp_geo_out->md_DrillSuccessRate);
mp_geo_out->md_NumberOfWellsInj = (mo_geo_in.md_DesiredSalesCapacityKW / (netBrineEffectiveness / 1000)) * (mp_geo_out->md_FractionGFInjected) / flowPerWellInj;
mp_geo_out->md_InjPump_hp = ( (mp_geo_out->md_NumberOfWellsInj * flowPerWellInj * GetInjectionPumpWorkft()) / (60 * 33000) ) / mo_geo_in.md_GFPumpEfficiency;
}
Expand Down
23 changes: 21 additions & 2 deletions shared/lib_geothermal.h
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,9 @@ struct SGeothermal_Inputs
md_TemperatureEGSAmbientC = md_RatioInjectionToProduction = 0.0;
md_AdditionalPressure = 1.0;
md_dtProdWell = md_dtProdWellChoice = 0.0;
}
md_NumberOfWellsProdExp = md_NumberOfWellsInjDrilled = md_NumberOfWellsProdDrilled = md_FailedWells = md_StimSuccessRate = md_DrillSuccessRate = 0;
md_FailedInjFlowRatio = md_FailedProdFlowRatio = 0;
}

calculationBasis me_cb; // { NO_CALCULATION_BASIS, POWER_SALES, NUMBER_OF_WELLS };
conversionTypes me_ct;
Expand All @@ -91,6 +93,14 @@ struct SGeothermal_Inputs
size_t mi_TotalMakeupCalculations; // mi_ProjectLifeYears * mi_MakeupCalculationsPerYear

double md_DesiredSalesCapacityKW; // entered or calculated, linked to 'cb'
double md_NumberOfWellsProdExp;
double md_NumberOfWellsProdDrilled;
double md_NumberOfWellsInjDrilled;
double md_FailedWells;
double md_FailedInjFlowRatio;
double md_FailedProdFlowRatio;
double md_StimSuccessRate;
double md_DrillSuccessRate;
double md_NumberOfWells; // entered or calculated, depending on 'cb'
double md_NumberofWellsInj;
double md_PlantEfficiency; // not in GETEM - essentially the ratio of plant brine effectiveness to max possible brine effectiveness
Expand Down Expand Up @@ -152,11 +162,20 @@ struct SGeothermal_Outputs
mb_BrineEffectivenessCalculated = mb_FlashPressuresCalculated = false;
maf_hourly_power = NULL;
ElapsedHours = 0;

md_NumberOfWellsProdExp = md_NumberOfWellsProdDrilled = md_NumberOfWellsInjDrilled = md_FailedWells = md_StimSuccessRate = md_DrillSuccessRate = 0;
md_FailedInjFlowRatio = md_FailedProdFlowRatio = 0;
}

//Following list of variables used as inputs in cmod_geothermal_costs.cpp for calculating direct geothermal plant cost:
double md_NumberOfWells;
double md_NumberOfWellsProdExp;
double md_NumberOfWellsProdDrilled;
double md_NumberOfWellsInjDrilled;
double md_FailedWells;
double md_FailedInjFlowRatio;
double md_FailedProdFlowRatio;
double md_StimSuccessRate;
double md_DrillSuccessRate;
double md_NumberOfWellsInj;
double md_PumpWorkKW;
double eff_secondlaw; //Overall Plant 2nd Law Efficiency
Expand Down
7 changes: 6 additions & 1 deletion ssc/cmod_geothermal_costs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,8 @@ class cm_geothermal_costs : public compute_module
std::vector<double> pump_ppi{ 0.853394181,0.872219053,0.899600685,0.924130063,0.936679977,0.950370793,0.976041072,1.000000000,1.010838562,1.039931546,1.093553908,1.142042213,1.213348545,1.278379920,1.314318311,1.324586423,1.324586423,1.349115801,1.339418140,1.366799772,1.391899601,1.411294923,1.438106104,1.489,1.553,1.575,1.660,1.000 }; //Pump Cost Index Normalized to 2001, 2002, 2007, 2010 and 2012; Beginning Year = 1995; Final Year = 2016;
std::vector<double> turbine_ppi{ 0.882850242,0.896135266,0.917874396,0.934782609,0.960144928,0.969202899,0.980072464,1.000000000,1.013285024,1.018719807,1.017512077,1.050120773,1.106884058,1.245169082,1.350241546,1.340579710,1.359903382,1.349637681,1.376811594,1.411835749,1.399154589,1.403046162,1.346947738,1.327974034,1.408,1.452,1.491,1.000 }; //Turbine-Generator Cost Index Normalized to 2001, 2002, 2007, 2010 and 2012; Beginning Year = 1995; Final Year = 2016;
std::vector<double> construction_ppi{ 0.790555556,0.816666667,0.842222222,0.872777778,0.909444444,0.933333333,0.957777778,1.000000000,1.039444444,1.067222222,1.088888889,1.129444444,1.170000000,1.221666667,1.277777778,1.320000000,1.357777778,1.361666667,1.374444444,1.426666667,1.475000000,1.528333333,1.594444444,1.653,1.676,1.708,1.753,1.000 };
double user_adjust = 1; //User Adjustment (Constant)
std::vector<double> drilling_ppi{ 0.319,0.353,0.441,0.474,0.408,0.425,0.540,0.471,0.471,0.517,0.808,1.180,1.121,1.142,1.015,1.000,1.113,1.207,1.344,1.403,1.152,0.960,0.989,1.016,1.030,0.959,0.977,1.000 };
double user_adjust = 1; //User Adjustment (Constant)
double size_ratio;
//double scaling_factor ; //for the GF HX
double ref_plant_size = 10000; //kW
Expand Down Expand Up @@ -293,6 +294,10 @@ class cm_geothermal_costs : public compute_module

int ppi_base_year = as_integer("ppi_base_year");

//OM Cost calculations
double percent_drilling_cost_om = as_double("percent_drilling_cost_om");
double well_om = percent_drilling_cost_om * as_double("geotherm.cost.prod_inj_total");


if (conversion_type == 0) {
//geo_inputs.me_ct = BINARY;
Expand Down
Loading

0 comments on commit 019fe35

Please sign in to comment.