-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSeparatorPhiEKernel.C
55 lines (44 loc) · 1.66 KB
/
SeparatorPhiEKernel.C
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
#include "SeparatorPhiEKernel.h"
registerMooseObject("BabblerApp", SeparatorPhiEKernel);
InputParameters SeparatorPhiEKernel::validParams()
{
InputParameters params = Kernel::validParams();
params.addRequiredParam<Real>("K", "conductivity of liquid phase");
params.addRequiredParam<Real>("eps", "porosity");
params.addRequiredCoupledVar("Ce", "concentration of electrolyte");
return params;
}
SeparatorPhiEKernel::SeparatorPhiEKernel(const InputParameters ¶meters)
: Kernel(parameters),
_K(getParam<Real>("K")),
_eps(getParam<Real>("eps")),
_couple_c(coupledValue("Ce")),
_grad_couple_c(coupledGradient("Ce")),
_couple_c_var(coupled("Ce"))
{
Keff = _K * _eps * sqrt(_eps);
}
Real SeparatorPhiEKernel::computeQpResidual()
{
Real t0 = 0.0107907 + _couple_c[_qp] * 1.48837e-4;
Keff = _K * _eps * sqrt(_eps);
return Keff * (_grad_u[_qp] - (1 - t0) * _grad_couple_c[_qp] / _couple_c[_qp]) * _grad_test[_i][_qp];
}
Real SeparatorPhiEKernel::computeQpJacobian()
{
Keff = _K * _eps * sqrt(_eps);
return Keff * _grad_phi[_j][_qp] * _grad_test[_i][_qp];
}
Real SeparatorPhiEKernel::computeQpOffDiagJacobian(unsigned int jvar)
{
Real t0 = 0.0107907 + _couple_c[_qp] * 1.48837e-4;
Real dt0 = 1.48837e-4;
Keff = _K * _eps * sqrt(_eps);
if (jvar == _couple_c_var)
{
return Keff * dt0 * (_grad_couple_c[_qp] / _couple_c[_qp]) * _phi[_j][_qp] * _grad_test[_i][_qp]
+ Keff * (1 - t0) * (_grad_couple_c[_qp] / (_couple_c[_qp] * _couple_c[_qp])) * _phi[_j][_qp] * _grad_test[_i][_qp]
- Keff * ((1 - t0) / _couple_c[_qp]) * _grad_phi[_j][_qp] * _grad_test[_i][_qp];
}
return 0.0;
}