Hello everyone.
I am new to FAST and have a problem I have been unable to solve for the past couple of days. I am trying to extend a 600s simulation to 6 hours in a .bts file.
I have downloaded TurbSim and have used the PERL script to generate 36 seeds. I renamed the PERL script accordingly and set out to run the input file. The problem is that once I decide to use the generated .bts file in a FAST simulation, my wind field runs out at 601s out of 21600s. The reason is that my input file is specified at 600s Analysis time and Usable time, which would be a standard 10-minute wind field generated by TurbSim.
My question is this: How do I extend the wind field to 21600s. I thought that the Perl script does that for me and compiles the .bts file.
Below are my Perl script and initial input file .inp. I really would appreciate any help you can offer!
TurbSim Input File. Valid for TurbSim v1.50; 17-May-2010; Example file that can be used with simulations for the NREL 5MW Baseline Turbine; note that UsableTime has been decreased in this file so that the file distributed with the FAST CertTest isn’t as large
---------Runtime Options-----------------------------------
13428 RandSeed1 - First random seed (-2147483648 to 2147483647)
RanLux RandSeed2 - Second random seed (-2147483648 to 2147483647) for intrinsic pRNG, or an alternative pRNG: “RanLux” or “RNSNLW”
False WrBHHTP - Output hub-height turbulence parameters in binary form? (Generates RootName.bin)
False WrFHHTP - Output hub-height turbulence parameters in formatted form? (Generates RootName.dat)
False WrADHH - Output hub-height time-series data in AeroDyn form? (Generates RootName.hh)
True WrADFF - Output full-field time-series data in TurbSim/AeroDyn form? (Generates RootName.bts)
False WrBLFF - Output full-field time-series data in BLADED/AeroDyn form? (Generates RootName.wnd)
True WrADTWR - Output tower time-series data? (Generates RootName.twr)
False WrFMTFF - Output full-field time-series data in formatted (readable) form? (Generates RootName.u, RootName.v, RootName.w)
False WrACT - Output coherent turbulence time steps in AeroDyn form? (Generates RootName.cts)
True Clockwise - Clockwise rotation looking downwind? (used only for full-field binary files - not necessary for AeroDyn)
0 ScaleIEC - Scale IEC turbulence models to exact target standard deviation? [0=no additional scaling; 1=use hub scale uniformly; 2=use individual scales]
--------Turbine/Model Specifications-----------------------
31 NumGrid_Z - Vertical grid-point matrix dimension
31 NumGrid_Y - Horizontal grid-point matrix dimension
0.05 TimeStep - Time step [seconds]
630.0 AnalysisTime - Length of analysis time series [seconds]
600.0 UsableTime - Usable length of output time series [seconds] (program will add GridWidth/MeanHHWS seconds) [bjj: was 630]
90.0 HubHt - Hub height [m] (should be > 0.5GridHeight)
145.0 GridHeight - Grid height [m]
145.0 GridWidth - Grid width [m] (should be >= 2(RotorRadius+ShaftLength))
0 VFlowAng - Vertical mean flow (uptilt) angle [degrees]
0 HFlowAng - Horizontal mean flow (skew) angle [degrees]
--------Meteorological Boundary Conditions-------------------
IECKAI TurbModel - Turbulence model (“IECKAI”=Kaimal, “IECVKM”=von Karman, “GP_LLJ”, “NWTCUP”, “SMOOTH”, “WF_UPW”, “WF_07D”, “WF_14D”, or “NONE”)
“1-ed3” IECstandard - Number of IEC 61400-x standard (x=1,2, or 3 with optional 61400-1 edition number (i.e. “1-Ed2”) )
“B” IECturbc - IEC turbulence characteristic (“A”, “B”, “C” or the turbulence intensity in percent) (“KHTEST” option with NWTCUP, not used for other models)
3EWM50 IEC_WindType - IEC turbulence type (“NTM”=normal, “xETM”=extreme turbulence, “xEWM1”=extreme 1-year wind, “xEWM50”=extreme 50-year wind, where x=wind turbine class 1, 2, or 3)
default ETMc - IEC Extreme turbulence model “c” parameter [m/s]
PL WindProfileType - Wind profile type (“JET”=Low-level jet,“LOG”=Logarithmic,“PL”=Power law, or “default”, or “USR”=User-defined)
90. RefHt - Height of the reference wind speed [m]
31.0 URef - Mean (total) wind speed at the reference height [m/s]
default ZJetMax - Jet height [m] (used only for JET wind profile, valid 70-490 m)
default PLExp - Power law exponent [-] (or “default”)
default Z0 - Surface roughness length [m] (or “default”)
--------Non-IEC Meteorological Boundary Conditions------------
default Latitude - Site latitude [degrees] (or “default”)
0.05 RICH_NO - Gradient Richardson number
default UStar - Friction or shear velocity [m/s] (or “default”)
default ZI - Mixing layer depth [m] (or “default”)
default PC_UW - Hub mean u’w’ Reynolds stress [(m/s)^2] (or “default”)
default PC_UV - Hub mean u’v’ Reynolds stress [(m/s)^2] (or “default”)
default PC_VW - Hub mean v’w’ Reynolds stress [(m/s)^2] (or “default”)
default IncDec1 - u-component coherence parameters (e.g. “10.0 0.3e-3” in quotes) (or “default”)
default IncDec2 - v-component coherence parameters (e.g. “10.0 0.3e-3” in quotes) (or “default”)
default IncDec3 - w-component coherence parameters (e.g. “10.0 0.3e-3” in quotes) (or “default”)
default CohExp - Coherence exponent (or “default”)
--------Coherent Turbulence Scaling Parameters-------------------
“C:\Users\EVGDIM\Desktop\FAST + Orcaflex\TurbSim\EventData” CTEventPath - Name of the path where event data files are located
“Random” CTEventFile - Type of event files (“random”, “les” or “dns”)
true Randomize - Randomize disturbance scale and location? (true/false)
1.0 DistScl - Disturbance scale (ratio of dataset height to rotor disk).
0.5 CTLy - Fractional location of tower centerline from right (looking downwind) to left side of the dataset.
0.5 CTLz - Fractional location of hub height from the bottom of the dataset.
10.0 CTStartTime - Minimum start time for coherent structures in RootName.cts [seconds]
==================================================
NOTE: Do not add or remove any lines in this file!
PERL SCRIPT
RunTurbSim.pl
See Marshall Buhl’s RunNTM Perl script for help with this script.
Run a series of TurbSim tests, changing the seed for each case.
NOTICE
------
Look for the string “USER” for lines that you may want to change.
#-------------------------------------------------------------------
User-specified paths to programs and files. USER: YOU WILL DEFINITELY NEED TO CHANGE THESE.
#-------------------------------------------------------------------
$turbsim = “TurbSim”;
The TurbSim input/output file name:
$input_file = “C:/Users/EVGDIM/Desktop/FAST + Orcaflex/TurbSim/90m_37mps_50yr.inp”;
The Directory to place results in:
$rslt_dir = “C:/Users/EVGDIM/Desktop/FAST + Orcaflex/TurbSim/Results Seeds”;
The name of the resulting file in the results directory (will be appended with the seed number)
$rslt_file = “37mps_TurbS_CTS_50yr”;
The extensions of TurbSim output to copy to the results directory:
#@out_ext = (“inp”,“sum”,“wnd”,“cts”);
@out_ext = (“sum”,“wnd”,“cts”);
#-------------------------------------------------------------------
Set the number of seeds to run. Initialize the first seed. USER: YOU MAY WANT TO CHANGE THESE
#-------------------------------------------------------------------
$seed_1 = 816416316;
$n_seeds = 36;
#-------------------------------------------------------------------
Get and save the start time. Initialize other variables
#-------------------------------------------------------------------
$StartTime = date_time();
$n_runs = 0;
$seed_line = 4;
srand($seed_1);
#===================================================================
Loop through all seeds.
#===================================================================
for $i_seed ( 1…$n_seeds )
{
$ts_root = "${rslt_file}";
#-------------------------------------------------------------------
# Create TurbSim Input File
#-------------------------------------------------------------------
$in_file = "${ts_root}.inp";
open( IN_FILE , ">$in_file" ) or die( "Can't open '$in_file'.\n" );
open( IN_FILE1, "$input_file" ) or die( "Can't open '$input_file'.\n" );
$cnt = 1;
while ( <IN_FILE1> )
{
if ( $cnt == $seed_line )
{
printf ( IN_FILE "%s\t%s\n", "$seed_1", "The first seed" );
}
else
{
print IN_FILE;
}
$cnt++;
} # while <IN_FILE1>
close( IN_FILE );
close( IN_FILE1 );
#-------------------------------------------------------------------
Run TurbSim
#-------------------------------------------------------------------
print "\n ==============================================\n";
print " TurbSim Seed $i_seed = $seed_1 \n";
print " ==============================================\n";
print " Starting TurbSim on ", date_time(), ".\n";
system( "$turbsim $ts_root.inp > NUL" );
#-------------------------------------------------------------------
Rename output
#-------------------------------------------------------------------
$root = sprintf( "%s/%s_%s", $rslt_dir, $ts_root, $i_seed);
for $i_r ( 0..$#out_ext )
{
rename( "$ts_root.$out_ext[$i_r]" , "$root.$out_ext[$i_r]" );
}
#-------------------------------------------------------------------
Get next seed
#-------------------------------------------------------------------
$seed_1 = int( rand(2147483646) ) + 1;
$n_runs ++;
End of $i_seed loop
}
#-------------------------------------------------------------------
Done.
#-------------------------------------------------------------------
print “\n ============================================\n”;
if ( $n_runs > 1 )
{
print " After starting on $StartTime, the $n_runs batch runs\n";
print " completed on ", date_time(), “.\n\n”;
}
else
{
print " The single batch run completed on ", date_time(), “.\n\n”;
}
#-------------------------------------------------------------------
End of main function.
#-------------------------------------------------------------------
#*******************************************************************
#*******************************************************************
This routine returns the date and time in the form “dd-Mon-ccyy at hh:mm:ss”.
sub date_time
{
my( $sec, $min, $hour, $mday, $mon, $year, $mon_str );
($sec, $min, $hour, $mday, $mon, $year) = localtime;
$mon_str = (Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec)[$mon];
return sprintf( “%2.2d-%s-%4.4d at %2.2d:%2.2d:%2.2d”, $mday, $mon_str, $year+1900, $hour, $min, $sec );
}
END