https://mooseframework.inl.gov
Loading...
Searching...
No Matches
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{
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
38Real
39AdvectiveFluxCalculatorConstantVelocity::computeVelocity(unsigned i, unsigned j, unsigned qp) const
40{
41 return (_grad_phi[i][qp] * _velocity) * _phi[j][qp];
42}
43
44Real
46{
47 return _u_at_nodes[i];
48}
registerMooseObject("PorousFlowApp", AdvectiveFluxCalculatorConstantVelocity)
Base class to compute Advective fluxes.
Computes Advective fluxes for a constant velocity.
AdvectiveFluxCalculatorConstantVelocity(const InputParameters &parameters)
const VariablePhiValue & _phi
Kuzmin-Turek shape function.
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...
const VariablePhiGradient & _grad_phi
grad(Kuzmin-Turek shape function)
virtual Real computeU(unsigned i) const override
Computes the value of u at the local node id of the current element (_current_elem)
const VariableValue & _u_at_nodes
the nodal values of u
void addRequiredCoupledVar(const std::string &name, const std::string &doc_string)
void addRequiredParam(const std::string &name, const std::string &doc_string)
void addClassDescription(const std::string &doc_string)