Constraints formulas in the PF module #16085
-
Hello, as you know, there are two constraints formulas in PF: In ICs, I write some codes let eta3 equals 1- eta1 - eta2. And c equals ... in the whole area. And there doesn't need any constraint in Kernels. Right? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 3 replies
-
Does "PF" mean "PhaseField" or "PorousFlow"? |
Beta Was this translation helpful? Give feedback.
-
I just wrote codes about eta1 * c1 + eta2 * c2 +eta3 * c3 =c, and there is no error when making. Real Real Real auto etavar = mapJvarToCvar(jvar, _etas_map); return 0.0; |
Beta Was this translation helpful? Give feedback.
I just wrote codes about eta1 * c1 + eta2 * c2 +eta3 * c3 =c, and there is no error when making.
But I am afraid there will be problems. Could anyone help me check the expressions of computeQpJacobian and computeQpOffDiagJacobian?
Thanks a lot!
Real
ConstraintConcentration::computeQpResidual()
{
Real sum = 0.0;
for (unsigned int i = 0; i < _cs_num; ++i)
sum += (* _cs[i])[_qp] * (* _etas[i])[_qp];
return _test[_i][_qp] * (sum - _u[_qp]);
}
Real
ConstraintConcentration::computeQpJacobian()
{
return -_test[_i][_qp] * _phi[_j][_qp];
}
Real
ConstraintConcentration::computeQpOffDiagJacobian(unsigned int jvar)
{
auto cjvar = mapJvarToCvar(jvar, _cs_map);
if (cjvar >= 0)
return _test[_i][_qp] * (…