12#ifndef DUMUX_ELECTROCHEMISTRY_NI_HH
13#define DUMUX_ELECTROCHEMISTRY_NI_HH
28template <
class Scalar,
class Indices,
class Flu
idSystem,
class Gr
idGeometry, ElectroChemistryModel electroChemistryModel>
36 contiH2OEqIdx = Indices::conti0EqIdx + FluidSystem::H2OIdx,
37 contiO2EqIdx = Indices::conti0EqIdx + FluidSystem::O2Idx,
38 energyEqIdx = Indices::energyEqIdx,
41 using GridView =
typename GridGeometry::GridView;
43 using GlobalPosition =
typename Dune::FieldVector<typename GridView::ctype, GridView::dimensionworld>;
44 using CellVector =
typename Dune::FieldVector<typename GridView::ctype, GridView::dimension>;
56 template<
class SourceValues>
58 const std::string& paramGroup =
"")
63 static Scalar gridYMax = getParamFromGroup<GlobalPosition>(paramGroup,
"Grid.UpperRight")[1];
64 static Scalar nCellsY = getParamFromGroup<GlobalPosition>(paramGroup,
"Grid.Cells")[1];
67 const auto lengthBox = gridYMax/nCellsY;
69 currentDensity *= 2.0/lengthBox;
71 currentDensity *= 1.0/lengthBox;
73 static Scalar transportNumberH2O = getParam<Scalar>(
"ElectroChemistry.TransportNumberH20");
74 static Scalar thermoneutralVoltage = getParam<Scalar>(
"ElectroChemistry.ThermoneutralVoltage");
75 static Scalar cellVoltage = getParam<Scalar>(
"ElectroChemistry.CellVoltage");
78 values[contiH2OEqIdx] = currentDensity/(2*
Constant::F);
79 values[contiH2OEqIdx] += currentDensity/
Constant::F*transportNumberH2O;
80 values[contiO2EqIdx] = -currentDensity/(4*
Constant::F);
81 values[energyEqIdx] = (thermoneutralVoltage - cellVoltage)*currentDensity;
A central place for various physical constants occurring in some equations.
Definition: constants.hh:27
static constexpr Scalar F
Faraday constant .
Definition: constants.hh:54
This class calculates source terms and current densities for fuel cells with the electrochemical mode...
Definition: electrochemistry.hh:41
Class calculating source terms and current densities for fuel cells with the electrochemical models s...
Definition: electrochemistryni.hh:30
static void reactionSource(SourceValues &values, Scalar currentDensity, const std::string ¶mGroup="")
Calculates reaction sources with an electrochemical model approach.
Definition: electrochemistryni.hh:57
A central place for various physical constants occurring in some equations.
Electrochemical model for a fuel cell application.
constexpr Box box
Definition: method.hh:147