cloudy  trunk
dense_parametric_wind.cpp
Go to the documentation of this file.
1 /* This file is part of Cloudy and is copyright (C)1978-2013 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 
7 /*dense_parametric_wind called by dlaw command, returns density for any density law */
8 double dense_parametric_wind(double rad)
9 {
10  /* >> refer wind profile Springmann, U., 1994, A&A, 289, 505 */
11 
12  // SOLAR_MASS / 3e7 converts from M_solar/year to g/s
13  double Mdot = dense.DensityLaw[0] * SOLAR_MASS / 3e7;
14  double v_inf = dense.DensityLaw[1] * 1e5;
15  double Beta2 = dense.DensityLaw[2];
16  double Beta1 = dense.DensityLaw[3];
17  double v_0 = dense.DensityLaw[4] * 1e5;
18  double v_star = dense.DensityLaw[5] * 1e5;
19 
20  double r_star = radius.rinner;
21  double x = MIN2( 0.01, 1. - r_star/rad );
22  double v_r = v_star + (v_inf - v_0) * sqrt( Beta1 * x + (1.-Beta1) * pow(x, Beta2) );
23  double mu = 1.;
24  if( dense.wmole > 0. )
25  mu = dense.wmole;
26  double density = Mdot / ( PI4 * ATOMIC_MASS_UNIT * mu * pow(rad, 2.) * v_r);
27  return density;
28 }
dense
t_dense dense
Definition: dense.cpp:24
SOLAR_MASS
const UNUSED double SOLAR_MASS
Definition: physconst.h:71
PI4
const UNUSED double PI4
Definition: physconst.h:35
MIN2
#define MIN2
Definition: cddefines.h:761
ATOMIC_MASS_UNIT
const UNUSED double ATOMIC_MASS_UNIT
Definition: physconst.h:88
radius
t_radius radius
Definition: radius.cpp:5
dense.h
cddefines.h
t_radius::rinner
double rinner
Definition: radius.h:22
dense_parametric_wind
double dense_parametric_wind(double rad)
Definition: dense_parametric_wind.cpp:8
radius.h
t_dense::wmole
realnum wmole
Definition: dense.h:101
t_dense::DensityLaw
double DensityLaw[10]
Definition: dense.h:173