Skip to content

Commit 2553643

Browse files
authored
Merge pull request #42 from rthedin/f/ff_updates
FAST.Farm toolbox updates
2 parents 4ace71c + 6b72eb8 commit 2553643

File tree

4 files changed

+210
-106
lines changed

4 files changed

+210
-106
lines changed

openfast_toolbox/fastfarm/AMRWindSimulation.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -635,7 +635,7 @@ def _check_grid_placement_single(self, sampling_xyzgrid_lhr, amr_xyzgrid_at_lhr_
635635

636636

637637

638-
def write_sampling_params(self, out=None, overwrite=False):
638+
def write_sampling_params(self, out=None, format='netcdf', overwrite=False):
639639
'''
640640
Write out text that can be used for the sampling planes in an
641641
AMR-Wind input file
@@ -647,6 +647,8 @@ def write_sampling_params(self, out=None, overwrite=False):
647647
If saving to a file, whether or not to overwrite potentially
648648
existing file
649649
'''
650+
if format not in ['netcdf','native']:
651+
raise ValueError(f'format should be either native or netcdf')
650652

651653
# Write time step information for consistenty with sampling frequency
652654
s = f"time.fixed_dt = {self.dt}\n\n"
@@ -663,7 +665,7 @@ def write_sampling_params(self, out=None, overwrite=False):
663665
s += f"incflo.post_processing = {self.postproc_name_lr} {self.postproc_name_hr} # averaging\n\n\n"
664666

665667
s += f"# ---- Low-res sampling parameters ----\n"
666-
s += f"{self.postproc_name_lr}.output_format = netcdf\n"
668+
s += f"{self.postproc_name_lr}.output_format = {format}\n"
667669
s += f"{self.postproc_name_lr}.output_frequency = {self.output_frequency_lr}\n"
668670
s += f"{self.postproc_name_lr}.fields = velocity # temperature tke\n"
669671
s += f"{self.postproc_name_lr}.labels = {sampling_labels_lr_str}\n\n"
@@ -681,7 +683,7 @@ def write_sampling_params(self, out=None, overwrite=False):
681683
s += f"{self.postproc_name_lr}.Low.offsets = {zoffsets_lr_str}\n\n\n"
682684

683685
s += f"# ---- High-res sampling parameters ----\n"
684-
s += f"{self.postproc_name_hr}.output_format = netcdf\n"
686+
s += f"{self.postproc_name_hr}.output_format = {format}\n"
685687
s += f"{self.postproc_name_hr}.output_frequency = {self.output_frequency_hr}\n"
686688
s += f"{self.postproc_name_hr}.fields = velocity # temperature tke\n"
687689
s += f"{self.postproc_name_hr}.labels = {sampling_labels_hr_str}\n"

0 commit comments

Comments
 (0)