OpenFCST: The open-source Fuel Cell Simulation Toolbox
|
Class used to calculate the total mass flux at a boundary. More...
#include <response_mass_flux.h>
Public Member Functions | |
Constructor, declaration and initialization | |
MassFluxResponse (const FuelCell::SystemManagement &sm) | |
~MassFluxResponse () | |
Compute functional | |
void | compute_responses (const typename DoFApplication< dim >::CellInfo &info, FuelCellShop::Layer::BaseLayer< dim > *const layer, std::map< FuelCellShop::PostProcessing::ResponsesNames, double > &respMap) const |
This member function computes the mass flux in a cell. More... | |
void | compute_responses (std::vector< FuelCellShop::SolutionVariable > solution_variables, const typename DoFApplication< dim >::CellInfo &info, FuelCellShop::Layer::BaseLayer< dim > *const layer, std::map< FuelCellShop::PostProcessing::ResponsesNames, double > &respMap) const |
Routine used in order to compute the response with a modified solution (not the one stored in CellInfo object.) More... | |
void | bdry_responses (std::vector< double > &dst, const typename FuelCell::ApplicationCore::DoFApplication< dim >::FaceInfo &bdry_info, std::vector< std::string > &responseNames, std::vector< unsigned int > &bdryIDs) const |
This member function computes the total mass flux along specified boundaries. More... | |
Private Attributes | |
Compute parameters | |
unsigned int | numOutputVars |
private variable for storing the number of species to calculate the mass flux for. More... | |
std::vector< unsigned int > | bdryIDs |
private variable for storing a vector of the boundary ids to calculate mass flux along. More... | |
std::vector< std::string > | nameOutputVars |
private variable for storing the names of species to calculate the mass flux for. More... | |
Additional Inherited Members | |
Protected Member Functions inherited from FuelCellShop::PostProcessing::BaseResponse< dim > | |
BaseResponse (const FuelCell::SystemManagement &sm) | |
Constructor. More... | |
virtual | ~BaseResponse () |
Destructor. More... | |
virtual void | declare_parameters (ParameterHandler ¶m) const |
Declare any necessary parameters to compute the functional. More... | |
virtual void | initialize (ParameterHandler ¶m) |
Initialize class parameters. More... | |
Protected Attributes inherited from FuelCellShop::PostProcessing::BaseResponse< dim > | |
const FuelCell::SystemManagement * | system_management |
Pointer to system management. More... | |
Class used to calculate the total mass flux at a boundary.
This class returns the total mass flux at specified boundary IDs, i.e.
User can then divide the obtained total quantity by the length (2D simulation) or surface area (3D simulation) in order to determine average mass flux.
Note: be careful if combining multiple boundary ids into one. For example if you have two outlets that have the same BCs and you call them by the same boundary ID then calculating the average mass flux gets a bit more tricky, as you need to normalize the integral over each outlet. If the outlets are the same dimensions then just divide by the length of one of the outlets (NOT the combined length of the outlets).
In the input data file, the following parameters can be specified (see declare_parameters ):
In order to use this classes, first add it to your application as an object.
In the class constructor, construct the class passing SystemManagement. This object is used in order to find the solution variables as appropriate, and flag parameters.
Note that unlike some response classes, this class does not require declare parameters, as information is declared by the OptimizationBlockMatrixApplication class. initialize() is used so the parameters do not need to be passed to MassFluxResponse.
Next, the object has to be initialized once SystemManagement and ThermalTransportEquation objects have already been initialized:
Finally, the object is ready for use in bdry_responses in your application:
|
inline |
|
inline |
void FuelCellShop::PostProcessing::MassFluxResponse< dim >::bdry_responses | ( | std::vector< double > & | dst, |
const typename FuelCell::ApplicationCore::DoFApplication< dim >::FaceInfo & | bdry_info, | ||
std::vector< std::string > & | responseNames, | ||
std::vector< unsigned int > & | bdryIDs | ||
) | const |
This member function computes the total mass flux along specified boundaries.
Call this function in the application class in the bdry_responses() function:
|
virtual |
This member function computes the mass flux in a cell.
Implements FuelCellShop::PostProcessing::BaseResponse< dim >.
|
virtual |
Routine used in order to compute the response with a modified solution (not the one stored in CellInfo object.)
Implements FuelCellShop::PostProcessing::BaseResponse< dim >.
|
private |
private variable for storing a vector of the boundary ids to calculate mass flux along.
Set in initalize();
|
private |
private variable for storing the names of species to calculate the mass flux for.
This is important in case the user has three species but only wants the mass flux for two of them. As well, this way the user can specify what order they want the output in. Format for strings should be: "total_mass_flux_species_" + integer.
|
private |
private variable for storing the number of species to calculate the mass flux for.
Set in initialize().