| 1 |
/* |
| 2 |
* Method Star_rot::hydro_euler |
| 3 |
* |
| 4 |
* (see file star_rot.h for documentation) |
| 5 |
* |
| 6 |
*/ |
| 7 |
|
| 8 |
/* |
| 9 |
* Copyright (c) 2010 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 star_rot_hydro_C[] = "$Header: /cvsroot/Lorene/C++/Source/Star/star_rot_hydro.C,v 1.3 2014/10/13 08:53:39 j_novak Exp $" ; |
| 31 |
|
| 32 |
/* |
| 33 |
* $Id: star_rot_hydro.C,v 1.3 2014/10/13 08:53:39 j_novak Exp $ |
| 34 |
* $Log: star_rot_hydro.C,v $ |
| 35 |
* Revision 1.3 2014/10/13 08:53:39 j_novak |
| 36 |
* Lorene classes and functions now belong to the namespace Lorene. |
| 37 |
* |
| 38 |
* Revision 1.2 2014/10/06 15:13:17 j_novak |
| 39 |
* Modified #include directives to use c++ syntax. |
| 40 |
* |
| 41 |
* Revision 1.1 2010/01/25 18:15:52 e_gourgoulhon |
| 42 |
* First version. |
| 43 |
* |
| 44 |
* |
| 45 |
* $Header: /cvsroot/Lorene/C++/Source/Star/star_rot_hydro.C,v 1.3 2014/10/13 08:53:39 j_novak Exp $ |
| 46 |
* |
| 47 |
*/ |
| 48 |
|
| 49 |
// Headers C |
| 50 |
#include <cstdlib> |
| 51 |
|
| 52 |
// Headers Lorene |
| 53 |
#include "star_rot.h" |
| 54 |
#include "utilitaires.h" |
| 55 |
|
| 56 |
namespace Lorene { |
| 57 |
void Star_rot::hydro_euler(){ |
| 58 |
|
| 59 |
int nz = mp.get_mg()->get_nzone() ; |
| 60 |
int nzm1 = nz - 1 ; |
| 61 |
|
| 62 |
// Computation of u_euler |
| 63 |
// ---------------------- |
| 64 |
|
| 65 |
const Coord& x = mp.x ; |
| 66 |
const Coord& y = mp.y ; |
| 67 |
|
| 68 |
u_euler.set_etat_qcq() ; |
| 69 |
|
| 70 |
u_euler.set(1) = - omega * y ; // Cartesian components of solid rotation |
| 71 |
u_euler.set(2) = omega * x ; |
| 72 |
u_euler.set(3) = 0 ; |
| 73 |
u_euler.annule_domain(nzm1) ; |
| 74 |
|
| 75 |
u_euler.set_triad( mp.get_bvect_cart() ) ; // Triad = Cartesian triad |
| 76 |
|
| 77 |
u_euler = ( u_euler + beta ) / nn ; |
| 78 |
|
| 79 |
u_euler.std_spectral_base() ; // sets the standard bases for spectral expansions |
| 80 |
|
| 81 |
if ( (u_euler(1).get_etat() == ETATZERO) && |
| 82 |
(u_euler(2).get_etat() == ETATZERO) && |
| 83 |
(u_euler(3).get_etat() == ETATZERO) ) { |
| 84 |
|
| 85 |
u_euler.set_etat_zero() ; |
| 86 |
} |
| 87 |
|
| 88 |
|
| 89 |
// Computation of uuu (norme of u_euler) |
| 90 |
// ------------------ |
| 91 |
|
| 92 |
// The scalar product is performed on the spherical components: |
| 93 |
|
| 94 |
Vector us = u_euler ; |
| 95 |
us.change_triad( mp.get_bvect_spher() ) ; |
| 96 |
|
| 97 |
Scalar uuu2 = a_car * ( us(1)*us(1) + us(2)*us(2) ) + b_car * us(3)*us(3) ; |
| 98 |
|
| 99 |
uuu = sqrt( uuu2 ) ; |
| 100 |
|
| 101 |
if (uuu.get_etat() == ETATQCQ) { |
| 102 |
// Same basis as (Omega -N^phi) r sin(theta) |
| 103 |
(uuu.set_spectral_va()).set_base( us(3).get_spectral_va().get_base() ) ; |
| 104 |
} |
| 105 |
|
| 106 |
// Lorentz factor |
| 107 |
// -------------- |
| 108 |
|
| 109 |
Scalar u2 = unsurc2 * uuu2 ; |
| 110 |
|
| 111 |
Scalar gam2 = double(1) / (double(1) - u2) ; |
| 112 |
|
| 113 |
gam_euler = sqrt(gam2) ; |
| 114 |
|
| 115 |
gam_euler.std_spectral_base() ; // sets the standard spectral bases for |
| 116 |
// a scalar field |
| 117 |
|
| 118 |
// Energy density E with respect to the Eulerian observer |
| 119 |
//-------------------------------------------------------- |
| 120 |
|
| 121 |
ener_euler = gam2 * ( ener + press ) - press ; |
| 122 |
|
| 123 |
// Trace of the stress tensor with respect to the Eulerian observer |
| 124 |
//------------------------------------ |
| 125 |
|
| 126 |
s_euler = 3 * press + ( ener_euler + press ) * u2 ; |
| 127 |
|
| 128 |
// The derived quantities are obsolete |
| 129 |
// ----------------------------------- |
| 130 |
|
| 131 |
del_deriv() ; |
| 132 |
|
| 133 |
} |
| 134 |
} |