Skip to content

Commit 139bfd2

Browse files
committed
fix SBT Coaxial errors listed in issue 373
1 parent bbc6fbd commit 139bfd2

File tree

1 file changed

+27
-22
lines changed

1 file changed

+27
-22
lines changed

src/geophires_x/SBTReservoir.py

Lines changed: 27 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,18 @@
55
import pandas as pd
66
from scipy.special import erf, erfc, jv, yv, exp1
77
from scipy.interpolate import interp1d
8+
from scipy.integrate import trapezoid
89
import scipy.io as sio
910
import matplotlib.pyplot as plt
1011

12+
import CoolProp.CoolProp as CP
13+
1114
import geophires_x.Model as Model
1215
from .CylindricalReservoir import CylindricalReservoir
1316
from .OptionList import FlowrateModel, InjectionTemperatureModel, Configuration
1417
from .Parameter import intParameter, floatParameter, OutputParameter, ReadParameter, strParameter, boolParameter
1518
from .Reservoir import Reservoir
1619
from .Units import *
17-
import sys
1820
from functools import lru_cache
1921

2022

@@ -458,28 +460,30 @@ def Calculate_Coaxial(self, model):
458460
eps_annulus = Dh_annulus * piperoughness # Relative roughness annulus [-]
459461
eps_centerpipe = 2 * radiuscenterpipe * piperoughness # Relative roughness inner pipe [-]
460462

463+
# These variables are set but never used, and sio.loadmat is causing a "No such file" error.
464+
# (see https://github.com/NREL/GEOPHIRES-X/issues/373)
461465
# Variable fluid properties logic
462-
if variablefluidproperties == 0:
463-
Pvector = [1, 1e9]
464-
Tvector = [1, 1e4]
465-
density = np.full((2, 2), rho_f)
466-
heatcapacity = np.full((2, 2), cp_f)
467-
thermalconductivity = np.full((2, 2), k_f)
468-
viscosity = np.full((2, 2), mu_f)
469-
thermalexpansion = np.zeros((2, 2))
470-
else:
471-
print('Loading fluid properties ...')
472-
if fluid == 1:
473-
# Load properties for water from pre-generated CoolProp data
474-
properties = sio.loadmat('properties_H2O_HT_v3.mat')
475-
print('Fluid properties for water loaded successfully')
476-
elif fluid == 2:
477-
# Load properties for CO2 from pre-generated CoolProp data
478-
properties = sio.loadmat('properties_CO2.mat')
479-
print('Fluid properties for CO2 loaded successfully')
480-
else:
481-
print('No valid fluid selected')
482-
exit()
466+
#if variablefluidproperties == 0:
467+
# Pvector = [1, 1e9]
468+
# Tvector = [1, 1e4]
469+
# density = np.full((2, 2), rho_f)
470+
# heatcapacity = np.full((2, 2), cp_f)
471+
# thermalconductivity = np.full((2, 2), k_f)
472+
# viscosity = np.full((2, 2), mu_f)
473+
# thermalexpansion = np.zeros((2, 2))
474+
#else:
475+
# print('Loading fluid properties ...')
476+
# if fluid == 1:
477+
# # Load properties for water from pre-generated CoolProp data
478+
# properties = sio.loadmat('properties_H2O_HT_v3.mat')
479+
# print('Fluid properties for water loaded successfully')
480+
# elif fluid == 2:
481+
# # Load properties for CO2 from pre-generated CoolProp data
482+
# properties = sio.loadmat('properties_CO2.mat')
483+
# print('Fluid properties for CO2 loaded successfully')
484+
# else:
485+
# print('No valid fluid selected')
486+
# exit()
483487

484488
# Length of each segment [m]
485489
Deltaz = np.sqrt(np.diff(x) ** 2 + np.diff(y) ** 2 + np.diff(z) ** 2)
@@ -648,6 +652,7 @@ def Calculate_Coaxial(self, model):
648652
# MIR Nreg = N - Nboiler
649653
Nreg = 1 + N - Nboiler
650654
self.krock.value_vector = np.full(N, self.krock.value)
655+
k_m_vector = np.zeros(N)
651656
k_m_vector[Nreg:] = k_m_boiler
652657
alpha_m_vector = k_m_vector / self.rhorock.value / self.cprock.value
653658

0 commit comments

Comments
 (0)