/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#include "AMReX_REAL.H"
13
14using namespace amrex::literals;
15#endif
16
17namespace amr_wind {
18
20{
21public:
22 explicit HelicsStorage(CFDSim& sim);
24
25 void pre_advance_work();
26 bool is_activated() const { return m_helics_activated; }
27
28#ifdef AMR_WIND_USE_HELICS
29 HelicsTime m_currenttime = 0.0_rt;
30 std::string m_fedinitstring = "--federates=1";
31#endif
32
34
35 amrex::Real m_inflow_wind_speed_to_amrwind{8.0_rt};
37
38 amrex::Vector<amrex::Real> m_turbine_power_to_controller;
39 amrex::Vector<amrex::Real> m_turbine_wind_direction_to_controller;
40 amrex::Vector<amrex::Real> m_turbine_yaw_to_amrwind;
41
42private:
44
47
48#ifdef AMR_WIND_USE_HELICS
49 std::unique_ptr<helicscpp::FederateInfo> m_fi;
50 std::unique_ptr<helicscpp::CombinationFederate> m_vfed;
51#endif
52
53#ifdef AMR_WIND_USE_HELICS
54 bool m_helics_activated{true};
55#else
56 bool m_helics_activated{false};
57#endif
58};
59
60} // namespace amr_wind
61
62#endif /* HELICS_H */
Definition CFDSim.H:54
amrex::Vector< amrex::Real > m_turbine_wind_direction_to_controller
Definition helics.H:39
amrex::Vector< amrex::Real > m_turbine_yaw_to_amrwind
Definition helics.H:40
amrex::Vector< amrex::Real > m_turbine_power_to_controller
Definition helics.H:38
void recv_messages_from_controller()
Definition helics.cpp:128
void send_messages_to_controller()
Definition helics.cpp:119
amrex::Real m_inflow_wind_speed_to_amrwind
Definition helics.H:35
bool m_helics_activated
Definition helics.H:56
CFDSim & m_sim
Definition helics.H:43
bool is_activated() const
Definition helics.H:26
int m_num_turbines
Definition helics.H:33
amrex::Real m_inflow_wind_direction_to_amrwind
Definition helics.H:36
void pre_advance_work()
Definition helics.cpp:109
HelicsStorage(CFDSim &sim)
Definition helics.cpp:47
This test case is intended as an evaluation of the momentum advection scheme.
Definition BCInterface.cpp:10