RadLib
Loading...
Searching...
No Matches
ex_Sb1.cc
Go to the documentation of this file.
1
3
4#include <iostream>
5#include "rad_rcslw.h"
6#include "rad.h"
7
8using namespace std;
9
10void parallel_planes(rad *RAD,
11 const double L,
12 const int ntheta,
13 const vector<double> &T,
14 const double P,
15 const vector<double> &fvsoot,
16 const vector<double> &xH2O,
17 const vector<double> &xCO2,
18 const vector<double> &xCO,
19 const vector<double> &xCH4,
20 vector<double> &q,
21 vector<double> &Q,
22 vector<double> &x,
23 vector<double> &xQ,
24 const bool LzeroIbc=false
25 );
26
28
29int main() {
30
31 //--------------------- parameters
32
33 double P = 101325.0;
34 double L = 1.0;
35 int nGG = 24;
36 int ntheta = 101;
37 int nx = 1001;
38 double Tconst = 1000;
39
40 int nGGa = nGG+1;
41
42 double xco2=0.1, xco=0.03, xh2o=0.2, xch4=0.0, fvs=1.0E-7;
43 //---------------------
44
45 vector<double> xCO2(nx, xco2);
46 vector<double> xCO(nx, xco);
47 vector<double> xH2O(nx, xh2o);
48 vector<double> xCH4(nx, 0.0);
49 vector<double> fvsoot(nx, fvs);
50
51 vector<double> x(nx, 0.0);
52 vector<double> xQ;
53 vector<double> T(nx, Tconst);
54
55 double dx = L/(nx-1);
56 x[0] = 0.0;
57 double Tavg = T[0];
58 double xH2O_avg = 0.0;
59 for(int i=1; i<nx; ++i){
60 x[i] = x[i-1] + dx;
61 }
62
63 rad *rcslw = new rad_rcslw(nGG, Tconst, P, fvs, xh2o, xco2, xco);
64
65 //--------------------- get q, Q
66
67 vector<double> q;
68 vector<double> Q;
69
70 parallel_planes(rcslw, L, ntheta, T, P, fvsoot, xH2O, xCO2, xCO, xCH4, q, Q, x, xQ, true);
71
72 //-------------------------------------------------------------------------
73
74 cout << "# x (m), Q (kW/m3)";
75 for(int i=0; i<xQ.size(); ++i)
76 cout << endl << xQ[i] << " " << Q[i]/1000;
77
78 //cout << "# x (m), q (kW/m2)";
79 //for(int i=0; i<x.size(); ++i)
80 // cout << endl << x[i] << " " << q[i]/1000;
81
82 cout << endl;
83
84 return 0;
85
86}
87
Definition rad.h:20
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)
int main()
Definition ex_Sb1.cc:29
Abstract base class.
Header file for child class rad_rcslw.