Memosa-FVM  0.2
BatteryPCLinearizeInterface_BV.h
Go to the documentation of this file.
1 // This file os part of FVM
2 // Copyright (c) 2012 FVM Authors
3 // See LICENSE file for terms.
4 
5 #ifndef _BATTERYPCLINEARIZEINTERFACE_BV_H_
6 #define _BATTERYPCLINEARIZEINTERFACE_BV_H_
7 
8 #include "Mesh.h"
9 #include "NumType.h"
10 #include "Array.h"
11 #include "Vector.h"
12 #include "Field.h"
13 #include "CRConnectivity.h"
14 #include "StorageSite.h"
15 #include "MultiFieldMatrix.h"
16 #include "CRMatrix.h"
17 #include "FluxJacobianMatrix.h"
18 #include "DiagonalMatrix.h"
19 
20 
21 
22 
23 template<class X, class Diag, class OffDiag, class otherMeshDiag>
25 {
26  public:
29  typedef typename CCMatrix::DiagArray DiagArray;
31  typedef Array<X> XArray;
32  //typedef Vector<T_Scalar,3> VectorT3;
33  //typedef Array<VectorT3> VectorT3Array;
34 
35  //typedef DiagonalTensor<T_Scalar,2> DiagTensorT3;
38 
40  const T_Scalar RRConstant,
41  const T_Scalar interfaceUnderRelax,
42  const bool Anode,
43  const bool Cathode,
44  const bool bInterfaceHeatSource,
45  Field& varField):
46  _geomFields(geomFields),
47  _varField(varField),
48  _RRConstant(RRConstant),
49  _interfaceUnderRelax(interfaceUnderRelax),
50  _Anode(Anode),
51  _Cathode(Cathode),
52  _bInterfaceHeatSource(bInterfaceHeatSource)
53  {}
54 
55 
56  void discretize(const Mesh& mesh, const Mesh& parentMesh,
57  const Mesh& otherMesh, MultiFieldMatrix& mfmatrix,
58  MultiField& xField, MultiField& rField)
59  {
60  const StorageSite& cells = mesh.getCells();
61  const StorageSite& faces = mesh.getParentFaceGroupSite();
62 
63  // shell mesh info
64  const MultiField::ArrayIndex cVarIndex(&_varField,&cells);
65  CCMatrix& matrix = dynamic_cast<CCMatrix&>(mfmatrix.getMatrix(cVarIndex,cVarIndex));
66  const XArray& xCell = dynamic_cast<const XArray&>(xField[cVarIndex]);
67  const CRConnectivity& cellCells = mesh.getCellCells();
68  XArray& rCell = dynamic_cast<XArray&>(rField[cVarIndex]);
69  DiagArray& diag = matrix.getDiag();
70 
71  // In the following, parent is assumed to be the electrolyte, and
72  // the other mesh is assumed to be electrode when implimenting
73  // the Butler-Volmer equations
74 
75  // parent mesh info
76  const CRConnectivity& parentFaceCells = parentMesh.getFaceCells(faces);
77  const StorageSite& parentCells = parentMesh.getCells();
78  const MultiField::ArrayIndex cVarIndexParent(&_varField,&parentCells);
79  XArray& rParentCell = dynamic_cast<XArray&>(rField[cVarIndexParent]);
80  CCMatrix_DiagTensors& parentmatrix = dynamic_cast<CCMatrix_DiagTensors&>(mfmatrix.getMatrix(cVarIndexParent,cVarIndexParent));
81  DiagArray_DiagTensors& parentdiag = parentmatrix.getDiag();
82  const TArray& faceAreaMag =
83  dynamic_cast<const TArray&>(_geomFields.areaMag[faces]);
84 
85  // other mesh info
86  const StorageSite& otherFaces = mesh.getOtherFaceGroupSite();
87  const CRConnectivity& otherFaceCells = otherMesh.getFaceCells(otherFaces);
88  const StorageSite& otherCells = otherMesh.getCells();
89  const MultiField::ArrayIndex cVarIndexOther(&_varField,&otherCells);
90  XArray& rOtherCell = dynamic_cast<XArray&>(rField[cVarIndexOther]);
91  CCMatrix_DiagTensors& othermatrix = dynamic_cast<CCMatrix_DiagTensors&>(mfmatrix.getMatrix(cVarIndexOther,cVarIndexOther));
92  DiagArray_DiagTensors& otherdiag = othermatrix.getDiag();
93 
94  // set constants for entire shell
95  const T_Scalar F = 96485.0; // C/mol
96  const T_Scalar k = _RRConstant;
97  T_Scalar csMax = 26000.0;
98  if (_Anode){
99  csMax = 26390.0;}
100  if (_Cathode){
101  csMax = 22860.0;}
102  const T_Scalar alpha_a = 0.5;
103  const T_Scalar alpha_c = 0.5;
104  const T_Scalar R = 8.314; // J/mol/K
105  const T_Scalar dU_dT = -0.0011; // V/K
106  const T_Scalar Peltier = 0.0;
107 
108  for (int f=0; f<faces.getCount(); f++)
109  {
110  int c0p = parentFaceCells(f,0);
111  int c1p = parentFaceCells(f,1);
112  if (c1p < parentCells.getSelfCount())
113  {
114  // c0 is ghost cell and c1 is boundry cell, so swap cell numbers
115  // so that c1p refers to the ghost cell in the following
116  int temp = c0p;
117  c0p = c1p;
118  c1p = temp;
119  }
120 
121  int c0o = otherFaceCells(f,0);
122  int c1o = otherFaceCells(f,1);
123  if (c1o < otherCells.getSelfCount())
124  {
125  // c0 is ghost cell and c1 is boundry cell, so swap cell numbers
126  // so that c1o refers to the ghost cell in the following
127  int temp = c0o;
128  c0o = c1o;
129  c1o = temp;
130  }
131 
132  // parent and other are full of diagonal tensors, while shell is full of square tensors
133  // need to convert incoming information from parent and other
134  // to a square tensor format
135  OffDiag dRC0dXC3 = NumTypeTraits<OffDiag>::getUnity();
136  Diag dRC0dXC0 = NumTypeTraits<Diag>::getUnity();
137  OffDiag dRC0dXC2 = NumTypeTraits<OffDiag>::getUnity();
138  Diag dRC0dXC1 = NumTypeTraits<Diag>::getUnity();
139 
140  // get parent and other flux
141  const X parentFlux = rParentCell[c1p]; // inward shell flux on the left
142  const X otherFlux = rOtherCell[c1o]; // inward shell flux on the right
143 
144  //get parent coeffs
145  const otherMeshDiag dRC0dXC3_DiagTens = parentmatrix.getCoeff(c1p, c0p);
146  const otherMeshDiag dRC0dXC0_DiagTens = parentdiag[c1p];
147 
148  //get other coeffs
149  const otherMeshDiag dRC0dXC2_DiagTens = othermatrix.getCoeff(c1o, c0o);
150  const otherMeshDiag dRC0dXC1_DiagTens = otherdiag[c1o];
151 
152  dRC0dXC3(0,0) = dRC0dXC3_DiagTens[0];
153  dRC0dXC3(1,1) = dRC0dXC3_DiagTens[1];
154  dRC0dXC2(0,0) = dRC0dXC2_DiagTens[0];
155  dRC0dXC2(1,1) = dRC0dXC2_DiagTens[1];
156  dRC0dXC1(0,0) = dRC0dXC1_DiagTens[0];
157  dRC0dXC1(1,1) = dRC0dXC1_DiagTens[1];
158  dRC0dXC0(0,0) = dRC0dXC0_DiagTens[0];
159  dRC0dXC0(1,1) = dRC0dXC0_DiagTens[1];
160 
162  {
163  dRC0dXC3(2,2) = dRC0dXC3_DiagTens[2];
164  dRC0dXC2(2,2) = dRC0dXC2_DiagTens[2];
165  dRC0dXC1(2,2) = dRC0dXC1_DiagTens[2];
166  dRC0dXC0(2,2) = dRC0dXC0_DiagTens[2];
167  }
168 
169  const int c0 = f;
170  const int c1 = cellCells(f,0);
171  const int c2 = cellCells(f,1);
172  const int c3 = cellCells(f,2);
173  const T_Scalar Area = faceAreaMag[f];
174  bool turnOffBV = false;
175 
176  T_Scalar cs_star = (xCell[c1])[1];
177  T_Scalar ce_star = (xCell[c0])[1];
178  const T_Scalar phis_star = (xCell[c1])[0];
179  const T_Scalar phie_star = (xCell[c0])[0];
180 
181  // avoid nans
182  if (cs_star < 0.0){ cout << "ERROR: Cs < 0, Cs=" << cs_star << endl; cs_star = 0.0;}
183  if (ce_star < 0.0){ cout << "ERROR: Ce < 0, Ce=" << ce_star << endl; ce_star = 0.0;}
184  //if (cs_star > csMax){ cout << "ERROR: Cs > CsMax, Cs=" << cs_star << endl; cs_star = csMax;}
185  if (cs_star > csMax){ cout << "ERROR: Cs > CsMax, Cs=" << cs_star << endl; turnOffBV = true;}
186 
187 
188  T_Scalar SOC = cs_star/csMax;
189  if (turnOffBV)
190  SOC = 1.0;
191 
192  T_Scalar U_ref = 0.1; // V
193  if (_Anode){
194  U_ref = -0.16 + 1.32*exp(-3.0*SOC)+10.0*exp(-2000.0*SOC);
195  if (U_ref < 0.0)
196  {U_ref = 0.0; cout << "U_ref < 0" << endl;}
197  if (U_ref > 1.2)
198  {U_ref = 1.2; cout << "U_ref > 1.2" << endl;}
199  }
200  if (_Cathode){
201  U_ref = 4.19829 + 0.0565661*tanh(-14.5546*SOC + 8.60942) - 0.0275479*(1.0/pow((0.998432-SOC),0.492465) - 1.90111) - 0.157123*exp(-0.04738*pow(SOC,8.0)) + 0.810239*exp(-40.0*(SOC-0.133875));
202  if (U_ref < 0.0)
203  {U_ref = 0.0; cout << "U_ref < 0" << endl;}
204  if (U_ref > 5.0)
205  {U_ref = 5.0; cout << "U_ref > 5.0" << endl;}
206  }
207 
208  // add small temperature dependence of U?
209 
210 
211  T_Scalar Temp = 300.0;
213  {
214  Temp = (xCell[c0])[2]; // K , c0 and c1 temps are equal at convergence
215  }
216  const T_Scalar C_a = alpha_a*F/R/Temp;
217  const T_Scalar C_c = alpha_c*F/R/Temp;
218 
219  const T_Scalar U = U_ref - (Temp - 298.0)*dU_dT;
220  const T_Scalar eta_star = phis_star - phie_star - U;
221 
222  const T_Scalar C_0 = exp(C_a*eta_star)-exp(-1.0*C_c*eta_star);
223 
224  T_Scalar i0_star = k*F*Area*pow(ce_star,alpha_c)*pow((csMax-cs_star),alpha_a)*pow(cs_star,alpha_c);
225  if (turnOffBV)
226  i0_star = 0.0;
227 
228  const T_Scalar i_star = C_0*i0_star;
229 
230  // CURRENT SHOULD NOT BE ZERO
231  //if (i_star < 1.0e-15){cout << "WARNING: current = 0" << endl;}
232 
233  // calculate dC_0/dCS
234  T_Scalar dC_0dCS = 0.0;
235  const T_Scalar dC0dEta = (C_a*exp(C_a*eta_star) + C_c*exp(-1*C_c*eta_star));
236  if (_Anode)
237  {
238  dC_0dCS = dC0dEta*(-1.0)*(-20000.0*exp(-2000.0*SOC) - 3.96*exp(-3.0*SOC))*(1.0/csMax);
239  }
240  if (_Cathode)
241  {
242  dC_0dCS = dC0dEta*(-1.0)*(-0.0135664/pow((0.998432-SOC),1.49247) - 0.823297/pow(cosh(8.60942-14.5546*SOC),2.0) + 0.0595559*exp(-0.04738*pow(SOC,8.0))*pow(SOC,7.0) - 6859.94*exp(-40.0*SOC))*(1.0/csMax);
243  }
244 
245  const T_Scalar dIdCS_star = i_star*(alpha_c/cs_star - alpha_a/(csMax-cs_star)+ dC_0dCS/C_0);
246  const T_Scalar dIdCE_star = i_star*alpha_c/ce_star;
247 
248  const T_Scalar dIdPhiS_star = i0_star*(C_a*exp(C_a*eta_star)+C_c*exp(-1*C_c*eta_star));
249  const T_Scalar dIdPhiE_star = -1*i0_star*(C_a*exp(C_a*eta_star)+C_c*exp(-1*C_c*eta_star));
250 
251  const T_Scalar dIdTe_star = -0.5*i0_star*F*eta_star/R/Temp/Temp*(alpha_a*exp(C_a*eta_star)+alpha_c*exp(-1*C_c*eta_star));
252  const T_Scalar dIdTs_star = -0.5*i0_star*F*eta_star/R/Temp/Temp*(alpha_a*exp(C_a*eta_star)+alpha_c*exp(-1*C_c*eta_star));
253 
254 
255  //now put flux information from meshes into shell cells
256 
257  // left(parent) shell cell - 3 neighbors
258  // flux balance for all equations
259  OffDiag& offdiagC0_C1 = matrix.getCoeff(c0, c1);
260  OffDiag& offdiagC0_C2 = matrix.getCoeff(c0, c2);
261  OffDiag& offdiagC0_C3 = matrix.getCoeff(c0, c3);
262 
263  rCell[c0] = otherFlux + parentFlux;
264  offdiagC0_C1 = dRC0dXC1;
265  offdiagC0_C3 = dRC0dXC3;
266  offdiagC0_C2 = dRC0dXC2;
267  diag[c0] = dRC0dXC0;
268 
269  //Fix for species equations so that both shell cells
270  //residuals and coeffs are on same order of magnitude
271 
272  (rCell[c0])[1] *= F;
273  (offdiagC0_C1)(1,1) *= F;
274  (offdiagC0_C3)(1,1) *= F;
275  (offdiagC0_C2)(1,1) *= F;
276  (diag[c0])(1,1) *= F;
277 
278  //include interface heating if thermal model turned on
279  //if (_bInterfaceHeatSource)
281  {
282  (rCell[c0])[2] += (eta_star + Peltier)*i_star; // in Watts
283  (diag[c0])(2,2) += (eta_star + Peltier)*dIdTe_star;
284  (offdiagC0_C1)(2,2) += (eta_star + Peltier)*dIdTs_star;
285 
286  // Point-coupled inclusions(off diagonal terms in square tensors)
287  // Cell c0
288  (diag[c0])(2,0) = (eta_star + Peltier)*dIdPhiE_star - i_star;
289  (diag[c0])(2,1) = (eta_star + Peltier)*dIdCE_star;
290  (offdiagC0_C1)(2,0) = i_star + (eta_star + Peltier)*dIdPhiS_star;
291  (offdiagC0_C1)(2,1) = i_star*dC_0dCS/dC0dEta + (eta_star + Peltier)*dIdCS_star;
292  }
293 
294 
295  // right(other) shell cell - 2 neighbors
296  // jump condition
297  OffDiag& offdiagC1_C0 = matrix.getCoeff(c1, c0);
298  OffDiag& offdiagC1_C2 = matrix.getCoeff(c1, c2);
299 
301  // SPECIES //
303 
304  (rCell[c1])[1] = F*otherFlux[1] - i_star;
305  offdiagC1_C0(1,1) = -1*dIdCE_star;
306  offdiagC1_C2(1,1) = F*dRC0dXC2(1,1);
307 
308  //make sure diag is < 0
309  if (dIdCS_star > 0.0)
310  {
311  (diag[c1])(1,1) = F*dRC0dXC1(1,1) - dIdCS_star;
312  }
313  else
314  {
315  (diag[c1])(1,1) = F*dRC0dXC1(1,1);
316  }
317 
319  // POTENTIAL //
321 
322  (rCell[c1])[0] = otherFlux[0] - i_star;
323  offdiagC1_C0(0,0) = -1*dIdPhiE_star;
324  offdiagC1_C2(0,0) = dRC0dXC2(0,0);
325  (diag[c1])(0,0) = dRC0dXC1(0,0) - dIdPhiS_star;
326 
327  //make sure diag is < 0
328  if ((diag[c1])(0,0) > 0.0)
329  {
330  cout << "Warning: Potential Diag > 0" << endl;
331  }
332 
334  // THERMAL //
336 
338  {
339  T_Scalar Factor = 1.0e-12;
340  (rCell[c1])[2] = Factor*((xCell[c0])[2] - (xCell[c1])[2]);
341  offdiagC1_C0(2,2) = Factor;
342  offdiagC1_C2(2,2) = 0.0;
343  (diag[c1])(2,2) = -1.0*Factor;
344  }
345 
346 
347  // Point-coupled inclusions(off diagonal terms in square tensors)
348  // Cell c1
349  (diag[c1])(0,1) = -1*dIdCS_star;
350  (diag[c1])(1,0) = -1*dIdPhiS_star;
351  offdiagC1_C0(0,1) = -1*dIdCE_star;
352  offdiagC1_C0(1,0) = -1*dIdPhiE_star;
353 
355  {
356  (diag[c1])(0,2) = -1*dIdTs_star;
357  (diag[c1])(1,2) = -1*dIdTs_star;
358  offdiagC1_C0(0,2) = -1*dIdTe_star;
359  offdiagC1_C0(1,2) = -1*dIdTe_star;
360  }
361 
362  // set other coeffs to zero for right shell cell
363  OffDiag& offdiagC1_C3 = matrix.getCoeff(c1, c3);
364  offdiagC1_C3 = NumTypeTraits<OffDiag>::getZero();
365 
366  // underrelax diagonal to help convergence
367  diag[c1] = 1.0/_interfaceUnderRelax*diag[c1];
368 
369  if (turnOffBV)
370  {
371  cout << "r[c1]: " << (rCell[c1])[0] << (rCell[c1])[1] << endl;
372  cout << "r[c0]: " << (rCell[c0])[0] << (rCell[c1])[1] << endl;
373  }
374 
375  if (c0 == 0)
376  {
377 
378  //cout << "OtherHeatFlux: " << otherFlux[2] << endl;
379  //cout << "ParentHeatFlux: " << parentFlux[2] << endl;
380  //cout << "SourceHeatFlux: " << (eta_star + Peltier)*i_star << endl;
381  if (_Cathode)
382  {
383  //cout << "UrefAnode: " << U_ref << endl;
384  cout << "Cs0: " << cs_star << endl;
385  //cout << "Diag: " << diag[c1] << endl;
386  //cout << "OffDiag: " << offdiagC1_C2 << endl;
387 
388  /*
389  cout << " " << endl;
390  cout << "OffDiag_C1C0: " << offdiagC1_C0(0,0) << " " << offdiagC1_C0(0,1) << " " << offdiagC1_C0(0,2) << endl;
391  cout << "OffDiag_C1C0: " << offdiagC1_C0(1,0) << " " << offdiagC1_C0(1,1) << " " << offdiagC1_C0(1,2) << endl;
392  cout << "OffDiag_C1C0: " << offdiagC1_C0(2,0) << " " << offdiagC1_C0(2,1) << " " << offdiagC1_C0(2,2) << endl;
393  cout << " " << endl;
394  cout << "OffDiag_C0C1: " << offdiagC0_C1(0,0) << " " << offdiagC0_C1(0,1) << " " << offdiagC0_C1(0,2) << endl;
395  cout << "OffDiag_C0C1: " << offdiagC0_C1(1,0) << " " << offdiagC0_C1(1,1) << " " << offdiagC0_C1(1,2) << endl;
396  cout << "OffDiag_C0C1: " << offdiagC0_C1(2,0) << " " << offdiagC0_C1(2,1) << " " << offdiagC0_C1(2,2) << endl;
397  cout << " " << endl;
398  cout << "Diag_C0: " << (diag[c0])(0,0) << " " << (diag[c0])(0,1) << " " << (diag[c0])(0,2) << endl;
399  cout << "Diag_C0: " << (diag[c0])(1,0) << " " << (diag[c0])(1,1) << " " << (diag[c0])(1,2) << endl;
400  cout << "Diag_C0: " << (diag[c0])(2,0) << " " << (diag[c0])(2,1) << " " << (diag[c0])(2,2) << endl;
401  cout << " " << endl;
402  cout << "Diag_C1: " << (diag[c1])(0,0) << " " << (diag[c1])(0,1) << " " << (diag[c1])(0,2) << endl;
403  cout << "Diag_C1: " << (diag[c1])(1,0) << " " << (diag[c1])(1,1) << " " << (diag[c1])(1,2) << endl;
404  cout << "Diag_C1: " << (diag[c1])(2,0) << " " << (diag[c1])(2,1) << " " << (diag[c1])(2,2) << endl;
405  cout << " " << endl;
406  cout << "Residual_C0: " << (rCell[c0])[0] << endl;
407  cout << "Residual_C0: " << (rCell[c0])[1] << endl;
408  cout << "Residual_C0: " << (rCell[c0])[2] << endl;
409  cout << " " << endl;
410  cout << "Residual_C1: " << (rCell[c1])[0] << endl;
411  cout << "Residual_C1: " << (rCell[c1])[1] << endl;
412  cout << "Residual_C1: " << (rCell[c1])[2] << endl;
413  cout << " " << endl;
414  */
415  }
416  if (_Anode)
417  {
418  //cout << "UrefAnode: " << U_ref << endl;
419  //cout << "Cs0: " << cs_star << endl;
420  //cout << "Diag: " << diag[c1] << endl;
421  //cout << "OffDiag: " << offdiagC1_C2 << endl;
422 
423  /*
424  cout << " " << endl;
425  cout << "OffDiag_C1C0: " << offdiagC1_C0(0,0) << " " << offdiagC1_C0(0,1) << " " << offdiagC1_C0(0,2) << endl;
426  cout << "OffDiag_C1C0: " << offdiagC1_C0(1,0) << " " << offdiagC1_C0(1,1) << " " << offdiagC1_C0(1,2) << endl;
427  cout << "OffDiag_C1C0: " << offdiagC1_C0(2,0) << " " << offdiagC1_C0(2,1) << " " << offdiagC1_C0(2,2) << endl;
428  cout << " " << endl;
429  cout << "OffDiag_C0C1: " << offdiagC0_C1(0,0) << " " << offdiagC0_C1(0,1) << " " << offdiagC0_C1(0,2) << endl;
430  cout << "OffDiag_C0C1: " << offdiagC0_C1(1,0) << " " << offdiagC0_C1(1,1) << " " << offdiagC0_C1(1,2) << endl;
431  cout << "OffDiag_C0C1: " << offdiagC0_C1(2,0) << " " << offdiagC0_C1(2,1) << " " << offdiagC0_C1(2,2) << endl;
432  cout << " " << endl;
433  cout << "Diag_C0: " << (diag[c0])(0,0) << " " << (diag[c0])(0,1) << " " << (diag[c0])(0,2) << endl;
434  cout << "Diag_C0: " << (diag[c0])(1,0) << " " << (diag[c0])(1,1) << " " << (diag[c0])(1,2) << endl;
435  cout << "Diag_C0: " << (diag[c0])(2,0) << " " << (diag[c0])(2,1) << " " << (diag[c0])(2,2) << endl;
436  cout << " " << endl;
437  cout << "Diag_C1: " << (diag[c1])(0,0) << " " << (diag[c1])(0,1) << " " << (diag[c1])(0,2) << endl;
438  cout << "Diag_C1: " << (diag[c1])(1,0) << " " << (diag[c1])(1,1) << " " << (diag[c1])(1,2) << endl;
439  cout << "Diag_C1: " << (diag[c1])(2,0) << " " << (diag[c1])(2,1) << " " << (diag[c1])(2,2) << endl;
440  cout << " " << endl;
441  cout << "Residual_C0: " << (rCell[c0])[0] << endl;
442  cout << "Residual_C0: " << (rCell[c0])[1] << endl;
443  cout << "Residual_C0: " << (rCell[c0])[2] << endl;
444  cout << " " << endl;
445  cout << "Residual_C1: " << (rCell[c1])[0] << endl;
446  cout << "Residual_C1: " << (rCell[c1])[1] << endl;
447  cout << "Residual_C1: " << (rCell[c1])[2] << endl;
448  cout << " " << endl;*/
449 
450  }
451  }
452 
453  }
454 
455  }
456  private:
457 
462  const bool _Anode;
463  const bool _Cathode;
465 
466 };
467 
468 #endif
Matrix & getMatrix(const Index &rowIndex, const Index &colIndex)
int getSelfCount() const
Definition: StorageSite.h:40
const StorageSite & getParentFaceGroupSite() const
Definition: Mesh.h:329
BatteryPCLinearizeInterface_BV(const GeomFields &geomFields, const T_Scalar RRConstant, const T_Scalar interfaceUnderRelax, const bool Anode, const bool Cathode, const bool bInterfaceHeatSource, Field &varField)
void discretize(const Mesh &mesh, const Mesh &parentMesh, const Mesh &otherMesh, MultiFieldMatrix &mfmatrix, MultiField &xField, MultiField &rField)
CRMatrix< otherMeshDiag, otherMeshDiag, X > CCMatrix_DiagTensors
Definition: Field.h:14
OffDiag & getCoeff(const int i, const int j)
Definition: CRMatrix.h:836
Definition: Mesh.h:49
Array< Diag > & getDiag()
Definition: CRMatrix.h:856
const StorageSite & getOtherFaceGroupSite() const
Definition: Mesh.h:332
pair< const Field *, const StorageSite * > ArrayIndex
Definition: MultiField.h:21
const CRConnectivity & getCellCells() const
Definition: Mesh.cpp:480
const StorageSite & getCells() const
Definition: Mesh.h:109
const CRConnectivity & getFaceCells(const StorageSite &site) const
Definition: Mesh.cpp:388
CCMatrix_DiagTensors::DiagArray DiagArray_DiagTensors
int getCount() const
Definition: StorageSite.h:39
Field areaMag
Definition: GeomFields.h:25