LORENE
strot_dirac_hydro.C
1/*
2 * Function Star_rot_Dirac::hydro_euler
3 *
4 * (see file star_rot_dirac.h for documentation).
5 *
6 */
7
8/*
9 * Copyright (c) 2005 Lap-Ming Lin & Jerome Novak
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 version 2
15 * as published by the Free Software Foundation.
16 *
17 * LORENE is distributed in the hope that it will be useful,
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 * GNU General Public License for more details.
21 *
22 * You should have received a copy of the GNU General Public License
23 * along with LORENE; if not, write to the Free Software
24 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
25 *
26 */
27
28
29
30/*
31 * $Id: strot_dirac_hydro.C,v 1.8 2016/12/05 16:18:15 j_novak Exp $
32 * $Log: strot_dirac_hydro.C,v $
33 * Revision 1.8 2016/12/05 16:18:15 j_novak
34 * Suppression of some global variables (file names, loch, ...) to prevent redefinitions
35 *
36 * Revision 1.7 2014/10/13 08:53:40 j_novak
37 * Lorene classes and functions now belong to the namespace Lorene.
38 *
39 * Revision 1.6 2014/10/06 15:13:18 j_novak
40 * Modified #include directives to use c++ syntax.
41 *
42 * Revision 1.5 2007/12/21 16:07:49 j_novak
43 * Use of direct filtering of Vector and Sym_tensor.
44 *
45 * Revision 1.4 2007/11/06 16:23:59 j_novak
46 * Added the flag spectral_filter giving the order of possible spectral filtering
47 * of the hydro sources of metric equations (some members *_euler). The filtering
48 * is done in strot_dirac_hydro, if this flag is non-zero.
49 *
50 * Revision 1.3 2005/03/14 14:01:34 j_novak
51 * u_euler is now defined on all the grid.
52 *
53 * Revision 1.2 2005/02/17 17:31:56 f_limousin
54 * Change the name of some quantities to be consistent with other classes
55 * (for instance nnn is changed to nn, shift to beta, beta to lnq...)
56 *
57 * Revision 1.1 2005/01/31 08:51:48 j_novak
58 * New files for rotating stars in Dirac gauge (still under developement).
59 *
60 *
61 * $Header: /cvsroot/Lorene/C++/Source/Star/strot_dirac_hydro.C,v 1.8 2016/12/05 16:18:15 j_novak Exp $
62 *
63 */
64
65
66// C headers
67#include <cmath>
68#include <cassert>
69
70// Lorene headers
71#include"star_rot_dirac.h"
72
73namespace Lorene {
75
76 // u_euler (fluid 3-velocity w.r.t. the Eulerian frame)
77 // -----------------------------------------------------
78
79
80 u_euler.set(1).set_etat_zero() ;
81 u_euler.set(2).set_etat_zero() ;
82
83 u_euler.set(3) = omega ;
84 u_euler.set(3).std_spectral_base() ;
85 u_euler.set(3).mult_rsint() ;
86 u_euler.set(3) += beta(3) ;
87
88 u_euler = u_euler / nn ;
89
90 // v2 (square of the norm of u_euler)
91 // ----------------------------------
92
93 v2 = contract(contract(gamma.cov(), 0, u_euler, 0), 0, u_euler, 0) ;
94
95
96 // gam_euler (Lorentz factor between the fluid and Eulerian observers)
97 // -------------------------------------------------------------------
98
99 gam_euler = 1. / sqrt(1. - v2) ;
100
101 gam_euler.std_spectral_base() ;
102
103
104 // ener_euler (energy density w.r.t. the Eulerian observer)
105 // ------------------------------------------------------
106
108
109 ener_euler.std_spectral_base() ;
110 if (spectral_filter > 0) {
111 ener_euler.exponential_filter_r(1, nzet-1, spectral_filter) ;
112 }
113 // j_euler (momentum density 3-vector w.r.t. the Eulerian observer)
114 // ----------------------------------------------------------------
115
117 j_euler.std_spectral_base() ;
118
119 if (spectral_filter > 0) {
120 j_euler.exponential_filter_r(1, nzet-1, spectral_filter) ;
121 }
122
123 // s_euler (trace of the stress tensor w.r.t. the Eulerian observer)
124 // ----------------------------------------------------------------
125
126 s_euler = (ener_euler + press)*v2 + 3*press ;
127 s_euler.std_spectral_base() ;
128 if (spectral_filter > 0) {
129 s_euler.exponential_filter_r(1, nzet-1, spectral_filter) ;
130 }
131 // stress_euler (stress tensor w.r.t. the Eulerian observer)
132 // ---------------------------------------------------------
133
134
136 stress_euler.std_spectral_base() ;
137 if (spectral_filter > 0) {
138 stress_euler.exponential_filter_r(1, nzet-1, spectral_filter) ;
139 }
140
141 // The derived quantities are obsolete
142 // ------------------------------------
143
144 del_deriv() ;
145
146
147}
148
149
150}
virtual void del_deriv() const
Deletes all the derived quantities.
int spectral_filter
Spectral exponential filtering order.
double omega
Rotation angular velocity ([f_unit] ).
Vector j_euler
Momentum density 3-vector with respect to the Eulerian observer.
virtual void hydro_euler()
Computes the hydrodynamical quantities relative to the Eulerian observer from those in the fluid fram...
Scalar ener
Total energy density in the fluid frame.
Definition star.h:193
Scalar nn
Lapse function N .
Definition star.h:225
Scalar ener_euler
Total energy density in the Eulerian frame.
Definition star.h:198
Scalar gam_euler
Lorentz factor between the fluid and Eulerian observers.
Definition star.h:204
Scalar s_euler
Trace of the stress scalar in the Eulerian frame.
Definition star.h:201
Metric gamma
3-metric
Definition star.h:235
Sym_tensor stress_euler
Spatial part of the stress-energy tensor with respect to the Eulerian observer.
Definition star.h:212
Scalar press
Fluid pressure.
Definition star.h:194
Vector u_euler
Fluid 3-velocity with respect to the Eulerian observer.
Definition star.h:207
int nzet
Number of domains of *mp occupied by the star.
Definition star.h:183
Vector beta
Shift vector.
Definition star.h:228
Cmp sqrt(const Cmp &)
Square root.
Definition cmp_math.C:223
Tenseur contract(const Tenseur &, int id1, int id2)
Self contraction of two indices of a Tenseur .
Lorene prototypes.
Definition app_hor.h:67