Getting started with HAWC2

Getting started with HAWC2#

This section contains some basic overview information and tips on debugging files when running HAWC2. A more detailed description of the format of the input file is discussed in Section General input layout.

Running HAWC2#

HAWC2 is run by calling the HAWC2 executable from a Windows Command Prompt on the input file, which has a .htc file extension (see Section General input layout):


> <path to HAWC2 executable> <path to htc file>

For example, if the current working directory of the Command Prompt contains both your HAWC2 executable and an input file called turbine_model.htc (which is not a recommended folder structure, see below), the command to run HAWC2 would be


> HAWC2MB.exe turbine_model.htc

Important! Any relative paths in the htc file will be defined with respect to the current working directory of the Command Prompt, not with respect to the file’s location.

To identify which version of HAWC2 is on the system, the “–version” flag can be used. This will make HAWC2 print the version information of the program, and terminate without throwing an error. An example of the call and output is shown below. This functionality is available from version 13.


> HAWC2MB.exe --version

 ********************************************************************
 *  Build information for HAWC2MB
 *  Aeroelastic tool HAWC2MB
 * Intel, version     2021 ,   20201112
 *  WINDOWS 32-bit
 ********************************************************************
 * GIT-TAG    = 12.9.5
 * GIT-BRANCH   =
 * BUILD_TYPE   = Windows32 RELEASE
 * BUILDER    = ContainerAdministrator
 *  COMPUTER_NAME  = RUNNER-UYZRLEJ3
 * BUILD_DATE   = Tue 06/21/2022
 ********************************************************************

Folder structure#

HAWC2 does not assume any folder structure, so the executable and the input file can be located anywhere that is accessible by the Command Prompt. However, it is often best to separate different wind turbine models so that their results do not overwrite each other. It can also be nice to separate the HAWC2 executable from the input/output files in order to keep the directories as clean as possible.

One way to do this is to place HAWC2 and all its required DLLs in one directory and all of the files related to a specific turbine model in another directory. Let us demonstrate this with an example. Assume that we have placed the HAWC2 executable and all related DLLs in C:\{hawc2}\. We desire to run an htc file, called input_a.htc, that is located in C:\{Documents}\{turbine_models}\{prototype_a}\{htc}\. However, the htc file contains relative paths that are defined with respect to the prototype_a\ directory. In this case, we must first change the working directory to the prototype_a\ directory so that the relative paths in the htc file point to the correct files, and then we can call the HAWC2 executable on the input files using an absolute path. The commands for this example would be as follows:


> cd C:\Documents\turbine_models\prototype_a\
> C:\hawc2\HAWC2MB.exe .\htc\input_a.htc

Debugging models#

Although HAWC2 is run from the Command Prompt, the errors that are printed to it when something goes wrong are often not illuminating to the average user. If something goes wrong with your model, you should first check the output log to see what warnings and errors are printed there. The output log is a text file ending in .log, and its location is determined by the logfile option in the simulation block in the htc file.

One of the most common errors for new users is having the wrong working directory in the Command Prompt, in which case the log file will state that it could not find the requested data files. Other common errors when running time-marching simulations include bad simulation parameters that lead to non-convergence or incorrect definitions of body properties. Regardless, your first step when debugging a model should always be to look at the log file to determine what went wrong. If you cannot find the source of your problem, you can email the HAWC2 support address (hawc2@windenergy.dtu.dk) to ask for help.

Important! HAWC2 is a flexible software with many different simulation options, so building a model from the ground up is complicated and not recommended. We recommend starting from a working model (see the HAWC2 website to download a working wind turbine model) and incrementally making changes as needed.