00001 /* 00002 * Methods of the class Star_bin for computing hydro quantities 00003 * 00004 * (see file star.h for documentation) 00005 */ 00006 00007 /* 00008 * Copyright (c) 2004 Francois Limousin 00009 * 00010 * This file is part of LORENE. 00011 * 00012 * LORENE is free software; you can redistribute it and/or modify 00013 * it under the terms of the GNU General Public License as published by 00014 * the Free Software Foundation; either version 2 of the License, or 00015 * (at your option) any later version. 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 00029 char star_bin_hydro_C[] = "$Header: /cvsroot/Lorene/C++/Source/Star/star_bin_hydro.C,v 1.7 2005/09/13 19:38:31 f_limousin Exp $" ; 00030 00031 /* 00032 * $Id: star_bin_hydro.C,v 1.7 2005/09/13 19:38:31 f_limousin Exp $ 00033 * $Log: star_bin_hydro.C,v $ 00034 * Revision 1.7 2005/09/13 19:38:31 f_limousin 00035 * Reintroduction of the resolution of the equations in cartesian coordinates. 00036 * 00037 * Revision 1.6 2005/02/11 18:15:16 f_limousin 00038 * Minor modification (to improve the convergence of the code). 00039 * 00040 * Revision 1.5 2004/06/22 12:50:43 f_limousin 00041 * Change qq, qq_auto and qq_comp to beta, beta_auto and beta_comp. 00042 * 00043 * Revision 1.4 2004/04/08 16:34:39 f_limousin 00044 * Changes for irrotationnal binaries. 00045 * 00046 * Revision 1.3 2004/02/27 09:54:48 f_limousin 00047 * Many minor changes. 00048 * 00049 * Revision 1.2 2004/01/20 15:18:31 f_limousin 00050 * First version 00051 * 00052 * 00053 * $Header: /cvsroot/Lorene/C++/Source/Star/star_bin_hydro.C,v 1.7 2005/09/13 19:38:31 f_limousin Exp $ 00054 * 00055 */ 00056 00057 // Headers C 00058 00059 // Headers Lorene 00060 #include "star.h" 00061 00062 void Star_bin::hydro_euler(){ 00063 00064 cout << "loggam 1" << norme(loggam) << endl ; 00065 00066 int nz = mp.get_mg()->get_nzone() ; 00067 int nzm1 = nz - 1 ; 00068 00069 Sym_tensor gamma_cov (gamma.cov()) ; 00070 Sym_tensor gamma_con (gamma.con()) ; 00071 gamma_cov.change_triad(mp.get_bvect_cart()) ; 00072 gamma_con.change_triad(mp.get_bvect_cart()) ; 00073 00074 //---------------------------------- 00075 // Specific relativistic enthalpy ---> hhh 00076 //---------------------------------- 00077 00078 Scalar hhh = exp(ent) ; // = 1 at the Newtonian limit 00079 hhh.std_spectral_base() ; 00080 00081 //--------------------------------------------------- 00082 // Lorentz factor between the co-orbiting ---> gam00 00083 // observer and the Eulerian one 00084 // See Eq (23) and (24) from Gourgoulhon et al. (2001) 00085 //--------------------------------------------------- 00086 00087 Scalar gam0 = 1 / sqrt( 1 - contract(gamma_cov, 0, 1, bsn * bsn, 0, 1)) ; 00088 gam0.std_spectral_base() ; 00089 00090 //------------------------------------------ 00091 // Lorentz factor and 3-velocity of the fluid 00092 // with respect to the Eulerian observer 00093 //------------------------------------------ 00094 00095 if (irrotational) { 00096 00097 d_psi.std_spectral_base() ; 00098 00099 // See Eq (32) from Gourgoulhon et al. (2001) 00100 gam_euler = sqrt( 1 + contract(gamma_con, 0, 1, d_psi * d_psi, 0, 1) 00101 / (hhh%hhh) ) ; 00102 00103 gam_euler.std_spectral_base() ; 00104 00105 u_euler = contract(gamma_con, 0, d_psi, 0)/( hhh % gam_euler ) ; 00106 u_euler.std_spectral_base() ; 00107 00108 } 00109 else { 00110 // Rigid rotation 00111 // -------------- 00112 00113 gam_euler = gam0 ; 00114 gam_euler.std_spectral_base() ; 00115 u_euler = bsn ; 00116 00117 } 00118 00119 //------------------------------------ 00120 // Energy density E with respect to the Eulerian observer 00121 // See Eq (53) from Gourgoulhon et al. (2001) 00122 //------------------------------------ 00123 00124 ener_euler = gam_euler % gam_euler % ( ener + press ) - press ; 00125 00126 //------------------------------------ 00127 // Trace of the stress tensor with respect to the Eulerian observer 00128 // See Eq (54) from Gourgoulhon et al. (2001) 00129 //------------------------------------ 00130 00131 s_euler = 3 * press + ( ener_euler + press ) % 00132 contract(gamma_cov, 0, 1, u_euler * u_euler, 0 ,1) ; 00133 00134 //------------------------------------------- 00135 // Spatial part of the stress-energy tensor with respect 00136 // to the Eulerian observer. 00137 //------------------------------------------- 00138 00139 for(int i=1; i<=3; i++){ 00140 for(int j=1; j<=3; j++){ 00141 stress_euler.set(i,j) = (ener_euler + press )*u_euler(i) 00142 *u_euler(j) + press * gamma_con(i,j) ; 00143 } 00144 } 00145 00146 //------------------------------------------- 00147 // Lorentz factor between the fluid and ---> gam 00148 // co-orbiting observers 00149 // See Eq (58) from Gourgoulhon et al. (2001) 00150 //-------------------------------------------- 00151 00152 if (irrotational) { 00153 00154 Scalar tmp = ( 1 - contract(gamma_cov, 0, 1, bsn * u_euler, 0, 1) ) ; 00155 tmp.std_spectral_base() ; 00156 Scalar gam = gam0 % gam_euler % tmp ; 00157 00158 //------------------------------------------- 00159 // Spatial projection of the fluid 3-velocity 00160 // with respect to the co-orbiting observer 00161 //-------------------------------------------- 00162 00163 wit_w = - gam_euler / gam * u_euler + gam0 * bsn ; 00164 00165 wit_w.std_spectral_base() ; // set the bases for spectral expansions 00166 00167 wit_w.annule_domain(nzm1) ; // zero in the ZEC 00168 00169 00170 //------------------------------------------- 00171 // Logarithm of the Lorentz factor between 00172 // the fluid and co-orbiting observers 00173 //-------------------------------------------- 00174 00175 loggam = log( gam ) ; 00176 00177 loggam.std_spectral_base() ; // set the bases for spectral expansions 00178 00179 //------------------------------------------------- 00180 // Velocity fields set to zero in external domains 00181 //------------------------------------------------- 00182 00183 loggam.annule_domain(nzm1) ; // zero in the ZEC only 00184 00185 wit_w.annule_domain(nzm1) ; // zero outside the star 00186 00187 u_euler.annule_domain(nzm1) ; // zero outside the star 00188 00189 loggam.set_dzpuis(0) ; 00190 } 00191 else { 00192 00193 loggam = 0 ; 00194 wit_w.set_etat_zero() ; 00195 } 00196 00197 // The derived quantities are obsolete 00198 // ----------------------------------- 00199 00200 del_deriv() ; 00201 00202 }
1.4.6