https://mooseframework.inl.gov
AEFVMaterial.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 "AEFVMaterial.h"
11 #include "MooseMesh.h"
12 
13 #include "libmesh/quadrature.h"
14 
15 using namespace libMesh;
16 
18 
21 {
23  params.addClassDescription(
24  "A material kernel for the advection equation using a cell-centered finite volume method.");
25  params.addRequiredCoupledVar("u", "Cell-averge variable");
26  params.addRequiredParam<UserObjectName>("slope_limiting", "Name for slope limiting user object");
27  return params;
28 }
29 
31  : Material(parameters),
32  _uc(coupledValue("u")),
33  _lslope(getUserObject<SlopeLimitingBase>("slope_limiting")),
34  _u(declareProperty<Real>("u"))
35 {
36 }
37 
39 
40 void
42 {
43  // initialize the variable
44  _u[_qp] = _uc[_qp];
45 
46  // interpolate variable values at face center
47  if (_bnd)
48  {
49  // you should know how many equations you are solving and assign this number
50  // e.g. = 1 (for the advection equation)
51  unsigned int nvars = 1;
52  std::vector<RealGradient> ugrad(nvars, RealGradient(0., 0., 0.));
54 
55  // get the directional vector from cell center to face center
57 
58  // calculate the variable at face center
59  _u[_qp] += ugrad[0] * dvec;
60 
61  // clear the temporary vectors
62  ugrad.clear();
63  }
64  // calculations only for elemental output
65  else if (!_bnd)
66  {
67  }
68 }
const MooseArray< Point > & _q_point
PetscInt nvars
virtual const std::vector< RealGradient > & getElementSlope(dof_id_type elementid) const
accessor function call
static InputParameters validParams()
Definition: AEFVMaterial.C:20
The following methods are specializations for using the Parallel::packed_range_* routines for a vecto...
MaterialProperty< Real > & _u
Definition: AEFVMaterial.h:56
void addRequiredParam(const std::string &name, const std::string &doc_string)
unsigned int _qp
const VariableValue & _uc
Definition: AEFVMaterial.h:50
dof_id_type id() const
static InputParameters validParams()
void addRequiredCoupledVar(const std::string &name, const std::string &doc_string)
virtual void computeQpProperties()
Definition: AEFVMaterial.C:41
Base class for slope limiting to limit the slopes of cell average variables.
const SlopeLimitingBase & _lslope
Definition: AEFVMaterial.h:53
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
registerMooseObject("RdgApp", AEFVMaterial)
void addClassDescription(const std::string &doc_string)
virtual ~AEFVMaterial()
Definition: AEFVMaterial.C:38
AEFVMaterial(const InputParameters &parameters)
Definition: AEFVMaterial.C:30
A material kernel for the advection equation using a cell-centered finite volume method.
Definition: AEFVMaterial.h:38
const Elem *const & _current_elem
Point vertex_average() const