https://mooseframework.inl.gov
BoundaryFlux1PhaseBaseBC.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 "MooseVariable.h"
12 
15 {
17 
18  params.addRequiredCoupledVar("A_linear", "Cross-sectional area, linear");
19  params.addRequiredCoupledVar("rhoA", "Conserved variable: rho*A");
20  params.addRequiredCoupledVar("rhouA", "Conserved variable: rho*u*A");
21  params.addRequiredCoupledVar("rhoEA", "Conserved variable: rho*E*A");
22 
23  params.addRequiredParam<UserObjectName>("boundary_flux", "Name of boundary flux user object");
24 
25  return params;
26 }
27 
29  : ADOneDIntegratedBC(parameters),
30 
31  _A_linear(adCoupledValue("A_linear")),
32 
33  _rhoA(getADMaterialProperty<Real>("rhoA")),
34  _rhouA(getADMaterialProperty<Real>("rhouA")),
35  _rhoEA(getADMaterialProperty<Real>("rhoEA")),
36 
37  _rhoA_var(coupled("rhoA")),
38  _rhouA_var(coupled("rhouA")),
39  _rhoEA_var(coupled("rhoEA")),
40 
41  _flux(getUserObject<ADBoundaryFluxBase>("boundary_flux"))
42 {
43 }
44 
45 void
47 {
49 
50  const auto jmap = getIndexMapping();
51  _equation_index = jmap.at(_var.number());
52 }
53 
54 ADReal
56 {
57  const auto & flux = _flux.getFlux(
59 
60  return flux[_equation_index] * _normal * _test[_i][_qp];
61 }
virtual const std::vector< ADReal > & getFlux(unsigned int iside, dof_id_type ielem, const std::vector< ADReal > &uvec1, const RealVectorValue &dwave) const
Get the boundary flux vector.
virtual ADReal computeQpResidual() override
virtual std::vector< ADReal > fluxInputVector() const =0
Returns the flux input vector.
static InputParameters validParams()
unsigned int number() const
const Elem *const & _current_elem
auto raw_value(const Eigen::Map< T > &in)
DualNumber< Real, DNDerivativeType, false > ADReal
void addRequiredParam(const std::string &name, const std::string &doc_string)
unsigned int _qp
virtual void initialSetup() override
static InputParameters validParams()
unsigned int _equation_index
index within the Euler system of the equation upon which this BC acts
MooseVariableFE< T > & _var
A base class for computing/caching fluxes at boundaries.
void addRequiredCoupledVar(const std::string &name, const std::string &doc_string)
const ADBoundaryFluxBase & _flux
boundary flux user object
virtual std::map< unsigned int, unsigned int > getIndexMapping() const =0
Creates the mapping of coupled variable index to index in Euler system.
const unsigned int & _current_side
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
const ADTemplateVariableTestValue< T > & _test
BoundaryFlux1PhaseBaseBC(const InputParameters &parameters)
const Real _normal
Component of outward normals along 1-D direction.
virtual void initialSetup()
Base class for integrated boundary conditions for 1D problems in 3D space.
const MooseArray< ADPoint > & _normals