226 Real Omega = rpm/60.0*2.0*
PI;
240 Real at, an, V1, Vt, Vr, psi, L, D, Cn, Ct;
241 Real ftip, fhub, F, Cl, Cd, at_new, an_new;
246 bool is_converged =
false;
248 for(
int i=0;i<100;i++) {
250 Vt = Omega*(1.0+at)*
rad;
251 Vr = std::pow(V1*V1+Vt*Vt,0.5);
253 psi = std::atan2(V1,Vt);
255 Real aoa = psi*180.0/
PI - twist + pitch;
257 Cl =
interpolate_1d(bld_airfoil_aoa, bld_airfoil_Cl, aoa, n_pts_airfoil);
258 Cd =
interpolate_1d(bld_airfoil_aoa, bld_airfoil_Cd, aoa, n_pts_airfoil);
265 Cn = Cl*std::cos(psi) + Cd*std::sin(psi);
266 Ct = Cl*std::sin(psi) - Cd*std::cos(psi);
268 ftip = B*(rtip-
rad)/(2.0*
rad*std::sin(psi)+1e-10);
269 fhub = B*(
rad-rhub)/(2.0*
rad*std::sin(psi)+1e-10);
274 F = 2.0/
PI*(std::acos(std::exp(-ftip)) + std::acos(std::exp(-fhub)) );
276 at_new = 1.0/ ( 4.0*F*std::sin(psi)*std::cos(psi)/(s*Ct+1e-10) - 1.0 );
277 an_new = 1.0/ ( 1.0 + 4.0*F*std::pow(std::sin(psi),2)/(s*Cn + 1e-10) );
278 at_new = std::max(0.0, at_new);
280 if(std::fabs(at_new-at) < 1e-5 and std::fabs(an_new-an) < 1e-5) {
293 Abort(
"The iteration procedure for the generalized actuator disk did not converge. Exiting...");
298 L = 0.5*
rho*Vr*Vr*c*Cl;
299 D = 0.5*
rho*Vr*Vr*c*Cd;
301 Real Fn = L*std::cos(psi) + D*std::sin(psi);
302 Real Ft = L*std::sin(psi) - D*std::cos(psi);
306 std::array<Real, 2> Fn_and_Ft;
constexpr amrex::Real PI
Definition: ERF_Constants.H:6
background fields should have been initialized with erf init_type<< std::endl;} Real qt_init=0.02;pp_prob.query("qt_init", qt_init);Real eq_pot_temp=320.0;pp_prob.query("eq_pot_temp", eq_pot_temp);bool use_empirical=false;pp_prob.query("use_empircal_psat", use_empirical);if(do_moist_bubble) { Vector< Real > h_r(khi+2);Vector< Real > h_p(khi+2);Vector< Real > h_t(khi+2);Vector< Real > h_q_v(khi+2);Gpu::DeviceVector< Real > d_r(khi+2);Gpu::DeviceVector< Real > d_p(khi+2);Gpu::DeviceVector< Real > d_t(khi+2);Gpu::DeviceVector< Real > d_q_v(khi+2);HSEutils::init_isentropic_hse_no_terrain(h_t.data(), h_r.data(), h_p.data(), h_q_v.data(), dz, khi, qt_init, eq_pot_temp, use_empirical, false);Gpu::copyAsync(Gpu::hostToDevice, h_r.begin(), h_r.end(), d_r.begin());Gpu::copyAsync(Gpu::hostToDevice, h_p.begin(), h_p.end(), d_p.begin());Gpu::copyAsync(Gpu::hostToDevice, h_t.begin(), h_t.end(), d_t.begin());Gpu::copyAsync(Gpu::hostToDevice, h_q_v.begin(), h_q_v.end(), d_q_v.begin());Real *theta_back=d_t.data();Real *p_back=d_p.data();Real *q_v_back=d_q_v.data();int moisture_type=1;if(sc.moisture_type==MoistureType::SAM) { moisture_type=1;} else if(sc.moisture_type==MoistureType::SAM_NoIce||sc.moisture_type==MoistureType::SAM_NoPrecip_NoIce) { moisture_type=2;} ParallelFor(bx,[=] AMREX_GPU_DEVICE(int i, int j, int k) { const auto prob_lo=geomdata.ProbLo();const auto dx=geomdata.CellSize();const Real x=prob_lo[0]+(i+0.5) *dx[0];const Real y=prob_lo[1]+(j+0.5) *dx[1];const Real z=prob_lo[2]+(k+0.5) *dx[2];Real rad, delta_theta, theta_total, rho, RH;rad=0.0;if(x_r > rad
Definition: ERF_InitCustomPert_Bubble.H:93
AMREX_ALWAYS_ASSERT(bx.length()[2]==khi+1)
rho
Definition: ERF_InitCustomPert_Bubble.H:106
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:12
amrex::Real Real
Definition: ERF_ShocInterface.H:19