nonrel_fermion.h

00001 /*
00002   -------------------------------------------------------------------
00003   
00004   Copyright (C) 2006, 2007, 2008, 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       Note that the energy density integral can be rescaled:
00061       \f[
00062       \varepsilon = 
00063       \frac{T^{5/2}(2 m^{*})^{3/2}}{\pi^2}
00064       \int_0^{\infty} d u \frac{u^{3/2}}{1 + \exp(u-y)}
00065       \f]
00066       where \f$ u = k^2/2/m^{*}/T \f$ and \f$ y=\mu/T \f$.
00067 
00068       The functions fermion::pair_density() and pair_mu() have not 
00069       been implemented. 
00070 
00071       \todo I think calc_mu_zerot() and calc_density_zerot() are
00072       missing the proper dependence on the degeneracy, \c g. (8/20/07)
00073       (I think this is fixed now, but should be tested, 8/22/07)
00074       \todo Make sure to test with non-interacting equal to 
00075       true or false, and document whether or not it works
00076       with both inc_rest_mass equal to true or false
00077 
00078       \future This could be improved by performing a Chebyshev 
00079       approximation to invert the density integral so that
00080       we don't need to use a solver. 
00081   */
00082   class nonrel_fermion : public fermion {
00083 
00084   public:
00085 
00086     /// Create a nonrelativistic fermion with mass 'm' and degeneracy 'g'
00087     nonrel_fermion(double m=0.0, double g=0.0);
00088 
00089     virtual ~nonrel_fermion();
00090     
00091     /** 
00092         \brief Zero temperature fermions
00093     */
00094     virtual int calc_mu_zerot();
00095 
00096     /** 
00097         \brief Zero temperature fermions
00098     */
00099     virtual int calc_density_zerot();
00100     
00101     /** 
00102         \brief Calculate properties as function of chemical potential
00103      */
00104     virtual int calc_mu(const double temper);
00105 
00106     /** \brief Calculate properties as function of density
00107      */
00108     virtual int calc_density(const double temper);
00109 
00110     /// Calculate effective chemical potential from density
00111     virtual int nu_from_n(const double temper);
00112 
00113     /** \brief Set the solver for use in calculating the chemical
00114         potential from the density 
00115     */
00116     int set_density_root(root<double,funct<double> > &rp) {
00117       density_root=&rp;
00118       return 0;
00119     }
00120 
00121     /// The default solver for calc_density().
00122     cern_mroot_root<double,funct<double> > def_density_root;
00123 
00124     /// Return string denoting type ("nonrel_fermion")
00125     virtual const char *type() { return "nonrel_fermion"; }
00126 
00127   protected:
00128 
00129 #ifndef DOXYGENP
00130 
00131     friend class io_tlate<nonrel_fermion>;
00132     
00133     /// Solver to compute chemical potential from density
00134     root<double,funct<double> > *density_root;
00135     
00136     /// Function to compute chemical potential from density
00137     int solve_fun(double x, double &yy, double &T);
00138 
00139   private:
00140 
00141     nonrel_fermion(const nonrel_fermion &);
00142     nonrel_fermion& operator=(const nonrel_fermion&);
00143 
00144 #endif
00145 
00146   };
00147 
00148   template<> int io_tlate<nonrel_fermion>::input
00149     (cinput *co, in_file_format *ins, nonrel_fermion *f);
00150   template<> int io_tlate<nonrel_fermion>::output
00151     (coutput *co, out_file_format *outs, nonrel_fermion *f);
00152   template<> const char *io_tlate<nonrel_fermion>::type(); 
00153   
00154   typedef io_tlate<nonrel_fermion> nonrel_fermion_io_type;
00155 
00156 #ifndef DOXYGENP
00157 }
00158 #endif
00159 
00160 #endif

Documentation generated with Doxygen and provided under the GNU Free Documentation License. See License Information for details.

Project hosting provided by SourceForge.net Logo, O2scl Sourceforge Project Page