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 
73 namespace Lorene {
75 
76  // u_euler (fluid 3-velocity w.r.t. the Eulerian frame)
77  // -----------------------------------------------------
78 
79 
82 
83  u_euler.set(3) = omega ;
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 
102 
103 
104  // ener_euler (energy density w.r.t. the Eulerian observer)
105  // ------------------------------------------------------
106 
108 
110  if (spectral_filter > 0) {
112  }
113  // j_euler (momentum density 3-vector w.r.t. the Eulerian observer)
114  // ----------------------------------------------------------------
115 
118 
119  if (spectral_filter > 0) {
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 ;
128  if (spectral_filter > 0) {
130  }
131  // stress_euler (stress tensor w.r.t. the Eulerian observer)
132  // ---------------------------------------------------------
133 
134 
137  if (spectral_filter > 0) {
139  }
140 
141  // The derived quantities are obsolete
142  // ------------------------------------
143 
144  del_deriv() ;
145 
146 
147 }
148 
149 
150 }
virtual const Sym_tensor & con() const
Read-only access to the contravariant representation.
Definition: metric.C:293
double omega
Rotation angular velocity ([f_unit] )
Cmp sqrt(const Cmp &)
Square root.
Definition: cmp_math.C:223
virtual void set_etat_zero()
Sets the logical state to ETATZERO (zero).
Definition: scalar.C:330
Metric gamma
3-metric
Definition: star.h:235
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:449
Lorene prototypes.
Definition: app_hor.h:67
Sym_tensor stress_euler
Spatial part of the stress-energy tensor with respect to the Eulerian observer.
Definition: star.h:212
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 std_spectral_base()
Sets the spectral bases of the Valeur va to the standard ones for a scalar field. ...
Definition: scalar.C:790
virtual void del_deriv() const
Deletes all the derived quantities.
Scalar s_euler
Trace of the stress scalar in the Eulerian frame.
Definition: star.h:201
Vector beta
Shift vector.
Definition: star.h:228
virtual void hydro_euler()
Computes the hydrodynamical quantities relative to the Eulerian observer from those in the fluid fram...
virtual void std_spectral_base()
Sets the standard spectal bases of decomposition for each component.
Definition: vector.C:322
int nzet
Number of domains of *mp occupied by the star.
Definition: star.h:183
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:856
Scalar gam_euler
Lorentz factor between the fluid and Eulerian observers.
Definition: star.h:204
Scalar ener
Total energy density in the fluid frame.
Definition: star.h:193
Scalar press
Fluid pressure.
Definition: star.h:194
Vector u_euler
Fluid 3-velocity with respect to the Eulerian observer.
Definition: star.h:207
void mult_rsint()
Multiplication by everywhere; dzpuis is not changed.
Tenseur contract(const Tenseur &, int id1, int id2)
Self contraction of two indices of a Tenseur .
virtual const Sym_tensor & cov() const
Read-only access to the covariant representation.
Definition: metric.C:283
Scalar nn
Lapse function N .
Definition: star.h:225
Scalar & set(int)
Read/write access to a component.
Definition: vector.C:302
Vector j_euler
Momentum density 3-vector with respect to the Eulerian observer.
Scalar ener_euler
Total energy density in the Eulerian frame.
Definition: star.h:198
virtual void std_spectral_base()
Sets the standard spectal bases of decomposition for each component.
Definition: tensor.C:935
int spectral_filter
Spectral exponential filtering order.