OpenFCST: The open-source Fuel Cell Simulation Toolbox
|
This class implements a liquid water condensation and evaporation term. More...
#include <liquid_water_source_terms.h>
Public Member Functions | |
Constructors, destructor, and initalization | |
LiquidSourceEquation (FuelCell::SystemManagement &system_management, boost::shared_ptr< FuelCell::ApplicationCore::ApplicationData > data=boost::shared_ptr< FuelCell::ApplicationCore::ApplicationData >()) | |
Constructor. More... | |
virtual | ~LiquidSourceEquation () |
Destructor. More... | |
virtual void | declare_parameters (ParameterHandler ¶m) const |
Declare parameters. More... | |
virtual void | initialize (ParameterHandler ¶m) |
Initialize parameters. More... | |
Local CG FEM based assemblers | |
virtual void | assemble_cell_matrix (FuelCell::ApplicationCore::MatrixVector &cell_matrices, const typename FuelCell::ApplicationCore::DoFApplication< dim >::CellInfo &cell_info, FuelCellShop::Layer::BaseLayer< dim > *const layer) |
Assemble local cell matrix. More... | |
virtual void | assemble_cell_residual (FuelCell::ApplicationCore::FEVector &cell_rhs, const typename FuelCell::ApplicationCore::DoFApplication< dim >::CellInfo &cell_info, FuelCellShop::Layer::BaseLayer< dim > *const layer) |
Assemble local cell residual. More... | |
Accessors and info | |
virtual void | print_equation_info () const |
The function prints out the equation's info about the internal coupling equations with the liquid water source terms. More... | |
double | get_kevap () const |
Returns evaporation rate constant, . More... | |
double | get_kcond () const |
Returns condensation rate constant, . More... | |
void | set_relative_humility (double const x_wv) |
Set the relative humility value from the operating condition class (using get_x_wv) More... | |
virtual void | adjust_internal_cell_couplings (std::vector< couplings_map > &) const |
This function is used to adjust std::vector < internal_cell_couplings > , which is generated after getting internal_cell_couplings from all the equations being used in the application. More... | |
Public Member Functions inherited from FuelCellShop::Equation::EquationBase< dim > | |
virtual void | assemble_bdry_matrix (FuelCell::ApplicationCore::MatrixVector &bdry_matrices, const typename FuelCell::ApplicationCore::DoFApplication< dim >::FaceInfo &bdry_info, FuelCellShop::Layer::BaseLayer< dim > *const layer) |
Assemble local boundary matrix. More... | |
virtual void | assemble_bdry_residual (FuelCell::ApplicationCore::FEVector &bdry_residual, const typename FuelCell::ApplicationCore::DoFApplication< dim >::FaceInfo &bdry_info, FuelCellShop::Layer::BaseLayer< dim > *const layer) |
Assemble local boundary residual. More... | |
const couplings_map & | get_internal_cell_couplings () const |
This function returns internal_cell_couplings of a derived equation class. More... | |
const couplings_map & | get_internal_flux_couplings () const |
This function returns internal_flux_couplings (DG FEM only) of a derived equation class. More... | |
const component_materialID_value_map & | get_component_materialID_value () const |
This function returns component_materialID_value of a derived equation class. More... | |
const component_boundaryID_value_map & | get_component_boundaryID_value () const |
This function returns component_boundaryID_value of a derived equation class. More... | |
const std::vector< BoundaryType > & | get_boundary_types () const |
This function returns boundary_types of a derived equation class. More... | |
const std::vector< std::vector < BoundaryType > > & | get_multi_boundary_types () const |
This function returns multi_boundary_types of a derived equation class. More... | |
const std::vector< OutputType > & | get_output_types () const |
This function returns output_types of a derived equation class. More... | |
const std::vector< std::vector < OutputType > > & | get_multi_output_types () const |
This function returns multi_output_types of a derived equation class. More... | |
const std::string & | get_equation_name () const |
This function returns equation_name of a derived equation class. More... | |
const std::vector< unsigned int > & | get_matrix_block_indices () const |
This function returns matrix_block_indices of a derived equation class. More... | |
const std::vector< unsigned int > & | get_residual_indices () const |
This function returns residual_indices of a derived equation class. More... | |
Protected Member Functions | |
void | get_temp_related_parameters (double Temp, double c_pressure, double &psat, double &dpsat_dT, double &h_lv, double &dhlv_dT, double &Kelvin_factor, double &psat_kelvin, double &dpsat_kelvin_dpc, double &dpsat_kelvin_dT, FuelCellShop::Material::WaterVapor water) const |
Inline function to reduce the repeatability of the code This function is used to compute Kelvin saturation pressure, latent heat of water and all the derivates with respect to Kelvin saturation pressure. More... | |
Local CG FEM based assemblers - make_ functions | |
virtual void | make_assemblers_generic_constant_data () |
This function computes Local CG FEM based assemblers - constant data (generic). More... | |
virtual void | make_assemblers_cell_constant_data (const typename FuelCell::ApplicationCore::DoFApplication< dim >::CellInfo &cell_info) |
This function computes Local CG FEM based assemblers - constant data (cell) and allocates the memory for shape functions , shape function gradients , and JxW_cell in Local CG FEM based assemblers - variable data (cell) . More... | |
virtual void | make_assemblers_cell_variable_data (const typename FuelCell::ApplicationCore::DoFApplication< dim >::CellInfo &cell_info, FuelCellShop::Layer::BaseLayer< dim > *const layer) |
This function computes Local CG FEM based assemblers - variable data (cell) . More... | |
Other make_ functions | |
virtual void | make_boundary_types () |
This function fills out boundary_types . More... | |
virtual void | make_output_types () |
This function fills out output_types . More... | |
Protected Member Functions inherited from FuelCellShop::Equation::EquationBase< dim > | |
EquationBase (FuelCell::SystemManagement &sys_management, boost::shared_ptr< FuelCell::ApplicationCore::ApplicationData > data=boost::shared_ptr< FuelCell::ApplicationCore::ApplicationData >()) | |
Constructor. More... | |
virtual | ~EquationBase () |
Destructor. More... | |
virtual void | set_parameters (const std::vector< std::string > &name_dvar, const std::vector< double > &value_dvar, ParameterHandler ¶m) |
Set parameters using the parameter file, in order to run parametric/optimization studies. More... | |
virtual void | make_assemblers_bdry_constant_data (const typename FuelCell::ApplicationCore::DoFApplication< dim >::FaceInfo &bdry_info) |
virtual void | make_assemblers_bdry_variable_data (const typename FuelCell::ApplicationCore::DoFApplication< dim >::FaceInfo &bdry_info, FuelCellShop::Layer::BaseLayer< dim > *const layer) |
void | select_cell_assemblers (const typename FuelCell::ApplicationCore::DoFApplication< dim >::CellInfo &cell_info, FuelCellShop::Layer::BaseLayer< dim > *const layer) |
This routine is used to select the make_assembly routines that need to be called inside assemble_cell_matrix to compute. More... | |
virtual void | make_internal_cell_couplings () |
This function fills out internal_cell_couplings of a derived equation class. More... | |
virtual void | make_internal_flux_couplings () |
This function fills out internal_flux_couplings (DG FEM only) of a derived equation class. More... | |
virtual void | make_component_materialID_value () |
This function fills out component_materialID_value of a derived equation class. More... | |
virtual void | make_component_boundaryID_value () |
This function fills out component_boundaryID_value of a derived equation class. More... | |
virtual void | make_multi_boundary_types () |
This function fills out multi_boundary_types of a derived equation class. More... | |
virtual void | make_multi_output_types () |
This function fills out multi_output_types of a derived equation class. More... | |
virtual void | make_matrix_block_indices () |
This function is only needed to provide the last argument to dealII_to_appframe. More... | |
virtual void | make_residual_indices () |
This function is only needed to provide the last argument to dealII_to_appframe. More... | |
virtual void | assemble_cell_Jacobian_matrix (FuelCell::ApplicationCore::MatrixVector &cell_matrices, const typename FuelCell::ApplicationCore::DoFApplication< dim >::CellInfo &cell_info, FuelCellShop::Layer::BaseLayer< dim > *const layer) |
Assemble the local Jacobian Matrix for Non-Linear problems. More... | |
virtual void | assemble_bdry_Jacobian_matrix (FuelCell::ApplicationCore::MatrixVector &bdry_matrices, const typename FuelCell::ApplicationCore::DoFApplication< dim >::FaceInfo &bdry_info, FuelCellShop::Layer::BaseLayer< dim > *const layer) |
Assemble local Jacobian boundary matrix for Non-Linear problems. More... | |
virtual void | assemble_cell_linear_matrix (FuelCell::ApplicationCore::MatrixVector &cell_matrices, const typename FuelCell::ApplicationCore::DoFApplication< dim >::CellInfo &cell_info, FuelCellShop::Layer::BaseLayer< dim > *const layer) |
Assemble the local cell matrix for Linear problems. More... | |
virtual void | assemble_cell_residual_rhs (FuelCell::ApplicationCore::FEVector &cell_residual, const typename FuelCell::ApplicationCore::DoFApplication< dim >::CellInfo &cell_info, FuelCellShop::Layer::BaseLayer< dim > *const layer) |
Assemble local cell RHS for nonlinear problems. More... | |
virtual void | assemble_cell_linear_rhs (FuelCell::ApplicationCore::FEVector &cell_residual, const typename FuelCell::ApplicationCore::DoFApplication< dim >::CellInfo &cell_info, FuelCellShop::Layer::BaseLayer< dim > *const layer) |
Assemble local cell RHS for Linear problems. More... | |
virtual void | assemble_bdry_linear_matrix (FuelCell::ApplicationCore::MatrixVector &bdry_matrices, const typename FuelCell::ApplicationCore::DoFApplication< dim >::FaceInfo &bdry_info, FuelCellShop::Layer::BaseLayer< dim > *const layer) |
Assemble local boundary matrix for linear problems. More... | |
virtual void | assemble_bdry_linear_rhs (FuelCell::ApplicationCore::FEVector &bdry_residual, const typename FuelCell::ApplicationCore::DoFApplication< dim >::FaceInfo &bdry_info, FuelCellShop::Layer::BaseLayer< dim > *const layer) |
Assemble local boundary RHS for linear problems. More... | |
void | standard_to_block_wise (FullMatrix< double > &target) const |
This function changes the order of dealii::FullMatrix<double> target from standard to block-wise. More... | |
void | standard_to_block_wise (Vector< double > &target) const |
This function changes the order of dealii::Vector<double> target from standard to block-wise. More... | |
void | dealII_to_appframe (FuelCell::ApplicationCore::MatrixVector &dst, const FullMatrix< double > &src, const std::vector< unsigned int > &matrix_block_indices) const |
This function converts the standard ordered structure dealii::FullMatrix<double> src into the block-wise ordered structure FuelCell::ApplicationCore::MatrixVector dst . More... | |
void | dealII_to_appframe (FuelCell::ApplicationCore::FEVector &dst, const Vector< double > &src, const std::vector< unsigned int > &residual_indices) const |
This function converts the standard ordered structure dealii::Vector<double> src into the block-wise ordered structure FuelCell::ApplicationCore::FEVector dst . More... | |
bool | belongs_to_boundary (const unsigned int &tria_boundary_id, const unsigned int ¶m_boundary_id) const |
This function returns true if a boundary indicator of an external face on the triangulation coincides with a boundary indicator defined in the parameters file of a derived equation class. More... | |
void | print_caller_name (const std::string &caller_name) const |
This function is used to print out the name of another function that has been declared in the scope of this class, but not yet been implemented. More... | |
Protected Attributes | |
bool | cell_residual_counter |
Counter set to TRUE when cell_residual is being assembled. More... | |
unsigned int | last_iter_cell |
Variable used to store the index in cell_info->global_data of the previous Newton solution The solution at the previous iteration is used to compute cell_matrix and cell_residual. More... | |
double | T_constant |
This tempearture is used when not solving temperature as the solution variable. More... | |
double | Relative_humility |
This is used to return relative humility the when not solving water vapor as the solution variable. More... | |
bool | Relative_humility_is_set |
This is used to check if relative humility is set when not solving water vapor as the solution variable. More... | |
Generic Constant Data | |
std::map< unsigned int, double > | capillary_pressure_current_flux_map |
VariableInfo | p_liquid_water |
VariableInfo structure corresponding to "liquid_capillary_pressure" . More... | |
VariableInfo | x_water |
VariableInfo structure corresponding to "water_molar_fraction" . More... | |
VariableInfo | t_rev |
VariableInfo structure corresponding to "temperature_of_REV" . More... | |
unsigned int | fickswater_blockindex_xwater |
Block index for "water_molar_fraction" corresponding to "Ficks Transport Equation - water". More... | |
unsigned int | fickswater_blockindex_pliquid |
Block index for "liquid_capillary_pressure" corresponding to "Ficks Transport Equation - water". More... | |
unsigned int | fickswater_blockindex_trev |
Block index for "temperature_of_REV" corresponding to "Ficks Transport Equation - water". More... | |
unsigned int | thermal_blockindex_xwater |
Block index for "water_molar_fraction" corresponding to "Thermal Transport Equation". More... | |
unsigned int | thermal_blockindex_pliquid |
Block index for "liquid_capillary_pressure" corresponding to "Thermal Transport Equation". More... | |
unsigned int | thermal_blockindex_trev |
Block index for "temperature_of_REV" corresponding to "Thermal Transport Equation". More... | |
double | M_water |
Molar weight of water in grams/mole. More... | |
double | k_e |
Evaporation rate constant, . More... | |
double | k_c |
Condensation rate constant, . More... | |
double | rho_l |
Density of liquid water, . More... | |
Local CG FEM based assemblers - variable data (cell) | |
double | p_cell |
Total pressure in the cell. More... | |
std::vector< double > | area_lv_cell |
Interfacial surface area per unit volume, , at all quadrature points in the cell. More... | |
std::vector< double > | darea_lv_dp_cell |
, at all quadrature points in the cell. More... | |
std::vector< std::vector < double > > | phi_p_cell |
shape functions. More... | |
std::vector< std::vector < double > > | phi_xwater_cell |
shape functions. More... | |
std::vector< std::vector < double > > | phi_T_cell |
shape functions. More... | |
Protected Attributes inherited from FuelCellShop::Equation::EquationBase< dim > | |
unsigned int | dofs_per_cell |
Number of degrees of freedom per cell. More... | |
unsigned int | n_q_points_cell |
Number of quadrature points per cell. More... | |
unsigned int | n_q_points_bdry |
Number of quadrature points per boundary. More... | |
DoFHandler< dim > ::active_cell_iterator | cell |
Currently active DoFHandler<dim> active cell iterator. More... | |
DoFHandler< dim > ::active_face_iterator | bdry |
Currently active DoFHandler<dim> active boundary iterator. More... | |
std::vector< double > | JxW_cell |
Jacobian of mapping by Weight in the quadrature points of a cell. More... | |
std::vector< double > | JxW_bdry |
Jacobian of mapping by Weight in the quadrature points of a boundary. More... | |
std::vector< Point< dim > > | normal_vectors |
Normal vectors in the quadrature points of a boundary. More... | |
std::vector< std::vector < Point< dim > > > | tangential_vectors |
Tangential vectors in the quadrature points of a boundary. More... | |
FuelCell::SystemManagement * | system_management |
Pointer to the external YourApplication<dim>::system_management object. More... | |
couplings_map | internal_cell_couplings |
This object contains the info on how the equations and solution variables of a derived equation class are coupled. More... | |
couplings_map | internal_flux_couplings |
This object contains the info on how the "X" and "Y" of a derived equation class are coupled (DG FEM only). More... | |
component_materialID_value_map | component_materialID_value |
This object reflects the following structure (see FuelCell::InitialAndBoundaryData namespace docs): More... | |
component_boundaryID_value_map | component_boundaryID_value |
This object reflects the following structure (see FuelCell::InitialAndBoundaryData namespace docs): More... | |
std::vector< BoundaryType > | boundary_types |
The list of boundary types of a derived equation class. More... | |
std::vector< std::vector < BoundaryType > > | multi_boundary_types |
The list of multiple boundary types of a derived equation class. More... | |
std::vector< OutputType > | output_types |
The list of output types of a derived equation class. More... | |
std::vector< std::vector < OutputType > > | multi_output_types |
The list of multiple output types of a derived equation class. More... | |
std::string | equation_name |
The name of a derived equation class. More... | |
std::string | name_base_variable |
Const std::string member storing name of the base solution variable corresponding to the equation represented by this class. More... | |
std::vector< unsigned int > | matrix_block_indices |
The system matrix block indices (a derived equation class) drawn from the global structure (a derived equation class + other active equation classes included into the computation). More... | |
std::vector< unsigned int > | residual_indices |
The residual indices (a derived equation class) drawn from the global structure (a derived equation class + other active equation classes included into the computation). More... | |
std::vector< bool > | counter |
This vector contains the collection of internal "counters" used by the derived equation classes. More... | |
EquationFlags | assemble_flags |
This vector contains a collection of internal flags to tell derived equation classes what needs to be re-computed. More... | |
boost::shared_ptr < FuelCell::ApplicationCore::ApplicationData > | data |
Data object for the application data to be passed to the equation classes. More... | |
std::string | solution_vector_name |
The name of the solution vector in FEVectors. More... | |
std::string | residual_vector_name |
The name of the residual vector name in FEVectors. More... | |
Additional Inherited Members | |
Public Attributes inherited from FuelCellShop::Equation::EquationBase< dim > | |
bool | variable_initial_data |
true , if variable initial data is prescribed on a part of the domain. More... | |
bool | variable_boundary_data |
true , if variable Dirichlet boundary conditions are prescribed on a part of the boundary. More... | |
This class implements a liquid water condensation and evaporation term.
It is to be noted that this equation is suggested to be solved alongside Thermal Transport Equation and Ficks Transport Equation - water. Thus these two equations are necessary while considering this equation class.
It is solved with respect to:
(capillary_pressure
),
(Temperature
) and
(water_molar_fraction
)This equation can be written as:
water_molar_fraction
, .
(temperature_of_REV
), .No
liquid
water
flux
or Symmetric
boundary conditions, as FEM formulation automatically implies a particular boundary is one of these cases, by default.We solve the whole problem by linearizing the governing equation at each Newton iteration with subsequent CG FEM discretization in space. The class contains the necessary class members to add the necessary contributions to cell_matrix and cell_residual to the governing equations used to analyze lambda transport,
For users:
In the input file, the evaporation and condensation rate constants need to be provided as follows:
For developers:
FuelCellShop::Equation::LiquidSourceEquation< dim >::LiquidSourceEquation | ( | FuelCell::SystemManagement & | system_management, |
boost::shared_ptr< FuelCell::ApplicationCore::ApplicationData > | data = boost::shared_ptr< FuelCell::ApplicationCore::ApplicationData >() |
||
) |
Constructor.
|
virtual |
Destructor.
|
virtual |
This function is used to adjust std::vector
<
internal_cell_couplings
>
, which is generated after getting internal_cell_couplings
from all the equations being used in the application.
internal_cell_couplings
is created, and BEFORE make_cell_couplings
of SystemManagement is called.
|
virtual |
Assemble local cell matrix.
Reimplemented from FuelCellShop::Equation::EquationBase< dim >.
|
virtual |
Assemble local cell residual.
Reimplemented from FuelCellShop::Equation::EquationBase< dim >.
|
virtual |
Declare parameters.
Reimplemented from FuelCellShop::Equation::EquationBase< dim >.
|
inline |
Returns condensation rate constant, .
References FuelCellShop::Equation::LiquidSourceEquation< dim >::k_c.
|
inline |
Returns evaporation rate constant, .
References FuelCellShop::Equation::LiquidSourceEquation< dim >::k_e.
|
inlineprotected |
Inline function to reduce the repeatability of the code This function is used to compute Kelvin saturation pressure, latent heat of water and all the derivates with respect to Kelvin saturation pressure.
References Units::convert(), FuelCellShop::Material::LiquidWater::deriv_latentVap_heat(), FuelCellShop::Material::PureGas::get_Dwater_vapor_saturation_pressure_Dtemperature(), FuelCellShop::Material::PureGas::get_water_vapor_saturation_pressure(), FuelCellShop::Material::LiquidWater::latentVap_heat(), FuelCellShop::Equation::LiquidSourceEquation< dim >::M_water, Units::PER_C_UNIT3, Units::PER_UNIT2, Constants::R(), and FuelCellShop::Equation::LiquidSourceEquation< dim >::rho_l.
|
virtual |
Initialize parameters.
This class will call make_internal_cell_couplings and make_boundary_types.
Reimplemented from FuelCellShop::Equation::EquationBase< dim >.
|
protectedvirtual |
This function computes Local CG FEM based assemblers - constant data (cell) and allocates the memory for shape
functions
, shape
function
gradients
, and JxW_cell
in Local CG FEM based assemblers - variable data (cell) .
Reimplemented from FuelCellShop::Equation::EquationBase< dim >.
|
protectedvirtual |
This function computes Local CG FEM based assemblers - variable data (cell) .
Reimplemented from FuelCellShop::Equation::EquationBase< dim >.
|
protectedvirtual |
This function computes Local CG FEM based assemblers - constant data (generic).
Reimplemented from FuelCellShop::Equation::EquationBase< dim >.
|
inlineprotectedvirtual |
This function fills out boundary_types
.
Currently, NOT IMPLEMENTED.
Reimplemented from FuelCellShop::Equation::EquationBase< dim >.
|
inlineprotectedvirtual |
This function fills out output_types
.
Currently, NOT IMPLEMENTED.
Reimplemented from FuelCellShop::Equation::EquationBase< dim >.
|
virtual |
The function prints out the equation's info about the internal coupling equations with the liquid water source terms.
Reimplemented from FuelCellShop::Equation::EquationBase< dim >.
|
inline |
Set the relative humility value from the operating condition class (using get_x_wv)
References FuelCellShop::Equation::LiquidSourceEquation< dim >::Relative_humility, and FuelCellShop::Equation::LiquidSourceEquation< dim >::Relative_humility_is_set.
|
protected |
Interfacial surface area per unit volume, , at all quadrature points in the cell.
|
protected |
|
protected |
Counter set to TRUE when cell_residual
is being assembled.
This ensures that only effective transport properties are calculated, not their derivatives. (improves speed)
|
protected |
, at all quadrature points in the cell.
|
protected |
Block index for "liquid_capillary_pressure"
corresponding to "Ficks Transport Equation - water".
|
protected |
Block index for "temperature_of_REV"
corresponding to "Ficks Transport Equation - water".
|
protected |
Block index for "water_molar_fraction"
corresponding to "Ficks Transport Equation - water".
|
protected |
Condensation rate constant, .
Referenced by FuelCellShop::Equation::LiquidSourceEquation< dim >::get_kcond().
|
protected |
Evaporation rate constant, .
Referenced by FuelCellShop::Equation::LiquidSourceEquation< dim >::get_kevap().
|
protected |
Variable used to store the index in cell_info->global_data of the previous Newton solution The solution at the previous iteration is used to compute cell_matrix and cell_residual.
|
protected |
Molar weight of water in grams/mole.
Referenced by FuelCellShop::Equation::LiquidSourceEquation< dim >::get_temp_related_parameters().
|
protected |
Total pressure in the cell.
|
protected |
VariableInfo structure corresponding to "liquid_capillary_pressure"
.
|
protected |
shape functions.
phi_p_cell
[
q
]
[
k
] denotes -th shape function computed in -th quadrature point of the cell.
|
protected |
shape functions.
phi_T_cell
[
q
]
[
k
] denotes -th shape function computed in -th quadrature point of the cell.
|
protected |
shape functions.
phi_xwater_cell
[
q
]
[
k
] denotes -th shape function computed in -th quadrature point of the cell.
|
protected |
This is used to return relative humility the when not solving water vapor as the solution variable.
Referenced by FuelCellShop::Equation::LiquidSourceEquation< dim >::set_relative_humility().
|
protected |
This is used to check if relative humility is set when not solving water vapor as the solution variable.
Referenced by FuelCellShop::Equation::LiquidSourceEquation< dim >::set_relative_humility().
|
protected |
Density of liquid water, .
Referenced by FuelCellShop::Equation::LiquidSourceEquation< dim >::get_temp_related_parameters().
|
protected |
This tempearture is used when not solving temperature as the solution variable.
|
protected |
VariableInfo structure corresponding to "temperature_of_REV"
.
|
protected |
Block index for "liquid_capillary_pressure"
corresponding to "Thermal Transport Equation".
|
protected |
Block index for "temperature_of_REV"
corresponding to "Thermal Transport Equation".
|
protected |
Block index for "water_molar_fraction"
corresponding to "Thermal Transport Equation".
|
protected |
VariableInfo structure corresponding to "water_molar_fraction"
.