12 #ifndef _FUELCELLSHOP__IDEAL_GAS_H
13 #define _FUELCELLSHOP__IDEAL_GAS_H
15 namespace FuelCellShop
107 return press/101325.0;
139 std::cout<<
"Pressure is: "<<
press <<
" Pa"<<std::endl;
140 std::cout<<
"Temperature is: "<<
temp <<
" K"<<std::endl;
141 std::cout<<
"Concentration is: "<<
conc <<
" mol/m3"<<std::endl;
142 std::cout<<
"Density is: "<<
density <<
" kg/m3"<<std::endl;
152 std::cout<<
"======== TESTING set_pT_and_gas ========"<<std::endl;
153 if (marc.
get_T() - 298 < 1e-4)
154 std::cout<<
"======== Temp OK ========"<<std::endl;
156 std::cout<<
"!!!!!!! Temp BUG !!!!!!!"<<std::endl;
158 if (marc.
get_p() - 101325 < 1e-4)
159 std::cout<<
"======== Pressure OK ========"<<std::endl;
161 std::cout<<
"!!!!!!! Pressure BUG !!!!!!!"<<std::endl;
163 if (marc.
get_c() - 40.8949 < 1e-4)
164 std::cout<<
"======== Concentration OK ========"<<std::endl;
166 std::cout<<
"!!!!!!! Concentration BUG !!!!!!!"<<std::endl;
169 std::cout<<
"======== Density OK ========"<<std::endl;
171 std::cout<<
"!!!!!!! Density BUG !!!!!!!"<<std::endl;
174 std::cout<<
"======== TESTING set_cT_and_gas ========"<<std::endl;
175 if (marc.
get_T() - 298 < 1e-4)
176 std::cout<<
"======== Temp OK ========"<<std::endl;
178 std::cout<<
"!!!!!!! Temp BUG !!!!!!!"<<std::endl;
180 if (marc.
get_p() - 101325 < 1e-4)
181 std::cout<<
"======== Pressure OK ========"<<std::endl;
183 std::cout<<
"!!!!!!! Pressure BUG !!!!!!!"<<std::endl;
185 if (marc.
get_c() - 40.8949 < 1e-4)
186 std::cout<<
"======== Concentration OK ========"<<std::endl;
188 std::cout<<
"!!!!!!! Concentration BUG !!!!!!!"<<std::endl;
191 std::cout<<
"======== Density OK ========"<<std::endl;
193 std::cout<<
"!!!!!!! Density BUG !!!!!!!"<<std::endl;
207 SmartPointer<FuelCellShop::Material::PureGas>
gas_type;
260 void set_pT_xi_and_gases(
const double p,
const double T,
const std::vector<double> xv, std::vector<FuelCellShop::Material::PureGas* > gases)
262 Assert (xv.size() == gases.size(),ExcDimensionMismatch(xv.size(),gases.size()));
268 concv.resize(xv.size());
273 for (
unsigned int i = 0; i<xv.size(); i++)
287 void set_cT_xi_and_gases(
const double c,
const double T,
const std::vector<double> xv, std::vector<FuelCellShop::Material::PureGas* > gases)
289 Assert (xv.size() == gases.size(),ExcDimensionMismatch(xv.size(),gases.size()));
295 concv.resize(xv.size());
300 for (
unsigned int i = 0; i<xv.size(); i++)
314 void set_pv_T_and_gases(
const std::vector<double> pv,
const double T, std::vector<FuelCellShop::Material::PureGas* > gases)
316 Assert (pv.size() == gases.size(),ExcDimensionMismatch(pv.size(),gases.size()));
321 concv.resize(pv.size());
325 for (
unsigned int i = 0; i<pv.size(); i++)
331 for (
unsigned int i = 0; i<pv.size(); i++)
343 void set_cv_T_and_gases(
const std::vector<double> cv,
const double T, std::vector<FuelCellShop::Material::PureGas* > gases)
345 Assert (cv.size() == gases.size(),ExcDimensionMismatch(cv.size(),gases.size()));
354 for (
unsigned int i = 0; i<cv.size(); i++)
360 for (
unsigned int i = 0; i<cv.size(); i++)
400 return press/101325.0;
440 std::vector<double> xi;
442 for (
unsigned int i = 0; i<
pressv.size(); ++i)
450 dealii::SmartPointer<FuelCellShop::Material::PureGas>
get_gas(
const unsigned int index)
461 std::cout<<
"Pressure is: "<<
press <<
" Pa"<<std::endl;
462 std::cout<<
"Temperature is: "<<
temp <<
" K"<<std::endl;
463 std::cout<<
"Concentration is: "<<
conc <<
" mol/m3"<<std::endl;
464 std::cout<<
"Density is: "<<
density <<
" kg/m3"<<std::endl;
466 for (
unsigned int i = 0; i<
concv.size(); i++)
468 std::cout<<
"Parial pressure for species "<<i<<
" is: "<<
pressv[i] <<
" Pa"<<std::endl;
469 std::cout<<
"Concentration for species: "<<i<<
" is: "<<
concv[i] <<
" mol/m3"<<std::endl;
470 std::cout<<
"Density for species: "<<i<<
" is: "<<
densityv[i] <<
" kg/m3"<<std::endl;
481 std::vector<FuelCellShop::Material::PureGas* > gasv;
483 gasv.push_back(&oxygen);
484 gasv.push_back(&nitrogen);
485 std::vector<double> v;
486 v.push_back(0.5*40.8949);
487 v.push_back(0.5*40.8949);
490 if (marc.
get_T() - 298 < 1e-4)
491 std::cout<<
"======== Temp OK ========"<<std::endl;
493 std::cout<<
"!!!!!!! Temp BUG !!!!!!!"<<std::endl;
495 if (marc.
get_p() - 101325 < 1e-4)
496 std::cout<<
"======== Pressure OK ========"<<std::endl;
498 std::cout<<
"!!!!!!! Pressure BUG !!!!!!!"<<std::endl;
500 if (marc.
get_c() - 40.8949 < 1e-4)
501 std::cout<<
"======== Concentration OK ========"<<std::endl;
503 std::cout<<
"!!!!!!! Concentration BUG !!!!!!!"<<std::endl;
506 std::cout<<
"======== Density OK ========"<<std::endl;
508 std::cout<<
"!!!!!!! Density BUG !!!!!!!"<<std::endl;
510 for (
unsigned int i=0; i<marc.
get_ci().size(); ++i)
511 if (marc.
get_gas(i)->M - gasv[i]->M < 1e-4)
512 std::cout<<
"======== Gas index "<<i<<
" is OK ========"<<std::endl;
514 std::cout<<
"!!!!!!! Gas index "<<i<<
" has a BUG !!!!!!!"<<std::endl;
516 for (
unsigned int i=0; i<marc.
get_ci().size(); ++i)
518 std::cout<<
"======== Gas index "<<i<<
" is OK ========"<<std::endl;
520 std::cout<<
"!!!!!!! Gas index "<<i<<
" has a BUG !!!!!!!"<<std::endl;
542 std::vector<SmartPointer<FuelCellShop::Material::PureGas> >
gas_types;