/home/runner/work/kynema-sgf/kynema-sgf/src/helics.H Source File

Kynema-SGF API: /home/runner/work/kynema-sgf/kynema-sgf/src/helics.H Source File
Kynema-SGF 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"
5#include "src/core/SimTime.H"
6#include "src/CFDSim.H"
7
8#ifdef KYNEMA_SGF_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 kynema_sgf {
18
20{
21public:
22 explicit HelicsStorage(CFDSim& sim);
24
25 void pre_advance_work();
26 [[nodiscard]] bool is_activated() const { return m_helics_activated; }
27
28#ifdef KYNEMA_SGF_USE_HELICS
29 HelicsTime m_currenttime = 0.0_rt;
30 std::string m_fedinitstring = "--federates=1";
31#endif
32
34
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_kynema_sgf;
41
42private:
44
47
48#ifdef KYNEMA_SGF_USE_HELICS
49 std::unique_ptr<helicscpp::FederateInfo> m_fi;
50 std::unique_ptr<helicscpp::CombinationFederate> m_vfed;
51#endif
52
53#ifdef KYNEMA_SGF_USE_HELICS
54 bool m_helics_activated{true};
55#else
56 bool m_helics_activated{false};
57#endif
58};
59
60} // namespace kynema_sgf
61
62#endif /* HELICS_H */
Definition CFDSim.H:55
CFDSim & m_sim
Definition helics.H:43
int m_num_turbines
Definition helics.H:33
void send_messages_to_controller()
Definition helics.cpp:119
void pre_advance_work()
Definition helics.cpp:109
amrex::Real m_inflow_wind_direction_to_kynema_sgf
Definition helics.H:36
bool is_activated() const
Definition helics.H:26
void recv_messages_from_controller()
Definition helics.cpp:128
amrex::Vector< amrex::Real > m_turbine_wind_direction_to_controller
Definition helics.H:39
amrex::Vector< amrex::Real > m_turbine_power_to_controller
Definition helics.H:38
amrex::Vector< amrex::Real > m_turbine_yaw_to_kynema_sgf
Definition helics.H:40
bool m_helics_activated
Definition helics.H:56
amrex::Real m_inflow_wind_speed_to_kynema_sgf
Definition helics.H:35
HelicsStorage(CFDSim &sim)
Definition helics.cpp:47
This test case is intended as an evaluation of the momentum advection scheme.
Definition BCInterface.cpp:10