Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changed velocity sampling to be consistent with standard ALM definition #882

Merged
merged 3 commits into from
Sep 26, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions amr-wind/wind_energy/actuator/wing/ActuatorWing.H
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ struct WingBaseData
//! Ending coordinate of the wing
vs::Vector end;

//! The normal vector perpendicular to the span
vs::Vector blade_x{1.0, 0, 0};

//! Gaussian smearing factor input by user
vs::Vector eps_inp;

Expand Down
34 changes: 24 additions & 10 deletions amr-wind/wind_energy/actuator/wing/wing_ops.H
Original file line number Diff line number Diff line change
Expand Up @@ -118,14 +118,25 @@ struct ComputeForceOp<
amrex::Real total_lift = 0.0;
amrex::Real total_drag = 0.0;
for (int ip = 0; ip < npts; ++ip) {
const auto& tmat = grid.orientation[ip];
// Effective velocity at the wing control point in local frame
auto wvel = tmat & grid.vel[ip];
// Set spanwise component to zero to get a pure 2D velocity
wvel.y() = 0.0;

const auto vmag = vs::mag(wvel);
const auto aoa = std::atan2(wvel.z(), wvel.x());
// Build the local reference frame
vs::Vector wspan = wdata.end - wdata.start;
wspan = wspan.unit();

// Use the global coord to orient the blade
// This works only for inflow in the x direction
tonyinme marked this conversation as resolved.
Show resolved Hide resolved
auto blade_x = wdata.blade_x;
auto blade_y = wspan;
auto blade_z = (blade_x ^ blade_y).unit();

vs::Vector windvector;
windvector[0] = grid.vel[ip] & blade_x;
windvector[1] = 0;
windvector[2] = grid.vel[ip] & blade_z;

const auto vmag = vs::mag(windvector);
const auto aoa = std::atan2(windvector[2], windvector[0]) +
amr_wind::utils::radians(wdata.pitch);

// Make up some Cl, Cd values
amrex::Real cl, cd;
Expand All @@ -135,16 +146,19 @@ struct ComputeForceOp<
const auto qval = 0.5 * vmag * vmag * chord[ip] * dx[ip];
const auto lift = qval * cl;
const auto drag = qval * cd;

// Determine unit vector parallel and perpendicular to velocity
// vector
const auto drag_dir = wvel.unit() & tmat;
const auto lift_dir = drag_dir ^ tmat.y();
// Directions
const auto drag_dir =
(blade_x * windvector.x() + blade_z * windvector.z()).unit();
const auto lift_dir = (drag_dir ^ blade_y).unit();

// Compute force on fluid from this section of wing
grid.force[ip] = -(lift_dir * lift + drag * drag_dir);

// Assign values for output
wdata.vel_rel[ip] = wvel;
wdata.vel_rel[ip] = windvector;
wdata.aoa[ip] = amr_wind::utils::degrees(aoa);
wdata.cl[ip] = cl;
wdata.cd[ip] = cd;
Expand Down
Loading