|
5 | 5 | import pandas as pd
|
6 | 6 | from scipy.special import erf, erfc, jv, yv, exp1
|
7 | 7 | from scipy.interpolate import interp1d
|
| 8 | +from scipy.integrate import trapezoid |
8 | 9 | import scipy.io as sio
|
9 | 10 | import matplotlib.pyplot as plt
|
10 | 11 |
|
| 12 | +import CoolProp.CoolProp as CP |
| 13 | + |
11 | 14 | import geophires_x.Model as Model
|
12 | 15 | from .CylindricalReservoir import CylindricalReservoir
|
13 | 16 | from .OptionList import FlowrateModel, InjectionTemperatureModel, Configuration
|
14 | 17 | from .Parameter import intParameter, floatParameter, OutputParameter, ReadParameter, strParameter, boolParameter
|
15 | 18 | from .Reservoir import Reservoir
|
16 | 19 | from .Units import *
|
17 |
| -import sys |
18 | 20 | from functools import lru_cache
|
19 | 21 |
|
20 | 22 |
|
@@ -458,28 +460,30 @@ def Calculate_Coaxial(self, model):
|
458 | 460 | eps_annulus = Dh_annulus * piperoughness # Relative roughness annulus [-]
|
459 | 461 | eps_centerpipe = 2 * radiuscenterpipe * piperoughness # Relative roughness inner pipe [-]
|
460 | 462 |
|
| 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) |
461 | 465 | # 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() |
483 | 487 |
|
484 | 488 | # Length of each segment [m]
|
485 | 489 | Deltaz = np.sqrt(np.diff(x) ** 2 + np.diff(y) ** 2 + np.diff(z) ** 2)
|
@@ -648,6 +652,7 @@ def Calculate_Coaxial(self, model):
|
648 | 652 | # MIR Nreg = N - Nboiler
|
649 | 653 | Nreg = 1 + N - Nboiler
|
650 | 654 | self.krock.value_vector = np.full(N, self.krock.value)
|
| 655 | + k_m_vector = np.zeros(N) |
651 | 656 | k_m_vector[Nreg:] = k_m_boiler
|
652 | 657 | alpha_m_vector = k_m_vector / self.rhorock.value / self.cprock.value
|
653 | 658 |
|
|
0 commit comments