star_rot_hydro.C

00001 /*
00002  * Method Star_rot::hydro_euler
00003  *
00004  * (see file star_rot.h for documentation)
00005  *
00006  */
00007 
00008 /*
00009  *   Copyright (c) 2010 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 star_rot_hydro_C[] = "$Header: /cvsroot/Lorene/C++/Source/Star/star_rot_hydro.C,v 1.1 2010/01/25 18:15:52 e_gourgoulhon Exp $" ;
00031 
00032 /*
00033  * $Id: star_rot_hydro.C,v 1.1 2010/01/25 18:15:52 e_gourgoulhon Exp $
00034  * $Log: star_rot_hydro.C,v $
00035  * Revision 1.1  2010/01/25 18:15:52  e_gourgoulhon
00036  * First version.
00037  *
00038  *
00039  * $Header: /cvsroot/Lorene/C++/Source/Star/star_rot_hydro.C,v 1.1 2010/01/25 18:15:52 e_gourgoulhon Exp $
00040  *
00041  */
00042 
00043 // Headers C
00044 #include <stdlib.h>
00045 
00046 // Headers Lorene
00047 #include "star_rot.h"
00048 #include "utilitaires.h"
00049 
00050 void Star_rot::hydro_euler(){
00051 
00052     int nz = mp.get_mg()->get_nzone() ; 
00053     int nzm1 = nz - 1 ; 
00054 
00055     // Computation of u_euler
00056     // ----------------------
00057     
00058     const Coord& x = mp.x ; 
00059     const Coord& y = mp.y ; 
00060     
00061     u_euler.set_etat_qcq() ; 
00062     
00063     u_euler.set(1) = - omega * y ;      // Cartesian components of solid rotation
00064     u_euler.set(2) =   omega * x ;
00065     u_euler.set(3) = 0 ;
00066     u_euler.annule_domain(nzm1) ; 
00067     
00068     u_euler.set_triad( mp.get_bvect_cart() ) ;  // Triad = Cartesian triad
00069     
00070     u_euler = ( u_euler + beta ) / nn ; 
00071 
00072     u_euler.std_spectral_base() ;   // sets the standard bases for spectral expansions
00073 
00074     if ( (u_euler(1).get_etat() == ETATZERO) &&
00075      (u_euler(2).get_etat() == ETATZERO) &&
00076      (u_euler(3).get_etat() == ETATZERO) )    {
00077     
00078     u_euler.set_etat_zero() ;    
00079     }
00080 
00081 
00082     // Computation of uuu (norme of u_euler)
00083     // ------------------
00084 
00085     // The scalar product is performed on the spherical components: 
00086 
00087     Vector us = u_euler ; 
00088     us.change_triad( mp.get_bvect_spher() ) ; 
00089 
00090     Scalar uuu2 = a_car * ( us(1)*us(1) + us(2)*us(2) ) + b_car * us(3)*us(3) ; 
00091 
00092     uuu = sqrt( uuu2 ) ; 
00093     
00094     if (uuu.get_etat() == ETATQCQ) {
00095     // Same basis as (Omega -N^phi) r sin(theta)
00096     (uuu.set_spectral_va()).set_base( us(3).get_spectral_va().get_base() ) ;   
00097     }                         
00098 
00099     // Lorentz factor
00100     // --------------
00101     
00102     Scalar u2 = unsurc2 * uuu2 ; 
00103     
00104     Scalar gam2 = double(1) / (double(1) - u2) ; 
00105     
00106     gam_euler = sqrt(gam2) ; 
00107 
00108     gam_euler.std_spectral_base() ; // sets the standard spectral bases for
00109                     // a scalar field
00110 
00111     //  Energy density E with respect to the Eulerian observer
00112     //--------------------------------------------------------
00113     
00114     ener_euler = gam2 * ( ener + press ) - press ; 
00115 
00116     // Trace of the stress tensor with respect to the Eulerian observer
00117     //------------------------------------
00118     
00119     s_euler = 3 * press  +  ( ener_euler + press ) * u2  ;
00120     
00121     // The derived quantities are obsolete
00122     // -----------------------------------
00123     
00124     del_deriv() ;                
00125     
00126 }

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