Debian Codegraph @

C++/Source/Etoile/et_rot_hydro.C

raw
1 /*
2 * Function Etoile_rot::hydro_euler
3 *
4 * (see file etoile.h for documentation)
5 *
6 */
7
8 /*
9 * Copyright (c) 2000-2001 Eric Gourgoulhon
10 *
11 * This file is part of LORENE.
12 *
13 * LORENE is free software; you can redistribute it and/or modify
14 * it under the terms of the GNU General Public License as published by
15 * the Free Software Foundation; either version 2 of the License, or
16 * (at your option) any later version.
17 *
18 * LORENE is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU General Public License for more details.
22 *
23 * You should have received a copy of the GNU General Public License
24 * along with LORENE; if not, write to the Free Software
25 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
26 *
27 */
28
29
30 char et_rot_hydro_C[] = "$Header: /cvsroot/Lorene/C++/Source/Etoile/et_rot_hydro.C,v 1.4 2014/10/13 08:52:58 j_novak Exp $" ;
31
32 /*
33 * $Id: et_rot_hydro.C,v 1.4 2014/10/13 08:52:58 j_novak Exp $
34 * $Log: et_rot_hydro.C,v $
35 * Revision 1.4 2014/10/13 08:52:58 j_novak
36 * Lorene classes and functions now belong to the namespace Lorene.
37 *
38 * Revision 1.3 2014/10/06 15:13:09 j_novak
39 * Modified #include directives to use c++ syntax.
40 *
41 * Revision 1.2 2006/09/14 07:37:47 j_novak
42 * Removal of a test on u_euler.
43 *
44 * Revision 1.1.1.1 2001/11/20 15:19:28 e_gourgoulhon
45 * LORENE
46 *
47 * Revision 2.6 2000/10/12 15:36:06 eric
48 * Le test sur u_euler est desormais effectue sur la totalite de u_euler
49 * (ie comprenant le shift).
50 *
51 * Revision 2.5 2000/10/06 15:08:13 eric
52 * Calcul 3-D de u_euler.
53 * uuu s'en deduit.
54 *
55 * Revision 2.4 2000/08/31 15:38:34 eric
56 * Appel du nouvel operateur Cmp::mult_rsint pour le calcul de uuu.
57 *
58 * Revision 2.3 2000/08/25 12:28:21 eric
59 * *** empty log message ***
60 *
61 * Revision 2.2 2000/08/18 14:01:49 eric
62 * *** empty log message ***
63 *
64 * Revision 2.1 2000/08/17 12:39:56 eric
65 * *** empty log message ***
66 *
67 * Revision 2.0 2000/07/21 16:31:00 eric
68 * *** empty log message ***
69 *
70 *
71 * $Header: /cvsroot/Lorene/C++/Source/Etoile/et_rot_hydro.C,v 1.4 2014/10/13 08:52:58 j_novak Exp $
72 *
73 */
74
75 // Headers C
76 #include <cstdlib>
77
78 // Headers Lorene
79 #include "etoile.h"
80 #include "utilitaires.h"
81
82 namespace Lorene {
83 void Etoile_rot::hydro_euler(){
84
85 int nz = mp.get_mg()->get_nzone() ;
86 int nzm1 = nz - 1 ;
87
88 // Computation of u_euler
89 // ----------------------
90
91 const Coord& x = mp.x ;
92 const Coord& y = mp.y ;
93
94 u_euler.set_etat_qcq() ;
95
96 u_euler.set(0) = - omega * y ; // Cartesian components of solid rotation
97 u_euler.set(1) = omega * x ;
98 u_euler.set(2) = 0 ;
99 u_euler.annule(nzm1) ;
100
101 u_euler.set_triad( mp.get_bvect_cart() ) ; // Triad = Cartesian triad
102
103 u_euler.set_std_base() ; // sets the standard bases for spectral expansions
104
105 u_euler = ( u_euler - shift ) / nnn ;
106
107 u_euler.set_std_base() ; // sets the standard bases for spectral expansions
108
109 if ( (u_euler(0).get_etat() == ETATZERO) &&
110 (u_euler(1).get_etat() == ETATZERO) &&
111 (u_euler(2).get_etat() == ETATZERO) ) {
112
113 u_euler = 0 ;
114 }
115
116
117 // Computation of uuu (norme of u_euler)
118 // ------------------
119
120 // The scalar product is performed on the spherical components:
121
122 Tenseur us = u_euler ;
123 us.change_triad( mp.get_bvect_spher() ) ;
124
125 Cmp uuu2 = a_car() * ( us(0) * us(0) + us(1) * us(1) )
126 + b_car() * us(2) * us(2) ;
127
128 uuu = sqrt( uuu2 ) ;
129
130 if (uuu.get_etat() == ETATQCQ) {
131 ((uuu.set()).va).set_base( us(2).va.base ) ; // Same basis as
132 } // (Omega -N^phi) r sin(theta)
133
134
135 // Lorentz factor
136 // --------------
137
138 Tenseur u2(mp) ;
139 u2 = unsurc2 * uuu2 ;
140
141 Tenseur gam2 = 1 / (1 - u2) ;
142
143 gam_euler = sqrt(gam2) ;
144
145 gam_euler.set_std_base() ; // sets the standard spectral bases for
146 // a scalar field
147
148 // Energy density E with respect to the Eulerian observer
149 //------------------------------------
150
151 ener_euler = gam2 * ( ener + press ) - press ;
152
153 ener_euler.set_std_base() ;
154
155 // Trace of the stress tensor with respect to the Eulerian observer
156 //------------------------------------
157
158 s_euler = 3 * press + ( ener_euler + press ) * u2 ;
159
160 s_euler.set_std_base() ;
161
162 // The derived quantities are obsolete
163 // -----------------------------------
164
165 del_deriv() ;
166
167
168 }
169 }