forked from lkilcher/pyTurbSim
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcode-framework.html
215 lines (198 loc) · 11.6 KB
/
code-framework.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Code Framework — PyTurbSim 0.4.8 documentation</title>
<link rel="stylesheet" href="_static/alabaster.css" type="text/css" />
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT: './',
VERSION: '0.4.8',
COLLAPSE_INDEX: false,
FILE_SUFFIX: '.html',
HAS_SOURCE: true,
SOURCELINK_SUFFIX: '.txt'
};
</script>
<script type="text/javascript" src="_static/jquery.js"></script>
<script type="text/javascript" src="_static/underscore.js"></script>
<script type="text/javascript" src="_static/doctools.js"></script>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
<link rel="author" title="About these documents" href="about.html" />
<link rel="index" title="Index" href="genindex.html" />
<link rel="search" title="Search" href="search.html" />
<link rel="next" title="pyts package" href="api/pyts.html" />
<link rel="prev" title="Plotting Tools" href="plotting-tools.html" />
<link rel="stylesheet" href="_static/custom.css" type="text/css" />
<meta name="viewport" content="width=device-width, initial-scale=0.9, maximum-scale=0.9" />
</head>
<body>
<div class="document">
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body" role="main">
<div class="section" id="code-framework">
<h1>Code Framework<a class="headerlink" href="#code-framework" title="Permalink to this headline">¶</a></h1>
<p>PyTurbSim is a Python ‘package’ organized into ‘modules’ and
‘sub-packages’ that provide a logical and functional framework for the
code and its use. The primary components of this framework are:</p>
<ol class="arabic simple">
<li>The modules in the <a class="reference internal" href="api/pyts.html#module-pyts" title="pyts"><code class="xref py py-mod docutils literal"><span class="pre">pyts</span></code></a> root folder, especially:<ol class="loweralpha">
<li><a class="reference internal" href="api/pyts.html#module-pyts.main" title="pyts.main"><code class="xref py py-mod docutils literal"><span class="pre">pyts.main</span></code></a>, which contains the high-level classes and
functions that control the flow of PyTurbSim simulations. Most
importantly, this module defines:<ul>
<li><a class="reference internal" href="api/pyts.html#pyts.main.tsrun" title="pyts.main.tsrun"><code class="xref py py-class docutils literal"><span class="pre">pyts.main.tsrun</span></code></a>, this is the primary ‘run’ class of
PyTurbSim, which controls and directs.</li>
<li><a class="reference internal" href="api/pyts.html#pyts.main.tsdata" title="pyts.main.tsdata"><code class="xref py py-class docutils literal"><span class="pre">pyts.main.tsdata</span></code></a>, this is the PyTurbSim output-data
class returned by <a class="reference internal" href="api/pyts.html#pyts.main.tsrun" title="pyts.main.tsrun"><code class="xref py py-class docutils literal"><span class="pre">pyts.main.tsrun</span></code></a> after execution.</li>
</ul>
</li>
<li><a class="reference internal" href="api/pyts.html#module-pyts.base" title="pyts.base"><code class="xref py py-mod docutils literal"><span class="pre">pyts.base</span></code></a>, which contains abstract base classes for other
components of the code (this is the foundation of the code
structure).</li>
</ol>
</li>
<li>The model packages, which contain predefined models of the statistics PyTurbSim is capable of simulating.<ol class="loweralpha">
<li><a class="reference internal" href="api/pyts.profModels.html#module-pyts.profModels" title="pyts.profModels"><code class="xref py py-mod docutils literal"><span class="pre">pyts.profModels</span></code></a>, contains the mean velocity profile
models.</li>
<li><a class="reference internal" href="api/pyts.specModels.html#module-pyts.specModels" title="pyts.specModels"><code class="xref py py-mod docutils literal"><span class="pre">pyts.specModels</span></code></a>, contains the TKE spectral
models.</li>
<li><a class="reference internal" href="api/pyts.stressModels.html#module-pyts.stressModels" title="pyts.stressModels"><code class="xref py py-mod docutils literal"><span class="pre">pyts.stressModels</span></code></a>, contains the Reynold’s
stress profile models.</li>
<li><a class="reference internal" href="api/pyts.cohereModels.html#module-pyts.cohereModels" title="pyts.cohereModels"><code class="xref py py-mod docutils literal"><span class="pre">pyts.cohereModels</span></code></a>, contains the spatial
coherence models.</li>
</ol>
</li>
</ol>
<blockquote>
<div>More details on model packages can be found in the <a class="reference internal" href="#model-info"><span class="std std-ref">Models vs. run-specific ‘statistics’</span></a> section.</div></blockquote>
<ol class="arabic" start="3">
<li><p class="first">The <a class="reference internal" href="api/pyts.io.html#module-pyts.io" title="pyts.io"><code class="xref py py-mod docutils literal"><span class="pre">pyts.io</span></code></a> package supports reading and writing of TurbSim
input (.inp) and output files (e.g. .bl, .wnd, etc.).</p>
</li>
<li><p class="first">Wrapper packages that implement different user interfaces of
PyTurbSim:</p>
<ol class="loweralpha simple">
<li><code class="xref py py-mod docutils literal"><span class="pre">pyts.runConfig</span></code> contains all the software for running
PyTurbSim using <a class="reference internal" href="glossary.html#term-input-file"><span class="xref std std-term">input file</span></a>s (to mimic <a class="reference internal" href="glossary.html#term-o-turbsim"><span class="xref std std-term">O-TurbSim</span></a>).</li>
<li><code class="xref py py-mod docutils literal"><span class="pre">pyts.gui</span></code> contains the graphical user interface.</li>
</ol>
<p>For further information on how to use these interface see
<a class="reference internal" href="usage.html"><span class="doc">Usage</span></a>.</p>
</li>
<li><p class="first">The ‘tslib’ folder and library. This folder contains the Fortran
code that implements the processor-intensive pieces of
PyTurbSim. Having this library compiled for your system significantly
speeds up PyTurbSim. For information on properly installing this
library, consult the <a class="reference internal" href="install.html"><span class="doc">Download and Install</span></a> page.</p>
</li>
</ol>
<div class="section" id="models-vs-run-specific-statistics">
<span id="model-info"></span><h2>Models vs. run-specific ‘statistics’<a class="headerlink" href="#models-vs-run-specific-statistics" title="Permalink to this headline">¶</a></h2>
<p>PyTurbSim makes a distinction between ‘models’ (PyTurbSim objects that
partially define a statistic) and run-specific ‘stat-objects’ which are the output
of these model objects (these are numpy array wrappers). Models are
independent of the spatial grid and other models in a PyTurbSim
run. The statistics are the values of the statistic that will be
reproduced in the PyTurbSim output.</p>
<p>PyTurbSim is primarily designed to produce output that matches four
statistics for each component of velocity (u,v,w):</p>
<ol class="arabic simple">
<li>The mean velocity profile (prof),</li>
<li>The turbulence energy spectrum (spec),</li>
<li>The spatial coherence (cohere), and</li>
<li>The Reynold’s stresses (stress).</li>
</ol>
<p>Within PyTurbSim each of these statistics may be defined in two
distinct ways. They may be defined using ‘models’ or using
‘stat-objects’ (essentially array wrappers). Models define a statistic
in terms of input parameters to a model and other variables of other
models. For more information on specifying a statistic, see the four
statistic properties (prof, spec, cohere, and stress) of a tsrun
object.</p>
<div class="section" id="models">
<h3>Models<a class="headerlink" href="#models" title="Permalink to this headline">¶</a></h3>
<p>Models define the functional form of a statistic and can depend on the
spatial grid or other stat-objects defined before it. When models are
used to compute statistics they are computed the order above
(1-4). This means that a turbulence energy spectrum model can depend
on the mean velocity profile, but not the coherence or
stress. Likewise the coherence can depend on the mean velocity and
turbulence spectrum, but not the stress, and so on. (Even though
models cannot depend on the values of an array defined later, they can
depend on ‘parameters’ of that model.)</p>
</div>
<div class="section" id="stat-objects-arrays">
<h3>Stat-objects/arrays<a class="headerlink" href="#stat-objects-arrays" title="Permalink to this headline">¶</a></h3>
<p>Stat-objects, on the other hand, contain the values of the statistic
(an array) that will be reproduced in the PyTurbSim output. However,
because stat-objects are essentially wrappers for an array of the
values of the statistic, they do not have the flexibility to depend on
the values of other statistics.</p>
</div>
</div>
<div class="section" id="customizing-pyturbsim">
<h2>Customizing PyTurbSim<a class="headerlink" href="#customizing-pyturbsim" title="Permalink to this headline">¶</a></h2>
<p>Need to add some examples here…</p>
</div>
</div>
</div>
</div>
</div>
<div class="sphinxsidebar" role="navigation" aria-label="main navigation">
<div class="sphinxsidebarwrapper">
<h3><a href="index.html">Table Of Contents</a></h3>
<ul>
<li><a class="reference internal" href="#">Code Framework</a><ul>
<li><a class="reference internal" href="#models-vs-run-specific-statistics">Models vs. run-specific ‘statistics’</a><ul>
<li><a class="reference internal" href="#models">Models</a></li>
<li><a class="reference internal" href="#stat-objects-arrays">Stat-objects/arrays</a></li>
</ul>
</li>
<li><a class="reference internal" href="#customizing-pyturbsim">Customizing PyTurbSim</a></li>
</ul>
</li>
</ul>
<div class="relations">
<h3>Related Topics</h3>
<ul>
<li><a href="index.html">Documentation overview</a><ul>
<li>Previous: <a href="plotting-tools.html" title="previous chapter">Plotting Tools</a></li>
<li>Next: <a href="api/pyts.html" title="next chapter">pyts package</a></li>
</ul></li>
</ul>
</div>
<div role="note" aria-label="source link">
<h3>This Page</h3>
<ul class="this-page-menu">
<li><a href="_sources/code-framework.rst.txt"
rel="nofollow">Show Source</a></li>
</ul>
</div>
<div id="searchbox" style="display: none" role="search">
<h3>Quick search</h3>
<form class="search" action="search.html" method="get">
<div><input type="text" name="q" /></div>
<div><input type="submit" value="Go" /></div>
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
</div>
<script type="text/javascript">$('#searchbox').show(0);</script>
</div>
</div>
<div class="clearer"></div>
</div>
<div class="footer">
©2018, National Renewable Energy Lab.
|
Powered by <a href="http://sphinx-doc.org/">Sphinx 1.6.6</a>
& <a href="https://github.com/bitprophet/alabaster">Alabaster 0.7.10</a>
|
<a href="_sources/code-framework.rst.txt"
rel="nofollow">Page source</a>
</div>
</body>
</html>