246 Real at, an, V1, Vt, Vr, psi, L, D, Cn, Ct;
247 Real ftip, fhub, F, Cl, Cd, at_new, an_new;
252 bool is_converged =
false;
254 for(
int i=0;i<100;i++) {
256 Vt = Omega*(
one+at)*rad;
257 Vr = std::pow(V1*V1+Vt*Vt,
myhalf);
259 psi = std::atan2(V1,Vt);
261 Real aoa = psi*
Real(180.0)/
PI - twist + pitch;
263 Cl =
interpolate_1d(bld_airfoil_aoa, bld_airfoil_Cl, aoa, n_pts_airfoil);
264 Cd =
interpolate_1d(bld_airfoil_aoa, bld_airfoil_Cd, aoa, n_pts_airfoil);
271 Cn = Cl*std::cos(psi) + Cd*std::sin(psi);
272 Ct = Cl*std::sin(psi) - Cd*std::cos(psi);
274 ftip = B*(rtip-rad)/(
two*rad*std::sin(psi)+
Real(1e-10));
275 fhub = B*(rad-rhub)/(
two*rad*std::sin(psi)+
Real(1e-10));
280 F =
two/
PI*(std::acos(std::exp(-ftip)) + std::acos(std::exp(-fhub)) );
282 at_new =
one/ (
Real(4.0)*F*std::sin(psi)*std::cos(psi)/(s*Ct+
Real(1e-10)) -
one );
283 an_new =
one/ (
one +
Real(4.0)*F*amrex::Math::powi<2>(std::sin(psi))/(s*Cn +
Real(1e-10)) );
284 at_new = std::max(
Real(0.), at_new);
286 if(std::fabs(at_new-at) <
Real(1e-5) and std::fabs(an_new-an) <
Real(1e-5)) {
299 Abort(
"The iteration procedure for the generalized actuator disk did not converge. Exiting...");
307 Real Fn = L*std::cos(psi) + D*std::sin(psi);
308 Real Ft = L*std::sin(psi) - D*std::cos(psi);
312 std::array<Real, 2> Fn_and_Ft;
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
constexpr amrex::Real three
Definition: ERF_NumericalConstants.H:32
constexpr amrex::Real two
Definition: ERF_NumericalConstants.H:31
constexpr amrex::Real one
Definition: ERF_NumericalConstants.H:30
constexpr amrex::Real myhalf
Definition: ERF_NumericalConstants.H:34
constexpr amrex::Real PI
Definition: ERF_NumericalConstants.H:39
amrex::Real Real
Definition: ERF_ShocInterface.H:19
@ rho
Definition: ERF_Kessler.H:25