diff --git a/pyproject.toml b/pyproject.toml index 4e64e501..ccaa0ec8 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta" [project] name = "rosco" -version = "2.10.3" +version = "2.10.4" description = "A reference open source controller toolset for wind turbine applications." readme = "README.md" requires-python = ">=3.9" diff --git a/rosco/controller/src/ControllerBlocks.f90 b/rosco/controller/src/ControllerBlocks.f90 index 1d096a7f..3593e476 100644 --- a/rosco/controller/src/ControllerBlocks.f90 +++ b/rosco/controller/src/ControllerBlocks.f90 @@ -605,13 +605,13 @@ SUBROUTINE Startup(LocalVar, CntrPar, objInst,ErrVar) ! Set PRC_R_Speed, SU_PrevLoad based on SU_Stage IF (LocalVar%SU_Stage == 1) THEN - LocalVar%PRC_R_Speed = CntrPar%SU_RotorSpeedThresh / CntrPar%PC_RefSpd + LocalVar%PRC_R_Speed = CntrPar%SU_RotorSpeedThresh * CntrPar%WE_GearboxRatio / CntrPar%PC_RefSpd ELSEIF (LocalVar%SU_Stage == 2) THEN SU_PrevLoad = 0.0_DbKi ! Ramp up PRC_R_Speed to 1.0 in duration = SU_LoadRampDuration(1) LocalVar%PRC_R_Speed = sigma(LocalVar%Time,LocalVar%SU_LoadStageStartTime, & LocalVar%SU_LoadStageStartTime + CntrPar%SU_LoadRampDuration(LocalVar%SU_Stage - 1), & - CntrPar%SU_RotorSpeedThresh / CntrPar%PC_RefSpd ,1.0_DbKi,ErrVar) + CntrPar%SU_RotorSpeedThresh * CntrPar%WE_GearboxRatio / CntrPar%PC_RefSpd ,1.0_DbKi,ErrVar) ELSEIF ((LocalVar%SU_Stage .ge. 2) .AND. (LocalVar%SU_Stage .le. CntrPar%SU_LoadStages_N + 1)) THEN SU_PrevLoad = CntrPar%SU_LoadStages(LocalVar%SU_Stage-2) ELSEIF (LocalVar%SU_Stage == CntrPar%SU_LoadStages_N + 2) THEN diff --git a/rosco/toolbox/inputs/validation.py b/rosco/toolbox/inputs/validation.py index aacdac6d..59ef7a45 100644 --- a/rosco/toolbox/inputs/validation.py +++ b/rosco/toolbox/inputs/validation.py @@ -1,5 +1,8 @@ import os from wisdem.inputs.validation import _validate +from openfast_io.FileTools import remove_numpy +from windIO.yaml import write_yaml + schema_dir = os.path.dirname(os.path.abspath(__file__)) @@ -7,10 +10,18 @@ def load_rosco_yaml(finput, rank_0=False): rosco_schema = os.path.join(schema_dir,'toolbox_schema.yaml') return _validate(finput, rosco_schema, defaults=True, rank_0=rank_0) +def write_rosco_yaml(instance, foutput): + rosco_schema = os.path.join(schema_dir,'toolbox_schema.yaml') + _validate(instance, rosco_schema, restrictive=False, removal=True, defaults=False, rank_0=True) + instance2 = remove_numpy(instance) + write_yaml(instance2, foutput) + if __name__=='__main__': - fname = '/Users/dzalkind/Tools/ROSCO/Tune_Cases/NREL5MW.yaml' + fname = '/Users/dzalkind/Tools/ROSCO-PRC/Examples/Tune_Cases/NREL5MW.yaml' new_input = load_rosco_yaml(fname) + + write_rosco_yaml(new_input, 'test_output.yaml') print('here') diff --git a/rosco/toolbox/utilities.py b/rosco/toolbox/utilities.py index a4b116b4..c2f91f07 100644 --- a/rosco/toolbox/utilities.py +++ b/rosco/toolbox/utilities.py @@ -770,7 +770,7 @@ def list_check(x, return_bool=True): elif isinstance(x, np.ndarray): if x.size == 1: is_list = False - y = float(x) + y = float(x[0]) else: is_list = True y = x