This application is used to perform a parametric study for a given fuel cell model.
More...
|
virtual void | set_parameters (ParameterHandler ¶m, 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 | run_point (ParameterHandler ¶m, 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 |
|
virtual void | print_parameters () const |
| Print parameters: More...
|
|
virtual void | print_parameteric_study_header () |
| Print parameteric study header into a file. More...
|
|
void | register_data (const double, std::map< std::string, double > &functionals) |
| Store the value of the current density in the solution. More...
|
|
|
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...
|
|
template<int dim>
class FuelCell::ParametricStudy< dim >
This application is used to perform a parametric study 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 parameteric study for the given application.
Usage
This class is used in SimulationBuilder to run a complete parameteric study. All parameters for this application should be defined in the main parameter file. There are two methods for running a parametric study. The first involves specifying multiple parameters (up to 10) and a respective list that these parameters values will be set to. An example of this is:
* subsection Simulator
* subsection Parametric study
* set Parameter 1 name = subsection>>subsection>>name1
* set Parameter 1 values = 0.1, 0.2, 0.3 #Solves for value 0.1 first then sequentially moves through list
*
* set Parameter 2 name = subsection>>subsection>>name2
* set Parameter 2 values = 1.0, 0.9, 0.8
* ...
* end
* end
*
- Note
- : On the first iteration it will solve the problem with name1 set to 0.1 and name2 set to 1.0. On the next iteration it will solve with name1 set to 0.2 and name2 set to 0.9, ...
-
: If you wish to change a value at a boundary or material ID then when specifying name1 add ":#" where # is the boundary/material ID number, e.g. Boundary data>>density_species_1 [g/cm^3]:2
-
: If you want to alter more than 10 parameters at a time, change max_num_parameters in parametric_study.h file and recompile OpenFCST.
The second method only allows for one parameter to be changed but it has the ease that you do not need to specify all the values that you wish to run the simulation at. Instead you enter an upper and lower bounds and the step size. An example of this is:
* subsection Simulator
* subsection Parametric study
* set Parameter 1 name = subsection>>subsection>>name
* set Initial value = 0.5 #Enter the value you would like to start the parameteric study from.
* set Final value = 1.0 #Enter the final value for the parameteric study.
* set Increment = 0.1 #Spacing between points in the parameteric study
* set Adaptive Increment =
false #Set to
true if you would like to reduce the voltage increment adaptively
if convergence could not be achieved with the larger value
* set Min. Increment = 0.1 #If Adaptive Increment is set to true, this value controls the
* #minimum change in cell voltage before the parameter study gives up
* #and the voltage is updated again. Note that this value has to be more
* #than 0.01 V as a value of zero would lead to an infinite loop.
* end
* end
*
To use the class, imply create an object, declare the parameters, read the file, initialize and run
* ParameterHandler param;
* std::string simulator_parameter_file_name = "input_file.prm";
* param.read_input(simulator_parameter_file_name,
* true);
* curve.
run(param, simulator_parameter_file_name, sim_selector);
*
- Author
- M. Secanell, 2014