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
FuelCell::OperatingConditions Class Reference

Class used to store, read from file and define the operating conditions for a fuel cell. More...

#include <operating_conditions.h>

Public Member Functions

 OperatingConditions ()
 Constructor.
 
 ~OperatingConditions ()
 Destructor.
 
void declare_parameters (ParameterHandler &param) const
 Declare all necessary parameters in order to compute the coefficients.
 
void set_parameters (const std::vector< std::string > &name_dvar, const std::vector< double > &value_dvar, ParameterHandler &param) const
 This class is used in order to create an interface with DAKOTA.
 
void initialize (ParameterHandler &param)
 Class used to read in data and initialize the necessary data to compute the coefficients.
 
double saturation_pressure ()
 Get the water vapour saturation pressure in atmospheres (atm) using cell temperature.
 
double get_x_wv ()
 Get the mole fraction of water at the cathode channel from pressure, temperature, and relative humidity note that the anode mole fraction of water is not required, as there are only two species so x_wv_a = 1 - x_h2.
 
double get_x_o2 ()
 Get the mole fraction of oxygen at the cathode channel from pressure, temperature, and relative humidity.
 
double get_x_h2 ()
 Get the mole fraction of hydrogen at the anode channel from pressure, temperature, and relative humidity.
 
double voltage_cell_th ()
 NOTE: This function is redefined in base_kinetics class, considering variable temperature and gas pressures.
 
void print_operating_conditions ()
 
double get_c_c ()
 Get the total gas concentration in the cathode.
 
double get_T ()
 Return cell temperture as input in Operating Conditions subsection.
 
double get_V ()
 Return cell voltage as input in Operating Conditions subsection.
 
double get_dV_a ()
 Return the voltage drop in the anode.
 
double get_pc_Pa ()
 Return cathode pressure as input in Operating Conditions subsection.
 
double get_pc_atm ()
 Return cathode pressure as input in Operating Conditions subsection.
 
double get_c_a ()
 Get the total gas concentration in the anode.
 
double get_pa_Pa ()
 Return anode pressure as input in Operating Conditions subsection.
 
double get_pa_atm ()
 Return anode pressure as input in Operating Conditions subsection.
 
double get_RH_a ()
 Return anode relative humidity as input in Operating Conditions subsection.
 
double get_RH_c ()
 Return cathode relative humidity as input in Operating Conditions subsection.
 
double get_OCV ()
 Get the open circuit voltage for the cell.
 

Private Attributes

double R
 
double channel_oxygen_mole_fraction
 Initial amount of oxygen in channel prior to humidification.
 
double T_cell
 Operating temperature of the cell.
 
double V_cell
 Operating voltage of the cell.
 
double dV_a
 Voltage drop in the anode.
 
double OCV
 Open circuit voltage for the cell.
 
double E_th
 Theoretical voltage for the cell.
 
double p_a
 Pressure of the gas mixture in the anode B.C.
 
double c_a
 Concentration of the gas mixture in the anode B.C.
 
double RH_a
 Relative humidity of the gas mixture in the anode B.C.
 
double p_c
 Pressure of the gas mixture in the cathode B.C.
 
double c_c
 Concentration of the gas mixture in the cathode B.C.
 
double RH_c
 Relative humidity of the gas mixture in the anode B.C.
 

Detailed Description

Class used to store, read from file and define the operating conditions for a fuel cell.

It stores the following:

This information, in conjunction with the water saturation equation is used to compute the mole fractions for each component in the mixture.

If the inlet is humidified air, please set the oxygen mole fraction to 0.21 (default).

In the input file, the following parameters can be specified (see declare_parameters ):

subsection Fuel cell data
(...)
subsection Operating conditions
set Temperature cell = 353
set Cathode pressure = 101325
set Cathode initial oxygen mole fraction (prior to humidification) = 0.21
set Cathode relative humidity = 0.7
set Anode pressure = 101325
set Anode relative humidity = 0.7
set Voltage cell = 0.6
set Voltage drop in the anode = 0.015
set Open circuit voltage = 1.23
end
end

Usage Details:

In order to use this class, first an object of the class needs to be created. Usually, one such objects exists in every application. To create the object, include the .h file in the include application file and in the application data member section add the object. For example:

// Then in the data member declaration (usually a private member)

Once the object is created, the section where the input data will be specified in the input file needs to be delcared. To do so, in the declare_parameters section of your application call the following:

//--------- IN DECLARE_PARAMETERS ------------------------------------------------------
template <int dim>
void
NAME::AppCathode<dim>::declare_parameters(ParameterHandler& param)
{
(...)
OC.declare_parameters(param);
(...)
}

If you intent to run an optimization/parameteric study, then you might have some variables that you wish to modify during the simulation. This is achieved in section set_parameters in the application file:

//--------- IN SET_PARAMETERS ------------------------------------------------------
template <int dim>
void
NAME::AppCathode<dim>::set_parameters(const std::vector<std::string>& name_dvar,
const std::vector<double>& value_dvar,
ParameterHandler& param)
{
(...)
// Set any parameters in the parameter file related to the layers.
OC.set_parameters(name_dvar, value_dvar, param);
(...)
}

Finally, once the input file has been read by our application, your class needs to be initialized. This is achieved using the function initialize()

//--------- IN INITIALIZE ------------------------------------------------------
template <int dim>
void
NAME::AppCathode<dim>::_initialize(ParameterHandler& param)
{
(...)
OC.initialize(param);
}

You are now ready to use your OperatingConditions object!.

Author
M. Secanell, 2009-2013

Constructor & Destructor Documentation

FuelCell::OperatingConditions::OperatingConditions ( )

