diff --git a/example_case_folders/02_amr_wind_dummy_only/amr_input.inp b/example_case_folders/02_amr_wind_dummy_only/amr_input.inp index 27fe02f..608043e 100755 --- a/example_case_folders/02_amr_wind_dummy_only/amr_input.inp +++ b/example_case_folders/02_amr_wind_dummy_only/amr_input.inp @@ -1,7 +1,7 @@ #¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨# # SIMULATION STOP # #.......................................# -time.stop_time = 10800.0 # Max (simulated) time to evolve +time.stop_time = 100.0 # Max (simulated) time to evolve time.max_step = -1 # Max number of time steps #¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨# diff --git a/example_case_folders/05_amr_wind_dummy_and_electrolzyer/amr_input.inp b/example_case_folders/05_amr_wind_dummy_and_electrolzyer/amr_input.inp index 3815a2b..735a1e6 100644 --- a/example_case_folders/05_amr_wind_dummy_and_electrolzyer/amr_input.inp +++ b/example_case_folders/05_amr_wind_dummy_and_electrolzyer/amr_input.inp @@ -1,7 +1,7 @@ #¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨# # SIMULATION STOP # #.......................................# -time.stop_time = 10800.0 # Max (simulated) time to evolve +time.stop_time = 100.0 # Max (simulated) time to evolve time.max_step = -1 # Max number of time steps #¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨# diff --git a/example_case_folders/06_amr_wind_standin_and_battery/amr_input.inp b/example_case_folders/06_amr_wind_standin_and_battery/amr_input.inp index 27fe02f..f37ecc1 100644 --- a/example_case_folders/06_amr_wind_standin_and_battery/amr_input.inp +++ b/example_case_folders/06_amr_wind_standin_and_battery/amr_input.inp @@ -1,7 +1,7 @@ #¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨# # SIMULATION STOP # #.......................................# -time.stop_time = 10800.0 # Max (simulated) time to evolve +time.stop_time = 900.0 # Max (simulated) time to evolve time.max_step = -1 # Max number of time steps #¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨# diff --git a/hercules/dummy_amr_wind.py b/hercules/dummy_amr_wind.py index 285dffe..90e0288 100644 --- a/hercules/dummy_amr_wind.py +++ b/hercules/dummy_amr_wind.py @@ -92,6 +92,11 @@ def read_amr_wind_input(amr_wind_input): if "helics.broker_port" in line: broker_port = int(line.split()[2]) + # Get the stop time + for line in Lines: + if "time.stop_time" in line: + stop_time = float(line.split()[2]) + return_dict = { "dt": dt, "num_turbines": num_turbines, @@ -99,6 +104,7 @@ def read_amr_wind_input(amr_wind_input): "rotor_diameter": D, "turbine_locations": turbine_locations, "helics_port": broker_port, + "stop_time":stop_time, } return return_dict @@ -171,7 +177,8 @@ def run(self): self.message_from_server = None - while self.absolute_helics_time < (self.endtime - self.starttime + 1): + #while self.absolute_helics_time < (self.endtime - self.starttime + 1): + while sim_time_s <= (self.endtime - self.starttime): # SIMULATE A CALCULATION STEP IN AMR WIND========================= logger.info("Calculating simulation time: %.1f" % sim_time_s) @@ -308,7 +315,7 @@ def process_subscription_messages(self, msg): def launch_dummy_amr_wind(amr_input_file, amr_standin_data_file=None): temp = read_amr_wind_input(amr_input_file) - print(temp["helics_port"]) + config = { "name": "dummy_amr_wind", "gridpack": {}, @@ -322,7 +329,7 @@ def launch_dummy_amr_wind(amr_input_file, amr_standin_data_file=None): "publication_interval": 1, "endpoint_interval": 1, "starttime": 0, - "stoptime": 900, + "stoptime": temp["stop_time"], "Agent": "dummy_amr_wind", }