OffDiagonalJacobian for divergence of RealVectorVariable #32015
-
Check these boxes if you have followed the posting rules.
QuestionI'm currently translating parts of the INS Code such that it uses one VectorVariable as velocity To implement I have already written this code: The residual should be implemented correctly and the function 'computeQpPGResidual' as well as 'computeQpPGJacobian' does not matter for now. Now comes the tricky part so I will outline what I understand until now: The Vector And now comes the part where I'm not shure how to implement this. I had the understanding, that one treats such equations the same as if Additional informationSorry for the weird formatting after some of the equal signs. I don't have a clue why this happens |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 7 replies
-
|
What's the motivation for making another implementation, e.g. making the velocity variables a vector instead of component scalars? I've worked on both implementation styles and at this point I prefer the latter because it's more likely that you can re-use kernels (e.g. advecting momentum components/passive scalars/energy all with the same kernel, diffusing momentum components/passive scalars/energy all with the same kernel) |
Beta Was this translation helpful? Give feedback.
For Anyone interested: Moose does magic. To implement the OffDiagJacobian for the$div \vec{u}$ one can just use the trace of Matrix as proposed above. So the working code is