et_rot_hydro.C

00001 /*
00002  * Function Etoile_rot::hydro_euler
00003  *
00004  * (see file etoile.h for documentation)
00005  *
00006  */
00007 
00008 /*
00009  *   Copyright (c) 2000-2001 Eric Gourgoulhon
00010  *
00011  *   This file is part of LORENE.
00012  *
00013  *   LORENE is free software; you can redistribute it and/or modify
00014  *   it under the terms of the GNU General Public License as published by
00015  *   the Free Software Foundation; either version 2 of the License, or
00016  *   (at your option) any later version.
00017  *
00018  *   LORENE is distributed in the hope that it will be useful,
00019  *   but WITHOUT ANY WARRANTY; without even the implied warranty of
00020  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00021  *   GNU General Public License for more details.
00022  *
00023  *   You should have received a copy of the GNU General Public License
00024  *   along with LORENE; if not, write to the Free Software
00025  *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00026  *
00027  */
00028 
00029 
00030 char et_rot_hydro_C[] = "$Header: /cvsroot/Lorene/C++/Source/Etoile/et_rot_hydro.C,v 1.2 2006/09/14 07:37:47 j_novak Exp $" ;
00031 
00032 /*
00033  * $Id: et_rot_hydro.C,v 1.2 2006/09/14 07:37:47 j_novak Exp $
00034  * $Log: et_rot_hydro.C,v $
00035  * Revision 1.2  2006/09/14 07:37:47  j_novak
00036  * Removal of a test on u_euler.
00037  *
00038  * Revision 1.1.1.1  2001/11/20 15:19:28  e_gourgoulhon
00039  * LORENE
00040  *
00041  * Revision 2.6  2000/10/12  15:36:06  eric
00042  * Le test sur u_euler est desormais effectue sur la totalite de u_euler
00043  *  (ie comprenant le shift).
00044  *
00045  * Revision 2.5  2000/10/06  15:08:13  eric
00046  * Calcul 3-D de u_euler.
00047  * uuu s'en deduit.
00048  *
00049  * Revision 2.4  2000/08/31  15:38:34  eric
00050  * Appel du nouvel operateur Cmp::mult_rsint pour le calcul de uuu.
00051  *
00052  * Revision 2.3  2000/08/25  12:28:21  eric
00053  * *** empty log message ***
00054  *
00055  * Revision 2.2  2000/08/18  14:01:49  eric
00056  * *** empty log message ***
00057  *
00058  * Revision 2.1  2000/08/17  12:39:56  eric
00059  * *** empty log message ***
00060  *
00061  * Revision 2.0  2000/07/21  16:31:00  eric
00062  * *** empty log message ***
00063  *
00064  *
00065  * $Header: /cvsroot/Lorene/C++/Source/Etoile/et_rot_hydro.C,v 1.2 2006/09/14 07:37:47 j_novak Exp $
00066  *
00067  */
00068 
00069 // Headers C
00070 #include <stdlib.h>
00071 
00072 // Headers Lorene
00073 #include "etoile.h"
00074 #include "utilitaires.h"
00075 
00076 void Etoile_rot::hydro_euler(){
00077 
00078     int nz = mp.get_mg()->get_nzone() ; 
00079     int nzm1 = nz - 1 ; 
00080 
00081     // Computation of u_euler
00082     // ----------------------
00083     
00084     const Coord& x = mp.x ; 
00085     const Coord& y = mp.y ; 
00086     
00087     u_euler.set_etat_qcq() ; 
00088     
00089     u_euler.set(0) = - omega * y ;      // Cartesian components of solid rotation
00090     u_euler.set(1) =   omega * x ;
00091     u_euler.set(2) = 0 ;
00092     u_euler.annule(nzm1) ; 
00093     
00094     u_euler.set_triad( mp.get_bvect_cart() ) ;  // Triad = Cartesian triad
00095     
00096     u_euler.set_std_base() ;    // sets the standard bases for spectral expansions
00097 
00098     u_euler = ( u_euler - shift ) / nnn ; 
00099 
00100     u_euler.set_std_base() ;    // sets the standard bases for spectral expansions
00101 
00102     if ( (u_euler(0).get_etat() == ETATZERO) &&
00103      (u_euler(1).get_etat() == ETATZERO) &&
00104      (u_euler(2).get_etat() == ETATZERO) )    {
00105     
00106     u_euler = 0 ;    
00107     }
00108 
00109 
00110     // Computation of uuu (norme of u_euler)
00111     // ------------------
00112 
00113     // The scalar product is performed on the spherical components: 
00114 
00115     Tenseur us = u_euler ; 
00116     us.change_triad( mp.get_bvect_spher() ) ; 
00117 
00118     Cmp uuu2 =  a_car() * ( us(0) * us(0) + us(1) * us(1) ) 
00119          +  b_car() * us(2) * us(2) ; 
00120 
00121     uuu = sqrt( uuu2 ) ; 
00122     
00123     if (uuu.get_etat() == ETATQCQ) {
00124     ((uuu.set()).va).set_base( us(2).va.base ) ;   // Same basis as 
00125     }                          // (Omega -N^phi) r sin(theta)
00126 
00127 
00128     // Lorentz factor
00129     // --------------
00130     
00131     Tenseur u2(mp) ; 
00132     u2 = unsurc2 * uuu2 ; 
00133     
00134     Tenseur gam2 = 1 / (1 - u2) ; 
00135     
00136     gam_euler = sqrt(gam2) ; 
00137 
00138     gam_euler.set_std_base() ;  // sets the standard spectral bases for
00139                     // a scalar field
00140 
00141     //  Energy density E with respect to the Eulerian observer
00142     //------------------------------------
00143     
00144     ener_euler = gam2 * ( ener + press ) - press ; 
00145 
00146     ener_euler.set_std_base() ; 
00147     
00148     // Trace of the stress tensor with respect to the Eulerian observer
00149     //------------------------------------
00150     
00151     s_euler = 3 * press  +  ( ener_euler + press ) * u2  ;
00152 
00153     s_euler.set_std_base() ; 
00154     
00155     // The derived quantities are obsolete
00156     // -----------------------------------
00157     
00158     del_deriv() ;                
00159     
00160 
00161 }

Generated on Tue Feb 7 01:35:16 2012 for LORENE by  doxygen 1.4.6