LORENE
binary_omegaana.C
1 /*
2  * Methods of class Binary to set analytical value to omega
3  *
4  */
5 
6 /*
7  * Copyright (c) 2004 Francois Limousin
8  *
9  * This file is part of LORENE.
10  *
11  * LORENE is free software; you can redistribute it and/or modify
12  * it under the terms of the GNU General Public License as published by
13  * the Free Software Foundation; either version 2 of the License, or
14  * (at your option) any later version.
15  *
16  * LORENE is distributed in the hope that it will be useful,
17  * but WITHOUT ANY WARRANTY; without even the implied warranty of
18  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19  * GNU General Public License for more details.
20  *
21  * You should have received a copy of the GNU General Public License
22  * along with LORENE; if not, write to the Free Software
23  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
24  *
25  */
26 
27 
28 
29 
30 /*
31  * $Id: binary_omegaana.C,v 1.5 2016/12/05 16:17:47 j_novak Exp $
32  * $Log: binary_omegaana.C,v $
33  * Revision 1.5 2016/12/05 16:17:47 j_novak
34  * Suppression of some global variables (file names, loch, ...) to prevent redefinitions
35  *
36  * Revision 1.4 2014/10/13 08:52:45 j_novak
37  * Lorene classes and functions now belong to the namespace Lorene.
38  *
39  * Revision 1.3 2004/03/25 10:29:01 j_novak
40  * All LORENE's units are now defined in the namespace Unites (in file unites.h).
41  *
42  * Revision 1.2 2004/01/20 15:21:52 f_limousin
43  * First version
44  *
45  *
46  * $Header: /cvsroot/Lorene/C++/Source/Binary/binary_omegaana.C,v 1.5 2016/12/05 16:17:47 j_novak Exp $
47  *
48  */
49 
50 // Headers C
51 #include "math.h"
52 
53 // Headers Lorene
54 #include "binary.h"
55 #include "unites.h"
56 
57 
58 namespace Lorene {
60 
61  using namespace Unites ;
62 
63  double rr = separation() ;
64  double mtot = star1.mass_g() + star2.mass_g() ;
65 
66  // Compacity factor
67  double compact = ggrav * mtot / rr ;
68 
69  double omega2 ;
70 
71  if ( star1.is_irrotational() ) {
72 
73  // Irrotational case
74  // -----------------
75 
76  assert( star2.is_irrotational() ) ;
77 
78  omega2 = ggrav * mtot / pow(rr, 3)
79  * (1. - 2.75 * compact + 8.625 * compact*compact ) ;
80 
81  }
82  else{ // Corotating case
83  // ---------------
84 
85  assert( !star2.is_irrotational() ) ;
86 
87  // a0/R
88  double a0sr = star1.ray_eq() / rr ;
89 
90  // Rescaled moment of inertia 5 I / (2 M a0^2)
91  double ired = double(5)/double(3) * ( 1. - double(6) / M_PI / M_PI ) ;
92  omega2 = ggrav * mtot / pow(rr, 3)
93  * (1. - compact * ( 2.75 + 2.*a0sr*a0sr * ired
94  - 0.48*pow(a0sr, 4) * ired*ired )
95  + compact*compact * ( 8.625 + 2.75*a0sr*a0sr * ired
96  + 2.*pow(a0sr, 4) * ired*ired ) ) ;
97 
98  }
99 
100  omega = sqrt( omega2 ) ;
101 
102  // The derived quantities are obsolete:
103  del_deriv() ;
104 
105 }
106 }
Cmp sqrt(const Cmp &)
Square root.
Definition: cmp_math.C:223
Star_bin star1
First star of the system.
Definition: binary.h:80
Lorene prototypes.
Definition: app_hor.h:67
Standard units of space, time and mass.
double omega
Angular velocity with respect to an asymptotically inertial observer.
Definition: binary.h:94
double separation() const
Returns the coordinate separation of the two stellar centers [r_unit].
Definition: binary.C:610
void del_deriv() const
Deletes all the derived quantities.
Definition: binary.C:167
Cmp pow(const Cmp &, int)
Power .
Definition: cmp_math.C:351
bool is_irrotational() const
Returns true for an irrotational motion, false for a corotating one.
Definition: star.h:773
double ray_eq() const
Coordinate radius at , [r_unit].
Definition: star_global.C:111
virtual double mass_g() const
Gravitational mass.
Star_bin star2
Second star of the system.
Definition: binary.h:83
void analytical_omega()
Sets the orbital angular velocity to some 2-PN analytical value (Keplerian value in the Newtonian cas...