LORENE
hot_strot_diff_cfc_hydro.C
1 /*
2  * Function Hot_star_rot_diff_CFC::hydro_euler
3  *
4  * (see file hot_star_rot_diff_cfc.h for documentation)
5  *
6  */
7 
8 /*
9  * Copyright (c) 2025 Santiago Jaraba
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 // C headers
31 #include <cstdlib>
32 
33 // Lorene headers
34 #include "hot_star_rot_diff_cfc.h"
35 #include "utilitaires.h"
36 
37 namespace Lorene {
39 
40  // u_euler (fluid 3-velocity w.r.t. the Eulerian frame)
41  // -----------------------------------------------------
42 
43 
46 
47  u_euler.set(3) = omega_field ;
49  u_euler.set(3).mult_rsint() ;
50  u_euler.set(3) += beta(3) ;
51 
52  u_euler = u_euler / nn ;
53 
54  // v2 (square of the norm of u_euler)
55  // ----------------------------------
56 
57  v2 = contract(contract(gamma.cov(), 0, u_euler, 0), 0, u_euler, 0) ;
58 
59 
60  // gam_euler (Lorentz factor between the fluid and Eulerian observers)
61  // -------------------------------------------------------------------
62 
63  gam_euler = 1. / sqrt(1. - v2) ;
64 
66 
67 
68  // ener_euler (energy density w.r.t. the Eulerian observer)
69  // ------------------------------------------------------
70 
72 
74  if (spectral_filter > 0) {
76  }
77  // j_euler (momentum density 3-vector w.r.t. the Eulerian observer)
78  // ----------------------------------------------------------------
79 
82 
83  if (spectral_filter > 0) {
85  }
86 
87  // s_euler (trace of the stress tensor w.r.t. the Eulerian observer)
88  // ----------------------------------------------------------------
89 
90  s_euler = (ener_euler + press)*v2 + 3*press ;
92  if (spectral_filter > 0) {
94  }
95  // stress_euler (stress tensor w.r.t. the Eulerian observer)
96  // ---------------------------------------------------------
97 
98 
101  if (spectral_filter > 0) {
103  }
104 
105  // The derived quantities are obsolete
106  // -----------------------------------
107 
108  del_deriv() ;
109 
110 }
111 }
virtual void del_deriv() const
Deletes all the derived quantities.
Metric gamma
3-metric
Definition: hot_star.h:140
virtual const Sym_tensor & con() const
Read-only access to the contravariant representation.
Definition: metric.C:293
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
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
Scalar ener_euler
Total energy density in the Eulerian frame.
Definition: hot_star.h:103
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
int spectral_filter
Spectral exponential filtering order.
Scalar nn
Lapse function N .
Definition: hot_star.h:130
virtual void std_spectral_base()
Sets the standard spectal bases of decomposition for each component.
Definition: vector.C:322
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
int nzet
Number of domains of *mp occupied by the star.
Definition: hot_star.h:84
Scalar gam_euler
Lorentz factor between the fluid and Eulerian observers.
Definition: hot_star.h:109
Scalar ener
Total energy density in the fluid frame.
Definition: hot_star.h:94
virtual void hydro_euler()
Computes the hydrodynamical quantities relative to the Eulerian observer from those in the fluid fram...
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
Sym_tensor stress_euler
Spatial part of the stress-energy tensor with respect to the Eulerian observer.
Definition: hot_star.h:117
Scalar s_euler
Trace of the stress scalar in the Eulerian frame.
Definition: hot_star.h:106
Scalar & set(int)
Read/write access to a component.
Definition: vector.C:302
Scalar press
Fluid pressure.
Definition: hot_star.h:95
Vector j_euler
Momentum density 3-vector with respect to the Eulerian observer.
virtual void std_spectral_base()
Sets the standard spectal bases of decomposition for each component.
Definition: tensor.C:936
Vector beta
Shift vector.
Definition: hot_star.h:133
Vector u_euler
Fluid 3-velocity with respect to the Eulerian observer.
Definition: hot_star.h:112