Run Batch Tutorials

The fusedwind.runSuite.runCaseGenerator and fusedwind.runSuite.runBatch modules facilitate high throughput aeroelastic simulation via a generic interface that can accomodate a variety of specifc wind codes. The philosophy of the tool is illustrated in the following figure (Figure 1):

_images/batchrunner.png

Figure 1: The separation of case generation and case execution implementated by fusedwind’s runCaseGenerator and runBatch classes.

Run Case Generator

This module allows for sampling of distributions encountered in wind energy research using a flexible text input file specification. The distributions currently available are:

  • Weibull
  • Gamma
  • vonMises
  • uniform
  • normal
  • bivariate normal

In addition, we allow for “enumeration” of sets of variables, and their cartesian product.

The impetus is the desire for a generic representation of rows in Table 1 of IEC document 88_329 describing design standards for loads analysis, where what is being represented are the distributions of wind/wave environment parameters. We can assume these all boil down to distributions of _numerical_ (rather than discrete) parameters. A twist is that some of the parameters depend on eachother, that is, the distributions are conditional distributions.

In principle all we need to say is \(\{v_i\} \sim D_k (\{p_j(v)\})\) where \(\{v_i\}\) are the random variables we’re defining (including multivariate distributions), \(D_k\) are distributions, and \(\{p_j\}\) are parameters to these distributions. Currently \(p_j\) can only depend on \(v_i\) for \(i<j\), but otherwise the dependence can be expressed as an arbitrary python math expression.

An example of the input this system can handle is:

#--WW4Ddist--
Vhub = W(2.120, 9.767)
WaveDir = VM(0.029265 + 0.119759 * Vhub, -0.620138 + 0.030709 * Vhub)
Hs = G(4.229440 + 0.222745 * WaveDir  + 0.328602 * Vhub, 0.145621 + -0.006188 * WaveDir  + 0.007561 * Vhub)
Tp = G(19.677865 + 6.617868 * Hs  + -0.532952 * Vhub, 0.202077 + 0.286631 / Hs  + -0.004321 * Vhub)

which causes the code to sample the joint distribution of hub height wind speed (Weibull), wave direction (von Mises), wave height (Gamma), and wave period (Gamma) for a recent study.

Or:

#--WW4Ddist--
Vhub = {5,15,25}
Hs = {1,5}

which causes the code to generate the cartesian product {(5,1),(5,5),(15,1),(15,1),(25,1),(25,5)}.

class fusedwind.runSuite.runCaseGenerator.EnumDistn(vstr, items, ctx)[source]

class for distributions that are just list of numbers or single numbers, ‘sampling’ is just going to return all values

get_bounds()[source]

assumes numbers

class fusedwind.runSuite.runCaseGenerator.FnDistn(vstr, fn, args, ctx)[source]

class for ‘real’ distributions like Gaussians, etc. the keys in ‘items’ are the names of the distributions, assumed to be known and sample-able. items = e.g. {“N”: [“2x”,”sig1”}

Case Runner

Here we will construct a cleaner version of openruniec.py. It will simply read a table of run cases and run them.

class fusedwind.runSuite.runBatch.CaseAnalyzer(params)[source]

main driver of whole show, after input is read wraps an openmdao CaseIteratorDriver, which has an openAeroCode assembly in its workflow, and whose cases are perhaps aero-code specific Case() objects that are sent into the aerocode via a slot variable

setup_cases()[source]

setup the cases

class fusedwind.runSuite.runBatch.FUSEDIECCaseIterator[source]

main driver of whole show, after input is read wraps an openmdao CaseIteratorDriver, which has an openAeroCode assembly in its workflow, and whose cases are perhaps aero-code specific Case() objects that are sent into the aerocode via a slot variable

configure()[source]

Configures an assembly for running with the CaseIteratorDriver

setup_cases()[source]

setup the cases to run

This method has to be called after instantiation of the class, once the cases list has been set.

class fusedwind.runSuite.runBatch.PostprocessIECCasesBase[source]

Postprocess list of cases returned by a case recorder

class fusedwind.runSuite.runBatch.RunControlInput[source]

class to modularize the input

fusedwind.runSuite.runBatch.create_aerocode_wrapper(aerocode_params, output_params, options)[source]

create wind code wrapper

fusedwind.runSuite.runBatch.create_dlc_dispatcher(dispatch_params)[source]

create dispatcher dispatcher originally meant to signify role as handling _how_ the computations are done E.g., we could have a parallel dispatcher, etc. For now this just handled by a flag, all the work is done in openmdao, ie ## so far there is actually only one type of dispatcher.

fusedwind.runSuite.runBatch.create_turbine(turbine_params)[source]

create turbine object

fusedwind.runSuite.runBatch.parse_input(options)[source]

input comes in a lot of categories, roughly broken into: – the turbine to simulate (formerly a FAST template file) – the design load cases to simulate – the wind code to use – the manner in which to simulate them – where to find the inputs and – what to put in the outputs

fusedwind.runSuite.runBatch.parse_key_val_file_all(fname)[source]

parse key/value file, some entries might be _lists_ of strings

fusedwind.runSuite.runBatch.rundlcs()[source]

run the whole process, including startup and shutdown to do: parse input create load cases create app assembly create dispatcher send cases and app to dispatcher run cases collect and save output