Chi-Tech
lbts_01_initialize.cc
Go to the documentation of this file.
2
4
5#include "chi_runtime.h"
6#include "chi_log.h"
7
8//###################################################################
9/**Transient solver initialize routine.*/
11{
12 chi::log.Log() << "Initializing " << TextName() << ".";
13 options_.save_angular_flux = true;
14 DiscOrdKEigenvalueSolver::Initialize();
15 DiscOrdKEigenvalueSolver::Execute();
16
18 {
19 const double FR = ComputeFissionRate(phi_new_local_);
20 char buff[200];
21 snprintf(buff,200, " Initial Fission Rate FR=%12.6g", FR);
22 chi::log.Log() << TextName() << buff;
23 }
24
25 //======================================== Compute auxiliary vectors
26 fission_rate_local_.resize(grid_ptr_->local_cells.size(), 0.0);
27 phi_prev_local_ = phi_old_local_;
28 precursor_prev_local_ = precursor_new_local_;
29 psi_prev_local_ = psi_new_local_;
30
32 {
33 const double beta = ComputeBeta();
34 char buff[200];
35 snprintf(buff,200, " Beta=%.2f [pcm] reactivity=%.3f [$]",
36 beta*1e5, (1.0- 1.0 / GetKeff()) / beta);
37 chi::log.Log() << TextName() << buff;
38 }
39
40 //================================================== Initialize source func
41 auto src_function =
42 std::make_shared<TransientSourceFunction>(*this, this->dt_, this->method);
43
44 using namespace std::placeholders;
45 active_set_source_function_ =
46 std::bind(&SourceFunction::operator(), src_function, _1, _2, _3, _4);
47}
std::vector< double > precursor_prev_local_
std::vector< double > fission_rate_local_
std::vector< double > phi_prev_local_
std::vector< std::vector< double > > psi_prev_local_
chi_math::SteppingMethod method
struct lbs::DiscOrdTransientSolver::Options transient_options_