46 std::string FentonKarma::className =
50 "Phenomenological Model.");
53 std::string FentonKarma::lookupIds[10] = {
54 LibUtilities::SessionReader::RegisterEnumValue(
"CellModelVariant",
55 "BR", FentonKarma::eBR),
56 LibUtilities::SessionReader::RegisterEnumValue(
"CellModelVariant",
57 "MBR", FentonKarma::eMBR),
58 LibUtilities::SessionReader::RegisterEnumValue(
"CellModelVariant",
59 "MLR1", FentonKarma::eMLR1),
60 LibUtilities::SessionReader::RegisterEnumValue(
"CellModelVariant",
61 "GP", FentonKarma::eGP),
62 LibUtilities::SessionReader::RegisterEnumValue(
"CellModelVariant",
63 "CF1", FentonKarma::eCF1),
64 LibUtilities::SessionReader::RegisterEnumValue(
"CellModelVariant",
65 "CF2a", FentonKarma::eCF2a),
66 LibUtilities::SessionReader::RegisterEnumValue(
"CellModelVariant",
67 "CF2b", FentonKarma::eCF2b),
68 LibUtilities::SessionReader::RegisterEnumValue(
"CellModelVariant",
69 "CF2c", FentonKarma::eCF2c),
70 LibUtilities::SessionReader::RegisterEnumValue(
"CellModelVariant",
71 "CF3a", FentonKarma::eCF3a),
72 LibUtilities::SessionReader::RegisterEnumValue(
"CellModelVariant",
73 "CF3b", FentonKarma::eCF3b)
77 std::string FentonKarma::def =
78 LibUtilities::SessionReader::RegisterDefaultSolverInfo(
79 "CellModelVariant",
"BR");
88 FentonKarma::FentonKarma(
302 ASSERTL0(!
isCF3,
"Cherry-Fenton model 3 not implemented yet.");
318 const Array<
OneD,
const Array<OneD, NekDouble> >&inarray,
319 Array<
OneD, Array<OneD, NekDouble> >&outarray,
322 ASSERTL0(inarray.get() != outarray.get(),
323 "Must have different arrays for input and output.");
346 NekDouble J_fi, J_so, J_si, h1, h2, h3, alpha, beta;
349 for (i = 0; i < n; ++i)
352 h1 = (*u <
u_c) ? 0.0 : 1.0;
353 h2 = (*u <
u_v) ? 0.0 : 1.0;
354 h3 = (*u <
u_r) ? 0.0 : 1.0;
359 *w_tau = 1.0 / (alpha + beta);
360 *w_new = alpha * (*w_tau);
365 *v_tau = 1.0 / (alpha + beta);
366 *v_new = alpha * (*v_tau);
375 J_fi = -(*v)*h1*(1 - *u)*(*u -
u_fi)/
tau_d;
379 J_so = (*u)*(1-h3)*(1-
k2*(*v))/
tau_0 +
386 *u_new = -J_fi - J_so - J_si;
388 ++u, ++v, ++w, ++u_new, ++v_new, ++w_new, ++v_tau, ++w_tau;
419 default:
return "unknown";