-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathConstFluxForCeBC.C
59 lines (48 loc) · 1.15 KB
/
ConstFluxForCeBC.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
56
57
58
59
//created by Armin 29.10.2020
#include "ConstFluxForCeBC.h"
registerMooseObject("BabblerApp", ConstFluxForCeBC);
template <>
InputParameters validParams<ConstFluxForCeBC>()
{
InputParameters params=IntegratedBCBase::validParams();
params.addRequiredParam<Real>("I","current");
params.addParam<Real>("ChargeTime",0.0,"0->forever,>=0 for charge time");
return params;
}
ConstFluxForCeBC::ConstFluxForCeBC(const InputParameters ¶meters)
:IntegratedBC(parameters),
_I(getParam<Real>("I")),
_ChargeTime(getParam<Real>("ChargeTime"))
{}
Real ConstFluxForCeBC::computeQpResidual()
{
Real t0=0.0107907+_u[_qp]*1.48837e-4;
if(_ChargeTime<=0.0)
{
return -_I*(1-t0)*_test[_i][_qp];
}
else
{
if(_t<=_ChargeTime)
{
return -_I*(1-t0)*_test[_i][_qp];
}
return 0.0;
}
}
Real ConstFluxForCeBC::computeQpJacobian()
{
const Real dt0=1.48837e-4;
if(_ChargeTime>0.0)
{
return _I*dt0*_phi[_j][_qp]*_test[_i][_qp];
}
else
{
if(_t<=_ChargeTime)
{
return _I*dt0*_phi[_j][_qp]*_test[_i][_qp];
}
return 0.0;
}
}