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
26char binary_omega_ana_xcts_C[] = "$Header: /cvsroot/Lorene/C++/Source/Binary_xcts/binary_omega_ana_xcts.C,v 1.2 2014/10/13 08:52:45 j_novak Exp $" ;
27
28/*
29 * $Id: binary_omega_ana_xcts.C,v 1.2 2014/10/13 08:52:45 j_novak Exp $
30 * $Log: binary_omega_ana_xcts.C,v $
31 * Revision 1.2 2014/10/13 08:52:45 j_novak
32 * Lorene classes and functions now belong to the namespace Lorene.
33 *
34 * Revision 1.1 2010/05/04 07:35:54 m_bejger
35 * Initial version
36 *
37 * $Header: /cvsroot/Lorene/C++/Source/Binary_xcts/binary_omega_ana_xcts.C,v 1.2 2014/10/13 08:52:45 j_novak Exp $
38 *
39 */
40
41// Headers C
42#include "math.h"
43
44// Headers Lorene
45#include "binary_xcts.h"
46#include "unites.h"
47
48
49namespace Lorene {
51
52 using namespace Unites ;
53
54 double rr = separation() ;
55 double mtot = star1.mass_g() + star2.mass_g() ;
56
57 // Compacity factor
58 double compact = ggrav * mtot / rr ;
59
60 double omega2 ;
61
62 if ( star1.is_irrotational() ) {
63
64 // Irrotational case
65 // -----------------
66
67 assert( star2.is_irrotational() ) ;
68
69 omega2 = ggrav * mtot / pow(rr, 3)
70 * (1. - 2.75 * compact + 8.625 * compact*compact ) ;
71
72 }
73 else{ // Corotating case
74 // ---------------
75
76 assert( !star2.is_irrotational() ) ;
77
78 // a0/R
79 double a0sr = star1.ray_eq() / rr ;
80
81 // Rescaled moment of inertia 5 I / (2 M a0^2)
82 double ired = double(5)/double(3) * ( 1. - double(6) / M_PI / M_PI ) ;
83 omega2 = ggrav * mtot / pow(rr, 3)
84 * (1. - compact * ( 2.75 + 2.*a0sr*a0sr * ired
85 - 0.48*pow(a0sr, 4) * ired*ired )
86 + compact*compact * ( 8.625 + 2.75*a0sr*a0sr * ired
87 + 2.*pow(a0sr, 4) * ired*ired ) ) ;
88
89 }
90
91 omega = sqrt( omega2 ) ;
92
93 // The derived quantities are obsolete:
94 del_deriv() ;
95
96}
97}
Star_bin_xcts star2
Second star of the system.
Definition binary_xcts.h:69
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
double separation() const
Returns the coordinate separation of the two stellar centers [r_unit].
void del_deriv() const
Deletes all the derived quantities.
double omega
Angular velocity with respect to an asymptotically inertial observer.
Definition binary_xcts.h:80
bool is_irrotational() const
Returns true for an irrotational motion, false for a corotating one.
Definition star.h:1317
virtual double mass_g() const
Gravitational mass.
double ray_eq() const
Coordinate radius at , [r_unit].
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.