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 char binary_omegaana_C[] = "$Header: /cvsroot/Lorene/C++/Source/Binary/binary_omegaana.C,v 1.4 2014/10/13 08:52:45 j_novak Exp $" ;
29 
30 /*
31  * $Id: binary_omegaana.C,v 1.4 2014/10/13 08:52:45 j_novak Exp $
32  * $Log: binary_omegaana.C,v $
33  * Revision 1.4 2014/10/13 08:52:45 j_novak
34  * Lorene classes and functions now belong to the namespace Lorene.
35  *
36  * Revision 1.3 2004/03/25 10:29:01 j_novak
37  * All LORENE's units are now defined in the namespace Unites (in file unites.h).
38  *
39  * Revision 1.2 2004/01/20 15:21:52 f_limousin
40  * First version
41  *
42  *
43  * $Header: /cvsroot/Lorene/C++/Source/Binary/binary_omegaana.C,v 1.4 2014/10/13 08:52:45 j_novak Exp $
44  *
45  */
46 
47 // Headers C
48 #include "math.h"
49 
50 // Headers Lorene
51 #include "binary.h"
52 #include "unites.h"
53 
54 
55 namespace Lorene {
57 
58  using namespace Unites ;
59 
60  double rr = separation() ;
61  double mtot = star1.mass_g() + star2.mass_g() ;
62 
63  // Compacity factor
64  double compact = ggrav * mtot / rr ;
65 
66  double omega2 ;
67 
68  if ( star1.is_irrotational() ) {
69 
70  // Irrotational case
71  // -----------------
72 
73  assert( star2.is_irrotational() ) ;
74 
75  omega2 = ggrav * mtot / pow(rr, 3)
76  * (1. - 2.75 * compact + 8.625 * compact*compact ) ;
77 
78  }
79  else{ // Corotating case
80  // ---------------
81 
82  assert( !star2.is_irrotational() ) ;
83 
84  // a0/R
85  double a0sr = star1.ray_eq() / rr ;
86 
87  // Rescaled moment of inertia 5 I / (2 M a0^2)
88  double ired = double(5)/double(3) * ( 1. - double(6) / M_PI / M_PI ) ;
89  omega2 = ggrav * mtot / pow(rr, 3)
90  * (1. - compact * ( 2.75 + 2.*a0sr*a0sr * ired
91  - 0.48*pow(a0sr, 4) * ired*ired )
92  + compact*compact * ( 8.625 + 2.75*a0sr*a0sr * ired
93  + 2.*pow(a0sr, 4) * ired*ired ) ) ;
94 
95  }
96 
97  omega = sqrt( omega2 ) ;
98 
99  // The derived quantities are obsolete:
100  del_deriv() ;
101 
102 }
103 }
void del_deriv() const
Deletes all the derived quantities.
Definition: binary.C:161
double omega
Angular velocity with respect to an asymptotically inertial observer.
Definition: binary.h:94
void analytical_omega()
Sets the orbital angular velocity to some 2-PN analytical value (Keplerian value in the Newtonian cas...
Star_bin star2
Second star of the system.
Definition: binary.h:83
Star_bin star1
First star of the system.
Definition: binary.h:80
double separation() const
Returns the coordinate separation of the two stellar centers [r_unit].
Definition: binary.C:604
bool is_irrotational() const
Returns true for an irrotational motion, false for a corotating one.
Definition: star.h:773
virtual double mass_g() const
Gravitational mass.
double ray_eq() const
Coordinate radius at , [r_unit].
Definition: star_global.C:108
Cmp sqrt(const Cmp &)
Square root.
Definition: cmp_math.C:220
Cmp pow(const Cmp &, int)
Power .
Definition: cmp_math.C:348
Lorene prototypes.
Definition: app_hor.h:64
Standard units of space, time and mass.