et_bin_bhns_extr_hydro.C

00001 /*
00002  *  Methods of the class Et_bin_bhns_extr for computing hydro quantities
00003  *  in the Kerr-Schild background metric or in the conformally flat one
00004  *  with extreme mass ratio
00005  *
00006  *    (see file et_bin_bhns_extr.h for documentation).
00007  *
00008  */
00009 
00010 /*
00011  *   Copyright (c) 2004-2005 Keisuke Taniguchi
00012  *
00013  *   This file is part of LORENE.
00014  *
00015  *   LORENE is free software; you can redistribute it and/or modify
00016  *   it under the terms of the GNU General Public License version 2
00017  *   as published by the Free Software Foundation.
00018  *
00019  *   LORENE is distributed in the hope that it will be useful,
00020  *   but WITHOUT ANY WARRANTY; without even the implied warranty of
00021  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00022  *   GNU General Public License for more details.
00023  *
00024  *   You should have received a copy of the GNU General Public License
00025  *   along with LORENE; if not, write to the Free Software
00026  *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00027  *
00028  */
00029 
00030 char et_bin_bhns_extr_hydro_C[] = "$Header: /cvsroot/Lorene/C++/Source/Etoile/et_bin_bhns_extr_hydro.C,v 1.2 2005/02/28 23:14:16 k_taniguchi Exp $" ;
00031 
00032 /*
00033  * $Id: et_bin_bhns_extr_hydro.C,v 1.2 2005/02/28 23:14:16 k_taniguchi Exp $
00034  * $Log: et_bin_bhns_extr_hydro.C,v $
00035  * Revision 1.2  2005/02/28 23:14:16  k_taniguchi
00036  * Modification to include the case of the conformally flat background metric
00037  *
00038  * Revision 1.1  2004/11/30 20:49:34  k_taniguchi
00039  * *** empty log message ***
00040  *
00041  *
00042  * $Header: /cvsroot/Lorene/C++/Source/Etoile/et_bin_bhns_extr_hydro.C,v 1.2 2005/02/28 23:14:16 k_taniguchi Exp $
00043  *
00044  */
00045 
00046 // Lorene headers
00047 #include "et_bin_bhns_extr.h"
00048 #include "etoile.h"
00049 #include "coord.h"
00050 #include "unites.h"
00051 
00052 void Et_bin_bhns_extr::hydro_euler_extr(const double& mass,
00053                     const double& sepa) {
00054 
00055   using namespace Unites ;
00056 
00057     if (kerrschild) {
00058 
00059         int nz = mp.get_mg()->get_nzone() ;
00060     int nzm1 = nz - 1 ;
00061 
00062     //--------------------------------
00063     // Specific relativistic enthalpy           ---> hhh
00064     //--------------------------------
00065 
00066     Tenseur hhh = exp(unsurc2 * ent) ;  // = 1 at the Newtonian limit
00067     hhh.set_std_base() ;
00068 
00069     //----------------------------------------
00070     // Lorentz factor between the co-orbiting             ---> gam0
00071     // observer and the Eulerian one
00072     //----------------------------------------
00073 
00074     const Coord& xx = mp.x ;
00075     const Coord& yy = mp.y ;
00076     const Coord& zz = mp.z ;
00077 
00078     Tenseur r_bh(mp) ;
00079     r_bh.set_etat_qcq() ;
00080     r_bh.set() = pow( (xx+sepa)*(xx+sepa) + yy*yy + zz*zz, 0.5) ;
00081     r_bh.set_std_base() ;
00082 
00083     Tenseur xx_cov(mp, 1, COV, ref_triad) ;
00084     xx_cov.set_etat_qcq() ;
00085     xx_cov.set(0) = xx + sepa ;
00086     xx_cov.set(1) = yy ;
00087     xx_cov.set(2) = zz ;
00088     xx_cov.set_std_base() ;
00089 
00090     Tenseur xsr_cov(mp, 1, COV, ref_triad) ;
00091     xsr_cov = xx_cov / r_bh ;
00092     xsr_cov.set_std_base() ;
00093 
00094     Tenseur msr(mp) ;
00095     msr = ggrav * mass / r_bh ;
00096     msr.set_std_base() ;
00097 
00098     Tenseur tmp1(mp) ;
00099     tmp1.set_etat_qcq() ;
00100     tmp1.set() = 0 ;
00101     tmp1.set_std_base() ;
00102 
00103     for (int i=0; i<3; i++)
00104         tmp1.set() += xsr_cov(i) % bsn(i) ;
00105 
00106     tmp1.set_std_base() ;
00107 
00108     Tenseur tmp2 = 2.*msr % tmp1 % tmp1 ;
00109     tmp2.set_std_base() ;
00110 
00111     for (int i=0; i<3; i++)
00112         tmp2.set() += bsn(i) % bsn(i) ;
00113 
00114     tmp2 = a_car % tmp2 ;
00115 
00116     Tenseur gam0 = 1 / sqrt( 1 - unsurc2*tmp2 ) ;
00117     gam0.set_std_base() ;
00118 
00119     //--------------------------------------------
00120     // Lorentz factor and 3-velocity of the fluid
00121     //  with respect to the Eulerian observer
00122     //--------------------------------------------
00123 
00124     if (irrotational) {
00125 
00126         d_psi.set_std_base() ;
00127 
00128         Tenseur xx_con(mp, 1, CON, ref_triad) ;
00129         xx_con.set_etat_qcq() ;
00130         xx_con.set(0) = xx + sepa ;
00131         xx_con.set(1) = yy ;
00132         xx_con.set(2) = zz ;
00133         xx_con.set_std_base() ;
00134 
00135         Tenseur xsr_con(mp, 1, CON, ref_triad) ;
00136         xsr_con = xx_con / r_bh ;
00137         xsr_con.set_std_base() ;
00138 
00139         Tenseur tmp3(mp) ;
00140         tmp3.set_etat_qcq() ;
00141         tmp3.set() = 0 ;
00142         tmp3.set_std_base() ;
00143 
00144         for (int i=0; i<3; i++)
00145             tmp3.set() += xsr_con(i) % d_psi(i) ;
00146 
00147         tmp3.set_std_base() ;
00148 
00149         Tenseur tmp4 = -2.*msr % tmp3 % tmp3 / (1.+2.*msr) ;
00150         tmp4.set_std_base() ;
00151 
00152         for (int i=0; i<3; i++)
00153             tmp4.set() += d_psi(i) % d_psi(i) ;
00154 
00155         tmp4 = tmp4 / a_car ;
00156 
00157         gam_euler = sqrt( 1 + unsurc2 * tmp4 / (hhh%hhh) ) ;
00158 
00159         gam_euler.set_std_base() ;  // sets the standard spectral bases
00160                                     // for a scalar field
00161 
00162         Tenseur vtmp1 = d_psi / ( hhh % gam_euler % a_car ) ;
00163                     // COV (a_car correction) -> CON
00164         Tenseur vtmp2 = -2.* msr % tmp3 % xsr_con / (1.+2.*msr)
00165           / ( hhh % gam_euler % a_car ) ;
00166                     // CON
00167 
00168         // The assignment of u_euler is performed component by component
00169         //  because u_euler is contravariant and d_psi is covariant
00170         if (vtmp1.get_etat() == ETATZERO) {
00171             u_euler.set_etat_zero() ;
00172         }
00173         else {
00174             assert(vtmp1.get_etat() == ETATQCQ) ;
00175         u_euler.set_etat_qcq() ;
00176         for (int i=0; i<3; i++) {
00177             u_euler.set(i) = vtmp1(i) + vtmp2(i) ;
00178         }
00179         u_euler.set_triad( *(vtmp1.get_triad()) ) ;
00180         }
00181 
00182         u_euler.set_std_base() ;
00183 
00184     }
00185     else {          // Rigid rotation
00186                     // --------------
00187 
00188         gam_euler = gam0 ;
00189         gam_euler.set_std_base() ;  // sets the standard spectral bases
00190                                     // for a scalar field
00191 
00192         u_euler = - bsn ;
00193 
00194     }
00195 
00196     //--------------------------------------------------------
00197     // Energy density E with respect to the Eulerian observer
00198     //--------------------------------------------------------
00199 
00200     ener_euler = gam_euler % gam_euler % ( ener + press ) - press ;
00201 
00202     //------------------------------------------------------------------
00203     // Trace of the stress tensor with respect to the Eulerian observer
00204     //------------------------------------------------------------------
00205 
00206     Tenseur stmp1(mp) ;
00207     stmp1.set_etat_qcq() ;
00208     stmp1.set() = 0 ;
00209     stmp1.set_std_base() ;
00210 
00211     for (int i=0; i<3; i++)
00212         stmp1.set() += xsr_cov(i) % u_euler(i) ;
00213 
00214     stmp1.set_std_base() ;
00215 
00216     Tenseur stmp2 = 2.*msr % stmp1 % stmp1 ;
00217     stmp2.set_std_base() ;
00218 
00219     for (int i=0; i<3; i++)
00220         stmp2.set() += u_euler(i) % u_euler(i) ;
00221 
00222     stmp2 = a_car % stmp2 ;
00223 
00224     s_euler = 3 * press + ( ener_euler + press ) * stmp2 ;
00225     s_euler.set_std_base() ;
00226 
00227     //--------------------------------------
00228     // Lorentz factor between the fluid and     ---> gam
00229     //  co-orbiting observers
00230     //--------------------------------------
00231 
00232     Tenseur gtmp = 2.*msr % tmp1 % stmp1 ;  //<- bsn^i = - U_0^i
00233     gtmp.set_std_base() ;
00234 
00235     for (int i=0; i<3; i++)
00236         gtmp.set() += bsn(i) % u_euler(i) ; //<- bsn^i = - U_0^i
00237 
00238     gtmp = a_car % gtmp ;
00239 
00240     Tenseur tmp = ( 1+unsurc2*gtmp ) ; //<- (minus->plus) because of U_0^i
00241     tmp.set_std_base() ;
00242     Tenseur gam = gam0 % gam_euler % tmp ;
00243 
00244     //--------------------------------------------
00245     // Spatial projection of the fluid 3-velocity
00246     //  with respect to the co-orbiting observer
00247     //--------------------------------------------
00248 
00249     wit_w = gam_euler / gam % u_euler + gam0 % bsn ;
00250 
00251     wit_w.set_std_base() ;  // set the bases for spectral expansions
00252 
00253     wit_w.annule(nzm1) ;    // zero in the ZEC
00254 
00255     //-----------------------------------------
00256     // Logarithm of the Lorentz factor between
00257     //  the fluid and co-orbiting observers
00258     //-----------------------------------------
00259 
00260     if (relativistic) {
00261 
00262         loggam = log( gam ) ;
00263         loggam.set_std_base() ;   // set the bases for spectral expansions
00264 
00265     }
00266     else {
00267         cout << "BH-NS binary systems should be relativistic !!!" << endl ;
00268         abort() ;
00269     }
00270 
00271     //-------------------------------------------------
00272     // Velocity fields set to zero in external domains
00273     //-------------------------------------------------
00274 
00275     loggam.annule(nzm1) ;       // zero in the ZEC only
00276 
00277     wit_w.annule(nzm1) ;        // zero outside the star
00278 
00279     u_euler.annule(nzm1) ;      // zero outside the star
00280 
00281     if (loggam.get_etat() != ETATZERO) {
00282         (loggam.set()).set_dzpuis(0) ;
00283     }
00284 
00285     if (!irrotational) {
00286 
00287         gam = 1 ;
00288         loggam = 0 ;
00289         wit_w = 0 ;
00290 
00291     }
00292 
00293     // The derived quantities are obsolete
00294     // -----------------------------------
00295 
00296     Etoile_bin::del_deriv() ;
00297 
00298     }
00299     else {
00300 
00301         int nz = mp.get_mg()->get_nzone() ;
00302     int nzm1 = nz - 1 ;
00303 
00304     //--------------------------------
00305     // Specific relativistic enthalpy           ---> hhh
00306     //--------------------------------
00307 
00308     Tenseur hhh = exp(unsurc2 * ent) ;  // = 1 at the Newtonian limit
00309     hhh.set_std_base() ;
00310 
00311     //----------------------------------------
00312     // Lorentz factor between the co-orbiting             ---> gam0
00313     // observer and the Eulerian one
00314     //----------------------------------------
00315 
00316     Tenseur gam0 = 1 / sqrt( 1 - unsurc2*sprod(bsn, bsn) ) ;
00317     gam0.set_std_base() ;
00318 
00319     //--------------------------------------------
00320     // Lorentz factor and 3-velocity of the fluid
00321     //  with respect to the Eulerian observer
00322     //--------------------------------------------
00323 
00324     if (irrotational) {
00325 
00326         d_psi.set_std_base() ;
00327 
00328         gam_euler = sqrt( 1 + unsurc2 * sprod(d_psi, d_psi)
00329                   / (hhh%hhh) ) ;
00330 
00331         gam_euler.set_std_base() ;  // sets the standard spectral bases
00332                                     // for a scalar field
00333 
00334         Tenseur vtmp = d_psi / ( hhh % gam_euler % a_car ) ;
00335                     // COV (a_car correction) -> CON
00336 
00337         // The assignment of u_euler is performed component by component
00338         //  because u_euler is contravariant and d_psi is covariant
00339         if (vtmp.get_etat() == ETATZERO) {
00340             u_euler.set_etat_zero() ;
00341         }
00342         else {
00343             assert(vtmp.get_etat() == ETATQCQ) ;
00344         u_euler.set_etat_qcq() ;
00345         for (int i=0; i<3; i++) {
00346             u_euler.set(i) = vtmp(i) ;
00347         }
00348         u_euler.set_triad( *(vtmp.get_triad()) ) ;
00349         }
00350 
00351         u_euler.set_std_base() ;
00352 
00353     }
00354     else {          // Rigid rotation
00355                     // --------------
00356 
00357         gam_euler = gam0 ;
00358         gam_euler.set_std_base() ;  // sets the standard spectral bases
00359                                     // for a scalar field
00360 
00361         u_euler = - bsn ;
00362 
00363     }
00364 
00365     //--------------------------------------------------------
00366     // Energy density E with respect to the Eulerian observer
00367     //--------------------------------------------------------
00368 
00369     ener_euler = gam_euler % gam_euler % ( ener + press ) - press ;
00370 
00371     //------------------------------------------------------------------
00372     // Trace of the stress tensor with respect to the Eulerian observer
00373     //------------------------------------------------------------------
00374 
00375     s_euler = 3 * press + ( ener_euler + press )
00376       * sprod(u_euler, u_euler) ;
00377     s_euler.set_std_base() ;
00378 
00379     //--------------------------------------
00380     // Lorentz factor between the fluid and     ---> gam
00381     //  co-orbiting observers
00382     //--------------------------------------
00383 
00384     Tenseur tmp = ( 1+unsurc2*sprod(bsn, u_euler) ) ;
00385                                     //<- (minus->plus) because of U_0^i
00386     tmp.set_std_base() ;
00387     Tenseur gam = gam0 % gam_euler % tmp ;
00388 
00389     //--------------------------------------------
00390     // Spatial projection of the fluid 3-velocity
00391     //  with respect to the co-orbiting observer
00392     //--------------------------------------------
00393 
00394     wit_w = gam_euler / gam % u_euler + gam0 % bsn ;
00395 
00396     wit_w.set_std_base() ;  // set the bases for spectral expansions
00397 
00398     wit_w.annule(nzm1) ;    // zero in the ZEC
00399 
00400     //-----------------------------------------
00401     // Logarithm of the Lorentz factor between
00402     //  the fluid and co-orbiting observers
00403     //-----------------------------------------
00404 
00405     if (relativistic) {
00406 
00407         loggam = log( gam ) ;
00408         loggam.set_std_base() ;  // set the bases for spectral expansions
00409 
00410     }
00411     else {
00412         cout << "BH-NS binary systems should be relativistic !!!" << endl ;
00413         abort() ;
00414     }
00415 
00416     //-------------------------------------------------
00417     // Velocity fields set to zero in external domains
00418     //-------------------------------------------------
00419 
00420     loggam.annule(nzm1) ;       // zero in the ZEC only
00421 
00422     wit_w.annule(nzm1) ;        // zero outside the star
00423 
00424     u_euler.annule(nzm1) ;      // zero outside the star
00425 
00426     if (loggam.get_etat() != ETATZERO) {
00427         (loggam.set()).set_dzpuis(0) ;
00428     }
00429 
00430     if (!irrotational) {
00431 
00432         gam = 1 ;
00433         loggam = 0 ;
00434         wit_w = 0 ;
00435 
00436     }
00437 
00438     // The derived quantities are obsolete
00439     // -----------------------------------
00440 
00441     Etoile_bin::del_deriv() ;
00442 
00443     }
00444 
00445 }

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