Skip to content

How to Preprocess and Upload a Model

Maggie Sullivan edited this page Jun 27, 2023 · 3 revisions

Note: All examples in this guide will be shown using the python package alfalfa-client, please see "How to Install Alfalfa Client" for more details on using this package.

Model upload

Once you have configured a model for use with Alfalfa, (see "How to Configure an OpenStudio Model"), your model can be uploaded to an Alfalfa instance where the relevant files will be stored. This model will be assigned a unique identifier which can be used to refer to this model upload.

model_id = upload_model(path_to_my_model)

path_to_my_model should reference either a folder or a zip file saved locally to your machine. This function can be used to submit a single file path, or a list of file paths. It will return either a single model ID or a list of model IDs.

Create a Simulation Run

Once you have model IDs associated with your file upload, simulation runs can be started with these models. When a simulation run is created, the model will be preprocessed to prepare the simulation to execute. Only one simulation run can be active for each model upload at a time. This run will have an associated run ID.

run_id = create_run_from_model(_model_id)

Similar to the upload_model functionality, either a list of model IDs or a single model ID can be passed to this function.

Once a run has been created, the simulation will have an associated status (see "Statuses") which can be returned as follows:

run_status = status(run_id)

Alternatively, a model can be uploaded and a run created in a single step with the following function:

run_id = submit(path_to_my_model)

Model Configuration

Openstudio

Tutorials

Guides

Reference

Modelica

Guides

Alfalfa Interaction

Tutorials

Guides

Reference

Explanation

Alfalfa Development

Guides

General

Reference

Explanation

Clone this wiki locally