cloudy  trunk
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
dense_parametric_wind.cpp
Go to the documentation of this file.
1 /* This file is part of Cloudy and is copyright (C)1978-2022 by Gary J. Ferland and
2  * others. For conditions of distribution and use see copyright notice in license.txt */
3 #include "cddefines.h"
4 #include "dense.h"
5 #include "radius.h"
6 #include "physconst.h"
7 
8 /*dense_parametric_wind called by dlaw command, returns density for any density law */
9 double dense_parametric_wind(double rad)
10 {
11  /* >> refer wind profile Springmann, U., 1994, A&A, 289, 505 */
12 
13  // SOLAR_MASS / 3e7 converts from M_solar/year to g/s
14  double Mdot = dense.DensityLaw[0] * SOLAR_MASS / 3e7;
15  double v_inf = dense.DensityLaw[1] * 1e5;
16  double Beta2 = dense.DensityLaw[2];
17  double Beta1 = dense.DensityLaw[3];
18  double v_0 = dense.DensityLaw[4] * 1e5;
19  double v_star = dense.DensityLaw[5] * 1e5;
20 
21  double r_star = radius.rinner;
22  double x = MIN2( 0.01, 1. - r_star/rad );
23  double v_r = v_star + (v_inf - v_0) * sqrt( Beta1 * x + (1.-Beta1) * pow(x, Beta2) );
24  double mu = 1.;
25  if( dense.wmole > 0. )
26  mu = dense.wmole;
27  double density = Mdot / ( PI4 * ATOMIC_MASS_UNIT * mu * pow2(rad) * v_r);
28  return density;
29 }
#define MIN2(a, b)
Definition: cddefines.h:803
t_dense dense
Definition: global.cpp:15
double rinner
Definition: radius.h:31
t_radius radius
Definition: radius.cpp:5
realnum wmole
Definition: dense.h:111
double density(const genericState &gs)
T pow2(T a)
Definition: cddefines.h:981
double dense_parametric_wind(double rad)
double DensityLaw[10]
Definition: dense.h:191