/home/runner/work/amr-wind/amr-wind/amr-wind/wind_energy/actuator/turbine/fast/FastIface.H Source File

AMR-Wind API: /home/runner/work/amr-wind/amr-wind/amr-wind/wind_energy/actuator/turbine/fast/FastIface.H Source File
AMR-Wind API v0.1.0
CFD solver for wind plant simulations
Loading...
Searching...
No Matches
FastIface.H
Go to the documentation of this file.
1#ifndef FASTIFACE_H
2#define FASTIFACE_H
3
7#include <map>
8#include <vector>
9
10namespace ncutils {
11class NCFile;
12}
13
14namespace amr_wind {
15class CFDSim;
16}
17
18namespace exw_fast {
19
20class FastIface : public ::amr_wind::ExtSolver::Register<FastIface>
21{
22public:
23 static std::string identifier() { return "OpenFAST"; }
24
25 explicit FastIface(const ::amr_wind::CFDSim& sim);
26
27 ~FastIface() override;
28
29 void parse_inputs(
30 const amr_wind::CFDSim& /*sim*/, const std::string& /*inp_name*/);
31
33
34 void init_turbine(const int local_id);
35
36 void init_solution(const int local_id);
37
38 void get_hub_stats(const int local_id);
39
40 void advance_turbine(const int local_id);
41
42 void save_restart(const int local_id);
43
45 {
46 return static_cast<int>(m_turbine_data.size());
47 }
48
49protected:
51
52 void fast_init_turbine(FastTurbine& /*fi*/);
53
55
56 void fast_replay_turbine(FastTurbine& /*fi*/);
57
58 void prepare_netcdf_file(FastTurbine& /*unused*/);
59
60 void write_velocity_data(const FastTurbine& /*unused*/);
61
62 static void read_velocity_data(
63 FastTurbine& /*unused*/,
64 const ncutils::NCFile& /*unused*/,
65 const size_t tid);
66
68 std::map<int, int> m_turbine_map;
69
70 std::vector<FastTurbine*> m_turbine_data;
71
72 std::string m_output_dir{"fast_velocity_data"};
73
74 double m_dt_cfd{0.0};
75
76 // Not using amrex::Real. Instead use explicit types from FAST API
77 double m_start_time{0.0};
78 double m_stop_time{-1.0};
80
83
87
88 bool m_is_initialized{false};
89};
90
91} // namespace exw_fast
92
93#endif /* FASTIFACE_H */
Definition CFDSim.H:47
Definition FastIface.H:21
void fast_init_turbine(FastTurbine &)
Definition FastIface.cpp:211
void save_restart(const int local_id)
bool m_is_initialized
Definition FastIface.H:88
int num_local_turbines() const
Definition FastIface.H:44
int m_num_sc_inputs_glob
Definition FastIface.H:84
int m_num_sc_outputs
Definition FastIface.H:82
static void read_velocity_data(FastTurbine &, const ncutils::NCFile &, const size_t tid)
Definition FastIface.cpp:458
double m_stop_time
Definition FastIface.H:78
std::map< int, int > m_turbine_map
Global to local index lookup map.
Definition FastIface.H:68
void init_turbine(const int local_id)
Definition FastIface.cpp:182
void fast_restart_turbine(FastTurbine &)
Definition FastIface.cpp:311
float m_init_sc_inputs_glob
Definition FastIface.H:85
void get_hub_stats(const int local_id)
Definition FastIface.cpp:137
void fast_replay_turbine(FastTurbine &)
Definition FastIface.cpp:264
void init_solution(const int local_id)
Definition FastIface.cpp:126
double m_start_time
Definition FastIface.H:77
float m_init_sc_inputs_turbine
Definition FastIface.H:86
void allocate_fast_turbines()
Definition FastIface.cpp:118
void write_velocity_data(const FastTurbine &)
Definition FastIface.cpp:457
int register_turbine(FastTurbine &data)
Definition FastIface.cpp:105
SimMode m_sim_mode
Definition FastIface.H:79
void prepare_netcdf_file(FastTurbine &)
Definition FastIface.cpp:456
double m_dt_cfd
Definition FastIface.H:74
std::vector< FastTurbine * > m_turbine_data
Definition FastIface.H:70
FastIface(const ::amr_wind::CFDSim &sim)
Definition FastIface.cpp:44
static std::string identifier()
Definition FastIface.H:23
void advance_turbine(const int local_id)
Definition FastIface.cpp:148
void parse_inputs(const amr_wind::CFDSim &, const std::string &)
Definition FastIface.cpp:58
int m_num_sc_inputs
Definition FastIface.H:81
~FastIface() override
Definition FastIface.cpp:46
std::string m_output_dir
Definition FastIface.H:72
Definition nc_interface.H:288
Definition BCInterface.cpp:7
Definition fast_types.H:8
SimMode
Definition fast_types.H:10
@ init
Clean start.
Definition nc_interface.cpp:9
Definition fast_types.H:19