17 #ifndef _FUELCELLSHOP__RESPONSE_WATER_SORPTION_H
18 #define _FUELCELLSHOP__RESPONSE_WATER_SORPTION_H
21 #include <base/parameter_handler.h>
22 #include <base/point.h>
23 #include <base/function.h>
24 #include <lac/vector.h>
25 #include <fe/fe_values.h>
44 using namespace dealii;
46 namespace FuelCellShop
49 namespace PostProcessing
139 if ( this->system_management->solution_in_userlist(
"membrane_water_content") )
141 lambda.solution_index = this->system_management->solution_name_to_index(
"membrane_water_content");
142 lambda.fetype_index = this->system_management->block_info->base_element[lambda.solution_index];
143 lambda.indices_exist =
true;
146 throw std::runtime_error(
"membrane_water_content variable required for WaterSorptionResponse");
148 if ( this->system_management->solution_in_userlist(
"water_molar_fraction") )
150 x_w.solution_index = this->system_management->solution_name_to_index(
"water_molar_fraction");
151 x_w.fetype_index = this->system_management->block_info->base_element[x_w.solution_index];
152 x_w.indices_exist =
true;
155 throw std::runtime_error(
"water_molar_fraction variable required for WaterSorptionResponse");
157 if ( this->system_management->solution_in_userlist(
"temperature_of_REV") )
159 tRev.solution_index = this->system_management->solution_name_to_index(
"temperature_of_REV");
160 tRev.fetype_index = this->system_management->block_info->base_element[tRev.solution_index];
161 tRev.indices_exist =
true;
164 time_k = sorption_source->get_time_constant();
186 std::map<FuelCellShop::PostProcessing::ResponsesNames, double>& respMap)
const
193 AssertThrow(base_layer == CatalystLayer,
194 ExcMessage(
"WaterSorptionResponse can only be used with a CatalystLayer object"));
197 unsigned int n_q_points_cell = (info.
fe(lambda.fetype_index)).n_quadrature_points;
200 unsigned int solIndex = info.
global_data->find_vector(
"Solution");
208 if (tRev.indices_exist)
211 std::vector<double> lambdaValue( info.
values[solIndex][lambda.solution_index] );
213 std::vector<double> lambdaEq(n_q_points_cell, 0.0);
216 for (
unsigned int q = 0; q < n_q_points_cell; ++q){
217 double JxW = info.
fe(lambda.fetype_index).JxW(q);
229 std::map<FuelCellShop::PostProcessing::ResponsesNames, double>& resp)
const
231 throw std::runtime_error(
"WaterSorptionResponse::compute_responses(solution_variables, info, layer, resp) not implemented");
WaterSorptionResponse(const FuelCell::SystemManagement &sm, const FuelCellShop::Equation::SorptionSourceTerms< dim > *sst)
Definition: response_water_sorption.h:125
const unsigned int dim
Definition: fcst_constants.h:24
This class assembles source terms corresponding to sorption/desorption of water inside the catalyst l...
Definition: sorption_source_terms.h:103
double get_EW() const
Get Equivalent Weight (grams of dry polymer electrolyte per moles of ) of the polymer electrolyte mat...
Definition: polymer_electrolyte_material_base.h:448
FuelCellShop::Equation::VariableInfo x_w
VariableInfo structure corresponding to the "water_molar_fraction".
Definition: response_water_sorption.h:256
SmartPointer< const FEVectors > global_data
The smart pointer to the FEVectors object called global_data.
Definition: mesh_loop_info_objects.h:780
This structure is used to encapsulate data from constant values and variable solution data that is us...
Definition: fcst_variables.h:86
void set_water_molar_fraction(const FuelCellShop::SolutionVariable &x_in)
Set the solution variable, water vapor molar fraction .
Definition: polymer_electrolyte_material_base.h:526
Virtual class used to develop a common interface to a set of functions used to evaluate functionals t...
Definition: base_response.h:129
virtual void sorption_isotherm(std::vector< double > &) const
Compute the equilibrium water content, , inside the polymer electrolyte for vapor-equilibriated case...
Definition: polymer_electrolyte_material_base.h:142
Definition: system_management.h:75
double get_density() const
Get the density [gm/cm^3] of the dry polymer electrolyte material.
Definition: polymer_electrolyte_material_base.h:430
Class used to calculate the amount of water sorbed inside the catalyst layer.
Definition: response_water_sorption.h:120
This class is created for the objects handed to the mesh loops.
Definition: mesh_loop_info_objects.h:625
void initialize(ParameterHandler ¶m)
Initialize class parameters.
Definition: response_water_sorption.h:137
virtual const std::type_info & get_base_type() const
This member function return the name of the type of layer, i.e.
Definition: base_layer.h:177
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 water adsorbed/desorbed from the electrolyte in the catalyst layer...
Definition: response_water_sorption.h:184
virtual FuelCellShop::Material::PolymerElectrolyteBase * get_electrolyte() const
Method to provide access to pointer of the electrolyte object of the catalyst layer.
Definition: catalyst_layer.h:809
Definition: system_management.h:67
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 > &resp) const
Routine used in order to compute the response with a modified solution (not the one stored in info) ...
Definition: response_water_sorption.h:226
double time_k
Rate of sorption/desorption.
Definition: response_water_sorption.h:244
const FuelCellShop::Equation::SorptionSourceTerms< dim > * sorption_source
Pointer to SorptionSourceTerms object.
Definition: response_water_sorption.h:238
Definition: base_response.h:60
~WaterSorptionResponse()
Definition: response_water_sorption.h:132
IMPORTANT: Add all new solution variables and equations here !
Definition: system_management.h:271
This simple structure stores certain information regarding a particular variable for the equation (al...
Definition: equation_base.h:121
FuelCellShop::Equation::VariableInfo lambda
VariableInfo structure corresponding to the "membrane_water_content".
Definition: response_water_sorption.h:250
std::vector< std::vector< std::vector< double > > > values
The vector containing the values of finite element functions in the quadrature points.
Definition: mesh_loop_info_objects.h:790
void set_temperature(const FuelCellShop::SolutionVariable &T_in)
Set the solution variable, temperature [Kelvin].
Definition: polymer_electrolyte_material_base.h:509
Virtual class used to characterize a generic layer interface.
Definition: base_layer.h:58
FuelCellShop::Equation::VariableInfo tRev
VariableInfo structure corresponding to the "temperature_of_REV".
Definition: response_water_sorption.h:262
const FEVALUESBASE & fe() const
Access to a single actual FEVALUES object.
Definition: mesh_loop_info_objects.h:1105
Virtual class used to provide the interface for all CatalystLayer children.
Definition: catalyst_layer.h:130