Skip to content

Add temperature constraint for resource temperature#1341

Merged
mjprilliman merged 5 commits into
patchfrom
getem-resource-temp-constraint
Feb 6, 2023
Merged

Add temperature constraint for resource temperature#1341
mjprilliman merged 5 commits into
patchfrom
getem-resource-temp-constraint

Conversation

@mjprilliman

Copy link
Copy Markdown
Collaborator

Description

-Add message box informing user of 374 C temperature constraint for geothermal resource temperature
-Add UI variable to store last successfully entered resource temperature to revert
-Associated var table change in ssc.

Fixes #1340

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update
  • This change modifies variables in existing compute modules. Please see Checking for PySAM Incompatible API Changes.

Checklist:

If you have added a new compute module in a SSC pull request related to this one, be sure to check the Process Requirements.

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules
  • I have checked my code and corrected any misspellings

@cpaulgilman cpaulgilman left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

@mjprilliman This modifies a UI form in the .txt format. Should we wait to make this pull request until after the JSON UI forms are finished?

@mjprilliman

Copy link
Copy Markdown
Collaborator Author

@mjprilliman This modifies a UI form in the .txt format. Should we wait to make this pull request until after the JSON UI forms are finished?

Good point. I can wait and update the .json format once merged. Just want to make sure this gets into patch 1.

@mjprilliman

Copy link
Copy Markdown
Collaborator Author

Updated UI form json file after merge

@cpaulgilman

Copy link
Copy Markdown
Collaborator

Thanks for waiting for the migration to JSON UI forms.

When I change the resource temperature on the Geothermal Resource page from the default 200 to 500 degrees C, I get a window with a geothermal mimo error twice, and then a UI callback error. After the callback error, I get your new UI error message "The maximum temperature for the GETEM model is 373 degrees Celsius," and the temperature is reset to 200 as expected. Here's part of the callback error:

equation engine: [29]: eval error in statement list\

fail: [num_wells_getem,num_wells_getem_inj,geotherm.plant_efficiency_used,pump_work_watthr_lb,pumpwork_prod,pumpwork_inj,gross_output,pump_depth,inj_pump_hp,pump_work,geotherm.delta_pressure_reservoir,geotherm.avg_reservoir_temp,geotherm.bottom_hole_pressure] = f( nameplate,resource_type,resource_temp,resource_depth,geotherm.cost.inj_prod_well_ratio,dt_prod_well,prod_well_choice,geothermal_analysis_period,model_choice,analysis_type,num_wells,conversion_type,plant_efficiency_input,conversion_subtype,decline_type,temp_decline_rate,temp_decline_max,wet_bulb_temp,ambient_pressure,well_flow_rate,pump_efficiency,delta_pressure_equip,excess_pressure_pump,well_diameter,casing_size,inj_casing_size,inj_well_diam,geotherm.cost.inj_cost_curve_welltype,geotherm.cost.prod_cost_curve_welltype,design_temp,specify_pump_work,specified_pump_work_amount,rock_thermal_conductivity,rock_specific_heat,rock_density,reservoir_pressure_change_type,reservoir_pressure_change,reservoir_width,reservoir_height,reservoir_permeability,inj_prod_well_distance,subsurface_water_loss,fracture_aperature,fracture_width,fracture_length,fracture_spacing,num_fractures,fracture_angle,reservoir_model_inputs,hr_pl_nlev )
equation engine: [29]: eval error in statement list\

fail: [num_wells_getem,num_wells_getem_inj,geotherm.plant_efficiency_used,pump_work_watthr_lb,pumpwork_prod,pumpwork_inj,gross_output,pump_depth,inj_pump_hp,pump_work,geotherm.delta_pressure_reservoir,geotherm.avg_reservoir_temp,geotherm.bottom_hole_pressure] = f( nameplate,resource_type,resource_temp,resource_depth,geotherm.cost.inj_prod_well_ratio,dt_prod_well,prod_well_choice,geothermal_analysis_period,model_choice,analysis_type,num_wells,conversion_type,plant_efficiency_input,conversion_subtype,decline_type,temp_decline_rate,temp_decline_max,wet_bulb_temp,ambient_pressure,well_flow_rate,pump_efficiency,delta_pressure_equip,excess_pressure_pump,well_diameter,casing_size,inj_casing_size,inj_well_diam,geotherm.cost.inj_cost_curve_welltype,geotherm.cost.prod_cost_curve_welltype,design_temp,specify_pump_work,specified_pump_work_amount,rock_thermal_conductivity,rock_specific_heat,rock_density,reservoir_pressure_change_type,reservoir_pressure_change,reservoir_width,reservoir_height,reservoir_permeability,inj_prod_well_distance,subsurface_water_loss,fracture_aperature,fracture_width,fracture_length,fracture_spacing,num_fractures,fracture_angle,reservoir_model_inputs,hr_pl_nlev )
no variables calculated in a single iteration, cannot make progress!
eqn not evaluated: [geotherm.delta_pressure_reservoirBar] = f( geotherm.delta_pressure_reservoir)
eqn not evaluated: [geotherm.bottom_hole_pressureBar] = f( geotherm.bottom_hole_pressure)
eqn not evaluated: [geotherm.avg_reservoir_tempF] = f( geotherm.avg_reservoir_temp)
eqn not evaluated: [geotherm.total_flow_kg_per_s] = f( well_flow_rate,num_wells_getem)
eqn not evaluated: [geotherm.total_flow_gpm] = f( geotherm.total_flow_kg_per_s)
eqn not evaluated: [system_capacity] = f( gross_output)
[...]

