diff --git a/power-curve-schema/examples/generic-117-3-with-extra-parameters.json b/power-curve-schema/examples/generic-117-3-with-extra-parameters.json new file mode 100644 index 0000000..94b3d52 --- /dev/null +++ b/power-curve-schema/examples/generic-117-3-with-extra-parameters.json @@ -0,0 +1,333 @@ +{ + "document": { + "metadata": [ + { + "term": "Identifier", + "value": "126b9e41-722f-49ab-9586-b55188adf420" + }, + { + "term": "Format", + "value": "IEC61400-16-1" + }, + { + "term": "Source", + "value": "Doc 12345 - Rev 01" + } + ] + }, + "turbine": { + "model_name": "GT 3.45-117", + "model_description": "A generic turbine based on supergeneric(TM) technology and featuring the GeneriX blade system.", + "manufacturer_name": "Generic Turbines (a Generic Megacorp company) Inc", + "manufacturer_display_name": "Generic Turbines", + "platform_name": "Series GT3.x", + "platform_description": "The Series GT3.x platform is designed to support a range of small onshore turbine models, intended to address a versatile range of site conditions and minimise logistical problems in constructions", + "rated_power": 3450000, + "rated_rpm": 12, + "cut_in_rpm": 2, + "rotor_diameter": 117.0, + "rotor_tilt": 5, + "number_of_blades": 3, + "available_hub_heights": [91.5, 116.5, 141.5], + "drive_type": "geared", + "regulation_type": "pitch", + "grid_frequencies": [50, 60], + "thermal_shutdown": { + "derating": [ + { + "$comment": "Linear ramp down in low temperatures, altitude 2500", + "altitude": 2500, + "temperature": [-15, 10], + "power_limit": [1.1e6, 2e6] + }, + { + "$comment": "Linear ramp down in low temperatures, altitude 1250", + "altitude": 1250, + "temperature": [-15, 10], + "power_limit": [1.4e6, 2e6] + }, + { + "$comment": "Linear ramp down in low temperatures, altitude 0", + "altitude": 0, + "temperature": [-15, 10], + "power_limit": [1.6e6, 2e6] + }, + { + "$comment": "Linear ramp down to zero in high temperatures, altitude 2500", + "altitude": 2500, + "temperature": [40, 45], + "power_limit": [2e6, 0] + }, + { + "$comment": "Linear ramp down to zero in high temperatures, altitude 1250", + "altitude": 1250, + "temperature": [42, 45], + "power_limit": [2e6, 0] + }, + { + "$comment": "Linear ramp down to zero in high temperatures, altitude 0", + "altitude": 0, + "temperature": [42, 45], + "power_limit": [2e6, 0] + } + ], + "cold": { + "shutdown_temperature": -15, + "restart_temperature": -12, + "restart_duration": 7200 + }, + "hot": { + "shutdown_temperature": 45, + "restart_temperature": 40, + "restart_duration": 30 + } + } + }, + "design_bases": [ + { + "label": "basis_1", + "name": "Basis 1", + "certification": { + "certificate_reference": "IECRE.WE.TC.20.0099-R6", + "standard": "IEC", + "standard_edition": "2" + }, + "design_class": { + "class_label": "II" + }, + "design_lifetime": 20, + "turbulence": { + "category": "A" + }, + "standard_climate": { + "operating_temperature_range": [-10, 40], + "survival_temperature_range": [-20, 50] + }, + "cold_climate": { + "operating_temperature_range": [-20, 40], + "survival_temperature_range": [-40, 50] + }, + "hot_climate": { + "operating_temperature_range": [-10, 45], + "survival_temperature_range": [-20, 50] + } + }, + { + "label": "basis_2", + "name": "Basis 2 - Custom design class", + "certification": { + "certificate_reference": "IECRE.WE.TC.20.0099-R6", + "standard": "IEC", + "standard_edition": "2" + }, + "design_class": { + "class_label": "S", + "annual_average_wind_speed": 8.5, + "annual_average_air_density": 1.15, + "reference_wind_speed": 37.5, + "weibull_shape_factor": 2.4, + "vertical_shear_exponent": 0.3, + "inclination_angle": 8, + "design_lifetime": 25 + }, + "turbulence": { + "category": "A" + }, + "standard_climate": { + "operating_temperature_range": [-10, 40], + "survival_temperature_range": [-20, 50] + }, + "cold_climate": { + "operating_temperature_range": [-20, 40], + "survival_temperature_range": [-40, 50] + }, + "hot_climate": { + "operating_temperature_range": [-10, 45], + "survival_temperature_range": [-20, 50] + } + }, + { + "label": "basis_3", + "name": "Basis 3 - Custom turbulence definition", + "certification": { + "certificate_reference": "IECRE.WE.TC.20.0099-R6", + "standard": "IEC", + "standard_edition": "2" + }, + "design_class": { + "class_label": "II" + }, + "design_lifetime": 20, + "standard_climate": { + "operating_temperature_range": [-10, 40], + "survival_temperature_range": [-20, 50] + }, + "cold_climate": { + "operating_temperature_range": [-20, 40], + "survival_temperature_range": [-40, 50] + }, + "hot_climate": { + "operating_temperature_range": [-10, 45], + "survival_temperature_range": [-20, 50] + }, + "turbulence": { + "category": "2d-NETM", + "wind_speed": [1, 2, 25], + "normal_turbulence_intensity": [ + [0.116, 0.1889, 0.2613, 0.3337, 0.46], + [0.116, 0.1889, 0.2613, 0.3337, 0.46], + [0.116, 0.1889, 0.2613, 0.3337, 0.46] + ], + "normal_hours_per_lifetime": [ + [1633.89, 2145.8, 1551.13, 1434.6, 1321.1], + [804.2, 956.3, 756.3, 645.6, 543.7], + [30.5, 60.4, 43.8, 38.5, 27.6] + ], + "extreme_turbulence_intensity": [0.92, 0.6, 0.15] + } + } + ], + "power_curves": { + "default_operating_mode": "standard", + "operating_modes": [ + { + "label": "standard", + "name": "Standard", + "description": "Standard full power mode", + "design_bases": ["basis_1", "basis_2", "basis_3"], + "rated_power": 3450000, + "cuts": [ + { + "kind": "low_cut_in", + "wind_speed": 3, + "period": 600 + }, + { + "kind": "low_cut_out", + "wind_speed": 2.5, + "period": 600 + }, + { + "kind": "high_cut_out", + "wind_speed": 25, + "period": 600 + }, + { + "kind": "high_cut_in", + "wind_speed": 22, + "period": 240 + }, + { + "kind": "high_cut_out", + "wind_speed": 28, + "period": 30 + }, + { + "kind": "high_cut_out", + "wind_speed": 34, + "period": 3 + } + ], + "parameters": [ + { + "label": "air-density", + "value": 1.225 + }, + { + "label": "reference-turbulence-intensity", + "max": 0.12, + "min": 0.04 + }, + { + "label": "turbulence-lengthscale", + "max": 300, + "min": 25 + }, + { + "label": "shear-coefficient", + "max": 0.2, + "min": 0.3 + }, + { + "label": "reference-turbulence-intensity", + "dimension": 0, + "values": [ + { + "min": 0.04, + "max": 0.012 + }, + { + "min": 0.12, + "max": 0.12 + }, + { + "min": 0.08, + "max": 0.12 + } + ] + }, + { + "label": "wind-speed", + "dimension": 1, + "values": [ + 3.0, 3.5, 4.0, 4.5, 5.0, 5.5, 6.0, 6.5, 7.0, 7.5, 8.0, 8.5, 9.0, + 9.5, 10.0, 10.5, 11.0, 11.5, 12.0, 12.5, 13.0, 13.5, 14.0, 14.5, + 15.0, 15.5, 16.0, 16.5, 17.0, 17.5, 18.0, 18.5, 19.0, 19.5, 20.0, + 20.5, 21.0, 21.5, 22.0, 22.5, 23.0, 23.5, 24.0, 24.5, 25.0 + ] + } + ], + "power_is_coefficient": false, + "thrust_is_coefficient": true, + "power": [ + [ + [ + 22000.0, 78000.0, 150000.0, 237000.0, 340000.0, 466000.0, 617000.0, + 796000.0, 1006000.0, 1247000.0, 1522000.0, 1871000.0, 2178000.0, + 2544000.0, 2905000.0, 3201000.0, 3374000.0, 3435000.0, 3448000.0, + 3450000.0, 3450000.0, 3450000.0, 3450000.0, 3450000.0, 3450000.0, + 3450000.0, 3450000.0, 3450000.0, 3450000.0, 3450000.0, 3450000.0, + 3450000.0, 3450000.0, 3450000.0, 3450000.0, 3450000.0, 3450000.0, + 3450000.0, 3450000.0, 3450000.0, 3450000.0, 3450000.0, 3450000.0, + 3450000.0, 3450000.0 + ] + ], + [ + [ + 22000.0, 78000.0, 150000.0, 237000.0, 340000.0, 466000.0, 617000.0, + 796000.0, 1006000.0, 1247000.0, 1522000.0, 1871000.0, 2178000.0, + 2544000.0, 2905000.0, 3201000.0, 3374000.0, 3435000.0, 3448000.0, + 3450000.0, 3450000.0, 3450000.0, 3450000.0, 3450000.0, 3450000.0, + 3450000.0, 3450000.0, 3450000.0, 3450000.0, 3450000.0, 3450000.0, + 3450000.0, 3450000.0, 3450000.0, 3450000.0, 3450000.0, 3450000.0, + 3450000.0, 3450000.0, 3450000.0, 3450000.0, 3450000.0, 3450000.0, + 3450000.0, 3450000.0 + ] + ], + [ + [ + 22000.0, 78000.0, 150000.0, 237000.0, 340000.0, 466000.0, 617000.0, + 796000.0, 1006000.0, 1247000.0, 1522000.0, 1871000.0, 2178000.0, + 2544000.0, 2905000.0, 3201000.0, 3374000.0, 3435000.0, 3448000.0, + 3450000.0, 3450000.0, 3450000.0, 3450000.0, 3450000.0, 3450000.0, + 3450000.0, 3450000.0, 3450000.0, 3450000.0, 3450000.0, 3450000.0, + 3450000.0, 3450000.0, 3450000.0, 3450000.0, 3450000.0, 3450000.0, + 3450000.0, 3450000.0, 3450000.0, 3450000.0, 3450000.0, 3450000.0, + 3450000.0, 3450000.0 + ] + ] + ], + "thrust": [ + [ + 0.873, 0.849, 0.834, 0.828, 0.827, 0.825, 0.82, 0.816, 0.805, 0.804, + 0.794, 0.79, 0.789, 0.772, 0.733, 0.666, 0.58, 0.494, 0.421, 0.362, + 0.316, 0.281, 0.249, 0.223, 0.199, 0.18, 0.164, 0.149, 0.137, 0.125, + 0.115, 0.107, 0.098, 0.091, 0.085, 0.079, 0.074, 0.07, 0.066, 0.062, + 0.058, 0.055, 0.052, 0.049, 0.046 + ] + ], + "overrides": {} + } + ] + } +} diff --git a/power-curve-schema/examples/generic-117-3.json b/power-curve-schema/examples/generic-117-3.json index 36b3111..92fbca4 100644 --- a/power-curve-schema/examples/generic-117-3.json +++ b/power-curve-schema/examples/generic-117-3.json @@ -231,12 +231,11 @@ "parameters": [ { "label": "air-density", - "dimension": 0, - "values": [1.225] + "value": 1.225 }, { "label": "wind-speed", - "dimension": 1, + "dimension": 0, "values": [ 3.0, 3.5, 4.0, 4.5, 5.0, 5.5, 6.0, 6.5, 7.0, 7.5, 8.0, 8.5, 9.0, 9.5, 10.0, 10.5, 11.0, 11.5, 12.0, 12.5, 13.0, 13.5, 14.0, 14.5, @@ -248,25 +247,21 @@ "power_is_coefficient": false, "thrust_is_coefficient": true, "power": [ - [ - 22000.0, 78000.0, 150000.0, 237000.0, 340000.0, 466000.0, 617000.0, - 796000.0, 1006000.0, 1247000.0, 1522000.0, 1871000.0, 2178000.0, - 2544000.0, 2905000.0, 3201000.0, 3374000.0, 3435000.0, 3448000.0, - 3450000.0, 3450000.0, 3450000.0, 3450000.0, 3450000.0, 3450000.0, - 3450000.0, 3450000.0, 3450000.0, 3450000.0, 3450000.0, 3450000.0, - 3450000.0, 3450000.0, 3450000.0, 3450000.0, 3450000.0, 3450000.0, - 3450000.0, 3450000.0, 3450000.0, 3450000.0, 3450000.0, 3450000.0, - 3450000.0, 3450000.0 - ] + 22000.0, 78000.0, 150000.0, 237000.0, 340000.0, 466000.0, 617000.0, + 796000.0, 1006000.0, 1247000.0, 1522000.0, 1871000.0, 2178000.0, + 2544000.0, 2905000.0, 3201000.0, 3374000.0, 3435000.0, 3448000.0, + 3450000.0, 3450000.0, 3450000.0, 3450000.0, 3450000.0, 3450000.0, + 3450000.0, 3450000.0, 3450000.0, 3450000.0, 3450000.0, 3450000.0, + 3450000.0, 3450000.0, 3450000.0, 3450000.0, 3450000.0, 3450000.0, + 3450000.0, 3450000.0, 3450000.0, 3450000.0, 3450000.0, 3450000.0, + 3450000.0, 3450000.0 ], "thrust": [ - [ - 0.873, 0.849, 0.834, 0.828, 0.827, 0.825, 0.82, 0.816, 0.805, 0.804, - 0.794, 0.79, 0.789, 0.772, 0.733, 0.666, 0.58, 0.494, 0.421, 0.362, - 0.316, 0.281, 0.249, 0.223, 0.199, 0.18, 0.164, 0.149, 0.137, 0.125, - 0.115, 0.107, 0.098, 0.091, 0.085, 0.079, 0.074, 0.07, 0.066, 0.062, - 0.058, 0.055, 0.052, 0.049, 0.046 - ] + 0.873, 0.849, 0.834, 0.828, 0.827, 0.825, 0.82, 0.816, 0.805, 0.804, + 0.794, 0.79, 0.789, 0.772, 0.733, 0.666, 0.58, 0.494, 0.421, 0.362, + 0.316, 0.281, 0.249, 0.223, 0.199, 0.18, 0.164, 0.149, 0.137, 0.125, + 0.115, 0.107, 0.098, 0.091, 0.085, 0.079, 0.074, 0.07, 0.066, 0.062, + 0.058, 0.055, 0.052, 0.049, 0.046 ], "overrides": {} } diff --git a/power-curve-schema/schema.json b/power-curve-schema/schema.json index 9d83fb4..66a59c7 100644 --- a/power-curve-schema/schema.json +++ b/power-curve-schema/schema.json @@ -373,6 +373,170 @@ "exclusiveMinimum": 0 }, "uniqueItems": true + }, + "parameters": { + "parameter_label": { + "type": "string", + "enum": [ + "air-density", + "wind-speed", + "turbulence-intensity", + "turbulence-lengthscale", + "monin-obukhov-stability", + "shear-coefficient" + ], + "title": "Parameter label", + "description": "A slugified string key used to identify the parameter (e.g. air-density)." + }, + "parameter_dimension": { + "type": "integer", + "title": "Dimension", + "description": "Dimension of the power/thrust array along which this parameter varies (0-based)" + }, + "parameter_values": { + "type": "array", + "additionalItems": true, + "items": { + "type": "number" + } + }, + "parameter_value": { + "type": "number" + }, + "singleton": { + "oneOf": [ + { + "value": { + "description": "Parameter value", + "type": "number" + }, + "required":["value"] + }, + { + "min": { + "description": "Inclusive minimum parameter value", + "type": "number" + }, + "max": { + "description": "Exclusive maximum parameter value", + "type": "number" + }, + "required": ["min", "max"] + } + ] + }, + "air_density": { + "value": { + "$ref": "#/$defs/parameter_value", + "title": "Air Density", + "description": "Value of air density [kg/m^3] for which this power curve is tabulated" + }, + "values": { + "$ref": "#/$defs/parameters/parameter_values", + "title": "Air Density Values", + "description": "Values of air density [kg/m^3] for which this power curve is tabulated" + }, + "min": { + "$ref": "#/$defs/parameters/air_density/value", + "title": "Minimum Air Density", + "description": "Inclusive minimum value of air density [kg/m^3] for which this tabulated power curve is valid" + }, + "max": { + "$ref": "#/$defs/parameters/air_density/value", + "title": "Maximum Air Density", + "description": "Exclusive maximum value of air density [kg/m^3] for which this tabulated power curve is valid" + }, + "range": { + "type": "object", + "properties": { + "min": { + "$ref": "#/$defs/parameters/air_density/min" + }, + "max": { + "$ref": "#/$defs/parameters/air_density/max" + } + } + }, + "ranges": {} + }, + "wind_speed": { + "value": { + "$ref": "#/$defs/parameter_value", + "title": "Wind Speed", + "description": "Value of free-stream wind speed [m/s] at hub height for which this power curve is tabulated" + }, + "values": { + "$ref": "#/$defs/parameters/parameter_values", + "title": "Wind Speed Values", + "description": "Values of free-stream wind speed [m/s] at hub height for which this power curve is tabulated" + }, + "range": {}, + "ranges": {} + }, + "turbulence_intensity": { + "value": { + "title": "Turbulence Intensity", + "description": "Value of turbulence intensity I [-] (expressed as a factor in the range 0,1 rather than a percentage) for which this power curve is tabulated", + "type": "number", + "minimum": 0, + "maximum": 1 + }, + "values": { + "type": "array", + "additionalItems": true, + "items": { + "type": "number", + "minimum": 0, + "maximum": 1 + }, + "title": "Turbulence Intensity Value", + "description": "Values of turbulence intensity I [-] (expressed as a factor in the range 0,1 rather than a percentage) for which this power curve is tabulated" + }, + "range": {}, + "ranges": {} + }, + "turbulence_lengthscale": { + "value": { + "$ref": "#/$defs/parameters/parameter_value", + "title": "Turbulence Lengthscale", + "description": "Value of turbulence integral lengthscale l [m] for which this power curve is tabulated" + }, + "values": { + "$ref": "#/$defs/parameters/parameter_values", + "title": "Turbulence Lengthscale Values", + "description": "Values of turbulence integral lengthscale l [m] for which this power curve is tabulated" + }, + "range": {}, + "ranges": {} + }, + "monin_obukhov_stability": { + "value": { + "$ref": "#/$defs/parameter_value", + "title": "Monin-Obukhov Stability", + "description": "Value of the the Monin-Obukhov stability parameter zeta [-] for which this power curve is tabulated. Values of zero indicate neutral conditions." + }, + "values": { + "$ref": "#/$defs/parameter_values", + "title": "Monin-Obukhov Stability Values", + "description": "Values of the the Monin-Obukhov stability parameter zeta [-] for which this power curve is tabulated. Values of zero indicate neutral conditions." + }, + "range": {}, + "ranges": {} + }, + "shear_coefficient": { + "value": { + "$ref": "#/$defs/parameters/parameter_value", + "title": "Shear Coefficient", + "description": "Value of wind shear coefficient alpha [-] for which this power curve is tabulated" + }, + "values": { + "$ref": "#/$defs/parameters/parameter_values", + "title": "Shear Coefficient Values", + "description": "Values of wind shear coefficient alpha [-] for which this power curve is tabulated" + }, + "range": {}, + "ranges": {} + } } }, "required": ["document", "turbine", "design_bases", "power_curves"], @@ -1132,193 +1296,390 @@ "additionalItems": true, "items": { "type": "object", - "required": ["label", "dimension", "values"], - "properties": { - "label": { - "type": "string", - "enum": [ - "air-density", - "wind-speed", - "turbulence-intensity", - "turbulence-lengthscale", - "monin-obukhov-stability", - "shear-coefficient", - "wind-direction" - ], - "title": "Parameter label", - "description": "A slugified string key used to identify the parameter (e.g. air-density)." - }, - "dimension": { - "type": "integer", - "title": "Dimension", - "description": "Dimension of the power curve array along which this parameter varies (0-based)" - } - }, - "allOf": [ + "oneOf": [ { - "if": { - "properties": { - "label": { - "const": "air-density" - } - } - }, - "then": { - "properties": { - "values": { - "type": "array", - "additionalItems": true, - "items": { - "type": "number" - }, - "title": "Air Density Values", - "description": "Values of air density [kg/m^3] for which this power curve is tabulated" - } + "title": "Varying with a list of values", + "description": "Power and thrust vary with the value of this parameter (represents a non-singleton dimension on the power and thrust arrays)", + "required": ["label", "dimension", "values"], + "properties": { + "label": { + "$ref": "#/$defs/parameter_label" }, - "required": ["values"] - } - }, - { - "if": { - "properties": { - "label": { - "const": "wind-speed" - } - } - }, - "then": { - "properties": { - "values": { - "type": "array", - "additionalItems": true, - "items": { - "type": "number" - }, - "title": "Wind Speed Values", - "description": "Values of free-stream wind speed [m/s] at hub height for which this power curve is tabulated" - } + "dimension": { + "$ref": "#/$defs/parameter_dimension" }, - "required": ["values"] - } - }, - { - "if": { - "properties": { - "label": { - "const": "turbulence-intensity" - } - } - }, - "then": { - "properties": { - "values": { - "type": "array", - "additionalItems": true, - "items": { - "type": "number", - "minimum": 0, - "maximum": 1 + "allOf": [ + { + "if": { + "properties": { + "label": { + "const": "air-density" + } + } }, - "title": "Turbulence Intensity Values", - "description": "Values of turbulence intensity I [-] (expressed as a factor in the range 0,1 rather than a percentage) for which this power curve is tabulated" - } - }, - "required": ["values"] - } - }, - { - "if": { - "properties": { - "label": { - "const": "turbulence-lengthscale" - } - } - }, - "then": { - "properties": { - "values": { - "type": "array", - "additionalItems": true, - "items": { - "type": "number" + "then": { + "properties": { + "values": { + "$ref": "#/$defs/parameters/air_density_values" + } + } + } + }, + { + "if": { + "properties": { + "label": { + "const": "wind-speed" + } + } }, - "title": "Turbulence Lengthscale Values", - "description": "Values of turbulence integral lengthscale l [m] for which this power curve is tabulated" - } - }, - "required": ["values"] - } - }, - { - "if": { - "properties": { - "label": { - "const": "monin-obukhov-stability" - } - } - }, - "then": { - "properties": { - "values": { - "type": "array", - "additionalItems": true, - "items": { - "type": "number" + "then": { + "properties": { + "values": { + "$ref": "#/$defs/parameters/wind_speed_values" + } + } + } + }, + { + "if": { + "properties": { + "label": { + "const": "turbulence-intensity" + } + } + }, + "then": { + "properties": { + "values": { + "$ref": "#/$defs/parameters/turbulence_intensity_values" + } + } + } + }, + { + "if": { + "properties": { + "label": { + "const": "turbulence-lengthscale" + } + } + }, + "then": { + "properties": { + "values": { + "$ref": "#/$defs/parameters/turbulence_lengthscale_values" + } + } + } + }, + { + "if": { + "properties": { + "label": { + "const": "monin-obukhov-stability" + } + } + }, + "then": { + "properties": { + "values": { + "$ref": "#/$defs/parameters/monin_obukhov_stability_values" + } + } + } + }, + { + "if": { + "properties": { + "label": { + "const": "shear-coefficient" + } + } }, - "title": "Monin-Obukhov Stability Values", - "description": "Values of the the Monin-Obukhov stability parameter zeta [-] for which this power curve is tabulated. Values of zero indicate neutral conditions, vegative condi" + "then": { + "properties": { + "values": { + "$ref": "#/$defs/parameters/shear_coefficient_values" + } + } + } } - }, - "required": ["values"] + ] } }, { - "if": { - "properties": { - "label": { - "const": "shear-coefficient" - } - } - }, - "then": { - "properties": { - "values": { - "type": "array", - "additionalItems": true, - "items": { - "type": "number" + "title": "Given for a specific parameter value", + "description": "Power and thrust values are given for the value of this parameter (represents a singleton dimension on the power and thrust arrays)", + "required": ["label", "value"], + "properties": { + "label": { + "$ref": "#/$defs/parameter_label" + }, + "allOf": [ + { + "if": { + "properties": { + "label": { + "const": "air-density" + } + } + }, + "then": { + "properties": { + "value": { + "$ref": "#/$defs/parameters/air_density/value" + } + } + } + }, + { + "if": { + "properties": { + "label": { + "const": "wind-speed" + } + } + }, + "then": { + "properties": { + "value": { + "$ref": "#/$defs/parameters/wind_speed/value" + } + } + } + }, + { + "if": { + "properties": { + "label": { + "const": "turbulence-intensity" + } + } }, - "title": "Shear Coefficient Values", - "description": "Values of wind shear coefficient alpha [-] for which this power curve is tabulated" + "then": { + "properties": { + "value": { + "$ref": "#/$defs/parameters/turbulence_intensity/value" + } + } + } + }, + { + "if": { + "properties": { + "label": { + "const": "turbulence-lengthscale" + } + } + }, + "then": { + "properties": { + "value": { + "$ref": "#/$defs/parameters/turbulence_lengthscale/value" + } + } + } + }, + { + "if": { + "properties": { + "label": { + "const": "monin-obukhov-stability" + } + } + }, + "then": { + "properties": { + "value": { + "$ref": "#/$defs/parameters/monin_obukhov_stability/value" + } + } + } + }, + { + "if": { + "properties": { + "label": { + "const": "shear-coefficient" + } + } + }, + "then": { + "properties": { + "value": { + "$ref": "#/$defs/parameters/shear_coefficient/value" + } + } + } } - }, - "required": ["values"] + ] } - }, + } + { - "if": { - "properties": { - "label": { - "const": "wind-direction" - } - } - }, - "then": { - "properties": { - "values": { - "type": "array", - "additionalItems": true, - "items": { - "type": "number" + "title": "Given for a specific parameter range", + "description": "Power and thrust values valid when value of this parameter is within a range (represents a singleton dimension on the power and thrust arrays)", + "required": ["label", "max", "min"], + "properties": { + "label": { + "$ref": "#/$defs/parameter_label" + }, + "allOf": [ + { + "if": { + "properties": { + "label": { + "const": "air-density" + } + } + }, + "then": { + "properties": { + "$ref": "#/$defs/parameters_value", + "min": { + "title": "Minimum Air Density", + "description": "Inclusive minimum value of air density [kg/m^3] for which this tabulated power curve is valid" + }, + "max": { + "$ref": "#/$defs/parameter_value", + "title": "Maximum Air Density", + "description": "Exclusive maximum value of air density [kg/m^3] for which this tabulated power curve is valid" + } + } + } + }, + { + "if": { + "properties": { + "label": { + "const": "wind-speed" + } + } + }, + "then": { + "properties": { + "min": { + "$ref": "#/$defs/parameter_value", + "title": "Minimum Wind Speed", + "description": "Inclusive minimum value of free-stream wind speed [m/s] at hub height for which this tabulated power curve is valid" + }, + "max": { + "$ref": "#/$defs/parameter_value", + "title": "Maximum Wind Speed", + "description": "Exclusive maximum value of free-stream wind speed [m/s] at hub height for which this tabulated power curve is valid" + } + } + } + }, + { + "if": { + "properties": { + "label": { + "const": "turbulence-intensity" + } + } }, - "title": "Wind Direction Values", - "description": "Values of wind direction [???? degrees clockwise from true north????] for which this power curve is tabulated" + "then": { + "properties": { + "min": { + "type": "array", + "additionalItems": true, + "items": { + "type": "number", + "minimum": 0, + "maximum": 1 + }, + "title": "Minimum Turbulence Intensity", + "description": "Inclusive minimum value of turbulence intensity I [-] (expressed as a factor in the range 0,1 rather than a percentage) for which this tabulated power curve is valid" + }, + "max": { + "type": "array", + "additionalItems": true, + "items": { + "type": "number", + "minimum": 0, + "maximum": 1 + }, + "title": "Maximum Turbulence Intensity", + "description": "Exclusive maximum value of turbulence intensity I [-] (expressed as a factor in the range 0,1 rather than a percentage) for which this tabulated power curve is valid" + } + } + } + }, + { + "if": { + "properties": { + "label": { + "const": "turbulence-lengthscale" + } + } + }, + "then": { + "properties": { + "min": { + "$ref": "#/$defs/parameter_values", + "title": "Minimum Turbulence Lengthscale", + "description": "Minimum value of turbulence integral lengthscale l [m] for which this tabulated power curve is valid" + }, + "max": { + "$ref": "#/$defs/parameter_values", + "title": "Maximum Turbulence Lengthscale", + "description": "Exclusive maximum of turbulence integral lengthscale l [m] for which this tabulated power curve is valid" + } + } + } + }, + { + "if": { + "properties": { + "label": { + "const": "monin-obukhov-stability" + } + } + }, + "then": { + "properties": { + "min": { + "$ref": "#/$defs/parameter_value", + "title": "Minimum Monin-Obukhov Stability", + "description": "Minimum value of the the Monin-Obukhov stability parameter zeta [-] for which this tabulated power curve is valid. Values of zero indicate neutral conditions." + }, + "max": { + "$ref": "#/$defs/parameter_value", + "title": "Maximum Monin-Obukhov Stability", + "description": "Exclusive maximum value of the the Monin-Obukhov stability parameter zeta [-] for which this tabulated power curve is valid. Values of zero indicate neutral conditions." + } + } + } + }, + { + "if": { + "properties": { + "label": { + "const": "shear-coefficient" + } + } + }, + "then": { + "properties": { + "min": { + "$ref": "#/$defs/parameter_value", + "title": "Minimum Shear Coefficient", + "description": "Inclusive minimum value of wind shear coefficient alpha [-] for which this tabulated power curve is valid" + }, + "max": { + "$ref": "#/$defs/parameter_value", + "title": "Maximum Shear Coefficient", + "description": "Exclusive maximum value of wind shear coefficient alpha [-] for which this tabulated power curve is valid" + } + } + } } - }, - "required": ["values"] + ] } } - ] + } } }, "power_is_coefficient": { diff --git a/test/conftest.py b/test/conftest.py index 04f552c..027ab66 100644 --- a/test/conftest.py +++ b/test/conftest.py @@ -140,17 +140,16 @@ def one_dimensional_mode(valid_cuts): "label": "one_dimensional", "name": "One Dimensional", "design_bases": ['basis-1'], - "description": "A typical mode where there are values for only the reference air density. In practicality this is the same as a two-dimensional example, just with a single air density value.", + "description": "A typical mode where there is an informational value for the reference air density. In practicality this is the same as a two-dimensional example, just with a single air density value.", "cuts": valid_cuts, "parameters": [ { "label": "air-density", - "dimension": 0, - "values": [1.225] + "value": 1.225 }, { "label": "wind-speed", - "dimension": 1, + "dimension": 0, "values": [ 3.0, 3.5, 4.0, 4.5, 5.0, 5.5, 6.0, 6.5, 7.0, 7.5, 8.0, 8.5, 9.0,9.5, 10.0, 10.5, 11.0, 11.5, 12.0, 12.5, 13.0, 13.5, 14.0, 14.5,15.0, 15.5, 16.0, 16.5, 17.0, 17.5, 18.0, 18.5, 19.0, 19.5, 20.0,20.5, 21.0, 21.5, 22.0, 22.5, 23.0, 23.5, 24.0, 24.5, 25.0 ] @@ -158,20 +157,16 @@ def one_dimensional_mode(valid_cuts): ], "power_is_coefficient": False, "thrust_is_coefficient": True, - "power": [ - [22000.0, 78000.0, 150000.0, 237000.0, 340000.0, 466000.0, 617000.0, 796000.0, 1006000.0, 1247000.0, 1522000.0, 1871000.0, 2178000.0, 2544000.0, 2905000.0, 3201000.0, 3374000.0, 3435000.0, 3448000.0, 3450000.0, 3450000.0, 3450000.0, 3450000.0, 3450000.0, 3450000.0, 3450000.0, 3450000.0, 3450000.0, 3450000.0, 3450000.0, 3450000.0, 3450000.0, 3450000.0, 3450000.0, 3450000.0, 3450000.0, 3450000.0, 3450000.0, 3450000.0, 3450000.0, 3450000.0, 3450000.0, 3450000.0,3450000.0, 3450000.0] - ], - "thrust": [ - [0.873, 0.849, 0.834, 0.828, 0.827, 0.825, 0.82, 0.816, 0.805, 0.804, 0.794, 0.79, 0.789, 0.772, 0.733, 0.666, 0.58, 0.494, 0.421, 0.362, 0.316, 0.281, 0.249, 0.223, 0.199, 0.18, 0.164, 0.149, 0.137, 0.125, 0.115, 0.107, 0.098, 0.091, 0.085, 0.079, 0.074, 0.07, 0.066, 0.062, 0.058, 0.055, 0.052, 0.049, 0.046] - ], + "power": [22000.0, 78000.0, 150000.0, 237000.0, 340000.0, 466000.0, 617000.0, 796000.0, 1006000.0, 1247000.0, 1522000.0, 1871000.0, 2178000.0, 2544000.0, 2905000.0, 3201000.0, 3374000.0, 3435000.0, 3448000.0, 3450000.0, 3450000.0, 3450000.0, 3450000.0, 3450000.0, 3450000.0, 3450000.0, 3450000.0, 3450000.0, 3450000.0, 3450000.0, 3450000.0, 3450000.0, 3450000.0, 3450000.0, 3450000.0, 3450000.0, 3450000.0, 3450000.0, 3450000.0, 3450000.0, 3450000.0, 3450000.0, 3450000.0,3450000.0, 3450000.0], + "thrust": [0.873, 0.849, 0.834, 0.828, 0.827, 0.825, 0.82, 0.816, 0.805, 0.804, 0.794, 0.79, 0.789, 0.772, 0.733, 0.666, 0.58, 0.494, 0.421, 0.362, 0.316, 0.281, 0.249, 0.223, 0.199, 0.18, 0.164, 0.149, 0.137, 0.125, 0.115, 0.107, 0.098, 0.091, 0.085, 0.079, 0.074, 0.07, 0.066, 0.062, 0.058, 0.055, 0.052, 0.049, 0.046], "overrides": {} } @pytest.fixture() def two_dimensional_mode(valid_cuts): - # fmt: off - return { + # fmt: off + return { "label": "two_dimensional", "name": "Two Dimensional", "description": "A typical mode where both air density and wind speed vary", @@ -216,6 +211,49 @@ def two_dimensional_mode(valid_cuts): # fmt: on +@pytest.fixture() +def two_dimensional_mode_with_varied_parameters(two_dimensional_mode): + # fmt: off + with_varied_parameters = two_dimensional_mode + with_varied_parameters['label'] = "two_dimensional_with_varied_parameters" + with_varied_parameters['parameters'] = [ + # Singleton value + { + "label": "air-density", + "value": 1.225 + }, + # Singleton range + { + "label": "shear-coefficient", + "min": 0.2, + "max": 0.3 + }, + # Dimension ranges + { + "label": "turbulence-intensity", + "dimension": 0, + "values": [ + { "min": 0, "max": 0.03 }, + { "min": 0.03, "max": 0.06 }, + { "min": 0.06, "max": 0.09 }, + { "min": 0.09, "max": 0.12 }, + { "min": 0.12, "max": 0.15 }, + { "min": 0.15, "max": 0.18 }, + { "min": 0.18, "max": 0.21 }, + { "min": 0.21, "max": 0.24 } + ] + }, + # Dimension values + { + "label": "wind-speed", + "dimension": 1, + "values": [3.0, 3.5, 4.0, 4.5, 5.0, 5.5, 6.0, 6.5, 7.0, 7.5, 8.0, 8.5, 9.0, 9.5, 10.0, 10.5, 11.0, 11.5, 12.0, 12.5, 13.0, 13.5, 14.0, 14.5, 15.0, 15.5, 16.0, 16.5, 17.0, 17.5, 18.0, 18.5, 19.0, 19.5, 20.0, 20.5, 21.0, 21.5, 22.0, 22.5, 23.0, 23.5, 24.0, 24.5, 25.0, 25.5, 26.0, 26.5, 27.0, 27.5, 28.0, 28.5, 29.0, 29.5, 30.0] + } + ] + return with_varied_parameters + # fmt: on + + @pytest.fixture(scope="session") def loaded_generic_117_3(): """Provides the generic 117m 3.45MW turbine as a test instance, loaded from disc only once per session diff --git a/test/test_power_curves.py b/test/test_power_curves.py index 6644f39..3f257b8 100644 --- a/test/test_power_curves.py +++ b/test/test_power_curves.py @@ -260,3 +260,18 @@ def test_acoustic_emissions(subschema, one_dimensional_mode): }, schema=subschema, ) + + +def test_with_varied_parameters(subschema, two_dimensional_mode_with_varied_parameters): + """Parameters which do not have a `dimension` property are informational + and do not relate to a dimension of the power curve nd-array. Test that they are acceptable.""" + + validate( + instance={ + "power_curves": { + "default_operating_mode": "two_dimensional_with_varied_parameters", + "operating_modes": [two_dimensional_mode_with_varied_parameters], + } + }, + schema=subschema, + )