Constructor.

FuelCell::OperatingConditions::~OperatingConditions ( )

Destructor.

Member Function Documentation

void FuelCell::OperatingConditions::declare_parameters ( ParameterHandler &  param) const

Declare all necessary parameters in order to compute the coefficients.

The parameters that can be specified in the input file are as follows:

subsection Fuel cell data
(...)
subsection Operating conditions
set Temperature cell = 353
set Cathode pressure = 101325
set Cathode initial oxygen mole fraction (prior to humidification) = 0.21
set Cathode relative humidity = 0.7
set Anode pressure = 101325
set Anode relative humidity = 0.7
set Voltage cell = 0.6
set Voltage drop in the anode = 0.015
set Open circuit voltage = 1.23
end
end
double FuelCell::OperatingConditions::get_c_a ( )
inline

Get the total gas concentration in the anode.

double FuelCell::OperatingConditions::get_c_c ( )
inline

Get the total gas concentration in the cathode.

NOTE: This is a constant value. Use only if the total gas concentration is assumed to be constant

double FuelCell::OperatingConditions::get_dV_a ( )
inline

Return the voltage drop in the anode.

Note
Can be used as boundary condition for anode model or initial condition in a full MEA model
double FuelCell::OperatingConditions::get_OCV ( )
inline

Get the open circuit voltage for the cell.

double FuelCell::OperatingConditions::get_pa_atm ( )
inline

Return anode pressure as input in Operating Conditions subsection.

double FuelCell::OperatingConditions::get_pa_Pa ( )
inline

Return anode pressure as input in Operating Conditions subsection.

double FuelCell::OperatingConditions::get_pc_atm ( )
inline

Return cathode pressure as input in Operating Conditions subsection.

double FuelCell::OperatingConditions::get_pc_Pa ( )
inline

Return cathode pressure as input in Operating Conditions subsection.

double FuelCell::OperatingConditions::get_RH_a ( )
inline

Return anode relative humidity as input in Operating Conditions subsection.

double FuelCell::OperatingConditions::get_RH_c ( )
inline

Return cathode relative humidity as input in Operating Conditions subsection.

double FuelCell::OperatingConditions::get_T ( )
inline

Return cell temperture as input in Operating Conditions subsection.

double FuelCell::OperatingConditions::get_V ( )
inline

Return cell voltage as input in Operating Conditions subsection.

double FuelCell::OperatingConditions::get_x_h2 ( )

Get the mole fraction of hydrogen at the anode channel from pressure, temperature, and relative humidity.

double FuelCell::OperatingConditions::get_x_o2 ( )

Get the mole fraction of oxygen at the cathode channel from pressure, temperature, and relative humidity.

double FuelCell::OperatingConditions::get_x_wv ( )

Get the mole fraction of water at the cathode channel from pressure, temperature, and relative humidity note that the anode mole fraction of water is not required, as there are only two species so x_wv_a = 1 - x_h2.

void FuelCell::OperatingConditions::initialize ( ParameterHandler &  param)

Class used to read in data and initialize the necessary data to compute the coefficients.

void FuelCell::OperatingConditions::print_operating_conditions ( )
double FuelCell::OperatingConditions::saturation_pressure ( )

Get the water vapour saturation pressure in atmospheres (atm) using cell temperature.

void FuelCell::OperatingConditions::set_parameters ( const std::vector< std::string > &  name_dvar,
const std::vector< double > &  value_dvar,
ParameterHandler &  param 
) const

This class is used in order to create an interface with DAKOTA.

Each parameter that could be used for optimization is assigned a design variable name that is related to the name on the parameter file. DAKOTA uses the design variable name to request a new analysis with a different design variable. This routine changes the ParameterHandler to take into account the changes on the design variable that DAKOTA requested In this routine we create the following design variables (NOTE: Derivatives not implemented for this values):

  • dV = "Voltage across MEA" in subsections Fuel cell data >> Operating conditions
  • x_o2 = "Cathode oxygen molar fraction" in Fuel cell data >> Operating conditions
  • x_wv = "Cathode water vapour molar fraction" in Fuel cell data >> Operating conditions
double FuelCell::OperatingConditions::voltage_cell_th ( )

NOTE: This function is redefined in base_kinetics class, considering variable temperature and gas pressures.

The function here should only be used for defining Initial condition values. Get the theoretical cell voltage using the cell temperature, and the reactant gas pressures

Member Data Documentation

double FuelCell::OperatingConditions::c_a
private

Concentration of the gas mixture in the anode B.C.

double FuelCell::OperatingConditions::c_c
private

Concentration of the gas mixture in the cathode B.C.

double FuelCell::OperatingConditions::channel_oxygen_mole_fraction
private

Initial amount of oxygen in channel prior to humidification.

double FuelCell::OperatingConditions::dV_a
private

Voltage drop in the anode.

double FuelCell::OperatingConditions::E_th
private

Theoretical voltage for the cell.

double FuelCell::OperatingConditions::OCV
private

Open circuit voltage for the cell.

double FuelCell::OperatingConditions::p_a
private

Pressure of the gas mixture in the anode B.C.

double FuelCell::OperatingConditions::p_c
private

Pressure of the gas mixture in the cathode B.C.

double FuelCell::OperatingConditions::R
private
double FuelCell::OperatingConditions::RH_a
private

Relative humidity of the gas mixture in the anode B.C.

double FuelCell::OperatingConditions::RH_c
private

Relative humidity of the gas mixture in the anode B.C.

double FuelCell::OperatingConditions::T_cell
private

Operating temperature of the cell.

double FuelCell::OperatingConditions::V_cell
private

Operating voltage of the cell.


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