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

2D Pitching Fixed Wing #983

Merged
merged 52 commits into from
Jul 9, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
52 commits
Select commit Hold shift + click to select a range
fc1c166
Added functionality to read and apply a pitch actuation time series f…
ET14 Feb 20, 2024
d1b4e26
Pitch Actuation: fix small bugs for declaration
ET14 Feb 20, 2024
8f24edf
Pitch Actuation: fix small bugs for declaration
ET14 Feb 20, 2024
8510099
Pitch Actuation: fix small bugs for declaration
ET14 Feb 20, 2024
20f49c4
Pitch Actuation: fix small bugs for declaration
Feb 21, 2024
7eaca46
formatting
mbkuhn Feb 26, 2024
76ca2db
correcting usage of amrex::Print()
mbkuhn Feb 26, 2024
b27368b
Add file identifier for pitch angle input file name and remove else s…
ET14 Feb 27, 2024
57b57d7
Remove unnecessary declaration of aoa
ET14 Feb 27, 2024
d074c45
formatting
mbkuhn Feb 27, 2024
1b14397
Merge branch 'main' into 2DPitchingFixedWing
mbkuhn Feb 27, 2024
04d05ca
missing }
mbkuhn Feb 27, 2024
4936631
Merge branch '2DPitchingFixedWing' of https://github.com/ET14/amr-win…
mbkuhn Feb 27, 2024
2f9afa9
1) Added 2D Gaussian for 2D problems 2) Modified pitch angle interpol…
ET14 Mar 12, 2024
a631931
Added 1) In case of 2D Gaussian: Rescaling of actuator force with the…
May 8, 2024
336ff75
Merge branch 'main' into 2DPitchingFixedWing
mbkuhn Jun 4, 2024
1f29057
formatting
mbkuhn Jun 4, 2024
3d757ae
ability to zero specific distance and force components
mbkuhn Jun 4, 2024
38c3f0a
fix bug changing the order of epsilon
mbkuhn Jun 4, 2024
0cd2f1a
better user interface for 2D actuator, apply factors for 2D
mbkuhn Jun 4, 2024
d472efd
minor
mbkuhn Jun 4, 2024
be4a82e
more minor stuff
mbkuhn Jun 4, 2024
3df9596
fixing comment
mbkuhn Jun 4, 2024
3e01f78
misspelling
mbkuhn Jun 4, 2024
9783f4c
fix bug with epsilon order
mbkuhn Jun 4, 2024
260d67b
making 2D capability explicitly in spanwise direction and updating bo…
mbkuhn Jun 4, 2024
ab62bda
remove variables left behind
mbkuhn Jun 4, 2024
f8d1980
more efficient parsing
mbkuhn Jun 4, 2024
352ba98
little thing
mbkuhn Jun 4, 2024
1016008
warning for non-periodic spanwise direction
mbkuhn Jun 5, 2024
8d7019a
don't require pitch when timetable is specified
mbkuhn Jun 5, 2024
d44d04a
set up reg test (mostly)
mbkuhn Jun 5, 2024
6b99a86
new query capability
mbkuhn Jun 5, 2024
e918e18
add sine pitch time series input file to the test case and adjust win…
Jun 20, 2024
672cea9
file names
mbkuhn Jun 27, 2024
c8158df
code review changes
mbkuhn Jun 27, 2024
1845fb6
changed too much
mbkuhn Jun 27, 2024
12701a3
move things outside loop if not function of ip, edit comments, use li…
mbkuhn Jun 28, 2024
3497ffe
trim reg test
mbkuhn Jun 28, 2024
3b198fb
update transformation matrix with time
mbkuhn Jun 28, 2024
3ef87d8
output pitch as function of time to netcdf postprocessing
mbkuhn Jun 28, 2024
0d2b101
add detail to print statement to reflect meaning of "current" pitch
mbkuhn Jun 28, 2024
312760a
removing wing_ops read_inputs
mbkuhn Jul 3, 2024
01a468d
removing excess make_component_view
mbkuhn Jul 3, 2024
a7e7eae
unit tests!
mbkuhn Jul 3, 2024
5cb9b9b
put header into pitch timetable file
mbkuhn Jul 3, 2024
9865439
remove commented inclusions
mbkuhn Jul 3, 2024
fee3ae3
add another option to match results in paper
mbkuhn Jul 3, 2024
45d3388
documentation
mbkuhn Jul 5, 2024
ce96edb
Merge branch 'main' into 2DPitchingFixedWing
mbkuhn Jul 5, 2024
7fffb2c
minor improvements
mbkuhn Jul 8, 2024
c605c22
all const
mbkuhn Jul 8, 2024
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
12 changes: 11 additions & 1 deletion amr-wind/wind_energy/actuator/ActSrcLineOp.H
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,17 @@ void ActSrcOp<ActTrait, ActSrcLine>::operator()(
const auto pos_ip = wt * pos[ip] + (1.0 - wt) * opos[ip];
const auto dist = cc - pos_ip;
const auto dist_local = tmat[ip] & dist;
const auto gauss_fac = utils::gaussian3d(dist_local, eps[ip]);
mbkuhn marked this conversation as resolved.
Show resolved Hide resolved
// If the spanwise eps is zero use the two-dimensional Gaussian
// The order of epsilon is (chord, thickness, span)
amrex::Real gauss_fac;
if (eps[ip].z() < 1e-12) {
mbkuhn marked this conversation as resolved.
Show resolved Hide resolved
// vector is only defined for n=3 -> append zeros
vs::Vector eps_2d{eps[ip].x(), eps[ip].y(), 0.0};
vs::Vector dist_local_2d{dist_local.x(), dist_local.z(), 0.0};
gauss_fac = utils::gaussian2d(dist_local_2d, eps_2d);
} else {
gauss_fac = utils::gaussian3d(dist_local, eps[ip]);
}
const auto& pforce = force[ip];

src_force[0] += gauss_fac * pforce.x();
Expand Down
27 changes: 27 additions & 0 deletions amr-wind/wind_energy/actuator/actuator_utils.H
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,33 @@ gaussian3d(const vs::Vector& dist, const vs::Vector& eps)

return 0.0;
}

