star_bhns_hydro.C

00001 /*
00002  *  Method of class Star_bhns to compute hydro quantities
00003  *
00004  *    (see file star_bhns.h for documentation).
00005  *
00006  */
00007 
00008 /*
00009  *   Copyright (c) 2005 Keisuke Taniguchi
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 version 2
00015  *   as published by the Free Software Foundation.
00016  *
00017  *   LORENE is distributed in the hope that it will be useful,
00018  *   but WITHOUT ANY WARRANTY; without even the implied warranty of
00019  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00020  *   GNU General Public License for more details.
00021  *
00022  *   You should have received a copy of the GNU General Public License
00023  *   along with LORENE; if not, write to the Free Software
00024  *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00025  *
00026  */
00027 
00028 char star_bhns_hydro_C[] = "$Header: /cvsroot/Lorene/C++/Source/Star_bhns/star_bhns_hydro.C,v 1.1 2007/06/22 01:31:42 k_taniguchi Exp $" ;
00029 
00030 /*
00031  * $Id: star_bhns_hydro.C,v 1.1 2007/06/22 01:31:42 k_taniguchi Exp $
00032  * $Log: star_bhns_hydro.C,v $
00033  * Revision 1.1  2007/06/22 01:31:42  k_taniguchi
00034  * *** empty log message ***
00035  *
00036  *
00037  * $Header: /cvsroot/Lorene/C++/Source/Star_bhns/star_bhns_hydro.C,v 1.1 2007/06/22 01:31:42 k_taniguchi Exp $
00038  *
00039  */
00040 
00041 // C++ headers
00042 //#include <>
00043 
00044 // C headers
00045 #include <math.h>
00046 
00047 // Lorene headers
00048 #include "star_bhns.h"
00049 #include "utilitaires.h"
00050 #include "unites.h"
00051 
00052 void Star_bhns::hydro_euler_bhns(bool kerrschild, const double& mass_bh,
00053                  const double& sepa) {
00054 
00055     // Fundamental constants and units
00056     // -------------------------------
00057     using namespace Unites ;
00058 
00059     int nz = mp.get_mg()->get_nzone() ;
00060     int nzm1 = nz - 1 ;
00061 
00062     //--------------------------------
00063     // Specific relativistic enthalpy          ---> hhh
00064     //--------------------------------
00065 
00066     Scalar hhh = exp(ent) ;  // = 1 at the Newtonian limit
00067     hhh.std_spectral_base() ;
00068 
00069     if (kerrschild) {
00070 
00071         double mass = ggrav * mass_bh ;
00072 
00073     Scalar xx(mp) ;
00074     xx = mp.x ;
00075     xx.std_spectral_base() ;
00076     Scalar yy(mp) ;
00077     yy = mp.y ;
00078     yy.std_spectral_base() ;
00079     Scalar zz(mp) ;
00080     zz = mp.z ;
00081     zz.std_spectral_base() ;
00082 
00083     double yns = mp.get_ori_y() ;
00084 
00085     Scalar rbh(mp) ;
00086     rbh = sqrt( (xx+sepa)*(xx+sepa) + (yy+yns)*(yy+yns) + zz*zz ) ;
00087     rbh.std_spectral_base() ;
00088 
00089     Vector ll(mp, CON, mp.get_bvect_cart()) ;
00090     ll.set_etat_qcq() ;
00091     ll.set(1) = (xx+sepa) / rbh ;
00092     ll.set(2) = (yy+yns) / rbh ;
00093     ll.set(3) = zz / rbh ;
00094     ll.std_spectral_base() ;
00095 
00096     Scalar msr(mp) ;
00097     msr = mass / rbh ;
00098     msr.std_spectral_base() ;
00099 
00100     //--------------------------------------------
00101     // Lorentz factor and 3-velocity of the fluid
00102     //  with respect to the Eulerian observer
00103     //--------------------------------------------
00104 
00105     if (irrotational) {
00106 
00107         d_psi.std_spectral_base() ;
00108 
00109         Scalar dpsi2(mp) ;
00110         dpsi2 = d_psi(1)%d_psi(1) + d_psi(2)%d_psi(2)
00111           + d_psi(3)%d_psi(3) ;
00112         dpsi2.std_spectral_base() ;
00113 
00114         Scalar lldpsi(mp) ;
00115         lldpsi = ll(1)%d_psi(1) + ll(2)%d_psi(2) + ll(3)%d_psi(3) ;
00116         lldpsi.std_spectral_base() ;
00117 
00118         Scalar lap_bh2(mp) ;
00119         lap_bh2 = 1. / (1.+2.*msr) ;
00120         lap_bh2.std_spectral_base() ;
00121 
00122         Scalar tmp1(mp) ;
00123         tmp1 = 2. * msr % lap_bh2 % lldpsi % lldpsi ;
00124         tmp1.std_spectral_base() ;
00125 
00126         gam_euler = sqrt( 1.+(dpsi2-tmp1)/(hhh%hhh)/psi4 ) ;
00127         gam_euler.std_spectral_base() ;
00128 
00129         u_euler.set_etat_qcq() ;
00130         assert( u_euler.get_triad() == bsn.get_triad() ) ;
00131 
00132         for (int i=1; i<=3; i++)
00133           u_euler.set(i) = (d_psi(i)-2.*msr%lap_bh2%lldpsi%ll(i))
00134         / (hhh % gam_euler) / psi4 ;
00135 
00136         u_euler.std_spectral_base() ;
00137 
00138     }
00139     else {
00140 
00141         // Rigid rotation
00142         // --------------
00143 
00144         gam_euler = gam0 ;
00145         gam_euler.std_spectral_base() ;
00146         u_euler = bsn ;
00147 
00148     }
00149 
00150     //--------------------------------------------------------
00151     // Energy density E with respect to the Eulerian observer
00152     // See Eq (53) from Gourgoulhon et al. (2001)
00153     //--------------------------------------------------------
00154 
00155     ener_euler = gam_euler % gam_euler % (ener + press) - press ;
00156     ener_euler.std_spectral_base() ;
00157 
00158     //---------------------------------------------------
00159     // Trace of the stress-energy tensor with respect to
00160     // the Eulerian observer
00161     // See Eq (54) from Gourgoulhon et al. (2001)
00162     //---------------------------------------------------
00163 
00164     Scalar ueuler2(mp) ;
00165     ueuler2 = u_euler(1)%u_euler(1) + u_euler(2)%u_euler(2)
00166       + u_euler(3)%u_euler(3) ;
00167     ueuler2.std_spectral_base() ;
00168 
00169     Scalar llueuler(mp) ;
00170     llueuler = ll(1)%u_euler(1) + ll(2)%u_euler(2) + ll(3)%u_euler(3) ;
00171     llueuler.std_spectral_base() ;
00172 
00173     s_euler = 3. * press + (ener_euler + press) * psi4
00174       * (ueuler2 + 2.*msr%llueuler%llueuler) ;
00175     s_euler.std_spectral_base() ;
00176 
00177     //--------------------------------------------
00178     // Lorentz factor between the fluid and        ---> gam
00179     //  co-orbiting observers
00180     // See Eq (58) from Gourgoulhon et al. (2001)
00181     //--------------------------------------------
00182 
00183     if (irrotational) {
00184 
00185         Scalar bsnueuler(mp) ;
00186         bsnueuler = bsn(1)%u_euler(1) + bsn(2)%u_euler(2)
00187           + bsn(3)%u_euler(3) ;
00188         bsnueuler.std_spectral_base() ;
00189 
00190         Scalar llbsn(mp) ;
00191         llbsn = ll(1)%bsn(1) + ll(2)%bsn(2) + ll(3)%bsn(3) ;
00192         llbsn.std_spectral_base() ;
00193 
00194         Scalar tmp2(mp) ;
00195         tmp2 = 1. - psi4 * (bsnueuler + 2.*msr%llueuler%llbsn) ;
00196         tmp2.std_spectral_base() ;
00197 
00198         gam = gam0 % gam_euler % tmp2 ;
00199         gam.std_spectral_base() ;
00200 
00201         //--------------------------------------------
00202         // Spetial projection of the fluid 3-velocity
00203         // with respect to the co-orbiting observer
00204         //--------------------------------------------
00205 
00206         wit_w = gam_euler / gam * u_euler - gam0 * bsn ;
00207         wit_w.std_spectral_base() ;
00208         wit_w.annule_domain(nzm1) ;
00209 
00210         //-----------------------------------------
00211         // Logarithm of the Lorentz factor between
00212         // the fluid and co-orbiting observer
00213         //-----------------------------------------
00214 
00215         loggam = log( gam ) ;
00216         loggam.std_spectral_base() ;
00217 
00218         //-------------------------------------------------
00219         // Velocity fields set to zero in external domains
00220         //-------------------------------------------------
00221 
00222         loggam.annule_domain(nzm1) ;
00223         wit_w.annule_domain(nzm1) ;
00224         u_euler.annule_domain(nzm1) ;
00225 
00226         loggam.set_dzpuis(0) ;
00227 
00228     }
00229     else {  // Rigid rotation
00230 
00231         gam = 1. ;
00232         gam.std_spectral_base() ;
00233         loggam = 0. ;
00234         wit_w.set_etat_zero() ;
00235 
00236     }
00237 
00238     }  // End of Kerr-Schild
00239     else {  // Isotropic coordinates with the maximal slicing
00240 
00241     //--------------------------------------------
00242     // Lorentz factor and 3-velocity of the fluid
00243     //  with respect to the Eulerian observer
00244     //--------------------------------------------
00245 
00246     if (irrotational) {
00247 
00248         d_psi.std_spectral_base() ;
00249 
00250         Scalar dpsi2(mp) ;
00251         dpsi2 = d_psi(1)%d_psi(1) + d_psi(2)%d_psi(2)
00252           + d_psi(3)%d_psi(3) ;
00253         dpsi2.std_spectral_base() ;
00254 
00255         gam_euler = sqrt( 1. + dpsi2/(hhh%hhh)/psi4 ) ;
00256         gam_euler.std_spectral_base() ;
00257 
00258         u_euler.set_etat_qcq() ;
00259         for (int i=1; i<=3; i++)
00260           u_euler.set(i) = d_psi(i)/(hhh%gam_euler)/psi4 ;
00261 
00262         u_euler.std_spectral_base() ;
00263 
00264     }
00265     else {
00266 
00267         // Rigid rotation
00268         // --------------
00269 
00270         gam_euler = gam0 ;
00271         gam_euler.std_spectral_base() ;
00272         u_euler = bsn ;
00273 
00274     }
00275 
00276     //--------------------------------------------------------
00277     // Energy density E with respect to the Eulerian observer
00278     // See Eq (53) from Gourgoulhon et al. (2001)
00279     //--------------------------------------------------------
00280 
00281     ener_euler = gam_euler % gam_euler % (ener + press) - press ;
00282     ener_euler.std_spectral_base() ;
00283 
00284     //---------------------------------------------------
00285     // Trace of the stress-energy tensor with respect to
00286     // the Eulerian observer
00287     // See Eq (54) from Gourgoulhon et al. (2001)
00288     //---------------------------------------------------
00289 
00290     Scalar ueuler2(mp) ;
00291     ueuler2 = u_euler(1)%u_euler(1) + u_euler(2)%u_euler(2)
00292       + u_euler(3)%u_euler(3) ;
00293     ueuler2.std_spectral_base() ;
00294 
00295     s_euler = 3.*press + (ener_euler+press)*psi4*ueuler2 ;
00296     s_euler.std_spectral_base() ;
00297 
00298 
00299     //--------------------------------------------
00300     // Lorentz factor between the fluid and        ---> gam
00301     //  co-orbiting observers
00302     // See Eq (58) from Gourgoulhon et al. (2001)
00303     //--------------------------------------------
00304 
00305     if (irrotational) {
00306 
00307         Scalar bsnueuler(mp) ;
00308         bsnueuler = bsn(1)%u_euler(1) + bsn(2)%u_euler(2)
00309           + bsn(3)%u_euler(3) ;
00310         bsnueuler.std_spectral_base() ;
00311 
00312         Scalar tmp3(mp) ;
00313         tmp3 = 1. - psi4 % bsnueuler ;
00314         tmp3.std_spectral_base() ;
00315 
00316         gam = gam0 % gam_euler % tmp3 ;
00317         gam.std_spectral_base() ;
00318 
00319         //--------------------------------------------
00320         // Spetial projection of the fluid 3-velocity
00321         // with respect to the co-orbiting observer
00322         //--------------------------------------------
00323 
00324         wit_w = gam_euler / gam * u_euler - gam0 * bsn ;
00325         wit_w.std_spectral_base() ;
00326         wit_w.annule_domain(nzm1) ;
00327 
00328         //-----------------------------------------
00329         // Logarithm of the Lorentz factor between
00330         // the fluid and co-orbiting observer
00331         //-----------------------------------------
00332 
00333         loggam = log( gam ) ;
00334         loggam.std_spectral_base() ;
00335 
00336         //-------------------------------------------------
00337         // Velocity fields set to zero in external domains
00338         //-------------------------------------------------
00339 
00340         loggam.annule_domain(nzm1) ;
00341         wit_w.annule_domain(nzm1) ;
00342         u_euler.annule_domain(nzm1) ;
00343 
00344         loggam.set_dzpuis(0) ;
00345 
00346     }
00347     else {  // Rigid rotation
00348 
00349         gam = 1. ;
00350         gam.std_spectral_base() ;
00351         loggam = 0. ;
00352         wit_w.set_etat_zero() ;
00353 
00354     }
00355 
00356     }   // End of Isotropic coordinates
00357 
00358     // The derived quantities are obsolete
00359     // -----------------------------------
00360 
00361     del_deriv() ;
00362 
00363 }

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