https://mooseframework.inl.gov
Loading...
Searching...
No Matches
AEFVFreeOutflowBoundaryFlux.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
13
16{
18 params.addParam<Real>("velocity", 1.0, "Advective velocity");
19 params.addClassDescription("Free outflow BC based boundary flux user object for the advection "
20 "equation using a cell-centered finite volume method.");
21 return params;
22}
23
25 : BoundaryFluxBase(parameters), _velocity(getParam<Real>("velocity"))
26{
27}
28
30
31void
33 dof_id_type /*ielem*/,
34 const std::vector<Real> & uvec1,
35 const RealVectorValue & dwave,
36 std::vector<Real> & flux) const
37{
38 mooseAssert(uvec1.size() == 1, "Invalid size for uvec1. Must be single variable coupling.");
39
40 // assume the velocity vector is constant
41 RealVectorValue uadv1(_velocity, 0.0, 0.0);
42
43 // assign the size of flux vector, e.g. = 1 for the advection equation
44 flux.resize(1);
45
46 // finally calculate the flux
47 flux[0] = (uadv1 * dwave) * uvec1[0];
48}
49
50void
52 dof_id_type /*ielem*/,
53 const std::vector<Real> & libmesh_dbg_var(uvec1),
54 const RealVectorValue & dwave,
55 DenseMatrix<Real> & jac1) const
56{
57 mooseAssert(uvec1.size() == 1, "Invalid size for uvec1. Must be single variable coupling.");
58 jac1.resize(1, 1);
59 // assume the velocity vector is constant
60 const RealVectorValue uadv1(_velocity, 0.0, 0.0);
61 jac1(0, 0) = uadv1 * dwave;
62}
registerMooseObject("RdgApp", AEFVFreeOutflowBoundaryFlux)
Free outflow BC based boundary flux user object for the advection equation using a cell-centered fini...
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.
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.
AEFVFreeOutflowBoundaryFlux(const InputParameters &parameters)
const Real _velocity
advective velocity
A base class for computing/caching fluxes at boundaries.
static InputParameters validParams()
void addParam(const std::string &name, const std::initializer_list< typename T::value_type > &value, const std::string &doc_string)
void addClassDescription(const std::string &doc_string)