https://mooseframework.inl.gov
Loading...
Searching...
No Matches
INSFVMomentumTimeDerivative.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
11#include "SystemBase.h"
12#include "NS.h"
13
15
18{
21 "Adds the time derivative term to the incompressible Navier-Stokes momentum equation.");
22 params.addRequiredParam<MooseFunctorName>(NS::density, "The density functor");
23 return params;
24}
25
27 : INSFVTimeKernel(params), _rho(getFunctor<ADReal>(NS::density))
28{
29}
30
31void
33{
34 const auto e = makeElemArg(&elem);
35 const auto state = determineState();
36 const auto residual = _rho(e, state) * _var.dot(e, state) * _assembly.elementVolume(&elem);
37 const auto dof_number = elem.dof_number(_sys.number(), _var.number(), 0);
38 const Real a = residual.derivatives()[dof_number];
39
41 _rc_uo.addToA(&elem, _index, a);
42
43 addResidualAndJacobian(residual, dof_number);
44}
DualNumber< Real, DNDerivativeType, true > ADReal
registerMooseObject("NavierStokesApp", INSFVMomentumTimeDerivative)
Real elementVolume(const Elem *elem) const
MooseVariableFV< Real > & _var
Moose::ElemArg makeElemArg(const Elem *elem, bool correct_skewnewss=false) const
const unsigned int _index
index x|y|z
RhieChowInterpolatorBase & _rc_uo
The Rhie Chow user object that is responsible for generating face velocities for advection terms.
INSFVMomentumTimeDerivative(const InputParameters &params)
const Moose::Functor< ADReal > & _rho
The density.
void gatherRCData(const Elem &) override
Should be a non-empty implementation if the residual object is a FVElementalKernel and introduces res...
All navier-stokes momentum time derivative terms should inherit from this class.
static InputParameters validParams()
void addResidualAndJacobian(const ADReal &residual, dof_id_type dof)
Process into either the system residual or Jacobian.
const bool _contribute_to_rc_coeffs
Whether to contribute to RC coefficients.
void addRequiredParam(const std::string &name, const std::string &doc_string)
void addClassDescription(const std::string &doc_string)
unsigned int number() const
DotType dot(const ElemArg &elem, const StateArg &state) const
Assembly & _assembly
SystemBase & _sys
virtual void addToA(const libMesh::Elem *elem, unsigned int component, const ADReal &value)=0
API for momentum residual objects that have on-diagonals for velocity call.
unsigned int number() const
Moose::StateArg determineState() const
static const std::string density
Definition NS.h:34