Skip to content

Commit

Permalink
Implement Joukoswky Acutator Disk (Exawind#583)
Browse files Browse the repository at this point in the history
  • Loading branch information
psakievich authored Jun 9, 2022
1 parent ae454ff commit 3a6a8e3
Show file tree
Hide file tree
Showing 21 changed files with 1,510 additions and 537 deletions.
14 changes: 10 additions & 4 deletions amr-wind/wind_energy/actuator/actuator_utils.H
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
#ifndef ACUTATOR_UTILS_H
#define ACUTATOR_UTILS_H

#include "amr-wind/core/vs/vector.H"
#include "amr-wind/utilities/trig_ops.H"
#include "amr-wind/core/vs/vector_space.H"
#include "AMReX_AmrCore.H"
#include "amr-wind/utilities/tensor_ops.H"
#include <cmath>

#include <set>
Expand Down Expand Up @@ -115,7 +113,8 @@ AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE vs::Vector delta_pnts_cyl(
const amrex::Real r1 = vs::mag(v1);
const amrex::Real r2 = vs::mag(v2);

const amrex::Real theta = std::acos((v1 & v2) / (r1 * r2 + eps));
const amrex::Real theta =
std::acos(std::min((v1 & v2) / (r1 * r2 + eps), 1.0));

return {std::abs(r1 - r2), theta, norm_dist1 - norm_dist2};
}
Expand All @@ -133,6 +132,13 @@ linear_basis_1d(const amrex::Real distance, const amrex::Real dX)
return amrex::max(0.0, 1.0 - distance / dX) / dX;
}

AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE vs::Vector compute_tangential_vector(
const vs::Vector& center, const vs::Vector& normal, const vs::Vector& point)
{
const auto blade_axis = (point - center).normalize();
return vs::quaternion(normal, 90.0) & blade_axis;
}

} // namespace utils
} // namespace actuator
} // namespace amr_wind
Expand Down
2 changes: 2 additions & 0 deletions amr-wind/wind_energy/actuator/disk/ActSrcDiskOp.H
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ class ActSrcOp<
ActSrcDisk,
std::enable_if_t<std::is_base_of<DiskType, ActTrait>::value>>
{
using TraitType = ActTrait;

template <typename T>
using MyType = ActSrcOp<
T,
Expand Down
37 changes: 37 additions & 0 deletions amr-wind/wind_energy/actuator/disk/ActuatorDisk.H
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
#ifndef ACTUATORDISK_H_
#define ACTUATORDISK_H_

#include "amr-wind/wind_energy/actuator/disk/disk_types.H"
#include "amr-wind/core/vs/vector_space.H"

namespace amr_wind {
namespace actuator {

struct DiskBaseData
{
int num_force_pts;
int num_force_theta_pts{1};
int num_vel_pts{1};
int num_vel_pts_r{1};
int num_vel_pts_t{1};
vs::Vector center;
vs::Vector normal_vec{0, 1, 0};
vs::Vector coplanar_vec{1, 0, 0};
vs::Vector sample_vec{0, 1, 0};
vs::Vector reference_velocity;
vs::Vector mean_disk_velocity;
amrex::Real epsilon;
amrex::Real diameter;
amrex::Real dr;
amrex::Real density;
amrex::Real current_ct;
amrex::Real diameters_to_sample{0.0};
RealList thrust_coeff;
RealList table_velocity;
std::string spreading_type{"LinearBasis"};
};

} // namespace actuator
} // namespace amr_wind

#endif /* ACTUATORDISK_H_ */
3 changes: 3 additions & 0 deletions amr-wind/wind_energy/actuator/disk/ActuatorDisk.cpp
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
#include "amr-wind/wind_energy/actuator/disk/UniformCt.H"
#include "amr-wind/wind_energy/actuator/disk/Joukowsky.H"
#include "amr-wind/wind_energy/actuator/disk/uniform_ct_ops.H"
#include "amr-wind/wind_energy/actuator/disk/Joukowsky_ops.H"
#include "amr-wind/wind_energy/actuator/ActuatorModel.H"
#include "amr-wind/wind_energy/actuator/disk/disk_spreading.H"

namespace amr_wind {
namespace actuator {
template class ActModel<UniformCt, ActSrcDisk>;
template class ActModel<Joukowsky, ActSrcDisk>;

} // namespace actuator
} // namespace amr_wind
2 changes: 2 additions & 0 deletions amr-wind/wind_energy/actuator/disk/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
target_sources(${amr_wind_lib_name} PRIVATE
ActuatorDisk.cpp
disk_ops.cpp
Joukowsky_ops.cpp
uniform_ct_ops.cpp
)
41 changes: 41 additions & 0 deletions amr-wind/wind_energy/actuator/disk/Joukowsky.H
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
#ifndef Joukowsky_H_
#define Joukowsky_H_

#include "amr-wind/wind_energy/actuator/disk/disk_types.H"
#include "amr-wind/wind_energy/actuator/disk/ActuatorDisk.H"
#include "amr-wind/core/vs/vector_space.H"

namespace amr_wind {
namespace actuator {

struct JoukowskyData : public DiskBaseData
{
RealList angular_velocity;
RealList tip_correction;
RealList root_correction;
amrex::Real current_angular_velocity{0.0};
amrex::Real vortex_core_size;
// --- Sorenson 2020 equation 10 constants ----
amrex::Real root_correction_coefficient{1.256};
amrex::Real root_correction_exponent{2.0};
// --------------------------------------------
int num_blades;
vs::Vector disk_force{0.0, 0.0, 0.0};
bool use_tip_correction{true};
bool use_root_correction{true};
};

struct Joukowsky : public DiskType
{
using InfoType = ActInfo;
using GridType = ActGrid;
using MetaType = JoukowskyData;
using DataType = ActDataHolder<Joukowsky>;

static std::string identifier() { return "Joukowsky"; }
};

} // namespace actuator
} // namespace amr_wind

#endif /* Joukowsky_H_ */
Loading

0 comments on commit 3a6a8e3

Please sign in to comment.