@mjprilliman

Copy link
Copy Markdown
Collaborator Author

Thanks for waiting for the migration to JSON UI forms.

When I change the resource temperature on the Geothermal Resource page from the default 200 to 500 degrees C, I get a window with a geothermal mimo error twice, and then a UI callback error. After the callback error, I get your new UI error message "The maximum temperature for the GETEM model is 373 degrees Celsius," and the temperature is reset to 200 as expected. Here's part of the callback error:

equation engine: [29]: eval error in statement list\

fail: [num_wells_getem,num_wells_getem_inj,geotherm.plant_efficiency_used,pump_work_watthr_lb,pumpwork_prod,pumpwork_inj,gross_output,pump_depth,inj_pump_hp,pump_work,geotherm.delta_pressure_reservoir,geotherm.avg_reservoir_temp,geotherm.bottom_hole_pressure] = f( nameplate,resource_type,resource_temp,resource_depth,geotherm.cost.inj_prod_well_ratio,dt_prod_well,prod_well_choice,geothermal_analysis_period,model_choice,analysis_type,num_wells,conversion_type,plant_efficiency_input,conversion_subtype,decline_type,temp_decline_rate,temp_decline_max,wet_bulb_temp,ambient_pressure,well_flow_rate,pump_efficiency,delta_pressure_equip,excess_pressure_pump,well_diameter,casing_size,inj_casing_size,inj_well_diam,geotherm.cost.inj_cost_curve_welltype,geotherm.cost.prod_cost_curve_welltype,design_temp,specify_pump_work,specified_pump_work_amount,rock_thermal_conductivity,rock_specific_heat,rock_density,reservoir_pressure_change_type,reservoir_pressure_change,reservoir_width,reservoir_height,reservoir_permeability,inj_prod_well_distance,subsurface_water_loss,fracture_aperature,fracture_width,fracture_length,fracture_spacing,num_fractures,fracture_angle,reservoir_model_inputs,hr_pl_nlev )
equation engine: [29]: eval error in statement list\

fail: [num_wells_getem,num_wells_getem_inj,geotherm.plant_efficiency_used,pump_work_watthr_lb,pumpwork_prod,pumpwork_inj,gross_output,pump_depth,inj_pump_hp,pump_work,geotherm.delta_pressure_reservoir,geotherm.avg_reservoir_temp,geotherm.bottom_hole_pressure] = f( nameplate,resource_type,resource_temp,resource_depth,geotherm.cost.inj_prod_well_ratio,dt_prod_well,prod_well_choice,geothermal_analysis_period,model_choice,analysis_type,num_wells,conversion_type,plant_efficiency_input,conversion_subtype,decline_type,temp_decline_rate,temp_decline_max,wet_bulb_temp,ambient_pressure,well_flow_rate,pump_efficiency,delta_pressure_equip,excess_pressure_pump,well_diameter,casing_size,inj_casing_size,inj_well_diam,geotherm.cost.inj_cost_curve_welltype,geotherm.cost.prod_cost_curve_welltype,design_temp,specify_pump_work,specified_pump_work_amount,rock_thermal_conductivity,rock_specific_heat,rock_density,reservoir_pressure_change_type,reservoir_pressure_change,reservoir_width,reservoir_height,reservoir_permeability,inj_prod_well_distance,subsurface_water_loss,fracture_aperature,fracture_width,fracture_length,fracture_spacing,num_fractures,fracture_angle,reservoir_model_inputs,hr_pl_nlev )
no variables calculated in a single iteration, cannot make progress!
eqn not evaluated: [geotherm.delta_pressure_reservoirBar] = f( geotherm.delta_pressure_reservoir)
eqn not evaluated: [geotherm.bottom_hole_pressureBar] = f( geotherm.bottom_hole_pressure)
eqn not evaluated: [geotherm.avg_reservoir_tempF] = f( geotherm.avg_reservoir_temp)
eqn not evaluated: [geotherm.total_flow_kg_per_s] = f( well_flow_rate,num_wells_getem)
eqn not evaluated: [geotherm.total_flow_gpm] = f( geotherm.total_flow_kg_per_s)
eqn not evaluated: [system_capacity] = f( gross_output)
[...]

Equations were breaking at 500C where they weren't at ~400C values I was testing with. Added checks to not update calcs for new temperature if > 373 degrees

@mjprilliman mjprilliman merged commit 83e1988 into patch Feb 6, 2023
@mjprilliman mjprilliman deleted the getem-resource-temp-constraint branch February 6, 2023 20:17
@cpaulgilman cpaulgilman added the added to release notes PR and/or issue has been added to release notes for a public release label Feb 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

added to release notes PR and/or issue has been added to release notes for a public release bug geothermal

Projects

None yet

Development

Successfully merging this pull request may close these issues.

GETEM resource temperature constraint

2 participants