Debian Codegraph @

C++/Source/Bin_ns_ncp/bin_ns_ncp_omegaana.C

raw
1 /*
2 * Methods of class Bin_ns_ncp to set analytical value to omega
3 *
4 */
5
6 /*
7 * Copyright (c) 2003 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 bin_ns_ncp_omegaana_C[] = "$Header: /cvsroot/Lorene/C++/Source/Bin_ns_ncp/bin_ns_ncp_omegaana.C,v 1.3 2014/10/13 08:52:43 j_novak Exp $" ;
29
30 /*
31 * $Header: /cvsroot/Lorene/C++/Source/Bin_ns_ncp/bin_ns_ncp_omegaana.C,v 1.3 2014/10/13 08:52:43 j_novak Exp $
32 *
33 */
34
35 // Headers C
36 #include "math.h"
37
38 // Headers Lorene
39 #include "bin_ns_ncp.h"
40 #include "unites.h"
41
42
43 namespace Lorene {
44 void Bin_ns_ncp::analytical_omega() {
45
46 using namespace Unites ;
47
48 double rr = separation() ;
49 double mtot = star1.mass_g() + star2.mass_g() ;
50
51 // Compacity factor
52 double compact = ggrav * mtot / rr ;
53
54 // The compacity factor is set to zero in the Newtonian case
55 if ( !star1.is_relativistic() ) {
56 assert( !star2.is_relativistic() ) ;
57 compact = 0 ;
58 }
59
60
61 double omega2 ;
62
63 if ( star1.is_irrotational() ) {
64
65 // Irrotational case
66 // -----------------
67
68 assert( star2.is_irrotational() ) ;
69
70 omega2 = ggrav * mtot / pow(rr, 3)
71 * (1. - 2.75 * compact + 8.625 * compact*compact ) ;
72
73 }
74 else{ // Corotating case
75 // ---------------
76
77 assert( !star2.is_irrotational() ) ;
78
79 // a0/R
80 double a0sr = star1.ray_eq() / rr ;
81
82 // Rescaled moment of inertia 5 I / (2 M a0^2)
83 double ired = double(5)/double(3) * ( 1. - double(6) / M_PI / M_PI ) ;
84 omega2 = ggrav * mtot / pow(rr, 3)
85 * (1. - compact * ( 2.75 + 2.*a0sr*a0sr * ired
86 - 0.48*pow(a0sr, 4) * ired*ired )
87 + compact*compact * ( 8.625 + 2.75*a0sr*a0sr * ired
88 + 2.*pow(a0sr, 4) * ired*ired ) ) ;
89
90 }
91
92 omega = sqrt( omega2 ) ;
93
94 // The derived quantities are obsolete:
95 del_deriv() ;
96
97 }
98 }