6 #ifndef _BATTERYPCTIMEDERIVATIVEDISCRETIZATION_H_
7 #define _BATTERYPCTIMEDERIVATIVEDISCRETIZATION_H_
17 template<
class X,
class Diag,
class OffDiag>
37 const bool thermalModel,
69 XArray& rCell =
dynamic_cast<XArray&
>(rField[cVarIndex]);
105 for(
int c=0; c<nCells; c++)
107 const T_Scalar rhoVbydT_species = cellVolume[c]/
_dT;
108 (rCell[c])[1] -= rhoVbydT_species*(onePointFive*(x[c])[1] - two*(xN1[c])[1] + pointFive*(xN2[c])[1]);
109 (diag[c])[1] -= rhoVbydT_species*onePointFive;
113 const T_Scalar rhoVbydT_temp = rhoCp[c]*cellVolume[c]/
_dT;
114 (rCell[c])[2] -= rhoVbydT_temp*(onePointFive*(x[c])[2] - two*(xN1[c])[2] + pointFive*(xN2[c])[2]);
115 (diag[c])[2] -= rhoVbydT_temp*onePointFive;
164 for(
int c=0; c<nCells; c++)
166 const T_Scalar rhoVbydT_species = cellVolume[c]/
_dT;
167 (rCell[c])[1] -= rhoVbydT_species*((x[c])[1]- (xN1[c])[1]);
168 (diag[c])[1] -= rhoVbydT_species;
172 const T_Scalar rhoVbydT_temp = rhoCp[c]*cellVolume[c]/
_dT;
173 (rCell[c])[2] -= rhoVbydT_temp*((x[c])[2]- (xN1[c])[2]);
174 (diag[c])[2] -= rhoVbydT_temp;
const Field & _varN1Field
Matrix & getMatrix(const Index &rowIndex, const Index &colIndex)
bool hasArray(const StorageSite &s) const
CRMatrix< Diag, OffDiag, X > CCMatrix
CCMatrix::PairWiseAssembler CCAssembler
BatteryPCTimeDerivativeDiscretization(const MeshList &meshes, const GeomFields &geomFields, Field &varField, Field &varN1Field, Field &varN2Field, Field &rhoCpField, const bool thermalModel, const T_Scalar dT)
Array< Diag > & getDiag()
CCMatrix::DiagArray DiagArray
pair< const Field *, const StorageSite * > ArrayIndex
void discretize(const Mesh &mesh, MultiFieldMatrix &mfmatrix, MultiField &xField, MultiField &rField)
const StorageSite & getCells() const
NumTypeTraits< X >::T_Scalar T_Scalar
const GeomFields & _geomFields
const Field & _varN2Field
vector< Mesh * > MeshList
const Field & _rhoCpField