73 std::ifstream CH4(path_to_files +
"/CH4_hv_cs.dat");
74 std::ifstream hv(path_to_files +
"/solar_flux.dat");
76 std::string first_line;
78 getline(CH4,first_line);
79 getline(hv,first_line);
81 std::vector<Scalar> CH4_cs;
82 std::vector<Scalar> CH4_lambda;
83 std::vector<Scalar> hv_irr;
84 std::vector<Scalar> hv_lambda;
91 CH4_lambda.push_back(l);
101 hv_lambda.push_back(l * 10);
102 hv_irr.push_back(w * 1e-4L
103 / (Antioch::Constants::Planck_constant<Scalar>() * Antioch::Constants::light_celerity<Scalar>() / l)
113 std::vector<Scalar> sigma_rescaled(hv_lambda.size());
116 Scalar rate = rate_hv.rate(part_flux);
118 Scalar rate_exact(0);
120 for(
unsigned int il = 0; il < hv_lambda.size() - 1; il++)
122 rate_exact += sigma_rescaled[il] * hv_irr[il] * (hv_lambda[il+1] - hv_lambda[il]);
125 int return_flag =
check_rate(rate_exact,rate);
128 int il = CH4_cs.size() * 2 / 3;
134 for(
unsigned int il = 0; il < hv_lambda.size() - 1; il++)
136 rate_exact += sigma_rescaled[il] * hv_irr[il] * (hv_lambda[il+1] - hv_lambda[il]);
139 rate = rate_hv.rate(part_flux);
141 return_flag =
check_rate(rate_exact,rate) || return_flag;
144 il = CH4_cs.size()/2;
150 for(
unsigned int il = 0; il < hv_lambda.size() - 1; il++)
152 rate_exact += sigma_rescaled[il] * hv_irr[il] * (hv_lambda[il+1] - hv_lambda[il]);
157 rate = rate_hv.rate(part_flux);
159 return_flag =
check_rate(rate_exact,rate) || return_flag;
Stores the incoming flux of particles.
void reset_parameter_of_rate(KineticsType< CoeffType, VectorCoeffType > &rate, KineticsModel::Parameters parameter, const CoeffType new_value, const std::string &unit="SI")
The rate constant models derived from the Arrhenius model have an activation energy which is stored a...
int check_rate(const Scalar &rate_exact, const Scalar &rate)
void set_zero(_Matrix< _Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols > &a)
void y_on_custom_grid(const VectorCoeffType &x_old, const VectorCoeffType &y_old, const VectorStateType &x_new, VectorStateType &y_new) const