-
Notifications
You must be signed in to change notification settings - Fork 66
Changes on FAST Farm case creation pull request #66
Conversation
Function to create a bat file for the Mann box and execute it
Adding functions to create the fstf file from Mann Box. creating functions to create and execute .bat files for TurbSim. Adding floating flag as well as Mooring files and rotating the mooring system with the wind direction. Adding the option to have a different Hydrodyn file for each turbine which is needed for floating wind turbines. There are also some other minor changes.
Changes in example 3 to reflect the added functions
I have made all turbines be on the positive side of the x-axis because for the MannBox this is necessary. I have modified TurbSim functions to follow the same.
update shifting the turbines to do the same function if the minimum x-coordinate is higher than zero
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for doing that and sharing. I've added a couple of comments that it would be great to address. Sorry for the extra work!
adding _repr_ function
added a flag for executing MannBox .bat file.
Hi Youssef-- Thanks for re-submitting the PR. There are a lot of changes here. I will provide detailed comments, but I will also open a discussion so we can talk about your needs and how incorporate the Mann box without modifying defaults. It is imperative that the changes are backward compatible. Let's iterate more about the changes before we pull everything in. Smaller commits with meaningful commit messages (and separate PRs) make everyone's life easier. For instance, all the formatting changes (like removing the f-strings) can/should be done in a separate commit, ideally a separate PR. |
changing ex3 to the former version with only adding the new changes
Hi @rthedin , I believe there are two major changes:
I am sorry for the mess and the big changes, I am willing to help and adjust as needed. However, I cannot redo everything step by step and recommit as this will be very time consuming. Just one question. I never managed to run FASTFarm with BR, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Apologies for the amount of comments. Let's move this to a discussion and iterate how to properly integrate the Mann boxes and your workflow into the toolbox.
nSeeds = 6, | ||
nSeeds = 1, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The default number of seeds follow the IEC 61400 standard. If you need to run only one seed for the Mann boxes, then you can specify nSeeds=1
without the need to change the defaults
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
agreed I was just making it easier for myself but you are correct.
seedValues = None, | ||
LESpath = None, | ||
sweepWakeSteering = False, | ||
sweepYawMisalignment = False, | ||
refTurb_rot = 0, | ||
verbose = 0): | ||
verbose = 0, | ||
floating=0): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is certainly a good option to have!
Max simulation time given in seconds | ||
Wind field time given in seconds | ||
tsim: integer | ||
Multiple of tmax to repeat the wind field |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems to be something that only applied to the Mann box? I'm not sure as I haven't used Mann extensively. Changing the description of tmax
to "wind field time [...]` is misleading because this also the time used on FAST.Farm.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is also an option in TurbSim. Your simulation time can be multiple of your windfield time, this way you do not create big windfields.
LESpath: str or list of strings | ||
Full path of the LES data, if driven by LES. If None, the setup will be for TurbSim inflow. | ||
Full path of the LES data, if driven by LES. | ||
If TurbSim, the setup will be for TurbSim inflow. | ||
If MannBox, the setup will be for MannBox inflow. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay, I see a need for a different option if now we have TurbSim, Mann, and LES. This needs to be changed.
self.TurbSimbin = TurbSimbin | ||
self.Mannbin = Mannbin |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point. This is useful to have.
if self.mod_wake == 1: # Polar model | ||
self.dr = self.cmax | ||
else: # Curled; Cartesian | ||
self.dr = round(self.D/10) | ||
# if self.mod_wake == 1: # Polar model | ||
# self.dr = self.cmax | ||
# else: # Curled; Cartesian | ||
# self.dr = round(self.D/10) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a reason to remove this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes. The dr should be same as DX and this is not necessarily the same as self.cmax
print(f'Calling: {sub_command}') | ||
_ = subprocess.call(sub_command, cwd=self.path, shell=True) | ||
time.sleep(delay) # Sometimes the same job gets submitted twice. This gets around it. | ||
|
||
|
||
def Create_Mannbox(self, Lm, gamma): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for creating this function. It is a really good capability to add to this case generation tool.
if nx == None: | ||
nx=re.search('Nx :(\d+)', lines[i]) | ||
if dx == None: | ||
dx=re.search('Dx : ((?:0|[1-9]\d*)(\.\d*)?(?:[eE][+\-]?\d+))', lines[i]) | ||
if ny == None: | ||
ny=re.search('Ny :(\d+)', lines[i]) | ||
if dy == None: | ||
dy=re.search('Dy : ((?:0|[1-9]\d*)(\.\d*)?(?:[eE][+\-]?\d+))', lines[i]) | ||
if nz == None: | ||
nz=re.search('Nz :(\d+)', lines[i]) | ||
if dz == None: | ||
dz=re.search('Dz : ((?:0|[1-9]\d*)(\.\d*)?(?:[eE][+\-]?\d+))', lines[i]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Regex like this should come with some comments above. It is hard to tell what is being done here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am reading the parameters of the MannBox as they have to be identical to the parameters in the Inflowind.dat file
slurm_TS_high = './SampleFiles/runAllHighBox.sh' | ||
slurm_TS_low = './SampleFiles/runAllLowBox.sh' | ||
slurm_FF_single = './SampleFiles/runFASTFarm_cond0_case0_seed0.sh' | ||
slurm_TS_high = '\SampleFiles/runAllHighBox.sh' | ||
slurm_TS_low = '/runAllLowBox.sh' | ||
slurm_FF_single = '/runFASTFarm_cond0_case0_seed0.sh' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see how I left the /
here for *nix systems and should have used os.path.join
instead. But by changing this to the Windows convention, you break its use. This needs to be updated to a more generic approach (e.g. using os
)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes I agree
self.ServoDynFile['DLL_FileName'] = f'"{self.DLLfilepath}{t+1}.so"' | ||
self.ServoDynFile['DLL_FileName'] = f'"{self.DLLfilepath}{t+1}.dll"' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
so
are used in *nix and dll
in Windows. We need to identify what system the user is using or not specify the extension.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes I agree
@rthedin no worries. I have replied to all the comments. BR, |
added batch files for turbsim and mannbox
Closing this and moving it to a discussion: #67. |
I have used the pull request #56 as a basis and updated it to include the following:
I am planning to make more changes to include:
I hope this helps. Thanks for creating the library.
BR,
Youssef