245 Real at, an, V1, Vt, Vr, psi, L, D, Cn, Ct;
246 Real ftip, fhub, F, Cl, Cd, at_new, an_new;
251 bool is_converged =
false;
253 for(
int i=0;i<100;i++) {
255 Vt = Omega*(
one+at)*rad;
256 Vr = std::pow(V1*V1+Vt*Vt,
myhalf);
258 psi = std::atan2(V1,Vt);
260 Real aoa = psi*
Real(180.0)/
PI - twist + pitch;
262 Cl =
interpolate_1d(bld_airfoil_aoa, bld_airfoil_Cl, aoa, n_pts_airfoil);
263 Cd =
interpolate_1d(bld_airfoil_aoa, bld_airfoil_Cd, aoa, n_pts_airfoil);
270 Cn = Cl*std::cos(psi) + Cd*std::sin(psi);
271 Ct = Cl*std::sin(psi) - Cd*std::cos(psi);
273 ftip = B*(rtip-rad)/(
two*rad*std::sin(psi)+
Real(1e-10));
274 fhub = B*(rad-rhub)/(
two*rad*std::sin(psi)+
Real(1e-10));
279 F =
two/
PI*(std::acos(std::exp(-ftip)) + std::acos(std::exp(-fhub)) );
281 at_new =
one/ (
Real(4.0)*F*std::sin(psi)*std::cos(psi)/(s*Ct+
Real(1e-10)) -
one );
282 an_new =
one/ (
one +
Real(4.0)*F*amrex::Math::powi<2>(std::sin(psi))/(s*Cn +
Real(1e-10)) );
283 at_new = std::max(
Real(0.), at_new);
285 if(std::fabs(at_new-at) <
Real(1e-5) and std::fabs(an_new-an) <
Real(1e-5)) {
298 Abort(
"The iteration procedure for the generalized actuator disk did not converge. Exiting...");
306 Real Fn = L*std::cos(psi) + D*std::sin(psi);
307 Real Ft = L*std::sin(psi) - D*std::cos(psi);
311 std::array<Real, 2> Fn_and_Ft;
constexpr amrex::Real three
Definition: ERF_Constants.H:11
constexpr amrex::Real two
Definition: ERF_Constants.H:10
constexpr amrex::Real one
Definition: ERF_Constants.H:9
constexpr amrex::Real myhalf
Definition: ERF_Constants.H:13
constexpr amrex::Real PI
Definition: ERF_Constants.H:42
AMREX_ALWAYS_ASSERT(bx.length()[2]==khi+1)
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real interpolate_1d(const amrex::Real *alpha, const amrex::Real *beta, const amrex::Real alpha_interp, const int alpha_size)
Definition: ERF_Interpolation_1D.H:14
amrex::Real Real
Definition: ERF_ShocInterface.H:19
@ rho
Definition: ERF_Kessler.H:24