I have the following form for finding the motion of a dilute particle cloud, subject to an applied body force and air drag. The air drag expression requires one to take an non-integer power of u, i.e. power(Re_p(u),0.687)
def C_DtimesU(Re_p): return 24.0/k_Re*(1.0 + 0.15*pow(Re_p,0.637)) def F_drag(u,c): Re_p = k_Re*abs(u) return -0.5*A_p*rho_f*C_DtimesU(Re_p)*c*u F = (c*(u-u_1) + u*(c-c_1))*k_t*v_u*dx + (c*u*u).dx(0)*v_u*dx - \ F_drag(u,c)*k_mp*v_u*dx - c*F_applied*k_mp*v_u*dx + \ (c - c_1)*k_t*v_c*dx + (c*u).dx(0)*v_c*dx
Is there a way of doing this within ufl? Could I make a c++ expression for the power function?
Thank you for your time,