Skip to content
Discussion options

You must be logged in to vote

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

#include "INSMassVector.h"
#include "Function.h"

registerMooseObject("otterApp", INSMassVector);

InputParameters INSMassVector::validParams() {
    InputParameters params = Kernel::validParams();

    params.addClassDescription("This class computes the mass equation residual and Jacobian "
                             "contributions for the incompressible Navier-Stokes momentum "
                             "equation.");

    params.addRequiredCoupledVar("velocity", "Coupled velocity vector");

    return params;
…

Replies: 1 comment 7 replies

Comment options

You must be logged in to vote
7 replies
@lindsayad
Comment options

@lindsayad
Comment options

@mhelel
Comment options

@mhelel
Comment options

Answer selected by mhelel
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants