26void I_IT(
const vector<double> &x,
28 const vector<double> &T,
29 const vector<vector<double>> &kabs,
30 const vector<vector<double>> &awts,
31 const vector<double> &Ilo,
32 const vector<double> &Ihi,
33 vector<vector<double>> &I){
36 int nGGa = I[0].size();
40 double mu = abs(cos(theta));
44 for(
int i=0; i<n-1; ++i){
50 for(
int j=0; j<nGGa; ++j)
51 I[i+1][j] = (I[i][j] + dx/mu*0.5*(kabs[i+1][j]*awts[i+1][j]*Ib1 + kabs[i][j]*(awts[i][j]*Ib2 - I[i][j]))) /
52 (1.0+dx/mu*0.5*kabs[i+1][j]);
57 for(
int i=n-1; i>0; --i){
63 for(
int j=0; j<nGGa; ++j)
64 I[i-1][j] = (I[i][j] + dx/mu*0.5*(kabs[i-1][j]*awts[i-1][j]*Ib1 + kabs[i][j]*(awts[i][j]*Ib2 - I[i][j]))) /
65 (1.0+dx/mu*0.5*kabs[i-1][j]);
95 const vector<double> &T,
97 const vector<double> &fvsoot,
98 const vector<double> &xH2O,
99 const vector<double> &xCO2,
100 const vector<double> &xCO,
101 const vector<double> &xCH4,
106 const bool LzeroIbc=
false
111 double dtheta = M_PI/ntheta;
113 vector<double> theta(ntheta, dtheta/2);
114 for(
int i=1; i<ntheta; ++i)
115 theta[i] = theta[i-1] + dtheta;
118 double dx = L/(nx-1);
119 x = vector<double> (nx, 0.0);
120 xQ = vector<double> (nx-1,0.0);
121 for(
int i=1; i<x.size(); ++i){
123 xQ[i-1] = 0.5*(x[i-1] + x[i]);
128 vector<vector<double>> kabs(nx, vector<double>(RAD->
get_nGGa()));
129 vector<vector<double>> awts(nx, vector<double>(RAD->
get_nGGa()));
131 for(
int i=0; i<nx; ++i)
132 RAD->
get_k_a(kabs[i], awts[i], T[i], P, fvsoot[i], xH2O[i], xCO2[i], xCO[i], xCH4[i]);
134 vector<double> Ilo(RAD->
get_nGGa(), 0.0);
135 vector<double> Ihi(RAD->
get_nGGa(), 0.0);
137 for(
int j=0; j<Ilo.size(); ++j){
143 Ilo[j] =
rad::sigma/M_PI*pow(T[0], 4.0)*awts[0][j];
144 Ihi[j] =
rad::sigma/M_PI*pow(T.back(), 4.0)*awts[nx-1][j];
148 vector<vector<double>> I(nx, vector<double>(RAD->
get_nGGa(), 0.0));
152 q = vector<double>(nx, 0.0);
153 Q = vector<double>(nx-1, 0.0);
157 for(
int j=0; j<ntheta; ++j) {
158 I_IT(x, theta[j], T, kabs, awts, Ilo, Ihi, I);
159 for(
int i=0; i<nx; ++i) {
161 for(
int k=0; k<RAD->
get_nGGa(); ++k)
163 q[i] += 2.0*M_PI*dtheta*cos(theta[j])*sin(theta[j])*sumI;
167 for(
int i=0; i<nx-1; i++)
168 Q[i] = -(q[i+1]-q[i])/dx;
virtual void get_k_a(std::vector< double > &kabs, std::vector< double > &awts, const double T, const double P, const double fvsoot, const double xH2O, const double xCO2, const double xCO=0, const double xCH4=0)=0
ABSTRACT BASE CLASS.
void parallel_planes(rad *RAD, const double L, const int ntheta, const vector< double > &T, const double P, const vector< double > &fvsoot, const vector< double > &xH2O, const vector< double > &xCO2, const vector< double > &xCO, const vector< double > &xCH4, vector< double > &q, vector< double > &Q, vector< double > &x, vector< double > &xQ, const bool LzeroIbc=false)
void I_IT(const vector< double > &x, const double theta, const vector< double > &T, const vector< vector< double > > &kabs, const vector< vector< double > > &awts, const vector< double > &Ilo, const vector< double > &Ihi, vector< vector< double > > &I)