www.mooseframework.org
AdvectiveFluxCalculatorConstantVelocity.C
Go to the documentation of this file.
1 //* This file is part of the MOOSE framework
2 //* https://www.mooseframework.org
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 
15 template <>
16 InputParameters
18 {
19  InputParameters params = validParams<AdvectiveFluxCalculatorBase>();
20  params.addClassDescription(
21  "Compute K_ij (a measure of advective flux from node i to node j) "
22  "and R+ and R- (which quantify amount of antidiffusion to add) in the "
23  "Kuzmin-Turek FEM-TVD multidimensional scheme. Constant advective velocity is assumed");
24  params.addRequiredCoupledVar("u", "The variable that is being advected");
25  params.addRequiredParam<RealVectorValue>("velocity", "Velocity vector");
26  return params;
27 }
28 
30  const InputParameters & parameters)
31  : AdvectiveFluxCalculatorBase(parameters),
32  _velocity(getParam<RealVectorValue>("velocity")),
33  _u_at_nodes(coupledDofValues("u")),
34  _phi(_assembly.fePhi<Real>(getVar("u", 0)->feType())),
35  _grad_phi(_assembly.feGradPhi<Real>(getVar("u", 0)->feType()))
36 {
37 }
38 
39 Real
40 AdvectiveFluxCalculatorConstantVelocity::computeVelocity(unsigned i, unsigned j, unsigned qp) const
41 {
42  return (_grad_phi[i][qp] * _velocity) * _phi[j][qp];
43 }
44 
45 Real
47 {
48  return _u_at_nodes[i];
49 }
registerMooseObject
registerMooseObject("PorousFlowApp", AdvectiveFluxCalculatorConstantVelocity)
AdvectiveFluxCalculatorConstantVelocity::computeU
virtual Real computeU(unsigned i) const override
Computes the value of u at the local node id of the current element (_current_elem)
Definition: AdvectiveFluxCalculatorConstantVelocity.C:46
validParams< AdvectiveFluxCalculatorBase >
InputParameters validParams< AdvectiveFluxCalculatorBase >()
Definition: AdvectiveFluxCalculatorBase.C:19
AdvectiveFluxCalculatorConstantVelocity::computeVelocity
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...
Definition: AdvectiveFluxCalculatorConstantVelocity.C:40
AdvectiveFluxCalculatorConstantVelocity::_grad_phi
const VariablePhiGradient & _grad_phi
grad(Kuzmin-Turek shape function)
Definition: AdvectiveFluxCalculatorConstantVelocity.h:42
AdvectiveFluxCalculatorConstantVelocity::_u_at_nodes
const VariableValue & _u_at_nodes
the nodal values of u
Definition: AdvectiveFluxCalculatorConstantVelocity.h:36
validParams< AdvectiveFluxCalculatorConstantVelocity >
InputParameters validParams< AdvectiveFluxCalculatorConstantVelocity >()
Definition: AdvectiveFluxCalculatorConstantVelocity.C:17
AdvectiveFluxCalculatorConstantVelocity::_phi
const VariablePhiValue & _phi
Kuzmin-Turek shape function.
Definition: AdvectiveFluxCalculatorConstantVelocity.h:39
AdvectiveFluxCalculatorConstantVelocity
Computes Advective fluxes for a constant velocity.
Definition: AdvectiveFluxCalculatorConstantVelocity.h:22
AdvectiveFluxCalculatorBase
Base class to compute Advective fluxes.
Definition: AdvectiveFluxCalculatorBase.h:33
AdvectiveFluxCalculatorConstantVelocity.h
AdvectiveFluxCalculatorConstantVelocity::AdvectiveFluxCalculatorConstantVelocity
AdvectiveFluxCalculatorConstantVelocity(const InputParameters &parameters)
Definition: AdvectiveFluxCalculatorConstantVelocity.C:29
AdvectiveFluxCalculatorConstantVelocity::_velocity
RealVectorValue _velocity
advection velocity
Definition: AdvectiveFluxCalculatorConstantVelocity.h:33