https://mooseframework.inl.gov
AdvectiveFluxCalculatorConstantVelocity.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 "Assembly.h"
12 
14 
17 {
19  params.addClassDescription(
20  "Compute K_ij (a measure of advective flux from node i to node j) "
21  "and R+ and R- (which quantify amount of antidiffusion to add) in the "
22  "Kuzmin-Turek FEM-TVD multidimensional scheme. Constant advective velocity is assumed");
23  params.addRequiredCoupledVar("u", "The variable that is being advected");
24  params.addRequiredParam<RealVectorValue>("velocity", "Velocity vector");
25  return params;
26 }
27 
29  const InputParameters & parameters)
30  : AdvectiveFluxCalculatorBase(parameters),
31  _velocity(getParam<RealVectorValue>("velocity")),
32  _u_at_nodes(coupledDofValues("u")),
33  _phi(_assembly.fePhi<Real>(getVar("u", 0)->feType())),
34  _grad_phi(_assembly.feGradPhi<Real>(getVar("u", 0)->feType()))
35 {
36 }
37 
38 Real
39 AdvectiveFluxCalculatorConstantVelocity::computeVelocity(unsigned i, unsigned j, unsigned qp) const
40 {
41  return (_grad_phi[i][qp] * _velocity) * _phi[j][qp];
42 }
43 
44 Real
46 {
47  return _u_at_nodes[i];
48 }
virtual Real computeU(unsigned i) const override
Computes the value of u at the local node id of the current element (_current_elem) ...
AdvectiveFluxCalculatorConstantVelocity(const InputParameters &parameters)
const VariablePhiValue & _phi
Kuzmin-Turek shape function.
const VariablePhiGradient & _grad_phi
grad(Kuzmin-Turek shape function)
registerMooseObject("PorousFlowApp", AdvectiveFluxCalculatorConstantVelocity)
void addRequiredParam(const std::string &name, const std::string &doc_string)
const VariableValue & _u_at_nodes
the nodal values of u
virtual Real computeVelocity(unsigned i, unsigned j, unsigned qp) const override
Computes the transfer velocity between current node i and current node j at the current qp in the cur...
static InputParameters validParams()
Base class to compute Advective fluxes.
Computes Advective fluxes for a constant velocity.
void addRequiredCoupledVar(const std::string &name, const std::string &doc_string)
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
void addClassDescription(const std::string &doc_string)
static const std::complex< double > j(0, 1)
Complex number "j" (also known as "i")