https://mooseframework.inl.gov
Loading...
Searching...
No Matches
FVBoundaryCondition.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 "FVBoundaryCondition.h"
11#include "Problem.h"
12#include "SystemBase.h"
13#include "MooseVariableFV.h"
14
15namespace
16{
18changeSystem(const InputParameters & params_in, MooseVariableFV<Real> & fv_var)
19{
20 SystemBase & var_sys = fv_var.sys();
21 auto & params = const_cast<InputParameters &>(params_in);
22 params.set<SystemBase *>("_sys") = &var_sys;
23 return var_sys;
24}
25}
26
29{
36
37 params.addRequiredParam<NonlinearVariableName>(
38 "variable", "The name of the variable that this boundary condition applies to");
39 params.addParam<bool>("use_displaced_mesh",
40 false,
41 "Whether or not this object should use the "
42 "displaced mesh for computation. Note that "
43 "in the case this is true but no "
44 "displacements are provided in the Mesh block "
45 "the undisplaced mesh will still be used.");
46
47 params.addParamNamesToGroup("use_displaced_mesh", "Advanced");
48 params.addCoupledVar("displacements", "The displacements");
49 params.declareControllable("enable");
50 params.registerBase("FVBoundaryCondition");
51 return params;
52}
53
55 : MooseObject(parameters),
57 SetupInterface(this),
65 MeshChangedInterface(parameters),
66 TaggingInterface(this),
67 MooseVariableInterface<Real>(this,
68 false,
69 "variable",
70 Moose::VarKindType::VAR_ANY,
71 Moose::VarFieldType::VAR_FIELD_STANDARD),
74 _var(*mooseVariableFV()),
75 _subproblem(*getCheckedPointerParam<SubProblem *>("_subproblem")),
76 _fv_problem(*getCheckedPointerParam<FEProblemBase *>("_fe_problem_base")),
77 _sys(changeSystem(parameters, _var)),
78 _tid(parameters.get<THREAD_ID>("_tid")),
79 _assembly(_subproblem.assembly(_tid, _var.kind() == Moose::VAR_SOLVER ? _sys.number() : 0)),
80 _mesh(_subproblem.mesh())
81{
84}
85
88 const Moose::FV::LimiterType limiter_type,
89 const bool correct_skewness,
90 const Moose::StateArg * state_limiter) const
91{
92 if (!fi)
93 fi = _face_info;
94
95 return makeFace(*fi, limiter_type, true, correct_skewness, state_limiter);
96}
97
98bool
99FVBoundaryCondition::hasFaceSide(const FaceInfo & fi, bool fi_elem_side) const
100{
101 const auto ft = fi.faceType(std::make_pair(_var.number(), _var.sys().number()));
102 if (fi_elem_side)
104 else
106}
unsigned int THREAD_ID
Definition MooseTypes.h:237
An interface for accessing Moose::Functors for systems that care about automatic differentiation,...
static InputParameters validParams()
A class for requiring an object to be boundary restricted.
Interface for objects that need to use distributions.
Specialization of SubProblem for solving nonlinear equations plus auxiliary equations.
static InputParameters validParams()
SubProblem & _subproblem
Reference to SubProblem.
MooseVariableFV< Real > & _var
const FaceInfo * _face_info
Holds information for the face we are currently examining.
Moose::FaceArg singleSidedFaceArg(const FaceInfo *fi=nullptr, Moose::FV::LimiterType limiter_type=Moose::FV::LimiterType::CentralDifference, bool correct_skewness=false, const Moose::StateArg *state_limiter=nullptr) const
Determine the single sided face argument when evaluating a functor on a face.
FVBoundaryCondition(const InputParameters &parameters)
Class constructor.
bool hasFaceSide(const FaceInfo &fi, bool fi_elem_side) const override
Moose::FaceArg makeFace(const FaceInfo &fi, const Moose::FV::LimiterType limiter_type, const bool elem_is_upwind, const bool correct_skewness=false, const Moose::StateArg *state_limiter=nullptr) const
Create a functor face argument from provided component arguments.
This data structure is used to store geometric and variable related metadata about each cell face in ...
Definition FaceInfo.h:38
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
Interface for objects that need to use functions.
static InputParameters validParams()
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system.
void declareControllable(const std::string &name, std::set< ExecFlagType > execute_flags={})
Declare the given parameters as controllable.
void addParamNamesToGroup(const std::string &space_delim_names, const std::string group_name)
This method takes a space delimited list of parameter names and adds them to the specified group name...
void addParam(const std::string &name, const S &value, const std::string &doc_string)
These methods add an optional parameter and a documentation string to the InputParameters object.
void addRequiredParam(const std::string &name, const std::string &doc_string)
This method adds a parameter and documentation string to the InputParameters object that will be extr...
void registerBase(const std::string &value)
This method must be called from every base "Moose System" to create linkage with the Action System.
T & set(const std::string &name, bool quiet_mode=false)
Returns a writable reference to the named parameters.
void addCoupledVar(const std::string &name, const std::string &doc_string)
This method adds a coupled variable name pair.
Interface for notifications that the mesh has changed.
Every object that can be built by the factory should be derived from this class.
Definition MooseObject.h:31
static InputParameters validParams()
Definition MooseObject.C:25
SystemBase & sys()
Get the system this variable is part of.
unsigned int number() const
Get variable number coming from libMesh.
void addMooseVariableDependency(MooseVariableFieldBase *var)
Call this function to add the passed in MooseVariableFieldBase as a variable that this object depends...
This class provides variable solution values for other classes/objects to bind to when looping over f...
Interface for objects that need to get values of MooseVariables.
Interface class for classes which interact with Postprocessors.
Generic class for solving transient nonlinear problems.
Definition SubProblem.h:79
virtual void haveADObjects(bool have_ad_objects)
Method for setting whether we have any ad objects.
Definition SubProblem.h:775
Base class for a system (of equations)
Definition SystemBase.h:87
unsigned int number() const
Gets the number of this system.
static InputParameters validParams()
Interface for objects that needs transient capabilities.
static InputParameters validParams()
Interface for objects that need to use UserObjects.
MeshBase & mesh
MOOSE now contains C++17 code, so give a reasonable error message stating what the user can do to add...
A structure defining a "face" evaluation calling argument for Moose functors.
State argument for evaluating functors.