24#ifndef DUMUX_ELECTROCHEMISTRY_NI_HH
25#define DUMUX_ELECTROCHEMISTRY_NI_HH
40template <
class Scalar,
class Indices,
class Flu
idSystem,
class Gr
idGeometry, ElectroChemistryModel electroChemistryModel>
48 contiH2OEqIdx = Indices::conti0EqIdx + FluidSystem::H2OIdx,
49 contiO2EqIdx = Indices::conti0EqIdx + FluidSystem::O2Idx,
50 energyEqIdx = Indices::energyEqIdx,
53 using GridView =
typename GridGeometry::GridView;
55 using GlobalPosition =
typename Dune::FieldVector<typename GridView::ctype, GridView::dimensionworld>;
56 using CellVector =
typename Dune::FieldVector<typename GridView::ctype, GridView::dimension>;
68 template<
class SourceValues>
70 const std::string& paramGroup =
"")
75 static Scalar gridYMax = getParamFromGroup<GlobalPosition>(paramGroup,
"Grid.UpperRight")[1];
76 static Scalar nCellsY = getParamFromGroup<GlobalPosition>(paramGroup,
"Grid.Cells")[1];
79 const auto lengthBox = gridYMax/nCellsY;
81 currentDensity *= 2.0/lengthBox;
83 currentDensity *= 1.0/lengthBox;
85 static Scalar transportNumberH2O = getParam<Scalar>(
"ElectroChemistry.TransportNumberH20");
86 static Scalar thermoneutralVoltage = getParam<Scalar>(
"ElectroChemistry.ThermoneutralVoltage");
87 static Scalar cellVoltage = getParam<Scalar>(
"ElectroChemistry.CellVoltage");
90 values[contiH2OEqIdx] = currentDensity/(2*
Constant::F);
91 values[contiH2OEqIdx] += currentDensity/
Constant::F*transportNumberH2O;
92 values[contiO2EqIdx] = -currentDensity/(4*
Constant::F);
93 values[energyEqIdx] = (thermoneutralVoltage - cellVoltage)*currentDensity;
Electrochemical model for a fuel cell application.
A central place for various physical constants occuring in some equations.
constexpr Box box
Definition: method.hh:139
This class calculates source terms and current densities for fuel cells with the electrochemical mode...
Definition: electrochemistry.hh:53
Class calculating source terms and current densities for fuel cells with the electrochemical models s...
Definition: electrochemistryni.hh:42
static void reactionSource(SourceValues &values, Scalar currentDensity, const std::string ¶mGroup="")
Calculates reaction sources with an electrochemical model approach.
Definition: electrochemistryni.hh:69
A central place for various physical constants occuring in some equations.
Definition: constants.hh:39
static constexpr Scalar F
Faraday constant .
Definition: constants.hh:66