forked from idaholab/moose
/
INSFVVariable.C
58 lines (49 loc) · 1.84 KB
/
INSFVVariable.C
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
//* This file is part of the MOOSE framework
//* https://www.mooseframework.org
//*
//* All rights reserved, see COPYRIGHT for full restrictions
//* https://github.com/idaholab/moose/blob/master/COPYRIGHT
//*
//* Licensed under LGPL 2.1, please see LICENSE for details
//* https://www.gnu.org/licenses/lgpl-2.1.html
#include "INSFVVariable.h"
#include "InputParameters.h"
#include "MooseError.h"
#include "INSFVFullyDevelopedFlowBC.h"
#include "Attributes.h"
#include "SubProblem.h"
#include "MooseApp.h"
#include "TheWarehouse.h"
#include "INSFVAttributes.h"
InputParameters
INSFVVariable::validParams()
{
return MooseVariableFVReal::validParams();
}
INSFVVariable::INSFVVariable(const InputParameters & params) : MooseVariableFVReal(params)
{
#ifndef MOOSE_GLOBAL_AD_INDEXING
mooseError("INSFV is not supported by local AD indexing. In order to use INSFV, please run the "
"configure script in the root MOOSE directory with the configure option "
"'--with-ad-indexing-type=global'");
#endif
}
bool
INSFVVariable::isFullyDevelopedFlowFace(const FaceInfo & fi) const
{
const auto & face_type = fi.faceType(this->name());
mooseAssert(face_type != FaceInfo::VarFaceNeighbors::NEITHER,
"I'm concerned that if you're calling this method with a FaceInfo that doesn't have "
"this variable defined on either side, that you are doing something dangerous.");
// If we're defined on both sides of the face, then we're not a boundary face
if (face_type == FaceInfo::VarFaceNeighbors::BOTH)
return false;
std::vector<INSFVFullyDevelopedFlowBC *> bcs;
this->_subproblem.getMooseApp()
.theWarehouse()
.query()
.template condition<AttribINSFVBCs>(INSFVBCs::INSFVFullyDevelopedFlowBC)
.template condition<AttribBoundaries>(fi.boundaryIDs())
.queryInto(bcs);
return !bcs.empty();
}