www.mooseframework.org
AEFVFreeOutflowBoundaryFlux.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 
13 
14 template <>
15 InputParameters
17 {
18  InputParameters params = validParams<BoundaryFluxBase>();
19  params.addParam<Real>("velocity", 1.0, "Advective velocity");
20  params.addClassDescription("Free outflow BC based boundary flux user object for the advection "
21  "equation using a cell-centered finite volume method.");
22  return params;
23 }
24 
26  : BoundaryFluxBase(parameters), _velocity(getParam<Real>("velocity"))
27 {
28 }
29 
31 
32 void
34  dof_id_type /*ielem*/,
35  const std::vector<Real> & uvec1,
36  const RealVectorValue & dwave,
37  std::vector<Real> & flux) const
38 {
39  mooseAssert(uvec1.size() == 1, "Invalid size for uvec1. Must be single variable coupling.");
40 
41  // assume the velocity vector is constant
42  RealVectorValue uadv1(_velocity, 0.0, 0.0);
43 
44  // assign the size of flux vector, e.g. = 1 for the advection equation
45  flux.resize(1);
46 
47  // finally calculate the flux
48  flux[0] = (uadv1 * dwave) * uvec1[0];
49 }
50 
51 void
53  dof_id_type /*ielem*/,
54  const std::vector<Real> & libmesh_dbg_var(uvec1),
55  const RealVectorValue & dwave,
56  DenseMatrix<Real> & jac1) const
57 {
58  mooseAssert(uvec1.size() == 1, "Invalid size for uvec1. Must be single variable coupling.");
59  jac1.resize(1, 1);
60  // assume the velocity vector is constant
61  const RealVectorValue uadv1(_velocity, 0.0, 0.0);
62  jac1(0, 0) = uadv1 * dwave;
63 }
AEFVFreeOutflowBoundaryFlux::calcFlux
virtual void calcFlux(unsigned int iside, dof_id_type ielem, const std::vector< Real > &uvec1, const RealVectorValue &dwave, std::vector< Real > &flux) const override
Solve the Riemann problem on the boundary face.
Definition: AEFVFreeOutflowBoundaryFlux.C:33
AEFVFreeOutflowBoundaryFlux.h
AEFVFreeOutflowBoundaryFlux::calcJacobian
virtual void calcJacobian(unsigned int iside, dof_id_type ielem, const std::vector< Real > &uvec1, const RealVectorValue &dwave, DenseMatrix< Real > &jac1) const override
Compute the Jacobian matrix on the boundary face.
Definition: AEFVFreeOutflowBoundaryFlux.C:52
AEFVFreeOutflowBoundaryFlux::_velocity
const Real _velocity
advective velocity
Definition: AEFVFreeOutflowBoundaryFlux.h:45
BoundaryFluxBase
A base class for computing/caching fluxes at boundaries.
Definition: BoundaryFluxBase.h:30
AEFVFreeOutflowBoundaryFlux
Free outflow BC based boundary flux user object for the advection equation using a cell-centered fini...
Definition: AEFVFreeOutflowBoundaryFlux.h:25
AEFVFreeOutflowBoundaryFlux::~AEFVFreeOutflowBoundaryFlux
virtual ~AEFVFreeOutflowBoundaryFlux()
Definition: AEFVFreeOutflowBoundaryFlux.C:30
registerMooseObject
registerMooseObject("RdgApp", AEFVFreeOutflowBoundaryFlux)
validParams< AEFVFreeOutflowBoundaryFlux >
InputParameters validParams< AEFVFreeOutflowBoundaryFlux >()
Definition: AEFVFreeOutflowBoundaryFlux.C:16
validParams< BoundaryFluxBase >
InputParameters validParams< BoundaryFluxBase >()
Definition: BoundaryFluxBase.C:14
AEFVFreeOutflowBoundaryFlux::AEFVFreeOutflowBoundaryFlux
AEFVFreeOutflowBoundaryFlux(const InputParameters &parameters)
Definition: AEFVFreeOutflowBoundaryFlux.C:25