00001 /* 00002 ------------------------------------------------------------------- 00003 00004 Copyright (C) 2006, 2007, 2008, 2009, Andrew W. Steiner 00005 00006 This file is part of O2scl. 00007 00008 O2scl is free software; you can redistribute it and/or modify 00009 it under the terms of the GNU General Public License as published by 00010 the Free Software Foundation; either version 3 of the License, or 00011 (at your option) any later version. 00012 00013 O2scl is distributed in the hope that it will be useful, 00014 but WITHOUT ANY WARRANTY; without even the implied warranty of 00015 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00016 GNU General Public License for more details. 00017 00018 You should have received a copy of the GNU General Public License 00019 along with O2scl. If not, see <http://www.gnu.org/licenses/>. 00020 00021 ------------------------------------------------------------------- 00022 */ 00023 #ifndef O2SCL_NONREL_FERMION_H 00024 #define O2SCL_NONREL_FERMION_H 00025 00026 #include <string> 00027 #include <iostream> 00028 #include <fstream> 00029 #include <cmath> 00030 #include <o2scl/constants.h> 00031 #include <o2scl/mroot.h> 00032 #include <o2scl/inte.h> 00033 #include <o2scl/fermion.h> 00034 #include <o2scl/cern_mroot_root.h> 00035 #include <o2scl/gsl_inte_qagiu.h> 00036 00037 #ifndef DOXYGENP 00038 namespace o2scl { 00039 #endif 00040 00041 /** 00042 \brief Nonrelativistic fermion class 00043 00044 The rest mass energy density is given by n*m not n*ms. Note that 00045 the effective mass here is the Landau mass, not the Dirac mass. 00046 00047 Pressure is computed with 00048 \f[ 00049 P = 2 \varepsilon/3 00050 \f] 00051 and entropy density with 00052 \f[ 00053 s = \frac{5 \varepsilon}{3 T} - \frac{n \mu}{T} 00054 \f] 00055 These relations can be verified with an integration by 00056 parts. See, e.g. Callen's "Thermodynamics and an introduction to 00057 thermostatistics", 2nd edition, pg. 403 or Landau and Lifshitz, 00058 Stat. Phys. 3rd edition, part 1, pg. 164. 00059 00060 \comment 00061 This was in an earlier version and is probably unnecessary. 00062 00063 Note that the energy density integral can be rescaled: 00064 \f[ 00065 \varepsilon = 00066 \frac{T^{5/2}(2 m^{*})^{3/2}}{\pi^2} 00067 \int_0^{\infty} d u \frac{u^{3/2}}{1 + \exp(u-y)} 00068 \f] 00069 where \f$ u = k^2/2/m^{*}/T \f$ and \f$ y=\mu/T \f$. 00070 \endcomment 00071 00072 The functions fermion::pair_density() and pair_mu() have not 00073 been implemented. 00074 00075 \todo Check behaviour of calc_density() at zero density, and 00076 compare with that from eff_fermion, rel_fermion, and \ref 00077 classical. 00078 00079 \todo I think calc_mu_zerot() and calc_density_zerot() are 00080 missing the proper dependence on the degeneracy, \c g. (8/20/07) 00081 (I think this is fixed now, but should be tested, 8/22/07) 00082 00083 \todo Make sure to test with non-interacting equal to 00084 true or false, and document whether or not it works 00085 with both inc_rest_mass equal to true or false 00086 00087 \future This could be improved by performing a Chebyshev 00088 approximation (for example) to invert the density integral so 00089 that we don't need to use a solver. 00090 */ 00091 class nonrel_fermion : public fermion_T { 00092 00093 public: 00094 00095 /// Create a nonrelativistic fermion with mass 'm' and degeneracy 'g' 00096 nonrel_fermion(double m=0.0, double g=0.0); 00097 00098 virtual ~nonrel_fermion(); 00099 00100 /** 00101 \brief Zero temperature fermions 00102 */ 00103 virtual int calc_mu_zerot(); 00104 00105 /** 00106 \brief Zero temperature fermions 00107 */ 00108 virtual int calc_density_zerot(); 00109 00110 /** 00111 \brief Calculate properties as function of chemical potential 00112 */ 00113 virtual int calc_mu(const double temper); 00114 00115 /** \brief Calculate properties as function of density 00116 00117 If the density is zero, this function just sets part::mu, 00118 part::nu, part::ed, part::pr, and part::en to zero and returns 00119 without calling the error handler (even though at 00120 zero density and finite temperature, the chemical potentials 00121 formally are equal to \f$ -\infty \f$). 00122 */ 00123 virtual int calc_density(const double temper); 00124 00125 virtual int pair_mu(const double temper) { 00126 return gsl_eunimpl; 00127 } 00128 00129 virtual int pair_density(const double temper) { 00130 return gsl_eunimpl; 00131 } 00132 00133 /// Calculate effective chemical potential from density 00134 virtual int nu_from_n(const double temper); 00135 00136 /** \brief Set the solver for use in calculating the chemical 00137 potential from the density 00138 */ 00139 int set_density_root(root<double,funct<double> > &rp) { 00140 density_root=&rp; 00141 return 0; 00142 } 00143 00144 /// The default solver for calc_density(). 00145 cern_mroot_root<double,funct<double> > def_density_root; 00146 00147 /// Return string denoting type ("nonrel_fermion") 00148 virtual const char *type() { return "nonrel_fermion"; } 00149 00150 protected: 00151 00152 #ifndef DOXYGENP 00153 00154 friend class io_tlate<nonrel_fermion>; 00155 00156 /// Solver to compute chemical potential from density 00157 root<double,funct<double> > *density_root; 00158 00159 /// Function to compute chemical potential from density 00160 int solve_fun(double x, double &yy, double &T); 00161 00162 private: 00163 00164 nonrel_fermion(const nonrel_fermion &); 00165 nonrel_fermion& operator=(const nonrel_fermion&); 00166 00167 #endif 00168 00169 }; 00170 00171 /// A zero temperature non-relativistic fermion 00172 class nonrel_fermion_zerot : public fermion { 00173 00174 public: 00175 00176 /// Create a nonrelativistic fermion with mass 'm' and degeneracy 'g' 00177 nonrel_fermion_zerot(double m=0.0, double g=0.0); 00178 00179 virtual ~nonrel_fermion_zerot(); 00180 00181 /** 00182 \brief Zero temperature fermions 00183 */ 00184 virtual int calc_mu_zerot(); 00185 00186 /** 00187 \brief Zero temperature fermions 00188 */ 00189 virtual int calc_density_zerot(); 00190 00191 /// Return string denoting type ("nonrel_fermion_zerot") 00192 virtual const char *type() { return "nonrel_fermion_zerot"; } 00193 00194 #ifndef DOXYGENP 00195 00196 private: 00197 00198 nonrel_fermion_zerot(const nonrel_fermion_zerot &); 00199 nonrel_fermion_zerot& operator=(const nonrel_fermion_zerot&); 00200 00201 #endif 00202 00203 }; 00204 00205 template<> int io_tlate<nonrel_fermion>::input 00206 (cinput *co, in_file_format *ins, nonrel_fermion *f); 00207 template<> int io_tlate<nonrel_fermion>::output 00208 (coutput *co, out_file_format *outs, nonrel_fermion *f); 00209 template<> const char *io_tlate<nonrel_fermion>::type(); 00210 00211 typedef io_tlate<nonrel_fermion> nonrel_fermion_io_type; 00212 00213 #ifndef DOXYGENP 00214 } 00215 #endif 00216 00217 #endif
Documentation generated with Doxygen and provided under the GNU Free Documentation License. See License Information for details.
Project hosting provided by
,
O2scl Sourceforge Project Page