/home/runner/work/amr-wind/amr-wind/amr-wind/helics.H Source File

AMR-Wind API: /home/runner/work/amr-wind/amr-wind/amr-wind/helics.H Source File
AMR-Wind API v0.1.0
CFD solver for wind plant simulations
Loading...
Searching...
No Matches
helics.H
Go to the documentation of this file.
1#ifndef HELICS_H
2#define HELICS_H
3
4#include "AMReX_AmrCore.H"
6#include "amr-wind/CFDSim.H"
7
8#ifdef AMR_WIND_USE_HELICS
9#include "helics/cpp98/CombinationFederate.hpp"
10#include "helics/cpp98/helics.hpp"
11#include "helics/cpp98/Federate.hpp"
12#endif
13
14namespace amr_wind {
15
17{
18public:
19 explicit HelicsStorage(CFDSim& sim);
21
22 void pre_advance_work();
23 bool is_activated() const { return m_helics_activated; }
24
25#ifdef AMR_WIND_USE_HELICS
26 HelicsTime m_currenttime = 0.0;
27 std::string m_fedinitstring = "--federates=1";
28#endif
29
31
34
35 amrex::Vector<amrex::Real> m_turbine_power_to_controller;
36 amrex::Vector<amrex::Real> m_turbine_wind_direction_to_controller;
37 amrex::Vector<amrex::Real> m_turbine_yaw_to_amrwind;
38
39private:
41
44
45#ifdef AMR_WIND_USE_HELICS
46 std::unique_ptr<helicscpp::FederateInfo> m_fi;
47 std::unique_ptr<helicscpp::CombinationFederate> m_vfed;
48#endif
49
50#ifdef AMR_WIND_USE_HELICS
51 bool m_helics_activated{true};
52#else
53 bool m_helics_activated{false};
54#endif
55};
56
57} // namespace amr_wind
58
59#endif /* HELICS_H */
Definition CFDSim.H:47
Definition helics.H:17
double m_inflow_wind_speed_to_amrwind
Definition helics.H:32
amrex::Vector< amrex::Real > m_turbine_wind_direction_to_controller
Definition helics.H:36
amrex::Vector< amrex::Real > m_turbine_yaw_to_amrwind
Definition helics.H:37
amrex::Vector< amrex::Real > m_turbine_power_to_controller
Definition helics.H:35
void recv_messages_from_controller()
Definition helics.cpp:121
void send_messages_to_controller()
Definition helics.cpp:112
bool m_helics_activated
Definition helics.H:53
CFDSim & m_sim
Definition helics.H:40
bool is_activated() const
Definition helics.H:23
int m_num_turbines
Definition helics.H:30
void pre_advance_work()
Definition helics.cpp:102
double m_inflow_wind_direction_to_amrwind
Definition helics.H:33
HelicsStorage(CFDSim &sim)
Definition helics.cpp:40
Definition BCInterface.cpp:7