00001 /* 00002 * ******** fete: From ENDF To ENDL ********* 00003 * 00004 * Copyright (c) 2006, The Regents of the University of California. 00005 * All rights reserved. 00006 * 00007 * Produced at the Lawrence Livermore National Laboratory. 00008 * Written by David A. Brown, Gerry Hedstrom, Tony Hill 00009 * 00010 * This file is part of fete v1.0 (UCRL-CODE-218718) 00011 * 00012 * Please read the COPYING file for "Our Notice and GNU General 00013 * Public License" in the root of this software distribution. 00014 * 00015 * This program is free software; you can redistribute it and/or modify 00016 * it under the terms of the GNU General Public License (as published by 00017 * the Free Software Foundation) version 2, dated June 1991. 00018 * 00019 * This program 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 terms 00022 * and conditions of the GNU General Public License for more details. 00023 * 00024 * You should have received a copy of the GNU General Public License along 00025 * with this program; if not, write to the Free Software Foundation, Inc., 00026 * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 00027 * 00028 * $Revision: 1861 $ 00029 * $Date: 2006-04-28 11:51:26 -0700 (Fri, 28 Apr 2006) $ 00030 * $Author: hedstrom $ 00031 * $Id: mf5classes.hpp 1861 2006-04-28 18:51:26Z hedstrom $ 00032 * 00033 * ******** fete: From ENDF To ENDL ********* 00034 */ 00035 00036 //header for the classes used in translating the MF=5 files 00037 00038 #ifndef MF5CLASSES 00039 #define MF5CLASSES 00040 00041 #include "list_2d.hpp" 00042 #include "ENDF_file.hpp" 00043 #include "multiplicity.hpp" 00044 00045 using namespace std; 00046 00047 // ----------- class mf5_table ----------------- 00048 // derive this class from two_d_table 00049 //! Class to handle tabular data 00050 class mf5_table : public two_d_table 00051 { 00052 private: 00053 00054 public: 00055 bool duplicate_Ein; 00056 00057 //! Reads in all the data 00058 void read_data( mf5_file& inFile, int NR, int NP ); 00059 00060 //! Reads in the data for a particular incident neutron energy 00061 void one_E_in( mf5_file& inFile ); 00062 00063 //! Interpolates between tables according to the INT array 00064 void table_interp( ); 00065 00066 //! Empty function 00067 inline void set_U( double U ) 00068 { 00069 } 00070 00071 //! Empty function 00072 inline void make_list( ) 00073 { 00074 } 00075 00076 }; 00077 00078 // ----------- class two_d_evap ----------------- 00079 // derive this class for the evaporation spectrum from two_d_list 00080 //! Class for handling the general evaporation spectrum 00081 class two_d_evap : public two_d_list< one_d_evap > 00082 { 00083 private: 00084 dd_list _theta; 00085 double UU; 00086 double Max_energy; 00087 00088 public: 00089 bool duplicate_Ein; 00090 00091 //! Default constructor 00092 two_d_evap(); 00093 //! Constructor with specific U parameter 00094 two_d_evap(double U); 00095 //! Default destructor 00096 ~two_d_evap(); 00097 00098 //! Sets the U parameter 00099 inline void set_U( double U ) 00100 { 00101 UU = U*ENDL.eV2MeV; // convert to MeV; 00102 } 00103 00104 //! Inserts a distribution for a given incident neutron energy 00105 void insert(two_d_iterator where, double e_in, double Theta); 00106 00107 //! Reads all the data 00108 void read_data(mf5_file& inFile, int NR, int NP); 00109 00110 //! Expands the data into a list 00111 void make_list(); 00112 }; 00113 00114 // ----------- class two_d_Maxwell ----------------- 00115 // derive this class for the Maxwell spectrum from two_d_list 00116 //! Class to handle the simple fission spectrum (Maxwellian) 00117 class two_d_Maxwell : public two_d_list< one_d_Maxwell > 00118 { 00119 private: 00120 dd_list _theta; 00121 double UU; 00122 double Max_energy; 00123 00124 public: 00125 bool duplicate_Ein; 00126 00127 //! Default constructor 00128 two_d_Maxwell(); 00129 //! Constructor with specific U parameter 00130 two_d_Maxwell(double U); 00131 //! Default destructor 00132 ~two_d_Maxwell(); 00133 00134 //! Sets the U parameter 00135 inline void set_U( double U ) 00136 { 00137 UU = U*ENDL.eV2MeV; // convert to MeV; 00138 } 00139 00140 //! Inserts a distribution for the given incident neutron energy 00141 void insert(two_d_iterator where, double e_in, double Theta); 00142 00143 //! Read in all the data 00144 void read_data(mf5_file& inFile, int NR, int NP); 00145 00146 //! Expands the data into a list 00147 void make_list(); 00148 }; 00149 00150 // ----------- class two_d_Watt ----------------- 00151 // derive this class for the Watt spectrum from two_d_list 00152 //! Class to handle the energy dependent Watt spectrum 00153 class two_d_Watt : public two_d_list< one_d_Watt > 00154 { 00155 private: 00156 dd_list Watt_a; // Watt a parameters 00157 dd_list Watt_b; // Watt b parameters 00158 double UU; 00159 double Max_energy; 00160 00161 public: 00162 bool duplicate_Ein; 00163 00164 //! Default constructor 00165 two_d_Watt(); 00166 //! Constructor with specifi U parameter 00167 two_d_Watt(double U); 00168 //! Default destructor 00169 ~two_d_Watt(); 00170 00171 //! Sets the U parameter 00172 inline void set_U( double U ) 00173 { 00174 UU = U*ENDL.eV2MeV; // convert to MeV; 00175 } 00176 00177 //! Inserts a distribution for the given incident neutron energy 00178 void insert( two_d_iterator where, double e_in, double a ); 00179 00180 //! Reads in all the data 00181 void read_data(mf5_file& inFile, int NR, int NP); 00182 00183 //! Expands the data into a list 00184 void make_list(); 00185 00186 //! Sets the b values and expand the lists 00187 void set_b( ); 00188 }; 00189 00190 // ----------- class two_d_Madland ----------------- 00191 // derive this class for the Madland spectrum from two_d_list 00192 //! Class to handle the energy dependent fission spectrum of Madland and Nix 00193 class two_d_Madland : public two_d_list< one_d_Madland > 00194 { 00195 private: 00196 dd_list Madland_TM; // Madland TM parameters 00197 double EFL_; 00198 double EFH_; 00199 double Max_energy; 00200 00201 public: 00202 bool duplicate_Ein; 00203 00204 //! Default constructor 00205 two_d_Madland(); 00206 //! Default destructor 00207 ~two_d_Madland(); 00208 00209 //! Sets the parameters 00210 inline void set_EF( double EFL, double EFH ) 00211 { 00212 EFL_ = EFL*ENDL.eV2MeV; // convert to MeV; 00213 EFH_ = EFH*ENDL.eV2MeV; // convert to MeV; 00214 } 00215 00216 //! Empty function 00217 inline void set_U( double U ) {} 00218 00219 //! Inserts a distribution for the given incident neutron energy 00220 void insert(two_d_iterator where, double e_in, double TM); 00221 00222 //! Reads all the data 00223 void read_data(mf5_file& inFile, int NR, int NP); 00224 00225 //! Expands the data into a list 00226 void make_list(); 00227 }; 00228 00229 // ************* class add_them_up ******************** 00230 //! Class to manage the addition of weighted models 00231 class add_them_up : public mf5_table 00232 { 00233 private: 00234 // arrays for the possible types of distributions 00235 mf5_table* table_vec; // array of mf5_tables 00236 two_d_evap* evap_vec; // array of evaporation models 00237 two_d_Maxwell* Maxwell_vec; // array of Maxwell models 00238 two_d_Watt* Watt_vec; // array of Watt models 00239 two_d_Madland* Madland_vec; // array of Madland models 00240 00241 int NK_; // how many models 00242 00243 // how many of each type of model 00244 int num_table; 00245 int num_evap; 00246 int num_Maxwell; 00247 int num_Watt; 00248 int num_Madland; 00249 00250 bool debug_; // do we test multiple models? 00251 00252 //! Checks that the total weight is 1 00253 void check_total_wt( ); 00254 00255 public: 00256 //! Constructor for NK sets of data 00257 add_them_up( int NK ); 00258 00259 //! Destructor 00260 ~add_them_up( ); 00261 00262 //! Manages all of the output models 00263 void manager( mf5_file& inFile ); 00264 00265 //! Handles one output model 00266 void one_model( mf5_file& inFile ); 00267 00268 //! Ensures that all lists have common incident energies 00269 void common_Ein( ); 00270 00271 //! Adds the lists to get the weighted sum 00272 void wt_add( ); 00273 }; 00274 00275 // ----------- class fission_delay ----------------- 00276 // This class is used with MT = 455 and LNU = 2. 00277 //! Class that handles multiplicites and energy distributions for delayed fission neutrons 00278 class fission_delay 00279 { 00280 private: 00281 one_d_table theta; 00282 vector<double> time_consts; 00283 multiplicity total_mult; // total multiplicity 00284 00285 public: 00286 //! Default constructor 00287 inline fission_delay() 00288 {} 00289 //! Default destructor 00290 ~fission_delay() 00291 {} 00292 00293 //! Manages the class 00294 void manager(mf1_file& inFile); 00295 00296 //! Gets the time constants and the total multiplicity 00297 void read_mf1(mf1_file& inFile); 00298 00299 //! Gets the multiplicities for the j-th channel and returns the model 00300 int one_mult(mf5_file& inFile, int j); 00301 00302 //! Gets the energy distribution for the j-th channel for the general evaporation model 00303 void one_gen_evap(mf5_file& inFile, int count); 00304 00305 //! Forms the 2d list of energy distributions for general evaporation model 00306 void gen_mf5_expand(int N_theta, two_d_table& e_dist); 00307 00308 //! Gets the energy distribution for the j-th channel for an mf5 table 00309 void one_table( mf5_file& inFile, int count ); 00310 }; 00311 00312 #endif