Skip to content

Commit

Permalink
Merge branch 'develop' of https://github.com/NREL/SAM into sam_181_in…
Browse files Browse the repository at this point in the history
…terconnection_limits
  • Loading branch information
brtietz committed Oct 24, 2024
2 parents 01c9372 + 30a8329 commit 94f7f35
Show file tree
Hide file tree
Showing 6 changed files with 8,939 additions and 11 deletions.
6 changes: 6 additions & 0 deletions deploy/runtime/defaults/MEtidal_LCOE Calculator.json
Original file line number Diff line number Diff line change
Expand Up @@ -1180,6 +1180,12 @@
"tidal_turbine_rotor_diameter": 0.0,
"tidal_turbine_rotor_diameter_input": 50.0,
"tidal_turbine_site_depth": 50.0,
"tidal_turbine_target_cf": 30.0,
"tidal_vel_freq": [
[
0.0
]
],
"tidal_velocity": [
1.06411,
0.907655,
Expand Down
6 changes: 6 additions & 0 deletions deploy/runtime/defaults/MEtidal_None.json
Original file line number Diff line number Diff line change
Expand Up @@ -566,6 +566,12 @@
"tidal_turbine_rotor_diameter": 0.0,
"tidal_turbine_rotor_diameter_input": 25.0,
"tidal_turbine_site_depth": 50.0,
"tidal_turbine_target_cf": 30.0,
"tidal_vel_freq": [
[
0.0
]
],
"tidal_velocity": [
1.06411,
0.907655,
Expand Down
4 changes: 2 additions & 2 deletions deploy/runtime/ui/Marine Tidal Converter.json
Original file line number Diff line number Diff line change
Expand Up @@ -759,11 +759,11 @@
"\tif (${library_or_input_tidal}==1)",
"\t\treturn ${user_tidal_power_curve};\r",
"\telse if (${library_or_input_tidal} == 2) {\r",
"\t\tresource = ${tidal_resource};\r",
"\t\t//esource = ${tidal_resource};\r",
"\t\tspeeds = ${tidal_turbine_powercurve_tidalspeeds};\r",
"\t\tpower = ${tidal_turbine_powercurve_powerout};\r",
"\t\ttidal_power_curve = [[]];\r",
"\t\tfor (i = 0; i < #resource; i++) {\r",
"\t\tfor (i = 0; i < #speeds; i++) {\r",
"\t\t\r",
"\t\t\ttidal_power_curve[i][0] = speeds[i];\r",
"\t\t\ttidal_power_curve[i][1] = power[i];\r",
Expand Down
57 changes: 56 additions & 1 deletion deploy/runtime/ui/Marine Tidal Resource File.json
Original file line number Diff line number Diff line change
Expand Up @@ -562,6 +562,23 @@
"sscVariableName": "",
"sscVariableValue": ""
},
"tidal_vel_freq": {
"Version": 4.0,
"Type": 3.0,
"Label": "Tidal timeseries velocity distribution",
"Units": "%",
"Group": "",
"IndexLabels": "",
"Flags": 8.0,
"DefaultValue": [
[
0.0
]
],
"UIObject": "Default",
"sscVariableName": "",
"sscVariableValue": ""
},
"tidal_velocity": {
"Version": 4.0,
"Type": 2.0,
Expand All @@ -573,7 +590,7 @@
"DefaultValue": [
0.0
],
"UIObject": "Default",
"UIObject": "DataArray",
"sscVariableName": "",
"sscVariableValue": ""
},
Expand Down Expand Up @@ -636,6 +653,44 @@
"\tlen_array = #array;\r",
"\treturn 60 / (len_array/8760);\r",
"};\r",
"\r",
"equations{ 'tidal_vel_freq' } = define() {\r",
"\tobj = ssc_create();\r",
"\tssc_var(obj, 'tidal_resource_model_choice', 1);\r",
"\tssc_var(obj, 'tidal_resource_filename', ${tidal_resource_filename});\r",
"\terr = ssc_exec(obj, 'tidal_file_reader');\r",
"\tif (err != 0) {\r",
"\t\tmsgbox('error');\r",
"\t\treturn [[0]];\r",
"\t}\r",
"\tarray = [];\r",
"\tarray = ssc_var(obj, 'tidal_velocity');\r",
"\t//array = ${tidal_velocity};\r",
"\tlen_array = #array;\r",
"\tmin_vel = floor(min(array));\r",
"\tmax_vel = ceil(max(array));\r",
"\tbins = (max_vel - min_vel) * 10; //int to int, * 10 for 0.1 bin size\r",
"\tfreq_bin = [[]];\r",
"\tfor (i = 1; i <= bins; i++) { //Create velocity bins (m/s)\r",
"\t\tfreq_bin[i-1][0] = min_vel + 0.1 * i;\r",
"\t\tfreq_bin[i-1][1] = 0;\r",
"\t}\r",
"\tfor (j = 0; j < len_array; j++) { //iterate through time series to sort velocities into bins\r",
"\t\tvel = array[j];\r",
"\t\tif (vel < freq_bin[0][0]) {\r",
"\t\t\tfreq_bin[0][1] += 1 / len_array;\r",
"\t\t}\r",
"\t\telse {\r",
"\t\t\tk = 0;\r",
"\t\t\twhile ((array[j] - freq_bin[k][0]) > 0.1 && k < bins) {\r",
"\t\t\t\tk = k + 1;\r",
"\t\t\t}\r",
"\t\t\tfreq_bin[k][1] += 1.0 / len_array;\r",
"\t\t}\r",
"\t}\r",
"\treturn freq_bin;\r",
"\r",
"};\r",
""
],
"Callbacks": [
Expand Down
114 changes: 106 additions & 8 deletions deploy/runtime/ui/Marine Tidal Turbine Design.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
},
"Y": {
"Type": 3.0,
"Integer": 264.0
"Integer": 294.0
},
"Width": {
"Type": 3.0,
Expand Down Expand Up @@ -136,7 +136,7 @@
},
"Y": {
"Type": 3.0,
"Integer": 234.0
"Integer": 264.0
},
"Width": {
"Type": 3.0,
Expand Down Expand Up @@ -385,7 +385,7 @@
},
"Y": {
"Type": 3.0,
"Integer": 207.0
"Integer": 237.0
},
"Width": {
"Type": 3.0,
Expand Down Expand Up @@ -438,7 +438,7 @@
},
"Y": {
"Type": 3.0,
"Integer": 144.0
"Integer": 174.0
},
"Width": {
"Type": 3.0,
Expand Down Expand Up @@ -550,7 +550,7 @@
},
"Y": {
"Type": 3.0,
"Integer": 177.0
"Integer": 207.0
},
"Width": {
"Type": 3.0,
Expand Down Expand Up @@ -603,7 +603,7 @@
},
"Y": {
"Type": 3.0,
"Integer": 114.0
"Integer": 144.0
},
"Width": {
"Type": 3.0,
Expand Down Expand Up @@ -672,6 +672,89 @@
"Integer": 4.0
}
}
},
"Numeric": {
"Visible": 1.0,
"ObjectProperties": {
"Name": {
"Type": 5.0,
"String": "tidal_turbine_target_cf"
},
"X": {
"Type": 3.0,
"Integer": 198.0
},
"Y": {
"Type": 3.0,
"Integer": 114.0
},
"Width": {
"Type": 3.0,
"Integer": 118.0
},
"Height": {
"Type": 3.0,
"Integer": 24.0
},
"Tool Tip": {
"Type": 5.0,
"String": ""
},
"Value": {
"Type": 1.0,
"Double": 0.0
},
"Mode": {
"Type": 3.0,
"Integer": 1.0
},
"Format": {
"Type": 3.0,
"Integer": 0.0
},
"Decimals": {
"Type": 3.0,
"Integer": 3.0
},
"Prefix": {
"Type": 5.0,
"String": ""
},
"Suffix": {
"Type": 5.0,
"String": ""
},
"ThousandsSep": {
"Type": 2.0,
"Boolean": 1.0
},
"Editable": {
"Type": 2.0,
"Boolean": 1.0
},
"ForeColour": {
"Type": 4.0,
"Color": {
"Red": 0.0,
"Green": 0.0,
"Blue": 0.0,
"Alpha": 255.0
}
},
"BackColour": {
"Type": 4.0,
"Color": {
"Red": 255.0,
"Green": 255.0,
"Blue": 255.0,
"Alpha": 255.0
}
},
"TabOrder": {
"Type": 3.0,
"Integer": -1.0
}
}
}
},
"VarDatabase": {
Expand Down Expand Up @@ -910,6 +993,19 @@
"sscVariableName": "",
"sscVariableValue": ""
},
"tidal_turbine_target_cf": {
"Version": 4.0,
"Type": 1.0,
"Label": "Target capacity factor",
"Units": "%",
"Group": "ME Tidal Converter",
"IndexLabels": "",
"Flags": 2.0,
"DefaultValue": 0.0,
"UIObject": "Default",
"sscVariableName": "",
"sscVariableValue": ""
},
"tidal_velocity_power_law_fit": {
"Version": 4.0,
"Type": 1.0,
Expand Down Expand Up @@ -946,7 +1042,9 @@
"\tdata.tidal_resource = ${tidal_resource};\r",
"\t//data.generator_rated_capacity = ${tidal_turbine_kw_rating_input};\r",
"\tdata.pto_efficiency = ${tidal_turbine_pto_eff};\r",
"\t\r",
"\tdata.target_cf = ${tidal_turbine_target_cf};\r",
"\tdata.tidal_resource_model_choice = ${ui_tidal_resource_model_choice};\r",
"\tdata.tidal_vel_freq = ${tidal_vel_freq};\r",
"\t\r",
"\tsuccess = ssc_eqn(\"tidal_turbine_calculate_powercurve\", data);\r",
"\t/*\r",
Expand Down Expand Up @@ -1032,6 +1130,6 @@
"on_change{'tidal_turbine_cutin'} = define() { plot_turbine_curve();};\r",
"on_change{'tidal_turbine_cut_out'} = define() { plot_turbine_curve();};\r",
"on_change{'tidal_turbine_number_rotors'} = define() { plot_turbine_curve();};\r",
""
"on_change{'tidal_turbine_target_cf'} = define() {plot_turbine_curve();};"
]
}
Loading

0 comments on commit 94f7f35

Please sign in to comment.