cloudy
trunk
Loading...
Searching...
No Matches
source
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
}
cddefines.h
MIN2
#define MIN2
Definition
cddefines.h:761
dense
t_dense dense
Definition
dense.cpp:24
dense.h
dense_parametric_wind
double dense_parametric_wind(double rad)
Definition
dense_parametric_wind.cpp:8
SOLAR_MASS
UNUSED const double SOLAR_MASS
Definition
physconst.h:71
PI4
UNUSED const double PI4
Definition
physconst.h:35
ATOMIC_MASS_UNIT
UNUSED const double ATOMIC_MASS_UNIT
Definition
physconst.h:88
radius
t_radius radius
Definition
radius.cpp:5
radius.h
Generated by
1.14.0