/home/runner/work/kynema/kynema/kynema/src/interfaces/components/beam.hpp Source File

Kynema API: /home/runner/work/kynema/kynema/kynema/src/interfaces/components/beam.hpp Source File
Kynema API
A flexible multibody structural dynamics code for wind turbines
Loading...
Searching...
No Matches
beam.hpp
Go to the documentation of this file.
1#pragma once
2
3#include <array>
4#include <vector>
5
7
8namespace kynema {
9class Model;
10struct BeamSection;
11} // namespace kynema
12
14
15struct BeamInput;
16
24class Beam {
25public:
26 using DeviceType =
27 Kokkos::Device<Kokkos::DefaultExecutionSpace, Kokkos::DefaultExecutionSpace::memory_space>;
28
30 static constexpr size_t invalid_id{9999999};
31
33 static constexpr size_t kMaxGeometryPoints{10};
34
37
39 std::vector<NodeData> nodes;
40
43
45 std::vector<double> node_xi;
46
47 Beam() = default;
48
55 Beam(const BeamInput& input, Model& model);
56
62 [[nodiscard]] std::vector<double> GetNodeWeights(double s) const;
63
71 void AddPointLoad(double s, std::array<double, 6> loads);
72
74 void ClearLoads();
75
78 void GetMotion(const HostState<DeviceType>& host_state);
79
82 void SetLoads(HostState<DeviceType>& host_state) const;
83
84private:
85 std::vector<std::array<double, 3>> node_coordinates;
86 std::vector<std::array<double, 3>> node_tangents;
87
93 static void ValidateInput(const BeamInput& input);
98 void SetupNodeLocations(const BeamInput& input);
99
104 void CreateNodeGeometry(const BeamInput& input);
110 void CreateBeamElement(const BeamInput& input, Model& model);
116 void PositionBladeInSpace(const BeamInput& input, Model& model) const;
117
123 void SetupRootNode(const BeamInput& input, Model& model);
124
128 void CalcNodeTangents();
134 static std::vector<BeamSection> BuildBeamSections(const BeamInput& input);
135};
136
137} // namespace kynema::interfaces::components
Struct to define the connectivity structure of elements, nodes, and constraints defining an Kynema pr...
Definition model.hpp:74
Represents a turbine blade with nodes, elements, and constraints.
Definition beam.hpp:24
void ClearLoads()
Sets blade point loads to zero.
Definition beam.cpp:47
std::vector< double > node_xi
Location of nodes in blade element [-1, 1].
Definition beam.hpp:45
static constexpr size_t kMaxGeometryPoints
Maximum number of points allowed in blade geometry definition.
Definition beam.hpp:33
size_t prescribed_root_constraint_id
Constraint ID of prescribed root displacement.
Definition beam.hpp:42
std::vector< NodeData > nodes
Blade node data.
Definition beam.hpp:39
void SetLoads(HostState< DeviceType > &host_state) const
Update the host state with current node forces and moments.
Definition beam.cpp:59
std::vector< double > GetNodeWeights(double s) const
Returns a vector of weights for distributing a point load to the nodes.
Definition beam.cpp:27
void AddPointLoad(double s, std::array< double, 6 > loads)
Adds a point load (Fx, Fy, Fz, Mx, My, Mz) to the blade at location 's' [0, 1] along the material axi...
Definition beam.cpp:34
static constexpr size_t invalid_id
Placeholder node ID value for uninitialized components.
Definition beam.hpp:30
Kokkos::Device< Kokkos::DefaultExecutionSpace, Kokkos::DefaultExecutionSpace::memory_space > DeviceType
Definition beam.hpp:27
void GetMotion(const HostState< DeviceType > &host_state)
Populate node motion based on host state.
Definition beam.cpp:53
size_t beam_element_id
Beam element ID.
Definition beam.hpp:36
Definition aerodynamics.cpp:3
Definition calculate_constraint_output.hpp:8
Host-side mirror of the simulation state for a given time increment.
Definition host_state.hpp:22
Complete input specification for a beam.
Definition beam_input.hpp:84