00001 /* This file is part of Cloudy and is copyright (C)1978-2013 by Gary J. Ferland and 00002 * others. For conditions of distribution and use see copyright notice in license.txt */ 00003 #include "cddefines.h" 00004 #include "dense.h" 00005 #include "radius.h" 00006 00007 /*dense_parametric_wind called by dlaw command, returns density for any density law */ 00008 double dense_parametric_wind(double rad) 00009 { 00010 /* >> refer wind profile Springmann, U., 1994, A&A, 289, 505 */ 00011 00012 // SOLAR_MASS / 3e7 converts from M_solar/year to g/s 00013 double Mdot = dense.DensityLaw[0] * SOLAR_MASS / 3e7; 00014 double v_inf = dense.DensityLaw[1] * 1e5; 00015 double Beta2 = dense.DensityLaw[2]; 00016 double Beta1 = dense.DensityLaw[3]; 00017 double v_0 = dense.DensityLaw[4] * 1e5; 00018 double v_star = dense.DensityLaw[5] * 1e5; 00019 00020 double r_star = radius.rinner; 00021 double x = MIN2( 0.01, 1. - r_star/rad ); 00022 double v_r = v_star + (v_inf - v_0) * sqrt( Beta1 * x + (1.-Beta1) * pow(x, Beta2) ); 00023 double mu = 1.; 00024 if( dense.wmole > 0. ) 00025 mu = dense.wmole; 00026 double density = Mdot / ( PI4 * ATOMIC_MASS_UNIT * mu * pow(rad, 2.) * v_r); 00027 return density; 00028 }