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 Member Functions | List of all members
FuelCell::PolarizationCurve< dim > Class Template Reference

This application is used to compute the polarization curve for a given fuel cell model. More...

#include <polarization_curve.h>

Inheritance diagram for FuelCell::PolarizationCurve< dim >:
Inheritance graph
[legend]
Collaboration diagram for FuelCell::PolarizationCurve< dim >:
Collaboration graph
[legend]

Public Member Functions

 PolarizationCurve ()
 Constructor. More...
 
 ~PolarizationCurve ()
 
void declare_parameters (ParameterHandler &param) const
 Declare all parameters that are needed for: More...
 
void initialize (ParameterHandler &param)
 Read parameters from file. More...
 
- Public Member Functions inherited from FuelCell::ParametricStudy< dim >
 ParametricStudy ()
 Constructor. More...
 
 ~ParametricStudy ()
 
void declare_parameters (ParameterHandler &) const
 
void initialize (ParameterHandler &)
 Read parameters from file. More...
 
void run (ParameterHandler &param, std::string simulator_parameter_file_name, boost::shared_ptr< SimulationSelector< dim > > sim_selector)
 Run a full polarization curve run. More...
 

Private Member Functions

void set_parameters (ParameterHandler &param, const shared_ptr< FuelCell::ApplicationCore::AdaptiveRefinement< dim > > &solver, const int iteration, const std::vector< std::string > parameter_name, const std::vector< double > param_value)
 Modify cell voltage and any other parameters that you would like to modify with respect to the inital input file. More...
 
void print_parameters () const
 Print parameters: More...
 
void print_parameteric_study_header ()
 Print polarization curve header into a file. More...
 

Additional Inherited Members

- Protected Member Functions inherited from FuelCell::ParametricStudy< dim >
void run_point (ParameterHandler &param, const std::string simulator_parameter_file_name, const boost::shared_ptr< SimulationSelector< dim > > sim_selector, const int iteration, const std::vector< std::string > parameter_name, const std::vector< double > param_value, std::map< std::string, double > &functionals)
 Run a single point in the polarization curve and return the current density and any other data. More...
 
void print_iteration_info (const unsigned int iteration, const double param_value) const
 
void print_iteration_info (const unsigned int iteration, const std::vector< double > param_value) const
 
void register_data (const double, std::map< std::string, double > &functionals)
 Store the value of the current density in the solution. More...
 
- Protected Attributes inherited from FuelCell::ParametricStudy< dim >
std::string parameter_filename
 Variable where the output file to store parameteric study results is stored. More...
 
std::vector< std::string > parameter_name
 String that defines the parameter that we would like to modify The parameter should be of the from. More...
 
double p_init
 Initial value to run the parametric study, in the units specified for the value. More...
 
double p_end
 Final parameter value used in the parameteric study. More...
 
double dp
 Spacing between points in the parameteric study. More...
 
std::vector< std::vector
< double > > 
p_values
 Another way to define the sequence of parameter values is to use the vector p_values instead of variables p_init, p_end, and dp. More...
 
bool adaptive
 Set to true if you would like to reduce the voltage increment adaptively if convergence could not be achieved with the larger value. More...
 
double min_dp
 
int n_dpPts
 
bool convergence
 Convergence of the solution. More...
 
std::vector< std::vector
< double > > 
curve
 Map used to store the parametric study data. More...
 
std::ofstream myfile
 File object for output logging. More...
 
std::vector< std::string > name_responses
 
int n_resp
 
const unsigned int max_num_parameters = 10
 Set the maximum number of parameters that you can alter in a Parametric Study. More...
 
FuelCell::ApplicationCore::FEVector coarse_solution
 Vector used to store the solution from the previous iteration if convergence has been achieved. More...
 

Detailed Description

template<int dim>
class FuelCell::PolarizationCurve< dim >

This application is used to compute the polarization curve for a given fuel cell model.

This class reads the linear and a nonlinear applications to be used from the parameter file and uses them in order to obtain a polarization curve for the given application.

Note that this is a specific implementation of the ParametricStudy class.

Warning
It expects that the application has the following capabilities: a) The cell voltage should be set using the folloing flags in the input file:
* subsection Fuel cell data
* subsection Operating conditions
* set Adjust electronic potential boundary condition = true
* set Voltage cell = 0.85 #0.7
* end
* end
*
and the bipolar plate to GDL boundary ID must be known.
* subsection Grid generation
* subsection Internal mesh generator parameters
* subsection Boundary ID
* set c_BPP/GDL = 2
* end
* end
* end
*
Note
see app_cathode application for an example on voltage modification based on this idea.

b) The application can return an the current density. The current density is returned under name "current"

Usage

This class is used in SimulationBuilder to run a complete polarization curve. All parameters for this application should be defined in the main parameter file under the following section:

* subsection Simulator
* subsection Polarization Curve
* set Initial voltage [V] = 1.1
* set Final voltage [V] = 0.5
* set Increment [V] = 0.1
* set Adaptive Increment = false
* set Min. Increment [V] = 0.1
* end
* end
*

To use the class, imply create an object, declare the parameters, read the file, initialize and run

* ParameterHandler param;
* curve.declare_parameters(param);
* std::string simulator_parameter_file_name = "input_file.prm";
* param.read_input(simulator_parameter_file_name,
* true);
* curve.initialize(param);
* curve.run(param, simulator_parameter_file_name, sim_selector);
*
Author
M. Secanell, 2014

Constructor & Destructor Documentation

Constructor.

Member Function Documentation

template<int dim>
void FuelCell::PolarizationCurve< dim >::declare_parameters ( ParameterHandler &  param) const

Declare all parameters that are needed for:

Currently the options implemented are:

* subsection Simulator
* subsection Polarization curve
* set Initial voltage [V] # initial voltage value
* set Final voltage [V] # final voltage value
* set Increment [V] # change in voltage between points
* set Adaptive Increment? # allow value to change if convergence not achieved
* set Min. Increment [V] # if voltage allowed to change, min. increment that should be used
* end
* end
*
template<int dim>
void FuelCell::PolarizationCurve< dim >::initialize ( ParameterHandler &  param)

Read parameters from file.

template<int dim>
void FuelCell::PolarizationCurve< dim >::print_parameteric_study_header ( )
privatevirtual

Print polarization curve header into a file.

Reimplemented from FuelCell::ParametricStudy< dim >.

template<int dim>
void FuelCell::PolarizationCurve< dim >::print_parameters ( ) const
privatevirtual

Print parameters:

Reimplemented from FuelCell::ParametricStudy< dim >.

template<int dim>
void FuelCell::PolarizationCurve< dim >::set_parameters ( ParameterHandler &  param,
const shared_ptr< FuelCell::ApplicationCore::AdaptiveRefinement< dim > > &  solver,
const int  iteration,
const std::vector< std::string >  parameter_name,
const std::vector< double >  param_value 
)
privatevirtual

Modify cell voltage and any other parameters that you would like to modify with respect to the inital input file.

Reimplemented from FuelCell::ParametricStudy< dim >.


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