Skip to content

Instantly share code, notes, and snippets.

View mitchute's full-sized avatar

Matt Mitchell mitchute

  • National Renewable Energy Laboratory
  • Golden, CO
View GitHub Profile
#include <algorithm>
#include <random>
#include <vector>
using namespace std;
using namespace std::chrono;
int main() {
// First create an instance of an engine.
"""
Python will allow you to use any naming convention you want. And therefore, will not enforce
any naming style. However, there are some generally agreed upon "best practices"
which help unify consistency across Python programs.
Python formatting guidelines are outlined in the PEP8 style guide.
https://www.python.org/dev/peps/pep-0008/
Here is a basic formatting example adapted from here: https://www.journaldev.com/14633/python-inheritance-example
"""
def runge_kutta_fourth(rhs, h, x, y):
"""
Solves one step using a fourth-order Runge-Kutta method.
Moin, Parviz. 2010. Fundamentals of Engineering Numerical Analysis. 2nd ed.
Cambridge University Press. New York, New York.
:param rhs: "Right-hand Side" of the equation(s). Everything but the derivative. (e.g dy/dx = f(x))
:param h: step size
:param x: step dimension
% Please add the following required packages to your document preamble:
% \usepackage{multirow}
% \usepackage[table,xcdraw]{xcolor}
% If you use beamer only pass "xcolor=table" option, i.e. \documentclass[xcolor=table]{beamer}
\begin{table}[]
\begin{tabular}{|ccccccc|}
\hline
Bin No. & 1 & 2 & 3 & 4 & 5 & 6 \\
Time-step & & & & & & \\ \hline
\multicolumn{1}{|c|}{} & \multicolumn{1}{c|}{Width} & \multicolumn{1}{c|}{$h$} & \mul
Parameter and G-file - Version 4.1
---------------------------------------------------
RECTANGULAR CONFIGURATION 20 : 2 x 10, rectangle
Number of boreholes = 20
Depth of the borehole = 420.000(ft)
Bore hole spacing = 15.000(ft)
Radius of the borehole = 2.165(ft)
Thermal conductivity of the ground = 1.400(BTU/(hr*ft*F))
Ground Volumetric heat capacity = 34.936(BTU/(F*ft^3))
Grout Conductivity = 0.4300(BTU/(hr*ft*F))
[mitchute@login2 ~]$ pyenv install 3.5.4
Downloading Python-3.5.4.tar.xz...
-> https://www.python.org/ftp/python/3.5.4/Python-3.5.4.tar.xz
Installing Python-3.5.4...
BUILD FAILED (CentOS 6.3 using python-build 1.2.7-1-g7190216)
Inspect or clean up the working tree at /tmp/python-build.20180820162036.8101
Results logged to /tmp/python-build.20180820162036.8101.log
tmp/python-build.20180820162036.8101 ~
/tmp/python-build.20180820162036.8101/Python-3.5.4 /tmp/python-build.20180820162036.8101 ~
checking build system type... x86_64-pc-linux-gnu
checking host system type... x86_64-pc-linux-gnu
checking for python3.5... no
checking for python3... python3
checking for --enable-universalsdk... no
checking for --with-universal-archs... no
checking MACHDEP... linux
checking for --without-gcc... no
@mitchute
mitchute / aadfl.cc
Created September 28, 2017 16:39
KickOffSim
if ( KickOffSimulation ) {
this->initGLHESimVars();
this->updateGHX();
} else {
this->initGLHESimVars();
this->calcGroundHeatExchanger();
this->updateGHX();
}
@mitchute
mitchute / usingArrayObject.for
Created September 18, 2017 14:32
GHE System IDF Configurations
GroundHeatExchanger:System,
Vertical GHE 1x4 Std,
GHLE Inlet, !- Inlet Node Name
GHLE Outlet, !- Outlet Node Name
KA Ground Temps, !- Ground Temperature Object Name
2.423, !- Ground Thermal Conductivity {W/m-K}
2.343E+06, !- Ground Thermal Heat Capacity {J/m3-K}
, !- Response Factors Object Name
GHE-1; !- GHE Object 1 Name
@mitchute
mitchute / main.py
Created September 15, 2017 14:21
pyiddidf test
from pyiddidf.idf.processor import IDFProcessor
processor = IDFProcessor()
idf_structure = processor.process_file_given_file_path('FanCoilAutoSize_MultiSpeedFan.idf')
idf_structure.write_idf('out.idf', idd_structure='Energy+.idd')