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