OpenFCST: The open-source Fuel Cell Simulation Toolbox
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Private Attributes | List of all members
FuelCellShop::Material::IdealGas Class Reference

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::PureGasget_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.
 

Detailed Description

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!

Usage details

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.

//Create a gas object
//Create an object IdealGas
// Set all gas properties. Make sure you are entering the info using the correct units.
marc.set_pT_and_gas(101325, 298, &oxygen);
// You can now request info from your class.
double temperature = marc.get_T();
//Print to screen all properties
Author
M. Secanell
Date
2012

Constructor & Destructor Documentation

FuelCellShop::Material::IdealGas::IdealGas ( )
inline

Constructor.

FuelCellShop::Material::IdealGas::~IdealGas ( )
inline

Destructor.

Member Function Documentation

double FuelCellShop::Material::IdealGas::get_c ( )
inline

Member function used to return the concentration of the gas in mol/m3.

References conc, and initialized.

Referenced by test().

Here is the caller graph for this function:

double FuelCellShop::Material::IdealGas::get_density ( )
inline

Member function used to return the density of the gas in kg/m3.

References density, and initialized.

Referenced by test().

Here is the caller graph for this function:

FuelCellShop::Material::PureGas* FuelCellShop::Material::IdealGas::get_gas ( )
inline

Member function used to return the density of the gas in kg/m3.

References gas_type, and initialized.

double FuelCellShop::Material::IdealGas::get_p ( )
inline

Member function used to return the pressure of the gas in Pascal.

References initialized, and press.

Referenced by test().

Here is the caller graph for this function:

double FuelCellShop::Material::IdealGas::get_p_atm ( )
inline

Member function used to return the pressure of the gas in atm.

References initialized, and press.

double FuelCellShop::Material::IdealGas::get_T ( )
inline

Member function used to return the temperature of the gas in Kelvin.

References initialized, and temp.

Referenced by test().

Here is the caller graph for this function:

void FuelCellShop::Material::IdealGas::print_properties_to_screen ( )
inline

Member function that prints to screen p, T and c.

References conc, density, initialized, press, and temp.

void FuelCellShop::Material::IdealGas::set_cT_and_gas ( const double  c,
const double  T,
FuelCellShop::Material::PureGas gas 
)
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().

Here is the call graph for this function:

Here is the caller graph for this function:

void FuelCellShop::Material::IdealGas::set_pT_and_gas ( const double  p,
const double  T,
FuelCellShop::Material::PureGas gas 
)
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().

Here is the call graph for this function:

Here is the caller graph for this function:

void FuelCellShop::Material::IdealGas::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().

Here is the call graph for this function:

Member Data Documentation

double FuelCellShop::Material::IdealGas::conc
private

Concentration of the gas, [mol/m3].

Referenced by get_c(), print_properties_to_screen(), set_cT_and_gas(), and set_pT_and_gas().

double FuelCellShop::Material::IdealGas::density
private

Density of the gas, [kg/m3].

Referenced by get_density(), print_properties_to_screen(), set_cT_and_gas(), and set_pT_and_gas().

SmartPointer<FuelCellShop::Material::PureGas> FuelCellShop::Material::IdealGas::gas_type
private

Gas species.

Referenced by get_gas(), set_cT_and_gas(), and set_pT_and_gas().

bool FuelCellShop::Material::IdealGas::initialized
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().

double FuelCellShop::Material::IdealGas::press
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().

double FuelCellShop::Material::IdealGas::temp
private

Temperature of the gas, [K].

Referenced by get_T(), print_properties_to_screen(), set_cT_and_gas(), and set_pT_and_gas().


The documentation for this class was generated from the following file: