Skip to content

Instantly share code, notes, and snippets.

View jkfurtney's full-sized avatar

Jason Furtney jkfurtney

  • St. Paul, Minnesota
View GitHub Profile
@jkfurtney
jkfurtney / borehole_temperature.py
Created May 19, 2022 13:38
Python program to calculate fluid temperature in borehole
"""
This file is the same as borehole.py but has an non-uniform cartesian mesh
Coupled thermal flow model for brine temperature and wall
temperature. Rock is an axisymmetric 2D mesh
A two-dimensional axi-symmetric domain represents the heat in the rock
surrounding the borehole. The rock is initially at the geo-thermal
gradient and is heated as hot brine is injected. The rock is heated as
the brine cools.
import numpy as np
import matplotlib; matplotlib.rcParams["savefig.directory"] = "."
from matplotlib import pyplot as plt
from matplotlib.pyplot import figure
from scipy.spatial import cKDTree
def show_actual_predicted(actual, predicted, target_unit=""):
assert len(actual.shape)==1
assert len(predicted.shape)==1