https://mooseframework.inl.gov
Loading...
Searching...
No Matches
FVQpFluxBC.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 "FVQpFluxBC.h"
11#include "MooseVariableFV.h"
12#include "SystemBase.h"
13
16{
18 return params;
19}
20
22 : FVFluxBC(params), _u(_var.adSln()), _u_neighbor(_var.adSlnNeighbor())
23{
24}
25
26const ADReal &
28{
29 mooseAssert(_face_info, "The face info has not been set");
30 const auto ft = _face_info->faceType(std::make_pair(_var.number(), _var.sys().number()));
31 mooseAssert(
33 "The variable " << _var.name()
34 << " should be defined on exactly one adjacent subdomain for FVFluxBC "
35 << this->name());
36 mooseAssert(_qp == 0,
37 "At the time of writing, we only support one quadrature point, which should "
38 "correspond to the location of the cell centroid. If that changes, we should "
39 "probably change the body of FVQpFluxBC::uOnUSub");
40
42 return _u[_qp];
43 else
44 return _u_neighbor[_qp];
45}
46
47const ADReal &
49{
50 mooseAssert(_face_info, "The face info has not been set");
51 const auto ft = _face_info->faceType(std::make_pair(_var.number(), _var.sys().number()));
52 mooseAssert(
54 "The variable " << _var.name()
55 << " should be defined on exactly one adjacent subdomain for FVFluxBC "
56 << this->name());
57 mooseAssert(_qp == 0,
58 "At the time of writing, we only support one quadrature point, which should "
59 "correspond to the location of the cell centroid. If that changes, we should "
60 "probably change the body of FVQpFluxBC::uOnGhost");
61
63 return _u_neighbor[_qp];
64 else
65 return _u[_qp];
66}
DualNumber< Real, DNDerivativeType, true > ADReal
MooseVariableFV< Real > & _var
const FaceInfo * _face_info
Holds information for the face we are currently examining.
Provides an interface for computing residual contributions from finite volume numerical fluxes comput...
Definition FVFluxBC.h:27
const unsigned int _qp
Definition FVFluxBC.h:52
static InputParameters validParams()
Definition FVFluxBC.C:17
FVQpFluxBC(const InputParameters &params)
Definition FVQpFluxBC.C:21
const ADReal & uOnGhost() const
Definition FVQpFluxBC.C:48
const ADReal & uOnUSub() const
Definition FVQpFluxBC.C:27
const ADVariableValue & _u
Definition FVQpFluxBC.h:35
const ADVariableValue & _u_neighbor
Definition FVQpFluxBC.h:36
static InputParameters validParams()
Definition FVQpFluxBC.C:15
VarFaceNeighbors faceType(const std::pair< unsigned int, unsigned int > &var_sys) const
Returns which side(s) the given variable-system number pair is defined on for this face.
Definition FaceInfo.h:229
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system.
const std::string & name() const
Get the name of the class.
Definition MooseBase.h:103
SystemBase & sys()
Get the system this variable is part of.
unsigned int number() const
Get variable number coming from libMesh.
unsigned int number() const
Gets the number of this system.