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 char strot_dirac_hydro_C[] = "$Header: /cvsroot/Lorene/C++/Source/Star/strot_dirac_hydro.C,v 1.7 2014/10/13 08:53:40 j_novak Exp $" ;
29 
30 /*
31  * $Id: strot_dirac_hydro.C,v 1.7 2014/10/13 08:53:40 j_novak Exp $
32  * $Log: strot_dirac_hydro.C,v $
33  * Revision 1.7 2014/10/13 08:53:40 j_novak
34  * Lorene classes and functions now belong to the namespace Lorene.
35  *
36  * Revision 1.6 2014/10/06 15:13:18 j_novak
37  * Modified #include directives to use c++ syntax.
38  *
39  * Revision 1.5 2007/12/21 16:07:49 j_novak
40  * Use of direct filtering of Vector and Sym_tensor.
41  *
42  * Revision 1.4 2007/11/06 16:23:59 j_novak
43  * Added the flag spectral_filter giving the order of possible spectral filtering
44  * of the hydro sources of metric equations (some members *_euler). The filtering
45  * is done in strot_dirac_hydro, if this flag is non-zero.
46  *
47  * Revision 1.3 2005/03/14 14:01:34 j_novak
48  * u_euler is now defined on all the grid.
49  *
50  * Revision 1.2 2005/02/17 17:31:56 f_limousin
51  * Change the name of some quantities to be consistent with other classes
52  * (for instance nnn is changed to nn, shift to beta, beta to lnq...)
53  *
54  * Revision 1.1 2005/01/31 08:51:48 j_novak
55  * New files for rotating stars in Dirac gauge (still under developement).
56  *
57  *
58  * $Header: /cvsroot/Lorene/C++/Source/Star/strot_dirac_hydro.C,v 1.7 2014/10/13 08:53:40 j_novak Exp $
59  *
60  */
61 
62 
63 // C headers
64 #include <cmath>
65 #include <cassert>
66 
67 // Lorene headers
68 #include"star_rot_dirac.h"
69 
70 namespace Lorene {
72 
73  // u_euler (fluid 3-velocity w.r.t. the Eulerian frame)
74  // -----------------------------------------------------
75 
76 
79 
80  u_euler.set(3) = omega ;
82  u_euler.set(3).mult_rsint() ;
83  u_euler.set(3) += beta(3) ;
84 
85  u_euler = u_euler / nn ;
86 
87  // v2 (square of the norm of u_euler)
88  // ----------------------------------
89 
90  v2 = contract(contract(gamma.cov(), 0, u_euler, 0), 0, u_euler, 0) ;
91 
92 
93  // gam_euler (Lorentz factor between the fluid and Eulerian observers)
94  // -------------------------------------------------------------------
95 
96  gam_euler = 1. / sqrt(1. - v2) ;
97 
99 
100 
101  // ener_euler (energy density w.r.t. the Eulerian observer)
102  // ------------------------------------------------------
103 
105 
107  if (spectral_filter > 0) {
109  }
110  // j_euler (momentum density 3-vector w.r.t. the Eulerian observer)
111  // ----------------------------------------------------------------
112 
115 
116  if (spectral_filter > 0) {
118  }
119 
120  // s_euler (trace of the stress tensor w.r.t. the Eulerian observer)
121  // ----------------------------------------------------------------
122 
123  s_euler = (ener_euler + press)*v2 + 3*press ;
125  if (spectral_filter > 0) {
127  }
128  // stress_euler (stress tensor w.r.t. the Eulerian observer)
129  // ---------------------------------------------------------
130 
131 
134  if (spectral_filter > 0) {
136  }
137 
138  // The derived quantities are obsolete
139  // ------------------------------------
140 
141  del_deriv() ;
142 
143 
144 }
145 
146 
147 }
virtual const Sym_tensor & con() const
Read-only access to the contravariant representation.
Definition: metric.C:290
virtual const Sym_tensor & cov() const
Read-only access to the covariant representation.
Definition: metric.C:280
virtual void std_spectral_base()
Sets the spectral bases of the Valeur va to the standard ones for a scalar field.
Definition: scalar.C:784
virtual void set_etat_zero()
Sets the logical state to ETATZERO (zero).
Definition: scalar.C:324
void mult_rsint()
Multiplication by everywhere; dzpuis is not changed.
virtual void exponential_filter_r(int lzmin, int lzmax, int p, double alpha=-16.)
Applies an exponential filter to the spectral coefficients in the radial direction.
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
virtual void exponential_filter_r(int lzmin, int lzmax, int p, double alpha=-16.)
Applies exponential filters to all components (see Scalar::exponential_filter_r ).
Definition: sym_tensor.C:446
virtual void std_spectral_base()
Sets the standard spectal bases of decomposition for each component.
Definition: vector.C:316
virtual void exponential_filter_r(int lzmin, int lzmax, int p, double alpha=-16.)
Applies exponential filters to all components (see Scalar::exponential_filter_r ).
Definition: vector.C:850
Scalar & set(int)
Read/write access to a component.
Definition: vector.C:296
Cmp sqrt(const Cmp &)
Square root.
Definition: cmp_math.C:220
virtual void std_spectral_base()
Sets the standard spectal bases of decomposition for each component.
Definition: tensor.C:926
Tenseur contract(const Tenseur &, int id1, int id2)
Self contraction of two indices of a Tenseur .
Lorene prototypes.
Definition: app_hor.h:64