/** Return the Gaussian smearing factor in 2D
*
* \param dist Distance vector of the cell center from the actuator node in
* local frame of reference.
*
* \param eps Two-dimensional Gaussian scaling factor
*
* \return Gaussian smearing factor in 2D
*/
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real
gaussian2d(const vs::Vector& dist, const vs::Vector& eps)
{
const vs::Vector rr{
dist.x() / eps.x(), dist.y() / eps.y(), 0.0};
const amrex::Real rr_sqr = vs::mag_sqr(rr);

if (rr_sqr < 16.0) {
constexpr amrex::Real fac = 0.31830988618379067;
mbkuhn marked this conversation as resolved.
Show resolved Hide resolved
const amrex::Real eps_fac = eps.x() * eps.y();
return (fac / eps_fac) *
mbkuhn marked this conversation as resolved.
Show resolved Hide resolved
std::exp(-rr.x() * rr.x() - rr.y() * rr.y());
}

return 0.0;
}

/** Return the Gaussian smearing factor in 1D
*
* \param dist Distance vector of the cell center from the actuator node in
Expand Down
5 changes: 3 additions & 2 deletions amr-wind/wind_energy/actuator/wing/wing_ops.H
Original file line number Diff line number Diff line change
Expand Up @@ -167,10 +167,11 @@ struct ComputeForceOp<
const auto vmag = vs::mag(windvector);

// Calculate the aoa based on the pitch actuation table if supplied
// (interpolate pitch angle at step n) or the initial pitch angle
// (interpolate pitch angle at step n+1/2) or the initial pitch angle
if (!wdata.pitch_timetable_file.empty()) {
const auto time_interp = (time.current_time() + time.new_time()) / 2.0;
wdata.pitch = amr_wind::interp::linear(
mbkuhn marked this conversation as resolved.
Show resolved Hide resolved
wdata.time_table, wdata.pitch_table, time.current_time());
wdata.time_table, wdata.pitch_table, time_interp);
amrex::Print() << "Wing Ops: Current wing pitch is "
<< wdata.pitch << " degrees.\n";
}
Expand Down