https://mooseframework.inl.gov
Loading...
Searching...
No Matches
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
15using namespace libMesh;
16
18
21{
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
40void
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}
registerMooseObject("RdgApp", AEFVMaterial)
PetscInt nvars
A material kernel for the advection equation using a cell-centered finite volume method.
virtual ~AEFVMaterial()
const SlopeLimitingBase & _lslope
static InputParameters validParams()
const VariableValue & _uc
virtual void computeQpProperties()
AEFVMaterial(const InputParameters &parameters)
MaterialProperty< Real > & _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)
unsigned int _qp
static InputParameters validParams()
const Elem *const & _current_elem
const MooseArray< Point > & _q_point
Base class for slope limiting to limit the slopes of cell average variables.
virtual const std::vector< RealGradient > & getElementSlope(dof_id_type elementid) const
accessor function call
dof_id_type id() const
Point vertex_average() const
The following methods are specializations for using the Parallel::packed_range_* routines for a vecto...
RealVectorValue RealGradient
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real