diff --git a/openfast_toolbox/fastfarm/AMRWindSimulation.py b/openfast_toolbox/fastfarm/AMRWindSimulation.py index bc29772..a45af88 100644 --- a/openfast_toolbox/fastfarm/AMRWindSimulation.py +++ b/openfast_toolbox/fastfarm/AMRWindSimulation.py @@ -180,7 +180,7 @@ def _checkInputs(self): # For convenience, the turbines should not be zero-indexed if 'name' in self.wts[0]: if self.wts[0]['name'] != 'T1': - if self.verbose>0: print(f"--- WARNING: Recommended turbine numbering should start at 1. Currently it is zero-indexed.") + if self.verbose>0: print(f"WARNING: Recommended turbine numbering should start at 1. Currently it is zero-indexed.") # Flags of given/calculated spatial resolution for warning/error printing purposes @@ -188,10 +188,10 @@ def _checkInputs(self): self.given_ds_lr = False warn_msg = "" if self.ds_hr is not None: - warn_msg += f"--- WARNING: HIGH-RES SPATIAL RESOLUTION GIVEN. CONVERTING FATAL ERRORS ON HIGH-RES BOXES CHECKS TO WARNINGS. ---\n" + warn_msg += f"WARNING: HIGH-RES SPATIAL RESOLUTION GIVEN. CONVERTING FATAL ERRORS ON HIGH-RES BOXES CHECKS TO WARNINGS." self.given_ds_hr = True if self.ds_lr is not None: - warn_msg += f"--- WARNING: LOW-RES SPATIAL RESOLUTION GIVEN. CONVERTING FATAL ERRORS ON LOW-RES BOX CHECKS TO WARNINGS. ---\n" + warn_msg += f"WARNING: LOW-RES SPATIAL RESOLUTION GIVEN. CONVERTING FATAL ERRORS ON LOW-RES BOX CHECKS TO WARNINGS." self.given_ds_lr = True if self.verbose>0: print(f'{warn_msg}\n') a=1 diff --git a/openfast_toolbox/fastfarm/FASTFarmCaseCreation.py b/openfast_toolbox/fastfarm/FASTFarmCaseCreation.py index 345e0db..09f0517 100644 --- a/openfast_toolbox/fastfarm/FASTFarmCaseCreation.py +++ b/openfast_toolbox/fastfarm/FASTFarmCaseCreation.py @@ -561,10 +561,13 @@ def _determine_resolutions_from_dummy_amrwind_grid(self): n_cell, max_level, incflo_velocity_hh, buffer_lr = self.extent_low, buffer_hr = self.extent_high, + ds_hr = self.ds_high, ds_lr = self.ds_low, + dt_hr = self.dt_high, dt_lr = self.dt_low, mod_wake = self.mod_wake) - print(f' High-resolution: ds: {amr.ds_high_les} m, dt: {amr.dt_high_les} s') - print(f' Low-resolution: ds: {amr.ds_low_les} m, dt: {amr.dt_low_les} s\n') + print(f'Calculated values:') + print(f' High-resolution: ds: {amr.ds_high_les} m, dt: {amr.dt_high_les} s') + print(f' Low-resolution: ds: {amr.ds_low_les} m, dt: {amr.dt_low_les} s\n') print(f'WARNING: If the above values are too fine or manual tuning is warranted, specify them manually.') print(f' To do that, specify, e.g., `dt_high = {2*amr.dt_high_les}` to the call to `FFCaseCreation`.') print(f' `ds_high = {2*amr.ds_high_les}`') @@ -808,7 +811,8 @@ def copyTurbineFilesForEachCase(self, writeFiles=True): if 'Skew_Mod' in self.AeroDynFile.keys(): self.AeroDynFile['Skew_Mod'] = 1 self.AeroDynFile['SkewMomCorr'] = True - # self.AeroDynFile['UA_Mod'] = 0 + self.AeroDynFile['BEM_Mod'] = 2 + self.AeroDynFile['IntegrationMethod'] = 4 # Adjust the Airfoil path to point to the templatePath (1:-1 to remove quotes) self.AeroDynFile['AFNames'] = [f'"{os.path.join(self.templatePathabs, "Airfoils", i[1:-1].split("Airfoils/", 1)[-1])}"' for i in self.AeroDynFile['AFNames'] ] @@ -1893,7 +1897,7 @@ def TS_high_get_time_series(self): uvel_hr = np.interp(time_hr, time, uvel) vvel_hr = np.interp(time_hr, time, vvel) wvel_hr = np.interp(time_hr, time, wvel) - + # Checks assert len(time_hr)==len(uvel_hr) assert len(uvel_hr)==len(vvel_hr) @@ -1911,7 +1915,7 @@ def TS_high_get_time_series(self): # point in the low-res box, and then pass this offset to the time-series file. In this example, the offset is 2 m, thus the # time-series file will have a y of 2 m. yoffset = bts['y'][jTurb] - yt - if yoffset != 0: + if yoffset != 0 and self.verbose>1: print(f"Seed {seed}, Case {case}: Turbine {t+1} is not at a grid point location. Tubine is at y={yloc_}",\ f"on the turbine reference frame, which is y={yt} on the low-res TurbSim reference frame. The",\ f"nearest grid point in y is {bts['y'][jTurb]} so printing y={yoffset} to the time-series file.") diff --git a/openfast_toolbox/fastfarm/examples/Ex1_FASTFarm_discretization.py b/openfast_toolbox/fastfarm/examples/Ex1_FASTFarm_discretization.py index 0bcdd70..411ca13 100644 --- a/openfast_toolbox/fastfarm/examples/Ex1_FASTFarm_discretization.py +++ b/openfast_toolbox/fastfarm/examples/Ex1_FASTFarm_discretization.py @@ -145,12 +145,12 @@ def main(): # ----------- Initial setup # The initial setup with the temporal and spatial resolutions of both high and # low resolution boxes given as None will trigger their automatic computation. - ffcase = FFCaseCreation(path, wts, tmax, zbot, vhub, shear, TIvalue, inflow_deg, - dt_high=dt_high, ds_high=ds_high, extent_high=extent_high, - dt_low=dt_low, ds_low=ds_low, extent_low=extent_low, - ffbin=ffbin, mod_wake=mod_wake, yaw_init=yaw_init, - nSeeds=nSeeds, tsbin=tsbin, inflowType=inflowType, - refTurb_rot=refTurb_rot, verbose=0) + amr = FFCaseCreation(path, wts, tmax, zbot, vhub, shear, TIvalue, inflow_deg, + dt_high=dt_high, ds_high=ds_high, extent_high=extent_high, + dt_low=dt_low, ds_low=ds_low, extent_low=extent_low, + ffbin=ffbin, mod_wake=mod_wake, yaw_init=yaw_init, + nSeeds=nSeeds, tsbin=tsbin, inflowType=inflowType, + refTurb_rot=refTurb_rot, verbose=0)