Skip to content

Commit

Permalink
Store defaults in a YAML file
Browse files Browse the repository at this point in the history
Allows for using this file in other areas of the software
  • Loading branch information
rafmudaf committed Feb 4, 2025
1 parent bac4c08 commit 2c7d975
Show file tree
Hide file tree
Showing 4 changed files with 122 additions and 143 deletions.
127 changes: 0 additions & 127 deletions floris/default_inputs.py

This file was deleted.

106 changes: 106 additions & 0 deletions floris/default_inputs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@

name: GCH
description: "Default initialization: Gauss-Curl hybrid model (GCH)"
floris_version: v4

logging:
console:
enable: true
level: WARNING
file:
enable: false
level: WARNING

solver:
type: turbine_grid
turbine_grid_points: 3

farm:
layout_x:
- 0.0
layout_y:
- 0.0
turbine_type:
- nrel_5MW

flow_field:
air_density: 1.225
reference_wind_height: -1
turbulence_intensities: []
wind_directions: []
wind_shear: 0.12
wind_speeds: []
wind_veer: 0.0

wake:
model_strings:
combination_model: sosfs
deflection_model: gauss
turbulence_model: crespo_hernandez
velocity_model: gauss

enable_secondary_steering: true
enable_yaw_added_recovery: true
enable_transverse_velocities: true
enable_active_wake_mixing: false

wake_deflection_parameters:
gauss:
ad: 0.0
alpha: 0.58
bd: 0.0
beta: 0.077
dm: 1.0
ka: 0.38
kb: 0.004
jimenez:
ad: 0.0
bd: 0.0
kd: 0.05
empirical_gauss:
horizontal_deflection_gain_D: 3.0
vertical_deflection_gain_D: -1
deflection_rate: 22
mixing_gain_deflection: 0.0
yaw_added_mixing_gain: 0.0

wake_velocity_parameters:
gauss:
alpha: 0.58
beta: 0.077
ka: 0.38
kb: 0.004
jensen:
we: 0.05
cc:
a_s: 0.179367259
b_s: 0.0118889215
c_s1: 0.0563691592
c_s2: 0.13290157
a_f: 3.11
b_f: -0.68
c_f: 2.41
alpha_mod: 1.0
turbopark:
A: 0.04
sigma_max_rel: 4.0
turboparkgauss:
A: 0.04
include_mirror_wake: True
empirical_gauss:
wake_expansion_rates: [0.023, 0.008]
breakpoints_D: [10]
sigma_0_D: 0.28
smoothing_length_D: 2.0
mixing_gain_velocity: 2.0
awc_wake_exp: 1.2
awc_wake_denominator: 400

wake_turbulence_parameters:
crespo_hernandez:
initial: 0.1
constant: 0.5
ai: 0.8
downstream: -0.32
wake_induced_mixing:
atmospheric_ti_gain: 0.0
4 changes: 2 additions & 2 deletions floris/floris_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
thrust_coefficient,
)
from floris.cut_plane import CutPlane
from floris.default_inputs import default_inputs
from floris.logging_manager import LoggingManager
from floris.type_dec import (
floris_array_converter,
Expand All @@ -34,6 +33,7 @@
NDArrayStr,
)
from floris.utilities import (
load_yaml,
nested_get,
nested_set,
print_nested_dict,
Expand Down Expand Up @@ -66,7 +66,7 @@ class FlorisModel(LoggingManager):

@staticmethod
def get_defaults() -> dict:
return copy.deepcopy(default_inputs)
return copy.deepcopy(load_yaml(Path(__file__).parent / "default_inputs.yaml"))

def __init__(self, configuration: dict | str | Path):

Expand Down
28 changes: 14 additions & 14 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,25 +9,25 @@ description = "A controls-oriented engineering wake model."
readme = "README.md"
requires-python = ">=3.9"
authors = [
{ name = "Rafael Mudafort", email = "rafael.mudafort@nrel.gov" },
{ name = "Paul Fleming", email = "paul.fleming@nrel.gov" },
{ name = "Rafael Mudafort", email = "Rafael.Mudafort@nrel.gov" },
{ name = "Paul Fleming", email = "Paul.Fleming@nrel.gov" },
{ name = "Michael (Misha) Sinner", email = "[email protected]" },
{ name = "Eric Simley", email = "[email protected]" },
{ name = "Christopher Bay", email = "[email protected]" },
]
license = { file = "LICENSE.txt" }
keywords = ["floris"]
classifiers = [
"License :: OSI Approved :: BSD License",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: Implementation :: CPython",
"Programming Language :: Python :: Implementation :: PyPy"
"License :: OSI Approved :: BSD License",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: Implementation :: CPython",
"Programming Language :: Python :: Implementation :: PyPy"
]
dependencies = [
"attrs",
Expand Down Expand Up @@ -63,7 +63,8 @@ include = ["floris*"]
[tool.setuptools.package-data]
floris = [
"turbine_library/*.yaml",
"core/wake_velocity/turbopark_lookup_table.mat"
"core/wake_velocity/turbopark_lookup_table.mat",
"default_inputs.yaml"
]

[project.urls]
Expand All @@ -76,7 +77,6 @@ Documentation = "https://nrel.github.io/floris/"
branch = true
source = "floris/*"
omit = [
"setup.py",
"tests/*"
]

Expand Down

0 comments on commit 2c7d975

Please sign in to comment.