https://mooseframework.inl.gov
INSFVFluxKernel.C
Go to the documentation of this file.
1 //* This file is part of the MOOSE framework
2 //* https://mooseframework.inl.gov
3 //*
4 //* All rights reserved, see COPYRIGHT for full restrictions
5 //* https://github.com/idaholab/moose/blob/master/COPYRIGHT
6 //*
7 //* Licensed under LGPL 2.1, please see LICENSE for details
8 //* https://www.gnu.org/licenses/lgpl-2.1.html
9 
10 #include "INSFVFluxKernel.h"
11 #include "SystemBase.h"
12 #include "MooseVariableFE.h"
13 #include "Assembly.h"
14 #include "SubProblem.h"
15 
18 {
19  auto params = FVFluxKernel::validParams();
21  return params;
22 }
23 
26 {
27 }
28 
29 void
31 {
32  if (_rc_uo.segregated())
34 }
35 
36 void
38 {
39  if (_rc_uo.segregated())
41 }
42 
43 void
45 {
46  if (_rc_uo.segregated())
48 }
49 
50 ADReal
52 {
53  mooseAssert(_rc_uo.segregated(), "We should not get here if we are not segregated!");
55 }
56 
57 void
59 {
60  auto process_residual = [this](const ADReal & residual, const Elem & elem)
61  {
62  const auto dof_index = elem.dof_number(_sys.number(), _var.number(), 0);
64  std::array<ADReal, 1>{{residual}},
65  std::array<dof_id_type, 1>{{dof_index}},
67  };
68 
71  process_residual(residual, _face_info->elem());
74  process_residual(-residual, _face_info->neighbor());
75 }
void addResidualsAndJacobian(Assembly &assembly, const Residuals &residuals, const Indices &dof_indices, Real scaling_factor)
unsigned int number() const
const Elem & elem() const
void computeResidualAndJacobian() override
const FaceInfo * _face_info
DualNumber< Real, DNDerivativeType, true > ADReal
virtual ADReal computeSegregatedContribution()
Compute the contribution which goes into the residual of the segregated system.
INSFVFluxKernel(const InputParameters &params)
RhieChowInterpolatorBase & _rc_uo
The Rhie Chow user object that is responsible for generating face velocities for advection terms...
void computeJacobian() override
SystemBase & _sys
static InputParameters validParams()
virtual bool segregated() const =0
Bool of the Rhie Chow user object is used in monolithic/segregated approaches.
const Elem & neighbor() const
unsigned int number() const
All objects that contribute to pressure-based (e.g.
ADReal computeQpResidual() override final
FaceInfo::VarFaceNeighbors _face_type
Assembly & _assembly
void addResidualAndJacobian(const ADReal &residual)
Process into either the system residual or Jacobian.
static InputParameters validParams()
MooseVariableFV< Real > & _var
static InputParameters validParams()
void computeResidual() override
void scalingFactor(const std::vector< Real > &factor)