OpenFCST: The open-source Fuel Cell Simulation Toolbox
|
Implementation of the ideal gas law. More...
#include <ideal_gas.h>
Public Member Functions | |
IdealGas () | |
Constructor. | |
~IdealGas () | |
Destructor. | |
void | set_pT_and_gas (const double p, const double T, FuelCellShop::Material::PureGas *gas) |
Function to set the temperature in K and pressure in Pa of the gas. | |
void | set_cT_and_gas (const double c, const double T, FuelCellShop::Material::PureGas *gas) |
Function to modify the temperature in K and concentration in mol/m3 of the gas. | |
double | get_T () |
Member function used to return the temperature of the gas in Kelvin. | |
double | get_p () |
Member function used to return the pressure of the gas in Pascal. | |
double | get_p_atm () |
Member function used to return the pressure of the gas in atm. | |
double | get_c () |
Member function used to return the concentration of the gas in mol/m3. | |
double | get_density () |
Member function used to return the density of the gas in kg/m3. | |
FuelCellShop::Material::PureGas * | get_gas () |
Member function used to return the density of the gas in kg/m3. | |
void | print_properties_to_screen () |
Member function that prints to screen p, T and c. | |
void | test () |
Member function use to make sure the class is returning appropriate values. | |
Private Attributes | |
bool | initialized |
Bool element that let's me know if the class has been initialized. | |
double | temp |
Temperature of the gas, [K]. | |
double | press |
Pressure of the gas, [Pa]. | |
double | conc |
Concentration of the gas, [mol/m3]. | |
double | density |
Density of the gas, [kg/m3]. | |
SmartPointer < FuelCellShop::Material::PureGas > | gas_type |
Gas species. | |
Implementation of the ideal gas law.
This class once initialized with either a pressure and temperature or a concentration and temperature will return the additional variable. Enjoy!
In order to use this class, you first need to use one of the set_* options in order to initialize all the variables that define an ideal gas. In the set_* member function all properties are computed. If you would like to change, temperature, type of gas, etc. you will need to call this routine again. Once the set routine has been called, then you can request any gas property using get_* routines.
|
inline |
Constructor.
|
inline |
Destructor.
|
inline |
Member function used to return the concentration of the gas in mol/m3.
References conc, and initialized.
Referenced by test().
|
inline |
Member function used to return the density of the gas in kg/m3.
References density, and initialized.
Referenced by test().
|
inline |
Member function used to return the density of the gas in kg/m3.
References gas_type, and initialized.
|
inline |
Member function used to return the pressure of the gas in Pascal.
References initialized, and press.
Referenced by test().
|
inline |
Member function used to return the pressure of the gas in atm.
References initialized, and press.
|
inline |
Member function used to return the temperature of the gas in Kelvin.
References initialized, and temp.
Referenced by test().
|
inline |
Member function that prints to screen p, T and c.
References conc, density, initialized, press, and temp.
|
inline |
Function to modify the temperature in K and concentration in mol/m3 of the gas.
References conc, density, gas_type, initialized, press, Constants::R(), and temp.
Referenced by test().
|
inline |
Function to set the temperature in K and pressure in Pa of the gas.
References conc, density, gas_type, initialized, press, Constants::R(), and temp.
Referenced by test().
|
inline |
Member function use to make sure the class is returning appropriate values.
In this case I simply test that for oxygen it returns the appropriate values for STP.
References get_c(), get_density(), get_p(), get_T(), set_cT_and_gas(), and set_pT_and_gas().
|
private |
Concentration of the gas, [mol/m3].
Referenced by get_c(), print_properties_to_screen(), set_cT_and_gas(), and set_pT_and_gas().
|
private |
Density of the gas, [kg/m3].
Referenced by get_density(), print_properties_to_screen(), set_cT_and_gas(), and set_pT_and_gas().
|
private |
Gas species.
Referenced by get_gas(), set_cT_and_gas(), and set_pT_and_gas().
|
private |
Bool element that let's me know if the class has been initialized.
Referenced by get_c(), get_density(), get_gas(), get_p(), get_p_atm(), get_T(), print_properties_to_screen(), set_cT_and_gas(), and set_pT_and_gas().
|
private |
Pressure of the gas, [Pa].
Referenced by get_p(), get_p_atm(), print_properties_to_screen(), set_cT_and_gas(), and set_pT_and_gas().
|
private |
Temperature of the gas, [K].
Referenced by get_T(), print_properties_to_screen(), set_cT_and_gas(), and set_pT_and_gas().