Running simulations

Single simulation on local pc

In [1]:
from wetb import hawc2
from wetb.hawc2 import HTCFile
from wetb.hawc2.tests.test_files import tfp
In [7]:
hawc2_path = "HAWC2MB.exe" # make sure HAWC2MB.exe is on your path or specify the full path to HAWC2

Generate and save a HAWC2 input htc file for a short simulation

In [9]:
htc = HTCFile(tfp + "simulation_setup/DTU10MWRef6.0/htc/DTU_10MW_RWT.htc")
htc.simulation.time_stop = 1 # stop the simulation after 1 s
htc.save(tfp + 'simulation_setup/DTU10MWRef6.0/htc/tmp.htc')

Execute the simulation

In [10]:
stdout, log = htc.simulate(hawc2_path)
In [11]:
print(stdout)
 ***********************************************************************
 *  Build information for HAWC2MB.exe (GIT)
 *  Intel, version         1900 ,     20190206
 *  WINDOWS 32-bit
 ***********************************************************************
 *  GIT-TAG        = 12.8.0
 *  BUILDER        = mmpe
 *  COMPUTER_NAME  = VINDRI-D17205
 *  BUILD_DATE     = 30-01-2020
 ***********************************************************************
 Logfile: ./log/dtu_10mw_rwt_ver4.log is open for log outputs
 Basic DTU Wind Energy Controller (ver. 2.3 v0.1.dev69.17400ca) loaded ...
 Gen. torque Servo (ver. 2.2 v0.1.dev15.eddfec3) loaded...
 Mech brake (ver. 2.2 v0.1.dev14.9e614a3) loaded...
 Pitch Servo (ver. 2.2 v0.1.dev15.eddfec3) loaded...
 Using licence_manager.dll, version: unknown
 License verified - OK
 Opening main command file: htc\tmp.htc
 Current directory is
 c:\mmpe\programming\python\windenergytoolbox\wetb\hawc2\tests\test_files\simula
 tion_setup\DTU10MWRef6.0
 Continue on no convergence = true

In [12]:
print(log)
 ***********************************************************************
 *  Build information for HAWC2MB.exe (GIT)
 *  Intel, version         1900 ,     20190206
 *  WINDOWS 32-bit
 ***********************************************************************
 *  GIT-TAG        = 12.8.0
 *  BUILDER        = mmpe
 *  COMPUTER_NAME  = VINDRI-D17205
 *  BUILD_DATE     = 30-01-2020
 ***********************************************************************
________________________________________________________________________________________________________________________
  Log file output
                                                            Time : 14:55:07
                                                            Date : 26:05.2020
________________________________________________________________________________________________________________________
 Newmark commands read with succes
 Simulation commands read with succes
 Reading data of main body : tower
 Succes opening ./data/dtu_10mw_rwt_tower_st.dat
 timoschenko input commands read with succes
 topologi_c2def_inputs read with succes
 Topologi main body tower commands read with succes
 Reading data of main body : towertop
 Succes opening ./data/dtu_10mw_rwt_towertop_st.dat
 timoschenko input commands read with succes
 topologi_c2def_inputs read with succes
 Topologi main body towertop commands read with succes
 Reading data of main body : shaft
 Succes opening ./data/dtu_10mw_rwt_shaft_st.dat
 timoschenko input commands read with succes
 topologi_c2def_inputs read with succes
 Topologi main body shaft commands read with succes
 Reading data of main body : hub1
 Succes opening ./data/dtu_10mw_rwt_hub_st.dat
 timoschenko input commands read with succes
 topologi_c2def_inputs read with succes
 Topologi main body hub1 commands read with succes
 Reading data of main body : hub2
 Topologi main body hub2 commands read with succes
 Reading data of main body : hub3
 Topologi main body hub3 commands read with succes
 Reading data of main body : blade1
 Succes opening ./data/dtu_10mw_rwt_blade_st.dat
 timoschenko input commands read with succes
 topologi_c2def_inputs read with succes
 Topologi main body blade1 commands read with succes
 Reading data of main body : blade2
 Topologi main body blade2 commands read with succes
 Reading data of main body : blade3
 Topologi main body blade3 commands read with succes
 Base orientation input commands read with succes
 relative orientation input commands read with succes
 relative orientation input commands read with succes
 relative orientation input commands read with succes
 relative orientation input commands read with succes
 relative orientation input commands read with succes
 relative orientation input commands read with succes
 relative orientation input commands read with succes
 relative orientation input commands read with succes
 Orientation input commands read with succes
 Fix0 constraint input commands read with succes
 Fix1 constraint input commands read with succes
 Bearing1 constraint input commands read with succes
 Fix1 constraint input commands read with succes
 Fix1 constraint input commands read with succes
 Fix1 constraint input commands read with succes
 bearing2 constraint input commands read with succes
 bearing2 constraint input commands read with succes
 bearing2 constraint input commands read with succes
 constraint input commands read with succes
 Topologi commands read with succes
 Tower shadow (potential2 flow) commands read with succes
 Wind commands read with succes
 aerodrag element commands read with succes
 aerodrag element commands read with succes
 Aerodrag commands read with succes
 Aerodynamic commands read with succes
 output commands read with succes
 Output commands read
 Dll type2 input commands read with succes
 output commands read with succes
 Output commands read
 Actions commands read
 Dll type2 input commands read with succes
 output commands read with succes
 Output commands read
 Actions commands read
 Dll type2 input commands read with succes
 output commands read with succes
 Output commands read
 Actions commands read
 Dll type2 input commands read with succes
 output commands read with succes
 Output commands read
 Dll type2 input commands read with succes
 DLL commands read with succes
 output commands read with succes
 Output commands read
 output_at read with succes
 Initialization of structure
 Initializing of aero rotor...
 Initialization of rotor aerodynamics
 Succes opening ./data/dtu_10mw_rwt_ae.dat
 Succes opening ./data/dtu_10mw_rwt_pc.dat
 Initialization of rotor induction
 Initialization of wind
 Initialization of external type2 DLL
 External DLL ./control/dtu_we_controller.dll is attempted to open
 Using ./control/dtu_we_controller.dll, version: unknown
 Succes opening external DLL ./control/dtu_we_controller.dll
 DLL subroutine init init_regulation is called
 In initialization call of ./control/dtu_we_controller.dll Output is
  0.000000000000000E+000
 *** INFO *** The DLL subroutine message could not be loaded - bypassed!
 Initialization of external type2 DLL
 External DLL ./control/generator_servo.dll is attempted to open
 Using ./control/generator_servo.dll, version: unknown
 Succes opening external DLL ./control/generator_servo.dll
 DLL subroutine init init_generator_servo is called
 In initialization call of ./control/generator_servo.dll Output is
  0.000000000000000E+000
 *** INFO *** The DLL subroutine message could not be loaded - bypassed!
 Initialization of external type2 DLL
 External DLL ./control/mech_brake.dll is attempted to open
 Using ./control/mech_brake.dll, version: unknown
 Succes opening external DLL ./control/mech_brake.dll
 DLL subroutine init init_mech_brake is called
 In initialization call of ./control/mech_brake.dll Output is
  0.000000000000000E+000
 *** INFO *** The DLL subroutine message could not be loaded - bypassed!
 Initialization of external type2 DLL
 External DLL ./control/servo_with_limits.dll is attempted to open
 Using ./control/servo_with_limits.dll, version: unknown
 Succes opening external DLL ./control/servo_with_limits.dll
 DLL subroutine init init_servo_with_limits is called
 In initialization call of ./control/servo_with_limits.dll Output is
  0.000000000000000E+000
 *** INFO *** The DLL subroutine message could not be loaded - bypassed!
 Initialization of external type2 DLL
 External DLL ./control/towclearsens.dll is attempted to open
 Using ./control/towclearsens.dll, version: unknown
 Succes opening external DLL ./control/towclearsens.dll
 DLL subroutine init initialize is called
 In initialization call of ./control/towclearsens.dll Output is
   2.66000000000000
 *** INFO *** The DLL subroutine message could not be loaded - bypassed!
 Creating link between structure and aerodynamics
 Creating link between structure and aerodrag
 Initialization of Aerodrag
 Starting simulation
Dynamic stall method:  2 used for entire rotor
 Global time =   2.000000000000000E-002 Iter =            2
 Global time =   4.000000000000000E-002 Iter =            2
 Global time =   6.000000000000000E-002 Iter =            2
 Global time =   8.000000000000000E-002 Iter =            2
 Global time =   0.100000000000000      Iter =            2
 Global time =   0.120000000000000      Iter =            2
 Global time =   0.140000000000000      Iter =            2
 Global time =   0.160000000000000      Iter =            2
 Global time =   0.180000000000000      Iter =            2
 Global time =   0.200000000000000      Iter =            2
 Global time =   0.220000000000000      Iter =            2
 Global time =   0.240000000000000      Iter =            2
 Global time =   0.260000000000000      Iter =            2
 Global time =   0.280000000000000      Iter =            3
 Global time =   0.300000000000000      Iter =            3
 Global time =   0.320000000000000      Iter =            3
 Global time =   0.340000000000000      Iter =            3
 Global time =   0.360000000000000      Iter =            3
 Global time =   0.380000000000000      Iter =            3
 Global time =   0.400000000000000      Iter =            3
 Global time =   0.420000000000000      Iter =            3
 Global time =   0.440000000000000      Iter =            3
 Global time =   0.460000000000000      Iter =            3
 Global time =   0.480000000000000      Iter =            3
 Global time =   0.500000000000000      Iter =            3
 Global time =   0.520000000000000      Iter =            3
 Global time =   0.540000000000000      Iter =            2
 Global time =   0.560000000000000      Iter =            3
 Global time =   0.580000000000000      Iter =            3
 Global time =   0.600000000000000      Iter =            3
 Global time =   0.620000000000000      Iter =            3
 Global time =   0.640000000000000      Iter =            3
 Global time =   0.660000000000000      Iter =            3
 Global time =   0.680000000000000      Iter =            3
 Global time =   0.700000000000000      Iter =            3
 Global time =   0.720000000000000      Iter =            3
 Global time =   0.740000000000000      Iter =            2
 Global time =   0.760000000000000      Iter =            3
 Global time =   0.780000000000000      Iter =            3
 Global time =   0.800000000000000      Iter =            2
 Global time =   0.820000000000000      Iter =            2
 Global time =   0.840000000000000      Iter =            3
 Global time =   0.860000000000000      Iter =            2
 Global time =   0.880000000000000      Iter =            2
 Global time =   0.900000000000000      Iter =            3
 Global time =   0.920000000000000      Iter =            3
 Global time =   0.940000000000000      Iter =            2
 Global time =   0.960000000000000      Iter =            2
 Global time =   0.980000000000000      Iter =            2
 Global time =    1.00000000000000      Iter =            3
 Closing of external type2 DLL
 Closing of external type2 DLL
 Closing of external type2 DLL
 Closing of external type2 DLL
 Closing of external type2 DLL
 Elapsed time :   0.9218750

In [ ]: